aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-09-12 07:02:26 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-12 07:02:26 -0400
commitddd559b13f6d2fe3ad68c4b3f5235fd3c2eae4e3 (patch)
treed827bca3fc825a0ac33efbcd493713be40fcc812
parentcf7a2b4fb6a9b86779930a0a123b0df41aa9208f (diff)
parentf17a1f06d2fa93f4825be572622eb02c4894db4e (diff)
Merge branch 'devel-stable' into devel
Conflicts: MAINTAINERS arch/arm/mm/fault.c
-rw-r--r--CREDITS8
-rw-r--r--Documentation/RCU/rculist_nulls.txt7
-rw-r--r--Documentation/arm/Samsung-S3C24XX/CPUfreq.txt75
-rw-r--r--Documentation/connector/cn_test.c4
-rw-r--r--Documentation/connector/ucon.c2
-rw-r--r--Documentation/driver-model/driver.txt4
-rw-r--r--Documentation/filesystems/sysfs.txt3
-rw-r--r--Documentation/lguest/lguest.c721
-rw-r--r--Documentation/networking/6pack.txt2
-rw-r--r--Documentation/scheduler/sched-rt-group.txt13
-rw-r--r--Documentation/sound/alsa/Procfile.txt5
-rw-r--r--Documentation/sysrq.txt7
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx2
-rw-r--r--Documentation/video4linux/gspca.txt32
-rw-r--r--MAINTAINERS2803
-rw-r--r--Makefile7
-rw-r--r--arch/alpha/include/asm/tlb.h4
-rw-r--r--arch/alpha/kernel/ptrace.c1
-rw-r--r--arch/arm/Kconfig231
-rw-r--r--arch/arm/Kconfig.debug1
-rw-r--r--arch/arm/Makefile16
-rw-r--r--arch/arm/boot/Makefile9
-rw-r--r--arch/arm/boot/compressed/head.S184
-rw-r--r--arch/arm/common/vic.c95
-rw-r--r--arch/arm/configs/nhk8815_defconfig1316
-rw-r--r--arch/arm/configs/s5pc100_defconfig892
-rw-r--r--arch/arm/configs/u300_defconfig18
-rw-r--r--arch/arm/include/asm/assembler.h133
-rw-r--r--arch/arm/include/asm/elf.h3
-rw-r--r--arch/arm/include/asm/ftrace.h1
-rw-r--r--arch/arm/include/asm/futex.h1
-rw-r--r--arch/arm/include/asm/memory.h6
-rw-r--r--arch/arm/include/asm/mmu_context.h2
-rw-r--r--arch/arm/include/asm/page-nommu.h3
-rw-r--r--arch/arm/include/asm/ptrace.h8
-rw-r--r--arch/arm/include/asm/tlb.h4
-rw-r--r--arch/arm/include/asm/uaccess.h7
-rw-r--r--arch/arm/include/asm/unified.h126
-rw-r--r--arch/arm/kernel/armksyms.c1
-rw-r--r--arch/arm/kernel/entry-armv.S179
-rw-r--r--arch/arm/kernel/entry-common.S47
-rw-r--r--arch/arm/kernel/entry-header.S92
-rw-r--r--arch/arm/kernel/head-common.S15
-rw-r--r--arch/arm/kernel/head-nommu.S16
-rw-r--r--arch/arm/kernel/head.S28
-rw-r--r--arch/arm/kernel/irq.c2
-rw-r--r--arch/arm/kernel/module.c53
-rw-r--r--arch/arm/kernel/process.c2
-rw-r--r--arch/arm/kernel/ptrace.c8
-rw-r--r--arch/arm/kernel/setup.c28
-rw-r--r--arch/arm/kernel/unwind.c4
-rw-r--r--arch/arm/lib/ashldi3.S4
-rw-r--r--arch/arm/lib/ashrdi3.S4
-rw-r--r--arch/arm/lib/backtrace.S8
-rw-r--r--arch/arm/lib/bitops.h2
-rw-r--r--arch/arm/lib/clear_user.S15
-rw-r--r--arch/arm/lib/copy_from_user.S19
-rw-r--r--arch/arm/lib/copy_template.S24
-rw-r--r--arch/arm/lib/copy_to_user.S19
-rw-r--r--arch/arm/lib/csumpartialcopyuser.S48
-rw-r--r--arch/arm/lib/div64.S4
-rw-r--r--arch/arm/lib/findbit.S34
-rw-r--r--arch/arm/lib/getuser.S5
-rw-r--r--arch/arm/lib/io-writesw-armv4.S5
-rw-r--r--arch/arm/lib/lshrdi3.S4
-rw-r--r--arch/arm/lib/memcpy.S7
-rw-r--r--arch/arm/lib/memmove.S28
-rw-r--r--arch/arm/lib/putuser.S15
-rw-r--r--arch/arm/lib/sha1.S2
-rw-r--r--arch/arm/lib/strncpy_from_user.S2
-rw-r--r--arch/arm/lib/strnlen_user.S2
-rw-r--r--arch/arm/mach-at91/include/mach/at_hdmac.h102
-rw-r--r--arch/arm/mach-ep93xx/dma-m2p.c1
-rw-r--r--arch/arm/mach-integrator/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c16
-rw-r--r--arch/arm/mach-kirkwood/Kconfig6
-rw-r--r--arch/arm/mach-kirkwood/Makefile1
-rw-r--r--arch/arm/mach-kirkwood/common.c5
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h1
-rw-r--r--arch/arm/mach-kirkwood/mpp.h2
-rw-r--r--arch/arm/mach-kirkwood/openrd_base-setup.c84
-rw-r--r--arch/arm/mach-mx1/clock.c86
-rw-r--r--arch/arm/mach-mx1/devices.c87
-rw-r--r--arch/arm/mach-mx1/generic.c7
-rw-r--r--arch/arm/mach-mx1/mx1ads.c10
-rw-r--r--arch/arm/mach-mx1/scb9328.c16
-rw-r--r--arch/arm/mach-mx2/Kconfig35
-rw-r--r--arch/arm/mach-mx2/Makefile3
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c2
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c11
-rw-r--r--arch/arm/mach-mx2/devices.c332
-rw-r--r--arch/arm/mach-mx2/devices.h9
-rw-r--r--arch/arm/mach-mx2/eukrea_cpuimx27.c234
-rw-r--r--arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c249
-rw-r--r--arch/arm/mach-mx2/generic.c12
-rw-r--r--arch/arm/mach-mx2/mx21ads.c44
-rw-r--r--arch/arm/mach-mx2/mx27ads.c38
-rw-r--r--arch/arm/mach-mx2/mx27lite.c2
-rw-r--r--arch/arm/mach-mx2/mx27pdk.c2
-rw-r--r--arch/arm/mach-mx2/pca100.c244
-rw-r--r--arch/arm/mach-mx2/pcm038.c17
-rw-r--r--arch/arm/mach-mx2/pcm970-baseboard.c112
-rw-r--r--arch/arm/mach-mx25/Kconfig9
-rw-r--r--arch/arm/mach-mx25/Makefile3
-rw-r--r--arch/arm/mach-mx25/Makefile.boot3
-rw-r--r--arch/arm/mach-mx25/clock.c219
-rw-r--r--arch/arm/mach-mx25/devices.c402
-rw-r--r--arch/arm/mach-mx25/devices.h19
-rw-r--r--arch/arm/mach-mx25/mm.c76
-rw-r--r--arch/arm/mach-mx25/mx25pdk.c58
-rw-r--r--arch/arm/mach-mx3/Kconfig8
-rw-r--r--arch/arm/mach-mx3/Makefile1
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c65
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c22
-rw-r--r--arch/arm/mach-mx3/clock.c22
-rw-r--r--arch/arm/mach-mx3/devices.c163
-rw-r--r--arch/arm/mach-mx3/devices.h6
-rw-r--r--arch/arm/mach-mx3/mm.c14
-rw-r--r--arch/arm/mach-mx3/mx31ads.c2
-rw-r--r--arch/arm/mach-mx3/mx31lilly.c2
-rw-r--r--arch/arm/mach-mx3/mx31lite.c7
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c43
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c55
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c134
-rw-r--r--arch/arm/mach-mx3/mx31pdk.c2
-rw-r--r--arch/arm/mach-mx3/mx35pdk.c2
-rw-r--r--arch/arm/mach-mx3/pcm037.c225
-rw-r--r--arch/arm/mach-mx3/pcm037.h11
-rw-r--r--arch/arm/mach-mx3/pcm037_eet.c204
-rw-r--r--arch/arm/mach-mx3/pcm043.c8
-rw-r--r--arch/arm/mach-mx3/qong.c7
-rw-r--r--arch/arm/mach-mxc91231/Kconfig11
-rw-r--r--arch/arm/mach-mxc91231/Makefile2
-rw-r--r--arch/arm/mach-mxc91231/Makefile.boot3
-rw-r--r--arch/arm/mach-mxc91231/clock.c642
-rw-r--r--arch/arm/mach-mxc91231/crm_regs.h399
-rw-r--r--arch/arm/mach-mxc91231/devices.c251
-rw-r--r--arch/arm/mach-mxc91231/devices.h13
-rw-r--r--arch/arm/mach-mxc91231/iomux.c177
-rw-r--r--arch/arm/mach-mxc91231/magx-zn5.c63
-rw-r--r--arch/arm/mach-mxc91231/mm.c94
-rw-r--r--arch/arm/mach-mxc91231/system.c51
-rw-r--r--arch/arm/mach-netx/include/mach/entry-macro.S4
-rw-r--r--arch/arm/mach-nomadik/Kconfig21
-rw-r--r--arch/arm/mach-nomadik/Makefile19
-rw-r--r--arch/arm/mach-nomadik/Makefile.boot4
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c111
-rw-r--r--arch/arm/mach-nomadik/clock.c45
-rw-r--r--arch/arm/mach-nomadik/clock.h14
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c139
-rw-r--r--arch/arm/mach-nomadik/gpio.c396
-rw-r--r--arch/arm/mach-nomadik/i2c-8815nhk.c65
-rw-r--r--arch/arm/mach-nomadik/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-nomadik/include/mach/debug-macro.S22
-rw-r--r--arch/arm/mach-nomadik/include/mach/entry-macro.S43
-rw-r--r--arch/arm/mach-nomadik/include/mach/gpio.h71
-rw-r--r--arch/arm/mach-nomadik/include/mach/hardware.h90
-rw-r--r--arch/arm/mach-nomadik/include/mach/io.h22
-rw-r--r--arch/arm/mach-nomadik/include/mach/irqs.h82
-rw-r--r--arch/arm/mach-nomadik/include/mach/memory.h28
-rw-r--r--arch/arm/mach-nomadik/include/mach/mtu.h45
-rw-r--r--arch/arm/mach-nomadik/include/mach/setup.h22
-rw-r--r--arch/arm/mach-nomadik/include/mach/system.h45
-rw-r--r--arch/arm/mach-nomadik/include/mach/timex.h6
-rw-r--r--arch/arm/mach-nomadik/include/mach/uncompress.h63
-rw-r--r--arch/arm/mach-nomadik/include/mach/vmalloc.h2
-rw-r--r--arch/arm/mach-nomadik/timer.c164
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c2
-rw-r--r--arch/arm/mach-omap2/board-overo.c1
-rw-r--r--arch/arm/mach-omap2/cm.h6
-rw-r--r--arch/arm/mach-omap2/mcbsp.c41
-rw-r--r--arch/arm/mach-omap2/pm.h3
-rw-r--r--arch/arm/mach-omap2/pm24xx.c2
-rw-r--r--arch/arm/mach-omap2/pm34xx.c51
-rw-r--r--arch/arm/mach-omap2/serial.c207
-rw-r--r--arch/arm/mach-orion5x/Kconfig21
-rw-r--r--arch/arm/mach-orion5x/Makefile3
-rw-r--r--arch/arm/mach-orion5x/addr-map.c3
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c365
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c431
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa300.h6
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c2
-rw-r--r--arch/arm/mach-realview/Kconfig2
-rw-r--r--arch/arm/mach-realview/core.c3
-rw-r--r--arch/arm/mach-realview/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-realview/platsmp.c18
-rw-r--r--arch/arm/mach-s3c2410/Kconfig18
-rw-r--r--arch/arm/mach-s3c2410/Makefile2
-rw-r--r--arch/arm/mach-s3c2410/cpu-freq.c159
-rw-r--r--arch/arm/mach-s3c2410/dma.c11
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-core.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/irqs.h6
-rw-r--r--arch/arm/mach-s3c2410/include/mach/map.h8
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-gpio.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-mem.h10
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h23
-rw-r--r--arch/arm/mach-s3c2410/include/mach/spi.h3
-rw-r--r--arch/arm/mach-s3c2410/irq.c15
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c41
-rw-r--r--arch/arm/mach-s3c2410/pll.c95
-rw-r--r--arch/arm/mach-s3c2410/pm.c12
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c29
-rw-r--r--arch/arm/mach-s3c2412/Kconfig9
-rw-r--r--arch/arm/mach-s3c2412/Makefile1
-rw-r--r--arch/arm/mach-s3c2412/cpu-freq.c257
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c12
-rw-r--r--arch/arm/mach-s3c2440/Kconfig7
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c9
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/map.h1
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h8
-rw-r--r--arch/arm/mach-s3c6400/s3c6400.c2
-rw-r--r--arch/arm/mach-s3c6410/Kconfig10
-rw-r--r--arch/arm/mach-s3c6410/Makefile3
-rw-r--r--arch/arm/mach-s3c6410/cpu.c2
-rw-r--r--arch/arm/mach-s3c6410/mach-hmt.c276
-rw-r--r--arch/arm/mach-s3c6410/mach-ncp.c2
-rw-r--r--arch/arm/mach-s3c6410/mach-smdk6410.c26
-rw-r--r--arch/arm/mach-s5pc100/Kconfig22
-rw-r--r--arch/arm/mach-s5pc100/Makefile17
-rw-r--r--arch/arm/mach-s5pc100/Makefile.boot2
-rw-r--r--arch/arm/mach-s5pc100/cpu.c97
-rw-r--r--arch/arm/mach-s5pc100/include/mach/debug-macro.S38
-rw-r--r--arch/arm/mach-s5pc100/include/mach/entry-macro.S50
-rw-r--r--arch/arm/mach-s5pc100/include/mach/gpio-core.h21
-rw-r--r--arch/arm/mach-s5pc100/include/mach/gpio.h146
-rw-r--r--arch/arm/mach-s5pc100/include/mach/hardware.h14
-rw-r--r--arch/arm/mach-s5pc100/include/mach/irqs.h14
-rw-r--r--arch/arm/mach-s5pc100/include/mach/map.h75
-rw-r--r--arch/arm/mach-s5pc100/include/mach/memory.h18
-rw-r--r--arch/arm/mach-s5pc100/include/mach/pwm-clock.h56
-rw-r--r--arch/arm/mach-s5pc100/include/mach/regs-irq.h24
-rw-r--r--arch/arm/mach-s5pc100/include/mach/system.h24
-rw-r--r--arch/arm/mach-s5pc100/include/mach/tick.h29
-rw-r--r--arch/arm/mach-s5pc100/include/mach/uncompress.h28
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c103
-rw-r--r--arch/arm/mach-u300/core.c4
-rw-r--r--arch/arm/mach-versatile/core.c3
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/alignment.c20
-rw-r--r--arch/arm/mm/cache-v7.S16
-rw-r--r--arch/arm/mm/dma-mapping.c94
-rw-r--r--arch/arm/mm/fault.c23
-rw-r--r--arch/arm/mm/nommu.c1
-rw-r--r--arch/arm/mm/proc-macros.S2
-rw-r--r--arch/arm/mm/proc-v7.S7
-rw-r--r--arch/arm/plat-mxc/Kconfig17
-rw-r--r--arch/arm/plat-mxc/clock.c170
-rw-r--r--arch/arm/plat-mxc/gpio.c42
-rw-r--r--arch/arm/plat-mxc/include/mach/board-armadillo5x0.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx27.h40
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx21ads.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27ads.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27lite.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27pdk.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31ads.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lilly.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lite.h3
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31moboard.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31pdk.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx35pdk.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-pcm037.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-pcm038.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-pcm043.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/board-qong.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h19
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S68
-rw-r--r--arch/arm/plat-mxc/include/mach/entry-macro.S3
-rw-r--r--arch/arm/plat-mxc/include/mach/hardware.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/imxfb.h29
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx25.h517
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mxc91231.h287
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h35
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h22
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h44
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2x.h18
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h1
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h21
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc.h28
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc91231.h315
-rw-r--r--arch/arm/plat-mxc/include/mach/system.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/timex.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h68
-rw-r--r--arch/arm/plat-mxc/iomux-v3.c15
-rw-r--r--arch/arm/plat-mxc/irq.c6
-rw-r--r--arch/arm/plat-mxc/pwm.c19
-rw-r--r--arch/arm/plat-mxc/system.c29
-rw-r--r--arch/arm/plat-mxc/time.c39
-rw-r--r--arch/arm/plat-omap/cpu-omap.c8
-rw-r--r--arch/arm/plat-omap/gpio.c255
-rw-r--r--arch/arm/plat-omap/include/mach/dma.h88
-rw-r--r--arch/arm/plat-omap/include/mach/mcbsp.h8
-rw-r--r--arch/arm/plat-omap/include/mach/serial.h1
-rw-r--r--arch/arm/plat-omap/mcbsp.c2
-rw-r--r--arch/arm/plat-pxa/gpio.c9
-rw-r--r--arch/arm/plat-s3c/Kconfig5
-rw-r--r--arch/arm/plat-s3c/Makefile6
-rw-r--r--arch/arm/plat-s3c/dev-nand.c30
-rw-r--r--arch/arm/plat-s3c/include/plat/adc.h8
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu-freq.h87
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu.h1
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h3
-rw-r--r--arch/arm/plat-s3c/include/plat/hwmon.h41
-rw-r--r--arch/arm/plat-s3c/include/plat/map-base.h8
-rw-r--r--arch/arm/plat-s3c/pwm.c (renamed from arch/arm/plat-s3c24xx/pwm.c)5
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig66
-rw-r--r--arch/arm/plat-s3c24xx/Makefile12
-rw-r--r--arch/arm/plat-s3c24xx/adc.c64
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq-debugfs.c199
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq.c716
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c2
-rw-r--r--arch/arm/plat-s3c24xx/devs.c71
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h282
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/fiq.h13
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/s3c2410.h1
-rw-r--r--arch/arm/plat-s3c24xx/irq.c36
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c64
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-iotiming.c477
-rw-r--r--arch/arm/plat-s3c24xx/s3c2412-iotiming.c285
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-cpufreq.c311
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c97
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c127
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c38
-rw-r--r--arch/arm/plat-s3c64xx/Kconfig1
-rw-r--r--arch/arm/plat-s3c64xx/Makefile3
-rw-r--r--arch/arm/plat-s3c64xx/dev-audio.c (renamed from arch/arm/plat-s3c/dev-audio.c)0
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-clock.c4
-rw-r--r--arch/arm/plat-s5pc1xx/Kconfig50
-rw-r--r--arch/arm/plat-s5pc1xx/Makefile26
-rw-r--r--arch/arm/plat-s5pc1xx/cpu.c112
-rw-r--r--arch/arm/plat-s5pc1xx/dev-uart.c174
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/irqs.h182
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/pll.h38
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-clock.h421
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/s5pc100.h65
-rw-r--r--arch/arm/plat-s5pc1xx/irq.c259
-rw-r--r--arch/arm/plat-s5pc1xx/s5pc100-clock.c1139
-rw-r--r--arch/arm/plat-s5pc1xx/s5pc100-init.c27
-rw-r--r--arch/arm/plat-s5pc1xx/setup-i2c0.c25
-rw-r--r--arch/arm/plat-s5pc1xx/setup-i2c1.c25
-rw-r--r--arch/arm/vfp/entry.S2
-rw-r--r--arch/arm/vfp/vfphw.S48
-rw-r--r--arch/avr32/include/asm/pgalloc.h2
-rw-r--r--arch/blackfin/include/asm/context.S7
-rw-r--r--arch/blackfin/include/asm/cpu.h1
-rw-r--r--arch/blackfin/include/asm/hardirq.h3
-rw-r--r--arch/blackfin/include/asm/processor.h21
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c29
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c6
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c23
-rw-r--r--arch/blackfin/kernel/process.c14
-rw-r--r--arch/blackfin/kernel/ptrace.c1
-rw-r--r--arch/blackfin/kernel/setup.c44
-rw-r--r--arch/blackfin/kernel/sys_bfin.c1
-rw-r--r--arch/blackfin/kernel/traps.c9
-rw-r--r--arch/blackfin/lib/lshrdi3.c16
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h4
-rw-r--r--arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c2
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c4
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/mem_map.h23
-rw-r--r--arch/blackfin/mach-common/entry.S12
-rw-r--r--arch/blackfin/mach-common/smp.c10
-rw-r--r--arch/cris/include/asm/pgalloc.h2
-rw-r--r--arch/cris/kernel/sys_cris.c1
-rw-r--r--arch/frv/include/asm/pgalloc.h4
-rw-r--r--arch/frv/include/asm/pgtable.h2
-rw-r--r--arch/ia64/include/asm/fpu.h2
-rw-r--r--arch/ia64/include/asm/pgalloc.h6
-rw-r--r--arch/ia64/include/asm/tlb.h12
-rw-r--r--arch/ia64/include/asm/xen/hypervisor.h1
-rw-r--r--arch/ia64/kernel/dma-mapping.c8
-rw-r--r--arch/ia64/kernel/ptrace.c1
-rw-r--r--arch/m32r/include/asm/pgalloc.h4
-rw-r--r--arch/m32r/kernel/ptrace.c1
-rw-r--r--arch/m68k/include/asm/motorola_pgalloc.h6
-rw-r--r--arch/m68k/include/asm/sun3_pgalloc.h4
-rw-r--r--arch/microblaze/Makefile35
-rw-r--r--arch/microblaze/include/asm/io.h1
-rw-r--r--arch/microblaze/include/asm/pgalloc.h4
-rw-r--r--arch/microblaze/include/asm/pgtable.h6
-rw-r--r--arch/microblaze/include/asm/prom.h23
-rw-r--r--arch/microblaze/include/asm/tlb.h2
-rw-r--r--arch/microblaze/include/asm/uaccess.h2
-rw-r--r--arch/microblaze/kernel/Makefile2
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c2
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-static.c2
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo.c2
-rw-r--r--arch/microblaze/kernel/head.S17
-rw-r--r--arch/microblaze/kernel/hw_exception_handler.S109
-rw-r--r--arch/microblaze/kernel/module.c19
-rw-r--r--arch/microblaze/kernel/ptrace.c1
-rw-r--r--arch/microblaze/kernel/setup.c8
-rw-r--r--arch/microblaze/kernel/signal.c1
-rw-r--r--arch/microblaze/kernel/sys_microblaze.c100
-rw-r--r--arch/microblaze/kernel/syscall_table.S2
-rw-r--r--arch/microblaze/mm/fault.c15
-rw-r--r--arch/mips/include/asm/pgalloc.h15
-rw-r--r--arch/mips/kernel/ptrace32.c1
-rw-r--r--arch/mips/mm/hugetlbpage.c1
-rw-r--r--arch/mn10300/include/asm/pgalloc.h2
-rw-r--r--arch/mn10300/kernel/ptrace.c1
-rw-r--r--arch/mn10300/kernel/signal.c1
-rw-r--r--arch/mn10300/kernel/sys_mn10300.c2
-rw-r--r--arch/mn10300/kernel/traps.c1
-rw-r--r--arch/mn10300/kernel/vmlinux.lds.S2
-rw-r--r--arch/mn10300/mm/fault.c1
-rw-r--r--arch/mn10300/mm/misalignment.c1
-rw-r--r--arch/parisc/include/asm/tlb.h4
-rw-r--r--arch/powerpc/boot/dts/mpc8377_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8378_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8379_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts4
-rw-r--r--arch/powerpc/configs/83xx/asp8347_defconfig106
-rw-r--r--arch/powerpc/configs/83xx/kmeter1_defconfig176
-rw-r--r--arch/powerpc/configs/83xx/mpc8313_rdb_defconfig168
-rw-r--r--arch/powerpc/configs/83xx/mpc8315_rdb_defconfig168
-rw-r--r--arch/powerpc/configs/83xx/mpc832x_mds_defconfig111
-rw-r--r--arch/powerpc/configs/83xx/mpc832x_rdb_defconfig120
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_itx_defconfig114
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig114
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_mds_defconfig104
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_mds_defconfig111
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_rdk_defconfig104
-rw-r--r--arch/powerpc/configs/83xx/mpc837x_mds_defconfig110
-rw-r--r--arch/powerpc/configs/83xx/mpc837x_rdb_defconfig162
-rw-r--r--arch/powerpc/configs/83xx/sbc834x_defconfig103
-rw-r--r--arch/powerpc/configs/85xx/ksi8560_defconfig93
-rw-r--r--arch/powerpc/configs/85xx/mpc8540_ads_defconfig91
-rw-r--r--arch/powerpc/configs/85xx/mpc8560_ads_defconfig99
-rw-r--r--arch/powerpc/configs/85xx/mpc85xx_cds_defconfig99
-rw-r--r--arch/powerpc/configs/85xx/sbc8548_defconfig96
-rw-r--r--arch/powerpc/configs/85xx/sbc8560_defconfig91
-rw-r--r--arch/powerpc/configs/85xx/socrates_defconfig165
-rw-r--r--arch/powerpc/configs/85xx/stx_gp3_defconfig119
-rw-r--r--arch/powerpc/configs/85xx/tqm8540_defconfig100
-rw-r--r--arch/powerpc/configs/85xx/tqm8541_defconfig101
-rw-r--r--arch/powerpc/configs/85xx/tqm8548_defconfig100
-rw-r--r--arch/powerpc/configs/85xx/tqm8555_defconfig101
-rw-r--r--arch/powerpc/configs/85xx/tqm8560_defconfig101
-rw-r--r--arch/powerpc/configs/85xx/xes_mpc85xx_defconfig118
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig521
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc310_defconfig216
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig130
-rw-r--r--arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig118
-rw-r--r--arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig186
-rw-r--r--arch/powerpc/configs/86xx/sbc8641d_defconfig112
-rw-r--r--arch/powerpc/configs/adder875_defconfig97
-rw-r--r--arch/powerpc/configs/c2k_defconfig121
-rw-r--r--arch/powerpc/configs/ep8248e_defconfig97
-rw-r--r--arch/powerpc/configs/ep88xc_defconfig91
-rw-r--r--arch/powerpc/configs/linkstation_defconfig116
-rw-r--r--arch/powerpc/configs/mgcoge_defconfig97
-rw-r--r--arch/powerpc/configs/mgsuvd_defconfig89
-rw-r--r--arch/powerpc/configs/mpc7448_hpc2_defconfig103
-rw-r--r--arch/powerpc/configs/mpc8272_ads_defconfig104
-rw-r--r--arch/powerpc/configs/mpc83xx_defconfig162
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig193
-rw-r--r--arch/powerpc/configs/mpc85xx_smp_defconfig193
-rw-r--r--arch/powerpc/configs/mpc866_ads_defconfig92
-rw-r--r--arch/powerpc/configs/mpc86xx_defconfig186
-rw-r--r--arch/powerpc/configs/mpc885_ads_defconfig91
-rw-r--r--arch/powerpc/configs/pq2fads_defconfig110
-rw-r--r--arch/powerpc/configs/prpmc2800_defconfig158
-rw-r--r--arch/powerpc/configs/storcenter_defconfig108
-rw-r--r--arch/powerpc/include/asm/pgalloc-32.h2
-rw-r--r--arch/powerpc/include/asm/pgalloc-64.h4
-rw-r--r--arch/powerpc/include/asm/pgalloc.h6
-rw-r--r--arch/powerpc/kernel/ptrace.c17
-rw-r--r--arch/powerpc/kernel/ptrace32.c1
-rw-r--r--arch/powerpc/kernel/vector.S6
-rw-r--r--arch/powerpc/mm/hugetlbpage.c4
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c13
-rw-r--r--arch/s390/include/asm/tlb.h9
-rw-r--r--arch/s390/kernel/dis.c1
-rw-r--r--arch/s390/kernel/early.c4
-rw-r--r--arch/s390/kernel/ptrace.c1
-rw-r--r--arch/s390/kernel/smp.c7
-rw-r--r--arch/s390/kernel/vdso64/clock_gettime.S11
-rw-r--r--arch/s390/mm/fault.c1
-rw-r--r--arch/s390/power/swsusp.c36
-rw-r--r--arch/s390/power/swsusp_asm64.S35
-rw-r--r--arch/sh/include/asm/pgalloc.h10
-rw-r--r--arch/sh/include/asm/tlb.h6
-rw-r--r--arch/sh/mm/tlb-sh3.c1
-rw-r--r--arch/sparc/include/asm/pgalloc_32.h8
-rw-r--r--arch/sparc/include/asm/tlb_64.h6
-rw-r--r--arch/sparc/kernel/ptrace_32.c1
-rw-r--r--arch/sparc/kernel/ptrace_64.c1
-rw-r--r--arch/sparc/kernel/time_64.c1
-rw-r--r--arch/sparc/kernel/traps_32.c1
-rw-r--r--arch/sparc/kernel/vio.c7
-rw-r--r--arch/um/include/asm/pgalloc.h4
-rw-r--r--arch/um/include/asm/tlb.h6
-rw-r--r--arch/x86/include/asm/io_apic.h2
-rw-r--r--arch/x86/include/asm/lguest.h3
-rw-r--r--arch/x86/include/asm/lguest_hcall.h18
-rw-r--r--arch/x86/include/asm/pgalloc.h25
-rw-r--r--arch/x86/include/asm/uaccess.h4
-rw-r--r--arch/x86/include/asm/uaccess_64.h10
-rw-r--r--arch/x86/kernel/apic/es7000_32.c3
-rw-r--r--arch/x86/kernel/apic/io_apic.c14
-rw-r--r--arch/x86/kernel/apic/numaq_32.c3
-rw-r--r--arch/x86/kernel/cpu/amd.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c6
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c253
-rw-r--r--arch/x86/kernel/irqinit.c2
-rw-r--r--arch/x86/kernel/mfgpt_32.c2
-rw-r--r--arch/x86/kernel/pvclock.c2
-rw-r--r--arch/x86/kernel/reboot.c8
-rw-r--r--arch/x86/kernel/setup.c13
-rw-r--r--arch/x86/kernel/vmlinux.lds.S7
-rw-r--r--arch/x86/lguest/boot.c510
-rw-r--r--arch/x86/lguest/i386_head.S112
-rw-r--r--arch/x86/mm/fault.c2
-rw-r--r--arch/x86/mm/highmem_32.c1
-rw-r--r--arch/x86/mm/pgtable.c6
-rw-r--r--arch/x86/mm/srat_64.c6
-rw-r--r--arch/x86/pci/i386.c7
-rw-r--r--arch/xtensa/include/asm/tlb.h2
-rw-r--r--block/blk-core.c19
-rw-r--r--block/blk-integrity.c1
-rw-r--r--block/blk-settings.c7
-rw-r--r--block/blk-sysfs.c11
-rw-r--r--block/elevator.c13
-rw-r--r--crypto/async_tx/async_xor.c2
-rw-r--r--drivers/acpi/sleep.c8
-rw-r--r--drivers/ata/ahci.c5
-rw-r--r--drivers/ata/ata_piix.c3
-rw-r--r--drivers/ata/libata-core.c50
-rw-r--r--drivers/ata/libata-eh.c6
-rw-r--r--drivers/ata/pata_at91.c70
-rw-r--r--drivers/ata/pata_octeon_cf.c3
-rw-r--r--drivers/ata/pata_pcmcia.c1
-rw-r--r--drivers/ata/sata_mv.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/base/devres.c3
-rw-r--r--drivers/base/firmware_class.c7
-rw-r--r--drivers/base/sys.c2
-rw-r--r--drivers/block/DAC960.c1
-rw-r--r--drivers/block/ataflop.c2
-rw-r--r--drivers/block/cciss.c1
-rw-r--r--drivers/block/loop.c1
-rw-r--r--drivers/block/mg_disk.c101
-rw-r--r--drivers/block/virtio_blk.c12
-rw-r--r--drivers/block/z2ram.c2
-rw-r--r--drivers/bluetooth/hci_vhci.c1
-rw-r--r--drivers/char/amiserial.c1
-rw-r--r--drivers/char/cyclades.c1
-rw-r--r--drivers/char/epca.c1
-rw-r--r--drivers/char/hvc_console.c2
-rw-r--r--drivers/char/isicom.c1
-rw-r--r--drivers/char/istallion.c1
-rw-r--r--drivers/char/moxa.c1
-rw-r--r--drivers/char/mxser.c1
-rw-r--r--drivers/char/n_hdlc.c1
-rw-r--r--drivers/char/n_r3964.c1
-rw-r--r--drivers/char/n_tty.c4
-rw-r--r--drivers/char/nozomi.c16
-rw-r--r--drivers/char/pcmcia/ipwireless/tty.c4
-rw-r--r--drivers/char/pty.c1
-rw-r--r--drivers/char/rio/rio_linux.c1
-rw-r--r--drivers/char/riscom8.c1
-rw-r--r--drivers/char/rocket.c1
-rw-r--r--drivers/char/serial167.c1
-rw-r--r--drivers/char/specialix.c25
-rw-r--r--drivers/char/sx.c1
-rw-r--r--drivers/char/synclink.c1
-rw-r--r--drivers/char/synclink_gt.c1
-rw-r--r--drivers/char/synclinkmp.c1
-rw-r--r--drivers/char/sysrq.c8
-rw-r--r--drivers/char/tpm/tpm.c1
-rw-r--r--drivers/char/tty_buffer.c13
-rw-r--r--drivers/char/tty_ioctl.c1
-rw-r--r--drivers/char/tty_ldisc.c26
-rw-r--r--drivers/char/tty_port.c2
-rw-r--r--drivers/char/vc_screen.c4
-rw-r--r--drivers/char/vr41xx_giu.c0
-rw-r--r--drivers/char/vt.c13
-rw-r--r--drivers/char/vt_ioctl.c1
-rw-r--r--drivers/connector/cn_queue.c2
-rw-r--r--drivers/connector/connector.c4
-rw-r--r--drivers/dma/Kconfig12
-rw-r--r--drivers/dma/Makefile1
-rw-r--r--drivers/dma/at_hdmac.c1213
-rw-r--r--drivers/dma/at_hdmac_regs.h353
-rw-r--r--drivers/dma/dmatest.c21
-rw-r--r--drivers/dma/fsldma.c17
-rw-r--r--drivers/dma/fsldma.h1
-rw-r--r--drivers/dma/mv_xor.c2
-rw-r--r--drivers/edac/amd64_edac.c2
-rw-r--r--drivers/edac/x38_edac.c2
-rw-r--r--drivers/gpio/vr41xx_giu.c1
-rw-r--r--drivers/gpu/drm/drm_debugfs.c4
-rw-r--r--drivers/gpu/drm/drm_gem.c17
-rw-r--r--drivers/gpu/drm/drm_stub.c3
-rw-r--r--drivers/gpu/drm/radeon/Makefile3
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c293
-rw-r--r--drivers/gpu/drm/radeon/r100.c770
-rw-r--r--drivers/gpu/drm/radeon/r300.c78
-rw-r--r--drivers/gpu/drm/radeon/r300_reg.h4
-rw-r--r--drivers/gpu/drm/radeon/r500_reg.h2
-rw-r--r--drivers/gpu/drm/radeon/r520.c22
-rw-r--r--drivers/gpu/drm/radeon/r600.c5
-rw-r--r--drivers/gpu/drm/radeon/radeon.h87
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h32
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_benchmark.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_cursor.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c59
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c74
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_encoders.c359
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c70
-rw-r--r--drivers/gpu/drm/radeon/radeon_fence.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c45
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_crtc.c687
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_encoders.c188
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h51
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c158
-rw-r--r--drivers/gpu/drm/radeon/radeon_ring.c15
-rw-r--r--drivers/gpu/drm/radeon/radeon_share.h39
-rw-r--r--drivers/gpu/drm/radeon/radeon_test.c209
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c24
-rw-r--r--drivers/gpu/drm/radeon/rs400.c30
-rw-r--r--drivers/gpu/drm/radeon/rs600.c7
-rw-r--r--drivers/gpu/drm/radeon/rs690.c479
-rw-r--r--drivers/gpu/drm/radeon/rs690r.h99
-rw-r--r--drivers/gpu/drm/radeon/rv515.c798
-rw-r--r--drivers/gpu/drm/radeon/rv515r.h170
-rw-r--r--drivers/gpu/drm/radeon/rv770.c2
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c63
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c69
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_vm.c7
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c25
-rw-r--r--drivers/gpu/drm/via/via_irq.c6
-rw-r--r--drivers/hid/hid-core.c6
-rw-r--r--drivers/hid/usbhid/hid-core.c1
-rw-r--r--drivers/hid/usbhid/hiddev.c4
-rw-r--r--drivers/hwmon/Kconfig17
-rw-r--r--drivers/hwmon/Makefile1
-rw-r--r--drivers/hwmon/abituguru3.c6
-rw-r--r--drivers/hwmon/asus_atk0110.c6
-rw-r--r--drivers/hwmon/max6650.c1
-rw-r--r--drivers/hwmon/s3c-hwmon.c405
-rw-r--r--drivers/hwmon/sht15.c2
-rw-r--r--drivers/hwmon/smsc47m1.c11
-rw-r--r--drivers/i2c/busses/i2c-davinci.c26
-rw-r--r--drivers/i2c/busses/i2c-omap.c48
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c5
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c4
-rw-r--r--drivers/i2c/busses/i2c-simtec.c2
-rw-r--r--drivers/i2c/chips/tsl2550.c17
-rw-r--r--drivers/ide/ide-disk.c1
-rw-r--r--drivers/ide/ide-tape.c1
-rw-r--r--drivers/input/evdev.c3
-rw-r--r--drivers/input/joydev.c2
-rw-r--r--drivers/input/joystick/xpad.c26
-rw-r--r--drivers/input/keyboard/atkbd.c32
-rw-r--r--drivers/input/misc/pcspkr.c8
-rw-r--r--drivers/input/misc/wistron_btns.c9
-rw-r--r--drivers/isdn/gigaset/interface.c2
-rw-r--r--drivers/isdn/hisax/hfc_usb.c1
-rw-r--r--drivers/isdn/i4l/isdn_tty.c1
-rw-r--r--drivers/isdn/mISDN/l1oip_core.c4
-rw-r--r--drivers/isdn/mISDN/stack.c1
-rw-r--r--drivers/lguest/core.c119
-rw-r--r--drivers/lguest/hypercalls.c145
-rw-r--r--drivers/lguest/interrupts_and_traps.c288
-rw-r--r--drivers/lguest/lg.h34
-rw-r--r--drivers/lguest/lguest_device.c160
-rw-r--r--drivers/lguest/lguest_user.c232
-rw-r--r--drivers/lguest/page_tables.c489
-rw-r--r--drivers/lguest/segments.c106
-rw-r--r--drivers/lguest/x86/core.c374
-rw-r--r--drivers/lguest/x86/switcher_32.S22
-rw-r--r--drivers/md/dm-crypt.c2
-rw-r--r--drivers/md/dm-delay.c4
-rw-r--r--drivers/md/dm-linear.c2
-rw-r--r--drivers/md/dm-mpath.c2
-rw-r--r--drivers/md/dm-raid1.c3
-rw-r--r--drivers/md/dm-stripe.c7
-rw-r--r--drivers/md/dm-table.c15
-rw-r--r--drivers/md/dm.c10
-rw-r--r--drivers/md/dm.h1
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c67
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c1
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.h1
-rw-r--r--drivers/media/dvb/frontends/af9013.c25
-rw-r--r--drivers/media/dvb/ttpci/av7110.c1
-rw-r--r--drivers/media/radio/radio-mr800.c1
-rw-r--r--drivers/media/radio/radio-si470x.c1
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c92
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c2
-rw-r--r--drivers/media/video/bt8xx/bttv.h1
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c5
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c1
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c1
-rw-r--r--drivers/media/video/cx88/cx88-video.c1
-rw-r--r--drivers/media/video/dabusb.c1
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c134
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c22
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c62
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c16
-rw-r--r--drivers/media/video/em28xx/em28xx.h31
-rw-r--r--drivers/media/video/gspca/Kconfig16
-rw-r--r--drivers/media/video/gspca/Makefile2
-rw-r--r--drivers/media/video/gspca/conex.c2
-rw-r--r--drivers/media/video/gspca/gspca.c73
-rw-r--r--drivers/media/video/gspca/gspca.h9
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.c6
-rw-r--r--drivers/media/video/gspca/mars.c2
-rw-r--r--drivers/media/video/gspca/sn9c20x.c2434
-rw-r--r--drivers/media/video/gspca/sonixj.c4
-rw-r--r--drivers/media/video/gspca/spca500.c2
-rw-r--r--drivers/media/video/gspca/stk014.c2
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c16
-rw-r--r--drivers/media/video/gspca/sunplus.c2
-rw-r--r--drivers/media/video/gspca/zc3xx.c2
-rw-r--r--drivers/media/video/mt9v011.c69
-rw-r--r--drivers/media/video/pwc/pwc-if.c1
-rw-r--r--drivers/media/video/pwc/pwc.h1
-rw-r--r--drivers/media/video/s2255drv.c1
-rw-r--r--drivers/media/video/saa5246a.c1
-rw-r--r--drivers/media/video/saa5249.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c1
-rw-r--r--drivers/media/video/se401.c1
-rw-r--r--drivers/media/video/stk-webcam.c1
-rw-r--r--drivers/media/video/stradis.c1
-rw-r--r--drivers/media/video/stv680.c1
-rw-r--r--drivers/media/video/usbvideo/vicam.c1
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c1
-rw-r--r--drivers/media/video/v4l2-dev.c1
-rw-r--r--drivers/media/video/zoran/zoran_driver.c1
-rw-r--r--drivers/misc/cb710/sgbuf2.c4
-rw-r--r--drivers/misc/eeprom/at25.c4
-rw-r--r--drivers/misc/sgi-gru/grufile.c1
-rw-r--r--drivers/misc/sgi-gru/grukservices.c1
-rw-r--r--drivers/mmc/host/cb710-mmc.c6
-rw-r--r--drivers/mmc/host/imxmmc.c2
-rw-r--r--drivers/mmc/host/mmci.c6
-rw-r--r--drivers/mmc/host/mvsdio.c4
-rw-r--r--drivers/mmc/host/pxamci.c4
-rw-r--r--drivers/mmc/host/sdhci-of.c8
-rw-r--r--drivers/mmc/host/sdhci.c15
-rw-r--r--drivers/mmc/host/sdhci.h1
-rw-r--r--drivers/mtd/ubi/gluebi.c1
-rw-r--r--drivers/mtd/ubi/scan.c2
-rw-r--r--drivers/net/8139too.c1
-rw-r--r--drivers/net/Kconfig7
-rw-r--r--drivers/net/Makefile1
-rw-r--r--drivers/net/arm/Kconfig8
-rw-r--r--drivers/net/arm/Makefile1
-rw-r--r--drivers/net/arm/at91_ether.c3
-rw-r--r--drivers/net/arm/ixp4xx_eth.c4
-rw-r--r--drivers/net/arm/w90p910_ether.c1105
-rw-r--r--drivers/net/at1700.c2
-rw-r--r--drivers/net/atl1c/atl1c.h8
-rw-r--r--drivers/net/atl1c/atl1c_main.c2
-rw-r--r--drivers/net/atlx/atl2.c2
-rw-r--r--drivers/net/benet/be_main.c8
-rw-r--r--drivers/net/bnx2x_link.c3
-rw-r--r--drivers/net/bonding/bond_main.c12
-rw-r--r--drivers/net/can/dev.c8
-rw-r--r--drivers/net/can/sja1000/sja1000.c1
-rw-r--r--drivers/net/cnic.c23
-rw-r--r--drivers/net/cs89x0.c7
-rw-r--r--drivers/net/e100.c3
-rw-r--r--drivers/net/eepro.c2
-rw-r--r--drivers/net/ehea/ehea_main.c2
-rw-r--r--drivers/net/fealnx.c3
-rw-r--r--drivers/net/fec.c1
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c20
-rw-r--r--drivers/net/gianfar.c26
-rw-r--r--drivers/net/hamradio/6pack.c2
-rw-r--r--drivers/net/ibm_newemac/rgmii.c7
-rw-r--r--drivers/net/igb/igb_main.c77
-rw-r--r--drivers/net/irda/irtty-sir.c1
-rw-r--r--drivers/net/isa-skeleton.c5
-rw-r--r--drivers/net/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c30
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c52
-rw-r--r--drivers/net/jazzsonic.c1
-rw-r--r--drivers/net/ks8851.c1322
-rw-r--r--drivers/net/ks8851.h296
-rw-r--r--drivers/net/macsonic.c15
-rw-r--r--drivers/net/mlx4/cmd.c5
-rw-r--r--drivers/net/mlx4/en_ethtool.c2
-rw-r--r--drivers/net/mlx4/main.c6
-rw-r--r--drivers/net/netxen/netxen_nic.h3
-rw-r--r--drivers/net/netxen/netxen_nic_ctx.c13
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c9
-rw-r--r--drivers/net/netxen/netxen_nic_init.c12
-rw-r--r--drivers/net/netxen/netxen_nic_main.c36
-rw-r--r--drivers/net/pcmcia/3c589_cs.c21
-rw-r--r--drivers/net/phy/mdio-gpio.c77
-rw-r--r--drivers/net/phy/phy_device.c4
-rw-r--r--drivers/net/plip.c3
-rw-r--r--drivers/net/ppp_async.c1
-rw-r--r--drivers/net/ppp_synctty.c1
-rw-r--r--drivers/net/ps3_gelic_net.c1
-rw-r--r--drivers/net/ps3_gelic_wireless.c1
-rw-r--r--drivers/net/r8169.c13
-rw-r--r--drivers/net/sc92031.c1
-rw-r--r--drivers/net/skge.c4
-rw-r--r--drivers/net/sky2.c25
-rw-r--r--drivers/net/smc91x.c1
-rw-r--r--drivers/net/smc91x.h3
-rw-r--r--drivers/net/smsc911x.c1
-rw-r--r--drivers/net/sunvnet.c2
-rw-r--r--drivers/net/tokenring/ibmtr.c2
-rw-r--r--drivers/net/ucc_geth.c23
-rw-r--r--drivers/net/usb/Kconfig8
-rw-r--r--drivers/net/usb/Makefile1
-rw-r--r--drivers/net/usb/cdc-phonet.c461
-rw-r--r--drivers/net/usb/cdc_eem.c2
-rw-r--r--drivers/net/usb/kaweth.c3
-rw-r--r--drivers/net/usb/pegasus.c3
-rw-r--r--drivers/net/via-rhine.c1
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ani.c12
-rw-r--r--drivers/net/wireless/ath/regd.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/netdev.c2
-rw-r--r--drivers/net/wireless/libertas/cmd.c8
-rw-r--r--drivers/net/wireless/libertas/defs.h2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c6
-rw-r--r--drivers/net/wireless/orinoco/main.c3
-rw-r--r--drivers/net/wireless/p54/p54spi.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_leds.c3
-rw-r--r--drivers/of/of_mdio.c42
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c1
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c1
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c1
-rw-r--r--drivers/pci/syscall.c1
-rw-r--r--drivers/platform/x86/acer-wmi.c2
-rw-r--r--drivers/power/Kconfig7
-rw-r--r--drivers/power/Makefile1
-rw-r--r--drivers/power/ds2782_battery.c330
-rw-r--r--drivers/power/olpc_battery.c26
-rw-r--r--drivers/power/wm97xx_battery.c4
-rw-r--r--drivers/rtc/rtc-cmos.c23
-rw-r--r--drivers/s390/block/dasd_ioctl.c1
-rw-r--r--drivers/s390/crypto/ap_bus.c9
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c1
-rw-r--r--drivers/serial/Kconfig9
-rw-r--r--drivers/serial/Makefile1
-rw-r--r--drivers/serial/atmel_serial.c2
-rw-r--r--drivers/serial/bfin_sport_uart.c1
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c2
-rw-r--r--drivers/serial/imx.c65
-rw-r--r--drivers/serial/msm_serial.c1
-rw-r--r--drivers/spi/omap2_mcspi.c32
-rw-r--r--drivers/staging/Kconfig2
-rw-r--r--drivers/staging/Makefile1
-rw-r--r--drivers/staging/android/lowmemorykiller.c8
-rw-r--r--drivers/staging/comedi/drivers/jr3_pci.c2
-rw-r--r--drivers/staging/comedi/drivers/s626.c35
-rw-r--r--drivers/staging/go7007/s2250-loader.c1
-rw-r--r--drivers/staging/meilhaus/TODO2
-rw-r--r--drivers/staging/rspiusb/rspiusb.c14
-rw-r--r--drivers/staging/rt2870/rt2870.h1
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c12
-rw-r--r--drivers/staging/rtl8192su/Kconfig2
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_module.c1
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c14
-rw-r--r--drivers/staging/rtl8192su/r8192U_core.c23
-rw-r--r--drivers/staging/rtl8192su/r8192U_pm.c8
-rw-r--r--drivers/staging/serqt_usb2/serqt_usb2.c26
-rw-r--r--drivers/staging/stlc45xx/stlc45xx.c27
-rw-r--r--drivers/staging/uc2322/Kconfig10
-rw-r--r--drivers/staging/uc2322/Makefile1
-rw-r--r--drivers/staging/uc2322/TODO7
-rw-r--r--drivers/staging/uc2322/aten2011.c2430
-rw-r--r--drivers/staging/udlfb/udlfb.c1
-rw-r--r--drivers/staging/usbip/usbip_common.c1
-rw-r--r--drivers/staging/vt6655/device_main.c10
-rw-r--r--drivers/telephony/ixj.c1
-rw-r--r--drivers/telephony/phonedev.c1
-rw-r--r--drivers/usb/class/cdc-acm.c33
-rw-r--r--drivers/usb/class/cdc-wdm.c1
-rw-r--r--drivers/usb/class/usbtmc.c10
-rw-r--r--drivers/usb/core/Kconfig2
-rw-r--r--drivers/usb/core/config.c48
-rw-r--r--drivers/usb/core/devices.c10
-rw-r--r--drivers/usb/core/devio.c78
-rw-r--r--drivers/usb/core/hcd.h4
-rw-r--r--drivers/usb/core/hub.c40
-rw-r--r--drivers/usb/core/hub.h6
-rw-r--r--drivers/usb/core/message.c63
-rw-r--r--drivers/usb/gadget/Kconfig43
-rw-r--r--drivers/usb/gadget/amd5536udc.c1
-rw-r--r--drivers/usb/gadget/audio.c6
-rw-r--r--drivers/usb/gadget/ether.c11
-rw-r--r--drivers/usb/gadget/langwell_udc.c1
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c24
-rw-r--r--drivers/usb/gadget/rndis.c2
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c1
-rw-r--r--drivers/usb/host/Kconfig29
-rw-r--r--drivers/usb/host/ehci-au1xxx.c2
-rw-r--r--drivers/usb/host/ehci-fsl.c2
-rw-r--r--drivers/usb/host/ehci-hcd.c37
-rw-r--r--drivers/usb/host/ehci-ixp4xx.c2
-rw-r--r--drivers/usb/host/ehci-orion.c4
-rw-r--r--drivers/usb/host/ehci-pci.c2
-rw-r--r--drivers/usb/host/ehci-ppc-of.c2
-rw-r--r--drivers/usb/host/ehci-ps3.c2
-rw-r--r--drivers/usb/host/ehci-q.c140
-rw-r--r--drivers/usb/host/ehci-sched.c12
-rw-r--r--drivers/usb/host/ehci.h2
-rw-r--r--drivers/usb/host/fhci-sched.c8
-rw-r--r--drivers/usb/host/isp1760-if.c2
-rw-r--r--drivers/usb/host/ohci-omap.c1
-rw-r--r--drivers/usb/host/r8a66597-hcd.c1
-rw-r--r--drivers/usb/host/xhci-dbg.c199
-rw-r--r--drivers/usb/host/xhci-hcd.c290
-rw-r--r--drivers/usb/host/xhci-mem.c300
-rw-r--r--drivers/usb/host/xhci-pci.c1
-rw-r--r--drivers/usb/host/xhci-ring.c305
-rw-r--r--drivers/usb/host/xhci.h148
-rw-r--r--drivers/usb/misc/Kconfig2
-rw-r--r--drivers/usb/misc/iowarrior.c1
-rw-r--r--drivers/usb/misc/rio500.c1
-rw-r--r--drivers/usb/misc/usblcd.c1
-rw-r--r--drivers/usb/musb/cppi_dma.h1
-rw-r--r--drivers/usb/musb/davinci.c32
-rw-r--r--drivers/usb/musb/musb_core.c3
-rw-r--r--drivers/usb/musb/musb_core.h1
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c2
-rw-r--r--drivers/usb/musb/musb_host.c27
-rw-r--r--drivers/usb/musb/musb_regs.h1
-rw-r--r--drivers/usb/otg/Kconfig14
-rw-r--r--drivers/usb/otg/Makefile1
-rw-r--r--drivers/usb/otg/langwell_otg.c1915
-rw-r--r--drivers/usb/otg/nop-usb-xceiv.c1
-rw-r--r--drivers/usb/serial/console.c13
-rw-r--r--drivers/usb/serial/cp210x.c5
-rw-r--r--drivers/usb/serial/cypress_m8.c4
-rw-r--r--drivers/usb/serial/ftdi_sio.c69
-rw-r--r--drivers/usb/serial/ftdi_sio.h25
-rw-r--r--drivers/usb/serial/mos7720.c2
-rw-r--r--drivers/usb/serial/mos7840.c10
-rw-r--r--drivers/usb/serial/option.c178
-rw-r--r--drivers/usb/serial/pl2303.c1
-rw-r--r--drivers/usb/serial/pl2303.h4
-rw-r--r--drivers/usb/serial/sierra.c51
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c7
-rw-r--r--drivers/usb/serial/usb-serial.c40
-rw-r--r--drivers/usb/storage/option_ms.c3
-rw-r--r--drivers/usb/storage/transport.c2
-rw-r--r--drivers/video/Kconfig3
-rw-r--r--drivers/video/backlight/jornada720_bl.c2
-rw-r--r--drivers/video/backlight/pwm_bl.c2
-rw-r--r--drivers/video/fbmem.c1
-rw-r--r--drivers/video/fbmon.c4
-rw-r--r--drivers/video/imxfb.c184
-rw-r--r--drivers/video/omap/omapfb_main.c14
-rw-r--r--drivers/video/s3c-fb.c4
-rw-r--r--drivers/virtio/virtio_pci.c242
-rw-r--r--drivers/watchdog/ep93xx_wdt.c1
-rw-r--r--fs/9p/vfs_addr.c2
-rw-r--r--fs/Kconfig27
-rw-r--r--fs/adfs/super.c1
-rw-r--r--fs/afs/dir.c2
-rw-r--r--fs/afs/super.c1
-rw-r--r--fs/autofs4/dev-ioctl.c1
-rw-r--r--fs/bfs/dir.c1
-rw-r--r--fs/bfs/file.c1
-rw-r--r--fs/block_dev.c10
-rw-r--r--fs/btrfs/async-thread.c4
-rw-r--r--fs/btrfs/compression.c1
-rw-r--r--fs/btrfs/ctree.c121
-rw-r--r--fs/btrfs/ctree.h27
-rw-r--r--fs/btrfs/disk-io.c15
-rw-r--r--fs/btrfs/extent-tree.c517
-rw-r--r--fs/btrfs/file.c1
-rw-r--r--fs/btrfs/free-space-cache.c1003
-rw-r--r--fs/btrfs/free-space-cache.h8
-rw-r--r--fs/btrfs/inode.c3
-rw-r--r--fs/btrfs/ioctl.c1
-rw-r--r--fs/btrfs/print-tree.c6
-rw-r--r--fs/btrfs/relocation.c3
-rw-r--r--fs/btrfs/super.c1
-rw-r--r--fs/btrfs/transaction.c56
-rw-r--r--fs/btrfs/transaction.h1
-rw-r--r--fs/btrfs/tree-log.c2
-rw-r--r--fs/btrfs/volumes.c46
-rw-r--r--fs/char_dev.c1
-rw-r--r--fs/cifs/cifs_debug.c8
-rw-r--r--fs/cifs/cifsglob.h2
-rw-r--r--fs/cifs/cifssmb.c5
-rw-r--r--fs/cifs/connect.c9
-rw-r--r--fs/cifs/inode.c9
-rw-r--r--fs/compat.c1
-rw-r--r--fs/compat_ioctl.c1
-rw-r--r--fs/dlm/lock.c2
-rw-r--r--fs/dlm/lowcomms.c4
-rw-r--r--fs/dlm/plock.c17
-rw-r--r--fs/ecryptfs/keystore.c13
-rw-r--r--fs/exofs/super.c1
-rw-r--r--fs/ext2/ioctl.c1
-rw-r--r--fs/ext3/dir.c3
-rw-r--r--fs/ext3/inode.c32
-rw-r--r--fs/ext4/ext4.h14
-rw-r--r--fs/ext4/ext4_jbd2.c4
-rw-r--r--fs/ext4/ext4_jbd2.h6
-rw-r--r--fs/ext4/extents.c1
-rw-r--r--fs/ext4/ialloc.c2
-rw-r--r--fs/ext4/inode.c384
-rw-r--r--fs/ext4/ioctl.c21
-rw-r--r--fs/ext4/mballoc.c50
-rw-r--r--fs/fat/dir.c1
-rw-r--r--fs/fat/namei_msdos.c1
-rw-r--r--fs/fat/namei_vfat.c1
-rw-r--r--fs/fcntl.c1
-rw-r--r--fs/freevxfs/vxfs_super.c1
-rw-r--r--fs/fuse/dev.c1
-rw-r--r--fs/gfs2/aops.c39
-rw-r--r--fs/gfs2/glock.c138
-rw-r--r--fs/gfs2/glock.h3
-rw-r--r--fs/gfs2/glops.c21
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/rgrp.c23
-rw-r--r--fs/gfs2/super.c40
-rw-r--r--fs/gfs2/super.h4
-rw-r--r--fs/gfs2/trace_gfs2.h8
-rw-r--r--fs/hfs/super.c1
-rw-r--r--fs/hfsplus/super.c1
-rw-r--r--fs/hpfs/dir.c1
-rw-r--r--fs/hpfs/file.c1
-rw-r--r--fs/hpfs/hpfs_fn.h1
-rw-r--r--fs/hpfs/inode.c1
-rw-r--r--fs/hpfs/namei.c1
-rw-r--r--fs/jbd/journal.c26
-rw-r--r--fs/jbd/transaction.c68
-rw-r--r--fs/jbd2/journal.c31
-rw-r--r--fs/jbd2/transaction.c68
-rw-r--r--fs/jffs2/super.c1
-rw-r--r--fs/jfs/acl.c4
-rw-r--r--fs/lockd/clntproc.c1
-rw-r--r--fs/lockd/svc4proc.c1
-rw-r--r--fs/lockd/svcproc.c1
-rw-r--r--fs/nfs/client.c18
-rw-r--r--fs/nfs/delegation.c1
-rw-r--r--fs/nfs/dir.c3
-rw-r--r--fs/nfs/file.c1
-rw-r--r--fs/nfs/inode.c1
-rw-r--r--fs/nfs/nfs4_fs.h6
-rw-r--r--fs/nfs/nfs4proc.c41
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--fs/nfs/read.c1
-rw-r--r--fs/nfs/write.c1
-rw-r--r--fs/nfsd/nfsctl.c1
-rw-r--r--fs/nfsd/nfssvc.c1
-rw-r--r--fs/nilfs2/Kconfig25
-rw-r--r--fs/nilfs2/dir.c1
-rw-r--r--fs/notify/Kconfig12
-rw-r--r--fs/notify/dnotify/Kconfig2
-rw-r--r--fs/notify/fsnotify.c4
-rw-r--r--fs/notify/inotify/Kconfig2
-rw-r--r--fs/notify/inotify/inotify_user.c109
-rw-r--r--fs/notify/notification.c19
-rw-r--r--fs/ocfs2/ioctl.c1
-rw-r--r--fs/partitions/check.c2
-rw-r--r--fs/pipe.c4
-rw-r--r--fs/quota/dquot.c7
-rw-r--r--fs/ramfs/file-nommu.c1
-rw-r--r--fs/reiserfs/xattr.c1
-rw-r--r--fs/squashfs/super.c1
-rw-r--r--fs/sysfs/dir.c2
-rw-r--r--fs/ubifs/ioctl.c1
-rw-r--r--fs/udf/super.c12
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c1
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c4
-rw-r--r--include/asm-generic/4level-fixup.h4
-rw-r--r--include/asm-generic/pgtable-nopmd.h2
-rw-r--r--include/asm-generic/pgtable-nopud.h2
-rw-r--r--include/asm-generic/tlb.h12
-rw-r--r--include/asm-generic/vmlinux.lds.h19
-rw-r--r--include/drm/drm_pciids.h6
-rw-r--r--include/drm/radeon_drm.h23
-rw-r--r--include/drm/ttm/ttm_bo_driver.h20
-rw-r--r--include/drm/ttm/ttm_module.h2
-rw-r--r--include/linux/amba/bus.h5
-rw-r--r--include/linux/amba/pl093.h80
-rw-r--r--include/linux/backing-dev.h5
-rw-r--r--include/linux/blkdev.h5
-rw-r--r--include/linux/cb710.h29
-rw-r--r--include/linux/cgroup.h28
-rw-r--r--include/linux/clockchips.h9
-rw-r--r--include/linux/clocksource.h14
-rw-r--r--include/linux/console_struct.h1
-rw-r--r--include/linux/crash_dump.h1
-rw-r--r--include/linux/device-mapper.h4
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/flex_array.h47
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/fsnotify_backend.h2
-rw-r--r--include/linux/hardirq.h2
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--include/linux/interrupt.h28
-rw-r--r--include/linux/iocontext.h2
-rw-r--r--include/linux/kmemleak.h4
-rw-r--r--include/linux/lguest.h39
-rw-r--r--include/linux/lguest_launcher.h18
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/of_mdio.h3
-rw-r--r--include/linux/perf_counter.h15
-rw-r--r--include/linux/personality.h5
-rw-r--r--include/linux/pps.h2
-rw-r--r--include/linux/quotaops.h1
-rw-r--r--include/linux/rfkill.h2
-rw-r--r--include/linux/scatterlist.h2
-rw-r--r--include/linux/sched.h3
-rw-r--r--include/linux/skbuff.h4
-rw-r--r--include/linux/slub_def.h2
-rw-r--r--include/linux/sunrpc/xdr.h1
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/uio.h17
-rw-r--r--include/linux/usb.h6
-rw-r--r--include/linux/usb/langwell_otg.h177
-rw-r--r--include/linux/videodev2.h1
-rw-r--r--include/linux/virtio_blk.h6
-rw-r--r--include/linux/virtio_config.h3
-rw-r--r--include/linux/virtio_net.h20
-rw-r--r--include/linux/virtio_ring.h12
-rw-r--r--include/media/v4l2-chip-ident.h12
-rw-r--r--include/net/rose.h2
-rw-r--r--include/net/sock.h32
-rw-r--r--include/net/tcp.h5
-rw-r--r--include/trace/events/block.h6
-rw-r--r--include/trace/events/ext4.h54
-rw-r--r--include/trace/events/irq.h6
-rw-r--r--include/trace/events/jbd2.h6
-rw-r--r--include/trace/events/kmem.h6
-rw-r--r--include/trace/events/lockdep.h6
-rw-r--r--include/trace/events/sched.h6
-rw-r--r--include/trace/events/skb.h6
-rw-r--r--include/trace/events/workqueue.h6
-rw-r--r--init/Kconfig2
-rw-r--r--kernel/cgroup.c151
-rw-r--r--kernel/fork.c10
-rw-r--r--kernel/freezer.c7
-rw-r--r--kernel/futex.c1
-rw-r--r--kernel/hrtimer.c110
-rw-r--r--kernel/irq/internals.h3
-rw-r--r--kernel/irq/manage.c55
-rw-r--r--kernel/irq/migration.c2
-rw-r--r--kernel/kexec.c2
-rw-r--r--kernel/kprobes.c2
-rw-r--r--kernel/kthread.c10
-rw-r--r--kernel/module.c3
-rw-r--r--kernel/perf_counter.c186
-rw-r--r--kernel/pid.c7
-rw-r--r--kernel/power/user.c1
-rw-r--r--kernel/profile.c5
-rw-r--r--kernel/sched.c47
-rw-r--r--kernel/sched_fair.c13
-rw-r--r--kernel/sched_rt.c18
-rw-r--r--kernel/softirq.c64
-rw-r--r--kernel/time/clockevents.c11
-rw-r--r--kernel/time/clocksource.c2
-rw-r--r--kernel/timer.c2
-rw-r--r--kernel/trace/blktrace.c1
-rw-r--r--kernel/trace/ftrace.c20
-rw-r--r--kernel/trace/trace.c1
-rw-r--r--kernel/trace/trace_functions.c2
-rw-r--r--kernel/trace/trace_stack.c7
-rw-r--r--kernel/trace/trace_stat.c34
-rw-r--r--lib/Makefile2
-rw-r--r--lib/atomic64.c11
-rw-r--r--lib/dynamic_debug.c2
-rw-r--r--lib/flex_array.c269
-rw-r--r--lib/scatterlist.c16
-rw-r--r--mm/bootmem.c6
-rw-r--r--mm/hugetlb.c2
-rw-r--r--mm/kmemleak.c240
-rw-r--r--mm/memcontrol.c23
-rw-r--r--mm/memory.c11
-rw-r--r--mm/page_alloc.c35
-rw-r--r--mm/slub.c10
-rw-r--r--mm/swapfile.c4
-rw-r--r--net/9p/client.c13
-rw-r--r--net/appletalk/ddp.c1
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/can/bcm.c4
-rw-r--r--net/can/raw.c4
-rw-r--r--net/core/sock.c41
-rw-r--r--net/dccp/proto.c4
-rw-r--r--net/ipv4/ip_gre.c4
-rw-r--r--net/ipv4/ip_output.c1
-rw-r--r--net/ipv4/tcp_ipv4.c3
-rw-r--r--net/ipv4/tcp_output.c2
-rw-r--r--net/ipv6/ip6_output.c1
-rw-r--r--net/ipv6/sit.c1
-rw-r--r--net/ipv6/tcp_ipv6.c3
-rw-r--r--net/ipx/af_ipx.c1
-rw-r--r--net/irda/af_irda.c1
-rw-r--r--net/irda/irnet/irnet.h1
-rw-r--r--net/irda/irnet/irnet_ppp.c1
-rw-r--r--net/irda/irttp.c1
-rw-r--r--net/mac80211/Kconfig1
-rw-r--r--net/mac80211/mesh_pathtbl.c11
-rw-r--r--net/mac80211/tx.c2
-rw-r--r--net/netfilter/nf_conntrack_core.c21
-rw-r--r--net/netfilter/xt_osf.c5
-rw-r--r--net/rfkill/core.c31
-rw-r--r--net/rose/af_rose.c18
-rw-r--r--net/rose/rose_route.c23
-rw-r--r--net/sunrpc/clnt.c1
-rw-r--r--net/sunrpc/sched.c1
-rw-r--r--net/sunrpc/svc_xprt.c1
-rw-r--r--net/wanrouter/wanmain.c1
-rw-r--r--net/wireless/nl80211.c5
-rw-r--r--net/wireless/scan.c3
-rw-r--r--net/x25/af_x25.c1
-rw-r--r--samples/trace_events/trace-events-sample.h37
-rwxr-xr-xscripts/get_maintainer.pl42
-rw-r--r--scripts/kconfig/lxdialog/util.c2
-rw-r--r--scripts/kconfig/mconf.c2
-rw-r--r--scripts/markup_oops.pl5
-rw-r--r--scripts/package/builddeb2
-rw-r--r--sound/aoa/core/gpio-pmf.c4
-rw-r--r--sound/arm/pxa2xx-pcm-lib.c2
-rw-r--r--sound/core/pcm_lib.c36
-rw-r--r--sound/core/seq/Makefile7
-rw-r--r--sound/isa/gus/gus_pcm.c4
-rw-r--r--sound/oss/aedsp16.c9
-rw-r--r--sound/oss/mpu401.c2
-rw-r--r--sound/pci/ca0106/ca0106_main.c4
-rw-r--r--sound/pci/ctxfi/ctamixer.c14
-rw-r--r--sound/pci/ctxfi/ctdaio.c4
-rw-r--r--sound/pci/ctxfi/ctsrc.c7
-rw-r--r--sound/pci/hda/hda_codec.c6
-rw-r--r--sound/pci/hda/hda_eld.c4
-rw-r--r--sound/pci/hda/patch_analog.c2
-rw-r--r--sound/pci/hda/patch_realtek.c43
-rw-r--r--sound/pci/hda/patch_sigmatel.c11
-rw-r--r--sound/pci/riptide/riptide.c7
-rw-r--r--sound/soc/codecs/tlv320aic3x.c11
-rw-r--r--sound/soc/codecs/wm8988.c4
-rw-r--r--sound/soc/s3c24xx/s3c24xx-ac97.h6
-rw-r--r--sound/usb/Kconfig1
-rw-r--r--sound/usb/caiaq/audio.c1
-rw-r--r--sound/usb/caiaq/device.c8
-rw-r--r--sound/usb/caiaq/device.h1
-rw-r--r--sound/usb/usbaudio.c14
-rw-r--r--sound/usb/usbmixer.c25
-rw-r--r--tools/perf/Documentation/perf-report.txt15
-rw-r--r--tools/perf/Makefile2
-rw-r--r--tools/perf/builtin-annotate.c24
-rw-r--r--tools/perf/builtin-record.c13
-rw-r--r--tools/perf/builtin-report.c255
-rw-r--r--tools/perf/builtin-stat.c3
-rw-r--r--tools/perf/builtin-top.c6
-rw-r--r--tools/perf/perf.c77
-rw-r--r--tools/perf/perf.h8
-rw-r--r--tools/perf/util/cache.h1
-rw-r--r--tools/perf/util/header.h2
-rw-r--r--tools/perf/util/include/linux/kernel.h8
-rw-r--r--tools/perf/util/parse-events.c182
-rw-r--r--tools/perf/util/parse-events.h5
-rw-r--r--tools/perf/util/string.h3
-rw-r--r--tools/perf/util/strlist.c20
-rw-r--r--tools/perf/util/strlist.h11
-rw-r--r--tools/perf/util/symbol.c145
-rw-r--r--tools/perf/util/symbol.h1
-rw-r--r--tools/perf/util/util.h2
1300 files changed, 47979 insertions, 17932 deletions
diff --git a/CREDITS b/CREDITS
index 2b88fb37ad50..1a41bf4addd0 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1856,7 +1856,7 @@ E: rfkoenig@immd4.informatik.uni-erlangen.de
1856D: The Linux Support Team Erlangen 1856D: The Linux Support Team Erlangen
1857 1857
1858N: Andreas Koensgen 1858N: Andreas Koensgen
1859E: ajk@iehk.rwth-aachen.de 1859E: ajk@comnets.uni-bremen.de
1860D: 6pack driver for AX.25 1860D: 6pack driver for AX.25
1861 1861
1862N: Harald Koerfgen 1862N: Harald Koerfgen
@@ -2006,6 +2006,9 @@ E: paul@laufernet.com
2006D: Soundblaster driver fixes, ISAPnP quirk 2006D: Soundblaster driver fixes, ISAPnP quirk
2007S: California, USA 2007S: California, USA
2008 2008
2009N: Jonathan Layes
2010D: ARPD support
2011
2009N: Tom Lees 2012N: Tom Lees
2010E: tom@lpsg.demon.co.uk 2013E: tom@lpsg.demon.co.uk
2011W: http://www.lpsg.demon.co.uk/ 2014W: http://www.lpsg.demon.co.uk/
@@ -3802,6 +3805,9 @@ S: van Bronckhorststraat 12
3802S: 2612 XV Delft 3805S: 2612 XV Delft
3803S: The Netherlands 3806S: The Netherlands
3804 3807
3808N: Thomas Woller
3809D: CS461x Cirrus Logic sound driver
3810
3805N: David Woodhouse 3811N: David Woodhouse
3806E: dwmw2@infradead.org 3812E: dwmw2@infradead.org
3807D: JFFS2 file system, Memory Technology Device subsystem, 3813D: JFFS2 file system, Memory Technology Device subsystem,
diff --git a/Documentation/RCU/rculist_nulls.txt b/Documentation/RCU/rculist_nulls.txt
index 93cb28d05dcd..18f9651ff23d 100644
--- a/Documentation/RCU/rculist_nulls.txt
+++ b/Documentation/RCU/rculist_nulls.txt
@@ -83,11 +83,12 @@ not detect it missed following items in original chain.
83obj = kmem_cache_alloc(...); 83obj = kmem_cache_alloc(...);
84lock_chain(); // typically a spin_lock() 84lock_chain(); // typically a spin_lock()
85obj->key = key; 85obj->key = key;
86atomic_inc(&obj->refcnt);
87/* 86/*
88 * we need to make sure obj->key is updated before obj->next 87 * we need to make sure obj->key is updated before obj->next
88 * or obj->refcnt
89 */ 89 */
90smp_wmb(); 90smp_wmb();
91atomic_set(&obj->refcnt, 1);
91hlist_add_head_rcu(&obj->obj_node, list); 92hlist_add_head_rcu(&obj->obj_node, list);
92unlock_chain(); // typically a spin_unlock() 93unlock_chain(); // typically a spin_unlock()
93 94
@@ -159,6 +160,10 @@ out:
159obj = kmem_cache_alloc(cachep); 160obj = kmem_cache_alloc(cachep);
160lock_chain(); // typically a spin_lock() 161lock_chain(); // typically a spin_lock()
161obj->key = key; 162obj->key = key;
163/*
164 * changes to obj->key must be visible before refcnt one
165 */
166smp_wmb();
162atomic_set(&obj->refcnt, 1); 167atomic_set(&obj->refcnt, 1);
163/* 168/*
164 * insert obj in RCU way (readers might be traversing chain) 169 * insert obj in RCU way (readers might be traversing chain)
diff --git a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
new file mode 100644
index 000000000000..76b3a11e90be
--- /dev/null
+++ b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
@@ -0,0 +1,75 @@
1 S3C24XX CPUfreq support
2 =======================
3
4Introduction
5------------
6
7 The S3C24XX series support a number of power saving systems, such as
8 the ability to change the core, memory and peripheral operating
9 frequencies. The core control is exported via the CPUFreq driver
10 which has a number of different manual or automatic controls over the
11 rate the core is running at.
12
13 There are two forms of the driver depending on the specific CPU and
14 how the clocks are arranged. The first implementation used as single
15 PLL to feed the ARM, memory and peripherals via a series of dividers
16 and muxes and this is the implementation that is documented here. A
17 newer version where there is a seperate PLL and clock divider for the
18 ARM core is available as a seperate driver.
19
20
21Layout
22------
23
24 The code core manages the CPU specific drivers, any data that they
25 need to register and the interface to the generic drivers/cpufreq
26 system. Each CPU registers a driver to control the PLL, clock dividers
27 and anything else associated with it. Any board that wants to use this
28 framework needs to supply at least basic details of what is required.
29
30 The core registers with drivers/cpufreq at init time if all the data
31 necessary has been supplied.
32
33
34CPU support
35-----------
36
37 The support for each CPU depends on the facilities provided by the
38 SoC and the driver as each device has different PLL and clock chains
39 associated with it.
40
41
42Slow Mode
43---------
44
45 The SLOW mode where the PLL is turned off altogether and the
46 system is fed by the external crystal input is currently not
47 supported.
48
49
50sysfs
51-----
52
53 The core code exports extra information via sysfs in the directory
54 devices/system/cpu/cpu0/arch-freq.
55
56
57Board Support
58-------------
59
60 Each board that wants to use the cpufreq code must register some basic
61 information with the core driver to provide information about what the
62 board requires and any restrictions being placed on it.
63
64 The board needs to supply information about whether it needs the IO bank
65 timings changing, any maximum frequency limits and information about the
66 SDRAM refresh rate.
67
68
69
70
71Document Author
72---------------
73
74Ben Dooks, Copyright 2009 Simtec Electronics
75Licensed under GPLv2
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c
index f688eba87704..6a5be5d5c8e4 100644
--- a/Documentation/connector/cn_test.c
+++ b/Documentation/connector/cn_test.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * cn_test.c 2 * cn_test.c
3 * 3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * 2004+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -194,5 +194,5 @@ module_init(cn_test_init);
194module_exit(cn_test_fini); 194module_exit(cn_test_fini);
195 195
196MODULE_LICENSE("GPL"); 196MODULE_LICENSE("GPL");
197MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); 197MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
198MODULE_DESCRIPTION("Connector's test module"); 198MODULE_DESCRIPTION("Connector's test module");
diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index d738cde2a8d5..c5092ad0ce4b 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * ucon.c 2 * ucon.c
3 * 3 *
4 * Copyright (c) 2004+ Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * Copyright (c) 2004+ Evgeniy Polyakov <zbr@ioremap.net>
5 * 5 *
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index 82132169d47a..60120fb3b961 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -207,8 +207,8 @@ Attributes
207~~~~~~~~~~ 207~~~~~~~~~~
208struct driver_attribute { 208struct driver_attribute {
209 struct attribute attr; 209 struct attribute attr;
210 ssize_t (*show)(struct device_driver *, char * buf, size_t count, loff_t off); 210 ssize_t (*show)(struct device_driver *driver, char *buf);
211 ssize_t (*store)(struct device_driver *, const char * buf, size_t count, loff_t off); 211 ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
212}; 212};
213 213
214Device drivers can export attributes via their sysfs directories. 214Device drivers can export attributes via their sysfs directories.
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 7e81e37c0b1e..b245d524d568 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -23,7 +23,8 @@ interface.
23Using sysfs 23Using sysfs
24~~~~~~~~~~~ 24~~~~~~~~~~~
25 25
26sysfs is always compiled in. You can access it by doing: 26sysfs is always compiled in if CONFIG_SYSFS is defined. You can access
27it by doing:
27 28
28 mount -t sysfs sysfs /sys 29 mount -t sysfs sysfs /sys
29 30
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 9ebcd6ef361b..950cde6d6e58 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1,7 +1,9 @@
1/*P:100 This is the Launcher code, a simple program which lays out the 1/*P:100
2 * "physical" memory for the new Guest by mapping the kernel image and 2 * This is the Launcher code, a simple program which lays out the "physical"
3 * the virtual devices, then opens /dev/lguest to tell the kernel 3 * memory for the new Guest by mapping the kernel image and the virtual
4 * about the Guest and control it. :*/ 4 * devices, then opens /dev/lguest to tell the kernel about the Guest and
5 * control it.
6:*/
5#define _LARGEFILE64_SOURCE 7#define _LARGEFILE64_SOURCE
6#define _GNU_SOURCE 8#define _GNU_SOURCE
7#include <stdio.h> 9#include <stdio.h>
@@ -46,13 +48,15 @@
46#include "linux/virtio_rng.h" 48#include "linux/virtio_rng.h"
47#include "linux/virtio_ring.h" 49#include "linux/virtio_ring.h"
48#include "asm/bootparam.h" 50#include "asm/bootparam.h"
49/*L:110 We can ignore the 39 include files we need for this program, but I do 51/*L:110
50 * want to draw attention to the use of kernel-style types. 52 * We can ignore the 42 include files we need for this program, but I do want
53 * to draw attention to the use of kernel-style types.
51 * 54 *
52 * As Linus said, "C is a Spartan language, and so should your naming be." I 55 * As Linus said, "C is a Spartan language, and so should your naming be." I
53 * like these abbreviations, so we define them here. Note that u64 is always 56 * like these abbreviations, so we define them here. Note that u64 is always
54 * unsigned long long, which works on all Linux systems: this means that we can 57 * unsigned long long, which works on all Linux systems: this means that we can
55 * use %llu in printf for any u64. */ 58 * use %llu in printf for any u64.
59 */
56typedef unsigned long long u64; 60typedef unsigned long long u64;
57typedef uint32_t u32; 61typedef uint32_t u32;
58typedef uint16_t u16; 62typedef uint16_t u16;
@@ -69,8 +73,10 @@ typedef uint8_t u8;
69/* This will occupy 3 pages: it must be a power of 2. */ 73/* This will occupy 3 pages: it must be a power of 2. */
70#define VIRTQUEUE_NUM 256 74#define VIRTQUEUE_NUM 256
71 75
72/*L:120 verbose is both a global flag and a macro. The C preprocessor allows 76/*L:120
73 * this, and although I wouldn't recommend it, it works quite nicely here. */ 77 * verbose is both a global flag and a macro. The C preprocessor allows
78 * this, and although I wouldn't recommend it, it works quite nicely here.
79 */
74static bool verbose; 80static bool verbose;
75#define verbose(args...) \ 81#define verbose(args...) \
76 do { if (verbose) printf(args); } while(0) 82 do { if (verbose) printf(args); } while(0)
@@ -87,8 +93,7 @@ static int lguest_fd;
87static unsigned int __thread cpu_id; 93static unsigned int __thread cpu_id;
88 94
89/* This is our list of devices. */ 95/* This is our list of devices. */
90struct device_list 96struct device_list {
91{
92 /* Counter to assign interrupt numbers. */ 97 /* Counter to assign interrupt numbers. */
93 unsigned int next_irq; 98 unsigned int next_irq;
94 99
@@ -100,8 +105,7 @@ struct device_list
100 105
101 /* A single linked list of devices. */ 106 /* A single linked list of devices. */
102 struct device *dev; 107 struct device *dev;
103 /* And a pointer to the last device for easy append and also for 108 /* And a pointer to the last device for easy append. */
104 * configuration appending. */
105 struct device *lastdev; 109 struct device *lastdev;
106}; 110};
107 111
@@ -109,8 +113,7 @@ struct device_list
109static struct device_list devices; 113static struct device_list devices;
110 114
111/* The device structure describes a single device. */ 115/* The device structure describes a single device. */
112struct device 116struct device {
113{
114 /* The linked-list pointer. */ 117 /* The linked-list pointer. */
115 struct device *next; 118 struct device *next;
116 119
@@ -135,8 +138,7 @@ struct device
135}; 138};
136 139
137/* The virtqueue structure describes a queue attached to a device. */ 140/* The virtqueue structure describes a queue attached to a device. */
138struct virtqueue 141struct virtqueue {
139{
140 struct virtqueue *next; 142 struct virtqueue *next;
141 143
142 /* Which device owns me. */ 144 /* Which device owns me. */
@@ -168,20 +170,24 @@ static char **main_args;
168/* The original tty settings to restore on exit. */ 170/* The original tty settings to restore on exit. */
169static struct termios orig_term; 171static struct termios orig_term;
170 172
171/* We have to be careful with barriers: our devices are all run in separate 173/*
174 * We have to be careful with barriers: our devices are all run in separate
172 * threads and so we need to make sure that changes visible to the Guest happen 175 * threads and so we need to make sure that changes visible to the Guest happen
173 * in precise order. */ 176 * in precise order.
177 */
174#define wmb() __asm__ __volatile__("" : : : "memory") 178#define wmb() __asm__ __volatile__("" : : : "memory")
175#define mb() __asm__ __volatile__("" : : : "memory") 179#define mb() __asm__ __volatile__("" : : : "memory")
176 180
177/* Convert an iovec element to the given type. 181/*
182 * Convert an iovec element to the given type.
178 * 183 *
179 * This is a fairly ugly trick: we need to know the size of the type and 184 * This is a fairly ugly trick: we need to know the size of the type and
180 * alignment requirement to check the pointer is kosher. It's also nice to 185 * alignment requirement to check the pointer is kosher. It's also nice to
181 * have the name of the type in case we report failure. 186 * have the name of the type in case we report failure.
182 * 187 *
183 * Typing those three things all the time is cumbersome and error prone, so we 188 * Typing those three things all the time is cumbersome and error prone, so we
184 * have a macro which sets them all up and passes to the real function. */ 189 * have a macro which sets them all up and passes to the real function.
190 */
185#define convert(iov, type) \ 191#define convert(iov, type) \
186 ((type *)_convert((iov), sizeof(type), __alignof__(type), #type)) 192 ((type *)_convert((iov), sizeof(type), __alignof__(type), #type))
187 193
@@ -198,8 +204,10 @@ static void *_convert(struct iovec *iov, size_t size, size_t align,
198/* Wrapper for the last available index. Makes it easier to change. */ 204/* Wrapper for the last available index. Makes it easier to change. */
199#define lg_last_avail(vq) ((vq)->last_avail_idx) 205#define lg_last_avail(vq) ((vq)->last_avail_idx)
200 206
201/* The virtio configuration space is defined to be little-endian. x86 is 207/*
202 * little-endian too, but it's nice to be explicit so we have these helpers. */ 208 * The virtio configuration space is defined to be little-endian. x86 is
209 * little-endian too, but it's nice to be explicit so we have these helpers.
210 */
203#define cpu_to_le16(v16) (v16) 211#define cpu_to_le16(v16) (v16)
204#define cpu_to_le32(v32) (v32) 212#define cpu_to_le32(v32) (v32)
205#define cpu_to_le64(v64) (v64) 213#define cpu_to_le64(v64) (v64)
@@ -241,11 +249,12 @@ static u8 *get_feature_bits(struct device *dev)
241 + dev->num_vq * sizeof(struct lguest_vqconfig); 249 + dev->num_vq * sizeof(struct lguest_vqconfig);
242} 250}
243 251
244/*L:100 The Launcher code itself takes us out into userspace, that scary place 252/*L:100
245 * where pointers run wild and free! Unfortunately, like most userspace 253 * The Launcher code itself takes us out into userspace, that scary place where
246 * programs, it's quite boring (which is why everyone likes to hack on the 254 * pointers run wild and free! Unfortunately, like most userspace programs,
247 * kernel!). Perhaps if you make up an Lguest Drinking Game at this point, it 255 * it's quite boring (which is why everyone likes to hack on the kernel!).
248 * will get you through this section. Or, maybe not. 256 * Perhaps if you make up an Lguest Drinking Game at this point, it will get
257 * you through this section. Or, maybe not.
249 * 258 *
250 * The Launcher sets up a big chunk of memory to be the Guest's "physical" 259 * The Launcher sets up a big chunk of memory to be the Guest's "physical"
251 * memory and stores it in "guest_base". In other words, Guest physical == 260 * memory and stores it in "guest_base". In other words, Guest physical ==
@@ -253,7 +262,8 @@ static u8 *get_feature_bits(struct device *dev)
253 * 262 *
254 * This can be tough to get your head around, but usually it just means that we 263 * This can be tough to get your head around, but usually it just means that we
255 * use these trivial conversion functions when the Guest gives us it's 264 * use these trivial conversion functions when the Guest gives us it's
256 * "physical" addresses: */ 265 * "physical" addresses:
266 */
257static void *from_guest_phys(unsigned long addr) 267static void *from_guest_phys(unsigned long addr)
258{ 268{
259 return guest_base + addr; 269 return guest_base + addr;
@@ -268,7 +278,8 @@ static unsigned long to_guest_phys(const void *addr)
268 * Loading the Kernel. 278 * Loading the Kernel.
269 * 279 *
270 * We start with couple of simple helper routines. open_or_die() avoids 280 * We start with couple of simple helper routines. open_or_die() avoids
271 * error-checking code cluttering the callers: */ 281 * error-checking code cluttering the callers:
282 */
272static int open_or_die(const char *name, int flags) 283static int open_or_die(const char *name, int flags)
273{ 284{
274 int fd = open(name, flags); 285 int fd = open(name, flags);
@@ -283,12 +294,19 @@ static void *map_zeroed_pages(unsigned int num)
283 int fd = open_or_die("/dev/zero", O_RDONLY); 294 int fd = open_or_die("/dev/zero", O_RDONLY);
284 void *addr; 295 void *addr;
285 296
286 /* We use a private mapping (ie. if we write to the page, it will be 297 /*
287 * copied). */ 298 * We use a private mapping (ie. if we write to the page, it will be
299 * copied).
300 */
288 addr = mmap(NULL, getpagesize() * num, 301 addr = mmap(NULL, getpagesize() * num,
289 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); 302 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
290 if (addr == MAP_FAILED) 303 if (addr == MAP_FAILED)
291 err(1, "Mmaping %u pages of /dev/zero", num); 304 err(1, "Mmaping %u pages of /dev/zero", num);
305
306 /*
307 * One neat mmap feature is that you can close the fd, and it
308 * stays mapped.
309 */
292 close(fd); 310 close(fd);
293 311
294 return addr; 312 return addr;
@@ -305,20 +323,24 @@ static void *get_pages(unsigned int num)
305 return addr; 323 return addr;
306} 324}
307 325
308/* This routine is used to load the kernel or initrd. It tries mmap, but if 326/*
327 * This routine is used to load the kernel or initrd. It tries mmap, but if
309 * that fails (Plan 9's kernel file isn't nicely aligned on page boundaries), 328 * that fails (Plan 9's kernel file isn't nicely aligned on page boundaries),
310 * it falls back to reading the memory in. */ 329 * it falls back to reading the memory in.
330 */
311static void map_at(int fd, void *addr, unsigned long offset, unsigned long len) 331static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
312{ 332{
313 ssize_t r; 333 ssize_t r;
314 334
315 /* We map writable even though for some segments are marked read-only. 335 /*
336 * We map writable even though for some segments are marked read-only.
316 * The kernel really wants to be writable: it patches its own 337 * The kernel really wants to be writable: it patches its own
317 * instructions. 338 * instructions.
318 * 339 *
319 * MAP_PRIVATE means that the page won't be copied until a write is 340 * MAP_PRIVATE means that the page won't be copied until a write is
320 * done to it. This allows us to share untouched memory between 341 * done to it. This allows us to share untouched memory between
321 * Guests. */ 342 * Guests.
343 */
322 if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC, 344 if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC,
323 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) 345 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED)
324 return; 346 return;
@@ -329,7 +351,8 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
329 err(1, "Reading offset %lu len %lu gave %zi", offset, len, r); 351 err(1, "Reading offset %lu len %lu gave %zi", offset, len, r);
330} 352}
331 353
332/* This routine takes an open vmlinux image, which is in ELF, and maps it into 354/*
355 * This routine takes an open vmlinux image, which is in ELF, and maps it into
333 * the Guest memory. ELF = Embedded Linking Format, which is the format used 356 * the Guest memory. ELF = Embedded Linking Format, which is the format used
334 * by all modern binaries on Linux including the kernel. 357 * by all modern binaries on Linux including the kernel.
335 * 358 *
@@ -337,23 +360,28 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
337 * address. We use the physical address; the Guest will map itself to the 360 * address. We use the physical address; the Guest will map itself to the
338 * virtual address. 361 * virtual address.
339 * 362 *
340 * We return the starting address. */ 363 * We return the starting address.
364 */
341static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr) 365static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
342{ 366{
343 Elf32_Phdr phdr[ehdr->e_phnum]; 367 Elf32_Phdr phdr[ehdr->e_phnum];
344 unsigned int i; 368 unsigned int i;
345 369
346 /* Sanity checks on the main ELF header: an x86 executable with a 370 /*
347 * reasonable number of correctly-sized program headers. */ 371 * Sanity checks on the main ELF header: an x86 executable with a
372 * reasonable number of correctly-sized program headers.
373 */
348 if (ehdr->e_type != ET_EXEC 374 if (ehdr->e_type != ET_EXEC
349 || ehdr->e_machine != EM_386 375 || ehdr->e_machine != EM_386
350 || ehdr->e_phentsize != sizeof(Elf32_Phdr) 376 || ehdr->e_phentsize != sizeof(Elf32_Phdr)
351 || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf32_Phdr)) 377 || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf32_Phdr))
352 errx(1, "Malformed elf header"); 378 errx(1, "Malformed elf header");
353 379
354 /* An ELF executable contains an ELF header and a number of "program" 380 /*
381 * An ELF executable contains an ELF header and a number of "program"
355 * headers which indicate which parts ("segments") of the program to 382 * headers which indicate which parts ("segments") of the program to
356 * load where. */ 383 * load where.
384 */
357 385
358 /* We read in all the program headers at once: */ 386 /* We read in all the program headers at once: */
359 if (lseek(elf_fd, ehdr->e_phoff, SEEK_SET) < 0) 387 if (lseek(elf_fd, ehdr->e_phoff, SEEK_SET) < 0)
@@ -361,8 +389,10 @@ static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
361 if (read(elf_fd, phdr, sizeof(phdr)) != sizeof(phdr)) 389 if (read(elf_fd, phdr, sizeof(phdr)) != sizeof(phdr))
362 err(1, "Reading program headers"); 390 err(1, "Reading program headers");
363 391
364 /* Try all the headers: there are usually only three. A read-only one, 392 /*
365 * a read-write one, and a "note" section which we don't load. */ 393 * Try all the headers: there are usually only three. A read-only one,
394 * a read-write one, and a "note" section which we don't load.
395 */
366 for (i = 0; i < ehdr->e_phnum; i++) { 396 for (i = 0; i < ehdr->e_phnum; i++) {
367 /* If this isn't a loadable segment, we ignore it */ 397 /* If this isn't a loadable segment, we ignore it */
368 if (phdr[i].p_type != PT_LOAD) 398 if (phdr[i].p_type != PT_LOAD)
@@ -380,13 +410,15 @@ static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
380 return ehdr->e_entry; 410 return ehdr->e_entry;
381} 411}
382 412
383/*L:150 A bzImage, unlike an ELF file, is not meant to be loaded. You're 413/*L:150
384 * supposed to jump into it and it will unpack itself. We used to have to 414 * A bzImage, unlike an ELF file, is not meant to be loaded. You're supposed
385 * perform some hairy magic because the unpacking code scared me. 415 * to jump into it and it will unpack itself. We used to have to perform some
416 * hairy magic because the unpacking code scared me.
386 * 417 *
387 * Fortunately, Jeremy Fitzhardinge convinced me it wasn't that hard and wrote 418 * Fortunately, Jeremy Fitzhardinge convinced me it wasn't that hard and wrote
388 * a small patch to jump over the tricky bits in the Guest, so now we just read 419 * a small patch to jump over the tricky bits in the Guest, so now we just read
389 * the funky header so we know where in the file to load, and away we go! */ 420 * the funky header so we know where in the file to load, and away we go!
421 */
390static unsigned long load_bzimage(int fd) 422static unsigned long load_bzimage(int fd)
391{ 423{
392 struct boot_params boot; 424 struct boot_params boot;
@@ -394,8 +426,10 @@ static unsigned long load_bzimage(int fd)
394 /* Modern bzImages get loaded at 1M. */ 426 /* Modern bzImages get loaded at 1M. */
395 void *p = from_guest_phys(0x100000); 427 void *p = from_guest_phys(0x100000);
396 428
397 /* Go back to the start of the file and read the header. It should be 429 /*
398 * a Linux boot header (see Documentation/x86/i386/boot.txt) */ 430 * Go back to the start of the file and read the header. It should be
431 * a Linux boot header (see Documentation/x86/i386/boot.txt)
432 */
399 lseek(fd, 0, SEEK_SET); 433 lseek(fd, 0, SEEK_SET);
400 read(fd, &boot, sizeof(boot)); 434 read(fd, &boot, sizeof(boot));
401 435
@@ -414,9 +448,11 @@ static unsigned long load_bzimage(int fd)
414 return boot.hdr.code32_start; 448 return boot.hdr.code32_start;
415} 449}
416 450
417/*L:140 Loading the kernel is easy when it's a "vmlinux", but most kernels 451/*L:140
452 * Loading the kernel is easy when it's a "vmlinux", but most kernels
418 * come wrapped up in the self-decompressing "bzImage" format. With a little 453 * come wrapped up in the self-decompressing "bzImage" format. With a little
419 * work, we can load those, too. */ 454 * work, we can load those, too.
455 */
420static unsigned long load_kernel(int fd) 456static unsigned long load_kernel(int fd)
421{ 457{
422 Elf32_Ehdr hdr; 458 Elf32_Ehdr hdr;
@@ -433,24 +469,28 @@ static unsigned long load_kernel(int fd)
433 return load_bzimage(fd); 469 return load_bzimage(fd);
434} 470}
435 471
436/* This is a trivial little helper to align pages. Andi Kleen hated it because 472/*
473 * This is a trivial little helper to align pages. Andi Kleen hated it because
437 * it calls getpagesize() twice: "it's dumb code." 474 * it calls getpagesize() twice: "it's dumb code."
438 * 475 *
439 * Kernel guys get really het up about optimization, even when it's not 476 * Kernel guys get really het up about optimization, even when it's not
440 * necessary. I leave this code as a reaction against that. */ 477 * necessary. I leave this code as a reaction against that.
478 */
441static inline unsigned long page_align(unsigned long addr) 479static inline unsigned long page_align(unsigned long addr)
442{ 480{
443 /* Add upwards and truncate downwards. */ 481 /* Add upwards and truncate downwards. */
444 return ((addr + getpagesize()-1) & ~(getpagesize()-1)); 482 return ((addr + getpagesize()-1) & ~(getpagesize()-1));
445} 483}
446 484
447/*L:180 An "initial ram disk" is a disk image loaded into memory along with 485/*L:180
448 * the kernel which the kernel can use to boot from without needing any 486 * An "initial ram disk" is a disk image loaded into memory along with the
449 * drivers. Most distributions now use this as standard: the initrd contains 487 * kernel which the kernel can use to boot from without needing any drivers.
450 * the code to load the appropriate driver modules for the current machine. 488 * Most distributions now use this as standard: the initrd contains the code to
489 * load the appropriate driver modules for the current machine.
451 * 490 *
452 * Importantly, James Morris works for RedHat, and Fedora uses initrds for its 491 * Importantly, James Morris works for RedHat, and Fedora uses initrds for its
453 * kernels. He sent me this (and tells me when I break it). */ 492 * kernels. He sent me this (and tells me when I break it).
493 */
454static unsigned long load_initrd(const char *name, unsigned long mem) 494static unsigned long load_initrd(const char *name, unsigned long mem)
455{ 495{
456 int ifd; 496 int ifd;
@@ -462,12 +502,16 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
462 if (fstat(ifd, &st) < 0) 502 if (fstat(ifd, &st) < 0)
463 err(1, "fstat() on initrd '%s'", name); 503 err(1, "fstat() on initrd '%s'", name);
464 504
465 /* We map the initrd at the top of memory, but mmap wants it to be 505 /*
466 * page-aligned, so we round the size up for that. */ 506 * We map the initrd at the top of memory, but mmap wants it to be
507 * page-aligned, so we round the size up for that.
508 */
467 len = page_align(st.st_size); 509 len = page_align(st.st_size);
468 map_at(ifd, from_guest_phys(mem - len), 0, st.st_size); 510 map_at(ifd, from_guest_phys(mem - len), 0, st.st_size);
469 /* Once a file is mapped, you can close the file descriptor. It's a 511 /*
470 * little odd, but quite useful. */ 512 * Once a file is mapped, you can close the file descriptor. It's a
513 * little odd, but quite useful.
514 */
471 close(ifd); 515 close(ifd);
472 verbose("mapped initrd %s size=%lu @ %p\n", name, len, (void*)mem-len); 516 verbose("mapped initrd %s size=%lu @ %p\n", name, len, (void*)mem-len);
473 517
@@ -476,8 +520,10 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
476} 520}
477/*:*/ 521/*:*/
478 522
479/* Simple routine to roll all the commandline arguments together with spaces 523/*
480 * between them. */ 524 * Simple routine to roll all the commandline arguments together with spaces
525 * between them.
526 */
481static void concat(char *dst, char *args[]) 527static void concat(char *dst, char *args[])
482{ 528{
483 unsigned int i, len = 0; 529 unsigned int i, len = 0;
@@ -494,10 +540,12 @@ static void concat(char *dst, char *args[])
494 dst[len] = '\0'; 540 dst[len] = '\0';
495} 541}
496 542
497/*L:185 This is where we actually tell the kernel to initialize the Guest. We 543/*L:185
544 * This is where we actually tell the kernel to initialize the Guest. We
498 * saw the arguments it expects when we looked at initialize() in lguest_user.c: 545 * saw the arguments it expects when we looked at initialize() in lguest_user.c:
499 * the base of Guest "physical" memory, the top physical page to allow and the 546 * the base of Guest "physical" memory, the top physical page to allow and the
500 * entry point for the Guest. */ 547 * entry point for the Guest.
548 */
501static void tell_kernel(unsigned long start) 549static void tell_kernel(unsigned long start)
502{ 550{
503 unsigned long args[] = { LHREQ_INITIALIZE, 551 unsigned long args[] = { LHREQ_INITIALIZE,
@@ -511,7 +559,7 @@ static void tell_kernel(unsigned long start)
511} 559}
512/*:*/ 560/*:*/
513 561
514/* 562/*L:200
515 * Device Handling. 563 * Device Handling.
516 * 564 *
517 * When the Guest gives us a buffer, it sends an array of addresses and sizes. 565 * When the Guest gives us a buffer, it sends an array of addresses and sizes.
@@ -522,20 +570,26 @@ static void tell_kernel(unsigned long start)
522static void *_check_pointer(unsigned long addr, unsigned int size, 570static void *_check_pointer(unsigned long addr, unsigned int size,
523 unsigned int line) 571 unsigned int line)
524{ 572{
525 /* We have to separately check addr and addr+size, because size could 573 /*
526 * be huge and addr + size might wrap around. */ 574 * We have to separately check addr and addr+size, because size could
575 * be huge and addr + size might wrap around.
576 */
527 if (addr >= guest_limit || addr + size >= guest_limit) 577 if (addr >= guest_limit || addr + size >= guest_limit)
528 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); 578 errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr);
529 /* We return a pointer for the caller's convenience, now we know it's 579 /*
530 * safe to use. */ 580 * We return a pointer for the caller's convenience, now we know it's
581 * safe to use.
582 */
531 return from_guest_phys(addr); 583 return from_guest_phys(addr);
532} 584}
533/* A macro which transparently hands the line number to the real function. */ 585/* A macro which transparently hands the line number to the real function. */
534#define check_pointer(addr,size) _check_pointer(addr, size, __LINE__) 586#define check_pointer(addr,size) _check_pointer(addr, size, __LINE__)
535 587
536/* Each buffer in the virtqueues is actually a chain of descriptors. This 588/*
589 * Each buffer in the virtqueues is actually a chain of descriptors. This
537 * function returns the next descriptor in the chain, or vq->vring.num if we're 590 * function returns the next descriptor in the chain, or vq->vring.num if we're
538 * at the end. */ 591 * at the end.
592 */
539static unsigned next_desc(struct vring_desc *desc, 593static unsigned next_desc(struct vring_desc *desc,
540 unsigned int i, unsigned int max) 594 unsigned int i, unsigned int max)
541{ 595{
@@ -556,7 +610,10 @@ static unsigned next_desc(struct vring_desc *desc,
556 return next; 610 return next;
557} 611}
558 612
559/* This actually sends the interrupt for this virtqueue */ 613/*
614 * This actually sends the interrupt for this virtqueue, if we've used a
615 * buffer.
616 */
560static void trigger_irq(struct virtqueue *vq) 617static void trigger_irq(struct virtqueue *vq)
561{ 618{
562 unsigned long buf[] = { LHREQ_IRQ, vq->config.irq }; 619 unsigned long buf[] = { LHREQ_IRQ, vq->config.irq };
@@ -576,12 +633,14 @@ static void trigger_irq(struct virtqueue *vq)
576 err(1, "Triggering irq %i", vq->config.irq); 633 err(1, "Triggering irq %i", vq->config.irq);
577} 634}
578 635
579/* This looks in the virtqueue and for the first available buffer, and converts 636/*
637 * This looks in the virtqueue for the first available buffer, and converts
580 * it to an iovec for convenient access. Since descriptors consist of some 638 * it to an iovec for convenient access. Since descriptors consist of some
581 * number of output then some number of input descriptors, it's actually two 639 * number of output then some number of input descriptors, it's actually two
582 * iovecs, but we pack them into one and note how many of each there were. 640 * iovecs, but we pack them into one and note how many of each there were.
583 * 641 *
584 * This function returns the descriptor number found. */ 642 * This function waits if necessary, and returns the descriptor number found.
643 */
585static unsigned wait_for_vq_desc(struct virtqueue *vq, 644static unsigned wait_for_vq_desc(struct virtqueue *vq,
586 struct iovec iov[], 645 struct iovec iov[],
587 unsigned int *out_num, unsigned int *in_num) 646 unsigned int *out_num, unsigned int *in_num)
@@ -590,17 +649,23 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
590 struct vring_desc *desc; 649 struct vring_desc *desc;
591 u16 last_avail = lg_last_avail(vq); 650 u16 last_avail = lg_last_avail(vq);
592 651
652 /* There's nothing available? */
593 while (last_avail == vq->vring.avail->idx) { 653 while (last_avail == vq->vring.avail->idx) {
594 u64 event; 654 u64 event;
595 655
596 /* OK, tell Guest about progress up to now. */ 656 /*
657 * Since we're about to sleep, now is a good time to tell the
658 * Guest about what we've used up to now.
659 */
597 trigger_irq(vq); 660 trigger_irq(vq);
598 661
599 /* OK, now we need to know about added descriptors. */ 662 /* OK, now we need to know about added descriptors. */
600 vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; 663 vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY;
601 664
602 /* They could have slipped one in as we were doing that: make 665 /*
603 * sure it's written, then check again. */ 666 * They could have slipped one in as we were doing that: make
667 * sure it's written, then check again.
668 */
604 mb(); 669 mb();
605 if (last_avail != vq->vring.avail->idx) { 670 if (last_avail != vq->vring.avail->idx) {
606 vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; 671 vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY;
@@ -620,8 +685,10 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
620 errx(1, "Guest moved used index from %u to %u", 685 errx(1, "Guest moved used index from %u to %u",
621 last_avail, vq->vring.avail->idx); 686 last_avail, vq->vring.avail->idx);
622 687
623 /* Grab the next descriptor number they're advertising, and increment 688 /*
624 * the index we've seen. */ 689 * Grab the next descriptor number they're advertising, and increment
690 * the index we've seen.
691 */
625 head = vq->vring.avail->ring[last_avail % vq->vring.num]; 692 head = vq->vring.avail->ring[last_avail % vq->vring.num];
626 lg_last_avail(vq)++; 693 lg_last_avail(vq)++;
627 694
@@ -636,8 +703,10 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
636 desc = vq->vring.desc; 703 desc = vq->vring.desc;
637 i = head; 704 i = head;
638 705
639 /* If this is an indirect entry, then this buffer contains a descriptor 706 /*
640 * table which we handle as if it's any normal descriptor chain. */ 707 * If this is an indirect entry, then this buffer contains a descriptor
708 * table which we handle as if it's any normal descriptor chain.
709 */
641 if (desc[i].flags & VRING_DESC_F_INDIRECT) { 710 if (desc[i].flags & VRING_DESC_F_INDIRECT) {
642 if (desc[i].len % sizeof(struct vring_desc)) 711 if (desc[i].len % sizeof(struct vring_desc))
643 errx(1, "Invalid size for indirect buffer table"); 712 errx(1, "Invalid size for indirect buffer table");
@@ -656,8 +725,10 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
656 if (desc[i].flags & VRING_DESC_F_WRITE) 725 if (desc[i].flags & VRING_DESC_F_WRITE)
657 (*in_num)++; 726 (*in_num)++;
658 else { 727 else {
659 /* If it's an output descriptor, they're all supposed 728 /*
660 * to come before any input descriptors. */ 729 * If it's an output descriptor, they're all supposed
730 * to come before any input descriptors.
731 */
661 if (*in_num) 732 if (*in_num)
662 errx(1, "Descriptor has out after in"); 733 errx(1, "Descriptor has out after in");
663 (*out_num)++; 734 (*out_num)++;
@@ -671,14 +742,19 @@ static unsigned wait_for_vq_desc(struct virtqueue *vq,
671 return head; 742 return head;
672} 743}
673 744
674/* After we've used one of their buffers, we tell them about it. We'll then 745/*
675 * want to send them an interrupt, using trigger_irq(). */ 746 * After we've used one of their buffers, we tell the Guest about it. Sometime
747 * later we'll want to send them an interrupt using trigger_irq(); note that
748 * wait_for_vq_desc() does that for us if it has to wait.
749 */
676static void add_used(struct virtqueue *vq, unsigned int head, int len) 750static void add_used(struct virtqueue *vq, unsigned int head, int len)
677{ 751{
678 struct vring_used_elem *used; 752 struct vring_used_elem *used;
679 753
680 /* The virtqueue contains a ring of used buffers. Get a pointer to the 754 /*
681 * next entry in that used ring. */ 755 * The virtqueue contains a ring of used buffers. Get a pointer to the
756 * next entry in that used ring.
757 */
682 used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num]; 758 used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num];
683 used->id = head; 759 used->id = head;
684 used->len = len; 760 used->len = len;
@@ -698,9 +774,9 @@ static void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len)
698/* 774/*
699 * The Console 775 * The Console
700 * 776 *
701 * We associate some data with the console for our exit hack. */ 777 * We associate some data with the console for our exit hack.
702struct console_abort 778 */
703{ 779struct console_abort {
704 /* How many times have they hit ^C? */ 780 /* How many times have they hit ^C? */
705 int count; 781 int count;
706 /* When did they start? */ 782 /* When did they start? */
@@ -715,30 +791,35 @@ static void console_input(struct virtqueue *vq)
715 struct console_abort *abort = vq->dev->priv; 791 struct console_abort *abort = vq->dev->priv;
716 struct iovec iov[vq->vring.num]; 792 struct iovec iov[vq->vring.num];
717 793
718 /* Make sure there's a descriptor waiting. */ 794 /* Make sure there's a descriptor available. */
719 head = wait_for_vq_desc(vq, iov, &out_num, &in_num); 795 head = wait_for_vq_desc(vq, iov, &out_num, &in_num);
720 if (out_num) 796 if (out_num)
721 errx(1, "Output buffers in console in queue?"); 797 errx(1, "Output buffers in console in queue?");
722 798
723 /* Read it in. */ 799 /* Read into it. This is where we usually wait. */
724 len = readv(STDIN_FILENO, iov, in_num); 800 len = readv(STDIN_FILENO, iov, in_num);
725 if (len <= 0) { 801 if (len <= 0) {
726 /* Ran out of input? */ 802 /* Ran out of input? */
727 warnx("Failed to get console input, ignoring console."); 803 warnx("Failed to get console input, ignoring console.");
728 /* For simplicity, dying threads kill the whole Launcher. So 804 /*
729 * just nap here. */ 805 * For simplicity, dying threads kill the whole Launcher. So
806 * just nap here.
807 */
730 for (;;) 808 for (;;)
731 pause(); 809 pause();
732 } 810 }
733 811
812 /* Tell the Guest we used a buffer. */
734 add_used_and_trigger(vq, head, len); 813 add_used_and_trigger(vq, head, len);
735 814
736 /* Three ^C within one second? Exit. 815 /*
816 * Three ^C within one second? Exit.
737 * 817 *
738 * This is such a hack, but works surprisingly well. Each ^C has to 818 * This is such a hack, but works surprisingly well. Each ^C has to
739 * be in a buffer by itself, so they can't be too fast. But we check 819 * be in a buffer by itself, so they can't be too fast. But we check
740 * that we get three within about a second, so they can't be too 820 * that we get three within about a second, so they can't be too
741 * slow. */ 821 * slow.
822 */
742 if (len != 1 || ((char *)iov[0].iov_base)[0] != 3) { 823 if (len != 1 || ((char *)iov[0].iov_base)[0] != 3) {
743 abort->count = 0; 824 abort->count = 0;
744 return; 825 return;
@@ -763,15 +844,23 @@ static void console_output(struct virtqueue *vq)
763 unsigned int head, out, in; 844 unsigned int head, out, in;
764 struct iovec iov[vq->vring.num]; 845 struct iovec iov[vq->vring.num];
765 846
847 /* We usually wait in here, for the Guest to give us something. */
766 head = wait_for_vq_desc(vq, iov, &out, &in); 848 head = wait_for_vq_desc(vq, iov, &out, &in);
767 if (in) 849 if (in)
768 errx(1, "Input buffers in console output queue?"); 850 errx(1, "Input buffers in console output queue?");
851
852 /* writev can return a partial write, so we loop here. */
769 while (!iov_empty(iov, out)) { 853 while (!iov_empty(iov, out)) {
770 int len = writev(STDOUT_FILENO, iov, out); 854 int len = writev(STDOUT_FILENO, iov, out);
771 if (len <= 0) 855 if (len <= 0)
772 err(1, "Write to stdout gave %i", len); 856 err(1, "Write to stdout gave %i", len);
773 iov_consume(iov, out, len); 857 iov_consume(iov, out, len);
774 } 858 }
859
860 /*
861 * We're finished with that buffer: if we're going to sleep,
862 * wait_for_vq_desc() will prod the Guest with an interrupt.
863 */
775 add_used(vq, head, 0); 864 add_used(vq, head, 0);
776} 865}
777 866
@@ -791,15 +880,30 @@ static void net_output(struct virtqueue *vq)
791 unsigned int head, out, in; 880 unsigned int head, out, in;
792 struct iovec iov[vq->vring.num]; 881 struct iovec iov[vq->vring.num];
793 882
883 /* We usually wait in here for the Guest to give us a packet. */
794 head = wait_for_vq_desc(vq, iov, &out, &in); 884 head = wait_for_vq_desc(vq, iov, &out, &in);
795 if (in) 885 if (in)
796 errx(1, "Input buffers in net output queue?"); 886 errx(1, "Input buffers in net output queue?");
887 /*
888 * Send the whole thing through to /dev/net/tun. It expects the exact
889 * same format: what a coincidence!
890 */
797 if (writev(net_info->tunfd, iov, out) < 0) 891 if (writev(net_info->tunfd, iov, out) < 0)
798 errx(1, "Write to tun failed?"); 892 errx(1, "Write to tun failed?");
893
894 /*
895 * Done with that one; wait_for_vq_desc() will send the interrupt if
896 * all packets are processed.
897 */
799 add_used(vq, head, 0); 898 add_used(vq, head, 0);
800} 899}
801 900
802/* Will reading from this file descriptor block? */ 901/*
902 * Handling network input is a bit trickier, because I've tried to optimize it.
903 *
904 * First we have a helper routine which tells is if from this file descriptor
905 * (ie. the /dev/net/tun device) will block:
906 */
803static bool will_block(int fd) 907static bool will_block(int fd)
804{ 908{
805 fd_set fdset; 909 fd_set fdset;
@@ -809,8 +913,11 @@ static bool will_block(int fd)
809 return select(fd+1, &fdset, NULL, NULL, &zero) != 1; 913 return select(fd+1, &fdset, NULL, NULL, &zero) != 1;
810} 914}
811 915
812/* This is where we handle packets coming in from the tun device to our 916/*
813 * Guest. */ 917 * This handles packets coming in from the tun device to our Guest. Like all
918 * service routines, it gets called again as soon as it returns, so you don't
919 * see a while(1) loop here.
920 */
814static void net_input(struct virtqueue *vq) 921static void net_input(struct virtqueue *vq)
815{ 922{
816 int len; 923 int len;
@@ -818,21 +925,38 @@ static void net_input(struct virtqueue *vq)
818 struct iovec iov[vq->vring.num]; 925 struct iovec iov[vq->vring.num];
819 struct net_info *net_info = vq->dev->priv; 926 struct net_info *net_info = vq->dev->priv;
820 927
928 /*
929 * Get a descriptor to write an incoming packet into. This will also
930 * send an interrupt if they're out of descriptors.
931 */
821 head = wait_for_vq_desc(vq, iov, &out, &in); 932 head = wait_for_vq_desc(vq, iov, &out, &in);
822 if (out) 933 if (out)
823 errx(1, "Output buffers in net input queue?"); 934 errx(1, "Output buffers in net input queue?");
824 935
825 /* Deliver interrupt now, since we're about to sleep. */ 936 /*
937 * If it looks like we'll block reading from the tun device, send them
938 * an interrupt.
939 */
826 if (vq->pending_used && will_block(net_info->tunfd)) 940 if (vq->pending_used && will_block(net_info->tunfd))
827 trigger_irq(vq); 941 trigger_irq(vq);
828 942
943 /*
944 * Read in the packet. This is where we normally wait (when there's no
945 * incoming network traffic).
946 */
829 len = readv(net_info->tunfd, iov, in); 947 len = readv(net_info->tunfd, iov, in);
830 if (len <= 0) 948 if (len <= 0)
831 err(1, "Failed to read from tun."); 949 err(1, "Failed to read from tun.");
950
951 /*
952 * Mark that packet buffer as used, but don't interrupt here. We want
953 * to wait until we've done as much work as we can.
954 */
832 add_used(vq, head, len); 955 add_used(vq, head, len);
833} 956}
957/*:*/
834 958
835/* This is the helper to create threads. */ 959/* This is the helper to create threads: run the service routine in a loop. */
836static int do_thread(void *_vq) 960static int do_thread(void *_vq)
837{ 961{
838 struct virtqueue *vq = _vq; 962 struct virtqueue *vq = _vq;
@@ -842,8 +966,10 @@ static int do_thread(void *_vq)
842 return 0; 966 return 0;
843} 967}
844 968
845/* When a child dies, we kill our entire process group with SIGTERM. This 969/*
846 * also has the side effect that the shell restores the console for us! */ 970 * When a child dies, we kill our entire process group with SIGTERM. This
971 * also has the side effect that the shell restores the console for us!
972 */
847static void kill_launcher(int signal) 973static void kill_launcher(int signal)
848{ 974{
849 kill(0, SIGTERM); 975 kill(0, SIGTERM);
@@ -878,11 +1004,15 @@ static void reset_device(struct device *dev)
878 signal(SIGCHLD, (void *)kill_launcher); 1004 signal(SIGCHLD, (void *)kill_launcher);
879} 1005}
880 1006
1007/*L:216
1008 * This actually creates the thread which services the virtqueue for a device.
1009 */
881static void create_thread(struct virtqueue *vq) 1010static void create_thread(struct virtqueue *vq)
882{ 1011{
883 /* Create stack for thread and run it. Since stack grows 1012 /*
884 * upwards, we point the stack pointer to the end of this 1013 * Create stack for thread. Since the stack grows upwards, we point
885 * region. */ 1014 * the stack pointer to the end of this region.
1015 */
886 char *stack = malloc(32768); 1016 char *stack = malloc(32768);
887 unsigned long args[] = { LHREQ_EVENTFD, 1017 unsigned long args[] = { LHREQ_EVENTFD,
888 vq->config.pfn*getpagesize(), 0 }; 1018 vq->config.pfn*getpagesize(), 0 };
@@ -893,17 +1023,22 @@ static void create_thread(struct virtqueue *vq)
893 err(1, "Creating eventfd"); 1023 err(1, "Creating eventfd");
894 args[2] = vq->eventfd; 1024 args[2] = vq->eventfd;
895 1025
896 /* Attach an eventfd to this virtqueue: it will go off 1026 /*
897 * when the Guest does an LHCALL_NOTIFY for this vq. */ 1027 * Attach an eventfd to this virtqueue: it will go off when the Guest
1028 * does an LHCALL_NOTIFY for this vq.
1029 */
898 if (write(lguest_fd, &args, sizeof(args)) != 0) 1030 if (write(lguest_fd, &args, sizeof(args)) != 0)
899 err(1, "Attaching eventfd"); 1031 err(1, "Attaching eventfd");
900 1032
901 /* CLONE_VM: because it has to access the Guest memory, and 1033 /*
902 * SIGCHLD so we get a signal if it dies. */ 1034 * CLONE_VM: because it has to access the Guest memory, and SIGCHLD so
1035 * we get a signal if it dies.
1036 */
903 vq->thread = clone(do_thread, stack + 32768, CLONE_VM | SIGCHLD, vq); 1037 vq->thread = clone(do_thread, stack + 32768, CLONE_VM | SIGCHLD, vq);
904 if (vq->thread == (pid_t)-1) 1038 if (vq->thread == (pid_t)-1)
905 err(1, "Creating clone"); 1039 err(1, "Creating clone");
906 /* We close our local copy, now the child has it. */ 1040
1041 /* We close our local copy now the child has it. */
907 close(vq->eventfd); 1042 close(vq->eventfd);
908} 1043}
909 1044
@@ -955,7 +1090,10 @@ static void update_device_status(struct device *dev)
955 } 1090 }
956} 1091}
957 1092
958/* This is the generic routine we call when the Guest uses LHCALL_NOTIFY. */ 1093/*L:215
1094 * This is the generic routine we call when the Guest uses LHCALL_NOTIFY. In
1095 * particular, it's used to notify us of device status changes during boot.
1096 */
959static void handle_output(unsigned long addr) 1097static void handle_output(unsigned long addr)
960{ 1098{
961 struct device *i; 1099 struct device *i;
@@ -964,25 +1102,42 @@ static void handle_output(unsigned long addr)
964 for (i = devices.dev; i; i = i->next) { 1102 for (i = devices.dev; i; i = i->next) {
965 struct virtqueue *vq; 1103 struct virtqueue *vq;
966 1104
967 /* Notifications to device descriptors update device status. */ 1105 /*
1106 * Notifications to device descriptors mean they updated the
1107 * device status.
1108 */
968 if (from_guest_phys(addr) == i->desc) { 1109 if (from_guest_phys(addr) == i->desc) {
969 update_device_status(i); 1110 update_device_status(i);
970 return; 1111 return;
971 } 1112 }
972 1113
973 /* Devices *can* be used before status is set to DRIVER_OK. */ 1114 /*
1115 * Devices *can* be used before status is set to DRIVER_OK.
1116 * The original plan was that they would never do this: they
1117 * would always finish setting up their status bits before
1118 * actually touching the virtqueues. In practice, we allowed
1119 * them to, and they do (eg. the disk probes for partition
1120 * tables as part of initialization).
1121 *
1122 * If we see this, we start the device: once it's running, we
1123 * expect the device to catch all the notifications.
1124 */
974 for (vq = i->vq; vq; vq = vq->next) { 1125 for (vq = i->vq; vq; vq = vq->next) {
975 if (addr != vq->config.pfn*getpagesize()) 1126 if (addr != vq->config.pfn*getpagesize())
976 continue; 1127 continue;
977 if (i->running) 1128 if (i->running)
978 errx(1, "Notification on running %s", i->name); 1129 errx(1, "Notification on running %s", i->name);
1130 /* This just calls create_thread() for each virtqueue */
979 start_device(i); 1131 start_device(i);
980 return; 1132 return;
981 } 1133 }
982 } 1134 }
983 1135
984 /* Early console write is done using notify on a nul-terminated string 1136 /*
985 * in Guest memory. */ 1137 * Early console write is done using notify on a nul-terminated string
1138 * in Guest memory. It's also great for hacking debugging messages
1139 * into a Guest.
1140 */
986 if (addr >= guest_limit) 1141 if (addr >= guest_limit)
987 errx(1, "Bad NOTIFY %#lx", addr); 1142 errx(1, "Bad NOTIFY %#lx", addr);
988 1143
@@ -998,10 +1153,12 @@ static void handle_output(unsigned long addr)
998 * routines to allocate and manage them. 1153 * routines to allocate and manage them.
999 */ 1154 */
1000 1155
1001/* The layout of the device page is a "struct lguest_device_desc" followed by a 1156/*
1157 * The layout of the device page is a "struct lguest_device_desc" followed by a
1002 * number of virtqueue descriptors, then two sets of feature bits, then an 1158 * number of virtqueue descriptors, then two sets of feature bits, then an
1003 * array of configuration bytes. This routine returns the configuration 1159 * array of configuration bytes. This routine returns the configuration
1004 * pointer. */ 1160 * pointer.
1161 */
1005static u8 *device_config(const struct device *dev) 1162static u8 *device_config(const struct device *dev)
1006{ 1163{
1007 return (void *)(dev->desc + 1) 1164 return (void *)(dev->desc + 1)
@@ -1009,9 +1166,11 @@ static u8 *device_config(const struct device *dev)
1009 + dev->feature_len * 2; 1166 + dev->feature_len * 2;
1010} 1167}
1011 1168
1012/* This routine allocates a new "struct lguest_device_desc" from descriptor 1169/*
1170 * This routine allocates a new "struct lguest_device_desc" from descriptor
1013 * table page just above the Guest's normal memory. It returns a pointer to 1171 * table page just above the Guest's normal memory. It returns a pointer to
1014 * that descriptor. */ 1172 * that descriptor.
1173 */
1015static struct lguest_device_desc *new_dev_desc(u16 type) 1174static struct lguest_device_desc *new_dev_desc(u16 type)
1016{ 1175{
1017 struct lguest_device_desc d = { .type = type }; 1176 struct lguest_device_desc d = { .type = type };
@@ -1032,8 +1191,10 @@ static struct lguest_device_desc *new_dev_desc(u16 type)
1032 return memcpy(p, &d, sizeof(d)); 1191 return memcpy(p, &d, sizeof(d));
1033} 1192}
1034 1193
1035/* Each device descriptor is followed by the description of its virtqueues. We 1194/*
1036 * specify how many descriptors the virtqueue is to have. */ 1195 * Each device descriptor is followed by the description of its virtqueues. We
1196 * specify how many descriptors the virtqueue is to have.
1197 */
1037static void add_virtqueue(struct device *dev, unsigned int num_descs, 1198static void add_virtqueue(struct device *dev, unsigned int num_descs,
1038 void (*service)(struct virtqueue *)) 1199 void (*service)(struct virtqueue *))
1039{ 1200{
@@ -1050,6 +1211,11 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1050 vq->next = NULL; 1211 vq->next = NULL;
1051 vq->last_avail_idx = 0; 1212 vq->last_avail_idx = 0;
1052 vq->dev = dev; 1213 vq->dev = dev;
1214
1215 /*
1216 * This is the routine the service thread will run, and its Process ID
1217 * once it's running.
1218 */
1053 vq->service = service; 1219 vq->service = service;
1054 vq->thread = (pid_t)-1; 1220 vq->thread = (pid_t)-1;
1055 1221
@@ -1061,10 +1227,12 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1061 /* Initialize the vring. */ 1227 /* Initialize the vring. */
1062 vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN); 1228 vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN);
1063 1229
1064 /* Append virtqueue to this device's descriptor. We use 1230 /*
1231 * Append virtqueue to this device's descriptor. We use
1065 * device_config() to get the end of the device's current virtqueues; 1232 * device_config() to get the end of the device's current virtqueues;
1066 * we check that we haven't added any config or feature information 1233 * we check that we haven't added any config or feature information
1067 * yet, otherwise we'd be overwriting them. */ 1234 * yet, otherwise we'd be overwriting them.
1235 */
1068 assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0); 1236 assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0);
1069 memcpy(device_config(dev), &vq->config, sizeof(vq->config)); 1237 memcpy(device_config(dev), &vq->config, sizeof(vq->config));
1070 dev->num_vq++; 1238 dev->num_vq++;
@@ -1072,14 +1240,18 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1072 1240
1073 verbose("Virtqueue page %#lx\n", to_guest_phys(p)); 1241 verbose("Virtqueue page %#lx\n", to_guest_phys(p));
1074 1242
1075 /* Add to tail of list, so dev->vq is first vq, dev->vq->next is 1243 /*
1076 * second. */ 1244 * Add to tail of list, so dev->vq is first vq, dev->vq->next is
1245 * second.
1246 */
1077 for (i = &dev->vq; *i; i = &(*i)->next); 1247 for (i = &dev->vq; *i; i = &(*i)->next);
1078 *i = vq; 1248 *i = vq;
1079} 1249}
1080 1250
1081/* The first half of the feature bitmask is for us to advertise features. The 1251/*
1082 * second half is for the Guest to accept features. */ 1252 * The first half of the feature bitmask is for us to advertise features. The
1253 * second half is for the Guest to accept features.
1254 */
1083static void add_feature(struct device *dev, unsigned bit) 1255static void add_feature(struct device *dev, unsigned bit)
1084{ 1256{
1085 u8 *features = get_feature_bits(dev); 1257 u8 *features = get_feature_bits(dev);
@@ -1093,9 +1265,11 @@ static void add_feature(struct device *dev, unsigned bit)
1093 features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT)); 1265 features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT));
1094} 1266}
1095 1267
1096/* This routine sets the configuration fields for an existing device's 1268/*
1269 * This routine sets the configuration fields for an existing device's
1097 * descriptor. It only works for the last device, but that's OK because that's 1270 * descriptor. It only works for the last device, but that's OK because that's
1098 * how we use it. */ 1271 * how we use it.
1272 */
1099static void set_config(struct device *dev, unsigned len, const void *conf) 1273static void set_config(struct device *dev, unsigned len, const void *conf)
1100{ 1274{
1101 /* Check we haven't overflowed our single page. */ 1275 /* Check we haven't overflowed our single page. */
@@ -1105,12 +1279,18 @@ static void set_config(struct device *dev, unsigned len, const void *conf)
1105 /* Copy in the config information, and store the length. */ 1279 /* Copy in the config information, and store the length. */
1106 memcpy(device_config(dev), conf, len); 1280 memcpy(device_config(dev), conf, len);
1107 dev->desc->config_len = len; 1281 dev->desc->config_len = len;
1282
1283 /* Size must fit in config_len field (8 bits)! */
1284 assert(dev->desc->config_len == len);
1108} 1285}
1109 1286
1110/* This routine does all the creation and setup of a new device, including 1287/*
1111 * calling new_dev_desc() to allocate the descriptor and device memory. 1288 * This routine does all the creation and setup of a new device, including
1289 * calling new_dev_desc() to allocate the descriptor and device memory. We
1290 * don't actually start the service threads until later.
1112 * 1291 *
1113 * See what I mean about userspace being boring? */ 1292 * See what I mean about userspace being boring?
1293 */
1114static struct device *new_device(const char *name, u16 type) 1294static struct device *new_device(const char *name, u16 type)
1115{ 1295{
1116 struct device *dev = malloc(sizeof(*dev)); 1296 struct device *dev = malloc(sizeof(*dev));
@@ -1123,10 +1303,12 @@ static struct device *new_device(const char *name, u16 type)
1123 dev->num_vq = 0; 1303 dev->num_vq = 0;
1124 dev->running = false; 1304 dev->running = false;
1125 1305
1126 /* Append to device list. Prepending to a single-linked list is 1306 /*
1307 * Append to device list. Prepending to a single-linked list is
1127 * easier, but the user expects the devices to be arranged on the bus 1308 * easier, but the user expects the devices to be arranged on the bus
1128 * in command-line order. The first network device on the command line 1309 * in command-line order. The first network device on the command line
1129 * is eth0, the first block device /dev/vda, etc. */ 1310 * is eth0, the first block device /dev/vda, etc.
1311 */
1130 if (devices.lastdev) 1312 if (devices.lastdev)
1131 devices.lastdev->next = dev; 1313 devices.lastdev->next = dev;
1132 else 1314 else
@@ -1136,8 +1318,10 @@ static struct device *new_device(const char *name, u16 type)
1136 return dev; 1318 return dev;
1137} 1319}
1138 1320
1139/* Our first setup routine is the console. It's a fairly simple device, but 1321/*
1140 * UNIX tty handling makes it uglier than it could be. */ 1322 * Our first setup routine is the console. It's a fairly simple device, but
1323 * UNIX tty handling makes it uglier than it could be.
1324 */
1141static void setup_console(void) 1325static void setup_console(void)
1142{ 1326{
1143 struct device *dev; 1327 struct device *dev;
@@ -1145,8 +1329,10 @@ static void setup_console(void)
1145 /* If we can save the initial standard input settings... */ 1329 /* If we can save the initial standard input settings... */
1146 if (tcgetattr(STDIN_FILENO, &orig_term) == 0) { 1330 if (tcgetattr(STDIN_FILENO, &orig_term) == 0) {
1147 struct termios term = orig_term; 1331 struct termios term = orig_term;
1148 /* Then we turn off echo, line buffering and ^C etc. We want a 1332 /*
1149 * raw input stream to the Guest. */ 1333 * Then we turn off echo, line buffering and ^C etc: We want a
1334 * raw input stream to the Guest.
1335 */
1150 term.c_lflag &= ~(ISIG|ICANON|ECHO); 1336 term.c_lflag &= ~(ISIG|ICANON|ECHO);
1151 tcsetattr(STDIN_FILENO, TCSANOW, &term); 1337 tcsetattr(STDIN_FILENO, TCSANOW, &term);
1152 } 1338 }
@@ -1157,10 +1343,12 @@ static void setup_console(void)
1157 dev->priv = malloc(sizeof(struct console_abort)); 1343 dev->priv = malloc(sizeof(struct console_abort));
1158 ((struct console_abort *)dev->priv)->count = 0; 1344 ((struct console_abort *)dev->priv)->count = 0;
1159 1345
1160 /* The console needs two virtqueues: the input then the output. When 1346 /*
1347 * The console needs two virtqueues: the input then the output. When
1161 * they put something the input queue, we make sure we're listening to 1348 * they put something the input queue, we make sure we're listening to
1162 * stdin. When they put something in the output queue, we write it to 1349 * stdin. When they put something in the output queue, we write it to
1163 * stdout. */ 1350 * stdout.
1351 */
1164 add_virtqueue(dev, VIRTQUEUE_NUM, console_input); 1352 add_virtqueue(dev, VIRTQUEUE_NUM, console_input);
1165 add_virtqueue(dev, VIRTQUEUE_NUM, console_output); 1353 add_virtqueue(dev, VIRTQUEUE_NUM, console_output);
1166 1354
@@ -1168,7 +1356,8 @@ static void setup_console(void)
1168} 1356}
1169/*:*/ 1357/*:*/
1170 1358
1171/*M:010 Inter-guest networking is an interesting area. Simplest is to have a 1359/*M:010
1360 * Inter-guest networking is an interesting area. Simplest is to have a
1172 * --sharenet=<name> option which opens or creates a named pipe. This can be 1361 * --sharenet=<name> option which opens or creates a named pipe. This can be
1173 * used to send packets to another guest in a 1:1 manner. 1362 * used to send packets to another guest in a 1:1 manner.
1174 * 1363 *
@@ -1182,7 +1371,8 @@ static void setup_console(void)
1182 * multiple inter-guest channels behind one interface, although it would 1371 * multiple inter-guest channels behind one interface, although it would
1183 * require some manner of hotplugging new virtio channels. 1372 * require some manner of hotplugging new virtio channels.
1184 * 1373 *
1185 * Finally, we could implement a virtio network switch in the kernel. :*/ 1374 * Finally, we could implement a virtio network switch in the kernel.
1375:*/
1186 1376
1187static u32 str2ip(const char *ipaddr) 1377static u32 str2ip(const char *ipaddr)
1188{ 1378{
@@ -1207,11 +1397,13 @@ static void str2mac(const char *macaddr, unsigned char mac[6])
1207 mac[5] = m[5]; 1397 mac[5] = m[5];
1208} 1398}
1209 1399
1210/* This code is "adapted" from libbridge: it attaches the Host end of the 1400/*
1401 * This code is "adapted" from libbridge: it attaches the Host end of the
1211 * network device to the bridge device specified by the command line. 1402 * network device to the bridge device specified by the command line.
1212 * 1403 *
1213 * This is yet another James Morris contribution (I'm an IP-level guy, so I 1404 * This is yet another James Morris contribution (I'm an IP-level guy, so I
1214 * dislike bridging), and I just try not to break it. */ 1405 * dislike bridging), and I just try not to break it.
1406 */
1215static void add_to_bridge(int fd, const char *if_name, const char *br_name) 1407static void add_to_bridge(int fd, const char *if_name, const char *br_name)
1216{ 1408{
1217 int ifidx; 1409 int ifidx;
@@ -1231,9 +1423,11 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name)
1231 err(1, "can't add %s to bridge %s", if_name, br_name); 1423 err(1, "can't add %s to bridge %s", if_name, br_name);
1232} 1424}
1233 1425
1234/* This sets up the Host end of the network device with an IP address, brings 1426/*
1427 * This sets up the Host end of the network device with an IP address, brings
1235 * it up so packets will flow, the copies the MAC address into the hwaddr 1428 * it up so packets will flow, the copies the MAC address into the hwaddr
1236 * pointer. */ 1429 * pointer.
1430 */
1237static void configure_device(int fd, const char *tapif, u32 ipaddr) 1431static void configure_device(int fd, const char *tapif, u32 ipaddr)
1238{ 1432{
1239 struct ifreq ifr; 1433 struct ifreq ifr;
@@ -1260,10 +1454,12 @@ static int get_tun_device(char tapif[IFNAMSIZ])
1260 /* Start with this zeroed. Messy but sure. */ 1454 /* Start with this zeroed. Messy but sure. */
1261 memset(&ifr, 0, sizeof(ifr)); 1455 memset(&ifr, 0, sizeof(ifr));
1262 1456
1263 /* We open the /dev/net/tun device and tell it we want a tap device. A 1457 /*
1458 * We open the /dev/net/tun device and tell it we want a tap device. A
1264 * tap device is like a tun device, only somehow different. To tell 1459 * tap device is like a tun device, only somehow different. To tell
1265 * the truth, I completely blundered my way through this code, but it 1460 * the truth, I completely blundered my way through this code, but it
1266 * works now! */ 1461 * works now!
1462 */
1267 netfd = open_or_die("/dev/net/tun", O_RDWR); 1463 netfd = open_or_die("/dev/net/tun", O_RDWR);
1268 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR; 1464 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR;
1269 strcpy(ifr.ifr_name, "tap%d"); 1465 strcpy(ifr.ifr_name, "tap%d");
@@ -1274,18 +1470,22 @@ static int get_tun_device(char tapif[IFNAMSIZ])
1274 TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0) 1470 TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0)
1275 err(1, "Could not set features for tun device"); 1471 err(1, "Could not set features for tun device");
1276 1472
1277 /* We don't need checksums calculated for packets coming in this 1473 /*
1278 * device: trust us! */ 1474 * We don't need checksums calculated for packets coming in this
1475 * device: trust us!
1476 */
1279 ioctl(netfd, TUNSETNOCSUM, 1); 1477 ioctl(netfd, TUNSETNOCSUM, 1);
1280 1478
1281 memcpy(tapif, ifr.ifr_name, IFNAMSIZ); 1479 memcpy(tapif, ifr.ifr_name, IFNAMSIZ);
1282 return netfd; 1480 return netfd;
1283} 1481}
1284 1482
1285/*L:195 Our network is a Host<->Guest network. This can either use bridging or 1483/*L:195
1484 * Our network is a Host<->Guest network. This can either use bridging or
1286 * routing, but the principle is the same: it uses the "tun" device to inject 1485 * routing, but the principle is the same: it uses the "tun" device to inject
1287 * packets into the Host as if they came in from a normal network card. We 1486 * packets into the Host as if they came in from a normal network card. We
1288 * just shunt packets between the Guest and the tun device. */ 1487 * just shunt packets between the Guest and the tun device.
1488 */
1289static void setup_tun_net(char *arg) 1489static void setup_tun_net(char *arg)
1290{ 1490{
1291 struct device *dev; 1491 struct device *dev;
@@ -1302,13 +1502,14 @@ static void setup_tun_net(char *arg)
1302 dev = new_device("net", VIRTIO_ID_NET); 1502 dev = new_device("net", VIRTIO_ID_NET);
1303 dev->priv = net_info; 1503 dev->priv = net_info;
1304 1504
1305 /* Network devices need a receive and a send queue, just like 1505 /* Network devices need a recv and a send queue, just like console. */
1306 * console. */
1307 add_virtqueue(dev, VIRTQUEUE_NUM, net_input); 1506 add_virtqueue(dev, VIRTQUEUE_NUM, net_input);
1308 add_virtqueue(dev, VIRTQUEUE_NUM, net_output); 1507 add_virtqueue(dev, VIRTQUEUE_NUM, net_output);
1309 1508
1310 /* We need a socket to perform the magic network ioctls to bring up the 1509 /*
1311 * tap interface, connect to the bridge etc. Any socket will do! */ 1510 * We need a socket to perform the magic network ioctls to bring up the
1511 * tap interface, connect to the bridge etc. Any socket will do!
1512 */
1312 ipfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); 1513 ipfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
1313 if (ipfd < 0) 1514 if (ipfd < 0)
1314 err(1, "opening IP socket"); 1515 err(1, "opening IP socket");
@@ -1362,39 +1563,31 @@ static void setup_tun_net(char *arg)
1362 verbose("device %u: tun %s: %s\n", 1563 verbose("device %u: tun %s: %s\n",
1363 devices.device_num, tapif, arg); 1564 devices.device_num, tapif, arg);
1364} 1565}
1365 1566/*:*/
1366/* Our block (disk) device should be really simple: the Guest asks for a block
1367 * number and we read or write that position in the file. Unfortunately, that
1368 * was amazingly slow: the Guest waits until the read is finished before
1369 * running anything else, even if it could have been doing useful work.
1370 *
1371 * We could use async I/O, except it's reputed to suck so hard that characters
1372 * actually go missing from your code when you try to use it.
1373 *
1374 * So we farm the I/O out to thread, and communicate with it via a pipe. */
1375 1567
1376/* This hangs off device->priv. */ 1568/* This hangs off device->priv. */
1377struct vblk_info 1569struct vblk_info {
1378{
1379 /* The size of the file. */ 1570 /* The size of the file. */
1380 off64_t len; 1571 off64_t len;
1381 1572
1382 /* The file descriptor for the file. */ 1573 /* The file descriptor for the file. */
1383 int fd; 1574 int fd;
1384 1575
1385 /* IO thread listens on this file descriptor [0]. */
1386 int workpipe[2];
1387
1388 /* IO thread writes to this file descriptor to mark it done, then
1389 * Launcher triggers interrupt to Guest. */
1390 int done_fd;
1391}; 1576};
1392 1577
1393/*L:210 1578/*L:210
1394 * The Disk 1579 * The Disk
1395 * 1580 *
1396 * Remember that the block device is handled by a separate I/O thread. We head 1581 * The disk only has one virtqueue, so it only has one thread. It is really
1397 * straight into the core of that thread here: 1582 * simple: the Guest asks for a block number and we read or write that position
1583 * in the file.
1584 *
1585 * Before we serviced each virtqueue in a separate thread, that was unacceptably
1586 * slow: the Guest waits until the read is finished before running anything
1587 * else, even if it could have been doing useful work.
1588 *
1589 * We could have used async I/O, except it's reputed to suck so hard that
1590 * characters actually go missing from your code when you try to use it.
1398 */ 1591 */
1399static void blk_request(struct virtqueue *vq) 1592static void blk_request(struct virtqueue *vq)
1400{ 1593{
@@ -1406,47 +1599,64 @@ static void blk_request(struct virtqueue *vq)
1406 struct iovec iov[vq->vring.num]; 1599 struct iovec iov[vq->vring.num];
1407 off64_t off; 1600 off64_t off;
1408 1601
1409 /* Get the next request. */ 1602 /*
1603 * Get the next request, where we normally wait. It triggers the
1604 * interrupt to acknowledge previously serviced requests (if any).
1605 */
1410 head = wait_for_vq_desc(vq, iov, &out_num, &in_num); 1606 head = wait_for_vq_desc(vq, iov, &out_num, &in_num);
1411 1607
1412 /* Every block request should contain at least one output buffer 1608 /*
1609 * Every block request should contain at least one output buffer
1413 * (detailing the location on disk and the type of request) and one 1610 * (detailing the location on disk and the type of request) and one
1414 * input buffer (to hold the result). */ 1611 * input buffer (to hold the result).
1612 */
1415 if (out_num == 0 || in_num == 0) 1613 if (out_num == 0 || in_num == 0)
1416 errx(1, "Bad virtblk cmd %u out=%u in=%u", 1614 errx(1, "Bad virtblk cmd %u out=%u in=%u",
1417 head, out_num, in_num); 1615 head, out_num, in_num);
1418 1616
1419 out = convert(&iov[0], struct virtio_blk_outhdr); 1617 out = convert(&iov[0], struct virtio_blk_outhdr);
1420 in = convert(&iov[out_num+in_num-1], u8); 1618 in = convert(&iov[out_num+in_num-1], u8);
1619 /*
1620 * For historical reasons, block operations are expressed in 512 byte
1621 * "sectors".
1622 */
1421 off = out->sector * 512; 1623 off = out->sector * 512;
1422 1624
1423 /* The block device implements "barriers", where the Guest indicates 1625 /*
1626 * The block device implements "barriers", where the Guest indicates
1424 * that it wants all previous writes to occur before this write. We 1627 * that it wants all previous writes to occur before this write. We
1425 * don't have a way of asking our kernel to do a barrier, so we just 1628 * don't have a way of asking our kernel to do a barrier, so we just
1426 * synchronize all the data in the file. Pretty poor, no? */ 1629 * synchronize all the data in the file. Pretty poor, no?
1630 */
1427 if (out->type & VIRTIO_BLK_T_BARRIER) 1631 if (out->type & VIRTIO_BLK_T_BARRIER)
1428 fdatasync(vblk->fd); 1632 fdatasync(vblk->fd);
1429 1633
1430 /* In general the virtio block driver is allowed to try SCSI commands. 1634 /*
1431 * It'd be nice if we supported eject, for example, but we don't. */ 1635 * In general the virtio block driver is allowed to try SCSI commands.
1636 * It'd be nice if we supported eject, for example, but we don't.
1637 */
1432 if (out->type & VIRTIO_BLK_T_SCSI_CMD) { 1638 if (out->type & VIRTIO_BLK_T_SCSI_CMD) {
1433 fprintf(stderr, "Scsi commands unsupported\n"); 1639 fprintf(stderr, "Scsi commands unsupported\n");
1434 *in = VIRTIO_BLK_S_UNSUPP; 1640 *in = VIRTIO_BLK_S_UNSUPP;
1435 wlen = sizeof(*in); 1641 wlen = sizeof(*in);
1436 } else if (out->type & VIRTIO_BLK_T_OUT) { 1642 } else if (out->type & VIRTIO_BLK_T_OUT) {
1437 /* Write */ 1643 /*
1438 1644 * Write
1439 /* Move to the right location in the block file. This can fail 1645 *
1440 * if they try to write past end. */ 1646 * Move to the right location in the block file. This can fail
1647 * if they try to write past end.
1648 */
1441 if (lseek64(vblk->fd, off, SEEK_SET) != off) 1649 if (lseek64(vblk->fd, off, SEEK_SET) != off)
1442 err(1, "Bad seek to sector %llu", out->sector); 1650 err(1, "Bad seek to sector %llu", out->sector);
1443 1651
1444 ret = writev(vblk->fd, iov+1, out_num-1); 1652 ret = writev(vblk->fd, iov+1, out_num-1);
1445 verbose("WRITE to sector %llu: %i\n", out->sector, ret); 1653 verbose("WRITE to sector %llu: %i\n", out->sector, ret);
1446 1654
1447 /* Grr... Now we know how long the descriptor they sent was, we 1655 /*
1656 * Grr... Now we know how long the descriptor they sent was, we
1448 * make sure they didn't try to write over the end of the block 1657 * make sure they didn't try to write over the end of the block
1449 * file (possibly extending it). */ 1658 * file (possibly extending it).
1659 */
1450 if (ret > 0 && off + ret > vblk->len) { 1660 if (ret > 0 && off + ret > vblk->len) {
1451 /* Trim it back to the correct length */ 1661 /* Trim it back to the correct length */
1452 ftruncate64(vblk->fd, vblk->len); 1662 ftruncate64(vblk->fd, vblk->len);
@@ -1456,10 +1666,12 @@ static void blk_request(struct virtqueue *vq)
1456 wlen = sizeof(*in); 1666 wlen = sizeof(*in);
1457 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); 1667 *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR);
1458 } else { 1668 } else {
1459 /* Read */ 1669 /*
1460 1670 * Read
1461 /* Move to the right location in the block file. This can fail 1671 *
1462 * if they try to read past end. */ 1672 * Move to the right location in the block file. This can fail
1673 * if they try to read past end.
1674 */
1463 if (lseek64(vblk->fd, off, SEEK_SET) != off) 1675 if (lseek64(vblk->fd, off, SEEK_SET) != off)
1464 err(1, "Bad seek to sector %llu", out->sector); 1676 err(1, "Bad seek to sector %llu", out->sector);
1465 1677
@@ -1474,13 +1686,16 @@ static void blk_request(struct virtqueue *vq)
1474 } 1686 }
1475 } 1687 }
1476 1688
1477 /* OK, so we noted that it was pretty poor to use an fdatasync as a 1689 /*
1690 * OK, so we noted that it was pretty poor to use an fdatasync as a
1478 * barrier. But Christoph Hellwig points out that we need a sync 1691 * barrier. But Christoph Hellwig points out that we need a sync
1479 * *afterwards* as well: "Barriers specify no reordering to the front 1692 * *afterwards* as well: "Barriers specify no reordering to the front
1480 * or the back." And Jens Axboe confirmed it, so here we are: */ 1693 * or the back." And Jens Axboe confirmed it, so here we are:
1694 */
1481 if (out->type & VIRTIO_BLK_T_BARRIER) 1695 if (out->type & VIRTIO_BLK_T_BARRIER)
1482 fdatasync(vblk->fd); 1696 fdatasync(vblk->fd);
1483 1697
1698 /* Finished that request. */
1484 add_used(vq, head, wlen); 1699 add_used(vq, head, wlen);
1485} 1700}
1486 1701
@@ -1491,7 +1706,7 @@ static void setup_block_file(const char *filename)
1491 struct vblk_info *vblk; 1706 struct vblk_info *vblk;
1492 struct virtio_blk_config conf; 1707 struct virtio_blk_config conf;
1493 1708
1494 /* The device responds to return from I/O thread. */ 1709 /* Creat the device. */
1495 dev = new_device("block", VIRTIO_ID_BLOCK); 1710 dev = new_device("block", VIRTIO_ID_BLOCK);
1496 1711
1497 /* The device has one virtqueue, where the Guest places requests. */ 1712 /* The device has one virtqueue, where the Guest places requests. */
@@ -1510,27 +1725,32 @@ static void setup_block_file(const char *filename)
1510 /* Tell Guest how many sectors this device has. */ 1725 /* Tell Guest how many sectors this device has. */
1511 conf.capacity = cpu_to_le64(vblk->len / 512); 1726 conf.capacity = cpu_to_le64(vblk->len / 512);
1512 1727
1513 /* Tell Guest not to put in too many descriptors at once: two are used 1728 /*
1514 * for the in and out elements. */ 1729 * Tell Guest not to put in too many descriptors at once: two are used
1730 * for the in and out elements.
1731 */
1515 add_feature(dev, VIRTIO_BLK_F_SEG_MAX); 1732 add_feature(dev, VIRTIO_BLK_F_SEG_MAX);
1516 conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2); 1733 conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2);
1517 1734
1518 set_config(dev, sizeof(conf), &conf); 1735 /* Don't try to put whole struct: we have 8 bit limit. */
1736 set_config(dev, offsetof(struct virtio_blk_config, geometry), &conf);
1519 1737
1520 verbose("device %u: virtblock %llu sectors\n", 1738 verbose("device %u: virtblock %llu sectors\n",
1521 ++devices.device_num, le64_to_cpu(conf.capacity)); 1739 ++devices.device_num, le64_to_cpu(conf.capacity));
1522} 1740}
1523 1741
1524struct rng_info { 1742/*L:211
1525 int rfd; 1743 * Our random number generator device reads from /dev/random into the Guest's
1526};
1527
1528/* Our random number generator device reads from /dev/random into the Guest's
1529 * input buffers. The usual case is that the Guest doesn't want random numbers 1744 * input buffers. The usual case is that the Guest doesn't want random numbers
1530 * and so has no buffers although /dev/random is still readable, whereas 1745 * and so has no buffers although /dev/random is still readable, whereas
1531 * console is the reverse. 1746 * console is the reverse.
1532 * 1747 *
1533 * The same logic applies, however. */ 1748 * The same logic applies, however.
1749 */
1750struct rng_info {
1751 int rfd;
1752};
1753
1534static void rng_input(struct virtqueue *vq) 1754static void rng_input(struct virtqueue *vq)
1535{ 1755{
1536 int len; 1756 int len;
@@ -1543,9 +1763,10 @@ static void rng_input(struct virtqueue *vq)
1543 if (out_num) 1763 if (out_num)
1544 errx(1, "Output buffers in rng?"); 1764 errx(1, "Output buffers in rng?");
1545 1765
1546 /* This is why we convert to iovecs: the readv() call uses them, and so 1766 /*
1547 * it reads straight into the Guest's buffer. We loop to make sure we 1767 * Just like the console write, we loop to cover the whole iovec.
1548 * fill it. */ 1768 * In this case, short reads actually happen quite a bit.
1769 */
1549 while (!iov_empty(iov, in_num)) { 1770 while (!iov_empty(iov, in_num)) {
1550 len = readv(rng_info->rfd, iov, in_num); 1771 len = readv(rng_info->rfd, iov, in_num);
1551 if (len <= 0) 1772 if (len <= 0)
@@ -1558,15 +1779,18 @@ static void rng_input(struct virtqueue *vq)
1558 add_used(vq, head, totlen); 1779 add_used(vq, head, totlen);
1559} 1780}
1560 1781
1561/* And this creates a "hardware" random number device for the Guest. */ 1782/*L:199
1783 * This creates a "hardware" random number device for the Guest.
1784 */
1562static void setup_rng(void) 1785static void setup_rng(void)
1563{ 1786{
1564 struct device *dev; 1787 struct device *dev;
1565 struct rng_info *rng_info = malloc(sizeof(*rng_info)); 1788 struct rng_info *rng_info = malloc(sizeof(*rng_info));
1566 1789
1790 /* Our device's privat info simply contains the /dev/random fd. */
1567 rng_info->rfd = open_or_die("/dev/random", O_RDONLY); 1791 rng_info->rfd = open_or_die("/dev/random", O_RDONLY);
1568 1792
1569 /* The device responds to return from I/O thread. */ 1793 /* Create the new device. */
1570 dev = new_device("rng", VIRTIO_ID_RNG); 1794 dev = new_device("rng", VIRTIO_ID_RNG);
1571 dev->priv = rng_info; 1795 dev->priv = rng_info;
1572 1796
@@ -1582,8 +1806,10 @@ static void __attribute__((noreturn)) restart_guest(void)
1582{ 1806{
1583 unsigned int i; 1807 unsigned int i;
1584 1808
1585 /* Since we don't track all open fds, we simply close everything beyond 1809 /*
1586 * stderr. */ 1810 * Since we don't track all open fds, we simply close everything beyond
1811 * stderr.
1812 */
1587 for (i = 3; i < FD_SETSIZE; i++) 1813 for (i = 3; i < FD_SETSIZE; i++)
1588 close(i); 1814 close(i);
1589 1815
@@ -1594,8 +1820,10 @@ static void __attribute__((noreturn)) restart_guest(void)
1594 err(1, "Could not exec %s", main_args[0]); 1820 err(1, "Could not exec %s", main_args[0]);
1595} 1821}
1596 1822
1597/*L:220 Finally we reach the core of the Launcher which runs the Guest, serves 1823/*L:220
1598 * its input and output, and finally, lays it to rest. */ 1824 * Finally we reach the core of the Launcher which runs the Guest, serves
1825 * its input and output, and finally, lays it to rest.
1826 */
1599static void __attribute__((noreturn)) run_guest(void) 1827static void __attribute__((noreturn)) run_guest(void)
1600{ 1828{
1601 for (;;) { 1829 for (;;) {
@@ -1630,7 +1858,7 @@ static void __attribute__((noreturn)) run_guest(void)
1630 * 1858 *
1631 * Are you ready? Take a deep breath and join me in the core of the Host, in 1859 * Are you ready? Take a deep breath and join me in the core of the Host, in
1632 * "make Host". 1860 * "make Host".
1633 :*/ 1861:*/
1634 1862
1635static struct option opts[] = { 1863static struct option opts[] = {
1636 { "verbose", 0, NULL, 'v' }, 1864 { "verbose", 0, NULL, 'v' },
@@ -1651,8 +1879,7 @@ static void usage(void)
1651/*L:105 The main routine is where the real work begins: */ 1879/*L:105 The main routine is where the real work begins: */
1652int main(int argc, char *argv[]) 1880int main(int argc, char *argv[])
1653{ 1881{
1654 /* Memory, top-level pagetable, code startpoint and size of the 1882 /* Memory, code startpoint and size of the (optional) initrd. */
1655 * (optional) initrd. */
1656 unsigned long mem = 0, start, initrd_size = 0; 1883 unsigned long mem = 0, start, initrd_size = 0;
1657 /* Two temporaries. */ 1884 /* Two temporaries. */
1658 int i, c; 1885 int i, c;
@@ -1664,24 +1891,32 @@ int main(int argc, char *argv[])
1664 /* Save the args: we "reboot" by execing ourselves again. */ 1891 /* Save the args: we "reboot" by execing ourselves again. */
1665 main_args = argv; 1892 main_args = argv;
1666 1893
1667 /* First we initialize the device list. We keep a pointer to the last 1894 /*
1895 * First we initialize the device list. We keep a pointer to the last
1668 * device, and the next interrupt number to use for devices (1: 1896 * device, and the next interrupt number to use for devices (1:
1669 * remember that 0 is used by the timer). */ 1897 * remember that 0 is used by the timer).
1898 */
1670 devices.lastdev = NULL; 1899 devices.lastdev = NULL;
1671 devices.next_irq = 1; 1900 devices.next_irq = 1;
1672 1901
1902 /* We're CPU 0. In fact, that's the only CPU possible right now. */
1673 cpu_id = 0; 1903 cpu_id = 0;
1674 /* We need to know how much memory so we can set up the device 1904
1905 /*
1906 * We need to know how much memory so we can set up the device
1675 * descriptor and memory pages for the devices as we parse the command 1907 * descriptor and memory pages for the devices as we parse the command
1676 * line. So we quickly look through the arguments to find the amount 1908 * line. So we quickly look through the arguments to find the amount
1677 * of memory now. */ 1909 * of memory now.
1910 */
1678 for (i = 1; i < argc; i++) { 1911 for (i = 1; i < argc; i++) {
1679 if (argv[i][0] != '-') { 1912 if (argv[i][0] != '-') {
1680 mem = atoi(argv[i]) * 1024 * 1024; 1913 mem = atoi(argv[i]) * 1024 * 1024;
1681 /* We start by mapping anonymous pages over all of 1914 /*
1915 * We start by mapping anonymous pages over all of
1682 * guest-physical memory range. This fills it with 0, 1916 * guest-physical memory range. This fills it with 0,
1683 * and ensures that the Guest won't be killed when it 1917 * and ensures that the Guest won't be killed when it
1684 * tries to access it. */ 1918 * tries to access it.
1919 */
1685 guest_base = map_zeroed_pages(mem / getpagesize() 1920 guest_base = map_zeroed_pages(mem / getpagesize()
1686 + DEVICE_PAGES); 1921 + DEVICE_PAGES);
1687 guest_limit = mem; 1922 guest_limit = mem;
@@ -1714,8 +1949,10 @@ int main(int argc, char *argv[])
1714 usage(); 1949 usage();
1715 } 1950 }
1716 } 1951 }
1717 /* After the other arguments we expect memory and kernel image name, 1952 /*
1718 * followed by command line arguments for the kernel. */ 1953 * After the other arguments we expect memory and kernel image name,
1954 * followed by command line arguments for the kernel.
1955 */
1719 if (optind + 2 > argc) 1956 if (optind + 2 > argc)
1720 usage(); 1957 usage();
1721 1958
@@ -1733,20 +1970,26 @@ int main(int argc, char *argv[])
1733 /* Map the initrd image if requested (at top of physical memory) */ 1970 /* Map the initrd image if requested (at top of physical memory) */
1734 if (initrd_name) { 1971 if (initrd_name) {
1735 initrd_size = load_initrd(initrd_name, mem); 1972 initrd_size = load_initrd(initrd_name, mem);
1736 /* These are the location in the Linux boot header where the 1973 /*
1737 * start and size of the initrd are expected to be found. */ 1974 * These are the location in the Linux boot header where the
1975 * start and size of the initrd are expected to be found.
1976 */
1738 boot->hdr.ramdisk_image = mem - initrd_size; 1977 boot->hdr.ramdisk_image = mem - initrd_size;
1739 boot->hdr.ramdisk_size = initrd_size; 1978 boot->hdr.ramdisk_size = initrd_size;
1740 /* The bootloader type 0xFF means "unknown"; that's OK. */ 1979 /* The bootloader type 0xFF means "unknown"; that's OK. */
1741 boot->hdr.type_of_loader = 0xFF; 1980 boot->hdr.type_of_loader = 0xFF;
1742 } 1981 }
1743 1982
1744 /* The Linux boot header contains an "E820" memory map: ours is a 1983 /*
1745 * simple, single region. */ 1984 * The Linux boot header contains an "E820" memory map: ours is a
1985 * simple, single region.
1986 */
1746 boot->e820_entries = 1; 1987 boot->e820_entries = 1;
1747 boot->e820_map[0] = ((struct e820entry) { 0, mem, E820_RAM }); 1988 boot->e820_map[0] = ((struct e820entry) { 0, mem, E820_RAM });
1748 /* The boot header contains a command line pointer: we put the command 1989 /*
1749 * line after the boot header. */ 1990 * The boot header contains a command line pointer: we put the command
1991 * line after the boot header.
1992 */
1750 boot->hdr.cmd_line_ptr = to_guest_phys(boot + 1); 1993 boot->hdr.cmd_line_ptr = to_guest_phys(boot + 1);
1751 /* We use a simple helper to copy the arguments separated by spaces. */ 1994 /* We use a simple helper to copy the arguments separated by spaces. */
1752 concat((char *)(boot + 1), argv+optind+2); 1995 concat((char *)(boot + 1), argv+optind+2);
@@ -1760,11 +2003,13 @@ int main(int argc, char *argv[])
1760 /* Tell the entry path not to try to reload segment registers. */ 2003 /* Tell the entry path not to try to reload segment registers. */
1761 boot->hdr.loadflags |= KEEP_SEGMENTS; 2004 boot->hdr.loadflags |= KEEP_SEGMENTS;
1762 2005
1763 /* We tell the kernel to initialize the Guest: this returns the open 2006 /*
1764 * /dev/lguest file descriptor. */ 2007 * We tell the kernel to initialize the Guest: this returns the open
2008 * /dev/lguest file descriptor.
2009 */
1765 tell_kernel(start); 2010 tell_kernel(start);
1766 2011
1767 /* Ensure that we terminate if a child dies. */ 2012 /* Ensure that we terminate if a device-servicing child dies. */
1768 signal(SIGCHLD, kill_launcher); 2013 signal(SIGCHLD, kill_launcher);
1769 2014
1770 /* If we exit via err(), this kills all the threads, restores tty. */ 2015 /* If we exit via err(), this kills all the threads, restores tty. */
diff --git a/Documentation/networking/6pack.txt b/Documentation/networking/6pack.txt
index d0777a1200e1..8f339428fdf4 100644
--- a/Documentation/networking/6pack.txt
+++ b/Documentation/networking/6pack.txt
@@ -1,7 +1,7 @@
1This is the 6pack-mini-HOWTO, written by 1This is the 6pack-mini-HOWTO, written by
2 2
3Andreas Könsgen DG3KQ 3Andreas Könsgen DG3KQ
4Internet: ajk@iehk.rwth-aachen.de 4Internet: ajk@comnets.uni-bremen.de
5AMPR-net: dg3kq@db0pra.ampr.org 5AMPR-net: dg3kq@db0pra.ampr.org
6AX.25: dg3kq@db0ach.#nrw.deu.eu 6AX.25: dg3kq@db0ach.#nrw.deu.eu
7 7
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 1df7f9cdab05..86eabe6c3419 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -73,7 +73,7 @@ The remaining CPU time will be used for user input and other tasks. Because
73realtime tasks have explicitly allocated the CPU time they need to perform 73realtime tasks have explicitly allocated the CPU time they need to perform
74their tasks, buffer underruns in the graphics or audio can be eliminated. 74their tasks, buffer underruns in the graphics or audio can be eliminated.
75 75
76NOTE: the above example is not fully implemented as of yet (2.6.25). We still 76NOTE: the above example is not fully implemented yet. We still
77lack an EDF scheduler to make non-uniform periods usable. 77lack an EDF scheduler to make non-uniform periods usable.
78 78
79 79
@@ -140,14 +140,15 @@ The other option is:
140 140
141.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups") 141.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
142 142
143This uses the /cgroup virtual file system and "/cgroup/<cgroup>/cpu.rt_runtime_us" 143This uses the /cgroup virtual file system and
144to control the CPU time reserved for each control group instead. 144"/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each
145control group instead.
145 146
146For more information on working with control groups, you should read 147For more information on working with control groups, you should read
147Documentation/cgroups/cgroups.txt as well. 148Documentation/cgroups/cgroups.txt as well.
148 149
149Group settings are checked against the following limits in order to keep the configuration 150Group settings are checked against the following limits in order to keep the
150schedulable: 151configuration schedulable:
151 152
152 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period 153 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period
153 154
@@ -189,7 +190,7 @@ Implementing SCHED_EDF might take a while to complete. Priority Inheritance is
189the biggest challenge as the current linux PI infrastructure is geared towards 190the biggest challenge as the current linux PI infrastructure is geared towards
190the limited static priority levels 0-99. With deadline scheduling you need to 191the limited static priority levels 0-99. With deadline scheduling you need to
191do deadline inheritance (since priority is inversely proportional to the 192do deadline inheritance (since priority is inversely proportional to the
192deadline delta (deadline - now). 193deadline delta (deadline - now)).
193 194
194This means the whole PI machinery will have to be reworked - and that is one of 195This means the whole PI machinery will have to be reworked - and that is one of
195the most complex pieces of code we have. 196the most complex pieces of code we have.
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt
index 381908d8ca42..719a819f8cc2 100644
--- a/Documentation/sound/alsa/Procfile.txt
+++ b/Documentation/sound/alsa/Procfile.txt
@@ -101,6 +101,8 @@ card*/pcm*/xrun_debug
101 bit 0 = Enable XRUN/jiffies debug messages 101 bit 0 = Enable XRUN/jiffies debug messages
102 bit 1 = Show stack trace at XRUN / jiffies check 102 bit 1 = Show stack trace at XRUN / jiffies check
103 bit 2 = Enable additional jiffies check 103 bit 2 = Enable additional jiffies check
104 bit 3 = Log hwptr update at each period interrupt
105 bit 4 = Log hwptr update at each snd_pcm_update_hw_ptr()
104 106
105 When the bit 0 is set, the driver will show the messages to 107 When the bit 0 is set, the driver will show the messages to
106 kernel log when an xrun is detected. The debug message is 108 kernel log when an xrun is detected. The debug message is
@@ -117,6 +119,9 @@ card*/pcm*/xrun_debug
117 buggy) hardware that doesn't give smooth pointer updates. 119 buggy) hardware that doesn't give smooth pointer updates.
118 This feature is enabled via the bit 2. 120 This feature is enabled via the bit 2.
119 121
122 Bits 3 and 4 are for logging the hwptr records. Note that
123 these will give flood of kernel messages.
124
120card*/pcm*/sub*/info 125card*/pcm*/sub*/info
121 The general information of this PCM sub-stream. 126 The general information of this PCM sub-stream.
122 127
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index cf42b820ff9d..d56a01775423 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -66,7 +66,8 @@ On all - write a character to /proc/sysrq-trigger. e.g.:
66'b' - Will immediately reboot the system without syncing or unmounting 66'b' - Will immediately reboot the system without syncing or unmounting
67 your disks. 67 your disks.
68 68
69'c' - Will perform a kexec reboot in order to take a crashdump. 69'c' - Will perform a system crash by a NULL pointer dereference.
70 A crashdump will be taken if configured.
70 71
71'd' - Shows all locks that are held. 72'd' - Shows all locks that are held.
72 73
@@ -141,8 +142,8 @@ useful when you want to exit a program that will not let you switch consoles.
141re'B'oot is good when you're unable to shut down. But you should also 'S'ync 142re'B'oot is good when you're unable to shut down. But you should also 'S'ync
142and 'U'mount first. 143and 'U'mount first.
143 144
144'C'rashdump can be used to manually trigger a crashdump when the system is hung. 145'C'rash can be used to manually trigger a crashdump when the system is hung.
145The kernel needs to have been built with CONFIG_KEXEC enabled. 146Note that this just triggers a crash if there is no dump mechanism available.
146 147
147'S'ync is great when your system is locked up, it allows you to sync your 148'S'ync is great when your system is locked up, it allows you to sync your
148disks and will certainly lessen the chance of data loss and fscking. Note 149disks and will certainly lessen the chance of data loss and fscking. Note
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index 014d255231fc..68c236c01846 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -20,7 +20,7 @@
20 19 -> EM2860/SAA711X Reference Design (em2860) 20 19 -> EM2860/SAA711X Reference Design (em2860)
21 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002] 21 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002]
22 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801] 22 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801]
23 22 -> Unknown EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751] 23 22 -> EM2710/EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751]
24 23 -> Huaqi DLCW-130 (em2750) 24 23 -> Huaqi DLCW-130 (em2750)
25 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112] 25 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112]
26 25 -> Gadmei UTV310 (em2820/em2840) 26 25 -> Gadmei UTV310 (em2820/em2840)
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 2bcf78896e22..573f95b58807 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -44,7 +44,9 @@ zc3xx 0458:7007 Genius VideoCam V2
44zc3xx 0458:700c Genius VideoCam V3 44zc3xx 0458:700c Genius VideoCam V3
45zc3xx 0458:700f Genius VideoCam Web V2 45zc3xx 0458:700f Genius VideoCam Web V2
46sonixj 0458:7025 Genius Eye 311Q 46sonixj 0458:7025 Genius Eye 311Q
47sn9c20x 0458:7029 Genius Look 320s
47sonixj 0458:702e Genius Slim 310 NB 48sonixj 0458:702e Genius Slim 310 NB
49sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650)
48sonixj 045e:00f5 MicroSoft VX3000 50sonixj 045e:00f5 MicroSoft VX3000
49sonixj 045e:00f7 MicroSoft VX1000 51sonixj 045e:00f7 MicroSoft VX1000
50ov519 045e:028c Micro$oft xbox cam 52ov519 045e:028c Micro$oft xbox cam
@@ -282,6 +284,28 @@ sonixj 0c45:613a Microdia Sonix PC Camera
282sonixj 0c45:613b Surfer SN-206 284sonixj 0c45:613b Surfer SN-206
283sonixj 0c45:613c Sonix Pccam168 285sonixj 0c45:613c Sonix Pccam168
284sonixj 0c45:6143 Sonix Pccam168 286sonixj 0c45:6143 Sonix Pccam168
287sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001)
288sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111)
289sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655)
290sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968)
291sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650)
292sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650)
293sn9c20x 0c45:6253 PC Camera (SN9C201 + OV9650)
294sn9c20x 0c45:6260 PC Camera (SN9C201 + OV7670)
295sn9c20x 0c45:6270 PC Camera (SN9C201 + MT9V011/MT9V111/MT9V112)
296sn9c20x 0c45:627b PC Camera (SN9C201 + OV7660)
297sn9c20x 0c45:627c PC Camera (SN9C201 + HV7131R)
298sn9c20x 0c45:627f PC Camera (SN9C201 + OV9650)
299sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001)
300sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111)
301sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655)
302sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968)
303sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650)
304sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670)
305sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112)
306sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655)
307sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660)
308sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R)
285sunplus 0d64:0303 Sunplus FashionCam DXG 309sunplus 0d64:0303 Sunplus FashionCam DXG
286etoms 102c:6151 Qcam Sangha CIF 310etoms 102c:6151 Qcam Sangha CIF
287etoms 102c:6251 Qcam xxxxxx VGA 311etoms 102c:6251 Qcam xxxxxx VGA
@@ -290,6 +314,7 @@ spca561 10fd:7e50 FlyCam Usb 100
290zc3xx 10fd:8050 Typhoon Webshot II USB 300k 314zc3xx 10fd:8050 Typhoon Webshot II USB 300k
291ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201) 315ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201)
292pac207 145f:013a Trust WB-1300N 316pac207 145f:013a Trust WB-1300N
317sn9c20x 145f:013d Trust WB-3600R
293vc032x 15b8:6001 HP 2.0 Megapixel 318vc032x 15b8:6001 HP 2.0 Megapixel
294vc032x 15b8:6002 HP 2.0 Megapixel rz406aa 319vc032x 15b8:6002 HP 2.0 Megapixel rz406aa
295spca501 1776:501c Arowana 300K CMOS Camera 320spca501 1776:501c Arowana 300K CMOS Camera
@@ -300,4 +325,11 @@ spca500 2899:012c Toptro Industrial
300spca508 8086:0110 Intel Easy PC Camera 325spca508 8086:0110 Intel Easy PC Camera
301spca500 8086:0630 Intel Pocket PC Camera 326spca500 8086:0630 Intel Pocket PC Camera
302spca506 99fa:8988 Grandtec V.cap 327spca506 99fa:8988 Grandtec V.cap
328sn9c20x a168:0610 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
329sn9c20x a168:0611 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
330sn9c20x a168:0613 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
331sn9c20x a168:0618 Dino-Lite Digital Microscope (SN9C201 + HV7131R)
332sn9c20x a168:0614 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
333sn9c20x a168:0615 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
334sn9c20x a168:0617 Dino-Lite Digital Microscope (SN9C201 + MT9M111)
303spca561 abcd:cdee Petcam 335spca561 abcd:cdee Petcam
diff --git a/MAINTAINERS b/MAINTAINERS
index 7b91c6e69d55..ed6a10349b14 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -73,8 +73,8 @@ Note: For the hard of thinking, this list is meant to remain in alphabetical
73order. If you could add yourselves to it in alphabetical order that would be 73order. If you could add yourselves to it in alphabetical order that would be
74so much easier [Ed] 74so much easier [Ed]
75 75
76P: Person 76P: Person (obsolete)
77M: Mail patches to 77M: Mail patches to: FullName <address@domain>
78L: Mailing list that is relevant to this area 78L: Mailing list that is relevant to this area
79W: Web-page with status/info 79W: Web-page with status/info
80T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. 80T: SCM tree type and location. Type is one of: git, hg, quilt, stgit.
@@ -104,88 +104,74 @@ X: Files and directories that are NOT maintained, same rules as F:
104 matches all files in and below net excluding net/ipv6/ 104 matches all files in and below net excluding net/ipv6/
105 105
1063C505 NETWORK DRIVER 1063C505 NETWORK DRIVER
107P: Philip Blundell 107M: Philip Blundell <philb@gnu.org>
108M: philb@gnu.org
109L: netdev@vger.kernel.org 108L: netdev@vger.kernel.org
110S: Maintained 109S: Maintained
111F: drivers/net/3c505* 110F: drivers/net/3c505*
112 111
1133C59X NETWORK DRIVER 1123C59X NETWORK DRIVER
114P: Steffen Klassert 113M: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
115M: klassert@mathematik.tu-chemnitz.de
116L: netdev@vger.kernel.org 114L: netdev@vger.kernel.org
117S: Maintained 115S: Maintained
118F: Documentation/networking/vortex.txt 116F: Documentation/networking/vortex.txt
119F: drivers/net/3c59x.c 117F: drivers/net/3c59x.c
120 118
1213CR990 NETWORK DRIVER 1193CR990 NETWORK DRIVER
122P: David Dillow 120M: David Dillow <dave@thedillows.org>
123M: dave@thedillows.org
124L: netdev@vger.kernel.org 121L: netdev@vger.kernel.org
125S: Maintained 122S: Maintained
126F: drivers/net/typhoon* 123F: drivers/net/typhoon*
127 124
1283W-9XXX SATA-RAID CONTROLLER DRIVER 1253W-9XXX SATA-RAID CONTROLLER DRIVER
129P: Adam Radford 126M: Adam Radford <linuxraid@amcc.com>
130M: linuxraid@amcc.com
131L: linux-scsi@vger.kernel.org 127L: linux-scsi@vger.kernel.org
132W: http://www.amcc.com 128W: http://www.amcc.com
133S: Supported 129S: Supported
134F: drivers/scsi/3w-9xxx* 130F: drivers/scsi/3w-9xxx*
135 131
1363W-XXXX ATA-RAID CONTROLLER DRIVER 1323W-XXXX ATA-RAID CONTROLLER DRIVER
137P: Adam Radford 133M: Adam Radford <linuxraid@amcc.com>
138M: linuxraid@amcc.com
139L: linux-scsi@vger.kernel.org 134L: linux-scsi@vger.kernel.org
140W: http://www.amcc.com 135W: http://www.amcc.com
141S: Supported 136S: Supported
142F: drivers/scsi/3w-xxxx* 137F: drivers/scsi/3w-xxxx*
143 138
14453C700 AND 53C700-66 SCSI DRIVER 13953C700 AND 53C700-66 SCSI DRIVER
145P: James E.J. Bottomley 140M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
146M: James.Bottomley@HansenPartnership.com
147L: linux-scsi@vger.kernel.org 141L: linux-scsi@vger.kernel.org
148S: Maintained 142S: Maintained
149F: drivers/scsi/53c700* 143F: drivers/scsi/53c700*
150 144
1516PACK NETWORK DRIVER FOR AX.25 1456PACK NETWORK DRIVER FOR AX.25
152P: Andreas Koensgen 146M: Andreas Koensgen <ajk@comnets.uni-bremen.de>
153M: ajk@iehk.rwth-aachen.de
154L: linux-hams@vger.kernel.org 147L: linux-hams@vger.kernel.org
155S: Maintained 148S: Maintained
156F: drivers/net/hamradio/6pack.c 149F: drivers/net/hamradio/6pack.c
157 150
1588169 10/100/1000 GIGABIT ETHERNET DRIVER 1518169 10/100/1000 GIGABIT ETHERNET DRIVER
159P: Francois Romieu 152M: Francois Romieu <romieu@fr.zoreil.com>
160M: romieu@fr.zoreil.com
161L: netdev@vger.kernel.org 153L: netdev@vger.kernel.org
162S: Maintained 154S: Maintained
163F: drivers/net/r8169.c 155F: drivers/net/r8169.c
164 156
1658250/16?50 (AND CLONE UARTS) SERIAL DRIVER 1578250/16?50 (AND CLONE UARTS) SERIAL DRIVER
166P: Alan Cox
167M: alan@lxorguk.ukuu.org.uk
168L: linux-serial@vger.kernel.org 158L: linux-serial@vger.kernel.org
169W: http://serial.sourceforge.net 159W: http://serial.sourceforge.net
170S: Odd Fixes 160S: Orphan
171F: drivers/serial/8250* 161F: drivers/serial/8250*
172F: include/linux/serial_8250.h 162F: include/linux/serial_8250.h
173 163
1748390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.] 1648390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
175P: Paul Gortmaker 165M: Paul Gortmaker <p_gortmaker@yahoo.com>
176M: p_gortmaker@yahoo.com
177L: netdev@vger.kernel.org 166L: netdev@vger.kernel.org
178S: Maintained 167S: Maintained
179F: drivers/net/*8390* 168F: drivers/net/*8390*
180F: drivers/net/ax88796.c 169F: drivers/net/ax88796.c
181 170
1829P FILE SYSTEM 1719P FILE SYSTEM
183P: Eric Van Hensbergen 172M: Eric Van Hensbergen <ericvh@gmail.com>
184M: ericvh@gmail.com 173M: Ron Minnich <rminnich@sandia.gov>
185P: Ron Minnich 174M: Latchesar Ionkov <lucho@ionkov.net>
186M: rminnich@sandia.gov
187P: Latchesar Ionkov
188M: lucho@ionkov.net
189L: v9fs-developer@lists.sourceforge.net 175L: v9fs-developer@lists.sourceforge.net
190W: http://swik.net/v9fs 176W: http://swik.net/v9fs
191T: git git://git.kernel.org/pub/scm/linux/kernel/ericvh/v9fs.git 177T: git git://git.kernel.org/pub/scm/linux/kernel/ericvh/v9fs.git
@@ -194,15 +180,13 @@ F: Documentation/filesystems/9p.txt
194F: fs/9p/ 180F: fs/9p/
195 181
196A2232 SERIAL BOARD DRIVER 182A2232 SERIAL BOARD DRIVER
197P: Enver Haase 183M: Enver Haase <A2232@gmx.net>
198M: A2232@gmx.net
199L: linux-m68k@lists.linux-m68k.org 184L: linux-m68k@lists.linux-m68k.org
200S: Maintained 185S: Maintained
201F: drivers/char/ser_a2232* 186F: drivers/char/ser_a2232*
202 187
203AACRAID SCSI RAID DRIVER 188AACRAID SCSI RAID DRIVER
204P: Adaptec OEM Raid Solutions 189M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
205M: aacraid@adaptec.com
206L: linux-scsi@vger.kernel.org 190L: linux-scsi@vger.kernel.org
207W: http://www.adaptec.com/ 191W: http://www.adaptec.com/
208S: Supported 192S: Supported
@@ -210,44 +194,38 @@ F: Documentation/scsi/aacraid.txt
210F: drivers/scsi/aacraid/ 194F: drivers/scsi/aacraid/
211 195
212ABIT UGURU 1,2 HARDWARE MONITOR DRIVER 196ABIT UGURU 1,2 HARDWARE MONITOR DRIVER
213P: Hans de Goede 197M: Hans de Goede <j.w.r.degoede@hhs.nl>
214M: j.w.r.degoede@hhs.nl
215L: lm-sensors@lm-sensors.org 198L: lm-sensors@lm-sensors.org
216S: Maintained 199S: Maintained
217F: drivers/hwmon/abituguru.c 200F: drivers/hwmon/abituguru.c
218 201
219ABIT UGURU 3 HARDWARE MONITOR DRIVER 202ABIT UGURU 3 HARDWARE MONITOR DRIVER
220P: Alistair John Strachan 203M: Alistair John Strachan <alistair@devzero.co.uk>
221M: alistair@devzero.co.uk
222L: lm-sensors@lm-sensors.org 204L: lm-sensors@lm-sensors.org
223S: Maintained 205S: Maintained
224F: drivers/hwmon/abituguru3.c 206F: drivers/hwmon/abituguru3.c
225 207
226ACENIC DRIVER 208ACENIC DRIVER
227P: Jes Sorensen 209M: Jes Sorensen <jes@trained-monkey.org>
228M: jes@trained-monkey.org
229L: linux-acenic@sunsite.dk 210L: linux-acenic@sunsite.dk
230S: Maintained 211S: Maintained
231F: drivers/net/acenic* 212F: drivers/net/acenic*
232 213
233ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER 214ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER
234P: Peter Feuerer 215M: Peter Feuerer <peter@piie.net>
235M: peter@piie.net 216W: http://piie.net/?section=acerhdf
236W: http://piie.net/?section=acerhdf 217S: Maintained
237S: Maintained 218F: drivers/platform/x86/acerhdf.c
238F: drivers/platform/x86/acerhdf.c
239 219
240ACER WMI LAPTOP EXTRAS 220ACER WMI LAPTOP EXTRAS
241P: Carlos Corbacho 221M: Carlos Corbacho <carlos@strangeworlds.co.uk>
242M: carlos@strangeworlds.co.uk
243L: aceracpi@googlegroups.com (subscribers-only) 222L: aceracpi@googlegroups.com (subscribers-only)
244W: http://code.google.com/p/aceracpi 223W: http://code.google.com/p/aceracpi
245S: Maintained 224S: Maintained
246F: drivers/platform/x86/acer-wmi.c 225F: drivers/platform/x86/acer-wmi.c
247 226
248ACPI 227ACPI
249P: Len Brown 228M: Len Brown <lenb@kernel.org>
250M: lenb@kernel.org
251L: linux-acpi@vger.kernel.org 229L: linux-acpi@vger.kernel.org
252W: http://www.lesswatts.org/projects/acpi/ 230W: http://www.lesswatts.org/projects/acpi/
253T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 231T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
@@ -257,8 +235,7 @@ F: drivers/pnp/pnpacpi/
257F: include/linux/acpi.h 235F: include/linux/acpi.h
258 236
259ACPI BATTERY DRIVERS 237ACPI BATTERY DRIVERS
260P: Alexey Starikovskiy 238M: Alexey Starikovskiy <astarikovskiy@suse.de>
261M: astarikovskiy@suse.de
262L: linux-acpi@vger.kernel.org 239L: linux-acpi@vger.kernel.org
263W: http://www.lesswatts.org/projects/acpi/ 240W: http://www.lesswatts.org/projects/acpi/
264S: Supported 241S: Supported
@@ -266,80 +243,69 @@ F: drivers/acpi/battery.c
266F: drivers/acpi/*sbs* 243F: drivers/acpi/*sbs*
267 244
268ACPI EC DRIVER 245ACPI EC DRIVER
269P: Alexey Starikovskiy 246M: Alexey Starikovskiy <astarikovskiy@suse.de>
270M: astarikovskiy@suse.de
271L: linux-acpi@vger.kernel.org 247L: linux-acpi@vger.kernel.org
272W: http://www.lesswatts.org/projects/acpi/ 248W: http://www.lesswatts.org/projects/acpi/
273S: Supported 249S: Supported
274F: drivers/acpi/ec.c 250F: drivers/acpi/ec.c
275 251
276ACPI FAN DRIVER 252ACPI FAN DRIVER
277P: Zhang Rui 253M: Zhang Rui <rui.zhang@intel.com>
278M: rui.zhang@intel.com
279L: linux-acpi@vger.kernel.org 254L: linux-acpi@vger.kernel.org
280W: http://www.lesswatts.org/projects/acpi/ 255W: http://www.lesswatts.org/projects/acpi/
281S: Supported 256S: Supported
282F: drivers/acpi/fan.c 257F: drivers/acpi/fan.c
283 258
284ACPI PCI HOTPLUG DRIVER 259ACPI PCI HOTPLUG DRIVER
285P: Kristen Carlson Accardi 260M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
286M: kristen.c.accardi@intel.com
287L: linux-pci@vger.kernel.org 261L: linux-pci@vger.kernel.org
288S: Supported 262S: Supported
289F: drivers/pci/hotplug/acpi* 263F: drivers/pci/hotplug/acpi*
290 264
291ACPI THERMAL DRIVER 265ACPI THERMAL DRIVER
292P: Zhang Rui 266M: Zhang Rui <rui.zhang@intel.com>
293M: rui.zhang@intel.com
294L: linux-acpi@vger.kernel.org 267L: linux-acpi@vger.kernel.org
295W: http://www.lesswatts.org/projects/acpi/ 268W: http://www.lesswatts.org/projects/acpi/
296S: Supported 269S: Supported
297F: drivers/acpi/*thermal* 270F: drivers/acpi/*thermal*
298 271
299ACPI VIDEO DRIVER 272ACPI VIDEO DRIVER
300P: Zhang Rui 273M: Zhang Rui <rui.zhang@intel.com>
301M: rui.zhang@intel.com
302L: linux-acpi@vger.kernel.org 274L: linux-acpi@vger.kernel.org
303W: http://www.lesswatts.org/projects/acpi/ 275W: http://www.lesswatts.org/projects/acpi/
304S: Supported 276S: Supported
305F: drivers/acpi/video.c 277F: drivers/acpi/video.c
306 278
307ACPI WMI DRIVER 279ACPI WMI DRIVER
308P: Carlos Corbacho 280M: Carlos Corbacho <carlos@strangeworlds.co.uk>
309M: carlos@strangeworlds.co.uk
310L: linux-acpi@vger.kernel.org 281L: linux-acpi@vger.kernel.org
311W: http://www.lesswatts.org/projects/acpi/ 282W: http://www.lesswatts.org/projects/acpi/
312S: Maintained 283S: Maintained
313F: drivers/platform/x86/wmi.c 284F: drivers/platform/x86/wmi.c
314 285
315AD1889 ALSA SOUND DRIVER 286AD1889 ALSA SOUND DRIVER
316P: Kyle McMartin 287M: Kyle McMartin <kyle@mcmartin.ca>
317M: kyle@mcmartin.ca 288M: Thibaut Varene <T-Bone@parisc-linux.org>
318P: Thibaut Varene
319M: T-Bone@parisc-linux.org
320W: http://wiki.parisc-linux.org/AD1889 289W: http://wiki.parisc-linux.org/AD1889
321L: linux-parisc@vger.kernel.org 290L: linux-parisc@vger.kernel.org
322S: Maintained 291S: Maintained
323F: sound/pci/ad1889.* 292F: sound/pci/ad1889.*
324 293
325ADM1025 HARDWARE MONITOR DRIVER 294ADM1025 HARDWARE MONITOR DRIVER
326P: Jean Delvare 295M: Jean Delvare <khali@linux-fr.org>
327M: khali@linux-fr.org
328L: lm-sensors@lm-sensors.org 296L: lm-sensors@lm-sensors.org
329S: Maintained 297S: Maintained
330F: Documentation/hwmon/adm1025 298F: Documentation/hwmon/adm1025
331F: drivers/hwmon/adm1025.c 299F: drivers/hwmon/adm1025.c
332 300
333ADM1029 HARDWARE MONITOR DRIVER 301ADM1029 HARDWARE MONITOR DRIVER
334P: Corentin Labbe 302M: Corentin Labbe <corentin.labbe@geomatys.fr>
335M: corentin.labbe@geomatys.fr
336L: lm-sensors@lm-sensors.org 303L: lm-sensors@lm-sensors.org
337S: Maintained 304S: Maintained
338F: drivers/hwmon/adm1029.c 305F: drivers/hwmon/adm1029.c
339 306
340ADM8211 WIRELESS DRIVER 307ADM8211 WIRELESS DRIVER
341P: Michael Wu 308M: Michael Wu <flamingice@sourmilk.net>
342M: flamingice@sourmilk.net
343L: linux-wireless@vger.kernel.org 309L: linux-wireless@vger.kernel.org
344W: http://linuxwireless.org/ 310W: http://linuxwireless.org/
345T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git 311T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
@@ -347,35 +313,30 @@ S: Maintained
347F: drivers/net/wireless/adm8211.* 313F: drivers/net/wireless/adm8211.*
348 314
349ADT746X FAN DRIVER 315ADT746X FAN DRIVER
350P: Colin Leroy 316M: Colin Leroy <colin@colino.net>
351M: colin@colino.net
352S: Maintained 317S: Maintained
353F: drivers/macintosh/therm_adt746x.c 318F: drivers/macintosh/therm_adt746x.c
354 319
355ADVANSYS SCSI DRIVER 320ADVANSYS SCSI DRIVER
356P: Matthew Wilcox 321M: Matthew Wilcox <matthew@wil.cx>
357M: matthew@wil.cx
358L: linux-scsi@vger.kernel.org 322L: linux-scsi@vger.kernel.org
359S: Maintained 323S: Maintained
360F: Documentation/scsi/advansys.txt 324F: Documentation/scsi/advansys.txt
361F: drivers/scsi/advansys.c 325F: drivers/scsi/advansys.c
362 326
363AEDSP16 DRIVER 327AEDSP16 DRIVER
364P: Riccardo Facchetti 328M: Riccardo Facchetti <fizban@tin.it>
365M: fizban@tin.it
366S: Maintained 329S: Maintained
367F: sound/oss/aedsp16.c 330F: sound/oss/aedsp16.c
368 331
369AFFS FILE SYSTEM 332AFFS FILE SYSTEM
370P: Roman Zippel 333M: Roman Zippel <zippel@linux-m68k.org>
371M: zippel@linux-m68k.org
372S: Maintained 334S: Maintained
373F: Documentation/filesystems/affs.txt 335F: Documentation/filesystems/affs.txt
374F: fs/affs/ 336F: fs/affs/
375 337
376AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN 338AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN
377P: David Howells 339M: David Howells <dhowells@redhat.com>
378M: dhowells@redhat.com
379L: linux-afs@lists.infradead.org 340L: linux-afs@lists.infradead.org
380S: Supported 341S: Supported
381F: fs/afs/ 342F: fs/afs/
@@ -383,40 +344,35 @@ F: include/net/af_rxrpc.h
383F: net/rxrpc/af_rxrpc.c 344F: net/rxrpc/af_rxrpc.c
384 345
385AGPGART DRIVER 346AGPGART DRIVER
386P: David Airlie 347M: David Airlie <airlied@linux.ie>
387M: airlied@linux.ie
388T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git 348T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
389S: Maintained 349S: Maintained
390F: drivers/char/agp/ 350F: drivers/char/agp/
391F: include/linux/agp* 351F: include/linux/agp*
392 352
393AHA152X SCSI DRIVER 353AHA152X SCSI DRIVER
394P: Juergen E. Fischer 354M: "Juergen E. Fischer" <fischer@norbit.de>
395M: fischer@norbit.de
396L: linux-scsi@vger.kernel.org 355L: linux-scsi@vger.kernel.org
397S: Maintained 356S: Maintained
398F: drivers/scsi/aha152x* 357F: drivers/scsi/aha152x*
399F: drivers/scsi/pcmcia/aha152x* 358F: drivers/scsi/pcmcia/aha152x*
400 359
401AIC7XXX / AIC79XX SCSI DRIVER 360AIC7XXX / AIC79XX SCSI DRIVER
402P: Hannes Reinecke 361M: Hannes Reinecke <hare@suse.de>
403M: hare@suse.de
404L: linux-scsi@vger.kernel.org 362L: linux-scsi@vger.kernel.org
405S: Maintained 363S: Maintained
406F: drivers/scsi/aic7xxx/ 364F: drivers/scsi/aic7xxx/
407F: drivers/scsi/aic7xxx_old/ 365F: drivers/scsi/aic7xxx_old/
408 366
409AIO 367AIO
410P: Benjamin LaHaise 368M: Benjamin LaHaise <bcrl@kvack.org>
411M: bcrl@kvack.org
412L: linux-aio@kvack.org 369L: linux-aio@kvack.org
413S: Supported 370S: Supported
414F: fs/aio.c 371F: fs/aio.c
415F: include/linux/*aio*.h 372F: include/linux/*aio*.h
416 373
417ALCATEL SPEEDTOUCH USB DRIVER 374ALCATEL SPEEDTOUCH USB DRIVER
418P: Duncan Sands 375M: Duncan Sands <duncan.sands@free.fr>
419M: duncan.sands@free.fr
420L: linux-usb@vger.kernel.org 376L: linux-usb@vger.kernel.org
421W: http://www.linux-usb.org/SpeedTouch/ 377W: http://www.linux-usb.org/SpeedTouch/
422S: Maintained 378S: Maintained
@@ -424,32 +380,27 @@ F: drivers/usb/atm/speedtch.c
424F: drivers/usb/atm/usbatm.c 380F: drivers/usb/atm/usbatm.c
425 381
426ALCHEMY AU1XX0 MMC DRIVER 382ALCHEMY AU1XX0 MMC DRIVER
427P: Manuel Lauss 383M: Manuel Lauss <manuel.lauss@gmail.com>
428M: manuel.lauss@gmail.com
429S: Maintained 384S: Maintained
430F: drivers/mmc/host/au1xmmc.c 385F: drivers/mmc/host/au1xmmc.c
431 386
432ALI1563 I2C DRIVER 387ALI1563 I2C DRIVER
433P: Rudolf Marek 388M: Rudolf Marek <r.marek@assembler.cz>
434M: r.marek@assembler.cz
435L: linux-i2c@vger.kernel.org 389L: linux-i2c@vger.kernel.org
436S: Maintained 390S: Maintained
437F: Documentation/i2c/busses/i2c-ali1563 391F: Documentation/i2c/busses/i2c-ali1563
438F: drivers/i2c/busses/i2c-ali1563.c 392F: drivers/i2c/busses/i2c-ali1563.c
439 393
440ALPHA PORT 394ALPHA PORT
441P: Richard Henderson 395M: Richard Henderson <rth@twiddle.net>
442M: rth@twiddle.net
443S: Odd Fixes for 2.4; Maintained for 2.6. 396S: Odd Fixes for 2.4; Maintained for 2.6.
444P: Ivan Kokshaysky 397M: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
445M: ink@jurassic.park.msu.ru
446S: Maintained for 2.4; PCI support for 2.6. 398S: Maintained for 2.4; PCI support for 2.6.
447L: linux-alpha@vger.kernel.org 399L: linux-alpha@vger.kernel.org
448F: arch/alpha/ 400F: arch/alpha/
449 401
450AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER 402AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
451P: Thomas Dahlmann 403M: Thomas Dahlmann <dahlmann.thomas@arcor.de>
452M: dahlmann.thomas@arcor.de
453L: linux-geode@lists.infradead.org (moderated for non-subscribers) 404L: linux-geode@lists.infradead.org (moderated for non-subscribers)
454S: Supported 405S: Supported
455F: drivers/usb/gadget/amd5536udc.* 406F: drivers/usb/gadget/amd5536udc.*
@@ -466,8 +417,7 @@ F: drivers/video/geode/
466F: arch/x86/include/asm/geode.h 417F: arch/x86/include/asm/geode.h
467 418
468AMD IOMMU (AMD-VI) 419AMD IOMMU (AMD-VI)
469P: Joerg Roedel 420M: Joerg Roedel <joerg.roedel@amd.com>
470M: joerg.roedel@amd.com
471L: iommu@lists.linux-foundation.org 421L: iommu@lists.linux-foundation.org
472T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git 422T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git
473S: Supported 423S: Supported
@@ -475,40 +425,33 @@ F: arch/x86/kernel/amd_iommu*.c
475F: arch/x86/include/asm/amd_iommu*.h 425F: arch/x86/include/asm/amd_iommu*.h
476 426
477AMD MICROCODE UPDATE SUPPORT 427AMD MICROCODE UPDATE SUPPORT
478P: Andreas Herrmann 428M: Andreas Herrmann <andreas.herrmann3@amd.com>
479M: andreas.herrmann3@amd.com
480L: amd64-microcode@amd64.org 429L: amd64-microcode@amd64.org
481S: Supported 430S: Supported
482F: arch/x86/kernel/microcode_amd.c 431F: arch/x86/kernel/microcode_amd.c
483 432
484AMS (Apple Motion Sensor) DRIVER 433AMS (Apple Motion Sensor) DRIVER
485P: Stelian Pop 434M: Stelian Pop <stelian@popies.net>
486M: stelian@popies.net 435M: Michael Hanselmann <linux-kernel@hansmi.ch>
487P: Michael Hanselmann
488M: linux-kernel@hansmi.ch
489S: Supported 436S: Supported
490F: drivers/hwmon/ams/ 437F: drivers/hwmon/ams/
491 438
492AMSO1100 RNIC DRIVER 439AMSO1100 RNIC DRIVER
493P: Tom Tucker 440M: Tom Tucker <tom@opengridcomputing.com>
494M: tom@opengridcomputing.com 441M: Steve Wise <swise@opengridcomputing.com>
495P: Steve Wise
496M: swise@opengridcomputing.com
497L: general@lists.openfabrics.org 442L: general@lists.openfabrics.org
498S: Maintained 443S: Maintained
499F: drivers/infiniband/hw/amso1100/ 444F: drivers/infiniband/hw/amso1100/
500 445
501AOA (Apple Onboard Audio) ALSA DRIVER 446AOA (Apple Onboard Audio) ALSA DRIVER
502P: Johannes Berg 447M: Johannes Berg <johannes@sipsolutions.net>
503M: johannes@sipsolutions.net
504L: linuxppc-dev@ozlabs.org 448L: linuxppc-dev@ozlabs.org
505L: alsa-devel@alsa-project.org (moderated for non-subscribers) 449L: alsa-devel@alsa-project.org (moderated for non-subscribers)
506S: Maintained 450S: Maintained
507F: sound/aoa/ 451F: sound/aoa/
508 452
509APM DRIVER 453APM DRIVER
510P: Stephen Rothwell 454M: Stephen Rothwell <sfr@canb.auug.org.au>
511M: sfr@canb.auug.org.au
512L: linux-laptop@vger.kernel.org 455L: linux-laptop@vger.kernel.org
513W: http://www.canb.auug.org.au/~sfr/ 456W: http://www.canb.auug.org.au/~sfr/
514S: Supported 457S: Supported
@@ -516,51 +459,44 @@ F: arch/x86/kernel/apm_32.c
516F: include/linux/apm_bios.h 459F: include/linux/apm_bios.h
517 460
518APPLE BCM5974 MULTITOUCH DRIVER 461APPLE BCM5974 MULTITOUCH DRIVER
519P: Henrik Rydberg 462M: Henrik Rydberg <rydberg@euromail.se>
520M: rydberg@euromail.se
521L: linux-input@vger.kernel.org 463L: linux-input@vger.kernel.org
522S: Maintained 464S: Maintained
523F: drivers/input/mouse/bcm5974.c 465F: drivers/input/mouse/bcm5974.c
524 466
525APPLE SMC DRIVER 467APPLE SMC DRIVER
526P: Nicolas Boichat 468M: Nicolas Boichat <nicolas@boichat.ch>
527M: nicolas@boichat.ch
528L: mactel-linux-devel@lists.sourceforge.net 469L: mactel-linux-devel@lists.sourceforge.net
529S: Maintained 470S: Maintained
530F: drivers/hwmon/applesmc.c 471F: drivers/hwmon/applesmc.c
531 472
532APPLETALK NETWORK LAYER 473APPLETALK NETWORK LAYER
533P: Arnaldo Carvalho de Melo 474M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
534M: acme@ghostprotocols.net
535S: Maintained 475S: Maintained
536F: drivers/net/appletalk/ 476F: drivers/net/appletalk/
537F: net/appletalk/ 477F: net/appletalk/
538 478
539APPLETOUCH TOUCHPAD DRIVER 479APPLETOUCH TOUCHPAD DRIVER
540P: Johannes Berg 480M: Johannes Berg <johannes@sipsolutions.net>
541M: johannes@sipsolutions.net
542L: linux-input@vger.kernel.org 481L: linux-input@vger.kernel.org
543S: Maintained 482S: Maintained
544F: Documentation/input/appletouch.txt 483F: Documentation/input/appletouch.txt
545F: drivers/input/mouse/appletouch.c 484F: drivers/input/mouse/appletouch.c
546 485
547ARC FRAMEBUFFER DRIVER 486ARC FRAMEBUFFER DRIVER
548P: Jaya Kumar 487M: Jaya Kumar <jayalk@intworks.biz>
549M: jayalk@intworks.biz
550S: Maintained 488S: Maintained
551F: drivers/video/arcfb.c 489F: drivers/video/arcfb.c
552F: drivers/video/fb_defio.c 490F: drivers/video/fb_defio.c
553 491
554ARM MFM AND FLOPPY DRIVERS 492ARM MFM AND FLOPPY DRIVERS
555P: Ian Molton 493M: Ian Molton <spyro@f2s.com>
556M: spyro@f2s.com
557S: Maintained 494S: Maintained
558F: arch/arm/lib/floppydma.S 495F: arch/arm/lib/floppydma.S
559F: arch/arm/include/asm/floppy.h 496F: arch/arm/include/asm/floppy.h
560 497
561ARM PORT 498ARM PORT
562P: Russell King 499M: Russell King <linux@arm.linux.org.uk>
563M: linux@arm.linux.org.uk
564L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 500L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
565W: http://www.arm.linux.org.uk/ 501W: http://www.arm.linux.org.uk/
566S: Maintained 502S: Maintained
@@ -571,48 +507,43 @@ S: Orphan
571F: drivers/mmc/host/mmci.* 507F: drivers/mmc/host/mmci.*
572 508
573ARM/ADI ROADRUNNER MACHINE SUPPORT 509ARM/ADI ROADRUNNER MACHINE SUPPORT
574P: Lennert Buytenhek 510M: Lennert Buytenhek <kernel@wantstofly.org>
575M: kernel@wantstofly.org
576L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 511L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
577S: Maintained 512S: Maintained
578F: arch/arm/mach-ixp23xx/ 513F: arch/arm/mach-ixp23xx/
579F: arch/arm/mach-ixp23xx/include/mach/ 514F: arch/arm/mach-ixp23xx/include/mach/
580 515
581ARM/ADS SPHERE MACHINE SUPPORT 516ARM/ADS SPHERE MACHINE SUPPORT
582P: Lennert Buytenhek 517M: Lennert Buytenhek <kernel@wantstofly.org>
583M: kernel@wantstofly.org
584L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 518L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
585S: Maintained 519S: Maintained
586 520
587ARM/AFEB9260 MACHINE SUPPORT 521ARM/AFEB9260 MACHINE SUPPORT
588P: Sergey Lapin 522M: Sergey Lapin <slapin@ossfans.org>
589M: slapin@ossfans.org
590L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 523L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
591S: Maintained 524S: Maintained
592 525
593ARM/AJECO 1ARM MACHINE SUPPORT 526ARM/AJECO 1ARM MACHINE SUPPORT
594P: Lennert Buytenhek 527M: Lennert Buytenhek <kernel@wantstofly.org>
595M: kernel@wantstofly.org
596L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 528L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
597S: Maintained 529S: Maintained
598 530
599ARM/ATMEL AT91RM9200 ARM ARCHITECTURE 531ARM/ATMEL AT91RM9200 ARM ARCHITECTURE
600P: Andrew Victor 532M: Andrew Victor <linux@maxim.org.za>
601M: linux@maxim.org.za
602L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 533L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
603W: http://maxim.org.za/at91_26.html 534W: http://maxim.org.za/at91_26.html
604S: Maintained 535S: Maintained
605 536
606ARM/BCMRING ARM ARCHITECTURE 537ARM/BCMRING ARM ARCHITECTURE
607P: Leo Chen <leochen@broadcom.com> 538M: Leo Chen <leochen@broadcom.com>
608P: Scott Branden <sbranden@broadcom.com> 539M: Scott Branden <sbranden@broadcom.com>
609L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 540L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
610S: Maintained 541S: Maintained
611F: arch/arm/mach-bcmring 542F: arch/arm/mach-bcmring
612 543
613ARM/BCMRING MTD NAND DRIVER 544ARM/BCMRING MTD NAND DRIVER
614P: Leo Chen <leochen@broadcom.com> 545M: Leo Chen <leochen@broadcom.com>
615P: Scott Branden <sbranden@broadcom.com> 546M: Scott Branden <sbranden@broadcom.com>
616L: linux-mtd@lists.infradead.org 547L: linux-mtd@lists.infradead.org
617S: Maintained 548S: Maintained
618F: drivers/mtd/nand/bcm_umi_nand.c 549F: drivers/mtd/nand/bcm_umi_nand.c
@@ -621,50 +552,42 @@ F: drivers/mtd/nand/bcm_umi_hamming.c
621F: drivers/mtd/nand/nand_bcm_umi.h 552F: drivers/mtd/nand/nand_bcm_umi.h
622 553
623ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE 554ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
624P: Hartley Sweeten 555M: Hartley Sweeten <hsweeten@visionengravers.com>
625M: hsweeten@visionengravers.com 556M: Ryan Mallon <ryan@bluewatersys.com>
626P: Ryan Mallon
627M: ryan@bluewatersys.com
628L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 557L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
629S: Maintained 558S: Maintained
630F: arch/arm/mach-ep93xx/ 559F: arch/arm/mach-ep93xx/
631F: arch/arm/mach-ep93xx/include/mach/ 560F: arch/arm/mach-ep93xx/include/mach/
632 561
633ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT 562ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT
634P: Lennert Buytenhek 563M: Lennert Buytenhek <kernel@wantstofly.org>
635M: kernel@wantstofly.org
636L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 564L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
637S: Maintained 565S: Maintained
638 566
639ARM/CLKDEV SUPPORT 567ARM/CLKDEV SUPPORT
640P: Russell King 568M: Russell King <linux@arm.linux.org.uk>
641M: linux@arm.linux.org.uk
642L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 569L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
643F: arch/arm/common/clkdev.c 570F: arch/arm/common/clkdev.c
644F: arch/arm/include/asm/clkdev.h 571F: arch/arm/include/asm/clkdev.h
645 572
646ARM/COMPULAB CM-X270/EM-X270 and CM-X300 MACHINE SUPPORT 573ARM/COMPULAB CM-X270/EM-X270 and CM-X300 MACHINE SUPPORT
647P: Mike Rapoport 574M: Mike Rapoport <mike@compulab.co.il>
648M: mike@compulab.co.il
649L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 575L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
650S: Maintained 576S: Maintained
651 577
652ARM/CORGI MACHINE SUPPORT 578ARM/CORGI MACHINE SUPPORT
653P: Richard Purdie 579M: Richard Purdie <rpurdie@rpsys.net>
654M: rpurdie@rpsys.net
655S: Maintained 580S: Maintained
656 581
657ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE 582ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE
658P: Paulius Zaleckas 583M: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
659M: paulius.zaleckas@teltonika.lt
660L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 584L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
661T: git git://gitorious.org/linux-gemini/mainline.git 585T: git git://gitorious.org/linux-gemini/mainline.git
662S: Maintained 586S: Maintained
663F: arch/arm/mach-gemini/ 587F: arch/arm/mach-gemini/
664 588
665ARM/EBSA110 MACHINE SUPPORT 589ARM/EBSA110 MACHINE SUPPORT
666P: Russell King 590M: Russell King <linux@arm.linux.org.uk>
667M: linux@arm.linux.org.uk
668L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 591L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
669W: http://www.arm.linux.org.uk/ 592W: http://www.arm.linux.org.uk/
670S: Maintained 593S: Maintained
@@ -672,12 +595,9 @@ F: arch/arm/mach-ebsa110/
672F: drivers/net/arm/am79c961a.* 595F: drivers/net/arm/am79c961a.*
673 596
674ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) 597ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6)
675P: Daniel Ribeiro 598M: Daniel Ribeiro <drwyrm@gmail.com>
676M: drwyrm@gmail.com 599M: Stefan Schmidt <stefan@openezx.org>
677P: Stefan Schmidt 600M: Harald Welte <laforge@openezx.org>
678M: stefan@openezx.org
679P: Harald Welte
680M: laforge@openezx.org
681L: openezx-devel@lists.openezx.org (subscribers-only) 601L: openezx-devel@lists.openezx.org (subscribers-only)
682W: http://www.openezx.org/ 602W: http://www.openezx.org/
683S: Maintained 603S: Maintained
@@ -685,15 +605,13 @@ T: topgit git://git.openezx.org/openezx.git
685F: arch/arm/mach-pxa/ezx.c 605F: arch/arm/mach-pxa/ezx.c
686 606
687ARM/FARADAY FA526 PORT 607ARM/FARADAY FA526 PORT
688P: Paulius Zaleckas 608M: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
689M: paulius.zaleckas@teltonika.lt
690L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 609L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
691S: Maintained 610S: Maintained
692F: arch/arm/mm/*-fa* 611F: arch/arm/mm/*-fa*
693 612
694ARM/FOOTBRIDGE ARCHITECTURE 613ARM/FOOTBRIDGE ARCHITECTURE
695P: Russell King 614M: Russell King <linux@arm.linux.org.uk>
696M: linux@arm.linux.org.uk
697L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 615L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
698W: http://www.arm.linux.org.uk/ 616W: http://www.arm.linux.org.uk/
699S: Maintained 617S: Maintained
@@ -701,175 +619,158 @@ F: arch/arm/include/asm/hardware/dec21285.h
701F: arch/arm/mach-footbridge/ 619F: arch/arm/mach-footbridge/
702 620
703ARM/FREESCALE IMX / MXC ARM ARCHITECTURE 621ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
704P: Sascha Hauer 622M: Sascha Hauer <kernel@pengutronix.de>
705M: kernel@pengutronix.de
706L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 623L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
707S: Maintained 624S: Maintained
708 625
709ARM/GLOMATION GESBC9312SX MACHINE SUPPORT 626ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
710P: Lennert Buytenhek 627M: Lennert Buytenhek <kernel@wantstofly.org>
711M: kernel@wantstofly.org
712L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 628L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
713S: Maintained 629S: Maintained
714 630
715ARM/GUMSTIX MACHINE SUPPORT 631ARM/GUMSTIX MACHINE SUPPORT
716P: Steve Sakoman 632M: Steve Sakoman <sakoman@gmail.com>
717M: sakoman@gmail.com
718L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 633L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
719S: Maintained 634S: Maintained
720 635
721ARM/H4700 (HP IPAQ HX4700) MACHINE SUPPORT 636ARM/H4700 (HP IPAQ HX4700) MACHINE SUPPORT
722P: Philipp Zabel 637M: Philipp Zabel <philipp.zabel@gmail.com>
723M: philipp.zabel@gmail.com
724S: Maintained 638S: Maintained
725F: arch/arm/mach-pxa/hx4700.c 639F: arch/arm/mach-pxa/hx4700.c
726F: arch/arm/mach-pxa/include/mach/hx4700.h 640F: arch/arm/mach-pxa/include/mach/hx4700.h
727 641
728ARM/HP JORNADA 7XX MACHINE SUPPORT 642ARM/HP JORNADA 7XX MACHINE SUPPORT
729P: Kristoffer Ericson 643M: Kristoffer Ericson <kristoffer.ericson@gmail.com>
730M: kristoffer.ericson@gmail.com
731W: www.jlime.com 644W: www.jlime.com
732S: Maintained 645S: Maintained
646T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git
647F: arch/arm/mach-sa1100/jornada720.c
648F: arch/arm/mach-sa1100/include/mach/jornada720.h
733 649
734ARM/INTEL IOP32X ARM ARCHITECTURE 650ARM/INTEL IOP32X ARM ARCHITECTURE
735P: Lennert Buytenhek 651M: Lennert Buytenhek <kernel@wantstofly.org>
736M: kernel@wantstofly.org 652M: Dan Williams <dan.j.williams@intel.com>
737P: Dan Williams
738M: dan.j.williams@intel.com
739L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 653L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
740S: Supported 654S: Supported
741 655
742ARM/INTEL IOP33X ARM ARCHITECTURE 656ARM/INTEL IOP33X ARM ARCHITECTURE
743P: Dan Williams 657M: Dan Williams <dan.j.williams@intel.com>
744M: dan.j.williams@intel.com
745L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 658L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
746S: Supported 659S: Supported
747 660
748ARM/INTEL IOP13XX ARM ARCHITECTURE 661ARM/INTEL IOP13XX ARM ARCHITECTURE
749P: Lennert Buytenhek 662M: Lennert Buytenhek <kernel@wantstofly.org>
750M: kernel@wantstofly.org 663M: Dan Williams <dan.j.williams@intel.com>
751P: Dan Williams
752M: dan.j.williams@intel.com
753L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 664L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
754S: Supported 665S: Supported
755 666
756ARM/INTEL IQ81342EX MACHINE SUPPORT 667ARM/INTEL IQ81342EX MACHINE SUPPORT
757P: Lennert Buytenhek 668M: Lennert Buytenhek <kernel@wantstofly.org>
758M: kernel@wantstofly.org 669M: Dan Williams <dan.j.williams@intel.com>
759P: Dan Williams
760M: dan.j.williams@intel.com
761L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 670L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
762S: Supported 671S: Supported
763 672
764ARM/INTEL IXP2000 ARM ARCHITECTURE 673ARM/INTEL IXP2000 ARM ARCHITECTURE
765P: Lennert Buytenhek 674M: Lennert Buytenhek <kernel@wantstofly.org>
766M: kernel@wantstofly.org
767L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 675L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
768S: Maintained 676S: Maintained
769 677
770ARM/INTEL IXDP2850 MACHINE SUPPORT 678ARM/INTEL IXDP2850 MACHINE SUPPORT
771P: Lennert Buytenhek 679M: Lennert Buytenhek <kernel@wantstofly.org>
772M: kernel@wantstofly.org
773L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 680L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
774S: Maintained 681S: Maintained
775 682
776ARM/INTEL IXP23XX ARM ARCHITECTURE 683ARM/INTEL IXP23XX ARM ARCHITECTURE
777P: Lennert Buytenhek 684M: Lennert Buytenhek <kernel@wantstofly.org>
778M: kernel@wantstofly.org
779L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 685L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
780S: Maintained 686S: Maintained
781 687
782ARM/INTEL XSC3 (MANZANO) ARM CORE 688ARM/INTEL XSC3 (MANZANO) ARM CORE
783P: Lennert Buytenhek 689M: Lennert Buytenhek <kernel@wantstofly.org>
784M: kernel@wantstofly.org 690M: Dan Williams <dan.j.williams@intel.com>
785P: Dan Williams
786M: dan.j.williams@intel.com
787L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 691L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
788S: Supported 692S: Supported
789 693
790ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT 694ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT
791P: Lennert Buytenhek 695M: Lennert Buytenhek <kernel@wantstofly.org>
792M: kernel@wantstofly.org
793L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 696L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
794S: Maintained 697S: Maintained
795 698
796ARM/LOGICPD PXA270 MACHINE SUPPORT 699ARM/LOGICPD PXA270 MACHINE SUPPORT
797P: Lennert Buytenhek 700M: Lennert Buytenhek <kernel@wantstofly.org>
798M: kernel@wantstofly.org
799L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 701L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
800S: Maintained 702S: Maintained
801 703
802ARM/MAGICIAN MACHINE SUPPORT 704ARM/MAGICIAN MACHINE SUPPORT
803P: Philipp Zabel 705M: Philipp Zabel <philipp.zabel@gmail.com>
804M: philipp.zabel@gmail.com 706S: Maintained
707
708ARM/Marvell Loki/Kirkwood/MV78xx0/Orion SOC support
709M: Lennert Buytenhek <buytenh@marvell.com>
710M: Nicolas Pitre <nico@marvell.com>
711L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
712T: git git://git.marvell.com/orion
805S: Maintained 713S: Maintained
714F: arch/arm/mach-loki/
715F: arch/arm/mach-kirkwood/
716F: arch/arm/mach-mv78xx0/
717F: arch/arm/mach-orion5x/
718F: arch/arm/plat-orion/
806 719
807ARM/MIOA701 MACHINE SUPPORT 720ARM/MIOA701 MACHINE SUPPORT
808P: Robert Jarzmik 721M: Robert Jarzmik <robert.jarzmik@free.fr>
809M: robert.jarzmik@free.fr
810L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 722L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
811F: arch/arm/mach-pxa/mioa701.c 723F: arch/arm/mach-pxa/mioa701.c
812S: Maintained 724S: Maintained
813 725
814ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT 726ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT
815P: Michael Petchkovsky 727M: Michael Petchkovsky <mkpetch@internode.on.net>
816M: mkpetch@internode.on.net
817S: Maintained 728S: Maintained
818 729
819ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT 730ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
820P: Nelson Castillo 731M: Nelson Castillo <arhuaco@freaks-unidos.net>
821M: arhuaco@freaks-unidos.net
822L: openmoko-kernel@lists.openmoko.org (subscribers-only) 732L: openmoko-kernel@lists.openmoko.org (subscribers-only)
823W: http://wiki.openmoko.org/wiki/Neo_FreeRunner 733W: http://wiki.openmoko.org/wiki/Neo_FreeRunner
824S: Supported 734S: Supported
825 735
826ARM/TOSA MACHINE SUPPORT 736ARM/TOSA MACHINE SUPPORT
827P: Dmitry Eremin-Solenikov 737M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
828M: dbaryshkov@gmail.com 738M: Dirk Opfer <dirk@opfer-online.de>
829P: Dirk Opfer
830M: dirk@opfer-online.de
831S: Maintained 739S: Maintained
832 740
833ARM/PALMTX,PALMT5,PALMLD,PALMTE2 SUPPORT 741ARM/PALMTX,PALMT5,PALMLD,PALMTE2 SUPPORT
834P: Marek Vasut 742M: Marek Vasut <marek.vasut@gmail.com>
835M: marek.vasut@gmail.com
836W: http://hackndev.com 743W: http://hackndev.com
837S: Maintained 744S: Maintained
838 745
839ARM/PALM TREO 680 SUPPORT 746ARM/PALM TREO 680 SUPPORT
840P: Tomas Cech 747M: Tomas Cech <sleep_walker@suse.cz>
841M: sleep_walker@suse.cz
842W: http://hackndev.com 748W: http://hackndev.com
843S: Maintained 749S: Maintained
844 750
845ARM/PALMZ72 SUPPORT 751ARM/PALMZ72 SUPPORT
846P: Sergey Lapin 752M: Sergey Lapin <slapin@ossfans.org>
847M: slapin@ossfans.org
848W: http://hackndev.com 753W: http://hackndev.com
849S: Maintained 754S: Maintained
850 755
851ARM/PLEB SUPPORT 756ARM/PLEB SUPPORT
852P: Peter Chubb 757M: Peter Chubb <pleb@gelato.unsw.edu.au>
853M: pleb@gelato.unsw.edu.au
854W: http://www.disy.cse.unsw.edu.au/Hardware/PLEB 758W: http://www.disy.cse.unsw.edu.au/Hardware/PLEB
855S: Maintained 759S: Maintained
856 760
857ARM/PT DIGITAL BOARD PORT 761ARM/PT DIGITAL BOARD PORT
858P: Stefan Eletzhofer 762M: Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
859M: stefan.eletzhofer@eletztrick.de
860L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 763L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
861W: http://www.arm.linux.org.uk/ 764W: http://www.arm.linux.org.uk/
862S: Maintained 765S: Maintained
863 766
864ARM/RADISYS ENP2611 MACHINE SUPPORT 767ARM/RADISYS ENP2611 MACHINE SUPPORT
865P: Lennert Buytenhek 768M: Lennert Buytenhek <kernel@wantstofly.org>
866M: kernel@wantstofly.org
867L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 769L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
868S: Maintained 770S: Maintained
869 771
870ARM/RISCPC ARCHITECTURE 772ARM/RISCPC ARCHITECTURE
871P: Russell King 773M: Russell King <linux@arm.linux.org.uk>
872M: linux@arm.linux.org.uk
873L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 774L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
874W: http://www.arm.linux.org.uk/ 775W: http://www.arm.linux.org.uk/
875S: Maintained 776S: Maintained
@@ -883,14 +784,12 @@ F: drivers/net/arm/ether*
883F: drivers/scsi/arm/ 784F: drivers/scsi/arm/
884 785
885ARM/SHARK MACHINE SUPPORT 786ARM/SHARK MACHINE SUPPORT
886P: Alexander Schulz 787M: Alexander Schulz <alex@shark-linux.de>
887M: alex@shark-linux.de
888W: http://www.shark-linux.de/shark.html 788W: http://www.shark-linux.de/shark.html
889S: Maintained 789S: Maintained
890 790
891ARM/SAMSUNG ARM ARCHITECTURES 791ARM/SAMSUNG ARM ARCHITECTURES
892P: Ben Dooks 792M: Ben Dooks <ben-linux@fluff.org>
893M: ben-linux@fluff.org
894L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 793L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
895W: http://www.fluff.org/ben/linux/ 794W: http://www.fluff.org/ben/linux/
896S: Maintained 795S: Maintained
@@ -898,91 +797,73 @@ F: arch/arm/plat-s3c/
898F: arch/arm/plat-s3c24xx/ 797F: arch/arm/plat-s3c24xx/
899 798
900ARM/S3C2410 ARM ARCHITECTURE 799ARM/S3C2410 ARM ARCHITECTURE
901P: Ben Dooks 800M: Ben Dooks <ben-linux@fluff.org>
902M: ben-linux@fluff.org
903L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 801L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
904W: http://www.fluff.org/ben/linux/ 802W: http://www.fluff.org/ben/linux/
905S: Maintained 803S: Maintained
906F: arch/arm/mach-s3c2410/ 804F: arch/arm/mach-s3c2410/
907 805
908ARM/S3C2440 ARM ARCHITECTURE 806ARM/S3C2440 ARM ARCHITECTURE
909P: Ben Dooks 807M: Ben Dooks <ben-linux@fluff.org>
910M: ben-linux@fluff.org
911L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 808L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
912W: http://www.fluff.org/ben/linux/ 809W: http://www.fluff.org/ben/linux/
913S: Maintained 810S: Maintained
914F: arch/arm/mach-s3c2440/ 811F: arch/arm/mach-s3c2440/
915 812
916ARM/S3C2442 ARM ARCHITECTURE 813ARM/S3C2442 ARM ARCHITECTURE
917P: Ben Dooks 814M: Ben Dooks <ben-linux@fluff.org>
918M: ben-linux@fluff.org
919L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 815L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
920W: http://www.fluff.org/ben/linux/ 816W: http://www.fluff.org/ben/linux/
921S: Maintained 817S: Maintained
922F: arch/arm/mach-s3c2442/ 818F: arch/arm/mach-s3c2442/
923 819
924ARM/S3C2443 ARM ARCHITECTURE 820ARM/S3C2443 ARM ARCHITECTURE
925P: Ben Dooks 821M: Ben Dooks <ben-linux@fluff.org>
926M: ben-linux@fluff.org
927L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 822L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
928W: http://www.fluff.org/ben/linux/ 823W: http://www.fluff.org/ben/linux/
929S: Maintained 824S: Maintained
930F: arch/arm/mach-s3c2443/ 825F: arch/arm/mach-s3c2443/
931 826
932ARM/S3C6400 ARM ARCHITECTURE 827ARM/S3C6400 ARM ARCHITECTURE
933P: Ben Dooks 828M: Ben Dooks <ben-linux@fluff.org>
934M: ben-linux@fluff.org
935L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 829L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
936W: http://www.fluff.org/ben/linux/ 830W: http://www.fluff.org/ben/linux/
937S: Maintained 831S: Maintained
938F: arch/arm/mach-s3c6400/ 832F: arch/arm/mach-s3c6400/
939 833
940ARM/S3C6410 ARM ARCHITECTURE 834ARM/S3C6410 ARM ARCHITECTURE
941P: Ben Dooks 835M: Ben Dooks <ben-linux@fluff.org>
942M: ben-linux@fluff.org
943L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 836L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
944W: http://www.fluff.org/ben/linux/ 837W: http://www.fluff.org/ben/linux/
945S: Maintained 838S: Maintained
946F: arch/arm/mach-s3c6410/ 839F: arch/arm/mach-s3c6410/
947 840
948ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT 841ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
949P: Lennert Buytenhek 842M: Lennert Buytenhek <kernel@wantstofly.org>
950M: kernel@wantstofly.org
951L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 843L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
952S: Maintained 844S: Maintained
953 845
954ARM/THECUS N2100 MACHINE SUPPORT 846ARM/THECUS N2100 MACHINE SUPPORT
955P: Lennert Buytenhek 847M: Lennert Buytenhek <kernel@wantstofly.org>
956M: kernel@wantstofly.org
957L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 848L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
958S: Maintained 849S: Maintained
959 850
960ARM/NUVOTON W90X900 ARM ARCHITECTURE 851ARM/NUVOTON W90X900 ARM ARCHITECTURE
961P: Wan ZongShun 852M: Wan ZongShun <mcuos.com@gmail.com>
962M: mcuos.com@gmail.com
963L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 853L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
964W: http://www.mcuos.com 854W: http://www.mcuos.com
965S: Maintained 855S: Maintained
966 856
967ARM/VFP SUPPORT 857ARM/VFP SUPPORT
968P: Russell King 858M: Russell King <linux@arm.linux.org.uk>
969M: linux@arm.linux.org.uk
970L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 859L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
971W: http://www.arm.linux.org.uk/ 860W: http://www.arm.linux.org.uk/
972S: Maintained 861S: Maintained
973F: arch/arm/vfp/ 862F: arch/arm/vfp/
974 863
975ARPD SUPPORT
976P: Jonathan Layes
977L: netdev@vger.kernel.org
978S: Maintained
979F: net/ipv4/arp.c
980
981ASUS ACPI EXTRAS DRIVER 864ASUS ACPI EXTRAS DRIVER
982P: Corentin Chary 865M: Corentin Chary <corentincj@iksaif.net>
983M: corentincj@iksaif.net 866M: Karol Kozimor <sziwan@users.sourceforge.net>
984P: Karol Kozimor
985M: sziwan@users.sourceforge.net
986L: acpi4asus-user@lists.sourceforge.net 867L: acpi4asus-user@lists.sourceforge.net
987W: http://acpi4asus.sf.net 868W: http://acpi4asus.sf.net
988S: Maintained 869S: Maintained
@@ -990,25 +871,21 @@ F: arch/x86/kernel/acpi/boot.c
990F: drivers/platform/x86/asus_acpi.c 871F: drivers/platform/x86/asus_acpi.c
991 872
992ASUS ASB100 HARDWARE MONITOR DRIVER 873ASUS ASB100 HARDWARE MONITOR DRIVER
993P: Mark M. Hoffman 874M: "Mark M. Hoffman" <mhoffman@lightlink.com>
994M: mhoffman@lightlink.com
995L: lm-sensors@lm-sensors.org 875L: lm-sensors@lm-sensors.org
996S: Maintained 876S: Maintained
997F: drivers/hwmon/asb100.c 877F: drivers/hwmon/asb100.c
998 878
999ASUS LAPTOP EXTRAS DRIVER 879ASUS LAPTOP EXTRAS DRIVER
1000P: Corentin Chary 880M: Corentin Chary <corentincj@iksaif.net>
1001M: corentincj@iksaif.net
1002L: acpi4asus-user@lists.sourceforge.net 881L: acpi4asus-user@lists.sourceforge.net
1003W: http://acpi4asus.sf.net 882W: http://acpi4asus.sf.net
1004S: Maintained 883S: Maintained
1005F: drivers/platform/x86/asus-laptop.c 884F: drivers/platform/x86/asus-laptop.c
1006 885
1007ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API 886ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API
1008P: Dan Williams 887M: Dan Williams <dan.j.williams@intel.com>
1009M: dan.j.williams@intel.com 888M: Maciej Sosnowski <maciej.sosnowski@intel.com>
1010P: Maciej Sosnowski
1011M: maciej.sosnowski@intel.com
1012W: http://sourceforge.net/projects/xscaleiop 889W: http://sourceforge.net/projects/xscaleiop
1013S: Supported 890S: Supported
1014F: Documentation/crypto/async-tx-api.txt 891F: Documentation/crypto/async-tx-api.txt
@@ -1018,64 +895,49 @@ F: include/linux/dmaengine.h
1018F: include/linux/async_tx.h 895F: include/linux/async_tx.h
1019 896
1020ATA OVER ETHERNET (AOE) DRIVER 897ATA OVER ETHERNET (AOE) DRIVER
1021P: Ed L. Cashin 898M: "Ed L. Cashin" <ecashin@coraid.com>
1022M: ecashin@coraid.com
1023W: http://www.coraid.com/support/linux 899W: http://www.coraid.com/support/linux
1024S: Supported 900S: Supported
1025F: Documentation/aoe/ 901F: Documentation/aoe/
1026F: drivers/block/aoe/ 902F: drivers/block/aoe/
1027 903
1028ATHEROS ATH5K WIRELESS DRIVER 904ATHEROS ATH5K WIRELESS DRIVER
1029P: Jiri Slaby 905M: Jiri Slaby <jirislaby@gmail.com>
1030M: jirislaby@gmail.com 906M: Nick Kossifidis <mickflemm@gmail.com>
1031P: Nick Kossifidis 907M: "Luis R. Rodriguez" <lrodriguez@atheros.com>
1032M: mickflemm@gmail.com 908M: Bob Copeland <me@bobcopeland.com>
1033P: Luis R. Rodriguez
1034M: lrodriguez@atheros.com
1035P: Bob Copeland
1036M: me@bobcopeland.com
1037L: linux-wireless@vger.kernel.org 909L: linux-wireless@vger.kernel.org
1038L: ath5k-devel@lists.ath5k.org 910L: ath5k-devel@lists.ath5k.org
1039S: Maintained 911S: Maintained
1040F: drivers/net/wireless/ath/ath5k/ 912F: drivers/net/wireless/ath/ath5k/
1041 913
1042ATHEROS ATH9K WIRELESS DRIVER 914ATHEROS ATH9K WIRELESS DRIVER
1043P: Luis R. Rodriguez 915M: "Luis R. Rodriguez" <lrodriguez@atheros.com>
1044M: lrodriguez@atheros.com 916M: Jouni Malinen <jmalinen@atheros.com>
1045P: Jouni Malinen 917M: Sujith Manoharan <Sujith.Manoharan@atheros.com>
1046M: jmalinen@atheros.com 918M: Vasanthakumar Thiagarajan <vasanth@atheros.com>
1047P: Sujith Manoharan 919M: Senthil Balasubramanian <senthilkumar@atheros.com>
1048M: Sujith.Manoharan@atheros.com
1049P: Vasanthakumar Thiagarajan
1050M: vasanth@atheros.com
1051P: Senthil Balasubramanian
1052M: senthilkumar@atheros.com
1053L: linux-wireless@vger.kernel.org 920L: linux-wireless@vger.kernel.org
1054L: ath9k-devel@lists.ath9k.org 921L: ath9k-devel@lists.ath9k.org
1055S: Supported 922S: Supported
1056F: drivers/net/wireless/ath/ath9k/ 923F: drivers/net/wireless/ath/ath9k/
1057 924
1058ATHEROS AR9170 WIRELESS DRIVER 925ATHEROS AR9170 WIRELESS DRIVER
1059P: Christian Lamparter 926M: Christian Lamparter <chunkeey@web.de>
1060M: chunkeey@web.de
1061L: linux-wireless@vger.kernel.org 927L: linux-wireless@vger.kernel.org
1062W: http://wireless.kernel.org/en/users/Drivers/ar9170 928W: http://wireless.kernel.org/en/users/Drivers/ar9170
1063S: Maintained 929S: Maintained
1064F: drivers/net/wireless/ath/ar9170/ 930F: drivers/net/wireless/ath/ar9170/
1065 931
1066ATI_REMOTE2 DRIVER 932ATI_REMOTE2 DRIVER
1067P: Ville Syrjala 933M: Ville Syrjala <syrjala@sci.fi>
1068M: syrjala@sci.fi
1069S: Maintained 934S: Maintained
1070F: drivers/input/misc/ati_remote2.c 935F: drivers/input/misc/ati_remote2.c
1071 936
1072ATLX ETHERNET DRIVERS 937ATLX ETHERNET DRIVERS
1073P: Jay Cliburn 938M: Jay Cliburn <jcliburn@gmail.com>
1074M: jcliburn@gmail.com 939M: Chris Snook <csnook@redhat.com>
1075P: Chris Snook 940M: Jie Yang <jie.yang@atheros.com>
1076M: csnook@redhat.com
1077P: Jie Yang
1078M: jie.yang@atheros.com
1079L: atl1-devel@lists.sourceforge.net 941L: atl1-devel@lists.sourceforge.net
1080W: http://sourceforge.net/projects/atl1 942W: http://sourceforge.net/projects/atl1
1081W: http://atl1.sourceforge.net 943W: http://atl1.sourceforge.net
@@ -1083,8 +945,7 @@ S: Maintained
1083F: drivers/net/atlx/ 945F: drivers/net/atlx/
1084 946
1085ATM 947ATM
1086P: Chas Williams 948M: Chas Williams <chas@cmf.nrl.navy.mil>
1087M: chas@cmf.nrl.navy.mil
1088L: linux-atm-general@lists.sourceforge.net (subscribers-only) 949L: linux-atm-general@lists.sourceforge.net (subscribers-only)
1089L: netdev@vger.kernel.org 950L: netdev@vger.kernel.org
1090W: http://linux-atm.sourceforge.net 951W: http://linux-atm.sourceforge.net
@@ -1093,8 +954,7 @@ F: drivers/atm/
1093F: include/linux/atm* 954F: include/linux/atm*
1094 955
1095ATMEL AT91 MCI DRIVER 956ATMEL AT91 MCI DRIVER
1096P: Nicolas Ferre 957M: Nicolas Ferre <nicolas.ferre@atmel.com>
1097M: nicolas.ferre@atmel.com
1098L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 958L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
1099W: http://www.atmel.com/products/AT91/ 959W: http://www.atmel.com/products/AT91/
1100W: http://www.at91.com/ 960W: http://www.at91.com/
@@ -1102,49 +962,42 @@ S: Maintained
1102F: drivers/mmc/host/at91_mci.c 962F: drivers/mmc/host/at91_mci.c
1103 963
1104ATMEL AT91 / AT32 MCI DRIVER 964ATMEL AT91 / AT32 MCI DRIVER
1105P: Nicolas Ferre 965M: Nicolas Ferre <nicolas.ferre@atmel.com>
1106M: nicolas.ferre@atmel.com
1107S: Maintained 966S: Maintained
1108F: drivers/mmc/host/atmel-mci.c 967F: drivers/mmc/host/atmel-mci.c
1109F: drivers/mmc/host/atmel-mci-regs.h 968F: drivers/mmc/host/atmel-mci-regs.h
1110 969
1111ATMEL AT91 / AT32 SERIAL DRIVER 970ATMEL AT91 / AT32 SERIAL DRIVER
1112P: Haavard Skinnemoen 971M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1113M: hskinnemoen@atmel.com
1114S: Supported 972S: Supported
1115F: drivers/serial/atmel_serial.c 973F: drivers/serial/atmel_serial.c
1116 974
1117ATMEL LCDFB DRIVER 975ATMEL LCDFB DRIVER
1118P: Nicolas Ferre 976M: Nicolas Ferre <nicolas.ferre@atmel.com>
1119M: nicolas.ferre@atmel.com
1120L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 977L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
1121S: Maintained 978S: Maintained
1122F: drivers/video/atmel_lcdfb.c 979F: drivers/video/atmel_lcdfb.c
1123F: include/video/atmel_lcdc.h 980F: include/video/atmel_lcdc.h
1124 981
1125ATMEL MACB ETHERNET DRIVER 982ATMEL MACB ETHERNET DRIVER
1126P: Haavard Skinnemoen 983M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1127M: hskinnemoen@atmel.com
1128S: Supported 984S: Supported
1129F: drivers/net/macb.* 985F: drivers/net/macb.*
1130 986
1131ATMEL SPI DRIVER 987ATMEL SPI DRIVER
1132P: Haavard Skinnemoen 988M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1133M: hskinnemoen@atmel.com
1134S: Supported 989S: Supported
1135F: drivers/spi/atmel_spi.* 990F: drivers/spi/atmel_spi.*
1136 991
1137ATMEL USBA UDC DRIVER 992ATMEL USBA UDC DRIVER
1138P: Haavard Skinnemoen 993M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1139M: hskinnemoen@atmel.com
1140L: kernel@avr32linux.org 994L: kernel@avr32linux.org
1141W: http://avr32linux.org/twiki/bin/view/Main/AtmelUsbDeviceDriver 995W: http://avr32linux.org/twiki/bin/view/Main/AtmelUsbDeviceDriver
1142S: Supported 996S: Supported
1143F: drivers/usb/gadget/atmel_usba_udc.* 997F: drivers/usb/gadget/atmel_usba_udc.*
1144 998
1145ATMEL WIRELESS DRIVER 999ATMEL WIRELESS DRIVER
1146P: Simon Kelley 1000M: Simon Kelley <simon@thekelleys.org.uk>
1147M: simon@thekelleys.org.uk
1148L: linux-wireless@vger.kernel.org 1001L: linux-wireless@vger.kernel.org
1149W: http://www.thekelleys.org.uk/atmel 1002W: http://www.thekelleys.org.uk/atmel
1150W: http://atmelwlandriver.sourceforge.net/ 1003W: http://atmelwlandriver.sourceforge.net/
@@ -1152,10 +1005,8 @@ S: Maintained
1152F: drivers/net/wireless/atmel* 1005F: drivers/net/wireless/atmel*
1153 1006
1154AUDIT SUBSYSTEM 1007AUDIT SUBSYSTEM
1155P: Al Viro 1008M: Al Viro <viro@zeniv.linux.org.uk>
1156M: viro@zeniv.linux.org.uk 1009M: Eric Paris <eparis@redhat.com>
1157P: Eric Paris
1158M: eparis@redhat.com
1159L: linux-audit@redhat.com (subscribers-only) 1010L: linux-audit@redhat.com (subscribers-only)
1160W: http://people.redhat.com/sgrubb/audit/ 1011W: http://people.redhat.com/sgrubb/audit/
1161T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git 1012T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git
@@ -1164,8 +1015,7 @@ F: include/linux/audit.h
1164F: kernel/audit* 1015F: kernel/audit*
1165 1016
1166AUXILIARY DISPLAY DRIVERS 1017AUXILIARY DISPLAY DRIVERS
1167P: Miguel Ojeda Sandonis 1018M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
1168M: miguel.ojeda.sandonis@gmail.com
1169W: http://miguelojeda.es/auxdisplay.htm 1019W: http://miguelojeda.es/auxdisplay.htm
1170W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1020W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1171S: Maintained 1021S: Maintained
@@ -1173,8 +1023,7 @@ F: drivers/auxdisplay/
1173F: include/linux/cfag12864b.h 1023F: include/linux/cfag12864b.h
1174 1024
1175AVR32 ARCHITECTURE 1025AVR32 ARCHITECTURE
1176P: Haavard Skinnemoen 1026M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1177M: hskinnemoen@atmel.com
1178W: http://www.atmel.com/products/AVR32/ 1027W: http://www.atmel.com/products/AVR32/
1179W: http://avr32linux.org/ 1028W: http://avr32linux.org/
1180W: http://avrfreaks.net/ 1029W: http://avrfreaks.net/
@@ -1182,14 +1031,12 @@ S: Supported
1182F: arch/avr32/ 1031F: arch/avr32/
1183 1032
1184AVR32/AT32AP MACHINE SUPPORT 1033AVR32/AT32AP MACHINE SUPPORT
1185P: Haavard Skinnemoen 1034M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1186M: hskinnemoen@atmel.com
1187S: Supported 1035S: Supported
1188F: arch/avr32/mach-at32ap/ 1036F: arch/avr32/mach-at32ap/
1189 1037
1190AX.25 NETWORK LAYER 1038AX.25 NETWORK LAYER
1191P: Ralf Baechle 1039M: Ralf Baechle <ralf@linux-mips.org>
1192M: ralf@linux-mips.org
1193L: linux-hams@vger.kernel.org 1040L: linux-hams@vger.kernel.org
1194W: http://www.linux-ax25.org/ 1041W: http://www.linux-ax25.org/
1195S: Maintained 1042S: Maintained
@@ -1198,128 +1045,110 @@ F: include/net/ax25.h
1198F: net/ax25/ 1045F: net/ax25/
1199 1046
1200B43 WIRELESS DRIVER 1047B43 WIRELESS DRIVER
1201P: Michael Buesch 1048M: Michael Buesch <mb@bu3sch.de>
1202M: mb@bu3sch.de 1049M: Stefano Brivio <stefano.brivio@polimi.it>
1203P: Stefano Brivio
1204M: stefano.brivio@polimi.it
1205L: linux-wireless@vger.kernel.org 1050L: linux-wireless@vger.kernel.org
1206W: http://linuxwireless.org/en/users/Drivers/b43 1051W: http://linuxwireless.org/en/users/Drivers/b43
1207S: Maintained 1052S: Maintained
1208F: drivers/net/wireless/b43/ 1053F: drivers/net/wireless/b43/
1209 1054
1210B43LEGACY WIRELESS DRIVER 1055B43LEGACY WIRELESS DRIVER
1211P: Larry Finger 1056M: Larry Finger <Larry.Finger@lwfinger.net>
1212M: Larry.Finger@lwfinger.net 1057M: Stefano Brivio <stefano.brivio@polimi.it>
1213P: Stefano Brivio
1214M: stefano.brivio@polimi.it
1215L: linux-wireless@vger.kernel.org 1058L: linux-wireless@vger.kernel.org
1216W: http://linuxwireless.org/en/users/Drivers/b43 1059W: http://linuxwireless.org/en/users/Drivers/b43
1217S: Maintained 1060S: Maintained
1218F: drivers/net/wireless/b43legacy/ 1061F: drivers/net/wireless/b43legacy/
1219 1062
1220BACKLIGHT CLASS/SUBSYSTEM 1063BACKLIGHT CLASS/SUBSYSTEM
1221P: Richard Purdie 1064M: Richard Purdie <rpurdie@rpsys.net>
1222M: rpurdie@rpsys.net
1223S: Maintained 1065S: Maintained
1224F: drivers/video/backlight/ 1066F: drivers/video/backlight/
1225F: include/linux/backlight.h 1067F: include/linux/backlight.h
1226 1068
1227BAYCOM/HDLCDRV DRIVERS FOR AX.25 1069BAYCOM/HDLCDRV DRIVERS FOR AX.25
1228P: Thomas Sailer 1070M: Thomas Sailer <t.sailer@alumni.ethz.ch>
1229M: t.sailer@alumni.ethz.ch
1230L: linux-hams@vger.kernel.org 1071L: linux-hams@vger.kernel.org
1231W: http://www.baycom.org/~tom/ham/ham.html 1072W: http://www.baycom.org/~tom/ham/ham.html
1232S: Maintained 1073S: Maintained
1233F: drivers/net/hamradio/baycom* 1074F: drivers/net/hamradio/baycom*
1234 1075
1235BEFS FILE SYSTEM 1076BEFS FILE SYSTEM
1236P: Sergey S. Kostyliov 1077M: "Sergey S. Kostyliov" <rathamahata@php4.ru>
1237M: rathamahata@php4.ru
1238S: Maintained 1078S: Maintained
1239F: Documentation/filesystems/befs.txt 1079F: Documentation/filesystems/befs.txt
1240F: fs/befs/ 1080F: fs/befs/
1241 1081
1242BFS FILE SYSTEM 1082BFS FILE SYSTEM
1243P: Tigran A. Aivazian 1083M: "Tigran A. Aivazian" <tigran@aivazian.fsnet.co.uk>
1244M: tigran@aivazian.fsnet.co.uk
1245S: Maintained 1084S: Maintained
1246F: Documentation/filesystems/bfs.txt 1085F: Documentation/filesystems/bfs.txt
1247F: fs/bfs/ 1086F: fs/bfs/
1248F: include/linux/bfs_fs.h 1087F: include/linux/bfs_fs.h
1249 1088
1250BLACKFIN ARCHITECTURE 1089BLACKFIN ARCHITECTURE
1251P: Mike Frysinger 1090M: Mike Frysinger <vapier@gentoo.org>
1252M: vapier@gentoo.org
1253L: uclinux-dist-devel@blackfin.uclinux.org 1091L: uclinux-dist-devel@blackfin.uclinux.org
1254W: http://blackfin.uclinux.org 1092W: http://blackfin.uclinux.org
1255S: Supported 1093S: Supported
1256F: arch/blackfin/ 1094F: arch/blackfin/
1257 1095
1258BLACKFIN EMAC DRIVER 1096BLACKFIN EMAC DRIVER
1259P: Michael Hennerich 1097M: Michael Hennerich <michael.hennerich@analog.com>
1260M: michael.hennerich@analog.com
1261L: uclinux-dist-devel@blackfin.uclinux.org 1098L: uclinux-dist-devel@blackfin.uclinux.org
1262W: http://blackfin.uclinux.org 1099W: http://blackfin.uclinux.org
1263S: Supported 1100S: Supported
1264F: drivers/net/bfin_mac.* 1101F: drivers/net/bfin_mac.*
1265 1102
1266BLACKFIN RTC DRIVER 1103BLACKFIN RTC DRIVER
1267P: Mike Frysinger 1104M: Mike Frysinger <vapier.adi@gmail.com>
1268M: vapier.adi@gmail.com
1269L: uclinux-dist-devel@blackfin.uclinux.org 1105L: uclinux-dist-devel@blackfin.uclinux.org
1270W: http://blackfin.uclinux.org 1106W: http://blackfin.uclinux.org
1271S: Supported 1107S: Supported
1272F: drivers/rtc/rtc-bfin.c 1108F: drivers/rtc/rtc-bfin.c
1273 1109
1274BLACKFIN SERIAL DRIVER 1110BLACKFIN SERIAL DRIVER
1275P: Sonic Zhang 1111M: Sonic Zhang <sonic.zhang@analog.com>
1276M: sonic.zhang@analog.com
1277L: uclinux-dist-devel@blackfin.uclinux.org 1112L: uclinux-dist-devel@blackfin.uclinux.org
1278W: http://blackfin.uclinux.org 1113W: http://blackfin.uclinux.org
1279S: Supported 1114S: Supported
1280F: drivers/serial/bfin_5xx.c 1115F: drivers/serial/bfin_5xx.c
1281 1116
1282BLACKFIN WATCHDOG DRIVER 1117BLACKFIN WATCHDOG DRIVER
1283P: Mike Frysinger 1118M: Mike Frysinger <vapier.adi@gmail.com>
1284M: vapier.adi@gmail.com
1285L: uclinux-dist-devel@blackfin.uclinux.org 1119L: uclinux-dist-devel@blackfin.uclinux.org
1286W: http://blackfin.uclinux.org 1120W: http://blackfin.uclinux.org
1287S: Supported 1121S: Supported
1288F: drivers/watchdog/bfin_wdt.c 1122F: drivers/watchdog/bfin_wdt.c
1289 1123
1290BLACKFIN I2C TWI DRIVER 1124BLACKFIN I2C TWI DRIVER
1291P: Sonic Zhang 1125M: Sonic Zhang <sonic.zhang@analog.com>
1292M: sonic.zhang@analog.com
1293L: uclinux-dist-devel@blackfin.uclinux.org 1126L: uclinux-dist-devel@blackfin.uclinux.org
1294W: http://blackfin.uclinux.org/ 1127W: http://blackfin.uclinux.org/
1295S: Supported 1128S: Supported
1296F: drivers/i2c/busses/i2c-bfin-twi.c 1129F: drivers/i2c/busses/i2c-bfin-twi.c
1297 1130
1298BLOCK LAYER 1131BLOCK LAYER
1299P: Jens Axboe 1132M: Jens Axboe <axboe@kernel.dk>
1300M: axboe@kernel.dk
1301T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git 1133T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
1302S: Maintained 1134S: Maintained
1303F: block/ 1135F: block/
1304 1136
1305BLOCK2MTD DRIVER 1137BLOCK2MTD DRIVER
1306P: Joern Engel 1138M: Joern Engel <joern@lazybastard.org>
1307M: joern@lazybastard.org
1308L: linux-mtd@lists.infradead.org 1139L: linux-mtd@lists.infradead.org
1309S: Maintained 1140S: Maintained
1310F: drivers/mtd/devices/block2mtd.c 1141F: drivers/mtd/devices/block2mtd.c
1311 1142
1312BLUETOOTH DRIVERS 1143BLUETOOTH DRIVERS
1313P: Marcel Holtmann 1144M: Marcel Holtmann <marcel@holtmann.org>
1314M: marcel@holtmann.org
1315L: linux-bluetooth@vger.kernel.org 1145L: linux-bluetooth@vger.kernel.org
1316W: http://www.bluez.org/ 1146W: http://www.bluez.org/
1317S: Maintained 1147S: Maintained
1318F: drivers/bluetooth/ 1148F: drivers/bluetooth/
1319 1149
1320BLUETOOTH SUBSYSTEM 1150BLUETOOTH SUBSYSTEM
1321P: Marcel Holtmann 1151M: Marcel Holtmann <marcel@holtmann.org>
1322M: marcel@holtmann.org
1323L: linux-bluetooth@vger.kernel.org 1152L: linux-bluetooth@vger.kernel.org
1324W: http://www.bluez.org/ 1153W: http://www.bluez.org/
1325T: git git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git 1154T: git git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
@@ -1328,8 +1157,7 @@ F: net/bluetooth/
1328F: include/net/bluetooth/ 1157F: include/net/bluetooth/
1329 1158
1330BONDING DRIVER 1159BONDING DRIVER
1331P: Jay Vosburgh 1160M: Jay Vosburgh <fubar@us.ibm.com>
1332M: fubar@us.ibm.com
1333L: bonding-devel@lists.sourceforge.net 1161L: bonding-devel@lists.sourceforge.net
1334W: http://sourceforge.net/projects/bonding/ 1162W: http://sourceforge.net/projects/bonding/
1335S: Supported 1163S: Supported
@@ -1337,54 +1165,46 @@ F: drivers/net/bonding/
1337F: include/linux/if_bonding.h 1165F: include/linux/if_bonding.h
1338 1166
1339BROADCOM B44 10/100 ETHERNET DRIVER 1167BROADCOM B44 10/100 ETHERNET DRIVER
1340P: Gary Zambrano 1168M: Gary Zambrano <zambrano@broadcom.com>
1341M: zambrano@broadcom.com
1342L: netdev@vger.kernel.org 1169L: netdev@vger.kernel.org
1343S: Supported 1170S: Supported
1344F: drivers/net/b44.* 1171F: drivers/net/b44.*
1345 1172
1346BROADCOM BNX2 GIGABIT ETHERNET DRIVER 1173BROADCOM BNX2 GIGABIT ETHERNET DRIVER
1347P: Michael Chan 1174M: Michael Chan <mchan@broadcom.com>
1348M: mchan@broadcom.com
1349L: netdev@vger.kernel.org 1175L: netdev@vger.kernel.org
1350S: Supported 1176S: Supported
1351F: drivers/net/bnx2.* 1177F: drivers/net/bnx2.*
1352F: drivers/net/bnx2_* 1178F: drivers/net/bnx2_*
1353 1179
1354BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER 1180BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
1355P: Eilon Greenstein 1181M: Eilon Greenstein <eilong@broadcom.com>
1356M: eilong@broadcom.com
1357L: netdev@vger.kernel.org 1182L: netdev@vger.kernel.org
1358S: Supported 1183S: Supported
1359F: drivers/net/bnx2x* 1184F: drivers/net/bnx2x*
1360 1185
1361BROADCOM TG3 GIGABIT ETHERNET DRIVER 1186BROADCOM TG3 GIGABIT ETHERNET DRIVER
1362P: Matt Carlson 1187M: Matt Carlson <mcarlson@broadcom.com>
1363M: mcarlson@broadcom.com 1188M: Michael Chan <mchan@broadcom.com>
1364P: Michael Chan
1365M: mchan@broadcom.com
1366L: netdev@vger.kernel.org 1189L: netdev@vger.kernel.org
1367S: Supported 1190S: Supported
1368F: drivers/net/tg3.* 1191F: drivers/net/tg3.*
1369 1192
1370BSG (block layer generic sg v4 driver) 1193BSG (block layer generic sg v4 driver)
1371P: FUJITA Tomonori 1194M: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
1372M: fujita.tomonori@lab.ntt.co.jp
1373L: linux-scsi@vger.kernel.org 1195L: linux-scsi@vger.kernel.org
1374S: Supported 1196S: Supported
1375F: block/bsg.c 1197F: block/bsg.c
1376F: include/linux/bsg.h 1198F: include/linux/bsg.h
1377 1199
1378BT8XXGPIO DRIVER 1200BT8XXGPIO DRIVER
1379P: Michael Buesch 1201M: Michael Buesch <mb@bu3sch.de>
1380M: mb@bu3sch.de
1381W: http://bu3sch.de/btgpio.php 1202W: http://bu3sch.de/btgpio.php
1382S: Maintained 1203S: Maintained
1383F: drivers/gpio/bt8xxgpio.c 1204F: drivers/gpio/bt8xxgpio.c
1384 1205
1385BTRFS FILE SYSTEM 1206BTRFS FILE SYSTEM
1386P: Chris Mason 1207M: Chris Mason <chris.mason@oracle.com>
1387M: chris.mason@oracle.com
1388L: linux-btrfs@vger.kernel.org 1208L: linux-btrfs@vger.kernel.org
1389W: http://btrfs.wiki.kernel.org/ 1209W: http://btrfs.wiki.kernel.org/
1390T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git 1210T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
@@ -1393,8 +1213,7 @@ F: Documentation/filesystems/btrfs.txt
1393F: fs/btrfs/ 1213F: fs/btrfs/
1394 1214
1395BTTV VIDEO4LINUX DRIVER 1215BTTV VIDEO4LINUX DRIVER
1396P: Mauro Carvalho Chehab 1216M: Mauro Carvalho Chehab <mchehab@infradead.org>
1397M: mchehab@infradead.org
1398L: linux-media@vger.kernel.org 1217L: linux-media@vger.kernel.org
1399W: http://linuxtv.org 1218W: http://linuxtv.org
1400T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1219T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -1403,16 +1222,14 @@ F: Documentation/video4linux/bttv/
1403F: drivers/media/video/bt8xx/bttv* 1222F: drivers/media/video/bt8xx/bttv*
1404 1223
1405CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS 1224CACHEFILES: FS-CACHE BACKEND FOR CACHING ON MOUNTED FILESYSTEMS
1406P: David Howells 1225M: David Howells <dhowells@redhat.com>
1407M: dhowells@redhat.com
1408L: linux-cachefs@redhat.com 1226L: linux-cachefs@redhat.com
1409S: Supported 1227S: Supported
1410F: Documentation/filesystems/caching/cachefiles.txt 1228F: Documentation/filesystems/caching/cachefiles.txt
1411F: fs/cachefiles/ 1229F: fs/cachefiles/
1412 1230
1413CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER 1231CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER
1414P: Jonathan Corbet 1232M: Jonathan Corbet <corbet@lwn.net>
1415M: corbet@lwn.net
1416L: linux-media@vger.kernel.org 1233L: linux-media@vger.kernel.org
1417T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1234T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1418S: Maintained 1235S: Maintained
@@ -1420,10 +1237,8 @@ F: Documentation/video4linux/cafe_ccic
1420F: drivers/media/video/cafe_ccic* 1237F: drivers/media/video/cafe_ccic*
1421 1238
1422CALGARY x86-64 IOMMU 1239CALGARY x86-64 IOMMU
1423P: Muli Ben-Yehuda 1240M: Muli Ben-Yehuda <muli@il.ibm.com>
1424M: muli@il.ibm.com 1241M: "Jon D. Mason" <jdmason@kudzu.us>
1425P: Jon D. Mason
1426M: jdmason@kudzu.us
1427L: discuss@x86-64.org 1242L: discuss@x86-64.org
1428S: Maintained 1243S: Maintained
1429F: arch/x86/kernel/pci-calgary_64.c 1244F: arch/x86/kernel/pci-calgary_64.c
@@ -1432,10 +1247,8 @@ F: arch/x86/include/asm/calgary.h
1432F: arch/x86/include/asm/tce.h 1247F: arch/x86/include/asm/tce.h
1433 1248
1434CAN NETWORK LAYER 1249CAN NETWORK LAYER
1435P: Urs Thuermann 1250M: Urs Thuermann <urs.thuermann@volkswagen.de>
1436M: urs.thuermann@volkswagen.de 1251M: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
1437P: Oliver Hartkopp
1438M: oliver.hartkopp@volkswagen.de
1439L: socketcan-core@lists.berlios.de (subscribers-only) 1252L: socketcan-core@lists.berlios.de (subscribers-only)
1440W: http://developer.berlios.de/projects/socketcan/ 1253W: http://developer.berlios.de/projects/socketcan/
1441S: Maintained 1254S: Maintained
@@ -1444,15 +1257,13 @@ F: include/linux/can/
1444F: include/linux/can.h 1257F: include/linux/can.h
1445 1258
1446CAN NETWORK DRIVERS 1259CAN NETWORK DRIVERS
1447P: Wolfgang Grandegger 1260M: Wolfgang Grandegger <wg@grandegger.com>
1448M: wg@grandegger.com
1449L: socketcan-core@lists.berlios.de (subscribers-only) 1261L: socketcan-core@lists.berlios.de (subscribers-only)
1450W: http://developer.berlios.de/projects/socketcan/ 1262W: http://developer.berlios.de/projects/socketcan/
1451S: Maintained 1263S: Maintained
1452 1264
1453CELL BROADBAND ENGINE ARCHITECTURE 1265CELL BROADBAND ENGINE ARCHITECTURE
1454P: Arnd Bergmann 1266M: Arnd Bergmann <arnd@arndb.de>
1455M: arnd@arndb.de
1456L: linuxppc-dev@ozlabs.org 1267L: linuxppc-dev@ozlabs.org
1457L: cbe-oss-dev@ozlabs.org 1268L: cbe-oss-dev@ozlabs.org
1458W: http://www.ibm.com/developerworks/power/cell/ 1269W: http://www.ibm.com/developerworks/power/cell/
@@ -1463,8 +1274,7 @@ F: arch/powerpc/oprofile/*cell*
1463F: arch/powerpc/platforms/cell/ 1274F: arch/powerpc/platforms/cell/
1464 1275
1465CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM: 1276CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
1466P: David Vrabel 1277M: David Vrabel <david.vrabel@csr.com>
1467M: david.vrabel@csr.com
1468L: linux-usb@vger.kernel.org 1278L: linux-usb@vger.kernel.org
1469S: Supported 1279S: Supported
1470F: Documentation/usb/WUSB-Design-overview.txt 1280F: Documentation/usb/WUSB-Design-overview.txt
@@ -1473,8 +1283,7 @@ F: drivers/usb/wusbcore/
1473F: include/linux/usb/wusb* 1283F: include/linux/usb/wusb*
1474 1284
1475CFAG12864B LCD DRIVER 1285CFAG12864B LCD DRIVER
1476P: Miguel Ojeda Sandonis 1286M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
1477M: miguel.ojeda.sandonis@gmail.com
1478W: http://miguelojeda.es/auxdisplay.htm 1287W: http://miguelojeda.es/auxdisplay.htm
1479W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1288W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1480S: Maintained 1289S: Maintained
@@ -1482,8 +1291,7 @@ F: drivers/auxdisplay/cfag12864b.c
1482F: include/linux/cfag12864b.h 1291F: include/linux/cfag12864b.h
1483 1292
1484CFAG12864BFB LCD FRAMEBUFFER DRIVER 1293CFAG12864BFB LCD FRAMEBUFFER DRIVER
1485P: Miguel Ojeda Sandonis 1294M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
1486M: miguel.ojeda.sandonis@gmail.com
1487W: http://miguelojeda.es/auxdisplay.htm 1295W: http://miguelojeda.es/auxdisplay.htm
1488W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1296W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1489S: Maintained 1297S: Maintained
@@ -1491,8 +1299,7 @@ F: drivers/auxdisplay/cfag12864bfb.c
1491F: include/linux/cfag12864b.h 1299F: include/linux/cfag12864b.h
1492 1300
1493CFG80211 and NL80211 1301CFG80211 and NL80211
1494P: Johannes Berg 1302M: Johannes Berg <johannes@sipsolutions.net>
1495M: johannes@sipsolutions.net
1496L: linux-wireless@vger.kernel.org 1303L: linux-wireless@vger.kernel.org
1497S: Maintained 1304S: Maintained
1498F: include/linux/nl80211.h 1305F: include/linux/nl80211.h
@@ -1501,66 +1308,47 @@ F: net/wireless/*
1501X: net/wireless/wext* 1308X: net/wireless/wext*
1502 1309
1503CHECKPATCH 1310CHECKPATCH
1504P: Andy Whitcroft 1311M: Andy Whitcroft <apw@canonical.com>
1505M: apw@canonical.com
1506S: Supported 1312S: Supported
1507F: scripts/checkpatch.pl 1313F: scripts/checkpatch.pl
1508 1314
1509CISCO 10G ETHERNET DRIVER 1315CISCO 10G ETHERNET DRIVER
1510P: Scott Feldman 1316M: Scott Feldman <scofeldm@cisco.com>
1511M: scofeldm@cisco.com 1317M: Joe Eykholt <jeykholt@cisco.com>
1512P: Joe Eykholt
1513M: jeykholt@cisco.com
1514S: Supported 1318S: Supported
1515F: drivers/net/enic/ 1319F: drivers/net/enic/
1516 1320
1517CIRRUS LOGIC EP93XX ETHERNET DRIVER 1321CIRRUS LOGIC EP93XX ETHERNET DRIVER
1518P: Lennert Buytenhek 1322M: Lennert Buytenhek <kernel@wantstofly.org>
1519M: kernel@wantstofly.org
1520L: netdev@vger.kernel.org 1323L: netdev@vger.kernel.org
1521S: Maintained 1324S: Maintained
1522F: drivers/net/arm/ep93xx_eth.c 1325F: drivers/net/arm/ep93xx_eth.c
1523 1326
1524CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER 1327CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER
1525P: Lennert Buytenhek 1328M: Lennert Buytenhek <kernel@wantstofly.org>
1526M: kernel@wantstofly.org
1527L: linux-usb@vger.kernel.org 1329L: linux-usb@vger.kernel.org
1528S: Maintained 1330S: Maintained
1529F: drivers/usb/host/ohci-ep93xx.c 1331F: drivers/usb/host/ohci-ep93xx.c
1530 1332
1531CIRRUS LOGIC CS4270 SOUND DRIVER 1333CIRRUS LOGIC CS4270 SOUND DRIVER
1532P: Timur Tabi 1334M: Timur Tabi <timur@freescale.com>
1533M: timur@freescale.com
1534L: alsa-devel@alsa-project.org (moderated for non-subscribers) 1335L: alsa-devel@alsa-project.org (moderated for non-subscribers)
1535S: Supported 1336S: Supported
1536F: sound/soc/codecs/cs4270* 1337F: sound/soc/codecs/cs4270*
1537 1338
1538CIRRUS LOGIC CS4280/CS461x SOUNDDRIVER
1539P: Cirrus Logic Corporation (kernel 2.2 driver)
1540M: Cirrus Logic Corporation, Thomas Woller <twoller@crystal.cirrus.com>
1541P: Nils Faerber (port to kernel 2.4)
1542M: Nils Faerber <nils@kernelconcepts.de>
1543S: Maintained
1544F: Documentation/input/cs461x.txt
1545F: sound/pci/cs46xx/
1546
1547CLK API 1339CLK API
1548P: Russell King 1340M: Russell King <linux@arm.linux.org.uk>
1549M: linux@arm.linux.org.uk
1550F: include/linux/clk.h 1341F: include/linux/clk.h
1551 1342
1552CISCO FCOE HBA DRIVER 1343CISCO FCOE HBA DRIVER
1553P: Abhijeet Joglekar 1344M: Abhijeet Joglekar <abjoglek@cisco.com>
1554M: abjoglek@cisco.com 1345M: Joe Eykholt <jeykholt@cisco.com>
1555P: Joe Eykholt
1556M: jeykholt@cisco.com
1557L: linux-scsi@vger.kernel.org 1346L: linux-scsi@vger.kernel.org
1558S: Supported 1347S: Supported
1559F: drivers/scsi/fnic/ 1348F: drivers/scsi/fnic/
1560 1349
1561CODA FILE SYSTEM 1350CODA FILE SYSTEM
1562P: Jan Harkes 1351M: Jan Harkes <jaharkes@cs.cmu.edu>
1563M: jaharkes@cs.cmu.edu
1564M: coda@cs.cmu.edu 1352M: coda@cs.cmu.edu
1565L: codalist@coda.cs.cmu.edu 1353L: codalist@coda.cs.cmu.edu
1566W: http://www.coda.cs.cmu.edu/ 1354W: http://www.coda.cs.cmu.edu/
@@ -1570,8 +1358,7 @@ F: fs/coda/
1570F: include/linux/coda*.h 1358F: include/linux/coda*.h
1571 1359
1572COMMON INTERNET FILE SYSTEM (CIFS) 1360COMMON INTERNET FILE SYSTEM (CIFS)
1573P: Steve French 1361M: Steve French <sfrench@samba.org>
1574M: sfrench@samba.org
1575L: linux-cifs-client@lists.samba.org 1362L: linux-cifs-client@lists.samba.org
1576L: samba-technical@lists.samba.org 1363L: samba-technical@lists.samba.org
1577W: http://linux-cifs.samba.org/ 1364W: http://linux-cifs.samba.org/
@@ -1581,63 +1368,57 @@ F: Documentation/filesystems/cifs.txt
1581F: fs/cifs/ 1368F: fs/cifs/
1582 1369
1583COMPACTPCI HOTPLUG CORE 1370COMPACTPCI HOTPLUG CORE
1584P: Scott Murray 1371M: Scott Murray <scott@spiteful.org>
1585M: scottm@somanetworks.com
1586M: scott@spiteful.org
1587L: linux-pci@vger.kernel.org 1372L: linux-pci@vger.kernel.org
1588S: Supported 1373S: Maintained
1589F: drivers/pci/hotplug/cpci_hotplug* 1374F: drivers/pci/hotplug/cpci_hotplug*
1590 1375
1591COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER 1376COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER
1592P: Scott Murray 1377M: Scott Murray <scott@spiteful.org>
1593M: scottm@somanetworks.com
1594M: scott@spiteful.org
1595L: linux-pci@vger.kernel.org 1378L: linux-pci@vger.kernel.org
1596S: Supported 1379S: Maintained
1597F: drivers/pci/hotplug/cpcihp_zt5550.* 1380F: drivers/pci/hotplug/cpcihp_zt5550.*
1598 1381
1599COMPACTPCI HOTPLUG GENERIC DRIVER 1382COMPACTPCI HOTPLUG GENERIC DRIVER
1600P: Scott Murray 1383M: Scott Murray <scott@spiteful.org>
1601M: scottm@somanetworks.com
1602M: scott@spiteful.org
1603L: linux-pci@vger.kernel.org 1384L: linux-pci@vger.kernel.org
1604S: Supported 1385S: Maintained
1605F: drivers/pci/hotplug/cpcihp_generic.c 1386F: drivers/pci/hotplug/cpcihp_generic.c
1606 1387
1607COMPAL LAPTOP SUPPORT 1388COMPAL LAPTOP SUPPORT
1608P: Cezary Jackiewicz 1389M: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
1609M: cezary.jackiewicz@gmail.com
1610S: Maintained 1390S: Maintained
1611F: drivers/platform/x86/compal-laptop.c 1391F: drivers/platform/x86/compal-laptop.c
1612 1392
1613COMPUTONE INTELLIPORT MULTIPORT CARD 1393COMPUTONE INTELLIPORT MULTIPORT CARD
1614P: Michael H. Warfield 1394M: "Michael H. Warfield" <mhw@wittsend.com>
1615M: mhw@wittsend.com
1616W: http://www.wittsend.com/computone.html 1395W: http://www.wittsend.com/computone.html
1617S: Maintained 1396S: Maintained
1618F: Documentation/serial/computone.txt 1397F: Documentation/serial/computone.txt
1619F: drivers/char/ip2/ 1398F: drivers/char/ip2/
1620 1399
1621CONEXANT ACCESSRUNNER USB DRIVER 1400CONEXANT ACCESSRUNNER USB DRIVER
1622P: Simon Arlott 1401M: Simon Arlott <cxacru@fire.lp0.eu>
1623M: cxacru@fire.lp0.eu
1624L: accessrunner-general@lists.sourceforge.net 1402L: accessrunner-general@lists.sourceforge.net
1625W: http://accessrunner.sourceforge.net/ 1403W: http://accessrunner.sourceforge.net/
1626S: Maintained 1404S: Maintained
1627F: drivers/usb/atm/cxacru.c 1405F: drivers/usb/atm/cxacru.c
1628 1406
1629CONFIGFS 1407CONFIGFS
1630P: Joel Becker 1408M: Joel Becker <joel.becker@oracle.com>
1631M: joel.becker@oracle.com
1632S: Supported 1409S: Supported
1633F: fs/configfs/ 1410F: fs/configfs/
1634F: include/linux/configfs.h 1411F: include/linux/configfs.h
1635 1412
1413CONNECTOR
1414M: Evgeniy Polyakov <zbr@ioremap.net>
1415L: netdev@vger.kernel.org
1416S: Maintained
1417F: drivers/connector/
1418
1636CONTROL GROUPS (CGROUPS) 1419CONTROL GROUPS (CGROUPS)
1637P: Paul Menage 1420M: Paul Menage <menage@google.com>
1638M: menage@google.com 1421M: Li Zefan <lizf@cn.fujitsu.com>
1639P: Li Zefan
1640M: lizf@cn.fujitsu.com
1641L: containers@lists.linux-foundation.org 1422L: containers@lists.linux-foundation.org
1642S: Maintained 1423S: Maintained
1643F: include/linux/cgroup* 1424F: include/linux/cgroup*
@@ -1645,30 +1426,26 @@ F: kernel/cgroup*
1645F: mm/*cgroup* 1426F: mm/*cgroup*
1646 1427
1647CORETEMP HARDWARE MONITORING DRIVER 1428CORETEMP HARDWARE MONITORING DRIVER
1648P: Rudolf Marek 1429M: Rudolf Marek <r.marek@assembler.cz>
1649M: r.marek@assembler.cz
1650L: lm-sensors@lm-sensors.org 1430L: lm-sensors@lm-sensors.org
1651S: Maintained 1431S: Maintained
1652F: Documentation/hwmon/coretemp 1432F: Documentation/hwmon/coretemp
1653F: drivers/hwmon/coretemp.c 1433F: drivers/hwmon/coretemp.c
1654 1434
1655COSA/SRP SYNC SERIAL DRIVER 1435COSA/SRP SYNC SERIAL DRIVER
1656P: Jan "Yenya" Kasprzak 1436M: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
1657M: kas@fi.muni.cz
1658W: http://www.fi.muni.cz/~kas/cosa/ 1437W: http://www.fi.muni.cz/~kas/cosa/
1659S: Maintained 1438S: Maintained
1660F: drivers/net/wan/cosa* 1439F: drivers/net/wan/cosa*
1661 1440
1662CPMAC ETHERNET DRIVER 1441CPMAC ETHERNET DRIVER
1663P: Florian Fainelli 1442M: Florian Fainelli <florian@openwrt.org>
1664M: florian@openwrt.org
1665L: netdev@vger.kernel.org 1443L: netdev@vger.kernel.org
1666S: Maintained 1444S: Maintained
1667F: drivers/net/cpmac.c 1445F: drivers/net/cpmac.c
1668 1446
1669CPU FREQUENCY DRIVERS 1447CPU FREQUENCY DRIVERS
1670P: Dave Jones 1448M: Dave Jones <davej@redhat.com>
1671M: davej@redhat.com
1672L: cpufreq@vger.kernel.org 1449L: cpufreq@vger.kernel.org
1673W: http://www.codemonkey.org.uk/projects/cpufreq/ 1450W: http://www.codemonkey.org.uk/projects/cpufreq/
1674T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git 1451T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git
@@ -1678,15 +1455,13 @@ F: drivers/cpufreq/
1678F: include/linux/cpufreq.h 1455F: include/linux/cpufreq.h
1679 1456
1680CPUID/MSR DRIVER 1457CPUID/MSR DRIVER
1681P: H. Peter Anvin 1458M: "H. Peter Anvin" <hpa@zytor.com>
1682M: hpa@zytor.com
1683S: Maintained 1459S: Maintained
1684F: arch/x86/kernel/cpuid.c 1460F: arch/x86/kernel/cpuid.c
1685F: arch/x86/kernel/msr.c 1461F: arch/x86/kernel/msr.c
1686 1462
1687CPUSETS 1463CPUSETS
1688P: Paul Menage 1464M: Paul Menage <menage@google.com>
1689M: menage@google.com
1690W: http://www.bullopensource.org/cpuset/ 1465W: http://www.bullopensource.org/cpuset/
1691W: http://oss.sgi.com/projects/cpusets/ 1466W: http://oss.sgi.com/projects/cpusets/
1692S: Supported 1467S: Supported
@@ -1701,20 +1476,16 @@ F: Documentation/filesystems/cramfs.txt
1701F: fs/cramfs/ 1476F: fs/cramfs/
1702 1477
1703CRIS PORT 1478CRIS PORT
1704P: Mikael Starvik 1479M: Mikael Starvik <starvik@axis.com>
1705M: starvik@axis.com 1480M: Jesper Nilsson <jesper.nilsson@axis.com>
1706P: Jesper Nilsson
1707M: jesper.nilsson@axis.com
1708L: linux-cris-kernel@axis.com 1481L: linux-cris-kernel@axis.com
1709W: http://developer.axis.com 1482W: http://developer.axis.com
1710S: Maintained 1483S: Maintained
1711F: arch/cris/ 1484F: arch/cris/
1712 1485
1713CRYPTO API 1486CRYPTO API
1714P: Herbert Xu 1487M: Herbert Xu <herbert@gondor.apana.org.au>
1715M: herbert@gondor.apana.org.au 1488M: "David S. Miller" <davem@davemloft.net>
1716P: David S. Miller
1717M: davem@davemloft.net
1718L: linux-crypto@vger.kernel.org 1489L: linux-crypto@vger.kernel.org
1719T: git git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git 1490T: git git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
1720S: Maintained 1491S: Maintained
@@ -1725,58 +1496,50 @@ F: drivers/crypto/
1725F: include/crypto/ 1496F: include/crypto/
1726 1497
1727CRYPTOGRAPHIC RANDOM NUMBER GENERATOR 1498CRYPTOGRAPHIC RANDOM NUMBER GENERATOR
1728P: Neil Horman 1499M: Neil Horman <nhorman@tuxdriver.com>
1729M: nhorman@tuxdriver.com
1730L: linux-crypto@vger.kernel.org 1500L: linux-crypto@vger.kernel.org
1731S: Maintained 1501S: Maintained
1732 1502
1733CS5535 Audio ALSA driver 1503CS5535 Audio ALSA driver
1734P: Jaya Kumar 1504M: Jaya Kumar <jayakumar.alsa@gmail.com>
1735M: jayakumar.alsa@gmail.com
1736S: Maintained 1505S: Maintained
1737F: sound/pci/cs5535audio/ 1506F: sound/pci/cs5535audio/
1738 1507
1739CX18 VIDEO4LINUX DRIVER 1508CX18 VIDEO4LINUX DRIVER
1740P: Hans Verkuil 1509M: Hans Verkuil <hverkuil@xs4all.nl>
1741M: hverkuil@xs4all.nl 1510M: Andy Walls <awalls@radix.net>
1742P: Andy Walls
1743M: awalls@radix.net
1744L: ivtv-devel@ivtvdriver.org 1511L: ivtv-devel@ivtvdriver.org
1745L: ivtv-users@ivtvdriver.org
1746L: linux-media@vger.kernel.org 1512L: linux-media@vger.kernel.org
1747T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1513T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1748W: http://linuxtv.org 1514W: http://linuxtv.org
1515W: http://www.ivtvdriver.org/index.php/Cx18
1749S: Maintained 1516S: Maintained
1750F: Documentation/video4linux/cx18.txt 1517F: Documentation/video4linux/cx18.txt
1751F: drivers/media/video/cx18/ 1518F: drivers/media/video/cx18/
1752 1519
1753CXGB3 ETHERNET DRIVER (CXGB3) 1520CXGB3 ETHERNET DRIVER (CXGB3)
1754P: Divy Le Ray 1521M: Divy Le Ray <divy@chelsio.com>
1755M: divy@chelsio.com
1756L: netdev@vger.kernel.org 1522L: netdev@vger.kernel.org
1757W: http://www.chelsio.com 1523W: http://www.chelsio.com
1758S: Supported 1524S: Supported
1759F: drivers/net/cxgb3/ 1525F: drivers/net/cxgb3/
1760 1526
1761CXGB3 IWARP RNIC DRIVER (IW_CXGB3) 1527CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
1762P: Steve Wise 1528M: Steve Wise <swise@chelsio.com>
1763M: swise@chelsio.com
1764L: general@lists.openfabrics.org 1529L: general@lists.openfabrics.org
1765W: http://www.openfabrics.org 1530W: http://www.openfabrics.org
1766S: Supported 1531S: Supported
1767F: drivers/infiniband/hw/cxgb3/ 1532F: drivers/infiniband/hw/cxgb3/
1768 1533
1769CYBERPRO FB DRIVER 1534CYBERPRO FB DRIVER
1770P: Russell King 1535M: Russell King <linux@arm.linux.org.uk>
1771M: linux@arm.linux.org.uk
1772L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 1536L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
1773W: http://www.arm.linux.org.uk/ 1537W: http://www.arm.linux.org.uk/
1774S: Maintained 1538S: Maintained
1775F: drivers/video/cyber2000fb.* 1539F: drivers/video/cyber2000fb.*
1776 1540
1777CYCLADES 2X SYNC CARD DRIVER 1541CYCLADES 2X SYNC CARD DRIVER
1778P: Arnaldo Carvalho de Melo 1542M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
1779M: acme@ghostprotocols.net
1780W: http://oops.ghostprotocols.net:81/blog 1543W: http://oops.ghostprotocols.net:81/blog
1781S: Maintained 1544S: Maintained
1782F: drivers/net/wan/cycx* 1545F: drivers/net/wan/cycx*
@@ -1793,8 +1556,7 @@ S: Orphan
1793F: drivers/net/wan/pc300* 1556F: drivers/net/wan/pc300*
1794 1557
1795DAMA SLAVE for AX.25 1558DAMA SLAVE for AX.25
1796P: Joerg Reuter 1559M: Joerg Reuter <jreuter@yaina.de>
1797M: jreuter@yaina.de
1798W: http://yaina.de/jreuter/ 1560W: http://yaina.de/jreuter/
1799W: http://www.qsl.net/dl1bke/ 1561W: http://www.qsl.net/dl1bke/
1800L: linux-hams@vger.kernel.org 1562L: linux-hams@vger.kernel.org
@@ -1808,29 +1570,23 @@ F: net/ax25/ax25_timer.c
1808F: net/ax25/sysctl_net_ax25.c 1570F: net/ax25/sysctl_net_ax25.c
1809 1571
1810DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER 1572DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER
1811P: Tobias Ringstrom 1573M: Tobias Ringstrom <tori@unhappy.mine.nu>
1812M: tori@unhappy.mine.nu
1813L: netdev@vger.kernel.org 1574L: netdev@vger.kernel.org
1814S: Maintained 1575S: Maintained
1815F: Documentation/networking/dmfe.txt 1576F: Documentation/networking/dmfe.txt
1816F: drivers/net/tulip/dmfe.c 1577F: drivers/net/tulip/dmfe.c
1817 1578
1818DC390/AM53C974 SCSI driver 1579DC390/AM53C974 SCSI driver
1819P: Kurt Garloff 1580M: Kurt Garloff <garloff@suse.de>
1820M: garloff@suse.de
1821W: http://www.garloff.de/kurt/linux/dc390/ 1581W: http://www.garloff.de/kurt/linux/dc390/
1822P: Guennadi Liakhovetski 1582M: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
1823M: g.liakhovetski@gmx.de
1824S: Maintained 1583S: Maintained
1825F: drivers/scsi/tmscsim.* 1584F: drivers/scsi/tmscsim.*
1826 1585
1827DC395x SCSI driver 1586DC395x SCSI driver
1828P: Oliver Neukum 1587M: Oliver Neukum <oliver@neukum.name>
1829M: oliver@neukum.name 1588M: Ali Akcaagac <aliakc@web.de>
1830P: Ali Akcaagac 1589M: Jamie Lenehan <lenehan@twibble.org>
1831M: aliakc@web.de
1832P: Jamie Lenehan
1833M: lenehan@twibble.org
1834W: http://twibble.org/dist/dc395x/ 1590W: http://twibble.org/dist/dc395x/
1835L: dc395x@twibble.org 1591L: dc395x@twibble.org
1836L: http://lists.twibble.org/mailman/listinfo/dc395x/ 1592L: http://lists.twibble.org/mailman/listinfo/dc395x/
@@ -1839,8 +1595,7 @@ F: Documentation/scsi/dc395x.txt
1839F: drivers/scsi/dc395x.* 1595F: drivers/scsi/dc395x.*
1840 1596
1841DCCP PROTOCOL 1597DCCP PROTOCOL
1842P: Arnaldo Carvalho de Melo 1598M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
1843M: acme@ghostprotocols.net
1844L: dccp@vger.kernel.org 1599L: dccp@vger.kernel.org
1845W: http://linux-net.osdl.org/index.php/DCCP 1600W: http://linux-net.osdl.org/index.php/DCCP
1846S: Maintained 1601S: Maintained
@@ -1849,8 +1604,7 @@ F: include/linux/tfrc.h
1849F: net/dccp/ 1604F: net/dccp/
1850 1605
1851DECnet NETWORK LAYER 1606DECnet NETWORK LAYER
1852P: Christine Caulfield 1607M: Christine Caulfield <christine.caulfield@googlemail.com>
1853M: christine.caulfield@googlemail.com
1854W: http://linux-decnet.sourceforge.net 1608W: http://linux-decnet.sourceforge.net
1855L: linux-decnet-user@lists.sourceforge.net 1609L: linux-decnet-user@lists.sourceforge.net
1856S: Maintained 1610S: Maintained
@@ -1858,40 +1612,34 @@ F: Documentation/networking/decnet.txt
1858F: net/decnet/ 1612F: net/decnet/
1859 1613
1860DEFXX FDDI NETWORK DRIVER 1614DEFXX FDDI NETWORK DRIVER
1861P: Maciej W. Rozycki 1615M: "Maciej W. Rozycki" <macro@linux-mips.org>
1862M: macro@linux-mips.org
1863S: Maintained 1616S: Maintained
1864F: drivers/net/defxx.* 1617F: drivers/net/defxx.*
1865 1618
1866DELL LAPTOP DRIVER 1619DELL LAPTOP DRIVER
1867P: Matthew Garrett 1620M: Matthew Garrett <mjg59@srcf.ucam.org>
1868M: mjg59@srcf.ucam.org
1869S: Maintained 1621S: Maintained
1870F: drivers/platform/x86/dell-laptop.c 1622F: drivers/platform/x86/dell-laptop.c
1871 1623
1872DELL LAPTOP SMM DRIVER 1624DELL LAPTOP SMM DRIVER
1873P: Massimo Dal Zotto 1625M: Massimo Dal Zotto <dz@debian.org>
1874M: dz@debian.org
1875W: http://www.debian.org/~dz/i8k/ 1626W: http://www.debian.org/~dz/i8k/
1876S: Maintained 1627S: Maintained
1877F: drivers/char/i8k.c 1628F: drivers/char/i8k.c
1878F: include/linux/i8k.h 1629F: include/linux/i8k.h
1879 1630
1880DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas) 1631DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas)
1881P: Doug Warzecha 1632M: Doug Warzecha <Douglas_Warzecha@dell.com>
1882M: Douglas_Warzecha@dell.com
1883S: Maintained 1633S: Maintained
1884F: Documentation/dcdbas.txt 1634F: Documentation/dcdbas.txt
1885F: drivers/firmware/dcdbas.* 1635F: drivers/firmware/dcdbas.*
1886 1636
1887DELL WMI EXTRAS DRIVER 1637DELL WMI EXTRAS DRIVER
1888P: Matthew Garrett 1638M: Matthew Garrett <mjg59@srcf.ucam.org>
1889M: mjg59@srcf.ucam.org
1890S: Maintained 1639S: Maintained
1891 1640
1892DEVICE NUMBER REGISTRY 1641DEVICE NUMBER REGISTRY
1893P: Torben Mathiasen 1642M: Torben Mathiasen <device@lanana.org>
1894M: device@lanana.org
1895W: http://lanana.org/docs/device-list/index.html 1643W: http://lanana.org/docs/device-list/index.html
1896S: Maintained 1644S: Maintained
1897 1645
@@ -1906,8 +1654,7 @@ F: include/linux/device-mapper.h
1906F: include/linux/dm-*.h 1654F: include/linux/dm-*.h
1907 1655
1908DIGI INTL. EPCA DRIVER 1656DIGI INTL. EPCA DRIVER
1909P: Digi International, Inc 1657M: "Digi International, Inc" <Eng.Linux@digi.com>
1910M: Eng.Linux@digi.com
1911L: Eng.Linux@digi.com 1658L: Eng.Linux@digi.com
1912W: http://www.digi.com 1659W: http://www.digi.com
1913S: Orphan 1660S: Orphan
@@ -1916,34 +1663,29 @@ F: drivers/char/epca*
1916F: drivers/char/digi* 1663F: drivers/char/digi*
1917 1664
1918DIRECTORY NOTIFICATION (DNOTIFY) 1665DIRECTORY NOTIFICATION (DNOTIFY)
1919P: Eric Paris 1666M: Eric Paris <eparis@parisplace.org>
1920M: eparis@parisplace.org
1921S: Maintained 1667S: Maintained
1922F: Documentation/filesystems/dnotify.txt 1668F: Documentation/filesystems/dnotify.txt
1923F: fs/notify/dnotify/ 1669F: fs/notify/dnotify/
1924F: include/linux/dnotify.h 1670F: include/linux/dnotify.h
1925 1671
1926DISK GEOMETRY AND PARTITION HANDLING 1672DISK GEOMETRY AND PARTITION HANDLING
1927P: Andries Brouwer 1673M: Andries Brouwer <aeb@cwi.nl>
1928M: aeb@cwi.nl
1929W: http://www.win.tue.nl/~aeb/linux/Large-Disk.html 1674W: http://www.win.tue.nl/~aeb/linux/Large-Disk.html
1930W: http://www.win.tue.nl/~aeb/linux/zip/zip-1.html 1675W: http://www.win.tue.nl/~aeb/linux/zip/zip-1.html
1931W: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html 1676W: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
1932S: Maintained 1677S: Maintained
1933 1678
1934DISKQUOTA 1679DISKQUOTA
1935P: Jan Kara 1680M: Jan Kara <jack@suse.cz>
1936M: jack@suse.cz
1937S: Maintained 1681S: Maintained
1938F: Documentation/filesystems/quota.txt 1682F: Documentation/filesystems/quota.txt
1939F: fs/quota/ 1683F: fs/quota/
1940F: include/linux/quota*.h 1684F: include/linux/quota*.h
1941 1685
1942DISTRIBUTED LOCK MANAGER (DLM) 1686DISTRIBUTED LOCK MANAGER (DLM)
1943P: Christine Caulfield 1687M: Christine Caulfield <ccaulfie@redhat.com>
1944M: ccaulfie@redhat.com 1688M: David Teigland <teigland@redhat.com>
1945P: David Teigland
1946M: teigland@redhat.com
1947L: cluster-devel@redhat.com 1689L: cluster-devel@redhat.com
1948W: http://sources.redhat.com/cluster/ 1690W: http://sources.redhat.com/cluster/
1949T: git git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm.git 1691T: git git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm.git
@@ -1951,52 +1693,44 @@ S: Supported
1951F: fs/dlm/ 1693F: fs/dlm/
1952 1694
1953DMA GENERIC OFFLOAD ENGINE SUBSYSTEM 1695DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
1954P: Maciej Sosnowski 1696M: Maciej Sosnowski <maciej.sosnowski@intel.com>
1955M: maciej.sosnowski@intel.com 1697M: Dan Williams <dan.j.williams@intel.com>
1956P: Dan Williams
1957M: dan.j.williams@intel.com
1958S: Supported 1698S: Supported
1959F: drivers/dma/ 1699F: drivers/dma/
1960F: include/linux/dma* 1700F: include/linux/dma*
1961 1701
1962DME1737 HARDWARE MONITOR DRIVER 1702DME1737 HARDWARE MONITOR DRIVER
1963P: Juerg Haefliger 1703M: Juerg Haefliger <juergh@gmail.com>
1964M: juergh@gmail.com
1965L: lm-sensors@lm-sensors.org 1704L: lm-sensors@lm-sensors.org
1966S: Maintained 1705S: Maintained
1967F: Documentation/hwmon/dme1737 1706F: Documentation/hwmon/dme1737
1968F: drivers/hwmon/dme1737.c 1707F: drivers/hwmon/dme1737.c
1969 1708
1970DOCBOOK FOR DOCUMENTATION 1709DOCBOOK FOR DOCUMENTATION
1971P: Randy Dunlap 1710M: Randy Dunlap <rdunlap@xenotime.net>
1972M: rdunlap@xenotime.net
1973S: Maintained 1711S: Maintained
1974 1712
1975DOCKING STATION DRIVER 1713DOCKING STATION DRIVER
1976P: Shaohua Li 1714M: Shaohua Li <shaohua.li@intel.com>
1977M: shaohua.li@intel.com
1978L: linux-acpi@vger.kernel.org 1715L: linux-acpi@vger.kernel.org
1979S: Supported 1716S: Supported
1980F: drivers/acpi/dock.c 1717F: drivers/acpi/dock.c
1981 1718
1982DOCUMENTATION 1719DOCUMENTATION
1983P: Randy Dunlap 1720M: Randy Dunlap <rdunlap@xenotime.net>
1984M: rdunlap@xenotime.net
1985L: linux-doc@vger.kernel.org 1721L: linux-doc@vger.kernel.org
1986S: Maintained 1722S: Maintained
1987F: Documentation/ 1723F: Documentation/
1988 1724
1989DOUBLETALK DRIVER 1725DOUBLETALK DRIVER
1990P: James R. Van Zandt 1726M: "James R. Van Zandt" <jrv@vanzandt.mv.com>
1991M: jrv@vanzandt.mv.com
1992L: blinux-list@redhat.com 1727L: blinux-list@redhat.com
1993S: Maintained 1728S: Maintained
1994F: drivers/char/dtlk.c 1729F: drivers/char/dtlk.c
1995F: include/linux/dtlk.h 1730F: include/linux/dtlk.h
1996 1731
1997DPT_I2O SCSI RAID DRIVER 1732DPT_I2O SCSI RAID DRIVER
1998P: Adaptec OEM Raid Solutions 1733M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
1999M: aacraid@adaptec.com
2000L: linux-scsi@vger.kernel.org 1734L: linux-scsi@vger.kernel.org
2001W: http://www.adaptec.com/ 1735W: http://www.adaptec.com/
2002S: Maintained 1736S: Maintained
@@ -2004,8 +1738,7 @@ F: drivers/scsi/dpt*
2004F: drivers/scsi/dpt/ 1738F: drivers/scsi/dpt/
2005 1739
2006DRIVER CORE, KOBJECTS, AND SYSFS 1740DRIVER CORE, KOBJECTS, AND SYSFS
2007P: Greg Kroah-Hartman 1741M: Greg Kroah-Hartman <gregkh@suse.de>
2008M: gregkh@suse.de
2009T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 1742T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
2010S: Supported 1743S: Supported
2011F: Documentation/kobject.txt 1744F: Documentation/kobject.txt
@@ -2015,52 +1748,45 @@ F: include/linux/kobj*
2015F: lib/kobj* 1748F: lib/kobj*
2016 1749
2017DRM DRIVERS 1750DRM DRIVERS
2018P: David Airlie 1751M: David Airlie <airlied@linux.ie>
2019M: airlied@linux.ie
2020L: dri-devel@lists.sourceforge.net 1752L: dri-devel@lists.sourceforge.net
2021T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git 1753T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
2022S: Maintained 1754S: Maintained
2023F: drivers/gpu/drm/ 1755F: drivers/gpu/drm/
2024 1756
2025DSCC4 DRIVER 1757DSCC4 DRIVER
2026P: Francois Romieu 1758M: Francois Romieu <romieu@fr.zoreil.com>
2027M: romieu@fr.zoreil.com
2028L: netdev@vger.kernel.org 1759L: netdev@vger.kernel.org
2029S: Maintained 1760S: Maintained
2030F: drivers/net/wan/dscc4.c 1761F: drivers/net/wan/dscc4.c
2031 1762
2032DZ DECSTATION DZ11 SERIAL DRIVER 1763DZ DECSTATION DZ11 SERIAL DRIVER
2033P: Maciej W. Rozycki 1764M: "Maciej W. Rozycki" <macro@linux-mips.org>
2034M: macro@linux-mips.org
2035S: Maintained 1765S: Maintained
2036F: drivers/serial/dz.* 1766F: drivers/serial/dz.*
2037 1767
2038EATA-DMA SCSI DRIVER 1768EATA-DMA SCSI DRIVER
2039P: Michael Neuffer 1769M: Michael Neuffer <mike@i-Connect.Net>
2040M: mike@i-Connect.Net
2041L: linux-eata@i-connect.net 1770L: linux-eata@i-connect.net
2042L: linux-scsi@vger.kernel.org 1771L: linux-scsi@vger.kernel.org
2043S: Maintained 1772S: Maintained
2044F: drivers/scsi/eata* 1773F: drivers/scsi/eata*
2045 1774
2046EATA ISA/EISA/PCI SCSI DRIVER 1775EATA ISA/EISA/PCI SCSI DRIVER
2047P: Dario Ballabio 1776M: Dario Ballabio <ballabio_dario@emc.com>
2048M: ballabio_dario@emc.com
2049L: linux-scsi@vger.kernel.org 1777L: linux-scsi@vger.kernel.org
2050S: Maintained 1778S: Maintained
2051F: drivers/scsi/eata.c 1779F: drivers/scsi/eata.c
2052 1780
2053EATA-PIO SCSI DRIVER 1781EATA-PIO SCSI DRIVER
2054P: Michael Neuffer 1782M: Michael Neuffer <mike@i-Connect.Net>
2055M: mike@i-Connect.Net
2056L: linux-eata@i-connect.net 1783L: linux-eata@i-connect.net
2057L: linux-scsi@vger.kernel.org 1784L: linux-scsi@vger.kernel.org
2058S: Maintained 1785S: Maintained
2059F: drivers/scsi/eata_pio.* 1786F: drivers/scsi/eata_pio.*
2060 1787
2061EBTABLES 1788EBTABLES
2062P: Bart De Schuymer 1789M: Bart De Schuymer <bart.de.schuymer@pandora.be>
2063M: bart.de.schuymer@pandora.be
2064L: ebtables-user@lists.sourceforge.net 1790L: ebtables-user@lists.sourceforge.net
2065L: ebtables-devel@lists.sourceforge.net 1791L: ebtables-devel@lists.sourceforge.net
2066W: http://ebtables.sourceforge.net/ 1792W: http://ebtables.sourceforge.net/
@@ -2069,10 +1795,8 @@ F: include/linux/netfilter_bridge/ebt_*.h
2069F: net/bridge/netfilter/ebt*.c 1795F: net/bridge/netfilter/ebt*.c
2070 1796
2071ECRYPT FILE SYSTEM 1797ECRYPT FILE SYSTEM
2072P: Tyler Hicks 1798M: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2073M: tyhicks@linux.vnet.ibm.com 1799M: Dustin Kirkland <kirkland@canonical.com>
2074P: Dustin Kirkland
2075M: kirkland@canonical.com
2076L: ecryptfs-devel@lists.launchpad.net 1800L: ecryptfs-devel@lists.launchpad.net
2077W: https://launchpad.net/ecryptfs 1801W: https://launchpad.net/ecryptfs
2078S: Supported 1802S: Supported
@@ -2080,8 +1804,7 @@ F: Documentation/filesystems/ecryptfs.txt
2080F: fs/ecryptfs/ 1804F: fs/ecryptfs/
2081 1805
2082EDAC-CORE 1806EDAC-CORE
2083P: Doug Thompson 1807M: Doug Thompson <dougthompson@xmission.com>
2084M: dougthompson@xmission.com
2085L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1808L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2086W: bluesmoke.sourceforge.net 1809W: bluesmoke.sourceforge.net
2087S: Supported 1810S: Supported
@@ -2090,94 +1813,80 @@ F: drivers/edac/edac_*
2090F: include/linux/edac.h 1813F: include/linux/edac.h
2091 1814
2092EDAC-AMD64 1815EDAC-AMD64
2093P: Doug Thompson 1816M: Doug Thompson <dougthompson@xmission.com>
2094M: dougthompson@xmission.com 1817M: Borislav Petkov <borislav.petkov@amd.com>
2095P: Borislav Petkov
2096M: borislav.petkov@amd.com
2097L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1818L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2098W: bluesmoke.sourceforge.net 1819W: bluesmoke.sourceforge.net
2099S: Supported 1820S: Supported
2100F: drivers/edac/amd64_edac* 1821F: drivers/edac/amd64_edac*
2101 1822
2102EDAC-E752X 1823EDAC-E752X
2103P: Mark Gross 1824M: Mark Gross <mark.gross@intel.com>
2104M: mark.gross@intel.com 1825M: Doug Thompson <dougthompson@xmission.com>
2105P: Doug Thompson
2106M: dougthompson@xmission.com
2107L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1826L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2108W: bluesmoke.sourceforge.net 1827W: bluesmoke.sourceforge.net
2109S: Maintained 1828S: Maintained
2110F: drivers/edac/e752x_edac.c 1829F: drivers/edac/e752x_edac.c
2111 1830
2112EDAC-E7XXX 1831EDAC-E7XXX
2113P: Doug Thompson 1832M: Doug Thompson <dougthompson@xmission.com>
2114M: dougthompson@xmission.com
2115L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1833L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2116W: bluesmoke.sourceforge.net 1834W: bluesmoke.sourceforge.net
2117S: Maintained 1835S: Maintained
2118F: drivers/edac/e7xxx_edac.c 1836F: drivers/edac/e7xxx_edac.c
2119 1837
2120EDAC-I82443BXGX 1838EDAC-I82443BXGX
2121P: Tim Small 1839M: Tim Small <tim@buttersideup.com>
2122M: tim@buttersideup.com
2123L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1840L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2124W: bluesmoke.sourceforge.net 1841W: bluesmoke.sourceforge.net
2125S: Maintained 1842S: Maintained
2126F: drivers/edac/i82443bxgx_edac.c 1843F: drivers/edac/i82443bxgx_edac.c
2127 1844
2128EDAC-I3000 1845EDAC-I3000
2129P: Jason Uhlenkott 1846M: Jason Uhlenkott <juhlenko@akamai.com>
2130M: juhlenko@akamai.com
2131L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1847L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2132W: bluesmoke.sourceforge.net 1848W: bluesmoke.sourceforge.net
2133S: Maintained 1849S: Maintained
2134F: drivers/edac/i3000_edac.c 1850F: drivers/edac/i3000_edac.c
2135 1851
2136EDAC-I5000 1852EDAC-I5000
2137P: Doug Thompson 1853M: Doug Thompson <dougthompson@xmission.com>
2138M: dougthompson@xmission.com
2139L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1854L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2140W: bluesmoke.sourceforge.net 1855W: bluesmoke.sourceforge.net
2141S: Maintained 1856S: Maintained
2142F: drivers/edac/i5000_edac.c 1857F: drivers/edac/i5000_edac.c
2143 1858
2144EDAC-I5400 1859EDAC-I5400
2145P: Mauro Carvalho Chehab 1860M: Mauro Carvalho Chehab <mchehab@redhat.com>
2146M: mchehab@redhat.com
2147L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1861L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2148W: bluesmoke.sourceforge.net 1862W: bluesmoke.sourceforge.net
2149S: Maintained 1863S: Maintained
2150F: drivers/edac/i5400_edac.c 1864F: drivers/edac/i5400_edac.c
2151 1865
2152EDAC-I82975X 1866EDAC-I82975X
2153P: Ranganathan Desikan 1867M: Ranganathan Desikan <ravi@jetztechnologies.com>
2154M: ravi@jetztechnologies.com 1868M: "Arvind R." <arvind@jetztechnologies.com>
2155P: Arvind R.
2156M: arvind@jetztechnologies.com
2157L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1869L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2158W: bluesmoke.sourceforge.net 1870W: bluesmoke.sourceforge.net
2159S: Maintained 1871S: Maintained
2160F: drivers/edac/i82975x_edac.c 1872F: drivers/edac/i82975x_edac.c
2161 1873
2162EDAC-PASEMI 1874EDAC-PASEMI
2163P: Egor Martovetsky 1875M: Egor Martovetsky <egor@pasemi.com>
2164M: egor@pasemi.com
2165L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1876L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2166W: bluesmoke.sourceforge.net 1877W: bluesmoke.sourceforge.net
2167S: Maintained 1878S: Maintained
2168F: drivers/edac/pasemi_edac.c 1879F: drivers/edac/pasemi_edac.c
2169 1880
2170EDAC-R82600 1881EDAC-R82600
2171P: Tim Small 1882M: Tim Small <tim@buttersideup.com>
2172M: tim@buttersideup.com
2173L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) 1883L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
2174W: bluesmoke.sourceforge.net 1884W: bluesmoke.sourceforge.net
2175S: Maintained 1885S: Maintained
2176F: drivers/edac/r82600_edac.c 1886F: drivers/edac/r82600_edac.c
2177 1887
2178EEEPC LAPTOP EXTRAS DRIVER 1888EEEPC LAPTOP EXTRAS DRIVER
2179P: Corentin Chary 1889M: Corentin Chary <corentincj@iksaif.net>
2180M: corentincj@iksaif.net
2181L: acpi4asus-user@lists.sourceforge.net 1890L: acpi4asus-user@lists.sourceforge.net
2182W: http://acpi4asus.sf.net 1891W: http://acpi4asus.sf.net
2183S: Maintained 1892S: Maintained
@@ -2189,66 +1898,54 @@ S: Orphan
2189F: fs/efs/ 1898F: fs/efs/
2190 1899
2191EHCA (IBM GX bus InfiniBand adapter) DRIVER 1900EHCA (IBM GX bus InfiniBand adapter) DRIVER
2192P: Hoang-Nam Nguyen 1901M: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
2193M: hnguyen@de.ibm.com 1902M: Christoph Raisch <raisch@de.ibm.com>
2194P: Christoph Raisch
2195M: raisch@de.ibm.com
2196L: general@lists.openfabrics.org 1903L: general@lists.openfabrics.org
2197S: Supported 1904S: Supported
2198F: drivers/infiniband/hw/ehca/ 1905F: drivers/infiniband/hw/ehca/
2199 1906
2200EMBEDDED LINUX 1907EMBEDDED LINUX
2201P: Paul Gortmaker 1908M: Paul Gortmaker <paul.gortmaker@windriver.com>
2202M: paul.gortmaker@windriver.com 1909M: Matt Mackall <mpm@selenic.com>
2203P: Matt Mackall 1910M: David Woodhouse <dwmw2@infradead.org>
2204M: mpm@selenic.com
2205P: David Woodhouse
2206M: dwmw2@infradead.org
2207L: linux-embedded@vger.kernel.org 1911L: linux-embedded@vger.kernel.org
2208S: Maintained 1912S: Maintained
2209 1913
2210EMULEX LPFC FC SCSI DRIVER 1914EMULEX LPFC FC SCSI DRIVER
2211P: James Smart 1915M: James Smart <james.smart@emulex.com>
2212M: james.smart@emulex.com
2213L: linux-scsi@vger.kernel.org 1916L: linux-scsi@vger.kernel.org
2214W: http://sourceforge.net/projects/lpfcxxxx 1917W: http://sourceforge.net/projects/lpfcxxxx
2215S: Supported 1918S: Supported
2216F: drivers/scsi/lpfc/ 1919F: drivers/scsi/lpfc/
2217 1920
2218ENE CB710 FLASH CARD READER DRIVER 1921ENE CB710 FLASH CARD READER DRIVER
2219P: Michał Mirosław 1922M: Michał Mirosław <mirq-linux@rere.qmqm.pl>
2220M: mirq-linux@rere.qmqm.pl
2221L: linux-kernel@vger.kernel.org
2222S: Maintained 1923S: Maintained
2223F: drivers/misc/cb710/ 1924F: drivers/misc/cb710/
2224F: drivers/mmc/host/cb710-mmc.* 1925F: drivers/mmc/host/cb710-mmc.*
2225F: include/linux/cb710.h 1926F: include/linux/cb710.h
2226 1927
2227EPSON 1355 FRAMEBUFFER DRIVER 1928EPSON 1355 FRAMEBUFFER DRIVER
2228P: Christopher Hoover 1929M: Christopher Hoover <ch@murgatroid.com>
2229M: ch@murgatroid.com 1930M: Christopher Hoover <ch@hpl.hp.com>
2230P: Christopher Hoover
2231M: ch@hpl.hp.com
2232S: Maintained 1931S: Maintained
2233F: drivers/video/epson1355fb.c 1932F: drivers/video/epson1355fb.c
2234 1933
2235EPSON S1D13XXX FRAMEBUFFER DRIVER 1934EPSON S1D13XXX FRAMEBUFFER DRIVER
2236P: Kristoffer Ericson 1935M: Kristoffer Ericson <kristoffer.ericson@gmail.com>
2237M: kristoffer.ericson@gmail.com
2238S: Maintained 1936S: Maintained
1937T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git
2239F: drivers/video/s1d13xxxfb.c 1938F: drivers/video/s1d13xxxfb.c
2240F: include/video/s1d13xxxfb.h 1939F: include/video/s1d13xxxfb.h
2241 1940
2242ETHEREXPRESS-16 NETWORK DRIVER 1941ETHEREXPRESS-16 NETWORK DRIVER
2243P: Philip Blundell 1942M: Philip Blundell <philb@gnu.org>
2244M: philb@gnu.org
2245L: netdev@vger.kernel.org 1943L: netdev@vger.kernel.org
2246S: Maintained 1944S: Maintained
2247F: drivers/net/eexpress.* 1945F: drivers/net/eexpress.*
2248 1946
2249ETHERNET BRIDGE 1947ETHERNET BRIDGE
2250P: Stephen Hemminger 1948M: Stephen Hemminger <shemminger@linux-foundation.org>
2251M: shemminger@linux-foundation.org
2252L: bridge@lists.linux-foundation.org 1949L: bridge@lists.linux-foundation.org
2253W: http://www.linux-foundation.org/en/Net:Bridge 1950W: http://www.linux-foundation.org/en/Net:Bridge
2254S: Maintained 1951S: Maintained
@@ -2256,8 +1953,7 @@ F: include/linux/netfilter_bridge/
2256F: net/bridge/ 1953F: net/bridge/
2257 1954
2258ETHERTEAM 16I DRIVER 1955ETHERTEAM 16I DRIVER
2259P: Mika Kuoppala 1956M: Mika Kuoppala <miku@iki.fi>
2260M: miku@iki.fi
2261S: Maintained 1957S: Maintained
2262F: drivers/net/eth16i.c 1958F: drivers/net/eth16i.c
2263 1959
@@ -2269,12 +1965,9 @@ F: fs/ext2/
2269F: include/linux/ext2* 1965F: include/linux/ext2*
2270 1966
2271EXT3 FILE SYSTEM 1967EXT3 FILE SYSTEM
2272P: Stephen Tweedie 1968M: Stephen Tweedie <sct@redhat.com>
2273M: sct@redhat.com 1969M: Andrew Morton <akpm@linux-foundation.org>
2274P: Andrew Morton 1970M: Andreas Dilger <adilger@sun.com>
2275M: akpm@linux-foundation.org
2276P: Andreas Dilger
2277M: adilger@sun.com
2278L: linux-ext4@vger.kernel.org 1971L: linux-ext4@vger.kernel.org
2279S: Maintained 1972S: Maintained
2280F: Documentation/filesystems/ext3.txt 1973F: Documentation/filesystems/ext3.txt
@@ -2282,10 +1975,8 @@ F: fs/ext3/
2282F: include/linux/ext3* 1975F: include/linux/ext3*
2283 1976
2284EXT4 FILE SYSTEM 1977EXT4 FILE SYSTEM
2285P: Theodore Ts'o 1978M: "Theodore Ts'o" <tytso@mit.edu>
2286M: tytso@mit.edu 1979M: Andreas Dilger <adilger@sun.com>
2287P: Andreas Dilger
2288M: adilger@sun.com
2289L: linux-ext4@vger.kernel.org 1980L: linux-ext4@vger.kernel.org
2290W: http://ext4.wiki.kernel.org 1981W: http://ext4.wiki.kernel.org
2291S: Maintained 1982S: Maintained
@@ -2293,30 +1984,26 @@ F: Documentation/filesystems/ext4.txt
2293F: fs/ext4/ 1984F: fs/ext4/
2294 1985
2295F71805F HARDWARE MONITORING DRIVER 1986F71805F HARDWARE MONITORING DRIVER
2296P: Jean Delvare 1987M: Jean Delvare <khali@linux-fr.org>
2297M: khali@linux-fr.org
2298L: lm-sensors@lm-sensors.org 1988L: lm-sensors@lm-sensors.org
2299S: Maintained 1989S: Maintained
2300F: Documentation/hwmon/f71805f 1990F: Documentation/hwmon/f71805f
2301F: drivers/hwmon/f71805f.c 1991F: drivers/hwmon/f71805f.c
2302 1992
2303FARSYNC SYNCHRONOUS DRIVER 1993FARSYNC SYNCHRONOUS DRIVER
2304P: Kevin Curtis 1994M: Kevin Curtis <kevin.curtis@farsite.co.uk>
2305M: kevin.curtis@farsite.co.uk
2306W: http://www.farsite.co.uk/ 1995W: http://www.farsite.co.uk/
2307S: Supported 1996S: Supported
2308F: drivers/net/wan/farsync.* 1997F: drivers/net/wan/farsync.*
2309 1998
2310FAULT INJECTION SUPPORT 1999FAULT INJECTION SUPPORT
2311P: Akinobu Mita 2000M: Akinobu Mita <akinobu.mita@gmail.com>
2312M: akinobu.mita@gmail.com
2313S: Supported 2001S: Supported
2314F: Documentation/fault-injection/ 2002F: Documentation/fault-injection/
2315F: lib/fault-inject.c 2003F: lib/fault-inject.c
2316 2004
2317FILE LOCKING (flock() and fcntl()/lockf()) 2005FILE LOCKING (flock() and fcntl()/lockf())
2318P: Matthew Wilcox 2006M: Matthew Wilcox <matthew@wil.cx>
2319M: matthew@wil.cx
2320L: linux-fsdevel@vger.kernel.org 2007L: linux-fsdevel@vger.kernel.org
2321S: Maintained 2008S: Maintained
2322F: include/linux/fcntl.h 2009F: include/linux/fcntl.h
@@ -2325,25 +2012,21 @@ F: fs/fcntl.c
2325F: fs/locks.c 2012F: fs/locks.c
2326 2013
2327FILESYSTEMS (VFS and infrastructure) 2014FILESYSTEMS (VFS and infrastructure)
2328P: Alexander Viro 2015M: Alexander Viro <viro@zeniv.linux.org.uk>
2329M: viro@zeniv.linux.org.uk
2330L: linux-fsdevel@vger.kernel.org 2016L: linux-fsdevel@vger.kernel.org
2331S: Maintained 2017S: Maintained
2332F: fs/* 2018F: fs/*
2333 2019
2334FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER 2020FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
2335P: Riku Voipio 2021M: Riku Voipio <riku.vipio@iki.fi>
2336M: riku.vipio@iki.fi
2337L: lm-sensors@lm-sensors.org 2022L: lm-sensors@lm-sensors.org
2338S: Maintained 2023S: Maintained
2339F: drivers/hwmon/f75375s.c 2024F: drivers/hwmon/f75375s.c
2340F: include/linux/f75375s.h 2025F: include/linux/f75375s.h
2341 2026
2342FIREWIRE SUBSYSTEM 2027FIREWIRE SUBSYSTEM
2343P: Kristian Hoegsberg 2028M: Kristian Hoegsberg <krh@redhat.com>
2344M: krh@redhat.com 2029M: Stefan Richter <stefanr@s5r6.in-berlin.de>
2345P: Stefan Richter
2346M: stefanr@s5r6.in-berlin.de
2347L: linux1394-devel@lists.sourceforge.net 2030L: linux1394-devel@lists.sourceforge.net
2348W: http://www.linux1394.org/ 2031W: http://www.linux1394.org/
2349T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git 2032T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
@@ -2358,15 +2041,13 @@ F: drivers/base/firmware*.c
2358F: include/linux/firmware.h 2041F: include/linux/firmware.h
2359 2042
2360FPU EMULATOR 2043FPU EMULATOR
2361P: Bill Metzenthen 2044M: Bill Metzenthen <billm@melbpc.org.au>
2362M: billm@melbpc.org.au
2363W: http://floatingpoint.sourceforge.net/emulator/index.html 2045W: http://floatingpoint.sourceforge.net/emulator/index.html
2364S: Maintained 2046S: Maintained
2365F: arch/x86/math-emu/ 2047F: arch/x86/math-emu/
2366 2048
2367FRAME RELAY DLCI/FRAD (Sangoma drivers too) 2049FRAME RELAY DLCI/FRAD (Sangoma drivers too)
2368P: Mike McLagan 2050M: Mike McLagan <mike.mclagan@linux.org>
2369M: mike.mclagan@linux.org
2370L: netdev@vger.kernel.org 2051L: netdev@vger.kernel.org
2371S: Maintained 2052S: Maintained
2372F: drivers/net/wan/dlci.c 2053F: drivers/net/wan/dlci.c
@@ -2381,25 +2062,21 @@ F: drivers/video/fb*
2381F: include/linux/fb.h 2062F: include/linux/fb.h
2382 2063
2383FREESCALE DMA DRIVER 2064FREESCALE DMA DRIVER
2384P: Li Yang 2065M: Li Yang <leoli@freescale.com>
2385M: leoli@freescale.com 2066M: Zhang Wei <zw@zh-kernel.org>
2386P: Zhang Wei
2387M: zw@zh-kernel.org
2388L: linuxppc-dev@ozlabs.org 2067L: linuxppc-dev@ozlabs.org
2389S: Maintained 2068S: Maintained
2390F: drivers/dma/fsldma.* 2069F: drivers/dma/fsldma.*
2391 2070
2392FREESCALE I2C CPM DRIVER 2071FREESCALE I2C CPM DRIVER
2393P: Jochen Friedrich 2072M: Jochen Friedrich <jochen@scram.de>
2394M: jochen@scram.de
2395L: linuxppc-dev@ozlabs.org 2073L: linuxppc-dev@ozlabs.org
2396L: linux-i2c@vger.kernel.org 2074L: linux-i2c@vger.kernel.org
2397S: Maintained 2075S: Maintained
2398F: drivers/i2c/busses/i2c-cpm.c 2076F: drivers/i2c/busses/i2c-cpm.c
2399 2077
2400FREESCALE IMX / MXC FRAMEBUFFER DRIVER 2078FREESCALE IMX / MXC FRAMEBUFFER DRIVER
2401P: Sascha Hauer 2079M: Sascha Hauer <kernel@pengutronix.de>
2402M: kernel@pengutronix.de
2403L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2080L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2404L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 2081L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
2405S: Maintained 2082S: Maintained
@@ -2407,10 +2084,8 @@ F: arch/arm/plat-mxc/include/mach/imxfb.h
2407F: drivers/video/imxfb.c 2084F: drivers/video/imxfb.c
2408 2085
2409FREESCALE SOC FS_ENET DRIVER 2086FREESCALE SOC FS_ENET DRIVER
2410P: Pantelis Antoniou 2087M: Pantelis Antoniou <pantelis.antoniou@gmail.com>
2411M: pantelis.antoniou@gmail.com 2088M: Vitaly Bordug <vbordug@ru.mvista.com>
2412P: Vitaly Bordug
2413M: vbordug@ru.mvista.com
2414L: linuxppc-dev@ozlabs.org 2089L: linuxppc-dev@ozlabs.org
2415L: netdev@vger.kernel.org 2090L: netdev@vger.kernel.org
2416S: Maintained 2091S: Maintained
@@ -2418,39 +2093,34 @@ F: drivers/net/fs_enet/
2418F: include/linux/fs_enet_pd.h 2093F: include/linux/fs_enet_pd.h
2419 2094
2420FREESCALE QUICC ENGINE LIBRARY 2095FREESCALE QUICC ENGINE LIBRARY
2421P: Timur Tabi 2096M: Timur Tabi <timur@freescale.com>
2422M: timur@freescale.com
2423L: linuxppc-dev@ozlabs.org 2097L: linuxppc-dev@ozlabs.org
2424S: Supported 2098S: Supported
2425F: arch/powerpc/sysdev/qe_lib/ 2099F: arch/powerpc/sysdev/qe_lib/
2426F: arch/powerpc/include/asm/*qe.h 2100F: arch/powerpc/include/asm/*qe.h
2427 2101
2428FREESCALE HIGHSPEED USB DEVICE DRIVER 2102FREESCALE HIGHSPEED USB DEVICE DRIVER
2429P: Li Yang 2103M: Li Yang <leoli@freescale.com>
2430M: leoli@freescale.com
2431L: linux-usb@vger.kernel.org 2104L: linux-usb@vger.kernel.org
2432L: linuxppc-dev@ozlabs.org 2105L: linuxppc-dev@ozlabs.org
2433S: Maintained 2106S: Maintained
2434F: drivers/usb/gadget/fsl_usb2_udc.c 2107F: drivers/usb/gadget/fsl_usb2_udc.c
2435 2108
2436FREESCALE QUICC ENGINE UCC ETHERNET DRIVER 2109FREESCALE QUICC ENGINE UCC ETHERNET DRIVER
2437P: Li Yang 2110M: Li Yang <leoli@freescale.com>
2438M: leoli@freescale.com
2439L: netdev@vger.kernel.org 2111L: netdev@vger.kernel.org
2440L: linuxppc-dev@ozlabs.org 2112L: linuxppc-dev@ozlabs.org
2441S: Maintained 2113S: Maintained
2442F: drivers/net/ucc_geth* 2114F: drivers/net/ucc_geth*
2443 2115
2444FREESCALE QUICC ENGINE UCC UART DRIVER 2116FREESCALE QUICC ENGINE UCC UART DRIVER
2445P: Timur Tabi 2117M: Timur Tabi <timur@freescale.com>
2446M: timur@freescale.com
2447L: linuxppc-dev@ozlabs.org 2118L: linuxppc-dev@ozlabs.org
2448S: Supported 2119S: Supported
2449F: drivers/serial/ucc_uart.c 2120F: drivers/serial/ucc_uart.c
2450 2121
2451FREESCALE SOC SOUND DRIVERS 2122FREESCALE SOC SOUND DRIVERS
2452P: Timur Tabi 2123M: Timur Tabi <timur@freescale.com>
2453M: timur@freescale.com
2454L: alsa-devel@alsa-project.org (moderated for non-subscribers) 2124L: alsa-devel@alsa-project.org (moderated for non-subscribers)
2455L: linuxppc-dev@ozlabs.org 2125L: linuxppc-dev@ozlabs.org
2456S: Supported 2126S: Supported
@@ -2458,17 +2128,14 @@ F: sound/soc/fsl/fsl*
2458F: sound/soc/fsl/mpc8610_hpcd.c 2128F: sound/soc/fsl/mpc8610_hpcd.c
2459 2129
2460FREEVXFS FILESYSTEM 2130FREEVXFS FILESYSTEM
2461P: Christoph Hellwig 2131M: Christoph Hellwig <hch@infradead.org>
2462M: hch@infradead.org
2463W: ftp://ftp.openlinux.org/pub/people/hch/vxfs 2132W: ftp://ftp.openlinux.org/pub/people/hch/vxfs
2464S: Maintained 2133S: Maintained
2465F: fs/freevxfs/ 2134F: fs/freevxfs/
2466 2135
2467FREEZER 2136FREEZER
2468P: Pavel Machek 2137M: Pavel Machek <pavel@ucw.cz>
2469M: pavel@ucw.cz 2138M: "Rafael J. Wysocki" <rjw@sisk.pl>
2470P: Rafael J. Wysocki
2471M: rjw@sisk.pl
2472L: linux-pm@lists.linux-foundation.org 2139L: linux-pm@lists.linux-foundation.org
2473S: Supported 2140S: Supported
2474F: Documentation/power/freezing-of-tasks.txt 2141F: Documentation/power/freezing-of-tasks.txt
@@ -2476,8 +2143,7 @@ F: include/linux/freezer.h
2476F: kernel/freezer.c 2143F: kernel/freezer.c
2477 2144
2478FS-CACHE: LOCAL CACHING FOR NETWORK FILESYSTEMS 2145FS-CACHE: LOCAL CACHING FOR NETWORK FILESYSTEMS
2479P: David Howells 2146M: David Howells <dhowells@redhat.com>
2480M: dhowells@redhat.com
2481L: linux-cachefs@redhat.com 2147L: linux-cachefs@redhat.com
2482S: Supported 2148S: Supported
2483F: Documentation/filesystems/caching/ 2149F: Documentation/filesystems/caching/
@@ -2485,8 +2151,7 @@ F: fs/fscache/
2485F: include/linux/fscache*.h 2151F: include/linux/fscache*.h
2486 2152
2487FTRACE 2153FTRACE
2488P: Steven Rostedt 2154M: Steven Rostedt <rostedt@goodmis.org>
2489M: rostedt@goodmis.org
2490S: Maintained 2155S: Maintained
2491F: Documentation/trace/ftrace.txt 2156F: Documentation/trace/ftrace.txt
2492F: arch/*/*/*/ftrace.h 2157F: arch/*/*/*/ftrace.h
@@ -2495,21 +2160,18 @@ F: include/*/ftrace.h
2495F: kernel/trace/ 2160F: kernel/trace/
2496 2161
2497FUJITSU FR-V (FRV) PORT 2162FUJITSU FR-V (FRV) PORT
2498P: David Howells 2163M: David Howells <dhowells@redhat.com>
2499M: dhowells@redhat.com
2500S: Maintained 2164S: Maintained
2501F: arch/frv/ 2165F: arch/frv/
2502 2166
2503FUJITSU LAPTOP EXTRAS 2167FUJITSU LAPTOP EXTRAS
2504P: Jonathan Woithe 2168M: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
2505M: jwoithe@physics.adelaide.edu.au
2506L: linux-acpi@vger.kernel.org 2169L: linux-acpi@vger.kernel.org
2507S: Maintained 2170S: Maintained
2508F: drivers/platform/x86/fujitsu-laptop.c 2171F: drivers/platform/x86/fujitsu-laptop.c
2509 2172
2510FUSE: FILESYSTEM IN USERSPACE 2173FUSE: FILESYSTEM IN USERSPACE
2511P: Miklos Szeredi 2174M: Miklos Szeredi <miklos@szeredi.hu>
2512M: miklos@szeredi.hu
2513L: fuse-devel@lists.sourceforge.net 2175L: fuse-devel@lists.sourceforge.net
2514W: http://fuse.sourceforge.net/ 2176W: http://fuse.sourceforge.net/
2515S: Maintained 2177S: Maintained
@@ -2517,30 +2179,26 @@ F: fs/fuse/
2517F: include/linux/fuse.h 2179F: include/linux/fuse.h
2518 2180
2519FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) 2181FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit)
2520P: Rik Faith 2182M: Rik Faith <faith@cs.unc.edu>
2521M: faith@cs.unc.edu
2522L: linux-scsi@vger.kernel.org 2183L: linux-scsi@vger.kernel.org
2523S: Odd Fixes (e.g., new signatures) 2184S: Odd Fixes (e.g., new signatures)
2524F: drivers/scsi/fdomain.* 2185F: drivers/scsi/fdomain.*
2525 2186
2526GDT SCSI DISK ARRAY CONTROLLER DRIVER 2187GDT SCSI DISK ARRAY CONTROLLER DRIVER
2527P: Achim Leubner 2188M: Achim Leubner <achim_leubner@adaptec.com>
2528M: achim_leubner@adaptec.com
2529L: linux-scsi@vger.kernel.org 2189L: linux-scsi@vger.kernel.org
2530W: http://www.icp-vortex.com/ 2190W: http://www.icp-vortex.com/
2531S: Supported 2191S: Supported
2532F: drivers/scsi/gdt* 2192F: drivers/scsi/gdt*
2533 2193
2534GENERIC GPIO I2C DRIVER 2194GENERIC GPIO I2C DRIVER
2535P: Haavard Skinnemoen 2195M: Haavard Skinnemoen <hskinnemoen@atmel.com>
2536M: hskinnemoen@atmel.com
2537S: Supported 2196S: Supported
2538F: drivers/i2c/busses/i2c-gpio.c 2197F: drivers/i2c/busses/i2c-gpio.c
2539F: include/linux/i2c-gpio.h 2198F: include/linux/i2c-gpio.h
2540 2199
2541GENERIC HDLC (WAN) DRIVERS 2200GENERIC HDLC (WAN) DRIVERS
2542P: Krzysztof Halasa 2201M: Krzysztof Halasa <khc@pm.waw.pl>
2543M: khc@pm.waw.pl
2544W: http://www.kernel.org/pub/linux/utils/net/hdlc/ 2202W: http://www.kernel.org/pub/linux/utils/net/hdlc/
2545S: Maintained 2203S: Maintained
2546F: drivers/net/wan/c101.c 2204F: drivers/net/wan/c101.c
@@ -2552,16 +2210,14 @@ F: drivers/net/wan/pci200syn.c
2552F: drivers/net/wan/wanxl* 2210F: drivers/net/wan/wanxl*
2553 2211
2554GENERIC INCLUDE/ASM HEADER FILES 2212GENERIC INCLUDE/ASM HEADER FILES
2555P: Arnd Bergmann 2213M: Arnd Bergmann <arnd@arndb.de>
2556M: arnd@arndb.de
2557L: linux-arch@vger.kernel.org 2214L: linux-arch@vger.kernel.org
2558T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 2215T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
2559S: Maintained 2216S: Maintained
2560F: include/asm-generic 2217F: include/asm-generic
2561 2218
2562GFS2 FILE SYSTEM 2219GFS2 FILE SYSTEM
2563P: Steven Whitehouse 2220M: Steven Whitehouse <swhiteho@redhat.com>
2564M: swhiteho@redhat.com
2565L: cluster-devel@redhat.com 2221L: cluster-devel@redhat.com
2566W: http://sources.redhat.com/cluster/ 2222W: http://sources.redhat.com/cluster/
2567T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git 2223T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git
@@ -2572,10 +2228,8 @@ F: fs/gfs2/
2572F: include/linux/gfs2_ondisk.h 2228F: include/linux/gfs2_ondisk.h
2573 2229
2574GIGASET ISDN DRIVERS 2230GIGASET ISDN DRIVERS
2575P: Hansjoerg Lipp 2231M: Hansjoerg Lipp <hjlipp@web.de>
2576M: hjlipp@web.de 2232M: Tilman Schmidt <tilman@imap.cc>
2577P: Tilman Schmidt
2578M: tilman@imap.cc
2579L: gigaset307x-common@lists.sourceforge.net 2233L: gigaset307x-common@lists.sourceforge.net
2580W: http://gigaset307x.sourceforge.net/ 2234W: http://gigaset307x.sourceforge.net/
2581S: Maintained 2235S: Maintained
@@ -2584,8 +2238,7 @@ F: drivers/isdn/gigaset/
2584F: include/linux/gigaset_dev.h 2238F: include/linux/gigaset_dev.h
2585 2239
2586HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER 2240HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
2587P: Frank Seidel 2241M: Frank Seidel <frank@f-seidel.de>
2588M: frank@f-seidel.de
2589L: lm-sensors@lm-sensors.org 2242L: lm-sensors@lm-sensors.org
2590W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/ 2243W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
2591S: Maintained 2244S: Maintained
@@ -2597,40 +2250,35 @@ S: Odd Fixes
2597F: drivers/char/hvc_* 2250F: drivers/char/hvc_*
2598 2251
2599GSPCA FINEPIX SUBDRIVER 2252GSPCA FINEPIX SUBDRIVER
2600P: Frank Zago 2253M: Frank Zago <frank@zago.net>
2601M: frank@zago.net
2602L: linux-media@vger.kernel.org 2254L: linux-media@vger.kernel.org
2603T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2255T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2604S: Maintained 2256S: Maintained
2605F: drivers/media/video/gspca/finepix.c 2257F: drivers/media/video/gspca/finepix.c
2606 2258
2607GSPCA M5602 SUBDRIVER 2259GSPCA M5602 SUBDRIVER
2608P: Erik Andren 2260M: Erik Andren <erik.andren@gmail.com>
2609M: erik.andren@gmail.com
2610L: linux-media@vger.kernel.org 2261L: linux-media@vger.kernel.org
2611T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2262T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2612S: Maintained 2263S: Maintained
2613F: drivers/media/video/gspca/m5602/ 2264F: drivers/media/video/gspca/m5602/
2614 2265
2615GSPCA PAC207 SONIXB SUBDRIVER 2266GSPCA PAC207 SONIXB SUBDRIVER
2616P: Hans de Goede 2267M: Hans de Goede <hdegoede@redhat.com>
2617M: hdegoede@redhat.com
2618L: linux-media@vger.kernel.org 2268L: linux-media@vger.kernel.org
2619T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2269T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2620S: Maintained 2270S: Maintained
2621F: drivers/media/video/gspca/pac207.c 2271F: drivers/media/video/gspca/pac207.c
2622 2272
2623GSPCA T613 SUBDRIVER 2273GSPCA T613 SUBDRIVER
2624P: Leandro Costantino 2274M: Leandro Costantino <lcostantino@gmail.com>
2625M: lcostantino@gmail.com
2626L: linux-media@vger.kernel.org 2275L: linux-media@vger.kernel.org
2627T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2276T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2628S: Maintained 2277S: Maintained
2629F: drivers/media/video/gspca/t613.c 2278F: drivers/media/video/gspca/t613.c
2630 2279
2631GSPCA USB WEBCAM DRIVER 2280GSPCA USB WEBCAM DRIVER
2632P: Jean-Francois Moine 2281M: Jean-Francois Moine <moinejf@free.fr>
2633M: moinejf@free.fr
2634W: http://moinejf.free.fr 2282W: http://moinejf.free.fr
2635L: linux-media@vger.kernel.org 2283L: linux-media@vger.kernel.org
2636T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2284T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -2650,31 +2298,27 @@ F: drivers/char/hw_random/
2650F: include/linux/hw_random.h 2298F: include/linux/hw_random.h
2651 2299
2652HARMONY SOUND DRIVER 2300HARMONY SOUND DRIVER
2653P: Kyle McMartin 2301M: Kyle McMartin <kyle@mcmartin.ca>
2654M: kyle@mcmartin.ca
2655L: linux-parisc@vger.kernel.org 2302L: linux-parisc@vger.kernel.org
2656S: Maintained 2303S: Maintained
2657F: sound/parisc/harmony.* 2304F: sound/parisc/harmony.*
2658 2305
2659HAYES ESP SERIAL DRIVER 2306HAYES ESP SERIAL DRIVER
2660P: Andrew J. Robinson 2307M: "Andrew J. Robinson" <arobinso@nyx.net>
2661M: arobinso@nyx.net
2662W: http://www.nyx.net/~arobinso 2308W: http://www.nyx.net/~arobinso
2663S: Maintained 2309S: Maintained
2664F: Documentation/serial/hayes-esp.txt 2310F: Documentation/serial/hayes-esp.txt
2665F: drivers/char/esp.c 2311F: drivers/char/esp.c
2666 2312
2667HEWLETT-PACKARD SMART2 RAID DRIVER 2313HEWLETT-PACKARD SMART2 RAID DRIVER
2668P: Chirag Kantharia 2314M: Chirag Kantharia <chirag.kantharia@hp.com>
2669M: chirag.kantharia@hp.com
2670L: iss_storagedev@hp.com 2315L: iss_storagedev@hp.com
2671S: Maintained 2316S: Maintained
2672F: Documentation/blockdev/cpqarray.txt 2317F: Documentation/blockdev/cpqarray.txt
2673F: drivers/block/cpqarray.* 2318F: drivers/block/cpqarray.*
2674 2319
2675HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) 2320HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
2676P: Mike Miller 2321M: Mike Miller <mike.miller@hp.com>
2677M: mike.miller@hp.com
2678L: iss_storagedev@hp.com 2322L: iss_storagedev@hp.com
2679S: Supported 2323S: Supported
2680F: Documentation/blockdev/cciss.txt 2324F: Documentation/blockdev/cciss.txt
@@ -2682,25 +2326,21 @@ F: drivers/block/cciss*
2682F: include/linux/cciss_ioctl.h 2326F: include/linux/cciss_ioctl.h
2683 2327
2684HFS FILESYSTEM 2328HFS FILESYSTEM
2685P: Roman Zippel 2329M: Roman Zippel <zippel@linux-m68k.org>
2686M: zippel@linux-m68k.org
2687S: Maintained 2330S: Maintained
2688F: Documentation/filesystems/hfs.txt 2331F: Documentation/filesystems/hfs.txt
2689F: fs/hfs/ 2332F: fs/hfs/
2690 2333
2691HGA FRAMEBUFFER DRIVER 2334HGA FRAMEBUFFER DRIVER
2692P: Ferenc Bakonyi 2335M: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
2693M: fero@drama.obuda.kando.hu
2694L: linux-nvidia@lists.surfsouth.com 2336L: linux-nvidia@lists.surfsouth.com
2695W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml 2337W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml
2696S: Maintained 2338S: Maintained
2697F: drivers/video/hgafb.c 2339F: drivers/video/hgafb.c
2698 2340
2699HIBERNATION (aka Software Suspend, aka swsusp) 2341HIBERNATION (aka Software Suspend, aka swsusp)
2700P: Pavel Machek 2342M: Pavel Machek <pavel@ucw.cz>
2701M: pavel@ucw.cz 2343M: "Rafael J. Wysocki" <rjw@sisk.pl>
2702P: Rafael J. Wysocki
2703M: rjw@sisk.pl
2704L: linux-pm@lists.linux-foundation.org 2344L: linux-pm@lists.linux-foundation.org
2705S: Supported 2345S: Supported
2706F: arch/x86/power/ 2346F: arch/x86/power/
@@ -2712,8 +2352,7 @@ F: include/linux/pm.h
2712F: arch/*/include/asm/suspend*.h 2352F: arch/*/include/asm/suspend*.h
2713 2353
2714HID CORE LAYER 2354HID CORE LAYER
2715P: Jiri Kosina 2355M: Jiri Kosina <jkosina@suse.cz>
2716M: jkosina@suse.cz
2717L: linux-input@vger.kernel.org 2356L: linux-input@vger.kernel.org
2718T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git 2357T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
2719S: Maintained 2358S: Maintained
@@ -2721,16 +2360,14 @@ F: drivers/hid/
2721F: include/linux/hid* 2360F: include/linux/hid*
2722 2361
2723HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS 2362HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS
2724P: Thomas Gleixner 2363M: Thomas Gleixner <tglx@linutronix.de>
2725M: tglx@linutronix.de
2726S: Maintained 2364S: Maintained
2727F: Documentation/timers/ 2365F: Documentation/timers/
2728F: kernel/hrtimer.c 2366F: kernel/hrtimer.c
2729F: include/linux/hrtimer.h 2367F: include/linux/hrtimer.h
2730 2368
2731HIGH-SPEED SCC DRIVER FOR AX.25 2369HIGH-SPEED SCC DRIVER FOR AX.25
2732P: Klaus Kudielka 2370M: Klaus Kudielka <klaus.kudielka@ieee.org>
2733M: klaus.kudielka@ieee.org
2734L: linux-hams@vger.kernel.org 2371L: linux-hams@vger.kernel.org
2735W: http://www.nt.tuwien.ac.at/~kkudielk/Linux/ 2372W: http://www.nt.tuwien.ac.at/~kkudielk/Linux/
2736S: Maintained 2373S: Maintained
@@ -2738,16 +2375,14 @@ F: drivers/net/hamradio/dmascc.c
2738F: drivers/net/hamradio/scc.c 2375F: drivers/net/hamradio/scc.c
2739 2376
2740HIGHPOINT ROCKETRAID 3xxx RAID DRIVER 2377HIGHPOINT ROCKETRAID 3xxx RAID DRIVER
2741P: HighPoint Linux Team 2378M: HighPoint Linux Team <linux@highpoint-tech.com>
2742M: linux@highpoint-tech.com
2743W: http://www.highpoint-tech.com 2379W: http://www.highpoint-tech.com
2744S: Supported 2380S: Supported
2745F: Documentation/scsi/hptiop.txt 2381F: Documentation/scsi/hptiop.txt
2746F: drivers/scsi/hptiop.c 2382F: drivers/scsi/hptiop.c
2747 2383
2748HIPPI 2384HIPPI
2749P: Jes Sorensen 2385M: Jes Sorensen <jes@trained-monkey.org>
2750M: jes@trained-monkey.org
2751L: linux-hippi@sunsite.dk 2386L: linux-hippi@sunsite.dk
2752S: Maintained 2387S: Maintained
2753F: include/linux/hippidevice.h 2388F: include/linux/hippidevice.h
@@ -2755,8 +2390,7 @@ F: include/linux/if_hippi.h
2755F: net/802/hippi.c 2390F: net/802/hippi.c
2756 2391
2757HOST AP DRIVER 2392HOST AP DRIVER
2758P: Jouni Malinen 2393M: Jouni Malinen <j@w1.fi>
2759M: j@w1.fi
2760L: hostap@shmoo.com (subscribers-only) 2394L: hostap@shmoo.com (subscribers-only)
2761L: linux-wireless@vger.kernel.org 2395L: linux-wireless@vger.kernel.org
2762W: http://hostap.epitest.fi/ 2396W: http://hostap.epitest.fi/
@@ -2764,82 +2398,69 @@ S: Maintained
2764F: drivers/net/wireless/hostap/ 2398F: drivers/net/wireless/hostap/
2765 2399
2766HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER 2400HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
2767P: Carlos Corbacho 2401M: Carlos Corbacho <carlos@strangeworlds.co.uk>
2768M: carlos@strangeworlds.co.uk
2769S: Odd Fixes 2402S: Odd Fixes
2770F: drivers/platform/x86/tc1100-wmi.c 2403F: drivers/platform/x86/tc1100-wmi.c
2771 2404
2772HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series 2405HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
2773P: Jaroslav Kysela 2406M: Jaroslav Kysela <perex@perex.cz>
2774M: perex@perex.cz
2775S: Maintained 2407S: Maintained
2776F: drivers/net/hp100.* 2408F: drivers/net/hp100.*
2777 2409
2778HPET: High Precision Event Timers driver 2410HPET: High Precision Event Timers driver
2779P: Clemens Ladisch 2411M: Clemens Ladisch <clemens@ladisch.de>
2780M: clemens@ladisch.de
2781S: Maintained 2412S: Maintained
2782F: Documentation/timers/hpet.txt 2413F: Documentation/timers/hpet.txt
2783F: drivers/char/hpet.c 2414F: drivers/char/hpet.c
2784F: include/linux/hpet.h 2415F: include/linux/hpet.h
2785 2416
2786HPET: i386 2417HPET: i386
2787P: Venkatesh Pallipadi (Venki) 2418M: "Venkatesh Pallipadi (Venki)" <venkatesh.pallipadi@intel.com>
2788M: venkatesh.pallipadi@intel.com
2789S: Maintained 2419S: Maintained
2790F: arch/x86/kernel/hpet.c 2420F: arch/x86/kernel/hpet.c
2791F: arch/x86/include/asm/hpet.h 2421F: arch/x86/include/asm/hpet.h
2792 2422
2793HPET: x86_64 2423HPET: x86_64
2794P: Vojtech Pavlik 2424M: Vojtech Pavlik <vojtech@suse.cz>
2795M: vojtech@suse.cz
2796S: Maintained 2425S: Maintained
2797 2426
2798HPET: ACPI 2427HPET: ACPI
2799P: Bob Picco 2428M: Bob Picco <bob.picco@hp.com>
2800M: bob.picco@hp.com
2801S: Maintained 2429S: Maintained
2802F: drivers/char/hpet.c 2430F: drivers/char/hpet.c
2803 2431
2804HPFS FILESYSTEM 2432HPFS FILESYSTEM
2805P: Mikulas Patocka 2433M: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
2806M: mikulas@artax.karlin.mff.cuni.cz
2807W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi 2434W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
2808S: Maintained 2435S: Maintained
2809F: fs/hpfs/ 2436F: fs/hpfs/
2810 2437
2811HSO 3G MODEM DRIVER 2438HSO 3G MODEM DRIVER
2812P: Jan Dumon 2439M: Jan Dumon <j.dumon@option.com>
2813M: j.dumon@option.com
2814W: http://www.pharscape.org 2440W: http://www.pharscape.org
2815S: Maintained 2441S: Maintained
2816F: drivers/net/usb/hso.c 2442F: drivers/net/usb/hso.c
2817 2443
2818HTCPEN TOUCHSCREEN DRIVER 2444HTCPEN TOUCHSCREEN DRIVER
2819P: Pau Oliva Fora 2445M: Pau Oliva Fora <pof@eslack.org>
2820M: pof@eslack.org
2821L: linux-input@vger.kernel.org 2446L: linux-input@vger.kernel.org
2822S: Maintained 2447S: Maintained
2823F: drivers/input/touchscreen/htcpen.c 2448F: drivers/input/touchscreen/htcpen.c
2824 2449
2825HUGETLB FILESYSTEM 2450HUGETLB FILESYSTEM
2826P: William Irwin 2451M: William Irwin <wli@holomorphy.com>
2827M: wli@holomorphy.com
2828S: Maintained 2452S: Maintained
2829F: fs/hugetlbfs/ 2453F: fs/hugetlbfs/
2830 2454
2831I2C/SMBUS STUB DRIVER 2455I2C/SMBUS STUB DRIVER
2832P: Mark M. Hoffman 2456M: "Mark M. Hoffman" <mhoffman@lightlink.com>
2833M: mhoffman@lightlink.com
2834L: linux-i2c@vger.kernel.org 2457L: linux-i2c@vger.kernel.org
2835S: Maintained 2458S: Maintained
2836F: drivers/i2c/busses/i2c-stub.c 2459F: drivers/i2c/busses/i2c-stub.c
2837 2460
2838I2C SUBSYSTEM 2461I2C SUBSYSTEM
2839P: Jean Delvare (PC drivers, core) 2462M: "Jean Delvare (PC drivers, core)" <khali@linux-fr.org>
2840M: khali@linux-fr.org 2463M: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
2841P: Ben Dooks (embedded platforms)
2842M: ben-linux@fluff.org
2843L: linux-i2c@vger.kernel.org 2464L: linux-i2c@vger.kernel.org
2844W: http://i2c.wiki.kernel.org/ 2465W: http://i2c.wiki.kernel.org/
2845T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ 2466T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
@@ -2851,30 +2472,25 @@ F: include/linux/i2c-dev.h
2851F: include/linux/i2c-id.h 2472F: include/linux/i2c-id.h
2852 2473
2853I2C-TINY-USB DRIVER 2474I2C-TINY-USB DRIVER
2854P: Till Harbaum 2475M: Till Harbaum <till@harbaum.org>
2855M: till@harbaum.org
2856L: linux-i2c@vger.kernel.org 2476L: linux-i2c@vger.kernel.org
2857W: http://www.harbaum.org/till/i2c_tiny_usb 2477W: http://www.harbaum.org/till/i2c_tiny_usb
2858S: Maintained 2478S: Maintained
2859F: drivers/i2c/busses/i2c-tiny-usb.c 2479F: drivers/i2c/busses/i2c-tiny-usb.c
2860 2480
2861i386 BOOT CODE 2481i386 BOOT CODE
2862P: H. Peter Anvin 2482M: "H. Peter Anvin" <hpa@zytor.com>
2863M: hpa@zytor.com
2864S: Maintained 2483S: Maintained
2865F: arch/x86/boot/ 2484F: arch/x86/boot/
2866 2485
2867i386 SETUP CODE / CPU ERRATA WORKAROUNDS 2486i386 SETUP CODE / CPU ERRATA WORKAROUNDS
2868P: H. Peter Anvin 2487M: "H. Peter Anvin" <hpa@zytor.com>
2869M: hpa@zytor.com
2870T: git git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git 2488T: git git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git
2871S: Maintained 2489S: Maintained
2872 2490
2873IA64 (Itanium) PLATFORM 2491IA64 (Itanium) PLATFORM
2874P: Tony Luck 2492M: Tony Luck <tony.luck@intel.com>
2875P: Fenghua Yu 2493M: Fenghua Yu <fenghua.yu@intel.com>
2876M: tony.luck@intel.com
2877M: fenghua.yu@intel.com
2878L: linux-ia64@vger.kernel.org 2494L: linux-ia64@vger.kernel.org
2879W: http://www.ia64-linux.org/ 2495W: http://www.ia64-linux.org/
2880T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git 2496T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git
@@ -2882,29 +2498,25 @@ S: Maintained
2882F: arch/ia64/ 2498F: arch/ia64/
2883 2499
2884IBM MCA SCSI SUBSYSTEM DRIVER 2500IBM MCA SCSI SUBSYSTEM DRIVER
2885P: Michael Lang 2501M: Michael Lang <langa2@kph.uni-mainz.de>
2886M: langa2@kph.uni-mainz.de
2887W: http://www.uni-mainz.de/~langm000/linux.html 2502W: http://www.uni-mainz.de/~langm000/linux.html
2888S: Maintained 2503S: Maintained
2889F: drivers/scsi/ibmmca.c 2504F: drivers/scsi/ibmmca.c
2890 2505
2891IBM Power Linux RAID adapter 2506IBM Power Linux RAID adapter
2892P: Brian King 2507M: Brian King <brking@us.ibm.com>
2893M: brking@us.ibm.com
2894S: Supported 2508S: Supported
2895F: drivers/scsi/ipr.* 2509F: drivers/scsi/ipr.*
2896 2510
2897IBM ServeRAID RAID DRIVER 2511IBM ServeRAID RAID DRIVER
2898P: Jack Hammer 2512P: Jack Hammer
2899P: Dave Jeffery 2513M: Dave Jeffery <ipslinux@adaptec.com>
2900M: ipslinux@adaptec.com
2901W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html 2514W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html
2902S: Supported 2515S: Supported
2903F: drivers/scsi/ips.* 2516F: drivers/scsi/ips.*
2904 2517
2905IDE SUBSYSTEM 2518IDE SUBSYSTEM
2906P: David S. Miller 2519M: "David S. Miller" <davem@davemloft.net>
2907M: davem@davemloft.net
2908L: linux-ide@vger.kernel.org 2520L: linux-ide@vger.kernel.org
2909T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6.git 2521T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6.git
2910S: Maintained 2522S: Maintained
@@ -2913,25 +2525,21 @@ F: drivers/ide/
2913F: include/linux/ide.h 2525F: include/linux/ide.h
2914 2526
2915IDE/ATAPI DRIVERS 2527IDE/ATAPI DRIVERS
2916P: Borislav Petkov 2528M: Borislav Petkov <petkovbb@gmail.com>
2917M: petkovbb@gmail.com
2918L: linux-ide@vger.kernel.org 2529L: linux-ide@vger.kernel.org
2919S: Maintained 2530S: Maintained
2920F: Documentation/cdrom/ide-cd 2531F: Documentation/cdrom/ide-cd
2921F: drivers/ide/ide-cd* 2532F: drivers/ide/ide-cd*
2922 2533
2923IDLE-I7300 2534IDLE-I7300
2924P: Andy Henroid 2535M: Andy Henroid <andrew.d.henroid@intel.com>
2925M: andrew.d.henroid@intel.com
2926L: linux-pm@lists.linux-foundation.org 2536L: linux-pm@lists.linux-foundation.org
2927S: Supported 2537S: Supported
2928F: drivers/idle/i7300_idle.c 2538F: drivers/idle/i7300_idle.c
2929 2539
2930IEEE 1394 SUBSYSTEM 2540IEEE 1394 SUBSYSTEM
2931P: Ben Collins 2541M: Ben Collins <ben.collins@ubuntu.com>
2932M: ben.collins@ubuntu.com 2542M: Stefan Richter <stefanr@s5r6.in-berlin.de>
2933P: Stefan Richter
2934M: stefanr@s5r6.in-berlin.de
2935L: linux1394-devel@lists.sourceforge.net 2543L: linux1394-devel@lists.sourceforge.net
2936W: http://www.linux1394.org/ 2544W: http://www.linux1394.org/
2937T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git 2545T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
@@ -2939,19 +2547,15 @@ S: Maintained
2939F: drivers/ieee1394/ 2547F: drivers/ieee1394/
2940 2548
2941IEEE 1394 RAW I/O DRIVER 2549IEEE 1394 RAW I/O DRIVER
2942P: Dan Dennedy 2550M: Dan Dennedy <dan@dennedy.org>
2943M: dan@dennedy.org 2551M: Stefan Richter <stefanr@s5r6.in-berlin.de>
2944P: Stefan Richter
2945M: stefanr@s5r6.in-berlin.de
2946L: linux1394-devel@lists.sourceforge.net 2552L: linux1394-devel@lists.sourceforge.net
2947S: Maintained 2553S: Maintained
2948F: drivers/ieee1394/raw1394* 2554F: drivers/ieee1394/raw1394*
2949 2555
2950IEEE 802.15.4 SUBSYSTEM 2556IEEE 802.15.4 SUBSYSTEM
2951P: Dmitry Eremin-Solenikov 2557M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
2952M: dbaryshkov@gmail.com 2558M: Sergey Lapin <slapin@ossfans.org>
2953P: Sergey Lapin
2954M: slapin@ossfans.org
2955L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers) 2559L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers)
2956W: http://apps.sourceforge.net/trac/linux-zigbee 2560W: http://apps.sourceforge.net/trac/linux-zigbee
2957T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git 2561T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git
@@ -2960,8 +2564,7 @@ F: net/ieee802154/
2960F: drivers/ieee802154/ 2564F: drivers/ieee802154/
2961 2565
2962INTEGRITY MEASUREMENT ARCHITECTURE (IMA) 2566INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
2963P: Mimi Zohar 2567M: Mimi Zohar <zohar@us.ibm.com>
2964M: zohar@us.ibm.com
2965S: Supported 2568S: Supported
2966F: security/integrity/ima/ 2569F: security/integrity/ima/
2967 2570
@@ -2971,12 +2574,9 @@ S: Orphan
2971F: drivers/video/imsttfb.c 2574F: drivers/video/imsttfb.c
2972 2575
2973INFINIBAND SUBSYSTEM 2576INFINIBAND SUBSYSTEM
2974P: Roland Dreier 2577M: Roland Dreier <rolandd@cisco.com>
2975M: rolandd@cisco.com 2578M: Sean Hefty <sean.hefty@intel.com>
2976P: Sean Hefty 2579M: Hal Rosenstock <hal.rosenstock@gmail.com>
2977M: sean.hefty@intel.com
2978P: Hal Rosenstock
2979M: hal.rosenstock@gmail.com
2980L: general@lists.openfabrics.org (moderated for non-subscribers) 2580L: general@lists.openfabrics.org (moderated for non-subscribers)
2981W: http://www.openib.org/ 2581W: http://www.openib.org/
2982T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git 2582T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
@@ -2986,65 +2586,55 @@ F: drivers/infiniband/
2986F: include/linux/if_infiniband.h 2586F: include/linux/if_infiniband.h
2987 2587
2988INOTIFY 2588INOTIFY
2989P: John McCutchan 2589M: John McCutchan <john@johnmccutchan.com>
2990M: john@johnmccutchan.com 2590M: Robert Love <rlove@rlove.org>
2991P: Robert Love 2591M: Eric Paris <eparis@parisplace.org>
2992M: rlove@rlove.org
2993P: Eric Paris
2994M: eparis@parisplace.org
2995S: Maintained 2592S: Maintained
2996F: Documentation/filesystems/inotify.txt 2593F: Documentation/filesystems/inotify.txt
2997F: fs/notify/inotify/ 2594F: fs/notify/inotify/
2998F: include/linux/inotify.h 2595F: include/linux/inotify.h
2999 2596
3000INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS 2597INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
3001P: Dmitry Torokhov 2598M: Dmitry Torokhov <dmitry.torokhov@gmail.com>
3002M: dmitry.torokhov@gmail.com 2599M: Dmitry Torokhov <dtor@mail.ru>
3003M: dtor@mail.ru
3004L: linux-input@vger.kernel.org 2600L: linux-input@vger.kernel.org
3005T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git 2601T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
3006S: Maintained 2602S: Maintained
3007F: drivers/input/ 2603F: drivers/input/
3008 2604
3009INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) 2605INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
3010P: Sylvain Meyer 2606M: Sylvain Meyer <sylvain.meyer@worldonline.fr>
3011M: sylvain.meyer@worldonline.fr
3012L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2607L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3013S: Maintained 2608S: Maintained
3014F: Documentation/fb/intelfb.txt 2609F: Documentation/fb/intelfb.txt
3015F: drivers/video/intelfb/ 2610F: drivers/video/intelfb/
3016 2611
3017INTEL 810/815 FRAMEBUFFER DRIVER 2612INTEL 810/815 FRAMEBUFFER DRIVER
3018P: Antonino Daplas 2613M: Antonino Daplas <adaplas@gmail.com>
3019M: adaplas@gmail.com
3020L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2614L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3021S: Maintained 2615S: Maintained
3022F: drivers/video/i810/ 2616F: drivers/video/i810/
3023 2617
3024INTEL MENLOW THERMAL DRIVER 2618INTEL MENLOW THERMAL DRIVER
3025P: Sujith Thomas 2619M: Sujith Thomas <sujith.thomas@intel.com>
3026M: sujith.thomas@intel.com
3027L: linux-acpi@vger.kernel.org 2620L: linux-acpi@vger.kernel.org
3028W: http://www.lesswatts.org/projects/acpi/ 2621W: http://www.lesswatts.org/projects/acpi/
3029S: Supported 2622S: Supported
3030F: drivers/platform/x86/intel_menlow.c 2623F: drivers/platform/x86/intel_menlow.c
3031 2624
3032INTEL IA32 MICROCODE UPDATE SUPPORT 2625INTEL IA32 MICROCODE UPDATE SUPPORT
3033P: Tigran Aivazian 2626M: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
3034M: tigran@aivazian.fsnet.co.uk
3035S: Maintained 2627S: Maintained
3036F: arch/x86/kernel/microcode_core.c 2628F: arch/x86/kernel/microcode_core.c
3037F: arch/x86/kernel/microcode_intel.c 2629F: arch/x86/kernel/microcode_intel.c
3038 2630
3039INTEL I/OAT DMA DRIVER 2631INTEL I/OAT DMA DRIVER
3040P: Maciej Sosnowski 2632M: Maciej Sosnowski <maciej.sosnowski@intel.com>
3041M: maciej.sosnowski@intel.com
3042S: Supported 2633S: Supported
3043F: drivers/dma/ioat* 2634F: drivers/dma/ioat*
3044 2635
3045INTEL IOMMU (VT-d) 2636INTEL IOMMU (VT-d)
3046P: David Woodhouse 2637M: David Woodhouse <dwmw2@infradead.org>
3047M: dwmw2@infradead.org
3048L: iommu@lists.linux-foundation.org 2638L: iommu@lists.linux-foundation.org
3049T: git git://git.infradead.org/iommu-2.6.git 2639T: git git://git.infradead.org/iommu-2.6.git
3050S: Supported 2640S: Supported
@@ -3052,14 +2642,12 @@ F: drivers/pci/intel-iommu.c
3052F: include/linux/intel-iommu.h 2642F: include/linux/intel-iommu.h
3053 2643
3054INTEL IOP-ADMA DMA DRIVER 2644INTEL IOP-ADMA DMA DRIVER
3055P: Dan Williams 2645M: Dan Williams <dan.j.williams@intel.com>
3056M: dan.j.williams@intel.com
3057S: Supported 2646S: Supported
3058F: drivers/dma/iop-adma.c 2647F: drivers/dma/iop-adma.c
3059 2648
3060INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT 2649INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
3061P: Krzysztof Halasa 2650M: Krzysztof Halasa <khc@pm.waw.pl>
3062M: khc@pm.waw.pl
3063S: Maintained 2651S: Maintained
3064F: arch/arm/mach-ixp4xx/include/mach/qmgr.h 2652F: arch/arm/mach-ixp4xx/include/mach/qmgr.h
3065F: arch/arm/mach-ixp4xx/include/mach/npe.h 2653F: arch/arm/mach-ixp4xx/include/mach/npe.h
@@ -3069,29 +2657,22 @@ F: drivers/net/arm/ixp4xx_eth.c
3069F: drivers/net/wan/ixp4xx_hss.c 2657F: drivers/net/wan/ixp4xx_hss.c
3070 2658
3071INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT 2659INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
3072P: Deepak Saxena 2660M: Deepak Saxena <dsaxena@plexity.net>
3073M: dsaxena@plexity.net
3074S: Maintained 2661S: Maintained
3075F: drivers/char/hw_random/ixp4xx-rng.c 2662F: drivers/char/hw_random/ixp4xx-rng.c
3076 2663
3077INTEL IXP2000 ETHERNET DRIVER 2664INTEL IXP2000 ETHERNET DRIVER
3078P: Lennert Buytenhek 2665M: Lennert Buytenhek <kernel@wantstofly.org>
3079M: kernel@wantstofly.org
3080L: netdev@vger.kernel.org 2666L: netdev@vger.kernel.org
3081S: Maintained 2667S: Maintained
3082F: drivers/net/ixp2000/ 2668F: drivers/net/ixp2000/
3083 2669
3084INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe) 2670INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe)
3085P: Jeff Kirsher 2671M: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3086M: jeffrey.t.kirsher@intel.com 2672M: Jesse Brandeburg <jesse.brandeburg@intel.com>
3087P: Jesse Brandeburg 2673M: Bruce Allan <bruce.w.allan@intel.com>
3088M: jesse.brandeburg@intel.com 2674M: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
3089P: Bruce Allan 2675M: John Ronciak <john.ronciak@intel.com>
3090M: bruce.w.allan@intel.com
3091P: PJ Waskiewicz
3092M: peter.p.waskiewicz.jr@intel.com
3093P: John Ronciak
3094M: john.ronciak@intel.com
3095L: e1000-devel@lists.sourceforge.net 2676L: e1000-devel@lists.sourceforge.net
3096W: http://e1000.sourceforge.net/ 2677W: http://e1000.sourceforge.net/
3097S: Supported 2678S: Supported
@@ -3103,12 +2684,9 @@ F: drivers/net/ixgb/
3103F: drivers/net/ixgbe/ 2684F: drivers/net/ixgbe/
3104 2685
3105INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT 2686INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
3106P: Zhu Yi 2687M: Zhu Yi <yi.zhu@intel.com>
3107M: yi.zhu@intel.com 2688M: James Ketrenos <jketreno@linux.intel.com>
3108P: James Ketrenos 2689M: Reinette Chatre <reinette.chatre@intel.com>
3109M: jketreno@linux.intel.com
3110P: Reinette Chatre
3111M: reinette.chatre@intel.com
3112L: linux-wireless@vger.kernel.org 2690L: linux-wireless@vger.kernel.org
3113L: ipw2100-devel@lists.sourceforge.net 2691L: ipw2100-devel@lists.sourceforge.net
3114W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 2692W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
@@ -3118,12 +2696,9 @@ F: Documentation/networking/README.ipw2100
3118F: drivers/net/wireless/ipw2x00/ipw2100.* 2696F: drivers/net/wireless/ipw2x00/ipw2100.*
3119 2697
3120INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT 2698INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
3121P: Zhu Yi 2699M: Zhu Yi <yi.zhu@intel.com>
3122M: yi.zhu@intel.com 2700M: James Ketrenos <jketreno@linux.intel.com>
3123P: James Ketrenos 2701M: Reinette Chatre <reinette.chatre@intel.com>
3124M: jketreno@linux.intel.com
3125P: Reinette Chatre
3126M: reinette.chatre@intel.com
3127L: linux-wireless@vger.kernel.org 2702L: linux-wireless@vger.kernel.org
3128L: ipw2100-devel@lists.sourceforge.net 2703L: ipw2100-devel@lists.sourceforge.net
3129W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 2704W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
@@ -3133,8 +2708,7 @@ F: Documentation/networking/README.ipw2200
3133F: drivers/net/wireless/ipw2x00/ipw2200.* 2708F: drivers/net/wireless/ipw2x00/ipw2200.*
3134 2709
3135INTEL WIRELESS WIMAX CONNECTION 2400 2710INTEL WIRELESS WIMAX CONNECTION 2400
3136P: Inaky Perez-Gonzalez 2711M: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
3137M: inaky.perez-gonzalez@intel.com
3138M: linux-wimax@intel.com 2712M: linux-wimax@intel.com
3139L: wimax@linuxwimax.org 2713L: wimax@linuxwimax.org
3140S: Supported 2714S: Supported
@@ -3144,10 +2718,8 @@ F: drivers/net/wimax/i2400m/
3144F: include/linux/wimax/i2400m.h 2718F: include/linux/wimax/i2400m.h
3145 2719
3146INTEL WIRELESS WIFI LINK (iwlwifi) 2720INTEL WIRELESS WIFI LINK (iwlwifi)
3147P: Zhu Yi 2721M: Zhu Yi <yi.zhu@intel.com>
3148M: yi.zhu@intel.com 2722M: Reinette Chatre <reinette.chatre@intel.com>
3149P: Reinette Chatre
3150M: reinette.chatre@intel.com
3151L: linux-wireless@vger.kernel.org 2723L: linux-wireless@vger.kernel.org
3152L: ipw3945-devel@lists.sourceforge.net 2724L: ipw3945-devel@lists.sourceforge.net
3153W: http://intellinuxwireless.org 2725W: http://intellinuxwireless.org
@@ -3156,47 +2728,39 @@ S: Supported
3156F: drivers/net/wireless/iwlwifi/ 2728F: drivers/net/wireless/iwlwifi/
3157 2729
3158IOC3 ETHERNET DRIVER 2730IOC3 ETHERNET DRIVER
3159P: Ralf Baechle 2731M: Ralf Baechle <ralf@linux-mips.org>
3160M: ralf@linux-mips.org
3161L: linux-mips@linux-mips.org 2732L: linux-mips@linux-mips.org
3162S: Maintained 2733S: Maintained
3163F: drivers/net/ioc3-eth.c 2734F: drivers/net/ioc3-eth.c
3164 2735
3165IOC3 SERIAL DRIVER 2736IOC3 SERIAL DRIVER
3166P: Pat Gefre 2737M: Pat Gefre <pfg@sgi.com>
3167M: pfg@sgi.com
3168L: linux-mips@linux-mips.org 2738L: linux-mips@linux-mips.org
3169S: Maintained 2739S: Maintained
3170F: drivers/serial/ioc3_serial.c 2740F: drivers/serial/ioc3_serial.c
3171 2741
3172IP MASQUERADING 2742IP MASQUERADING
3173P: Juanjo Ciarlante 2743M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
3174M: jjciarla@raiz.uncu.edu.ar
3175S: Maintained 2744S: Maintained
3176F: net/ipv4/netfilter/ipt_MASQUERADE.c 2745F: net/ipv4/netfilter/ipt_MASQUERADE.c
3177 2746
3178IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER 2747IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER
3179P: Francois Romieu 2748M: Francois Romieu <romieu@fr.zoreil.com>
3180M: romieu@fr.zoreil.com 2749M: Sorbica Shieh <sorbica@icplus.com.tw>
3181P: Sorbica Shieh 2750M: Jesse Huang <jesse@icplus.com.tw>
3182M: sorbica@icplus.com.tw
3183P: Jesse Huang
3184M: jesse@icplus.com.tw
3185L: netdev@vger.kernel.org 2751L: netdev@vger.kernel.org
3186S: Maintained 2752S: Maintained
3187F: drivers/net/ipg.c 2753F: drivers/net/ipg.c
3188 2754
3189IPATH DRIVER 2755IPATH DRIVER
3190P: Ralph Campbell 2756M: Ralph Campbell <infinipath@qlogic.com>
3191M: infinipath@qlogic.com
3192L: general@lists.openfabrics.org 2757L: general@lists.openfabrics.org
3193T: git git://git.qlogic.com/ipath-linux-2.6 2758T: git git://git.qlogic.com/ipath-linux-2.6
3194S: Supported 2759S: Supported
3195F: drivers/infiniband/hw/ipath/ 2760F: drivers/infiniband/hw/ipath/
3196 2761
3197IPMI SUBSYSTEM 2762IPMI SUBSYSTEM
3198P: Corey Minyard 2763M: Corey Minyard <minyard@acm.org>
3199M: minyard@acm.org
3200L: openipmi-developer@lists.sourceforge.net 2764L: openipmi-developer@lists.sourceforge.net
3201W: http://openipmi.sourceforge.net/ 2765W: http://openipmi.sourceforge.net/
3202S: Supported 2766S: Supported
@@ -3205,20 +2769,16 @@ F: drivers/char/ipmi/
3205F: include/linux/ipmi* 2769F: include/linux/ipmi*
3206 2770
3207IPS SCSI RAID DRIVER 2771IPS SCSI RAID DRIVER
3208P: Adaptec OEM Raid Solutions 2772M: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
3209M: aacraid@adaptec.com
3210L: linux-scsi@vger.kernel.org 2773L: linux-scsi@vger.kernel.org
3211W: http://www.adaptec.com/ 2774W: http://www.adaptec.com/
3212S: Maintained 2775S: Maintained
3213F: drivers/scsi/ips* 2776F: drivers/scsi/ips*
3214 2777
3215IPVS 2778IPVS
3216P: Wensong Zhang 2779M: Wensong Zhang <wensong@linux-vs.org>
3217M: wensong@linux-vs.org 2780M: Simon Horman <horms@verge.net.au>
3218P: Simon Horman 2781M: Julian Anastasov <ja@ssi.bg>
3219M: horms@verge.net.au
3220P: Julian Anastasov
3221M: ja@ssi.bg
3222L: netdev@vger.kernel.org 2782L: netdev@vger.kernel.org
3223L: lvs-devel@vger.kernel.org 2783L: lvs-devel@vger.kernel.org
3224S: Maintained 2784S: Maintained
@@ -3226,17 +2786,14 @@ F: Documentation/networking/ipvs-sysctl.txt
3226F: net/netfilter/ipvs/ 2786F: net/netfilter/ipvs/
3227 2787
3228IPWIRELESS DRIVER 2788IPWIRELESS DRIVER
3229P: Jiri Kosina 2789M: Jiri Kosina <jkosina@suse.cz>
3230M: jkosina@suse.cz 2790M: David Sterba <dsterba@suse.cz>
3231P: David Sterba
3232M: dsterba@suse.cz
3233S: Maintained 2791S: Maintained
3234T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git 2792T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
3235F: drivers/char/pcmcia/ipwireless/ 2793F: drivers/char/pcmcia/ipwireless/
3236 2794
3237IPX NETWORK LAYER 2795IPX NETWORK LAYER
3238P: Arnaldo Carvalho de Melo 2796M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
3239M: acme@ghostprotocols.net
3240L: netdev@vger.kernel.org 2797L: netdev@vger.kernel.org
3241S: Maintained 2798S: Maintained
3242F: include/linux/ipx.h 2799F: include/linux/ipx.h
@@ -3244,8 +2801,7 @@ F: include/net/ipx.h
3244F: net/ipx/ 2801F: net/ipx/
3245 2802
3246IRDA SUBSYSTEM 2803IRDA SUBSYSTEM
3247P: Samuel Ortiz 2804M: Samuel Ortiz <samuel@sortiz.org>
3248M: samuel@sortiz.org
3249L: irda-users@lists.sourceforge.net (subscribers-only) 2805L: irda-users@lists.sourceforge.net (subscribers-only)
3250W: http://irda.sourceforge.net/ 2806W: http://irda.sourceforge.net/
3251S: Maintained 2807S: Maintained
@@ -3256,16 +2812,14 @@ F: include/net/irda/
3256F: net/irda/ 2812F: net/irda/
3257 2813
3258ISAPNP 2814ISAPNP
3259P: Jaroslav Kysela 2815M: Jaroslav Kysela <perex@perex.cz>
3260M: perex@perex.cz
3261S: Maintained 2816S: Maintained
3262F: Documentation/isapnp.txt 2817F: Documentation/isapnp.txt
3263F: drivers/pnp/isapnp/ 2818F: drivers/pnp/isapnp/
3264F: include/linux/isapnp.h 2819F: include/linux/isapnp.h
3265 2820
3266ISCSI 2821ISCSI
3267P: Mike Christie 2822M: Mike Christie <michaelc@cs.wisc.edu>
3268M: michaelc@cs.wisc.edu
3269L: open-iscsi@googlegroups.com 2823L: open-iscsi@googlegroups.com
3270W: www.open-iscsi.org 2824W: www.open-iscsi.org
3271T: git git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git 2825T: git git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
@@ -3274,8 +2828,7 @@ F: drivers/scsi/*iscsi*
3274F: include/scsi/*iscsi* 2828F: include/scsi/*iscsi*
3275 2829
3276ISDN SUBSYSTEM 2830ISDN SUBSYSTEM
3277P: Karsten Keil 2831M: Karsten Keil <isdn@linux-pingi.de>
3278M: isdn@linux-pingi.de
3279L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 2832L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
3280W: http://www.isdn4linux.de 2833W: http://www.isdn4linux.de
3281T: git git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/isdn-2.6.git 2834T: git git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/isdn-2.6.git
@@ -3286,18 +2839,15 @@ F: include/linux/isdn.h
3286F: include/linux/isdn/ 2839F: include/linux/isdn/
3287 2840
3288ISDN SUBSYSTEM (Eicon active card driver) 2841ISDN SUBSYSTEM (Eicon active card driver)
3289P: Armin Schindler 2842M: Armin Schindler <mac@melware.de>
3290M: mac@melware.de
3291L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 2843L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
3292W: http://www.melware.de 2844W: http://www.melware.de
3293S: Maintained 2845S: Maintained
3294F: drivers/isdn/hardware/eicon/ 2846F: drivers/isdn/hardware/eicon/
3295 2847
3296IVTV VIDEO4LINUX DRIVER 2848IVTV VIDEO4LINUX DRIVER
3297P: Hans Verkuil 2849M: Hans Verkuil <hverkuil@xs4all.nl>
3298M: hverkuil@xs4all.nl
3299L: ivtv-devel@ivtvdriver.org 2850L: ivtv-devel@ivtvdriver.org
3300L: ivtv-users@ivtvdriver.org
3301L: linux-media@vger.kernel.org 2851L: linux-media@vger.kernel.org
3302T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2852T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
3303W: http://www.ivtvdriver.org 2853W: http://www.ivtvdriver.org
@@ -3307,25 +2857,22 @@ F: drivers/media/video/ivtv/
3307F: include/linux/ivtv* 2857F: include/linux/ivtv*
3308 2858
3309JFS FILESYSTEM 2859JFS FILESYSTEM
3310P: Dave Kleikamp 2860M: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
3311M: shaggy@austin.ibm.com
3312L: jfs-discussion@lists.sourceforge.net 2861L: jfs-discussion@lists.sourceforge.net
3313W: http://jfs.sourceforge.net/ 2862W: http://jfs.sourceforge.net/
3314T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git 2863T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
3315S: Supported 2864S: Maintained
3316F: Documentation/filesystems/jfs.txt 2865F: Documentation/filesystems/jfs.txt
3317F: fs/jfs/ 2866F: fs/jfs/
3318 2867
3319JME NETWORK DRIVER 2868JME NETWORK DRIVER
3320P: Guo-Fu Tseng 2869M: Guo-Fu Tseng <cooldavid@cooldavid.org>
3321M: cooldavid@cooldavid.org
3322L: netdev@vger.kernel.org 2870L: netdev@vger.kernel.org
3323S: Maintained 2871S: Maintained
3324F: drivers/net/jme.* 2872F: drivers/net/jme.*
3325 2873
3326JOURNALLING FLASH FILE SYSTEM V2 (JFFS2) 2874JOURNALLING FLASH FILE SYSTEM V2 (JFFS2)
3327P: David Woodhouse 2875M: David Woodhouse <dwmw2@infradead.org>
3328M: dwmw2@infradead.org
3329L: linux-mtd@lists.infradead.org 2876L: linux-mtd@lists.infradead.org
3330W: http://www.linux-mtd.infradead.org/doc/jffs2.html 2877W: http://www.linux-mtd.infradead.org/doc/jffs2.html
3331S: Maintained 2878S: Maintained
@@ -3333,10 +2880,8 @@ F: fs/jffs2/
3333F: include/linux/jffs2.h 2880F: include/linux/jffs2.h
3334 2881
3335JOURNALLING LAYER FOR BLOCK DEVICES (JBD) 2882JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
3336P: Stephen Tweedie 2883M: Stephen Tweedie <sct@redhat.com>
3337M: sct@redhat.com 2884M: Andrew Morton <akpm@linux-foundation.org>
3338P: Andrew Morton
3339M: akpm@linux-foundation.org
3340L: linux-ext4@vger.kernel.org 2885L: linux-ext4@vger.kernel.org
3341S: Maintained 2886S: Maintained
3342F: fs/jbd*/ 2887F: fs/jbd*/
@@ -3344,48 +2889,41 @@ F: include/linux/ext*jbd*.h
3344F: include/linux/jbd*.h 2889F: include/linux/jbd*.h
3345 2890
3346K8TEMP HARDWARE MONITORING DRIVER 2891K8TEMP HARDWARE MONITORING DRIVER
3347P: Rudolf Marek 2892M: Rudolf Marek <r.marek@assembler.cz>
3348M: r.marek@assembler.cz
3349L: lm-sensors@lm-sensors.org 2893L: lm-sensors@lm-sensors.org
3350S: Maintained 2894S: Maintained
3351F: Documentation/hwmon/k8temp 2895F: Documentation/hwmon/k8temp
3352F: drivers/hwmon/k8temp.c 2896F: drivers/hwmon/k8temp.c
3353 2897
3354KCONFIG 2898KCONFIG
3355P: Roman Zippel 2899M: Roman Zippel <zippel@linux-m68k.org>
3356M: zippel@linux-m68k.org
3357L: linux-kbuild@vger.kernel.org 2900L: linux-kbuild@vger.kernel.org
3358S: Maintained 2901S: Maintained
3359F: Documentation/kbuild/kconfig-language.txt 2902F: Documentation/kbuild/kconfig-language.txt
3360F: scripts/kconfig/ 2903F: scripts/kconfig/
3361 2904
3362KDUMP 2905KDUMP
3363P: Vivek Goyal 2906M: Vivek Goyal <vgoyal@redhat.com>
3364M: vgoyal@redhat.com 2907M: Haren Myneni <hbabu@us.ibm.com>
3365P: Haren Myneni
3366M: hbabu@us.ibm.com
3367L: kexec@lists.infradead.org 2908L: kexec@lists.infradead.org
3368W: http://lse.sourceforge.net/kdump/ 2909W: http://lse.sourceforge.net/kdump/
3369S: Maintained 2910S: Maintained
3370F: Documentation/kdump/ 2911F: Documentation/kdump/
3371 2912
3372KERNEL AUTOMOUNTER (AUTOFS) 2913KERNEL AUTOMOUNTER (AUTOFS)
3373P: H. Peter Anvin 2914M: "H. Peter Anvin" <hpa@zytor.com>
3374M: hpa@zytor.com
3375L: autofs@linux.kernel.org 2915L: autofs@linux.kernel.org
3376S: Odd Fixes 2916S: Odd Fixes
3377F: fs/autofs/ 2917F: fs/autofs/
3378 2918
3379KERNEL AUTOMOUNTER v4 (AUTOFS4) 2919KERNEL AUTOMOUNTER v4 (AUTOFS4)
3380P: Ian Kent 2920M: Ian Kent <raven@themaw.net>
3381M: raven@themaw.net
3382L: autofs@linux.kernel.org 2921L: autofs@linux.kernel.org
3383S: Maintained 2922S: Maintained
3384F: fs/autofs4/ 2923F: fs/autofs4/
3385 2924
3386KERNEL BUILD 2925KERNEL BUILD
3387P: Sam Ravnborg 2926M: Sam Ravnborg <sam@ravnborg.org>
3388M: sam@ravnborg.org
3389T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git 2927T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git
3390T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git 2928T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git
3391L: linux-kbuild@vger.kernel.org 2929L: linux-kbuild@vger.kernel.org
@@ -3395,16 +2933,13 @@ F: Makefile
3395F: scripts/Makefile.* 2933F: scripts/Makefile.*
3396 2934
3397KERNEL JANITORS 2935KERNEL JANITORS
3398P: Several
3399L: kernel-janitors@vger.kernel.org 2936L: kernel-janitors@vger.kernel.org
3400W: http://www.kerneljanitors.org/ 2937W: http://www.kerneljanitors.org/
3401S: Maintained 2938S: Odd fixes
3402 2939
3403KERNEL NFSD, SUNRPC, AND LOCKD SERVERS 2940KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
3404P: J. Bruce Fields 2941M: "J. Bruce Fields" <bfields@fieldses.org>
3405M: bfields@fieldses.org 2942M: Neil Brown <neilb@suse.de>
3406P: Neil Brown
3407M: neilb@suse.de
3408L: linux-nfs@vger.kernel.org 2943L: linux-nfs@vger.kernel.org
3409W: http://nfs.sourceforge.net/ 2944W: http://nfs.sourceforge.net/
3410S: Supported 2945S: Supported
@@ -3417,8 +2952,7 @@ F: include/linux/lockd/
3417F: include/linux/sunrpc/ 2952F: include/linux/sunrpc/
3418 2953
3419KERNEL VIRTUAL MACHINE (KVM) 2954KERNEL VIRTUAL MACHINE (KVM)
3420P: Avi Kivity 2955M: Avi Kivity <avi@redhat.com>
3421M: avi@redhat.com
3422L: kvm@vger.kernel.org 2956L: kvm@vger.kernel.org
3423W: http://kvm.qumranet.com 2957W: http://kvm.qumranet.com
3424S: Supported 2958S: Supported
@@ -3429,8 +2963,7 @@ F: include/linux/kvm*
3429F: virt/kvm/ 2963F: virt/kvm/
3430 2964
3431KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V 2965KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V
3432P: Joerg Roedel 2966M: Joerg Roedel <joerg.roedel@amd.com>
3433M: joerg.roedel@amd.com
3434L: kvm@vger.kernel.org 2967L: kvm@vger.kernel.org
3435W: http://kvm.qumranet.com 2968W: http://kvm.qumranet.com
3436S: Supported 2969S: Supported
@@ -3439,8 +2972,7 @@ F: arch/x86/kvm/kvm_svm.h
3439F: arch/x86/kvm/svm.c 2972F: arch/x86/kvm/svm.c
3440 2973
3441KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC 2974KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
3442P: Hollis Blanchard 2975M: Hollis Blanchard <hollisb@us.ibm.com>
3443M: hollisb@us.ibm.com
3444L: kvm-ppc@vger.kernel.org 2976L: kvm-ppc@vger.kernel.org
3445W: http://kvm.qumranet.com 2977W: http://kvm.qumranet.com
3446S: Supported 2978S: Supported
@@ -3448,8 +2980,7 @@ F: arch/powerpc/include/asm/kvm*
3448F: arch/powerpc/kvm/ 2980F: arch/powerpc/kvm/
3449 2981
3450KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64) 2982KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64)
3451P: Xiantao Zhang 2983M: Xiantao Zhang <xiantao.zhang@intel.com>
3452M: xiantao.zhang@intel.com
3453L: kvm-ia64@vger.kernel.org 2984L: kvm-ia64@vger.kernel.org
3454W: http://kvm.qumranet.com 2985W: http://kvm.qumranet.com
3455S: Supported 2986S: Supported
@@ -3458,10 +2989,8 @@ F: arch/ia64/include/asm/kvm*
3458F: arch/ia64/kvm/ 2989F: arch/ia64/kvm/
3459 2990
3460KERNEL VIRTUAL MACHINE for s390 (KVM/s390) 2991KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
3461P: Carsten Otte 2992M: Carsten Otte <cotte@de.ibm.com>
3462M: cotte@de.ibm.com 2993M: Christian Borntraeger <borntraeger@de.ibm.com>
3463P: Christian Borntraeger
3464M: borntraeger@de.ibm.com
3465M: linux390@de.ibm.com 2994M: linux390@de.ibm.com
3466L: linux-s390@vger.kernel.org 2995L: linux-s390@vger.kernel.org
3467W: http://www.ibm.com/developerworks/linux/linux390/ 2996W: http://www.ibm.com/developerworks/linux/linux390/
@@ -3471,8 +3000,7 @@ F: arch/s390/include/asm/kvm*
3471F: arch/s390/kvm/ 3000F: arch/s390/kvm/
3472 3001
3473KEXEC 3002KEXEC
3474P: Eric Biederman 3003M: Eric Biederman <ebiederm@xmission.com>
3475M: ebiederm@xmission.com
3476W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ 3004W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
3477L: kexec@lists.infradead.org 3005L: kexec@lists.infradead.org
3478S: Maintained 3006S: Maintained
@@ -3480,8 +3008,7 @@ F: include/linux/kexec.h
3480F: kernel/kexec.c 3008F: kernel/kexec.c
3481 3009
3482KGDB 3010KGDB
3483P: Jason Wessel 3011M: Jason Wessel <jason.wessel@windriver.com>
3484M: jason.wessel@windriver.com
3485L: kgdb-bugreport@lists.sourceforge.net 3012L: kgdb-bugreport@lists.sourceforge.net
3486S: Maintained 3013S: Maintained
3487F: Documentation/DocBook/kgdb.tmpl 3014F: Documentation/DocBook/kgdb.tmpl
@@ -3491,17 +3018,13 @@ F: include/linux/kgdb.h
3491F: kernel/kgdb.c 3018F: kernel/kgdb.c
3492 3019
3493KMEMCHECK 3020KMEMCHECK
3494P: Vegard Nossum 3021M: Vegard Nossum <vegardno@ifi.uio.no>
3495M: vegardno@ifi.uio.no
3496P Pekka Enberg 3022P Pekka Enberg
3497M: penberg@cs.helsinki.fi 3023M: penberg@cs.helsinki.fi
3498L: linux-kernel@vger.kernel.org
3499S: Maintained 3024S: Maintained
3500 3025
3501KMEMLEAK 3026KMEMLEAK
3502P: Catalin Marinas 3027M: Catalin Marinas <catalin.marinas@arm.com>
3503M: catalin.marinas@arm.com
3504L: linux-kernel@vger.kernel.org
3505S: Maintained 3028S: Maintained
3506F: Documentation/kmemleak.txt 3029F: Documentation/kmemleak.txt
3507F: include/linux/kmemleak.h 3030F: include/linux/kmemleak.h
@@ -3509,30 +3032,24 @@ F: mm/kmemleak.c
3509F: mm/kmemleak-test.c 3032F: mm/kmemleak-test.c
3510 3033
3511KMEMTRACE 3034KMEMTRACE
3512P: Eduard - Gabriel Munteanu 3035M: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
3513M: eduard.munteanu@linux360.ro
3514S: Maintained 3036S: Maintained
3515F: Documentation/trace/kmemtrace.txt 3037F: Documentation/trace/kmemtrace.txt
3516F: include/linux/kmemtrace.h 3038F: include/linux/kmemtrace.h
3517F: kernel/trace/kmemtrace.c 3039F: kernel/trace/kmemtrace.c
3518 3040
3519KPROBES 3041KPROBES
3520P: Ananth N Mavinakayanahalli 3042M: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
3521M: ananth@in.ibm.com 3043M: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
3522P: Anil S Keshavamurthy 3044M: "David S. Miller" <davem@davemloft.net>
3523M: anil.s.keshavamurthy@intel.com 3045M: Masami Hiramatsu <mhiramat@redhat.com>
3524P: David S. Miller
3525M: davem@davemloft.net
3526P: Masami Hiramatsu
3527M: mhiramat@redhat.com
3528S: Maintained 3046S: Maintained
3529F: Documentation/kprobes.txt 3047F: Documentation/kprobes.txt
3530F: include/linux/kprobes.h 3048F: include/linux/kprobes.h
3531F: kernel/kprobes.c 3049F: kernel/kprobes.c
3532 3050
3533KS0108 LCD CONTROLLER DRIVER 3051KS0108 LCD CONTROLLER DRIVER
3534P: Miguel Ojeda Sandonis 3052M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
3535M: miguel.ojeda.sandonis@gmail.com
3536W: http://miguelojeda.es/auxdisplay.htm 3053W: http://miguelojeda.es/auxdisplay.htm
3537W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 3054W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
3538S: Maintained 3055S: Maintained
@@ -3548,31 +3065,27 @@ F: include/*/lapb.h
3548F: net/lapb/ 3065F: net/lapb/
3549 3066
3550LASI 53c700 driver for PARISC 3067LASI 53c700 driver for PARISC
3551P: James E.J. Bottomley 3068M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
3552M: James.Bottomley@HansenPartnership.com
3553L: linux-scsi@vger.kernel.org 3069L: linux-scsi@vger.kernel.org
3554S: Maintained 3070S: Maintained
3555F: Documentation/scsi/53c700.txt 3071F: Documentation/scsi/53c700.txt
3556F: drivers/scsi/53c700* 3072F: drivers/scsi/53c700*
3557 3073
3558LED SUBSYSTEM 3074LED SUBSYSTEM
3559P: Richard Purdie 3075M: Richard Purdie <rpurdie@rpsys.net>
3560M: rpurdie@rpsys.net
3561S: Maintained 3076S: Maintained
3562F: drivers/leds/ 3077F: drivers/leds/
3563F: include/linux/leds.h 3078F: include/linux/leds.h
3564 3079
3565LEGO USB Tower driver 3080LEGO USB Tower driver
3566P: Juergen Stuber 3081M: Juergen Stuber <starblue@users.sourceforge.net>
3567M: starblue@users.sourceforge.net
3568L: legousb-devel@lists.sourceforge.net 3082L: legousb-devel@lists.sourceforge.net
3569W: http://legousb.sourceforge.net/ 3083W: http://legousb.sourceforge.net/
3570S: Maintained 3084S: Maintained
3571F: drivers/usb/misc/legousbtower.c 3085F: drivers/usb/misc/legousbtower.c
3572 3086
3573LGUEST 3087LGUEST
3574P: Rusty Russell 3088M: Rusty Russell <rusty@rustcorp.com.au>
3575M: rusty@rustcorp.com.au
3576L: lguest@ozlabs.org 3089L: lguest@ozlabs.org
3577W: http://lguest.ozlabs.org/ 3090W: http://lguest.ozlabs.org/
3578S: Maintained 3091S: Maintained
@@ -3583,119 +3096,100 @@ F: include/linux/lguest*.h
3583F: arch/x86/include/asm/lguest*.h 3096F: arch/x86/include/asm/lguest*.h
3584 3097
3585LINUX FOR IBM pSERIES (RS/6000) 3098LINUX FOR IBM pSERIES (RS/6000)
3586P: Paul Mackerras 3099M: Paul Mackerras <paulus@au.ibm.com>
3587M: paulus@au.ibm.com
3588W: http://www.ibm.com/linux/ltc/projects/ppc 3100W: http://www.ibm.com/linux/ltc/projects/ppc
3589S: Supported 3101S: Supported
3590 3102
3591LINUX FOR POWERPC (32-BIT AND 64-BIT) 3103LINUX FOR POWERPC (32-BIT AND 64-BIT)
3592P: Benjamin Herrenschmidt 3104M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
3593M: benh@kernel.crashing.org 3105M: Paul Mackerras <paulus@samba.org>
3594P: Paul Mackerras
3595M: paulus@samba.org
3596W: http://www.penguinppc.org/ 3106W: http://www.penguinppc.org/
3597L: linuxppc-dev@ozlabs.org 3107L: linuxppc-dev@ozlabs.org
3598T: git git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git 3108T: git git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
3599S: Supported 3109S: Supported
3600 3110
3601LINUX FOR POWER MACINTOSH 3111LINUX FOR POWER MACINTOSH
3602P: Benjamin Herrenschmidt 3112M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
3603M: benh@kernel.crashing.org
3604W: http://www.penguinppc.org/ 3113W: http://www.penguinppc.org/
3605L: linuxppc-dev@ozlabs.org 3114L: linuxppc-dev@ozlabs.org
3606S: Maintained 3115S: Maintained
3607 3116
3608LINUX FOR POWERPC EMBEDDED MPC5XXX 3117LINUX FOR POWERPC EMBEDDED MPC5XXX
3609P: Grant Likely 3118M: Grant Likely <grant.likely@secretlab.ca>
3610M: grant.likely@secretlab.ca
3611L: linuxppc-dev@ozlabs.org 3119L: linuxppc-dev@ozlabs.org
3612T: git git://git.secretlab.ca/git/linux-2.6.git 3120T: git git://git.secretlab.ca/git/linux-2.6.git
3613S: Maintained 3121S: Maintained
3614 3122
3615LINUX FOR POWERPC EMBEDDED PPC4XX 3123LINUX FOR POWERPC EMBEDDED PPC4XX
3616P: Josh Boyer 3124M: Josh Boyer <jwboyer@linux.vnet.ibm.com>
3617M: jwboyer@linux.vnet.ibm.com 3125M: Matt Porter <mporter@kernel.crashing.org>
3618P: Matt Porter
3619M: mporter@kernel.crashing.org
3620W: http://www.penguinppc.org/ 3126W: http://www.penguinppc.org/
3621L: linuxppc-dev@ozlabs.org 3127L: linuxppc-dev@ozlabs.org
3622T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git 3128T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git
3623S: Maintained 3129S: Maintained
3624 3130
3625LINUX FOR POWERPC EMBEDDED XILINX VIRTEX 3131LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
3626P: Grant Likely 3132M: Grant Likely <grant.likely@secretlab.ca>
3627M: grant.likely@secretlab.ca
3628W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex 3133W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
3629L: linuxppc-dev@ozlabs.org 3134L: linuxppc-dev@ozlabs.org
3630T: git git://git.secretlab.ca/git/linux-2.6.git 3135T: git git://git.secretlab.ca/git/linux-2.6.git
3631S: Maintained 3136S: Maintained
3632 3137
3633LINUX FOR POWERPC EMBEDDED PPC8XX 3138LINUX FOR POWERPC EMBEDDED PPC8XX
3634P: Vitaly Bordug 3139M: Vitaly Bordug <vitb@kernel.crashing.org>
3635M: vitb@kernel.crashing.org 3140M: Marcelo Tosatti <marcelo@kvack.org>
3636P: Marcelo Tosatti
3637M: marcelo@kvack.org
3638W: http://www.penguinppc.org/ 3141W: http://www.penguinppc.org/
3639L: linuxppc-dev@ozlabs.org 3142L: linuxppc-dev@ozlabs.org
3640S: Maintained 3143S: Maintained
3641 3144
3642LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX 3145LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
3643P: Kumar Gala 3146M: Kumar Gala <galak@kernel.crashing.org>
3644M: galak@kernel.crashing.org
3645W: http://www.penguinppc.org/ 3147W: http://www.penguinppc.org/
3646L: linuxppc-dev@ozlabs.org 3148L: linuxppc-dev@ozlabs.org
3647S: Maintained 3149S: Maintained
3648 3150
3649LINUX FOR POWERPC PA SEMI PWRFICIENT 3151LINUX FOR POWERPC PA SEMI PWRFICIENT
3650P: Olof Johansson 3152M: Olof Johansson <olof@lixom.net>
3651M: olof@lixom.net
3652W: http://www.pasemi.com/ 3153W: http://www.pasemi.com/
3653L: linuxppc-dev@ozlabs.org 3154L: linuxppc-dev@ozlabs.org
3654S: Supported 3155S: Supported
3655 3156
3656LINUX SECURITY MODULE (LSM) FRAMEWORK 3157LINUX SECURITY MODULE (LSM) FRAMEWORK
3657P: Chris Wright 3158M: Chris Wright <chrisw@sous-sol.org>
3658M: chrisw@sous-sol.org
3659L: linux-security-module@vger.kernel.org 3159L: linux-security-module@vger.kernel.org
3660T: git git://git.kernel.org/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git 3160T: git git://git.kernel.org/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
3661S: Supported 3161S: Supported
3662 3162
3663LLC (802.2) 3163LLC (802.2)
3664P: Arnaldo Carvalho de Melo 3164M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
3665M: acme@ghostprotocols.net
3666S: Maintained 3165S: Maintained
3667F: include/linux/llc.h 3166F: include/linux/llc.h
3668F: include/net/llc* 3167F: include/net/llc*
3669F: net/llc/ 3168F: net/llc/
3670 3169
3671LIS3LV02D ACCELEROMETER DRIVER 3170LIS3LV02D ACCELEROMETER DRIVER
3672P: Eric Piel 3171M: Eric Piel <eric.piel@tremplin-utc.net>
3673M: eric.piel@tremplin-utc.net
3674S: Maintained 3172S: Maintained
3675F: Documentation/hwmon/lis3lv02d 3173F: Documentation/hwmon/lis3lv02d
3676F: drivers/hwmon/lis3lv02d.* 3174F: drivers/hwmon/lis3lv02d.*
3677 3175
3678LM83 HARDWARE MONITOR DRIVER 3176LM83 HARDWARE MONITOR DRIVER
3679P: Jean Delvare 3177M: Jean Delvare <khali@linux-fr.org>
3680M: khali@linux-fr.org
3681L: lm-sensors@lm-sensors.org 3178L: lm-sensors@lm-sensors.org
3682S: Maintained 3179S: Maintained
3683F: Documentation/hwmon/lm83 3180F: Documentation/hwmon/lm83
3684F: drivers/hwmon/lm83.c 3181F: drivers/hwmon/lm83.c
3685 3182
3686LM90 HARDWARE MONITOR DRIVER 3183LM90 HARDWARE MONITOR DRIVER
3687P: Jean Delvare 3184M: Jean Delvare <khali@linux-fr.org>
3688M: khali@linux-fr.org
3689L: lm-sensors@lm-sensors.org 3185L: lm-sensors@lm-sensors.org
3690S: Maintained 3186S: Maintained
3691F: Documentation/hwmon/lm90 3187F: Documentation/hwmon/lm90
3692F: drivers/hwmon/lm90.c 3188F: drivers/hwmon/lm90.c
3693 3189
3694LOCKDEP AND LOCKSTAT 3190LOCKDEP AND LOCKSTAT
3695P: Peter Zijlstra 3191M: Peter Zijlstra <peterz@infradead.org>
3696M: peterz@infradead.org 3192M: Ingo Molnar <mingo@redhat.com>
3697P: Ingo Molnar
3698M: mingo@redhat.com
3699T: git git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git 3193T: git git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git
3700S: Maintained 3194S: Maintained
3701F: Documentation/lockdep*.txt 3195F: Documentation/lockdep*.txt
@@ -3704,8 +3198,7 @@ F: include/linux/lockdep.h
3704F: kernel/lockdep* 3198F: kernel/lockdep*
3705 3199
3706LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks) 3200LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks)
3707P: Richard Russon (FlatCap) 3201M: "Richard Russon (FlatCap)" <ldm@flatcap.org>
3708M: ldm@flatcap.org
3709L: linux-ntfs-dev@lists.sourceforge.net 3202L: linux-ntfs-dev@lists.sourceforge.net
3710W: http://www.linux-ntfs.org/content/view/19/37/ 3203W: http://www.linux-ntfs.org/content/view/19/37/
3711S: Maintained 3204S: Maintained
@@ -3713,8 +3206,7 @@ F: Documentation/ldm.txt
3713F: fs/partitions/ldm.* 3206F: fs/partitions/ldm.*
3714 3207
3715LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 3208LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
3716P: Eric Moore 3209M: Eric Moore <Eric.Moore@lsi.com>
3717M: Eric.Moore@lsi.com
3718M: support@lsi.com 3210M: support@lsi.com
3719L: DL-MPTFusionLinux@lsi.com 3211L: DL-MPTFusionLinux@lsi.com
3720L: linux-scsi@vger.kernel.org 3212L: linux-scsi@vger.kernel.org
@@ -3723,25 +3215,21 @@ S: Supported
3723F: drivers/message/fusion/ 3215F: drivers/message/fusion/
3724 3216
3725LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers 3217LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
3726P: Matthew Wilcox 3218M: Matthew Wilcox <matthew@wil.cx>
3727M: matthew@wil.cx
3728L: linux-scsi@vger.kernel.org 3219L: linux-scsi@vger.kernel.org
3729S: Maintained 3220S: Maintained
3730F: drivers/scsi/sym53c8xx_2/ 3221F: drivers/scsi/sym53c8xx_2/
3731 3222
3732LTP (Linux Test Project) 3223LTP (Linux Test Project)
3733P: Subrata Modak 3224M: Subrata Modak <subrata@linux.vnet.ibm.com>
3734M: subrata@linux.vnet.ibm.com 3225M: Mike Frysinger <vapier@gentoo.org>
3735P: Mike Frysinger
3736M: vapier@gentoo.org
3737L: ltp-list@lists.sourceforge.net (subscribers-only) 3226L: ltp-list@lists.sourceforge.net (subscribers-only)
3738W: http://ltp.sourceforge.net/ 3227W: http://ltp.sourceforge.net/
3739T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git 3228T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git
3740S: Maintained 3229S: Maintained
3741 3230
3742M32R ARCHITECTURE 3231M32R ARCHITECTURE
3743P: Hirokazu Takata 3232M: Hirokazu Takata <takata@linux-m32r.org>
3744M: takata@linux-m32r.org
3745L: linux-m32r@ml.linux-m32r.org 3233L: linux-m32r@ml.linux-m32r.org
3746L: linux-m32r-ja@ml.linux-m32r.org (in Japanese) 3234L: linux-m32r-ja@ml.linux-m32r.org (in Japanese)
3747W: http://www.linux-m32r.org/ 3235W: http://www.linux-m32r.org/
@@ -3749,10 +3237,8 @@ S: Maintained
3749F: arch/m32r/ 3237F: arch/m32r/
3750 3238
3751M68K ARCHITECTURE 3239M68K ARCHITECTURE
3752P: Geert Uytterhoeven 3240M: Geert Uytterhoeven <geert@linux-m68k.org>
3753M: geert@linux-m68k.org 3241M: Roman Zippel <zippel@linux-m68k.org>
3754P: Roman Zippel
3755M: zippel@linux-m68k.org
3756L: linux-m68k@lists.linux-m68k.org 3242L: linux-m68k@lists.linux-m68k.org
3757W: http://www.linux-m68k.org/ 3243W: http://www.linux-m68k.org/
3758T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git 3244T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git
@@ -3761,23 +3247,20 @@ F: arch/m68k/
3761F: drivers/zorro/ 3247F: drivers/zorro/
3762 3248
3763M68K ON APPLE MACINTOSH 3249M68K ON APPLE MACINTOSH
3764P: Joshua Thompson 3250M: Joshua Thompson <funaho@jurai.org>
3765M: funaho@jurai.org
3766W: http://www.mac.linux-m68k.org/ 3251W: http://www.mac.linux-m68k.org/
3767L: linux-m68k@lists.linux-m68k.org 3252L: linux-m68k@lists.linux-m68k.org
3768S: Maintained 3253S: Maintained
3769F: arch/m68k/mac/ 3254F: arch/m68k/mac/
3770 3255
3771M68K ON HP9000/300 3256M68K ON HP9000/300
3772P: Philip Blundell 3257M: Philip Blundell <philb@gnu.org>
3773M: philb@gnu.org
3774W: http://www.tazenda.demon.co.uk/phil/linux-hp 3258W: http://www.tazenda.demon.co.uk/phil/linux-hp
3775S: Maintained 3259S: Maintained
3776F: arch/m68k/hp300/ 3260F: arch/m68k/hp300/
3777 3261
3778MAC80211 3262MAC80211
3779P: Johannes Berg 3263M: Johannes Berg <johannes@sipsolutions.net>
3780M: johannes@sipsolutions.net
3781L: linux-wireless@vger.kernel.org 3264L: linux-wireless@vger.kernel.org
3782W: http://linuxwireless.org/ 3265W: http://linuxwireless.org/
3783T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3266T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
@@ -3787,10 +3270,8 @@ F: include/net/mac80211.h
3787F: net/mac80211/ 3270F: net/mac80211/
3788 3271
3789MAC80211 PID RATE CONTROL 3272MAC80211 PID RATE CONTROL
3790P: Stefano Brivio 3273M: Stefano Brivio <stefano.brivio@polimi.it>
3791M: stefano.brivio@polimi.it 3274M: Mattias Nissler <mattias.nissler@gmx.de>
3792P: Mattias Nissler
3793M: mattias.nissler@gmx.de
3794L: linux-wireless@vger.kernel.org 3275L: linux-wireless@vger.kernel.org
3795W: http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID 3276W: http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID
3796T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3277T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
@@ -3798,67 +3279,57 @@ S: Maintained
3798F: net/mac80211/rc80211_pid* 3279F: net/mac80211/rc80211_pid*
3799 3280
3800MACVLAN DRIVER 3281MACVLAN DRIVER
3801P: Patrick McHardy 3282M: Patrick McHardy <kaber@trash.net>
3802M: kaber@trash.net
3803L: netdev@vger.kernel.org 3283L: netdev@vger.kernel.org
3804S: Maintained 3284S: Maintained
3805F: drivers/net/macvlan.c 3285F: drivers/net/macvlan.c
3806F: include/linux/if_macvlan.h 3286F: include/linux/if_macvlan.h
3807 3287
3808MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 3288MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7
3809P: Michael Kerrisk 3289M: Michael Kerrisk <mtk.manpages@gmail.com>
3810M: mtk.manpages@gmail.com
3811W: http://www.kernel.org/doc/man-pages 3290W: http://www.kernel.org/doc/man-pages
3812L: linux-man@vger.kernel.org 3291L: linux-man@vger.kernel.org
3813S: Maintained 3292S: Maintained
3814 3293
3815MARVELL LIBERTAS WIRELESS DRIVER 3294MARVELL LIBERTAS WIRELESS DRIVER
3816P: Dan Williams 3295M: Dan Williams <dcbw@redhat.com>
3817M: dcbw@redhat.com
3818L: libertas-dev@lists.infradead.org 3296L: libertas-dev@lists.infradead.org
3819S: Maintained 3297S: Maintained
3820F: drivers/net/wireless/libertas/ 3298F: drivers/net/wireless/libertas/
3821 3299
3822MARVELL MV643XX ETHERNET DRIVER 3300MARVELL MV643XX ETHERNET DRIVER
3823P: Lennert Buytenhek 3301M: Lennert Buytenhek <buytenh@marvell.com>
3824M: buytenh@marvell.com
3825L: netdev@vger.kernel.org 3302L: netdev@vger.kernel.org
3826S: Supported 3303S: Supported
3827F: drivers/net/mv643xx_eth.* 3304F: drivers/net/mv643xx_eth.*
3828F: include/linux/mv643xx.h 3305F: include/linux/mv643xx.h
3829 3306
3830MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER 3307MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
3831P: Nicolas Pitre 3308M: Nicolas Pitre <nico@cam.org>
3832M: nico@cam.org
3833S: Maintained 3309S: Maintained
3834 3310
3835MARVELL YUKON / SYSKONNECT DRIVER 3311MARVELL YUKON / SYSKONNECT DRIVER
3836P: Mirko Lindner 3312M: Mirko Lindner <mlindner@syskonnect.de>
3837M: mlindner@syskonnect.de 3313M: Ralph Roesler <rroesler@syskonnect.de>
3838P: Ralph Roesler
3839M: rroesler@syskonnect.de
3840W: http://www.syskonnect.com 3314W: http://www.syskonnect.com
3841S: Supported 3315S: Supported
3842 3316
3843MATROX FRAMEBUFFER DRIVER 3317MATROX FRAMEBUFFER DRIVER
3844P: Petr Vandrovec 3318M: Petr Vandrovec <vandrove@vc.cvut.cz>
3845M: vandrove@vc.cvut.cz
3846L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3319L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3847S: Maintained 3320S: Maintained
3848F: drivers/video/matrox/matroxfb_* 3321F: drivers/video/matrox/matroxfb_*
3849F: include/linux/matroxfb.h 3322F: include/linux/matroxfb.h
3850 3323
3851MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER 3324MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
3852P: Hans J. Koch 3325M: "Hans J. Koch" <hjk@linutronix.de>
3853M: hjk@linutronix.de
3854L: lm-sensors@lm-sensors.org 3326L: lm-sensors@lm-sensors.org
3855S: Maintained 3327S: Maintained
3856F: Documentation/hwmon/max6650 3328F: Documentation/hwmon/max6650
3857F: drivers/hwmon/max6650.c 3329F: drivers/hwmon/max6650.c
3858 3330
3859MEDIA INPUT INFRASTRUCTURE (V4L/DVB) 3331MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
3860P: Mauro Carvalho Chehab 3332M: Mauro Carvalho Chehab <mchehab@infradead.org>
3861M: mchehab@infradead.org
3862P: LinuxTV.org Project 3333P: LinuxTV.org Project
3863L: linux-media@vger.kernel.org 3334L: linux-media@vger.kernel.org
3864W: http://linuxtv.org 3335W: http://linuxtv.org
@@ -3872,8 +3343,7 @@ F: include/linux/dvb/
3872F: include/linux/videodev*.h 3343F: include/linux/videodev*.h
3873 3344
3874MEGARAID SCSI DRIVERS 3345MEGARAID SCSI DRIVERS
3875P: Neela Syam Kolli 3346M: Neela Syam Kolli <megaraidlinux@lsi.com>
3876M: megaraidlinux@lsi.com
3877L: linux-scsi@vger.kernel.org 3347L: linux-scsi@vger.kernel.org
3878W: http://megaraid.lsilogic.com 3348W: http://megaraid.lsilogic.com
3879S: Maintained 3349S: Maintained
@@ -3889,19 +3359,15 @@ F: include/linux/mm.h
3889F: mm/ 3359F: mm/
3890 3360
3891MEMORY RESOURCE CONTROLLER 3361MEMORY RESOURCE CONTROLLER
3892P: Balbir Singh 3362M: Balbir Singh <balbir@linux.vnet.ibm.com>
3893M: balbir@linux.vnet.ibm.com 3363M: Pavel Emelyanov <xemul@openvz.org>
3894P: Pavel Emelyanov 3364M: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
3895M: xemul@openvz.org
3896P: KAMEZAWA Hiroyuki
3897M: kamezawa.hiroyu@jp.fujitsu.com
3898L: linux-mm@kvack.org 3365L: linux-mm@kvack.org
3899S: Maintained 3366S: Maintained
3900F: mm/memcontrol.c 3367F: mm/memcontrol.c
3901 3368
3902MEMORY TECHNOLOGY DEVICES (MTD) 3369MEMORY TECHNOLOGY DEVICES (MTD)
3903P: David Woodhouse 3370M: David Woodhouse <dwmw2@infradead.org>
3904M: dwmw2@infradead.org
3905W: http://www.linux-mtd.infradead.org/ 3371W: http://www.linux-mtd.infradead.org/
3906L: linux-mtd@lists.infradead.org 3372L: linux-mtd@lists.infradead.org
3907T: git git://git.infradead.org/mtd-2.6.git 3373T: git git://git.infradead.org/mtd-2.6.git
@@ -3911,8 +3377,7 @@ F: include/linux/mtd/
3911F: include/mtd/ 3377F: include/mtd/
3912 3378
3913MICROBLAZE ARCHITECTURE 3379MICROBLAZE ARCHITECTURE
3914P: Michal Simek 3380M: Michal Simek <monstr@monstr.eu>
3915M: monstr@monstr.eu
3916L: microblaze-uclinux@itee.uq.edu.au 3381L: microblaze-uclinux@itee.uq.edu.au
3917W: http://www.monstr.eu/fdt/ 3382W: http://www.monstr.eu/fdt/
3918T: git git://git.monstr.eu/linux-2.6-microblaze.git 3383T: git git://git.monstr.eu/linux-2.6-microblaze.git
@@ -3920,14 +3385,12 @@ S: Supported
3920F: arch/microblaze/ 3385F: arch/microblaze/
3921 3386
3922MICROTEK X6 SCANNER 3387MICROTEK X6 SCANNER
3923P: Oliver Neukum 3388M: Oliver Neukum <oliver@neukum.name>
3924M: oliver@neukum.name
3925S: Maintained 3389S: Maintained
3926F: drivers/usb/image/microtek.* 3390F: drivers/usb/image/microtek.*
3927 3391
3928MIPS 3392MIPS
3929P: Ralf Baechle 3393M: Ralf Baechle <ralf@linux-mips.org>
3930M: ralf@linux-mips.org
3931W: http://www.linux-mips.org/ 3394W: http://www.linux-mips.org/
3932L: linux-mips@linux-mips.org 3395L: linux-mips@linux-mips.org
3933T: git git://git.linux-mips.org/pub/scm/linux.git 3396T: git git://git.linux-mips.org/pub/scm/linux.git
@@ -3936,8 +3399,7 @@ F: Documentation/mips/
3936F: arch/mips/ 3399F: arch/mips/
3937 3400
3938MISCELLANEOUS MCA-SUPPORT 3401MISCELLANEOUS MCA-SUPPORT
3939P: James Bottomley 3402M: James Bottomley <James.Bottomley@HansenPartnership.com>
3940M: James.Bottomley@HansenPartnership.com
3941S: Maintained 3403S: Maintained
3942F: Documentation/ia64/mca.txt 3404F: Documentation/ia64/mca.txt
3943F: Documentation/mca.txt 3405F: Documentation/mca.txt
@@ -3945,15 +3407,13 @@ F: drivers/mca/
3945F: include/linux/mca* 3407F: include/linux/mca*
3946 3408
3947MODULE SUPPORT 3409MODULE SUPPORT
3948P: Rusty Russell 3410M: Rusty Russell <rusty@rustcorp.com.au>
3949M: rusty@rustcorp.com.au
3950S: Maintained 3411S: Maintained
3951F: include/linux/module.h 3412F: include/linux/module.h
3952F: kernel/module.c 3413F: kernel/module.c
3953 3414
3954MOTION EYE VAIO PICTUREBOOK CAMERA DRIVER 3415MOTION EYE VAIO PICTUREBOOK CAMERA DRIVER
3955P: Stelian Pop 3416M: Stelian Pop <stelian@popies.net>
3956M: stelian@popies.net
3957W: http://popies.net/meye/ 3417W: http://popies.net/meye/
3958S: Maintained 3418S: Maintained
3959F: Documentation/video4linux/meye.txt 3419F: Documentation/video4linux/meye.txt
@@ -3961,135 +3421,111 @@ F: drivers/media/video/meye.*
3961F: include/linux/meye.h 3421F: include/linux/meye.h
3962 3422
3963MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER 3423MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
3964P: Pavel Pisa 3424M: Pavel Pisa <ppisa@pikron.com>
3965M: ppisa@pikron.com
3966L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 3425L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3967S: Maintained 3426S: Maintained
3968F: drivers/mmc/host/imxmmc.* 3427F: drivers/mmc/host/imxmmc.*
3969 3428
3970MOUSE AND MISC DEVICES [GENERAL] 3429MOUSE AND MISC DEVICES [GENERAL]
3971P: Alessandro Rubini 3430M: Alessandro Rubini <rubini@ipvvis.unipv.it>
3972M: rubini@ipvvis.unipv.it
3973S: Maintained 3431S: Maintained
3974F: drivers/input/mouse/ 3432F: drivers/input/mouse/
3975F: include/linux/gpio_mouse.h 3433F: include/linux/gpio_mouse.h
3976 3434
3977MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD 3435MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
3978P: Jiri Slaby 3436M: Jiri Slaby <jirislaby@gmail.com>
3979M: jirislaby@gmail.com
3980S: Maintained 3437S: Maintained
3981F: Documentation/serial/moxa-smartio 3438F: Documentation/serial/moxa-smartio
3982F: drivers/char/mxser.* 3439F: drivers/char/mxser.*
3983 3440
3984MSI LAPTOP SUPPORT 3441MSI LAPTOP SUPPORT
3985P: Lennart Poettering 3442M: Lennart Poettering <mzxreary@0pointer.de>
3986M: mzxreary@0pointer.de
3987W: https://tango.0pointer.de/mailman/listinfo/s270-linux 3443W: https://tango.0pointer.de/mailman/listinfo/s270-linux
3988W: http://0pointer.de/lennart/tchibo.html 3444W: http://0pointer.de/lennart/tchibo.html
3989S: Maintained 3445S: Maintained
3990F: drivers/platform/x86/msi-laptop.c 3446F: drivers/platform/x86/msi-laptop.c
3991 3447
3992MULTIFUNCTION DEVICES (MFD) 3448MULTIFUNCTION DEVICES (MFD)
3993P: Samuel Ortiz 3449M: Samuel Ortiz <sameo@linux.intel.com>
3994M: sameo@linux.intel.com
3995T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git 3450T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git
3996S: Supported 3451S: Supported
3997F: drivers/mfd/ 3452F: drivers/mfd/
3998 3453
3999MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM 3454MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
4000P: Pierre Ossman 3455S: Orphan
4001M: pierre@ossman.eu
4002S: Maintained
4003F: drivers/mmc/ 3456F: drivers/mmc/
4004F: include/linux/mmc/ 3457F: include/linux/mmc/
4005 3458
4006MULTIMEDIA CARD (MMC) ETC. OVER SPI 3459MULTIMEDIA CARD (MMC) ETC. OVER SPI
4007P: David Brownell 3460M: David Brownell <dbrownell@users.sourceforge.net>
4008M: dbrownell@users.sourceforge.net
4009S: Odd Fixes 3461S: Odd Fixes
4010F: drivers/mmc/host/mmc_spi.c 3462F: drivers/mmc/host/mmc_spi.c
4011F: include/linux/spi/mmc_spi.h 3463F: include/linux/spi/mmc_spi.h
4012 3464
4013MULTISOUND SOUND DRIVER 3465MULTISOUND SOUND DRIVER
4014P: Andrew Veliath 3466M: Andrew Veliath <andrewtv@usa.net>
4015M: andrewtv@usa.net
4016S: Maintained 3467S: Maintained
4017F: Documentation/sound/oss/MultiSound 3468F: Documentation/sound/oss/MultiSound
4018F: sound/oss/msnd* 3469F: sound/oss/msnd*
4019 3470
4020MULTITECH MULTIPORT CARD (ISICOM) 3471MULTITECH MULTIPORT CARD (ISICOM)
4021P: Jiri Slaby 3472M: Jiri Slaby <jirislaby@gmail.com>
4022M: jirislaby@gmail.com
4023S: Maintained 3473S: Maintained
4024F: drivers/char/isicom.c 3474F: drivers/char/isicom.c
4025F: include/linux/isicom.h 3475F: include/linux/isicom.h
4026 3476
4027MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER 3477MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
4028P: Felipe Balbi 3478M: Felipe Balbi <felipe.balbi@nokia.com>
4029M: felipe.balbi@nokia.com
4030L: linux-usb@vger.kernel.org 3479L: linux-usb@vger.kernel.org
4031T: git git://gitorious.org/musb/mainline.git 3480T: git git://gitorious.org/musb/mainline.git
4032S: Maintained 3481S: Maintained
4033F: drivers/usb/musb/ 3482F: drivers/usb/musb/
4034 3483
4035MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE) 3484MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
4036P: Andrew Gallatin 3485M: Andrew Gallatin <gallatin@myri.com>
4037M: gallatin@myri.com 3486M: Brice Goglin <brice@myri.com>
4038P: Brice Goglin
4039M: brice@myri.com
4040L: netdev@vger.kernel.org 3487L: netdev@vger.kernel.org
4041W: http://www.myri.com/scs/download-Myri10GE.html 3488W: http://www.myri.com/scs/download-Myri10GE.html
4042S: Supported 3489S: Supported
4043F: drivers/net/myri10ge/ 3490F: drivers/net/myri10ge/
4044 3491
4045NATSEMI ETHERNET DRIVER (DP8381x) 3492NATSEMI ETHERNET DRIVER (DP8381x)
4046P: Tim Hockin 3493M: Tim Hockin <thockin@hockin.org>
4047M: thockin@hockin.org
4048S: Maintained 3494S: Maintained
4049F: drivers/net/natsemi.c 3495F: drivers/net/natsemi.c
4050 3496
4051NCP FILESYSTEM 3497NCP FILESYSTEM
4052P: Petr Vandrovec 3498M: Petr Vandrovec <vandrove@vc.cvut.cz>
4053M: vandrove@vc.cvut.cz
4054L: linware@sh.cvut.cz 3499L: linware@sh.cvut.cz
4055S: Maintained 3500S: Maintained
4056F: fs/ncpfs/ 3501F: fs/ncpfs/
4057 3502
4058NCR DUAL 700 SCSI DRIVER (MICROCHANNEL) 3503NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)
4059P: James E.J. Bottomley 3504M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
4060M: James.Bottomley@HansenPartnership.com
4061L: linux-scsi@vger.kernel.org 3505L: linux-scsi@vger.kernel.org
4062S: Maintained 3506S: Maintained
4063F: drivers/scsi/NCR_D700.* 3507F: drivers/scsi/NCR_D700.*
4064 3508
4065NETEFFECT IWARP RNIC DRIVER (IW_NES) 3509NETEFFECT IWARP RNIC DRIVER (IW_NES)
4066P: Faisal Latif 3510M: Faisal Latif <faisal.latif@intel.com>
4067M: faisal.latif@intel.com 3511M: Chien Tung <chien.tin.tung@intel.com>
4068P: Chien Tung
4069M: chien.tin.tung@intel.com
4070L: general@lists.openfabrics.org 3512L: general@lists.openfabrics.org
4071W: http://www.neteffect.com 3513W: http://www.neteffect.com
4072S: Supported 3514S: Supported
4073F: drivers/infiniband/hw/nes/ 3515F: drivers/infiniband/hw/nes/
4074 3516
4075NETEM NETWORK EMULATOR 3517NETEM NETWORK EMULATOR
4076P: Stephen Hemminger 3518M: Stephen Hemminger <shemminger@linux-foundation.org>
4077M: shemminger@linux-foundation.org
4078L: netem@lists.linux-foundation.org 3519L: netem@lists.linux-foundation.org
4079S: Maintained 3520S: Maintained
4080F: net/sched/sch_netem.c 3521F: net/sched/sch_netem.c
4081 3522
4082NETERION (S2IO) 10GbE DRIVER (xframe/vxge) 3523NETERION (S2IO) 10GbE DRIVER (xframe/vxge)
4083P: Ramkrishna Vepa 3524M: Ramkrishna Vepa <ram.vepa@neterion.com>
4084M: ram.vepa@neterion.com 3525M: Rastapur Santosh <santosh.rastapur@neterion.com>
4085P: Rastapur Santosh 3526M: Sivakumar Subramani <sivakumar.subramani@neterion.com>
4086M: santosh.rastapur@neterion.com 3527M: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
4087P: Sivakumar Subramani 3528M: Anil Murthy <anil.murthy@neterion.com>
4088M: sivakumar.subramani@neterion.com
4089P: Sreenivasa Honnur
4090M: sreenivasa.honnur@neterion.com
4091P: Anil Murthy
4092M: anil.murthy@neterion.com
4093L: netdev@vger.kernel.org 3529L: netdev@vger.kernel.org
4094W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous 3530W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
4095W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous 3531W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
@@ -4103,13 +3539,13 @@ P: Marc Boucher
4103P: James Morris 3539P: James Morris
4104P: Harald Welte 3540P: Harald Welte
4105P: Jozsef Kadlecsik 3541P: Jozsef Kadlecsik
4106P: Patrick McHardy 3542M: Patrick McHardy <kaber@trash.net>
4107M: kaber@trash.net
4108L: netfilter-devel@vger.kernel.org 3543L: netfilter-devel@vger.kernel.org
4109L: netfilter@vger.kernel.org 3544L: netfilter@vger.kernel.org
4110L: coreteam@netfilter.org 3545L: coreteam@netfilter.org
4111W: http://www.netfilter.org/ 3546W: http://www.netfilter.org/
4112W: http://www.iptables.org/ 3547W: http://www.iptables.org/
3548T: git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git
4113S: Supported 3549S: Supported
4114F: include/linux/netfilter* 3550F: include/linux/netfilter*
4115F: include/linux/netfilter/ 3551F: include/linux/netfilter/
@@ -4119,8 +3555,7 @@ F: net/*/netfilter/
4119F: net/netfilter/ 3555F: net/netfilter/
4120 3556
4121NETLABEL 3557NETLABEL
4122P: Paul Moore 3558M: Paul Moore <paul.moore@hp.com>
4123M: paul.moore@hp.com
4124W: http://netlabel.sf.net 3559W: http://netlabel.sf.net
4125L: netdev@vger.kernel.org 3560L: netdev@vger.kernel.org
4126S: Supported 3561S: Supported
@@ -4129,8 +3564,7 @@ F: include/net/netlabel.h
4129F: net/netlabel/ 3564F: net/netlabel/
4130 3565
4131NETROM NETWORK LAYER 3566NETROM NETWORK LAYER
4132P: Ralf Baechle 3567M: Ralf Baechle <ralf@linux-mips.org>
4133M: ralf@linux-mips.org
4134L: linux-hams@vger.kernel.org 3568L: linux-hams@vger.kernel.org
4135W: http://www.linux-ax25.org/ 3569W: http://www.linux-ax25.org/
4136S: Maintained 3570S: Maintained
@@ -4139,16 +3573,14 @@ F: include/net/netrom.h
4139F: net/netrom/ 3573F: net/netrom/
4140 3574
4141NETWORK BLOCK DEVICE (NBD) 3575NETWORK BLOCK DEVICE (NBD)
4142P: Paul Clements 3576M: Paul Clements <Paul.Clements@steeleye.com>
4143M: Paul.Clements@steeleye.com
4144S: Maintained 3577S: Maintained
4145F: Documentation/blockdev/nbd.txt 3578F: Documentation/blockdev/nbd.txt
4146F: drivers/block/nbd.c 3579F: drivers/block/nbd.c
4147F: include/linux/nbd.h 3580F: include/linux/nbd.h
4148 3581
4149NETWORKING [GENERAL] 3582NETWORKING [GENERAL]
4150P: David S. Miller 3583M: "David S. Miller" <davem@davemloft.net>
4151M: davem@davemloft.net
4152L: netdev@vger.kernel.org 3584L: netdev@vger.kernel.org
4153W: http://www.linuxfoundation.org/en/Net 3585W: http://www.linuxfoundation.org/en/Net
4154T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git 3586T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
@@ -4157,18 +3589,12 @@ F: net/
4157F: include/net/ 3589F: include/net/
4158 3590
4159NETWORKING [IPv4/IPv6] 3591NETWORKING [IPv4/IPv6]
4160P: David S. Miller 3592M: "David S. Miller" <davem@davemloft.net>
4161M: davem@davemloft.net 3593M: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
4162P: Alexey Kuznetsov 3594M: "Pekka Savola (ipv6)" <pekkas@netcore.fi>
4163M: kuznet@ms2.inr.ac.ru 3595M: James Morris <jmorris@namei.org>
4164P: Pekka Savola (ipv6) 3596M: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
4165M: pekkas@netcore.fi 3597M: Patrick McHardy <kaber@trash.net>
4166P: James Morris
4167M: jmorris@namei.org
4168P: Hideaki YOSHIFUJI
4169M: yoshfuji@linux-ipv6.org
4170P: Patrick McHardy
4171M: kaber@trash.net
4172L: netdev@vger.kernel.org 3598L: netdev@vger.kernel.org
4173T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git 3599T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
4174S: Maintained 3600S: Maintained
@@ -4177,14 +3603,12 @@ F: net/ipv6/
4177F: include/net/ip* 3603F: include/net/ip*
4178 3604
4179NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK) 3605NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK)
4180P: Paul Moore 3606M: Paul Moore <paul.moore@hp.com>
4181M: paul.moore@hp.com
4182L: netdev@vger.kernel.org 3607L: netdev@vger.kernel.org
4183S: Maintained 3608S: Maintained
4184 3609
4185NETWORKING [WIRELESS] 3610NETWORKING [WIRELESS]
4186P: John W. Linville 3611M: "John W. Linville" <linville@tuxdriver.com>
4187M: linville@tuxdriver.com
4188L: linux-wireless@vger.kernel.org 3612L: linux-wireless@vger.kernel.org
4189T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3613T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
4190S: Maintained 3614S: Maintained
@@ -4200,16 +3624,14 @@ S: Odd Fixes
4200F: drivers/net/ 3624F: drivers/net/
4201 3625
4202NETXEN (1/10) GbE SUPPORT 3626NETXEN (1/10) GbE SUPPORT
4203P: Dhananjay Phadke 3627M: Dhananjay Phadke <dhananjay@netxen.com>
4204M: dhananjay@netxen.com
4205L: netdev@vger.kernel.org 3628L: netdev@vger.kernel.org
4206W: http://www.netxen.com 3629W: http://www.netxen.com
4207S: Supported 3630S: Supported
4208F: drivers/net/netxen/ 3631F: drivers/net/netxen/
4209 3632
4210NFS, SUNRPC, AND LOCKD CLIENTS 3633NFS, SUNRPC, AND LOCKD CLIENTS
4211P: Trond Myklebust 3634M: Trond Myklebust <Trond.Myklebust@netapp.com>
4212M: Trond.Myklebust@netapp.com
4213L: linux-nfs@vger.kernel.org 3635L: linux-nfs@vger.kernel.org
4214W: http://client.linux-nfs.org 3636W: http://client.linux-nfs.org
4215T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git 3637T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git
@@ -4223,17 +3645,14 @@ F: include/linux/nfs*
4223F: include/linux/sunrpc/ 3645F: include/linux/sunrpc/
4224 3646
4225NI5010 NETWORK DRIVER 3647NI5010 NETWORK DRIVER
4226P: Jan-Pascal van Best 3648M: Jan-Pascal van Best <janpascal@vanbest.org>
4227M: janpascal@vanbest.org 3649M: Andreas Mohr <andi@lisas.de>
4228P: Andreas Mohr
4229M: andi@lisas.de
4230L: netdev@vger.kernel.org 3650L: netdev@vger.kernel.org
4231S: Maintained 3651S: Maintained
4232F: drivers/net/ni5010.* 3652F: drivers/net/ni5010.*
4233 3653
4234NILFS2 FILESYSTEM 3654NILFS2 FILESYSTEM
4235P: KONISHI Ryusuke 3655M: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
4236M: konishi.ryusuke@lab.ntt.co.jp
4237L: users@nilfs.org 3656L: users@nilfs.org
4238W: http://www.nilfs.org/en/ 3657W: http://www.nilfs.org/en/
4239S: Supported 3658S: Supported
@@ -4242,26 +3661,22 @@ F: fs/nilfs2/
4242F: include/linux/nilfs2_fs.h 3661F: include/linux/nilfs2_fs.h
4243 3662
4244NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER 3663NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER
4245P: YOKOTA Hiroshi 3664M: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
4246M: yokota@netlab.is.tsukuba.ac.jp
4247W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/ 3665W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
4248S: Maintained 3666S: Maintained
4249F: Documentation/scsi/NinjaSCSI.txt 3667F: Documentation/scsi/NinjaSCSI.txt
4250F: drivers/scsi/pcmcia/nsp_* 3668F: drivers/scsi/pcmcia/nsp_*
4251 3669
4252NINJA SCSI-32Bi/UDE PCI/CARDBUS SCSI HOST ADAPTER DRIVER 3670NINJA SCSI-32Bi/UDE PCI/CARDBUS SCSI HOST ADAPTER DRIVER
4253P: GOTO Masanori 3671M: GOTO Masanori <gotom@debian.or.jp>
4254M: gotom@debian.or.jp 3672M: YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
4255P: YOKOTA Hiroshi
4256M: yokota@netlab.is.tsukuba.ac.jp
4257W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/ 3673W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
4258S: Maintained 3674S: Maintained
4259F: Documentation/scsi/NinjaSCSI.txt 3675F: Documentation/scsi/NinjaSCSI.txt
4260F: drivers/scsi/nsp32* 3676F: drivers/scsi/nsp32*
4261 3677
4262NTFS FILESYSTEM 3678NTFS FILESYSTEM
4263P: Anton Altaparmakov 3679M: Anton Altaparmakov <aia21@cantab.net>
4264M: aia21@cantab.net
4265L: linux-ntfs-dev@lists.sourceforge.net 3680L: linux-ntfs-dev@lists.sourceforge.net
4266W: http://www.linux-ntfs.org/ 3681W: http://www.linux-ntfs.org/
4267T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git 3682T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
@@ -4270,16 +3685,14 @@ F: Documentation/filesystems/ntfs.txt
4270F: fs/ntfs/ 3685F: fs/ntfs/
4271 3686
4272NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER 3687NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER
4273P: Antonino Daplas 3688M: Antonino Daplas <adaplas@gmail.com>
4274M: adaplas@gmail.com
4275L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3689L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4276S: Maintained 3690S: Maintained
4277F: drivers/video/riva/ 3691F: drivers/video/riva/
4278F: drivers/video/nvidia/ 3692F: drivers/video/nvidia/
4279 3693
4280OMAP SUPPORT 3694OMAP SUPPORT
4281P: Tony Lindgren <tony@atomide.com> 3695M: "Tony Lindgren <tony@atomide.com>" <tony@atomide.com>
4282M: tony@atomide.com
4283L: linux-omap@vger.kernel.org 3696L: linux-omap@vger.kernel.org
4284W: http://www.muru.com/linux/omap/ 3697W: http://www.muru.com/linux/omap/
4285W: http://linux.omap.com/ 3698W: http://linux.omap.com/
@@ -4288,98 +3701,83 @@ S: Maintained
4288F: arch/arm/*omap* 3701F: arch/arm/*omap*
4289 3702
4290OMAP CLOCK FRAMEWORK SUPPORT 3703OMAP CLOCK FRAMEWORK SUPPORT
4291P: Paul Walmsley 3704M: Paul Walmsley <paul@pwsan.com>
4292M: paul@pwsan.com
4293L: linux-omap@vger.kernel.org 3705L: linux-omap@vger.kernel.org
4294S: Maintained 3706S: Maintained
4295F: arch/arm/*omap*/*clock* 3707F: arch/arm/*omap*/*clock*
4296 3708
4297OMAP POWER MANAGEMENT SUPPORT 3709OMAP POWER MANAGEMENT SUPPORT
4298P: Kevin Hilman 3710M: Kevin Hilman <khilman@deeprootsystems.com>
4299M: khilman@deeprootsystems.com
4300L: linux-omap@vger.kernel.org 3711L: linux-omap@vger.kernel.org
4301S: Maintained 3712S: Maintained
4302F: arch/arm/*omap*/*pm* 3713F: arch/arm/*omap*/*pm*
4303 3714
4304OMAP AUDIO SUPPORT 3715OMAP AUDIO SUPPORT
4305P: Jarkko Nikula 3716M: Jarkko Nikula <jhnikula@gmail.com>
4306M: jhnikula@gmail.com
4307L: alsa-devel@alsa-project.org (subscribers-only) 3717L: alsa-devel@alsa-project.org (subscribers-only)
4308L: linux-omap@vger.kernel.org 3718L: linux-omap@vger.kernel.org
4309S: Maintained 3719S: Maintained
4310F: sound/soc/omap/ 3720F: sound/soc/omap/
4311 3721
4312OMAP FRAMEBUFFER SUPPORT 3722OMAP FRAMEBUFFER SUPPORT
4313P: Imre Deak 3723M: Imre Deak <imre.deak@nokia.com>
4314M: imre.deak@nokia.com
4315L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3724L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4316L: linux-omap@vger.kernel.org 3725L: linux-omap@vger.kernel.org
4317S: Maintained 3726S: Maintained
4318F: drivers/video/omap/ 3727F: drivers/video/omap/
4319 3728
4320OMAP MMC SUPPORT 3729OMAP MMC SUPPORT
4321P: Jarkko Lavinen 3730M: Jarkko Lavinen <jarkko.lavinen@nokia.com>
4322M: jarkko.lavinen@nokia.com
4323L: linux-kernel@vger.kernel.org
4324L: linux-omap@vger.kernel.org 3731L: linux-omap@vger.kernel.org
4325S: Maintained 3732S: Maintained
4326F: drivers/mmc/host/*omap* 3733F: drivers/mmc/host/*omap*
4327 3734
4328OMAP RANDOM NUMBER GENERATOR SUPPORT 3735OMAP RANDOM NUMBER GENERATOR SUPPORT
4329P: Deepak Saxena 3736M: Deepak Saxena <dsaxena@plexity.net>
4330M: dsaxena@plexity.net
4331S: Maintained 3737S: Maintained
4332F: drivers/char/hw_random/omap-rng.c 3738F: drivers/char/hw_random/omap-rng.c
4333 3739
4334OMAP USB SUPPORT 3740OMAP USB SUPPORT
4335P: Felipe Balbi 3741M: Felipe Balbi <felipe.balbi@nokia.com>
4336M: felipe.balbi@nokia.com 3742M: David Brownell <dbrownell@users.sourceforge.net>
4337P: David Brownell
4338M: dbrownell@users.sourceforge.net
4339L: linux-usb@vger.kernel.org 3743L: linux-usb@vger.kernel.org
4340L: linux-omap@vger.kernel.org 3744L: linux-omap@vger.kernel.org
4341S: Maintained 3745S: Maintained
4342 3746
4343OMFS FILESYSTEM 3747OMFS FILESYSTEM
4344P: Bob Copeland 3748M: Bob Copeland <me@bobcopeland.com>
4345M: me@bobcopeland.com
4346L: linux-karma-devel@lists.sourceforge.net 3749L: linux-karma-devel@lists.sourceforge.net
4347S: Maintained 3750S: Maintained
4348F: Documentation/filesystems/omfs.txt 3751F: Documentation/filesystems/omfs.txt
4349F: fs/omfs/ 3752F: fs/omfs/
4350 3753
4351OMNIKEY CARDMAN 4000 DRIVER 3754OMNIKEY CARDMAN 4000 DRIVER
4352P: Harald Welte 3755M: Harald Welte <laforge@gnumonks.org>
4353M: laforge@gnumonks.org
4354S: Maintained 3756S: Maintained
4355F: drivers/char/pcmcia/cm4000_cs.c 3757F: drivers/char/pcmcia/cm4000_cs.c
4356F: include/linux/cm4000_cs.h 3758F: include/linux/cm4000_cs.h
4357 3759
4358OMNIKEY CARDMAN 4040 DRIVER 3760OMNIKEY CARDMAN 4040 DRIVER
4359P: Harald Welte 3761M: Harald Welte <laforge@gnumonks.org>
4360M: laforge@gnumonks.org
4361S: Maintained 3762S: Maintained
4362F: drivers/char/pcmcia/cm4040_cs.* 3763F: drivers/char/pcmcia/cm4040_cs.*
4363 3764
4364OMNIVISION OV7670 SENSOR DRIVER 3765OMNIVISION OV7670 SENSOR DRIVER
4365P: Jonathan Corbet 3766M: Jonathan Corbet <corbet@lwn.net>
4366M: corbet@lwn.net
4367L: linux-media@vger.kernel.org 3767L: linux-media@vger.kernel.org
4368T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 3768T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4369S: Maintained 3769S: Maintained
4370F: drivers/media/video/ov7670.c 3770F: drivers/media/video/ov7670.c
4371 3771
4372ONENAND FLASH DRIVER 3772ONENAND FLASH DRIVER
4373P: Kyungmin Park 3773M: Kyungmin Park <kyungmin.park@samsung.com>
4374M: kyungmin.park@samsung.com
4375L: linux-mtd@lists.infradead.org 3774L: linux-mtd@lists.infradead.org
4376S: Maintained 3775S: Maintained
4377F: drivers/mtd/onenand/ 3776F: drivers/mtd/onenand/
4378F: include/linux/mtd/onenand*.h 3777F: include/linux/mtd/onenand*.h
4379 3778
4380ONSTREAM SCSI TAPE DRIVER 3779ONSTREAM SCSI TAPE DRIVER
4381P: Willem Riede 3780M: Willem Riede <osst@riede.org>
4382M: osst@riede.org
4383L: osst-users@lists.sourceforge.net 3781L: osst-users@lists.sourceforge.net
4384L: linux-scsi@vger.kernel.org 3782L: linux-scsi@vger.kernel.org
4385S: Maintained 3783S: Maintained
@@ -4387,16 +3785,14 @@ F: drivers/scsi/osst*
4387F: drivers/scsi/st* 3785F: drivers/scsi/st*
4388 3786
4389OPENCORES I2C BUS DRIVER 3787OPENCORES I2C BUS DRIVER
4390P: Peter Korsgaard 3788M: Peter Korsgaard <jacmet@sunsite.dk>
4391M: jacmet@sunsite.dk
4392L: linux-i2c@vger.kernel.org 3789L: linux-i2c@vger.kernel.org
4393S: Maintained 3790S: Maintained
4394F: Documentation/i2c/busses/i2c-ocores 3791F: Documentation/i2c/busses/i2c-ocores
4395F: drivers/i2c/busses/i2c-ocores.c 3792F: drivers/i2c/busses/i2c-ocores.c
4396 3793
4397OPROFILE 3794OPROFILE
4398P: Robert Richter 3795M: Robert Richter <robert.richter@amd.com>
4399M: robert.richter@amd.com
4400L: oprofile-list@lists.sf.net 3796L: oprofile-list@lists.sf.net
4401S: Maintained 3797S: Maintained
4402F: arch/*/oprofile/ 3798F: arch/*/oprofile/
@@ -4404,10 +3800,8 @@ F: drivers/oprofile/
4404F: include/linux/oprofile.h 3800F: include/linux/oprofile.h
4405 3801
4406ORACLE CLUSTER FILESYSTEM 2 (OCFS2) 3802ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
4407P: Mark Fasheh 3803M: Mark Fasheh <mfasheh@suse.com>
4408M: mfasheh@suse.com 3804M: Joel Becker <joel.becker@oracle.com>
4409P: Joel Becker
4410M: joel.becker@oracle.com
4411L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers) 3805L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
4412W: http://oss.oracle.com/projects/ocfs2/ 3806W: http://oss.oracle.com/projects/ocfs2/
4413T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git 3807T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
@@ -4417,10 +3811,8 @@ F: Documentation/filesystems/dlmfs.txt
4417F: fs/ocfs2/ 3811F: fs/ocfs2/
4418 3812
4419ORINOCO DRIVER 3813ORINOCO DRIVER
4420P: Pavel Roskin 3814M: Pavel Roskin <proski@gnu.org>
4421M: proski@gnu.org 3815M: David Gibson <hermes@gibson.dropbear.id.au>
4422P: David Gibson
4423M: hermes@gibson.dropbear.id.au
4424L: linux-wireless@vger.kernel.org 3816L: linux-wireless@vger.kernel.org
4425L: orinoco-users@lists.sourceforge.net 3817L: orinoco-users@lists.sourceforge.net
4426L: orinoco-devel@lists.sourceforge.net 3818L: orinoco-devel@lists.sourceforge.net
@@ -4429,10 +3821,8 @@ S: Maintained
4429F: drivers/net/wireless/orinoco/ 3821F: drivers/net/wireless/orinoco/
4430 3822
4431OSD LIBRARY and FILESYSTEM 3823OSD LIBRARY and FILESYSTEM
4432P: Boaz Harrosh 3824M: Boaz Harrosh <bharrosh@panasas.com>
4433M: bharrosh@panasas.com 3825M: Benny Halevy <bhalevy@panasas.com>
4434P: Benny Halevy
4435M: bhalevy@panasas.com
4436L: osd-dev@open-osd.org 3826L: osd-dev@open-osd.org
4437W: http://open-osd.org 3827W: http://open-osd.org
4438T: git git://git.open-osd.org/open-osd.git 3828T: git git://git.open-osd.org/open-osd.git
@@ -4442,8 +3832,7 @@ F: drivers/include/scsi/osd_*
4442F: fs/exofs/ 3832F: fs/exofs/
4443 3833
4444P54 WIRELESS DRIVER 3834P54 WIRELESS DRIVER
4445P: Michael Wu 3835M: Michael Wu <flamingice@sourmilk.net>
4446M: flamingice@sourmilk.net
4447L: linux-wireless@vger.kernel.org 3836L: linux-wireless@vger.kernel.org
4448W: http://prism54.org 3837W: http://prism54.org
4449T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git 3838T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
@@ -4451,30 +3840,25 @@ S: Maintained
4451F: drivers/net/wireless/p54/ 3840F: drivers/net/wireless/p54/
4452 3841
4453PA SEMI ETHERNET DRIVER 3842PA SEMI ETHERNET DRIVER
4454P: Olof Johansson 3843M: Olof Johansson <olof@lixom.net>
4455M: olof@lixom.net
4456L: netdev@vger.kernel.org 3844L: netdev@vger.kernel.org
4457S: Maintained 3845S: Maintained
4458F: drivers/net/pasemi_mac.* 3846F: drivers/net/pasemi_mac.*
4459 3847
4460PA SEMI SMBUS DRIVER 3848PA SEMI SMBUS DRIVER
4461P: Olof Johansson 3849M: Olof Johansson <olof@lixom.net>
4462M: olof@lixom.net
4463L: linux-i2c@vger.kernel.org 3850L: linux-i2c@vger.kernel.org
4464S: Maintained 3851S: Maintained
4465F: drivers/i2c/busses/i2c-pasemi.c 3852F: drivers/i2c/busses/i2c-pasemi.c
4466 3853
4467PANASONIC LAPTOP ACPI EXTRAS DRIVER 3854PANASONIC LAPTOP ACPI EXTRAS DRIVER
4468P: Harald Welte 3855M: Harald Welte <laforge@gnumonks.org>
4469M: laforge@gnumonks.org
4470S: Maintained 3856S: Maintained
4471F: drivers/platform/x86/panasonic-laptop.c 3857F: drivers/platform/x86/panasonic-laptop.c
4472 3858
4473PANASONIC MN10300/AM33 PORT 3859PANASONIC MN10300/AM33 PORT
4474P: David Howells 3860M: David Howells <dhowells@redhat.com>
4475M: dhowells@redhat.com 3861M: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
4476P: Koichi Yasutake
4477M: yasutake.koichi@jp.panasonic.com
4478L: linux-am33-list@redhat.com (moderated for non-subscribers) 3862L: linux-am33-list@redhat.com (moderated for non-subscribers)
4479W: ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/ 3863W: ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/
4480S: Maintained 3864S: Maintained
@@ -4490,14 +3874,10 @@ F: drivers/char/ppdev.c
4490F: include/linux/ppdev.h 3874F: include/linux/ppdev.h
4491 3875
4492PARAVIRT_OPS INTERFACE 3876PARAVIRT_OPS INTERFACE
4493P: Jeremy Fitzhardinge 3877M: Jeremy Fitzhardinge <jeremy@xensource.com>
4494M: jeremy@xensource.com 3878M: Chris Wright <chrisw@sous-sol.org>
4495P: Chris Wright 3879M: Alok Kataria <akataria@vmware.com>
4496M: chrisw@sous-sol.org 3880M: Rusty Russell <rusty@rustcorp.com.au>
4497P: Alok Kataria
4498M: akataria@vmware.com
4499P: Rusty Russell
4500M: rusty@rustcorp.com.au
4501L: virtualization@lists.osdl.org 3881L: virtualization@lists.osdl.org
4502S: Supported 3882S: Supported
4503F: Documentation/ia64/paravirt_ops.txt 3883F: Documentation/ia64/paravirt_ops.txt
@@ -4505,8 +3885,7 @@ F: arch/*/kernel/paravirt*
4505F: arch/*/include/asm/paravirt.h 3885F: arch/*/include/asm/paravirt.h
4506 3886
4507PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES 3887PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
4508P: Tim Waugh 3888M: Tim Waugh <tim@cyberelk.net>
4509M: tim@cyberelk.net
4510L: linux-parport@lists.infradead.org (subscribers-only) 3889L: linux-parport@lists.infradead.org (subscribers-only)
4511W: http://www.torque.net/linux-pp.html 3890W: http://www.torque.net/linux-pp.html
4512S: Maintained 3891S: Maintained
@@ -4514,10 +3893,8 @@ F: Documentation/blockdev/paride.txt
4514F: drivers/block/paride/ 3893F: drivers/block/paride/
4515 3894
4516PARISC ARCHITECTURE 3895PARISC ARCHITECTURE
4517P: Kyle McMartin 3896M: Kyle McMartin <kyle@mcmartin.ca>
4518M: kyle@mcmartin.ca 3897M: Helge Deller <deller@gmx.de>
4519P: Helge Deller
4520M: deller@gmx.de
4521L: linux-parisc@vger.kernel.org 3898L: linux-parisc@vger.kernel.org
4522W: http://www.parisc-linux.org/ 3899W: http://www.parisc-linux.org/
4523T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git 3900T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
@@ -4526,37 +3903,32 @@ F: arch/parisc/
4526F: drivers/parisc/ 3903F: drivers/parisc/
4527 3904
4528PC87360 HARDWARE MONITORING DRIVER 3905PC87360 HARDWARE MONITORING DRIVER
4529P: Jim Cromie 3906M: Jim Cromie <jim.cromie@gmail.com>
4530M: jim.cromie@gmail.com
4531L: lm-sensors@lm-sensors.org 3907L: lm-sensors@lm-sensors.org
4532S: Maintained 3908S: Maintained
4533F: Documentation/hwmon/pc87360 3909F: Documentation/hwmon/pc87360
4534F: drivers/hwmon/pc87360.c 3910F: drivers/hwmon/pc87360.c
4535 3911
4536PC8736x GPIO DRIVER 3912PC8736x GPIO DRIVER
4537P: Jim Cromie 3913M: Jim Cromie <jim.cromie@gmail.com>
4538M: jim.cromie@gmail.com
4539S: Maintained 3914S: Maintained
4540F: drivers/char/pc8736x_gpio.c 3915F: drivers/char/pc8736x_gpio.c
4541 3916
4542PCA9532 LED DRIVER 3917PCA9532 LED DRIVER
4543P: Riku Voipio 3918M: Riku Voipio <riku.voipio@iki.fi>
4544M: riku.voipio@iki.fi
4545S: Maintained 3919S: Maintained
4546F: drivers/leds/leds-pca9532.c 3920F: drivers/leds/leds-pca9532.c
4547F: include/linux/leds-pca9532.h 3921F: include/linux/leds-pca9532.h
4548 3922
4549PCI ERROR RECOVERY 3923PCI ERROR RECOVERY
4550P: Linas Vepstas 3924M: Linas Vepstas <linas@austin.ibm.com>
4551M: linas@austin.ibm.com
4552L: linux-pci@vger.kernel.org 3925L: linux-pci@vger.kernel.org
4553S: Supported 3926S: Supported
4554F: Documentation/PCI/pci-error-recovery.txt 3927F: Documentation/PCI/pci-error-recovery.txt
4555F: Documentation/powerpc/eeh-pci-error-recovery.txt 3928F: Documentation/powerpc/eeh-pci-error-recovery.txt
4556 3929
4557PCI SUBSYSTEM 3930PCI SUBSYSTEM
4558P: Jesse Barnes 3931M: Jesse Barnes <jbarnes@virtuousgeek.org>
4559M: jbarnes@virtuousgeek.org
4560L: linux-pci@vger.kernel.org 3932L: linux-pci@vger.kernel.org
4561T: git git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git 3933T: git git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git
4562S: Supported 3934S: Supported
@@ -4565,8 +3937,7 @@ F: drivers/pci/
4565F: include/linux/pci* 3937F: include/linux/pci*
4566 3938
4567PCIE HOTPLUG DRIVER 3939PCIE HOTPLUG DRIVER
4568P: Kristen Carlson Accardi 3940M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
4569M: kristen.c.accardi@intel.com
4570L: linux-pci@vger.kernel.org 3941L: linux-pci@vger.kernel.org
4571S: Supported 3942S: Supported
4572F: drivers/pci/pcie/ 3943F: drivers/pci/pcie/
@@ -4582,121 +3953,103 @@ F: drivers/pcmcia/
4582F: include/pcmcia/ 3953F: include/pcmcia/
4583 3954
4584PCNET32 NETWORK DRIVER 3955PCNET32 NETWORK DRIVER
4585P: Don Fry 3956M: Don Fry <pcnet32@verizon.net>
4586M: pcnet32@verizon.net
4587L: netdev@vger.kernel.org 3957L: netdev@vger.kernel.org
4588S: Maintained 3958S: Maintained
4589F: drivers/net/pcnet32.c 3959F: drivers/net/pcnet32.c
4590 3960
4591PER-TASK DELAY ACCOUNTING 3961PER-TASK DELAY ACCOUNTING
4592P: Balbir Singh 3962M: Balbir Singh <balbir@linux.vnet.ibm.com>
4593M: balbir@linux.vnet.ibm.com
4594S: Maintained 3963S: Maintained
4595F: include/linux/delayacct.h 3964F: include/linux/delayacct.h
4596F: kernel/delayacct.c 3965F: kernel/delayacct.c
4597 3966
4598PERFORMANCE COUNTER SUBSYSTEM 3967PERFORMANCE COUNTER SUBSYSTEM
4599P: Peter Zijlstra 3968M: Peter Zijlstra <a.p.zijlstra@chello.nl>
4600M: a.p.zijlstra@chello.nl 3969M: Paul Mackerras <paulus@samba.org>
4601P: Paul Mackerras 3970M: Ingo Molnar <mingo@elte.hu>
4602M: paulus@samba.org
4603P: Ingo Molnar
4604M: mingo@elte.hu
4605L: linux-kernel@vger.kernel.org
4606S: Supported 3971S: Supported
4607 3972
4608PERSONALITY HANDLING 3973PERSONALITY HANDLING
4609P: Christoph Hellwig 3974M: Christoph Hellwig <hch@infradead.org>
4610M: hch@infradead.org
4611L: linux-abi-devel@lists.sourceforge.net 3975L: linux-abi-devel@lists.sourceforge.net
4612S: Maintained 3976S: Maintained
4613F: include/linux/personality.h 3977F: include/linux/personality.h
4614 3978
4615PHRAM MTD DRIVER 3979PHRAM MTD DRIVER
4616P: Joern Engel 3980M: Joern Engel <joern@lazybastard.org>
4617M: joern@lazybastard.org
4618L: linux-mtd@lists.infradead.org 3981L: linux-mtd@lists.infradead.org
4619S: Maintained 3982S: Maintained
4620F: drivers/mtd/devices/phram.c 3983F: drivers/mtd/devices/phram.c
4621 3984
4622PKTCDVD DRIVER 3985PKTCDVD DRIVER
4623P: Peter Osterlund 3986M: Peter Osterlund <petero2@telia.com>
4624M: petero2@telia.com
4625S: Maintained 3987S: Maintained
4626F: drivers/block/pktcdvd.c 3988F: drivers/block/pktcdvd.c
4627F: include/linux/pktcdvd.h 3989F: include/linux/pktcdvd.h
4628 3990
4629POSIX CLOCKS and TIMERS 3991POSIX CLOCKS and TIMERS
4630P: Thomas Gleixner 3992M: Thomas Gleixner <tglx@linutronix.de>
4631M: tglx@linutronix.de
4632S: Supported 3993S: Supported
4633F: fs/timerfd.c 3994F: fs/timerfd.c
4634F: include/linux/timer* 3995F: include/linux/timer*
4635F: kernel/*timer* 3996F: kernel/*timer*
4636 3997
4637POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS 3998POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
4638P: Anton Vorontsov 3999M: Anton Vorontsov <cbou@mail.ru>
4639M: cbou@mail.ru 4000M: David Woodhouse <dwmw2@infradead.org>
4640P: David Woodhouse
4641M: dwmw2@infradead.org
4642T: git git://git.infradead.org/battery-2.6.git 4001T: git git://git.infradead.org/battery-2.6.git
4643S: Maintained 4002S: Maintained
4644F: include/linux/power_supply.h 4003F: include/linux/power_supply.h
4645F: drivers/power/power_supply* 4004F: drivers/power/power_supply*
4646 4005
4647PNP SUPPORT 4006PNP SUPPORT
4648P: Adam Belay 4007M: Adam Belay <abelay@mit.edu>
4649M: abelay@mit.edu 4008M: Bjorn Helgaas <bjorn.helgaas@hp.com>
4650P: Bjorn Helgaas
4651M: bjorn.helgaas@hp.com
4652S: Maintained 4009S: Maintained
4653F: drivers/pnp/ 4010F: drivers/pnp/
4654 4011
4655PNXxxxx I2C DRIVER 4012PNXxxxx I2C DRIVER
4656P: Vitaly Wool 4013M: Vitaly Wool <vitalywool@gmail.com>
4657M: vitalywool@gmail.com
4658L: linux-i2c@vger.kernel.org 4014L: linux-i2c@vger.kernel.org
4659S: Maintained 4015S: Maintained
4660F: drivers/i2c/busses/i2c-pnx.c 4016F: drivers/i2c/busses/i2c-pnx.c
4661 4017
4662PPP PROTOCOL DRIVERS AND COMPRESSORS 4018PPP PROTOCOL DRIVERS AND COMPRESSORS
4663P: Paul Mackerras 4019M: Paul Mackerras <paulus@samba.org>
4664M: paulus@samba.org
4665L: linux-ppp@vger.kernel.org 4020L: linux-ppp@vger.kernel.org
4666S: Maintained 4021S: Maintained
4667F: drivers/net/ppp_* 4022F: drivers/net/ppp_*
4668 4023
4669PPP OVER ATM (RFC 2364) 4024PPP OVER ATM (RFC 2364)
4670P: Mitchell Blank Jr 4025M: Mitchell Blank Jr <mitch@sfgoth.com>
4671M: mitch@sfgoth.com
4672S: Maintained 4026S: Maintained
4673F: net/atm/pppoatm.c 4027F: net/atm/pppoatm.c
4674F: include/linux/atmppp.h 4028F: include/linux/atmppp.h
4675 4029
4676PPP OVER ETHERNET 4030PPP OVER ETHERNET
4677P: Michal Ostrowski 4031M: Michal Ostrowski <mostrows@earthlink.net>
4678M: mostrows@earthlink.net
4679S: Maintained 4032S: Maintained
4680F: drivers/net/pppoe.c 4033F: drivers/net/pppoe.c
4681F: drivers/net/pppox.c 4034F: drivers/net/pppox.c
4682 4035
4683PPP OVER L2TP 4036PPP OVER L2TP
4684P: James Chapman 4037M: James Chapman <jchapman@katalix.com>
4685M: jchapman@katalix.com
4686S: Maintained 4038S: Maintained
4687F: drivers/net/pppol2tp.c 4039F: drivers/net/pppol2tp.c
4688F: include/linux/if_pppol2tp.h 4040F: include/linux/if_pppol2tp.h
4689 4041
4690PPS SUPPORT 4042PPS SUPPORT
4691P: Rodolfo Giometti 4043M: Rodolfo Giometti <giometti@enneenne.com>
4692M: giometti@enneenne.com
4693W: http://wiki.enneenne.com/index.php/LinuxPPS_support 4044W: http://wiki.enneenne.com/index.php/LinuxPPS_support
4694L: linuxpps@ml.enneenne.com (subscribers-only) 4045L: linuxpps@ml.enneenne.com (subscribers-only)
4695S: Maintained 4046S: Maintained
4047F: Documentation/pps/
4048F: drivers/pps/
4049F: include/linux/pps*.h
4696 4050
4697PREEMPTIBLE KERNEL 4051PREEMPTIBLE KERNEL
4698P: Robert Love 4052M: Robert Love <rml@tech9.net>
4699M: rml@tech9.net
4700L: kpreempt-tech@lists.sourceforge.net 4053L: kpreempt-tech@lists.sourceforge.net
4701W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel 4054W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel
4702S: Supported 4055S: Supported
@@ -4704,37 +4057,32 @@ F: Documentation/preempt-locking.txt
4704F: include/linux/preempt.h 4057F: include/linux/preempt.h
4705 4058
4706PRISM54 WIRELESS DRIVER 4059PRISM54 WIRELESS DRIVER
4707P: Luis R. Rodriguez 4060M: "Luis R. Rodriguez" <mcgrof@gmail.com>
4708M: mcgrof@gmail.com
4709L: linux-wireless@vger.kernel.org 4061L: linux-wireless@vger.kernel.org
4710W: http://prism54.org 4062W: http://prism54.org
4711S: Maintained 4063S: Maintained
4712F: drivers/net/wireless/prism54/ 4064F: drivers/net/wireless/prism54/
4713 4065
4714PROMISE DC4030 CACHING DISK CONTROLLER DRIVER 4066PROMISE DC4030 CACHING DISK CONTROLLER DRIVER
4715P: Peter Denison 4067M: Peter Denison <promise@pnd-pc.demon.co.uk>
4716M: promise@pnd-pc.demon.co.uk
4717W: http://www.pnd-pc.demon.co.uk/promise/ 4068W: http://www.pnd-pc.demon.co.uk/promise/
4718S: Maintained 4069S: Maintained
4719 4070
4720PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER 4071PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER
4721P: Mikael Pettersson 4072M: Mikael Pettersson <mikpe@it.uu.se>
4722M: mikpe@it.uu.se
4723L: linux-ide@vger.kernel.org 4073L: linux-ide@vger.kernel.org
4724S: Maintained 4074S: Maintained
4725F: drivers/ata/sata_promise.* 4075F: drivers/ata/sata_promise.*
4726 4076
4727PS3 NETWORK SUPPORT 4077PS3 NETWORK SUPPORT
4728P: Geoff Levand 4078M: Geoff Levand <geoffrey.levand@am.sony.com>
4729M: geoffrey.levand@am.sony.com
4730L: netdev@vger.kernel.org 4079L: netdev@vger.kernel.org
4731L: cbe-oss-dev@ozlabs.org 4080L: cbe-oss-dev@ozlabs.org
4732S: Supported 4081S: Supported
4733F: drivers/net/ps3_gelic_net.* 4082F: drivers/net/ps3_gelic_net.*
4734 4083
4735PS3 PLATFORM SUPPORT 4084PS3 PLATFORM SUPPORT
4736P: Geoff Levand 4085M: Geoff Levand <geoffrey.levand@am.sony.com>
4737M: geoffrey.levand@am.sony.com
4738L: linuxppc-dev@ozlabs.org 4086L: linuxppc-dev@ozlabs.org
4739L: cbe-oss-dev@ozlabs.org 4087L: cbe-oss-dev@ozlabs.org
4740S: Supported 4088S: Supported
@@ -4749,16 +4097,13 @@ F: drivers/usb/host/*ps3.c
4749F: sound/ppc/snd_ps3* 4097F: sound/ppc/snd_ps3*
4750 4098
4751PS3VRAM DRIVER 4099PS3VRAM DRIVER
4752P: Jim Paris 4100M: Jim Paris <jim@jtan.com>
4753M: jim@jtan.com
4754L: cbe-oss-dev@ozlabs.org 4101L: cbe-oss-dev@ozlabs.org
4755S: Maintained 4102S: Maintained
4756 4103
4757PTRACE SUPPORT 4104PTRACE SUPPORT
4758P: Roland McGrath 4105M: Roland McGrath <roland@redhat.com>
4759M: roland@redhat.com 4106M: Oleg Nesterov <oleg@redhat.com>
4760P: Oleg Nesterov
4761M: oleg@redhat.com
4762S: Maintained 4107S: Maintained
4763F: include/asm-generic/syscall.h 4108F: include/asm-generic/syscall.h
4764F: include/linux/ptrace.h 4109F: include/linux/ptrace.h
@@ -4767,8 +4112,7 @@ F: include/linux/tracehook.h
4767F: kernel/ptrace.c 4112F: kernel/ptrace.c
4768 4113
4769PVRUSB2 VIDEO4LINUX DRIVER 4114PVRUSB2 VIDEO4LINUX DRIVER
4770P: Mike Isely 4115M: Mike Isely <isely@pobox.com>
4771M: isely@pobox.com
4772L: pvrusb2@isely.net (subscribers-only) 4116L: pvrusb2@isely.net (subscribers-only)
4773L: linux-media@vger.kernel.org 4117L: linux-media@vger.kernel.org
4774W: http://www.isely.net/pvrusb2/ 4118W: http://www.isely.net/pvrusb2/
@@ -4778,10 +4122,8 @@ F: Documentation/video4linux/README.pvrusb2
4778F: drivers/media/video/pvrusb2/ 4122F: drivers/media/video/pvrusb2/
4779 4123
4780PXA2xx/PXA3xx SUPPORT 4124PXA2xx/PXA3xx SUPPORT
4781P: Eric Miao 4125M: Eric Miao <eric.y.miao@gmail.com>
4782M: eric.y.miao@gmail.com 4126M: Russell King <linux@arm.linux.org.uk>
4783P: Russell King
4784M: linux@arm.linux.org.uk
4785L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4127L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4786S: Maintained 4128S: Maintained
4787F: arch/arm/mach-pxa/ 4129F: arch/arm/mach-pxa/
@@ -4793,17 +4135,14 @@ F: sound/arm/pxa*
4793F: sound/soc/pxa 4135F: sound/soc/pxa
4794 4136
4795PXA168 SUPPORT 4137PXA168 SUPPORT
4796P: Eric Miao 4138M: Eric Miao <eric.y.miao@gmail.com>
4797M: eric.y.miao@gmail.com 4139M: Jason Chagas <jason.chagas@marvell.com>
4798P: Jason Chagas
4799M: jason.chagas@marvell.com
4800L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4140L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4801T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4141T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
4802S: Maintained 4142S: Maintained
4803 4143
4804PXA910 SUPPORT 4144PXA910 SUPPORT
4805P: Eric Miao 4145M: Eric Miao <eric.y.miao@gmail.com>
4806M: eric.y.miao@gmail.com
4807L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4146L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4808T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4147T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
4809S: Maintained 4148S: Maintained
@@ -4812,13 +4151,12 @@ PXA MMCI DRIVER
4812S: Orphan 4151S: Orphan
4813 4152
4814PXA RTC DRIVER 4153PXA RTC DRIVER
4815P: Robert Jarzmik 4154M: Robert Jarzmik <robert.jarzmik@free.fr>
4816M: robert.jarzmik@free.fr
4817L: rtc-linux@googlegroups.com 4155L: rtc-linux@googlegroups.com
4818S: Maintained 4156S: Maintained
4819 4157
4820QLOGIC QLA2XXX FC-SCSI DRIVER 4158QLOGIC QLA2XXX FC-SCSI DRIVER
4821P: Andrew Vasquez 4159M: Andrew Vasquez <andrew.vasquez@qlogic.com>
4822M: linux-driver@qlogic.com 4160M: linux-driver@qlogic.com
4823L: linux-scsi@vger.kernel.org 4161L: linux-scsi@vger.kernel.org
4824S: Supported 4162S: Supported
@@ -4826,7 +4164,7 @@ F: Documentation/scsi/LICENSE.qla2xxx
4826F: drivers/scsi/qla2xxx/ 4164F: drivers/scsi/qla2xxx/
4827 4165
4828QLOGIC QLA3XXX NETWORK DRIVER 4166QLOGIC QLA3XXX NETWORK DRIVER
4829P: Ron Mercer 4167M: Ron Mercer <ron.mercer@qlogic.com>
4830M: linux-driver@qlogic.com 4168M: linux-driver@qlogic.com
4831L: netdev@vger.kernel.org 4169L: netdev@vger.kernel.org
4832S: Supported 4170S: Supported
@@ -4834,16 +4172,14 @@ F: Documentation/networking/LICENSE.qla3xxx
4834F: drivers/net/qla3xxx.* 4172F: drivers/net/qla3xxx.*
4835 4173
4836QLOGIC QLGE 10Gb ETHERNET DRIVER 4174QLOGIC QLGE 10Gb ETHERNET DRIVER
4837P: Ron Mercer 4175M: Ron Mercer <ron.mercer@qlogic.com>
4838M: linux-driver@qlogic.com 4176M: linux-driver@qlogic.com
4839M: ron.mercer@qlogic.com
4840L: netdev@vger.kernel.org 4177L: netdev@vger.kernel.org
4841S: Supported 4178S: Supported
4842F: drivers/net/qlge/ 4179F: drivers/net/qlge/
4843 4180
4844QNX4 FILESYSTEM 4181QNX4 FILESYSTEM
4845P: Anders Larsen 4182M: Anders Larsen <al@alarsen.net>
4846M: al@alarsen.net
4847W: http://www.alarsen.net/linux/qnx4fs/ 4183W: http://www.alarsen.net/linux/qnx4fs/
4848S: Maintained 4184S: Maintained
4849F: fs/qnx4/ 4185F: fs/qnx4/
@@ -4851,16 +4187,14 @@ F: include/linux/qnx4_fs.h
4851F: include/linux/qnxtypes.h 4187F: include/linux/qnxtypes.h
4852 4188
4853RADEON FRAMEBUFFER DISPLAY DRIVER 4189RADEON FRAMEBUFFER DISPLAY DRIVER
4854P: Benjamin Herrenschmidt 4190M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4855M: benh@kernel.crashing.org
4856L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4191L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4857S: Maintained 4192S: Maintained
4858F: drivers/video/aty/radeon* 4193F: drivers/video/aty/radeon*
4859F: include/linux/radeonfb.h 4194F: include/linux/radeonfb.h
4860 4195
4861RAGE128 FRAMEBUFFER DISPLAY DRIVER 4196RAGE128 FRAMEBUFFER DISPLAY DRIVER
4862P: Paul Mackerras 4197M: Paul Mackerras <paulus@samba.org>
4863M: paulus@samba.org
4864L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4198L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4865S: Maintained 4199S: Maintained
4866F: drivers/video/aty/aty128fb.c 4200F: drivers/video/aty/aty128fb.c
@@ -4875,64 +4209,53 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git
4875F: drivers/net/wireless/rt2x00/ 4209F: drivers/net/wireless/rt2x00/
4876 4210
4877RAMDISK RAM BLOCK DEVICE DRIVER 4211RAMDISK RAM BLOCK DEVICE DRIVER
4878P: Nick Piggin 4212M: Nick Piggin <npiggin@suse.de>
4879M: npiggin@suse.de
4880S: Maintained 4213S: Maintained
4881F: Documentation/blockdev/ramdisk.txt 4214F: Documentation/blockdev/ramdisk.txt
4882F: drivers/block/brd.c 4215F: drivers/block/brd.c
4883 4216
4884RANDOM NUMBER DRIVER 4217RANDOM NUMBER DRIVER
4885P: Matt Mackall 4218M: Matt Mackall <mpm@selenic.com>
4886M: mpm@selenic.com
4887S: Maintained 4219S: Maintained
4888F: drivers/char/random.c 4220F: drivers/char/random.c
4889 4221
4890RAPIDIO SUBSYSTEM 4222RAPIDIO SUBSYSTEM
4891P: Matt Porter 4223M: Matt Porter <mporter@kernel.crashing.org>
4892M: mporter@kernel.crashing.org
4893S: Maintained 4224S: Maintained
4894F: drivers/rapidio/ 4225F: drivers/rapidio/
4895 4226
4896RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER 4227RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
4897P: Corey Thomas 4228M: Corey Thomas <coreythomas@charter.net>
4898M: coreythomas@charter.net
4899L: linux-wireless@vger.kernel.org 4229L: linux-wireless@vger.kernel.org
4900S: Maintained 4230S: Maintained
4901F: drivers/net/wireless/ray* 4231F: drivers/net/wireless/ray*
4902 4232
4903RCUTORTURE MODULE 4233RCUTORTURE MODULE
4904P: Josh Triplett 4234M: Josh Triplett <josh@freedesktop.org>
4905M: josh@freedesktop.org 4235M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
4906P: Paul E. McKenney
4907M: paulmck@linux.vnet.ibm.com
4908S: Maintained 4236S: Maintained
4909F: Documentation/RCU/torture.txt 4237F: Documentation/RCU/torture.txt
4910F: kernel/rcutorture.c 4238F: kernel/rcutorture.c
4911 4239
4912RDC R-321X SoC 4240RDC R-321X SoC
4913P: Florian Fainelli 4241M: Florian Fainelli <florian@openwrt.org>
4914M: florian@openwrt.org
4915S: Maintained 4242S: Maintained
4916 4243
4917RDC R6040 FAST ETHERNET DRIVER 4244RDC R6040 FAST ETHERNET DRIVER
4918P: Florian Fainelli 4245M: Florian Fainelli <florian@openwrt.org>
4919M: florian@openwrt.org
4920L: netdev@vger.kernel.org 4246L: netdev@vger.kernel.org
4921S: Maintained 4247S: Maintained
4922F: drivers/net/r6040.c 4248F: drivers/net/r6040.c
4923 4249
4924RDS - RELIABLE DATAGRAM SOCKETS 4250RDS - RELIABLE DATAGRAM SOCKETS
4925P: Andy Grover 4251M: Andy Grover <andy.grover@oracle.com>
4926M: andy.grover@oracle.com
4927L: rds-devel@oss.oracle.com (moderated for non-subscribers) 4252L: rds-devel@oss.oracle.com (moderated for non-subscribers)
4928S: Supported 4253S: Supported
4929F: net/rds/ 4254F: net/rds/
4930 4255
4931READ-COPY UPDATE (RCU) 4256READ-COPY UPDATE (RCU)
4932P: Dipankar Sarma 4257M: Dipankar Sarma <dipankar@in.ibm.com>
4933M: dipankar@in.ibm.com 4258M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
4934P: Paul E. McKenney
4935M: paulmck@linux.vnet.ibm.com
4936W: http://www.rdrop.com/users/paulmck/rclock/ 4259W: http://www.rdrop.com/users/paulmck/rclock/
4937S: Supported 4260S: Supported
4938F: Documentation/RCU/rcu.txt 4261F: Documentation/RCU/rcu.txt
@@ -4942,16 +4265,14 @@ F: include/linux/srcu.h
4942F: kernel/rcupdate.c 4265F: kernel/rcupdate.c
4943 4266
4944REAL TIME CLOCK DRIVER 4267REAL TIME CLOCK DRIVER
4945P: Paul Gortmaker 4268M: Paul Gortmaker <p_gortmaker@yahoo.com>
4946M: p_gortmaker@yahoo.com
4947S: Maintained 4269S: Maintained
4948F: Documentation/rtc.txt 4270F: Documentation/rtc.txt
4949F: drivers/rtc/ 4271F: drivers/rtc/
4950F: include/linux/rtc.h 4272F: include/linux/rtc.h
4951 4273
4952REAL TIME CLOCK (RTC) SUBSYSTEM 4274REAL TIME CLOCK (RTC) SUBSYSTEM
4953P: Alessandro Zummo 4275M: Alessandro Zummo <a.zummo@towertech.it>
4954M: a.zummo@towertech.it
4955L: rtc-linux@googlegroups.com 4276L: rtc-linux@googlegroups.com
4956S: Maintained 4277S: Maintained
4957F: Documentation/rtc.txt 4278F: Documentation/rtc.txt
@@ -4964,8 +4285,7 @@ S: Supported
4964F: fs/reiserfs/ 4285F: fs/reiserfs/
4965 4286
4966RFKILL 4287RFKILL
4967P: Johannes Berg 4288M: Johannes Berg <johannes@sipsolutions.net>
4968M: johannes@sipsolutions.net
4969L: linux-wireless@vger.kernel.org 4289L: linux-wireless@vger.kernel.org
4970S: Maintained 4290S: Maintained
4971F Documentation/rfkill.txt 4291F Documentation/rfkill.txt
@@ -4984,8 +4304,7 @@ F: Documentation/serial/rocket.txt
4984F: drivers/char/rocket* 4304F: drivers/char/rocket*
4985 4305
4986ROSE NETWORK LAYER 4306ROSE NETWORK LAYER
4987P: Ralf Baechle 4307M: Ralf Baechle <ralf@linux-mips.org>
4988M: ralf@linux-mips.org
4989L: linux-hams@vger.kernel.org 4308L: linux-hams@vger.kernel.org
4990W: http://www.linux-ax25.org/ 4309W: http://www.linux-ax25.org/
4991S: Maintained 4310S: Maintained
@@ -4994,8 +4313,7 @@ F: include/net/rose.h
4994F: net/rose/ 4313F: net/rose/
4995 4314
4996RTL8180 WIRELESS DRIVER 4315RTL8180 WIRELESS DRIVER
4997P: John W. Linville 4316M: "John W. Linville" <linville@tuxdriver.com>
4998M: linville@tuxdriver.com
4999L: linux-wireless@vger.kernel.org 4317L: linux-wireless@vger.kernel.org
5000W: http://linuxwireless.org/ 4318W: http://linuxwireless.org/
5001T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git 4319T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
@@ -5003,12 +4321,9 @@ S: Maintained
5003F: drivers/net/wireless/rtl818* 4321F: drivers/net/wireless/rtl818*
5004 4322
5005RTL8187 WIRELESS DRIVER 4323RTL8187 WIRELESS DRIVER
5006P: Herton Ronaldo Krzesinski 4324M: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
5007M: herton@mandriva.com.br 4325M: Hin-Tak Leung <htl10@users.sourceforge.net>
5008P: Hin-Tak Leung 4326M: Larry Finger <Larry.Finger@lwfinger.net>
5009M: htl10@users.sourceforge.net
5010P: Larry Finger
5011M: Larry.Finger@lwfinger.net
5012L: linux-wireless@vger.kernel.org 4327L: linux-wireless@vger.kernel.org
5013W: http://linuxwireless.org/ 4328W: http://linuxwireless.org/
5014T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git 4329T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
@@ -5016,17 +4331,14 @@ S: Maintained
5016F: drivers/net/wireless/rtl818x/rtl8187* 4331F: drivers/net/wireless/rtl818x/rtl8187*
5017 4332
5018S3 SAVAGE FRAMEBUFFER DRIVER 4333S3 SAVAGE FRAMEBUFFER DRIVER
5019P: Antonino Daplas 4334M: Antonino Daplas <adaplas@gmail.com>
5020M: adaplas@gmail.com
5021L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4335L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
5022S: Maintained 4336S: Maintained
5023F: drivers/video/savage/ 4337F: drivers/video/savage/
5024 4338
5025S390 4339S390
5026P: Martin Schwidefsky 4340M: Martin Schwidefsky <schwidefsky@de.ibm.com>
5027M: schwidefsky@de.ibm.com 4341M: Heiko Carstens <heiko.carstens@de.ibm.com>
5028P: Heiko Carstens
5029M: heiko.carstens@de.ibm.com
5030M: linux390@de.ibm.com 4342M: linux390@de.ibm.com
5031L: linux-s390@vger.kernel.org 4343L: linux-s390@vger.kernel.org
5032W: http://www.ibm.com/developerworks/linux/linux390/ 4344W: http://www.ibm.com/developerworks/linux/linux390/
@@ -5034,10 +4346,8 @@ S: Supported
5034F: arch/s390/ 4346F: arch/s390/
5035 4347
5036S390 NETWORK DRIVERS 4348S390 NETWORK DRIVERS
5037P: Ursula Braun 4349M: Ursula Braun <ursula.braun@de.ibm.com>
5038M: ursula.braun@de.ibm.com 4350M: Frank Blaschka <blaschka@linux.vnet.ibm.com>
5039P: Frank Blaschka
5040M: blaschka@linux.vnet.ibm.com
5041M: linux390@de.ibm.com 4351M: linux390@de.ibm.com
5042L: linux-s390@vger.kernel.org 4352L: linux-s390@vger.kernel.org
5043W: http://www.ibm.com/developerworks/linux/linux390/ 4353W: http://www.ibm.com/developerworks/linux/linux390/
@@ -5045,20 +4355,16 @@ S: Supported
5045F: drivers/s390/net/ 4355F: drivers/s390/net/
5046 4356
5047S390 ZCRYPT DRIVER 4357S390 ZCRYPT DRIVER
5048P: Felix Beck 4358M: Felix Beck <felix.beck@de.ibm.com>
5049M: felix.beck@de.ibm.com 4359M: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
5050P: Ralph Wuerthner
5051M: ralph.wuerthner@de.ibm.com
5052M: linux390@de.ibm.com 4360M: linux390@de.ibm.com
5053L: linux-s390@vger.kernel.org 4361L: linux-s390@vger.kernel.org
5054S: Supported 4362S: Supported
5055F: drivers/s390/crypto/ 4363F: drivers/s390/crypto/
5056 4364
5057S390 ZFCP DRIVER 4365S390 ZFCP DRIVER
5058P: Christof Schmitt 4366M: Christof Schmitt <christof.schmitt@de.ibm.com>
5059M: christof.schmitt@de.ibm.com 4367M: Martin Peschke <mp3@de.ibm.com>
5060P: Martin Peschke
5061M: mp3@de.ibm.com
5062M: linux390@de.ibm.com 4368M: linux390@de.ibm.com
5063L: linux-s390@vger.kernel.org 4369L: linux-s390@vger.kernel.org
5064W: http://www.ibm.com/developerworks/linux/linux390/ 4370W: http://www.ibm.com/developerworks/linux/linux390/
@@ -5067,8 +4373,7 @@ F: Documentation/s390/zfcpdump.txt
5067F: drivers/s390/scsi/zfcp_* 4373F: drivers/s390/scsi/zfcp_*
5068 4374
5069S390 IUCV NETWORK LAYER 4375S390 IUCV NETWORK LAYER
5070P: Ursula Braun 4376M: Ursula Braun <ursula.braun@de.ibm.com>
5071M: ursula.braun@de.ibm.com
5072M: linux390@de.ibm.com 4377M: linux390@de.ibm.com
5073L: linux-s390@vger.kernel.org 4378L: linux-s390@vger.kernel.org
5074W: http://www.ibm.com/developerworks/linux/linux390/ 4379W: http://www.ibm.com/developerworks/linux/linux390/
@@ -5078,15 +4383,13 @@ F: include/net/iucv/
5078F: net/iucv/ 4383F: net/iucv/
5079 4384
5080S3C24XX SD/MMC Driver 4385S3C24XX SD/MMC Driver
5081P: Ben Dooks 4386M: Ben Dooks <ben-linux@fluff.org>
5082M: ben-linux@fluff.org
5083L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4387L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
5084S: Supported 4388S: Supported
5085F: drivers/mmc/host/s3cmci.* 4389F: drivers/mmc/host/s3cmci.*
5086 4390
5087SAA7146 VIDEO4LINUX-2 DRIVER 4391SAA7146 VIDEO4LINUX-2 DRIVER
5088P: Michael Hunold 4392M: Michael Hunold <michael@mihu.de>
5089M: michael@mihu.de
5090L: linux-media@vger.kernel.org 4393L: linux-media@vger.kernel.org
5091T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4394T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
5092W: http://www.mihu.de/linux/saa7146 4395W: http://www.mihu.de/linux/saa7146
@@ -5096,31 +4399,26 @@ F: drivers/media/video/*7146*
5096F: include/media/*7146* 4399F: include/media/*7146*
5097 4400
5098SC1200 WDT DRIVER 4401SC1200 WDT DRIVER
5099P: Zwane Mwaikambo 4402M: Zwane Mwaikambo <zwane@arm.linux.org.uk>
5100M: zwane@arm.linux.org.uk
5101S: Maintained 4403S: Maintained
5102F: drivers/watchdog/sc1200wdt.c 4404F: drivers/watchdog/sc1200wdt.c
5103 4405
5104SCHEDULER 4406SCHEDULER
5105P: Ingo Molnar 4407M: Ingo Molnar <mingo@elte.hu>
5106M: mingo@elte.hu 4408M: Peter Zijlstra <peterz@infradead.org>
5107P: Peter Zijlstra
5108M: peterz@infradead.org
5109S: Maintained 4409S: Maintained
5110F: kernel/sched* 4410F: kernel/sched*
5111F: include/linux/sched.h 4411F: include/linux/sched.h
5112 4412
5113SCSI CDROM DRIVER 4413SCSI CDROM DRIVER
5114P: Jens Axboe 4414M: Jens Axboe <axboe@kernel.dk>
5115M: axboe@kernel.dk
5116L: linux-scsi@vger.kernel.org 4415L: linux-scsi@vger.kernel.org
5117W: http://www.kernel.dk 4416W: http://www.kernel.dk
5118S: Maintained 4417S: Maintained
5119F: drivers/scsi/sr* 4418F: drivers/scsi/sr*
5120 4419
5121SCSI SG DRIVER 4420SCSI SG DRIVER
5122P: Doug Gilbert 4421M: Doug Gilbert <dgilbert@interlog.com>
5123M: dgilbert@interlog.com
5124L: linux-scsi@vger.kernel.org 4422L: linux-scsi@vger.kernel.org
5125W: http://www.torque.net/sg 4423W: http://www.torque.net/sg
5126S: Maintained 4424S: Maintained
@@ -5128,8 +4426,7 @@ F: drivers/scsi/sg.c
5128F: include/scsi/sg.h 4426F: include/scsi/sg.h
5129 4427
5130SCSI SUBSYSTEM 4428SCSI SUBSYSTEM
5131P: James E.J. Bottomley 4429M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
5132M: James.Bottomley@HansenPartnership.com
5133L: linux-scsi@vger.kernel.org 4430L: linux-scsi@vger.kernel.org
5134T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 4431T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
5135T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git 4432T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
@@ -5139,18 +4436,15 @@ F: drivers/scsi/
5139F: include/scsi/ 4436F: include/scsi/
5140 4437
5141SCSI TAPE DRIVER 4438SCSI TAPE DRIVER
5142P: Kai Mäkisara 4439M: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
5143M: Kai.Makisara@kolumbus.fi
5144L: linux-scsi@vger.kernel.org 4440L: linux-scsi@vger.kernel.org
5145S: Maintained 4441S: Maintained
5146F: Documentation/scsi/st.txt 4442F: Documentation/scsi/st.txt
5147F: drivers/scsi/st* 4443F: drivers/scsi/st*
5148 4444
5149SCTP PROTOCOL 4445SCTP PROTOCOL
5150P: Vlad Yasevich 4446M: Vlad Yasevich <vladislav.yasevich@hp.com>
5151M: vladislav.yasevich@hp.com 4447M: Sridhar Samudrala <sri@us.ibm.com>
5152P: Sridhar Samudrala
5153M: sri@us.ibm.com
5154L: linux-sctp@vger.kernel.org 4448L: linux-sctp@vger.kernel.org
5155W: http://lksctp.sourceforge.net 4449W: http://lksctp.sourceforge.net
5156S: Supported 4450S: Supported
@@ -5160,8 +4454,7 @@ F: include/net/sctp/
5160F: net/sctp/ 4454F: net/sctp/
5161 4455
5162SCx200 CPU SUPPORT 4456SCx200 CPU SUPPORT
5163P: Jim Cromie 4457M: Jim Cromie <jim.cromie@gmail.com>
5164M: jim.cromie@gmail.com
5165S: Odd Fixes 4458S: Odd Fixes
5166F: Documentation/i2c/busses/scx200_acb 4459F: Documentation/i2c/busses/scx200_acb
5167F: arch/x86/kernel/scx200_32.c 4460F: arch/x86/kernel/scx200_32.c
@@ -5171,49 +4464,42 @@ F: drivers/mtd/maps/scx200_docflash.c
5171F: include/linux/scx200.h 4464F: include/linux/scx200.h
5172 4465
5173SCx200 GPIO DRIVER 4466SCx200 GPIO DRIVER
5174P: Jim Cromie 4467M: Jim Cromie <jim.cromie@gmail.com>
5175M: jim.cromie@gmail.com
5176S: Maintained 4468S: Maintained
5177F: drivers/char/scx200_gpio.c 4469F: drivers/char/scx200_gpio.c
5178F: include/linux/scx200_gpio.h 4470F: include/linux/scx200_gpio.h
5179 4471
5180SCx200 HRT CLOCKSOURCE DRIVER 4472SCx200 HRT CLOCKSOURCE DRIVER
5181P: Jim Cromie 4473M: Jim Cromie <jim.cromie@gmail.com>
5182M: jim.cromie@gmail.com
5183S: Maintained 4474S: Maintained
5184F: drivers/clocksource/scx200_hrt.c 4475F: drivers/clocksource/scx200_hrt.c
5185 4476
5186SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER 4477SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER
5187P: Sascha Sommer 4478M: Sascha Sommer <saschasommer@freenet.de>
5188M: saschasommer@freenet.de
5189L: sdricohcs-devel@lists.sourceforge.net (subscribers-only) 4479L: sdricohcs-devel@lists.sourceforge.net (subscribers-only)
5190S: Maintained 4480S: Maintained
5191F: drivers/mmc/host/sdricoh_cs.c 4481F: drivers/mmc/host/sdricoh_cs.c
5192 4482
5193SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER 4483SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
5194P: Pierre Ossman 4484M: Pierre Ossman <pierre@ossman.eu>
5195M: pierre@ossman.eu
5196L: sdhci-devel@lists.ossman.eu 4485L: sdhci-devel@lists.ossman.eu
5197S: Maintained 4486S: Maintained
5198 4487
5199SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF) 4488SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
5200P: Anton Vorontsov 4489M: Anton Vorontsov <avorontsov@ru.mvista.com>
5201M: avorontsov@ru.mvista.com
5202L: linuxppc-dev@ozlabs.org 4490L: linuxppc-dev@ozlabs.org
5203L: sdhci-devel@lists.ossman.eu 4491L: sdhci-devel@lists.ossman.eu
5204S: Maintained 4492S: Maintained
5205F: drivers/mmc/host/sdhci.* 4493F: drivers/mmc/host/sdhci.*
5206 4494
5207SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER 4495SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER
5208P: Ben Dooks 4496M: Ben Dooks <ben-linux@fluff.org>
5209M: ben-linux@fluff.org
5210L: sdhci-devel@lists.ossman.eu 4497L: sdhci-devel@lists.ossman.eu
5211S: Maintained 4498S: Maintained
5212F: drivers/mmc/host/sdhci-s3c.c 4499F: drivers/mmc/host/sdhci-s3c.c
5213 4500
5214SECURITY SUBSYSTEM 4501SECURITY SUBSYSTEM
5215P: James Morris 4502M: James Morris <jmorris@namei.org>
5216M: jmorris@namei.org
5217L: linux-security-module@vger.kernel.org (suggested Cc:) 4503L: linux-security-module@vger.kernel.org (suggested Cc:)
5218T: git git://www.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4504T: git git://www.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
5219W: http://security.wiki.kernel.org/ 4505W: http://security.wiki.kernel.org/
@@ -5221,17 +4507,13 @@ S: Supported
5221F: security/ 4507F: security/
5222 4508
5223SECURITY CONTACT 4509SECURITY CONTACT
5224P: Security Officers 4510M: Security Officers <security@kernel.org>
5225M: security@kernel.org
5226S: Supported 4511S: Supported
5227 4512
5228SELINUX SECURITY MODULE 4513SELINUX SECURITY MODULE
5229P: Stephen Smalley 4514M: Stephen Smalley <sds@tycho.nsa.gov>
5230M: sds@tycho.nsa.gov 4515M: James Morris <jmorris@namei.org>
5231P: James Morris 4516M: Eric Paris <eparis@parisplace.org>
5232M: jmorris@namei.org
5233P: Eric Paris
5234M: eparis@parisplace.org
5235L: selinux@tycho.nsa.gov (subscribers-only, general discussion) 4517L: selinux@tycho.nsa.gov (subscribers-only, general discussion)
5236W: http://selinuxproject.org 4518W: http://selinuxproject.org
5237T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4519T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
@@ -5240,15 +4522,13 @@ F: include/linux/selinux*
5240F: security/selinux/ 4522F: security/selinux/
5241 4523
5242SENSABLE PHANTOM 4524SENSABLE PHANTOM
5243P: Jiri Slaby 4525M: Jiri Slaby <jirislaby@gmail.com>
5244M: jirislaby@gmail.com
5245S: Maintained 4526S: Maintained
5246F: drivers/misc/phantom.c 4527F: drivers/misc/phantom.c
5247F: include/linux/phantom.h 4528F: include/linux/phantom.h
5248 4529
5249SERIAL ATA (SATA) SUBSYSTEM 4530SERIAL ATA (SATA) SUBSYSTEM
5250P: Jeff Garzik 4531M: Jeff Garzik <jgarzik@pobox.com>
5251M: jgarzik@pobox.com
5252L: linux-ide@vger.kernel.org 4532L: linux-ide@vger.kernel.org
5253T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 4533T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
5254S: Supported 4534S: Supported
@@ -5257,10 +4537,8 @@ F: include/linux/ata.h
5257F: include/linux/libata.h 4537F: include/linux/libata.h
5258 4538
5259SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER 4539SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
5260P: Sathya Perla 4540M: Sathya Perla <sathyap@serverengines.com>
5261M: sathyap@serverengines.com 4541M: Subbu Seetharaman <subbus@serverengines.com>
5262P: Subbu Seetharaman
5263M: subbus@serverengines.com
5264L: netdev@vger.kernel.org 4542L: netdev@vger.kernel.org
5265W: http://www.serverengines.com 4543W: http://www.serverengines.com
5266S: Supported 4544S: Supported
@@ -5269,20 +4547,17 @@ F: drivers/net/benet/
5269SFC NETWORK DRIVER 4547SFC NETWORK DRIVER
5270P: Steve Hodgson 4548P: Steve Hodgson
5271P: Ben Hutchings 4549P: Ben Hutchings
5272P: Robert Stonehouse 4550M: Robert Stonehouse <linux-net-drivers@solarflare.com>
5273M: linux-net-drivers@solarflare.com
5274S: Supported 4551S: Supported
5275F: drivers/net/sfc/ 4552F: drivers/net/sfc/
5276 4553
5277SGI GRU DRIVER 4554SGI GRU DRIVER
5278P: Jack Steiner 4555M: Jack Steiner <steiner@sgi.com>
5279M: steiner@sgi.com
5280S: Maintained 4556S: Maintained
5281F: drivers/misc/sgi-gru/ 4557F: drivers/misc/sgi-gru/
5282 4558
5283SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER 4559SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER
5284P: Pat Gefre 4560M: Pat Gefre <pfg@sgi.com>
5285M: pfg@sgi.com
5286L: linux-ia64@vger.kernel.org 4561L: linux-ia64@vger.kernel.org
5287S: Supported 4562S: Supported
5288F: Documentation/ia64/serial.txt 4563F: Documentation/ia64/serial.txt
@@ -5290,22 +4565,19 @@ F: drivers/serial/ioc?_serial.c
5290F: include/linux/ioc?.h 4565F: include/linux/ioc?.h
5291 4566
5292SGI VISUAL WORKSTATION 320 AND 540 4567SGI VISUAL WORKSTATION 320 AND 540
5293P: Andrey Panin 4568M: Andrey Panin <pazke@donpac.ru>
5294M: pazke@donpac.ru
5295L: linux-visws-devel@lists.sf.net 4569L: linux-visws-devel@lists.sf.net
5296W: http://linux-visws.sf.net 4570W: http://linux-visws.sf.net
5297S: Maintained for 2.6. 4571S: Maintained for 2.6.
5298F: Documentation/sgi-visws.txt 4572F: Documentation/sgi-visws.txt
5299 4573
5300SGI XP/XPC/XPNET DRIVER 4574SGI XP/XPC/XPNET DRIVER
5301P: Robin Holt 4575M: Robin Holt <holt@sgi.com>
5302M: holt@sgi.com
5303S: Maintained 4576S: Maintained
5304F: drivers/misc/sgi-xp/ 4577F: drivers/misc/sgi-xp/
5305 4578
5306SHARP LH SUPPORT (LH7952X & LH7A40X) 4579SHARP LH SUPPORT (LH7952X & LH7A40X)
5307P: Marc Singer 4580M: Marc Singer <elf@buici.com>
5308M: elf@buici.com
5309W: http://projects.buici.com/arm 4581W: http://projects.buici.com/arm
5310L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4582L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
5311S: Maintained 4583S: Maintained
@@ -5316,23 +4588,20 @@ F: drivers/usb/gadget/lh7a40*
5316F: drivers/usb/host/ohci-lh7a40* 4588F: drivers/usb/host/ohci-lh7a40*
5317 4589
5318SHPC HOTPLUG DRIVER 4590SHPC HOTPLUG DRIVER
5319P: Kristen Carlson Accardi 4591M: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
5320M: kristen.c.accardi@intel.com
5321L: linux-pci@vger.kernel.org 4592L: linux-pci@vger.kernel.org
5322S: Supported 4593S: Supported
5323F: drivers/pci/hotplug/shpchp* 4594F: drivers/pci/hotplug/shpchp*
5324 4595
5325SIMTEC EB110ATX (Chalice CATS) 4596SIMTEC EB110ATX (Chalice CATS)
5326P: Ben Dooks 4597P: Ben Dooks
5327P: Vincent Sanders 4598M: Vincent Sanders <support@simtec.co.uk>
5328M: support@simtec.co.uk
5329W: http://www.simtec.co.uk/products/EB110ATX/ 4599W: http://www.simtec.co.uk/products/EB110ATX/
5330S: Supported 4600S: Supported
5331 4601
5332SIMTEC EB2410ITX (BAST) 4602SIMTEC EB2410ITX (BAST)
5333P: Ben Dooks 4603P: Ben Dooks
5334P: Vincent Sanders 4604M: Vincent Sanders <support@simtec.co.uk>
5335M: support@simtec.co.uk
5336W: http://www.simtec.co.uk/products/EB2410ITX/ 4605W: http://www.simtec.co.uk/products/EB2410ITX/
5337S: Supported 4606S: Supported
5338F: arch/arm/mach-s3c2410/ 4607F: arch/arm/mach-s3c2410/
@@ -5340,31 +4609,27 @@ F: drivers/*/*s3c2410*
5340F: drivers/*/*/*s3c2410* 4609F: drivers/*/*/*s3c2410*
5341 4610
5342SIS 190 ETHERNET DRIVER 4611SIS 190 ETHERNET DRIVER
5343P: Francois Romieu 4612M: Francois Romieu <romieu@fr.zoreil.com>
5344M: romieu@fr.zoreil.com
5345L: netdev@vger.kernel.org 4613L: netdev@vger.kernel.org
5346S: Maintained 4614S: Maintained
5347F: drivers/net/sis190.c 4615F: drivers/net/sis190.c
5348 4616
5349SIS 900/7016 FAST ETHERNET DRIVER 4617SIS 900/7016 FAST ETHERNET DRIVER
5350P: Daniele Venzano 4618M: Daniele Venzano <venza@brownhat.org>
5351M: venza@brownhat.org
5352W: http://www.brownhat.org/sis900.html 4619W: http://www.brownhat.org/sis900.html
5353L: netdev@vger.kernel.org 4620L: netdev@vger.kernel.org
5354S: Maintained 4621S: Maintained
5355F: drivers/net/sis900.* 4622F: drivers/net/sis900.*
5356 4623
5357SIS 96X I2C/SMBUS DRIVER 4624SIS 96X I2C/SMBUS DRIVER
5358P: Mark M. Hoffman 4625M: "Mark M. Hoffman" <mhoffman@lightlink.com>
5359M: mhoffman@lightlink.com
5360L: linux-i2c@vger.kernel.org 4626L: linux-i2c@vger.kernel.org
5361S: Maintained 4627S: Maintained
5362F: Documentation/i2c/busses/i2c-sis96x 4628F: Documentation/i2c/busses/i2c-sis96x
5363F: drivers/i2c/busses/i2c-sis96x.c 4629F: drivers/i2c/busses/i2c-sis96x.c
5364 4630
5365SIS FRAMEBUFFER DRIVER 4631SIS FRAMEBUFFER DRIVER
5366P: Thomas Winischhofer 4632M: Thomas Winischhofer <thomas@winischhofer.net>
5367M: thomas@winischhofer.net
5368W: http://www.winischhofer.net/linuxsisvga.shtml 4633W: http://www.winischhofer.net/linuxsisvga.shtml
5369S: Maintained 4634S: Maintained
5370F: Documentation/fb/sisfb.txt 4635F: Documentation/fb/sisfb.txt
@@ -5372,70 +4637,59 @@ F: drivers/video/sis/
5372F: include/video/sisfb.h 4637F: include/video/sisfb.h
5373 4638
5374SIS USB2VGA DRIVER 4639SIS USB2VGA DRIVER
5375P: Thomas Winischhofer 4640M: Thomas Winischhofer <thomas@winischhofer.net>
5376M: thomas@winischhofer.net
5377W: http://www.winischhofer.at/linuxsisusbvga.shtml 4641W: http://www.winischhofer.at/linuxsisusbvga.shtml
5378S: Maintained 4642S: Maintained
5379F: drivers/usb/misc/sisusbvga/ 4643F: drivers/usb/misc/sisusbvga/
5380 4644
5381SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS 4645SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS
5382P: Stephen Hemminger 4646M: Stephen Hemminger <shemminger@linux-foundation.org>
5383M: shemminger@linux-foundation.org
5384L: netdev@vger.kernel.org 4647L: netdev@vger.kernel.org
5385S: Maintained 4648S: Maintained
5386F: drivers/net/skge.* 4649F: drivers/net/skge.*
5387F: drivers/net/sky2.* 4650F: drivers/net/sky2.*
5388 4651
5389SLAB ALLOCATOR 4652SLAB ALLOCATOR
5390P: Christoph Lameter 4653M: Christoph Lameter <cl@linux-foundation.org>
5391M: cl@linux-foundation.org 4654M: Pekka Enberg <penberg@cs.helsinki.fi>
5392P: Pekka Enberg 4655M: Matt Mackall <mpm@selenic.com>
5393M: penberg@cs.helsinki.fi
5394P: Matt Mackall
5395M: mpm@selenic.com
5396L: linux-mm@kvack.org 4656L: linux-mm@kvack.org
5397S: Maintained 4657S: Maintained
5398F: include/linux/sl?b*.h 4658F: include/linux/sl?b*.h
5399F: mm/sl?b.c 4659F: mm/sl?b.c
5400 4660
5401SMC91x ETHERNET DRIVER 4661SMC91x ETHERNET DRIVER
5402P: Nicolas Pitre 4662M: Nicolas Pitre <nico@cam.org>
5403M: nico@cam.org
5404S: Maintained 4663S: Maintained
5405F: drivers/net/smc91x.* 4664F: drivers/net/smc91x.*
5406 4665
5407SMSC47B397 HARDWARE MONITOR DRIVER 4666SMSC47B397 HARDWARE MONITOR DRIVER
5408P: Mark M. Hoffman 4667M: "Mark M. Hoffman" <mhoffman@lightlink.com>
5409M: mhoffman@lightlink.com
5410L: lm-sensors@lm-sensors.org 4668L: lm-sensors@lm-sensors.org
5411S: Maintained 4669S: Maintained
5412F: Documentation/hwmon/smsc47b397 4670F: Documentation/hwmon/smsc47b397
5413F: drivers/hwmon/smsc47b397.c 4671F: drivers/hwmon/smsc47b397.c
5414 4672
5415SMSC911x ETHERNET DRIVER 4673SMSC911x ETHERNET DRIVER
5416P: Steve Glendinning 4674M: Steve Glendinning <steve.glendinning@smsc.com>
5417M: steve.glendinning@smsc.com
5418L: netdev@vger.kernel.org 4675L: netdev@vger.kernel.org
5419S: Supported 4676S: Supported
5420F: include/linux/smsc911x.h 4677F: include/linux/smsc911x.h
5421F: drivers/net/smsc911x.* 4678F: drivers/net/smsc911x.*
5422 4679
5423SMSC9420 PCI ETHERNET DRIVER 4680SMSC9420 PCI ETHERNET DRIVER
5424P: Steve Glendinning 4681M: Steve Glendinning <steve.glendinning@smsc.com>
5425M: steve.glendinning@smsc.com
5426L: netdev@vger.kernel.org 4682L: netdev@vger.kernel.org
5427S: Supported 4683S: Supported
5428F: drivers/net/smsc9420.* 4684F: drivers/net/smsc9420.*
5429 4685
5430SMX UIO Interface 4686SMX UIO Interface
5431P: Ben Nizette 4687M: Ben Nizette <bn@niasdigital.com>
5432M: bn@niasdigital.com
5433S: Maintained 4688S: Maintained
5434F: drivers/uio/uio_smx.c 4689F: drivers/uio/uio_smx.c
5435 4690
5436SN-IA64 (Itanium) SUB-PLATFORM 4691SN-IA64 (Itanium) SUB-PLATFORM
5437P: Jes Sorensen 4692M: Jes Sorensen <jes@sgi.com>
5438M: jes@sgi.com
5439L: linux-altix@sgi.com 4693L: linux-altix@sgi.com
5440L: linux-ia64@vger.kernel.org 4694L: linux-ia64@vger.kernel.org
5441W: http://www.sgi.com/altix 4695W: http://www.sgi.com/altix
@@ -5443,8 +4697,7 @@ S: Maintained
5443F: arch/ia64/sn/ 4697F: arch/ia64/sn/
5444 4698
5445SOC-CAMERA V4L2 SUBSYSTEM 4699SOC-CAMERA V4L2 SUBSYSTEM
5446P: Guennadi Liakhovetski 4700M: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5447M: g.liakhovetski@gmx.de
5448L: linux-media@vger.kernel.org 4701L: linux-media@vger.kernel.org
5449T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4702T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
5450S: Maintained 4703S: Maintained
@@ -5452,37 +4705,32 @@ F: include/media/v4l2*
5452F: drivers/media/video/v4l2* 4705F: drivers/media/video/v4l2*
5453 4706
5454SOEKRIS NET48XX LED SUPPORT 4707SOEKRIS NET48XX LED SUPPORT
5455P: Chris Boot 4708M: Chris Boot <bootc@bootc.net>
5456M: bootc@bootc.net
5457S: Maintained 4709S: Maintained
5458F: drivers/leds/leds-net48xx.c 4710F: drivers/leds/leds-net48xx.c
5459 4711
5460SOFTWARE RAID (Multiple Disks) SUPPORT 4712SOFTWARE RAID (Multiple Disks) SUPPORT
5461P: Neil Brown 4713M: Neil Brown <neilb@suse.de>
5462M: neilb@suse.de
5463L: linux-raid@vger.kernel.org 4714L: linux-raid@vger.kernel.org
5464S: Supported 4715S: Supported
5465F: drivers/md/ 4716F: drivers/md/
5466F: include/linux/raid/ 4717F: include/linux/raid/
5467 4718
5468SONIC NETWORK DRIVER 4719SONIC NETWORK DRIVER
5469P: Thomas Bogendoerfer 4720M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
5470M: tsbogend@alpha.franken.de
5471L: netdev@vger.kernel.org 4721L: netdev@vger.kernel.org
5472S: Maintained 4722S: Maintained
5473F: drivers/net/sonic.* 4723F: drivers/net/sonic.*
5474 4724
5475SONICS SILICON BACKPLANE DRIVER (SSB) 4725SONICS SILICON BACKPLANE DRIVER (SSB)
5476P: Michael Buesch 4726M: Michael Buesch <mb@bu3sch.de>
5477M: mb@bu3sch.de
5478L: netdev@vger.kernel.org 4727L: netdev@vger.kernel.org
5479S: Maintained 4728S: Maintained
5480F: drivers/ssb/ 4729F: drivers/ssb/
5481F: include/linux/ssb/ 4730F: include/linux/ssb/
5482 4731
5483SONY VAIO CONTROL DEVICE DRIVER 4732SONY VAIO CONTROL DEVICE DRIVER
5484P: Mattia Dongili 4733M: Mattia Dongili <malattia@linux.it>
5485M: malattia@linux.it
5486L: linux-acpi@vger.kernel.org 4734L: linux-acpi@vger.kernel.org
5487W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers 4735W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
5488S: Maintained 4736S: Maintained
@@ -5492,17 +4740,14 @@ F: drivers/platform/x86/sony-laptop.c
5492F: include/linux/sony-laptop.h 4740F: include/linux/sony-laptop.h
5493 4741
5494SONY MEMORYSTICK CARD SUPPORT 4742SONY MEMORYSTICK CARD SUPPORT
5495P: Alex Dubov 4743M: Alex Dubov <oakad@yahoo.com>
5496M: oakad@yahoo.com
5497W: http://tifmxx.berlios.de/ 4744W: http://tifmxx.berlios.de/
5498S: Maintained 4745S: Maintained
5499F: drivers/memstick/host/tifm_ms.c 4746F: drivers/memstick/host/tifm_ms.c
5500 4747
5501SOUND 4748SOUND
5502P: Jaroslav Kysela 4749M: Jaroslav Kysela <perex@perex.cz>
5503M: perex@perex.cz 4750M: Takashi Iwai <tiwai@suse.de>
5504P: Takashi Iwai
5505M: tiwai@suse.de
5506L: alsa-devel@alsa-project.org (moderated for non-subscribers) 4751L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5507W: http://www.alsa-project.org/ 4752W: http://www.alsa-project.org/
5508T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git 4753T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
@@ -5513,10 +4758,8 @@ F: include/sound/
5513F: sound/ 4758F: sound/
5514 4759
5515SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) 4760SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
5516P: Liam Girdwood 4761M: Liam Girdwood <lrg@slimlogic.co.uk>
5517M: lrg@slimlogic.co.uk 4762M: Mark Brown <broonie@opensource.wolfsonmicro.com>
5518P: Mark Brown
5519M: broonie@opensource.wolfsonmicro.com
5520T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git 4763T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
5521L: alsa-devel@alsa-project.org (moderated for non-subscribers) 4764L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5522W: http://alsa-project.org/main/index.php/ASoC 4765W: http://alsa-project.org/main/index.php/ASoC
@@ -5525,8 +4768,7 @@ F: sound/soc/
5525F: include/sound/soc* 4768F: include/sound/soc*
5526 4769
5527SPARC + UltraSPARC (sparc/sparc64) 4770SPARC + UltraSPARC (sparc/sparc64)
5528P: David S. Miller 4771M: "David S. Miller" <davem@davemloft.net>
5529M: davem@davemloft.net
5530L: sparclinux@vger.kernel.org 4772L: sparclinux@vger.kernel.org
5531T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git 4773T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
5532T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git 4774T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
@@ -5534,15 +4776,13 @@ S: Maintained
5534F: arch/sparc/ 4776F: arch/sparc/
5535 4777
5536SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER 4778SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
5537P: Roger Wolff 4779M: Roger Wolff <R.E.Wolff@BitWizard.nl>
5538M: R.E.Wolff@BitWizard.nl
5539S: Supported 4780S: Supported
5540F: Documentation/serial/specialix.txt 4781F: Documentation/serial/specialix.txt
5541F: drivers/char/specialix* 4782F: drivers/char/specialix*
5542 4783
5543SPI SUBSYSTEM 4784SPI SUBSYSTEM
5544P: David Brownell 4785M: David Brownell <dbrownell@users.sourceforge.net>
5545M: dbrownell@users.sourceforge.net
5546L: spi-devel-general@lists.sourceforge.net 4786L: spi-devel-general@lists.sourceforge.net
5547S: Maintained 4787S: Maintained
5548F: Documentation/spi/ 4788F: Documentation/spi/
@@ -5550,18 +4790,15 @@ F: drivers/spi/
5550F: include/linux/spi/ 4790F: include/linux/spi/
5551 4791
5552SPIDERNET NETWORK DRIVER for CELL 4792SPIDERNET NETWORK DRIVER for CELL
5553P: Ishizaki Kou 4793M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
5554M: kou.ishizaki@toshiba.co.jp 4794M: Jens Osterkamp <jens@de.ibm.com>
5555P: Jens Osterkamp
5556M: jens@de.ibm.com
5557L: netdev@vger.kernel.org 4795L: netdev@vger.kernel.org
5558S: Supported 4796S: Supported
5559F: Documentation/networking/spider_net.txt 4797F: Documentation/networking/spider_net.txt
5560F: drivers/net/spider_net* 4798F: drivers/net/spider_net*
5561 4799
5562SPU FILE SYSTEM 4800SPU FILE SYSTEM
5563P: Jeremy Kerr 4801M: Jeremy Kerr <jk@ozlabs.org>
5564M: jk@ozlabs.org
5565L: linuxppc-dev@ozlabs.org 4802L: linuxppc-dev@ozlabs.org
5566L: cbe-oss-dev@ozlabs.org 4803L: cbe-oss-dev@ozlabs.org
5567W: http://www.ibm.com/developerworks/power/cell/ 4804W: http://www.ibm.com/developerworks/power/cell/
@@ -5570,8 +4807,7 @@ F: Documentation/filesystems/spufs.txt
5570F: arch/powerpc/platforms/cell/spufs/ 4807F: arch/powerpc/platforms/cell/spufs/
5571 4808
5572SQUASHFS FILE SYSTEM 4809SQUASHFS FILE SYSTEM
5573P: Phillip Lougher 4810M: Phillip Lougher <phillip@lougher.demon.co.uk>
5574M: phillip@lougher.demon.co.uk
5575L: squashfs-devel@lists.sourceforge.net (subscribers-only) 4811L: squashfs-devel@lists.sourceforge.net (subscribers-only)
5576W: http://squashfs.org.uk 4812W: http://squashfs.org.uk
5577S: Maintained 4813S: Maintained
@@ -5579,49 +4815,41 @@ F: Documentation/filesystems/squashfs.txt
5579F: fs/squashfs/ 4815F: fs/squashfs/
5580 4816
5581SRM (Alpha) environment access 4817SRM (Alpha) environment access
5582P: Jan-Benedict Glaw 4818M: Jan-Benedict Glaw <jbglaw@lug-owl.de>
5583M: jbglaw@lug-owl.de
5584S: Maintained 4819S: Maintained
5585F: arch/alpha/kernel/srm_env.c 4820F: arch/alpha/kernel/srm_env.c
5586 4821
5587STABLE BRANCH 4822STABLE BRANCH
5588P: Greg Kroah-Hartman 4823M: Greg Kroah-Hartman <greg@kroah.com>
5589M: greg@kroah.com 4824M: Chris Wright <chrisw@sous-sol.org>
5590P: Chris Wright
5591M: chrisw@sous-sol.org
5592L: stable@kernel.org 4825L: stable@kernel.org
5593S: Maintained 4826S: Maintained
5594 4827
5595STAGING SUBSYSTEM 4828STAGING SUBSYSTEM
5596P: Greg Kroah-Hartman 4829M: Greg Kroah-Hartman <gregkh@suse.de>
5597M: gregkh@suse.de
5598T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 4830T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
5599L: devel@driverdev.osuosl.org 4831L: devel@driverdev.osuosl.org
5600S: Maintained 4832S: Maintained
5601F: drivers/staging/ 4833F: drivers/staging/
5602 4834
5603STARFIRE/DURALAN NETWORK DRIVER 4835STARFIRE/DURALAN NETWORK DRIVER
5604P: Ion Badulescu 4836M: Ion Badulescu <ionut@badula.org>
5605M: ionut@badula.org
5606S: Odd Fixes 4837S: Odd Fixes
5607F: drivers/net/starfire* 4838F: drivers/net/starfire*
5608 4839
5609STARMODE RADIO IP (STRIP) PROTOCOL DRIVER 4840STARMODE RADIO IP (STRIP) PROTOCOL DRIVER
5610W: http://mosquitonet.Stanford.EDU/strip.html
5611S: Orphan 4841S: Orphan
5612F: drivers/net/wireless/strip.c 4842F: drivers/net/wireless/strip.c
5613F: include/linux/if_strip.h 4843F: include/linux/if_strip.h
5614 4844
5615STRADIS MPEG-2 DECODER DRIVER 4845STRADIS MPEG-2 DECODER DRIVER
5616P: Nathan Laredo 4846M: Nathan Laredo <laredo@gnu.org>
5617M: laredo@gnu.org
5618W: http://www.stradis.com/ 4847W: http://www.stradis.com/
5619S: Maintained 4848S: Maintained
5620F: drivers/media/video/stradis.c 4849F: drivers/media/video/stradis.c
5621 4850
5622SUN3/3X 4851SUN3/3X
5623P: Sam Creasey 4852M: Sam Creasey <sammy@sammy.net>
5624M: sammy@sammy.net
5625W: http://sammy.net/sun3/ 4853W: http://sammy.net/sun3/
5626S: Maintained 4854S: Maintained
5627F: arch/m68k/kernel/*sun3* 4855F: arch/m68k/kernel/*sun3*
@@ -5629,8 +4857,7 @@ F: arch/m68k/sun3*/
5629F: arch/m68k/include/asm/sun3* 4857F: arch/m68k/include/asm/sun3*
5630 4858
5631SUPERH 4859SUPERH
5632P: Paul Mundt 4860M: Paul Mundt <lethal@linux-sh.org>
5633M: lethal@linux-sh.org
5634L: linux-sh@vger.kernel.org 4861L: linux-sh@vger.kernel.org
5635W: http://www.linux-sh.org 4862W: http://www.linux-sh.org
5636T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git 4863T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git
@@ -5640,12 +4867,9 @@ F: arch/sh/
5640F: drivers/sh/ 4867F: drivers/sh/
5641 4868
5642SUSPEND TO RAM 4869SUSPEND TO RAM
5643P: Len Brown 4870M: Len Brown <len.brown@intel.com>
5644M: len.brown@intel.com 4871M: Pavel Machek <pavel@ucw.cz>
5645P: Pavel Machek 4872M: "Rafael J. Wysocki" <rjw@sisk.pl>
5646M: pavel@ucw.cz
5647P: Rafael J. Wysocki
5648M: rjw@sisk.pl
5649L: linux-pm@lists.linux-foundation.org 4873L: linux-pm@lists.linux-foundation.org
5650S: Supported 4874S: Supported
5651F: Documentation/power/ 4875F: Documentation/power/
@@ -5657,32 +4881,28 @@ F: include/linux/freezer.h
5657F: include/linux/pm.h 4881F: include/linux/pm.h
5658 4882
5659SVGA HANDLING 4883SVGA HANDLING
5660P: Martin Mares 4884M: Martin Mares <mj@ucw.cz>
5661M: mj@ucw.cz
5662L: linux-video@atrey.karlin.mff.cuni.cz 4885L: linux-video@atrey.karlin.mff.cuni.cz
5663S: Maintained 4886S: Maintained
5664F: Documentation/svga.txt 4887F: Documentation/svga.txt
5665F: arch/x86/boot/video* 4888F: arch/x86/boot/video*
5666 4889
5667SYSV FILESYSTEM 4890SYSV FILESYSTEM
5668P: Christoph Hellwig 4891M: Christoph Hellwig <hch@infradead.org>
5669M: hch@infradead.org
5670S: Maintained 4892S: Maintained
5671F: Documentation/filesystems/sysv-fs.txt 4893F: Documentation/filesystems/sysv-fs.txt
5672F: fs/sysv/ 4894F: fs/sysv/
5673F: include/linux/sysv_fs.h 4895F: include/linux/sysv_fs.h
5674 4896
5675TASKSTATS STATISTICS INTERFACE 4897TASKSTATS STATISTICS INTERFACE
5676P: Balbir Singh 4898M: Balbir Singh <balbir@linux.vnet.ibm.com>
5677M: balbir@linux.vnet.ibm.com
5678S: Maintained 4899S: Maintained
5679F: Documentation/accounting/taskstats* 4900F: Documentation/accounting/taskstats*
5680F: include/linux/taskstats* 4901F: include/linux/taskstats*
5681F: kernel/taskstats.c 4902F: kernel/taskstats.c
5682 4903
5683TC CLASSIFIER 4904TC CLASSIFIER
5684P: Jamal Hadi Salim 4905M: Jamal Hadi Salim <hadi@cyberus.ca>
5685M: hadi@cyberus.ca
5686L: netdev@vger.kernel.org 4906L: netdev@vger.kernel.org
5687S: Maintained 4907S: Maintained
5688F: include/linux/pkt_cls.h 4908F: include/linux/pkt_cls.h
@@ -5690,38 +4910,31 @@ F: include/net/pkt_cls.h
5690F: net/sched/ 4910F: net/sched/
5691 4911
5692TCP LOW PRIORITY MODULE 4912TCP LOW PRIORITY MODULE
5693P: Wong Hoi Sing, Edison 4913M: "Wong Hoi Sing, Edison" <hswong3i@gmail.com>
5694M: hswong3i@gmail.com 4914M: "Hung Hing Lun, Mike" <hlhung3i@gmail.com>
5695P: Hung Hing Lun, Mike
5696M: hlhung3i@gmail.com
5697W: http://tcp-lp-mod.sourceforge.net/ 4915W: http://tcp-lp-mod.sourceforge.net/
5698S: Maintained 4916S: Maintained
5699F: net/ipv4/tcp_lp.c 4917F: net/ipv4/tcp_lp.c
5700 4918
5701TEHUTI ETHERNET DRIVER 4919TEHUTI ETHERNET DRIVER
5702P: Alexander Indenbaum 4920M: Alexander Indenbaum <baum@tehutinetworks.net>
5703M: baum@tehutinetworks.net 4921M: Andy Gospodarek <andy@greyhouse.net>
5704P: Andy Gospodarek
5705M: andy@greyhouse.net
5706L: netdev@vger.kernel.org 4922L: netdev@vger.kernel.org
5707S: Supported 4923S: Supported
5708F: drivers/net/tehuti* 4924F: drivers/net/tehuti*
5709 4925
5710Telecom Clock Driver for MCPL0010 4926Telecom Clock Driver for MCPL0010
5711P: Mark Gross 4927M: Mark Gross <mark.gross@intel.com>
5712M: mark.gross@intel.com
5713S: Supported 4928S: Supported
5714F: drivers/char/tlclk.c 4929F: drivers/char/tlclk.c
5715 4930
5716TENSILICA XTENSA PORT (xtensa) 4931TENSILICA XTENSA PORT (xtensa)
5717P: Chris Zankel 4932M: Chris Zankel <chris@zankel.net>
5718M: chris@zankel.net
5719S: Maintained 4933S: Maintained
5720F: arch/xtensa/ 4934F: arch/xtensa/
5721 4935
5722THINKPAD ACPI EXTRAS DRIVER 4936THINKPAD ACPI EXTRAS DRIVER
5723P: Henrique de Moraes Holschuh 4937M: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
5724M: ibm-acpi@hmh.eng.br
5725L: ibm-acpi-devel@lists.sourceforge.net 4938L: ibm-acpi-devel@lists.sourceforge.net
5726W: http://ibm-acpi.sourceforge.net 4939W: http://ibm-acpi.sourceforge.net
5727W: http://thinkwiki.org/wiki/Ibm-acpi 4940W: http://thinkwiki.org/wiki/Ibm-acpi
@@ -5730,27 +4943,22 @@ S: Maintained
5730F: drivers/platform/x86/thinkpad_acpi.c 4943F: drivers/platform/x86/thinkpad_acpi.c
5731 4944
5732TI FLASH MEDIA INTERFACE DRIVER 4945TI FLASH MEDIA INTERFACE DRIVER
5733P: Alex Dubov 4946M: Alex Dubov <oakad@yahoo.com>
5734M: oakad@yahoo.com
5735S: Maintained 4947S: Maintained
5736F: drivers/misc/tifm* 4948F: drivers/misc/tifm*
5737F: drivers/mmc/host/tifm_sd.c 4949F: drivers/mmc/host/tifm_sd.c
5738F: include/linux/tifm.h 4950F: include/linux/tifm.h
5739 4951
5740TI TWL4030 SERIES SOC CODEC DRIVER 4952TI TWL4030 SERIES SOC CODEC DRIVER
5741P: Peter Ujfalusi 4953M: Peter Ujfalusi <peter.ujfalusi@nokia.com>
5742M: peter.ujfalusi@nokia.com
5743L: alsa-devel@alsa-project.org (moderated for non-subscribers) 4954L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5744S: Maintained 4955S: Maintained
5745F: sound/soc/codecs/twl4030* 4956F: sound/soc/codecs/twl4030*
5746 4957
5747TIPC NETWORK LAYER 4958TIPC NETWORK LAYER
5748P: Per Liden 4959M: Per Liden <per.liden@ericsson.com>
5749M: per.liden@ericsson.com 4960M: Jon Maloy <jon.maloy@ericsson.com>
5750P: Jon Maloy 4961M: Allan Stephens <allan.stephens@windriver.com>
5751M: jon.maloy@ericsson.com
5752P: Allan Stephens
5753M: allan.stephens@windriver.com
5754L: tipc-discussion@lists.sourceforge.net 4962L: tipc-discussion@lists.sourceforge.net
5755W: http://tipc.sourceforge.net/ 4963W: http://tipc.sourceforge.net/
5756W: http://tipc.cslab.ericsson.net/ 4964W: http://tipc.cslab.ericsson.net/
@@ -5761,8 +4969,7 @@ F: include/net/tipc/
5761F: net/tipc/ 4969F: net/tipc/
5762 4970
5763TLAN NETWORK DRIVER 4971TLAN NETWORK DRIVER
5764P: Samuel Chessman 4972M: Samuel Chessman <chessman@tux.org>
5765M: chessman@tux.org
5766L: tlan-devel@lists.sourceforge.net (subscribers-only) 4973L: tlan-devel@lists.sourceforge.net (subscribers-only)
5767W: http://sourceforge.net/projects/tlan/ 4974W: http://sourceforge.net/projects/tlan/
5768S: Maintained 4975S: Maintained
@@ -5770,10 +4977,8 @@ F: Documentation/networking/tlan.txt
5770F: drivers/net/tlan.* 4977F: drivers/net/tlan.*
5771 4978
5772TOMOYO SECURITY MODULE 4979TOMOYO SECURITY MODULE
5773P: Kentaro Takeda 4980M: Kentaro Takeda <takedakn@nttdata.co.jp>
5774M: takedakn@nttdata.co.jp 4981M: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
5775P: Tetsuo Handa
5776M: penguin-kernel@I-love.SAKURA.ne.jp
5777L: tomoyo-users-en@lists.sourceforge.jp (subscribers-only, for developers and users in English) 4982L: tomoyo-users-en@lists.sourceforge.jp (subscribers-only, for developers and users in English)
5778L: tomoyo-dev@lists.sourceforge.jp (subscribers-only, for developers in Japanese) 4983L: tomoyo-dev@lists.sourceforge.jp (subscribers-only, for developers in Japanese)
5779L: tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese) 4984L: tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese)
@@ -5787,8 +4992,7 @@ S: Orphan
5787F: drivers/platform/x86/toshiba_acpi.c 4992F: drivers/platform/x86/toshiba_acpi.c
5788 4993
5789TOSHIBA SMM DRIVER 4994TOSHIBA SMM DRIVER
5790P: Jonathan Buzzard 4995M: Jonathan Buzzard <jonathan@buzzard.org.uk>
5791M: jonathan@buzzard.org.uk
5792L: tlinux-users@tce.toshiba-dme.co.jp 4996L: tlinux-users@tce.toshiba-dme.co.jp
5793W: http://www.buzzard.org.uk/toshiba/ 4997W: http://www.buzzard.org.uk/toshiba/
5794S: Maintained 4998S: Maintained
@@ -5796,43 +5000,34 @@ F: drivers/char/toshiba.c
5796F: include/linux/toshiba.h 5000F: include/linux/toshiba.h
5797 5001
5798TMIO MMC DRIVER 5002TMIO MMC DRIVER
5799P: Ian Molton 5003M: Ian Molton <ian@mnementh.co.uk>
5800M: ian@mnementh.co.uk
5801S: Maintained 5004S: Maintained
5802F: drivers/mmc/host/tmio_mmc.* 5005F: drivers/mmc/host/tmio_mmc.*
5803 5006
5804TMPFS (SHMEM FILESYSTEM) 5007TMPFS (SHMEM FILESYSTEM)
5805P: Hugh Dickins 5008M: Hugh Dickins <hugh.dickins@tiscali.co.uk>
5806M: hugh.dickins@tiscali.co.uk
5807L: linux-mm@kvack.org 5009L: linux-mm@kvack.org
5808S: Maintained 5010S: Maintained
5809F: include/linux/shmem_fs.h 5011F: include/linux/shmem_fs.h
5810F: mm/shmem.c 5012F: mm/shmem.c
5811 5013
5812TPM DEVICE DRIVER 5014TPM DEVICE DRIVER
5813P: Debora Velarde 5015M: Debora Velarde <debora@linux.vnet.ibm.com>
5814M: debora@linux.vnet.ibm.com 5016M: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
5815P: Rajiv Andrade
5816M: srajiv@linux.vnet.ibm.com
5817W: http://tpmdd.sourceforge.net 5017W: http://tpmdd.sourceforge.net
5818P: Marcel Selhorst 5018M: Marcel Selhorst <m.selhorst@sirrix.com>
5819M: m.selhorst@sirrix.com
5820W: http://www.sirrix.com 5019W: http://www.sirrix.com
5821L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers) 5020L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
5822S: Maintained 5021S: Maintained
5823F: drivers/char/tpm/ 5022F: drivers/char/tpm/
5824 5023
5825TRIVIAL PATCHES 5024TRIVIAL PATCHES
5826P: Jiri Kosina 5025M: Jiri Kosina <trivial@kernel.org>
5827M: trivial@kernel.org
5828T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git 5026T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git
5829S: Maintained 5027S: Maintained
5830 5028
5831TTY LAYER 5029TTY LAYER
5832P: Alan Cox 5030S: Orphan
5833M: alan@lxorguk.ukuu.org.uk
5834S: Maintained
5835T: stgit http://zeniv.linux.org.uk/~alan/ttydev/
5836F: drivers/char/tty_* 5031F: drivers/char/tty_*
5837F: drivers/serial/serial_core.c 5032F: drivers/serial/serial_core.c
5838F: include/linux/serial_core.h 5033F: include/linux/serial_core.h
@@ -5840,17 +5035,14 @@ F: include/linux/serial.h
5840F: include/linux/tty.h 5035F: include/linux/tty.h
5841 5036
5842TULIP NETWORK DRIVERS 5037TULIP NETWORK DRIVERS
5843P: Grant Grundler 5038M: Grant Grundler <grundler@parisc-linux.org>
5844M: grundler@parisc-linux.org 5039M: Kyle McMartin <kyle@mcmartin.ca>
5845P: Kyle McMartin
5846M: kyle@mcmartin.ca
5847L: netdev@vger.kernel.org 5040L: netdev@vger.kernel.org
5848S: Maintained 5041S: Maintained
5849F: drivers/net/tulip/ 5042F: drivers/net/tulip/
5850 5043
5851TUN/TAP driver 5044TUN/TAP driver
5852P: Maxim Krasnyansky 5045M: Maxim Krasnyansky <maxk@qualcomm.com>
5853M: maxk@qualcomm.com
5854L: vtun@office.satix.net 5046L: vtun@office.satix.net
5855W: http://vtun.sourceforge.net/tun 5047W: http://vtun.sourceforge.net/tun
5856S: Maintained 5048S: Maintained
@@ -5858,24 +5050,20 @@ F: Documentation/networking/tuntap.txt
5858F: arch/um/os-Linux/drivers/ 5050F: arch/um/os-Linux/drivers/
5859 5051
5860TURBOCHANNEL SUBSYSTEM 5052TURBOCHANNEL SUBSYSTEM
5861P: Maciej W. Rozycki 5053M: "Maciej W. Rozycki" <macro@linux-mips.org>
5862M: macro@linux-mips.org
5863S: Maintained 5054S: Maintained
5864F: drivers/tc/ 5055F: drivers/tc/
5865F: include/linux/tc.h 5056F: include/linux/tc.h
5866 5057
5867U14-34F SCSI DRIVER 5058U14-34F SCSI DRIVER
5868P: Dario Ballabio 5059M: Dario Ballabio <ballabio_dario@emc.com>
5869M: ballabio_dario@emc.com
5870L: linux-scsi@vger.kernel.org 5060L: linux-scsi@vger.kernel.org
5871S: Maintained 5061S: Maintained
5872F: drivers/scsi/u14-34f.c 5062F: drivers/scsi/u14-34f.c
5873 5063
5874UBI FILE SYSTEM (UBIFS) 5064UBI FILE SYSTEM (UBIFS)
5875P: Artem Bityutskiy 5065M: Artem Bityutskiy <dedekind@infradead.org>
5876M: dedekind@infradead.org 5066M: Adrian Hunter <adrian.hunter@nokia.com>
5877P: Adrian Hunter
5878M: adrian.hunter@nokia.com
5879L: linux-mtd@lists.infradead.org 5067L: linux-mtd@lists.infradead.org
5880T: git git://git.infradead.org/ubifs-2.6.git 5068T: git git://git.infradead.org/ubifs-2.6.git
5881W: http://www.linux-mtd.infradead.org/doc/ubifs.html 5069W: http://www.linux-mtd.infradead.org/doc/ubifs.html
@@ -5884,37 +5072,32 @@ F: Documentation/filesystems/ubifs.txt
5884F: fs/ubifs/ 5072F: fs/ubifs/
5885 5073
5886UCLINUX (AND M68KNOMMU) 5074UCLINUX (AND M68KNOMMU)
5887P: Greg Ungerer 5075M: Greg Ungerer <gerg@uclinux.org>
5888M: gerg@uclinux.org
5889W: http://www.uclinux.org/ 5076W: http://www.uclinux.org/
5890L: uclinux-dev@uclinux.org (subscribers-only) 5077L: uclinux-dev@uclinux.org (subscribers-only)
5891S: Maintained 5078S: Maintained
5892F: arch/m68knommu/ 5079F: arch/m68knommu/
5893 5080
5894UCLINUX FOR RENESAS H8/300 (H8300) 5081UCLINUX FOR RENESAS H8/300 (H8300)
5895P: Yoshinori Sato 5082M: Yoshinori Sato <ysato@users.sourceforge.jp>
5896M: ysato@users.sourceforge.jp
5897W: http://uclinux-h8.sourceforge.jp/ 5083W: http://uclinux-h8.sourceforge.jp/
5898S: Supported 5084S: Supported
5899 5085
5900UDF FILESYSTEM 5086UDF FILESYSTEM
5901P: Jan Kara 5087M: Jan Kara <jack@suse.cz>
5902M: jack@suse.cz
5903W: http://linux-udf.sourceforge.net 5088W: http://linux-udf.sourceforge.net
5904S: Maintained 5089S: Maintained
5905F: Documentation/filesystems/udf.txt 5090F: Documentation/filesystems/udf.txt
5906F: fs/udf/ 5091F: fs/udf/
5907 5092
5908UFS FILESYSTEM 5093UFS FILESYSTEM
5909P: Evgeniy Dushistov 5094M: Evgeniy Dushistov <dushistov@mail.ru>
5910M: dushistov@mail.ru
5911S: Maintained 5095S: Maintained
5912F: Documentation/filesystems/ufs.txt 5096F: Documentation/filesystems/ufs.txt
5913F: fs/ufs/ 5097F: fs/ufs/
5914 5098
5915ULTRA-WIDEBAND (UWB) SUBSYSTEM: 5099ULTRA-WIDEBAND (UWB) SUBSYSTEM:
5916P: David Vrabel 5100M: David Vrabel <david.vrabel@csr.com>
5917M: david.vrabel@csr.com
5918L: linux-usb@vger.kernel.org 5101L: linux-usb@vger.kernel.org
5919S: Supported 5102S: Supported
5920F: drivers/uwb/* 5103F: drivers/uwb/*
@@ -5922,8 +5105,7 @@ F: include/linux/uwb.h
5922F: include/linux/uwb/ 5105F: include/linux/uwb/
5923 5106
5924UNIFORM CDROM DRIVER 5107UNIFORM CDROM DRIVER
5925P: Jens Axboe 5108M: Jens Axboe <axboe@kernel.dk>
5926M: axboe@kernel.dk
5927W: http://www.kernel.dk 5109W: http://www.kernel.dk
5928S: Maintained 5110S: Maintained
5929F: Documentation/cdrom/ 5111F: Documentation/cdrom/
@@ -5931,8 +5113,7 @@ F: drivers/cdrom/cdrom.c
5931F: include/linux/cdrom.h 5113F: include/linux/cdrom.h
5932 5114
5933UNSORTED BLOCK IMAGES (UBI) 5115UNSORTED BLOCK IMAGES (UBI)
5934P: Artem Bityutskiy 5116M: Artem Bityutskiy <dedekind@infradead.org>
5935M: dedekind@infradead.org
5936W: http://www.linux-mtd.infradead.org/ 5117W: http://www.linux-mtd.infradead.org/
5937L: linux-mtd@lists.infradead.org 5118L: linux-mtd@lists.infradead.org
5938T: git git://git.infradead.org/ubi-2.6.git 5119T: git git://git.infradead.org/ubi-2.6.git
@@ -5942,23 +5123,20 @@ F: include/linux/mtd/ubi.h
5942F: include/mtd/ubi-user.h 5123F: include/mtd/ubi-user.h
5943 5124
5944USB ACM DRIVER 5125USB ACM DRIVER
5945P: Oliver Neukum 5126M: Oliver Neukum <oliver@neukum.name>
5946M: oliver@neukum.name
5947L: linux-usb@vger.kernel.org 5127L: linux-usb@vger.kernel.org
5948S: Maintained 5128S: Maintained
5949F: Documentation/usb/acm.txt 5129F: Documentation/usb/acm.txt
5950F: drivers/usb/class/cdc-acm.* 5130F: drivers/usb/class/cdc-acm.*
5951 5131
5952USB BLOCK DRIVER (UB ub) 5132USB BLOCK DRIVER (UB ub)
5953P: Pete Zaitcev 5133M: Pete Zaitcev <zaitcev@redhat.com>
5954M: zaitcev@redhat.com
5955L: linux-usb@vger.kernel.org 5134L: linux-usb@vger.kernel.org
5956S: Supported 5135S: Supported
5957F: drivers/block/ub.c 5136F: drivers/block/ub.c
5958 5137
5959USB CDC ETHERNET DRIVER 5138USB CDC ETHERNET DRIVER
5960P: Greg Kroah-Hartman 5139M: Greg Kroah-Hartman <greg@kroah.com>
5961M: greg@kroah.com
5962L: linux-usb@vger.kernel.org 5140L: linux-usb@vger.kernel.org
5963S: Maintained 5141S: Maintained
5964W: http://www.kroah.com/linux-usb/ 5142W: http://www.kroah.com/linux-usb/
@@ -5966,39 +5144,34 @@ F: drivers/net/usb/cdc_*.c
5966F: include/linux/usb/cdc.h 5144F: include/linux/usb/cdc.h
5967 5145
5968USB CYPRESS C67X00 DRIVER 5146USB CYPRESS C67X00 DRIVER
5969P: Peter Korsgaard 5147M: Peter Korsgaard <jacmet@sunsite.dk>
5970M: jacmet@sunsite.dk
5971L: linux-usb@vger.kernel.org 5148L: linux-usb@vger.kernel.org
5972S: Maintained 5149S: Maintained
5973F: drivers/usb/c67x00/ 5150F: drivers/usb/c67x00/
5974 5151
5975USB DAVICOM DM9601 DRIVER 5152USB DAVICOM DM9601 DRIVER
5976P: Peter Korsgaard 5153M: Peter Korsgaard <jacmet@sunsite.dk>
5977M: jacmet@sunsite.dk
5978L: netdev@vger.kernel.org 5154L: netdev@vger.kernel.org
5979W: http://www.linux-usb.org/usbnet 5155W: http://www.linux-usb.org/usbnet
5980S: Maintained 5156S: Maintained
5981F: drivers/net/usb/dm9601.c 5157F: drivers/net/usb/dm9601.c
5982 5158
5983USB DIAMOND RIO500 DRIVER 5159USB DIAMOND RIO500 DRIVER
5984P: Cesar Miquel 5160M: Cesar Miquel <miquel@df.uba.ar>
5985M: miquel@df.uba.ar
5986L: rio500-users@lists.sourceforge.net 5161L: rio500-users@lists.sourceforge.net
5987W: http://rio500.sourceforge.net 5162W: http://rio500.sourceforge.net
5988S: Maintained 5163S: Maintained
5989F: drivers/usb/misc/rio500* 5164F: drivers/usb/misc/rio500*
5990 5165
5991USB EHCI DRIVER 5166USB EHCI DRIVER
5992P: David Brownell 5167M: David Brownell <dbrownell@users.sourceforge.net>
5993M: dbrownell@users.sourceforge.net
5994L: linux-usb@vger.kernel.org 5168L: linux-usb@vger.kernel.org
5995S: Odd Fixes 5169S: Odd Fixes
5996F: Documentation/usb/ehci.txt 5170F: Documentation/usb/ehci.txt
5997F: drivers/usb/host/ehci* 5171F: drivers/usb/host/ehci*
5998 5172
5999USB ET61X[12]51 DRIVER 5173USB ET61X[12]51 DRIVER
6000P: Luca Risolia 5174M: Luca Risolia <luca.risolia@studio.unibo.it>
6001M: luca.risolia@studio.unibo.it
6002L: linux-usb@vger.kernel.org 5175L: linux-usb@vger.kernel.org
6003L: linux-media@vger.kernel.org 5176L: linux-media@vger.kernel.org
6004T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5177T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6007,8 +5180,7 @@ S: Maintained
6007F: drivers/media/video/et61x251/ 5180F: drivers/media/video/et61x251/
6008 5181
6009USB GADGET/PERIPHERAL SUBSYSTEM 5182USB GADGET/PERIPHERAL SUBSYSTEM
6010P: David Brownell 5183M: David Brownell <dbrownell@users.sourceforge.net>
6011M: dbrownell@users.sourceforge.net
6012L: linux-usb@vger.kernel.org 5184L: linux-usb@vger.kernel.org
6013W: http://www.linux-usb.org/gadget 5185W: http://www.linux-usb.org/gadget
6014S: Maintained 5186S: Maintained
@@ -6016,8 +5188,7 @@ F: drivers/usb/gadget/
6016F: include/linux/usb/gadget* 5188F: include/linux/usb/gadget*
6017 5189
6018USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...) 5190USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
6019P: Jiri Kosina 5191M: Jiri Kosina <jkosina@suse.cz>
6020M: jkosina@suse.cz
6021L: linux-usb@vger.kernel.org 5192L: linux-usb@vger.kernel.org
6022T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git 5193T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
6023S: Maintained 5194S: Maintained
@@ -6025,23 +5196,20 @@ F: Documentation/usb/hiddev.txt
6025F: drivers/hid/usbhid/ 5196F: drivers/hid/usbhid/
6026 5197
6027USB ISP116X DRIVER 5198USB ISP116X DRIVER
6028P: Olav Kongas 5199M: Olav Kongas <ok@artecdesign.ee>
6029M: ok@artecdesign.ee
6030L: linux-usb@vger.kernel.org 5200L: linux-usb@vger.kernel.org
6031S: Maintained 5201S: Maintained
6032F: drivers/usb/host/isp116x* 5202F: drivers/usb/host/isp116x*
6033F: include/linux/usb/isp116x.h 5203F: include/linux/usb/isp116x.h
6034 5204
6035USB KAWASAKI LSI DRIVER 5205USB KAWASAKI LSI DRIVER
6036P: Oliver Neukum 5206M: Oliver Neukum <oliver@neukum.name>
6037M: oliver@neukum.name
6038L: linux-usb@vger.kernel.org 5207L: linux-usb@vger.kernel.org
6039S: Maintained 5208S: Maintained
6040F: drivers/usb/serial/kl5kusb105.* 5209F: drivers/usb/serial/kl5kusb105.*
6041 5210
6042USB MASS STORAGE DRIVER 5211USB MASS STORAGE DRIVER
6043P: Matthew Dharm 5212M: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
6044M: mdharm-usb@one-eyed-alien.net
6045L: linux-usb@vger.kernel.org 5213L: linux-usb@vger.kernel.org
6046L: usb-storage@lists.one-eyed-alien.net 5214L: usb-storage@lists.one-eyed-alien.net
6047S: Maintained 5215S: Maintained
@@ -6049,31 +5217,27 @@ W: http://www.one-eyed-alien.net/~mdharm/linux-usb/
6049F: drivers/usb/storage/ 5217F: drivers/usb/storage/
6050 5218
6051USB OHCI DRIVER 5219USB OHCI DRIVER
6052P: David Brownell 5220M: David Brownell <dbrownell@users.sourceforge.net>
6053M: dbrownell@users.sourceforge.net
6054L: linux-usb@vger.kernel.org 5221L: linux-usb@vger.kernel.org
6055S: Odd Fixes 5222S: Odd Fixes
6056F: Documentation/usb/ohci.txt 5223F: Documentation/usb/ohci.txt
6057F: drivers/usb/host/ohci* 5224F: drivers/usb/host/ohci*
6058 5225
6059USB OPTION-CARD DRIVER 5226USB OPTION-CARD DRIVER
6060P: Matthias Urlichs 5227M: Matthias Urlichs <smurf@smurf.noris.de>
6061M: smurf@smurf.noris.de
6062L: linux-usb@vger.kernel.org 5228L: linux-usb@vger.kernel.org
6063S: Maintained 5229S: Maintained
6064F: drivers/usb/serial/option.c 5230F: drivers/usb/serial/option.c
6065 5231
6066USB OV511 DRIVER 5232USB OV511 DRIVER
6067P: Mark McClelland 5233M: Mark McClelland <mmcclell@bigfoot.com>
6068M: mmcclell@bigfoot.com
6069L: linux-usb@vger.kernel.org 5234L: linux-usb@vger.kernel.org
6070W: http://alpha.dyndns.org/ov511/ 5235W: http://alpha.dyndns.org/ov511/
6071S: Maintained 5236S: Maintained
6072F: drivers/media/video/ov511.* 5237F: drivers/media/video/ov511.*
6073 5238
6074USB PEGASUS DRIVER 5239USB PEGASUS DRIVER
6075P: Petko Manolov 5240M: Petko Manolov <petkan@users.sourceforge.net>
6076M: petkan@users.sourceforge.net
6077L: linux-usb@vger.kernel.org 5241L: linux-usb@vger.kernel.org
6078L: netdev@vger.kernel.org 5242L: netdev@vger.kernel.org
6079W: http://pegasus2.sourceforge.net/ 5243W: http://pegasus2.sourceforge.net/
@@ -6081,15 +5245,13 @@ S: Maintained
6081F: drivers/net/usb/pegasus.* 5245F: drivers/net/usb/pegasus.*
6082 5246
6083USB PRINTER DRIVER (usblp) 5247USB PRINTER DRIVER (usblp)
6084P: Pete Zaitcev 5248M: Pete Zaitcev <zaitcev@redhat.com>
6085M: zaitcev@redhat.com
6086L: linux-usb@vger.kernel.org 5249L: linux-usb@vger.kernel.org
6087S: Supported 5250S: Supported
6088F: drivers/usb/class/usblp.c 5251F: drivers/usb/class/usblp.c
6089 5252
6090USB RTL8150 DRIVER 5253USB RTL8150 DRIVER
6091P: Petko Manolov 5254M: Petko Manolov <petkan@users.sourceforge.net>
6092M: petkan@users.sourceforge.net
6093L: linux-usb@vger.kernel.org 5255L: linux-usb@vger.kernel.org
6094L: netdev@vger.kernel.org 5256L: netdev@vger.kernel.org
6095W: http://pegasus2.sourceforge.net/ 5257W: http://pegasus2.sourceforge.net/
@@ -6097,8 +5259,7 @@ S: Maintained
6097F: drivers/net/usb/rtl8150.c 5259F: drivers/net/usb/rtl8150.c
6098 5260
6099USB SE401 DRIVER 5261USB SE401 DRIVER
6100P: Jeroen Vreeken 5262M: Jeroen Vreeken <pe1rxq@amsat.org>
6101M: pe1rxq@amsat.org
6102L: linux-usb@vger.kernel.org 5263L: linux-usb@vger.kernel.org
6103W: http://www.chello.nl/~j.vreeken/se401/ 5264W: http://www.chello.nl/~j.vreeken/se401/
6104S: Maintained 5265S: Maintained
@@ -6106,15 +5267,13 @@ F: Documentation/video4linux/se401.txt
6106F: drivers/media/video/se401.* 5267F: drivers/media/video/se401.*
6107 5268
6108USB SERIAL BELKIN F5U103 DRIVER 5269USB SERIAL BELKIN F5U103 DRIVER
6109P: William Greathouse 5270M: William Greathouse <wgreathouse@smva.com>
6110M: wgreathouse@smva.com
6111L: linux-usb@vger.kernel.org 5271L: linux-usb@vger.kernel.org
6112S: Maintained 5272S: Maintained
6113F: drivers/usb/serial/belkin_sa.* 5273F: drivers/usb/serial/belkin_sa.*
6114 5274
6115USB SERIAL CYPRESS M8 DRIVER 5275USB SERIAL CYPRESS M8 DRIVER
6116P: Lonnie Mendez 5276M: Lonnie Mendez <dignome@gmail.com>
6117M: dignome@gmail.com
6118L: linux-usb@vger.kernel.org 5277L: linux-usb@vger.kernel.org
6119S: Maintained 5278S: Maintained
6120W: http://geocities.com/i0xox0i 5279W: http://geocities.com/i0xox0i
@@ -6122,23 +5281,20 @@ W: http://firstlight.net/cvs
6122F: drivers/usb/serial/cypress_m8.* 5281F: drivers/usb/serial/cypress_m8.*
6123 5282
6124USB SERIAL CYBERJACK DRIVER 5283USB SERIAL CYBERJACK DRIVER
6125P: Matthias Bruestle and Harald Welte 5284M: Matthias Bruestle and Harald Welte <support@reiner-sct.com>
6126M: support@reiner-sct.com
6127W: http://www.reiner-sct.de/support/treiber_cyberjack.php 5285W: http://www.reiner-sct.de/support/treiber_cyberjack.php
6128S: Maintained 5286S: Maintained
6129F: drivers/usb/serial/cyberjack.c 5287F: drivers/usb/serial/cyberjack.c
6130 5288
6131USB SERIAL DIGI ACCELEPORT DRIVER 5289USB SERIAL DIGI ACCELEPORT DRIVER
6132P: Peter Berger and Al Borchers 5290M: Peter Berger <pberger@brimson.com>
6133M: pberger@brimson.com 5291M: Al Borchers <alborchers@steinerpoint.com>
6134M: alborchers@steinerpoint.com
6135L: linux-usb@vger.kernel.org 5292L: linux-usb@vger.kernel.org
6136S: Maintained 5293S: Maintained
6137F: drivers/usb/serial/digi_acceleport.c 5294F: drivers/usb/serial/digi_acceleport.c
6138 5295
6139USB SERIAL DRIVER 5296USB SERIAL DRIVER
6140P: Greg Kroah-Hartman 5297M: Greg Kroah-Hartman <gregkh@suse.de>
6141M: gregkh@suse.de
6142L: linux-usb@vger.kernel.org 5298L: linux-usb@vger.kernel.org
6143S: Supported 5299S: Supported
6144F: Documentation/usb/usb-serial.txt 5300F: Documentation/usb/usb-serial.txt
@@ -6147,38 +5303,33 @@ F: drivers/usb/serial/usb-serial.c
6147F: include/linux/usb/serial.h 5303F: include/linux/usb/serial.h
6148 5304
6149USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER 5305USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER
6150P: Gary Brubaker 5306M: Gary Brubaker <xavyer@ix.netcom.com>
6151M: xavyer@ix.netcom.com
6152L: linux-usb@vger.kernel.org 5307L: linux-usb@vger.kernel.org
6153S: Maintained 5308S: Maintained
6154F: drivers/usb/serial/empeg.c 5309F: drivers/usb/serial/empeg.c
6155 5310
6156USB SERIAL KEYSPAN DRIVER 5311USB SERIAL KEYSPAN DRIVER
6157P: Greg Kroah-Hartman 5312M: Greg Kroah-Hartman <greg@kroah.com>
6158M: greg@kroah.com
6159L: linux-usb@vger.kernel.org 5313L: linux-usb@vger.kernel.org
6160W: http://www.kroah.com/linux/ 5314W: http://www.kroah.com/linux/
6161S: Maintained 5315S: Maintained
6162F: drivers/usb/serial/*keyspan* 5316F: drivers/usb/serial/*keyspan*
6163 5317
6164USB SERIAL WHITEHEAT DRIVER 5318USB SERIAL WHITEHEAT DRIVER
6165P: Support Department 5319M: Support Department <support@connecttech.com>
6166M: support@connecttech.com
6167L: linux-usb@vger.kernel.org 5320L: linux-usb@vger.kernel.org
6168W: http://www.connecttech.com 5321W: http://www.connecttech.com
6169S: Supported 5322S: Supported
6170F: drivers/usb/serial/whiteheat* 5323F: drivers/usb/serial/whiteheat*
6171 5324
6172USB SMSC95XX ETHERNET DRIVER 5325USB SMSC95XX ETHERNET DRIVER
6173P: Steve Glendinning 5326M: Steve Glendinning <steve.glendinning@smsc.com>
6174M: steve.glendinning@smsc.com
6175L: netdev@vger.kernel.org 5327L: netdev@vger.kernel.org
6176S: Supported 5328S: Supported
6177F: drivers/net/usb/smsc95xx.* 5329F: drivers/net/usb/smsc95xx.*
6178 5330
6179USB SN9C1xx DRIVER 5331USB SN9C1xx DRIVER
6180P: Luca Risolia 5332M: Luca Risolia <luca.risolia@studio.unibo.it>
6181M: luca.risolia@studio.unibo.it
6182L: linux-usb@vger.kernel.org 5333L: linux-usb@vger.kernel.org
6183L: linux-media@vger.kernel.org 5334L: linux-media@vger.kernel.org
6184T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5335T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6188,8 +5339,7 @@ F: Documentation/video4linux/sn9c102.txt
6188F: drivers/media/video/sn9c102/ 5339F: drivers/media/video/sn9c102/
6189 5340
6190USB SUBSYSTEM 5341USB SUBSYSTEM
6191P: Greg Kroah-Hartman 5342M: Greg Kroah-Hartman <gregkh@suse.de>
6192M: gregkh@suse.de
6193L: linux-usb@vger.kernel.org 5343L: linux-usb@vger.kernel.org
6194W: http://www.linux-usb.org 5344W: http://www.linux-usb.org
6195T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 5345T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
@@ -6201,15 +5351,13 @@ F: include/linux/usb.h
6201F: include/linux/usb/ 5351F: include/linux/usb/
6202 5352
6203USB UHCI DRIVER 5353USB UHCI DRIVER
6204P: Alan Stern 5354M: Alan Stern <stern@rowland.harvard.edu>
6205M: stern@rowland.harvard.edu
6206L: linux-usb@vger.kernel.org 5355L: linux-usb@vger.kernel.org
6207S: Maintained 5356S: Maintained
6208F: drivers/usb/host/uhci* 5357F: drivers/usb/host/uhci*
6209 5358
6210USB "USBNET" DRIVER FRAMEWORK 5359USB "USBNET" DRIVER FRAMEWORK
6211P: David Brownell 5360M: David Brownell <dbrownell@users.sourceforge.net>
6212M: dbrownell@users.sourceforge.net
6213L: netdev@vger.kernel.org 5361L: netdev@vger.kernel.org
6214W: http://www.linux-usb.org/usbnet 5362W: http://www.linux-usb.org/usbnet
6215S: Maintained 5363S: Maintained
@@ -6217,8 +5365,7 @@ F: drivers/net/usb/usbnet.c
6217F: include/linux/usb/usbnet.h 5365F: include/linux/usb/usbnet.h
6218 5366
6219USB VIDEO CLASS 5367USB VIDEO CLASS
6220P: Laurent Pinchart 5368M: Laurent Pinchart <laurent.pinchart@skynet.be>
6221M: laurent.pinchart@skynet.be
6222L: linux-uvc-devel@lists.berlios.de (subscribers-only) 5369L: linux-uvc-devel@lists.berlios.de (subscribers-only)
6223L: linux-media@vger.kernel.org 5370L: linux-media@vger.kernel.org
6224T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5371T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6227,8 +5374,7 @@ S: Maintained
6227F: drivers/media/video/uvc/ 5374F: drivers/media/video/uvc/
6228 5375
6229USB W996[87]CF DRIVER 5376USB W996[87]CF DRIVER
6230P: Luca Risolia 5377M: Luca Risolia <luca.risolia@studio.unibo.it>
6231M: luca.risolia@studio.unibo.it
6232L: linux-usb@vger.kernel.org 5378L: linux-usb@vger.kernel.org
6233L: linux-media@vger.kernel.org 5379L: linux-media@vger.kernel.org
6234T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5380T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6238,21 +5384,18 @@ F: Documentation/video4linux/w9968cf.txt
6238F: drivers/media/video/w996* 5384F: drivers/media/video/w996*
6239 5385
6240USB WIRELESS RNDIS DRIVER (rndis_wlan) 5386USB WIRELESS RNDIS DRIVER (rndis_wlan)
6241P: Jussi Kivilinna 5387M: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
6242M: jussi.kivilinna@mbnet.fi
6243L: linux-wireless@vger.kernel.org 5388L: linux-wireless@vger.kernel.org
6244S: Maintained 5389S: Maintained
6245F: drivers/net/wireless/rndis_wlan.c 5390F: drivers/net/wireless/rndis_wlan.c
6246 5391
6247USB XHCI DRIVER 5392USB XHCI DRIVER
6248P: Sarah Sharp 5393M: Sarah Sharp <sarah.a.sharp@intel.com>
6249M: sarah.a.sharp@intel.com
6250L: linux-usb@vger.kernel.org 5394L: linux-usb@vger.kernel.org
6251S: Supported 5395S: Supported
6252 5396
6253USB ZC0301 DRIVER 5397USB ZC0301 DRIVER
6254P: Luca Risolia 5398M: Luca Risolia <luca.risolia@studio.unibo.it>
6255M: luca.risolia@studio.unibo.it
6256L: linux-usb@vger.kernel.org 5399L: linux-usb@vger.kernel.org
6257L: linux-media@vger.kernel.org 5400L: linux-media@vger.kernel.org
6258T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5401T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6262,16 +5405,14 @@ F: Documentation/video4linux/zc0301.txt
6262F: drivers/media/video/zc0301/ 5405F: drivers/media/video/zc0301/
6263 5406
6264USB ZD1201 DRIVER 5407USB ZD1201 DRIVER
6265P: Jeroen Vreeken 5408M: Jeroen Vreeken <pe1rxq@amsat.org>
6266M: pe1rxq@amsat.org
6267L: linux-usb@vger.kernel.org 5409L: linux-usb@vger.kernel.org
6268W: http://linux-lc100020.sourceforge.net 5410W: http://linux-lc100020.sourceforge.net
6269S: Maintained 5411S: Maintained
6270F: drivers/net/wireless/zd1201.* 5412F: drivers/net/wireless/zd1201.*
6271 5413
6272USB ZR364XX DRIVER 5414USB ZR364XX DRIVER
6273P: Antoine Jacquet 5415M: Antoine Jacquet <royale@zerezo.com>
6274M: royale@zerezo.com
6275L: linux-usb@vger.kernel.org 5416L: linux-usb@vger.kernel.org
6276L: linux-media@vger.kernel.org 5417L: linux-media@vger.kernel.org
6277T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5418T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
@@ -6281,8 +5422,7 @@ F: Documentation/video4linux/zr364xx.txt
6281F: drivers/media/video/zr364xx.c 5422F: drivers/media/video/zr364xx.c
6282 5423
6283USER-MODE LINUX (UML) 5424USER-MODE LINUX (UML)
6284P: Jeff Dike 5425M: Jeff Dike <jdike@addtoit.com>
6285M: jdike@addtoit.com
6286L: user-mode-linux-devel@lists.sourceforge.net 5426L: user-mode-linux-devel@lists.sourceforge.net
6287L: user-mode-linux-user@lists.sourceforge.net 5427L: user-mode-linux-user@lists.sourceforge.net
6288W: http://user-mode-linux.sourceforge.net 5428W: http://user-mode-linux.sourceforge.net
@@ -6293,26 +5433,22 @@ F: fs/hostfs/
6293F: fs/hppfs/ 5433F: fs/hppfs/
6294 5434
6295USERSPACE I/O (UIO) 5435USERSPACE I/O (UIO)
6296P: Hans J. Koch 5436M: "Hans J. Koch" <hjk@linutronix.de>
6297M: hjk@linutronix.de 5437M: Greg Kroah-Hartman <gregkh@suse.de>
6298P: Greg Kroah-Hartman
6299M: gregkh@suse.de
6300S: Maintained 5438S: Maintained
6301F: Documentation/DocBook/uio-howto.tmpl 5439F: Documentation/DocBook/uio-howto.tmpl
6302F: drivers/uio/ 5440F: drivers/uio/
6303F: include/linux/uio*.h 5441F: include/linux/uio*.h
6304 5442
6305UTIL-LINUX-NG PACKAGE 5443UTIL-LINUX-NG PACKAGE
6306P: Karel Zak 5444M: Karel Zak <kzak@redhat.com>
6307M: kzak@redhat.com
6308L: util-linux-ng@vger.kernel.org 5445L: util-linux-ng@vger.kernel.org
6309W: http://kernel.org/~kzak/util-linux-ng/ 5446W: http://kernel.org/~kzak/util-linux-ng/
6310T: git git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git 5447T: git git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
6311S: Maintained 5448S: Maintained
6312 5449
6313UVESAFB DRIVER 5450UVESAFB DRIVER
6314P: Michal Januszewski 5451M: Michal Januszewski <spock@gentoo.org>
6315M: spock@gentoo.org
6316L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5452L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
6317W: http://dev.gentoo.org/~spock/projects/uvesafb/ 5453W: http://dev.gentoo.org/~spock/projects/uvesafb/
6318S: Maintained 5454S: Maintained
@@ -6320,53 +5456,44 @@ F: Documentation/fb/uvesafb.txt
6320F: drivers/video/uvesafb.* 5456F: drivers/video/uvesafb.*
6321 5457
6322VFAT/FAT/MSDOS FILESYSTEM 5458VFAT/FAT/MSDOS FILESYSTEM
6323P: OGAWA Hirofumi 5459M: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
6324M: hirofumi@mail.parknet.co.jp
6325S: Maintained 5460S: Maintained
6326F: Documentation/filesystems/vfat.txt 5461F: Documentation/filesystems/vfat.txt
6327F: fs/fat/ 5462F: fs/fat/
6328 5463
6329VIA RHINE NETWORK DRIVER 5464VIA RHINE NETWORK DRIVER
6330P: Roger Luethi 5465M: Roger Luethi <rl@hellgate.ch>
6331M: rl@hellgate.ch
6332S: Maintained 5466S: Maintained
6333F: drivers/net/via-rhine.c 5467F: drivers/net/via-rhine.c
6334 5468
6335VIAPRO SMBUS DRIVER 5469VIAPRO SMBUS DRIVER
6336P: Jean Delvare 5470M: Jean Delvare <khali@linux-fr.org>
6337M: khali@linux-fr.org
6338L: linux-i2c@vger.kernel.org 5471L: linux-i2c@vger.kernel.org
6339S: Maintained 5472S: Maintained
6340F: Documentation/i2c/busses/i2c-viapro 5473F: Documentation/i2c/busses/i2c-viapro
6341F: drivers/i2c/busses/i2c-viapro.c 5474F: drivers/i2c/busses/i2c-viapro.c
6342 5475
6343VIA SD/MMC CARD CONTROLLER DRIVER 5476VIA SD/MMC CARD CONTROLLER DRIVER
6344P: Joseph Chan 5477M: Joseph Chan <JosephChan@via.com.tw>
6345M: JosephChan@via.com.tw 5478M: Harald Welte <HaraldWelte@viatech.com>
6346P: Harald Welte
6347M: HaraldWelte@viatech.com
6348S: Maintained 5479S: Maintained
6349F: drivers/mmc/host/via-sdmmc.c 5480F: drivers/mmc/host/via-sdmmc.c
6350 5481
6351VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER 5482VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
6352P: Joseph Chan 5483M: Joseph Chan <JosephChan@via.com.tw>
6353M: JosephChan@via.com.tw 5484M: Scott Fang <ScottFang@viatech.com.cn>
6354P: Scott Fang
6355M: ScottFang@viatech.com.cn
6356L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5485L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
6357S: Maintained 5486S: Maintained
6358F: drivers/video/via/ 5487F: drivers/video/via/
6359 5488
6360VIA VELOCITY NETWORK DRIVER 5489VIA VELOCITY NETWORK DRIVER
6361P: Francois Romieu 5490M: Francois Romieu <romieu@fr.zoreil.com>
6362M: romieu@fr.zoreil.com
6363L: netdev@vger.kernel.org 5491L: netdev@vger.kernel.org
6364S: Maintained 5492S: Maintained
6365F: drivers/net/via-velocity.* 5493F: drivers/net/via-velocity.*
6366 5494
6367VLAN (802.1Q) 5495VLAN (802.1Q)
6368P: Patrick McHardy 5496M: Patrick McHardy <kaber@trash.net>
6369M: kaber@trash.net
6370L: netdev@vger.kernel.org 5497L: netdev@vger.kernel.org
6371S: Maintained 5498S: Maintained
6372F: drivers/net/macvlan.c 5499F: drivers/net/macvlan.c
@@ -6374,18 +5501,15 @@ F: include/linux/if_*vlan.h
6374F: net/8021q/ 5501F: net/8021q/
6375 5502
6376VLYNQ BUS 5503VLYNQ BUS
6377P: Florian Fainelli 5504M: Florian Fainelli <florian@openwrt.org>
6378M: florian@openwrt.org
6379L: openwrt-devel@lists.openwrt.org 5505L: openwrt-devel@lists.openwrt.org
6380S: Maintained 5506S: Maintained
6381F: drivers/vlynq/vlynq.c 5507F: drivers/vlynq/vlynq.c
6382F: include/linux/vlynq.h 5508F: include/linux/vlynq.h
6383 5509
6384VOLTAGE AND CURRENT REGULATOR FRAMEWORK 5510VOLTAGE AND CURRENT REGULATOR FRAMEWORK
6385P: Liam Girdwood 5511M: Liam Girdwood <lrg@slimlogic.co.uk>
6386M: lrg@slimlogic.co.uk 5512M: Mark Brown <broonie@opensource.wolfsonmicro.com>
6387P: Mark Brown
6388M: broonie@opensource.wolfsonmicro.com
6389W: http://opensource.wolfsonmicro.com/node/15 5513W: http://opensource.wolfsonmicro.com/node/15
6390W: http://www.slimlogic.co.uk/?p=48 5514W: http://www.slimlogic.co.uk/?p=48
6391T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git 5515T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
@@ -6394,52 +5518,45 @@ F: drivers/regulator/
6394F: include/linux/regulator/ 5518F: include/linux/regulator/
6395 5519
6396VT1211 HARDWARE MONITOR DRIVER 5520VT1211 HARDWARE MONITOR DRIVER
6397P: Juerg Haefliger 5521M: Juerg Haefliger <juergh@gmail.com>
6398M: juergh@gmail.com
6399L: lm-sensors@lm-sensors.org 5522L: lm-sensors@lm-sensors.org
6400S: Maintained 5523S: Maintained
6401F: Documentation/hwmon/vt1211 5524F: Documentation/hwmon/vt1211
6402F: drivers/hwmon/vt1211.c 5525F: drivers/hwmon/vt1211.c
6403 5526
6404VT8231 HARDWARE MONITOR DRIVER 5527VT8231 HARDWARE MONITOR DRIVER
6405P: Roger Lucas 5528M: Roger Lucas <vt8231@hiddenengine.co.uk>
6406M: vt8231@hiddenengine.co.uk
6407L: lm-sensors@lm-sensors.org 5529L: lm-sensors@lm-sensors.org
6408S: Maintained 5530S: Maintained
6409F: drivers/hwmon/vt8231.c 5531F: drivers/hwmon/vt8231.c
6410 5532
6411W1 DALLAS'S 1-WIRE BUS 5533W1 DALLAS'S 1-WIRE BUS
6412P: Evgeniy Polyakov 5534M: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
6413M: johnpol@2ka.mipt.ru
6414S: Maintained 5535S: Maintained
6415F: Documentation/w1/ 5536F: Documentation/w1/
6416F: drivers/w1/ 5537F: drivers/w1/
6417 5538
6418W83791D HARDWARE MONITORING DRIVER 5539W83791D HARDWARE MONITORING DRIVER
6419P: Marc Hulsman 5540M: Marc Hulsman <m.hulsman@tudelft.nl>
6420M: m.hulsman@tudelft.nl
6421L: lm-sensors@lm-sensors.org 5541L: lm-sensors@lm-sensors.org
6422S: Maintained 5542S: Maintained
6423F: Documentation/hwmon/w83791d 5543F: Documentation/hwmon/w83791d
6424F: drivers/hwmon/w83791d.c 5544F: drivers/hwmon/w83791d.c
6425 5545
6426W83793 HARDWARE MONITORING DRIVER 5546W83793 HARDWARE MONITORING DRIVER
6427P: Rudolf Marek 5547M: Rudolf Marek <r.marek@assembler.cz>
6428M: r.marek@assembler.cz
6429L: lm-sensors@lm-sensors.org 5548L: lm-sensors@lm-sensors.org
6430S: Maintained 5549S: Maintained
6431F: Documentation/hwmon/w83793 5550F: Documentation/hwmon/w83793
6432F: drivers/hwmon/w83793.c 5551F: drivers/hwmon/w83793.c
6433 5552
6434W83L51xD SD/MMC CARD INTERFACE DRIVER 5553W83L51xD SD/MMC CARD INTERFACE DRIVER
6435P: Pierre Ossman 5554M: Pierre Ossman <pierre@ossman.eu>
6436M: pierre@ossman.eu
6437S: Maintained 5555S: Maintained
6438F: drivers/mmc/host/wbsd.* 5556F: drivers/mmc/host/wbsd.*
6439 5557
6440WATCHDOG DEVICE DRIVERS 5558WATCHDOG DEVICE DRIVERS
6441P: Wim Van Sebroeck 5559M: Wim Van Sebroeck <wim@iguana.be>
6442M: wim@iguana.be
6443T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git 5560T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
6444S: Maintained 5561S: Maintained
6445F: Documentation/watchdog/ 5562F: Documentation/watchdog/
@@ -6447,8 +5564,7 @@ F: drivers/watchdog/
6447F: include/linux/watchdog.h 5564F: include/linux/watchdog.h
6448 5565
6449WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS 5566WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
6450P: Jean Tourrilhes 5567M: Jean Tourrilhes <jt@hpl.hp.com>
6451M: jt@hpl.hp.com
6452L: linux-wireless@vger.kernel.org 5568L: linux-wireless@vger.kernel.org
6453W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/ 5569W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
6454S: Maintained 5570S: Maintained
@@ -6456,46 +5572,39 @@ F: Documentation/networking/wavelan.txt
6456F: drivers/net/wireless/wavelan* 5572F: drivers/net/wireless/wavelan*
6457 5573
6458WD7000 SCSI DRIVER 5574WD7000 SCSI DRIVER
6459P: Miroslav Zagorac 5575M: Miroslav Zagorac <zaga@fly.cc.fer.hr>
6460M: zaga@fly.cc.fer.hr
6461L: linux-scsi@vger.kernel.org 5576L: linux-scsi@vger.kernel.org
6462S: Maintained 5577S: Maintained
6463F: drivers/scsi/wd7000.c 5578F: drivers/scsi/wd7000.c
6464 5579
6465WIMAX STACK 5580WIMAX STACK
6466P: Inaky Perez-Gonzalez 5581M: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
6467M: inaky.perez-gonzalez@intel.com
6468M: linux-wimax@intel.com 5582M: linux-wimax@intel.com
6469L: wimax@linuxwimax.org 5583L: wimax@linuxwimax.org
6470S: Supported 5584S: Supported
6471W: http://linuxwimax.org 5585W: http://linuxwimax.org
6472 5586
6473WIMEDIA LLC PROTOCOL (WLP) SUBSYSTEM 5587WIMEDIA LLC PROTOCOL (WLP) SUBSYSTEM
6474P: David Vrabel 5588M: David Vrabel <david.vrabel@csr.com>
6475M: david.vrabel@csr.com
6476S: Maintained 5589S: Maintained
6477F: include/linux/wlp.h 5590F: include/linux/wlp.h
6478F: drivers/uwb/wlp/ 5591F: drivers/uwb/wlp/
6479 5592
6480WISTRON LAPTOP BUTTON DRIVER 5593WISTRON LAPTOP BUTTON DRIVER
6481P: Miloslav Trmac 5594M: Miloslav Trmac <mitr@volny.cz>
6482M: mitr@volny.cz
6483S: Maintained 5595S: Maintained
6484F: drivers/input/misc/wistron_btns.c 5596F: drivers/input/misc/wistron_btns.c
6485 5597
6486WL3501 WIRELESS PCMCIA CARD DRIVER 5598WL3501 WIRELESS PCMCIA CARD DRIVER
6487P: Arnaldo Carvalho de Melo 5599M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
6488M: acme@ghostprotocols.net
6489L: linux-wireless@vger.kernel.org 5600L: linux-wireless@vger.kernel.org
6490W: http://oops.ghostprotocols.net:81/blog 5601W: http://oops.ghostprotocols.net:81/blog
6491S: Maintained 5602S: Maintained
6492F: drivers/net/wireless/wl3501* 5603F: drivers/net/wireless/wl3501*
6493 5604
6494WM97XX TOUCHSCREEN DRIVERS 5605WM97XX TOUCHSCREEN DRIVERS
6495P: Mark Brown 5606M: Mark Brown <broonie@opensource.wolfsonmicro.com>
6496M: broonie@opensource.wolfsonmicro.com 5607M: Liam Girdwood <lrg@slimlogic.co.uk>
6497P: Liam Girdwood
6498M: lrg@slimlogic.co.uk
6499L: linux-input@vger.kernel.org 5608L: linux-input@vger.kernel.org
6500T: git git://opensource.wolfsonmicro.com/linux-2.6-touch 5609T: git git://opensource.wolfsonmicro.com/linux-2.6-touch
6501W: http://opensource.wolfsonmicro.com/node/7 5610W: http://opensource.wolfsonmicro.com/node/7
@@ -6504,8 +5613,7 @@ F: drivers/input/touchscreen/*wm97*
6504F: include/linux/wm97xx.h 5613F: include/linux/wm97xx.h
6505 5614
6506X.25 NETWORK LAYER 5615X.25 NETWORK LAYER
6507P: Henner Eisen 5616M: Henner Eisen <eis@baty.hanse.de>
6508M: eis@baty.hanse.de
6509L: linux-x25@vger.kernel.org 5617L: linux-x25@vger.kernel.org
6510S: Maintained 5618S: Maintained
6511F: Documentation/networking/x25* 5619F: Documentation/networking/x25*
@@ -6513,12 +5621,9 @@ F: include/net/x25*
6513F: net/x25/ 5621F: net/x25/
6514 5622
6515X86 ARCHITECTURE (32-BIT AND 64-BIT) 5623X86 ARCHITECTURE (32-BIT AND 64-BIT)
6516P: Thomas Gleixner 5624M: Thomas Gleixner <tglx@linutronix.de>
6517M: tglx@linutronix.de 5625M: Ingo Molnar <mingo@redhat.com>
6518P: Ingo Molnar 5626M: "H. Peter Anvin" <hpa@zytor.com>
6519M: mingo@redhat.com
6520P: H. Peter Anvin
6521M: hpa@zytor.com
6522M: x86@kernel.org 5627M: x86@kernel.org
6523T: git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 5628T: git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
6524S: Maintained 5629S: Maintained
@@ -6526,10 +5631,8 @@ F: Documentation/x86/
6526F: arch/x86/ 5631F: arch/x86/
6527 5632
6528XEN HYPERVISOR INTERFACE 5633XEN HYPERVISOR INTERFACE
6529P: Jeremy Fitzhardinge 5634M: Jeremy Fitzhardinge <jeremy@xensource.com>
6530M: jeremy@xensource.com 5635M: Chris Wright <chrisw@sous-sol.org>
6531P: Chris Wright
6532M: chrisw@sous-sol.org
6533L: virtualization@lists.osdl.org 5636L: virtualization@lists.osdl.org
6534L: xen-devel@lists.xensource.com 5637L: xen-devel@lists.xensource.com
6535S: Supported 5638S: Supported
@@ -6541,8 +5644,7 @@ F: include/xen/
6541 5644
6542XFS FILESYSTEM 5645XFS FILESYSTEM
6543P: Silicon Graphics Inc 5646P: Silicon Graphics Inc
6544P: Felix Blyakher 5647M: Felix Blyakher <felixb@sgi.com>
6545M: felixb@sgi.com
6546M: xfs-masters@oss.sgi.com 5648M: xfs-masters@oss.sgi.com
6547L: xfs@oss.sgi.com 5649L: xfs@oss.sgi.com
6548W: http://oss.sgi.com/projects/xfs 5650W: http://oss.sgi.com/projects/xfs
@@ -6552,38 +5654,33 @@ F: Documentation/filesystems/xfs.txt
6552F: fs/xfs/ 5654F: fs/xfs/
6553 5655
6554XILINX SYSTEMACE DRIVER 5656XILINX SYSTEMACE DRIVER
6555P: Grant Likely 5657M: Grant Likely <grant.likely@secretlab.ca>
6556M: grant.likely@secretlab.ca
6557W: http://www.secretlab.ca/ 5658W: http://www.secretlab.ca/
6558S: Maintained 5659S: Maintained
6559F: drivers/block/xsysace.c 5660F: drivers/block/xsysace.c
6560 5661
6561XILINX UARTLITE SERIAL DRIVER 5662XILINX UARTLITE SERIAL DRIVER
6562P: Peter Korsgaard 5663M: Peter Korsgaard <jacmet@sunsite.dk>
6563M: jacmet@sunsite.dk
6564L: linux-serial@vger.kernel.org 5664L: linux-serial@vger.kernel.org
6565S: Maintained 5665S: Maintained
6566F: drivers/serial/uartlite.c 5666F: drivers/serial/uartlite.c
6567 5667
6568YAM DRIVER FOR AX.25 5668YAM DRIVER FOR AX.25
6569P: Jean-Paul Roubelat 5669M: Jean-Paul Roubelat <jpr@f6fbb.org>
6570M: jpr@f6fbb.org
6571L: linux-hams@vger.kernel.org 5670L: linux-hams@vger.kernel.org
6572S: Maintained 5671S: Maintained
6573F: drivers/net/hamradio/yam* 5672F: drivers/net/hamradio/yam*
6574F: include/linux/yam.h 5673F: include/linux/yam.h
6575 5674
6576YEALINK PHONE DRIVER 5675YEALINK PHONE DRIVER
6577P: Henk Vergonet 5676M: Henk Vergonet <Henk.Vergonet@gmail.com>
6578M: Henk.Vergonet@gmail.com
6579L: usbb2k-api-dev@nongnu.org 5677L: usbb2k-api-dev@nongnu.org
6580S: Maintained 5678S: Maintained
6581F: Documentation/input/yealink.txt 5679F: Documentation/input/yealink.txt
6582F: drivers/input/misc/yealink.* 5680F: drivers/input/misc/yealink.*
6583 5681
6584Z8530 DRIVER FOR AX.25 5682Z8530 DRIVER FOR AX.25
6585P: Joerg Reuter 5683M: Joerg Reuter <jreuter@yaina.de>
6586M: jreuter@yaina.de
6587W: http://yaina.de/jreuter/ 5684W: http://yaina.de/jreuter/
6588W: http://www.qsl.net/dl1bke/ 5685W: http://www.qsl.net/dl1bke/
6589L: linux-hams@vger.kernel.org 5686L: linux-hams@vger.kernel.org
@@ -6593,10 +5690,8 @@ F: drivers/net/hamradio/*scc.c
6593F: drivers/net/hamradio/z8530.h 5690F: drivers/net/hamradio/z8530.h
6594 5691
6595ZD1211RW WIRELESS DRIVER 5692ZD1211RW WIRELESS DRIVER
6596P: Daniel Drake 5693M: Daniel Drake <dsd@gentoo.org>
6597M: dsd@gentoo.org 5694M: Ulrich Kunitz <kune@deine-taler.de>
6598P: Ulrich Kunitz
6599M: kune@deine-taler.de
6600W: http://zd1211.ath.cx/wiki/DriverRewrite 5695W: http://zd1211.ath.cx/wiki/DriverRewrite
6601L: linux-wireless@vger.kernel.org 5696L: linux-wireless@vger.kernel.org
6602L: zd1211-devs@lists.sourceforge.net (subscribers-only) 5697L: zd1211-devs@lists.sourceforge.net (subscribers-only)
@@ -6612,14 +5707,12 @@ S: Odd Fixes
6612F: drivers/media/video/zoran/ 5707F: drivers/media/video/zoran/
6613 5708
6614ZS DECSTATION Z85C30 SERIAL DRIVER 5709ZS DECSTATION Z85C30 SERIAL DRIVER
6615P: Maciej W. Rozycki 5710M: "Maciej W. Rozycki" <macro@linux-mips.org>
6616M: macro@linux-mips.org
6617S: Maintained 5711S: Maintained
6618F: drivers/serial/zs.* 5712F: drivers/serial/zs.*
6619 5713
6620THE REST 5714THE REST
6621P: Linus Torvalds 5715M: Linus Torvalds <torvalds@linux-foundation.org>
6622M: torvalds@linux-foundation.org
6623L: linux-kernel@vger.kernel.org 5716L: linux-kernel@vger.kernel.org
6624T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 5717T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
6625S: Buried alive in reporters 5718S: Buried alive in reporters
diff --git a/Makefile b/Makefile
index 0aeec59c1f0a..0d46615bffe5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 31 3SUBLEVEL = 31
4EXTRAVERSION = -rc2 4EXTRAVERSION = -rc5
5NAME = Man-Eating Seals of Antiquity 5NAME = Man-Eating Seals of Antiquity
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -343,7 +343,8 @@ KBUILD_CPPFLAGS := -D__KERNEL__
343KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 343KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
344 -fno-strict-aliasing -fno-common \ 344 -fno-strict-aliasing -fno-common \
345 -Werror-implicit-function-declaration \ 345 -Werror-implicit-function-declaration \
346 -Wno-format-security 346 -Wno-format-security \
347 -fno-delete-null-pointer-checks
347KBUILD_AFLAGS := -D__ASSEMBLY__ 348KBUILD_AFLAGS := -D__ASSEMBLY__
348 349
349# Read KERNELRELEASE from include/config/kernel.release (if it exists) 350# Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@ -565,7 +566,7 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
565KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) 566KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
566 567
567# disable invalid "can't wrap" optimizations for signed / pointers 568# disable invalid "can't wrap" optimizations for signed / pointers
568KBUILD_CFLAGS += $(call cc-option,-fwrapv) 569KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
569 570
570# revert to pre-gcc-4.4 behaviour of .eh_frame 571# revert to pre-gcc-4.4 behaviour of .eh_frame
571KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) 572KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
diff --git a/arch/alpha/include/asm/tlb.h b/arch/alpha/include/asm/tlb.h
index c13636575fba..42866759f3fa 100644
--- a/arch/alpha/include/asm/tlb.h
+++ b/arch/alpha/include/asm/tlb.h
@@ -9,7 +9,7 @@
9 9
10#include <asm-generic/tlb.h> 10#include <asm-generic/tlb.h>
11 11
12#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 12#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
13#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 13#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
14 14
15#endif 15#endif
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 1e9ad52c460e..e072041d19f8 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -8,7 +8,6 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/smp_lock.h>
12#include <linux/errno.h> 11#include <linux/errno.h>
13#include <linux/ptrace.h> 12#include <linux/ptrace.h>
14#include <linux/user.h> 13#include <linux/user.h>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5d60508472f0..d778a699f577 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -46,10 +46,6 @@ config GENERIC_CLOCKEVENTS_BROADCAST
46 depends on GENERIC_CLOCKEVENTS 46 depends on GENERIC_CLOCKEVENTS
47 default y if SMP && !LOCAL_TIMERS 47 default y if SMP && !LOCAL_TIMERS
48 48
49config MMU
50 bool
51 default y
52
53config NO_IOPORT 49config NO_IOPORT
54 bool 50 bool
55 51
@@ -126,6 +122,13 @@ config ARCH_HAS_ILOG2_U32
126config ARCH_HAS_ILOG2_U64 122config ARCH_HAS_ILOG2_U64
127 bool 123 bool
128 124
125config ARCH_HAS_CPUFREQ
126 bool
127 help
128 Internal node to signify that the ARCH has CPUFREQ support
129 and that the relevant menu configurations are displayed for
130 it.
131
129config GENERIC_HWEIGHT 132config GENERIC_HWEIGHT
130 bool 133 bool
131 default y 134 default y
@@ -188,6 +191,13 @@ source "kernel/Kconfig.freezer"
188 191
189menu "System Type" 192menu "System Type"
190 193
194config MMU
195 bool "MMU-based Paged Memory Management Support"
196 default y
197 help
198 Select if you want MMU-based virtualised addressing space
199 support by paged memory management. If unsure, say 'Y'.
200
191choice 201choice
192 prompt "ARM system type" 202 prompt "ARM system type"
193 default ARCH_VERSATILE 203 default ARCH_VERSATILE
@@ -203,6 +213,7 @@ config ARCH_AAEC2000
203config ARCH_INTEGRATOR 213config ARCH_INTEGRATOR
204 bool "ARM Ltd. Integrator family" 214 bool "ARM Ltd. Integrator family"
205 select ARM_AMBA 215 select ARM_AMBA
216 select ARCH_HAS_CPUFREQ
206 select HAVE_CLK 217 select HAVE_CLK
207 select COMMON_CLKDEV 218 select COMMON_CLKDEV
208 select ICST525 219 select ICST525
@@ -329,6 +340,20 @@ config ARCH_H720X
329 help 340 help
330 This enables support for systems based on the Hynix HMS720x 341 This enables support for systems based on the Hynix HMS720x
331 342
343config ARCH_NOMADIK
344 bool "STMicroelectronics Nomadik"
345 select ARM_AMBA
346 select ARM_VIC
347 select CPU_ARM926T
348 select HAVE_CLK
349 select COMMON_CLKDEV
350 select GENERIC_TIME
351 select GENERIC_CLOCKEVENTS
352 select GENERIC_GPIO
353 select ARCH_REQUIRE_GPIOLIB
354 help
355 Support for the Nomadik platform by ST-Ericsson
356
332config ARCH_IOP13XX 357config ARCH_IOP13XX
333 bool "IOP13xx-based" 358 bool "IOP13xx-based"
334 depends on MMU 359 depends on MMU
@@ -519,6 +544,7 @@ config ARCH_PXA
519 bool "PXA2xx/PXA3xx-based" 544 bool "PXA2xx/PXA3xx-based"
520 depends on MMU 545 depends on MMU
521 select ARCH_MTD_XIP 546 select ARCH_MTD_XIP
547 select ARCH_HAS_CPUFREQ
522 select GENERIC_GPIO 548 select GENERIC_GPIO
523 select HAVE_CLK 549 select HAVE_CLK
524 select COMMON_CLKDEV 550 select COMMON_CLKDEV
@@ -561,6 +587,7 @@ config ARCH_SA1100
561 select ISA 587 select ISA
562 select ARCH_SPARSEMEM_ENABLE 588 select ARCH_SPARSEMEM_ENABLE
563 select ARCH_MTD_XIP 589 select ARCH_MTD_XIP
590 select ARCH_HAS_CPUFREQ
564 select GENERIC_GPIO 591 select GENERIC_GPIO
565 select GENERIC_TIME 592 select GENERIC_TIME
566 select GENERIC_CLOCKEVENTS 593 select GENERIC_CLOCKEVENTS
@@ -573,6 +600,7 @@ config ARCH_SA1100
573config ARCH_S3C2410 600config ARCH_S3C2410
574 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443" 601 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
575 select GENERIC_GPIO 602 select GENERIC_GPIO
603 select ARCH_HAS_CPUFREQ
576 select HAVE_CLK 604 select HAVE_CLK
577 help 605 help
578 Samsung S3C2410X CPU based systems, such as the Simtec Electronics 606 Samsung S3C2410X CPU based systems, such as the Simtec Electronics
@@ -583,9 +611,18 @@ config ARCH_S3C64XX
583 bool "Samsung S3C64XX" 611 bool "Samsung S3C64XX"
584 select GENERIC_GPIO 612 select GENERIC_GPIO
585 select HAVE_CLK 613 select HAVE_CLK
614 select ARCH_HAS_CPUFREQ
586 help 615 help
587 Samsung S3C64XX series based systems 616 Samsung S3C64XX series based systems
588 617
618config ARCH_S5PC1XX
619 bool "Samsung S5PC1XX"
620 select GENERIC_GPIO
621 select HAVE_CLK
622 select CPU_V7
623 help
624 Samsung S5PC1XX series based systems
625
589config ARCH_SHARK 626config ARCH_SHARK
590 bool "Shark" 627 bool "Shark"
591 select CPU_SA110 628 select CPU_SA110
@@ -642,6 +679,7 @@ config ARCH_OMAP
642 select GENERIC_GPIO 679 select GENERIC_GPIO
643 select HAVE_CLK 680 select HAVE_CLK
644 select ARCH_REQUIRE_GPIOLIB 681 select ARCH_REQUIRE_GPIOLIB
682 select ARCH_HAS_CPUFREQ
645 select GENERIC_TIME 683 select GENERIC_TIME
646 select GENERIC_CLOCKEVENTS 684 select GENERIC_CLOCKEVENTS
647 help 685 help
@@ -707,6 +745,7 @@ source "arch/arm/mach-kirkwood/Kconfig"
707source "arch/arm/plat-s3c24xx/Kconfig" 745source "arch/arm/plat-s3c24xx/Kconfig"
708source "arch/arm/plat-s3c64xx/Kconfig" 746source "arch/arm/plat-s3c64xx/Kconfig"
709source "arch/arm/plat-s3c/Kconfig" 747source "arch/arm/plat-s3c/Kconfig"
748source "arch/arm/plat-s5pc1xx/Kconfig"
710 749
711if ARCH_S3C2410 750if ARCH_S3C2410
712source "arch/arm/mach-s3c2400/Kconfig" 751source "arch/arm/mach-s3c2400/Kconfig"
@@ -724,6 +763,10 @@ endif
724 763
725source "arch/arm/plat-stmp3xxx/Kconfig" 764source "arch/arm/plat-stmp3xxx/Kconfig"
726 765
766if ARCH_S5PC1XX
767source "arch/arm/mach-s5pc100/Kconfig"
768endif
769
727source "arch/arm/mach-lh7a40x/Kconfig" 770source "arch/arm/mach-lh7a40x/Kconfig"
728 771
729source "arch/arm/mach-h720x/Kconfig" 772source "arch/arm/mach-h720x/Kconfig"
@@ -738,6 +781,8 @@ source "arch/arm/mach-at91/Kconfig"
738 781
739source "arch/arm/plat-mxc/Kconfig" 782source "arch/arm/plat-mxc/Kconfig"
740 783
784source "arch/arm/mach-nomadik/Kconfig"
785
741source "arch/arm/mach-netx/Kconfig" 786source "arch/arm/mach-netx/Kconfig"
742 787
743source "arch/arm/mach-ns9xxx/Kconfig" 788source "arch/arm/mach-ns9xxx/Kconfig"
@@ -986,18 +1031,7 @@ config LOCAL_TIMERS
986 accounting to be spread across the timer interval, preventing a 1031 accounting to be spread across the timer interval, preventing a
987 "thundering herd" at every timer tick. 1032 "thundering herd" at every timer tick.
988 1033
989config PREEMPT 1034source kernel/Kconfig.preempt
990 bool "Preemptible Kernel (EXPERIMENTAL)"
991 depends on EXPERIMENTAL
992 help
993 This option reduces the latency of the kernel when reacting to
994 real-time or interactive events by allowing a low priority process to
995 be preempted even if it is in kernel mode executing a system call.
996 This allows applications to run more reliably even when the system is
997 under load.
998
999 Say Y here if you are building a kernel for a desktop, embedded
1000 or real-time system. Say N if you are unsure.
1001 1035
1002config HZ 1036config HZ
1003 int 1037 int
@@ -1007,6 +1041,21 @@ config HZ
1007 default AT91_TIMER_HZ if ARCH_AT91 1041 default AT91_TIMER_HZ if ARCH_AT91
1008 default 100 1042 default 100
1009 1043
1044config THUMB2_KERNEL
1045 bool "Compile the kernel in Thumb-2 mode"
1046 depends on CPU_V7 && EXPERIMENTAL
1047 select AEABI
1048 select ARM_ASM_UNIFIED
1049 help
1050 By enabling this option, the kernel will be compiled in
1051 Thumb-2 mode. A compiler/assembler that understand the unified
1052 ARM-Thumb syntax is needed.
1053
1054 If unsure, say N.
1055
1056config ARM_ASM_UNIFIED
1057 bool
1058
1010config AEABI 1059config AEABI
1011 bool "Use the ARM EABI to compile the kernel" 1060 bool "Use the ARM EABI to compile the kernel"
1012 help 1061 help
@@ -1270,7 +1319,7 @@ endmenu
1270 1319
1271menu "CPU Power Management" 1320menu "CPU Power Management"
1272 1321
1273if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_PXA || ARCH_S3C64XX) 1322if ARCH_HAS_CPUFREQ
1274 1323
1275source "drivers/cpufreq/Kconfig" 1324source "drivers/cpufreq/Kconfig"
1276 1325
@@ -1305,6 +1354,52 @@ config CPU_FREQ_S3C64XX
1305 bool "CPUfreq support for Samsung S3C64XX CPUs" 1354 bool "CPUfreq support for Samsung S3C64XX CPUs"
1306 depends on CPU_FREQ && CPU_S3C6410 1355 depends on CPU_FREQ && CPU_S3C6410
1307 1356
1357config CPU_FREQ_S3C
1358 bool
1359 help
1360 Internal configuration node for common cpufreq on Samsung SoC
1361
1362config CPU_FREQ_S3C24XX
1363 bool "CPUfreq driver for Samsung S3C24XX series CPUs"
1364 depends on ARCH_S3C2410 && CPU_FREQ && EXPERIMENTAL
1365 select CPU_FREQ_S3C
1366 help
1367 This enables the CPUfreq driver for the Samsung S3C24XX family
1368 of CPUs.
1369
1370 For details, take a look at <file:Documentation/cpu-freq>.
1371
1372 If in doubt, say N.
1373
1374config CPU_FREQ_S3C24XX_PLL
1375 bool "Support CPUfreq changing of PLL frequency"
1376 depends on CPU_FREQ_S3C24XX && EXPERIMENTAL
1377 help
1378 Compile in support for changing the PLL frequency from the
1379 S3C24XX series CPUfreq driver. The PLL takes time to settle
1380 after a frequency change, so by default it is not enabled.
1381
1382 This also means that the PLL tables for the selected CPU(s) will
1383 be built which may increase the size of the kernel image.
1384
1385config CPU_FREQ_S3C24XX_DEBUG
1386 bool "Debug CPUfreq Samsung driver core"
1387 depends on CPU_FREQ_S3C24XX
1388 help
1389 Enable s3c_freq_dbg for the Samsung S3C CPUfreq core
1390
1391config CPU_FREQ_S3C24XX_IODEBUG
1392 bool "Debug CPUfreq Samsung driver IO timing"
1393 depends on CPU_FREQ_S3C24XX
1394 help
1395 Enable s3c_freq_iodbg for the Samsung S3C CPUfreq core
1396
1397config CPU_FREQ_S3C24XX_DEBUGFS
1398 bool "Export debugfs for CPUFreq"
1399 depends on CPU_FREQ_S3C24XX && DEBUG_FS
1400 help
1401 Export status information via debugfs.
1402
1308endif 1403endif
1309 1404
1310source "drivers/cpuidle/Kconfig" 1405source "drivers/cpuidle/Kconfig"
@@ -1406,107 +1501,7 @@ endmenu
1406 1501
1407source "net/Kconfig" 1502source "net/Kconfig"
1408 1503
1409menu "Device Drivers" 1504source "drivers/Kconfig"
1410
1411source "drivers/base/Kconfig"
1412
1413source "drivers/connector/Kconfig"
1414
1415if ALIGNMENT_TRAP || !CPU_CP15_MMU
1416source "drivers/mtd/Kconfig"
1417endif
1418
1419source "drivers/parport/Kconfig"
1420
1421source "drivers/pnp/Kconfig"
1422
1423source "drivers/block/Kconfig"
1424
1425# misc before ide - BLK_DEV_SGIIOC4 depends on SGI_IOC4
1426
1427source "drivers/misc/Kconfig"
1428
1429source "drivers/ide/Kconfig"
1430
1431source "drivers/scsi/Kconfig"
1432
1433source "drivers/ata/Kconfig"
1434
1435source "drivers/md/Kconfig"
1436
1437source "drivers/message/fusion/Kconfig"
1438
1439source "drivers/ieee1394/Kconfig"
1440
1441source "drivers/message/i2o/Kconfig"
1442
1443source "drivers/net/Kconfig"
1444
1445source "drivers/isdn/Kconfig"
1446
1447# input before char - char/joystick depends on it. As does USB.
1448
1449source "drivers/input/Kconfig"
1450
1451source "drivers/char/Kconfig"
1452
1453source "drivers/i2c/Kconfig"
1454
1455source "drivers/spi/Kconfig"
1456
1457source "drivers/gpio/Kconfig"
1458
1459source "drivers/w1/Kconfig"
1460
1461source "drivers/power/Kconfig"
1462
1463source "drivers/hwmon/Kconfig"
1464
1465source "drivers/thermal/Kconfig"
1466
1467source "drivers/watchdog/Kconfig"
1468
1469source "drivers/ssb/Kconfig"
1470
1471#source "drivers/l3/Kconfig"
1472
1473source "drivers/mfd/Kconfig"
1474
1475source "drivers/media/Kconfig"
1476
1477source "drivers/video/Kconfig"
1478
1479source "sound/Kconfig"
1480
1481source "drivers/hid/Kconfig"
1482
1483source "drivers/usb/Kconfig"
1484
1485source "drivers/uwb/Kconfig"
1486
1487source "drivers/mmc/Kconfig"
1488
1489source "drivers/memstick/Kconfig"
1490
1491source "drivers/accessibility/Kconfig"
1492
1493source "drivers/leds/Kconfig"
1494
1495source "drivers/rtc/Kconfig"
1496
1497source "drivers/dma/Kconfig"
1498
1499source "drivers/dca/Kconfig"
1500
1501source "drivers/auxdisplay/Kconfig"
1502
1503source "drivers/regulator/Kconfig"
1504
1505source "drivers/uio/Kconfig"
1506
1507source "drivers/staging/Kconfig"
1508
1509endmenu
1510 1505
1511source "fs/Kconfig" 1506source "fs/Kconfig"
1512 1507
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index a89e4734b8f0..1a6f70e52921 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -8,6 +8,7 @@ source "lib/Kconfig.debug"
8# n, but then RMK will have to kill you ;). 8# n, but then RMK will have to kill you ;).
9config FRAME_POINTER 9config FRAME_POINTER
10 bool 10 bool
11 depends on !THUMB2_KERNEL
11 default y if !ARM_UNWIND 12 default y if !ARM_UNWIND
12 help 13 help
13 If you say N here, the resulting kernel will be slightly smaller and 14 If you say N here, the resulting kernel will be slightly smaller and
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index b9ae98b88a7e..7350557a81e0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -93,9 +93,16 @@ ifeq ($(CONFIG_ARM_UNWIND),y)
93CFLAGS_ABI +=-funwind-tables 93CFLAGS_ABI +=-funwind-tables
94endif 94endif
95 95
96ifeq ($(CONFIG_THUMB2_KERNEL),y)
97AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=thumb,-Wa$(comma)-mauto-it)
98AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
99CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
100AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
101endif
102
96# Need -Uarm for gcc < 3.x 103# Need -Uarm for gcc < 3.x
97KBUILD_CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm 104KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_THUMB2) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
98KBUILD_AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float 105KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_THUMB2) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
99 106
100CHECKFLAGS += -D__arm__ 107CHECKFLAGS += -D__arm__
101 108
@@ -136,8 +143,10 @@ machine-$(CONFIG_ARCH_MSM) := msm
136machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 143machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0
137machine-$(CONFIG_ARCH_MX1) := mx1 144machine-$(CONFIG_ARCH_MX1) := mx1
138machine-$(CONFIG_ARCH_MX2) := mx2 145machine-$(CONFIG_ARCH_MX2) := mx2
146machine-$(CONFIG_ARCH_MX25) := mx25
139machine-$(CONFIG_ARCH_MX3) := mx3 147machine-$(CONFIG_ARCH_MX3) := mx3
140machine-$(CONFIG_ARCH_NETX) := netx 148machine-$(CONFIG_ARCH_NETX) := netx
149machine-$(CONFIG_ARCH_NOMADIK) := nomadik
141machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx 150machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx
142machine-$(CONFIG_ARCH_OMAP1) := omap1 151machine-$(CONFIG_ARCH_OMAP1) := omap1
143machine-$(CONFIG_ARCH_OMAP2) := omap2 152machine-$(CONFIG_ARCH_OMAP2) := omap2
@@ -151,6 +160,7 @@ machine-$(CONFIG_ARCH_RPC) := rpc
151machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 160machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443
152machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 161machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
153machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 162machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410
163machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100
154machine-$(CONFIG_ARCH_SA1100) := sa1100 164machine-$(CONFIG_ARCH_SA1100) := sa1100
155machine-$(CONFIG_ARCH_SHARK) := shark 165machine-$(CONFIG_ARCH_SHARK) := shark
156machine-$(CONFIG_ARCH_STMP378X) := stmp378x 166machine-$(CONFIG_ARCH_STMP378X) := stmp378x
@@ -159,6 +169,7 @@ machine-$(CONFIG_ARCH_U300) := u300
159machine-$(CONFIG_ARCH_VERSATILE) := versatile 169machine-$(CONFIG_ARCH_VERSATILE) := versatile
160machine-$(CONFIG_ARCH_W90X900) := w90x900 170machine-$(CONFIG_ARCH_W90X900) := w90x900
161machine-$(CONFIG_FOOTBRIDGE) := footbridge 171machine-$(CONFIG_FOOTBRIDGE) := footbridge
172machine-$(CONFIG_ARCH_MXC91231) := mxc91231
162 173
163# Platform directory name. This list is sorted alphanumerically 174# Platform directory name. This list is sorted alphanumerically
164# by CONFIG_* macro name. 175# by CONFIG_* macro name.
@@ -169,6 +180,7 @@ plat-$(CONFIG_PLAT_ORION) := orion
169plat-$(CONFIG_PLAT_PXA) := pxa 180plat-$(CONFIG_PLAT_PXA) := pxa
170plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c 181plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c
171plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c 182plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c
183plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx s3c
172plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx 184plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
173 185
174ifeq ($(CONFIG_ARCH_EBSA110),y) 186ifeq ($(CONFIG_ARCH_EBSA110),y)
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index da226abce2d0..4a590f4113e2 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -61,7 +61,7 @@ endif
61 61
62quiet_cmd_uimage = UIMAGE $@ 62quiet_cmd_uimage = UIMAGE $@
63 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ 63 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
64 -C none -a $(LOADADDR) -e $(LOADADDR) \ 64 -C none -a $(LOADADDR) -e $(STARTADDR) \
65 -n 'Linux-$(KERNELRELEASE)' -d $< $@ 65 -n 'Linux-$(KERNELRELEASE)' -d $< $@
66 66
67ifeq ($(CONFIG_ZBOOT_ROM),y) 67ifeq ($(CONFIG_ZBOOT_ROM),y)
@@ -70,6 +70,13 @@ else
70$(obj)/uImage: LOADADDR=$(ZRELADDR) 70$(obj)/uImage: LOADADDR=$(ZRELADDR)
71endif 71endif
72 72
73ifeq ($(CONFIG_THUMB2_KERNEL),y)
74# Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode
75$(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
76else
77$(obj)/uImage: STARTADDR=$(LOADADDR)
78endif
79
73$(obj)/uImage: $(obj)/zImage FORCE 80$(obj)/uImage: $(obj)/zImage FORCE
74 $(call if_changed,uimage) 81 $(call if_changed,uimage)
75 @echo ' Image $@ is ready' 82 @echo ' Image $@ is ready'
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 4515728c5345..fa6fbf45cf3b 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -140,7 +140,8 @@ start:
140 tst r2, #3 @ not user? 140 tst r2, #3 @ not user?
141 bne not_angel 141 bne not_angel
142 mov r0, #0x17 @ angel_SWIreason_EnterSVC 142 mov r0, #0x17 @ angel_SWIreason_EnterSVC
143 swi 0x123456 @ angel_SWI_ARM 143 ARM( swi 0x123456 ) @ angel_SWI_ARM
144 THUMB( svc 0xab ) @ angel_SWI_THUMB
144not_angel: 145not_angel:
145 mrs r2, cpsr @ turn off interrupts to 146 mrs r2, cpsr @ turn off interrupts to
146 orr r2, r2, #0xc0 @ prevent angel from running 147 orr r2, r2, #0xc0 @ prevent angel from running
@@ -161,7 +162,9 @@ not_angel:
161 162
162 .text 163 .text
163 adr r0, LC0 164 adr r0, LC0
164 ldmia r0, {r1, r2, r3, r4, r5, r6, ip, sp} 165 ARM( ldmia r0, {r1, r2, r3, r4, r5, r6, ip, sp} )
166 THUMB( ldmia r0, {r1, r2, r3, r4, r5, r6, ip} )
167 THUMB( ldr sp, [r0, #28] )
165 subs r0, r0, r1 @ calculate the delta offset 168 subs r0, r0, r1 @ calculate the delta offset
166 169
167 @ if delta is zero, we are 170 @ if delta is zero, we are
@@ -263,22 +266,25 @@ not_relocated: mov r0, #0
263 * r6 = processor ID 266 * r6 = processor ID
264 * r7 = architecture ID 267 * r7 = architecture ID
265 * r8 = atags pointer 268 * r8 = atags pointer
266 * r9-r14 = corrupted 269 * r9-r12,r14 = corrupted
267 */ 270 */
268 add r1, r5, r0 @ end of decompressed kernel 271 add r1, r5, r0 @ end of decompressed kernel
269 adr r2, reloc_start 272 adr r2, reloc_start
270 ldr r3, LC1 273 ldr r3, LC1
271 add r3, r2, r3 274 add r3, r2, r3
2721: ldmia r2!, {r9 - r14} @ copy relocation code 2751: ldmia r2!, {r9 - r12, r14} @ copy relocation code
273 stmia r1!, {r9 - r14} 276 stmia r1!, {r9 - r12, r14}
274 ldmia r2!, {r9 - r14} 277 ldmia r2!, {r9 - r12, r14}
275 stmia r1!, {r9 - r14} 278 stmia r1!, {r9 - r12, r14}
276 cmp r2, r3 279 cmp r2, r3
277 blo 1b 280 blo 1b
278 add sp, r1, #128 @ relocate the stack 281 mov sp, r1
282 add sp, sp, #128 @ relocate the stack
279 283
280 bl cache_clean_flush 284 bl cache_clean_flush
281 add pc, r5, r0 @ call relocation code 285 ARM( add pc, r5, r0 ) @ call relocation code
286 THUMB( add r12, r5, r0 )
287 THUMB( mov pc, r12 ) @ call relocation code
282 288
283/* 289/*
284 * We're not in danger of overwriting ourselves. Do this the simple way. 290 * We're not in danger of overwriting ourselves. Do this the simple way.
@@ -291,6 +297,7 @@ wont_overwrite: mov r0, r4
291 bl decompress_kernel 297 bl decompress_kernel
292 b call_kernel 298 b call_kernel
293 299
300 .align 2
294 .type LC0, #object 301 .type LC0, #object
295LC0: .word LC0 @ r1 302LC0: .word LC0 @ r1
296 .word __bss_start @ r2 303 .word __bss_start @ r2
@@ -431,6 +438,7 @@ ENDPROC(__setup_mmu)
431 438
432__armv4_mmu_cache_on: 439__armv4_mmu_cache_on:
433 mov r12, lr 440 mov r12, lr
441#ifdef CONFIG_MMU
434 bl __setup_mmu 442 bl __setup_mmu
435 mov r0, #0 443 mov r0, #0
436 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 444 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
@@ -444,10 +452,12 @@ __armv4_mmu_cache_on:
444 bl __common_mmu_cache_on 452 bl __common_mmu_cache_on
445 mov r0, #0 453 mov r0, #0
446 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs 454 mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
455#endif
447 mov pc, r12 456 mov pc, r12
448 457
449__armv7_mmu_cache_on: 458__armv7_mmu_cache_on:
450 mov r12, lr 459 mov r12, lr
460#ifdef CONFIG_MMU
451 mrc p15, 0, r11, c0, c1, 4 @ read ID_MMFR0 461 mrc p15, 0, r11, c0, c1, 4 @ read ID_MMFR0
452 tst r11, #0xf @ VMSA 462 tst r11, #0xf @ VMSA
453 blne __setup_mmu 463 blne __setup_mmu
@@ -455,9 +465,11 @@ __armv7_mmu_cache_on:
455 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 465 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
456 tst r11, #0xf @ VMSA 466 tst r11, #0xf @ VMSA
457 mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs 467 mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
468#endif
458 mrc p15, 0, r0, c1, c0, 0 @ read control reg 469 mrc p15, 0, r0, c1, c0, 0 @ read control reg
459 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement 470 orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
460 orr r0, r0, #0x003c @ write buffer 471 orr r0, r0, #0x003c @ write buffer
472#ifdef CONFIG_MMU
461#ifdef CONFIG_CPU_ENDIAN_BE8 473#ifdef CONFIG_CPU_ENDIAN_BE8
462 orr r0, r0, #1 << 25 @ big-endian page tables 474 orr r0, r0, #1 << 25 @ big-endian page tables
463#endif 475#endif
@@ -465,6 +477,7 @@ __armv7_mmu_cache_on:
465 movne r1, #-1 477 movne r1, #-1
466 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer 478 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
467 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control 479 mcrne p15, 0, r1, c3, c0, 0 @ load domain access control
480#endif
468 mcr p15, 0, r0, c1, c0, 0 @ load control register 481 mcr p15, 0, r0, c1, c0, 0 @ load control register
469 mrc p15, 0, r0, c1, c0, 0 @ and read it back 482 mrc p15, 0, r0, c1, c0, 0 @ and read it back
470 mov r0, #0 483 mov r0, #0
@@ -498,6 +511,7 @@ __arm6_mmu_cache_on:
498 mov pc, r12 511 mov pc, r12
499 512
500__common_mmu_cache_on: 513__common_mmu_cache_on:
514#ifndef CONFIG_THUMB2_KERNEL
501#ifndef DEBUG 515#ifndef DEBUG
502 orr r0, r0, #0x000d @ Write buffer, mmu 516 orr r0, r0, #0x000d @ Write buffer, mmu
503#endif 517#endif
@@ -509,6 +523,7 @@ __common_mmu_cache_on:
5091: mcr p15, 0, r0, c1, c0, 0 @ load control register 5231: mcr p15, 0, r0, c1, c0, 0 @ load control register
510 mrc p15, 0, r0, c1, c0, 0 @ and read it back to 524 mrc p15, 0, r0, c1, c0, 0 @ and read it back to
511 sub pc, lr, r0, lsr #32 @ properly flush pipeline 525 sub pc, lr, r0, lsr #32 @ properly flush pipeline
526#endif
512 527
513/* 528/*
514 * All code following this line is relocatable. It is relocated by 529 * All code following this line is relocatable. It is relocated by
@@ -522,7 +537,7 @@ __common_mmu_cache_on:
522 * r6 = processor ID 537 * r6 = processor ID
523 * r7 = architecture ID 538 * r7 = architecture ID
524 * r8 = atags pointer 539 * r8 = atags pointer
525 * r9-r14 = corrupted 540 * r9-r12,r14 = corrupted
526 */ 541 */
527 .align 5 542 .align 5
528reloc_start: add r9, r5, r0 543reloc_start: add r9, r5, r0
@@ -531,13 +546,14 @@ reloc_start: add r9, r5, r0
531 mov r1, r4 546 mov r1, r4
5321: 5471:
533 .rept 4 548 .rept 4
534 ldmia r5!, {r0, r2, r3, r10 - r14} @ relocate kernel 549 ldmia r5!, {r0, r2, r3, r10 - r12, r14} @ relocate kernel
535 stmia r1!, {r0, r2, r3, r10 - r14} 550 stmia r1!, {r0, r2, r3, r10 - r12, r14}
536 .endr 551 .endr
537 552
538 cmp r5, r9 553 cmp r5, r9
539 blo 1b 554 blo 1b
540 add sp, r1, #128 @ relocate the stack 555 mov sp, r1
556 add sp, sp, #128 @ relocate the stack
541 debug_reloc_end 557 debug_reloc_end
542 558
543call_kernel: bl cache_clean_flush 559call_kernel: bl cache_clean_flush
@@ -571,7 +587,9 @@ call_cache_fn: adr r12, proc_types
571 ldr r2, [r12, #4] @ get mask 587 ldr r2, [r12, #4] @ get mask
572 eor r1, r1, r6 @ (real ^ match) 588 eor r1, r1, r6 @ (real ^ match)
573 tst r1, r2 @ & mask 589 tst r1, r2 @ & mask
574 addeq pc, r12, r3 @ call cache function 590 ARM( addeq pc, r12, r3 ) @ call cache function
591 THUMB( addeq r12, r3 )
592 THUMB( moveq pc, r12 ) @ call cache function
575 add r12, r12, #4*5 593 add r12, r12, #4*5
576 b 1b 594 b 1b
577 595
@@ -589,13 +607,15 @@ call_cache_fn: adr r12, proc_types
589 * methods. Writeback caches _must_ have the flush method 607 * methods. Writeback caches _must_ have the flush method
590 * defined. 608 * defined.
591 */ 609 */
610 .align 2
592 .type proc_types,#object 611 .type proc_types,#object
593proc_types: 612proc_types:
594 .word 0x41560600 @ ARM6/610 613 .word 0x41560600 @ ARM6/610
595 .word 0xffffffe0 614 .word 0xffffffe0
596 b __arm6_mmu_cache_off @ works, but slow 615 W(b) __arm6_mmu_cache_off @ works, but slow
597 b __arm6_mmu_cache_off 616 W(b) __arm6_mmu_cache_off
598 mov pc, lr 617 mov pc, lr
618 THUMB( nop )
599@ b __arm6_mmu_cache_on @ untested 619@ b __arm6_mmu_cache_on @ untested
600@ b __arm6_mmu_cache_off 620@ b __arm6_mmu_cache_off
601@ b __armv3_mmu_cache_flush 621@ b __armv3_mmu_cache_flush
@@ -603,76 +623,84 @@ proc_types:
603 .word 0x00000000 @ old ARM ID 623 .word 0x00000000 @ old ARM ID
604 .word 0x0000f000 624 .word 0x0000f000
605 mov pc, lr 625 mov pc, lr
626 THUMB( nop )
606 mov pc, lr 627 mov pc, lr
628 THUMB( nop )
607 mov pc, lr 629 mov pc, lr
630 THUMB( nop )
608 631
609 .word 0x41007000 @ ARM7/710 632 .word 0x41007000 @ ARM7/710
610 .word 0xfff8fe00 633 .word 0xfff8fe00
611 b __arm7_mmu_cache_off 634 W(b) __arm7_mmu_cache_off
612 b __arm7_mmu_cache_off 635 W(b) __arm7_mmu_cache_off
613 mov pc, lr 636 mov pc, lr
637 THUMB( nop )
614 638
615 .word 0x41807200 @ ARM720T (writethrough) 639 .word 0x41807200 @ ARM720T (writethrough)
616 .word 0xffffff00 640 .word 0xffffff00
617 b __armv4_mmu_cache_on 641 W(b) __armv4_mmu_cache_on
618 b __armv4_mmu_cache_off 642 W(b) __armv4_mmu_cache_off
619 mov pc, lr 643 mov pc, lr
644 THUMB( nop )
620 645
621 .word 0x41007400 @ ARM74x 646 .word 0x41007400 @ ARM74x
622 .word 0xff00ff00 647 .word 0xff00ff00
623 b __armv3_mpu_cache_on 648 W(b) __armv3_mpu_cache_on
624 b __armv3_mpu_cache_off 649 W(b) __armv3_mpu_cache_off
625 b __armv3_mpu_cache_flush 650 W(b) __armv3_mpu_cache_flush
626 651
627 .word 0x41009400 @ ARM94x 652 .word 0x41009400 @ ARM94x
628 .word 0xff00ff00 653 .word 0xff00ff00
629 b __armv4_mpu_cache_on 654 W(b) __armv4_mpu_cache_on
630 b __armv4_mpu_cache_off 655 W(b) __armv4_mpu_cache_off
631 b __armv4_mpu_cache_flush 656 W(b) __armv4_mpu_cache_flush
632 657
633 .word 0x00007000 @ ARM7 IDs 658 .word 0x00007000 @ ARM7 IDs
634 .word 0x0000f000 659 .word 0x0000f000
635 mov pc, lr 660 mov pc, lr
661 THUMB( nop )
636 mov pc, lr 662 mov pc, lr
663 THUMB( nop )
637 mov pc, lr 664 mov pc, lr
665 THUMB( nop )
638 666
639 @ Everything from here on will be the new ID system. 667 @ Everything from here on will be the new ID system.
640 668
641 .word 0x4401a100 @ sa110 / sa1100 669 .word 0x4401a100 @ sa110 / sa1100
642 .word 0xffffffe0 670 .word 0xffffffe0
643 b __armv4_mmu_cache_on 671 W(b) __armv4_mmu_cache_on
644 b __armv4_mmu_cache_off 672 W(b) __armv4_mmu_cache_off
645 b __armv4_mmu_cache_flush 673 W(b) __armv4_mmu_cache_flush
646 674
647 .word 0x6901b110 @ sa1110 675 .word 0x6901b110 @ sa1110
648 .word 0xfffffff0 676 .word 0xfffffff0
649 b __armv4_mmu_cache_on 677 W(b) __armv4_mmu_cache_on
650 b __armv4_mmu_cache_off 678 W(b) __armv4_mmu_cache_off
651 b __armv4_mmu_cache_flush 679 W(b) __armv4_mmu_cache_flush
652 680
653 .word 0x56056930 681 .word 0x56056930
654 .word 0xff0ffff0 @ PXA935 682 .word 0xff0ffff0 @ PXA935
655 b __armv4_mmu_cache_on 683 W(b) __armv4_mmu_cache_on
656 b __armv4_mmu_cache_off 684 W(b) __armv4_mmu_cache_off
657 b __armv4_mmu_cache_flush 685 W(b) __armv4_mmu_cache_flush
658 686
659 .word 0x56158000 @ PXA168 687 .word 0x56158000 @ PXA168
660 .word 0xfffff000 688 .word 0xfffff000
661 b __armv4_mmu_cache_on 689 W(b) __armv4_mmu_cache_on
662 b __armv4_mmu_cache_off 690 W(b) __armv4_mmu_cache_off
663 b __armv5tej_mmu_cache_flush 691 W(b) __armv5tej_mmu_cache_flush
664 692
665 .word 0x56056930 693 .word 0x56056930
666 .word 0xff0ffff0 @ PXA935 694 .word 0xff0ffff0 @ PXA935
667 b __armv4_mmu_cache_on 695 W(b) __armv4_mmu_cache_on
668 b __armv4_mmu_cache_off 696 W(b) __armv4_mmu_cache_off
669 b __armv4_mmu_cache_flush 697 W(b) __armv4_mmu_cache_flush
670 698
671 .word 0x56050000 @ Feroceon 699 .word 0x56050000 @ Feroceon
672 .word 0xff0f0000 700 .word 0xff0f0000
673 b __armv4_mmu_cache_on 701 W(b) __armv4_mmu_cache_on
674 b __armv4_mmu_cache_off 702 W(b) __armv4_mmu_cache_off
675 b __armv5tej_mmu_cache_flush 703 W(b) __armv5tej_mmu_cache_flush
676 704
677#ifdef CONFIG_CPU_FEROCEON_OLD_ID 705#ifdef CONFIG_CPU_FEROCEON_OLD_ID
678 /* this conflicts with the standard ARMv5TE entry */ 706 /* this conflicts with the standard ARMv5TE entry */
@@ -685,47 +713,50 @@ proc_types:
685 713
686 .word 0x66015261 @ FA526 714 .word 0x66015261 @ FA526
687 .word 0xff01fff1 715 .word 0xff01fff1
688 b __fa526_cache_on 716 W(b) __fa526_cache_on
689 b __armv4_mmu_cache_off 717 W(b) __armv4_mmu_cache_off
690 b __fa526_cache_flush 718 W(b) __fa526_cache_flush
691 719
692 @ These match on the architecture ID 720 @ These match on the architecture ID
693 721
694 .word 0x00020000 @ ARMv4T 722 .word 0x00020000 @ ARMv4T
695 .word 0x000f0000 723 .word 0x000f0000
696 b __armv4_mmu_cache_on 724 W(b) __armv4_mmu_cache_on
697 b __armv4_mmu_cache_off 725 W(b) __armv4_mmu_cache_off
698 b __armv4_mmu_cache_flush 726 W(b) __armv4_mmu_cache_flush
699 727
700 .word 0x00050000 @ ARMv5TE 728 .word 0x00050000 @ ARMv5TE
701 .word 0x000f0000 729 .word 0x000f0000
702 b __armv4_mmu_cache_on 730 W(b) __armv4_mmu_cache_on
703 b __armv4_mmu_cache_off 731 W(b) __armv4_mmu_cache_off
704 b __armv4_mmu_cache_flush 732 W(b) __armv4_mmu_cache_flush
705 733
706 .word 0x00060000 @ ARMv5TEJ 734 .word 0x00060000 @ ARMv5TEJ
707 .word 0x000f0000 735 .word 0x000f0000
708 b __armv4_mmu_cache_on 736 W(b) __armv4_mmu_cache_on
709 b __armv4_mmu_cache_off 737 W(b) __armv4_mmu_cache_off
710 b __armv5tej_mmu_cache_flush 738 W(b) __armv4_mmu_cache_flush
711 739
712 .word 0x0007b000 @ ARMv6 740 .word 0x0007b000 @ ARMv6
713 .word 0x000ff000 741 .word 0x000ff000
714 b __armv4_mmu_cache_on 742 W(b) __armv4_mmu_cache_on
715 b __armv4_mmu_cache_off 743 W(b) __armv4_mmu_cache_off
716 b __armv6_mmu_cache_flush 744 W(b) __armv6_mmu_cache_flush
717 745
718 .word 0x000f0000 @ new CPU Id 746 .word 0x000f0000 @ new CPU Id
719 .word 0x000f0000 747 .word 0x000f0000
720 b __armv7_mmu_cache_on 748 W(b) __armv7_mmu_cache_on
721 b __armv7_mmu_cache_off 749 W(b) __armv7_mmu_cache_off
722 b __armv7_mmu_cache_flush 750 W(b) __armv7_mmu_cache_flush
723 751
724 .word 0 @ unrecognised type 752 .word 0 @ unrecognised type
725 .word 0 753 .word 0
726 mov pc, lr 754 mov pc, lr
755 THUMB( nop )
727 mov pc, lr 756 mov pc, lr
757 THUMB( nop )
728 mov pc, lr 758 mov pc, lr
759 THUMB( nop )
729 760
730 .size proc_types, . - proc_types 761 .size proc_types, . - proc_types
731 762
@@ -760,22 +791,30 @@ __armv3_mpu_cache_off:
760 mov pc, lr 791 mov pc, lr
761 792
762__armv4_mmu_cache_off: 793__armv4_mmu_cache_off:
794#ifdef CONFIG_MMU
763 mrc p15, 0, r0, c1, c0 795 mrc p15, 0, r0, c1, c0
764 bic r0, r0, #0x000d 796 bic r0, r0, #0x000d
765 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off 797 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
766 mov r0, #0 798 mov r0, #0
767 mcr p15, 0, r0, c7, c7 @ invalidate whole cache v4 799 mcr p15, 0, r0, c7, c7 @ invalidate whole cache v4
768 mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4 800 mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4
801#endif
769 mov pc, lr 802 mov pc, lr
770 803
771__armv7_mmu_cache_off: 804__armv7_mmu_cache_off:
772 mrc p15, 0, r0, c1, c0 805 mrc p15, 0, r0, c1, c0
806#ifdef CONFIG_MMU
773 bic r0, r0, #0x000d 807 bic r0, r0, #0x000d
808#else
809 bic r0, r0, #0x000c
810#endif
774 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off 811 mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
775 mov r12, lr 812 mov r12, lr
776 bl __armv7_mmu_cache_flush 813 bl __armv7_mmu_cache_flush
777 mov r0, #0 814 mov r0, #0
815#ifdef CONFIG_MMU
778 mcr p15, 0, r0, c8, c7, 0 @ invalidate whole TLB 816 mcr p15, 0, r0, c8, c7, 0 @ invalidate whole TLB
817#endif
779 mcr p15, 0, r0, c7, c5, 6 @ invalidate BTC 818 mcr p15, 0, r0, c7, c5, 6 @ invalidate BTC
780 mcr p15, 0, r0, c7, c10, 4 @ DSB 819 mcr p15, 0, r0, c7, c10, 4 @ DSB
781 mcr p15, 0, r0, c7, c5, 4 @ ISB 820 mcr p15, 0, r0, c7, c5, 4 @ ISB
@@ -852,7 +891,7 @@ __armv7_mmu_cache_flush:
852 b iflush 891 b iflush
853hierarchical: 892hierarchical:
854 mcr p15, 0, r10, c7, c10, 5 @ DMB 893 mcr p15, 0, r10, c7, c10, 5 @ DMB
855 stmfd sp!, {r0-r5, r7, r9, r11} 894 stmfd sp!, {r0-r7, r9-r11}
856 mrc p15, 1, r0, c0, c0, 1 @ read clidr 895 mrc p15, 1, r0, c0, c0, 1 @ read clidr
857 ands r3, r0, #0x7000000 @ extract loc from clidr 896 ands r3, r0, #0x7000000 @ extract loc from clidr
858 mov r3, r3, lsr #23 @ left align loc bit field 897 mov r3, r3, lsr #23 @ left align loc bit field
@@ -877,8 +916,12 @@ loop1:
877loop2: 916loop2:
878 mov r9, r4 @ create working copy of max way size 917 mov r9, r4 @ create working copy of max way size
879loop3: 918loop3:
880 orr r11, r10, r9, lsl r5 @ factor way and cache number into r11 919 ARM( orr r11, r10, r9, lsl r5 ) @ factor way and cache number into r11
881 orr r11, r11, r7, lsl r2 @ factor index number into r11 920 ARM( orr r11, r11, r7, lsl r2 ) @ factor index number into r11
921 THUMB( lsl r6, r9, r5 )
922 THUMB( orr r11, r10, r6 ) @ factor way and cache number into r11
923 THUMB( lsl r6, r7, r2 )
924 THUMB( orr r11, r11, r6 ) @ factor index number into r11
882 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way 925 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way
883 subs r9, r9, #1 @ decrement the way 926 subs r9, r9, #1 @ decrement the way
884 bge loop3 927 bge loop3
@@ -889,7 +932,7 @@ skip:
889 cmp r3, r10 932 cmp r3, r10
890 bgt loop1 933 bgt loop1
891finished: 934finished:
892 ldmfd sp!, {r0-r5, r7, r9, r11} 935 ldmfd sp!, {r0-r7, r9-r11}
893 mov r10, #0 @ swith back to cache level 0 936 mov r10, #0 @ swith back to cache level 0
894 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr 937 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
895iflush: 938iflush:
@@ -923,9 +966,13 @@ __armv4_mmu_cache_flush:
923 mov r11, #8 966 mov r11, #8
924 mov r11, r11, lsl r3 @ cache line size in bytes 967 mov r11, r11, lsl r3 @ cache line size in bytes
925no_cache_id: 968no_cache_id:
926 bic r1, pc, #63 @ align to longest cache line 969 mov r1, pc
970 bic r1, r1, #63 @ align to longest cache line
927 add r2, r1, r2 971 add r2, r1, r2
9281: ldr r3, [r1], r11 @ s/w flush D cache 9721:
973 ARM( ldr r3, [r1], r11 ) @ s/w flush D cache
974 THUMB( ldr r3, [r1] ) @ s/w flush D cache
975 THUMB( add r1, r1, r11 )
929 teq r1, r2 976 teq r1, r2
930 bne 1b 977 bne 1b
931 978
@@ -945,6 +992,7 @@ __armv3_mpu_cache_flush:
945 * memory, which again must be relocatable. 992 * memory, which again must be relocatable.
946 */ 993 */
947#ifdef DEBUG 994#ifdef DEBUG
995 .align 2
948 .type phexbuf,#object 996 .type phexbuf,#object
949phexbuf: .space 12 997phexbuf: .space 12
950 .size phexbuf, . - phexbuf 998 .size phexbuf, . - phexbuf
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 6ed89836e908..920ced0b73c5 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -22,10 +22,20 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/sysdev.h> 24#include <linux/sysdev.h>
25#include <linux/amba/bus.h>
25 26
26#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
27#include <asm/hardware/vic.h> 28#include <asm/hardware/vic.h>
28 29
30static void vic_ack_irq(unsigned int irq)
31{
32 void __iomem *base = get_irq_chip_data(irq);
33 irq &= 31;
34 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
35 /* moreover, clear the soft-triggered, in case it was the reason */
36 writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
37}
38
29static void vic_mask_irq(unsigned int irq) 39static void vic_mask_irq(unsigned int irq)
30{ 40{
31 void __iomem *base = get_irq_chip_data(irq); 41 void __iomem *base = get_irq_chip_data(irq);
@@ -253,12 +263,16 @@ static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg
253 263
254static struct irq_chip vic_chip = { 264static struct irq_chip vic_chip = {
255 .name = "VIC", 265 .name = "VIC",
256 .ack = vic_mask_irq, 266 .ack = vic_ack_irq,
257 .mask = vic_mask_irq, 267 .mask = vic_mask_irq,
258 .unmask = vic_unmask_irq, 268 .unmask = vic_unmask_irq,
259 .set_wake = vic_set_wake, 269 .set_wake = vic_set_wake,
260}; 270};
261 271
272/* The PL190 cell from ARM has been modified by ST, so handle both here */
273static void vik_init_st(void __iomem *base, unsigned int irq_start,
274 u32 vic_sources);
275
262/** 276/**
263 * vic_init - initialise a vectored interrupt controller 277 * vic_init - initialise a vectored interrupt controller
264 * @base: iomem base address 278 * @base: iomem base address
@@ -270,6 +284,28 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
270 u32 vic_sources, u32 resume_sources) 284 u32 vic_sources, u32 resume_sources)
271{ 285{
272 unsigned int i; 286 unsigned int i;
287 u32 cellid = 0;
288 enum amba_vendor vendor;
289
290 /* Identify which VIC cell this one is, by reading the ID */
291 for (i = 0; i < 4; i++) {
292 u32 addr = ((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);
293 cellid |= (readl(addr) & 0xff) << (8 * i);
294 }
295 vendor = (cellid >> 12) & 0xff;
296 printk(KERN_INFO "VIC @%p: id 0x%08x, vendor 0x%02x\n",
297 base, cellid, vendor);
298
299 switch(vendor) {
300 case AMBA_VENDOR_ST:
301 vik_init_st(base, irq_start, vic_sources);
302 return;
303 default:
304 printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
305 /* fall through */
306 case AMBA_VENDOR_ARM:
307 break;
308 }
273 309
274 /* Disable all interrupts initially. */ 310 /* Disable all interrupts initially. */
275 311
@@ -306,3 +342,60 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
306 342
307 vic_pm_register(base, irq_start, resume_sources); 343 vic_pm_register(base, irq_start, resume_sources);
308} 344}
345
346/*
347 * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
348 * The original cell has 32 interrupts, while the modified one has 64,
349 * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case
350 * the probe function is called twice, with base set to offset 000
351 * and 020 within the page. We call this "second block".
352 */
353static void __init vik_init_st(void __iomem *base, unsigned int irq_start,
354 u32 vic_sources)
355{
356 unsigned int i;
357 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
358
359 /* Disable all interrupts initially. */
360
361 writel(0, base + VIC_INT_SELECT);
362 writel(0, base + VIC_INT_ENABLE);
363 writel(~0, base + VIC_INT_ENABLE_CLEAR);
364 writel(0, base + VIC_IRQ_STATUS);
365 writel(0, base + VIC_ITCR);
366 writel(~0, base + VIC_INT_SOFT_CLEAR);
367
368 /*
369 * Make sure we clear all existing interrupts. The vector registers
370 * in this cell are after the second block of general registers,
371 * so we can address them using standard offsets, but only from
372 * the second base address, which is 0x20 in the page
373 */
374 if (vic_2nd_block) {
375 writel(0, base + VIC_PL190_VECT_ADDR);
376 for (i = 0; i < 19; i++) {
377 unsigned int value;
378
379 value = readl(base + VIC_PL190_VECT_ADDR);
380 writel(value, base + VIC_PL190_VECT_ADDR);
381 }
382 /* ST has 16 vectors as well, but we don't enable them by now */
383 for (i = 0; i < 16; i++) {
384 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
385 writel(0, reg);
386 }
387
388 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
389 }
390
391 for (i = 0; i < 32; i++) {
392 if (vic_sources & (1 << i)) {
393 unsigned int irq = irq_start + i;
394
395 set_irq_chip(irq, &vic_chip);
396 set_irq_chip_data(irq, base);
397 set_irq_handler(irq, handle_level_irq);
398 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
399 }
400 }
401}
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig
new file mode 100644
index 000000000000..9bb45b932f04
--- /dev/null
+++ b/arch/arm/configs/nhk8815_defconfig
@@ -0,0 +1,1316 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30
4# Tue Jun 23 22:57:16 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12CONFIG_GENERIC_HARDIRQS=y
13CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_LOCK_KERNEL=y
33CONFIG_INIT_ENV_ARG_LIMIT=32
34CONFIG_LOCALVERSION=""
35# CONFIG_LOCALVERSION_AUTO is not set
36# CONFIG_SWAP is not set
37CONFIG_SYSVIPC=y
38CONFIG_SYSVIPC_SYSCTL=y
39# CONFIG_POSIX_MQUEUE is not set
40# CONFIG_BSD_PROCESS_ACCT is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_CLASSIC_RCU=y
48# CONFIG_TREE_RCU is not set
49# CONFIG_PREEMPT_RCU is not set
50# CONFIG_TREE_RCU_TRACE is not set
51# CONFIG_PREEMPT_RCU_TRACE is not set
52CONFIG_IKCONFIG=y
53CONFIG_IKCONFIG_PROC=y
54CONFIG_LOG_BUF_SHIFT=14
55# CONFIG_GROUP_SCHED is not set
56# CONFIG_CGROUPS is not set
57CONFIG_SYSFS_DEPRECATED=y
58CONFIG_SYSFS_DEPRECATED_V2=y
59# CONFIG_RELAY is not set
60# CONFIG_NAMESPACES is not set
61CONFIG_BLK_DEV_INITRD=y
62CONFIG_INITRAMFS_SOURCE=""
63CONFIG_RD_GZIP=y
64# CONFIG_RD_BZIP2 is not set
65# CONFIG_RD_LZMA is not set
66CONFIG_CC_OPTIMIZE_FOR_SIZE=y
67CONFIG_SYSCTL=y
68CONFIG_ANON_INODES=y
69CONFIG_EMBEDDED=y
70CONFIG_UID16=y
71CONFIG_SYSCTL_SYSCALL=y
72CONFIG_KALLSYMS=y
73CONFIG_KALLSYMS_ALL=y
74# CONFIG_KALLSYMS_EXTRA_PASS is not set
75CONFIG_HOTPLUG=y
76CONFIG_PRINTK=y
77CONFIG_BUG=y
78CONFIG_ELF_CORE=y
79CONFIG_BASE_FULL=y
80CONFIG_FUTEX=y
81CONFIG_EPOLL=y
82CONFIG_SIGNALFD=y
83CONFIG_TIMERFD=y
84CONFIG_EVENTFD=y
85CONFIG_SHMEM=y
86CONFIG_AIO=y
87
88#
89# Performance Counters
90#
91CONFIG_VM_EVENT_COUNTERS=y
92# CONFIG_STRIP_ASM_SYMS is not set
93CONFIG_COMPAT_BRK=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97# CONFIG_PROFILING is not set
98# CONFIG_MARKERS is not set
99CONFIG_HAVE_OPROFILE=y
100# CONFIG_KPROBES is not set
101CONFIG_HAVE_KPROBES=y
102CONFIG_HAVE_KRETPROBES=y
103CONFIG_HAVE_CLK=y
104
105#
106# GCOV-based kernel profiling
107#
108# CONFIG_SLOW_WORK is not set
109CONFIG_HAVE_GENERIC_DMA_COHERENT=y
110CONFIG_SLABINFO=y
111CONFIG_RT_MUTEXES=y
112CONFIG_BASE_SMALL=0
113CONFIG_MODULES=y
114# CONFIG_MODULE_FORCE_LOAD is not set
115CONFIG_MODULE_UNLOAD=y
116# CONFIG_MODULE_FORCE_UNLOAD is not set
117# CONFIG_MODVERSIONS is not set
118# CONFIG_MODULE_SRCVERSION_ALL is not set
119CONFIG_BLOCK=y
120CONFIG_LBDAF=y
121# CONFIG_BLK_DEV_BSG is not set
122# CONFIG_BLK_DEV_INTEGRITY is not set
123
124#
125# IO Schedulers
126#
127CONFIG_IOSCHED_NOOP=y
128CONFIG_IOSCHED_AS=y
129CONFIG_IOSCHED_DEADLINE=y
130CONFIG_IOSCHED_CFQ=y
131CONFIG_DEFAULT_AS=y
132# CONFIG_DEFAULT_DEADLINE is not set
133# CONFIG_DEFAULT_CFQ is not set
134# CONFIG_DEFAULT_NOOP is not set
135CONFIG_DEFAULT_IOSCHED="anticipatory"
136CONFIG_FREEZER=y
137
138#
139# System Type
140#
141# CONFIG_ARCH_AAEC2000 is not set
142# CONFIG_ARCH_INTEGRATOR is not set
143# CONFIG_ARCH_REALVIEW is not set
144# CONFIG_ARCH_VERSATILE is not set
145# CONFIG_ARCH_AT91 is not set
146# CONFIG_ARCH_CLPS711X is not set
147# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_FOOTBRIDGE is not set
151# CONFIG_ARCH_MXC is not set
152# CONFIG_ARCH_STMP3XXX is not set
153# CONFIG_ARCH_NETX is not set
154# CONFIG_ARCH_H720X is not set
155CONFIG_ARCH_NOMADIK=y
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_LOKI is not set
165# CONFIG_ARCH_MV78XX0 is not set
166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_KS8695 is not set
169# CONFIG_ARCH_NS9XXX is not set
170# CONFIG_ARCH_W90X900 is not set
171# CONFIG_ARCH_PNX4008 is not set
172# CONFIG_ARCH_PXA is not set
173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_RPC is not set
175# CONFIG_ARCH_SA1100 is not set
176# CONFIG_ARCH_S3C2410 is not set
177# CONFIG_ARCH_S3C64XX is not set
178# CONFIG_ARCH_SHARK is not set
179# CONFIG_ARCH_LH7A40X is not set
180# CONFIG_ARCH_U300 is not set
181# CONFIG_ARCH_DAVINCI is not set
182# CONFIG_ARCH_OMAP is not set
183
184#
185# Nomadik boards
186#
187CONFIG_MACH_NOMADIK_8815NHK=y
188CONFIG_NOMADIK_8815=y
189CONFIG_I2C_BITBANG_8815NHK=y
190
191#
192# Processor Type
193#
194CONFIG_CPU_32=y
195CONFIG_CPU_ARM926T=y
196CONFIG_CPU_32v5=y
197CONFIG_CPU_ABRT_EV5TJ=y
198CONFIG_CPU_PABRT_NOIFAR=y
199CONFIG_CPU_CACHE_VIVT=y
200CONFIG_CPU_COPY_V4WB=y
201CONFIG_CPU_TLB_V4WBI=y
202CONFIG_CPU_CP15=y
203CONFIG_CPU_CP15_MMU=y
204
205#
206# Processor Features
207#
208CONFIG_ARM_THUMB=y
209# CONFIG_CPU_ICACHE_DISABLE is not set
210# CONFIG_CPU_DCACHE_DISABLE is not set
211# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
212# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
213CONFIG_OUTER_CACHE=y
214CONFIG_CACHE_L2X0=y
215CONFIG_ARM_VIC=y
216CONFIG_ARM_VIC_NR=2
217CONFIG_COMMON_CLKDEV=y
218
219#
220# Bus support
221#
222CONFIG_ARM_AMBA=y
223# CONFIG_PCI_SYSCALL is not set
224# CONFIG_ARCH_SUPPORTS_MSI is not set
225# CONFIG_PCCARD is not set
226
227#
228# Kernel Features
229#
230# CONFIG_NO_HZ is not set
231# CONFIG_HIGH_RES_TIMERS is not set
232CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
233CONFIG_VMSPLIT_3G=y
234# CONFIG_VMSPLIT_2G is not set
235# CONFIG_VMSPLIT_1G is not set
236CONFIG_PAGE_OFFSET=0xC0000000
237CONFIG_PREEMPT=y
238CONFIG_HZ=100
239CONFIG_AEABI=y
240CONFIG_OABI_COMPAT=y
241# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
242# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
243# CONFIG_HIGHMEM is not set
244CONFIG_SELECT_MEMORY_MODEL=y
245CONFIG_FLATMEM_MANUAL=y
246# CONFIG_DISCONTIGMEM_MANUAL is not set
247# CONFIG_SPARSEMEM_MANUAL is not set
248CONFIG_FLATMEM=y
249CONFIG_FLAT_NODE_MEM_MAP=y
250CONFIG_PAGEFLAGS_EXTENDED=y
251CONFIG_SPLIT_PTLOCK_CPUS=4096
252# CONFIG_PHYS_ADDR_T_64BIT is not set
253CONFIG_ZONE_DMA_FLAG=0
254CONFIG_VIRT_TO_BUS=y
255CONFIG_HAVE_MLOCK=y
256CONFIG_HAVE_MLOCKED_PAGE_BIT=y
257CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_ALIGNMENT_TRAP=y
259# CONFIG_UACCESS_WITH_MEMCPY is not set
260
261#
262# Boot options
263#
264CONFIG_ZBOOT_ROM_TEXT=0x0
265CONFIG_ZBOOT_ROM_BSS=0x0
266CONFIG_CMDLINE=""
267# CONFIG_XIP_KERNEL is not set
268# CONFIG_KEXEC is not set
269
270#
271# CPU Power Management
272#
273# CONFIG_CPU_IDLE is not set
274
275#
276# Floating point emulation
277#
278
279#
280# At least one emulation must be selected
281#
282CONFIG_FPE_NWFPE=y
283# CONFIG_FPE_NWFPE_XP is not set
284# CONFIG_FPE_FASTFPE is not set
285# CONFIG_VFP is not set
286
287#
288# Userspace binary formats
289#
290CONFIG_BINFMT_ELF=y
291# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
292CONFIG_HAVE_AOUT=y
293# CONFIG_BINFMT_AOUT is not set
294# CONFIG_BINFMT_MISC is not set
295
296#
297# Power management options
298#
299CONFIG_PM=y
300# CONFIG_PM_DEBUG is not set
301CONFIG_PM_SLEEP=y
302CONFIG_SUSPEND=y
303CONFIG_SUSPEND_FREEZER=y
304# CONFIG_APM_EMULATION is not set
305CONFIG_ARCH_SUSPEND_POSSIBLE=y
306CONFIG_NET=y
307
308#
309# Networking options
310#
311CONFIG_PACKET=y
312# CONFIG_PACKET_MMAP is not set
313CONFIG_UNIX=y
314CONFIG_XFRM=y
315# CONFIG_XFRM_USER is not set
316# CONFIG_XFRM_SUB_POLICY is not set
317# CONFIG_XFRM_MIGRATE is not set
318# CONFIG_XFRM_STATISTICS is not set
319CONFIG_NET_KEY=y
320# CONFIG_NET_KEY_MIGRATE is not set
321CONFIG_INET=y
322CONFIG_IP_MULTICAST=y
323CONFIG_IP_ADVANCED_ROUTER=y
324CONFIG_ASK_IP_FIB_HASH=y
325# CONFIG_IP_FIB_TRIE is not set
326CONFIG_IP_FIB_HASH=y
327# CONFIG_IP_MULTIPLE_TABLES is not set
328# CONFIG_IP_ROUTE_MULTIPATH is not set
329# CONFIG_IP_ROUTE_VERBOSE is not set
330CONFIG_IP_PNP=y
331CONFIG_IP_PNP_DHCP=y
332CONFIG_IP_PNP_BOOTP=y
333# CONFIG_IP_PNP_RARP is not set
334CONFIG_NET_IPIP=y
335CONFIG_NET_IPGRE=y
336CONFIG_NET_IPGRE_BROADCAST=y
337CONFIG_IP_MROUTE=y
338# CONFIG_IP_PIMSM_V1 is not set
339# CONFIG_IP_PIMSM_V2 is not set
340# CONFIG_ARPD is not set
341# CONFIG_SYN_COOKIES is not set
342# CONFIG_INET_AH is not set
343# CONFIG_INET_ESP is not set
344# CONFIG_INET_IPCOMP is not set
345# CONFIG_INET_XFRM_TUNNEL is not set
346CONFIG_INET_TUNNEL=y
347CONFIG_INET_XFRM_MODE_TRANSPORT=y
348CONFIG_INET_XFRM_MODE_TUNNEL=y
349CONFIG_INET_XFRM_MODE_BEET=y
350# CONFIG_INET_LRO is not set
351CONFIG_INET_DIAG=y
352CONFIG_INET_TCP_DIAG=y
353# CONFIG_TCP_CONG_ADVANCED is not set
354CONFIG_TCP_CONG_CUBIC=y
355CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_TCP_MD5SIG is not set
357# CONFIG_IPV6 is not set
358# CONFIG_NETWORK_SECMARK is not set
359# CONFIG_NETFILTER is not set
360# CONFIG_IP_DCCP is not set
361# CONFIG_IP_SCTP is not set
362# CONFIG_TIPC is not set
363# CONFIG_ATM is not set
364# CONFIG_BRIDGE is not set
365# CONFIG_NET_DSA is not set
366# CONFIG_VLAN_8021Q is not set
367# CONFIG_DECNET is not set
368# CONFIG_LLC2 is not set
369# CONFIG_IPX is not set
370# CONFIG_ATALK is not set
371# CONFIG_X25 is not set
372# CONFIG_LAPB is not set
373# CONFIG_ECONET is not set
374# CONFIG_WAN_ROUTER is not set
375# CONFIG_PHONET is not set
376# CONFIG_IEEE802154 is not set
377# CONFIG_NET_SCHED is not set
378# CONFIG_DCB is not set
379
380#
381# Network testing
382#
383# CONFIG_NET_PKTGEN is not set
384# CONFIG_HAMRADIO is not set
385# CONFIG_CAN is not set
386# CONFIG_IRDA is not set
387CONFIG_BT=m
388CONFIG_BT_L2CAP=m
389CONFIG_BT_SCO=m
390CONFIG_BT_RFCOMM=m
391CONFIG_BT_RFCOMM_TTY=y
392CONFIG_BT_BNEP=m
393CONFIG_BT_BNEP_MC_FILTER=y
394CONFIG_BT_BNEP_PROTO_FILTER=y
395CONFIG_BT_HIDP=m
396
397#
398# Bluetooth device drivers
399#
400CONFIG_BT_HCIUART=m
401CONFIG_BT_HCIUART_H4=y
402CONFIG_BT_HCIUART_BCSP=y
403# CONFIG_BT_HCIUART_LL is not set
404CONFIG_BT_HCIVHCI=m
405# CONFIG_AF_RXRPC is not set
406CONFIG_WIRELESS=y
407# CONFIG_CFG80211 is not set
408CONFIG_WIRELESS_OLD_REGULATORY=y
409# CONFIG_WIRELESS_EXT is not set
410# CONFIG_LIB80211 is not set
411
412#
413# CFG80211 needs to be enabled for MAC80211
414#
415CONFIG_MAC80211_DEFAULT_PS_VALUE=0
416# CONFIG_WIMAX is not set
417# CONFIG_RFKILL is not set
418# CONFIG_NET_9P is not set
419
420#
421# Device Drivers
422#
423
424#
425# Generic Driver Options
426#
427CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
428CONFIG_STANDALONE=y
429CONFIG_PREVENT_FIRMWARE_BUILD=y
430CONFIG_FW_LOADER=y
431CONFIG_FIRMWARE_IN_KERNEL=y
432CONFIG_EXTRA_FIRMWARE=""
433# CONFIG_DEBUG_DRIVER is not set
434# CONFIG_DEBUG_DEVRES is not set
435# CONFIG_SYS_HYPERVISOR is not set
436# CONFIG_CONNECTOR is not set
437CONFIG_MTD=y
438# CONFIG_MTD_DEBUG is not set
439# CONFIG_MTD_CONCAT is not set
440CONFIG_MTD_PARTITIONS=y
441CONFIG_MTD_TESTS=m
442# CONFIG_MTD_REDBOOT_PARTS is not set
443# CONFIG_MTD_CMDLINE_PARTS is not set
444# CONFIG_MTD_AFS_PARTS is not set
445# CONFIG_MTD_AR7_PARTS is not set
446
447#
448# User Modules And Translation Layers
449#
450CONFIG_MTD_CHAR=y
451CONFIG_MTD_BLKDEVS=y
452CONFIG_MTD_BLOCK=y
453# CONFIG_FTL is not set
454# CONFIG_NFTL is not set
455# CONFIG_INFTL is not set
456# CONFIG_RFD_FTL is not set
457# CONFIG_SSFDC is not set
458# CONFIG_MTD_OOPS is not set
459
460#
461# RAM/ROM/Flash chip drivers
462#
463# CONFIG_MTD_CFI is not set
464# CONFIG_MTD_JEDECPROBE is not set
465CONFIG_MTD_MAP_BANK_WIDTH_1=y
466CONFIG_MTD_MAP_BANK_WIDTH_2=y
467CONFIG_MTD_MAP_BANK_WIDTH_4=y
468# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
469# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
470# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
471CONFIG_MTD_CFI_I1=y
472CONFIG_MTD_CFI_I2=y
473# CONFIG_MTD_CFI_I4 is not set
474# CONFIG_MTD_CFI_I8 is not set
475# CONFIG_MTD_RAM is not set
476# CONFIG_MTD_ROM is not set
477# CONFIG_MTD_ABSENT is not set
478
479#
480# Mapping drivers for chip access
481#
482# CONFIG_MTD_COMPLEX_MAPPINGS is not set
483# CONFIG_MTD_PLATRAM is not set
484
485#
486# Self-contained MTD device drivers
487#
488# CONFIG_MTD_SLRAM is not set
489# CONFIG_MTD_PHRAM is not set
490# CONFIG_MTD_MTDRAM is not set
491# CONFIG_MTD_BLOCK2MTD is not set
492
493#
494# Disk-On-Chip Device Drivers
495#
496# CONFIG_MTD_DOC2000 is not set
497# CONFIG_MTD_DOC2001 is not set
498# CONFIG_MTD_DOC2001PLUS is not set
499CONFIG_MTD_NAND=y
500CONFIG_MTD_NAND_VERIFY_WRITE=y
501# CONFIG_MTD_NAND_ECC_SMC is not set
502# CONFIG_MTD_NAND_MUSEUM_IDS is not set
503# CONFIG_MTD_NAND_GPIO is not set
504CONFIG_MTD_NAND_IDS=y
505# CONFIG_MTD_NAND_DISKONCHIP is not set
506# CONFIG_MTD_NAND_NANDSIM is not set
507# CONFIG_MTD_NAND_PLATFORM is not set
508CONFIG_MTD_NAND_NOMADIK=y
509CONFIG_MTD_ONENAND=y
510CONFIG_MTD_ONENAND_VERIFY_WRITE=y
511CONFIG_MTD_ONENAND_GENERIC=y
512# CONFIG_MTD_ONENAND_OTP is not set
513# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
514# CONFIG_MTD_ONENAND_SIM is not set
515
516#
517# LPDDR flash memory drivers
518#
519# CONFIG_MTD_LPDDR is not set
520
521#
522# UBI - Unsorted block images
523#
524# CONFIG_MTD_UBI is not set
525# CONFIG_PARPORT is not set
526CONFIG_BLK_DEV=y
527# CONFIG_BLK_DEV_COW_COMMON is not set
528CONFIG_BLK_DEV_LOOP=y
529CONFIG_BLK_DEV_CRYPTOLOOP=y
530# CONFIG_BLK_DEV_NBD is not set
531CONFIG_BLK_DEV_RAM=y
532CONFIG_BLK_DEV_RAM_COUNT=16
533CONFIG_BLK_DEV_RAM_SIZE=4096
534# CONFIG_BLK_DEV_XIP is not set
535# CONFIG_CDROM_PKTCDVD is not set
536# CONFIG_ATA_OVER_ETH is not set
537# CONFIG_MG_DISK is not set
538CONFIG_MISC_DEVICES=y
539# CONFIG_ICS932S401 is not set
540# CONFIG_ENCLOSURE_SERVICES is not set
541# CONFIG_ISL29003 is not set
542# CONFIG_C2PORT is not set
543
544#
545# EEPROM support
546#
547# CONFIG_EEPROM_AT24 is not set
548# CONFIG_EEPROM_LEGACY is not set
549# CONFIG_EEPROM_MAX6875 is not set
550# CONFIG_EEPROM_93CX6 is not set
551CONFIG_HAVE_IDE=y
552# CONFIG_IDE is not set
553
554#
555# SCSI device support
556#
557# CONFIG_RAID_ATTRS is not set
558CONFIG_SCSI=y
559CONFIG_SCSI_DMA=y
560# CONFIG_SCSI_TGT is not set
561# CONFIG_SCSI_NETLINK is not set
562CONFIG_SCSI_PROC_FS=y
563
564#
565# SCSI support type (disk, tape, CD-ROM)
566#
567CONFIG_BLK_DEV_SD=y
568# CONFIG_CHR_DEV_ST is not set
569# CONFIG_CHR_DEV_OSST is not set
570# CONFIG_BLK_DEV_SR is not set
571CONFIG_CHR_DEV_SG=y
572# CONFIG_CHR_DEV_SCH is not set
573CONFIG_SCSI_MULTI_LUN=y
574CONFIG_SCSI_CONSTANTS=y
575CONFIG_SCSI_LOGGING=y
576CONFIG_SCSI_SCAN_ASYNC=y
577CONFIG_SCSI_WAIT_SCAN=m
578
579#
580# SCSI Transports
581#
582# CONFIG_SCSI_SPI_ATTRS is not set
583# CONFIG_SCSI_FC_ATTRS is not set
584# CONFIG_SCSI_ISCSI_ATTRS is not set
585# CONFIG_SCSI_SAS_LIBSAS is not set
586# CONFIG_SCSI_SRP_ATTRS is not set
587CONFIG_SCSI_LOWLEVEL=y
588# CONFIG_ISCSI_TCP is not set
589# CONFIG_LIBFC is not set
590# CONFIG_LIBFCOE is not set
591# CONFIG_SCSI_DEBUG is not set
592# CONFIG_SCSI_DH is not set
593# CONFIG_SCSI_OSD_INITIATOR is not set
594# CONFIG_ATA is not set
595# CONFIG_MD is not set
596CONFIG_NETDEVICES=y
597# CONFIG_DUMMY is not set
598# CONFIG_BONDING is not set
599# CONFIG_MACVLAN is not set
600# CONFIG_EQUALIZER is not set
601CONFIG_TUN=y
602# CONFIG_VETH is not set
603# CONFIG_PHYLIB is not set
604CONFIG_NET_ETHERNET=y
605CONFIG_MII=y
606# CONFIG_AX88796 is not set
607CONFIG_SMC91X=y
608# CONFIG_DM9000 is not set
609# CONFIG_ETHOC is not set
610# CONFIG_SMC911X is not set
611# CONFIG_SMSC911X is not set
612# CONFIG_DNET is not set
613# CONFIG_IBM_NEW_EMAC_ZMII is not set
614# CONFIG_IBM_NEW_EMAC_RGMII is not set
615# CONFIG_IBM_NEW_EMAC_TAH is not set
616# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
617# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
618# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
619# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
620# CONFIG_B44 is not set
621# CONFIG_KS8842 is not set
622CONFIG_NETDEV_1000=y
623CONFIG_NETDEV_10000=y
624
625#
626# Wireless LAN
627#
628# CONFIG_WLAN_PRE80211 is not set
629# CONFIG_WLAN_80211 is not set
630
631#
632# Enable WiMAX (Networking options) to see the WiMAX drivers
633#
634# CONFIG_WAN is not set
635CONFIG_PPP=m
636# CONFIG_PPP_MULTILINK is not set
637# CONFIG_PPP_FILTER is not set
638CONFIG_PPP_ASYNC=m
639CONFIG_PPP_SYNC_TTY=m
640CONFIG_PPP_DEFLATE=m
641CONFIG_PPP_BSDCOMP=m
642CONFIG_PPP_MPPE=m
643CONFIG_PPPOE=m
644# CONFIG_PPPOL2TP is not set
645# CONFIG_SLIP is not set
646CONFIG_SLHC=m
647CONFIG_NETCONSOLE=m
648# CONFIG_NETCONSOLE_DYNAMIC is not set
649CONFIG_NETPOLL=y
650# CONFIG_NETPOLL_TRAP is not set
651CONFIG_NET_POLL_CONTROLLER=y
652# CONFIG_ISDN is not set
653
654#
655# Input device support
656#
657CONFIG_INPUT=y
658# CONFIG_INPUT_FF_MEMLESS is not set
659# CONFIG_INPUT_POLLDEV is not set
660
661#
662# Userland interfaces
663#
664# CONFIG_INPUT_MOUSEDEV is not set
665# CONFIG_INPUT_JOYDEV is not set
666CONFIG_INPUT_EVDEV=y
667# CONFIG_INPUT_EVBUG is not set
668
669#
670# Input Device Drivers
671#
672CONFIG_INPUT_KEYBOARD=y
673# CONFIG_KEYBOARD_ATKBD is not set
674# CONFIG_KEYBOARD_SUNKBD is not set
675# CONFIG_KEYBOARD_LKKBD is not set
676# CONFIG_KEYBOARD_XTKBD is not set
677# CONFIG_KEYBOARD_NEWTON is not set
678# CONFIG_KEYBOARD_STOWAWAY is not set
679# CONFIG_KEYBOARD_GPIO is not set
680CONFIG_INPUT_MOUSE=y
681# CONFIG_MOUSE_PS2 is not set
682# CONFIG_MOUSE_SERIAL is not set
683# CONFIG_MOUSE_APPLETOUCH is not set
684# CONFIG_MOUSE_BCM5974 is not set
685# CONFIG_MOUSE_VSXXXAA is not set
686# CONFIG_MOUSE_GPIO is not set
687# CONFIG_MOUSE_SYNAPTICS_I2C is not set
688# CONFIG_INPUT_JOYSTICK is not set
689# CONFIG_INPUT_TABLET is not set
690# CONFIG_INPUT_TOUCHSCREEN is not set
691# CONFIG_INPUT_MISC is not set
692
693#
694# Hardware I/O ports
695#
696# CONFIG_SERIO is not set
697# CONFIG_GAMEPORT is not set
698
699#
700# Character devices
701#
702CONFIG_VT=y
703CONFIG_CONSOLE_TRANSLATIONS=y
704CONFIG_VT_CONSOLE=y
705CONFIG_HW_CONSOLE=y
706# CONFIG_VT_HW_CONSOLE_BINDING is not set
707CONFIG_DEVKMEM=y
708# CONFIG_SERIAL_NONSTANDARD is not set
709
710#
711# Serial drivers
712#
713# CONFIG_SERIAL_8250 is not set
714
715#
716# Non-8250 serial port support
717#
718# CONFIG_SERIAL_AMBA_PL010 is not set
719CONFIG_SERIAL_AMBA_PL011=y
720CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
721CONFIG_SERIAL_CORE=y
722CONFIG_SERIAL_CORE_CONSOLE=y
723CONFIG_UNIX98_PTYS=y
724# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
725# CONFIG_LEGACY_PTYS is not set
726# CONFIG_IPMI_HANDLER is not set
727# CONFIG_HW_RANDOM is not set
728# CONFIG_R3964 is not set
729# CONFIG_RAW_DRIVER is not set
730# CONFIG_TCG_TPM is not set
731CONFIG_I2C=y
732CONFIG_I2C_BOARDINFO=y
733CONFIG_I2C_CHARDEV=y
734CONFIG_I2C_HELPER_AUTO=y
735CONFIG_I2C_ALGOBIT=y
736
737#
738# I2C Hardware Bus support
739#
740
741#
742# I2C system bus drivers (mostly embedded / system-on-chip)
743#
744CONFIG_I2C_GPIO=y
745# CONFIG_I2C_OCORES is not set
746# CONFIG_I2C_SIMTEC is not set
747
748#
749# External I2C/SMBus adapter drivers
750#
751# CONFIG_I2C_PARPORT_LIGHT is not set
752# CONFIG_I2C_TAOS_EVM is not set
753
754#
755# Other I2C/SMBus bus drivers
756#
757# CONFIG_I2C_PCA_PLATFORM is not set
758# CONFIG_I2C_STUB is not set
759
760#
761# Miscellaneous I2C Chip support
762#
763# CONFIG_DS1682 is not set
764# CONFIG_SENSORS_PCF8574 is not set
765# CONFIG_PCF8575 is not set
766# CONFIG_SENSORS_PCA9539 is not set
767# CONFIG_SENSORS_TSL2550 is not set
768# CONFIG_I2C_DEBUG_CORE is not set
769# CONFIG_I2C_DEBUG_ALGO is not set
770# CONFIG_I2C_DEBUG_BUS is not set
771# CONFIG_I2C_DEBUG_CHIP is not set
772# CONFIG_SPI is not set
773CONFIG_ARCH_REQUIRE_GPIOLIB=y
774CONFIG_GPIOLIB=y
775CONFIG_DEBUG_GPIO=y
776# CONFIG_GPIO_SYSFS is not set
777
778#
779# Memory mapped GPIO expanders:
780#
781# CONFIG_GPIO_PL061 is not set
782
783#
784# I2C GPIO expanders:
785#
786# CONFIG_GPIO_MAX732X is not set
787# CONFIG_GPIO_PCA953X is not set
788# CONFIG_GPIO_PCF857X is not set
789
790#
791# PCI GPIO expanders:
792#
793
794#
795# SPI GPIO expanders:
796#
797# CONFIG_W1 is not set
798# CONFIG_POWER_SUPPLY is not set
799# CONFIG_HWMON is not set
800# CONFIG_THERMAL is not set
801# CONFIG_THERMAL_HWMON is not set
802# CONFIG_WATCHDOG is not set
803CONFIG_SSB_POSSIBLE=y
804
805#
806# Sonics Silicon Backplane
807#
808# CONFIG_SSB is not set
809
810#
811# Multifunction device drivers
812#
813# CONFIG_MFD_CORE is not set
814# CONFIG_MFD_SM501 is not set
815# CONFIG_MFD_ASIC3 is not set
816# CONFIG_HTC_EGPIO is not set
817# CONFIG_HTC_PASIC3 is not set
818# CONFIG_TPS65010 is not set
819# CONFIG_TWL4030_CORE is not set
820# CONFIG_MFD_TMIO is not set
821# CONFIG_MFD_T7L66XB is not set
822# CONFIG_MFD_TC6387XB is not set
823# CONFIG_MFD_TC6393XB is not set
824# CONFIG_PMIC_DA903X is not set
825# CONFIG_MFD_WM8400 is not set
826# CONFIG_MFD_WM8350_I2C is not set
827# CONFIG_MFD_PCF50633 is not set
828# CONFIG_AB3100_CORE is not set
829# CONFIG_MEDIA_SUPPORT is not set
830
831#
832# Graphics support
833#
834# CONFIG_VGASTATE is not set
835# CONFIG_VIDEO_OUTPUT_CONTROL is not set
836# CONFIG_FB is not set
837# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
838
839#
840# Display device support
841#
842# CONFIG_DISPLAY_SUPPORT is not set
843
844#
845# Console display driver support
846#
847# CONFIG_VGA_CONSOLE is not set
848CONFIG_DUMMY_CONSOLE=y
849# CONFIG_SOUND is not set
850CONFIG_HID_SUPPORT=y
851CONFIG_HID=y
852# CONFIG_HID_DEBUG is not set
853# CONFIG_HIDRAW is not set
854# CONFIG_HID_PID is not set
855
856#
857# Special HID drivers
858#
859# CONFIG_HID_APPLE is not set
860# CONFIG_HID_WACOM is not set
861CONFIG_USB_SUPPORT=y
862CONFIG_USB_ARCH_HAS_HCD=y
863# CONFIG_USB_ARCH_HAS_OHCI is not set
864# CONFIG_USB_ARCH_HAS_EHCI is not set
865# CONFIG_USB is not set
866# CONFIG_USB_OTG_WHITELIST is not set
867# CONFIG_USB_OTG_BLACKLIST_HUB is not set
868
869#
870# Enable Host or Gadget support to see Inventra options
871#
872
873#
874# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
875#
876# CONFIG_USB_GADGET is not set
877
878#
879# OTG and related infrastructure
880#
881# CONFIG_MMC is not set
882# CONFIG_MEMSTICK is not set
883# CONFIG_ACCESSIBILITY is not set
884# CONFIG_NEW_LEDS is not set
885CONFIG_RTC_LIB=y
886CONFIG_RTC_CLASS=y
887CONFIG_RTC_HCTOSYS=y
888CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
889# CONFIG_RTC_DEBUG is not set
890
891#
892# RTC interfaces
893#
894CONFIG_RTC_INTF_SYSFS=y
895CONFIG_RTC_INTF_PROC=y
896CONFIG_RTC_INTF_DEV=y
897# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
898# CONFIG_RTC_DRV_TEST is not set
899
900#
901# I2C RTC drivers
902#
903# CONFIG_RTC_DRV_DS1307 is not set
904# CONFIG_RTC_DRV_DS1374 is not set
905# CONFIG_RTC_DRV_DS1672 is not set
906# CONFIG_RTC_DRV_MAX6900 is not set
907# CONFIG_RTC_DRV_RS5C372 is not set
908# CONFIG_RTC_DRV_ISL1208 is not set
909# CONFIG_RTC_DRV_X1205 is not set
910# CONFIG_RTC_DRV_PCF8563 is not set
911# CONFIG_RTC_DRV_PCF8583 is not set
912# CONFIG_RTC_DRV_M41T80 is not set
913# CONFIG_RTC_DRV_S35390A is not set
914# CONFIG_RTC_DRV_FM3130 is not set
915# CONFIG_RTC_DRV_RX8581 is not set
916# CONFIG_RTC_DRV_RX8025 is not set
917
918#
919# SPI RTC drivers
920#
921
922#
923# Platform RTC drivers
924#
925# CONFIG_RTC_DRV_CMOS is not set
926# CONFIG_RTC_DRV_DS1286 is not set
927# CONFIG_RTC_DRV_DS1511 is not set
928# CONFIG_RTC_DRV_DS1553 is not set
929# CONFIG_RTC_DRV_DS1742 is not set
930# CONFIG_RTC_DRV_STK17TA8 is not set
931# CONFIG_RTC_DRV_M48T86 is not set
932# CONFIG_RTC_DRV_M48T35 is not set
933# CONFIG_RTC_DRV_M48T59 is not set
934# CONFIG_RTC_DRV_BQ4802 is not set
935# CONFIG_RTC_DRV_V3020 is not set
936
937#
938# on-CPU RTC drivers
939#
940# CONFIG_RTC_DRV_PL030 is not set
941# CONFIG_RTC_DRV_PL031 is not set
942# CONFIG_DMADEVICES is not set
943# CONFIG_AUXDISPLAY is not set
944# CONFIG_REGULATOR is not set
945# CONFIG_UIO is not set
946# CONFIG_STAGING is not set
947
948#
949# File systems
950#
951CONFIG_EXT2_FS=y
952# CONFIG_EXT2_FS_XATTR is not set
953# CONFIG_EXT2_FS_XIP is not set
954CONFIG_EXT3_FS=y
955# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
956CONFIG_EXT3_FS_XATTR=y
957# CONFIG_EXT3_FS_POSIX_ACL is not set
958# CONFIG_EXT3_FS_SECURITY is not set
959# CONFIG_EXT4_FS is not set
960CONFIG_JBD=y
961CONFIG_FS_MBCACHE=y
962# CONFIG_REISERFS_FS is not set
963# CONFIG_JFS_FS is not set
964CONFIG_FS_POSIX_ACL=y
965# CONFIG_XFS_FS is not set
966# CONFIG_GFS2_FS is not set
967# CONFIG_OCFS2_FS is not set
968# CONFIG_BTRFS_FS is not set
969CONFIG_FILE_LOCKING=y
970CONFIG_FSNOTIFY=y
971CONFIG_DNOTIFY=y
972CONFIG_INOTIFY=y
973CONFIG_INOTIFY_USER=y
974# CONFIG_QUOTA is not set
975# CONFIG_AUTOFS_FS is not set
976# CONFIG_AUTOFS4_FS is not set
977CONFIG_FUSE_FS=y
978# CONFIG_CUSE is not set
979
980#
981# Caches
982#
983# CONFIG_FSCACHE is not set
984
985#
986# CD-ROM/DVD Filesystems
987#
988# CONFIG_ISO9660_FS is not set
989# CONFIG_UDF_FS is not set
990
991#
992# DOS/FAT/NT Filesystems
993#
994CONFIG_FAT_FS=y
995CONFIG_MSDOS_FS=y
996CONFIG_VFAT_FS=y
997CONFIG_FAT_DEFAULT_CODEPAGE=437
998CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
999# CONFIG_NTFS_FS is not set
1000
1001#
1002# Pseudo filesystems
1003#
1004CONFIG_PROC_FS=y
1005CONFIG_PROC_SYSCTL=y
1006CONFIG_PROC_PAGE_MONITOR=y
1007CONFIG_SYSFS=y
1008CONFIG_TMPFS=y
1009# CONFIG_TMPFS_POSIX_ACL is not set
1010# CONFIG_HUGETLB_PAGE is not set
1011# CONFIG_CONFIGFS_FS is not set
1012CONFIG_MISC_FILESYSTEMS=y
1013# CONFIG_ADFS_FS is not set
1014# CONFIG_AFFS_FS is not set
1015# CONFIG_HFS_FS is not set
1016# CONFIG_HFSPLUS_FS is not set
1017# CONFIG_BEFS_FS is not set
1018# CONFIG_BFS_FS is not set
1019# CONFIG_EFS_FS is not set
1020CONFIG_JFFS2_FS=y
1021CONFIG_JFFS2_FS_DEBUG=0
1022CONFIG_JFFS2_FS_WRITEBUFFER=y
1023# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1024# CONFIG_JFFS2_SUMMARY is not set
1025# CONFIG_JFFS2_FS_XATTR is not set
1026# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1027CONFIG_JFFS2_ZLIB=y
1028# CONFIG_JFFS2_LZO is not set
1029CONFIG_JFFS2_RTIME=y
1030# CONFIG_JFFS2_RUBIN is not set
1031# CONFIG_CRAMFS is not set
1032# CONFIG_SQUASHFS is not set
1033# CONFIG_VXFS_FS is not set
1034# CONFIG_MINIX_FS is not set
1035# CONFIG_OMFS_FS is not set
1036# CONFIG_HPFS_FS is not set
1037# CONFIG_QNX4FS_FS is not set
1038# CONFIG_ROMFS_FS is not set
1039# CONFIG_SYSV_FS is not set
1040# CONFIG_UFS_FS is not set
1041# CONFIG_NILFS2_FS is not set
1042CONFIG_NETWORK_FILESYSTEMS=y
1043CONFIG_NFS_FS=y
1044CONFIG_NFS_V3=y
1045CONFIG_NFS_V3_ACL=y
1046# CONFIG_NFS_V4 is not set
1047CONFIG_ROOT_NFS=y
1048# CONFIG_NFSD is not set
1049CONFIG_LOCKD=y
1050CONFIG_LOCKD_V4=y
1051CONFIG_NFS_ACL_SUPPORT=y
1052CONFIG_NFS_COMMON=y
1053CONFIG_SUNRPC=y
1054# CONFIG_RPCSEC_GSS_KRB5 is not set
1055# CONFIG_RPCSEC_GSS_SPKM3 is not set
1056CONFIG_SMB_FS=m
1057# CONFIG_SMB_NLS_DEFAULT is not set
1058CONFIG_CIFS=m
1059# CONFIG_CIFS_STATS is not set
1060CONFIG_CIFS_WEAK_PW_HASH=y
1061# CONFIG_CIFS_XATTR is not set
1062# CONFIG_CIFS_DEBUG2 is not set
1063# CONFIG_CIFS_EXPERIMENTAL is not set
1064# CONFIG_NCP_FS is not set
1065# CONFIG_CODA_FS is not set
1066# CONFIG_AFS_FS is not set
1067
1068#
1069# Partition Types
1070#
1071# CONFIG_PARTITION_ADVANCED is not set
1072CONFIG_MSDOS_PARTITION=y
1073CONFIG_NLS=y
1074CONFIG_NLS_DEFAULT="iso8859-1"
1075CONFIG_NLS_CODEPAGE_437=y
1076# CONFIG_NLS_CODEPAGE_737 is not set
1077# CONFIG_NLS_CODEPAGE_775 is not set
1078# CONFIG_NLS_CODEPAGE_850 is not set
1079# CONFIG_NLS_CODEPAGE_852 is not set
1080# CONFIG_NLS_CODEPAGE_855 is not set
1081# CONFIG_NLS_CODEPAGE_857 is not set
1082# CONFIG_NLS_CODEPAGE_860 is not set
1083# CONFIG_NLS_CODEPAGE_861 is not set
1084# CONFIG_NLS_CODEPAGE_862 is not set
1085# CONFIG_NLS_CODEPAGE_863 is not set
1086# CONFIG_NLS_CODEPAGE_864 is not set
1087# CONFIG_NLS_CODEPAGE_865 is not set
1088# CONFIG_NLS_CODEPAGE_866 is not set
1089# CONFIG_NLS_CODEPAGE_869 is not set
1090# CONFIG_NLS_CODEPAGE_936 is not set
1091# CONFIG_NLS_CODEPAGE_950 is not set
1092# CONFIG_NLS_CODEPAGE_932 is not set
1093# CONFIG_NLS_CODEPAGE_949 is not set
1094# CONFIG_NLS_CODEPAGE_874 is not set
1095# CONFIG_NLS_ISO8859_8 is not set
1096# CONFIG_NLS_CODEPAGE_1250 is not set
1097# CONFIG_NLS_CODEPAGE_1251 is not set
1098CONFIG_NLS_ASCII=y
1099CONFIG_NLS_ISO8859_1=y
1100# CONFIG_NLS_ISO8859_2 is not set
1101# CONFIG_NLS_ISO8859_3 is not set
1102# CONFIG_NLS_ISO8859_4 is not set
1103# CONFIG_NLS_ISO8859_5 is not set
1104# CONFIG_NLS_ISO8859_6 is not set
1105# CONFIG_NLS_ISO8859_7 is not set
1106# CONFIG_NLS_ISO8859_9 is not set
1107# CONFIG_NLS_ISO8859_13 is not set
1108# CONFIG_NLS_ISO8859_14 is not set
1109CONFIG_NLS_ISO8859_15=y
1110# CONFIG_NLS_KOI8_R is not set
1111# CONFIG_NLS_KOI8_U is not set
1112# CONFIG_NLS_UTF8 is not set
1113# CONFIG_DLM is not set
1114
1115#
1116# Kernel hacking
1117#
1118# CONFIG_PRINTK_TIME is not set
1119CONFIG_ENABLE_WARN_DEPRECATED=y
1120# CONFIG_ENABLE_MUST_CHECK is not set
1121CONFIG_FRAME_WARN=1024
1122# CONFIG_MAGIC_SYSRQ is not set
1123# CONFIG_UNUSED_SYMBOLS is not set
1124# CONFIG_DEBUG_FS is not set
1125# CONFIG_HEADERS_CHECK is not set
1126CONFIG_DEBUG_KERNEL=y
1127# CONFIG_DEBUG_SHIRQ is not set
1128CONFIG_DETECT_SOFTLOCKUP=y
1129# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1130CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1131CONFIG_DETECT_HUNG_TASK=y
1132# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1133CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1134# CONFIG_SCHED_DEBUG is not set
1135# CONFIG_SCHEDSTATS is not set
1136# CONFIG_TIMER_STATS is not set
1137# CONFIG_DEBUG_OBJECTS is not set
1138# CONFIG_DEBUG_SLAB is not set
1139# CONFIG_DEBUG_KMEMLEAK is not set
1140# CONFIG_DEBUG_PREEMPT is not set
1141# CONFIG_DEBUG_RT_MUTEXES is not set
1142# CONFIG_RT_MUTEX_TESTER is not set
1143# CONFIG_DEBUG_SPINLOCK is not set
1144# CONFIG_DEBUG_MUTEXES is not set
1145# CONFIG_DEBUG_LOCK_ALLOC is not set
1146# CONFIG_PROVE_LOCKING is not set
1147# CONFIG_LOCK_STAT is not set
1148# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1149# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1150# CONFIG_DEBUG_KOBJECT is not set
1151# CONFIG_DEBUG_BUGVERBOSE is not set
1152CONFIG_DEBUG_INFO=y
1153# CONFIG_DEBUG_VM is not set
1154# CONFIG_DEBUG_WRITECOUNT is not set
1155# CONFIG_DEBUG_MEMORY_INIT is not set
1156# CONFIG_DEBUG_LIST is not set
1157# CONFIG_DEBUG_SG is not set
1158# CONFIG_DEBUG_NOTIFIERS is not set
1159# CONFIG_BOOT_PRINTK_DELAY is not set
1160# CONFIG_RCU_TORTURE_TEST is not set
1161# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1162# CONFIG_BACKTRACE_SELF_TEST is not set
1163# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1164# CONFIG_FAULT_INJECTION is not set
1165# CONFIG_LATENCYTOP is not set
1166# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1167# CONFIG_PAGE_POISONING is not set
1168CONFIG_HAVE_FUNCTION_TRACER=y
1169CONFIG_TRACING_SUPPORT=y
1170CONFIG_FTRACE=y
1171# CONFIG_FUNCTION_TRACER is not set
1172# CONFIG_IRQSOFF_TRACER is not set
1173# CONFIG_PREEMPT_TRACER is not set
1174# CONFIG_SCHED_TRACER is not set
1175# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1176# CONFIG_BOOT_TRACER is not set
1177CONFIG_BRANCH_PROFILE_NONE=y
1178# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1179# CONFIG_PROFILE_ALL_BRANCHES is not set
1180# CONFIG_STACK_TRACER is not set
1181# CONFIG_KMEMTRACE is not set
1182# CONFIG_WORKQUEUE_TRACER is not set
1183# CONFIG_BLK_DEV_IO_TRACE is not set
1184# CONFIG_SAMPLES is not set
1185CONFIG_HAVE_ARCH_KGDB=y
1186# CONFIG_KGDB is not set
1187CONFIG_ARM_UNWIND=y
1188# CONFIG_DEBUG_USER is not set
1189# CONFIG_DEBUG_ERRORS is not set
1190# CONFIG_DEBUG_STACK_USAGE is not set
1191# CONFIG_DEBUG_LL is not set
1192
1193#
1194# Security options
1195#
1196# CONFIG_KEYS is not set
1197# CONFIG_SECURITY is not set
1198# CONFIG_SECURITYFS is not set
1199# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1200CONFIG_CRYPTO=y
1201
1202#
1203# Crypto core or helper
1204#
1205# CONFIG_CRYPTO_FIPS is not set
1206CONFIG_CRYPTO_ALGAPI=y
1207CONFIG_CRYPTO_ALGAPI2=y
1208CONFIG_CRYPTO_AEAD2=y
1209CONFIG_CRYPTO_BLKCIPHER=y
1210CONFIG_CRYPTO_BLKCIPHER2=y
1211CONFIG_CRYPTO_HASH=y
1212CONFIG_CRYPTO_HASH2=y
1213CONFIG_CRYPTO_RNG2=y
1214CONFIG_CRYPTO_PCOMP=y
1215CONFIG_CRYPTO_MANAGER=y
1216CONFIG_CRYPTO_MANAGER2=y
1217# CONFIG_CRYPTO_GF128MUL is not set
1218# CONFIG_CRYPTO_NULL is not set
1219CONFIG_CRYPTO_WORKQUEUE=y
1220# CONFIG_CRYPTO_CRYPTD is not set
1221# CONFIG_CRYPTO_AUTHENC is not set
1222# CONFIG_CRYPTO_TEST is not set
1223
1224#
1225# Authenticated Encryption with Associated Data
1226#
1227# CONFIG_CRYPTO_CCM is not set
1228# CONFIG_CRYPTO_GCM is not set
1229# CONFIG_CRYPTO_SEQIV is not set
1230
1231#
1232# Block modes
1233#
1234CONFIG_CRYPTO_CBC=y
1235# CONFIG_CRYPTO_CTR is not set
1236# CONFIG_CRYPTO_CTS is not set
1237CONFIG_CRYPTO_ECB=m
1238# CONFIG_CRYPTO_LRW is not set
1239# CONFIG_CRYPTO_PCBC is not set
1240# CONFIG_CRYPTO_XTS is not set
1241
1242#
1243# Hash modes
1244#
1245# CONFIG_CRYPTO_HMAC is not set
1246# CONFIG_CRYPTO_XCBC is not set
1247
1248#
1249# Digest
1250#
1251# CONFIG_CRYPTO_CRC32C is not set
1252# CONFIG_CRYPTO_MD4 is not set
1253CONFIG_CRYPTO_MD5=y
1254# CONFIG_CRYPTO_MICHAEL_MIC is not set
1255# CONFIG_CRYPTO_RMD128 is not set
1256# CONFIG_CRYPTO_RMD160 is not set
1257# CONFIG_CRYPTO_RMD256 is not set
1258# CONFIG_CRYPTO_RMD320 is not set
1259CONFIG_CRYPTO_SHA1=y
1260# CONFIG_CRYPTO_SHA256 is not set
1261# CONFIG_CRYPTO_SHA512 is not set
1262# CONFIG_CRYPTO_TGR192 is not set
1263# CONFIG_CRYPTO_WP512 is not set
1264
1265#
1266# Ciphers
1267#
1268# CONFIG_CRYPTO_AES is not set
1269# CONFIG_CRYPTO_ANUBIS is not set
1270CONFIG_CRYPTO_ARC4=m
1271# CONFIG_CRYPTO_BLOWFISH is not set
1272# CONFIG_CRYPTO_CAMELLIA is not set
1273# CONFIG_CRYPTO_CAST5 is not set
1274# CONFIG_CRYPTO_CAST6 is not set
1275CONFIG_CRYPTO_DES=y
1276# CONFIG_CRYPTO_FCRYPT is not set
1277# CONFIG_CRYPTO_KHAZAD is not set
1278# CONFIG_CRYPTO_SALSA20 is not set
1279# CONFIG_CRYPTO_SEED is not set
1280# CONFIG_CRYPTO_SERPENT is not set
1281# CONFIG_CRYPTO_TEA is not set
1282# CONFIG_CRYPTO_TWOFISH is not set
1283
1284#
1285# Compression
1286#
1287# CONFIG_CRYPTO_DEFLATE is not set
1288# CONFIG_CRYPTO_ZLIB is not set
1289# CONFIG_CRYPTO_LZO is not set
1290
1291#
1292# Random Number Generation
1293#
1294# CONFIG_CRYPTO_ANSI_CPRNG is not set
1295CONFIG_CRYPTO_HW=y
1296# CONFIG_BINARY_PRINTF is not set
1297
1298#
1299# Library routines
1300#
1301CONFIG_BITREVERSE=y
1302CONFIG_GENERIC_FIND_LAST_BIT=y
1303CONFIG_CRC_CCITT=m
1304# CONFIG_CRC16 is not set
1305# CONFIG_CRC_T10DIF is not set
1306# CONFIG_CRC_ITU_T is not set
1307CONFIG_CRC32=y
1308# CONFIG_CRC7 is not set
1309# CONFIG_LIBCRC32C is not set
1310CONFIG_ZLIB_INFLATE=y
1311CONFIG_ZLIB_DEFLATE=y
1312CONFIG_DECOMPRESS_GZIP=y
1313CONFIG_HAS_IOMEM=y
1314CONFIG_HAS_IOPORT=y
1315CONFIG_HAS_DMA=y
1316CONFIG_NLATTR=y
diff --git a/arch/arm/configs/s5pc100_defconfig b/arch/arm/configs/s5pc100_defconfig
new file mode 100644
index 000000000000..b0d7d3d3a5e3
--- /dev/null
+++ b/arch/arm/configs/s5pc100_defconfig
@@ -0,0 +1,892 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30
4# Wed Jul 1 15:53:07 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_MMU=y
10CONFIG_NO_IOPORT=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_INIT_ENV_ARG_LIMIT=32
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35# CONFIG_SYSVIPC is not set
36# CONFIG_BSD_PROCESS_ACCT is not set
37
38#
39# RCU Subsystem
40#
41CONFIG_CLASSIC_RCU=y
42# CONFIG_TREE_RCU is not set
43# CONFIG_PREEMPT_RCU is not set
44# CONFIG_TREE_RCU_TRACE is not set
45# CONFIG_PREEMPT_RCU_TRACE is not set
46# CONFIG_IKCONFIG is not set
47CONFIG_LOG_BUF_SHIFT=17
48# CONFIG_GROUP_SCHED is not set
49# CONFIG_CGROUPS is not set
50CONFIG_SYSFS_DEPRECATED=y
51CONFIG_SYSFS_DEPRECATED_V2=y
52# CONFIG_RELAY is not set
53CONFIG_NAMESPACES=y
54# CONFIG_UTS_NS is not set
55# CONFIG_USER_NS is not set
56# CONFIG_PID_NS is not set
57CONFIG_BLK_DEV_INITRD=y
58CONFIG_INITRAMFS_SOURCE=""
59CONFIG_RD_GZIP=y
60CONFIG_RD_BZIP2=y
61CONFIG_RD_LZMA=y
62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
63CONFIG_SYSCTL=y
64CONFIG_ANON_INODES=y
65# CONFIG_EMBEDDED is not set
66CONFIG_UID16=y
67CONFIG_SYSCTL_SYSCALL=y
68CONFIG_KALLSYMS=y
69CONFIG_KALLSYMS_ALL=y
70# CONFIG_KALLSYMS_EXTRA_PASS is not set
71CONFIG_HOTPLUG=y
72CONFIG_PRINTK=y
73CONFIG_BUG=y
74CONFIG_ELF_CORE=y
75CONFIG_BASE_FULL=y
76CONFIG_FUTEX=y
77CONFIG_EPOLL=y
78CONFIG_SIGNALFD=y
79CONFIG_TIMERFD=y
80CONFIG_EVENTFD=y
81CONFIG_SHMEM=y
82CONFIG_AIO=y
83
84#
85# Performance Counters
86#
87CONFIG_VM_EVENT_COUNTERS=y
88CONFIG_SLUB_DEBUG=y
89# CONFIG_STRIP_ASM_SYMS is not set
90CONFIG_COMPAT_BRK=y
91# CONFIG_SLAB is not set
92CONFIG_SLUB=y
93# CONFIG_SLOB is not set
94# CONFIG_PROFILING is not set
95# CONFIG_MARKERS is not set
96CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
101
102#
103# GCOV-based kernel profiling
104#
105# CONFIG_SLOW_WORK is not set
106CONFIG_HAVE_GENERIC_DMA_COHERENT=y
107CONFIG_SLABINFO=y
108CONFIG_RT_MUTEXES=y
109CONFIG_BASE_SMALL=0
110CONFIG_MODULES=y
111# CONFIG_MODULE_FORCE_LOAD is not set
112CONFIG_MODULE_UNLOAD=y
113# CONFIG_MODULE_FORCE_UNLOAD is not set
114# CONFIG_MODVERSIONS is not set
115# CONFIG_MODULE_SRCVERSION_ALL is not set
116CONFIG_BLOCK=y
117CONFIG_LBDAF=y
118# CONFIG_BLK_DEV_BSG is not set
119# CONFIG_BLK_DEV_INTEGRITY is not set
120
121#
122# IO Schedulers
123#
124CONFIG_IOSCHED_NOOP=y
125CONFIG_IOSCHED_AS=y
126CONFIG_IOSCHED_DEADLINE=y
127CONFIG_IOSCHED_CFQ=y
128# CONFIG_DEFAULT_AS is not set
129# CONFIG_DEFAULT_DEADLINE is not set
130CONFIG_DEFAULT_CFQ=y
131# CONFIG_DEFAULT_NOOP is not set
132CONFIG_DEFAULT_IOSCHED="cfq"
133# CONFIG_FREEZER is not set
134
135#
136# System Type
137#
138# CONFIG_ARCH_AAEC2000 is not set
139# CONFIG_ARCH_INTEGRATOR is not set
140# CONFIG_ARCH_REALVIEW is not set
141# CONFIG_ARCH_VERSATILE is not set
142# CONFIG_ARCH_AT91 is not set
143# CONFIG_ARCH_CLPS711X is not set
144# CONFIG_ARCH_GEMINI is not set
145# CONFIG_ARCH_EBSA110 is not set
146# CONFIG_ARCH_EP93XX is not set
147# CONFIG_ARCH_FOOTBRIDGE is not set
148# CONFIG_ARCH_MXC is not set
149# CONFIG_ARCH_STMP3XXX is not set
150# CONFIG_ARCH_NETX is not set
151# CONFIG_ARCH_H720X is not set
152# CONFIG_ARCH_IOP13XX is not set
153# CONFIG_ARCH_IOP32X is not set
154# CONFIG_ARCH_IOP33X is not set
155# CONFIG_ARCH_IXP23XX is not set
156# CONFIG_ARCH_IXP2000 is not set
157# CONFIG_ARCH_IXP4XX is not set
158# CONFIG_ARCH_L7200 is not set
159# CONFIG_ARCH_KIRKWOOD is not set
160# CONFIG_ARCH_LOKI is not set
161# CONFIG_ARCH_MV78XX0 is not set
162# CONFIG_ARCH_ORION5X is not set
163# CONFIG_ARCH_MMP is not set
164# CONFIG_ARCH_KS8695 is not set
165# CONFIG_ARCH_NS9XXX is not set
166# CONFIG_ARCH_W90X900 is not set
167# CONFIG_ARCH_PNX4008 is not set
168# CONFIG_ARCH_PXA is not set
169# CONFIG_ARCH_MSM is not set
170# CONFIG_ARCH_RPC is not set
171# CONFIG_ARCH_SA1100 is not set
172# CONFIG_ARCH_S3C2410 is not set
173# CONFIG_ARCH_S3C64XX is not set
174CONFIG_ARCH_S5PC1XX=y
175# CONFIG_ARCH_SHARK is not set
176# CONFIG_ARCH_LH7A40X is not set
177# CONFIG_ARCH_U300 is not set
178# CONFIG_ARCH_DAVINCI is not set
179# CONFIG_ARCH_OMAP is not set
180CONFIG_PLAT_S3C=y
181
182#
183# Boot options
184#
185# CONFIG_S3C_BOOT_ERROR_RESET is not set
186CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
187
188#
189# Power management
190#
191CONFIG_S3C_LOWLEVEL_UART_PORT=0
192CONFIG_S3C_GPIO_SPACE=0
193CONFIG_S3C_GPIO_TRACK=y
194CONFIG_S3C_GPIO_PULL_UPDOWN=y
195CONFIG_PLAT_S5PC1XX=y
196CONFIG_CPU_S5PC100_INIT=y
197CONFIG_CPU_S5PC100_CLOCK=y
198CONFIG_S5PC100_SETUP_I2C0=y
199CONFIG_CPU_S5PC100=y
200CONFIG_MACH_SMDKC100=y
201
202#
203# Processor Type
204#
205CONFIG_CPU_32=y
206CONFIG_CPU_32v6K=y
207CONFIG_CPU_V7=y
208CONFIG_CPU_32v7=y
209CONFIG_CPU_ABRT_EV7=y
210CONFIG_CPU_PABRT_IFAR=y
211CONFIG_CPU_CACHE_V7=y
212CONFIG_CPU_CACHE_VIPT=y
213CONFIG_CPU_COPY_V6=y
214CONFIG_CPU_TLB_V7=y
215CONFIG_CPU_HAS_ASID=y
216CONFIG_CPU_CP15=y
217CONFIG_CPU_CP15_MMU=y
218
219#
220# Processor Features
221#
222CONFIG_ARM_THUMB=y
223# CONFIG_ARM_THUMBEE is not set
224# CONFIG_CPU_ICACHE_DISABLE is not set
225# CONFIG_CPU_DCACHE_DISABLE is not set
226# CONFIG_CPU_BPREDICT_DISABLE is not set
227CONFIG_HAS_TLS_REG=y
228# CONFIG_ARM_ERRATA_430973 is not set
229# CONFIG_ARM_ERRATA_458693 is not set
230# CONFIG_ARM_ERRATA_460075 is not set
231CONFIG_ARM_VIC=y
232CONFIG_ARM_VIC_NR=2
233
234#
235# Bus support
236#
237# CONFIG_PCI_SYSCALL is not set
238# CONFIG_ARCH_SUPPORTS_MSI is not set
239# CONFIG_PCCARD is not set
240
241#
242# Kernel Features
243#
244CONFIG_VMSPLIT_3G=y
245# CONFIG_VMSPLIT_2G is not set
246# CONFIG_VMSPLIT_1G is not set
247CONFIG_PAGE_OFFSET=0xC0000000
248# CONFIG_PREEMPT is not set
249CONFIG_HZ=100
250CONFIG_AEABI=y
251CONFIG_OABI_COMPAT=y
252# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
253# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
254# CONFIG_HIGHMEM is not set
255CONFIG_SELECT_MEMORY_MODEL=y
256CONFIG_FLATMEM_MANUAL=y
257# CONFIG_DISCONTIGMEM_MANUAL is not set
258# CONFIG_SPARSEMEM_MANUAL is not set
259CONFIG_FLATMEM=y
260CONFIG_FLAT_NODE_MEM_MAP=y
261CONFIG_PAGEFLAGS_EXTENDED=y
262CONFIG_SPLIT_PTLOCK_CPUS=4
263# CONFIG_PHYS_ADDR_T_64BIT is not set
264CONFIG_ZONE_DMA_FLAG=0
265CONFIG_VIRT_TO_BUS=y
266CONFIG_HAVE_MLOCK=y
267CONFIG_HAVE_MLOCKED_PAGE_BIT=y
268CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
269CONFIG_ALIGNMENT_TRAP=y
270# CONFIG_UACCESS_WITH_MEMCPY is not set
271
272#
273# Boot options
274#
275CONFIG_ZBOOT_ROM_TEXT=0
276CONFIG_ZBOOT_ROM_BSS=0
277CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=cramfs init=/linuxrc console=ttySAC2,115200 mem=128M"
278# CONFIG_XIP_KERNEL is not set
279# CONFIG_KEXEC is not set
280
281#
282# CPU Power Management
283#
284# CONFIG_CPU_IDLE is not set
285
286#
287# Floating point emulation
288#
289
290#
291# At least one emulation must be selected
292#
293# CONFIG_FPE_NWFPE is not set
294# CONFIG_FPE_FASTFPE is not set
295# CONFIG_VFP is not set
296
297#
298# Userspace binary formats
299#
300CONFIG_BINFMT_ELF=y
301# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
302CONFIG_HAVE_AOUT=y
303# CONFIG_BINFMT_AOUT is not set
304# CONFIG_BINFMT_MISC is not set
305
306#
307# Power management options
308#
309# CONFIG_PM is not set
310CONFIG_ARCH_SUSPEND_POSSIBLE=y
311# CONFIG_NET is not set
312
313#
314# Device Drivers
315#
316
317#
318# Generic Driver Options
319#
320CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
321CONFIG_STANDALONE=y
322CONFIG_PREVENT_FIRMWARE_BUILD=y
323CONFIG_FW_LOADER=y
324CONFIG_FIRMWARE_IN_KERNEL=y
325CONFIG_EXTRA_FIRMWARE=""
326# CONFIG_DEBUG_DRIVER is not set
327# CONFIG_DEBUG_DEVRES is not set
328# CONFIG_SYS_HYPERVISOR is not set
329# CONFIG_MTD is not set
330# CONFIG_PARPORT is not set
331CONFIG_BLK_DEV=y
332# CONFIG_BLK_DEV_COW_COMMON is not set
333CONFIG_BLK_DEV_LOOP=y
334# CONFIG_BLK_DEV_CRYPTOLOOP is not set
335CONFIG_BLK_DEV_RAM=y
336CONFIG_BLK_DEV_RAM_COUNT=16
337CONFIG_BLK_DEV_RAM_SIZE=8192
338# CONFIG_BLK_DEV_XIP is not set
339# CONFIG_CDROM_PKTCDVD is not set
340# CONFIG_MG_DISK is not set
341CONFIG_MISC_DEVICES=y
342# CONFIG_ICS932S401 is not set
343# CONFIG_ENCLOSURE_SERVICES is not set
344# CONFIG_ISL29003 is not set
345# CONFIG_C2PORT is not set
346
347#
348# EEPROM support
349#
350CONFIG_EEPROM_AT24=y
351# CONFIG_EEPROM_LEGACY is not set
352# CONFIG_EEPROM_MAX6875 is not set
353# CONFIG_EEPROM_93CX6 is not set
354CONFIG_HAVE_IDE=y
355# CONFIG_IDE is not set
356
357#
358# SCSI device support
359#
360# CONFIG_RAID_ATTRS is not set
361# CONFIG_SCSI is not set
362# CONFIG_SCSI_DMA is not set
363# CONFIG_SCSI_NETLINK is not set
364# CONFIG_ATA is not set
365# CONFIG_MD is not set
366
367#
368# Input device support
369#
370CONFIG_INPUT=y
371# CONFIG_INPUT_FF_MEMLESS is not set
372# CONFIG_INPUT_POLLDEV is not set
373
374#
375# Userland interfaces
376#
377CONFIG_INPUT_MOUSEDEV=y
378CONFIG_INPUT_MOUSEDEV_PSAUX=y
379CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
380CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
381# CONFIG_INPUT_JOYDEV is not set
382# CONFIG_INPUT_EVDEV is not set
383# CONFIG_INPUT_EVBUG is not set
384
385#
386# Input Device Drivers
387#
388CONFIG_INPUT_KEYBOARD=y
389CONFIG_KEYBOARD_ATKBD=y
390# CONFIG_KEYBOARD_SUNKBD is not set
391# CONFIG_KEYBOARD_LKKBD is not set
392# CONFIG_KEYBOARD_XTKBD is not set
393# CONFIG_KEYBOARD_NEWTON is not set
394# CONFIG_KEYBOARD_STOWAWAY is not set
395# CONFIG_KEYBOARD_GPIO is not set
396CONFIG_INPUT_MOUSE=y
397CONFIG_MOUSE_PS2=y
398CONFIG_MOUSE_PS2_ALPS=y
399CONFIG_MOUSE_PS2_LOGIPS2PP=y
400CONFIG_MOUSE_PS2_SYNAPTICS=y
401CONFIG_MOUSE_PS2_TRACKPOINT=y
402# CONFIG_MOUSE_PS2_ELANTECH is not set
403# CONFIG_MOUSE_PS2_TOUCHKIT is not set
404# CONFIG_MOUSE_SERIAL is not set
405# CONFIG_MOUSE_APPLETOUCH is not set
406# CONFIG_MOUSE_BCM5974 is not set
407# CONFIG_MOUSE_VSXXXAA is not set
408# CONFIG_MOUSE_GPIO is not set
409# CONFIG_MOUSE_SYNAPTICS_I2C is not set
410# CONFIG_INPUT_JOYSTICK is not set
411# CONFIG_INPUT_TABLET is not set
412# CONFIG_INPUT_TOUCHSCREEN is not set
413# CONFIG_INPUT_MISC is not set
414
415#
416# Hardware I/O ports
417#
418CONFIG_SERIO=y
419CONFIG_SERIO_SERPORT=y
420CONFIG_SERIO_LIBPS2=y
421# CONFIG_SERIO_RAW is not set
422# CONFIG_GAMEPORT is not set
423
424#
425# Character devices
426#
427CONFIG_VT=y
428CONFIG_CONSOLE_TRANSLATIONS=y
429CONFIG_VT_CONSOLE=y
430CONFIG_HW_CONSOLE=y
431# CONFIG_VT_HW_CONSOLE_BINDING is not set
432CONFIG_DEVKMEM=y
433# CONFIG_SERIAL_NONSTANDARD is not set
434
435#
436# Serial drivers
437#
438CONFIG_SERIAL_8250=y
439# CONFIG_SERIAL_8250_CONSOLE is not set
440CONFIG_SERIAL_8250_NR_UARTS=4
441CONFIG_SERIAL_8250_RUNTIME_UARTS=4
442# CONFIG_SERIAL_8250_EXTENDED is not set
443
444#
445# Non-8250 serial port support
446#
447CONFIG_SERIAL_SAMSUNG=y
448CONFIG_SERIAL_SAMSUNG_UARTS=3
449# CONFIG_SERIAL_SAMSUNG_DEBUG is not set
450CONFIG_SERIAL_SAMSUNG_CONSOLE=y
451CONFIG_SERIAL_CORE=y
452CONFIG_SERIAL_CORE_CONSOLE=y
453CONFIG_UNIX98_PTYS=y
454# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
455CONFIG_LEGACY_PTYS=y
456CONFIG_LEGACY_PTY_COUNT=256
457# CONFIG_IPMI_HANDLER is not set
458CONFIG_HW_RANDOM=y
459# CONFIG_HW_RANDOM_TIMERIOMEM is not set
460# CONFIG_R3964 is not set
461# CONFIG_RAW_DRIVER is not set
462# CONFIG_TCG_TPM is not set
463CONFIG_I2C=y
464CONFIG_I2C_BOARDINFO=y
465CONFIG_I2C_CHARDEV=y
466CONFIG_I2C_HELPER_AUTO=y
467
468#
469# I2C Hardware Bus support
470#
471
472#
473# I2C system bus drivers (mostly embedded / system-on-chip)
474#
475# CONFIG_I2C_GPIO is not set
476# CONFIG_I2C_OCORES is not set
477# CONFIG_I2C_SIMTEC is not set
478
479#
480# External I2C/SMBus adapter drivers
481#
482# CONFIG_I2C_PARPORT_LIGHT is not set
483# CONFIG_I2C_TAOS_EVM is not set
484
485#
486# Other I2C/SMBus bus drivers
487#
488# CONFIG_I2C_PCA_PLATFORM is not set
489# CONFIG_I2C_STUB is not set
490
491#
492# Miscellaneous I2C Chip support
493#
494# CONFIG_DS1682 is not set
495# CONFIG_SENSORS_PCF8574 is not set
496# CONFIG_PCF8575 is not set
497# CONFIG_SENSORS_PCA9539 is not set
498# CONFIG_SENSORS_TSL2550 is not set
499# CONFIG_I2C_DEBUG_CORE is not set
500# CONFIG_I2C_DEBUG_ALGO is not set
501# CONFIG_I2C_DEBUG_BUS is not set
502# CONFIG_I2C_DEBUG_CHIP is not set
503# CONFIG_SPI is not set
504CONFIG_ARCH_REQUIRE_GPIOLIB=y
505CONFIG_GPIOLIB=y
506# CONFIG_DEBUG_GPIO is not set
507# CONFIG_GPIO_SYSFS is not set
508
509#
510# Memory mapped GPIO expanders:
511#
512
513#
514# I2C GPIO expanders:
515#
516# CONFIG_GPIO_MAX732X is not set
517# CONFIG_GPIO_PCA953X is not set
518# CONFIG_GPIO_PCF857X is not set
519
520#
521# PCI GPIO expanders:
522#
523
524#
525# SPI GPIO expanders:
526#
527# CONFIG_W1 is not set
528# CONFIG_POWER_SUPPLY is not set
529CONFIG_HWMON=y
530# CONFIG_HWMON_VID is not set
531# CONFIG_SENSORS_AD7414 is not set
532# CONFIG_SENSORS_AD7418 is not set
533# CONFIG_SENSORS_ADM1021 is not set
534# CONFIG_SENSORS_ADM1025 is not set
535# CONFIG_SENSORS_ADM1026 is not set
536# CONFIG_SENSORS_ADM1029 is not set
537# CONFIG_SENSORS_ADM1031 is not set
538# CONFIG_SENSORS_ADM9240 is not set
539# CONFIG_SENSORS_ADT7462 is not set
540# CONFIG_SENSORS_ADT7470 is not set
541# CONFIG_SENSORS_ADT7473 is not set
542# CONFIG_SENSORS_ADT7475 is not set
543# CONFIG_SENSORS_ATXP1 is not set
544# CONFIG_SENSORS_DS1621 is not set
545# CONFIG_SENSORS_F71805F is not set
546# CONFIG_SENSORS_F71882FG is not set
547# CONFIG_SENSORS_F75375S is not set
548# CONFIG_SENSORS_G760A is not set
549# CONFIG_SENSORS_GL518SM is not set
550# CONFIG_SENSORS_GL520SM is not set
551# CONFIG_SENSORS_IT87 is not set
552# CONFIG_SENSORS_LM63 is not set
553# CONFIG_SENSORS_LM75 is not set
554# CONFIG_SENSORS_LM77 is not set
555# CONFIG_SENSORS_LM78 is not set
556# CONFIG_SENSORS_LM80 is not set
557# CONFIG_SENSORS_LM83 is not set
558# CONFIG_SENSORS_LM85 is not set
559# CONFIG_SENSORS_LM87 is not set
560# CONFIG_SENSORS_LM90 is not set
561# CONFIG_SENSORS_LM92 is not set
562# CONFIG_SENSORS_LM93 is not set
563# CONFIG_SENSORS_LTC4215 is not set
564# CONFIG_SENSORS_LTC4245 is not set
565# CONFIG_SENSORS_LM95241 is not set
566# CONFIG_SENSORS_MAX1619 is not set
567# CONFIG_SENSORS_MAX6650 is not set
568# CONFIG_SENSORS_PC87360 is not set
569# CONFIG_SENSORS_PC87427 is not set
570# CONFIG_SENSORS_PCF8591 is not set
571# CONFIG_SENSORS_SHT15 is not set
572# CONFIG_SENSORS_DME1737 is not set
573# CONFIG_SENSORS_SMSC47M1 is not set
574# CONFIG_SENSORS_SMSC47M192 is not set
575# CONFIG_SENSORS_SMSC47B397 is not set
576# CONFIG_SENSORS_ADS7828 is not set
577# CONFIG_SENSORS_THMC50 is not set
578# CONFIG_SENSORS_TMP401 is not set
579# CONFIG_SENSORS_VT1211 is not set
580# CONFIG_SENSORS_W83781D is not set
581# CONFIG_SENSORS_W83791D is not set
582# CONFIG_SENSORS_W83792D is not set
583# CONFIG_SENSORS_W83793 is not set
584# CONFIG_SENSORS_W83L785TS is not set
585# CONFIG_SENSORS_W83L786NG is not set
586# CONFIG_SENSORS_W83627HF is not set
587# CONFIG_SENSORS_W83627EHF is not set
588# CONFIG_HWMON_DEBUG_CHIP is not set
589# CONFIG_THERMAL is not set
590# CONFIG_THERMAL_HWMON is not set
591# CONFIG_WATCHDOG is not set
592CONFIG_SSB_POSSIBLE=y
593
594#
595# Sonics Silicon Backplane
596#
597# CONFIG_SSB is not set
598
599#
600# Multifunction device drivers
601#
602# CONFIG_MFD_CORE is not set
603# CONFIG_MFD_SM501 is not set
604# CONFIG_MFD_ASIC3 is not set
605# CONFIG_HTC_EGPIO is not set
606# CONFIG_HTC_PASIC3 is not set
607# CONFIG_TPS65010 is not set
608# CONFIG_TWL4030_CORE is not set
609# CONFIG_MFD_TMIO is not set
610# CONFIG_MFD_T7L66XB is not set
611# CONFIG_MFD_TC6387XB is not set
612# CONFIG_MFD_TC6393XB is not set
613# CONFIG_PMIC_DA903X is not set
614# CONFIG_MFD_WM8400 is not set
615# CONFIG_MFD_WM8350_I2C is not set
616# CONFIG_MFD_PCF50633 is not set
617# CONFIG_AB3100_CORE is not set
618# CONFIG_MEDIA_SUPPORT is not set
619
620#
621# Graphics support
622#
623# CONFIG_VGASTATE is not set
624# CONFIG_VIDEO_OUTPUT_CONTROL is not set
625# CONFIG_FB is not set
626# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
627
628#
629# Display device support
630#
631# CONFIG_DISPLAY_SUPPORT is not set
632
633#
634# Console display driver support
635#
636# CONFIG_VGA_CONSOLE is not set
637CONFIG_DUMMY_CONSOLE=y
638# CONFIG_SOUND is not set
639CONFIG_HID_SUPPORT=y
640CONFIG_HID=y
641CONFIG_HID_DEBUG=y
642# CONFIG_HIDRAW is not set
643# CONFIG_HID_PID is not set
644
645#
646# Special HID drivers
647#
648CONFIG_USB_SUPPORT=y
649CONFIG_USB_ARCH_HAS_HCD=y
650# CONFIG_USB_ARCH_HAS_OHCI is not set
651# CONFIG_USB_ARCH_HAS_EHCI is not set
652# CONFIG_USB is not set
653
654#
655# Enable Host or Gadget support to see Inventra options
656#
657
658#
659# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
660#
661# CONFIG_USB_GADGET is not set
662
663#
664# OTG and related infrastructure
665#
666CONFIG_MMC=y
667CONFIG_MMC_DEBUG=y
668CONFIG_MMC_UNSAFE_RESUME=y
669
670#
671# MMC/SD/SDIO Card Drivers
672#
673CONFIG_MMC_BLOCK=y
674CONFIG_MMC_BLOCK_BOUNCE=y
675CONFIG_SDIO_UART=y
676# CONFIG_MMC_TEST is not set
677
678#
679# MMC/SD/SDIO Host Controller Drivers
680#
681CONFIG_MMC_SDHCI=y
682# CONFIG_MMC_SDHCI_PLTFM is not set
683# CONFIG_MEMSTICK is not set
684# CONFIG_ACCESSIBILITY is not set
685# CONFIG_NEW_LEDS is not set
686CONFIG_RTC_LIB=y
687# CONFIG_RTC_CLASS is not set
688# CONFIG_DMADEVICES is not set
689# CONFIG_AUXDISPLAY is not set
690# CONFIG_REGULATOR is not set
691# CONFIG_UIO is not set
692# CONFIG_STAGING is not set
693
694#
695# File systems
696#
697CONFIG_EXT2_FS=y
698# CONFIG_EXT2_FS_XATTR is not set
699# CONFIG_EXT2_FS_XIP is not set
700CONFIG_EXT3_FS=y
701# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
702CONFIG_EXT3_FS_XATTR=y
703CONFIG_EXT3_FS_POSIX_ACL=y
704CONFIG_EXT3_FS_SECURITY=y
705# CONFIG_EXT4_FS is not set
706CONFIG_JBD=y
707CONFIG_FS_MBCACHE=y
708# CONFIG_REISERFS_FS is not set
709# CONFIG_JFS_FS is not set
710CONFIG_FS_POSIX_ACL=y
711# CONFIG_XFS_FS is not set
712# CONFIG_GFS2_FS is not set
713# CONFIG_BTRFS_FS is not set
714CONFIG_FILE_LOCKING=y
715CONFIG_FSNOTIFY=y
716CONFIG_DNOTIFY=y
717CONFIG_INOTIFY=y
718CONFIG_INOTIFY_USER=y
719# CONFIG_QUOTA is not set
720# CONFIG_AUTOFS_FS is not set
721# CONFIG_AUTOFS4_FS is not set
722# CONFIG_FUSE_FS is not set
723CONFIG_GENERIC_ACL=y
724
725#
726# Caches
727#
728# CONFIG_FSCACHE is not set
729
730#
731# CD-ROM/DVD Filesystems
732#
733# CONFIG_ISO9660_FS is not set
734# CONFIG_UDF_FS is not set
735
736#
737# DOS/FAT/NT Filesystems
738#
739# CONFIG_MSDOS_FS is not set
740# CONFIG_VFAT_FS is not set
741# CONFIG_NTFS_FS is not set
742
743#
744# Pseudo filesystems
745#
746CONFIG_PROC_FS=y
747CONFIG_PROC_SYSCTL=y
748CONFIG_PROC_PAGE_MONITOR=y
749CONFIG_SYSFS=y
750CONFIG_TMPFS=y
751CONFIG_TMPFS_POSIX_ACL=y
752# CONFIG_HUGETLB_PAGE is not set
753# CONFIG_CONFIGFS_FS is not set
754CONFIG_MISC_FILESYSTEMS=y
755# CONFIG_ADFS_FS is not set
756# CONFIG_AFFS_FS is not set
757# CONFIG_HFS_FS is not set
758# CONFIG_HFSPLUS_FS is not set
759# CONFIG_BEFS_FS is not set
760# CONFIG_BFS_FS is not set
761# CONFIG_EFS_FS is not set
762CONFIG_CRAMFS=y
763# CONFIG_SQUASHFS is not set
764# CONFIG_VXFS_FS is not set
765# CONFIG_MINIX_FS is not set
766# CONFIG_OMFS_FS is not set
767# CONFIG_HPFS_FS is not set
768# CONFIG_QNX4FS_FS is not set
769CONFIG_ROMFS_FS=y
770CONFIG_ROMFS_BACKED_BY_BLOCK=y
771# CONFIG_ROMFS_BACKED_BY_MTD is not set
772# CONFIG_ROMFS_BACKED_BY_BOTH is not set
773CONFIG_ROMFS_ON_BLOCK=y
774# CONFIG_SYSV_FS is not set
775# CONFIG_UFS_FS is not set
776# CONFIG_NILFS2_FS is not set
777
778#
779# Partition Types
780#
781# CONFIG_PARTITION_ADVANCED is not set
782CONFIG_MSDOS_PARTITION=y
783# CONFIG_NLS is not set
784
785#
786# Kernel hacking
787#
788# CONFIG_PRINTK_TIME is not set
789CONFIG_ENABLE_WARN_DEPRECATED=y
790CONFIG_ENABLE_MUST_CHECK=y
791CONFIG_FRAME_WARN=1024
792CONFIG_MAGIC_SYSRQ=y
793# CONFIG_UNUSED_SYMBOLS is not set
794# CONFIG_DEBUG_FS is not set
795# CONFIG_HEADERS_CHECK is not set
796CONFIG_DEBUG_KERNEL=y
797# CONFIG_DEBUG_SHIRQ is not set
798CONFIG_DETECT_SOFTLOCKUP=y
799# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
800CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
801CONFIG_DETECT_HUNG_TASK=y
802# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
803CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
804CONFIG_SCHED_DEBUG=y
805# CONFIG_SCHEDSTATS is not set
806# CONFIG_TIMER_STATS is not set
807# CONFIG_DEBUG_OBJECTS is not set
808# CONFIG_SLUB_DEBUG_ON is not set
809# CONFIG_SLUB_STATS is not set
810# CONFIG_DEBUG_KMEMLEAK is not set
811CONFIG_DEBUG_RT_MUTEXES=y
812CONFIG_DEBUG_PI_LIST=y
813# CONFIG_RT_MUTEX_TESTER is not set
814CONFIG_DEBUG_SPINLOCK=y
815CONFIG_DEBUG_MUTEXES=y
816# CONFIG_DEBUG_LOCK_ALLOC is not set
817# CONFIG_PROVE_LOCKING is not set
818# CONFIG_LOCK_STAT is not set
819CONFIG_DEBUG_SPINLOCK_SLEEP=y
820# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
821# CONFIG_DEBUG_KOBJECT is not set
822CONFIG_DEBUG_BUGVERBOSE=y
823CONFIG_DEBUG_INFO=y
824# CONFIG_DEBUG_VM is not set
825# CONFIG_DEBUG_WRITECOUNT is not set
826CONFIG_DEBUG_MEMORY_INIT=y
827# CONFIG_DEBUG_LIST is not set
828# CONFIG_DEBUG_SG is not set
829# CONFIG_DEBUG_NOTIFIERS is not set
830# CONFIG_BOOT_PRINTK_DELAY is not set
831# CONFIG_RCU_TORTURE_TEST is not set
832# CONFIG_RCU_CPU_STALL_DETECTOR is not set
833# CONFIG_BACKTRACE_SELF_TEST is not set
834# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
835# CONFIG_FAULT_INJECTION is not set
836# CONFIG_LATENCYTOP is not set
837CONFIG_SYSCTL_SYSCALL_CHECK=y
838# CONFIG_PAGE_POISONING is not set
839CONFIG_HAVE_FUNCTION_TRACER=y
840CONFIG_TRACING_SUPPORT=y
841CONFIG_FTRACE=y
842# CONFIG_FUNCTION_TRACER is not set
843# CONFIG_SCHED_TRACER is not set
844# CONFIG_ENABLE_DEFAULT_TRACERS is not set
845# CONFIG_BOOT_TRACER is not set
846CONFIG_BRANCH_PROFILE_NONE=y
847# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
848# CONFIG_PROFILE_ALL_BRANCHES is not set
849# CONFIG_STACK_TRACER is not set
850# CONFIG_KMEMTRACE is not set
851# CONFIG_WORKQUEUE_TRACER is not set
852# CONFIG_BLK_DEV_IO_TRACE is not set
853# CONFIG_SAMPLES is not set
854CONFIG_HAVE_ARCH_KGDB=y
855# CONFIG_KGDB is not set
856CONFIG_ARM_UNWIND=y
857CONFIG_DEBUG_USER=y
858CONFIG_DEBUG_ERRORS=y
859# CONFIG_DEBUG_STACK_USAGE is not set
860CONFIG_DEBUG_LL=y
861# CONFIG_DEBUG_ICEDCC is not set
862CONFIG_DEBUG_S3C_PORT=y
863CONFIG_DEBUG_S3C_UART=0
864
865#
866# Security options
867#
868# CONFIG_KEYS is not set
869# CONFIG_SECURITY is not set
870# CONFIG_SECURITYFS is not set
871# CONFIG_SECURITY_FILE_CAPABILITIES is not set
872# CONFIG_CRYPTO is not set
873# CONFIG_BINARY_PRINTF is not set
874
875#
876# Library routines
877#
878CONFIG_BITREVERSE=y
879CONFIG_GENERIC_FIND_LAST_BIT=y
880# CONFIG_CRC_CCITT is not set
881# CONFIG_CRC16 is not set
882# CONFIG_CRC_T10DIF is not set
883# CONFIG_CRC_ITU_T is not set
884CONFIG_CRC32=y
885# CONFIG_CRC7 is not set
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_DECOMPRESS_GZIP=y
889CONFIG_DECOMPRESS_BZIP2=y
890CONFIG_DECOMPRESS_LZMA=y
891CONFIG_HAS_IOMEM=y
892CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig
index 4762d9001298..7d61ae6e75da 100644
--- a/arch/arm/configs/u300_defconfig
+++ b/arch/arm/configs/u300_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.31-rc1 3# Linux kernel version: 2.6.31-rc3
4# Thu Jul 2 00:16:59 2009 4# Thu Jul 16 23:36:10 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -9,7 +9,6 @@ CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y 11CONFIG_MMU=y
12CONFIG_HAVE_TCM=y
13CONFIG_GENERIC_HARDIRQS=y 12CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 13CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -113,7 +112,7 @@ CONFIG_MODULE_UNLOAD=y
113# CONFIG_MODVERSIONS is not set 112# CONFIG_MODVERSIONS is not set
114# CONFIG_MODULE_SRCVERSION_ALL is not set 113# CONFIG_MODULE_SRCVERSION_ALL is not set
115CONFIG_BLOCK=y 114CONFIG_BLOCK=y
116CONFIG_LBDAF=y 115# CONFIG_LBDAF is not set
117# CONFIG_BLK_DEV_BSG is not set 116# CONFIG_BLK_DEV_BSG is not set
118# CONFIG_BLK_DEV_INTEGRITY is not set 117# CONFIG_BLK_DEV_INTEGRITY is not set
119 118
@@ -542,13 +541,14 @@ CONFIG_INPUT_EVDEV=y
542# 541#
543CONFIG_INPUT_KEYBOARD=y 542CONFIG_INPUT_KEYBOARD=y
544# CONFIG_KEYBOARD_ATKBD is not set 543# CONFIG_KEYBOARD_ATKBD is not set
545# CONFIG_KEYBOARD_SUNKBD is not set
546# CONFIG_KEYBOARD_LKKBD is not set 544# CONFIG_KEYBOARD_LKKBD is not set
547# CONFIG_KEYBOARD_XTKBD is not set 545# CONFIG_KEYBOARD_GPIO is not set
546# CONFIG_KEYBOARD_MATRIX is not set
547# CONFIG_KEYBOARD_LM8323 is not set
548# CONFIG_KEYBOARD_NEWTON is not set 548# CONFIG_KEYBOARD_NEWTON is not set
549# CONFIG_KEYBOARD_STOWAWAY is not set 549# CONFIG_KEYBOARD_STOWAWAY is not set
550# CONFIG_KEYBOARD_LM8323 is not set 550# CONFIG_KEYBOARD_SUNKBD is not set
551# CONFIG_KEYBOARD_GPIO is not set 551# CONFIG_KEYBOARD_XTKBD is not set
552# CONFIG_INPUT_MOUSE is not set 552# CONFIG_INPUT_MOUSE is not set
553# CONFIG_INPUT_JOYSTICK is not set 553# CONFIG_INPUT_JOYSTICK is not set
554# CONFIG_INPUT_TABLET is not set 554# CONFIG_INPUT_TABLET is not set
@@ -911,7 +911,6 @@ CONFIG_REGULATOR=y
911# CONFIG_JFS_FS is not set 911# CONFIG_JFS_FS is not set
912# CONFIG_FS_POSIX_ACL is not set 912# CONFIG_FS_POSIX_ACL is not set
913# CONFIG_XFS_FS is not set 913# CONFIG_XFS_FS is not set
914# CONFIG_GFS2_FS is not set
915# CONFIG_OCFS2_FS is not set 914# CONFIG_OCFS2_FS is not set
916# CONFIG_BTRFS_FS is not set 915# CONFIG_BTRFS_FS is not set
917CONFIG_FILE_LOCKING=y 916CONFIG_FILE_LOCKING=y
@@ -1122,7 +1121,6 @@ CONFIG_GENERIC_FIND_LAST_BIT=y
1122# CONFIG_CRC32 is not set 1121# CONFIG_CRC32 is not set
1123# CONFIG_CRC7 is not set 1122# CONFIG_CRC7 is not set
1124# CONFIG_LIBCRC32C is not set 1123# CONFIG_LIBCRC32C is not set
1125CONFIG_GENERIC_ALLOCATOR=y
1126CONFIG_HAS_IOMEM=y 1124CONFIG_HAS_IOMEM=y
1127CONFIG_HAS_IOPORT=y 1125CONFIG_HAS_IOPORT=y
1128CONFIG_HAS_DMA=y 1126CONFIG_HAS_DMA=y
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 15f8a092b700..00f46d9ce299 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -74,23 +74,56 @@
74 * Enable and disable interrupts 74 * Enable and disable interrupts
75 */ 75 */
76#if __LINUX_ARM_ARCH__ >= 6 76#if __LINUX_ARM_ARCH__ >= 6
77 .macro disable_irq 77 .macro disable_irq_notrace
78 cpsid i 78 cpsid i
79 .endm 79 .endm
80 80
81 .macro enable_irq 81 .macro enable_irq_notrace
82 cpsie i 82 cpsie i
83 .endm 83 .endm
84#else 84#else
85 .macro disable_irq 85 .macro disable_irq_notrace
86 msr cpsr_c, #PSR_I_BIT | SVC_MODE 86 msr cpsr_c, #PSR_I_BIT | SVC_MODE
87 .endm 87 .endm
88 88
89 .macro enable_irq 89 .macro enable_irq_notrace
90 msr cpsr_c, #SVC_MODE 90 msr cpsr_c, #SVC_MODE
91 .endm 91 .endm
92#endif 92#endif
93 93
94 .macro asm_trace_hardirqs_off
95#if defined(CONFIG_TRACE_IRQFLAGS)
96 stmdb sp!, {r0-r3, ip, lr}
97 bl trace_hardirqs_off
98 ldmia sp!, {r0-r3, ip, lr}
99#endif
100 .endm
101
102 .macro asm_trace_hardirqs_on_cond, cond
103#if defined(CONFIG_TRACE_IRQFLAGS)
104 /*
105 * actually the registers should be pushed and pop'd conditionally, but
106 * after bl the flags are certainly clobbered
107 */
108 stmdb sp!, {r0-r3, ip, lr}
109 bl\cond trace_hardirqs_on
110 ldmia sp!, {r0-r3, ip, lr}
111#endif
112 .endm
113
114 .macro asm_trace_hardirqs_on
115 asm_trace_hardirqs_on_cond al
116 .endm
117
118 .macro disable_irq
119 disable_irq_notrace
120 asm_trace_hardirqs_off
121 .endm
122
123 .macro enable_irq
124 asm_trace_hardirqs_on
125 enable_irq_notrace
126 .endm
94/* 127/*
95 * Save the current IRQ state and disable IRQs. Note that this macro 128 * Save the current IRQ state and disable IRQs. Note that this macro
96 * assumes FIQs are enabled, and that the processor is in SVC mode. 129 * assumes FIQs are enabled, and that the processor is in SVC mode.
@@ -104,10 +137,16 @@
104 * Restore interrupt state previously stored in a register. We don't 137 * Restore interrupt state previously stored in a register. We don't
105 * guarantee that this will preserve the flags. 138 * guarantee that this will preserve the flags.
106 */ 139 */
107 .macro restore_irqs, oldcpsr 140 .macro restore_irqs_notrace, oldcpsr
108 msr cpsr_c, \oldcpsr 141 msr cpsr_c, \oldcpsr
109 .endm 142 .endm
110 143
144 .macro restore_irqs, oldcpsr
145 tst \oldcpsr, #PSR_I_BIT
146 asm_trace_hardirqs_on_cond eq
147 restore_irqs_notrace \oldcpsr
148 .endm
149
111#define USER(x...) \ 150#define USER(x...) \
1129999: x; \ 1519999: x; \
113 .section __ex_table,"a"; \ 152 .section __ex_table,"a"; \
@@ -127,3 +166,87 @@
127#endif 166#endif
128#endif 167#endif
129 .endm 168 .endm
169
170#ifdef CONFIG_THUMB2_KERNEL
171 .macro setmode, mode, reg
172 mov \reg, #\mode
173 msr cpsr_c, \reg
174 .endm
175#else
176 .macro setmode, mode, reg
177 msr cpsr_c, #\mode
178 .endm
179#endif
180
181/*
182 * STRT/LDRT access macros with ARM and Thumb-2 variants
183 */
184#ifdef CONFIG_THUMB2_KERNEL
185
186 .macro usraccoff, instr, reg, ptr, inc, off, cond, abort
1879999:
188 .if \inc == 1
189 \instr\cond\()bt \reg, [\ptr, #\off]
190 .elseif \inc == 4
191 \instr\cond\()t \reg, [\ptr, #\off]
192 .else
193 .error "Unsupported inc macro argument"
194 .endif
195
196 .section __ex_table,"a"
197 .align 3
198 .long 9999b, \abort
199 .previous
200 .endm
201
202 .macro usracc, instr, reg, ptr, inc, cond, rept, abort
203 @ explicit IT instruction needed because of the label
204 @ introduced by the USER macro
205 .ifnc \cond,al
206 .if \rept == 1
207 itt \cond
208 .elseif \rept == 2
209 ittt \cond
210 .else
211 .error "Unsupported rept macro argument"
212 .endif
213 .endif
214
215 @ Slightly optimised to avoid incrementing the pointer twice
216 usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
217 .if \rept == 2
218 usraccoff \instr, \reg, \ptr, \inc, 4, \cond, \abort
219 .endif
220
221 add\cond \ptr, #\rept * \inc
222 .endm
223
224#else /* !CONFIG_THUMB2_KERNEL */
225
226 .macro usracc, instr, reg, ptr, inc, cond, rept, abort
227 .rept \rept
2289999:
229 .if \inc == 1
230 \instr\cond\()bt \reg, [\ptr], #\inc
231 .elseif \inc == 4
232 \instr\cond\()t \reg, [\ptr], #\inc
233 .else
234 .error "Unsupported inc macro argument"
235 .endif
236
237 .section __ex_table,"a"
238 .align 3
239 .long 9999b, \abort
240 .previous
241 .endr
242 .endm
243
244#endif /* CONFIG_THUMB2_KERNEL */
245
246 .macro strusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
247 usracc str, \reg, \ptr, \inc, \cond, \rept, \abort
248 .endm
249
250 .macro ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
251 usracc ldr, \reg, \ptr, \inc, \cond, \rept, \abort
252 .endm
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index c207504de84d..c3b911ee9151 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
@@ -55,6 +55,9 @@ typedef struct user_fp elf_fpregset_t;
55#define R_ARM_MOVW_ABS_NC 43 55#define R_ARM_MOVW_ABS_NC 43
56#define R_ARM_MOVT_ABS 44 56#define R_ARM_MOVT_ABS 44
57 57
58#define R_ARM_THM_CALL 10
59#define R_ARM_THM_JUMP24 30
60
58/* 61/*
59 * These are used to set parameters in the core dumps. 62 * These are used to set parameters in the core dumps.
60 */ 63 */
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index d74265cffd86..103f7ee97313 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -7,6 +7,7 @@
7 7
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
9extern void mcount(void); 9extern void mcount(void);
10extern void __gnu_mcount_nc(void);
10#endif 11#endif
11 12
12#endif 13#endif
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index 9ee743b95de8..bfcc15929a7f 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -99,6 +99,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
99 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" 99 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
100 "1: ldrt %0, [%3]\n" 100 "1: ldrt %0, [%3]\n"
101 " teq %0, %1\n" 101 " teq %0, %1\n"
102 " it eq @ explicit IT needed for the 2b label\n"
102 "2: streqt %2, [%3]\n" 103 "2: streqt %2, [%3]\n"
103 "3:\n" 104 "3:\n"
104 " .section __ex_table,\"a\"\n" 105 " .section __ex_table,\"a\"\n"
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 85763db87449..376be1a62866 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -44,7 +44,13 @@
44 * The module space lives between the addresses given by TASK_SIZE 44 * The module space lives between the addresses given by TASK_SIZE
45 * and PAGE_OFFSET - it must be within 32MB of the kernel text. 45 * and PAGE_OFFSET - it must be within 32MB of the kernel text.
46 */ 46 */
47#ifndef CONFIG_THUMB2_KERNEL
47#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024) 48#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024)
49#else
50/* smaller range for Thumb-2 symbols relocation (2^24)*/
51#define MODULES_VADDR (PAGE_OFFSET - 8*1024*1024)
52#endif
53
48#if TASK_SIZE > MODULES_VADDR 54#if TASK_SIZE > MODULES_VADDR
49#error Top of user space clashes with start of module space 55#error Top of user space clashes with start of module space
50#endif 56#endif
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h
index 263fed05ea33..bcdb9291ef0c 100644
--- a/arch/arm/include/asm/mmu_context.h
+++ b/arch/arm/include/asm/mmu_context.h
@@ -62,8 +62,10 @@ static inline void check_context(struct mm_struct *mm)
62 62
63static inline void check_context(struct mm_struct *mm) 63static inline void check_context(struct mm_struct *mm)
64{ 64{
65#ifdef CONFIG_MMU
65 if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) 66 if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq))
66 __check_kvm_seq(mm); 67 __check_kvm_seq(mm);
68#endif
67} 69}
68 70
69#define init_new_context(tsk,mm) 0 71#define init_new_context(tsk,mm) 0
diff --git a/arch/arm/include/asm/page-nommu.h b/arch/arm/include/asm/page-nommu.h
index 3574c0deb37f..d1b162a18dcb 100644
--- a/arch/arm/include/asm/page-nommu.h
+++ b/arch/arm/include/asm/page-nommu.h
@@ -43,7 +43,4 @@ typedef unsigned long pgprot_t;
43#define __pmd(x) (x) 43#define __pmd(x) (x)
44#define __pgprot(x) (x) 44#define __pgprot(x) (x)
45 45
46extern unsigned long memory_start;
47extern unsigned long memory_end;
48
49#endif 46#endif
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 67b833c9b6b9..bbecccda76d0 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -82,6 +82,14 @@
82#define PSR_ENDSTATE 0 82#define PSR_ENDSTATE 0
83#endif 83#endif
84 84
85/*
86 * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
87 * process is located in memory.
88 */
89#define PT_TEXT_ADDR 0x10000
90#define PT_DATA_ADDR 0x10004
91#define PT_TEXT_END_ADDR 0x10008
92
85#ifndef __ASSEMBLY__ 93#ifndef __ASSEMBLY__
86 94
87/* 95/*
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 321c83e43a1e..f41a6f57cd12 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -102,8 +102,8 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
102} 102}
103 103
104#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 104#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
105#define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep) 105#define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep)
106#define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp) 106#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)
107 107
108#define tlb_migrate_finish(mm) do { } while (0) 108#define tlb_migrate_finish(mm) do { } while (0)
109 109
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 0da9bc9b3b1d..1d6bd40a4322 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -17,6 +17,7 @@
17#include <asm/memory.h> 17#include <asm/memory.h>
18#include <asm/domain.h> 18#include <asm/domain.h>
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/unified.h>
20 21
21#define VERIFY_READ 0 22#define VERIFY_READ 0
22#define VERIFY_WRITE 1 23#define VERIFY_WRITE 1
@@ -365,8 +366,10 @@ do { \
365 366
366#define __put_user_asm_dword(x,__pu_addr,err) \ 367#define __put_user_asm_dword(x,__pu_addr,err) \
367 __asm__ __volatile__( \ 368 __asm__ __volatile__( \
368 "1: strt " __reg_oper1 ", [%1], #4\n" \ 369 ARM( "1: strt " __reg_oper1 ", [%1], #4\n" ) \
369 "2: strt " __reg_oper0 ", [%1]\n" \ 370 ARM( "2: strt " __reg_oper0 ", [%1]\n" ) \
371 THUMB( "1: strt " __reg_oper1 ", [%1]\n" ) \
372 THUMB( "2: strt " __reg_oper0 ", [%1, #4]\n" ) \
370 "3:\n" \ 373 "3:\n" \
371 " .section .fixup,\"ax\"\n" \ 374 " .section .fixup,\"ax\"\n" \
372 " .align 2\n" \ 375 " .align 2\n" \
diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h
new file mode 100644
index 000000000000..073e85b9b961
--- /dev/null
+++ b/arch/arm/include/asm/unified.h
@@ -0,0 +1,126 @@
1/*
2 * include/asm-arm/unified.h - Unified Assembler Syntax helper macros
3 *
4 * Copyright (C) 2008 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_UNIFIED_H
21#define __ASM_UNIFIED_H
22
23#if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
24 .syntax unified
25#endif
26
27#ifdef CONFIG_THUMB2_KERNEL
28
29#if __GNUC__ < 4
30#error Thumb-2 kernel requires gcc >= 4
31#endif
32
33/* The CPSR bit describing the instruction set (Thumb) */
34#define PSR_ISETSTATE PSR_T_BIT
35
36#define ARM(x...)
37#define THUMB(x...) x
38#define W(instr) instr.w
39#define BSYM(sym) sym + 1
40
41#else /* !CONFIG_THUMB2_KERNEL */
42
43/* The CPSR bit describing the instruction set (ARM) */
44#define PSR_ISETSTATE 0
45
46#define ARM(x...) x
47#define THUMB(x...)
48#define W(instr) instr
49#define BSYM(sym) sym
50
51#endif /* CONFIG_THUMB2_KERNEL */
52
53#ifndef CONFIG_ARM_ASM_UNIFIED
54
55/*
56 * If the unified assembly syntax isn't used (in ARM mode), these
57 * macros expand to an empty string
58 */
59#ifdef __ASSEMBLY__
60 .macro it, cond
61 .endm
62 .macro itt, cond
63 .endm
64 .macro ite, cond
65 .endm
66 .macro ittt, cond
67 .endm
68 .macro itte, cond
69 .endm
70 .macro itet, cond
71 .endm
72 .macro itee, cond
73 .endm
74 .macro itttt, cond
75 .endm
76 .macro ittte, cond
77 .endm
78 .macro ittet, cond
79 .endm
80 .macro ittee, cond
81 .endm
82 .macro itett, cond
83 .endm
84 .macro itete, cond
85 .endm
86 .macro iteet, cond
87 .endm
88 .macro iteee, cond
89 .endm
90#else /* !__ASSEMBLY__ */
91__asm__(
92" .macro it, cond\n"
93" .endm\n"
94" .macro itt, cond\n"
95" .endm\n"
96" .macro ite, cond\n"
97" .endm\n"
98" .macro ittt, cond\n"
99" .endm\n"
100" .macro itte, cond\n"
101" .endm\n"
102" .macro itet, cond\n"
103" .endm\n"
104" .macro itee, cond\n"
105" .endm\n"
106" .macro itttt, cond\n"
107" .endm\n"
108" .macro ittte, cond\n"
109" .endm\n"
110" .macro ittet, cond\n"
111" .endm\n"
112" .macro ittee, cond\n"
113" .endm\n"
114" .macro itett, cond\n"
115" .endm\n"
116" .macro itete, cond\n"
117" .endm\n"
118" .macro iteet, cond\n"
119" .endm\n"
120" .macro iteee, cond\n"
121" .endm\n");
122#endif /* __ASSEMBLY__ */
123
124#endif /* CONFIG_ARM_ASM_UNIFIED */
125
126#endif /* !__ASM_UNIFIED_H */
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 531e1860e546..0e627705f746 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -186,4 +186,5 @@ EXPORT_SYMBOL(_find_next_bit_be);
186 186
187#ifdef CONFIG_FUNCTION_TRACER 187#ifdef CONFIG_FUNCTION_TRACER
188EXPORT_SYMBOL(mcount); 188EXPORT_SYMBOL(mcount);
189EXPORT_SYMBOL(__gnu_mcount_nc);
189#endif 190#endif
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index fc8af43c5000..3d727a8a23bc 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -34,7 +34,7 @@
34 @ 34 @
35 @ routine called with r0 = irq number, r1 = struct pt_regs * 35 @ routine called with r0 = irq number, r1 = struct pt_regs *
36 @ 36 @
37 adrne lr, 1b 37 adrne lr, BSYM(1b)
38 bne asm_do_IRQ 38 bne asm_do_IRQ
39 39
40#ifdef CONFIG_SMP 40#ifdef CONFIG_SMP
@@ -46,13 +46,13 @@
46 */ 46 */
47 test_for_ipi r0, r6, r5, lr 47 test_for_ipi r0, r6, r5, lr
48 movne r0, sp 48 movne r0, sp
49 adrne lr, 1b 49 adrne lr, BSYM(1b)
50 bne do_IPI 50 bne do_IPI
51 51
52#ifdef CONFIG_LOCAL_TIMERS 52#ifdef CONFIG_LOCAL_TIMERS
53 test_for_ltirq r0, r6, r5, lr 53 test_for_ltirq r0, r6, r5, lr
54 movne r0, sp 54 movne r0, sp
55 adrne lr, 1b 55 adrne lr, BSYM(1b)
56 bne do_local_timer 56 bne do_local_timer
57#endif 57#endif
58#endif 58#endif
@@ -70,7 +70,10 @@
70 */ 70 */
71 .macro inv_entry, reason 71 .macro inv_entry, reason
72 sub sp, sp, #S_FRAME_SIZE 72 sub sp, sp, #S_FRAME_SIZE
73 stmib sp, {r1 - lr} 73 ARM( stmib sp, {r1 - lr} )
74 THUMB( stmia sp, {r0 - r12} )
75 THUMB( str sp, [sp, #S_SP] )
76 THUMB( str lr, [sp, #S_LR] )
74 mov r1, #\reason 77 mov r1, #\reason
75 .endm 78 .endm
76 79
@@ -126,17 +129,24 @@ ENDPROC(__und_invalid)
126 .macro svc_entry, stack_hole=0 129 .macro svc_entry, stack_hole=0
127 UNWIND(.fnstart ) 130 UNWIND(.fnstart )
128 UNWIND(.save {r0 - pc} ) 131 UNWIND(.save {r0 - pc} )
129 sub sp, sp, #(S_FRAME_SIZE + \stack_hole) 132 sub sp, sp, #(S_FRAME_SIZE + \stack_hole - 4)
133#ifdef CONFIG_THUMB2_KERNEL
134 SPFIX( str r0, [sp] ) @ temporarily saved
135 SPFIX( mov r0, sp )
136 SPFIX( tst r0, #4 ) @ test original stack alignment
137 SPFIX( ldr r0, [sp] ) @ restored
138#else
130 SPFIX( tst sp, #4 ) 139 SPFIX( tst sp, #4 )
131 SPFIX( bicne sp, sp, #4 ) 140#endif
132 stmib sp, {r1 - r12} 141 SPFIX( subeq sp, sp, #4 )
142 stmia sp, {r1 - r12}
133 143
134 ldmia r0, {r1 - r3} 144 ldmia r0, {r1 - r3}
135 add r5, sp, #S_SP @ here for interlock avoidance 145 add r5, sp, #S_SP - 4 @ here for interlock avoidance
136 mov r4, #-1 @ "" "" "" "" 146 mov r4, #-1 @ "" "" "" ""
137 add r0, sp, #(S_FRAME_SIZE + \stack_hole) 147 add r0, sp, #(S_FRAME_SIZE + \stack_hole - 4)
138 SPFIX( addne r0, r0, #4 ) 148 SPFIX( addeq r0, r0, #4 )
139 str r1, [sp] @ save the "real" r0 copied 149 str r1, [sp, #-4]! @ save the "real" r0 copied
140 @ from the exception stack 150 @ from the exception stack
141 151
142 mov r1, lr 152 mov r1, lr
@@ -151,6 +161,8 @@ ENDPROC(__und_invalid)
151 @ r4 - orig_r0 (see pt_regs definition in ptrace.h) 161 @ r4 - orig_r0 (see pt_regs definition in ptrace.h)
152 @ 162 @
153 stmia r5, {r0 - r4} 163 stmia r5, {r0 - r4}
164
165 asm_trace_hardirqs_off
154 .endm 166 .endm
155 167
156 .align 5 168 .align 5
@@ -196,9 +208,8 @@ __dabt_svc:
196 @ 208 @
197 @ restore SPSR and restart the instruction 209 @ restore SPSR and restart the instruction
198 @ 210 @
199 ldr r0, [sp, #S_PSR] 211 ldr r2, [sp, #S_PSR]
200 msr spsr_cxsf, r0 212 svc_exit r2 @ return from exception
201 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
202 UNWIND(.fnend ) 213 UNWIND(.fnend )
203ENDPROC(__dabt_svc) 214ENDPROC(__dabt_svc)
204 215
@@ -206,9 +217,6 @@ ENDPROC(__dabt_svc)
206__irq_svc: 217__irq_svc:
207 svc_entry 218 svc_entry
208 219
209#ifdef CONFIG_TRACE_IRQFLAGS
210 bl trace_hardirqs_off
211#endif
212#ifdef CONFIG_PREEMPT 220#ifdef CONFIG_PREEMPT
213 get_thread_info tsk 221 get_thread_info tsk
214 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count 222 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
@@ -225,13 +233,12 @@ __irq_svc:
225 tst r0, #_TIF_NEED_RESCHED 233 tst r0, #_TIF_NEED_RESCHED
226 blne svc_preempt 234 blne svc_preempt
227#endif 235#endif
228 ldr r0, [sp, #S_PSR] @ irqs are already disabled 236 ldr r4, [sp, #S_PSR] @ irqs are already disabled
229 msr spsr_cxsf, r0
230#ifdef CONFIG_TRACE_IRQFLAGS 237#ifdef CONFIG_TRACE_IRQFLAGS
231 tst r0, #PSR_I_BIT 238 tst r4, #PSR_I_BIT
232 bleq trace_hardirqs_on 239 bleq trace_hardirqs_on
233#endif 240#endif
234 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 241 svc_exit r4 @ return from exception
235 UNWIND(.fnend ) 242 UNWIND(.fnend )
236ENDPROC(__irq_svc) 243ENDPROC(__irq_svc)
237 244
@@ -266,7 +273,7 @@ __und_svc:
266 @ r0 - instruction 273 @ r0 - instruction
267 @ 274 @
268 ldr r0, [r2, #-4] 275 ldr r0, [r2, #-4]
269 adr r9, 1f 276 adr r9, BSYM(1f)
270 bl call_fpe 277 bl call_fpe
271 278
272 mov r0, sp @ struct pt_regs *regs 279 mov r0, sp @ struct pt_regs *regs
@@ -280,9 +287,8 @@ __und_svc:
280 @ 287 @
281 @ restore SPSR and restart the instruction 288 @ restore SPSR and restart the instruction
282 @ 289 @
283 ldr lr, [sp, #S_PSR] @ Get SVC cpsr 290 ldr r2, [sp, #S_PSR] @ Get SVC cpsr
284 msr spsr_cxsf, lr 291 svc_exit r2 @ return from exception
285 ldmia sp, {r0 - pc}^ @ Restore SVC registers
286 UNWIND(.fnend ) 292 UNWIND(.fnend )
287ENDPROC(__und_svc) 293ENDPROC(__und_svc)
288 294
@@ -323,9 +329,8 @@ __pabt_svc:
323 @ 329 @
324 @ restore SPSR and restart the instruction 330 @ restore SPSR and restart the instruction
325 @ 331 @
326 ldr r0, [sp, #S_PSR] 332 ldr r2, [sp, #S_PSR]
327 msr spsr_cxsf, r0 333 svc_exit r2 @ return from exception
328 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
329 UNWIND(.fnend ) 334 UNWIND(.fnend )
330ENDPROC(__pabt_svc) 335ENDPROC(__pabt_svc)
331 336
@@ -353,7 +358,8 @@ ENDPROC(__pabt_svc)
353 UNWIND(.fnstart ) 358 UNWIND(.fnstart )
354 UNWIND(.cantunwind ) @ don't unwind the user space 359 UNWIND(.cantunwind ) @ don't unwind the user space
355 sub sp, sp, #S_FRAME_SIZE 360 sub sp, sp, #S_FRAME_SIZE
356 stmib sp, {r1 - r12} 361 ARM( stmib sp, {r1 - r12} )
362 THUMB( stmia sp, {r0 - r12} )
357 363
358 ldmia r0, {r1 - r3} 364 ldmia r0, {r1 - r3}
359 add r0, sp, #S_PC @ here for interlock avoidance 365 add r0, sp, #S_PC @ here for interlock avoidance
@@ -372,7 +378,8 @@ ENDPROC(__pabt_svc)
372 @ Also, separately save sp_usr and lr_usr 378 @ Also, separately save sp_usr and lr_usr
373 @ 379 @
374 stmia r0, {r2 - r4} 380 stmia r0, {r2 - r4}
375 stmdb r0, {sp, lr}^ 381 ARM( stmdb r0, {sp, lr}^ )
382 THUMB( store_user_sp_lr r0, r1, S_SP - S_PC )
376 383
377 @ 384 @
378 @ Enable the alignment trap while in kernel mode 385 @ Enable the alignment trap while in kernel mode
@@ -383,6 +390,8 @@ ENDPROC(__pabt_svc)
383 @ Clear FP to mark the first stack frame 390 @ Clear FP to mark the first stack frame
384 @ 391 @
385 zero_fp 392 zero_fp
393
394 asm_trace_hardirqs_off
386 .endm 395 .endm
387 396
388 .macro kuser_cmpxchg_check 397 .macro kuser_cmpxchg_check
@@ -427,7 +436,7 @@ __dabt_usr:
427 @ 436 @
428 enable_irq 437 enable_irq
429 mov r2, sp 438 mov r2, sp
430 adr lr, ret_from_exception 439 adr lr, BSYM(ret_from_exception)
431 b do_DataAbort 440 b do_DataAbort
432 UNWIND(.fnend ) 441 UNWIND(.fnend )
433ENDPROC(__dabt_usr) 442ENDPROC(__dabt_usr)
@@ -437,9 +446,6 @@ __irq_usr:
437 usr_entry 446 usr_entry
438 kuser_cmpxchg_check 447 kuser_cmpxchg_check
439 448
440#ifdef CONFIG_TRACE_IRQFLAGS
441 bl trace_hardirqs_off
442#endif
443 get_thread_info tsk 449 get_thread_info tsk
444#ifdef CONFIG_PREEMPT 450#ifdef CONFIG_PREEMPT
445 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count 451 ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
@@ -452,7 +458,9 @@ __irq_usr:
452 ldr r0, [tsk, #TI_PREEMPT] 458 ldr r0, [tsk, #TI_PREEMPT]
453 str r8, [tsk, #TI_PREEMPT] 459 str r8, [tsk, #TI_PREEMPT]
454 teq r0, r7 460 teq r0, r7
455 strne r0, [r0, -r0] 461 ARM( strne r0, [r0, -r0] )
462 THUMB( movne r0, #0 )
463 THUMB( strne r0, [r0] )
456#endif 464#endif
457#ifdef CONFIG_TRACE_IRQFLAGS 465#ifdef CONFIG_TRACE_IRQFLAGS
458 bl trace_hardirqs_on 466 bl trace_hardirqs_on
@@ -476,9 +484,10 @@ __und_usr:
476 @ 484 @
477 @ r0 - instruction 485 @ r0 - instruction
478 @ 486 @
479 adr r9, ret_from_exception 487 adr r9, BSYM(ret_from_exception)
480 adr lr, __und_usr_unknown 488 adr lr, BSYM(__und_usr_unknown)
481 tst r3, #PSR_T_BIT @ Thumb mode? 489 tst r3, #PSR_T_BIT @ Thumb mode?
490 itet eq @ explicit IT needed for the 1f label
482 subeq r4, r2, #4 @ ARM instr at LR - 4 491 subeq r4, r2, #4 @ ARM instr at LR - 4
483 subne r4, r2, #2 @ Thumb instr at LR - 2 492 subne r4, r2, #2 @ Thumb instr at LR - 2
4841: ldreqt r0, [r4] 4931: ldreqt r0, [r4]
@@ -488,7 +497,10 @@ __und_usr:
488 beq call_fpe 497 beq call_fpe
489 @ Thumb instruction 498 @ Thumb instruction
490#if __LINUX_ARM_ARCH__ >= 7 499#if __LINUX_ARM_ARCH__ >= 7
4912: ldrht r5, [r4], #2 5002:
501 ARM( ldrht r5, [r4], #2 )
502 THUMB( ldrht r5, [r4] )
503 THUMB( add r4, r4, #2 )
492 and r0, r5, #0xf800 @ mask bits 111x x... .... .... 504 and r0, r5, #0xf800 @ mask bits 111x x... .... ....
493 cmp r0, #0xe800 @ 32bit instruction if xx != 0 505 cmp r0, #0xe800 @ 32bit instruction if xx != 0
494 blo __und_usr_unknown 506 blo __und_usr_unknown
@@ -577,9 +589,11 @@ call_fpe:
577 moveq pc, lr 589 moveq pc, lr
578 get_thread_info r10 @ get current thread 590 get_thread_info r10 @ get current thread
579 and r8, r0, #0x00000f00 @ mask out CP number 591 and r8, r0, #0x00000f00 @ mask out CP number
592 THUMB( lsr r8, r8, #8 )
580 mov r7, #1 593 mov r7, #1
581 add r6, r10, #TI_USED_CP 594 add r6, r10, #TI_USED_CP
582 strb r7, [r6, r8, lsr #8] @ set appropriate used_cp[] 595 ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[]
596 THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[]
583#ifdef CONFIG_IWMMXT 597#ifdef CONFIG_IWMMXT
584 @ Test if we need to give access to iWMMXt coprocessors 598 @ Test if we need to give access to iWMMXt coprocessors
585 ldr r5, [r10, #TI_FLAGS] 599 ldr r5, [r10, #TI_FLAGS]
@@ -587,36 +601,38 @@ call_fpe:
587 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) 601 movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1)
588 bcs iwmmxt_task_enable 602 bcs iwmmxt_task_enable
589#endif 603#endif
590 add pc, pc, r8, lsr #6 604 ARM( add pc, pc, r8, lsr #6 )
591 mov r0, r0 605 THUMB( lsl r8, r8, #2 )
592 606 THUMB( add pc, r8 )
593 mov pc, lr @ CP#0 607 nop
594 b do_fpe @ CP#1 (FPE) 608
595 b do_fpe @ CP#2 (FPE) 609 W(mov) pc, lr @ CP#0
596 mov pc, lr @ CP#3 610 W(b) do_fpe @ CP#1 (FPE)
611 W(b) do_fpe @ CP#2 (FPE)
612 W(mov) pc, lr @ CP#3
597#ifdef CONFIG_CRUNCH 613#ifdef CONFIG_CRUNCH
598 b crunch_task_enable @ CP#4 (MaverickCrunch) 614 b crunch_task_enable @ CP#4 (MaverickCrunch)
599 b crunch_task_enable @ CP#5 (MaverickCrunch) 615 b crunch_task_enable @ CP#5 (MaverickCrunch)
600 b crunch_task_enable @ CP#6 (MaverickCrunch) 616 b crunch_task_enable @ CP#6 (MaverickCrunch)
601#else 617#else
602 mov pc, lr @ CP#4 618 W(mov) pc, lr @ CP#4
603 mov pc, lr @ CP#5 619 W(mov) pc, lr @ CP#5
604 mov pc, lr @ CP#6 620 W(mov) pc, lr @ CP#6
605#endif 621#endif
606 mov pc, lr @ CP#7 622 W(mov) pc, lr @ CP#7
607 mov pc, lr @ CP#8 623 W(mov) pc, lr @ CP#8
608 mov pc, lr @ CP#9 624 W(mov) pc, lr @ CP#9
609#ifdef CONFIG_VFP 625#ifdef CONFIG_VFP
610 b do_vfp @ CP#10 (VFP) 626 W(b) do_vfp @ CP#10 (VFP)
611 b do_vfp @ CP#11 (VFP) 627 W(b) do_vfp @ CP#11 (VFP)
612#else 628#else
613 mov pc, lr @ CP#10 (VFP) 629 W(mov) pc, lr @ CP#10 (VFP)
614 mov pc, lr @ CP#11 (VFP) 630 W(mov) pc, lr @ CP#11 (VFP)
615#endif 631#endif
616 mov pc, lr @ CP#12 632 W(mov) pc, lr @ CP#12
617 mov pc, lr @ CP#13 633 W(mov) pc, lr @ CP#13
618 mov pc, lr @ CP#14 (Debug) 634 W(mov) pc, lr @ CP#14 (Debug)
619 mov pc, lr @ CP#15 (Control) 635 W(mov) pc, lr @ CP#15 (Control)
620 636
621#ifdef CONFIG_NEON 637#ifdef CONFIG_NEON
622 .align 6 638 .align 6
@@ -667,7 +683,7 @@ no_fp: mov pc, lr
667__und_usr_unknown: 683__und_usr_unknown:
668 enable_irq 684 enable_irq
669 mov r0, sp 685 mov r0, sp
670 adr lr, ret_from_exception 686 adr lr, BSYM(ret_from_exception)
671 b do_undefinstr 687 b do_undefinstr
672ENDPROC(__und_usr_unknown) 688ENDPROC(__und_usr_unknown)
673 689
@@ -711,7 +727,10 @@ ENTRY(__switch_to)
711 UNWIND(.cantunwind ) 727 UNWIND(.cantunwind )
712 add ip, r1, #TI_CPU_SAVE 728 add ip, r1, #TI_CPU_SAVE
713 ldr r3, [r2, #TI_TP_VALUE] 729 ldr r3, [r2, #TI_TP_VALUE]
714 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack 730 ARM( stmia ip!, {r4 - sl, fp, sp, lr} ) @ Store most regs on stack
731 THUMB( stmia ip!, {r4 - sl, fp} ) @ Store most regs on stack
732 THUMB( str sp, [ip], #4 )
733 THUMB( str lr, [ip], #4 )
715#ifdef CONFIG_MMU 734#ifdef CONFIG_MMU
716 ldr r6, [r2, #TI_CPU_DOMAIN] 735 ldr r6, [r2, #TI_CPU_DOMAIN]
717#endif 736#endif
@@ -736,8 +755,12 @@ ENTRY(__switch_to)
736 ldr r0, =thread_notify_head 755 ldr r0, =thread_notify_head
737 mov r1, #THREAD_NOTIFY_SWITCH 756 mov r1, #THREAD_NOTIFY_SWITCH
738 bl atomic_notifier_call_chain 757 bl atomic_notifier_call_chain
758 THUMB( mov ip, r4 )
739 mov r0, r5 759 mov r0, r5
740 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously 760 ARM( ldmia r4, {r4 - sl, fp, sp, pc} ) @ Load all regs saved previously
761 THUMB( ldmia ip!, {r4 - sl, fp} ) @ Load all regs saved previously
762 THUMB( ldr sp, [ip], #4 )
763 THUMB( ldr pc, [ip] )
741 UNWIND(.fnend ) 764 UNWIND(.fnend )
742ENDPROC(__switch_to) 765ENDPROC(__switch_to)
743 766
@@ -772,6 +795,7 @@ ENDPROC(__switch_to)
772 * if your compiled code is not going to use the new instructions for other 795 * if your compiled code is not going to use the new instructions for other
773 * purpose. 796 * purpose.
774 */ 797 */
798 THUMB( .arm )
775 799
776 .macro usr_ret, reg 800 .macro usr_ret, reg
777#ifdef CONFIG_ARM_THUMB 801#ifdef CONFIG_ARM_THUMB
@@ -1020,6 +1044,7 @@ __kuser_helper_version: @ 0xffff0ffc
1020 .globl __kuser_helper_end 1044 .globl __kuser_helper_end
1021__kuser_helper_end: 1045__kuser_helper_end:
1022 1046
1047 THUMB( .thumb )
1023 1048
1024/* 1049/*
1025 * Vector stubs. 1050 * Vector stubs.
@@ -1054,17 +1079,23 @@ vector_\name:
1054 @ Prepare for SVC32 mode. IRQs remain disabled. 1079 @ Prepare for SVC32 mode. IRQs remain disabled.
1055 @ 1080 @
1056 mrs r0, cpsr 1081 mrs r0, cpsr
1057 eor r0, r0, #(\mode ^ SVC_MODE) 1082 eor r0, r0, #(\mode ^ SVC_MODE | PSR_ISETSTATE)
1058 msr spsr_cxsf, r0 1083 msr spsr_cxsf, r0
1059 1084
1060 @ 1085 @
1061 @ the branch table must immediately follow this code 1086 @ the branch table must immediately follow this code
1062 @ 1087 @
1063 and lr, lr, #0x0f 1088 and lr, lr, #0x0f
1089 THUMB( adr r0, 1f )
1090 THUMB( ldr lr, [r0, lr, lsl #2] )
1064 mov r0, sp 1091 mov r0, sp
1065 ldr lr, [pc, lr, lsl #2] 1092 ARM( ldr lr, [pc, lr, lsl #2] )
1066 movs pc, lr @ branch to handler in SVC mode 1093 movs pc, lr @ branch to handler in SVC mode
1067ENDPROC(vector_\name) 1094ENDPROC(vector_\name)
1095
1096 .align 2
1097 @ handler addresses follow this label
10981:
1068 .endm 1099 .endm
1069 1100
1070 .globl __stubs_start 1101 .globl __stubs_start
@@ -1202,14 +1233,16 @@ __stubs_end:
1202 1233
1203 .globl __vectors_start 1234 .globl __vectors_start
1204__vectors_start: 1235__vectors_start:
1205 swi SYS_ERROR0 1236 ARM( swi SYS_ERROR0 )
1206 b vector_und + stubs_offset 1237 THUMB( svc #0 )
1207 ldr pc, .LCvswi + stubs_offset 1238 THUMB( nop )
1208 b vector_pabt + stubs_offset 1239 W(b) vector_und + stubs_offset
1209 b vector_dabt + stubs_offset 1240 W(ldr) pc, .LCvswi + stubs_offset
1210 b vector_addrexcptn + stubs_offset 1241 W(b) vector_pabt + stubs_offset
1211 b vector_irq + stubs_offset 1242 W(b) vector_dabt + stubs_offset
1212 b vector_fiq + stubs_offset 1243 W(b) vector_addrexcptn + stubs_offset
1244 W(b) vector_irq + stubs_offset
1245 W(b) vector_fiq + stubs_offset
1213 1246
1214 .globl __vectors_end 1247 .globl __vectors_end
1215__vectors_end: 1248__vectors_end:
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index bfa7f0af7ede..3657c5328a5b 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -33,14 +33,7 @@ ret_fast_syscall:
33 /* perform architecture specific actions before user return */ 33 /* perform architecture specific actions before user return */
34 arch_ret_to_user r1, lr 34 arch_ret_to_user r1, lr
35 35
36 @ fast_restore_user_regs 36 restore_user_regs fast = 1, offset = S_OFF
37 ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr
38 ldr lr, [sp, #S_OFF + S_PC]! @ get pc
39 msr spsr_cxsf, r1 @ save in spsr_svc
40 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
41 mov r0, r0
42 add sp, sp, #S_FRAME_SIZE - S_PC
43 movs pc, lr @ return & move spsr_svc into cpsr
44 UNWIND(.fnend ) 37 UNWIND(.fnend )
45 38
46/* 39/*
@@ -73,14 +66,7 @@ no_work_pending:
73 /* perform architecture specific actions before user return */ 66 /* perform architecture specific actions before user return */
74 arch_ret_to_user r1, lr 67 arch_ret_to_user r1, lr
75 68
76 @ slow_restore_user_regs 69 restore_user_regs fast = 0, offset = 0
77 ldr r1, [sp, #S_PSR] @ get calling cpsr
78 ldr lr, [sp, #S_PC]! @ get pc
79 msr spsr_cxsf, r1 @ save in spsr_svc
80 ldmdb sp, {r0 - lr}^ @ get calling r0 - lr
81 mov r0, r0
82 add sp, sp, #S_FRAME_SIZE - S_PC
83 movs pc, lr @ return & move spsr_svc into cpsr
84ENDPROC(ret_to_user) 70ENDPROC(ret_to_user)
85 71
86/* 72/*
@@ -132,6 +118,25 @@ ftrace_call:
132 118
133#else 119#else
134 120
121ENTRY(__gnu_mcount_nc)
122 stmdb sp!, {r0-r3, lr}
123 ldr r0, =ftrace_trace_function
124 ldr r2, [r0]
125 adr r0, ftrace_stub
126 cmp r0, r2
127 bne gnu_trace
128 ldmia sp!, {r0-r3, ip, lr}
129 bx ip
130
131gnu_trace:
132 ldr r1, [sp, #20] @ lr of instrumented routine
133 mov r0, lr
134 sub r0, r0, #MCOUNT_INSN_SIZE
135 mov lr, pc
136 mov pc, r2
137 ldmia sp!, {r0-r3, ip, lr}
138 bx ip
139
135ENTRY(mcount) 140ENTRY(mcount)
136 stmdb sp!, {r0-r3, lr} 141 stmdb sp!, {r0-r3, lr}
137 ldr r0, =ftrace_trace_function 142 ldr r0, =ftrace_trace_function
@@ -182,8 +187,10 @@ ftrace_stub:
182ENTRY(vector_swi) 187ENTRY(vector_swi)
183 sub sp, sp, #S_FRAME_SIZE 188 sub sp, sp, #S_FRAME_SIZE
184 stmia sp, {r0 - r12} @ Calling r0 - r12 189 stmia sp, {r0 - r12} @ Calling r0 - r12
185 add r8, sp, #S_PC 190 ARM( add r8, sp, #S_PC )
186 stmdb r8, {sp, lr}^ @ Calling sp, lr 191 ARM( stmdb r8, {sp, lr}^ ) @ Calling sp, lr
192 THUMB( mov r8, sp )
193 THUMB( store_user_sp_lr r8, r10, S_SP ) @ calling sp, lr
187 mrs r8, spsr @ called from non-FIQ mode, so ok. 194 mrs r8, spsr @ called from non-FIQ mode, so ok.
188 str lr, [sp, #S_PC] @ Save calling PC 195 str lr, [sp, #S_PC] @ Save calling PC
189 str r8, [sp, #S_PSR] @ Save CPSR 196 str r8, [sp, #S_PSR] @ Save CPSR
@@ -272,7 +279,7 @@ ENTRY(vector_swi)
272 bne __sys_trace 279 bne __sys_trace
273 280
274 cmp scno, #NR_syscalls @ check upper syscall limit 281 cmp scno, #NR_syscalls @ check upper syscall limit
275 adr lr, ret_fast_syscall @ return address 282 adr lr, BSYM(ret_fast_syscall) @ return address
276 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine 283 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
277 284
278 add r1, sp, #S_OFF 285 add r1, sp, #S_OFF
@@ -293,7 +300,7 @@ __sys_trace:
293 mov r0, #0 @ trace entry [IP = 0] 300 mov r0, #0 @ trace entry [IP = 0]
294 bl syscall_trace 301 bl syscall_trace
295 302
296 adr lr, __sys_trace_return @ return address 303 adr lr, BSYM(__sys_trace_return) @ return address
297 mov scno, r0 @ syscall number (possibly new) 304 mov scno, r0 @ syscall number (possibly new)
298 add r1, sp, #S_R0 + S_OFF @ pointer to regs 305 add r1, sp, #S_R0 + S_OFF @ pointer to regs
299 cmp scno, #NR_syscalls @ check upper syscall limit 306 cmp scno, #NR_syscalls @ check upper syscall limit
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 87ab4e157997..a4eaf4f920c5 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -36,11 +36,6 @@
36#endif 36#endif
37 .endm 37 .endm
38 38
39 .macro get_thread_info, rd
40 mov \rd, sp, lsr #13
41 mov \rd, \rd, lsl #13
42 .endm
43
44 .macro alignment_trap, rtemp 39 .macro alignment_trap, rtemp
45#ifdef CONFIG_ALIGNMENT_TRAP 40#ifdef CONFIG_ALIGNMENT_TRAP
46 ldr \rtemp, .LCcralign 41 ldr \rtemp, .LCcralign
@@ -49,6 +44,93 @@
49#endif 44#endif
50 .endm 45 .endm
51 46
47 @
48 @ Store/load the USER SP and LR registers by switching to the SYS
49 @ mode. Useful in Thumb-2 mode where "stm/ldm rd, {sp, lr}^" is not
50 @ available. Should only be called from SVC mode
51 @
52 .macro store_user_sp_lr, rd, rtemp, offset = 0
53 mrs \rtemp, cpsr
54 eor \rtemp, \rtemp, #(SVC_MODE ^ SYSTEM_MODE)
55 msr cpsr_c, \rtemp @ switch to the SYS mode
56
57 str sp, [\rd, #\offset] @ save sp_usr
58 str lr, [\rd, #\offset + 4] @ save lr_usr
59
60 eor \rtemp, \rtemp, #(SVC_MODE ^ SYSTEM_MODE)
61 msr cpsr_c, \rtemp @ switch back to the SVC mode
62 .endm
63
64 .macro load_user_sp_lr, rd, rtemp, offset = 0
65 mrs \rtemp, cpsr
66 eor \rtemp, \rtemp, #(SVC_MODE ^ SYSTEM_MODE)
67 msr cpsr_c, \rtemp @ switch to the SYS mode
68
69 ldr sp, [\rd, #\offset] @ load sp_usr
70 ldr lr, [\rd, #\offset + 4] @ load lr_usr
71
72 eor \rtemp, \rtemp, #(SVC_MODE ^ SYSTEM_MODE)
73 msr cpsr_c, \rtemp @ switch back to the SVC mode
74 .endm
75
76#ifndef CONFIG_THUMB2_KERNEL
77 .macro svc_exit, rpsr
78 msr spsr_cxsf, \rpsr
79 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
80 .endm
81
82 .macro restore_user_regs, fast = 0, offset = 0
83 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
84 ldr lr, [sp, #\offset + S_PC]! @ get pc
85 msr spsr_cxsf, r1 @ save in spsr_svc
86 .if \fast
87 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
88 .else
89 ldmdb sp, {r0 - lr}^ @ get calling r0 - lr
90 .endif
91 add sp, sp, #S_FRAME_SIZE - S_PC
92 movs pc, lr @ return & move spsr_svc into cpsr
93 .endm
94
95 .macro get_thread_info, rd
96 mov \rd, sp, lsr #13
97 mov \rd, \rd, lsl #13
98 .endm
99#else /* CONFIG_THUMB2_KERNEL */
100 .macro svc_exit, rpsr
101 ldr r0, [sp, #S_SP] @ top of the stack
102 ldr r1, [sp, #S_PC] @ return address
103 tst r0, #4 @ orig stack 8-byte aligned?
104 stmdb r0, {r1, \rpsr} @ rfe context
105 ldmia sp, {r0 - r12}
106 ldr lr, [sp, #S_LR]
107 addeq sp, sp, #S_FRAME_SIZE - 8 @ aligned
108 addne sp, sp, #S_FRAME_SIZE - 4 @ not aligned
109 rfeia sp!
110 .endm
111
112 .macro restore_user_regs, fast = 0, offset = 0
113 mov r2, sp
114 load_user_sp_lr r2, r3, \offset + S_SP @ calling sp, lr
115 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
116 ldr lr, [sp, #\offset + S_PC] @ get pc
117 add sp, sp, #\offset + S_SP
118 msr spsr_cxsf, r1 @ save in spsr_svc
119 .if \fast
120 ldmdb sp, {r1 - r12} @ get calling r1 - r12
121 .else
122 ldmdb sp, {r0 - r12} @ get calling r0 - r12
123 .endif
124 add sp, sp, #S_FRAME_SIZE - S_SP
125 movs pc, lr @ return & move spsr_svc into cpsr
126 .endm
127
128 .macro get_thread_info, rd
129 mov \rd, sp
130 lsr \rd, \rd, #13
131 mov \rd, \rd, lsl #13
132 .endm
133#endif /* !CONFIG_THUMB2_KERNEL */
52 134
53/* 135/*
54 * These are the registers used in the syscall handler, and allow us to 136 * These are the registers used in the syscall handler, and allow us to
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 991952c644d1..93ad576b2d74 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -14,6 +14,7 @@
14#define ATAG_CORE 0x54410001 14#define ATAG_CORE 0x54410001
15#define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2) 15#define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2)
16 16
17 .align 2
17 .type __switch_data, %object 18 .type __switch_data, %object
18__switch_data: 19__switch_data:
19 .long __mmap_switched 20 .long __mmap_switched
@@ -51,7 +52,9 @@ __mmap_switched:
51 strcc fp, [r6],#4 52 strcc fp, [r6],#4
52 bcc 1b 53 bcc 1b
53 54
54 ldmia r3, {r4, r5, r6, r7, sp} 55 ARM( ldmia r3, {r4, r5, r6, r7, sp})
56 THUMB( ldmia r3, {r4, r5, r6, r7} )
57 THUMB( ldr sp, [r3, #16] )
55 str r9, [r4] @ Save processor ID 58 str r9, [r4] @ Save processor ID
56 str r1, [r5] @ Save machine type 59 str r1, [r5] @ Save machine type
57 str r2, [r6] @ Save atags pointer 60 str r2, [r6] @ Save atags pointer
@@ -155,7 +158,8 @@ ENDPROC(__error)
155 */ 158 */
156__lookup_processor_type: 159__lookup_processor_type:
157 adr r3, 3f 160 adr r3, 3f
158 ldmda r3, {r5 - r7} 161 ldmia r3, {r5 - r7}
162 add r3, r3, #8
159 sub r3, r3, r7 @ get offset between virt&phys 163 sub r3, r3, r7 @ get offset between virt&phys
160 add r5, r5, r3 @ convert virt addresses to 164 add r5, r5, r3 @ convert virt addresses to
161 add r6, r6, r3 @ physical address space 165 add r6, r6, r3 @ physical address space
@@ -185,9 +189,10 @@ ENDPROC(lookup_processor_type)
185 * Look in <asm/procinfo.h> and arch/arm/kernel/arch.[ch] for 189 * Look in <asm/procinfo.h> and arch/arm/kernel/arch.[ch] for
186 * more information about the __proc_info and __arch_info structures. 190 * more information about the __proc_info and __arch_info structures.
187 */ 191 */
188 .long __proc_info_begin 192 .align 2
1933: .long __proc_info_begin
189 .long __proc_info_end 194 .long __proc_info_end
1903: .long . 1954: .long .
191 .long __arch_info_begin 196 .long __arch_info_begin
192 .long __arch_info_end 197 .long __arch_info_end
193 198
@@ -203,7 +208,7 @@ ENDPROC(lookup_processor_type)
203 * r5 = mach_info pointer in physical address space 208 * r5 = mach_info pointer in physical address space
204 */ 209 */
205__lookup_machine_type: 210__lookup_machine_type:
206 adr r3, 3b 211 adr r3, 4b
207 ldmia r3, {r4, r5, r6} 212 ldmia r3, {r4, r5, r6}
208 sub r3, r3, r4 @ get offset between virt&phys 213 sub r3, r3, r4 @ get offset between virt&phys
209 add r5, r5, r3 @ convert virt addresses to 214 add r5, r5, r3 @ convert virt addresses to
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index cc87e1765ed2..e5dfc2895e24 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -34,7 +34,7 @@
34 */ 34 */
35 .section ".text.head", "ax" 35 .section ".text.head", "ax"
36ENTRY(stext) 36ENTRY(stext)
37 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode 37 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
38 @ and irqs disabled 38 @ and irqs disabled
39#ifndef CONFIG_CPU_CP15 39#ifndef CONFIG_CPU_CP15
40 ldr r9, =CONFIG_PROCESSOR_ID 40 ldr r9, =CONFIG_PROCESSOR_ID
@@ -50,8 +50,10 @@ ENTRY(stext)
50 50
51 ldr r13, __switch_data @ address to jump to after 51 ldr r13, __switch_data @ address to jump to after
52 @ the initialization is done 52 @ the initialization is done
53 adr lr, __after_proc_init @ return (PIC) address 53 adr lr, BSYM(__after_proc_init) @ return (PIC) address
54 add pc, r10, #PROCINFO_INITFUNC 54 ARM( add pc, r10, #PROCINFO_INITFUNC )
55 THUMB( add r12, r10, #PROCINFO_INITFUNC )
56 THUMB( mov pc, r12 )
55ENDPROC(stext) 57ENDPROC(stext)
56 58
57/* 59/*
@@ -59,7 +61,10 @@ ENDPROC(stext)
59 */ 61 */
60__after_proc_init: 62__after_proc_init:
61#ifdef CONFIG_CPU_CP15 63#ifdef CONFIG_CPU_CP15
62 mrc p15, 0, r0, c1, c0, 0 @ read control reg 64 /*
65 * CP15 system control register value returned in r0 from
66 * the CPU init function.
67 */
63#ifdef CONFIG_ALIGNMENT_TRAP 68#ifdef CONFIG_ALIGNMENT_TRAP
64 orr r0, r0, #CR_A 69 orr r0, r0, #CR_A
65#else 70#else
@@ -82,7 +87,8 @@ __after_proc_init:
82 mcr p15, 0, r0, c1, c0, 0 @ write control reg 87 mcr p15, 0, r0, c1, c0, 0 @ write control reg
83#endif /* CONFIG_CPU_CP15 */ 88#endif /* CONFIG_CPU_CP15 */
84 89
85 mov pc, r13 @ clear the BSS and jump 90 mov r3, r13
91 mov pc, r3 @ clear the BSS and jump
86 @ to start_kernel 92 @ to start_kernel
87ENDPROC(__after_proc_init) 93ENDPROC(__after_proc_init)
88 .ltorg 94 .ltorg
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 21e17dc94cb5..38ccbe1d3b2c 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -76,7 +76,7 @@
76 */ 76 */
77 .section ".text.head", "ax" 77 .section ".text.head", "ax"
78ENTRY(stext) 78ENTRY(stext)
79 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode 79 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
80 @ and irqs disabled 80 @ and irqs disabled
81 mrc p15, 0, r9, c0, c0 @ get processor id 81 mrc p15, 0, r9, c0, c0 @ get processor id
82 bl __lookup_processor_type @ r5=procinfo r9=cpuid 82 bl __lookup_processor_type @ r5=procinfo r9=cpuid
@@ -97,8 +97,10 @@ ENTRY(stext)
97 */ 97 */
98 ldr r13, __switch_data @ address to jump to after 98 ldr r13, __switch_data @ address to jump to after
99 @ mmu has been enabled 99 @ mmu has been enabled
100 adr lr, __enable_mmu @ return (PIC) address 100 adr lr, BSYM(__enable_mmu) @ return (PIC) address
101 add pc, r10, #PROCINFO_INITFUNC 101 ARM( add pc, r10, #PROCINFO_INITFUNC )
102 THUMB( add r12, r10, #PROCINFO_INITFUNC )
103 THUMB( mov pc, r12 )
102ENDPROC(stext) 104ENDPROC(stext)
103 105
104#if defined(CONFIG_SMP) 106#if defined(CONFIG_SMP)
@@ -110,7 +112,7 @@ ENTRY(secondary_startup)
110 * the processor type - there is no need to check the machine type 112 * the processor type - there is no need to check the machine type
111 * as it has already been validated by the primary processor. 113 * as it has already been validated by the primary processor.
112 */ 114 */
113 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE 115 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9
114 mrc p15, 0, r9, c0, c0 @ get processor id 116 mrc p15, 0, r9, c0, c0 @ get processor id
115 bl __lookup_processor_type 117 bl __lookup_processor_type
116 movs r10, r5 @ invalid processor? 118 movs r10, r5 @ invalid processor?
@@ -121,12 +123,15 @@ ENTRY(secondary_startup)
121 * Use the page tables supplied from __cpu_up. 123 * Use the page tables supplied from __cpu_up.
122 */ 124 */
123 adr r4, __secondary_data 125 adr r4, __secondary_data
124 ldmia r4, {r5, r7, r13} @ address to jump to after 126 ldmia r4, {r5, r7, r12} @ address to jump to after
125 sub r4, r4, r5 @ mmu has been enabled 127 sub r4, r4, r5 @ mmu has been enabled
126 ldr r4, [r7, r4] @ get secondary_data.pgdir 128 ldr r4, [r7, r4] @ get secondary_data.pgdir
127 adr lr, __enable_mmu @ return address 129 adr lr, BSYM(__enable_mmu) @ return address
128 add pc, r10, #PROCINFO_INITFUNC @ initialise processor 130 mov r13, r12 @ __secondary_switched address
129 @ (return control reg) 131 ARM( add pc, r10, #PROCINFO_INITFUNC ) @ initialise processor
132 @ (return control reg)
133 THUMB( add r12, r10, #PROCINFO_INITFUNC )
134 THUMB( mov pc, r12 )
130ENDPROC(secondary_startup) 135ENDPROC(secondary_startup)
131 136
132 /* 137 /*
@@ -193,8 +198,8 @@ __turn_mmu_on:
193 mcr p15, 0, r0, c1, c0, 0 @ write control reg 198 mcr p15, 0, r0, c1, c0, 0 @ write control reg
194 mrc p15, 0, r3, c0, c0, 0 @ read id reg 199 mrc p15, 0, r3, c0, c0, 0 @ read id reg
195 mov r3, r3 200 mov r3, r3
196 mov r3, r3 201 mov r3, r13
197 mov pc, r13 202 mov pc, r3
198ENDPROC(__turn_mmu_on) 203ENDPROC(__turn_mmu_on)
199 204
200 205
@@ -235,7 +240,8 @@ __create_page_tables:
235 * will be removed by paging_init(). We use our current program 240 * will be removed by paging_init(). We use our current program
236 * counter to determine corresponding section base address. 241 * counter to determine corresponding section base address.
237 */ 242 */
238 mov r6, pc, lsr #20 @ start of kernel section 243 mov r6, pc
244 mov r6, r6, lsr #20 @ start of kernel section
239 orr r3, r7, r6, lsl #20 @ flags + kernel base 245 orr r3, r7, r6, lsl #20 @ flags + kernel base
240 str r3, [r4, r6, lsl #2] @ identity mapping 246 str r3, [r4, r6, lsl #2] @ identity mapping
241 247
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index b7c3490eaa24..c9a8619f3856 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -86,7 +86,7 @@ int show_interrupts(struct seq_file *p, void *v)
86unlock: 86unlock:
87 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 87 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
88 } else if (i == NR_IRQS) { 88 } else if (i == NR_IRQS) {
89#ifdef CONFIG_ARCH_ACORN 89#ifdef CONFIG_FIQ
90 show_fiq_list(p, v); 90 show_fiq_list(p, v);
91#endif 91#endif
92#ifdef CONFIG_SMP 92#ifdef CONFIG_SMP
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index bac03c81489d..f28c5e9c51ea 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -102,6 +102,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
102 unsigned long loc; 102 unsigned long loc;
103 Elf32_Sym *sym; 103 Elf32_Sym *sym;
104 s32 offset; 104 s32 offset;
105 u32 upper, lower, sign, j1, j2;
105 106
106 offset = ELF32_R_SYM(rel->r_info); 107 offset = ELF32_R_SYM(rel->r_info);
107 if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) { 108 if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) {
@@ -184,6 +185,58 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
184 (offset & 0x0fff); 185 (offset & 0x0fff);
185 break; 186 break;
186 187
188 case R_ARM_THM_CALL:
189 case R_ARM_THM_JUMP24:
190 upper = *(u16 *)loc;
191 lower = *(u16 *)(loc + 2);
192
193 /*
194 * 25 bit signed address range (Thumb-2 BL and B.W
195 * instructions):
196 * S:I1:I2:imm10:imm11:0
197 * where:
198 * S = upper[10] = offset[24]
199 * I1 = ~(J1 ^ S) = offset[23]
200 * I2 = ~(J2 ^ S) = offset[22]
201 * imm10 = upper[9:0] = offset[21:12]
202 * imm11 = lower[10:0] = offset[11:1]
203 * J1 = lower[13]
204 * J2 = lower[11]
205 */
206 sign = (upper >> 10) & 1;
207 j1 = (lower >> 13) & 1;
208 j2 = (lower >> 11) & 1;
209 offset = (sign << 24) | ((~(j1 ^ sign) & 1) << 23) |
210 ((~(j2 ^ sign) & 1) << 22) |
211 ((upper & 0x03ff) << 12) |
212 ((lower & 0x07ff) << 1);
213 if (offset & 0x01000000)
214 offset -= 0x02000000;
215 offset += sym->st_value - loc;
216
217 /* only Thumb addresses allowed (no interworking) */
218 if (!(offset & 1) ||
219 offset <= (s32)0xff000000 ||
220 offset >= (s32)0x01000000) {
221 printk(KERN_ERR
222 "%s: relocation out of range, section "
223 "%d reloc %d sym '%s'\n", module->name,
224 relindex, i, strtab + sym->st_name);
225 return -ENOEXEC;
226 }
227
228 sign = (offset >> 24) & 1;
229 j1 = sign ^ (~(offset >> 23) & 1);
230 j2 = sign ^ (~(offset >> 22) & 1);
231 *(u16 *)loc = (u16)((upper & 0xf800) | (sign << 10) |
232 ((offset >> 12) & 0x03ff));
233 *(u16 *)(loc + 2) = (u16)((lower & 0xd000) |
234 (j1 << 13) | (j2 << 11) |
235 ((offset >> 1) & 0x07ff));
236 upper = *(u16 *)loc;
237 lower = *(u16 *)(loc + 2);
238 break;
239
187 default: 240 default:
188 printk(KERN_ERR "%s: unknown relocation: %u\n", 241 printk(KERN_ERR "%s: unknown relocation: %u\n",
189 module->name, ELF32_R_TYPE(rel->r_info)); 242 module->name, ELF32_R_TYPE(rel->r_info));
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 39196dff478c..790fbee92ec5 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -388,7 +388,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
388 regs.ARM_r2 = (unsigned long)fn; 388 regs.ARM_r2 = (unsigned long)fn;
389 regs.ARM_r3 = (unsigned long)kernel_thread_exit; 389 regs.ARM_r3 = (unsigned long)kernel_thread_exit;
390 regs.ARM_pc = (unsigned long)kernel_thread_helper; 390 regs.ARM_pc = (unsigned long)kernel_thread_helper;
391 regs.ARM_cpsr = SVC_MODE | PSR_ENDSTATE; 391 regs.ARM_cpsr = SVC_MODE | PSR_ENDSTATE | PSR_ISETSTATE;
392 392
393 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL); 393 return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
394} 394}
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 89882a1d0187..a2ea3854cb3c 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -521,7 +521,13 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
521 return -EIO; 521 return -EIO;
522 522
523 tmp = 0; 523 tmp = 0;
524 if (off < sizeof(struct pt_regs)) 524 if (off == PT_TEXT_ADDR)
525 tmp = tsk->mm->start_code;
526 else if (off == PT_DATA_ADDR)
527 tmp = tsk->mm->start_data;
528 else if (off == PT_TEXT_END_ADDR)
529 tmp = tsk->mm->end_code;
530 else if (off < sizeof(struct pt_regs))
525 tmp = get_user_reg(tsk, off >> 2); 531 tmp = get_user_reg(tsk, off >> 2);
526 532
527 return put_user(tmp, ret); 533 return put_user(tmp, ret);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index bc5e4128f9f3..d4d4f77c91b2 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -25,6 +25,7 @@
25#include <linux/smp.h> 25#include <linux/smp.h>
26#include <linux/fs.h> 26#include <linux/fs.h>
27 27
28#include <asm/unified.h>
28#include <asm/cpu.h> 29#include <asm/cpu.h>
29#include <asm/cputype.h> 30#include <asm/cputype.h>
30#include <asm/elf.h> 31#include <asm/elf.h>
@@ -327,25 +328,38 @@ void cpu_init(void)
327 } 328 }
328 329
329 /* 330 /*
331 * Define the placement constraint for the inline asm directive below.
332 * In Thumb-2, msr with an immediate value is not allowed.
333 */
334#ifdef CONFIG_THUMB2_KERNEL
335#define PLC "r"
336#else
337#define PLC "I"
338#endif
339
340 /*
330 * setup stacks for re-entrant exception handlers 341 * setup stacks for re-entrant exception handlers
331 */ 342 */
332 __asm__ ( 343 __asm__ (
333 "msr cpsr_c, %1\n\t" 344 "msr cpsr_c, %1\n\t"
334 "add sp, %0, %2\n\t" 345 "add r14, %0, %2\n\t"
346 "mov sp, r14\n\t"
335 "msr cpsr_c, %3\n\t" 347 "msr cpsr_c, %3\n\t"
336 "add sp, %0, %4\n\t" 348 "add r14, %0, %4\n\t"
349 "mov sp, r14\n\t"
337 "msr cpsr_c, %5\n\t" 350 "msr cpsr_c, %5\n\t"
338 "add sp, %0, %6\n\t" 351 "add r14, %0, %6\n\t"
352 "mov sp, r14\n\t"
339 "msr cpsr_c, %7" 353 "msr cpsr_c, %7"
340 : 354 :
341 : "r" (stk), 355 : "r" (stk),
342 "I" (PSR_F_BIT | PSR_I_BIT | IRQ_MODE), 356 PLC (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
343 "I" (offsetof(struct stack, irq[0])), 357 "I" (offsetof(struct stack, irq[0])),
344 "I" (PSR_F_BIT | PSR_I_BIT | ABT_MODE), 358 PLC (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
345 "I" (offsetof(struct stack, abt[0])), 359 "I" (offsetof(struct stack, abt[0])),
346 "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE), 360 PLC (PSR_F_BIT | PSR_I_BIT | UND_MODE),
347 "I" (offsetof(struct stack, und[0])), 361 "I" (offsetof(struct stack, und[0])),
348 "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE) 362 PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
349 : "r14"); 363 : "r14");
350} 364}
351 365
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index dd56e11f339a..39baf1128bfa 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -62,7 +62,11 @@ struct unwind_ctrl_block {
62}; 62};
63 63
64enum regs { 64enum regs {
65#ifdef CONFIG_THUMB2_KERNEL
66 FP = 7,
67#else
65 FP = 11, 68 FP = 11,
69#endif
66 SP = 13, 70 SP = 13,
67 LR = 14, 71 LR = 14,
68 PC = 15 72 PC = 15
diff --git a/arch/arm/lib/ashldi3.S b/arch/arm/lib/ashldi3.S
index 1154d924080b..638deb13da1c 100644
--- a/arch/arm/lib/ashldi3.S
+++ b/arch/arm/lib/ashldi3.S
@@ -43,7 +43,9 @@ ENTRY(__aeabi_llsl)
43 rsb ip, r2, #32 43 rsb ip, r2, #32
44 movmi ah, ah, lsl r2 44 movmi ah, ah, lsl r2
45 movpl ah, al, lsl r3 45 movpl ah, al, lsl r3
46 orrmi ah, ah, al, lsr ip 46 ARM( orrmi ah, ah, al, lsr ip )
47 THUMB( lsrmi r3, al, ip )
48 THUMB( orrmi ah, ah, r3 )
47 mov al, al, lsl r2 49 mov al, al, lsl r2
48 mov pc, lr 50 mov pc, lr
49 51
diff --git a/arch/arm/lib/ashrdi3.S b/arch/arm/lib/ashrdi3.S
index 9f8b35572f8c..015e8aa5a1d1 100644
--- a/arch/arm/lib/ashrdi3.S
+++ b/arch/arm/lib/ashrdi3.S
@@ -43,7 +43,9 @@ ENTRY(__aeabi_lasr)
43 rsb ip, r2, #32 43 rsb ip, r2, #32
44 movmi al, al, lsr r2 44 movmi al, al, lsr r2
45 movpl al, ah, asr r3 45 movpl al, ah, asr r3
46 orrmi al, al, ah, lsl ip 46 ARM( orrmi al, al, ah, lsl ip )
47 THUMB( lslmi r3, ah, ip )
48 THUMB( orrmi al, al, r3 )
47 mov ah, ah, asr r2 49 mov ah, ah, asr r2
48 mov pc, lr 50 mov pc, lr
49 51
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
index b0951d0e8b2c..aaf7220d9e30 100644
--- a/arch/arm/lib/backtrace.S
+++ b/arch/arm/lib/backtrace.S
@@ -38,7 +38,9 @@ ENDPROC(c_backtrace)
38 beq no_frame @ we have no stack frames 38 beq no_frame @ we have no stack frames
39 39
40 tst r1, #0x10 @ 26 or 32-bit mode? 40 tst r1, #0x10 @ 26 or 32-bit mode?
41 moveq mask, #0xfc000003 @ mask for 26-bit 41 ARM( moveq mask, #0xfc000003 )
42 THUMB( moveq mask, #0xfc000000 )
43 THUMB( orreq mask, #0x03 )
42 movne mask, #0 @ mask for 32-bit 44 movne mask, #0 @ mask for 32-bit
43 45
441: stmfd sp!, {pc} @ calculate offset of PC stored 461: stmfd sp!, {pc} @ calculate offset of PC stored
@@ -126,7 +128,9 @@ ENDPROC(c_backtrace)
126 mov reg, #10 128 mov reg, #10
127 mov r7, #0 129 mov r7, #0
1281: mov r3, #1 1301: mov r3, #1
129 tst instr, r3, lsl reg 131 ARM( tst instr, r3, lsl reg )
132 THUMB( lsl r3, reg )
133 THUMB( tst instr, r3 )
130 beq 2f 134 beq 2f
131 add r7, r7, #1 135 add r7, r7, #1
132 teq r7, #6 136 teq r7, #6
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index c7f2627385e7..d42252918bfb 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -60,8 +60,8 @@
60 tst r2, r0, lsl r3 60 tst r2, r0, lsl r3
61 \instr r2, r2, r0, lsl r3 61 \instr r2, r2, r0, lsl r3
62 \store r2, [r1] 62 \store r2, [r1]
63 restore_irqs ip
64 moveq r0, #0 63 moveq r0, #0
64 restore_irqs ip
65 mov pc, lr 65 mov pc, lr
66 .endm 66 .endm
67#endif 67#endif
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
index 844f56785ebc..1279abd8b886 100644
--- a/arch/arm/lib/clear_user.S
+++ b/arch/arm/lib/clear_user.S
@@ -27,21 +27,20 @@ WEAK(__clear_user)
27 ands ip, r0, #3 27 ands ip, r0, #3
28 beq 1f 28 beq 1f
29 cmp ip, #2 29 cmp ip, #2
30USER( strbt r2, [r0], #1) 30 strusr r2, r0, 1
31USER( strlebt r2, [r0], #1) 31 strusr r2, r0, 1, le
32USER( strltbt r2, [r0], #1) 32 strusr r2, r0, 1, lt
33 rsb ip, ip, #4 33 rsb ip, ip, #4
34 sub r1, r1, ip @ 7 6 5 4 3 2 1 34 sub r1, r1, ip @ 7 6 5 4 3 2 1
351: subs r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -7 351: subs r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -7
36USER( strplt r2, [r0], #4) 36 strusr r2, r0, 4, pl, rept=2
37USER( strplt r2, [r0], #4)
38 bpl 1b 37 bpl 1b
39 adds r1, r1, #4 @ 3 2 1 0 -1 -2 -3 38 adds r1, r1, #4 @ 3 2 1 0 -1 -2 -3
40USER( strplt r2, [r0], #4) 39 strusr r2, r0, 4, pl
412: tst r1, #2 @ 1x 1x 0x 0x 1x 1x 0x 402: tst r1, #2 @ 1x 1x 0x 0x 1x 1x 0x
42USER( strnebt r2, [r0], #1) 41 strusr r2, r0, 1, ne, rept=2
43USER( strnebt r2, [r0], #1)
44 tst r1, #1 @ x1 x0 x1 x0 x1 x0 x1 42 tst r1, #1 @ x1 x0 x1 x0 x1 x0 x1
43 it ne @ explicit IT needed for the label
45USER( strnebt r2, [r0]) 44USER( strnebt r2, [r0])
46 mov r0, #0 45 mov r0, #0
47 ldmfd sp!, {r1, pc} 46 ldmfd sp!, {r1, pc}
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
index 56799a165cc4..e4fe124acedc 100644
--- a/arch/arm/lib/copy_from_user.S
+++ b/arch/arm/lib/copy_from_user.S
@@ -33,11 +33,15 @@
33 * Number of bytes NOT copied. 33 * Number of bytes NOT copied.
34 */ 34 */
35 35
36#ifndef CONFIG_THUMB2_KERNEL
37#define LDR1W_SHIFT 0
38#else
39#define LDR1W_SHIFT 1
40#endif
41#define STR1W_SHIFT 0
42
36 .macro ldr1w ptr reg abort 43 .macro ldr1w ptr reg abort
37100: ldrt \reg, [\ptr], #4 44 ldrusr \reg, \ptr, 4, abort=\abort
38 .section __ex_table, "a"
39 .long 100b, \abort
40 .previous
41 .endm 45 .endm
42 46
43 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort 47 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
@@ -53,14 +57,11 @@
53 .endm 57 .endm
54 58
55 .macro ldr1b ptr reg cond=al abort 59 .macro ldr1b ptr reg cond=al abort
56100: ldr\cond\()bt \reg, [\ptr], #1 60 ldrusr \reg, \ptr, 1, \cond, abort=\abort
57 .section __ex_table, "a"
58 .long 100b, \abort
59 .previous
60 .endm 61 .endm
61 62
62 .macro str1w ptr reg abort 63 .macro str1w ptr reg abort
63 str \reg, [\ptr], #4 64 W(str) \reg, [\ptr], #4
64 .endm 65 .endm
65 66
66 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort 67 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
diff --git a/arch/arm/lib/copy_template.S b/arch/arm/lib/copy_template.S
index 139cce646055..805e3f8fb007 100644
--- a/arch/arm/lib/copy_template.S
+++ b/arch/arm/lib/copy_template.S
@@ -57,6 +57,13 @@
57 * 57 *
58 * Restore registers with the values previously saved with the 58 * Restore registers with the values previously saved with the
59 * 'preserv' macro. Called upon code termination. 59 * 'preserv' macro. Called upon code termination.
60 *
61 * LDR1W_SHIFT
62 * STR1W_SHIFT
63 *
64 * Correction to be applied to the "ip" register when branching into
65 * the ldr1w or str1w instructions (some of these macros may expand to
66 * than one 32bit instruction in Thumb-2)
60 */ 67 */
61 68
62 69
@@ -99,9 +106,15 @@
99 106
1005: ands ip, r2, #28 1075: ands ip, r2, #28
101 rsb ip, ip, #32 108 rsb ip, ip, #32
109#if LDR1W_SHIFT > 0
110 lsl ip, ip, #LDR1W_SHIFT
111#endif
102 addne pc, pc, ip @ C is always clear here 112 addne pc, pc, ip @ C is always clear here
103 b 7f 113 b 7f
1046: nop 1146:
115 .rept (1 << LDR1W_SHIFT)
116 W(nop)
117 .endr
105 ldr1w r1, r3, abort=20f 118 ldr1w r1, r3, abort=20f
106 ldr1w r1, r4, abort=20f 119 ldr1w r1, r4, abort=20f
107 ldr1w r1, r5, abort=20f 120 ldr1w r1, r5, abort=20f
@@ -110,9 +123,16 @@
110 ldr1w r1, r8, abort=20f 123 ldr1w r1, r8, abort=20f
111 ldr1w r1, lr, abort=20f 124 ldr1w r1, lr, abort=20f
112 125
126#if LDR1W_SHIFT < STR1W_SHIFT
127 lsl ip, ip, #STR1W_SHIFT - LDR1W_SHIFT
128#elif LDR1W_SHIFT > STR1W_SHIFT
129 lsr ip, ip, #LDR1W_SHIFT - STR1W_SHIFT
130#endif
113 add pc, pc, ip 131 add pc, pc, ip
114 nop 132 nop
115 nop 133 .rept (1 << STR1W_SHIFT)
134 W(nop)
135 .endr
116 str1w r0, r3, abort=20f 136 str1w r0, r3, abort=20f
117 str1w r0, r4, abort=20f 137 str1w r0, r4, abort=20f
118 str1w r0, r5, abort=20f 138 str1w r0, r5, abort=20f
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
index 878820f0a320..1a71e1584442 100644
--- a/arch/arm/lib/copy_to_user.S
+++ b/arch/arm/lib/copy_to_user.S
@@ -33,8 +33,15 @@
33 * Number of bytes NOT copied. 33 * Number of bytes NOT copied.
34 */ 34 */
35 35
36#define LDR1W_SHIFT 0
37#ifndef CONFIG_THUMB2_KERNEL
38#define STR1W_SHIFT 0
39#else
40#define STR1W_SHIFT 1
41#endif
42
36 .macro ldr1w ptr reg abort 43 .macro ldr1w ptr reg abort
37 ldr \reg, [\ptr], #4 44 W(ldr) \reg, [\ptr], #4
38 .endm 45 .endm
39 46
40 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort 47 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
@@ -50,10 +57,7 @@
50 .endm 57 .endm
51 58
52 .macro str1w ptr reg abort 59 .macro str1w ptr reg abort
53100: strt \reg, [\ptr], #4 60 strusr \reg, \ptr, 4, abort=\abort
54 .section __ex_table, "a"
55 .long 100b, \abort
56 .previous
57 .endm 61 .endm
58 62
59 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort 63 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
@@ -68,10 +72,7 @@
68 .endm 72 .endm
69 73
70 .macro str1b ptr reg cond=al abort 74 .macro str1b ptr reg cond=al abort
71100: str\cond\()bt \reg, [\ptr], #1 75 strusr \reg, \ptr, 1, \cond, abort=\abort
72 .section __ex_table, "a"
73 .long 100b, \abort
74 .previous
75 .endm 76 .endm
76 77
77 .macro enter reg1 reg2 78 .macro enter reg1 reg2
diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S
index 14677fb4b0c4..fd0e9dcd9fdc 100644
--- a/arch/arm/lib/csumpartialcopyuser.S
+++ b/arch/arm/lib/csumpartialcopyuser.S
@@ -26,50 +26,28 @@
26 .endm 26 .endm
27 27
28 .macro load1b, reg1 28 .macro load1b, reg1
299999: ldrbt \reg1, [r0], $1 29 ldrusr \reg1, r0, 1
30 .section __ex_table, "a"
31 .align 3
32 .long 9999b, 6001f
33 .previous
34 .endm 30 .endm
35 31
36 .macro load2b, reg1, reg2 32 .macro load2b, reg1, reg2
379999: ldrbt \reg1, [r0], $1 33 ldrusr \reg1, r0, 1
389998: ldrbt \reg2, [r0], $1 34 ldrusr \reg2, r0, 1
39 .section __ex_table, "a"
40 .long 9999b, 6001f
41 .long 9998b, 6001f
42 .previous
43 .endm 35 .endm
44 36
45 .macro load1l, reg1 37 .macro load1l, reg1
469999: ldrt \reg1, [r0], $4 38 ldrusr \reg1, r0, 4
47 .section __ex_table, "a"
48 .align 3
49 .long 9999b, 6001f
50 .previous
51 .endm 39 .endm
52 40
53 .macro load2l, reg1, reg2 41 .macro load2l, reg1, reg2
549999: ldrt \reg1, [r0], $4 42 ldrusr \reg1, r0, 4
559998: ldrt \reg2, [r0], $4 43 ldrusr \reg2, r0, 4
56 .section __ex_table, "a"
57 .long 9999b, 6001f
58 .long 9998b, 6001f
59 .previous
60 .endm 44 .endm
61 45
62 .macro load4l, reg1, reg2, reg3, reg4 46 .macro load4l, reg1, reg2, reg3, reg4
639999: ldrt \reg1, [r0], $4 47 ldrusr \reg1, r0, 4
649998: ldrt \reg2, [r0], $4 48 ldrusr \reg2, r0, 4
659997: ldrt \reg3, [r0], $4 49 ldrusr \reg3, r0, 4
669996: ldrt \reg4, [r0], $4 50 ldrusr \reg4, r0, 4
67 .section __ex_table, "a"
68 .long 9999b, 6001f
69 .long 9998b, 6001f
70 .long 9997b, 6001f
71 .long 9996b, 6001f
72 .previous
73 .endm 51 .endm
74 52
75/* 53/*
@@ -92,14 +70,14 @@
92 */ 70 */
93 .section .fixup,"ax" 71 .section .fixup,"ax"
94 .align 4 72 .align 4
956001: mov r4, #-EFAULT 739001: mov r4, #-EFAULT
96 ldr r5, [fp, #4] @ *err_ptr 74 ldr r5, [fp, #4] @ *err_ptr
97 str r4, [r5] 75 str r4, [r5]
98 ldmia sp, {r1, r2} @ retrieve dst, len 76 ldmia sp, {r1, r2} @ retrieve dst, len
99 add r2, r2, r1 77 add r2, r2, r1
100 mov r0, #0 @ zero the buffer 78 mov r0, #0 @ zero the buffer
1016002: teq r2, r1 799002: teq r2, r1
102 strneb r0, [r1], #1 80 strneb r0, [r1], #1
103 bne 6002b 81 bne 9002b
104 load_regs 82 load_regs
105 .previous 83 .previous
diff --git a/arch/arm/lib/div64.S b/arch/arm/lib/div64.S
index 1425e789ba86..faa7748142da 100644
--- a/arch/arm/lib/div64.S
+++ b/arch/arm/lib/div64.S
@@ -177,7 +177,9 @@ ENTRY(__do_div64)
177 mov yh, xh, lsr ip 177 mov yh, xh, lsr ip
178 mov yl, xl, lsr ip 178 mov yl, xl, lsr ip
179 rsb ip, ip, #32 179 rsb ip, ip, #32
180 orr yl, yl, xh, lsl ip 180 ARM( orr yl, yl, xh, lsl ip )
181 THUMB( lsl xh, xh, ip )
182 THUMB( orr yl, yl, xh )
181 mov xh, xl, lsl ip 183 mov xh, xl, lsl ip
182 mov xh, xh, lsr ip 184 mov xh, xh, lsr ip
183 mov pc, lr 185 mov pc, lr
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S
index 8c4defc4f3c4..1e4cbd4e7be9 100644
--- a/arch/arm/lib/findbit.S
+++ b/arch/arm/lib/findbit.S
@@ -25,7 +25,10 @@ ENTRY(_find_first_zero_bit_le)
25 teq r1, #0 25 teq r1, #0
26 beq 3f 26 beq 3f
27 mov r2, #0 27 mov r2, #0
281: ldrb r3, [r0, r2, lsr #3] 281:
29 ARM( ldrb r3, [r0, r2, lsr #3] )
30 THUMB( lsr r3, r2, #3 )
31 THUMB( ldrb r3, [r0, r3] )
29 eors r3, r3, #0xff @ invert bits 32 eors r3, r3, #0xff @ invert bits
30 bne .L_found @ any now set - found zero bit 33 bne .L_found @ any now set - found zero bit
31 add r2, r2, #8 @ next bit pointer 34 add r2, r2, #8 @ next bit pointer
@@ -44,7 +47,9 @@ ENTRY(_find_next_zero_bit_le)
44 beq 3b 47 beq 3b
45 ands ip, r2, #7 48 ands ip, r2, #7
46 beq 1b @ If new byte, goto old routine 49 beq 1b @ If new byte, goto old routine
47 ldrb r3, [r0, r2, lsr #3] 50 ARM( ldrb r3, [r0, r2, lsr #3] )
51 THUMB( lsr r3, r2, #3 )
52 THUMB( ldrb r3, [r0, r3] )
48 eor r3, r3, #0xff @ now looking for a 1 bit 53 eor r3, r3, #0xff @ now looking for a 1 bit
49 movs r3, r3, lsr ip @ shift off unused bits 54 movs r3, r3, lsr ip @ shift off unused bits
50 bne .L_found 55 bne .L_found
@@ -61,7 +66,10 @@ ENTRY(_find_first_bit_le)
61 teq r1, #0 66 teq r1, #0
62 beq 3f 67 beq 3f
63 mov r2, #0 68 mov r2, #0
641: ldrb r3, [r0, r2, lsr #3] 691:
70 ARM( ldrb r3, [r0, r2, lsr #3] )
71 THUMB( lsr r3, r2, #3 )
72 THUMB( ldrb r3, [r0, r3] )
65 movs r3, r3 73 movs r3, r3
66 bne .L_found @ any now set - found zero bit 74 bne .L_found @ any now set - found zero bit
67 add r2, r2, #8 @ next bit pointer 75 add r2, r2, #8 @ next bit pointer
@@ -80,7 +88,9 @@ ENTRY(_find_next_bit_le)
80 beq 3b 88 beq 3b
81 ands ip, r2, #7 89 ands ip, r2, #7
82 beq 1b @ If new byte, goto old routine 90 beq 1b @ If new byte, goto old routine
83 ldrb r3, [r0, r2, lsr #3] 91 ARM( ldrb r3, [r0, r2, lsr #3] )
92 THUMB( lsr r3, r2, #3 )
93 THUMB( ldrb r3, [r0, r3] )
84 movs r3, r3, lsr ip @ shift off unused bits 94 movs r3, r3, lsr ip @ shift off unused bits
85 bne .L_found 95 bne .L_found
86 orr r2, r2, #7 @ if zero, then no bits here 96 orr r2, r2, #7 @ if zero, then no bits here
@@ -95,7 +105,9 @@ ENTRY(_find_first_zero_bit_be)
95 beq 3f 105 beq 3f
96 mov r2, #0 106 mov r2, #0
971: eor r3, r2, #0x18 @ big endian byte ordering 1071: eor r3, r2, #0x18 @ big endian byte ordering
98 ldrb r3, [r0, r3, lsr #3] 108 ARM( ldrb r3, [r0, r3, lsr #3] )
109 THUMB( lsr r3, #3 )
110 THUMB( ldrb r3, [r0, r3] )
99 eors r3, r3, #0xff @ invert bits 111 eors r3, r3, #0xff @ invert bits
100 bne .L_found @ any now set - found zero bit 112 bne .L_found @ any now set - found zero bit
101 add r2, r2, #8 @ next bit pointer 113 add r2, r2, #8 @ next bit pointer
@@ -111,7 +123,9 @@ ENTRY(_find_next_zero_bit_be)
111 ands ip, r2, #7 123 ands ip, r2, #7
112 beq 1b @ If new byte, goto old routine 124 beq 1b @ If new byte, goto old routine
113 eor r3, r2, #0x18 @ big endian byte ordering 125 eor r3, r2, #0x18 @ big endian byte ordering
114 ldrb r3, [r0, r3, lsr #3] 126 ARM( ldrb r3, [r0, r3, lsr #3] )
127 THUMB( lsr r3, #3 )
128 THUMB( ldrb r3, [r0, r3] )
115 eor r3, r3, #0xff @ now looking for a 1 bit 129 eor r3, r3, #0xff @ now looking for a 1 bit
116 movs r3, r3, lsr ip @ shift off unused bits 130 movs r3, r3, lsr ip @ shift off unused bits
117 bne .L_found 131 bne .L_found
@@ -125,7 +139,9 @@ ENTRY(_find_first_bit_be)
125 beq 3f 139 beq 3f
126 mov r2, #0 140 mov r2, #0
1271: eor r3, r2, #0x18 @ big endian byte ordering 1411: eor r3, r2, #0x18 @ big endian byte ordering
128 ldrb r3, [r0, r3, lsr #3] 142 ARM( ldrb r3, [r0, r3, lsr #3] )
143 THUMB( lsr r3, #3 )
144 THUMB( ldrb r3, [r0, r3] )
129 movs r3, r3 145 movs r3, r3
130 bne .L_found @ any now set - found zero bit 146 bne .L_found @ any now set - found zero bit
131 add r2, r2, #8 @ next bit pointer 147 add r2, r2, #8 @ next bit pointer
@@ -141,7 +157,9 @@ ENTRY(_find_next_bit_be)
141 ands ip, r2, #7 157 ands ip, r2, #7
142 beq 1b @ If new byte, goto old routine 158 beq 1b @ If new byte, goto old routine
143 eor r3, r2, #0x18 @ big endian byte ordering 159 eor r3, r2, #0x18 @ big endian byte ordering
144 ldrb r3, [r0, r3, lsr #3] 160 ARM( ldrb r3, [r0, r3, lsr #3] )
161 THUMB( lsr r3, #3 )
162 THUMB( ldrb r3, [r0, r3] )
145 movs r3, r3, lsr ip @ shift off unused bits 163 movs r3, r3, lsr ip @ shift off unused bits
146 bne .L_found 164 bne .L_found
147 orr r2, r2, #7 @ if zero, then no bits here 165 orr r2, r2, #7 @ if zero, then no bits here
diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S
index 6763088b7607..a1814d927122 100644
--- a/arch/arm/lib/getuser.S
+++ b/arch/arm/lib/getuser.S
@@ -36,8 +36,13 @@ ENTRY(__get_user_1)
36ENDPROC(__get_user_1) 36ENDPROC(__get_user_1)
37 37
38ENTRY(__get_user_2) 38ENTRY(__get_user_2)
39#ifdef CONFIG_THUMB2_KERNEL
402: ldrbt r2, [r0]
413: ldrbt r3, [r0, #1]
42#else
392: ldrbt r2, [r0], #1 432: ldrbt r2, [r0], #1
403: ldrbt r3, [r0] 443: ldrbt r3, [r0]
45#endif
41#ifndef __ARMEB__ 46#ifndef __ARMEB__
42 orr r2, r2, r3, lsl #8 47 orr r2, r2, r3, lsl #8
43#else 48#else
diff --git a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S
index d6585612c86b..ff4f71b579ee 100644
--- a/arch/arm/lib/io-writesw-armv4.S
+++ b/arch/arm/lib/io-writesw-armv4.S
@@ -75,7 +75,10 @@ ENTRY(__raw_writesw)
75#endif 75#endif
76 76
77.Loutsw_noalign: 77.Loutsw_noalign:
78 ldr r3, [r1, -r3]! 78 ARM( ldr r3, [r1, -r3]! )
79 THUMB( rsb r3, r3, #0 )
80 THUMB( ldr r3, [r1, r3] )
81 THUMB( sub r1, r3 )
79 subcs r2, r2, #1 82 subcs r2, r2, #1
80 bcs 2f 83 bcs 2f
81 subs r2, r2, #2 84 subs r2, r2, #2
diff --git a/arch/arm/lib/lshrdi3.S b/arch/arm/lib/lshrdi3.S
index 99ea338bf87c..f83d449141f7 100644
--- a/arch/arm/lib/lshrdi3.S
+++ b/arch/arm/lib/lshrdi3.S
@@ -43,7 +43,9 @@ ENTRY(__aeabi_llsr)
43 rsb ip, r2, #32 43 rsb ip, r2, #32
44 movmi al, al, lsr r2 44 movmi al, al, lsr r2
45 movpl al, ah, lsr r3 45 movpl al, ah, lsr r3
46 orrmi al, al, ah, lsl ip 46 ARM( orrmi al, al, ah, lsl ip )
47 THUMB( lslmi r3, ah, ip )
48 THUMB( orrmi al, al, r3 )
47 mov ah, ah, lsr r2 49 mov ah, ah, lsr r2
48 mov pc, lr 50 mov pc, lr
49 51
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index e0d002641d3f..a9b9e2287a09 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -13,8 +13,11 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15 15
16#define LDR1W_SHIFT 0
17#define STR1W_SHIFT 0
18
16 .macro ldr1w ptr reg abort 19 .macro ldr1w ptr reg abort
17 ldr \reg, [\ptr], #4 20 W(ldr) \reg, [\ptr], #4
18 .endm 21 .endm
19 22
20 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort 23 .macro ldr4w ptr reg1 reg2 reg3 reg4 abort
@@ -30,7 +33,7 @@
30 .endm 33 .endm
31 34
32 .macro str1w ptr reg abort 35 .macro str1w ptr reg abort
33 str \reg, [\ptr], #4 36 W(str) \reg, [\ptr], #4
34 .endm 37 .endm
35 38
36 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort 39 .macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S
index 12549187088c..5025c863713d 100644
--- a/arch/arm/lib/memmove.S
+++ b/arch/arm/lib/memmove.S
@@ -75,24 +75,24 @@ ENTRY(memmove)
75 addne pc, pc, ip @ C is always clear here 75 addne pc, pc, ip @ C is always clear here
76 b 7f 76 b 7f
776: nop 776: nop
78 ldr r3, [r1, #-4]! 78 W(ldr) r3, [r1, #-4]!
79 ldr r4, [r1, #-4]! 79 W(ldr) r4, [r1, #-4]!
80 ldr r5, [r1, #-4]! 80 W(ldr) r5, [r1, #-4]!
81 ldr r6, [r1, #-4]! 81 W(ldr) r6, [r1, #-4]!
82 ldr r7, [r1, #-4]! 82 W(ldr) r7, [r1, #-4]!
83 ldr r8, [r1, #-4]! 83 W(ldr) r8, [r1, #-4]!
84 ldr lr, [r1, #-4]! 84 W(ldr) lr, [r1, #-4]!
85 85
86 add pc, pc, ip 86 add pc, pc, ip
87 nop 87 nop
88 nop 88 nop
89 str r3, [r0, #-4]! 89 W(str) r3, [r0, #-4]!
90 str r4, [r0, #-4]! 90 W(str) r4, [r0, #-4]!
91 str r5, [r0, #-4]! 91 W(str) r5, [r0, #-4]!
92 str r6, [r0, #-4]! 92 W(str) r6, [r0, #-4]!
93 str r7, [r0, #-4]! 93 W(str) r7, [r0, #-4]!
94 str r8, [r0, #-4]! 94 W(str) r8, [r0, #-4]!
95 str lr, [r0, #-4]! 95 W(str) lr, [r0, #-4]!
96 96
97 CALGN( bcs 2b ) 97 CALGN( bcs 2b )
98 98
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S
index 864f3c1c4f18..02fedbf07c0d 100644
--- a/arch/arm/lib/putuser.S
+++ b/arch/arm/lib/putuser.S
@@ -37,6 +37,15 @@ ENDPROC(__put_user_1)
37 37
38ENTRY(__put_user_2) 38ENTRY(__put_user_2)
39 mov ip, r2, lsr #8 39 mov ip, r2, lsr #8
40#ifdef CONFIG_THUMB2_KERNEL
41#ifndef __ARMEB__
422: strbt r2, [r0]
433: strbt ip, [r0, #1]
44#else
452: strbt ip, [r0]
463: strbt r2, [r0, #1]
47#endif
48#else /* !CONFIG_THUMB2_KERNEL */
40#ifndef __ARMEB__ 49#ifndef __ARMEB__
412: strbt r2, [r0], #1 502: strbt r2, [r0], #1
423: strbt ip, [r0] 513: strbt ip, [r0]
@@ -44,6 +53,7 @@ ENTRY(__put_user_2)
442: strbt ip, [r0], #1 532: strbt ip, [r0], #1
453: strbt r2, [r0] 543: strbt r2, [r0]
46#endif 55#endif
56#endif /* CONFIG_THUMB2_KERNEL */
47 mov r0, #0 57 mov r0, #0
48 mov pc, lr 58 mov pc, lr
49ENDPROC(__put_user_2) 59ENDPROC(__put_user_2)
@@ -55,8 +65,13 @@ ENTRY(__put_user_4)
55ENDPROC(__put_user_4) 65ENDPROC(__put_user_4)
56 66
57ENTRY(__put_user_8) 67ENTRY(__put_user_8)
68#ifdef CONFIG_THUMB2_KERNEL
695: strt r2, [r0]
706: strt r3, [r0, #4]
71#else
585: strt r2, [r0], #4 725: strt r2, [r0], #4
596: strt r3, [r0] 736: strt r3, [r0]
74#endif
60 mov r0, #0 75 mov r0, #0
61 mov pc, lr 76 mov pc, lr
62ENDPROC(__put_user_8) 77ENDPROC(__put_user_8)
diff --git a/arch/arm/lib/sha1.S b/arch/arm/lib/sha1.S
index a16fb208c841..09b548cac1a4 100644
--- a/arch/arm/lib/sha1.S
+++ b/arch/arm/lib/sha1.S
@@ -187,6 +187,7 @@ ENTRY(sha_transform)
187 187
188ENDPROC(sha_transform) 188ENDPROC(sha_transform)
189 189
190 .align 2
190.L_sha_K: 191.L_sha_K:
191 .word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 192 .word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
192 193
@@ -195,6 +196,7 @@ ENDPROC(sha_transform)
195 * void sha_init(__u32 *buf) 196 * void sha_init(__u32 *buf)
196 */ 197 */
197 198
199 .align 2
198.L_sha_initial_digest: 200.L_sha_initial_digest:
199 .word 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 201 .word 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0
200 202
diff --git a/arch/arm/lib/strncpy_from_user.S b/arch/arm/lib/strncpy_from_user.S
index 330373c26dd9..1c9814f346c6 100644
--- a/arch/arm/lib/strncpy_from_user.S
+++ b/arch/arm/lib/strncpy_from_user.S
@@ -23,7 +23,7 @@
23ENTRY(__strncpy_from_user) 23ENTRY(__strncpy_from_user)
24 mov ip, r1 24 mov ip, r1
251: subs r2, r2, #1 251: subs r2, r2, #1
26USER( ldrplbt r3, [r1], #1) 26 ldrusr r3, r1, 1, pl
27 bmi 2f 27 bmi 2f
28 strb r3, [r0], #1 28 strb r3, [r0], #1
29 teq r3, #0 29 teq r3, #0
diff --git a/arch/arm/lib/strnlen_user.S b/arch/arm/lib/strnlen_user.S
index 90bb9d020836..7855b2906659 100644
--- a/arch/arm/lib/strnlen_user.S
+++ b/arch/arm/lib/strnlen_user.S
@@ -23,7 +23,7 @@
23ENTRY(__strnlen_user) 23ENTRY(__strnlen_user)
24 mov r2, r0 24 mov r2, r0
251: 251:
26USER( ldrbt r3, [r0], #1) 26 ldrusr r3, r0, 1
27 teq r3, #0 27 teq r3, #0
28 beq 2f 28 beq 2f
29 subs r1, r1, #1 29 subs r1, r1, #1
diff --git a/arch/arm/mach-at91/include/mach/at_hdmac.h b/arch/arm/mach-at91/include/mach/at_hdmac.h
new file mode 100644
index 000000000000..187cb58345c0
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at_hdmac.h
@@ -0,0 +1,102 @@
1/*
2 * Header file for the Atmel AHB DMA Controller driver
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#ifndef AT_HDMAC_H
12#define AT_HDMAC_H
13
14#include <linux/dmaengine.h>
15
16/**
17 * struct at_dma_platform_data - Controller configuration parameters
18 * @nr_channels: Number of channels supported by hardware (max 8)
19 * @cap_mask: dma_capability flags supported by the platform
20 */
21struct at_dma_platform_data {
22 unsigned int nr_channels;
23 dma_cap_mask_t cap_mask;
24};
25
26/**
27 * enum at_dma_slave_width - DMA slave register access width.
28 * @AT_DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses
29 * @AT_DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses
30 * @AT_DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses
31 */
32enum at_dma_slave_width {
33 AT_DMA_SLAVE_WIDTH_8BIT = 0,
34 AT_DMA_SLAVE_WIDTH_16BIT,
35 AT_DMA_SLAVE_WIDTH_32BIT,
36};
37
38/**
39 * struct at_dma_slave - Controller-specific information about a slave
40 * @dma_dev: required DMA master device
41 * @tx_reg: physical address of data register used for
42 * memory-to-peripheral transfers
43 * @rx_reg: physical address of data register used for
44 * peripheral-to-memory transfers
45 * @reg_width: peripheral register width
46 * @cfg: Platform-specific initializer for the CFG register
47 * @ctrla: Platform-specific initializer for the CTRLA register
48 */
49struct at_dma_slave {
50 struct device *dma_dev;
51 dma_addr_t tx_reg;
52 dma_addr_t rx_reg;
53 enum at_dma_slave_width reg_width;
54 u32 cfg;
55 u32 ctrla;
56};
57
58
59/* Platform-configurable bits in CFG */
60#define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */
61#define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */
62#define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */
63#define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */
64#define ATC_SRC_H2SEL_SW (0x0 << 9)
65#define ATC_SRC_H2SEL_HW (0x1 << 9)
66#define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */
67#define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */
68#define ATC_DST_H2SEL_SW (0x0 << 13)
69#define ATC_DST_H2SEL_HW (0x1 << 13)
70#define ATC_SOD (0x1 << 16) /* Stop On Done */
71#define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */
72#define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */
73#define ATC_LOCK_IF_L (0x1 << 22) /* Master Interface Arbiter Lock */
74#define ATC_LOCK_IF_L_CHUNK (0x0 << 22)
75#define ATC_LOCK_IF_L_BUFFER (0x1 << 22)
76#define ATC_AHB_PROT_MASK (0x7 << 24) /* AHB Protection */
77#define ATC_FIFOCFG_MASK (0x3 << 28) /* FIFO Request Configuration */
78#define ATC_FIFOCFG_LARGESTBURST (0x0 << 28)
79#define ATC_FIFOCFG_HALFFIFO (0x1 << 28)
80#define ATC_FIFOCFG_ENOUGHSPACE (0x2 << 28)
81
82/* Platform-configurable bits in CTRLA */
83#define ATC_SCSIZE_MASK (0x7 << 16) /* Source Chunk Transfer Size */
84#define ATC_SCSIZE_1 (0x0 << 16)
85#define ATC_SCSIZE_4 (0x1 << 16)
86#define ATC_SCSIZE_8 (0x2 << 16)
87#define ATC_SCSIZE_16 (0x3 << 16)
88#define ATC_SCSIZE_32 (0x4 << 16)
89#define ATC_SCSIZE_64 (0x5 << 16)
90#define ATC_SCSIZE_128 (0x6 << 16)
91#define ATC_SCSIZE_256 (0x7 << 16)
92#define ATC_DCSIZE_MASK (0x7 << 20) /* Destination Chunk Transfer Size */
93#define ATC_DCSIZE_1 (0x0 << 20)
94#define ATC_DCSIZE_4 (0x1 << 20)
95#define ATC_DCSIZE_8 (0x2 << 20)
96#define ATC_DCSIZE_16 (0x3 << 20)
97#define ATC_DCSIZE_32 (0x4 << 20)
98#define ATC_DCSIZE_64 (0x5 << 20)
99#define ATC_DCSIZE_128 (0x6 << 20)
100#define ATC_DCSIZE_256 (0x7 << 20)
101
102#endif /* AT_HDMAC_H */
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c
index a2df5bb7dff0..dbcac9c40a28 100644
--- a/arch/arm/mach-ep93xx/dma-m2p.c
+++ b/arch/arm/mach-ep93xx/dma-m2p.c
@@ -33,6 +33,7 @@
33#include <linux/err.h> 33#include <linux/err.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/io.h>
36 37
37#include <mach/dma.h> 38#include <mach/dma.h>
38#include <mach/hardware.h> 39#include <mach/hardware.h>
diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h
index 1251319ef9ae..d795642fad22 100644
--- a/arch/arm/mach-integrator/include/mach/hardware.h
+++ b/arch/arm/mach-integrator/include/mach/hardware.h
@@ -36,8 +36,12 @@
36#define PCIO_BASE PCI_IO_VADDR 36#define PCIO_BASE PCI_IO_VADDR
37#define PCIMEM_BASE PCI_MEMORY_VADDR 37#define PCIMEM_BASE PCI_MEMORY_VADDR
38 38
39#ifdef CONFIG_MMU
39/* macro to get at IO space when running virtually */ 40/* macro to get at IO space when running virtually */
40#define IO_ADDRESS(x) (((x) >> 4) + IO_BASE) 41#define IO_ADDRESS(x) (((x) >> 4) + IO_BASE)
42#else
43#define IO_ADDRESS(x) (x)
44#endif
41 45
42#define pcibios_assign_all_busses() 1 46#define pcibios_assign_all_busses() 1
43 47
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 69956cdae3c2..2a318eba1b07 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -49,14 +49,14 @@
49 49
50#define INTCP_PA_CLCD_BASE 0xc0000000 50#define INTCP_PA_CLCD_BASE 0xc0000000
51 51
52#define INTCP_VA_CIC_BASE 0xf1000040 52#define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + 0x40
53#define INTCP_VA_PIC_BASE 0xf1400000 53#define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
54#define INTCP_VA_SIC_BASE 0xfca00000 54#define INTCP_VA_SIC_BASE IO_ADDRESS(0xca000000)
55 55
56#define INTCP_PA_ETH_BASE 0xc8000000 56#define INTCP_PA_ETH_BASE 0xc8000000
57#define INTCP_ETH_SIZE 0x10 57#define INTCP_ETH_SIZE 0x10
58 58
59#define INTCP_VA_CTRL_BASE 0xfcb00000 59#define INTCP_VA_CTRL_BASE IO_ADDRESS(0xcb000000)
60#define INTCP_FLASHPROG 0x04 60#define INTCP_FLASHPROG 0x04
61#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) 61#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
62#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) 62#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
@@ -121,12 +121,12 @@ static struct map_desc intcp_io_desc[] __initdata = {
121 .length = SZ_4K, 121 .length = SZ_4K,
122 .type = MT_DEVICE 122 .type = MT_DEVICE
123 }, { 123 }, {
124 .virtual = 0xfca00000, 124 .virtual = IO_ADDRESS(0xca000000),
125 .pfn = __phys_to_pfn(0xca000000), 125 .pfn = __phys_to_pfn(0xca000000),
126 .length = SZ_4K, 126 .length = SZ_4K,
127 .type = MT_DEVICE 127 .type = MT_DEVICE
128 }, { 128 }, {
129 .virtual = 0xfcb00000, 129 .virtual = IO_ADDRESS(0xcb000000),
130 .pfn = __phys_to_pfn(0xcb000000), 130 .pfn = __phys_to_pfn(0xcb000000),
131 .length = SZ_4K, 131 .length = SZ_4K,
132 .type = MT_DEVICE 132 .type = MT_DEVICE
@@ -394,8 +394,8 @@ static struct platform_device *intcp_devs[] __initdata = {
394 */ 394 */
395static unsigned int mmc_status(struct device *dev) 395static unsigned int mmc_status(struct device *dev)
396{ 396{
397 unsigned int status = readl(0xfca00004); 397 unsigned int status = readl(IO_ADDRESS(0xca000000) + 4);
398 writel(8, 0xfcb00008); 398 writel(8, IO_ADDRESS(0xcb000000) + 8);
399 399
400 return status & 8; 400 return status & 8;
401} 401}
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 25100f7acf4c..0aca451b216d 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -38,6 +38,12 @@ config MACH_TS219
38 Say 'Y' here if you want your kernel to support the 38 Say 'Y' here if you want your kernel to support the
39 QNAP TS-119 and TS-219 Turbo NAS devices. 39 QNAP TS-119 and TS-219 Turbo NAS devices.
40 40
41config MACH_OPENRD_BASE
42 bool "Marvell OpenRD Base Board"
43 help
44 Say 'Y' here if you want your kernel to support the
45 Marvell OpenRD Base Board.
46
41endmenu 47endmenu
42 48
43endif 49endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 9dd680e964d6..80ab0ec90ee1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -6,5 +6,6 @@ obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o 6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
8obj-$(CONFIG_MACH_TS219) += ts219-setup.o 8obj-$(CONFIG_MACH_TS219) += ts219-setup.o
9obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o
9 10
10obj-$(CONFIG_CPU_IDLE) += cpuidle.o 11obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0f6919838011..0acb61f3c10b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -838,7 +838,8 @@ int __init kirkwood_find_tclk(void)
838 u32 dev, rev; 838 u32 dev, rev;
839 839
840 kirkwood_pcie_id(&dev, &rev); 840 kirkwood_pcie_id(&dev, &rev);
841 if (dev == MV88F6281_DEV_ID && rev == MV88F6281_REV_A0) 841 if (dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 ||
842 rev == MV88F6281_REV_A1))
842 return 200000000; 843 return 200000000;
843 844
844 return 166666667; 845 return 166666667;
@@ -872,6 +873,8 @@ static char * __init kirkwood_id(void)
872 return "MV88F6281-Z0"; 873 return "MV88F6281-Z0";
873 else if (rev == MV88F6281_REV_A0) 874 else if (rev == MV88F6281_REV_A0)
874 return "MV88F6281-A0"; 875 return "MV88F6281-A0";
876 else if (rev == MV88F6281_REV_A1)
877 return "MV88F6281-A1";
875 else 878 else
876 return "MV88F6281-Rev-Unsupported"; 879 return "MV88F6281-Rev-Unsupported";
877 } else if (dev == MV88F6192_DEV_ID) { 880 } else if (dev == MV88F6192_DEV_ID) {
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index 07af858814a0..54c132731d2d 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -101,6 +101,7 @@
101#define MV88F6281_DEV_ID 0x6281 101#define MV88F6281_DEV_ID 0x6281
102#define MV88F6281_REV_Z0 0 102#define MV88F6281_REV_Z0 0
103#define MV88F6281_REV_A0 2 103#define MV88F6281_REV_A0 2
104#define MV88F6281_REV_A1 3
104 105
105#define MV88F6192_DEV_ID 0x6192 106#define MV88F6192_DEV_ID 0x6192
106#define MV88F6192_REV_Z0 0 107#define MV88F6192_REV_Z0 0
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h
index e021a80c2caf..bc74278ed311 100644
--- a/arch/arm/mach-kirkwood/mpp.h
+++ b/arch/arm/mach-kirkwood/mpp.h
@@ -289,7 +289,7 @@
289 289
290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 ) 290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 )
291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 ) 291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 )
292#define MPP48_TDM_DTX MPP( 48. 0x2, 0, 1, 0, 0, 0, 1 ) 292#define MPP48_TDM_DTX MPP( 48, 0x2, 0, 1, 0, 0, 0, 1 )
293 293
294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 ) 294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 )
295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 ) 295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 )
diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
new file mode 100644
index 000000000000..947dfb8cd5b2
--- /dev/null
+++ b/arch/arm/mach-kirkwood/openrd_base-setup.c
@@ -0,0 +1,84 @@
1/*
2 * arch/arm/mach-kirkwood/openrd_base-setup.c
3 *
4 * Marvell OpenRD Base Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/partitions.h>
15#include <linux/ata_platform.h>
16#include <linux/mv643xx_eth.h>
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <mach/kirkwood.h>
20#include <plat/mvsdio.h>
21#include "common.h"
22#include "mpp.h"
23
24static struct mtd_partition openrd_base_nand_parts[] = {
25 {
26 .name = "u-boot",
27 .offset = 0,
28 .size = SZ_1M
29 }, {
30 .name = "uImage",
31 .offset = MTDPART_OFS_NXTBLK,
32 .size = SZ_4M
33 }, {
34 .name = "root",
35 .offset = MTDPART_OFS_NXTBLK,
36 .size = MTDPART_SIZ_FULL
37 },
38};
39
40static struct mv643xx_eth_platform_data openrd_base_ge00_data = {
41 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
42};
43
44static struct mv_sata_platform_data openrd_base_sata_data = {
45 .n_ports = 2,
46};
47
48static struct mvsdio_platform_data openrd_base_mvsdio_data = {
49 .gpio_card_detect = 29, /* MPP29 used as SD card detect */
50};
51
52static unsigned int openrd_base_mpp_config[] __initdata = {
53 MPP29_GPIO,
54 0
55};
56
57static void __init openrd_base_init(void)
58{
59 /*
60 * Basic setup. Needs to be called early.
61 */
62 kirkwood_init();
63 kirkwood_mpp_conf(openrd_base_mpp_config);
64
65 kirkwood_uart0_init();
66 kirkwood_nand_init(ARRAY_AND_SIZE(openrd_base_nand_parts), 25);
67
68 kirkwood_ehci_init();
69
70 kirkwood_ge00_init(&openrd_base_ge00_data);
71 kirkwood_sata_init(&openrd_base_sata_data);
72 kirkwood_sdio_init(&openrd_base_mvsdio_data);
73}
74
75MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
76 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
77 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
78 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
79 .boot_params = 0x00000100,
80 .init_machine = openrd_base_init,
81 .map_io = kirkwood_map_io,
82 .init_irq = kirkwood_init_irq,
83 .timer = &kirkwood_timer,
84MACHINE_END
diff --git a/arch/arm/mach-mx1/clock.c b/arch/arm/mach-mx1/clock.c
index 0d0f306851d0..d1b588519ad2 100644
--- a/arch/arm/mach-mx1/clock.c
+++ b/arch/arm/mach-mx1/clock.c
@@ -18,11 +18,14 @@
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/list.h>
21#include <linux/math64.h> 22#include <linux/math64.h>
22#include <linux/err.h> 23#include <linux/err.h>
23#include <linux/clk.h> 24#include <linux/clk.h>
24#include <linux/io.h> 25#include <linux/io.h>
25 26
27#include <asm/clkdev.h>
28
26#include <mach/clock.h> 29#include <mach/clock.h>
27#include <mach/hardware.h> 30#include <mach/hardware.h>
28#include <mach/common.h> 31#include <mach/common.h>
@@ -94,7 +97,6 @@ static unsigned long clk16m_get_rate(struct clk *clk)
94} 97}
95 98
96static struct clk clk16m = { 99static struct clk clk16m = {
97 .name = "CLK16M",
98 .get_rate = clk16m_get_rate, 100 .get_rate = clk16m_get_rate,
99 .enable = _clk_enable, 101 .enable = _clk_enable,
100 .enable_reg = CCM_CSCR, 102 .enable_reg = CCM_CSCR,
@@ -111,7 +113,6 @@ static unsigned long clk32_get_rate(struct clk *clk)
111} 113}
112 114
113static struct clk clk32 = { 115static struct clk clk32 = {
114 .name = "CLK32",
115 .get_rate = clk32_get_rate, 116 .get_rate = clk32_get_rate,
116}; 117};
117 118
@@ -121,7 +122,6 @@ static unsigned long clk32_premult_get_rate(struct clk *clk)
121} 122}
122 123
123static struct clk clk32_premult = { 124static struct clk clk32_premult = {
124 .name = "CLK32_premultiplier",
125 .parent = &clk32, 125 .parent = &clk32,
126 .get_rate = clk32_premult_get_rate, 126 .get_rate = clk32_premult_get_rate,
127}; 127};
@@ -156,7 +156,6 @@ static int prem_clk_set_parent(struct clk *clk, struct clk *parent)
156} 156}
157 157
158static struct clk prem_clk = { 158static struct clk prem_clk = {
159 .name = "prem_clk",
160 .set_parent = prem_clk_set_parent, 159 .set_parent = prem_clk_set_parent,
161}; 160};
162 161
@@ -167,7 +166,6 @@ static unsigned long system_clk_get_rate(struct clk *clk)
167} 166}
168 167
169static struct clk system_clk = { 168static struct clk system_clk = {
170 .name = "system_clk",
171 .parent = &prem_clk, 169 .parent = &prem_clk,
172 .get_rate = system_clk_get_rate, 170 .get_rate = system_clk_get_rate,
173}; 171};
@@ -179,7 +177,6 @@ static unsigned long mcu_clk_get_rate(struct clk *clk)
179} 177}
180 178
181static struct clk mcu_clk = { 179static struct clk mcu_clk = {
182 .name = "mcu_clk",
183 .parent = &clk32_premult, 180 .parent = &clk32_premult,
184 .get_rate = mcu_clk_get_rate, 181 .get_rate = mcu_clk_get_rate,
185}; 182};
@@ -195,7 +192,6 @@ static unsigned long fclk_get_rate(struct clk *clk)
195} 192}
196 193
197static struct clk fclk = { 194static struct clk fclk = {
198 .name = "fclk",
199 .parent = &mcu_clk, 195 .parent = &mcu_clk,
200 .get_rate = fclk_get_rate, 196 .get_rate = fclk_get_rate,
201}; 197};
@@ -238,7 +234,6 @@ static int hclk_set_rate(struct clk *clk, unsigned long rate)
238} 234}
239 235
240static struct clk hclk = { 236static struct clk hclk = {
241 .name = "hclk",
242 .parent = &system_clk, 237 .parent = &system_clk,
243 .get_rate = hclk_get_rate, 238 .get_rate = hclk_get_rate,
244 .round_rate = hclk_round_rate, 239 .round_rate = hclk_round_rate,
@@ -280,7 +275,6 @@ static int clk48m_set_rate(struct clk *clk, unsigned long rate)
280} 275}
281 276
282static struct clk clk48m = { 277static struct clk clk48m = {
283 .name = "CLK48M",
284 .parent = &system_clk, 278 .parent = &system_clk,
285 .get_rate = clk48m_get_rate, 279 .get_rate = clk48m_get_rate,
286 .round_rate = clk48m_round_rate, 280 .round_rate = clk48m_round_rate,
@@ -400,21 +394,18 @@ static int perclk3_set_rate(struct clk *clk, unsigned long rate)
400 394
401static struct clk perclk[] = { 395static struct clk perclk[] = {
402 { 396 {
403 .name = "perclk",
404 .id = 0, 397 .id = 0,
405 .parent = &system_clk, 398 .parent = &system_clk,
406 .get_rate = perclk1_get_rate, 399 .get_rate = perclk1_get_rate,
407 .round_rate = perclk1_round_rate, 400 .round_rate = perclk1_round_rate,
408 .set_rate = perclk1_set_rate, 401 .set_rate = perclk1_set_rate,
409 }, { 402 }, {
410 .name = "perclk",
411 .id = 1, 403 .id = 1,
412 .parent = &system_clk, 404 .parent = &system_clk,
413 .get_rate = perclk2_get_rate, 405 .get_rate = perclk2_get_rate,
414 .round_rate = perclk2_round_rate, 406 .round_rate = perclk2_round_rate,
415 .set_rate = perclk2_set_rate, 407 .set_rate = perclk2_set_rate,
416 }, { 408 }, {
417 .name = "perclk",
418 .id = 2, 409 .id = 2,
419 .parent = &system_clk, 410 .parent = &system_clk,
420 .get_rate = perclk3_get_rate, 411 .get_rate = perclk3_get_rate,
@@ -457,12 +448,10 @@ static int clko_set_parent(struct clk *clk, struct clk *parent)
457} 448}
458 449
459static struct clk clko_clk = { 450static struct clk clko_clk = {
460 .name = "clko_clk",
461 .set_parent = clko_set_parent, 451 .set_parent = clko_set_parent,
462}; 452};
463 453
464static struct clk dma_clk = { 454static struct clk dma_clk = {
465 .name = "dma",
466 .parent = &hclk, 455 .parent = &hclk,
467 .round_rate = _clk_parent_round_rate, 456 .round_rate = _clk_parent_round_rate,
468 .set_rate = _clk_parent_set_rate, 457 .set_rate = _clk_parent_set_rate,
@@ -473,7 +462,6 @@ static struct clk dma_clk = {
473}; 462};
474 463
475static struct clk csi_clk = { 464static struct clk csi_clk = {
476 .name = "csi_clk",
477 .parent = &hclk, 465 .parent = &hclk,
478 .round_rate = _clk_parent_round_rate, 466 .round_rate = _clk_parent_round_rate,
479 .set_rate = _clk_parent_set_rate, 467 .set_rate = _clk_parent_set_rate,
@@ -484,7 +472,6 @@ static struct clk csi_clk = {
484}; 472};
485 473
486static struct clk mma_clk = { 474static struct clk mma_clk = {
487 .name = "mma_clk",
488 .parent = &hclk, 475 .parent = &hclk,
489 .round_rate = _clk_parent_round_rate, 476 .round_rate = _clk_parent_round_rate,
490 .set_rate = _clk_parent_set_rate, 477 .set_rate = _clk_parent_set_rate,
@@ -495,7 +482,6 @@ static struct clk mma_clk = {
495}; 482};
496 483
497static struct clk usbd_clk = { 484static struct clk usbd_clk = {
498 .name = "usbd_clk",
499 .parent = &clk48m, 485 .parent = &clk48m,
500 .round_rate = _clk_parent_round_rate, 486 .round_rate = _clk_parent_round_rate,
501 .set_rate = _clk_parent_set_rate, 487 .set_rate = _clk_parent_set_rate,
@@ -506,99 +492,85 @@ static struct clk usbd_clk = {
506}; 492};
507 493
508static struct clk gpt_clk = { 494static struct clk gpt_clk = {
509 .name = "gpt_clk",
510 .parent = &perclk[0], 495 .parent = &perclk[0],
511 .round_rate = _clk_parent_round_rate, 496 .round_rate = _clk_parent_round_rate,
512 .set_rate = _clk_parent_set_rate, 497 .set_rate = _clk_parent_set_rate,
513}; 498};
514 499
515static struct clk uart_clk = { 500static struct clk uart_clk = {
516 .name = "uart",
517 .parent = &perclk[0], 501 .parent = &perclk[0],
518 .round_rate = _clk_parent_round_rate, 502 .round_rate = _clk_parent_round_rate,
519 .set_rate = _clk_parent_set_rate, 503 .set_rate = _clk_parent_set_rate,
520}; 504};
521 505
522static struct clk i2c_clk = { 506static struct clk i2c_clk = {
523 .name = "i2c_clk",
524 .parent = &hclk, 507 .parent = &hclk,
525 .round_rate = _clk_parent_round_rate, 508 .round_rate = _clk_parent_round_rate,
526 .set_rate = _clk_parent_set_rate, 509 .set_rate = _clk_parent_set_rate,
527}; 510};
528 511
529static struct clk spi_clk = { 512static struct clk spi_clk = {
530 .name = "spi_clk",
531 .parent = &perclk[1], 513 .parent = &perclk[1],
532 .round_rate = _clk_parent_round_rate, 514 .round_rate = _clk_parent_round_rate,
533 .set_rate = _clk_parent_set_rate, 515 .set_rate = _clk_parent_set_rate,
534}; 516};
535 517
536static struct clk sdhc_clk = { 518static struct clk sdhc_clk = {
537 .name = "sdhc_clk",
538 .parent = &perclk[1], 519 .parent = &perclk[1],
539 .round_rate = _clk_parent_round_rate, 520 .round_rate = _clk_parent_round_rate,
540 .set_rate = _clk_parent_set_rate, 521 .set_rate = _clk_parent_set_rate,
541}; 522};
542 523
543static struct clk lcdc_clk = { 524static struct clk lcdc_clk = {
544 .name = "lcdc_clk",
545 .parent = &perclk[1], 525 .parent = &perclk[1],
546 .round_rate = _clk_parent_round_rate, 526 .round_rate = _clk_parent_round_rate,
547 .set_rate = _clk_parent_set_rate, 527 .set_rate = _clk_parent_set_rate,
548}; 528};
549 529
550static struct clk mshc_clk = { 530static struct clk mshc_clk = {
551 .name = "mshc_clk",
552 .parent = &hclk, 531 .parent = &hclk,
553 .round_rate = _clk_parent_round_rate, 532 .round_rate = _clk_parent_round_rate,
554 .set_rate = _clk_parent_set_rate, 533 .set_rate = _clk_parent_set_rate,
555}; 534};
556 535
557static struct clk ssi_clk = { 536static struct clk ssi_clk = {
558 .name = "ssi_clk",
559 .parent = &perclk[2], 537 .parent = &perclk[2],
560 .round_rate = _clk_parent_round_rate, 538 .round_rate = _clk_parent_round_rate,
561 .set_rate = _clk_parent_set_rate, 539 .set_rate = _clk_parent_set_rate,
562}; 540};
563 541
564static struct clk rtc_clk = { 542static struct clk rtc_clk = {
565 .name = "rtc_clk",
566 .parent = &clk32, 543 .parent = &clk32,
567}; 544};
568 545
569static struct clk *mxc_clks[] = { 546#define _REGISTER_CLOCK(d, n, c) \
570 &clk16m, 547 { \
571 &clk32, 548 .dev_id = d, \
572 &clk32_premult, 549 .con_id = n, \
573 &prem_clk, 550 .clk = &c, \
574 &system_clk, 551 },
575 &mcu_clk, 552static struct clk_lookup lookups[] __initdata = {
576 &fclk, 553 _REGISTER_CLOCK(NULL, "dma", dma_clk)
577 &hclk, 554 _REGISTER_CLOCK("mx1-camera.0", NULL, csi_clk)
578 &clk48m, 555 _REGISTER_CLOCK(NULL, "mma", mma_clk)
579 &perclk[0], 556 _REGISTER_CLOCK("imx_udc.0", NULL, usbd_clk)
580 &perclk[1], 557 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
581 &perclk[2], 558 _REGISTER_CLOCK("imx-uart.0", NULL, uart_clk)
582 &clko_clk, 559 _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk)
583 &dma_clk, 560 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk)
584 &csi_clk, 561 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
585 &mma_clk, 562 _REGISTER_CLOCK("spi_imx.0", NULL, spi_clk)
586 &usbd_clk, 563 _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk)
587 &gpt_clk, 564 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
588 &uart_clk, 565 _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
589 &i2c_clk, 566 _REGISTER_CLOCK(NULL, "ssi", ssi_clk)
590 &spi_clk, 567 _REGISTER_CLOCK("mxc_rtc.0", NULL, rtc_clk)
591 &sdhc_clk,
592 &lcdc_clk,
593 &mshc_clk,
594 &ssi_clk,
595 &rtc_clk,
596}; 568};
597 569
598int __init mx1_clocks_init(unsigned long fref) 570int __init mx1_clocks_init(unsigned long fref)
599{ 571{
600 struct clk **clkp;
601 unsigned int reg; 572 unsigned int reg;
573 int i;
602 574
603 /* disable clocks we are able to */ 575 /* disable clocks we are able to */
604 __raw_writel(0, SCM_GCCR); 576 __raw_writel(0, SCM_GCCR);
@@ -620,13 +592,13 @@ int __init mx1_clocks_init(unsigned long fref)
620 reg = (reg & CCM_CSCR_CLKO_MASK) >> CCM_CSCR_CLKO_OFFSET; 592 reg = (reg & CCM_CSCR_CLKO_MASK) >> CCM_CSCR_CLKO_OFFSET;
621 clko_clk.parent = (struct clk *)clko_clocks[reg]; 593 clko_clk.parent = (struct clk *)clko_clocks[reg];
622 594
623 for (clkp = mxc_clks; clkp < mxc_clks + ARRAY_SIZE(mxc_clks); clkp++) 595 for (i = 0; i < ARRAY_SIZE(lookups); i++)
624 clk_register(*clkp); 596 clkdev_add(&lookups[i]);
625 597
626 clk_enable(&hclk); 598 clk_enable(&hclk);
627 clk_enable(&fclk); 599 clk_enable(&fclk);
628 600
629 mxc_timer_init(&gpt_clk); 601 mxc_timer_init(&gpt_clk, IO_ADDRESS(TIM1_BASE_ADDR), TIM1_INT);
630 602
631 return 0; 603 return 0;
632} 604}
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c
index 76d1ffb48079..b6be29d1cb08 100644
--- a/arch/arm/mach-mx1/devices.c
+++ b/arch/arm/mach-mx1/devices.c
@@ -29,12 +29,11 @@
29#include "devices.h" 29#include "devices.h"
30 30
31static struct resource imx_csi_resources[] = { 31static struct resource imx_csi_resources[] = {
32 [0] = { 32 {
33 .start = 0x00224000, 33 .start = 0x00224000,
34 .end = 0x00224010, 34 .end = 0x00224010,
35 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
36 }, 36 }, {
37 [1] = {
38 .start = CSI_INT, 37 .start = CSI_INT,
39 .end = CSI_INT, 38 .end = CSI_INT,
40 .flags = IORESOURCE_IRQ, 39 .flags = IORESOURCE_IRQ,
@@ -55,12 +54,11 @@ struct platform_device imx_csi_device = {
55}; 54};
56 55
57static struct resource imx_i2c_resources[] = { 56static struct resource imx_i2c_resources[] = {
58 [0] = { 57 {
59 .start = 0x00217000, 58 .start = 0x00217000,
60 .end = 0x00217010, 59 .end = 0x00217010,
61 .flags = IORESOURCE_MEM, 60 .flags = IORESOURCE_MEM,
62 }, 61 }, {
63 [1] = {
64 .start = I2C_INT, 62 .start = I2C_INT,
65 .end = I2C_INT, 63 .end = I2C_INT,
66 .flags = IORESOURCE_IRQ, 64 .flags = IORESOURCE_IRQ,
@@ -75,22 +73,19 @@ struct platform_device imx_i2c_device = {
75}; 73};
76 74
77static struct resource imx_uart1_resources[] = { 75static struct resource imx_uart1_resources[] = {
78 [0] = { 76 {
79 .start = UART1_BASE_ADDR, 77 .start = UART1_BASE_ADDR,
80 .end = UART1_BASE_ADDR + 0xD0, 78 .end = UART1_BASE_ADDR + 0xD0,
81 .flags = IORESOURCE_MEM, 79 .flags = IORESOURCE_MEM,
82 }, 80 }, {
83 [1] = {
84 .start = UART1_MINT_RX, 81 .start = UART1_MINT_RX,
85 .end = UART1_MINT_RX, 82 .end = UART1_MINT_RX,
86 .flags = IORESOURCE_IRQ, 83 .flags = IORESOURCE_IRQ,
87 }, 84 }, {
88 [2] = {
89 .start = UART1_MINT_TX, 85 .start = UART1_MINT_TX,
90 .end = UART1_MINT_TX, 86 .end = UART1_MINT_TX,
91 .flags = IORESOURCE_IRQ, 87 .flags = IORESOURCE_IRQ,
92 }, 88 }, {
93 [3] = {
94 .start = UART1_MINT_RTS, 89 .start = UART1_MINT_RTS,
95 .end = UART1_MINT_RTS, 90 .end = UART1_MINT_RTS,
96 .flags = IORESOURCE_IRQ, 91 .flags = IORESOURCE_IRQ,
@@ -105,22 +100,19 @@ struct platform_device imx_uart1_device = {
105}; 100};
106 101
107static struct resource imx_uart2_resources[] = { 102static struct resource imx_uart2_resources[] = {
108 [0] = { 103 {
109 .start = UART2_BASE_ADDR, 104 .start = UART2_BASE_ADDR,
110 .end = UART2_BASE_ADDR + 0xD0, 105 .end = UART2_BASE_ADDR + 0xD0,
111 .flags = IORESOURCE_MEM, 106 .flags = IORESOURCE_MEM,
112 }, 107 }, {
113 [1] = {
114 .start = UART2_MINT_RX, 108 .start = UART2_MINT_RX,
115 .end = UART2_MINT_RX, 109 .end = UART2_MINT_RX,
116 .flags = IORESOURCE_IRQ, 110 .flags = IORESOURCE_IRQ,
117 }, 111 }, {
118 [2] = {
119 .start = UART2_MINT_TX, 112 .start = UART2_MINT_TX,
120 .end = UART2_MINT_TX, 113 .end = UART2_MINT_TX,
121 .flags = IORESOURCE_IRQ, 114 .flags = IORESOURCE_IRQ,
122 }, 115 }, {
123 [3] = {
124 .start = UART2_MINT_RTS, 116 .start = UART2_MINT_RTS,
125 .end = UART2_MINT_RTS, 117 .end = UART2_MINT_RTS,
126 .flags = IORESOURCE_IRQ, 118 .flags = IORESOURCE_IRQ,
@@ -135,17 +127,15 @@ struct platform_device imx_uart2_device = {
135}; 127};
136 128
137static struct resource imx_rtc_resources[] = { 129static struct resource imx_rtc_resources[] = {
138 [0] = { 130 {
139 .start = 0x00204000, 131 .start = 0x00204000,
140 .end = 0x00204024, 132 .end = 0x00204024,
141 .flags = IORESOURCE_MEM, 133 .flags = IORESOURCE_MEM,
142 }, 134 }, {
143 [1] = {
144 .start = RTC_INT, 135 .start = RTC_INT,
145 .end = RTC_INT, 136 .end = RTC_INT,
146 .flags = IORESOURCE_IRQ, 137 .flags = IORESOURCE_IRQ,
147 }, 138 }, {
148 [2] = {
149 .start = RTC_SAMINT, 139 .start = RTC_SAMINT,
150 .end = RTC_SAMINT, 140 .end = RTC_SAMINT,
151 .flags = IORESOURCE_IRQ, 141 .flags = IORESOURCE_IRQ,
@@ -160,12 +150,11 @@ struct platform_device imx_rtc_device = {
160}; 150};
161 151
162static struct resource imx_wdt_resources[] = { 152static struct resource imx_wdt_resources[] = {
163 [0] = { 153 {
164 .start = 0x00201000, 154 .start = 0x00201000,
165 .end = 0x00201008, 155 .end = 0x00201008,
166 .flags = IORESOURCE_MEM, 156 .flags = IORESOURCE_MEM,
167 }, 157 }, {
168 [1] = {
169 .start = WDT_INT, 158 .start = WDT_INT,
170 .end = WDT_INT, 159 .end = WDT_INT,
171 .flags = IORESOURCE_IRQ, 160 .flags = IORESOURCE_IRQ,
@@ -180,42 +169,35 @@ struct platform_device imx_wdt_device = {
180}; 169};
181 170
182static struct resource imx_usb_resources[] = { 171static struct resource imx_usb_resources[] = {
183 [0] = { 172 {
184 .start = 0x00212000, 173 .start = 0x00212000,
185 .end = 0x00212148, 174 .end = 0x00212148,
186 .flags = IORESOURCE_MEM, 175 .flags = IORESOURCE_MEM,
187 }, 176 }, {
188 [1] = {
189 .start = USBD_INT0, 177 .start = USBD_INT0,
190 .end = USBD_INT0, 178 .end = USBD_INT0,
191 .flags = IORESOURCE_IRQ, 179 .flags = IORESOURCE_IRQ,
192 }, 180 }, {
193 [2] = {
194 .start = USBD_INT1, 181 .start = USBD_INT1,
195 .end = USBD_INT1, 182 .end = USBD_INT1,
196 .flags = IORESOURCE_IRQ, 183 .flags = IORESOURCE_IRQ,
197 }, 184 }, {
198 [3] = {
199 .start = USBD_INT2, 185 .start = USBD_INT2,
200 .end = USBD_INT2, 186 .end = USBD_INT2,
201 .flags = IORESOURCE_IRQ, 187 .flags = IORESOURCE_IRQ,
202 }, 188 }, {
203 [4] = {
204 .start = USBD_INT3, 189 .start = USBD_INT3,
205 .end = USBD_INT3, 190 .end = USBD_INT3,
206 .flags = IORESOURCE_IRQ, 191 .flags = IORESOURCE_IRQ,
207 }, 192 }, {
208 [5] = {
209 .start = USBD_INT4, 193 .start = USBD_INT4,
210 .end = USBD_INT4, 194 .end = USBD_INT4,
211 .flags = IORESOURCE_IRQ, 195 .flags = IORESOURCE_IRQ,
212 }, 196 }, {
213 [6] = {
214 .start = USBD_INT5, 197 .start = USBD_INT5,
215 .end = USBD_INT5, 198 .end = USBD_INT5,
216 .flags = IORESOURCE_IRQ, 199 .flags = IORESOURCE_IRQ,
217 }, 200 }, {
218 [7] = {
219 .start = USBD_INT6, 201 .start = USBD_INT6,
220 .end = USBD_INT6, 202 .end = USBD_INT6,
221 .flags = IORESOURCE_IRQ, 203 .flags = IORESOURCE_IRQ,
@@ -231,29 +213,26 @@ struct platform_device imx_usb_device = {
231 213
232/* GPIO port description */ 214/* GPIO port description */
233static struct mxc_gpio_port imx_gpio_ports[] = { 215static struct mxc_gpio_port imx_gpio_ports[] = {
234 [0] = { 216 {
235 .chip.label = "gpio-0", 217 .chip.label = "gpio-0",
236 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR), 218 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR),
237 .irq = GPIO_INT_PORTA, 219 .irq = GPIO_INT_PORTA,
238 .virtual_irq_start = MXC_GPIO_IRQ_START 220 .virtual_irq_start = MXC_GPIO_IRQ_START,
239 }, 221 }, {
240 [1] = {
241 .chip.label = "gpio-1", 222 .chip.label = "gpio-1",
242 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100), 223 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
243 .irq = GPIO_INT_PORTB, 224 .irq = GPIO_INT_PORTB,
244 .virtual_irq_start = MXC_GPIO_IRQ_START + 32 225 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
245 }, 226 }, {
246 [2] = {
247 .chip.label = "gpio-2", 227 .chip.label = "gpio-2",
248 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200), 228 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
249 .irq = GPIO_INT_PORTC, 229 .irq = GPIO_INT_PORTC,
250 .virtual_irq_start = MXC_GPIO_IRQ_START + 64 230 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
251 }, 231 }, {
252 [3] = {
253 .chip.label = "gpio-3", 232 .chip.label = "gpio-3",
254 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300), 233 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
255 .irq = GPIO_INT_PORTD, 234 .irq = GPIO_INT_PORTD,
256 .virtual_irq_start = MXC_GPIO_IRQ_START + 96 235 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
257 } 236 }
258}; 237};
259 238
diff --git a/arch/arm/mach-mx1/generic.c b/arch/arm/mach-mx1/generic.c
index 7622c9b38c97..7f9fc1034c08 100644
--- a/arch/arm/mach-mx1/generic.c
+++ b/arch/arm/mach-mx1/generic.c
@@ -41,6 +41,13 @@ static struct map_desc imx_io_desc[] __initdata = {
41void __init mx1_map_io(void) 41void __init mx1_map_io(void)
42{ 42{
43 mxc_set_cpu_type(MXC_CPU_MX1); 43 mxc_set_cpu_type(MXC_CPU_MX1);
44 mxc_arch_reset_init(IO_ADDRESS(WDT_BASE_ADDR));
44 45
45 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc)); 46 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
46} 47}
48
49void __init mx1_init_irq(void)
50{
51 mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR));
52}
53
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c
index e5b0c0a83c3b..30f04e56fafe 100644
--- a/arch/arm/mach-mx1/mx1ads.c
+++ b/arch/arm/mach-mx1/mx1ads.c
@@ -104,12 +104,10 @@ static struct imxi2c_platform_data mx1ads_i2c_data = {
104 104
105static struct i2c_board_info mx1ads_i2c_devices[] = { 105static struct i2c_board_info mx1ads_i2c_devices[] = {
106 { 106 {
107 I2C_BOARD_INFO("pcf857x", 0x22), 107 I2C_BOARD_INFO("pcf8575", 0x22),
108 .type = "pcf8575",
109 .platform_data = &pcf857x_data[0], 108 .platform_data = &pcf857x_data[0],
110 }, { 109 }, {
111 I2C_BOARD_INFO("pcf857x", 0x24), 110 I2C_BOARD_INFO("pcf8575", 0x24),
112 .type = "pcf8575",
113 .platform_data = &pcf857x_data[1], 111 .platform_data = &pcf857x_data[1],
114 }, 112 },
115}; 113};
@@ -151,7 +149,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
151 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, 149 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
152 .boot_params = PHYS_OFFSET + 0x100, 150 .boot_params = PHYS_OFFSET + 0x100,
153 .map_io = mx1_map_io, 151 .map_io = mx1_map_io,
154 .init_irq = mxc_init_irq, 152 .init_irq = mx1_init_irq,
155 .timer = &mx1ads_timer, 153 .timer = &mx1ads_timer,
156 .init_machine = mx1ads_init, 154 .init_machine = mx1ads_init,
157MACHINE_END 155MACHINE_END
@@ -161,7 +159,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS")
161 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, 159 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
162 .boot_params = PHYS_OFFSET + 0x100, 160 .boot_params = PHYS_OFFSET + 0x100,
163 .map_io = mx1_map_io, 161 .map_io = mx1_map_io,
164 .init_irq = mxc_init_irq, 162 .init_irq = mx1_init_irq,
165 .timer = &mx1ads_timer, 163 .timer = &mx1ads_timer,
166 .init_machine = mx1ads_init, 164 .init_machine = mx1ads_init,
167MACHINE_END 165MACHINE_END
diff --git a/arch/arm/mach-mx1/scb9328.c b/arch/arm/mach-mx1/scb9328.c
index 20e0b5bcdffc..325d98df6053 100644
--- a/arch/arm/mach-mx1/scb9328.c
+++ b/arch/arm/mach-mx1/scb9328.c
@@ -68,22 +68,20 @@ static struct dm9000_plat_data dm9000_platdata = {
68 * to gain access to address latch registers and the data path. 68 * to gain access to address latch registers and the data path.
69 */ 69 */
70static struct resource dm9000x_resources[] = { 70static struct resource dm9000x_resources[] = {
71 [0] = { 71 {
72 .name = "address area", 72 .name = "address area",
73 .start = IMX_CS5_PHYS, 73 .start = IMX_CS5_PHYS,
74 .end = IMX_CS5_PHYS + 1, 74 .end = IMX_CS5_PHYS + 1,
75 .flags = IORESOURCE_MEM /* address access */ 75 .flags = IORESOURCE_MEM, /* address access */
76 }, 76 }, {
77 [1] = {
78 .name = "data area", 77 .name = "data area",
79 .start = IMX_CS5_PHYS + 4, 78 .start = IMX_CS5_PHYS + 4,
80 .end = IMX_CS5_PHYS + 5, 79 .end = IMX_CS5_PHYS + 5,
81 .flags = IORESOURCE_MEM /* data access */ 80 .flags = IORESOURCE_MEM, /* data access */
82 }, 81 }, {
83 [2] = {
84 .start = IRQ_GPIOC(3), 82 .start = IRQ_GPIOC(3),
85 .end = IRQ_GPIOC(3), 83 .end = IRQ_GPIOC(3),
86 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL 84 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
87 }, 85 },
88}; 86};
89 87
@@ -154,7 +152,7 @@ MACHINE_START(SCB9328, "Synertronixx scb9328")
154 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, 152 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
155 .boot_params = 0x08000100, 153 .boot_params = 0x08000100,
156 .map_io = mx1_map_io, 154 .map_io = mx1_map_io,
157 .init_irq = mxc_init_irq, 155 .init_irq = mx1_init_irq,
158 .timer = &scb9328_timer, 156 .timer = &scb9328_timer,
159 .init_machine = scb9328_init, 157 .init_machine = scb9328_init,
160MACHINE_END 158MACHINE_END
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index c77da586b71d..c8a2eac4d13c 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -53,6 +53,34 @@ config MACH_PCM970_BASEBOARD
53 53
54endchoice 54endchoice
55 55
56config MACH_EUKREA_CPUIMX27
57 bool "Eukrea CPUIMX27 module"
58 depends on MACH_MX27
59 help
60 Include support for Eukrea CPUIMX27 platform. This includes
61 specific configurations for the module and its peripherals.
62
63config MACH_EUKREA_CPUIMX27_USESDHC2
64 bool "CPUIMX27 integrates SDHC2 module"
65 depends on MACH_EUKREA_CPUIMX27
66 help
67 This adds support for the internal SDHC2 used on CPUIMX27 used
68 for wifi or eMMC.
69
70choice
71 prompt "Baseboard"
72 depends on MACH_EUKREA_CPUIMX27
73 default MACH_EUKREA_MBIMX27_BASEBOARD
74
75config MACH_EUKREA_MBIMX27_BASEBOARD
76 prompt "Eukrea MBIMX27 development board"
77 bool
78 help
79 This adds board specific devices that can be found on Eukrea's
80 MBIMX27 evaluation board.
81
82endchoice
83
56config MACH_MX27_3DS 84config MACH_MX27_3DS
57 bool "MX27PDK platform" 85 bool "MX27PDK platform"
58 depends on MACH_MX27 86 depends on MACH_MX27
@@ -67,4 +95,11 @@ config MACH_MX27LITE
67 Include support for MX27 LITEKIT platform. This includes specific 95 Include support for MX27 LITEKIT platform. This includes specific
68 configurations for the board and its peripherals. 96 configurations for the board and its peripherals.
69 97
98config MACH_PCA100
99 bool "Phytec phyCARD-s (pca100)"
100 depends on MACH_MX27
101 help
102 Include support for phyCARD-s (aka pca100) platform. This
103 includes specific configurations for the module and its peripherals.
104
70endif 105endif
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index b9b1cca4e9bc..19560f045632 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -17,4 +17,7 @@ obj-$(CONFIG_MACH_PCM038) += pcm038.o
17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o 17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
18obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o 18obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o
19obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o 19obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o
20obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27.o
21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
22obj-$(CONFIG_MACH_PCA100) += pca100.o
20 23
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index 0850fb88ec15..eede79855f4a 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -1004,6 +1004,6 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
1004 clk_enable(&uart_clk[0]); 1004 clk_enable(&uart_clk[0]);
1005#endif 1005#endif
1006 1006
1007 mxc_timer_init(&gpt_clk[0]); 1007 mxc_timer_init(&gpt_clk[0], IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT1);
1008 return 0; 1008 return 0;
1009} 1009}
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index 2c971442f3f2..4089951acb47 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -643,7 +643,14 @@ static struct clk_lookup lookups[] = {
643 _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk) 643 _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk)
644 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) 644 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
645 _REGISTER_CLOCK(NULL, "csi", csi_clk) 645 _REGISTER_CLOCK(NULL, "csi", csi_clk)
646 _REGISTER_CLOCK(NULL, "usb", usb_clk) 646 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk)
647 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk1)
648 _REGISTER_CLOCK("mxc-ehci.0", "usb", usb_clk)
649 _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", usb_clk1)
650 _REGISTER_CLOCK("mxc-ehci.1", "usb", usb_clk)
651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1)
652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk)
653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1)
647 _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) 654 _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk)
648 _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) 655 _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk)
649 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
@@ -748,7 +755,7 @@ int __init mx27_clocks_init(unsigned long fref)
748 clk_enable(&uart1_clk); 755 clk_enable(&uart1_clk);
749#endif 756#endif
750 757
751 mxc_timer_init(&gpt1_clk); 758 mxc_timer_init(&gpt1_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT1);
752 759
753 return 0; 760 return 0;
754} 761}
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index a0f1b3674327..50199aff0143 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -40,45 +40,87 @@
40#include "devices.h" 40#include "devices.h"
41 41
42/* 42/*
43 * Resource definition for the MXC IrDA 43 * SPI master controller
44 *
45 * - i.MX1: 2 channel (slighly different register setting)
46 * - i.MX21: 2 channel
47 * - i.MX27: 3 channel
44 */ 48 */
45static struct resource mxc_irda_resources[] = { 49static struct resource mxc_spi_resources0[] = {
46 [0] = { 50 {
47 .start = UART3_BASE_ADDR, 51 .start = CSPI1_BASE_ADDR,
48 .end = UART3_BASE_ADDR + SZ_4K - 1, 52 .end = CSPI1_BASE_ADDR + SZ_4K - 1,
49 .flags = IORESOURCE_MEM, 53 .flags = IORESOURCE_MEM,
54 }, {
55 .start = MXC_INT_CSPI1,
56 .end = MXC_INT_CSPI1,
57 .flags = IORESOURCE_IRQ,
50 }, 58 },
51 [1] = { 59};
52 .start = MXC_INT_UART3, 60
53 .end = MXC_INT_UART3, 61static struct resource mxc_spi_resources1[] = {
54 .flags = IORESOURCE_IRQ, 62 {
63 .start = CSPI2_BASE_ADDR,
64 .end = CSPI2_BASE_ADDR + SZ_4K - 1,
65 .flags = IORESOURCE_MEM,
66 }, {
67 .start = MXC_INT_CSPI2,
68 .end = MXC_INT_CSPI2,
69 .flags = IORESOURCE_IRQ,
55 }, 70 },
56}; 71};
57 72
58/* Platform Data for MXC IrDA */ 73#ifdef CONFIG_MACH_MX27
59struct platform_device mxc_irda_device = { 74static struct resource mxc_spi_resources2[] = {
60 .name = "mxc_irda", 75 {
76 .start = CSPI3_BASE_ADDR,
77 .end = CSPI3_BASE_ADDR + SZ_4K - 1,
78 .flags = IORESOURCE_MEM,
79 }, {
80 .start = MXC_INT_CSPI3,
81 .end = MXC_INT_CSPI3,
82 .flags = IORESOURCE_IRQ,
83 },
84};
85#endif
86
87struct platform_device mxc_spi_device0 = {
88 .name = "spi_imx",
61 .id = 0, 89 .id = 0,
62 .num_resources = ARRAY_SIZE(mxc_irda_resources), 90 .num_resources = ARRAY_SIZE(mxc_spi_resources0),
63 .resource = mxc_irda_resources, 91 .resource = mxc_spi_resources0,
92};
93
94struct platform_device mxc_spi_device1 = {
95 .name = "spi_imx",
96 .id = 1,
97 .num_resources = ARRAY_SIZE(mxc_spi_resources1),
98 .resource = mxc_spi_resources1,
99};
100
101#ifdef CONFIG_MACH_MX27
102struct platform_device mxc_spi_device2 = {
103 .name = "spi_imx",
104 .id = 2,
105 .num_resources = ARRAY_SIZE(mxc_spi_resources2),
106 .resource = mxc_spi_resources2,
64}; 107};
108#endif
65 109
66/* 110/*
67 * General Purpose Timer 111 * General Purpose Timer
68 * - i.MX1: 2 timer (slighly different register handling) 112 * - i.MX21: 3 timers
69 * - i.MX21: 3 timer 113 * - i.MX27: 6 timers
70 * - i.MX27: 6 timer
71 */ 114 */
72 115
73/* We use gpt0 as system timer, so do not add a device for this one */ 116/* We use gpt0 as system timer, so do not add a device for this one */
74 117
75static struct resource timer1_resources[] = { 118static struct resource timer1_resources[] = {
76 [0] = { 119 {
77 .start = GPT2_BASE_ADDR, 120 .start = GPT2_BASE_ADDR,
78 .end = GPT2_BASE_ADDR + 0x17, 121 .end = GPT2_BASE_ADDR + 0x17,
79 .flags = IORESOURCE_MEM 122 .flags = IORESOURCE_MEM,
80 }, 123 }, {
81 [1] = {
82 .start = MXC_INT_GPT2, 124 .start = MXC_INT_GPT2,
83 .end = MXC_INT_GPT2, 125 .end = MXC_INT_GPT2,
84 .flags = IORESOURCE_IRQ, 126 .flags = IORESOURCE_IRQ,
@@ -89,16 +131,15 @@ struct platform_device mxc_gpt1 = {
89 .name = "imx_gpt", 131 .name = "imx_gpt",
90 .id = 1, 132 .id = 1,
91 .num_resources = ARRAY_SIZE(timer1_resources), 133 .num_resources = ARRAY_SIZE(timer1_resources),
92 .resource = timer1_resources 134 .resource = timer1_resources,
93}; 135};
94 136
95static struct resource timer2_resources[] = { 137static struct resource timer2_resources[] = {
96 [0] = { 138 {
97 .start = GPT3_BASE_ADDR, 139 .start = GPT3_BASE_ADDR,
98 .end = GPT3_BASE_ADDR + 0x17, 140 .end = GPT3_BASE_ADDR + 0x17,
99 .flags = IORESOURCE_MEM 141 .flags = IORESOURCE_MEM,
100 }, 142 }, {
101 [1] = {
102 .start = MXC_INT_GPT3, 143 .start = MXC_INT_GPT3,
103 .end = MXC_INT_GPT3, 144 .end = MXC_INT_GPT3,
104 .flags = IORESOURCE_IRQ, 145 .flags = IORESOURCE_IRQ,
@@ -109,17 +150,16 @@ struct platform_device mxc_gpt2 = {
109 .name = "imx_gpt", 150 .name = "imx_gpt",
110 .id = 2, 151 .id = 2,
111 .num_resources = ARRAY_SIZE(timer2_resources), 152 .num_resources = ARRAY_SIZE(timer2_resources),
112 .resource = timer2_resources 153 .resource = timer2_resources,
113}; 154};
114 155
115#ifdef CONFIG_MACH_MX27 156#ifdef CONFIG_MACH_MX27
116static struct resource timer3_resources[] = { 157static struct resource timer3_resources[] = {
117 [0] = { 158 {
118 .start = GPT4_BASE_ADDR, 159 .start = GPT4_BASE_ADDR,
119 .end = GPT4_BASE_ADDR + 0x17, 160 .end = GPT4_BASE_ADDR + 0x17,
120 .flags = IORESOURCE_MEM 161 .flags = IORESOURCE_MEM,
121 }, 162 }, {
122 [1] = {
123 .start = MXC_INT_GPT4, 163 .start = MXC_INT_GPT4,
124 .end = MXC_INT_GPT4, 164 .end = MXC_INT_GPT4,
125 .flags = IORESOURCE_IRQ, 165 .flags = IORESOURCE_IRQ,
@@ -130,16 +170,15 @@ struct platform_device mxc_gpt3 = {
130 .name = "imx_gpt", 170 .name = "imx_gpt",
131 .id = 3, 171 .id = 3,
132 .num_resources = ARRAY_SIZE(timer3_resources), 172 .num_resources = ARRAY_SIZE(timer3_resources),
133 .resource = timer3_resources 173 .resource = timer3_resources,
134}; 174};
135 175
136static struct resource timer4_resources[] = { 176static struct resource timer4_resources[] = {
137 [0] = { 177 {
138 .start = GPT5_BASE_ADDR, 178 .start = GPT5_BASE_ADDR,
139 .end = GPT5_BASE_ADDR + 0x17, 179 .end = GPT5_BASE_ADDR + 0x17,
140 .flags = IORESOURCE_MEM 180 .flags = IORESOURCE_MEM,
141 }, 181 }, {
142 [1] = {
143 .start = MXC_INT_GPT5, 182 .start = MXC_INT_GPT5,
144 .end = MXC_INT_GPT5, 183 .end = MXC_INT_GPT5,
145 .flags = IORESOURCE_IRQ, 184 .flags = IORESOURCE_IRQ,
@@ -150,16 +189,15 @@ struct platform_device mxc_gpt4 = {
150 .name = "imx_gpt", 189 .name = "imx_gpt",
151 .id = 4, 190 .id = 4,
152 .num_resources = ARRAY_SIZE(timer4_resources), 191 .num_resources = ARRAY_SIZE(timer4_resources),
153 .resource = timer4_resources 192 .resource = timer4_resources,
154}; 193};
155 194
156static struct resource timer5_resources[] = { 195static struct resource timer5_resources[] = {
157 [0] = { 196 {
158 .start = GPT6_BASE_ADDR, 197 .start = GPT6_BASE_ADDR,
159 .end = GPT6_BASE_ADDR + 0x17, 198 .end = GPT6_BASE_ADDR + 0x17,
160 .flags = IORESOURCE_MEM 199 .flags = IORESOURCE_MEM,
161 }, 200 }, {
162 [1] = {
163 .start = MXC_INT_GPT6, 201 .start = MXC_INT_GPT6,
164 .end = MXC_INT_GPT6, 202 .end = MXC_INT_GPT6,
165 .flags = IORESOURCE_IRQ, 203 .flags = IORESOURCE_IRQ,
@@ -170,7 +208,7 @@ struct platform_device mxc_gpt5 = {
170 .name = "imx_gpt", 208 .name = "imx_gpt",
171 .id = 5, 209 .id = 5,
172 .num_resources = ARRAY_SIZE(timer5_resources), 210 .num_resources = ARRAY_SIZE(timer5_resources),
173 .resource = timer5_resources 211 .resource = timer5_resources,
174}; 212};
175#endif 213#endif
176 214
@@ -214,11 +252,11 @@ static struct resource mxc_nand_resources[] = {
214 { 252 {
215 .start = NFC_BASE_ADDR, 253 .start = NFC_BASE_ADDR,
216 .end = NFC_BASE_ADDR + 0xfff, 254 .end = NFC_BASE_ADDR + 0xfff,
217 .flags = IORESOURCE_MEM 255 .flags = IORESOURCE_MEM,
218 }, { 256 }, {
219 .start = MXC_INT_NANDFC, 257 .start = MXC_INT_NANDFC,
220 .end = MXC_INT_NANDFC, 258 .end = MXC_INT_NANDFC,
221 .flags = IORESOURCE_IRQ 259 .flags = IORESOURCE_IRQ,
222 }, 260 },
223}; 261};
224 262
@@ -240,8 +278,7 @@ static struct resource mxc_fb[] = {
240 .start = LCDC_BASE_ADDR, 278 .start = LCDC_BASE_ADDR,
241 .end = LCDC_BASE_ADDR + 0xFFF, 279 .end = LCDC_BASE_ADDR + 0xFFF,
242 .flags = IORESOURCE_MEM, 280 .flags = IORESOURCE_MEM,
243 }, 281 }, {
244 {
245 .start = MXC_INT_LCDC, 282 .start = MXC_INT_LCDC,
246 .end = MXC_INT_LCDC, 283 .end = MXC_INT_LCDC,
247 .flags = IORESOURCE_IRQ, 284 .flags = IORESOURCE_IRQ,
@@ -264,11 +301,11 @@ static struct resource mxc_fec_resources[] = {
264 { 301 {
265 .start = FEC_BASE_ADDR, 302 .start = FEC_BASE_ADDR,
266 .end = FEC_BASE_ADDR + 0xfff, 303 .end = FEC_BASE_ADDR + 0xfff,
267 .flags = IORESOURCE_MEM 304 .flags = IORESOURCE_MEM,
268 }, { 305 }, {
269 .start = MXC_INT_FEC, 306 .start = MXC_INT_FEC,
270 .end = MXC_INT_FEC, 307 .end = MXC_INT_FEC,
271 .flags = IORESOURCE_IRQ 308 .flags = IORESOURCE_IRQ,
272 }, 309 },
273}; 310};
274 311
@@ -281,15 +318,14 @@ struct platform_device mxc_fec_device = {
281#endif 318#endif
282 319
283static struct resource mxc_i2c_1_resources[] = { 320static struct resource mxc_i2c_1_resources[] = {
284 [0] = { 321 {
285 .start = I2C_BASE_ADDR, 322 .start = I2C_BASE_ADDR,
286 .end = I2C_BASE_ADDR + 0x0fff, 323 .end = I2C_BASE_ADDR + 0x0fff,
287 .flags = IORESOURCE_MEM 324 .flags = IORESOURCE_MEM,
288 }, 325 }, {
289 [1] = {
290 .start = MXC_INT_I2C, 326 .start = MXC_INT_I2C,
291 .end = MXC_INT_I2C, 327 .end = MXC_INT_I2C,
292 .flags = IORESOURCE_IRQ 328 .flags = IORESOURCE_IRQ,
293 } 329 }
294}; 330};
295 331
@@ -297,20 +333,19 @@ struct platform_device mxc_i2c_device0 = {
297 .name = "imx-i2c", 333 .name = "imx-i2c",
298 .id = 0, 334 .id = 0,
299 .num_resources = ARRAY_SIZE(mxc_i2c_1_resources), 335 .num_resources = ARRAY_SIZE(mxc_i2c_1_resources),
300 .resource = mxc_i2c_1_resources 336 .resource = mxc_i2c_1_resources,
301}; 337};
302 338
303#ifdef CONFIG_MACH_MX27 339#ifdef CONFIG_MACH_MX27
304static struct resource mxc_i2c_2_resources[] = { 340static struct resource mxc_i2c_2_resources[] = {
305 [0] = { 341 {
306 .start = I2C2_BASE_ADDR, 342 .start = I2C2_BASE_ADDR,
307 .end = I2C2_BASE_ADDR + 0x0fff, 343 .end = I2C2_BASE_ADDR + 0x0fff,
308 .flags = IORESOURCE_MEM 344 .flags = IORESOURCE_MEM,
309 }, 345 }, {
310 [1] = {
311 .start = MXC_INT_I2C2, 346 .start = MXC_INT_I2C2,
312 .end = MXC_INT_I2C2, 347 .end = MXC_INT_I2C2,
313 .flags = IORESOURCE_IRQ 348 .flags = IORESOURCE_IRQ,
314 } 349 }
315}; 350};
316 351
@@ -318,17 +353,16 @@ struct platform_device mxc_i2c_device1 = {
318 .name = "imx-i2c", 353 .name = "imx-i2c",
319 .id = 1, 354 .id = 1,
320 .num_resources = ARRAY_SIZE(mxc_i2c_2_resources), 355 .num_resources = ARRAY_SIZE(mxc_i2c_2_resources),
321 .resource = mxc_i2c_2_resources 356 .resource = mxc_i2c_2_resources,
322}; 357};
323#endif 358#endif
324 359
325static struct resource mxc_pwm_resources[] = { 360static struct resource mxc_pwm_resources[] = {
326 [0] = { 361 {
327 .start = PWM_BASE_ADDR, 362 .start = PWM_BASE_ADDR,
328 .end = PWM_BASE_ADDR + 0x0fff, 363 .end = PWM_BASE_ADDR + 0x0fff,
329 .flags = IORESOURCE_MEM 364 .flags = IORESOURCE_MEM,
330 }, 365 }, {
331 [1] = {
332 .start = MXC_INT_PWM, 366 .start = MXC_INT_PWM,
333 .end = MXC_INT_PWM, 367 .end = MXC_INT_PWM,
334 .flags = IORESOURCE_IRQ, 368 .flags = IORESOURCE_IRQ,
@@ -339,28 +373,26 @@ struct platform_device mxc_pwm_device = {
339 .name = "mxc_pwm", 373 .name = "mxc_pwm",
340 .id = 0, 374 .id = 0,
341 .num_resources = ARRAY_SIZE(mxc_pwm_resources), 375 .num_resources = ARRAY_SIZE(mxc_pwm_resources),
342 .resource = mxc_pwm_resources 376 .resource = mxc_pwm_resources,
343}; 377};
344 378
345/* 379/*
346 * Resource definition for the MXC SDHC 380 * Resource definition for the MXC SDHC
347 */ 381 */
348static struct resource mxc_sdhc1_resources[] = { 382static struct resource mxc_sdhc1_resources[] = {
349 [0] = { 383 {
350 .start = SDHC1_BASE_ADDR, 384 .start = SDHC1_BASE_ADDR,
351 .end = SDHC1_BASE_ADDR + SZ_4K - 1, 385 .end = SDHC1_BASE_ADDR + SZ_4K - 1,
352 .flags = IORESOURCE_MEM, 386 .flags = IORESOURCE_MEM,
353 }, 387 }, {
354 [1] = { 388 .start = MXC_INT_SDHC1,
355 .start = MXC_INT_SDHC1, 389 .end = MXC_INT_SDHC1,
356 .end = MXC_INT_SDHC1, 390 .flags = IORESOURCE_IRQ,
357 .flags = IORESOURCE_IRQ, 391 }, {
358 }, 392 .start = DMA_REQ_SDHC1,
359 [2] = { 393 .end = DMA_REQ_SDHC1,
360 .start = DMA_REQ_SDHC1, 394 .flags = IORESOURCE_DMA,
361 .end = DMA_REQ_SDHC1, 395 },
362 .flags = IORESOURCE_DMA
363 },
364}; 396};
365 397
366static u64 mxc_sdhc1_dmamask = 0xffffffffUL; 398static u64 mxc_sdhc1_dmamask = 0xffffffffUL;
@@ -377,21 +409,19 @@ struct platform_device mxc_sdhc_device0 = {
377}; 409};
378 410
379static struct resource mxc_sdhc2_resources[] = { 411static struct resource mxc_sdhc2_resources[] = {
380 [0] = { 412 {
381 .start = SDHC2_BASE_ADDR, 413 .start = SDHC2_BASE_ADDR,
382 .end = SDHC2_BASE_ADDR + SZ_4K - 1, 414 .end = SDHC2_BASE_ADDR + SZ_4K - 1,
383 .flags = IORESOURCE_MEM, 415 .flags = IORESOURCE_MEM,
384 }, 416 }, {
385 [1] = { 417 .start = MXC_INT_SDHC2,
386 .start = MXC_INT_SDHC2, 418 .end = MXC_INT_SDHC2,
387 .end = MXC_INT_SDHC2, 419 .flags = IORESOURCE_IRQ,
388 .flags = IORESOURCE_IRQ, 420 }, {
389 }, 421 .start = DMA_REQ_SDHC2,
390 [2] = { 422 .end = DMA_REQ_SDHC2,
391 .start = DMA_REQ_SDHC2, 423 .flags = IORESOURCE_DMA,
392 .end = DMA_REQ_SDHC2, 424 },
393 .flags = IORESOURCE_DMA
394 },
395}; 425};
396 426
397static u64 mxc_sdhc2_dmamask = 0xffffffffUL; 427static u64 mxc_sdhc2_dmamask = 0xffffffffUL;
@@ -407,35 +437,123 @@ struct platform_device mxc_sdhc_device1 = {
407 .resource = mxc_sdhc2_resources, 437 .resource = mxc_sdhc2_resources,
408}; 438};
409 439
440#ifdef CONFIG_MACH_MX27
441static struct resource otg_resources[] = {
442 {
443 .start = OTG_BASE_ADDR,
444 .end = OTG_BASE_ADDR + 0x1ff,
445 .flags = IORESOURCE_MEM,
446 }, {
447 .start = MXC_INT_USB3,
448 .end = MXC_INT_USB3,
449 .flags = IORESOURCE_IRQ,
450 },
451};
452
453static u64 otg_dmamask = 0xffffffffUL;
454
455/* OTG gadget device */
456struct platform_device mxc_otg_udc_device = {
457 .name = "fsl-usb2-udc",
458 .id = -1,
459 .dev = {
460 .dma_mask = &otg_dmamask,
461 .coherent_dma_mask = 0xffffffffUL,
462 },
463 .resource = otg_resources,
464 .num_resources = ARRAY_SIZE(otg_resources),
465};
466
467/* OTG host */
468struct platform_device mxc_otg_host = {
469 .name = "mxc-ehci",
470 .id = 0,
471 .dev = {
472 .coherent_dma_mask = 0xffffffff,
473 .dma_mask = &otg_dmamask,
474 },
475 .resource = otg_resources,
476 .num_resources = ARRAY_SIZE(otg_resources),
477};
478
479/* USB host 1 */
480
481static u64 usbh1_dmamask = 0xffffffffUL;
482
483static struct resource mxc_usbh1_resources[] = {
484 {
485 .start = OTG_BASE_ADDR + 0x200,
486 .end = OTG_BASE_ADDR + 0x3ff,
487 .flags = IORESOURCE_MEM,
488 }, {
489 .start = MXC_INT_USB1,
490 .end = MXC_INT_USB1,
491 .flags = IORESOURCE_IRQ,
492 },
493};
494
495struct platform_device mxc_usbh1 = {
496 .name = "mxc-ehci",
497 .id = 1,
498 .dev = {
499 .coherent_dma_mask = 0xffffffff,
500 .dma_mask = &usbh1_dmamask,
501 },
502 .resource = mxc_usbh1_resources,
503 .num_resources = ARRAY_SIZE(mxc_usbh1_resources),
504};
505
506/* USB host 2 */
507static u64 usbh2_dmamask = 0xffffffffUL;
508
509static struct resource mxc_usbh2_resources[] = {
510 {
511 .start = OTG_BASE_ADDR + 0x400,
512 .end = OTG_BASE_ADDR + 0x5ff,
513 .flags = IORESOURCE_MEM,
514 }, {
515 .start = MXC_INT_USB2,
516 .end = MXC_INT_USB2,
517 .flags = IORESOURCE_IRQ,
518 },
519};
520
521struct platform_device mxc_usbh2 = {
522 .name = "mxc-ehci",
523 .id = 2,
524 .dev = {
525 .coherent_dma_mask = 0xffffffff,
526 .dma_mask = &usbh2_dmamask,
527 },
528 .resource = mxc_usbh2_resources,
529 .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
530};
531#endif
532
410/* GPIO port description */ 533/* GPIO port description */
411static struct mxc_gpio_port imx_gpio_ports[] = { 534static struct mxc_gpio_port imx_gpio_ports[] = {
412 [0] = { 535 {
413 .chip.label = "gpio-0", 536 .chip.label = "gpio-0",
414 .irq = MXC_INT_GPIO, 537 .irq = MXC_INT_GPIO,
415 .base = IO_ADDRESS(GPIO_BASE_ADDR), 538 .base = IO_ADDRESS(GPIO_BASE_ADDR),
416 .virtual_irq_start = MXC_GPIO_IRQ_START, 539 .virtual_irq_start = MXC_GPIO_IRQ_START,
417 }, 540 }, {
418 [1] = {
419 .chip.label = "gpio-1", 541 .chip.label = "gpio-1",
420 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x100), 542 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
421 .virtual_irq_start = MXC_GPIO_IRQ_START + 32, 543 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
422 }, 544 }, {
423 [2] = {
424 .chip.label = "gpio-2", 545 .chip.label = "gpio-2",
425 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x200), 546 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
426 .virtual_irq_start = MXC_GPIO_IRQ_START + 64, 547 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
427 }, 548 }, {
428 [3] = {
429 .chip.label = "gpio-3", 549 .chip.label = "gpio-3",
430 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x300), 550 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
431 .virtual_irq_start = MXC_GPIO_IRQ_START + 96, 551 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
432 }, 552 }, {
433 [4] = {
434 .chip.label = "gpio-4", 553 .chip.label = "gpio-4",
435 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x400), 554 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x400),
436 .virtual_irq_start = MXC_GPIO_IRQ_START + 128, 555 .virtual_irq_start = MXC_GPIO_IRQ_START + 128,
437 }, 556 }, {
438 [5] = {
439 .chip.label = "gpio-5", 557 .chip.label = "gpio-5",
440 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x500), 558 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x500),
441 .virtual_irq_start = MXC_GPIO_IRQ_START + 160, 559 .virtual_irq_start = MXC_GPIO_IRQ_START + 160,
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index 049005bb6aa9..d315406d6725 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -4,7 +4,6 @@ extern struct platform_device mxc_gpt3;
4extern struct platform_device mxc_gpt4; 4extern struct platform_device mxc_gpt4;
5extern struct platform_device mxc_gpt5; 5extern struct platform_device mxc_gpt5;
6extern struct platform_device mxc_wdt; 6extern struct platform_device mxc_wdt;
7extern struct platform_device mxc_irda_device;
8extern struct platform_device mxc_uart_device0; 7extern struct platform_device mxc_uart_device0;
9extern struct platform_device mxc_uart_device1; 8extern struct platform_device mxc_uart_device1;
10extern struct platform_device mxc_uart_device2; 9extern struct platform_device mxc_uart_device2;
@@ -20,3 +19,11 @@ extern struct platform_device mxc_i2c_device0;
20extern struct platform_device mxc_i2c_device1; 19extern struct platform_device mxc_i2c_device1;
21extern struct platform_device mxc_sdhc_device0; 20extern struct platform_device mxc_sdhc_device0;
22extern struct platform_device mxc_sdhc_device1; 21extern struct platform_device mxc_sdhc_device1;
22extern struct platform_device mxc_otg_udc_device;
23extern struct platform_device mxc_otg_host;
24extern struct platform_device mxc_usbh1;
25extern struct platform_device mxc_usbh2;
26extern struct platform_device mxc_spi_device0;
27extern struct platform_device mxc_spi_device1;
28extern struct platform_device mxc_spi_device2;
29
diff --git a/arch/arm/mach-mx2/eukrea_cpuimx27.c b/arch/arm/mach-mx2/eukrea_cpuimx27.c
new file mode 100644
index 000000000000..7b187606682c
--- /dev/null
+++ b/arch/arm/mach-mx2/eukrea_cpuimx27.c
@@ -0,0 +1,234 @@
1/*
2 * Copyright (C) 2009 Eric Benard - eric@eukrea.com
3 *
4 * Based on pcm038.c which is :
5 * Copyright 2007 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
6 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
21 */
22
23#include <linux/i2c.h>
24#include <linux/io.h>
25#include <linux/mtd/plat-ram.h>
26#include <linux/mtd/physmap.h>
27#include <linux/platform_device.h>
28#include <linux/serial_8250.h>
29
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33#include <asm/mach/map.h>
34
35#include <mach/board-eukrea_cpuimx27.h>
36#include <mach/common.h>
37#include <mach/hardware.h>
38#include <mach/i2c.h>
39#include <mach/iomux.h>
40#include <mach/imx-uart.h>
41#include <mach/mxc_nand.h>
42
43#include "devices.h"
44
45static int eukrea_cpuimx27_pins[] = {
46 /* UART1 */
47 PE12_PF_UART1_TXD,
48 PE13_PF_UART1_RXD,
49 PE14_PF_UART1_CTS,
50 PE15_PF_UART1_RTS,
51 /* UART4 */
52 PB26_AF_UART4_RTS,
53 PB28_AF_UART4_TXD,
54 PB29_AF_UART4_CTS,
55 PB31_AF_UART4_RXD,
56 /* FEC */
57 PD0_AIN_FEC_TXD0,
58 PD1_AIN_FEC_TXD1,
59 PD2_AIN_FEC_TXD2,
60 PD3_AIN_FEC_TXD3,
61 PD4_AOUT_FEC_RX_ER,
62 PD5_AOUT_FEC_RXD1,
63 PD6_AOUT_FEC_RXD2,
64 PD7_AOUT_FEC_RXD3,
65 PD8_AF_FEC_MDIO,
66 PD9_AIN_FEC_MDC,
67 PD10_AOUT_FEC_CRS,
68 PD11_AOUT_FEC_TX_CLK,
69 PD12_AOUT_FEC_RXD0,
70 PD13_AOUT_FEC_RX_DV,
71 PD14_AOUT_FEC_RX_CLK,
72 PD15_AOUT_FEC_COL,
73 PD16_AIN_FEC_TX_ER,
74 PF23_AIN_FEC_TX_EN,
75 /* I2C1 */
76 PD17_PF_I2C_DATA,
77 PD18_PF_I2C_CLK,
78 /* SDHC2 */
79 PB4_PF_SD2_D0,
80 PB5_PF_SD2_D1,
81 PB6_PF_SD2_D2,
82 PB7_PF_SD2_D3,
83 PB8_PF_SD2_CMD,
84 PB9_PF_SD2_CLK,
85#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
86 /* Quad UART's IRQ */
87 GPIO_PORTD | 22 | GPIO_GPIO | GPIO_IN,
88 GPIO_PORTD | 23 | GPIO_GPIO | GPIO_IN,
89 GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN,
90 GPIO_PORTD | 30 | GPIO_GPIO | GPIO_IN,
91#endif
92};
93
94static struct physmap_flash_data eukrea_cpuimx27_flash_data = {
95 .width = 2,
96};
97
98static struct resource eukrea_cpuimx27_flash_resource = {
99 .start = 0xc0000000,
100 .end = 0xc3ffffff,
101 .flags = IORESOURCE_MEM,
102};
103
104static struct platform_device eukrea_cpuimx27_nor_mtd_device = {
105 .name = "physmap-flash",
106 .id = 0,
107 .dev = {
108 .platform_data = &eukrea_cpuimx27_flash_data,
109 },
110 .num_resources = 1,
111 .resource = &eukrea_cpuimx27_flash_resource,
112};
113
114static struct imxuart_platform_data uart_pdata[] = {
115 {
116 .flags = IMXUART_HAVE_RTSCTS,
117 }, {
118 .flags = IMXUART_HAVE_RTSCTS,
119 },
120};
121
122static struct mxc_nand_platform_data eukrea_cpuimx27_nand_board_info = {
123 .width = 1,
124 .hw_ecc = 1,
125};
126
127static struct platform_device *platform_devices[] __initdata = {
128 &eukrea_cpuimx27_nor_mtd_device,
129 &mxc_fec_device,
130};
131
132static struct imxi2c_platform_data eukrea_cpuimx27_i2c_1_data = {
133 .bitrate = 100000,
134};
135
136static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = {
137 {
138 I2C_BOARD_INFO("pcf8563", 0x51),
139 },
140};
141
142#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
143static struct plat_serial8250_port serial_platform_data[] = {
144 {
145 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x200000),
146 .irq = IRQ_GPIOB(23),
147 .uartclk = 14745600,
148 .regshift = 1,
149 .iotype = UPIO_MEM,
150 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
151 }, {
152 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x400000),
153 .irq = IRQ_GPIOB(22),
154 .uartclk = 14745600,
155 .regshift = 1,
156 .iotype = UPIO_MEM,
157 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
158 }, {
159 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x800000),
160 .irq = IRQ_GPIOB(27),
161 .uartclk = 14745600,
162 .regshift = 1,
163 .iotype = UPIO_MEM,
164 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
165 }, {
166 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x1000000),
167 .irq = IRQ_GPIOB(30),
168 .uartclk = 14745600,
169 .regshift = 1,
170 .iotype = UPIO_MEM,
171 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
172 }, {
173 }
174};
175
176static struct platform_device serial_device = {
177 .name = "serial8250",
178 .id = 0,
179 .dev = {
180 .platform_data = serial_platform_data,
181 },
182};
183#endif
184
185static void __init eukrea_cpuimx27_init(void)
186{
187 mxc_gpio_setup_multiple_pins(eukrea_cpuimx27_pins,
188 ARRAY_SIZE(eukrea_cpuimx27_pins), "CPUIMX27");
189
190 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
191
192 mxc_register_device(&mxc_nand_device, &eukrea_cpuimx27_nand_board_info);
193
194 i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices,
195 ARRAY_SIZE(eukrea_cpuimx27_i2c_devices));
196
197 mxc_register_device(&mxc_i2c_device0, &eukrea_cpuimx27_i2c_1_data);
198
199 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
200
201#if defined(CONFIG_MACH_EUKREA_CPUIMX27_USESDHC2)
202 /* SDHC2 can be used for Wifi */
203 mxc_register_device(&mxc_sdhc_device1, NULL);
204 /* in which case UART4 is also used for Bluetooth */
205 mxc_register_device(&mxc_uart_device3, &uart_pdata[1]);
206#endif
207
208#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
209 platform_device_register(&serial_device);
210#endif
211
212#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD
213 eukrea_mbimx27_baseboard_init();
214#endif
215}
216
217static void __init eukrea_cpuimx27_timer_init(void)
218{
219 mx27_clocks_init(26000000);
220}
221
222static struct sys_timer eukrea_cpuimx27_timer = {
223 .init = eukrea_cpuimx27_timer_init,
224};
225
226MACHINE_START(CPUIMX27, "EUKREA CPUIMX27")
227 .phys_io = AIPI_BASE_ADDR,
228 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
229 .boot_params = PHYS_OFFSET + 0x100,
230 .map_io = mx27_map_io,
231 .init_irq = mx27_init_irq,
232 .init_machine = eukrea_cpuimx27_init,
233 .timer = &eukrea_cpuimx27_timer,
234MACHINE_END
diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
new file mode 100644
index 000000000000..7382b6d27ee1
--- /dev/null
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -0,0 +1,249 @@
1/*
2 * Copyright (C) 2009 Eric Benard - eric@eukrea.com
3 *
4 * Based on pcm970-baseboard.c which is :
5 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22#include <linux/gpio.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/spi/spi.h>
26#include <linux/spi/ads7846.h>
27
28#include <asm/mach/arch.h>
29
30#include <mach/common.h>
31#include <mach/iomux.h>
32#include <mach/imxfb.h>
33#include <mach/hardware.h>
34#include <mach/mmc.h>
35#include <mach/imx-uart.h>
36
37#include "devices.h"
38
39static int eukrea_mbimx27_pins[] = {
40 /* UART2 */
41 PE3_PF_UART2_CTS,
42 PE4_PF_UART2_RTS,
43 PE6_PF_UART2_TXD,
44 PE7_PF_UART2_RXD,
45 /* UART3 */
46 PE8_PF_UART3_TXD,
47 PE9_PF_UART3_RXD,
48 PE10_PF_UART3_CTS,
49 PE11_PF_UART3_RTS,
50 /* UART4 */
51 PB26_AF_UART4_RTS,
52 PB28_AF_UART4_TXD,
53 PB29_AF_UART4_CTS,
54 PB31_AF_UART4_RXD,
55 /* SDHC1*/
56 PE18_PF_SD1_D0,
57 PE19_PF_SD1_D1,
58 PE20_PF_SD1_D2,
59 PE21_PF_SD1_D3,
60 PE22_PF_SD1_CMD,
61 PE23_PF_SD1_CLK,
62 /* display */
63 PA5_PF_LSCLK,
64 PA6_PF_LD0,
65 PA7_PF_LD1,
66 PA8_PF_LD2,
67 PA9_PF_LD3,
68 PA10_PF_LD4,
69 PA11_PF_LD5,
70 PA12_PF_LD6,
71 PA13_PF_LD7,
72 PA14_PF_LD8,
73 PA15_PF_LD9,
74 PA16_PF_LD10,
75 PA17_PF_LD11,
76 PA18_PF_LD12,
77 PA19_PF_LD13,
78 PA20_PF_LD14,
79 PA21_PF_LD15,
80 PA22_PF_LD16,
81 PA23_PF_LD17,
82 PA28_PF_HSYNC,
83 PA29_PF_VSYNC,
84 PA30_PF_CONTRAST,
85 PA31_PF_OE_ACD,
86 /* SPI1 */
87 PD28_PF_CSPI1_SS0,
88 PD29_PF_CSPI1_SCLK,
89 PD30_PF_CSPI1_MISO,
90 PD31_PF_CSPI1_MOSI,
91};
92
93static struct gpio_led gpio_leds[] = {
94 {
95 .name = "led1",
96 .default_trigger = "heartbeat",
97 .active_low = 1,
98 .gpio = GPIO_PORTF | 16,
99 },
100 {
101 .name = "led2",
102 .default_trigger = "none",
103 .active_low = 1,
104 .gpio = GPIO_PORTF | 19,
105 },
106 {
107 .name = "backlight",
108 .default_trigger = "backlight",
109 .active_low = 0,
110 .gpio = GPIO_PORTE | 5,
111 },
112};
113
114static struct gpio_led_platform_data gpio_led_info = {
115 .leds = gpio_leds,
116 .num_leds = ARRAY_SIZE(gpio_leds),
117};
118
119static struct platform_device leds_gpio = {
120 .name = "leds-gpio",
121 .id = -1,
122 .dev = {
123 .platform_data = &gpio_led_info,
124 },
125};
126
127static struct imx_fb_videomode eukrea_mbimx27_modes[] = {
128 {
129 .mode = {
130 .name = "CMO-QGVA",
131 .refresh = 60,
132 .xres = 320,
133 .yres = 240,
134 .pixclock = 156000,
135 .hsync_len = 30,
136 .left_margin = 38,
137 .right_margin = 20,
138 .vsync_len = 3,
139 .upper_margin = 15,
140 .lower_margin = 4,
141 },
142 .pcr = 0xFAD08B80,
143 .bpp = 16,
144 },
145};
146
147static struct imx_fb_platform_data eukrea_mbimx27_fb_data = {
148 .mode = eukrea_mbimx27_modes,
149 .num_modes = ARRAY_SIZE(eukrea_mbimx27_modes),
150
151 .pwmr = 0x00A903FF,
152 .lscr1 = 0x00120300,
153 .dmacr = 0x00040060,
154};
155
156static struct imxuart_platform_data uart_pdata[] = {
157 {
158 .flags = IMXUART_HAVE_RTSCTS,
159 },
160 {
161 .flags = IMXUART_HAVE_RTSCTS,
162 },
163};
164
165#if defined(CONFIG_TOUCHSCREEN_ADS7846)
166 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
167
168#define ADS7846_PENDOWN (GPIO_PORTD | 25)
169
170static void ads7846_dev_init(void)
171{
172 if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) {
173 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
174 return;
175 }
176
177 gpio_direction_input(ADS7846_PENDOWN);
178}
179
180static int ads7846_get_pendown_state(void)
181{
182 return !gpio_get_value(ADS7846_PENDOWN);
183}
184
185static struct ads7846_platform_data ads7846_config __initdata = {
186 .get_pendown_state = ads7846_get_pendown_state,
187 .keep_vref_on = 1,
188};
189
190static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = {
191 [0] = {
192 .modalias = "ads7846",
193 .bus_num = 0,
194 .chip_select = 0,
195 .max_speed_hz = 1500000,
196 .irq = IRQ_GPIOD(25),
197 .platform_data = &ads7846_config,
198 .mode = SPI_MODE_2,
199 },
200};
201
202static int eukrea_mbimx27_spi_cs[] = {GPIO_PORTD | 28};
203
204static struct spi_imx_master eukrea_mbimx27_spi_0_data = {
205 .chipselect = eukrea_mbimx27_spi_cs,
206 .num_chipselect = ARRAY_SIZE(eukrea_mbimx27_spi_cs),
207};
208#endif
209
210static struct platform_device *platform_devices[] __initdata = {
211 &leds_gpio,
212};
213
214/*
215 * system init for baseboard usage. Will be called by cpuimx27 init.
216 *
217 * Add platform devices present on this baseboard and init
218 * them from CPU side as far as required to use them later on
219 */
220void __init eukrea_mbimx27_baseboard_init(void)
221{
222 mxc_gpio_setup_multiple_pins(eukrea_mbimx27_pins,
223 ARRAY_SIZE(eukrea_mbimx27_pins), "MBIMX27");
224
225 mxc_register_device(&mxc_uart_device1, &uart_pdata[0]);
226 mxc_register_device(&mxc_uart_device2, &uart_pdata[1]);
227
228 mxc_register_device(&mxc_fb_device, &eukrea_mbimx27_fb_data);
229 mxc_register_device(&mxc_sdhc_device0, NULL);
230
231#if defined(CONFIG_TOUCHSCREEN_ADS7846)
232 || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
233 /* SPI and ADS7846 Touchscreen controler init */
234 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
235 mxc_gpio_mode(GPIO_PORTD | 25 | GPIO_GPIO | GPIO_IN);
236 mxc_register_device(&mxc_spi_device0, &eukrea_mbimx27_spi_0_data);
237 spi_register_board_info(eukrea_mbimx27_spi_board_info,
238 ARRAY_SIZE(eukrea_mbimx27_spi_board_info));
239 ads7846_dev_init();
240#endif
241
242 /* Leds configuration */
243 mxc_gpio_mode(GPIO_PORTF | 16 | GPIO_GPIO | GPIO_OUT);
244 mxc_gpio_mode(GPIO_PORTF | 19 | GPIO_GPIO | GPIO_OUT);
245 /* Backlight */
246 mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_OUT);
247
248 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
249}
diff --git a/arch/arm/mach-mx2/generic.c b/arch/arm/mach-mx2/generic.c
index 169372f69d8f..ae8f759134d1 100644
--- a/arch/arm/mach-mx2/generic.c
+++ b/arch/arm/mach-mx2/generic.c
@@ -72,6 +72,7 @@ static struct map_desc mxc_io_desc[] __initdata = {
72void __init mx21_map_io(void) 72void __init mx21_map_io(void)
73{ 73{
74 mxc_set_cpu_type(MXC_CPU_MX21); 74 mxc_set_cpu_type(MXC_CPU_MX21);
75 mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR));
75 76
76 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 77 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
77} 78}
@@ -79,7 +80,18 @@ void __init mx21_map_io(void)
79void __init mx27_map_io(void) 80void __init mx27_map_io(void)
80{ 81{
81 mxc_set_cpu_type(MXC_CPU_MX27); 82 mxc_set_cpu_type(MXC_CPU_MX27);
83 mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR));
82 84
83 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 85 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
84} 86}
85 87
88void __init mx27_init_irq(void)
89{
90 mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR));
91}
92
93void __init mx21_init_irq(void)
94{
95 mx27_init_irq();
96}
97
diff --git a/arch/arm/mach-mx2/mx21ads.c b/arch/arm/mach-mx2/mx21ads.c
index a5ee461cb405..cf5f77cbc2f1 100644
--- a/arch/arm/mach-mx2/mx21ads.c
+++ b/arch/arm/mach-mx2/mx21ads.c
@@ -164,25 +164,33 @@ static void mx21ads_fb_exit(struct platform_device *pdev)
164 * Connected is a portrait Sharp-QVGA display 164 * Connected is a portrait Sharp-QVGA display
165 * of type: LQ035Q7DB02 165 * of type: LQ035Q7DB02
166 */ 166 */
167static struct imx_fb_platform_data mx21ads_fb_data = { 167static struct imx_fb_videomode mx21ads_modes[] = {
168 .pixclock = 188679, /* in ps */ 168 {
169 .xres = 240, 169 .mode = {
170 .yres = 320, 170 .name = "Sharp-LQ035Q7",
171 171 .refresh = 60,
172 .bpp = 16, 172 .xres = 240,
173 .hsync_len = 2, 173 .yres = 320,
174 .left_margin = 6, 174 .pixclock = 188679, /* in ps (5.3MHz) */
175 .right_margin = 16, 175 .hsync_len = 2,
176 .left_margin = 6,
177 .right_margin = 16,
178 .vsync_len = 1,
179 .upper_margin = 8,
180 .lower_margin = 10,
181 },
182 .pcr = 0xfb108bc7,
183 .bpp = 16,
184 },
185};
176 186
177 .vsync_len = 1, 187static struct imx_fb_platform_data mx21ads_fb_data = {
178 .upper_margin = 8, 188 .mode = mx21ads_modes,
179 .lower_margin = 10, 189 .num_modes = ARRAY_SIZE(mx21ads_modes),
180 .fixed_screen_cpu = 0,
181 190
182 .pcr = 0xFB108BC7, 191 .pwmr = 0x00a903ff,
183 .pwmr = 0x00A901ff, 192 .lscr1 = 0x00120300,
184 .lscr1 = 0x00120300, 193 .dmacr = 0x00020008,
185 .dmacr = 0x00020008,
186 194
187 .init = mx21ads_fb_init, 195 .init = mx21ads_fb_init,
188 .exit = mx21ads_fb_exit, 196 .exit = mx21ads_fb_exit,
@@ -280,7 +288,7 @@ MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
280 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 288 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
281 .boot_params = PHYS_OFFSET + 0x100, 289 .boot_params = PHYS_OFFSET + 0x100,
282 .map_io = mx21ads_map_io, 290 .map_io = mx21ads_map_io,
283 .init_irq = mxc_init_irq, 291 .init_irq = mx21_init_irq,
284 .init_machine = mx21ads_board_init, 292 .init_machine = mx21ads_board_init,
285 .timer = &mx21ads_timer, 293 .timer = &mx21ads_timer,
286MACHINE_END 294MACHINE_END
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c
index 02daddac6995..83e412b713e6 100644
--- a/arch/arm/mach-mx2/mx27ads.c
+++ b/arch/arm/mach-mx2/mx27ads.c
@@ -183,20 +183,29 @@ void lcd_power(int on)
183 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG); 183 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
184} 184}
185 185
186static struct imx_fb_platform_data mx27ads_fb_data = { 186static struct imx_fb_videomode mx27ads_modes[] = {
187 .pixclock = 188679, 187 {
188 .xres = 240, 188 .mode = {
189 .yres = 320, 189 .name = "Sharp-LQ035Q7",
190 190 .refresh = 60,
191 .bpp = 16, 191 .xres = 240,
192 .hsync_len = 1, 192 .yres = 320,
193 .left_margin = 9, 193 .pixclock = 188679, /* in ps (5.3MHz) */
194 .right_margin = 16, 194 .hsync_len = 1,
195 .left_margin = 9,
196 .right_margin = 16,
197 .vsync_len = 1,
198 .upper_margin = 7,
199 .lower_margin = 9,
200 },
201 .bpp = 16,
202 .pcr = 0xFB008BC0,
203 },
204};
195 205
196 .vsync_len = 1, 206static struct imx_fb_platform_data mx27ads_fb_data = {
197 .upper_margin = 7, 207 .mode = mx27ads_modes,
198 .lower_margin = 9, 208 .num_modes = ARRAY_SIZE(mx27ads_modes),
199 .fixed_screen_cpu = 0,
200 209
201 /* 210 /*
202 * - HSYNC active high 211 * - HSYNC active high
@@ -207,7 +216,6 @@ static struct imx_fb_platform_data mx27ads_fb_data = {
207 * - data enable low active 216 * - data enable low active
208 * - enable sharp mode 217 * - enable sharp mode
209 */ 218 */
210 .pcr = 0xFB008BC0,
211 .pwmr = 0x00A903FF, 219 .pwmr = 0x00A903FF,
212 .lscr1 = 0x00120300, 220 .lscr1 = 0x00120300,
213 .dmacr = 0x00020010, 221 .dmacr = 0x00020010,
@@ -330,7 +338,7 @@ MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
330 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 338 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
331 .boot_params = PHYS_OFFSET + 0x100, 339 .boot_params = PHYS_OFFSET + 0x100,
332 .map_io = mx27ads_map_io, 340 .map_io = mx27ads_map_io,
333 .init_irq = mxc_init_irq, 341 .init_irq = mx27_init_irq,
334 .init_machine = mx27ads_board_init, 342 .init_machine = mx27ads_board_init,
335 .timer = &mx27ads_timer, 343 .timer = &mx27ads_timer,
336MACHINE_END 344MACHINE_END
diff --git a/arch/arm/mach-mx2/mx27lite.c b/arch/arm/mach-mx2/mx27lite.c
index 3ae11cb8c04b..82ea227ea0cf 100644
--- a/arch/arm/mach-mx2/mx27lite.c
+++ b/arch/arm/mach-mx2/mx27lite.c
@@ -89,7 +89,7 @@ MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100, 90 .boot_params = PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io, 91 .map_io = mx27_map_io,
92 .init_irq = mxc_init_irq, 92 .init_irq = mx27_init_irq,
93 .init_machine = mx27lite_init, 93 .init_machine = mx27lite_init,
94 .timer = &mx27lite_timer, 94 .timer = &mx27lite_timer,
95MACHINE_END 95MACHINE_END
diff --git a/arch/arm/mach-mx2/mx27pdk.c b/arch/arm/mach-mx2/mx27pdk.c
index 1d9238c7a6c3..6761d1b79e43 100644
--- a/arch/arm/mach-mx2/mx27pdk.c
+++ b/arch/arm/mach-mx2/mx27pdk.c
@@ -89,7 +89,7 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100, 90 .boot_params = PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io, 91 .map_io = mx27_map_io,
92 .init_irq = mxc_init_irq, 92 .init_irq = mx27_init_irq,
93 .init_machine = mx27pdk_init, 93 .init_machine = mx27pdk_init,
94 .timer = &mx27pdk_timer, 94 .timer = &mx27pdk_timer,
95MACHINE_END 95MACHINE_END
diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c
new file mode 100644
index 000000000000..fe5b165b88cc
--- /dev/null
+++ b/arch/arm/mach-mx2/pca100.c
@@ -0,0 +1,244 @@
1/*
2 * Copyright 2007 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
3 * Copyright (C) 2009 Sascha Hauer (kernel@pengutronix.de)
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/i2c.h>
23#include <linux/i2c/at24.h>
24#include <linux/dma-mapping.h>
25#include <linux/spi/spi.h>
26#include <linux/spi/eeprom.h>
27#include <linux/irq.h>
28#include <linux/gpio.h>
29
30#include <asm/mach/arch.h>
31#include <asm/mach-types.h>
32#include <mach/common.h>
33#include <mach/hardware.h>
34#include <mach/iomux.h>
35#include <mach/i2c.h>
36#include <asm/mach/time.h>
37#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
38#include <mach/spi.h>
39#endif
40#include <mach/imx-uart.h>
41#include <mach/mxc_nand.h>
42#include <mach/irqs.h>
43#include <mach/mmc.h>
44
45#include "devices.h"
46
47static int pca100_pins[] = {
48 /* UART1 */
49 PE12_PF_UART1_TXD,
50 PE13_PF_UART1_RXD,
51 PE14_PF_UART1_CTS,
52 PE15_PF_UART1_RTS,
53 /* SDHC */
54 PB4_PF_SD2_D0,
55 PB5_PF_SD2_D1,
56 PB6_PF_SD2_D2,
57 PB7_PF_SD2_D3,
58 PB8_PF_SD2_CMD,
59 PB9_PF_SD2_CLK,
60 /* FEC */
61 PD0_AIN_FEC_TXD0,
62 PD1_AIN_FEC_TXD1,
63 PD2_AIN_FEC_TXD2,
64 PD3_AIN_FEC_TXD3,
65 PD4_AOUT_FEC_RX_ER,
66 PD5_AOUT_FEC_RXD1,
67 PD6_AOUT_FEC_RXD2,
68 PD7_AOUT_FEC_RXD3,
69 PD8_AF_FEC_MDIO,
70 PD9_AIN_FEC_MDC,
71 PD10_AOUT_FEC_CRS,
72 PD11_AOUT_FEC_TX_CLK,
73 PD12_AOUT_FEC_RXD0,
74 PD13_AOUT_FEC_RX_DV,
75 PD14_AOUT_FEC_RX_CLK,
76 PD15_AOUT_FEC_COL,
77 PD16_AIN_FEC_TX_ER,
78 PF23_AIN_FEC_TX_EN,
79 /* SSI1 */
80 PC20_PF_SSI1_FS,
81 PC21_PF_SSI1_RXD,
82 PC22_PF_SSI1_TXD,
83 PC23_PF_SSI1_CLK,
84 /* onboard I2C */
85 PC5_PF_I2C2_SDA,
86 PC6_PF_I2C2_SCL,
87 /* external I2C */
88 PD17_PF_I2C_DATA,
89 PD18_PF_I2C_CLK,
90 /* SPI1 */
91 PD25_PF_CSPI1_RDY,
92 PD29_PF_CSPI1_SCLK,
93 PD30_PF_CSPI1_MISO,
94 PD31_PF_CSPI1_MOSI,
95};
96
97static struct imxuart_platform_data uart_pdata = {
98 .flags = IMXUART_HAVE_RTSCTS,
99};
100
101static struct mxc_nand_platform_data pca100_nand_board_info = {
102 .width = 1,
103 .hw_ecc = 1,
104};
105
106static struct platform_device *platform_devices[] __initdata = {
107 &mxc_w1_master_device,
108 &mxc_fec_device,
109};
110
111static struct imxi2c_platform_data pca100_i2c_1_data = {
112 .bitrate = 100000,
113};
114
115static struct at24_platform_data board_eeprom = {
116 .byte_len = 4096,
117 .page_size = 32,
118 .flags = AT24_FLAG_ADDR16,
119};
120
121static struct i2c_board_info pca100_i2c_devices[] = {
122 {
123 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
124 .platform_data = &board_eeprom,
125 }, {
126 I2C_BOARD_INFO("rtc-pcf8563", 0x51),
127 .type = "pcf8563"
128 }, {
129 I2C_BOARD_INFO("lm75", 0x4a),
130 .type = "lm75"
131 }
132};
133
134#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
135static struct spi_eeprom at25320 = {
136 .name = "at25320an",
137 .byte_len = 4096,
138 .page_size = 32,
139 .flags = EE_ADDR2,
140};
141
142static struct spi_board_info pca100_spi_board_info[] __initdata = {
143 {
144 .modalias = "at25",
145 .max_speed_hz = 30000,
146 .bus_num = 0,
147 .chip_select = 1,
148 .platform_data = &at25320,
149 },
150};
151
152static int pca100_spi_cs[] = {GPIO_PORTD + 28, GPIO_PORTD + 27};
153
154static struct spi_imx_master pca100_spi_0_data = {
155 .chipselect = pca100_spi_cs,
156 .num_chipselect = ARRAY_SIZE(pca100_spi_cs),
157};
158#endif
159
160static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
161 void *data)
162{
163 int ret;
164
165 ret = request_irq(IRQ_GPIOC(29), detect_irq,
166 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
167 "imx-mmc-detect", data);
168 if (ret)
169 printk(KERN_ERR
170 "pca100: Failed to reuest irq for sd/mmc detection\n");
171
172 return ret;
173}
174
175static void pca100_sdhc2_exit(struct device *dev, void *data)
176{
177 free_irq(IRQ_GPIOC(29), data);
178}
179
180static struct imxmmc_platform_data sdhc_pdata = {
181 .init = pca100_sdhc2_init,
182 .exit = pca100_sdhc2_exit,
183};
184
185static void __init pca100_init(void)
186{
187 int ret;
188
189 ret = mxc_gpio_setup_multiple_pins(pca100_pins,
190 ARRAY_SIZE(pca100_pins), "PCA100");
191 if (ret)
192 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret);
193
194 mxc_register_device(&mxc_uart_device0, &uart_pdata);
195
196 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
197 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
198
199 mxc_register_device(&mxc_nand_device, &pca100_nand_board_info);
200
201 /* only the i2c master 1 is used on this CPU card */
202 i2c_register_board_info(1, pca100_i2c_devices,
203 ARRAY_SIZE(pca100_i2c_devices));
204
205 mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data);
206
207 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
208 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_OUT);
209
210 /* GPIO0_IRQ */
211 mxc_gpio_mode(GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN);
212 /* GPIO1_IRQ */
213 mxc_gpio_mode(GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN);
214 /* GPIO2_IRQ */
215 mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN);
216
217#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
218 spi_register_board_info(pca100_spi_board_info,
219 ARRAY_SIZE(pca100_spi_board_info));
220 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data);
221#endif
222
223 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
224}
225
226static void __init pca100_timer_init(void)
227{
228 mx27_clocks_init(26000000);
229}
230
231static struct sys_timer pca100_timer = {
232 .init = pca100_timer_init,
233};
234
235MACHINE_START(PCA100, "phyCARD-i.MX27")
236 .phys_io = AIPI_BASE_ADDR,
237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
238 .boot_params = PHYS_OFFSET + 0x100,
239 .map_io = mx27_map_io,
240 .init_irq = mxc_init_irq,
241 .init_machine = pca100_init,
242 .timer = &pca100_timer,
243MACHINE_END
244
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c
index a4628d004343..ee65dda584cf 100644
--- a/arch/arm/mach-mx2/pcm038.c
+++ b/arch/arm/mach-mx2/pcm038.c
@@ -186,17 +186,13 @@ static struct at24_platform_data board_eeprom = {
186}; 186};
187 187
188static struct i2c_board_info pcm038_i2c_devices[] = { 188static struct i2c_board_info pcm038_i2c_devices[] = {
189 [0] = { 189 {
190 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ 190 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
191 .platform_data = &board_eeprom, 191 .platform_data = &board_eeprom,
192 }, 192 }, {
193 [1] = { 193 I2C_BOARD_INFO("pcf8563", 0x51),
194 I2C_BOARD_INFO("rtc-pcf8563", 0x51), 194 }, {
195 .type = "pcf8563"
196 },
197 [2] = {
198 I2C_BOARD_INFO("lm75", 0x4a), 195 I2C_BOARD_INFO("lm75", 0x4a),
199 .type = "lm75"
200 } 196 }
201}; 197};
202 198
@@ -220,6 +216,9 @@ static void __init pcm038_init(void)
220 216
221 mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data); 217 mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data);
222 218
219 /* PE18 for user-LED D40 */
220 mxc_gpio_mode(GPIO_PORTE | 18 | GPIO_GPIO | GPIO_OUT);
221
223 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 222 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
224 223
225#ifdef CONFIG_MACH_PCM970_BASEBOARD 224#ifdef CONFIG_MACH_PCM970_BASEBOARD
@@ -241,7 +240,7 @@ MACHINE_START(PCM038, "phyCORE-i.MX27")
241 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 240 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
242 .boot_params = PHYS_OFFSET + 0x100, 241 .boot_params = PHYS_OFFSET + 0x100,
243 .map_io = mx27_map_io, 242 .map_io = mx27_map_io,
244 .init_irq = mxc_init_irq, 243 .init_irq = mx27_init_irq,
245 .init_machine = pcm038_init, 244 .init_machine = pcm038_init,
246 .timer = &pcm038_timer, 245 .timer = &pcm038_timer,
247MACHINE_END 246MACHINE_END
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c
index 6a3acaf57dd4..c261f59b0b4c 100644
--- a/arch/arm/mach-mx2/pcm970-baseboard.c
+++ b/arch/arm/mach-mx2/pcm970-baseboard.c
@@ -19,6 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/can/platform/sja1000.h>
22 23
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24 25
@@ -125,40 +126,96 @@ static struct imxmmc_platform_data sdhc_pdata = {
125 .exit = pcm970_sdhc2_exit, 126 .exit = pcm970_sdhc2_exit,
126}; 127};
127 128
128/* 129static struct imx_fb_videomode pcm970_modes[] = {
129 * Connected is a portrait Sharp-QVGA display 130 {
130 * of type: LQ035Q7DH06 131 .mode = {
131 */ 132 .name = "Sharp-LQ035Q7",
132static struct imx_fb_platform_data pcm038_fb_data = { 133 .refresh = 60,
133 .pixclock = 188679, /* in ps (5.3MHz) */ 134 .xres = 240,
134 .xres = 240, 135 .yres = 320,
135 .yres = 320, 136 .pixclock = 188679, /* in ps (5.3MHz) */
136 137 .hsync_len = 7,
137 .bpp = 16, 138 .left_margin = 5,
138 .hsync_len = 7, 139 .right_margin = 16,
139 .left_margin = 5, 140 .vsync_len = 1,
140 .right_margin = 16, 141 .upper_margin = 7,
142 .lower_margin = 9,
143 },
144 /*
145 * - HSYNC active high
146 * - VSYNC active high
147 * - clk notenabled while idle
148 * - clock not inverted
149 * - data not inverted
150 * - data enable low active
151 * - enable sharp mode
152 */
153 .pcr = 0xF00080C0,
154 .bpp = 16,
155 }, {
156 .mode = {
157 .name = "TX090",
158 .refresh = 60,
159 .xres = 240,
160 .yres = 320,
161 .pixclock = 38255,
162 .left_margin = 144,
163 .right_margin = 0,
164 .upper_margin = 7,
165 .lower_margin = 40,
166 .hsync_len = 96,
167 .vsync_len = 1,
168 },
169 /*
170 * - HSYNC active low (1 << 22)
171 * - VSYNC active low (1 << 23)
172 * - clk notenabled while idle
173 * - clock not inverted
174 * - data not inverted
175 * - data enable low active
176 * - enable sharp mode
177 */
178 .pcr = 0xF0008080 | (1<<22) | (1<<23) | (1<<19),
179 .bpp = 32,
180 },
181};
141 182
142 .vsync_len = 1, 183static struct imx_fb_platform_data pcm038_fb_data = {
143 .upper_margin = 7, 184 .mode = pcm970_modes,
144 .lower_margin = 9, 185 .num_modes = ARRAY_SIZE(pcm970_modes),
145 .fixed_screen_cpu = 0,
146 186
147 /*
148 * - HSYNC active high
149 * - VSYNC active high
150 * - clk notenabled while idle
151 * - clock not inverted
152 * - data not inverted
153 * - data enable low active
154 * - enable sharp mode
155 */
156 .pcr = 0xFA0080C0,
157 .pwmr = 0x00A903FF, 187 .pwmr = 0x00A903FF,
158 .lscr1 = 0x00120300, 188 .lscr1 = 0x00120300,
159 .dmacr = 0x00020010, 189 .dmacr = 0x00020010,
160}; 190};
161 191
192static struct resource pcm970_sja1000_resources[] = {
193 {
194 .start = CS4_BASE_ADDR,
195 .end = CS4_BASE_ADDR + 0x100 - 1,
196 .flags = IORESOURCE_MEM,
197 }, {
198 .start = IRQ_GPIOE(19),
199 .end = IRQ_GPIOE(19),
200 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
201 },
202};
203
204struct sja1000_platform_data pcm970_sja1000_platform_data = {
205 .clock = 16000000 / 2,
206 .ocr = 0x40 | 0x18,
207 .cdr = 0x40,
208};
209
210static struct platform_device pcm970_sja1000 = {
211 .name = "sja1000_platform",
212 .dev = {
213 .platform_data = &pcm970_sja1000_platform_data,
214 },
215 .resource = pcm970_sja1000_resources,
216 .num_resources = ARRAY_SIZE(pcm970_sja1000_resources),
217};
218
162/* 219/*
163 * system init for baseboard usage. Will be called by pcm038 init. 220 * system init for baseboard usage. Will be called by pcm038 init.
164 * 221 *
@@ -172,4 +229,5 @@ void __init pcm970_baseboard_init(void)
172 229
173 mxc_register_device(&mxc_fb_device, &pcm038_fb_data); 230 mxc_register_device(&mxc_fb_device, &pcm038_fb_data);
174 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); 231 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
232 platform_device_register(&pcm970_sja1000);
175} 233}
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig
new file mode 100644
index 000000000000..cc28f56eae80
--- /dev/null
+++ b/arch/arm/mach-mx25/Kconfig
@@ -0,0 +1,9 @@
1if ARCH_MX25
2
3comment "MX25 platforms:"
4
5config MACH_MX25_3DS
6 select ARCH_MXC_IOMUX_V3
7 bool "Support MX25PDK (3DS) Platform"
8
9endif
diff --git a/arch/arm/mach-mx25/Makefile b/arch/arm/mach-mx25/Makefile
new file mode 100644
index 000000000000..fe23836a9f3d
--- /dev/null
+++ b/arch/arm/mach-mx25/Makefile
@@ -0,0 +1,3 @@
1obj-y := mm.o devices.o
2obj-$(CONFIG_ARCH_MX25) += clock.o
3obj-$(CONFIG_MACH_MX25_3DS) += mx25pdk.o
diff --git a/arch/arm/mach-mx25/Makefile.boot b/arch/arm/mach-mx25/Makefile.boot
new file mode 100644
index 000000000000..e1dd366f836b
--- /dev/null
+++ b/arch/arm/mach-mx25/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x80008000
2params_phys-y := 0x80000100
3initrd_phys-y := 0x80800000
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c
new file mode 100644
index 000000000000..ef26951a5275
--- /dev/null
+++ b/arch/arm/mach-mx25/clock.c
@@ -0,0 +1,219 @@
1/*
2 * Copyright (C) 2009 by Sascha Hauer, Pengutronix
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/list.h>
22#include <linux/clk.h>
23#include <linux/io.h>
24
25#include <asm/clkdev.h>
26
27#include <mach/clock.h>
28#include <mach/hardware.h>
29#include <mach/common.h>
30#include <mach/mx25.h>
31
32#define CRM_BASE MX25_IO_ADDRESS(MX25_CRM_BASE_ADDR)
33
34#define CCM_MPCTL 0x00
35#define CCM_UPCTL 0x04
36#define CCM_CCTL 0x08
37#define CCM_CGCR0 0x0C
38#define CCM_CGCR1 0x10
39#define CCM_CGCR2 0x14
40#define CCM_PCDR0 0x18
41#define CCM_PCDR1 0x1C
42#define CCM_PCDR2 0x20
43#define CCM_PCDR3 0x24
44#define CCM_RCSR 0x28
45#define CCM_CRDR 0x2C
46#define CCM_DCVR0 0x30
47#define CCM_DCVR1 0x34
48#define CCM_DCVR2 0x38
49#define CCM_DCVR3 0x3c
50#define CCM_LTR0 0x40
51#define CCM_LTR1 0x44
52#define CCM_LTR2 0x48
53#define CCM_LTR3 0x4c
54
55static unsigned long get_rate_mpll(void)
56{
57 ulong mpctl = __raw_readl(CRM_BASE + CCM_MPCTL);
58
59 return mxc_decode_pll(mpctl, 24000000);
60}
61
62static unsigned long get_rate_upll(void)
63{
64 ulong mpctl = __raw_readl(CRM_BASE + CCM_UPCTL);
65
66 return mxc_decode_pll(mpctl, 24000000);
67}
68
69unsigned long get_rate_arm(struct clk *clk)
70{
71 unsigned long cctl = readl(CRM_BASE + CCM_CCTL);
72 unsigned long rate = get_rate_mpll();
73
74 if (cctl & (1 << 14))
75 rate = (rate * 3) >> 1;
76
77 return rate / ((cctl >> 30) + 1);
78}
79
80static unsigned long get_rate_ahb(struct clk *clk)
81{
82 unsigned long cctl = readl(CRM_BASE + CCM_CCTL);
83
84 return get_rate_arm(NULL) / (((cctl >> 28) & 0x3) + 1);
85}
86
87static unsigned long get_rate_ipg(struct clk *clk)
88{
89 return get_rate_ahb(NULL) >> 1;
90}
91
92static unsigned long get_rate_per(int per)
93{
94 unsigned long ofs = (per & 0x3) * 8;
95 unsigned long reg = per & ~0x3;
96 unsigned long val = (readl(CRM_BASE + CCM_PCDR0 + reg) >> ofs) & 0x3f;
97 unsigned long fref;
98
99 if (readl(CRM_BASE + 0x64) & (1 << per))
100 fref = get_rate_upll();
101 else
102 fref = get_rate_ipg(NULL);
103
104 return fref / (val + 1);
105}
106
107static unsigned long get_rate_uart(struct clk *clk)
108{
109 return get_rate_per(15);
110}
111
112static unsigned long get_rate_i2c(struct clk *clk)
113{
114 return get_rate_per(6);
115}
116
117static unsigned long get_rate_nfc(struct clk *clk)
118{
119 return get_rate_per(8);
120}
121
122static unsigned long get_rate_otg(struct clk *clk)
123{
124 return 48000000; /* FIXME */
125}
126
127static int clk_cgcr_enable(struct clk *clk)
128{
129 u32 reg;
130
131 reg = __raw_readl(clk->enable_reg);
132 reg |= 1 << clk->enable_shift;
133 __raw_writel(reg, clk->enable_reg);
134
135 return 0;
136}
137
138static void clk_cgcr_disable(struct clk *clk)
139{
140 u32 reg;
141
142 reg = __raw_readl(clk->enable_reg);
143 reg &= ~(1 << clk->enable_shift);
144 __raw_writel(reg, clk->enable_reg);
145}
146
147#define DEFINE_CLOCK(name, i, er, es, gr, sr) \
148 static struct clk name = { \
149 .id = i, \
150 .enable_reg = CRM_BASE + er, \
151 .enable_shift = es, \
152 .get_rate = gr, \
153 .set_rate = sr, \
154 .enable = clk_cgcr_enable, \
155 .disable = clk_cgcr_disable, \
156 }
157
158DEFINE_CLOCK(gpt_clk, 0, CCM_CGCR0, 5, get_rate_ipg, NULL);
159DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL);
160DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL);
161DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL);
162DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL);
163DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL);
164DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL);
165DEFINE_CLOCK(uart4_clk, 0, CCM_CGCR2, 17, get_rate_uart, NULL);
166DEFINE_CLOCK(uart5_clk, 0, CCM_CGCR2, 18, get_rate_uart, NULL);
167DEFINE_CLOCK(nfc_clk, 0, CCM_CGCR0, 8, get_rate_nfc, NULL);
168DEFINE_CLOCK(usbotg_clk, 0, CCM_CGCR0, 28, get_rate_otg, NULL);
169DEFINE_CLOCK(pwm1_clk, 0, CCM_CGCR1, 31, get_rate_ipg, NULL);
170DEFINE_CLOCK(pwm2_clk, 0, CCM_CGCR2, 0, get_rate_ipg, NULL);
171DEFINE_CLOCK(pwm3_clk, 0, CCM_CGCR2, 1, get_rate_ipg, NULL);
172DEFINE_CLOCK(pwm4_clk, 0, CCM_CGCR2, 2, get_rate_ipg, NULL);
173DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL);
174DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL);
175DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL);
176
177#define _REGISTER_CLOCK(d, n, c) \
178 { \
179 .dev_id = d, \
180 .con_id = n, \
181 .clk = &c, \
182 },
183
184static struct clk_lookup lookups[] = {
185 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
186 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
187 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
188 _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk)
189 _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk)
190 _REGISTER_CLOCK("mxc-ehci.0", "usb", usbotg_clk)
191 _REGISTER_CLOCK("mxc-ehci.1", "usb", usbotg_clk)
192 _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk)
193 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
194 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
195 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
196 _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
197 _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
198 _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk)
199 _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk)
200 _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk)
201 _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk)
202 _REGISTER_CLOCK("mxc-keypad", NULL, kpp_clk)
203 _REGISTER_CLOCK("mx25-adc", NULL, tsc_clk)
204 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
205 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk)
206 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
207};
208
209int __init mx25_clocks_init(unsigned long fref)
210{
211 int i;
212
213 for (i = 0; i < ARRAY_SIZE(lookups); i++)
214 clkdev_add(&lookups[i]);
215
216 mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54);
217
218 return 0;
219}
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
new file mode 100644
index 000000000000..eb12de1da42d
--- /dev/null
+++ b/arch/arm/mach-mx25/devices.c
@@ -0,0 +1,402 @@
1#include <linux/platform_device.h>
2#include <linux/gpio.h>
3#include <mach/mx25.h>
4#include <mach/irqs.h>
5
6static struct resource uart0[] = {
7 {
8 .start = 0x43f90000,
9 .end = 0x43f93fff,
10 .flags = IORESOURCE_MEM,
11 }, {
12 .start = 45,
13 .end = 45,
14 .flags = IORESOURCE_IRQ,
15 },
16};
17
18struct platform_device mxc_uart_device0 = {
19 .name = "imx-uart",
20 .id = 0,
21 .resource = uart0,
22 .num_resources = ARRAY_SIZE(uart0),
23};
24
25static struct resource uart1[] = {
26 {
27 .start = 0x43f94000,
28 .end = 0x43f97fff,
29 .flags = IORESOURCE_MEM,
30 }, {
31 .start = 32,
32 .end = 32,
33 .flags = IORESOURCE_IRQ,
34 },
35};
36
37struct platform_device mxc_uart_device1 = {
38 .name = "imx-uart",
39 .id = 1,
40 .resource = uart1,
41 .num_resources = ARRAY_SIZE(uart1),
42};
43
44static struct resource uart2[] = {
45 {
46 .start = 0x5000c000,
47 .end = 0x5000ffff,
48 .flags = IORESOURCE_MEM,
49 }, {
50 .start = 18,
51 .end = 18,
52 .flags = IORESOURCE_IRQ,
53 },
54};
55
56struct platform_device mxc_uart_device2 = {
57 .name = "imx-uart",
58 .id = 2,
59 .resource = uart2,
60 .num_resources = ARRAY_SIZE(uart2),
61};
62
63static struct resource uart3[] = {
64 {
65 .start = 0x50008000,
66 .end = 0x5000bfff,
67 .flags = IORESOURCE_MEM,
68 }, {
69 .start = 5,
70 .end = 5,
71 .flags = IORESOURCE_IRQ,
72 },
73};
74
75struct platform_device mxc_uart_device3 = {
76 .name = "imx-uart",
77 .id = 3,
78 .resource = uart3,
79 .num_resources = ARRAY_SIZE(uart3),
80};
81
82static struct resource uart4[] = {
83 {
84 .start = 0x5002c000,
85 .end = 0x5002ffff,
86 .flags = IORESOURCE_MEM,
87 }, {
88 .start = 40,
89 .end = 40,
90 .flags = IORESOURCE_IRQ,
91 },
92};
93
94struct platform_device mxc_uart_device4 = {
95 .name = "imx-uart",
96 .id = 4,
97 .resource = uart4,
98 .num_resources = ARRAY_SIZE(uart4),
99};
100
101#define MX25_OTG_BASE_ADDR 0x53FF4000
102
103static u64 otg_dmamask = DMA_BIT_MASK(32);
104
105static struct resource mxc_otg_resources[] = {
106 {
107 .start = MX25_OTG_BASE_ADDR,
108 .end = MX25_OTG_BASE_ADDR + 0x1ff,
109 .flags = IORESOURCE_MEM,
110 }, {
111 .start = 37,
112 .end = 37,
113 .flags = IORESOURCE_IRQ,
114 },
115};
116
117struct platform_device mxc_otg = {
118 .name = "mxc-ehci",
119 .id = 0,
120 .dev = {
121 .coherent_dma_mask = 0xffffffff,
122 .dma_mask = &otg_dmamask,
123 },
124 .resource = mxc_otg_resources,
125 .num_resources = ARRAY_SIZE(mxc_otg_resources),
126};
127
128/* OTG gadget device */
129struct platform_device otg_udc_device = {
130 .name = "fsl-usb2-udc",
131 .id = -1,
132 .dev = {
133 .dma_mask = &otg_dmamask,
134 .coherent_dma_mask = 0xffffffff,
135 },
136 .resource = mxc_otg_resources,
137 .num_resources = ARRAY_SIZE(mxc_otg_resources),
138};
139
140static u64 usbh2_dmamask = DMA_BIT_MASK(32);
141
142static struct resource mxc_usbh2_resources[] = {
143 {
144 .start = MX25_OTG_BASE_ADDR + 0x400,
145 .end = MX25_OTG_BASE_ADDR + 0x5ff,
146 .flags = IORESOURCE_MEM,
147 }, {
148 .start = 35,
149 .end = 35,
150 .flags = IORESOURCE_IRQ,
151 },
152};
153
154struct platform_device mxc_usbh2 = {
155 .name = "mxc-ehci",
156 .id = 1,
157 .dev = {
158 .coherent_dma_mask = 0xffffffff,
159 .dma_mask = &usbh2_dmamask,
160 },
161 .resource = mxc_usbh2_resources,
162 .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
163};
164
165static struct resource mxc_spi_resources0[] = {
166 {
167 .start = 0x43fa4000,
168 .end = 0x43fa7fff,
169 .flags = IORESOURCE_MEM,
170 }, {
171 .start = 14,
172 .end = 14,
173 .flags = IORESOURCE_IRQ,
174 },
175};
176
177struct platform_device mxc_spi_device0 = {
178 .name = "spi_imx",
179 .id = 0,
180 .num_resources = ARRAY_SIZE(mxc_spi_resources0),
181 .resource = mxc_spi_resources0,
182};
183
184static struct resource mxc_spi_resources1[] = {
185 {
186 .start = 0x50010000,
187 .end = 0x50013fff,
188 .flags = IORESOURCE_MEM,
189 }, {
190 .start = 13,
191 .end = 13,
192 .flags = IORESOURCE_IRQ,
193 },
194};
195
196struct platform_device mxc_spi_device1 = {
197 .name = "spi_imx",
198 .id = 1,
199 .num_resources = ARRAY_SIZE(mxc_spi_resources1),
200 .resource = mxc_spi_resources1,
201};
202
203static struct resource mxc_spi_resources2[] = {
204 {
205 .start = 0x50004000,
206 .end = 0x50007fff,
207 .flags = IORESOURCE_MEM,
208 }, {
209 .start = 0,
210 .end = 0,
211 .flags = IORESOURCE_IRQ,
212 },
213};
214
215struct platform_device mxc_spi_device2 = {
216 .name = "spi_imx",
217 .id = 2,
218 .num_resources = ARRAY_SIZE(mxc_spi_resources2),
219 .resource = mxc_spi_resources2,
220};
221
222static struct resource mxc_pwm_resources0[] = {
223 {
224 .start = 0x53fe0000,
225 .end = 0x53fe3fff,
226 .flags = IORESOURCE_MEM,
227 }, {
228 .start = 26,
229 .end = 26,
230 .flags = IORESOURCE_IRQ,
231 }
232};
233
234struct platform_device mxc_pwm_device0 = {
235 .name = "mxc_pwm",
236 .id = 0,
237 .num_resources = ARRAY_SIZE(mxc_pwm_resources0),
238 .resource = mxc_pwm_resources0,
239};
240
241static struct resource mxc_pwm_resources1[] = {
242 {
243 .start = 0x53fa0000,
244 .end = 0x53fa3fff,
245 .flags = IORESOURCE_MEM,
246 }, {
247 .start = 36,
248 .end = 36,
249 .flags = IORESOURCE_IRQ,
250 }
251};
252
253struct platform_device mxc_pwm_device1 = {
254 .name = "mxc_pwm",
255 .id = 1,
256 .num_resources = ARRAY_SIZE(mxc_pwm_resources1),
257 .resource = mxc_pwm_resources1,
258};
259
260static struct resource mxc_pwm_resources2[] = {
261 {
262 .start = 0x53fa8000,
263 .end = 0x53fabfff,
264 .flags = IORESOURCE_MEM,
265 }, {
266 .start = 41,
267 .end = 41,
268 .flags = IORESOURCE_IRQ,
269 }
270};
271
272struct platform_device mxc_pwm_device2 = {
273 .name = "mxc_pwm",
274 .id = 2,
275 .num_resources = ARRAY_SIZE(mxc_pwm_resources2),
276 .resource = mxc_pwm_resources2,
277};
278
279static struct resource mxc_keypad_resources[] = {
280 {
281 .start = 0x43fa8000,
282 .end = 0x43fabfff,
283 .flags = IORESOURCE_MEM,
284 }, {
285 .start = 24,
286 .end = 24,
287 .flags = IORESOURCE_IRQ,
288 }
289};
290
291struct platform_device mxc_keypad_device = {
292 .name = "mxc-keypad",
293 .id = -1,
294 .num_resources = ARRAY_SIZE(mxc_keypad_resources),
295 .resource = mxc_keypad_resources,
296};
297
298static struct resource mxc_pwm_resources3[] = {
299 {
300 .start = 0x53fc8000,
301 .end = 0x53fcbfff,
302 .flags = IORESOURCE_MEM,
303 }, {
304 .start = 42,
305 .end = 42,
306 .flags = IORESOURCE_IRQ,
307 }
308};
309
310struct platform_device mxc_pwm_device3 = {
311 .name = "mxc_pwm",
312 .id = 3,
313 .num_resources = ARRAY_SIZE(mxc_pwm_resources3),
314 .resource = mxc_pwm_resources3,
315};
316
317static struct resource mxc_i2c_1_resources[] = {
318 {
319 .start = 0x43f80000,
320 .end = 0x43f83fff,
321 .flags = IORESOURCE_MEM,
322 }, {
323 .start = 3,
324 .end = 3,
325 .flags = IORESOURCE_IRQ,
326 }
327};
328
329struct platform_device mxc_i2c_device0 = {
330 .name = "imx-i2c",
331 .id = 0,
332 .num_resources = ARRAY_SIZE(mxc_i2c_1_resources),
333 .resource = mxc_i2c_1_resources,
334};
335
336static struct resource mxc_i2c_2_resources[] = {
337 {
338 .start = 0x43f98000,
339 .end = 0x43f9bfff,
340 .flags = IORESOURCE_MEM,
341 }, {
342 .start = 4,
343 .end = 4,
344 .flags = IORESOURCE_IRQ,
345 }
346};
347
348struct platform_device mxc_i2c_device1 = {
349 .name = "imx-i2c",
350 .id = 1,
351 .num_resources = ARRAY_SIZE(mxc_i2c_2_resources),
352 .resource = mxc_i2c_2_resources,
353};
354
355static struct resource mxc_i2c_3_resources[] = {
356 {
357 .start = 0x43f84000,
358 .end = 0x43f87fff,
359 .flags = IORESOURCE_MEM,
360 }, {
361 .start = 10,
362 .end = 10,
363 .flags = IORESOURCE_IRQ,
364 }
365};
366
367struct platform_device mxc_i2c_device2 = {
368 .name = "imx-i2c",
369 .id = 2,
370 .num_resources = ARRAY_SIZE(mxc_i2c_3_resources),
371 .resource = mxc_i2c_3_resources,
372};
373
374static struct mxc_gpio_port imx_gpio_ports[] = {
375 {
376 .chip.label = "gpio-0",
377 .base = (void __iomem *)MX25_GPIO1_BASE_ADDR_VIRT,
378 .irq = 52,
379 .virtual_irq_start = MXC_GPIO_IRQ_START,
380 }, {
381 .chip.label = "gpio-1",
382 .base = (void __iomem *)MX25_GPIO2_BASE_ADDR_VIRT,
383 .irq = 51,
384 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
385 }, {
386 .chip.label = "gpio-2",
387 .base = (void __iomem *)MX25_GPIO3_BASE_ADDR_VIRT,
388 .irq = 16,
389 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
390 }, {
391 .chip.label = "gpio-3",
392 .base = (void __iomem *)MX25_GPIO4_BASE_ADDR_VIRT,
393 .irq = 23,
394 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
395 }
396};
397
398int __init mxc_register_gpios(void)
399{
400 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
401}
402
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h
new file mode 100644
index 000000000000..fe6bf88ad1dd
--- /dev/null
+++ b/arch/arm/mach-mx25/devices.h
@@ -0,0 +1,19 @@
1extern struct platform_device mxc_uart_device0;
2extern struct platform_device mxc_uart_device1;
3extern struct platform_device mxc_uart_device2;
4extern struct platform_device mxc_uart_device3;
5extern struct platform_device mxc_uart_device4;
6extern struct platform_device mxc_otg;
7extern struct platform_device otg_udc_device;
8extern struct platform_device mxc_usbh2;
9extern struct platform_device mxc_spi_device0;
10extern struct platform_device mxc_spi_device1;
11extern struct platform_device mxc_spi_device2;
12extern struct platform_device mxc_pwm_device0;
13extern struct platform_device mxc_pwm_device1;
14extern struct platform_device mxc_pwm_device2;
15extern struct platform_device mxc_pwm_device3;
16extern struct platform_device mxc_keypad_device;
17extern struct platform_device mxc_i2c_device0;
18extern struct platform_device mxc_i2c_device1;
19extern struct platform_device mxc_i2c_device2;
diff --git a/arch/arm/mach-mx25/mm.c b/arch/arm/mach-mx25/mm.c
new file mode 100644
index 000000000000..a7e587ff3e9e
--- /dev/null
+++ b/arch/arm/mach-mx25/mm.c
@@ -0,0 +1,76 @@
1/*
2 * Copyright (C) 1999,2000 Arm Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
5 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6 * - add MX31 specific definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <linux/mm.h>
24#include <linux/init.h>
25#include <linux/err.h>
26
27#include <asm/pgtable.h>
28#include <asm/mach/map.h>
29
30#include <mach/common.h>
31#include <mach/hardware.h>
32#include <mach/mx25.h>
33#include <mach/iomux-v3.h>
34
35/*
36 * This table defines static virtual address mappings for I/O regions.
37 * These are the mappings common across all MX3 boards.
38 */
39static struct map_desc mxc_io_desc[] __initdata = {
40 {
41 .virtual = MX25_AVIC_BASE_ADDR_VIRT,
42 .pfn = __phys_to_pfn(MX25_AVIC_BASE_ADDR),
43 .length = MX25_AVIC_SIZE,
44 .type = MT_DEVICE_NONSHARED
45 }, {
46 .virtual = MX25_AIPS1_BASE_ADDR_VIRT,
47 .pfn = __phys_to_pfn(MX25_AIPS1_BASE_ADDR),
48 .length = MX25_AIPS1_SIZE,
49 .type = MT_DEVICE_NONSHARED
50 }, {
51 .virtual = MX25_AIPS2_BASE_ADDR_VIRT,
52 .pfn = __phys_to_pfn(MX25_AIPS2_BASE_ADDR),
53 .length = MX25_AIPS2_SIZE,
54 .type = MT_DEVICE_NONSHARED
55 },
56};
57
58/*
59 * This function initializes the memory map. It is called during the
60 * system startup to create static physical to virtual memory mappings
61 * for the IO modules.
62 */
63void __init mx25_map_io(void)
64{
65 mxc_set_cpu_type(MXC_CPU_MX25);
66 mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR));
67 mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR));
68
69 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
70}
71
72void __init mx25_init_irq(void)
73{
74 mxc_init_irq((void __iomem *)MX25_AVIC_BASE_ADDR_VIRT);
75}
76
diff --git a/arch/arm/mach-mx25/mx25pdk.c b/arch/arm/mach-mx25/mx25pdk.c
new file mode 100644
index 000000000000..92aa4fd19d99
--- /dev/null
+++ b/arch/arm/mach-mx25/mx25pdk.c
@@ -0,0 +1,58 @@
1#include <linux/types.h>
2#include <linux/init.h>
3#include <linux/clk.h>
4#include <linux/irq.h>
5#include <linux/gpio.h>
6#include <linux/smsc911x.h>
7#include <linux/platform_device.h>
8
9#include <mach/hardware.h>
10#include <asm/mach-types.h>
11#include <asm/mach/arch.h>
12#include <asm/mach/time.h>
13#include <asm/memory.h>
14#include <asm/mach/map.h>
15#include <mach/common.h>
16#include <mach/imx-uart.h>
17#include <mach/mx25.h>
18#include <mach/mxc_nand.h>
19#include "devices.h"
20#include <mach/iomux-v3.h>
21
22static struct imxuart_platform_data uart_pdata = {
23 .flags = IMXUART_HAVE_RTSCTS,
24};
25
26static struct mxc_nand_platform_data nand_board_info = {
27 .width = 1,
28 .hw_ecc = 1,
29};
30
31static void __init mx25pdk_init(void)
32{
33 mxc_register_device(&mxc_uart_device0, &uart_pdata);
34 mxc_register_device(&mxc_usbh2, NULL);
35 mxc_register_device(&mxc_nand_device, &nand_board_info);
36}
37
38
39static void __init mx25pdk_timer_init(void)
40{
41 mx25_clocks_init(26000000);
42}
43
44static struct sys_timer mx25pdk_timer = {
45 .init = mx25pdk_timer_init,
46};
47
48MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
49 /* Maintainer: Freescale Semiconductor, Inc. */
50 .phys_io = MX25_AIPS1_BASE_ADDR,
51 .io_pg_offst = ((MX25_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
52 .boot_params = PHYS_OFFSET + 0x100,
53 .map_io = mx25_map_io,
54 .init_irq = mx25_init_irq,
55 .init_machine = mx25pdk_init,
56 .timer = &mx25pdk_timer,
57MACHINE_END
58
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 17a21a291e2f..851f2458bf65 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -36,6 +36,14 @@ config MACH_PCM037
36 Include support for Phytec pcm037 platform. This includes 36 Include support for Phytec pcm037 platform. This includes
37 specific configurations for the board and its peripherals. 37 specific configurations for the board and its peripherals.
38 38
39config MACH_PCM037_EET
40 bool "Support pcm037 EET board extensions"
41 depends on MACH_PCM037
42 help
43 Add support for PCM037 EET baseboard extensions. If you are using the
44 OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel
45 command-line parameter.
46
39config MACH_MX31LITE 47config MACH_MX31LITE
40 bool "Support MX31 LITEKIT (LogicPD)" 48 bool "Support MX31 LITEKIT (LogicPD)"
41 select ARCH_MX31 49 select ARCH_MX31
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 0322696bd11a..6b9775471be6 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o 11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
13obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o
14obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
15obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \ 16obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
16 mx31moboard-marxbot.o 17 mx31moboard-marxbot.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
index 541181090b37..776c0ee1b3cd 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -31,6 +31,8 @@
31#include <linux/smsc911x.h> 31#include <linux/smsc911x.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/mtd/physmap.h>
35#include <linux/io.h>
34 36
35#include <mach/hardware.h> 37#include <mach/hardware.h>
36#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -46,8 +48,10 @@
46#include <mach/mmc.h> 48#include <mach/mmc.h>
47#include <mach/ipu.h> 49#include <mach/ipu.h>
48#include <mach/mx3fb.h> 50#include <mach/mx3fb.h>
51#include <mach/mxc_nand.h>
49 52
50#include "devices.h" 53#include "devices.h"
54#include "crm_regs.h"
51 55
52static int armadillo5x0_pins[] = { 56static int armadillo5x0_pins[] = {
53 /* UART1 */ 57 /* UART1 */
@@ -93,7 +97,56 @@ static int armadillo5x0_pins[] = {
93 MX31_PIN_FPSHIFT__FPSHIFT, 97 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0, 98 MX31_PIN_DRDY0__DRDY0,
95 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ 99 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
100};
96 101
102/*
103 * NAND Flash
104 */
105static struct mxc_nand_platform_data armadillo5x0_nand_flash_pdata = {
106 .width = 1,
107 .hw_ecc = 1,
108};
109
110/*
111 * MTD NOR Flash
112 */
113static struct mtd_partition armadillo5x0_nor_flash_partitions[] = {
114 {
115 .name = "nor.bootloader",
116 .offset = 0x00000000,
117 .size = 4*32*1024,
118 }, {
119 .name = "nor.kernel",
120 .offset = MTDPART_OFS_APPEND,
121 .size = 16*128*1024,
122 }, {
123 .name = "nor.userland",
124 .offset = MTDPART_OFS_APPEND,
125 .size = 110*128*1024,
126 }, {
127 .name = "nor.config",
128 .offset = MTDPART_OFS_APPEND,
129 .size = 1*128*1024,
130 },
131};
132
133static struct physmap_flash_data armadillo5x0_nor_flash_pdata = {
134 .width = 2,
135 .parts = armadillo5x0_nor_flash_partitions,
136 .nr_parts = ARRAY_SIZE(armadillo5x0_nor_flash_partitions),
137};
138
139static struct resource armadillo5x0_nor_flash_resource = {
140 .flags = IORESOURCE_MEM,
141 .start = CS0_BASE_ADDR,
142 .end = CS0_BASE_ADDR + SZ_64M - 1,
143};
144
145static struct platform_device armadillo5x0_nor_flash = {
146 .name = "physmap-flash",
147 .id = -1,
148 .num_resources = 1,
149 .resource = &armadillo5x0_nor_flash_resource,
97}; 150};
98 151
99/* 152/*
@@ -272,6 +325,16 @@ static void __init armadillo5x0_init(void)
272 /* Register FB */ 325 /* Register FB */
273 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 326 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
274 mxc_register_device(&mx3_fb, &mx3fb_pdata); 327 mxc_register_device(&mx3_fb, &mx3fb_pdata);
328
329 /* Register NOR Flash */
330 mxc_register_device(&armadillo5x0_nor_flash,
331 &armadillo5x0_nor_flash_pdata);
332
333 /* Register NAND Flash */
334 mxc_register_device(&mxc_nand_device, &armadillo5x0_nand_flash_pdata);
335
336 /* set NAND page size to 2k if not configured via boot mode pins */
337 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
275} 338}
276 339
277static void __init armadillo5x0_timer_init(void) 340static void __init armadillo5x0_timer_init(void)
@@ -289,7 +352,7 @@ MACHINE_START(ARMADILLO5X0, "Armadillo-500")
289 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 352 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
290 .boot_params = PHYS_OFFSET + 0x00000100, 353 .boot_params = PHYS_OFFSET + 0x00000100,
291 .map_io = mx31_map_io, 354 .map_io = mx31_map_io,
292 .init_irq = mxc_init_irq, 355 .init_irq = mx31_init_irq,
293 .timer = &armadillo5x0_timer, 356 .timer = &armadillo5x0_timer,
294 .init_machine = armadillo5x0_init, 357 .init_machine = armadillo5x0_init,
295MACHINE_END 358MACHINE_END
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 577ee83d1f60..fe5c4217322e 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -273,6 +273,19 @@ static unsigned long get_rate_csi(struct clk *clk)
273 return rate / get_3_3_div((pdr2 >> 16) & 0x3f); 273 return rate / get_3_3_div((pdr2 >> 16) & 0x3f);
274} 274}
275 275
276static unsigned long get_rate_otg(struct clk *clk)
277{
278 unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4);
279 unsigned long rate;
280
281 if (pdr4 & (1 << 9))
282 rate = get_rate_arm();
283 else
284 rate = get_rate_ppll();
285
286 return rate / get_3_3_div((pdr4 >> 22) & 0x3f);
287}
288
276static unsigned long get_rate_ipg_per(struct clk *clk) 289static unsigned long get_rate_ipg_per(struct clk *clk)
277{ 290{
278 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); 291 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
@@ -365,7 +378,7 @@ DEFINE_CLOCK(ssi2_clk, 1, CCM_CGR2, 14, get_rate_ssi, NULL);
365DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL); 378DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL);
366DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL); 379DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL);
367DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL); 380DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL);
368DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, NULL, NULL); 381DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL);
369DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); 382DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL);
370DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); 383DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL);
371DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL); 384DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL);
@@ -426,7 +439,10 @@ static struct clk_lookup lookups[] = {
426 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 439 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
427 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 440 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
428 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 441 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
429 _REGISTER_CLOCK(NULL, "usbotg", usbotg_clk) 442 _REGISTER_CLOCK("mxc-ehci.0", "usb", usbotg_clk)
443 _REGISTER_CLOCK("mxc-ehci.1", "usb", usbotg_clk)
444 _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk)
445 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
430 _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk) 446 _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk)
431 _REGISTER_CLOCK(NULL, "max", max_clk) 447 _REGISTER_CLOCK(NULL, "max", max_clk)
432 _REGISTER_CLOCK(NULL, "admux", admux_clk) 448 _REGISTER_CLOCK(NULL, "admux", admux_clk)
@@ -456,7 +472,7 @@ int __init mx35_clocks_init()
456 __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2); 472 __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2);
457 __raw_writel(0, CCM_BASE + CCM_CGR3); 473 __raw_writel(0, CCM_BASE + CCM_CGR3);
458 474
459 mxc_timer_init(&gpt_clk); 475 mxc_timer_init(&gpt_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT);
460 476
461 return 0; 477 return 0;
462} 478}
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index 8b14239724c9..06bd6180bfc3 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -29,6 +29,7 @@
29 29
30#include <mach/clock.h> 30#include <mach/clock.h>
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/mx31.h>
32#include <mach/common.h> 33#include <mach/common.h>
33 34
34#include "crm_regs.h" 35#include "crm_regs.h"
@@ -402,6 +403,11 @@ static unsigned long clk_ckih_get_rate(struct clk *clk)
402 return ckih_rate; 403 return ckih_rate;
403} 404}
404 405
406static unsigned long clk_ckil_get_rate(struct clk *clk)
407{
408 return CKIL_CLK_FREQ;
409}
410
405static struct clk ckih_clk = { 411static struct clk ckih_clk = {
406 .get_rate = clk_ckih_get_rate, 412 .get_rate = clk_ckih_get_rate,
407}; 413};
@@ -508,6 +514,7 @@ DEFINE_CLOCK(usb_clk1, 0, NULL, 0, usb_get_rate, NULL, &usb_pll_clk)
508DEFINE_CLOCK(nfc_clk, 0, NULL, 0, nfc_get_rate, NULL, &ahb_clk); 514DEFINE_CLOCK(nfc_clk, 0, NULL, 0, nfc_get_rate, NULL, &ahb_clk);
509DEFINE_CLOCK(scc_clk, 0, NULL, 0, NULL, NULL, &ipg_clk); 515DEFINE_CLOCK(scc_clk, 0, NULL, 0, NULL, NULL, &ipg_clk);
510DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk); 516DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk);
517DEFINE_CLOCK(ckil_clk, 0, NULL, 0, clk_ckil_get_rate, NULL, NULL);
511 518
512#define _REGISTER_CLOCK(d, n, c) \ 519#define _REGISTER_CLOCK(d, n, c) \
513 { \ 520 { \
@@ -518,9 +525,9 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk);
518 525
519static struct clk_lookup lookups[] = { 526static struct clk_lookup lookups[] = {
520 _REGISTER_CLOCK(NULL, "emi", emi_clk) 527 _REGISTER_CLOCK(NULL, "emi", emi_clk)
521 _REGISTER_CLOCK(NULL, "cspi", cspi1_clk) 528 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
522 _REGISTER_CLOCK(NULL, "cspi", cspi2_clk) 529 _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
523 _REGISTER_CLOCK(NULL, "cspi", cspi3_clk) 530 _REGISTER_CLOCK("spi_imx.2", NULL, cspi3_clk)
524 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 531 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
525 _REGISTER_CLOCK(NULL, "pwm", pwm_clk) 532 _REGISTER_CLOCK(NULL, "pwm", pwm_clk)
526 _REGISTER_CLOCK(NULL, "wdog", wdog_clk) 533 _REGISTER_CLOCK(NULL, "wdog", wdog_clk)
@@ -531,6 +538,12 @@ static struct clk_lookup lookups[] = {
531 _REGISTER_CLOCK("ipu-core", NULL, ipu_clk) 538 _REGISTER_CLOCK("ipu-core", NULL, ipu_clk)
532 _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk) 539 _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk)
533 _REGISTER_CLOCK(NULL, "kpp", kpp_clk) 540 _REGISTER_CLOCK(NULL, "kpp", kpp_clk)
541 _REGISTER_CLOCK("mxc-ehci.0", "usb", usb_clk1)
542 _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", usb_clk2)
543 _REGISTER_CLOCK("mxc-ehci.1", "usb", usb_clk1)
544 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk2)
545 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk1)
546 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk2)
534 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk1) 547 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk1)
535 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk2) 548 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk2)
536 _REGISTER_CLOCK("mx3-camera.0", NULL, csi_clk) 549 _REGISTER_CLOCK("mx3-camera.0", NULL, csi_clk)
@@ -559,6 +572,7 @@ static struct clk_lookup lookups[] = {
559 _REGISTER_CLOCK(NULL, "iim", iim_clk) 572 _REGISTER_CLOCK(NULL, "iim", iim_clk)
560 _REGISTER_CLOCK(NULL, "mpeg4", mpeg4_clk) 573 _REGISTER_CLOCK(NULL, "mpeg4", mpeg4_clk)
561 _REGISTER_CLOCK(NULL, "mbx", mbx_clk) 574 _REGISTER_CLOCK(NULL, "mbx", mbx_clk)
575 _REGISTER_CLOCK("mxc_rtc", NULL, ckil_clk)
562}; 576};
563 577
564int __init mx31_clocks_init(unsigned long fref) 578int __init mx31_clocks_init(unsigned long fref)
@@ -609,7 +623,7 @@ int __init mx31_clocks_init(unsigned long fref)
609 __raw_writel(reg, MXC_CCM_PMCR1); 623 __raw_writel(reg, MXC_CCM_PMCR1);
610 } 624 }
611 625
612 mxc_timer_init(&ipg_clk); 626 mxc_timer_init(&ipg_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT);
613 627
614 return 0; 628 return 0;
615} 629}
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 9e87e08fb121..8a577f367250 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -129,19 +129,17 @@ struct platform_device mxc_uart_device4 = {
129 129
130/* GPIO port description */ 130/* GPIO port description */
131static struct mxc_gpio_port imx_gpio_ports[] = { 131static struct mxc_gpio_port imx_gpio_ports[] = {
132 [0] = { 132 {
133 .chip.label = "gpio-0", 133 .chip.label = "gpio-0",
134 .base = IO_ADDRESS(GPIO1_BASE_ADDR), 134 .base = IO_ADDRESS(GPIO1_BASE_ADDR),
135 .irq = MXC_INT_GPIO1, 135 .irq = MXC_INT_GPIO1,
136 .virtual_irq_start = MXC_GPIO_IRQ_START, 136 .virtual_irq_start = MXC_GPIO_IRQ_START,
137 }, 137 }, {
138 [1] = {
139 .chip.label = "gpio-1", 138 .chip.label = "gpio-1",
140 .base = IO_ADDRESS(GPIO2_BASE_ADDR), 139 .base = IO_ADDRESS(GPIO2_BASE_ADDR),
141 .irq = MXC_INT_GPIO2, 140 .irq = MXC_INT_GPIO2,
142 .virtual_irq_start = MXC_GPIO_IRQ_START + 32, 141 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
143 }, 142 }, {
144 [2] = {
145 .chip.label = "gpio-2", 143 .chip.label = "gpio-2",
146 .base = IO_ADDRESS(GPIO3_BASE_ADDR), 144 .base = IO_ADDRESS(GPIO3_BASE_ADDR),
147 .irq = MXC_INT_GPIO3, 145 .irq = MXC_INT_GPIO3,
@@ -173,11 +171,11 @@ static struct resource mxc_nand_resources[] = {
173 { 171 {
174 .start = 0, /* runtime dependent */ 172 .start = 0, /* runtime dependent */
175 .end = 0, 173 .end = 0,
176 .flags = IORESOURCE_MEM 174 .flags = IORESOURCE_MEM,
177 }, { 175 }, {
178 .start = MXC_INT_NANDFC, 176 .start = MXC_INT_NANDFC,
179 .end = MXC_INT_NANDFC, 177 .end = MXC_INT_NANDFC,
180 .flags = IORESOURCE_IRQ 178 .flags = IORESOURCE_IRQ,
181 }, 179 },
182}; 180};
183 181
@@ -193,8 +191,7 @@ static struct resource mxc_i2c0_resources[] = {
193 .start = I2C_BASE_ADDR, 191 .start = I2C_BASE_ADDR,
194 .end = I2C_BASE_ADDR + SZ_4K - 1, 192 .end = I2C_BASE_ADDR + SZ_4K - 1,
195 .flags = IORESOURCE_MEM, 193 .flags = IORESOURCE_MEM,
196 }, 194 }, {
197 {
198 .start = MXC_INT_I2C, 195 .start = MXC_INT_I2C,
199 .end = MXC_INT_I2C, 196 .end = MXC_INT_I2C,
200 .flags = IORESOURCE_IRQ, 197 .flags = IORESOURCE_IRQ,
@@ -213,8 +210,7 @@ static struct resource mxc_i2c1_resources[] = {
213 .start = I2C2_BASE_ADDR, 210 .start = I2C2_BASE_ADDR,
214 .end = I2C2_BASE_ADDR + SZ_4K - 1, 211 .end = I2C2_BASE_ADDR + SZ_4K - 1,
215 .flags = IORESOURCE_MEM, 212 .flags = IORESOURCE_MEM,
216 }, 213 }, {
217 {
218 .start = MXC_INT_I2C2, 214 .start = MXC_INT_I2C2,
219 .end = MXC_INT_I2C2, 215 .end = MXC_INT_I2C2,
220 .flags = IORESOURCE_IRQ, 216 .flags = IORESOURCE_IRQ,
@@ -233,8 +229,7 @@ static struct resource mxc_i2c2_resources[] = {
233 .start = I2C3_BASE_ADDR, 229 .start = I2C3_BASE_ADDR,
234 .end = I2C3_BASE_ADDR + SZ_4K - 1, 230 .end = I2C3_BASE_ADDR + SZ_4K - 1,
235 .flags = IORESOURCE_MEM, 231 .flags = IORESOURCE_MEM,
236 }, 232 }, {
237 {
238 .start = MXC_INT_I2C3, 233 .start = MXC_INT_I2C3,
239 .end = MXC_INT_I2C3, 234 .end = MXC_INT_I2C3,
240 .flags = IORESOURCE_IRQ, 235 .flags = IORESOURCE_IRQ,
@@ -371,8 +366,8 @@ struct platform_device mx3_camera = {
371 366
372static struct resource otg_resources[] = { 367static struct resource otg_resources[] = {
373 { 368 {
374 .start = OTG_BASE_ADDR, 369 .start = MX31_OTG_BASE_ADDR,
375 .end = OTG_BASE_ADDR + 0x1ff, 370 .end = MX31_OTG_BASE_ADDR + 0x1ff,
376 .flags = IORESOURCE_MEM, 371 .flags = IORESOURCE_MEM,
377 }, { 372 }, {
378 .start = MXC_INT_USB3, 373 .start = MXC_INT_USB3,
@@ -395,16 +390,142 @@ struct platform_device mxc_otg_udc_device = {
395 .num_resources = ARRAY_SIZE(otg_resources), 390 .num_resources = ARRAY_SIZE(otg_resources),
396}; 391};
397 392
393/* OTG host */
394struct platform_device mxc_otg_host = {
395 .name = "mxc-ehci",
396 .id = 0,
397 .dev = {
398 .coherent_dma_mask = 0xffffffff,
399 .dma_mask = &otg_dmamask,
400 },
401 .resource = otg_resources,
402 .num_resources = ARRAY_SIZE(otg_resources),
403};
404
405/* USB host 1 */
406
407static u64 usbh1_dmamask = ~(u32)0;
408
409static struct resource mxc_usbh1_resources[] = {
410 {
411 .start = MX31_OTG_BASE_ADDR + 0x200,
412 .end = MX31_OTG_BASE_ADDR + 0x3ff,
413 .flags = IORESOURCE_MEM,
414 }, {
415 .start = MXC_INT_USB1,
416 .end = MXC_INT_USB1,
417 .flags = IORESOURCE_IRQ,
418 },
419};
420
421struct platform_device mxc_usbh1 = {
422 .name = "mxc-ehci",
423 .id = 1,
424 .dev = {
425 .coherent_dma_mask = 0xffffffff,
426 .dma_mask = &usbh1_dmamask,
427 },
428 .resource = mxc_usbh1_resources,
429 .num_resources = ARRAY_SIZE(mxc_usbh1_resources),
430};
431
432/* USB host 2 */
433static u64 usbh2_dmamask = ~(u32)0;
434
435static struct resource mxc_usbh2_resources[] = {
436 {
437 .start = MX31_OTG_BASE_ADDR + 0x400,
438 .end = MX31_OTG_BASE_ADDR + 0x5ff,
439 .flags = IORESOURCE_MEM,
440 }, {
441 .start = MXC_INT_USB2,
442 .end = MXC_INT_USB2,
443 .flags = IORESOURCE_IRQ,
444 },
445};
446
447struct platform_device mxc_usbh2 = {
448 .name = "mxc-ehci",
449 .id = 2,
450 .dev = {
451 .coherent_dma_mask = 0xffffffff,
452 .dma_mask = &usbh2_dmamask,
453 },
454 .resource = mxc_usbh2_resources,
455 .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
456};
457
458/*
459 * SPI master controller
460 * 3 channels
461 */
462static struct resource imx_spi_0_resources[] = {
463 {
464 .start = CSPI1_BASE_ADDR,
465 .end = CSPI1_BASE_ADDR + SZ_4K - 1,
466 .flags = IORESOURCE_MEM,
467 }, {
468 .start = MXC_INT_CSPI1,
469 .end = MXC_INT_CSPI1,
470 .flags = IORESOURCE_IRQ,
471 },
472};
473
474static struct resource imx_spi_1_resources[] = {
475 {
476 .start = CSPI2_BASE_ADDR,
477 .end = CSPI2_BASE_ADDR + SZ_4K - 1,
478 .flags = IORESOURCE_MEM,
479 }, {
480 .start = MXC_INT_CSPI2,
481 .end = MXC_INT_CSPI2,
482 .flags = IORESOURCE_IRQ,
483 },
484};
485
486static struct resource imx_spi_2_resources[] = {
487 {
488 .start = CSPI3_BASE_ADDR,
489 .end = CSPI3_BASE_ADDR + SZ_4K - 1,
490 .flags = IORESOURCE_MEM,
491 }, {
492 .start = MXC_INT_CSPI3,
493 .end = MXC_INT_CSPI3,
494 .flags = IORESOURCE_IRQ,
495 },
496};
497
498struct platform_device imx_spi_device0 = {
499 .name = "spi_imx",
500 .id = 0,
501 .num_resources = ARRAY_SIZE(imx_spi_0_resources),
502 .resource = imx_spi_0_resources,
503};
504
505struct platform_device imx_spi_device1 = {
506 .name = "spi_imx",
507 .id = 1,
508 .num_resources = ARRAY_SIZE(imx_spi_1_resources),
509 .resource = imx_spi_1_resources,
510};
511
512struct platform_device imx_spi_device2 = {
513 .name = "spi_imx",
514 .id = 2,
515 .num_resources = ARRAY_SIZE(imx_spi_2_resources),
516 .resource = imx_spi_2_resources,
517};
518
398#ifdef CONFIG_ARCH_MX35 519#ifdef CONFIG_ARCH_MX35
399static struct resource mxc_fec_resources[] = { 520static struct resource mxc_fec_resources[] = {
400 { 521 {
401 .start = MXC_FEC_BASE_ADDR, 522 .start = MXC_FEC_BASE_ADDR,
402 .end = MXC_FEC_BASE_ADDR + 0xfff, 523 .end = MXC_FEC_BASE_ADDR + 0xfff,
403 .flags = IORESOURCE_MEM 524 .flags = IORESOURCE_MEM,
404 }, { 525 }, {
405 .start = MXC_INT_FEC, 526 .start = MXC_INT_FEC,
406 .end = MXC_INT_FEC, 527 .end = MXC_INT_FEC,
407 .flags = IORESOURCE_IRQ 528 .flags = IORESOURCE_IRQ,
408 }, 529 },
409}; 530};
410 531
@@ -426,6 +547,14 @@ static int mx3_devices_init(void)
426 if (cpu_is_mx35()) { 547 if (cpu_is_mx35()) {
427 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; 548 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
428 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff; 549 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff;
550 otg_resources[0].start = MX35_OTG_BASE_ADDR;
551 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff;
552 otg_resources[1].start = MXC_INT_USBOTG;
553 otg_resources[1].end = MXC_INT_USBOTG;
554 mxc_usbh1_resources[0].start = MX35_OTG_BASE_ADDR + 0x400;
555 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff;
556 mxc_usbh1_resources[1].start = MXC_INT_USBHS;
557 mxc_usbh1_resources[1].end = MXC_INT_USBHS;
429 } 558 }
430 559
431 return 0; 560 return 0;
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index ffd494ddd4ac..79f2be45d139 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -16,5 +16,11 @@ extern struct platform_device mxc_fec_device;
16extern struct platform_device mxcsdhc_device0; 16extern struct platform_device mxcsdhc_device0;
17extern struct platform_device mxcsdhc_device1; 17extern struct platform_device mxcsdhc_device1;
18extern struct platform_device mxc_otg_udc_device; 18extern struct platform_device mxc_otg_udc_device;
19extern struct platform_device mxc_otg_host;
20extern struct platform_device mxc_usbh1;
21extern struct platform_device mxc_usbh2;
19extern struct platform_device mxc_rnga_device; 22extern struct platform_device mxc_rnga_device;
23extern struct platform_device imx_spi_device0;
24extern struct platform_device imx_spi_device1;
25extern struct platform_device imx_spi_device2;
20 26
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
index 1f5fdd456cb9..ad5a1122d765 100644
--- a/arch/arm/mach-mx3/mm.c
+++ b/arch/arm/mach-mx3/mm.c
@@ -30,6 +30,7 @@
30 30
31#include <mach/common.h> 31#include <mach/common.h>
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/iomux-v3.h>
33 34
34/*! 35/*!
35 * @file mm.c 36 * @file mm.c
@@ -75,6 +76,7 @@ static struct map_desc mxc_io_desc[] __initdata = {
75void __init mx31_map_io(void) 76void __init mx31_map_io(void)
76{ 77{
77 mxc_set_cpu_type(MXC_CPU_MX31); 78 mxc_set_cpu_type(MXC_CPU_MX31);
79 mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR));
78 80
79 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 81 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
80} 82}
@@ -82,10 +84,22 @@ void __init mx31_map_io(void)
82void __init mx35_map_io(void) 84void __init mx35_map_io(void)
83{ 85{
84 mxc_set_cpu_type(MXC_CPU_MX35); 86 mxc_set_cpu_type(MXC_CPU_MX35);
87 mxc_iomux_v3_init(IO_ADDRESS(IOMUXC_BASE_ADDR));
88 mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR));
85 89
86 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 90 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
87} 91}
88 92
93void __init mx31_init_irq(void)
94{
95 mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR));
96}
97
98void __init mx35_init_irq(void)
99{
100 mx31_init_irq();
101}
102
89#ifdef CONFIG_CACHE_L2X0 103#ifdef CONFIG_CACHE_L2X0
90static int mxc_init_l2x0(void) 104static int mxc_init_l2x0(void)
91{ 105{
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c
index 30e2767a78ae..0497c152be18 100644
--- a/arch/arm/mach-mx3/mx31ads.c
+++ b/arch/arm/mach-mx3/mx31ads.c
@@ -517,7 +517,7 @@ static void __init mx31ads_map_io(void)
517 517
518static void __init mx31ads_init_irq(void) 518static void __init mx31ads_init_irq(void)
519{ 519{
520 mxc_init_irq(); 520 mx31_init_irq();
521 mx31ads_init_expio(); 521 mx31ads_init_expio();
522} 522}
523 523
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
index 6ab2f163cb95..423025150f6f 100644
--- a/arch/arm/mach-mx3/mx31lilly.c
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -148,7 +148,7 @@ MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
148 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 148 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
149 .boot_params = PHYS_OFFSET + 0x100, 149 .boot_params = PHYS_OFFSET + 0x100,
150 .map_io = mx31_map_io, 150 .map_io = mx31_map_io,
151 .init_irq = mxc_init_irq, 151 .init_irq = mx31_init_irq,
152 .init_machine = mx31lilly_board_init, 152 .init_machine = mx31lilly_board_init,
153 .timer = &mx31lilly_timer, 153 .timer = &mx31lilly_timer,
154MACHINE_END 154MACHINE_END
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c
index 86fe70fa3e13..a8d57decdfdb 100644
--- a/arch/arm/mach-mx3/mx31lite.c
+++ b/arch/arm/mach-mx3/mx31lite.c
@@ -71,12 +71,11 @@ static struct smsc911x_platform_config smsc911x_config = {
71}; 71};
72 72
73static struct resource smsc911x_resources[] = { 73static struct resource smsc911x_resources[] = {
74 [0] = { 74 {
75 .start = CS4_BASE_ADDR, 75 .start = CS4_BASE_ADDR,
76 .end = CS4_BASE_ADDR + 0x100, 76 .end = CS4_BASE_ADDR + 0x100,
77 .flags = IORESOURCE_MEM, 77 .flags = IORESOURCE_MEM,
78 }, 78 }, {
79 [1] = {
80 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6), 79 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6),
81 .end = IOMUX_TO_IRQ(MX31_PIN_SFS6), 80 .end = IOMUX_TO_IRQ(MX31_PIN_SFS6),
82 .flags = IORESOURCE_IRQ, 81 .flags = IORESOURCE_IRQ,
@@ -162,7 +161,7 @@ MACHINE_START(MX31LITE, "LogicPD MX31 LITEKIT")
162 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 161 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
163 .boot_params = PHYS_OFFSET + 0x100, 162 .boot_params = PHYS_OFFSET + 0x100,
164 .map_io = mx31lite_map_io, 163 .map_io = mx31lite_map_io,
165 .init_irq = mxc_init_irq, 164 .init_irq = mx31_init_irq,
166 .init_machine = mxc_board_init, 165 .init_machine = mxc_board_init,
167 .timer = &mx31lite_timer, 166 .timer = &mx31lite_timer,
168MACHINE_END 167MACHINE_END
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 4704405165a1..b3e8f251ac79 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -16,7 +16,6 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/fsl_devices.h>
20#include <linux/gpio.h> 19#include <linux/gpio.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/interrupt.h> 21#include <linux/interrupt.h>
@@ -40,18 +39,6 @@ static unsigned int devboard_pins[] = {
40 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0, 39 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
41 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, 40 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
42 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, 41 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
43 /* USB OTG */
44 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
45 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
46 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
47 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
48 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
49 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
50 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
51 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
52 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
53 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
54 MX31_PIN_USB_OC__GPIO1_30,
55}; 42};
56 43
57static struct imxuart_platform_data uart_pdata = { 44static struct imxuart_platform_data uart_pdata = {
@@ -111,33 +98,6 @@ static struct imxmmc_platform_data sdhc2_pdata = {
111 .exit = devboard_sdhc2_exit, 98 .exit = devboard_sdhc2_exit,
112}; 99};
113 100
114static struct fsl_usb2_platform_data usb_pdata = {
115 .operating_mode = FSL_USB2_DR_DEVICE,
116 .phy_mode = FSL_USB2_PHY_ULPI,
117};
118
119#define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST)
120#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
121
122static void devboard_usbotg_init(void)
123{
124 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG);
125 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG);
126 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG);
127 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG);
128 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG);
129 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG);
130 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG);
131 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG);
132 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG);
133 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG);
134 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG);
135 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG);
136
137 gpio_request(OTG_EN_B, "usb-udc-en");
138 gpio_direction_output(OTG_EN_B, 0);
139}
140
141/* 101/*
142 * system init for baseboard usage. Will be called by mx31moboard init. 102 * system init for baseboard usage. Will be called by mx31moboard init.
143 */ 103 */
@@ -151,7 +111,4 @@ void __init mx31moboard_devboard_init(void)
151 mxc_register_device(&mxc_uart_device1, &uart_pdata); 111 mxc_register_device(&mxc_uart_device1, &uart_pdata);
152 112
153 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 113 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
154
155 devboard_usbotg_init();
156 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
157} 114}
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 641c3d6153ae..3e2b73051b94 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -16,7 +16,6 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/fsl_devices.h>
20#include <linux/gpio.h> 19#include <linux/gpio.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/interrupt.h> 21#include <linux/interrupt.h>
@@ -48,18 +47,8 @@ static unsigned int marxbot_pins[] = {
48 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC, 47 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
49 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1, 48 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
50 MX31_PIN_TXD2__GPIO1_28, 49 MX31_PIN_TXD2__GPIO1_28,
51 /* USB OTG */ 50 /* dsPIC resets */
52 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, 51 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22,
53 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
54 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
55 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
56 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
57 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
58 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
59 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
60 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
61 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
62 MX31_PIN_USB_OC__GPIO1_30,
63}; 52};
64 53
65#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR) 54#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
@@ -115,31 +104,20 @@ static struct imxmmc_platform_data sdhc2_pdata = {
115 .exit = marxbot_sdhc2_exit, 104 .exit = marxbot_sdhc2_exit,
116}; 105};
117 106
118static struct fsl_usb2_platform_data usb_pdata = { 107#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_STXD5)
119 .operating_mode = FSL_USB2_DR_DEVICE, 108#define DSPICS_RST_B IOMUX_TO_GPIO(MX31_PIN_SRXD5)
120 .phy_mode = FSL_USB2_PHY_ULPI,
121};
122
123#define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST)
124#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
125 109
126static void marxbot_usbotg_init(void) 110static void dspics_resets_init(void)
127{ 111{
128 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG); 112 if (!gpio_request(TRSLAT_RST_B, "translator-rst")) {
129 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG); 113 gpio_direction_output(TRSLAT_RST_B, 1);
130 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG); 114 gpio_export(TRSLAT_RST_B, false);
131 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG); 115 }
132 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG); 116
133 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG); 117 if (!gpio_request(DSPICS_RST_B, "dspics-rst")) {
134 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG); 118 gpio_direction_output(DSPICS_RST_B, 1);
135 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG); 119 gpio_export(DSPICS_RST_B, false);
136 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG); 120 }
137 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG);
138 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG);
139 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG);
140
141 gpio_request(OTG_EN_B, "usb-udc-en");
142 gpio_direction_output(OTG_EN_B, 0);
143} 121}
144 122
145/* 123/*
@@ -152,8 +130,7 @@ void __init mx31moboard_marxbot_init(void)
152 mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins), 130 mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins),
153 "marxbot"); 131 "marxbot");
154 132
155 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 133 dspics_resets_init();
156 134
157 marxbot_usbotg_init(); 135 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
158 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
159} 136}
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index a17f2e411609..d3c6bb26271f 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -16,9 +16,12 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/delay.h>
20#include <linux/fsl_devices.h>
19#include <linux/gpio.h> 21#include <linux/gpio.h>
20#include <linux/init.h> 22#include <linux/init.h>
21#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/leds.h>
22#include <linux/memory.h> 25#include <linux/memory.h>
23#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
24#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
@@ -36,6 +39,7 @@
36#include <mach/iomux-mx3.h> 39#include <mach/iomux-mx3.h>
37#include <mach/i2c.h> 40#include <mach/i2c.h>
38#include <mach/mmc.h> 41#include <mach/mmc.h>
42#include <mach/mx31.h>
39 43
40#include "devices.h" 44#include "devices.h"
41 45
@@ -55,6 +59,26 @@ static unsigned int moboard_pins[] = {
55 MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0, 59 MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0,
56 MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD, 60 MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD,
57 MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27, 61 MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27,
62 /* USB reset */
63 MX31_PIN_GPIO1_0__GPIO1_0,
64 /* USB OTG */
65 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
66 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
67 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
68 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
69 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
70 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
71 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
72 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
73 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
74 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
75 MX31_PIN_USB_OC__GPIO1_30,
76 /* LEDs */
77 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1,
78 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3,
79 /* SEL */
80 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
81 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
58}; 82};
59 83
60static struct physmap_flash_data mx31moboard_flash_data = { 84static struct physmap_flash_data mx31moboard_flash_data = {
@@ -142,8 +166,109 @@ static struct imxmmc_platform_data sdhc1_pdata = {
142 .exit = moboard_sdhc1_exit, 166 .exit = moboard_sdhc1_exit,
143}; 167};
144 168
169/*
170 * this pin is dedicated for all mx31moboard systems, so we do it here
171 */
172#define USB_RESET_B IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)
173
174static void usb_xcvr_reset(void)
175{
176 gpio_request(USB_RESET_B, "usb-reset");
177 gpio_direction_output(USB_RESET_B, 0);
178 mdelay(1);
179 gpio_set_value(USB_RESET_B, 1);
180}
181
182#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
183 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
184
185#define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC)
186
187static void moboard_usbotg_init(void)
188{
189 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG);
190 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG);
191 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG);
192 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG);
193 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG);
194 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG);
195 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG);
196 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG);
197 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG);
198 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG);
199 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG);
200 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG);
201
202 gpio_request(OTG_EN_B, "usb-udc-en");
203 gpio_direction_output(OTG_EN_B, 0);
204}
205
206static struct fsl_usb2_platform_data usb_pdata = {
207 .operating_mode = FSL_USB2_DR_DEVICE,
208 .phy_mode = FSL_USB2_PHY_ULPI,
209};
210
211static struct gpio_led mx31moboard_leds[] = {
212 {
213 .name = "coreboard-led-0:red:running",
214 .default_trigger = "heartbeat",
215 .gpio = IOMUX_TO_GPIO(MX31_PIN_SVEN0),
216 }, {
217 .name = "coreboard-led-1:red",
218 .gpio = IOMUX_TO_GPIO(MX31_PIN_STX0),
219 }, {
220 .name = "coreboard-led-2:red",
221 .gpio = IOMUX_TO_GPIO(MX31_PIN_SRX0),
222 }, {
223 .name = "coreboard-led-3:red",
224 .gpio = IOMUX_TO_GPIO(MX31_PIN_SIMPD0),
225 },
226};
227
228static struct gpio_led_platform_data mx31moboard_led_pdata = {
229 .num_leds = ARRAY_SIZE(mx31moboard_leds),
230 .leds = mx31moboard_leds,
231};
232
233static struct platform_device mx31moboard_leds_device = {
234 .name = "leds-gpio",
235 .id = -1,
236 .dev = {
237 .platform_data = &mx31moboard_led_pdata,
238 },
239};
240
241#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
242#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
243#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
244#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
245
246static void mx31moboard_init_sel_gpios(void)
247{
248 if (!gpio_request(SEL0, "sel0")) {
249 gpio_direction_input(SEL0);
250 gpio_export(SEL0, true);
251 }
252
253 if (!gpio_request(SEL1, "sel1")) {
254 gpio_direction_input(SEL1);
255 gpio_export(SEL1, true);
256 }
257
258 if (!gpio_request(SEL2, "sel2")) {
259 gpio_direction_input(SEL2);
260 gpio_export(SEL2, true);
261 }
262
263 if (!gpio_request(SEL3, "sel3")) {
264 gpio_direction_input(SEL3);
265 gpio_export(SEL3, true);
266 }
267}
268
145static struct platform_device *devices[] __initdata = { 269static struct platform_device *devices[] __initdata = {
146 &mx31moboard_flash, 270 &mx31moboard_flash,
271 &mx31moboard_leds_device,
147}; 272};
148 273
149static int mx31moboard_baseboard; 274static int mx31moboard_baseboard;
@@ -162,11 +287,18 @@ static void __init mxc_board_init(void)
162 mxc_register_device(&mxc_uart_device0, &uart_pdata); 287 mxc_register_device(&mxc_uart_device0, &uart_pdata);
163 mxc_register_device(&mxc_uart_device4, &uart_pdata); 288 mxc_register_device(&mxc_uart_device4, &uart_pdata);
164 289
290 mx31moboard_init_sel_gpios();
291
165 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); 292 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
166 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); 293 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
167 294
168 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata); 295 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata);
169 296
297 usb_xcvr_reset();
298
299 moboard_usbotg_init();
300 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
301
170 switch (mx31moboard_baseboard) { 302 switch (mx31moboard_baseboard) {
171 case MX31NOBOARD: 303 case MX31NOBOARD:
172 break; 304 break;
@@ -197,7 +329,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
197 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 329 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
198 .boot_params = PHYS_OFFSET + 0x100, 330 .boot_params = PHYS_OFFSET + 0x100,
199 .map_io = mx31_map_io, 331 .map_io = mx31_map_io,
200 .init_irq = mxc_init_irq, 332 .init_irq = mx31_init_irq,
201 .init_machine = mxc_board_init, 333 .init_machine = mxc_board_init,
202 .timer = &mx31moboard_timer, 334 .timer = &mx31moboard_timer,
203MACHINE_END 335MACHINE_END
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
index c19838d2e369..0f7a2f06bc2d 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -265,7 +265,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
265 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 265 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
266 .boot_params = PHYS_OFFSET + 0x100, 266 .boot_params = PHYS_OFFSET + 0x100,
267 .map_io = mx31pdk_map_io, 267 .map_io = mx31pdk_map_io,
268 .init_irq = mxc_init_irq, 268 .init_irq = mx31_init_irq,
269 .init_machine = mxc_board_init, 269 .init_machine = mxc_board_init,
270 .timer = &mx31pdk_timer, 270 .timer = &mx31pdk_timer,
271MACHINE_END 271MACHINE_END
diff --git a/arch/arm/mach-mx3/mx35pdk.c b/arch/arm/mach-mx3/mx35pdk.c
index 6d15374414b9..6ff186e46ceb 100644
--- a/arch/arm/mach-mx3/mx35pdk.c
+++ b/arch/arm/mach-mx3/mx35pdk.c
@@ -98,7 +98,7 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
98 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 98 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
99 .boot_params = PHYS_OFFSET + 0x100, 99 .boot_params = PHYS_OFFSET + 0x100,
100 .map_io = mx35_map_io, 100 .map_io = mx35_map_io,
101 .init_irq = mxc_init_irq, 101 .init_irq = mx35_init_irq,
102 .init_machine = mxc_board_init, 102 .init_machine = mxc_board_init,
103 .timer = &mx35pdk_timer, 103 .timer = &mx35pdk_timer,
104MACHINE_END 104MACHINE_END
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index c6f61a1f06c8..6cbaabedf386 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -18,7 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21#include <linux/dma-mapping.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/mtd/plat-ram.h> 24#include <linux/mtd/plat-ram.h>
@@ -32,30 +32,69 @@
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/fsl_devices.h> 34#include <linux/fsl_devices.h>
35#include <linux/can/platform/sja1000.h>
36
37#include <media/soc_camera.h>
35 38
36#include <mach/hardware.h>
37#include <asm/mach-types.h> 39#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
39#include <asm/mach/time.h> 41#include <asm/mach/time.h>
40#include <asm/mach/map.h> 42#include <asm/mach/map.h>
43#include <mach/board-pcm037.h>
41#include <mach/common.h> 44#include <mach/common.h>
45#include <mach/hardware.h>
46#include <mach/i2c.h>
42#include <mach/imx-uart.h> 47#include <mach/imx-uart.h>
43#include <mach/iomux-mx3.h> 48#include <mach/iomux-mx3.h>
44#include <mach/ipu.h> 49#include <mach/ipu.h>
45#include <mach/board-pcm037.h> 50#include <mach/mmc.h>
51#include <mach/mx3_camera.h>
46#include <mach/mx3fb.h> 52#include <mach/mx3fb.h>
47#include <mach/mxc_nand.h> 53#include <mach/mxc_nand.h>
48#include <mach/mmc.h>
49#ifdef CONFIG_I2C_IMX
50#include <mach/i2c.h>
51#endif
52 54
53#include "devices.h" 55#include "devices.h"
56#include "pcm037.h"
57
58static enum pcm037_board_variant pcm037_instance = PCM037_PCM970;
59
60static int __init pcm037_variant_setup(char *str)
61{
62 if (!strcmp("eet", str))
63 pcm037_instance = PCM037_EET;
64 else if (strcmp("pcm970", str))
65 pr_warning("Unknown pcm037 baseboard variant %s\n", str);
66
67 return 1;
68}
69
70/* Supported values: "pcm970" (default) and "eet" */
71__setup("pcm037_variant=", pcm037_variant_setup);
72
73enum pcm037_board_variant pcm037_variant(void)
74{
75 return pcm037_instance;
76}
77
78/* UART1 with RTS/CTS handshake signals */
79static unsigned int pcm037_uart1_handshake_pins[] = {
80 MX31_PIN_CTS1__CTS1,
81 MX31_PIN_RTS1__RTS1,
82 MX31_PIN_TXD1__TXD1,
83 MX31_PIN_RXD1__RXD1,
84};
85
86/* UART1 without RTS/CTS handshake signals */
87static unsigned int pcm037_uart1_pins[] = {
88 MX31_PIN_TXD1__TXD1,
89 MX31_PIN_RXD1__RXD1,
90};
54 91
55static unsigned int pcm037_pins[] = { 92static unsigned int pcm037_pins[] = {
56 /* I2C */ 93 /* I2C */
57 MX31_PIN_CSPI2_MOSI__SCL, 94 MX31_PIN_CSPI2_MOSI__SCL,
58 MX31_PIN_CSPI2_MISO__SDA, 95 MX31_PIN_CSPI2_MISO__SDA,
96 MX31_PIN_CSPI2_SS2__I2C3_SDA,
97 MX31_PIN_CSPI2_SCLK__I2C3_SCL,
59 /* SDHC1 */ 98 /* SDHC1 */
60 MX31_PIN_SD1_DATA3__SD1_DATA3, 99 MX31_PIN_SD1_DATA3__SD1_DATA3,
61 MX31_PIN_SD1_DATA2__SD1_DATA2, 100 MX31_PIN_SD1_DATA2__SD1_DATA2,
@@ -73,11 +112,6 @@ static unsigned int pcm037_pins[] = {
73 MX31_PIN_CSPI1_SS0__SS0, 112 MX31_PIN_CSPI1_SS0__SS0,
74 MX31_PIN_CSPI1_SS1__SS1, 113 MX31_PIN_CSPI1_SS1__SS1,
75 MX31_PIN_CSPI1_SS2__SS2, 114 MX31_PIN_CSPI1_SS2__SS2,
76 /* UART1 */
77 MX31_PIN_CTS1__CTS1,
78 MX31_PIN_RTS1__RTS1,
79 MX31_PIN_TXD1__TXD1,
80 MX31_PIN_RXD1__RXD1,
81 /* UART2 */ 115 /* UART2 */
82 MX31_PIN_TXD2__TXD2, 116 MX31_PIN_TXD2__TXD2,
83 MX31_PIN_RXD2__RXD2, 117 MX31_PIN_RXD2__RXD2,
@@ -120,6 +154,24 @@ static unsigned int pcm037_pins[] = {
120 MX31_PIN_D3_SPL__D3_SPL, 154 MX31_PIN_D3_SPL__D3_SPL,
121 MX31_PIN_D3_CLS__D3_CLS, 155 MX31_PIN_D3_CLS__D3_CLS,
122 MX31_PIN_LCS0__GPI03_23, 156 MX31_PIN_LCS0__GPI03_23,
157 /* CSI */
158 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO),
159 MX31_PIN_CSI_D6__CSI_D6,
160 MX31_PIN_CSI_D7__CSI_D7,
161 MX31_PIN_CSI_D8__CSI_D8,
162 MX31_PIN_CSI_D9__CSI_D9,
163 MX31_PIN_CSI_D10__CSI_D10,
164 MX31_PIN_CSI_D11__CSI_D11,
165 MX31_PIN_CSI_D12__CSI_D12,
166 MX31_PIN_CSI_D13__CSI_D13,
167 MX31_PIN_CSI_D14__CSI_D14,
168 MX31_PIN_CSI_D15__CSI_D15,
169 MX31_PIN_CSI_HSYNC__CSI_HSYNC,
170 MX31_PIN_CSI_MCLK__CSI_MCLK,
171 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
172 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
173 /* GPIO */
174 IOMUX_MODE(MX31_PIN_ATA_DMACK, IOMUX_CONFIG_GPIO),
123}; 175};
124 176
125static struct physmap_flash_data pcm037_flash_data = { 177static struct physmap_flash_data pcm037_flash_data = {
@@ -195,12 +247,11 @@ static struct imxuart_platform_data uart_pdata = {
195}; 247};
196 248
197static struct resource smsc911x_resources[] = { 249static struct resource smsc911x_resources[] = {
198 [0] = { 250 {
199 .start = CS1_BASE_ADDR + 0x300, 251 .start = CS1_BASE_ADDR + 0x300,
200 .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, 252 .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1,
201 .flags = IORESOURCE_MEM, 253 .flags = IORESOURCE_MEM,
202 }, 254 }, {
203 [1] = {
204 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 255 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
205 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 256 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
206 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 257 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
@@ -250,27 +301,57 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
250 .hw_ecc = 1, 301 .hw_ecc = 1,
251}; 302};
252 303
253#ifdef CONFIG_I2C_IMX
254static struct imxi2c_platform_data pcm037_i2c_1_data = { 304static struct imxi2c_platform_data pcm037_i2c_1_data = {
255 .bitrate = 100000, 305 .bitrate = 100000,
256}; 306};
257 307
308static struct imxi2c_platform_data pcm037_i2c_2_data = {
309 .bitrate = 20000,
310};
311
258static struct at24_platform_data board_eeprom = { 312static struct at24_platform_data board_eeprom = {
259 .byte_len = 4096, 313 .byte_len = 4096,
260 .page_size = 32, 314 .page_size = 32,
261 .flags = AT24_FLAG_ADDR16, 315 .flags = AT24_FLAG_ADDR16,
262}; 316};
263 317
318static int pcm037_camera_power(struct device *dev, int on)
319{
320 /* disable or enable the camera in X7 or X8 PCM970 connector */
321 gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), !on);
322 return 0;
323}
324
325static struct i2c_board_info pcm037_i2c_2_devices[] = {
326 {
327 I2C_BOARD_INFO("mt9t031", 0x5d),
328 },
329};
330
331static struct soc_camera_link iclink = {
332 .bus_id = 0, /* Must match with the camera ID */
333 .power = pcm037_camera_power,
334 .board_info = &pcm037_i2c_2_devices[0],
335 .i2c_adapter_id = 2,
336 .module_name = "mt9t031",
337};
338
264static struct i2c_board_info pcm037_i2c_devices[] = { 339static struct i2c_board_info pcm037_i2c_devices[] = {
265 { 340 {
266 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ 341 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
267 .platform_data = &board_eeprom, 342 .platform_data = &board_eeprom,
268 }, { 343 }, {
269 I2C_BOARD_INFO("rtc-pcf8563", 0x51), 344 I2C_BOARD_INFO("pcf8563", 0x51),
270 .type = "pcf8563",
271 } 345 }
272}; 346};
273#endif 347
348static struct platform_device pcm037_camera = {
349 .name = "soc-camera-pdrv",
350 .id = 0,
351 .dev = {
352 .platform_data = &iclink,
353 },
354};
274 355
275/* Not connected by default */ 356/* Not connected by default */
276#ifdef PCM970_SDHC_RW_SWITCH 357#ifdef PCM970_SDHC_RW_SWITCH
@@ -334,9 +415,41 @@ static struct imxmmc_platform_data sdhc_pdata = {
334 .exit = pcm970_sdhc1_exit, 415 .exit = pcm970_sdhc1_exit,
335}; 416};
336 417
418struct mx3_camera_pdata camera_pdata = {
419 .dma_dev = &mx3_ipu.dev,
420 .flags = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
421 .mclk_10khz = 2000,
422};
423
424static int __init pcm037_camera_alloc_dma(const size_t buf_size)
425{
426 dma_addr_t dma_handle;
427 void *buf;
428 int dma;
429
430 if (buf_size < 2 * 1024 * 1024)
431 return -EINVAL;
432
433 buf = dma_alloc_coherent(NULL, buf_size, &dma_handle, GFP_KERNEL);
434 if (!buf) {
435 pr_err("%s: cannot allocate camera buffer-memory\n", __func__);
436 return -ENOMEM;
437 }
438
439 memset(buf, 0, buf_size);
440
441 dma = dma_declare_coherent_memory(&mx3_camera.dev,
442 dma_handle, dma_handle, buf_size,
443 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
444
445 /* The way we call dma_declare_coherent_memory only a malloc can fail */
446 return dma & DMA_MEMORY_MAP ? 0 : -ENOMEM;
447}
448
337static struct platform_device *devices[] __initdata = { 449static struct platform_device *devices[] __initdata = {
338 &pcm037_flash, 450 &pcm037_flash,
339 &pcm037_sram_device, 451 &pcm037_sram_device,
452 &pcm037_camera,
340}; 453};
341 454
342static struct ipu_platform_data mx3_ipu_data = { 455static struct ipu_platform_data mx3_ipu_data = {
@@ -377,6 +490,22 @@ static const struct fb_videomode fb_modedb[] = {
377 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH, 490 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
378 .vmode = FB_VMODE_NONINTERLACED, 491 .vmode = FB_VMODE_NONINTERLACED,
379 .flag = 0, 492 .flag = 0,
493 }, {
494 /* 240x320 @ 60 Hz */
495 .name = "CMEL-OLED",
496 .refresh = 60,
497 .xres = 240,
498 .yres = 320,
499 .pixclock = 185925,
500 .left_margin = 9,
501 .right_margin = 16,
502 .upper_margin = 7,
503 .lower_margin = 9,
504 .hsync_len = 1,
505 .vsync_len = 1,
506 .sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
507 .vmode = FB_VMODE_NONINTERLACED,
508 .flag = 0,
380 }, 509 },
381}; 510};
382 511
@@ -387,6 +516,33 @@ static struct mx3fb_platform_data mx3fb_pdata = {
387 .num_modes = ARRAY_SIZE(fb_modedb), 516 .num_modes = ARRAY_SIZE(fb_modedb),
388}; 517};
389 518
519static struct resource pcm970_sja1000_resources[] = {
520 {
521 .start = CS5_BASE_ADDR,
522 .end = CS5_BASE_ADDR + 0x100 - 1,
523 .flags = IORESOURCE_MEM,
524 }, {
525 .start = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)),
526 .end = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)),
527 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
528 },
529};
530
531struct sja1000_platform_data pcm970_sja1000_platform_data = {
532 .clock = 16000000 / 2,
533 .ocr = 0x40 | 0x18,
534 .cdr = 0x40,
535};
536
537static struct platform_device pcm970_sja1000 = {
538 .name = "sja1000_platform",
539 .dev = {
540 .platform_data = &pcm970_sja1000_platform_data,
541 },
542 .resource = pcm970_sja1000_resources,
543 .num_resources = ARRAY_SIZE(pcm970_sja1000_resources),
544};
545
390/* 546/*
391 * Board specific initialization. 547 * Board specific initialization.
392 */ 548 */
@@ -397,6 +553,14 @@ static void __init mxc_board_init(void)
397 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins), 553 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
398 "pcm037"); 554 "pcm037");
399 555
556 if (pcm037_variant() == PCM037_EET)
557 mxc_iomux_setup_multiple_pins(pcm037_uart1_pins,
558 ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1");
559 else
560 mxc_iomux_setup_multiple_pins(pcm037_uart1_handshake_pins,
561 ARRAY_SIZE(pcm037_uart1_handshake_pins),
562 "pcm037_uart1");
563
400 platform_add_devices(devices, ARRAY_SIZE(devices)); 564 platform_add_devices(devices, ARRAY_SIZE(devices));
401 565
402 mxc_register_device(&mxc_uart_device0, &uart_pdata); 566 mxc_register_device(&mxc_uart_device0, &uart_pdata);
@@ -415,18 +579,32 @@ static void __init mxc_board_init(void)
415 } 579 }
416 580
417 581
418#ifdef CONFIG_I2C_IMX 582 /* I2C adapters and devices */
419 i2c_register_board_info(1, pcm037_i2c_devices, 583 i2c_register_board_info(1, pcm037_i2c_devices,
420 ARRAY_SIZE(pcm037_i2c_devices)); 584 ARRAY_SIZE(pcm037_i2c_devices));
421 585
422 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); 586 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
423#endif 587 mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data);
588
424 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 589 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
425 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); 590 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
426 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 591 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
427 mxc_register_device(&mx3_fb, &mx3fb_pdata); 592 mxc_register_device(&mx3_fb, &mx3fb_pdata);
428 if (!gpio_usbotg_hs_activate()) 593 if (!gpio_usbotg_hs_activate())
429 mxc_register_device(&mxc_otg_udc_device, &usb_pdata); 594 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
595
596 /* CSI */
597 /* Camera power: default - off */
598 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
599 if (!ret)
600 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
601 else
602 iclink.power = NULL;
603
604 if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
605 mxc_register_device(&mx3_camera, &camera_pdata);
606
607 platform_device_register(&pcm970_sja1000);
430} 608}
431 609
432static void __init pcm037_timer_init(void) 610static void __init pcm037_timer_init(void)
@@ -444,8 +622,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
444 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 622 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
445 .boot_params = PHYS_OFFSET + 0x100, 623 .boot_params = PHYS_OFFSET + 0x100,
446 .map_io = mx31_map_io, 624 .map_io = mx31_map_io,
447 .init_irq = mxc_init_irq, 625 .init_irq = mx31_init_irq,
448 .init_machine = mxc_board_init, 626 .init_machine = mxc_board_init,
449 .timer = &pcm037_timer, 627 .timer = &pcm037_timer,
450MACHINE_END 628MACHINE_END
451
diff --git a/arch/arm/mach-mx3/pcm037.h b/arch/arm/mach-mx3/pcm037.h
new file mode 100644
index 000000000000..d6929721a5fd
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm037.h
@@ -0,0 +1,11 @@
1#ifndef __PCM037_H__
2#define __PCM037_H__
3
4enum pcm037_board_variant {
5 PCM037_PCM970,
6 PCM037_EET,
7};
8
9extern enum pcm037_board_variant pcm037_variant(void);
10
11#endif
diff --git a/arch/arm/mach-mx3/pcm037_eet.c b/arch/arm/mach-mx3/pcm037_eet.c
new file mode 100644
index 000000000000..fe52fb1bb8b7
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm037_eet.c
@@ -0,0 +1,204 @@
1/*
2 * Copyright (C) 2009
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#include <linux/gpio.h>
10#include <linux/gpio_keys.h>
11#include <linux/input.h>
12#include <linux/platform_device.h>
13#include <linux/spi/spi.h>
14
15#include <mach/common.h>
16#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
17#include <mach/spi.h>
18#endif
19#include <mach/iomux-mx3.h>
20
21#include <asm/mach-types.h>
22
23#include "pcm037.h"
24#include "devices.h"
25
26static unsigned int pcm037_eet_pins[] = {
27 /* SPI #1 */
28 MX31_PIN_CSPI1_MISO__MISO,
29 MX31_PIN_CSPI1_MOSI__MOSI,
30 MX31_PIN_CSPI1_SCLK__SCLK,
31 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
32 MX31_PIN_CSPI1_SS0__SS0,
33 MX31_PIN_CSPI1_SS1__SS1,
34 MX31_PIN_CSPI1_SS2__SS2,
35
36 /* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */
37 IOMUX_MODE(MX31_PIN_KEY_COL7, IOMUX_CONFIG_GPIO),
38 /* GPIO keys */
39 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO), /* 0 */
40 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO), /* 1 */
41 IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO), /* 2 */
42 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO), /* 3 */
43 IOMUX_MODE(MX31_PIN_SVEN0, IOMUX_CONFIG_GPIO), /* 32 */
44 IOMUX_MODE(MX31_PIN_STX0, IOMUX_CONFIG_GPIO), /* 33 */
45 IOMUX_MODE(MX31_PIN_SRX0, IOMUX_CONFIG_GPIO), /* 34 */
46 IOMUX_MODE(MX31_PIN_SIMPD0, IOMUX_CONFIG_GPIO), /* 35 */
47 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO), /* 38 */
48 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO), /* 39 */
49 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_GPIO), /* 50 */
50 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_GPIO), /* 51 */
51 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_GPIO), /* 52 */
52 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_GPIO), /* 53 */
53
54 /* LEDs */
55 IOMUX_MODE(MX31_PIN_DTR_DTE1, IOMUX_CONFIG_GPIO), /* 44 */
56 IOMUX_MODE(MX31_PIN_DSR_DTE1, IOMUX_CONFIG_GPIO), /* 45 */
57 IOMUX_MODE(MX31_PIN_KEY_COL5, IOMUX_CONFIG_GPIO), /* 55 */
58 IOMUX_MODE(MX31_PIN_KEY_COL6, IOMUX_CONFIG_GPIO), /* 56 */
59};
60
61/* SPI */
62static struct spi_board_info pcm037_spi_dev[] = {
63 {
64 .modalias = "dac124s085",
65 .max_speed_hz = 400000,
66 .bus_num = 0,
67 .chip_select = 0, /* Index in pcm037_spi1_cs[] */
68 .mode = SPI_CPHA,
69 },
70};
71
72/* Platform Data for MXC CSPI */
73#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
74static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)};
75
76struct spi_imx_master pcm037_spi1_master = {
77 .chipselect = pcm037_spi1_cs,
78 .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs),
79};
80#endif
81
82/* GPIO-keys input device */
83static struct gpio_keys_button pcm037_gpio_keys[] = {
84 {
85 .type = EV_KEY,
86 .code = KEY_L,
87 .gpio = 0,
88 .desc = "Wheel Manual",
89 .wakeup = 0,
90 }, {
91 .type = EV_KEY,
92 .code = KEY_A,
93 .gpio = 1,
94 .desc = "Wheel AF",
95 .wakeup = 0,
96 }, {
97 .type = EV_KEY,
98 .code = KEY_V,
99 .gpio = 2,
100 .desc = "Wheel View",
101 .wakeup = 0,
102 }, {
103 .type = EV_KEY,
104 .code = KEY_M,
105 .gpio = 3,
106 .desc = "Wheel Menu",
107 .wakeup = 0,
108 }, {
109 .type = EV_KEY,
110 .code = KEY_UP,
111 .gpio = 32,
112 .desc = "Nav Pad Up",
113 .wakeup = 0,
114 }, {
115 .type = EV_KEY,
116 .code = KEY_RIGHT,
117 .gpio = 33,
118 .desc = "Nav Pad Right",
119 .wakeup = 0,
120 }, {
121 .type = EV_KEY,
122 .code = KEY_DOWN,
123 .gpio = 34,
124 .desc = "Nav Pad Down",
125 .wakeup = 0,
126 }, {
127 .type = EV_KEY,
128 .code = KEY_LEFT,
129 .gpio = 35,
130 .desc = "Nav Pad Left",
131 .wakeup = 0,
132 }, {
133 .type = EV_KEY,
134 .code = KEY_ENTER,
135 .gpio = 38,
136 .desc = "Nav Pad Ok",
137 .wakeup = 0,
138 }, {
139 .type = EV_KEY,
140 .code = KEY_O,
141 .gpio = 39,
142 .desc = "Wheel Off",
143 .wakeup = 0,
144 }, {
145 .type = EV_KEY,
146 .code = BTN_FORWARD,
147 .gpio = 50,
148 .desc = "Focus Forward",
149 .wakeup = 0,
150 }, {
151 .type = EV_KEY,
152 .code = BTN_BACK,
153 .gpio = 51,
154 .desc = "Focus Backward",
155 .wakeup = 0,
156 }, {
157 .type = EV_KEY,
158 .code = BTN_MIDDLE,
159 .gpio = 52,
160 .desc = "Release Half",
161 .wakeup = 0,
162 }, {
163 .type = EV_KEY,
164 .code = BTN_EXTRA,
165 .gpio = 53,
166 .desc = "Release Full",
167 .wakeup = 0,
168 },
169};
170
171static struct gpio_keys_platform_data pcm037_gpio_keys_platform_data = {
172 .buttons = pcm037_gpio_keys,
173 .nbuttons = ARRAY_SIZE(pcm037_gpio_keys),
174 .rep = 0, /* No auto-repeat */
175};
176
177static struct platform_device pcm037_gpio_keys_device = {
178 .name = "gpio-keys",
179 .id = -1,
180 .dev = {
181 .platform_data = &pcm037_gpio_keys_platform_data,
182 },
183};
184
185static int eet_init_devices(void)
186{
187 if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
188 return 0;
189
190 mxc_iomux_setup_multiple_pins(pcm037_eet_pins,
191 ARRAY_SIZE(pcm037_eet_pins), "pcm037_eet");
192
193 /* SPI */
194 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
195#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
196 mxc_register_device(&mxc_spi_device0, &pcm037_spi1_master);
197#endif
198
199 platform_device_register(&pcm037_gpio_keys_device);
200
201 return 0;
202}
203
204late_initcall(eet_init_devices);
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c
index 8d27c324abf2..e18a224671fa 100644
--- a/arch/arm/mach-mx3/pcm043.c
+++ b/arch/arm/mach-mx3/pcm043.c
@@ -133,8 +133,7 @@ static struct i2c_board_info pcm043_i2c_devices[] = {
133 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ 133 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
134 .platform_data = &board_eeprom, 134 .platform_data = &board_eeprom,
135 }, { 135 }, {
136 I2C_BOARD_INFO("rtc-pcf8563", 0x51), 136 I2C_BOARD_INFO("pcf8563", 0x51),
137 .type = "pcf8563",
138 } 137 }
139}; 138};
140#endif 139#endif
@@ -203,7 +202,8 @@ static struct pad_desc pcm043_pads[] = {
203 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC, 202 MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
204 MX35_PAD_D3_REV__IPU_DISPB_D3_REV, 203 MX35_PAD_D3_REV__IPU_DISPB_D3_REV,
205 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS, 204 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
206 MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL 205 /* gpio */
206 MX35_PAD_ATA_CS0__GPIO2_6,
207}; 207};
208 208
209/* 209/*
@@ -245,7 +245,7 @@ MACHINE_START(PCM043, "Phytec Phycore pcm043")
245 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 245 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
246 .boot_params = PHYS_OFFSET + 0x100, 246 .boot_params = PHYS_OFFSET + 0x100,
247 .map_io = mx35_map_io, 247 .map_io = mx35_map_io,
248 .init_irq = mxc_init_irq, 248 .init_irq = mx35_init_irq,
249 .init_machine = mxc_board_init, 249 .init_machine = mxc_board_init,
250 .timer = &pcm043_timer, 250 .timer = &pcm043_timer,
251MACHINE_END 251MACHINE_END
diff --git a/arch/arm/mach-mx3/qong.c b/arch/arm/mach-mx3/qong.c
index 82b31c4ab11f..044511f1b9a9 100644
--- a/arch/arm/mach-mx3/qong.c
+++ b/arch/arm/mach-mx3/qong.c
@@ -81,13 +81,12 @@ static inline void mxc_init_imx_uart(void)
81} 81}
82 82
83static struct resource dnet_resources[] = { 83static struct resource dnet_resources[] = {
84 [0] = { 84 {
85 .name = "dnet-memory", 85 .name = "dnet-memory",
86 .start = QONG_DNET_BASEADDR, 86 .start = QONG_DNET_BASEADDR,
87 .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1, 87 .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1,
88 .flags = IORESOURCE_MEM, 88 .flags = IORESOURCE_MEM,
89 }, 89 }, {
90 [1] = {
91 .start = QONG_FPGA_IRQ, 90 .start = QONG_FPGA_IRQ,
92 .end = QONG_FPGA_IRQ, 91 .end = QONG_FPGA_IRQ,
93 .flags = IORESOURCE_IRQ, 92 .flags = IORESOURCE_IRQ,
@@ -280,7 +279,7 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
280 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 279 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
281 .boot_params = PHYS_OFFSET + 0x100, 280 .boot_params = PHYS_OFFSET + 0x100,
282 .map_io = mx31_map_io, 281 .map_io = mx31_map_io,
283 .init_irq = mxc_init_irq, 282 .init_irq = mx31_init_irq,
284 .init_machine = mxc_board_init, 283 .init_machine = mxc_board_init,
285 .timer = &qong_timer, 284 .timer = &qong_timer,
286MACHINE_END 285MACHINE_END
diff --git a/arch/arm/mach-mxc91231/Kconfig b/arch/arm/mach-mxc91231/Kconfig
new file mode 100644
index 000000000000..8e5fa38ebb67
--- /dev/null
+++ b/arch/arm/mach-mxc91231/Kconfig
@@ -0,0 +1,11 @@
1if ARCH_MXC91231
2
3comment "MXC91231 platforms:"
4
5config MACH_MAGX_ZN5
6 bool "Support Motorola Zn5 GSM phone"
7 default n
8 help
9 Include support for Motorola Zn5 GSM phone.
10
11endif
diff --git a/arch/arm/mach-mxc91231/Makefile b/arch/arm/mach-mxc91231/Makefile
new file mode 100644
index 000000000000..011d5e197125
--- /dev/null
+++ b/arch/arm/mach-mxc91231/Makefile
@@ -0,0 +1,2 @@
1obj-y := mm.o clock.o devices.o system.o iomux.o
2obj-$(CONFIG_MACH_MAGX_ZN5) += magx-zn5.o
diff --git a/arch/arm/mach-mxc91231/Makefile.boot b/arch/arm/mach-mxc91231/Makefile.boot
new file mode 100644
index 000000000000..9939a19d99a1
--- /dev/null
+++ b/arch/arm/mach-mxc91231/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x90008000
2params_phys-y := 0x90000100
3initrd_phys-y := 0x90800000
diff --git a/arch/arm/mach-mxc91231/clock.c b/arch/arm/mach-mxc91231/clock.c
new file mode 100644
index 000000000000..ecfa37fef8ad
--- /dev/null
+++ b/arch/arm/mach-mxc91231/clock.c
@@ -0,0 +1,642 @@
1#include <linux/clk.h>
2#include <linux/kernel.h>
3#include <linux/init.h>
4#include <linux/io.h>
5
6#include <mach/clock.h>
7#include <mach/hardware.h>
8#include <mach/common.h>
9
10#include <asm/clkdev.h>
11#include <asm/bug.h>
12#include <asm/div64.h>
13
14#include "crm_regs.h"
15
16#define CRM_SMALL_DIVIDER(base, name) \
17 crm_small_divider(base, \
18 base ## _ ## name ## _OFFSET, \
19 base ## _ ## name ## _MASK)
20#define CRM_1DIVIDER(base, name) \
21 crm_divider(base, \
22 base ## _ ## name ## _OFFSET, \
23 base ## _ ## name ## _MASK, 1)
24#define CRM_16DIVIDER(base, name) \
25 crm_divider(base, \
26 base ## _ ## name ## _OFFSET, \
27 base ## _ ## name ## _MASK, 16)
28
29static u32 crm_small_divider(void __iomem *reg, u8 offset, u32 mask)
30{
31 static const u32 crm_small_dividers[] = {
32 2, 3, 4, 5, 6, 8, 10, 12
33 };
34 u8 idx;
35
36 idx = (__raw_readl(reg) & mask) >> offset;
37 if (idx > 7)
38 return 1;
39
40 return crm_small_dividers[idx];
41}
42
43static u32 crm_divider(void __iomem *reg, u8 offset, u32 mask, u32 z)
44{
45 u32 div;
46 div = (__raw_readl(reg) & mask) >> offset;
47 return div ? div : z;
48}
49
50static int _clk_1bit_enable(struct clk *clk)
51{
52 u32 reg;
53
54 reg = __raw_readl(clk->enable_reg);
55 reg |= 1 << clk->enable_shift;
56 __raw_writel(reg, clk->enable_reg);
57
58 return 0;
59}
60
61static void _clk_1bit_disable(struct clk *clk)
62{
63 u32 reg;
64
65 reg = __raw_readl(clk->enable_reg);
66 reg &= ~(1 << clk->enable_shift);
67 __raw_writel(reg, clk->enable_reg);
68}
69
70static int _clk_3bit_enable(struct clk *clk)
71{
72 u32 reg;
73
74 reg = __raw_readl(clk->enable_reg);
75 reg |= 0x7 << clk->enable_shift;
76 __raw_writel(reg, clk->enable_reg);
77
78 return 0;
79}
80
81static void _clk_3bit_disable(struct clk *clk)
82{
83 u32 reg;
84
85 reg = __raw_readl(clk->enable_reg);
86 reg &= ~(0x7 << clk->enable_shift);
87 __raw_writel(reg, clk->enable_reg);
88}
89
90static unsigned long ckih_rate;
91
92static unsigned long clk_ckih_get_rate(struct clk *clk)
93{
94 return ckih_rate;
95}
96
97static struct clk ckih_clk = {
98 .get_rate = clk_ckih_get_rate,
99};
100
101static unsigned long clk_ckih_x2_get_rate(struct clk *clk)
102{
103 return 2 * clk_get_rate(clk->parent);
104}
105
106static struct clk ckih_x2_clk = {
107 .parent = &ckih_clk,
108 .get_rate = clk_ckih_x2_get_rate,
109};
110
111static unsigned long clk_ckil_get_rate(struct clk *clk)
112{
113 return CKIL_CLK_FREQ;
114}
115
116static struct clk ckil_clk = {
117 .get_rate = clk_ckil_get_rate,
118};
119
120/* plls stuff */
121static struct clk mcu_pll_clk;
122static struct clk dsp_pll_clk;
123static struct clk usb_pll_clk;
124
125static struct clk *pll_clk(u8 sel)
126{
127 switch (sel) {
128 case 0:
129 return &mcu_pll_clk;
130 case 1:
131 return &dsp_pll_clk;
132 case 2:
133 return &usb_pll_clk;
134 }
135 BUG();
136}
137
138static void __iomem *pll_base(struct clk *clk)
139{
140 if (clk == &mcu_pll_clk)
141 return MXC_PLL0_BASE;
142 else if (clk == &dsp_pll_clk)
143 return MXC_PLL1_BASE;
144 else if (clk == &usb_pll_clk)
145 return MXC_PLL2_BASE;
146 BUG();
147}
148
149static unsigned long clk_pll_get_rate(struct clk *clk)
150{
151 const void __iomem *pllbase;
152 unsigned long dp_op, dp_mfd, dp_mfn, pll_hfsm, ref_clk, mfi;
153 long mfn, mfn_abs, mfd, pdf;
154 s64 temp;
155 pllbase = pll_base(clk);
156
157 pll_hfsm = __raw_readl(pllbase + MXC_PLL_DP_CTL) & MXC_PLL_DP_CTL_HFSM;
158 if (pll_hfsm == 0) {
159 dp_op = __raw_readl(pllbase + MXC_PLL_DP_OP);
160 dp_mfd = __raw_readl(pllbase + MXC_PLL_DP_MFD);
161 dp_mfn = __raw_readl(pllbase + MXC_PLL_DP_MFN);
162 } else {
163 dp_op = __raw_readl(pllbase + MXC_PLL_DP_HFS_OP);
164 dp_mfd = __raw_readl(pllbase + MXC_PLL_DP_HFS_MFD);
165 dp_mfn = __raw_readl(pllbase + MXC_PLL_DP_HFS_MFN);
166 }
167
168 pdf = dp_op & MXC_PLL_DP_OP_PDF_MASK;
169 mfi = (dp_op >> MXC_PLL_DP_OP_MFI_OFFSET) & MXC_PLL_DP_OP_PDF_MASK;
170 mfi = (mfi <= 5) ? 5 : mfi;
171 mfd = dp_mfd & MXC_PLL_DP_MFD_MASK;
172 mfn = dp_mfn & MXC_PLL_DP_MFN_MASK;
173 mfn = (mfn <= 0x4000000) ? mfn : (mfn - 0x10000000);
174
175 if (mfn < 0)
176 mfn_abs = -mfn;
177 else
178 mfn_abs = mfn;
179
180/* XXX: actually this asumes that ckih is fed to pll, but spec says
181 * that ckih_x2 is also possible. need to check this out.
182 */
183 ref_clk = clk_get_rate(&ckih_clk);
184
185 ref_clk *= 2;
186 ref_clk /= pdf + 1;
187
188 temp = (u64) ref_clk * mfn_abs;
189 do_div(temp, mfd);
190 if (mfn < 0)
191 temp = -temp;
192 temp += ref_clk * mfi;
193
194 return temp;
195}
196
197static int clk_pll_enable(struct clk *clk)
198{
199 void __iomem *ctl;
200 u32 reg;
201
202 ctl = pll_base(clk);
203 reg = __raw_readl(ctl);
204 reg |= (MXC_PLL_DP_CTL_RST | MXC_PLL_DP_CTL_UPEN);
205 __raw_writel(reg, ctl);
206 do {
207 reg = __raw_readl(ctl);
208 } while ((reg & MXC_PLL_DP_CTL_LRF) != MXC_PLL_DP_CTL_LRF);
209 return 0;
210}
211
212static void clk_pll_disable(struct clk *clk)
213{
214 void __iomem *ctl;
215 u32 reg;
216
217 ctl = pll_base(clk);
218 reg = __raw_readl(ctl);
219 reg &= ~(MXC_PLL_DP_CTL_RST | MXC_PLL_DP_CTL_UPEN);
220 __raw_writel(reg, ctl);
221}
222
223static struct clk mcu_pll_clk = {
224 .parent = &ckih_clk,
225 .get_rate = clk_pll_get_rate,
226 .enable = clk_pll_enable,
227 .disable = clk_pll_disable,
228};
229
230static struct clk dsp_pll_clk = {
231 .parent = &ckih_clk,
232 .get_rate = clk_pll_get_rate,
233 .enable = clk_pll_enable,
234 .disable = clk_pll_disable,
235};
236
237static struct clk usb_pll_clk = {
238 .parent = &ckih_clk,
239 .get_rate = clk_pll_get_rate,
240 .enable = clk_pll_enable,
241 .disable = clk_pll_disable,
242};
243/* plls stuff end */
244
245/* ap_ref_clk stuff */
246static struct clk ap_ref_clk;
247
248static unsigned long clk_ap_ref_get_rate(struct clk *clk)
249{
250 u32 ascsr, acsr;
251 u8 ap_pat_ref_div_2, ap_isel, acs, ads;
252
253 ascsr = __raw_readl(MXC_CRMAP_ASCSR);
254 acsr = __raw_readl(MXC_CRMAP_ACSR);
255
256 /* 0 for ckih, 1 for ckih*2 */
257 ap_isel = ascsr & MXC_CRMAP_ASCSR_APISEL;
258 /* reg divider */
259 ap_pat_ref_div_2 = (ascsr >> MXC_CRMAP_ASCSR_AP_PATDIV2_OFFSET) & 0x1;
260 /* undocumented, 1 for disabling divider */
261 ads = (acsr >> MXC_CRMAP_ACSR_ADS_OFFSET) & 0x1;
262 /* 0 for pat_ref, 1 for divider out */
263 acs = acsr & MXC_CRMAP_ACSR_ACS;
264
265 if (acs & !ads)
266 /* use divided clock */
267 return clk_get_rate(clk->parent) / (ap_pat_ref_div_2 ? 2 : 1);
268
269 return clk_get_rate(clk->parent) * (ap_isel ? 2 : 1);
270}
271
272static struct clk ap_ref_clk = {
273 .parent = &ckih_clk,
274 .get_rate = clk_ap_ref_get_rate,
275};
276/* ap_ref_clk stuff end */
277
278/* ap_pre_dfs_clk stuff */
279static struct clk ap_pre_dfs_clk;
280
281static unsigned long clk_ap_pre_dfs_get_rate(struct clk *clk)
282{
283 u32 acsr, ascsr;
284
285 acsr = __raw_readl(MXC_CRMAP_ACSR);
286 ascsr = __raw_readl(MXC_CRMAP_ASCSR);
287
288 if (acsr & MXC_CRMAP_ACSR_ACS) {
289 u8 sel;
290 sel = (ascsr & MXC_CRMAP_ASCSR_APSEL_MASK) >>
291 MXC_CRMAP_ASCSR_APSEL_OFFSET;
292 return clk_get_rate(pll_clk(sel)) /
293 CRM_SMALL_DIVIDER(MXC_CRMAP_ACDR, ARMDIV);
294 }
295 return clk_get_rate(&ap_ref_clk);
296}
297
298static struct clk ap_pre_dfs_clk = {
299 .get_rate = clk_ap_pre_dfs_get_rate,
300};
301/* ap_pre_dfs_clk stuff end */
302
303/* usb_clk stuff */
304static struct clk usb_clk;
305
306static struct clk *clk_usb_parent(struct clk *clk)
307{
308 u32 acsr, ascsr;
309
310 acsr = __raw_readl(MXC_CRMAP_ACSR);
311 ascsr = __raw_readl(MXC_CRMAP_ASCSR);
312
313 if (acsr & MXC_CRMAP_ACSR_ACS) {
314 u8 sel;
315 sel = (ascsr & MXC_CRMAP_ASCSR_USBSEL_MASK) >>
316 MXC_CRMAP_ASCSR_USBSEL_OFFSET;
317 return pll_clk(sel);
318 }
319 return &ap_ref_clk;
320}
321
322static unsigned long clk_usb_get_rate(struct clk *clk)
323{
324 return clk_get_rate(clk->parent) /
325 CRM_SMALL_DIVIDER(MXC_CRMAP_ACDER2, USBDIV);
326}
327
328static struct clk usb_clk = {
329 .enable_reg = MXC_CRMAP_ACDER2,
330 .enable_shift = MXC_CRMAP_ACDER2_USBEN_OFFSET,
331 .get_rate = clk_usb_get_rate,
332 .enable = _clk_1bit_enable,
333 .disable = _clk_1bit_disable,
334};
335/* usb_clk stuff end */
336
337static unsigned long clk_ipg_get_rate(struct clk *clk)
338{
339 return clk_get_rate(clk->parent) / CRM_16DIVIDER(MXC_CRMAP_ACDR, IPDIV);
340}
341
342static unsigned long clk_ahb_get_rate(struct clk *clk)
343{
344 return clk_get_rate(clk->parent) /
345 CRM_16DIVIDER(MXC_CRMAP_ACDR, AHBDIV);
346}
347
348static struct clk ipg_clk = {
349 .parent = &ap_pre_dfs_clk,
350 .get_rate = clk_ipg_get_rate,
351};
352
353static struct clk ahb_clk = {
354 .parent = &ap_pre_dfs_clk,
355 .get_rate = clk_ahb_get_rate,
356};
357
358/* perclk_clk stuff */
359static struct clk perclk_clk;
360
361static unsigned long clk_perclk_get_rate(struct clk *clk)
362{
363 u32 acder2;
364
365 acder2 = __raw_readl(MXC_CRMAP_ACDER2);
366 if (acder2 & MXC_CRMAP_ACDER2_BAUD_ISEL_MASK)
367 return 2 * clk_get_rate(clk->parent);
368
369 return clk_get_rate(clk->parent);
370}
371
372static struct clk perclk_clk = {
373 .parent = &ckih_clk,
374 .get_rate = clk_perclk_get_rate,
375};
376/* perclk_clk stuff end */
377
378/* uart_clk stuff */
379static struct clk uart_clk[];
380
381static unsigned long clk_uart_get_rate(struct clk *clk)
382{
383 u32 div;
384
385 switch (clk->id) {
386 case 0:
387 case 1:
388 div = CRM_SMALL_DIVIDER(MXC_CRMAP_ACDER2, BAUDDIV);
389 break;
390 case 2:
391 div = CRM_SMALL_DIVIDER(MXC_CRMAP_APRA, UART3DIV);
392 break;
393 default:
394 BUG();
395 }
396 return clk_get_rate(clk->parent) / div;
397}
398
399static struct clk uart_clk[] = {
400 {
401 .id = 0,
402 .parent = &perclk_clk,
403 .enable_reg = MXC_CRMAP_APRA,
404 .enable_shift = MXC_CRMAP_APRA_UART1EN_OFFSET,
405 .get_rate = clk_uart_get_rate,
406 .enable = _clk_1bit_enable,
407 .disable = _clk_1bit_disable,
408 }, {
409 .id = 1,
410 .parent = &perclk_clk,
411 .enable_reg = MXC_CRMAP_APRA,
412 .enable_shift = MXC_CRMAP_APRA_UART2EN_OFFSET,
413 .get_rate = clk_uart_get_rate,
414 .enable = _clk_1bit_enable,
415 .disable = _clk_1bit_disable,
416 }, {
417 .id = 2,
418 .parent = &perclk_clk,
419 .enable_reg = MXC_CRMAP_APRA,
420 .enable_shift = MXC_CRMAP_APRA_UART3EN_OFFSET,
421 .get_rate = clk_uart_get_rate,
422 .enable = _clk_1bit_enable,
423 .disable = _clk_1bit_disable,
424 },
425};
426/* uart_clk stuff end */
427
428/* sdhc_clk stuff */
429static struct clk nfc_clk;
430
431static unsigned long clk_nfc_get_rate(struct clk *clk)
432{
433 return clk_get_rate(clk->parent) /
434 CRM_1DIVIDER(MXC_CRMAP_ACDER2, NFCDIV);
435}
436
437static struct clk nfc_clk = {
438 .parent = &ahb_clk,
439 .enable_reg = MXC_CRMAP_ACDER2,
440 .enable_shift = MXC_CRMAP_ACDER2_NFCEN_OFFSET,
441 .get_rate = clk_nfc_get_rate,
442 .enable = _clk_1bit_enable,
443 .disable = _clk_1bit_disable,
444};
445/* sdhc_clk stuff end */
446
447/* sdhc_clk stuff */
448static struct clk sdhc_clk[];
449
450static struct clk *clk_sdhc_parent(struct clk *clk)
451{
452 u32 aprb;
453 u8 sel;
454 u32 mask;
455 int offset;
456
457 aprb = __raw_readl(MXC_CRMAP_APRB);
458
459 switch (clk->id) {
460 case 0:
461 mask = MXC_CRMAP_APRB_SDHC1_ISEL_MASK;
462 offset = MXC_CRMAP_APRB_SDHC1_ISEL_OFFSET;
463 break;
464 case 1:
465 mask = MXC_CRMAP_APRB_SDHC2_ISEL_MASK;
466 offset = MXC_CRMAP_APRB_SDHC2_ISEL_OFFSET;
467 break;
468 default:
469 BUG();
470 }
471 sel = (aprb & mask) >> offset;
472
473 switch (sel) {
474 case 0:
475 return &ckih_clk;
476 case 1:
477 return &ckih_x2_clk;
478 }
479 return &usb_clk;
480}
481
482static unsigned long clk_sdhc_get_rate(struct clk *clk)
483{
484 u32 div;
485
486 switch (clk->id) {
487 case 0:
488 div = CRM_SMALL_DIVIDER(MXC_CRMAP_APRB, SDHC1_DIV);
489 break;
490 case 1:
491 div = CRM_SMALL_DIVIDER(MXC_CRMAP_APRB, SDHC2_DIV);
492 break;
493 default:
494 BUG();
495 }
496
497 return clk_get_rate(clk->parent) / div;
498}
499
500static int clk_sdhc_enable(struct clk *clk)
501{
502 u32 amlpmre1, aprb;
503
504 amlpmre1 = __raw_readl(MXC_CRMAP_AMLPMRE1);
505 aprb = __raw_readl(MXC_CRMAP_APRB);
506 switch (clk->id) {
507 case 0:
508 amlpmre1 |= (0x7 << MXC_CRMAP_AMLPMRE1_MLPME4_OFFSET);
509 aprb |= (0x1 << MXC_CRMAP_APRB_SDHC1EN_OFFSET);
510 break;
511 case 1:
512 amlpmre1 |= (0x7 << MXC_CRMAP_AMLPMRE1_MLPME5_OFFSET);
513 aprb |= (0x1 << MXC_CRMAP_APRB_SDHC2EN_OFFSET);
514 break;
515 }
516 __raw_writel(amlpmre1, MXC_CRMAP_AMLPMRE1);
517 __raw_writel(aprb, MXC_CRMAP_APRB);
518 return 0;
519}
520
521static void clk_sdhc_disable(struct clk *clk)
522{
523 u32 amlpmre1, aprb;
524
525 amlpmre1 = __raw_readl(MXC_CRMAP_AMLPMRE1);
526 aprb = __raw_readl(MXC_CRMAP_APRB);
527 switch (clk->id) {
528 case 0:
529 amlpmre1 &= ~(0x7 << MXC_CRMAP_AMLPMRE1_MLPME4_OFFSET);
530 aprb &= ~(0x1 << MXC_CRMAP_APRB_SDHC1EN_OFFSET);
531 break;
532 case 1:
533 amlpmre1 &= ~(0x7 << MXC_CRMAP_AMLPMRE1_MLPME5_OFFSET);
534 aprb &= ~(0x1 << MXC_CRMAP_APRB_SDHC2EN_OFFSET);
535 break;
536 }
537 __raw_writel(amlpmre1, MXC_CRMAP_AMLPMRE1);
538 __raw_writel(aprb, MXC_CRMAP_APRB);
539}
540
541static struct clk sdhc_clk[] = {
542 {
543 .id = 0,
544 .get_rate = clk_sdhc_get_rate,
545 .enable = clk_sdhc_enable,
546 .disable = clk_sdhc_disable,
547 }, {
548 .id = 1,
549 .get_rate = clk_sdhc_get_rate,
550 .enable = clk_sdhc_enable,
551 .disable = clk_sdhc_disable,
552 },
553};
554/* sdhc_clk stuff end */
555
556/* wdog_clk stuff */
557static struct clk wdog_clk[] = {
558 {
559 .id = 0,
560 .parent = &ipg_clk,
561 .enable_reg = MXC_CRMAP_AMLPMRD,
562 .enable_shift = MXC_CRMAP_AMLPMRD_MLPMD7_OFFSET,
563 .enable = _clk_3bit_enable,
564 .disable = _clk_3bit_disable,
565 }, {
566 .id = 1,
567 .parent = &ipg_clk,
568 .enable_reg = MXC_CRMAP_AMLPMRD,
569 .enable_shift = MXC_CRMAP_AMLPMRD_MLPMD3_OFFSET,
570 .enable = _clk_3bit_enable,
571 .disable = _clk_3bit_disable,
572 },
573};
574/* wdog_clk stuff end */
575
576/* gpt_clk stuff */
577static struct clk gpt_clk = {
578 .parent = &ipg_clk,
579 .enable_reg = MXC_CRMAP_AMLPMRC,
580 .enable_shift = MXC_CRMAP_AMLPMRC_MLPMC4_OFFSET,
581 .enable = _clk_3bit_enable,
582 .disable = _clk_3bit_disable,
583};
584/* gpt_clk stuff end */
585
586/* cspi_clk stuff */
587static struct clk cspi_clk[] = {
588 {
589 .id = 0,
590 .parent = &ipg_clk,
591 .enable_reg = MXC_CRMAP_AMLPMRE2,
592 .enable_shift = MXC_CRMAP_AMLPMRE2_MLPME0_OFFSET,
593 .enable = _clk_3bit_enable,
594 .disable = _clk_3bit_disable,
595 }, {
596 .id = 1,
597 .parent = &ipg_clk,
598 .enable_reg = MXC_CRMAP_AMLPMRE1,
599 .enable_shift = MXC_CRMAP_AMLPMRE1_MLPME6_OFFSET,
600 .enable = _clk_3bit_enable,
601 .disable = _clk_3bit_disable,
602 },
603};
604/* cspi_clk stuff end */
605
606#define _REGISTER_CLOCK(d, n, c) \
607 { \
608 .dev_id = d, \
609 .con_id = n, \
610 .clk = &c, \
611 },
612
613static struct clk_lookup lookups[] = {
614 _REGISTER_CLOCK("imx-uart.0", NULL, uart_clk[0])
615 _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk[1])
616 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk[2])
617 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc_clk[0])
618 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc_clk[1])
619 _REGISTER_CLOCK("mxc-wdt.0", NULL, wdog_clk[0])
620 _REGISTER_CLOCK("spi_imx.0", NULL, cspi_clk[0])
621 _REGISTER_CLOCK("spi_imx.1", NULL, cspi_clk[1])
622};
623
624int __init mxc91231_clocks_init(unsigned long fref)
625{
626 void __iomem *gpt_base;
627 int i;
628
629 ckih_rate = fref;
630
631 usb_clk.parent = clk_usb_parent(&usb_clk);
632 sdhc_clk[0].parent = clk_sdhc_parent(&sdhc_clk[0]);
633 sdhc_clk[1].parent = clk_sdhc_parent(&sdhc_clk[1]);
634
635 for (i = 0; i < ARRAY_SIZE(lookups); i++)
636 clkdev_add(&lookups[i]);
637
638 gpt_base = MXC91231_IO_ADDRESS(MXC91231_GPT1_BASE_ADDR);
639 mxc_timer_init(&gpt_clk, gpt_base, MXC91231_INT_GPT);
640
641 return 0;
642}
diff --git a/arch/arm/mach-mxc91231/crm_regs.h b/arch/arm/mach-mxc91231/crm_regs.h
new file mode 100644
index 000000000000..ce4f59058189
--- /dev/null
+++ b/arch/arm/mach-mxc91231/crm_regs.h
@@ -0,0 +1,399 @@
1/*
2 * Copyright 2006 Freescale Semiconductor, Inc.
3 * Copyright 2006-2007 Motorola, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21#ifndef _ARCH_ARM_MACH_MXC91231_CRM_REGS_H_
22#define _ARCH_ARM_MACH_MXC91231_CRM_REGS_H_
23
24#define CKIL_CLK_FREQ 32768
25
26#define MXC_CRM_AP_BASE MXC91231_IO_ADDRESS(MXC91231_CRM_AP_BASE_ADDR)
27#define MXC_CRM_COM_BASE MXC91231_IO_ADDRESS(MXC91231_CRM_COM_BASE_ADDR)
28#define MXC_DSM_BASE MXC91231_IO_ADDRESS(MXC91231_DSM_BASE_ADDR)
29#define MXC_PLL0_BASE MXC91231_IO_ADDRESS(MXC91231_PLL0_BASE_ADDR)
30#define MXC_PLL1_BASE MXC91231_IO_ADDRESS(MXC91231_PLL1_BASE_ADDR)
31#define MXC_PLL2_BASE MXC91231_IO_ADDRESS(MXC91231_PLL2_BASE_ADDR)
32#define MXC_CLKCTL_BASE MXC91231_IO_ADDRESS(MXC91231_CLKCTL_BASE_ADDR)
33
34/* PLL Register Offsets */
35#define MXC_PLL_DP_CTL 0x00
36#define MXC_PLL_DP_CONFIG 0x04
37#define MXC_PLL_DP_OP 0x08
38#define MXC_PLL_DP_MFD 0x0C
39#define MXC_PLL_DP_MFN 0x10
40#define MXC_PLL_DP_HFS_OP 0x1C
41#define MXC_PLL_DP_HFS_MFD 0x20
42#define MXC_PLL_DP_HFS_MFN 0x24
43
44/* PLL Register Bit definitions */
45#define MXC_PLL_DP_CTL_DPDCK0_2_EN 0x1000
46#define MXC_PLL_DP_CTL_ADE 0x800
47#define MXC_PLL_DP_CTL_REF_CLK_DIV 0x400
48#define MXC_PLL_DP_CTL_HFSM 0x80
49#define MXC_PLL_DP_CTL_PRE 0x40
50#define MXC_PLL_DP_CTL_UPEN 0x20
51#define MXC_PLL_DP_CTL_RST 0x10
52#define MXC_PLL_DP_CTL_RCP 0x8
53#define MXC_PLL_DP_CTL_PLM 0x4
54#define MXC_PLL_DP_CTL_BRM0 0x2
55#define MXC_PLL_DP_CTL_LRF 0x1
56
57#define MXC_PLL_DP_OP_MFI_OFFSET 4
58#define MXC_PLL_DP_OP_MFI_MASK 0xF
59#define MXC_PLL_DP_OP_PDF_OFFSET 0
60#define MXC_PLL_DP_OP_PDF_MASK 0xF
61
62#define MXC_PLL_DP_MFD_OFFSET 0
63#define MXC_PLL_DP_MFD_MASK 0x7FFFFFF
64
65#define MXC_PLL_DP_MFN_OFFSET 0
66#define MXC_PLL_DP_MFN_MASK 0x7FFFFFF
67
68/* CRM AP Register Offsets */
69#define MXC_CRMAP_ASCSR (MXC_CRM_AP_BASE + 0x00)
70#define MXC_CRMAP_ACDR (MXC_CRM_AP_BASE + 0x04)
71#define MXC_CRMAP_ACDER1 (MXC_CRM_AP_BASE + 0x08)
72#define MXC_CRMAP_ACDER2 (MXC_CRM_AP_BASE + 0x0C)
73#define MXC_CRMAP_ACGCR (MXC_CRM_AP_BASE + 0x10)
74#define MXC_CRMAP_ACCGCR (MXC_CRM_AP_BASE + 0x14)
75#define MXC_CRMAP_AMLPMRA (MXC_CRM_AP_BASE + 0x18)
76#define MXC_CRMAP_AMLPMRB (MXC_CRM_AP_BASE + 0x1C)
77#define MXC_CRMAP_AMLPMRC (MXC_CRM_AP_BASE + 0x20)
78#define MXC_CRMAP_AMLPMRD (MXC_CRM_AP_BASE + 0x24)
79#define MXC_CRMAP_AMLPMRE1 (MXC_CRM_AP_BASE + 0x28)
80#define MXC_CRMAP_AMLPMRE2 (MXC_CRM_AP_BASE + 0x2C)
81#define MXC_CRMAP_AMLPMRF (MXC_CRM_AP_BASE + 0x30)
82#define MXC_CRMAP_AMLPMRG (MXC_CRM_AP_BASE + 0x34)
83#define MXC_CRMAP_APGCR (MXC_CRM_AP_BASE + 0x38)
84#define MXC_CRMAP_ACSR (MXC_CRM_AP_BASE + 0x3C)
85#define MXC_CRMAP_ADCR (MXC_CRM_AP_BASE + 0x40)
86#define MXC_CRMAP_ACR (MXC_CRM_AP_BASE + 0x44)
87#define MXC_CRMAP_AMCR (MXC_CRM_AP_BASE + 0x48)
88#define MXC_CRMAP_APCR (MXC_CRM_AP_BASE + 0x4C)
89#define MXC_CRMAP_AMORA (MXC_CRM_AP_BASE + 0x50)
90#define MXC_CRMAP_AMORB (MXC_CRM_AP_BASE + 0x54)
91#define MXC_CRMAP_AGPR (MXC_CRM_AP_BASE + 0x58)
92#define MXC_CRMAP_APRA (MXC_CRM_AP_BASE + 0x5C)
93#define MXC_CRMAP_APRB (MXC_CRM_AP_BASE + 0x60)
94#define MXC_CRMAP_APOR (MXC_CRM_AP_BASE + 0x64)
95#define MXC_CRMAP_ADFMR (MXC_CRM_AP_BASE + 0x68)
96
97/* CRM AP Register Bit definitions */
98#define MXC_CRMAP_ASCSR_CRS 0x10000
99#define MXC_CRMAP_ASCSR_AP_PATDIV2_OFFSET 15
100#define MXC_CRMAP_ASCSR_AP_PATREF_DIV2 0x8000
101#define MXC_CRMAP_ASCSR_USBSEL_OFFSET 13
102#define MXC_CRMAP_ASCSR_USBSEL_MASK (0x3 << 13)
103#define MXC_CRMAP_ASCSR_CSISEL_OFFSET 11
104#define MXC_CRMAP_ASCSR_CSISEL_MASK (0x3 << 11)
105#define MXC_CRMAP_ASCSR_SSI2SEL_OFFSET 7
106#define MXC_CRMAP_ASCSR_SSI2SEL_MASK (0x3 << 7)
107#define MXC_CRMAP_ASCSR_SSI1SEL_OFFSET 5
108#define MXC_CRMAP_ASCSR_SSI1SEL_MASK (0x3 << 5)
109#define MXC_CRMAP_ASCSR_APSEL_OFFSET 3
110#define MXC_CRMAP_ASCSR_APSEL_MASK (0x3 << 3)
111#define MXC_CRMAP_ASCSR_AP_PATDIV1_OFFSET 2
112#define MXC_CRMAP_ASCSR_AP_PATREF_DIV1 0x4
113#define MXC_CRMAP_ASCSR_APISEL 0x1
114
115#define MXC_CRMAP_ACDR_ARMDIV_OFFSET 8
116#define MXC_CRMAP_ACDR_ARMDIV_MASK (0xF << 8)
117#define MXC_CRMAP_ACDR_AHBDIV_OFFSET 4
118#define MXC_CRMAP_ACDR_AHBDIV_MASK (0xF << 4)
119#define MXC_CRMAP_ACDR_IPDIV_OFFSET 0
120#define MXC_CRMAP_ACDR_IPDIV_MASK 0xF
121
122#define MXC_CRMAP_ACDER1_CSIEN_OFFSET 30
123#define MXC_CRMAP_ACDER1_CSIDIV_OFFSET 24
124#define MXC_CRMAP_ACDER1_CSIDIV_MASK (0x3F << 24)
125#define MXC_CRMAP_ACDER1_SSI2EN_OFFSET 14
126#define MXC_CRMAP_ACDER1_SSI2DIV_OFFSET 8
127#define MXC_CRMAP_ACDER1_SSI2DIV_MASK (0x3F << 8)
128#define MXC_CRMAP_ACDER1_SSI1EN_OFFSET 6
129#define MXC_CRMAP_ACDER1_SSI1DIV_OFFSET 0
130#define MXC_CRMAP_ACDER1_SSI1DIV_MASK 0x3F
131
132#define MXC_CRMAP_ACDER2_CRCT_CLK_DIV_OFFSET 24
133#define MXC_CRMAP_ACDER2_CRCT_CLK_DIV_MASK (0x7 << 24)
134#define MXC_CRMAP_ACDER2_NFCEN_OFFSET 20
135#define MXC_CRMAP_ACDER2_NFCDIV_OFFSET 16
136#define MXC_CRMAP_ACDER2_NFCDIV_MASK (0xF << 16)
137#define MXC_CRMAP_ACDER2_USBEN_OFFSET 12
138#define MXC_CRMAP_ACDER2_USBDIV_OFFSET 8
139#define MXC_CRMAP_ACDER2_USBDIV_MASK (0xF << 8)
140#define MXC_CRMAP_ACDER2_BAUD_ISEL_OFFSET 5
141#define MXC_CRMAP_ACDER2_BAUD_ISEL_MASK (0x3 << 5)
142#define MXC_CRMAP_ACDER2_BAUDDIV_OFFSET 0
143#define MXC_CRMAP_ACDER2_BAUDDIV_MASK 0xF
144
145#define MXC_CRMAP_AMLPMRA_MLPMA7_OFFSET 22
146#define MXC_CRMAP_AMLPMRA_MLPMA7_MASK (0x7 << 22)
147#define MXC_CRMAP_AMLPMRA_MLPMA6_OFFSET 19
148#define MXC_CRMAP_AMLPMRA_MLPMA6_MASK (0x7 << 19)
149#define MXC_CRMAP_AMLPMRA_MLPMA4_OFFSET 12
150#define MXC_CRMAP_AMLPMRA_MLPMA4_MASK (0x7 << 12)
151#define MXC_CRMAP_AMLPMRA_MLPMA3_OFFSET 9
152#define MXC_CRMAP_AMLPMRA_MLPMA3_MASK (0x7 << 9)
153#define MXC_CRMAP_AMLPMRA_MLPMA2_OFFSET 6
154#define MXC_CRMAP_AMLPMRA_MLPMA2_MASK (0x7 << 6)
155#define MXC_CRMAP_AMLPMRA_MLPMA1_OFFSET 3
156#define MXC_CRMAP_AMLPMRA_MLPMA1_MASK (0x7 << 3)
157
158#define MXC_CRMAP_AMLPMRB_MLPMB0_OFFSET 0
159#define MXC_CRMAP_AMLPMRB_MLPMB0_MASK 0x7
160
161#define MXC_CRMAP_AMLPMRC_MLPMC9_OFFSET 28
162#define MXC_CRMAP_AMLPMRC_MLPMC9_MASK (0x7 << 28)
163#define MXC_CRMAP_AMLPMRC_MLPMC7_OFFSET 22
164#define MXC_CRMAP_AMLPMRC_MLPMC7_MASK (0x7 << 22)
165#define MXC_CRMAP_AMLPMRC_MLPMC5_OFFSET 16
166#define MXC_CRMAP_AMLPMRC_MLPMC5_MASK (0x7 << 16)
167#define MXC_CRMAP_AMLPMRC_MLPMC4_OFFSET 12
168#define MXC_CRMAP_AMLPMRC_MLPMC4_MASK (0x7 << 12)
169#define MXC_CRMAP_AMLPMRC_MLPMC3_OFFSET 9
170#define MXC_CRMAP_AMLPMRC_MLPMC3_MASK (0x7 << 9)
171#define MXC_CRMAP_AMLPMRC_MLPMC2_OFFSET 6
172#define MXC_CRMAP_AMLPMRC_MLPMC2_MASK (0x7 << 6)
173#define MXC_CRMAP_AMLPMRC_MLPMC1_OFFSET 3
174#define MXC_CRMAP_AMLPMRC_MLPMC1_MASK (0x7 << 3)
175#define MXC_CRMAP_AMLPMRC_MLPMC0_OFFSET 0
176#define MXC_CRMAP_AMLPMRC_MLPMC0_MASK 0x7
177
178#define MXC_CRMAP_AMLPMRD_MLPMD7_OFFSET 22
179#define MXC_CRMAP_AMLPMRD_MLPMD7_MASK (0x7 << 22)
180#define MXC_CRMAP_AMLPMRD_MLPMD4_OFFSET 12
181#define MXC_CRMAP_AMLPMRD_MLPMD4_MASK (0x7 << 12)
182#define MXC_CRMAP_AMLPMRD_MLPMD3_OFFSET 9
183#define MXC_CRMAP_AMLPMRD_MLPMD3_MASK (0x7 << 9)
184#define MXC_CRMAP_AMLPMRD_MLPMD2_OFFSET 6
185#define MXC_CRMAP_AMLPMRD_MLPMD2_MASK (0x7 << 6)
186#define MXC_CRMAP_AMLPMRD_MLPMD0_OFFSET 0
187#define MXC_CRMAP_AMLPMRD_MLPMD0_MASK 0x7
188
189#define MXC_CRMAP_AMLPMRE1_MLPME9_OFFSET 28
190#define MXC_CRMAP_AMLPMRE1_MLPME9_MASK (0x7 << 28)
191#define MXC_CRMAP_AMLPMRE1_MLPME8_OFFSET 25
192#define MXC_CRMAP_AMLPMRE1_MLPME8_MASK (0x7 << 25)
193#define MXC_CRMAP_AMLPMRE1_MLPME7_OFFSET 22
194#define MXC_CRMAP_AMLPMRE1_MLPME7_MASK (0x7 << 22)
195#define MXC_CRMAP_AMLPMRE1_MLPME6_OFFSET 19
196#define MXC_CRMAP_AMLPMRE1_MLPME6_MASK (0x7 << 19)
197#define MXC_CRMAP_AMLPMRE1_MLPME5_OFFSET 16
198#define MXC_CRMAP_AMLPMRE1_MLPME5_MASK (0x7 << 16)
199#define MXC_CRMAP_AMLPMRE1_MLPME4_OFFSET 12
200#define MXC_CRMAP_AMLPMRE1_MLPME4_MASK (0x7 << 12)
201#define MXC_CRMAP_AMLPMRE1_MLPME3_OFFSET 9
202#define MXC_CRMAP_AMLPMRE1_MLPME3_MASK (0x7 << 9)
203#define MXC_CRMAP_AMLPMRE1_MLPME2_OFFSET 6
204#define MXC_CRMAP_AMLPMRE1_MLPME2_MASK (0x7 << 6)
205#define MXC_CRMAP_AMLPMRE1_MLPME1_OFFSET 3
206#define MXC_CRMAP_AMLPMRE1_MLPME1_MASK (0x7 << 3)
207#define MXC_CRMAP_AMLPMRE1_MLPME0_OFFSET 0
208#define MXC_CRMAP_AMLPMRE1_MLPME0_MASK 0x7
209
210#define MXC_CRMAP_AMLPMRE2_MLPME0_OFFSET 0
211#define MXC_CRMAP_AMLPMRE2_MLPME0_MASK 0x7
212
213#define MXC_CRMAP_AMLPMRF_MLPMF6_OFFSET 19
214#define MXC_CRMAP_AMLPMRF_MLPMF6_MASK (0x7 << 19)
215#define MXC_CRMAP_AMLPMRF_MLPMF5_OFFSET 16
216#define MXC_CRMAP_AMLPMRF_MLPMF5_MASK (0x7 << 16)
217#define MXC_CRMAP_AMLPMRF_MLPMF3_OFFSET 9
218#define MXC_CRMAP_AMLPMRF_MLPMF3_MASK (0x7 << 9)
219#define MXC_CRMAP_AMLPMRF_MLPMF2_OFFSET 6
220#define MXC_CRMAP_AMLPMRF_MLPMF2_MASK (0x7 << 6)
221#define MXC_CRMAP_AMLPMRF_MLPMF1_OFFSET 3
222#define MXC_CRMAP_AMLPMRF_MLPMF1_MASK (0x7 << 3)
223#define MXC_CRMAP_AMLPMRF_MLPMF0_OFFSET 0
224#define MXC_CRMAP_AMLPMRF_MLPMF0_MASK (0x7 << 0)
225
226#define MXC_CRMAP_AMLPMRG_MLPMG9_OFFSET 28
227#define MXC_CRMAP_AMLPMRG_MLPMG9_MASK (0x7 << 28)
228#define MXC_CRMAP_AMLPMRG_MLPMG7_OFFSET 22
229#define MXC_CRMAP_AMLPMRG_MLPMG7_MASK (0x7 << 22)
230#define MXC_CRMAP_AMLPMRG_MLPMG6_OFFSET 19
231#define MXC_CRMAP_AMLPMRG_MLPMG6_MASK (0x7 << 19)
232#define MXC_CRMAP_AMLPMRG_MLPMG5_OFFSET 16
233#define MXC_CRMAP_AMLPMRG_MLPMG5_MASK (0x7 << 16)
234#define MXC_CRMAP_AMLPMRG_MLPMG4_OFFSET 12
235#define MXC_CRMAP_AMLPMRG_MLPMG4_MASK (0x7 << 12)
236#define MXC_CRMAP_AMLPMRG_MLPMG3_OFFSET 9
237#define MXC_CRMAP_AMLPMRG_MLPMG3_MASK (0x7 << 9)
238#define MXC_CRMAP_AMLPMRG_MLPMG2_OFFSET 6
239#define MXC_CRMAP_AMLPMRG_MLPMG2_MASK (0x7 << 6)
240#define MXC_CRMAP_AMLPMRG_MLPMG1_OFFSET 3
241#define MXC_CRMAP_AMLPMRG_MLPMG1_MASK (0x7 << 3)
242#define MXC_CRMAP_AMLPMRG_MLPMG0_OFFSET 0
243#define MXC_CRMAP_AMLPMRG_MLPMG0_MASK 0x7
244
245#define MXC_CRMAP_AGPR_IPUPAD_OFFSET 20
246#define MXC_CRMAP_AGPR_IPUPAD_MASK (0x7 << 20)
247
248#define MXC_CRMAP_APRA_EL1TEN_OFFSET 29
249#define MXC_CRMAP_APRA_SIMEN_OFFSET 24
250#define MXC_CRMAP_APRA_UART3DIV_OFFSET 17
251#define MXC_CRMAP_APRA_UART3DIV_MASK (0xF << 17)
252#define MXC_CRMAP_APRA_UART3EN_OFFSET 16
253#define MXC_CRMAP_APRA_SAHARA_DIV2_CLKEN_OFFSET 14
254#define MXC_CRMAP_APRA_MQSPIEN_OFFSET 13
255#define MXC_CRMAP_APRA_UART2EN_OFFSET 8
256#define MXC_CRMAP_APRA_UART1EN_OFFSET 0
257
258#define MXC_CRMAP_APRB_SDHC2_ISEL_OFFSET 13
259#define MXC_CRMAP_APRB_SDHC2_ISEL_MASK (0x7 << 13)
260#define MXC_CRMAP_APRB_SDHC2_DIV_OFFSET 9
261#define MXC_CRMAP_APRB_SDHC2_DIV_MASK (0xF << 9)
262#define MXC_CRMAP_APRB_SDHC2EN_OFFSET 8
263#define MXC_CRMAP_APRB_SDHC1_ISEL_OFFSET 5
264#define MXC_CRMAP_APRB_SDHC1_ISEL_MASK (0x7 << 5)
265#define MXC_CRMAP_APRB_SDHC1_DIV_OFFSET 1
266#define MXC_CRMAP_APRB_SDHC1_DIV_MASK (0xF << 1)
267#define MXC_CRMAP_APRB_SDHC1EN_OFFSET 0
268
269#define MXC_CRMAP_ACSR_ADS_OFFSET 8
270#define MXC_CRMAP_ACSR_ADS (0x1 << 8)
271#define MXC_CRMAP_ACSR_ACS 0x1
272
273#define MXC_CRMAP_ADCR_LFDF_0 (0x0 << 8)
274#define MXC_CRMAP_ADCR_LFDF_2 (0x1 << 8)
275#define MXC_CRMAP_ADCR_LFDF_4 (0x2 << 8)
276#define MXC_CRMAP_ADCR_LFDF_8 (0x3 << 8)
277#define MXC_CRMAP_ADCR_LFDF_OFFSET 8
278#define MXC_CRMAP_ADCR_LFDF_MASK (0x3 << 8)
279#define MXC_CRMAP_ADCR_ALT_PLL 0x80
280#define MXC_CRMAP_ADCR_DFS_DIVEN 0x20
281#define MXC_CRMAP_ADCR_DIV_BYP 0x2
282#define MXC_CRMAP_ADCR_VSTAT 0x8
283#define MXC_CRMAP_ADCR_TSTAT 0x10
284#define MXC_CRMAP_ADCR_DVFS_VCTRL 0x10
285#define MXC_CRMAP_ADCR_CLK_ON 0x40
286
287#define MXC_CRMAP_ADFMR_FC_OFFSET 16
288#define MXC_CRMAP_ADFMR_FC_MASK (0x1F << 16)
289#define MXC_CRMAP_ADFMR_MF_OFFSET 1
290#define MXC_CRMAP_ADFMR_MF_MASK (0x3FF << 1)
291#define MXC_CRMAP_ADFMR_DFM_CLK_READY 0x1
292#define MXC_CRMAP_ADFMR_DFM_PWR_DOWN 0x8000
293
294#define MXC_CRMAP_ACR_CKOHS_HIGH (1 << 18)
295#define MXC_CRMAP_ACR_CKOS_HIGH (1 << 16)
296#define MXC_CRMAP_ACR_CKOHS_MASK (0x7 << 12)
297#define MXC_CRMAP_ACR_CKOHD (1 << 11)
298#define MXC_CRMAP_ACR_CKOHDIV_MASK (0xF << 8)
299#define MXC_CRMAP_ACR_CKOHDIV_OFFSET 8
300#define MXC_CRMAP_ACR_CKOD (1 << 7)
301#define MXC_CRMAP_ACR_CKOS_MASK (0x7 << 4)
302
303/* AP Warm reset */
304#define MXC_CRMAP_AMCR_SW_AP (1 << 14)
305
306/* Bit definitions of ACGCR in CRM_AP for tree level clock gating */
307#define MXC_CRMAP_ACGCR_ACG0_STOP_WAIT 0x00000001
308#define MXC_CRMAP_ACGCR_ACG0_STOP 0x00000003
309#define MXC_CRMAP_ACGCR_ACG0_RUN 0x00000007
310#define MXC_CRMAP_ACGCR_ACG0_DISABLED 0x00000000
311
312#define MXC_CRMAP_ACGCR_ACG1_STOP_WAIT 0x00000008
313#define MXC_CRMAP_ACGCR_ACG1_STOP 0x00000018
314#define MXC_CRMAP_ACGCR_ACG1_RUN 0x00000038
315#define MXC_CRMAP_ACGCR_ACG1_DISABLED 0x00000000
316
317#define MXC_CRMAP_ACGCR_ACG2_STOP_WAIT 0x00000040
318#define MXC_CRMAP_ACGCR_ACG2_STOP 0x000000C0
319#define MXC_CRMAP_ACGCR_ACG2_RUN 0x000001C0
320#define MXC_CRMAP_ACGCR_ACG2_DISABLED 0x00000000
321
322#define MXC_CRMAP_ACGCR_ACG3_STOP_WAIT 0x00000200
323#define MXC_CRMAP_ACGCR_ACG3_STOP 0x00000600
324#define MXC_CRMAP_ACGCR_ACG3_RUN 0x00000E00
325#define MXC_CRMAP_ACGCR_ACG3_DISABLED 0x00000000
326
327#define MXC_CRMAP_ACGCR_ACG4_STOP_WAIT 0x00001000
328#define MXC_CRMAP_ACGCR_ACG4_STOP 0x00003000
329#define MXC_CRMAP_ACGCR_ACG4_RUN 0x00007000
330#define MXC_CRMAP_ACGCR_ACG4_DISABLED 0x00000000
331
332#define MXC_CRMAP_ACGCR_ACG5_STOP_WAIT 0x00010000
333#define MXC_CRMAP_ACGCR_ACG5_STOP 0x00030000
334#define MXC_CRMAP_ACGCR_ACG5_RUN 0x00070000
335#define MXC_CRMAP_ACGCR_ACG5_DISABLED 0x00000000
336
337#define MXC_CRMAP_ACGCR_ACG6_STOP_WAIT 0x00080000
338#define MXC_CRMAP_ACGCR_ACG6_STOP 0x00180000
339#define MXC_CRMAP_ACGCR_ACG6_RUN 0x00380000
340#define MXC_CRMAP_ACGCR_ACG6_DISABLED 0x00000000
341
342#define NUM_GATE_CTRL 6
343
344/* CRM COM Register Offsets */
345#define MXC_CRMCOM_CSCR (MXC_CRM_COM_BASE + 0x0C)
346#define MXC_CRMCOM_CCCR (MXC_CRM_COM_BASE + 0x10)
347
348/* CRM COM Bit Definitions */
349#define MXC_CRMCOM_CSCR_PPD1 0x08000000
350#define MXC_CRMCOM_CSCR_CKOHSEL (1 << 18)
351#define MXC_CRMCOM_CSCR_CKOSEL (1 << 17)
352#define MXC_CRMCOM_CCCR_CC_DIV_OFFSET 8
353#define MXC_CRMCOM_CCCR_CC_DIV_MASK (0x1F << 8)
354#define MXC_CRMCOM_CCCR_CC_SEL_OFFSET 0
355#define MXC_CRMCOM_CCCR_CC_SEL_MASK 0x3
356
357/* DSM Register Offsets */
358#define MXC_DSM_SLEEP_TIME (MXC_DSM_BASE + 0x0c)
359#define MXC_DSM_CONTROL0 (MXC_DSM_BASE + 0x20)
360#define MXC_DSM_CONTROL1 (MXC_DSM_BASE + 0x24)
361#define MXC_DSM_CTREN (MXC_DSM_BASE + 0x28)
362#define MXC_DSM_WARM_PER (MXC_DSM_BASE + 0x40)
363#define MXC_DSM_LOCK_PER (MXC_DSM_BASE + 0x44)
364#define MXC_DSM_MGPER (MXC_DSM_BASE + 0x4c)
365#define MXC_DSM_CRM_CONTROL (MXC_DSM_BASE + 0x50)
366
367/* Bit definitions of various registers in DSM */
368#define MXC_DSM_CRM_CTRL_DVFS_BYP 0x00000008
369#define MXC_DSM_CRM_CTRL_DVFS_VCTRL 0x00000004
370#define MXC_DSM_CRM_CTRL_LPMD1 0x00000002
371#define MXC_DSM_CRM_CTRL_LPMD0 0x00000001
372#define MXC_DSM_CRM_CTRL_LPMD_STOP_MODE 0x00000000
373#define MXC_DSM_CRM_CTRL_LPMD_WAIT_MODE 0x00000001
374#define MXC_DSM_CRM_CTRL_LPMD_RUN_MODE 0x00000003
375#define MXC_DSM_CONTROL0_STBY_COMMIT_EN 0x00000200
376#define MXC_DSM_CONTROL0_MSTR_EN 0x00000001
377#define MXC_DSM_CONTROL0_RESTART 0x00000010
378/* Counter Block reset */
379#define MXC_DSM_CONTROL1_CB_RST 0x00000002
380/* State Machine reset */
381#define MXC_DSM_CONTROL1_SM_RST 0x00000004
382/* Bit needed to reset counter block */
383#define MXC_CONTROL1_RST_CNT32 0x00000008
384#define MXC_DSM_CONTROL1_RST_CNT32_EN 0x00000800
385#define MXC_DSM_CONTROL1_SLEEP 0x00000100
386#define MXC_DSM_CONTROL1_WAKEUP_DISABLE 0x00004000
387#define MXC_DSM_CTREN_CNT32 0x00000001
388
389/* Magic Fix enable bit */
390#define MXC_DSM_MGPER_EN_MGFX 0x80000000
391#define MXC_DSM_MGPER_PER_MASK 0x000003FF
392#define MXC_DSM_MGPER_PER(n) (MXC_DSM_MGPER_PER_MASK & n)
393
394/* Address offsets of the CLKCTL registers */
395#define MXC_CLKCTL_GP_CTRL (MXC_CLKCTL_BASE + 0x00)
396#define MXC_CLKCTL_GP_SER (MXC_CLKCTL_BASE + 0x04)
397#define MXC_CLKCTL_GP_CER (MXC_CLKCTL_BASE + 0x08)
398
399#endif /* _ARCH_ARM_MACH_MXC91231_CRM_REGS_H_ */
diff --git a/arch/arm/mach-mxc91231/devices.c b/arch/arm/mach-mxc91231/devices.c
new file mode 100644
index 000000000000..353bd977b393
--- /dev/null
+++ b/arch/arm/mach-mxc91231/devices.c
@@ -0,0 +1,251 @@
1/*
2 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#include <linux/module.h>
21#include <linux/platform_device.h>
22#include <linux/serial.h>
23#include <linux/gpio.h>
24#include <mach/hardware.h>
25#include <mach/irqs.h>
26#include <mach/imx-uart.h>
27
28static struct resource uart0[] = {
29 {
30 .start = MXC91231_UART1_BASE_ADDR,
31 .end = MXC91231_UART1_BASE_ADDR + 0x0B5,
32 .flags = IORESOURCE_MEM,
33 }, {
34 .start = MXC91231_INT_UART1_RX,
35 .end = MXC91231_INT_UART1_RX,
36 .flags = IORESOURCE_IRQ,
37 }, {
38 .start = MXC91231_INT_UART1_TX,
39 .end = MXC91231_INT_UART1_TX,
40 .flags = IORESOURCE_IRQ,
41 }, {
42 .start = MXC91231_INT_UART1_MINT,
43 .end = MXC91231_INT_UART1_MINT,
44 .flags = IORESOURCE_IRQ,
45 },
46};
47
48struct platform_device mxc_uart_device0 = {
49 .name = "imx-uart",
50 .id = 0,
51 .resource = uart0,
52 .num_resources = ARRAY_SIZE(uart0),
53};
54
55static struct resource uart1[] = {
56 {
57 .start = MXC91231_UART2_BASE_ADDR,
58 .end = MXC91231_UART2_BASE_ADDR + 0x0B5,
59 .flags = IORESOURCE_MEM,
60 }, {
61 .start = MXC91231_INT_UART2_RX,
62 .end = MXC91231_INT_UART2_RX,
63 .flags = IORESOURCE_IRQ,
64 }, {
65 .start = MXC91231_INT_UART2_TX,
66 .end = MXC91231_INT_UART2_TX,
67 .flags = IORESOURCE_IRQ,
68 }, {
69 .start = MXC91231_INT_UART2_MINT,
70 .end = MXC91231_INT_UART2_MINT,
71 .flags = IORESOURCE_IRQ,
72 },
73};
74
75struct platform_device mxc_uart_device1 = {
76 .name = "imx-uart",
77 .id = 1,
78 .resource = uart1,
79 .num_resources = ARRAY_SIZE(uart1),
80};
81
82static struct resource uart2[] = {
83 {
84 .start = MXC91231_UART3_BASE_ADDR,
85 .end = MXC91231_UART3_BASE_ADDR + 0x0B5,
86 .flags = IORESOURCE_MEM,
87 }, {
88 .start = MXC91231_INT_UART3_RX,
89 .end = MXC91231_INT_UART3_RX,
90 .flags = IORESOURCE_IRQ,
91 }, {
92 .start = MXC91231_INT_UART3_TX,
93 .end = MXC91231_INT_UART3_TX,
94 .flags = IORESOURCE_IRQ,
95 }, {
96 .start = MXC91231_INT_UART3_MINT,
97 .end = MXC91231_INT_UART3_MINT,
98 .flags = IORESOURCE_IRQ,
99
100 },
101};
102
103struct platform_device mxc_uart_device2 = {
104 .name = "imx-uart",
105 .id = 2,
106 .resource = uart2,
107 .num_resources = ARRAY_SIZE(uart2),
108};
109
110/* GPIO port description */
111static struct mxc_gpio_port mxc_gpio_ports[] = {
112 [0] = {
113 .chip.label = "gpio-0",
114 .base = MXC91231_IO_ADDRESS(MXC91231_GPIO1_AP_BASE_ADDR),
115 .irq = MXC91231_INT_GPIO1,
116 .virtual_irq_start = MXC_GPIO_IRQ_START,
117 },
118 [1] = {
119 .chip.label = "gpio-1",
120 .base = MXC91231_IO_ADDRESS(MXC91231_GPIO2_AP_BASE_ADDR),
121 .irq = MXC91231_INT_GPIO2,
122 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
123 },
124 [2] = {
125 .chip.label = "gpio-2",
126 .base = MXC91231_IO_ADDRESS(MXC91231_GPIO3_AP_BASE_ADDR),
127 .irq = MXC91231_INT_GPIO3,
128 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
129 },
130 [3] = {
131 .chip.label = "gpio-3",
132 .base = MXC91231_IO_ADDRESS(MXC91231_GPIO4_SH_BASE_ADDR),
133 .irq = MXC91231_INT_GPIO4,
134 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
135 },
136};
137
138int __init mxc_register_gpios(void)
139{
140 return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports));
141}
142
143static struct resource mxc_nand_resources[] = {
144 {
145 .start = MXC91231_NFC_BASE_ADDR,
146 .end = MXC91231_NFC_BASE_ADDR + 0xfff,
147 .flags = IORESOURCE_MEM
148 }, {
149 .start = MXC91231_INT_NANDFC,
150 .end = MXC91231_INT_NANDFC,
151 .flags = IORESOURCE_IRQ
152 },
153};
154
155struct platform_device mxc_nand_device = {
156 .name = "mxc_nand",
157 .id = 0,
158 .num_resources = ARRAY_SIZE(mxc_nand_resources),
159 .resource = mxc_nand_resources,
160};
161
162static struct resource mxc_sdhc0_resources[] = {
163 {
164 .start = MXC91231_MMC_SDHC1_BASE_ADDR,
165 .end = MXC91231_MMC_SDHC1_BASE_ADDR + SZ_16K - 1,
166 .flags = IORESOURCE_MEM,
167 }, {
168 .start = MXC91231_INT_MMC_SDHC1,
169 .end = MXC91231_INT_MMC_SDHC1,
170 .flags = IORESOURCE_IRQ,
171 },
172};
173
174static struct resource mxc_sdhc1_resources[] = {
175 {
176 .start = MXC91231_MMC_SDHC2_BASE_ADDR,
177 .end = MXC91231_MMC_SDHC2_BASE_ADDR + SZ_16K - 1,
178 .flags = IORESOURCE_MEM,
179 }, {
180 .start = MXC91231_INT_MMC_SDHC2,
181 .end = MXC91231_INT_MMC_SDHC2,
182 .flags = IORESOURCE_IRQ,
183 },
184};
185
186struct platform_device mxc_sdhc_device0 = {
187 .name = "mxc-mmc",
188 .id = 0,
189 .num_resources = ARRAY_SIZE(mxc_sdhc0_resources),
190 .resource = mxc_sdhc0_resources,
191};
192
193struct platform_device mxc_sdhc_device1 = {
194 .name = "mxc-mmc",
195 .id = 1,
196 .num_resources = ARRAY_SIZE(mxc_sdhc1_resources),
197 .resource = mxc_sdhc1_resources,
198};
199
200static struct resource mxc_cspi0_resources[] = {
201 {
202 .start = MXC91231_CSPI1_BASE_ADDR,
203 .end = MXC91231_CSPI1_BASE_ADDR + 0x20,
204 .flags = IORESOURCE_MEM,
205 }, {
206 .start = MXC91231_INT_CSPI1,
207 .end = MXC91231_INT_CSPI1,
208 .flags = IORESOURCE_IRQ,
209 },
210};
211
212struct platform_device mxc_cspi_device0 = {
213 .name = "spi_imx",
214 .id = 0,
215 .num_resources = ARRAY_SIZE(mxc_cspi0_resources),
216 .resource = mxc_cspi0_resources,
217};
218
219static struct resource mxc_cspi1_resources[] = {
220 {
221 .start = MXC91231_CSPI2_BASE_ADDR,
222 .end = MXC91231_CSPI2_BASE_ADDR + 0x20,
223 .flags = IORESOURCE_MEM,
224 }, {
225 .start = MXC91231_INT_CSPI2,
226 .end = MXC91231_INT_CSPI2,
227 .flags = IORESOURCE_IRQ,
228 },
229};
230
231struct platform_device mxc_cspi_device1 = {
232 .name = "spi_imx",
233 .id = 1,
234 .num_resources = ARRAY_SIZE(mxc_cspi1_resources),
235 .resource = mxc_cspi1_resources,
236};
237
238static struct resource mxc_wdog0_resources[] = {
239 {
240 .start = MXC91231_WDOG1_BASE_ADDR,
241 .end = MXC91231_WDOG1_BASE_ADDR + 0x10,
242 .flags = IORESOURCE_MEM,
243 },
244};
245
246struct platform_device mxc_wdog_device0 = {
247 .name = "mxc-wdt",
248 .id = 0,
249 .num_resources = ARRAY_SIZE(mxc_wdog0_resources),
250 .resource = mxc_wdog0_resources,
251};
diff --git a/arch/arm/mach-mxc91231/devices.h b/arch/arm/mach-mxc91231/devices.h
new file mode 100644
index 000000000000..72a2136ce27d
--- /dev/null
+++ b/arch/arm/mach-mxc91231/devices.h
@@ -0,0 +1,13 @@
1extern struct platform_device mxc_uart_device0;
2extern struct platform_device mxc_uart_device1;
3extern struct platform_device mxc_uart_device2;
4
5extern struct platform_device mxc_nand_device;
6
7extern struct platform_device mxc_sdhc_device0;
8extern struct platform_device mxc_sdhc_device1;
9
10extern struct platform_device mxc_cspi_device0;
11extern struct platform_device mxc_cspi_device1;
12
13extern struct platform_device mxc_wdog_device0;
diff --git a/arch/arm/mach-mxc91231/iomux.c b/arch/arm/mach-mxc91231/iomux.c
new file mode 100644
index 000000000000..405d9b19d891
--- /dev/null
+++ b/arch/arm/mach-mxc91231/iomux.c
@@ -0,0 +1,177 @@
1/*
2 * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
4 * Copyright (C) 2009 by Valentin Longchamp <valentin.longchamp@epfl.ch>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#include <linux/module.h>
22#include <linux/spinlock.h>
23#include <linux/io.h>
24#include <linux/kernel.h>
25#include <mach/hardware.h>
26#include <mach/gpio.h>
27#include <mach/iomux-mxc91231.h>
28
29/*
30 * IOMUX register (base) addresses
31 */
32#define IOMUX_AP_BASE MXC91231_IO_ADDRESS(MXC91231_IOMUX_AP_BASE_ADDR)
33#define IOMUX_COM_BASE MXC91231_IO_ADDRESS(MXC91231_IOMUX_COM_BASE_ADDR)
34#define IOMUXSW_AP_MUX_CTL (IOMUX_AP_BASE + 0x000)
35#define IOMUXSW_SP_MUX_CTL (IOMUX_COM_BASE + 0x000)
36#define IOMUXSW_PAD_CTL (IOMUX_COM_BASE + 0x200)
37
38#define IOMUXINT_OBS1 (IOMUX_AP_BASE + 0x600)
39#define IOMUXINT_OBS2 (IOMUX_AP_BASE + 0x004)
40
41static DEFINE_SPINLOCK(gpio_mux_lock);
42
43#define NB_PORTS ((PIN_MAX + 32) / 32)
44#define PIN_GLOBAL_NUM(pin) \
45 (((pin & MUX_SIDE_MASK) >> MUX_SIDE_SHIFT)*PIN_AP_MAX + \
46 ((pin & MUX_REG_MASK) >> MUX_REG_SHIFT)*4 + \
47 ((pin & MUX_FIELD_MASK) >> MUX_FIELD_SHIFT))
48
49unsigned long mxc_pin_alloc_map[NB_PORTS * 32 / BITS_PER_LONG];
50/*
51 * set the mode for a IOMUX pin.
52 */
53int mxc_iomux_mode(const unsigned int pin_mode)
54{
55 u32 side, field, l, mode, ret = 0;
56 void __iomem *reg;
57
58 side = (pin_mode & MUX_SIDE_MASK) >> MUX_SIDE_SHIFT;
59 switch (side) {
60 case MUX_SIDE_AP:
61 reg = IOMUXSW_AP_MUX_CTL;
62 break;
63 case MUX_SIDE_SP:
64 reg = IOMUXSW_SP_MUX_CTL;
65 break;
66 default:
67 return -EINVAL;
68 }
69 reg += ((pin_mode & MUX_REG_MASK) >> MUX_REG_SHIFT) * 4;
70 field = (pin_mode & MUX_FIELD_MASK) >> MUX_FIELD_SHIFT;
71 mode = (pin_mode & MUX_MODE_MASK) >> MUX_MODE_SHIFT;
72
73 spin_lock(&gpio_mux_lock);
74
75 l = __raw_readl(reg);
76 l &= ~(0xff << (field * 8));
77 l |= mode << (field * 8);
78 __raw_writel(l, reg);
79
80 spin_unlock(&gpio_mux_lock);
81
82 return ret;
83}
84EXPORT_SYMBOL(mxc_iomux_mode);
85
86/*
87 * This function configures the pad value for a IOMUX pin.
88 */
89void mxc_iomux_set_pad(enum iomux_pins pin, u32 config)
90{
91 u32 padgrp, field, l;
92 void __iomem *reg;
93
94 padgrp = (pin & MUX_PADGRP_MASK) >> MUX_PADGRP_SHIFT;
95 reg = IOMUXSW_PAD_CTL + (pin + 2) / 3 * 4;
96 field = (pin + 2) % 3;
97
98 pr_debug("%s: reg offset = 0x%x, field = %d\n",
99 __func__, (pin + 2) / 3, field);
100
101 spin_lock(&gpio_mux_lock);
102
103 l = __raw_readl(reg);
104 l &= ~(0x1ff << (field * 10));
105 l |= config << (field * 10);
106 __raw_writel(l, reg);
107
108 spin_unlock(&gpio_mux_lock);
109}
110EXPORT_SYMBOL(mxc_iomux_set_pad);
111
112/*
113 * allocs a single pin:
114 * - reserves the pin so that it is not claimed by another driver
115 * - setups the iomux according to the configuration
116 */
117int mxc_iomux_alloc_pin(const unsigned int pin_mode, const char *label)
118{
119 unsigned pad = PIN_GLOBAL_NUM(pin_mode);
120 if (pad >= (PIN_MAX + 1)) {
121 printk(KERN_ERR "mxc_iomux: Attempt to request nonexistant pin %u for \"%s\"\n",
122 pad, label ? label : "?");
123 return -EINVAL;
124 }
125
126 if (test_and_set_bit(pad, mxc_pin_alloc_map)) {
127 printk(KERN_ERR "mxc_iomux: pin %u already used. Allocation for \"%s\" failed\n",
128 pad, label ? label : "?");
129 return -EBUSY;
130 }
131 mxc_iomux_mode(pin_mode);
132
133 return 0;
134}
135EXPORT_SYMBOL(mxc_iomux_alloc_pin);
136
137int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
138 const char *label)
139{
140 unsigned int *p = pin_list;
141 int i;
142 int ret = -EINVAL;
143
144 for (i = 0; i < count; i++) {
145 ret = mxc_iomux_alloc_pin(*p, label);
146 if (ret)
147 goto setup_error;
148 p++;
149 }
150 return 0;
151
152setup_error:
153 mxc_iomux_release_multiple_pins(pin_list, i);
154 return ret;
155}
156EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins);
157
158void mxc_iomux_release_pin(const unsigned int pin_mode)
159{
160 unsigned pad = PIN_GLOBAL_NUM(pin_mode);
161
162 if (pad < (PIN_MAX + 1))
163 clear_bit(pad, mxc_pin_alloc_map);
164}
165EXPORT_SYMBOL(mxc_iomux_release_pin);
166
167void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count)
168{
169 unsigned int *p = pin_list;
170 int i;
171
172 for (i = 0; i < count; i++) {
173 mxc_iomux_release_pin(*p);
174 p++;
175 }
176}
177EXPORT_SYMBOL(mxc_iomux_release_multiple_pins);
diff --git a/arch/arm/mach-mxc91231/magx-zn5.c b/arch/arm/mach-mxc91231/magx-zn5.c
new file mode 100644
index 000000000000..7dbe4ca12efd
--- /dev/null
+++ b/arch/arm/mach-mxc91231/magx-zn5.c
@@ -0,0 +1,63 @@
1/*
2 * Copyright 2009 Dmitriy Taychenachev <dimichxp@gmail.com>
3 *
4 * This file is released under the GPLv2 or later.
5 */
6
7#include <linux/irq.h>
8#include <linux/init.h>
9#include <linux/device.h>
10
11#include <asm/mach-types.h>
12#include <asm/mach/time.h>
13#include <asm/mach/arch.h>
14
15#include <mach/common.h>
16#include <mach/hardware.h>
17#include <mach/iomux-mxc91231.h>
18#include <mach/mmc.h>
19#include <mach/imx-uart.h>
20
21#include "devices.h"
22
23static struct imxuart_platform_data uart_pdata = {
24};
25
26static struct imxmmc_platform_data sdhc_pdata = {
27};
28
29static void __init zn5_init(void)
30{
31 pm_power_off = mxc91231_power_off;
32
33 mxc_iomux_alloc_pin(MXC91231_PIN_SP_USB_DAT_VP__RXD2, "uart2-rx");
34 mxc_iomux_alloc_pin(MXC91231_PIN_SP_USB_SE0_VM__TXD2, "uart2-tx");
35
36 mxc_register_device(&mxc_uart_device1, &uart_pdata);
37 mxc_register_device(&mxc_uart_device0, &uart_pdata);
38
39 mxc_register_device(&mxc_sdhc_device0, &sdhc_pdata);
40
41 mxc_register_device(&mxc_wdog_device0, NULL);
42
43 return;
44}
45
46static void __init zn5_timer_init(void)
47{
48 mxc91231_clocks_init(26000000); /* 26mhz ckih */
49}
50
51struct sys_timer zn5_timer = {
52 .init = zn5_timer_init,
53};
54
55MACHINE_START(MAGX_ZN5, "Motorola Zn5")
56 .phys_io = MXC91231_AIPS1_BASE_ADDR,
57 .io_pg_offst = ((MXC91231_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
58 .boot_params = PHYS_OFFSET + 0x100,
59 .map_io = mxc91231_map_io,
60 .init_irq = mxc91231_init_irq,
61 .timer = &zn5_timer,
62 .init_machine = zn5_init,
63MACHINE_END
diff --git a/arch/arm/mach-mxc91231/mm.c b/arch/arm/mach-mxc91231/mm.c
new file mode 100644
index 000000000000..6becda3ff331
--- /dev/null
+++ b/arch/arm/mach-mxc91231/mm.c
@@ -0,0 +1,94 @@
1/*
2 * Copyright (C) 1999,2000 Arm Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
5 * Copyright 2004-2005 Freescale Semiconductor, Inc. All Rights Reserved.
6 * - add MXC specific definitions
7 * Copyright 2006 Motorola, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#include <linux/mm.h>
26#include <linux/init.h>
27#include <mach/hardware.h>
28#include <mach/common.h>
29#include <asm/pgtable.h>
30#include <asm/mach/map.h>
31
32/*
33 * This structure defines the MXC memory map.
34 */
35static struct map_desc mxc_io_desc[] __initdata = {
36 {
37 .virtual = MXC91231_L2CC_BASE_ADDR_VIRT,
38 .pfn = __phys_to_pfn(MXC91231_L2CC_BASE_ADDR),
39 .length = MXC91231_L2CC_SIZE,
40 .type = MT_DEVICE,
41 }, {
42 .virtual = MXC91231_X_MEMC_BASE_ADDR_VIRT,
43 .pfn = __phys_to_pfn(MXC91231_X_MEMC_BASE_ADDR),
44 .length = MXC91231_X_MEMC_SIZE,
45 .type = MT_DEVICE,
46 }, {
47 .virtual = MXC91231_ROMP_BASE_ADDR_VIRT,
48 .pfn = __phys_to_pfn(MXC91231_ROMP_BASE_ADDR),
49 .length = MXC91231_ROMP_SIZE,
50 .type = MT_DEVICE,
51 }, {
52 .virtual = MXC91231_AVIC_BASE_ADDR_VIRT,
53 .pfn = __phys_to_pfn(MXC91231_AVIC_BASE_ADDR),
54 .length = MXC91231_AVIC_SIZE,
55 .type = MT_DEVICE,
56 }, {
57 .virtual = MXC91231_AIPS1_BASE_ADDR_VIRT,
58 .pfn = __phys_to_pfn(MXC91231_AIPS1_BASE_ADDR),
59 .length = MXC91231_AIPS1_SIZE,
60 .type = MT_DEVICE,
61 }, {
62 .virtual = MXC91231_SPBA0_BASE_ADDR_VIRT,
63 .pfn = __phys_to_pfn(MXC91231_SPBA0_BASE_ADDR),
64 .length = MXC91231_SPBA0_SIZE,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = MXC91231_SPBA1_BASE_ADDR_VIRT,
68 .pfn = __phys_to_pfn(MXC91231_SPBA1_BASE_ADDR),
69 .length = MXC91231_SPBA1_SIZE,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = MXC91231_AIPS2_BASE_ADDR_VIRT,
73 .pfn = __phys_to_pfn(MXC91231_AIPS2_BASE_ADDR),
74 .length = MXC91231_AIPS2_SIZE,
75 .type = MT_DEVICE,
76 },
77};
78
79/*
80 * This function initializes the memory map. It is called during the
81 * system startup to create static physical to virtual memory map for
82 * the IO modules.
83 */
84void __init mxc91231_map_io(void)
85{
86 mxc_set_cpu_type(MXC_CPU_MXC91231);
87
88 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
89}
90
91void __init mxc91231_init_irq(void)
92{
93 mxc_init_irq(MXC91231_IO_ADDRESS(MXC91231_AVIC_BASE_ADDR));
94}
diff --git a/arch/arm/mach-mxc91231/system.c b/arch/arm/mach-mxc91231/system.c
new file mode 100644
index 000000000000..736f7efd874a
--- /dev/null
+++ b/arch/arm/mach-mxc91231/system.c
@@ -0,0 +1,51 @@
1/*
2 * Copyright 2009 Dmitriy Taychenachev <dimichxp@gmail.com>
3 *
4 * This file is released under the GPLv2 or later.
5 */
6
7#include <linux/delay.h>
8#include <linux/io.h>
9
10#include <asm/proc-fns.h>
11#include <mach/hardware.h>
12
13#include "crm_regs.h"
14
15#define WDOG_WCR MXC91231_IO_ADDRESS(MXC91231_WDOG1_BASE_ADDR)
16#define WDOG_WCR_OUT_ENABLE (1 << 6)
17#define WDOG_WCR_ASSERT (1 << 5)
18
19void mxc91231_power_off(void)
20{
21 u16 wcr;
22
23 wcr = __raw_readw(WDOG_WCR);
24 wcr |= WDOG_WCR_OUT_ENABLE;
25 wcr &= ~WDOG_WCR_ASSERT;
26 __raw_writew(wcr, WDOG_WCR);
27}
28
29void mxc91231_arch_reset(char mode, const char *cmd)
30{
31 u32 amcr;
32
33 /* Reset the AP using CRM */
34 amcr = __raw_readl(MXC_CRMAP_AMCR);
35 amcr &= ~MXC_CRMAP_AMCR_SW_AP;
36 __raw_writel(amcr, MXC_CRMAP_AMCR);
37
38 mdelay(10);
39 cpu_reset(0);
40}
41
42void mxc91231_prepare_idle(void)
43{
44 u32 crm_ctl;
45
46 /* Go to WAIT mode after WFI */
47 crm_ctl = __raw_readl(MXC_DSM_CRM_CONTROL);
48 crm_ctl &= ~(MXC_DSM_CRM_CTRL_LPMD0 | MXC_DSM_CRM_CTRL_LPMD1);
49 crm_ctl |= MXC_DSM_CRM_CTRL_LPMD_WAIT_MODE;
50 __raw_writel(crm_ctl, MXC_DSM_CRM_CONTROL);
51}
diff --git a/arch/arm/mach-netx/include/mach/entry-macro.S b/arch/arm/mach-netx/include/mach/entry-macro.S
index a1952a0feda6..844f1f9acbdf 100644
--- a/arch/arm/mach-netx/include/mach/entry-macro.S
+++ b/arch/arm/mach-netx/include/mach/entry-macro.S
@@ -24,15 +24,13 @@
24 .endm 24 .endm
25 25
26 .macro get_irqnr_preamble, base, tmp 26 .macro get_irqnr_preamble, base, tmp
27 ldr \base, =io_p2v(0x001ff000)
27 .endm 28 .endm
28 29
29 .macro arch_ret_to_user, tmp1, tmp2 30 .macro arch_ret_to_user, tmp1, tmp2
30 .endm 31 .endm
31 32
32 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 33 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
33 mov \base, #io_p2v(0x00100000)
34 add \base, \base, #0x000ff000
35
36 ldr \irqstat, [\base, #0] 34 ldr \irqstat, [\base, #0]
37 clz \irqnr, \irqstat 35 clz \irqnr, \irqstat
38 rsb \irqnr, \irqnr, #31 36 rsb \irqnr, \irqnr, #31
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
new file mode 100644
index 000000000000..2a02b49c40f0
--- /dev/null
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -0,0 +1,21 @@
1if ARCH_NOMADIK
2
3menu "Nomadik boards"
4
5config MACH_NOMADIK_8815NHK
6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
7 select NOMADIK_8815
8
9endmenu
10
11config NOMADIK_8815
12 bool
13
14
15config I2C_BITBANG_8815NHK
16 tristate "Driver for bit-bang busses found on the 8815 NHK"
17 depends on I2C && MACH_NOMADIK_8815NHK
18 select I2C_ALGOBIT
19 default y
20
21endif
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile
new file mode 100644
index 000000000000..412040982a40
--- /dev/null
+++ b/arch/arm/mach-nomadik/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile for the linux kernel.
3#
4# Note! Dependencies are done automagically by 'make dep', which also
5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file).
7
8# Object file lists.
9
10obj-y += clock.o timer.o gpio.o
11
12# Cpu revision
13obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
14
15# Specific board support
16obj-$(CONFIG_MACH_NOMADIK_8815NHK) += board-nhk8815.o
17
18# Nomadik extra devices
19obj-$(CONFIG_I2C_BITBANG_8815NHK) += i2c-8815nhk.o
diff --git a/arch/arm/mach-nomadik/Makefile.boot b/arch/arm/mach-nomadik/Makefile.boot
new file mode 100644
index 000000000000..c7e75acfe6c9
--- /dev/null
+++ b/arch/arm/mach-nomadik/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
4
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
new file mode 100644
index 000000000000..79bdea943eb4
--- /dev/null
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -0,0 +1,111 @@
1/*
2 * linux/arch/arm/mach-nomadik/board-8815nhk.c
3 *
4 * Copyright (C) STMicroelectronics
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 * NHK15 board specifc driver definition
11 */
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/amba/bus.h>
17#include <linux/interrupt.h>
18#include <linux/gpio.h>
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <asm/mach/irq.h>
22#include <mach/setup.h>
23#include "clock.h"
24
25#define __MEM_4K_RESOURCE(x) \
26 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
27
28static struct amba_device uart0_device = {
29 .dev = { .init_name = "uart0" },
30 __MEM_4K_RESOURCE(NOMADIK_UART0_BASE),
31 .irq = {IRQ_UART0, NO_IRQ},
32};
33
34static struct amba_device uart1_device = {
35 .dev = { .init_name = "uart1" },
36 __MEM_4K_RESOURCE(NOMADIK_UART1_BASE),
37 .irq = {IRQ_UART1, NO_IRQ},
38};
39
40static struct amba_device *amba_devs[] __initdata = {
41 &uart0_device,
42 &uart1_device,
43};
44
45/* We have a fixed clock alone, by now */
46static struct clk nhk8815_clk_48 = {
47 .rate = 48*1000*1000,
48};
49
50static struct resource nhk8815_eth_resources[] = {
51 {
52 .name = "smc91x-regs",
53 .start = 0x34000000 + 0x300,
54 .end = 0x34000000 + SZ_64K - 1,
55 .flags = IORESOURCE_MEM,
56 }, {
57 .start = NOMADIK_GPIO_TO_IRQ(115),
58 .end = NOMADIK_GPIO_TO_IRQ(115),
59 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
60 }
61};
62
63static struct platform_device nhk8815_eth_device = {
64 .name = "smc91x",
65 .resource = nhk8815_eth_resources,
66 .num_resources = ARRAY_SIZE(nhk8815_eth_resources),
67};
68
69static int __init nhk8815_eth_init(void)
70{
71 int gpio_nr = 115; /* hardwired in the board */
72 int err;
73
74 err = gpio_request(gpio_nr, "eth_irq");
75 if (!err) err = nmk_gpio_set_mode(gpio_nr, NMK_GPIO_ALT_GPIO);
76 if (!err) err = gpio_direction_input(gpio_nr);
77 if (err)
78 pr_err("Error %i in %s\n", err, __func__);
79 return err;
80}
81device_initcall(nhk8815_eth_init);
82
83static struct platform_device *nhk8815_platform_devices[] __initdata = {
84 &nhk8815_eth_device,
85 /* will add more devices */
86};
87
88static void __init nhk8815_platform_init(void)
89{
90 int i;
91
92 cpu8815_platform_init();
93 platform_add_devices(nhk8815_platform_devices,
94 ARRAY_SIZE(nhk8815_platform_devices));
95
96 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
97 nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name);
98 amba_device_register(amba_devs[i], &iomem_resource);
99 }
100}
101
102MACHINE_START(NOMADIK, "NHK8815")
103 /* Maintainer: ST MicroElectronics */
104 .phys_io = NOMADIK_UART0_BASE,
105 .io_pg_offst = (IO_ADDRESS(NOMADIK_UART0_BASE) >> 18) & 0xfffc,
106 .boot_params = 0x100,
107 .map_io = cpu8815_map_io,
108 .init_irq = cpu8815_init_irq,
109 .timer = &nomadik_timer,
110 .init_machine = nhk8815_platform_init,
111MACHINE_END
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c
new file mode 100644
index 000000000000..9f92502a0083
--- /dev/null
+++ b/arch/arm/mach-nomadik/clock.c
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/arm/mach-nomadik/clock.c
3 *
4 * Copyright (C) 2009 Alessandro Rubini
5 */
6#include <linux/kernel.h>
7#include <linux/module.h>
8#include <linux/errno.h>
9#include <linux/clk.h>
10#include <asm/clkdev.h>
11#include "clock.h"
12
13/*
14 * The nomadik board uses generic clocks, but the serial pl011 file
15 * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them
16 */
17unsigned long clk_get_rate(struct clk *clk)
18{
19 return clk->rate;
20}
21EXPORT_SYMBOL(clk_get_rate);
22
23/* enable and disable do nothing */
24int clk_enable(struct clk *clk)
25{
26 return 0;
27}
28EXPORT_SYMBOL(clk_enable);
29
30void clk_disable(struct clk *clk)
31{
32}
33EXPORT_SYMBOL(clk_disable);
34
35/* Create a clock structure with the given name */
36int nmdk_clk_create(struct clk *clk, const char *dev_id)
37{
38 struct clk_lookup *clkdev;
39
40 clkdev = clkdev_alloc(clk, NULL, dev_id);
41 if (!clkdev)
42 return -ENOMEM;
43 clkdev_add(clkdev);
44 return 0;
45}
diff --git a/arch/arm/mach-nomadik/clock.h b/arch/arm/mach-nomadik/clock.h
new file mode 100644
index 000000000000..235faec7f627
--- /dev/null
+++ b/arch/arm/mach-nomadik/clock.h
@@ -0,0 +1,14 @@
1
2/*
3 * linux/arch/arm/mach-nomadik/clock.h
4 *
5 * Copyright (C) 2009 Alessandro Rubini
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11struct clk {
12 unsigned long rate;
13};
14extern int nmdk_clk_create(struct clk *clk, const char *dev_id);
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
new file mode 100644
index 000000000000..f93c59634191
--- /dev/null
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -0,0 +1,139 @@
1/*
2 * Copyright STMicroelectronics, 2007.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/types.h>
20#include <linux/init.h>
21#include <linux/device.h>
22#include <linux/amba/bus.h>
23#include <linux/gpio.h>
24
25#include <mach/hardware.h>
26#include <mach/irqs.h>
27#include <asm/mach/map.h>
28#include <asm/hardware/vic.h>
29
30#include <asm/cacheflush.h>
31#include <asm/hardware/cache-l2x0.h>
32
33/* The 8815 has 4 GPIO blocks, let's register them immediately */
34static struct nmk_gpio_platform_data cpu8815_gpio[] = {
35 {
36 .name = "GPIO-0-31",
37 .first_gpio = 0,
38 .first_irq = NOMADIK_GPIO_TO_IRQ(0),
39 .parent_irq = IRQ_GPIO0,
40 }, {
41 .name = "GPIO-32-63",
42 .first_gpio = 32,
43 .first_irq = NOMADIK_GPIO_TO_IRQ(32),
44 .parent_irq = IRQ_GPIO1,
45 }, {
46 .name = "GPIO-64-95",
47 .first_gpio = 64,
48 .first_irq = NOMADIK_GPIO_TO_IRQ(64),
49 .parent_irq = IRQ_GPIO2,
50 }, {
51 .name = "GPIO-96-127", /* 124..127 not routed to pin */
52 .first_gpio = 96,
53 .first_irq = NOMADIK_GPIO_TO_IRQ(96),
54 .parent_irq = IRQ_GPIO3,
55 }
56};
57
58#define __MEM_4K_RESOURCE(x) \
59 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
60
61static struct amba_device cpu8815_amba_gpio[] = {
62 {
63 .dev = {
64 .init_name = "gpio0",
65 .platform_data = cpu8815_gpio + 0,
66 },
67 __MEM_4K_RESOURCE(NOMADIK_GPIO0_BASE),
68 }, {
69 .dev = {
70 .init_name = "gpio1",
71 .platform_data = cpu8815_gpio + 1,
72 },
73 __MEM_4K_RESOURCE(NOMADIK_GPIO1_BASE),
74 }, {
75 .dev = {
76 .init_name = "gpio2",
77 .platform_data = cpu8815_gpio + 2,
78 },
79 __MEM_4K_RESOURCE(NOMADIK_GPIO2_BASE),
80 }, {
81 .dev = {
82 .init_name = "gpio3",
83 .platform_data = cpu8815_gpio + 3,
84 },
85 __MEM_4K_RESOURCE(NOMADIK_GPIO3_BASE),
86 },
87};
88
89static struct amba_device *amba_devs[] __initdata = {
90 cpu8815_amba_gpio + 0,
91 cpu8815_amba_gpio + 1,
92 cpu8815_amba_gpio + 2,
93 cpu8815_amba_gpio + 3,
94};
95
96static int __init cpu8815_init(void)
97{
98 int i;
99
100 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
101 amba_device_register(amba_devs[i], &iomem_resource);
102 return 0;
103}
104arch_initcall(cpu8815_init);
105
106/* All SoC devices live in the same area (see hardware.h) */
107static struct map_desc nomadik_io_desc[] __initdata = {
108 {
109 .virtual = NOMADIK_IO_VIRTUAL,
110 .pfn = __phys_to_pfn(NOMADIK_IO_PHYSICAL),
111 .length = NOMADIK_IO_SIZE,
112 .type = MT_DEVICE,
113 }
114 /* static ram and secured ram may be added later */
115};
116
117void __init cpu8815_map_io(void)
118{
119 iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc));
120}
121
122void __init cpu8815_init_irq(void)
123{
124 /* This modified VIC cell has two register blocks, at 0 and 0x20 */
125 vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START + 0, ~0, 0);
126 vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0);
127}
128
129/*
130 * This function is called from the board init ("init_machine").
131 */
132 void __init cpu8815_platform_init(void)
133{
134#ifdef CONFIG_CACHE_L2X0
135 /* At full speed latency must be >=2, so 0x249 in low bits */
136 l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff);
137#endif
138 return;
139}
diff --git a/arch/arm/mach-nomadik/gpio.c b/arch/arm/mach-nomadik/gpio.c
new file mode 100644
index 000000000000..9a09b2791e03
--- /dev/null
+++ b/arch/arm/mach-nomadik/gpio.c
@@ -0,0 +1,396 @@
1/*
2 * Generic GPIO driver for logic cells found in the Nomadik SoC
3 *
4 * Copyright (C) 2008,2009 STMicroelectronics
5 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
6 * Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/amba/bus.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
19#include <linux/spinlock.h>
20#include <linux/interrupt.h>
21#include <linux/irq.h>
22
23#include <mach/hardware.h>
24#include <mach/gpio.h>
25
26/*
27 * The GPIO module in the Nomadik family of Systems-on-Chip is an
28 * AMBA device, managing 32 pins and alternate functions. The logic block
29 * is currently only used in the Nomadik.
30 *
31 * Symbols in this file are called "nmk_gpio" for "nomadik gpio"
32 */
33
34#define NMK_GPIO_PER_CHIP 32
35struct nmk_gpio_chip {
36 struct gpio_chip chip;
37 void __iomem *addr;
38 unsigned int parent_irq;
39 spinlock_t *lock;
40 /* Keep track of configured edges */
41 u32 edge_rising;
42 u32 edge_falling;
43};
44
45/* Mode functions */
46int nmk_gpio_set_mode(int gpio, int gpio_mode)
47{
48 struct nmk_gpio_chip *nmk_chip;
49 unsigned long flags;
50 u32 afunc, bfunc, bit;
51
52 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
53 if (!nmk_chip)
54 return -EINVAL;
55
56 bit = 1 << (gpio - nmk_chip->chip.base);
57
58 spin_lock_irqsave(&nmk_chip->lock, flags);
59 afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & ~bit;
60 bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & ~bit;
61 if (gpio_mode & NMK_GPIO_ALT_A)
62 afunc |= bit;
63 if (gpio_mode & NMK_GPIO_ALT_B)
64 bfunc |= bit;
65 writel(afunc, nmk_chip->addr + NMK_GPIO_AFSLA);
66 writel(bfunc, nmk_chip->addr + NMK_GPIO_AFSLB);
67 spin_unlock_irqrestore(&nmk_chip->lock, flags);
68
69 return 0;
70}
71EXPORT_SYMBOL(nmk_gpio_set_mode);
72
73int nmk_gpio_get_mode(int gpio)
74{
75 struct nmk_gpio_chip *nmk_chip;
76 u32 afunc, bfunc, bit;
77
78 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
79 if (!nmk_chip)
80 return -EINVAL;
81
82 bit = 1 << (gpio - nmk_chip->chip.base);
83
84 afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & bit;
85 bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & bit;
86
87 return (afunc ? NMK_GPIO_ALT_A : 0) | (bfunc ? NMK_GPIO_ALT_B : 0);
88}
89EXPORT_SYMBOL(nmk_gpio_get_mode);
90
91
92/* IRQ functions */
93static inline int nmk_gpio_get_bitmask(int gpio)
94{
95 return 1 << (gpio % 32);
96}
97
98static void nmk_gpio_irq_ack(unsigned int irq)
99{
100 int gpio;
101 struct nmk_gpio_chip *nmk_chip;
102
103 gpio = NOMADIK_IRQ_TO_GPIO(irq);
104 nmk_chip = get_irq_chip_data(irq);
105 if (!nmk_chip)
106 return;
107 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC);
108}
109
110static void nmk_gpio_irq_mask(unsigned int irq)
111{
112 int gpio;
113 struct nmk_gpio_chip *nmk_chip;
114 unsigned long flags;
115 u32 bitmask, reg;
116
117 gpio = NOMADIK_IRQ_TO_GPIO(irq);
118 nmk_chip = get_irq_chip_data(irq);
119 bitmask = nmk_gpio_get_bitmask(gpio);
120 if (!nmk_chip)
121 return;
122
123 /* we must individually clear the two edges */
124 spin_lock_irqsave(&nmk_chip->lock, flags);
125 if (nmk_chip->edge_rising & bitmask) {
126 reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC);
127 reg &= ~bitmask;
128 writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC);
129 }
130 if (nmk_chip->edge_falling & bitmask) {
131 reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC);
132 reg &= ~bitmask;
133 writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC);
134 }
135 spin_unlock_irqrestore(&nmk_chip->lock, flags);
136};
137
138static void nmk_gpio_irq_unmask(unsigned int irq)
139{
140 int gpio;
141 struct nmk_gpio_chip *nmk_chip;
142 unsigned long flags;
143 u32 bitmask, reg;
144
145 gpio = NOMADIK_IRQ_TO_GPIO(irq);
146 nmk_chip = get_irq_chip_data(irq);
147 bitmask = nmk_gpio_get_bitmask(gpio);
148 if (!nmk_chip)
149 return;
150
151 /* we must individually set the two edges */
152 spin_lock_irqsave(&nmk_chip->lock, flags);
153 if (nmk_chip->edge_rising & bitmask) {
154 reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC);
155 reg |= bitmask;
156 writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC);
157 }
158 if (nmk_chip->edge_falling & bitmask) {
159 reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC);
160 reg |= bitmask;
161 writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC);
162 }
163 spin_unlock_irqrestore(&nmk_chip->lock, flags);
164}
165
166static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
167{
168 int gpio;
169 struct nmk_gpio_chip *nmk_chip;
170 unsigned long flags;
171 u32 bitmask;
172
173 gpio = NOMADIK_IRQ_TO_GPIO(irq);
174 nmk_chip = get_irq_chip_data(irq);
175 bitmask = nmk_gpio_get_bitmask(gpio);
176 if (!nmk_chip)
177 return -EINVAL;
178
179 if (type & IRQ_TYPE_LEVEL_HIGH)
180 return -EINVAL;
181 if (type & IRQ_TYPE_LEVEL_LOW)
182 return -EINVAL;
183
184 spin_lock_irqsave(&nmk_chip->lock, flags);
185
186 nmk_chip->edge_rising &= ~bitmask;
187 if (type & IRQ_TYPE_EDGE_RISING)
188 nmk_chip->edge_rising |= bitmask;
189 writel(nmk_chip->edge_rising, nmk_chip->addr + NMK_GPIO_RIMSC);
190
191 nmk_chip->edge_falling &= ~bitmask;
192 if (type & IRQ_TYPE_EDGE_FALLING)
193 nmk_chip->edge_falling |= bitmask;
194 writel(nmk_chip->edge_falling, nmk_chip->addr + NMK_GPIO_FIMSC);
195
196 spin_unlock_irqrestore(&nmk_chip->lock, flags);
197
198 nmk_gpio_irq_unmask(irq);
199
200 return 0;
201}
202
203static struct irq_chip nmk_gpio_irq_chip = {
204 .name = "Nomadik-GPIO",
205 .ack = nmk_gpio_irq_ack,
206 .mask = nmk_gpio_irq_mask,
207 .unmask = nmk_gpio_irq_unmask,
208 .set_type = nmk_gpio_irq_set_type,
209};
210
211static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
212{
213 struct nmk_gpio_chip *nmk_chip;
214 struct irq_chip *host_chip;
215 unsigned int gpio_irq;
216 u32 pending;
217 unsigned int first_irq;
218
219 nmk_chip = get_irq_data(irq);
220 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base);
221 while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) {
222 gpio_irq = first_irq + __ffs(pending);
223 generic_handle_irq(gpio_irq);
224 }
225 if (0) {/* don't ack parent irq, as ack == disable */
226 host_chip = get_irq_chip(irq);
227 host_chip->ack(irq);
228 }
229}
230
231static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
232{
233 unsigned int first_irq;
234 int i;
235
236 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base);
237 for (i = first_irq; i < first_irq + NMK_GPIO_PER_CHIP; i++) {
238 set_irq_chip(i, &nmk_gpio_irq_chip);
239 set_irq_handler(i, handle_edge_irq);
240 set_irq_flags(i, IRQF_VALID);
241 set_irq_chip_data(i, nmk_chip);
242 }
243 set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler);
244 set_irq_data(nmk_chip->parent_irq, nmk_chip);
245 return 0;
246}
247
248/* I/O Functions */
249static int nmk_gpio_make_input(struct gpio_chip *chip, unsigned offset)
250{
251 struct nmk_gpio_chip *nmk_chip =
252 container_of(chip, struct nmk_gpio_chip, chip);
253
254 writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRC);
255 return 0;
256}
257
258static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
259 int val)
260{
261 struct nmk_gpio_chip *nmk_chip =
262 container_of(chip, struct nmk_gpio_chip, chip);
263
264 writel(1 << offset, nmk_chip->addr + NMK_GPIO_DIRS);
265 return 0;
266}
267
268static int nmk_gpio_get_input(struct gpio_chip *chip, unsigned offset)
269{
270 struct nmk_gpio_chip *nmk_chip =
271 container_of(chip, struct nmk_gpio_chip, chip);
272 u32 bit = 1 << offset;
273
274 return (readl(nmk_chip->addr + NMK_GPIO_DAT) & bit) != 0;
275}
276
277static void nmk_gpio_set_output(struct gpio_chip *chip, unsigned offset,
278 int val)
279{
280 struct nmk_gpio_chip *nmk_chip =
281 container_of(chip, struct nmk_gpio_chip, chip);
282 u32 bit = 1 << offset;
283
284 if (val)
285 writel(bit, nmk_chip->addr + NMK_GPIO_DATS);
286 else
287 writel(bit, nmk_chip->addr + NMK_GPIO_DATC);
288}
289
290/* This structure is replicated for each GPIO block allocated at probe time */
291static struct gpio_chip nmk_gpio_template = {
292 .direction_input = nmk_gpio_make_input,
293 .get = nmk_gpio_get_input,
294 .direction_output = nmk_gpio_make_output,
295 .set = nmk_gpio_set_output,
296 .ngpio = NMK_GPIO_PER_CHIP,
297 .can_sleep = 0,
298};
299
300static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id)
301{
302 struct nmk_gpio_platform_data *pdata;
303 struct nmk_gpio_chip *nmk_chip;
304 struct gpio_chip *chip;
305 int ret;
306
307 pdata = dev->dev.platform_data;
308 ret = amba_request_regions(dev, pdata->name);
309 if (ret)
310 return ret;
311
312 nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL);
313 if (!nmk_chip) {
314 ret = -ENOMEM;
315 goto out_amba;
316 }
317 /*
318 * The virt address in nmk_chip->addr is in the nomadik register space,
319 * so we can simply convert the resource address, without remapping
320 */
321 nmk_chip->addr = io_p2v(dev->res.start);
322 nmk_chip->chip = nmk_gpio_template;
323 nmk_chip->parent_irq = pdata->parent_irq;
324
325 chip = &nmk_chip->chip;
326 chip->base = pdata->first_gpio;
327 chip->label = pdata->name;
328 chip->dev = &dev->dev;
329 chip->owner = THIS_MODULE;
330
331 ret = gpiochip_add(&nmk_chip->chip);
332 if (ret)
333 goto out_free;
334
335 amba_set_drvdata(dev, nmk_chip);
336
337 nmk_gpio_init_irq(nmk_chip);
338
339 dev_info(&dev->dev, "Bits %i-%i at address %p\n",
340 nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr);
341 return 0;
342
343 out_free:
344 kfree(nmk_chip);
345 out_amba:
346 amba_release_regions(dev);
347 dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
348 pdata->first_gpio, pdata->first_gpio+31);
349 return ret;
350}
351
352static int nmk_gpio_remove(struct amba_device *dev)
353{
354 struct nmk_gpio_chip *nmk_chip;
355
356 nmk_chip = amba_get_drvdata(dev);
357 gpiochip_remove(&nmk_chip->chip);
358 kfree(nmk_chip);
359 amba_release_regions(dev);
360 return 0;
361}
362
363
364/* We have 0x1f080060 and 0x1f180060, accept both using the mask */
365static struct amba_id nmk_gpio_ids[] = {
366 {
367 .id = 0x1f080060,
368 .mask = 0xffefffff,
369 },
370 {0, 0},
371};
372
373static struct amba_driver nmk_gpio_driver = {
374 .drv = {
375 .owner = THIS_MODULE,
376 .name = "gpio",
377 },
378 .probe = nmk_gpio_probe,
379 .remove = nmk_gpio_remove,
380 .suspend = NULL, /* to be done */
381 .resume = NULL,
382 .id_table = nmk_gpio_ids,
383};
384
385static int __init nmk_gpio_init(void)
386{
387 return amba_driver_register(&nmk_gpio_driver);
388}
389
390arch_initcall(nmk_gpio_init);
391
392MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini");
393MODULE_DESCRIPTION("Nomadik GPIO Driver");
394MODULE_LICENSE("GPL");
395
396
diff --git a/arch/arm/mach-nomadik/i2c-8815nhk.c b/arch/arm/mach-nomadik/i2c-8815nhk.c
new file mode 100644
index 000000000000..abfe25a08d6b
--- /dev/null
+++ b/arch/arm/mach-nomadik/i2c-8815nhk.c
@@ -0,0 +1,65 @@
1#include <linux/module.h>
2#include <linux/init.h>
3#include <linux/i2c.h>
4#include <linux/i2c-algo-bit.h>
5#include <linux/i2c-gpio.h>
6#include <linux/gpio.h>
7#include <linux/platform_device.h>
8
9/*
10 * There are two busses in the 8815NHK.
11 * They could, in theory, be driven by the hardware component, but we
12 * use bit-bang through GPIO by now, to keep things simple
13 */
14
15static struct i2c_gpio_platform_data nhk8815_i2c_data0 = {
16 /* keep defaults for timeouts; pins are push-pull bidirectional */
17 .scl_pin = 62,
18 .sda_pin = 63,
19};
20
21static struct i2c_gpio_platform_data nhk8815_i2c_data1 = {
22 /* keep defaults for timeouts; pins are push-pull bidirectional */
23 .scl_pin = 53,
24 .sda_pin = 54,
25};
26
27/* first bus: GPIO XX and YY */
28static struct platform_device nhk8815_i2c_dev0 = {
29 .name = "i2c-gpio",
30 .id = 0,
31 .dev = {
32 .platform_data = &nhk8815_i2c_data0,
33 },
34};
35/* second bus: GPIO XX and YY */
36static struct platform_device nhk8815_i2c_dev1 = {
37 .name = "i2c-gpio",
38 .id = 1,
39 .dev = {
40 .platform_data = &nhk8815_i2c_data1,
41 },
42};
43
44static int __init nhk8815_i2c_init(void)
45{
46 nmk_gpio_set_mode(nhk8815_i2c_data0.scl_pin, NMK_GPIO_ALT_GPIO);
47 nmk_gpio_set_mode(nhk8815_i2c_data0.sda_pin, NMK_GPIO_ALT_GPIO);
48 platform_device_register(&nhk8815_i2c_dev0);
49
50 nmk_gpio_set_mode(nhk8815_i2c_data1.scl_pin, NMK_GPIO_ALT_GPIO);
51 nmk_gpio_set_mode(nhk8815_i2c_data1.sda_pin, NMK_GPIO_ALT_GPIO);
52 platform_device_register(&nhk8815_i2c_dev1);
53
54 return 0;
55}
56
57static void __exit nhk8815_i2c_exit(void)
58{
59 platform_device_unregister(&nhk8815_i2c_dev0);
60 platform_device_unregister(&nhk8815_i2c_dev1);
61 return;
62}
63
64module_init(nhk8815_i2c_init);
65module_exit(nhk8815_i2c_exit);
diff --git a/arch/arm/mach-nomadik/include/mach/clkdev.h b/arch/arm/mach-nomadik/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-nomadik/include/mach/debug-macro.S b/arch/arm/mach-nomadik/include/mach/debug-macro.S
new file mode 100644
index 000000000000..e876990e1569
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/debug-macro.S
@@ -0,0 +1,22 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 1994-1999 Russell King
5 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11*/
12
13 .macro addruart,rx
14 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled?
16 moveq \rx, #0x10000000 @ physical base address
17 movne \rx, #0xf0000000 @ virtual base
18 add \rx, \rx, #0x00100000
19 add \rx, \rx, #0x000fb000
20 .endm
21
22#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-nomadik/include/mach/entry-macro.S b/arch/arm/mach-nomadik/include/mach/entry-macro.S
new file mode 100644
index 000000000000..49f1aa3bb420
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/entry-macro.S
@@ -0,0 +1,43 @@
1/*
2 * Low-level IRQ helper macros for Nomadik platforms
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#include <mach/hardware.h>
10#include <mach/irqs.h>
11
12 .macro disable_fiq
13 .endm
14
15 .macro get_irqnr_preamble, base, tmp
16 ldr \base, =IO_ADDRESS(NOMADIK_IC_BASE)
17 .endm
18
19 .macro arch_ret_to_user, tmp1, tmp2
20 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23
24 /* This stanza gets the irq mask from one of two status registers */
25 mov \irqnr, #0
26 ldr \irqstat, [\base, #VIC_REG_IRQSR0] @ get masked status
27 cmp \irqstat, #0
28 bne 1001f
29 add \irqnr, \irqnr, #32
30 ldr \irqstat, [\base, #VIC_REG_IRQSR1] @ get masked status
31
321001: tst \irqstat, #15
33 bne 1002f
34 add \irqnr, \irqnr, #4
35 movs \irqstat, \irqstat, lsr #4
36 bne 1001b
371002: tst \irqstat, #1
38 bne 1003f
39 add \irqnr, \irqnr, #1
40 movs \irqstat, \irqstat, lsr #1
41 bne 1002b
421003: /* EQ will be set if no irqs pending */
43 .endm
diff --git a/arch/arm/mach-nomadik/include/mach/gpio.h b/arch/arm/mach-nomadik/include/mach/gpio.h
new file mode 100644
index 000000000000..61577c9f9a7d
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/gpio.h
@@ -0,0 +1,71 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
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#ifndef __ASM_ARCH_GPIO_H
13#define __ASM_ARCH_GPIO_H
14
15#include <asm-generic/gpio.h>
16
17/*
18 * These currently cause a function call to happen, they may be optimized
19 * if needed by adding cpu-specific defines to identify blocks
20 * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc)
21 */
22#define gpio_get_value __gpio_get_value
23#define gpio_set_value __gpio_set_value
24#define gpio_cansleep __gpio_cansleep
25#define gpio_to_irq __gpio_to_irq
26
27/*
28 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
29 * the "gpio" namespace for generic and cross-machine functions
30 */
31
32/* Register in the logic block */
33#define NMK_GPIO_DAT 0x00
34#define NMK_GPIO_DATS 0x04
35#define NMK_GPIO_DATC 0x08
36#define NMK_GPIO_PDIS 0x0c
37#define NMK_GPIO_DIR 0x10
38#define NMK_GPIO_DIRS 0x14
39#define NMK_GPIO_DIRC 0x18
40#define NMK_GPIO_SLPC 0x1c
41#define NMK_GPIO_AFSLA 0x20
42#define NMK_GPIO_AFSLB 0x24
43
44#define NMK_GPIO_RIMSC 0x40
45#define NMK_GPIO_FIMSC 0x44
46#define NMK_GPIO_IS 0x48
47#define NMK_GPIO_IC 0x4c
48#define NMK_GPIO_RWIMSC 0x50
49#define NMK_GPIO_FWIMSC 0x54
50#define NMK_GPIO_WKS 0x58
51
52/* Alternate functions: function C is set in hw by setting both A and B */
53#define NMK_GPIO_ALT_GPIO 0
54#define NMK_GPIO_ALT_A 1
55#define NMK_GPIO_ALT_B 2
56#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
57
58extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
59extern int nmk_gpio_get_mode(int gpio);
60
61/*
62 * Platform data to register a block: only the initial gpio/irq number.
63 */
64struct nmk_gpio_platform_data {
65 char *name;
66 int first_gpio;
67 int first_irq;
68 int parent_irq;
69};
70
71#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-nomadik/include/mach/hardware.h b/arch/arm/mach-nomadik/include/mach/hardware.h
new file mode 100644
index 000000000000..6316dba3bfc8
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/hardware.h
@@ -0,0 +1,90 @@
1/*
2 * This file contains the hardware definitions of the Nomadik.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * YOU should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef __ASM_ARCH_HARDWARE_H
19#define __ASM_ARCH_HARDWARE_H
20
21/* Nomadik registers live from 0x1000.0000 to 0x1023.0000 -- currently */
22#define NOMADIK_IO_VIRTUAL 0xF0000000 /* VA of IO */
23#define NOMADIK_IO_PHYSICAL 0x10000000 /* PA of IO */
24#define NOMADIK_IO_SIZE 0x00300000 /* 3MB for all regs */
25
26/* used in C code, so cast to proper type */
27#define io_p2v(x) ((void __iomem *)(x) \
28 - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
29#define io_v2p(x) ((unsigned long)(x) \
30 - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL)
31
32/* used in asm code, so no casts */
33#define IO_ADDRESS(x) ((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL)
34
35/*
36 * Base address defination for Nomadik Onchip Logic Block
37 */
38#define NOMADIK_FSMC_BASE 0x10100000 /* FSMC registers */
39#define NOMADIK_SDRAMC_BASE 0x10110000 /* SDRAM Controller */
40#define NOMADIK_CLCDC_BASE 0x10120000 /* CLCD Controller */
41#define NOMADIK_MDIF_BASE 0x10120000 /* MDIF */
42#define NOMADIK_DMA0_BASE 0x10130000 /* DMA0 Controller */
43#define NOMADIK_IC_BASE 0x10140000 /* Vectored Irq Controller */
44#define NOMADIK_DMA1_BASE 0x10150000 /* DMA1 Controller */
45#define NOMADIK_USB_BASE 0x10170000 /* USB-OTG conf reg base */
46#define NOMADIK_CRYP_BASE 0x10180000 /* Crypto processor */
47#define NOMADIK_SHA1_BASE 0x10190000 /* SHA-1 Processor */
48#define NOMADIK_XTI_BASE 0x101A0000 /* XTI */
49#define NOMADIK_RNG_BASE 0x101B0000 /* Random number generator */
50#define NOMADIK_SRC_BASE 0x101E0000 /* SRC base */
51#define NOMADIK_WDOG_BASE 0x101E1000 /* Watchdog */
52#define NOMADIK_MTU0_BASE 0x101E2000 /* Multiple Timer 0 */
53#define NOMADIK_MTU1_BASE 0x101E3000 /* Multiple Timer 1 */
54#define NOMADIK_GPIO0_BASE 0x101E4000 /* GPIO0 */
55#define NOMADIK_GPIO1_BASE 0x101E5000 /* GPIO1 */
56#define NOMADIK_GPIO2_BASE 0x101E6000 /* GPIO2 */
57#define NOMADIK_GPIO3_BASE 0x101E7000 /* GPIO3 */
58#define NOMADIK_RTC_BASE 0x101E8000 /* Real Time Clock base */
59#define NOMADIK_PMU_BASE 0x101E9000 /* Power Management Unit */
60#define NOMADIK_OWM_BASE 0x101EA000 /* One wire master */
61#define NOMADIK_SCR_BASE 0x101EF000 /* Secure Control registers */
62#define NOMADIK_MSP2_BASE 0x101F0000 /* MSP 2 interface */
63#define NOMADIK_MSP1_BASE 0x101F1000 /* MSP 1 interface */
64#define NOMADIK_UART2_BASE 0x101F2000 /* UART 2 interface */
65#define NOMADIK_SSIRx_BASE 0x101F3000 /* SSI 8-ch rx interface */
66#define NOMADIK_SSITx_BASE 0x101F4000 /* SSI 8-ch tx interface */
67#define NOMADIK_MSHC_BASE 0x101F5000 /* Memory Stick(Pro) Host */
68#define NOMADIK_SDI_BASE 0x101F6000 /* SD-card/MM-Card */
69#define NOMADIK_I2C1_BASE 0x101F7000 /* I2C1 interface */
70#define NOMADIK_I2C0_BASE 0x101F8000 /* I2C0 interface */
71#define NOMADIK_MSP0_BASE 0x101F9000 /* MSP 0 interface */
72#define NOMADIK_FIRDA_BASE 0x101FA000 /* FIrDA interface */
73#define NOMADIK_UART1_BASE 0x101FB000 /* UART 1 interface */
74#define NOMADIK_SSP_BASE 0x101FC000 /* SSP interface */
75#define NOMADIK_UART0_BASE 0x101FD000 /* UART 0 interface */
76#define NOMADIK_SGA_BASE 0x101FE000 /* SGA interface */
77#define NOMADIK_L2CC_BASE 0x10210000 /* L2 Cache controller */
78
79/* Other ranges, not for p2v/v2p */
80#define NOMADIK_BACKUP_RAM 0x80010000
81#define NOMADIK_EBROM 0x80000000 /* Embedded boot ROM */
82#define NOMADIK_HAMACV_DMEM_BASE 0xA0100000 /* HAMACV Data Memory Start */
83#define NOMADIK_HAMACV_DMEM_END 0xA01FFFFF /* HAMACV Data Memory End */
84#define NOMADIK_HAMACA_DMEM 0xA0200000 /* HAMACA Data Memory Space */
85
86#define NOMADIK_FSMC_VA IO_ADDRESS(NOMADIK_FSMC_BASE)
87#define NOMADIK_MTU0_VA IO_ADDRESS(NOMADIK_MTU0_BASE)
88#define NOMADIK_MTU1_VA IO_ADDRESS(NOMADIK_MTU1_BASE)
89
90#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-nomadik/include/mach/io.h b/arch/arm/mach-nomadik/include/mach/io.h
new file mode 100644
index 000000000000..2e1eca1b8243
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/io.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-nomadik/include/mach/io.h (copied from mach-sa1100)
3 *
4 * Copyright (C) 1997-1999 Russell King
5 *
6 * Modifications:
7 * 06-12-1997 RMK Created.
8 * 07-04-1999 RMK Major cleanup
9 */
10#ifndef __ASM_ARM_ARCH_IO_H
11#define __ASM_ARM_ARCH_IO_H
12
13#define IO_SPACE_LIMIT 0xffffffff
14
15/*
16 * We don't actually have real ISA nor PCI buses, but there is so many
17 * drivers out there that might just work if we fake them...
18 */
19#define __io(a) __typesafe_io(a)
20#define __mem_pci(a) (a)
21
22#endif
diff --git a/arch/arm/mach-nomadik/include/mach/irqs.h b/arch/arm/mach-nomadik/include/mach/irqs.h
new file mode 100644
index 000000000000..8faabc560398
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/irqs.h
@@ -0,0 +1,82 @@
1/*
2 * mach-nomadik/include/mach/irqs.h
3 *
4 * Copyright (C) ST Microelectronics
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_IRQS_H
21#define __ASM_ARCH_IRQS_H
22
23#include <mach/hardware.h>
24
25#define IRQ_VIC_START 0 /* first VIC interrupt is 0 */
26
27/*
28 * Interrupt numbers generic for all Nomadik Chip cuts
29 */
30#define IRQ_WATCHDOG 0
31#define IRQ_SOFTINT 1
32#define IRQ_CRYPTO 2
33#define IRQ_OWM 3
34#define IRQ_MTU0 4
35#define IRQ_MTU1 5
36#define IRQ_GPIO0 6
37#define IRQ_GPIO1 7
38#define IRQ_GPIO2 8
39#define IRQ_GPIO3 9
40#define IRQ_RTC_RTT 10
41#define IRQ_SSP 11
42#define IRQ_UART0 12
43#define IRQ_DMA1 13
44#define IRQ_CLCD_MDIF 14
45#define IRQ_DMA0 15
46#define IRQ_PWRFAIL 16
47#define IRQ_UART1 17
48#define IRQ_FIRDA 18
49#define IRQ_MSP0 19
50#define IRQ_I2C0 20
51#define IRQ_I2C1 21
52#define IRQ_SDMMC 22
53#define IRQ_USBOTG 23
54#define IRQ_SVA_IT0 24
55#define IRQ_SVA_IT1 25
56#define IRQ_SAA_IT0 26
57#define IRQ_SAA_IT1 27
58#define IRQ_UART2 28
59#define IRQ_MSP2 31
60#define IRQ_L2CC 48
61#define IRQ_HPI 49
62#define IRQ_SKE 50
63#define IRQ_KP 51
64#define IRQ_MEMST 54
65#define IRQ_SGA_IT 58
66#define IRQ_USBM 60
67#define IRQ_MSP1 62
68
69#define NOMADIK_SOC_NR_IRQS 64
70
71/* After chip-specific IRQ numbers we have the GPIO ones */
72#define NOMADIK_NR_GPIO 128 /* last 4 not wired to pins */
73#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + NOMADIK_SOC_NR_IRQS)
74#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - NOMADIK_SOC_NR_IRQS)
75#define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
76
77/* Following two are used by entry_macro.S, to access our dual-vic */
78#define VIC_REG_IRQSR0 0
79#define VIC_REG_IRQSR1 0x20
80
81#endif /* __ASM_ARCH_IRQS_H */
82
diff --git a/arch/arm/mach-nomadik/include/mach/memory.h b/arch/arm/mach-nomadik/include/mach/memory.h
new file mode 100644
index 000000000000..1e5689d98ecd
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/memory.h
@@ -0,0 +1,28 @@
1/*
2 * mach-nomadik/include/mach/memory.h
3 *
4 * Copyright (C) 1999 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23/*
24 * Physical DRAM offset.
25 */
26#define PHYS_OFFSET UL(0x00000000)
27
28#endif
diff --git a/arch/arm/mach-nomadik/include/mach/mtu.h b/arch/arm/mach-nomadik/include/mach/mtu.h
new file mode 100644
index 000000000000..76da7f085330
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/mtu.h
@@ -0,0 +1,45 @@
1#ifndef __ASM_ARCH_MTU_H
2#define __ASM_ARCH_MTU_H
3
4/*
5 * The MTU device hosts four different counters, with 4 set of
6 * registers. These are register names.
7 */
8
9#define MTU_IMSC 0x00 /* Interrupt mask set/clear */
10#define MTU_RIS 0x04 /* Raw interrupt status */
11#define MTU_MIS 0x08 /* Masked interrupt status */
12#define MTU_ICR 0x0C /* Interrupt clear register */
13
14/* per-timer registers take 0..3 as argument */
15#define MTU_LR(x) (0x10 + 0x10 * (x) + 0x00) /* Load value */
16#define MTU_VAL(x) (0x10 + 0x10 * (x) + 0x04) /* Current value */
17#define MTU_CR(x) (0x10 + 0x10 * (x) + 0x08) /* Control reg */
18#define MTU_BGLR(x) (0x10 + 0x10 * (x) + 0x0c) /* At next overflow */
19
20/* bits for the control register */
21#define MTU_CRn_ENA 0x80
22#define MTU_CRn_PERIODIC 0x40 /* if 0 = free-running */
23#define MTU_CRn_PRESCALE_MASK 0x0c
24#define MTU_CRn_PRESCALE_1 0x00
25#define MTU_CRn_PRESCALE_16 0x04
26#define MTU_CRn_PRESCALE_256 0x08
27#define MTU_CRn_32BITS 0x02
28#define MTU_CRn_ONESHOT 0x01 /* if 0 = wraps reloading from BGLR*/
29
30/* Other registers are usual amba/primecell registers, currently not used */
31#define MTU_ITCR 0xff0
32#define MTU_ITOP 0xff4
33
34#define MTU_PERIPH_ID0 0xfe0
35#define MTU_PERIPH_ID1 0xfe4
36#define MTU_PERIPH_ID2 0xfe8
37#define MTU_PERIPH_ID3 0xfeC
38
39#define MTU_PCELL0 0xff0
40#define MTU_PCELL1 0xff4
41#define MTU_PCELL2 0xff8
42#define MTU_PCELL3 0xffC
43
44#endif /* __ASM_ARCH_MTU_H */
45
diff --git a/arch/arm/mach-nomadik/include/mach/setup.h b/arch/arm/mach-nomadik/include/mach/setup.h
new file mode 100644
index 000000000000..a4e468cf63da
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/setup.h
@@ -0,0 +1,22 @@
1
2/*
3 * These symbols are needed for board-specific files to call their
4 * own cpu-specific files
5 */
6
7#ifndef __ASM_ARCH_SETUP_H
8#define __ASM_ARCH_SETUP_H
9
10#include <asm/mach/time.h>
11#include <linux/init.h>
12
13#ifdef CONFIG_NOMADIK_8815
14
15extern void cpu8815_map_io(void);
16extern void cpu8815_platform_init(void);
17extern void cpu8815_init_irq(void);
18extern struct sys_timer nomadik_timer;
19
20#endif /* NOMADIK_8815 */
21
22#endif /* __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-nomadik/include/mach/system.h b/arch/arm/mach-nomadik/include/mach/system.h
new file mode 100644
index 000000000000..7119f688116e
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/system.h
@@ -0,0 +1,45 @@
1/*
2 * mach-nomadik/include/mach/system.h
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_SYSTEM_H
21#define __ASM_ARCH_SYSTEM_H
22
23#include <linux/io.h>
24#include <mach/hardware.h>
25
26static inline void arch_idle(void)
27{
28 /*
29 * This should do all the clock switching
30 * and wait for interrupt tricks
31 */
32 cpu_do_idle();
33}
34
35static inline void arch_reset(char mode, const char *cmd)
36{
37 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
38
39 /* FIXME: use egpio when implemented */
40
41 /* Write anything to Reset status register */
42 writel(1, src_rstsr);
43}
44
45#endif
diff --git a/arch/arm/mach-nomadik/include/mach/timex.h b/arch/arm/mach-nomadik/include/mach/timex.h
new file mode 100644
index 000000000000..318b8896ce96
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/timex.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_ARCH_TIMEX_H
2#define __ASM_ARCH_TIMEX_H
3
4#define CLOCK_TICK_RATE 2400000
5
6#endif
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
new file mode 100644
index 000000000000..071003bc8456
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2008 STMicroelectronics
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARCH_UNCOMPRESS_H
20#define __ASM_ARCH_UNCOMPRESS_H
21
22#include <asm/setup.h>
23#include <asm/io.h>
24#include <mach/hardware.h>
25
26/* we need the constants in amba/serial.h, but it refers to amba_device */
27struct amba_device;
28#include <linux/amba/serial.h>
29
30#define NOMADIK_UART_DR 0x101FB000
31#define NOMADIK_UART_LCRH 0x101FB02c
32#define NOMADIK_UART_CR 0x101FB030
33#define NOMADIK_UART_FR 0x101FB018
34
35static void putc(const char c)
36{
37 /* Do nothing if the UART is not enabled. */
38 if (!(readb(NOMADIK_UART_CR) & UART01x_CR_UARTEN))
39 return;
40
41 if (c == '\n')
42 putc('\r');
43
44 while (readb(NOMADIK_UART_FR) & UART01x_FR_TXFF)
45 barrier();
46 writeb(c, NOMADIK_UART_DR);
47}
48
49static void flush(void)
50{
51 if (!(readb(NOMADIK_UART_CR) & UART01x_CR_UARTEN))
52 return;
53 while (readb(NOMADIK_UART_FR) & UART01x_FR_BUSY)
54 barrier();
55}
56
57static inline void arch_decomp_setup(void)
58{
59}
60
61#define arch_decomp_wdog() /* nothing to do here */
62
63#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-nomadik/include/mach/vmalloc.h b/arch/arm/mach-nomadik/include/mach/vmalloc.h
new file mode 100644
index 000000000000..be12e31ea528
--- /dev/null
+++ b/arch/arm/mach-nomadik/include/mach/vmalloc.h
@@ -0,0 +1,2 @@
1
2#define VMALLOC_END 0xe8000000
diff --git a/arch/arm/mach-nomadik/timer.c b/arch/arm/mach-nomadik/timer.c
new file mode 100644
index 000000000000..d1738e7061d4
--- /dev/null
+++ b/arch/arm/mach-nomadik/timer.c
@@ -0,0 +1,164 @@
1/*
2 * linux/arch/arm/mach-nomadik/timer.c
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Copyright (C) 2009 Alessandro Rubini, somewhat based on at91sam926x
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2, as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/irq.h>
14#include <linux/io.h>
15#include <linux/clockchips.h>
16#include <linux/jiffies.h>
17#include <asm/mach/time.h>
18#include <mach/mtu.h>
19
20#define TIMER_CTRL 0x80 /* No divisor */
21#define TIMER_PERIODIC 0x40
22#define TIMER_SZ32BIT 0x02
23
24/* Initial value for SRC control register: all timers use MXTAL/8 source */
25#define SRC_CR_INIT_MASK 0x00007fff
26#define SRC_CR_INIT_VAL 0x2aaa8000
27
28static u32 nmdk_count; /* accumulated count */
29static u32 nmdk_cycle; /* write-once */
30static __iomem void *mtu_base;
31
32/*
33 * clocksource: the MTU device is a decrementing counters, so we negate
34 * the value being read.
35 */
36static cycle_t nmdk_read_timer(struct clocksource *cs)
37{
38 u32 count = readl(mtu_base + MTU_VAL(0));
39 return nmdk_count + nmdk_cycle - count;
40
41}
42
43static struct clocksource nmdk_clksrc = {
44 .name = "mtu_0",
45 .rating = 120,
46 .read = nmdk_read_timer,
47 .shift = 20,
48 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
49};
50
51/*
52 * Clockevent device: currently only periodic mode is supported
53 */
54static void nmdk_clkevt_mode(enum clock_event_mode mode,
55 struct clock_event_device *dev)
56{
57 unsigned long flags;
58
59 switch (mode) {
60 case CLOCK_EVT_MODE_PERIODIC:
61 /* enable interrupts -- and count current value? */
62 raw_local_irq_save(flags);
63 writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC);
64 raw_local_irq_restore(flags);
65 break;
66 case CLOCK_EVT_MODE_ONESHOT:
67 BUG(); /* Not supported, yet */
68 /* FALLTHROUGH */
69 case CLOCK_EVT_MODE_SHUTDOWN:
70 case CLOCK_EVT_MODE_UNUSED:
71 /* disable irq */
72 raw_local_irq_save(flags);
73 writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC);
74 raw_local_irq_restore(flags);
75 break;
76 case CLOCK_EVT_MODE_RESUME:
77 break;
78 }
79}
80
81static struct clock_event_device nmdk_clkevt = {
82 .name = "mtu_0",
83 .features = CLOCK_EVT_FEAT_PERIODIC,
84 .shift = 32,
85 .rating = 100,
86 .set_mode = nmdk_clkevt_mode,
87};
88
89/*
90 * IRQ Handler for the timer 0 of the MTU block. The irq is not shared
91 * as we are the only users of mtu0 by now.
92 */
93static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id)
94{
95 /* ack: "interrupt clear register" */
96 writel( 1 << 0, mtu_base + MTU_ICR);
97
98 /* we can't count lost ticks, unfortunately */
99 nmdk_count += nmdk_cycle;
100 nmdk_clkevt.event_handler(&nmdk_clkevt);
101
102 return IRQ_HANDLED;
103}
104
105/*
106 * Set up timer interrupt, and return the current time in seconds.
107 */
108static struct irqaction nmdk_timer_irq = {
109 .name = "Nomadik Timer Tick",
110 .flags = IRQF_DISABLED | IRQF_TIMER,
111 .handler = nmdk_timer_interrupt,
112};
113
114static void nmdk_timer_reset(void)
115{
116 u32 cr;
117
118 writel(0, mtu_base + MTU_CR(0)); /* off */
119
120 /* configure load and background-load, and fire it up */
121 writel(nmdk_cycle, mtu_base + MTU_LR(0));
122 writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
123 cr = MTU_CRn_PERIODIC | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS;
124 writel(cr, mtu_base + MTU_CR(0));
125 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
126}
127
128static void __init nmdk_timer_init(void)
129{
130 u32 src_cr;
131 unsigned long rate;
132 int bits;
133
134 rate = CLOCK_TICK_RATE; /* 2.4MHz */
135 nmdk_cycle = (rate + HZ/2) / HZ;
136
137 /* Configure timer sources in "system reset controller" ctrl reg */
138 src_cr = readl(io_p2v(NOMADIK_SRC_BASE));
139 src_cr &= SRC_CR_INIT_MASK;
140 src_cr |= SRC_CR_INIT_VAL;
141 writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
142
143 /* Save global pointer to mtu, used by functions above */
144 mtu_base = io_p2v(NOMADIK_MTU0_BASE);
145
146 /* Init the timer and register clocksource */
147 nmdk_timer_reset();
148
149 nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift);
150 bits = 8*sizeof(nmdk_count);
151 nmdk_clksrc.mask = CLOCKSOURCE_MASK(bits);
152
153 clocksource_register(&nmdk_clksrc);
154
155 /* Register irq and clockevents */
156 setup_irq(IRQ_MTU0, &nmdk_timer_irq);
157 nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift);
158 nmdk_clkevt.cpumask = cpumask_of(0);
159 clockevents_register_device(&nmdk_clkevt);
160}
161
162struct sys_timer nomadik_timer = {
163 .init = nmdk_timer_init,
164};
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 57e477bd89c6..7e1e721f0324 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -39,7 +39,7 @@ static struct platform_device *sdp4430_devices[] __initdata = {
39}; 39};
40 40
41static struct omap_uart_config sdp4430_uart_config __initdata = { 41static struct omap_uart_config sdp4430_uart_config __initdata = {
42 .enabled_uarts = (1 << 0) | (1 << 1) | (1 << 2), 42 .enabled_uarts = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
43}; 43};
44 44
45static struct omap_lcd_config sdp4430_lcd_config __initdata = { 45static struct omap_lcd_config sdp4430_lcd_config __initdata = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index dff5528fbfb5..e26af837510b 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -51,6 +51,7 @@
51 51
52#define OVERO_GPIO_BT_XGATE 15 52#define OVERO_GPIO_BT_XGATE 15
53#define OVERO_GPIO_W2W_NRESET 16 53#define OVERO_GPIO_W2W_NRESET 16
54#define OVERO_GPIO_PENDOWN 114
54#define OVERO_GPIO_BT_NRESET 164 55#define OVERO_GPIO_BT_NRESET 164
55#define OVERO_GPIO_USBH_CPEN 168 56#define OVERO_GPIO_USBH_CPEN 168
56#define OVERO_GPIO_USBH_NRESET 183 57#define OVERO_GPIO_USBH_NRESET 183
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index 1d3c93bf86d3..f3c91a1ca391 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -29,9 +29,9 @@
29 * These registers appear once per CM module. 29 * These registers appear once per CM module.
30 */ 30 */
31 31
32#define OMAP3430_CM_REVISION OMAP_CM_REGADDR(OCP_MOD, 0x0000) 32#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
33#define OMAP3430_CM_SYSCONFIG OMAP_CM_REGADDR(OCP_MOD, 0x0010) 33#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
34#define OMAP3430_CM_POLCTRL OMAP_CM_REGADDR(OCP_MOD, 0x009c) 34#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
35 35
36#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070 36#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
37#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070) 37#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 99b6e1546311..d7288f1dc64f 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -168,6 +168,42 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
168#define OMAP34XX_MCBSP_PDATA_SZ 0 168#define OMAP34XX_MCBSP_PDATA_SZ 0
169#endif 169#endif
170 170
171static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = {
172 {
173 .phys_base = OMAP44XX_MCBSP1_BASE,
174 .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX,
175 .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX,
176 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
177 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
178 .ops = &omap2_mcbsp_ops,
179 },
180 {
181 .phys_base = OMAP44XX_MCBSP2_BASE,
182 .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX,
183 .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX,
184 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
185 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
186 .ops = &omap2_mcbsp_ops,
187 },
188 {
189 .phys_base = OMAP44XX_MCBSP3_BASE,
190 .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX,
191 .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX,
192 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
193 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
194 .ops = &omap2_mcbsp_ops,
195 },
196 {
197 .phys_base = OMAP44XX_MCBSP4_BASE,
198 .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX,
199 .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX,
200 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
201 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
202 .ops = &omap2_mcbsp_ops,
203 },
204};
205#define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata)
206
171static int __init omap2_mcbsp_init(void) 207static int __init omap2_mcbsp_init(void)
172{ 208{
173 if (cpu_is_omap2420()) 209 if (cpu_is_omap2420())
@@ -176,6 +212,8 @@ static int __init omap2_mcbsp_init(void)
176 omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; 212 omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
177 if (cpu_is_omap34xx()) 213 if (cpu_is_omap34xx())
178 omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; 214 omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
215 if (cpu_is_omap44xx())
216 omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ;
179 217
180 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 218 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
181 GFP_KERNEL); 219 GFP_KERNEL);
@@ -191,6 +229,9 @@ static int __init omap2_mcbsp_init(void)
191 if (cpu_is_omap34xx()) 229 if (cpu_is_omap34xx())
192 omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, 230 omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
193 OMAP34XX_MCBSP_PDATA_SZ); 231 OMAP34XX_MCBSP_PDATA_SZ);
232 if (cpu_is_omap44xx())
233 omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata,
234 OMAP44XX_MCBSP_PDATA_SZ);
194 235
195 return omap_mcbsp_init(); 236 return omap_mcbsp_init();
196} 237}
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index f7b3baf76678..21201cd4117b 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -11,9 +11,6 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H 11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H
12#define __ARCH_ARM_MACH_OMAP2_PM_H 12#define __ARCH_ARM_MACH_OMAP2_PM_H
13 13
14extern int omap2_pm_init(void);
15extern int omap3_pm_init(void);
16
17#ifdef CONFIG_PM_DEBUG 14#ifdef CONFIG_PM_DEBUG
18extern void omap2_pm_dump(int mode, int resume, unsigned int us); 15extern void omap2_pm_dump(int mode, int resume, unsigned int us);
19extern int omap2_pm_debug; 16extern int omap2_pm_debug;
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index db1025562fb0..528dbdc26e23 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -470,7 +470,7 @@ static void __init prcm_setup_regs(void)
470 WKUP_MOD, PM_WKEN); 470 WKUP_MOD, PM_WKEN);
471} 471}
472 472
473int __init omap2_pm_init(void) 473static int __init omap2_pm_init(void)
474{ 474{
475 u32 l; 475 u32 l;
476 476
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 841d4c5ed8be..488d595d8e4b 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -39,7 +39,9 @@
39struct power_state { 39struct power_state {
40 struct powerdomain *pwrdm; 40 struct powerdomain *pwrdm;
41 u32 next_state; 41 u32 next_state;
42#ifdef CONFIG_SUSPEND
42 u32 saved_state; 43 u32 saved_state;
44#endif
43 struct list_head node; 45 struct list_head node;
44}; 46};
45 47
@@ -293,6 +295,9 @@ out:
293 local_irq_enable(); 295 local_irq_enable();
294} 296}
295 297
298#ifdef CONFIG_SUSPEND
299static suspend_state_t suspend_state;
300
296static int omap3_pm_prepare(void) 301static int omap3_pm_prepare(void)
297{ 302{
298 disable_hlt(); 303 disable_hlt();
@@ -321,7 +326,6 @@ static int omap3_pm_suspend(void)
321restore: 326restore:
322 /* Restore next_pwrsts */ 327 /* Restore next_pwrsts */
323 list_for_each_entry(pwrst, &pwrst_list, node) { 328 list_for_each_entry(pwrst, &pwrst_list, node) {
324 set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
325 state = pwrdm_read_prev_pwrst(pwrst->pwrdm); 329 state = pwrdm_read_prev_pwrst(pwrst->pwrdm);
326 if (state > pwrst->next_state) { 330 if (state > pwrst->next_state) {
327 printk(KERN_INFO "Powerdomain (%s) didn't enter " 331 printk(KERN_INFO "Powerdomain (%s) didn't enter "
@@ -329,6 +333,7 @@ restore:
329 pwrst->pwrdm->name, pwrst->next_state); 333 pwrst->pwrdm->name, pwrst->next_state);
330 ret = -1; 334 ret = -1;
331 } 335 }
336 set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
332 } 337 }
333 if (ret) 338 if (ret)
334 printk(KERN_ERR "Could not enter target state in pm_suspend\n"); 339 printk(KERN_ERR "Could not enter target state in pm_suspend\n");
@@ -339,11 +344,11 @@ restore:
339 return ret; 344 return ret;
340} 345}
341 346
342static int omap3_pm_enter(suspend_state_t state) 347static int omap3_pm_enter(suspend_state_t unused)
343{ 348{
344 int ret = 0; 349 int ret = 0;
345 350
346 switch (state) { 351 switch (suspend_state) {
347 case PM_SUSPEND_STANDBY: 352 case PM_SUSPEND_STANDBY:
348 case PM_SUSPEND_MEM: 353 case PM_SUSPEND_MEM:
349 ret = omap3_pm_suspend(); 354 ret = omap3_pm_suspend();
@@ -360,12 +365,30 @@ static void omap3_pm_finish(void)
360 enable_hlt(); 365 enable_hlt();
361} 366}
362 367
368/* Hooks to enable / disable UART interrupts during suspend */
369static int omap3_pm_begin(suspend_state_t state)
370{
371 suspend_state = state;
372 omap_uart_enable_irqs(0);
373 return 0;
374}
375
376static void omap3_pm_end(void)
377{
378 suspend_state = PM_SUSPEND_ON;
379 omap_uart_enable_irqs(1);
380 return;
381}
382
363static struct platform_suspend_ops omap_pm_ops = { 383static struct platform_suspend_ops omap_pm_ops = {
384 .begin = omap3_pm_begin,
385 .end = omap3_pm_end,
364 .prepare = omap3_pm_prepare, 386 .prepare = omap3_pm_prepare,
365 .enter = omap3_pm_enter, 387 .enter = omap3_pm_enter,
366 .finish = omap3_pm_finish, 388 .finish = omap3_pm_finish,
367 .valid = suspend_valid_only_mem, 389 .valid = suspend_valid_only_mem,
368}; 390};
391#endif /* CONFIG_SUSPEND */
369 392
370 393
371/** 394/**
@@ -613,6 +636,24 @@ static void __init prcm_setup_regs(void)
613 /* Clear any pending PRCM interrupts */ 636 /* Clear any pending PRCM interrupts */
614 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 637 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
615 638
639 /* Don't attach IVA interrupts */
640 prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
641 prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
642 prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
643 prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
644
645 /* Clear any pending 'reset' flags */
646 prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST);
647 prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST);
648 prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST);
649 prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST);
650 prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST);
651 prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST);
652 prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST);
653
654 /* Clear any pending PRCM interrupts */
655 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
656
616 omap3_iva_idle(); 657 omap3_iva_idle();
617 omap3_d2d_idle(); 658 omap3_d2d_idle();
618} 659}
@@ -652,7 +693,7 @@ static int __init clkdms_setup(struct clockdomain *clkdm)
652 return 0; 693 return 0;
653} 694}
654 695
655int __init omap3_pm_init(void) 696static int __init omap3_pm_init(void)
656{ 697{
657 struct power_state *pwrst, *tmp; 698 struct power_state *pwrst, *tmp;
658 int ret; 699 int ret;
@@ -692,7 +733,9 @@ int __init omap3_pm_init(void)
692 _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend, 733 _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
693 omap34xx_cpu_suspend_sz); 734 omap34xx_cpu_suspend_sz);
694 735
736#ifdef CONFIG_SUSPEND
695 suspend_set_ops(&omap_pm_ops); 737 suspend_set_ops(&omap_pm_ops);
738#endif /* CONFIG_SUSPEND */
696 739
697 pm_idle = omap3_pm_idle; 740 pm_idle = omap3_pm_idle;
698 741
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index b094c15bfe47..ce22344b94e7 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -54,6 +54,7 @@ struct omap_uart_state {
54 54
55 struct plat_serial8250_port *p; 55 struct plat_serial8250_port *p;
56 struct list_head node; 56 struct list_head node;
57 struct platform_device pdev;
57 58
58#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 59#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
59 int context_valid; 60 int context_valid;
@@ -68,10 +69,9 @@ struct omap_uart_state {
68#endif 69#endif
69}; 70};
70 71
71static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS];
72static LIST_HEAD(uart_list); 72static LIST_HEAD(uart_list);
73 73
74static struct plat_serial8250_port serial_platform_data[] = { 74static struct plat_serial8250_port serial_platform_data0[] = {
75 { 75 {
76 .membase = IO_ADDRESS(OMAP_UART1_BASE), 76 .membase = IO_ADDRESS(OMAP_UART1_BASE),
77 .mapbase = OMAP_UART1_BASE, 77 .mapbase = OMAP_UART1_BASE,
@@ -81,6 +81,12 @@ static struct plat_serial8250_port serial_platform_data[] = {
81 .regshift = 2, 81 .regshift = 2,
82 .uartclk = OMAP24XX_BASE_BAUD * 16, 82 .uartclk = OMAP24XX_BASE_BAUD * 16,
83 }, { 83 }, {
84 .flags = 0
85 }
86};
87
88static struct plat_serial8250_port serial_platform_data1[] = {
89 {
84 .membase = IO_ADDRESS(OMAP_UART2_BASE), 90 .membase = IO_ADDRESS(OMAP_UART2_BASE),
85 .mapbase = OMAP_UART2_BASE, 91 .mapbase = OMAP_UART2_BASE,
86 .irq = 73, 92 .irq = 73,
@@ -89,6 +95,12 @@ static struct plat_serial8250_port serial_platform_data[] = {
89 .regshift = 2, 95 .regshift = 2,
90 .uartclk = OMAP24XX_BASE_BAUD * 16, 96 .uartclk = OMAP24XX_BASE_BAUD * 16,
91 }, { 97 }, {
98 .flags = 0
99 }
100};
101
102static struct plat_serial8250_port serial_platform_data2[] = {
103 {
92 .membase = IO_ADDRESS(OMAP_UART3_BASE), 104 .membase = IO_ADDRESS(OMAP_UART3_BASE),
93 .mapbase = OMAP_UART3_BASE, 105 .mapbase = OMAP_UART3_BASE,
94 .irq = 74, 106 .irq = 74,
@@ -97,6 +109,16 @@ static struct plat_serial8250_port serial_platform_data[] = {
97 .regshift = 2, 109 .regshift = 2,
98 .uartclk = OMAP24XX_BASE_BAUD * 16, 110 .uartclk = OMAP24XX_BASE_BAUD * 16,
99 }, { 111 }, {
112#ifdef CONFIG_ARCH_OMAP4
113 .membase = IO_ADDRESS(OMAP_UART4_BASE),
114 .mapbase = OMAP_UART4_BASE,
115 .irq = 70,
116 .flags = UPF_BOOT_AUTOCONF,
117 .iotype = UPIO_MEM,
118 .regshift = 2,
119 .uartclk = OMAP24XX_BASE_BAUD * 16,
120 }, {
121#endif
100 .flags = 0 122 .flags = 0
101 } 123 }
102}; 124};
@@ -217,6 +239,40 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart)
217 clk_disable(uart->fck); 239 clk_disable(uart->fck);
218} 240}
219 241
242static void omap_uart_enable_wakeup(struct omap_uart_state *uart)
243{
244 /* Set wake-enable bit */
245 if (uart->wk_en && uart->wk_mask) {
246 u32 v = __raw_readl(uart->wk_en);
247 v |= uart->wk_mask;
248 __raw_writel(v, uart->wk_en);
249 }
250
251 /* Ensure IOPAD wake-enables are set */
252 if (cpu_is_omap34xx() && uart->padconf) {
253 u16 v = omap_ctrl_readw(uart->padconf);
254 v |= OMAP3_PADCONF_WAKEUPENABLE0;
255 omap_ctrl_writew(v, uart->padconf);
256 }
257}
258
259static void omap_uart_disable_wakeup(struct omap_uart_state *uart)
260{
261 /* Clear wake-enable bit */
262 if (uart->wk_en && uart->wk_mask) {
263 u32 v = __raw_readl(uart->wk_en);
264 v &= ~uart->wk_mask;
265 __raw_writel(v, uart->wk_en);
266 }
267
268 /* Ensure IOPAD wake-enables are cleared */
269 if (cpu_is_omap34xx() && uart->padconf) {
270 u16 v = omap_ctrl_readw(uart->padconf);
271 v &= ~OMAP3_PADCONF_WAKEUPENABLE0;
272 omap_ctrl_writew(v, uart->padconf);
273 }
274}
275
220static void omap_uart_smart_idle_enable(struct omap_uart_state *uart, 276static void omap_uart_smart_idle_enable(struct omap_uart_state *uart,
221 int enable) 277 int enable)
222{ 278{
@@ -246,6 +302,11 @@ static void omap_uart_block_sleep(struct omap_uart_state *uart)
246 302
247static void omap_uart_allow_sleep(struct omap_uart_state *uart) 303static void omap_uart_allow_sleep(struct omap_uart_state *uart)
248{ 304{
305 if (device_may_wakeup(&uart->pdev.dev))
306 omap_uart_enable_wakeup(uart);
307 else
308 omap_uart_disable_wakeup(uart);
309
249 if (!uart->clocked) 310 if (!uart->clocked)
250 return; 311 return;
251 312
@@ -292,7 +353,6 @@ void omap_uart_resume_idle(int num)
292 /* Check for normal UART wakeup */ 353 /* Check for normal UART wakeup */
293 if (__raw_readl(uart->wk_st) & uart->wk_mask) 354 if (__raw_readl(uart->wk_st) & uart->wk_mask)
294 omap_uart_block_sleep(uart); 355 omap_uart_block_sleep(uart);
295
296 return; 356 return;
297 } 357 }
298 } 358 }
@@ -346,16 +406,13 @@ static irqreturn_t omap_uart_interrupt(int irq, void *dev_id)
346 return IRQ_NONE; 406 return IRQ_NONE;
347} 407}
348 408
349static u32 sleep_timeout = DEFAULT_TIMEOUT;
350
351static void omap_uart_idle_init(struct omap_uart_state *uart) 409static void omap_uart_idle_init(struct omap_uart_state *uart)
352{ 410{
353 u32 v;
354 struct plat_serial8250_port *p = uart->p; 411 struct plat_serial8250_port *p = uart->p;
355 int ret; 412 int ret;
356 413
357 uart->can_sleep = 0; 414 uart->can_sleep = 0;
358 uart->timeout = sleep_timeout; 415 uart->timeout = DEFAULT_TIMEOUT;
359 setup_timer(&uart->timer, omap_uart_idle_timer, 416 setup_timer(&uart->timer, omap_uart_idle_timer,
360 (unsigned long) uart); 417 (unsigned long) uart);
361 mod_timer(&uart->timer, jiffies + uart->timeout); 418 mod_timer(&uart->timer, jiffies + uart->timeout);
@@ -413,76 +470,101 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
413 uart->padconf = 0; 470 uart->padconf = 0;
414 } 471 }
415 472
416 /* Set wake-enable bit */
417 if (uart->wk_en && uart->wk_mask) {
418 v = __raw_readl(uart->wk_en);
419 v |= uart->wk_mask;
420 __raw_writel(v, uart->wk_en);
421 }
422
423 /* Ensure IOPAD wake-enables are set */
424 if (cpu_is_omap34xx() && uart->padconf) {
425 u16 v;
426
427 v = omap_ctrl_readw(uart->padconf);
428 v |= OMAP3_PADCONF_WAKEUPENABLE0;
429 omap_ctrl_writew(v, uart->padconf);
430 }
431
432 p->flags |= UPF_SHARE_IRQ; 473 p->flags |= UPF_SHARE_IRQ;
433 ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED, 474 ret = request_irq(p->irq, omap_uart_interrupt, IRQF_SHARED,
434 "serial idle", (void *)uart); 475 "serial idle", (void *)uart);
435 WARN_ON(ret); 476 WARN_ON(ret);
436} 477}
437 478
438static ssize_t sleep_timeout_show(struct kobject *kobj, 479void omap_uart_enable_irqs(int enable)
439 struct kobj_attribute *attr, 480{
481 int ret;
482 struct omap_uart_state *uart;
483
484 list_for_each_entry(uart, &uart_list, node) {
485 if (enable)
486 ret = request_irq(uart->p->irq, omap_uart_interrupt,
487 IRQF_SHARED, "serial idle", (void *)uart);
488 else
489 free_irq(uart->p->irq, (void *)uart);
490 }
491}
492
493static ssize_t sleep_timeout_show(struct device *dev,
494 struct device_attribute *attr,
440 char *buf) 495 char *buf)
441{ 496{
442 return sprintf(buf, "%u\n", sleep_timeout / HZ); 497 struct platform_device *pdev = container_of(dev,
498 struct platform_device, dev);
499 struct omap_uart_state *uart = container_of(pdev,
500 struct omap_uart_state, pdev);
501
502 return sprintf(buf, "%u\n", uart->timeout / HZ);
443} 503}
444 504
445static ssize_t sleep_timeout_store(struct kobject *kobj, 505static ssize_t sleep_timeout_store(struct device *dev,
446 struct kobj_attribute *attr, 506 struct device_attribute *attr,
447 const char *buf, size_t n) 507 const char *buf, size_t n)
448{ 508{
449 struct omap_uart_state *uart; 509 struct platform_device *pdev = container_of(dev,
510 struct platform_device, dev);
511 struct omap_uart_state *uart = container_of(pdev,
512 struct omap_uart_state, pdev);
450 unsigned int value; 513 unsigned int value;
451 514
452 if (sscanf(buf, "%u", &value) != 1) { 515 if (sscanf(buf, "%u", &value) != 1) {
453 printk(KERN_ERR "sleep_timeout_store: Invalid value\n"); 516 printk(KERN_ERR "sleep_timeout_store: Invalid value\n");
454 return -EINVAL; 517 return -EINVAL;
455 } 518 }
456 sleep_timeout = value * HZ; 519
457 list_for_each_entry(uart, &uart_list, node) { 520 uart->timeout = value * HZ;
458 uart->timeout = sleep_timeout; 521 if (uart->timeout)
459 if (uart->timeout) 522 mod_timer(&uart->timer, jiffies + uart->timeout);
460 mod_timer(&uart->timer, jiffies + uart->timeout); 523 else
461 else 524 /* A zero value means disable timeout feature */
462 /* A zero value means disable timeout feature */ 525 omap_uart_block_sleep(uart);
463 omap_uart_block_sleep(uart); 526
464 }
465 return n; 527 return n;
466} 528}
467 529
468static struct kobj_attribute sleep_timeout_attr = 530DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store);
469 __ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store); 531#define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr))
470
471#else 532#else
472static inline void omap_uart_idle_init(struct omap_uart_state *uart) {} 533static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
534#define DEV_CREATE_FILE(dev, attr)
473#endif /* CONFIG_PM */ 535#endif /* CONFIG_PM */
474 536
475static struct platform_device serial_device = { 537static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
476 .name = "serial8250", 538 {
477 .id = PLAT8250_DEV_PLATFORM, 539 .pdev = {
478 .dev = { 540 .name = "serial8250",
479 .platform_data = serial_platform_data, 541 .id = PLAT8250_DEV_PLATFORM,
542 .dev = {
543 .platform_data = serial_platform_data0,
544 },
545 },
546 }, {
547 .pdev = {
548 .name = "serial8250",
549 .id = PLAT8250_DEV_PLATFORM1,
550 .dev = {
551 .platform_data = serial_platform_data1,
552 },
553 },
554 }, {
555 .pdev = {
556 .name = "serial8250",
557 .id = PLAT8250_DEV_PLATFORM2,
558 .dev = {
559 .platform_data = serial_platform_data2,
560 },
561 },
480 }, 562 },
481}; 563};
482 564
483void __init omap_serial_init(void) 565void __init omap_serial_init(void)
484{ 566{
485 int i, err; 567 int i;
486 const struct omap_uart_config *info; 568 const struct omap_uart_config *info;
487 char name[16]; 569 char name[16];
488 570
@@ -496,14 +578,12 @@ void __init omap_serial_init(void)
496 578
497 if (info == NULL) 579 if (info == NULL)
498 return; 580 return;
499 if (cpu_is_omap44xx()) {
500 for (i = 0; i < OMAP_MAX_NR_PORTS; i++)
501 serial_platform_data[i].irq += 32;
502 }
503 581
504 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 582 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
505 struct plat_serial8250_port *p = serial_platform_data + i;
506 struct omap_uart_state *uart = &omap_uart[i]; 583 struct omap_uart_state *uart = &omap_uart[i];
584 struct platform_device *pdev = &uart->pdev;
585 struct device *dev = &pdev->dev;
586 struct plat_serial8250_port *p = dev->platform_data;
507 587
508 if (!(info->enabled_uarts & (1 << i))) { 588 if (!(info->enabled_uarts & (1 << i))) {
509 p->membase = NULL; 589 p->membase = NULL;
@@ -531,20 +611,21 @@ void __init omap_serial_init(void)
531 uart->num = i; 611 uart->num = i;
532 p->private_data = uart; 612 p->private_data = uart;
533 uart->p = p; 613 uart->p = p;
534 list_add(&uart->node, &uart_list); 614 list_add_tail(&uart->node, &uart_list);
615
616 if (cpu_is_omap44xx())
617 p->irq += 32;
535 618
536 omap_uart_enable_clocks(uart); 619 omap_uart_enable_clocks(uart);
537 omap_uart_reset(uart); 620 omap_uart_reset(uart);
538 omap_uart_idle_init(uart); 621 omap_uart_idle_init(uart);
539 }
540
541 err = platform_device_register(&serial_device);
542
543#ifdef CONFIG_PM
544 if (!err)
545 err = sysfs_create_file(&serial_device.dev.kobj,
546 &sleep_timeout_attr.attr);
547#endif
548 622
623 if (WARN_ON(platform_device_register(pdev)))
624 continue;
625 if ((cpu_is_omap34xx() && uart->padconf) ||
626 (uart->wk_en && uart->wk_mask)) {
627 device_init_wakeup(dev, true);
628 DEV_CREATE_FILE(dev, &dev_attr_sleep_timeout);
629 }
630 }
549} 631}
550
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index 2c7035d8dcbf..c3d513cad5ac 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -89,6 +89,27 @@ config MACH_EDMINI_V2
89 Say 'Y' here if you want your kernel to support the 89 Say 'Y' here if you want your kernel to support the
90 LaCie Ethernet Disk mini V2. 90 LaCie Ethernet Disk mini V2.
91 91
92config MACH_D2NET
93 bool "LaCie d2 Network"
94 select I2C_BOARDINFO
95 help
96 Say 'Y' here if you want your kernel to support the
97 LaCie d2 Network NAS.
98
99config MACH_BIGDISK
100 bool "LaCie Big Disk Network"
101 select I2C_BOARDINFO
102 help
103 Say 'Y' here if you want your kernel to support the
104 LaCie Big Disk Network NAS.
105
106config MACH_NET2BIG
107 bool "LaCie 2Big Network"
108 select I2C_BOARDINFO
109 help
110 Say 'Y' here if you want your kernel to support the
111 LaCie 2Big Network NAS.
112
92config MACH_MSS2 113config MACH_MSS2
93 bool "Maxtor Shared Storage II" 114 bool "Maxtor Shared Storage II"
94 help 115 help
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index edc38e2c856f..89772fcd65c7 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -12,6 +12,9 @@ obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n-v2-setup.o
12obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o 12obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o
13obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o 13obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o
14obj-$(CONFIG_MACH_EDMINI_V2) += edmini_v2-setup.o 14obj-$(CONFIG_MACH_EDMINI_V2) += edmini_v2-setup.o
15obj-$(CONFIG_MACH_D2NET) += d2net-setup.o
16obj-$(CONFIG_MACH_BIGDISK) += d2net-setup.o
17obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o
15obj-$(CONFIG_MACH_MSS2) += mss2-setup.o 18obj-$(CONFIG_MACH_MSS2) += mss2-setup.o
16obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o 19obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o
17obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o 20obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
index d78731edebb6..1a5d6a0e2602 100644
--- a/arch/arm/mach-orion5x/addr-map.c
+++ b/arch/arm/mach-orion5x/addr-map.c
@@ -84,7 +84,8 @@ static int __init orion5x_cpu_win_can_remap(int win)
84 orion5x_pcie_id(&dev, &rev); 84 orion5x_pcie_id(&dev, &rev);
85 if ((dev == MV88F5281_DEV_ID && win < 4) 85 if ((dev == MV88F5281_DEV_ID && win < 4)
86 || (dev == MV88F5182_DEV_ID && win < 2) 86 || (dev == MV88F5182_DEV_ID && win < 2)
87 || (dev == MV88F5181_DEV_ID && win < 2)) 87 || (dev == MV88F5181_DEV_ID && win < 2)
88 || (dev == MV88F6183_DEV_ID && win < 4))
88 return 1; 89 return 1;
89 90
90 return 0; 91 return 0;
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
new file mode 100644
index 000000000000..9d4bf763f25b
--- /dev/null
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -0,0 +1,365 @@
1/*
2 * arch/arm/mach-orion5x/d2net-setup.c
3 *
4 * LaCie d2Network and Big Disk Network NAS setup
5 *
6 * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/pci.h>
17#include <linux/irq.h>
18#include <linux/mtd/physmap.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/leds.h>
21#include <linux/gpio_keys.h>
22#include <linux/input.h>
23#include <linux/i2c.h>
24#include <linux/ata_platform.h>
25#include <linux/gpio.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/pci.h>
29#include <mach/orion5x.h>
30#include "common.h"
31#include "mpp.h"
32
33/*****************************************************************************
34 * LaCie d2 Network Info
35 ****************************************************************************/
36
37/*
38 * 512KB NOR flash Device bus boot chip select
39 */
40
41#define D2NET_NOR_BOOT_BASE 0xfff80000
42#define D2NET_NOR_BOOT_SIZE SZ_512K
43
44/*****************************************************************************
45 * 512KB NOR Flash on Boot Device
46 ****************************************************************************/
47
48/*
49 * TODO: Check write support on flash MX29LV400CBTC-70G
50 */
51
52static struct mtd_partition d2net_partitions[] = {
53 {
54 .name = "Full512kb",
55 .size = MTDPART_SIZ_FULL,
56 .offset = 0,
57 .mask_flags = MTD_WRITEABLE,
58 },
59};
60
61static struct physmap_flash_data d2net_nor_flash_data = {
62 .width = 1,
63 .parts = d2net_partitions,
64 .nr_parts = ARRAY_SIZE(d2net_partitions),
65};
66
67static struct resource d2net_nor_flash_resource = {
68 .flags = IORESOURCE_MEM,
69 .start = D2NET_NOR_BOOT_BASE,
70 .end = D2NET_NOR_BOOT_BASE
71 + D2NET_NOR_BOOT_SIZE - 1,
72};
73
74static struct platform_device d2net_nor_flash = {
75 .name = "physmap-flash",
76 .id = 0,
77 .dev = {
78 .platform_data = &d2net_nor_flash_data,
79 },
80 .num_resources = 1,
81 .resource = &d2net_nor_flash_resource,
82};
83
84/*****************************************************************************
85 * Ethernet
86 ****************************************************************************/
87
88static struct mv643xx_eth_platform_data d2net_eth_data = {
89 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
90};
91
92/*****************************************************************************
93 * I2C devices
94 ****************************************************************************/
95
96/*
97 * i2c addr | chip | description
98 * 0x32 | Ricoh 5C372b | RTC
99 * 0x3e | GMT G762 | PWM fan controller
100 * 0x50 | HT24LC08 | eeprom (1kB)
101 *
102 * TODO: Add G762 support to the g760a driver.
103 */
104static struct i2c_board_info __initdata d2net_i2c_devices[] = {
105 {
106 I2C_BOARD_INFO("rs5c372b", 0x32),
107 }, {
108 I2C_BOARD_INFO("24c08", 0x50),
109 },
110};
111
112/*****************************************************************************
113 * SATA
114 ****************************************************************************/
115
116static struct mv_sata_platform_data d2net_sata_data = {
117 .n_ports = 2,
118};
119
120#define D2NET_GPIO_SATA0_POWER 3
121#define D2NET_GPIO_SATA1_POWER 12
122
123static void __init d2net_sata_power_init(void)
124{
125 int err;
126
127 err = gpio_request(D2NET_GPIO_SATA0_POWER, "SATA0 power");
128 if (err == 0) {
129 err = gpio_direction_output(D2NET_GPIO_SATA0_POWER, 1);
130 if (err)
131 gpio_free(D2NET_GPIO_SATA0_POWER);
132 }
133 if (err)
134 pr_err("d2net: failed to configure SATA0 power GPIO\n");
135
136 err = gpio_request(D2NET_GPIO_SATA1_POWER, "SATA1 power");
137 if (err == 0) {
138 err = gpio_direction_output(D2NET_GPIO_SATA1_POWER, 1);
139 if (err)
140 gpio_free(D2NET_GPIO_SATA1_POWER);
141 }
142 if (err)
143 pr_err("d2net: failed to configure SATA1 power GPIO\n");
144}
145
146/*****************************************************************************
147 * GPIO LED's
148 ****************************************************************************/
149
150/*
151 * The blue front LED is wired to the CPLD and can blink in relation with the
152 * SATA activity. This feature is disabled to make this LED compatible with
153 * the leds-gpio driver: MPP14 and MPP15 are configured to act like output
154 * GPIO's and have to stay in an active state. This is needed to set the blue
155 * LED in a "fix on" state regardless of the SATA activity.
156 *
157 * The following array detail the different LED registers and the combination
158 * of their possible values:
159 *
160 * led_off | blink_ctrl | SATA active | LED state
161 * | | |
162 * 1 | x | x | off
163 * 0 | 0 | 0 | off
164 * 0 | 1 | 0 | blink (rate 300ms)
165 * 0 | x | 1 | on
166 *
167 * Notes: The blue and the red front LED's can't be on at the same time.
168 * Red LED have priority.
169 */
170
171#define D2NET_GPIO_RED_LED 6
172#define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16
173#define D2NET_GPIO_BLUE_LED_OFF 23
174#define D2NET_GPIO_SATA0_ACT 14
175#define D2NET_GPIO_SATA1_ACT 15
176
177static struct gpio_led d2net_leds[] = {
178 {
179 .name = "d2net:blue:power",
180 .gpio = D2NET_GPIO_BLUE_LED_OFF,
181 .active_low = 1,
182 },
183 {
184 .name = "d2net:red:fail",
185 .gpio = D2NET_GPIO_RED_LED,
186 },
187};
188
189static struct gpio_led_platform_data d2net_led_data = {
190 .num_leds = ARRAY_SIZE(d2net_leds),
191 .leds = d2net_leds,
192};
193
194static struct platform_device d2net_gpio_leds = {
195 .name = "leds-gpio",
196 .id = -1,
197 .dev = {
198 .platform_data = &d2net_led_data,
199 },
200};
201
202static void __init d2net_gpio_leds_init(void)
203{
204 /* Configure GPIO over MPP max number. */
205 orion_gpio_set_valid(D2NET_GPIO_BLUE_LED_OFF, 1);
206
207 if (gpio_request(D2NET_GPIO_SATA0_ACT, "LED SATA0 activity") != 0)
208 return;
209 if (gpio_direction_output(D2NET_GPIO_SATA0_ACT, 1) != 0)
210 goto err_free_1;
211 if (gpio_request(D2NET_GPIO_SATA1_ACT, "LED SATA1 activity") != 0)
212 goto err_free_1;
213 if (gpio_direction_output(D2NET_GPIO_SATA1_ACT, 1) != 0)
214 goto err_free_2;
215 platform_device_register(&d2net_gpio_leds);
216 return;
217
218err_free_2:
219 gpio_free(D2NET_GPIO_SATA1_ACT);
220err_free_1:
221 gpio_free(D2NET_GPIO_SATA0_ACT);
222 return;
223}
224
225/****************************************************************************
226 * GPIO keys
227 ****************************************************************************/
228
229#define D2NET_GPIO_PUSH_BUTTON 18
230#define D2NET_GPIO_POWER_SWITCH_ON 8
231#define D2NET_GPIO_POWER_SWITCH_OFF 9
232
233#define D2NET_SWITCH_POWER_ON 0x1
234#define D2NET_SWITCH_POWER_OFF 0x2
235
236static struct gpio_keys_button d2net_buttons[] = {
237 {
238 .type = EV_SW,
239 .code = D2NET_SWITCH_POWER_OFF,
240 .gpio = D2NET_GPIO_POWER_SWITCH_OFF,
241 .desc = "Power rocker switch (auto|off)",
242 .active_low = 0,
243 },
244 {
245 .type = EV_SW,
246 .code = D2NET_SWITCH_POWER_ON,
247 .gpio = D2NET_GPIO_POWER_SWITCH_ON,
248 .desc = "Power rocker switch (on|auto)",
249 .active_low = 0,
250 },
251 {
252 .type = EV_KEY,
253 .code = KEY_POWER,
254 .gpio = D2NET_GPIO_PUSH_BUTTON,
255 .desc = "Front Push Button",
256 .active_low = 0,
257 },
258};
259
260static struct gpio_keys_platform_data d2net_button_data = {
261 .buttons = d2net_buttons,
262 .nbuttons = ARRAY_SIZE(d2net_buttons),
263};
264
265static struct platform_device d2net_gpio_buttons = {
266 .name = "gpio-keys",
267 .id = -1,
268 .dev = {
269 .platform_data = &d2net_button_data,
270 },
271};
272
273/*****************************************************************************
274 * General Setup
275 ****************************************************************************/
276
277static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = {
278 { 0, MPP_GPIO }, /* Board ID (bit 0) */
279 { 1, MPP_GPIO }, /* Board ID (bit 1) */
280 { 2, MPP_GPIO }, /* Board ID (bit 2) */
281 { 3, MPP_GPIO }, /* SATA 0 power */
282 { 4, MPP_UNUSED },
283 { 5, MPP_GPIO }, /* Fan fail detection */
284 { 6, MPP_GPIO }, /* Red front LED */
285 { 7, MPP_UNUSED },
286 { 8, MPP_GPIO }, /* Rear power switch (on|auto) */
287 { 9, MPP_GPIO }, /* Rear power switch (auto|off) */
288 { 10, MPP_UNUSED },
289 { 11, MPP_UNUSED },
290 { 12, MPP_GPIO }, /* SATA 1 power */
291 { 13, MPP_UNUSED },
292 { 14, MPP_GPIO }, /* SATA 0 active */
293 { 15, MPP_GPIO }, /* SATA 1 active */
294 { 16, MPP_GPIO }, /* Blue front LED blink control */
295 { 17, MPP_UNUSED },
296 { 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */
297 { 19, MPP_UNUSED },
298 { -1 }
299 /* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
300 /* 23: Blue front LED off */
301 /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */
302};
303
304static void __init d2net_init(void)
305{
306 /*
307 * Setup basic Orion functions. Need to be called early.
308 */
309 orion5x_init();
310
311 orion5x_mpp_conf(d2net_mpp_modes);
312
313 /*
314 * Configure peripherals.
315 */
316 orion5x_ehci0_init();
317 orion5x_eth_init(&d2net_eth_data);
318 orion5x_i2c_init();
319 orion5x_uart0_init();
320
321 d2net_sata_power_init();
322 orion5x_sata_init(&d2net_sata_data);
323
324 orion5x_setup_dev_boot_win(D2NET_NOR_BOOT_BASE,
325 D2NET_NOR_BOOT_SIZE);
326 platform_device_register(&d2net_nor_flash);
327
328 platform_device_register(&d2net_gpio_buttons);
329
330 d2net_gpio_leds_init();
331
332 pr_notice("d2net: Flash write are not yet supported.\n");
333
334 i2c_register_board_info(0, d2net_i2c_devices,
335 ARRAY_SIZE(d2net_i2c_devices));
336}
337
338/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */
339
340#ifdef CONFIG_MACH_D2NET
341MACHINE_START(D2NET, "LaCie d2 Network")
342 .phys_io = ORION5X_REGS_PHYS_BASE,
343 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
344 .boot_params = 0x00000100,
345 .init_machine = d2net_init,
346 .map_io = orion5x_map_io,
347 .init_irq = orion5x_init_irq,
348 .timer = &orion5x_timer,
349 .fixup = tag_fixup_mem32,
350MACHINE_END
351#endif
352
353#ifdef CONFIG_MACH_BIGDISK
354MACHINE_START(BIGDISK, "LaCie Big Disk Network")
355 .phys_io = ORION5X_REGS_PHYS_BASE,
356 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
357 .boot_params = 0x00000100,
358 .init_machine = d2net_init,
359 .map_io = orion5x_map_io,
360 .init_irq = orion5x_init_irq,
361 .timer = &orion5x_timer,
362 .fixup = tag_fixup_mem32,
363MACHINE_END
364#endif
365
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
new file mode 100644
index 000000000000..7bd6283476f9
--- /dev/null
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -0,0 +1,431 @@
1/*
2 * arch/arm/mach-orion5x/net2big-setup.c
3 *
4 * LaCie 2Big Network NAS setup
5 *
6 * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mv643xx_eth.h>
18#include <linux/leds.h>
19#include <linux/gpio_keys.h>
20#include <linux/input.h>
21#include <linux/i2c.h>
22#include <linux/ata_platform.h>
23#include <linux/gpio.h>
24#include <linux/delay.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <mach/orion5x.h>
28#include "common.h"
29#include "mpp.h"
30
31/*****************************************************************************
32 * LaCie 2Big Network Info
33 ****************************************************************************/
34
35/*
36 * 512KB NOR flash Device bus boot chip select
37 */
38
39#define NET2BIG_NOR_BOOT_BASE 0xfff80000
40#define NET2BIG_NOR_BOOT_SIZE SZ_512K
41
42/*****************************************************************************
43 * 512KB NOR Flash on Boot Device
44 ****************************************************************************/
45
46/*
47 * TODO: Check write support on flash MX29LV400CBTC-70G
48 */
49
50static struct mtd_partition net2big_partitions[] = {
51 {
52 .name = "Full512kb",
53 .size = MTDPART_SIZ_FULL,
54 .offset = 0x00000000,
55 .mask_flags = MTD_WRITEABLE,
56 },
57};
58
59static struct physmap_flash_data net2big_nor_flash_data = {
60 .width = 1,
61 .parts = net2big_partitions,
62 .nr_parts = ARRAY_SIZE(net2big_partitions),
63};
64
65static struct resource net2big_nor_flash_resource = {
66 .flags = IORESOURCE_MEM,
67 .start = NET2BIG_NOR_BOOT_BASE,
68 .end = NET2BIG_NOR_BOOT_BASE
69 + NET2BIG_NOR_BOOT_SIZE - 1,
70};
71
72static struct platform_device net2big_nor_flash = {
73 .name = "physmap-flash",
74 .id = 0,
75 .dev = {
76 .platform_data = &net2big_nor_flash_data,
77 },
78 .num_resources = 1,
79 .resource = &net2big_nor_flash_resource,
80};
81
82/*****************************************************************************
83 * Ethernet
84 ****************************************************************************/
85
86static struct mv643xx_eth_platform_data net2big_eth_data = {
87 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
88};
89
90/*****************************************************************************
91 * I2C devices
92 ****************************************************************************/
93
94/*
95 * i2c addr | chip | description
96 * 0x32 | Ricoh 5C372b | RTC
97 * 0x50 | HT24LC08 | eeprom (1kB)
98 */
99static struct i2c_board_info __initdata net2big_i2c_devices[] = {
100 {
101 I2C_BOARD_INFO("rs5c372b", 0x32),
102 }, {
103 I2C_BOARD_INFO("24c08", 0x50),
104 },
105};
106
107/*****************************************************************************
108 * SATA
109 ****************************************************************************/
110
111static struct mv_sata_platform_data net2big_sata_data = {
112 .n_ports = 2,
113};
114
115#define NET2BIG_GPIO_SATA_POWER_REQ 19
116#define NET2BIG_GPIO_SATA0_POWER 23
117#define NET2BIG_GPIO_SATA1_POWER 25
118
119static void __init net2big_sata_power_init(void)
120{
121 int err;
122
123 /* Configure GPIOs over MPP max number. */
124 orion_gpio_set_valid(NET2BIG_GPIO_SATA0_POWER, 1);
125 orion_gpio_set_valid(NET2BIG_GPIO_SATA1_POWER, 1);
126
127 err = gpio_request(NET2BIG_GPIO_SATA0_POWER, "SATA0 power status");
128 if (err == 0) {
129 err = gpio_direction_input(NET2BIG_GPIO_SATA0_POWER);
130 if (err)
131 gpio_free(NET2BIG_GPIO_SATA0_POWER);
132 }
133 if (err) {
134 pr_err("net2big: failed to setup SATA0 power GPIO\n");
135 return;
136 }
137
138 err = gpio_request(NET2BIG_GPIO_SATA1_POWER, "SATA1 power status");
139 if (err == 0) {
140 err = gpio_direction_input(NET2BIG_GPIO_SATA1_POWER);
141 if (err)
142 gpio_free(NET2BIG_GPIO_SATA1_POWER);
143 }
144 if (err) {
145 pr_err("net2big: failed to setup SATA1 power GPIO\n");
146 goto err_free_1;
147 }
148
149 err = gpio_request(NET2BIG_GPIO_SATA_POWER_REQ, "SATA power request");
150 if (err == 0) {
151 err = gpio_direction_output(NET2BIG_GPIO_SATA_POWER_REQ, 0);
152 if (err)
153 gpio_free(NET2BIG_GPIO_SATA_POWER_REQ);
154 }
155 if (err) {
156 pr_err("net2big: failed to setup SATA power request GPIO\n");
157 goto err_free_2;
158 }
159
160 if (gpio_get_value(NET2BIG_GPIO_SATA0_POWER) &&
161 gpio_get_value(NET2BIG_GPIO_SATA1_POWER)) {
162 return;
163 }
164
165 /*
166 * SATA power up on both disk is done by pulling high the CPLD power
167 * request line. The 300ms delay is related to the CPLD clock and is
168 * needed to be sure that the CPLD has take into account the low line
169 * status.
170 */
171 msleep(300);
172 gpio_set_value(NET2BIG_GPIO_SATA_POWER_REQ, 1);
173 pr_info("net2big: power up SATA hard disks\n");
174
175 return;
176
177err_free_2:
178 gpio_free(NET2BIG_GPIO_SATA1_POWER);
179err_free_1:
180 gpio_free(NET2BIG_GPIO_SATA0_POWER);
181
182 return;
183}
184
185/*****************************************************************************
186 * GPIO LEDs
187 ****************************************************************************/
188
189/*
190 * The power front LEDs (blue and red) and SATA red LEDs are controlled via a
191 * single GPIO line and are compatible with the leds-gpio driver.
192 *
193 * The SATA blue LEDs have some hardware blink capabilities which are detailled
194 * in the following array:
195 *
196 * SATAx blue LED | SATAx activity | LED state
197 * | |
198 * 0 | 0 | blink (rate 300ms)
199 * 1 | 0 | off
200 * ? | 1 | on
201 *
202 * Notes: The blue and the red front LED's can't be on at the same time.
203 * Blue LED have priority.
204 */
205
206#define NET2BIG_GPIO_PWR_RED_LED 6
207#define NET2BIG_GPIO_PWR_BLUE_LED 16
208#define NET2BIG_GPIO_PWR_LED_BLINK_STOP 7
209
210#define NET2BIG_GPIO_SATA0_RED_LED 11
211#define NET2BIG_GPIO_SATA1_RED_LED 10
212
213#define NET2BIG_GPIO_SATA0_BLUE_LED 17
214#define NET2BIG_GPIO_SATA1_BLUE_LED 13
215
216static struct gpio_led net2big_leds[] = {
217 {
218 .name = "net2big:red:power",
219 .gpio = NET2BIG_GPIO_PWR_RED_LED,
220 },
221 {
222 .name = "net2big:blue:power",
223 .gpio = NET2BIG_GPIO_PWR_BLUE_LED,
224 },
225 {
226 .name = "net2big:red:sata0",
227 .gpio = NET2BIG_GPIO_SATA0_RED_LED,
228 },
229 {
230 .name = "net2big:red:sata1",
231 .gpio = NET2BIG_GPIO_SATA1_RED_LED,
232 },
233};
234
235static struct gpio_led_platform_data net2big_led_data = {
236 .num_leds = ARRAY_SIZE(net2big_leds),
237 .leds = net2big_leds,
238};
239
240static struct platform_device net2big_gpio_leds = {
241 .name = "leds-gpio",
242 .id = -1,
243 .dev = {
244 .platform_data = &net2big_led_data,
245 },
246};
247
248static void __init net2big_gpio_leds_init(void)
249{
250 int err;
251
252 /* Stop initial CPLD slow red/blue blinking on power LED. */
253 err = gpio_request(NET2BIG_GPIO_PWR_LED_BLINK_STOP,
254 "Power LED blink stop");
255 if (err == 0) {
256 err = gpio_direction_output(NET2BIG_GPIO_PWR_LED_BLINK_STOP, 1);
257 if (err)
258 gpio_free(NET2BIG_GPIO_PWR_LED_BLINK_STOP);
259 }
260 if (err)
261 pr_err("net2big: failed to setup power LED blink GPIO\n");
262
263 /*
264 * Configure SATA0 and SATA1 blue LEDs to blink in relation with the
265 * hard disk activity.
266 */
267 err = gpio_request(NET2BIG_GPIO_SATA0_BLUE_LED,
268 "SATA0 blue LED control");
269 if (err == 0) {
270 err = gpio_direction_output(NET2BIG_GPIO_SATA0_BLUE_LED, 1);
271 if (err)
272 gpio_free(NET2BIG_GPIO_SATA0_BLUE_LED);
273 }
274 if (err)
275 pr_err("net2big: failed to setup SATA0 blue LED GPIO\n");
276
277 err = gpio_request(NET2BIG_GPIO_SATA1_BLUE_LED,
278 "SATA1 blue LED control");
279 if (err == 0) {
280 err = gpio_direction_output(NET2BIG_GPIO_SATA1_BLUE_LED, 1);
281 if (err)
282 gpio_free(NET2BIG_GPIO_SATA1_BLUE_LED);
283 }
284 if (err)
285 pr_err("net2big: failed to setup SATA1 blue LED GPIO\n");
286
287 platform_device_register(&net2big_gpio_leds);
288}
289
290/****************************************************************************
291 * GPIO keys
292 ****************************************************************************/
293
294#define NET2BIG_GPIO_PUSH_BUTTON 18
295#define NET2BIG_GPIO_POWER_SWITCH_ON 8
296#define NET2BIG_GPIO_POWER_SWITCH_OFF 9
297
298#define NET2BIG_SWITCH_POWER_ON 0x1
299#define NET2BIG_SWITCH_POWER_OFF 0x2
300
301static struct gpio_keys_button net2big_buttons[] = {
302 {
303 .type = EV_SW,
304 .code = NET2BIG_SWITCH_POWER_OFF,
305 .gpio = NET2BIG_GPIO_POWER_SWITCH_OFF,
306 .desc = "Power rocker switch (auto|off)",
307 .active_low = 0,
308 },
309 {
310 .type = EV_SW,
311 .code = NET2BIG_SWITCH_POWER_ON,
312 .gpio = NET2BIG_GPIO_POWER_SWITCH_ON,
313 .desc = "Power rocker switch (on|auto)",
314 .active_low = 0,
315 },
316 {
317 .type = EV_KEY,
318 .code = KEY_POWER,
319 .gpio = NET2BIG_GPIO_PUSH_BUTTON,
320 .desc = "Front Push Button",
321 .active_low = 0,
322 },
323};
324
325static struct gpio_keys_platform_data net2big_button_data = {
326 .buttons = net2big_buttons,
327 .nbuttons = ARRAY_SIZE(net2big_buttons),
328};
329
330static struct platform_device net2big_gpio_buttons = {
331 .name = "gpio-keys",
332 .id = -1,
333 .dev = {
334 .platform_data = &net2big_button_data,
335 },
336};
337
338/*****************************************************************************
339 * General Setup
340 ****************************************************************************/
341
342static struct orion5x_mpp_mode net2big_mpp_modes[] __initdata = {
343 { 0, MPP_GPIO }, /* Raid mode (bit 0) */
344 { 1, MPP_GPIO }, /* USB port 2 fuse (0 = Fail, 1 = Ok) */
345 { 2, MPP_GPIO }, /* Raid mode (bit 1) */
346 { 3, MPP_GPIO }, /* Board ID (bit 0) */
347 { 4, MPP_GPIO }, /* Fan activity (0 = Off, 1 = On) */
348 { 5, MPP_GPIO }, /* Fan fail detection */
349 { 6, MPP_GPIO }, /* Red front LED (0 = Off, 1 = On) */
350 { 7, MPP_GPIO }, /* Disable initial blinking on front LED */
351 { 8, MPP_GPIO }, /* Rear power switch (on|auto) */
352 { 9, MPP_GPIO }, /* Rear power switch (auto|off) */
353 { 10, MPP_GPIO }, /* SATA 1 red LED (0 = Off, 1 = On) */
354 { 11, MPP_GPIO }, /* SATA 0 red LED (0 = Off, 1 = On) */
355 { 12, MPP_GPIO }, /* Board ID (bit 1) */
356 { 13, MPP_GPIO }, /* SATA 1 blue LED blink control */
357 { 14, MPP_SATA_LED },
358 { 15, MPP_SATA_LED },
359 { 16, MPP_GPIO }, /* Blue front LED control */
360 { 17, MPP_GPIO }, /* SATA 0 blue LED blink control */
361 { 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */
362 { 19, MPP_GPIO }, /* SATA{0,1} power On/Off request */
363 { -1 }
364 /* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */
365 /* 23: SATA 0 power status */
366 /* 24: Board power off */
367 /* 25: SATA 1 power status */
368};
369
370#define NET2BIG_GPIO_POWER_OFF 24
371
372static void net2big_power_off(void)
373{
374 gpio_set_value(NET2BIG_GPIO_POWER_OFF, 1);
375}
376
377static void __init net2big_init(void)
378{
379 /*
380 * Setup basic Orion functions. Need to be called early.
381 */
382 orion5x_init();
383
384 orion5x_mpp_conf(net2big_mpp_modes);
385
386 /*
387 * Configure peripherals.
388 */
389 orion5x_ehci0_init();
390 orion5x_ehci1_init();
391 orion5x_eth_init(&net2big_eth_data);
392 orion5x_i2c_init();
393 orion5x_uart0_init();
394 orion5x_xor_init();
395
396 net2big_sata_power_init();
397 orion5x_sata_init(&net2big_sata_data);
398
399 orion5x_setup_dev_boot_win(NET2BIG_NOR_BOOT_BASE,
400 NET2BIG_NOR_BOOT_SIZE);
401 platform_device_register(&net2big_nor_flash);
402
403 platform_device_register(&net2big_gpio_buttons);
404 net2big_gpio_leds_init();
405
406 i2c_register_board_info(0, net2big_i2c_devices,
407 ARRAY_SIZE(net2big_i2c_devices));
408
409 orion_gpio_set_valid(NET2BIG_GPIO_POWER_OFF, 1);
410
411 if (gpio_request(NET2BIG_GPIO_POWER_OFF, "power-off") == 0 &&
412 gpio_direction_output(NET2BIG_GPIO_POWER_OFF, 0) == 0)
413 pm_power_off = net2big_power_off;
414 else
415 pr_err("net2big: failed to configure power-off GPIO\n");
416
417 pr_notice("net2big: Flash writing is not yet supported.\n");
418}
419
420/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */
421MACHINE_START(NET2BIG, "LaCie 2Big Network")
422 .phys_io = ORION5X_REGS_PHYS_BASE,
423 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
424 .boot_params = 0x00000100,
425 .init_machine = net2big_init,
426 .map_io = orion5x_map_io,
427 .init_irq = orion5x_init_irq,
428 .timer = &orion5x_timer,
429 .fixup = tag_fixup_mem32,
430MACHINE_END
431
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa300.h b/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
index ae8441192ef0..7139e0dc26d1 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
@@ -567,9 +567,9 @@
567#define GPIO37_ULPI_DATA_OUT_7 MFP_CFG(GPIO37, AF3) 567#define GPIO37_ULPI_DATA_OUT_7 MFP_CFG(GPIO37, AF3)
568#define GPIO33_ULPI_OTG_INTR MFP_CFG(GPIO33, AF1) 568#define GPIO33_ULPI_OTG_INTR MFP_CFG(GPIO33, AF1)
569 569
570#define ULPI_DIR MFP_CFG_DRV(ULPI_DIR, MFP_AF0, MFP_DS01X) 570#define ULPI_DIR MFP_CFG_DRV(ULPI_DIR, AF0, DS01X)
571#define ULPI_NXT MFP_CFG_DRV(ULPI_NXT, MFP_AF0, MFP_DS01X) 571#define ULPI_NXT MFP_CFG_DRV(ULPI_NXT, AF0, DS01X)
572#define ULPI_STP MFP_CFG_DRV(ULPI_STP, MFP_AF0, MFP_DS01X) 572#define ULPI_STP MFP_CFG_DRV(ULPI_STP, AF0, DS01X)
573#endif /* CONFIG_CPU_PXA310 */ 573#endif /* CONFIG_CPU_PXA310 */
574 574
575#endif /* __ASM_ARCH_MFP_PXA300_H */ 575#endif /* __ASM_ARCH_MFP_PXA300_H */
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 6f678d93bf4e..09b7b1a10cad 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -250,7 +250,7 @@ static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
250static struct clk_lookup pxa3xx_clkregs[] = { 250static struct clk_lookup pxa3xx_clkregs[] = {
251 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), 251 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
252 /* Power I2C clock is always on */ 252 /* Power I2C clock is always on */
253 INIT_CLKREG(&clk_dummy, "pxa2xx-i2c.1", NULL), 253 INIT_CLKREG(&clk_dummy, "pxa3xx-pwri2c.1", NULL),
254 INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL), 254 INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL),
255 INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"), 255 INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"),
256 INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"), 256 INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"),
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index d4cfa2145386..dfc9b0bc6eb2 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -75,7 +75,7 @@ config MACH_REALVIEW_PBX
75 75
76config REALVIEW_HIGH_PHYS_OFFSET 76config REALVIEW_HIGH_PHYS_OFFSET
77 bool "High physical base address for the RealView platform" 77 bool "High physical base address for the RealView platform"
78 depends on !MACH_REALVIEW_PB1176 78 depends on MMU && !MACH_REALVIEW_PB1176
79 default y 79 default y
80 help 80 help
81 RealView boards other than PB1176 have the RAM available at 81 RealView boards other than PB1176 have the RAM available at
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index ab615e78b798..dc3519c50ab2 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -208,8 +208,7 @@ struct platform_device realview_i2c_device = {
208 208
209static struct i2c_board_info realview_i2c_board_info[] = { 209static struct i2c_board_info realview_i2c_board_info[] = {
210 { 210 {
211 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), 211 I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
212 .type = "ds1338",
213 }, 212 },
214}; 213};
215 214
diff --git a/arch/arm/mach-realview/include/mach/hardware.h b/arch/arm/mach-realview/include/mach/hardware.h
index b42c14f89acb..8a638d15797f 100644
--- a/arch/arm/mach-realview/include/mach/hardware.h
+++ b/arch/arm/mach-realview/include/mach/hardware.h
@@ -25,6 +25,7 @@
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26 26
27/* macro to get at IO space when running virtually */ 27/* macro to get at IO space when running virtually */
28#ifdef CONFIG_MMU
28/* 29/*
29 * Statically mapped addresses: 30 * Statically mapped addresses:
30 * 31 *
@@ -33,6 +34,9 @@
33 * 1fxx xxxx -> fexx xxxx 34 * 1fxx xxxx -> fexx xxxx
34 */ 35 */
35#define IO_ADDRESS(x) (((x) & 0x03ffffff) + 0xfb000000) 36#define IO_ADDRESS(x) (((x) & 0x03ffffff) + 0xfb000000)
37#else
38#define IO_ADDRESS(x) (x)
39#endif
36#define __io_address(n) __io(IO_ADDRESS(n)) 40#define __io_address(n) __io(IO_ADDRESS(n))
37 41
38#endif 42#endif
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index ac0e83f1cc3a..a88458b4799d 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -20,6 +20,7 @@
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/localtimer.h> 22#include <asm/localtimer.h>
23#include <asm/unified.h>
23 24
24#include <mach/board-eb.h> 25#include <mach/board-eb.h>
25#include <mach/board-pb11mp.h> 26#include <mach/board-pb11mp.h>
@@ -137,26 +138,19 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
137 138
138static void __init poke_milo(void) 139static void __init poke_milo(void)
139{ 140{
140 extern void secondary_startup(void);
141
142 /* nobody is to be released from the pen yet */ 141 /* nobody is to be released from the pen yet */
143 pen_release = -1; 142 pen_release = -1;
144 143
145 /* 144 /*
146 * write the address of secondary startup into the system-wide 145 * Write the address of secondary startup into the system-wide flags
147 * flags register, then clear the bottom two bits, which is what 146 * register. The BootMonitor waits for this register to become
148 * BootMonitor is waiting for 147 * non-zero.
149 */ 148 */
150#if 1
151#define REALVIEW_SYS_FLAGSS_OFFSET 0x30 149#define REALVIEW_SYS_FLAGSS_OFFSET 0x30
152 __raw_writel(virt_to_phys(realview_secondary_startup),
153 __io_address(REALVIEW_SYS_BASE) +
154 REALVIEW_SYS_FLAGSS_OFFSET);
155#define REALVIEW_SYS_FLAGSC_OFFSET 0x34 150#define REALVIEW_SYS_FLAGSC_OFFSET 0x34
156 __raw_writel(3, 151 __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)),
157 __io_address(REALVIEW_SYS_BASE) + 152 __io_address(REALVIEW_SYS_BASE) +
158 REALVIEW_SYS_FLAGSC_OFFSET); 153 REALVIEW_SYS_FLAGSS_OFFSET);
159#endif
160 154
161 mb(); 155 mb();
162} 156}
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 41bb65d5b91f..d8c023d4df30 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -12,6 +12,7 @@ config CPU_S3C2410
12 select S3C2410_GPIO 12 select S3C2410_GPIO
13 select CPU_LLSERIAL_S3C2410 13 select CPU_LLSERIAL_S3C2410
14 select S3C2410_PM if PM 14 select S3C2410_PM if PM
15 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
15 help 16 help
16 Support for S3C2410 and S3C2410A family from the S3C24XX line 17 Support for S3C2410 and S3C2410A family from the S3C24XX line
17 of Samsung Mobile CPUs. 18 of Samsung Mobile CPUs.
@@ -45,6 +46,22 @@ config MACH_BAST_IDE
45 Internal node for machines with an BAST style IDE 46 Internal node for machines with an BAST style IDE
46 interface 47 interface
47 48
49# cpu frequency scaling support
50
51config S3C2410_CPUFREQ
52 bool
53 depends on CPU_FREQ_S3C24XX && CPU_S3C2410
54 select S3C2410_CPUFREQ_UTILS
55 help
56 CPU Frequency scaling support for S3C2410
57
58config S3C2410_PLLTABLE
59 bool
60 depends on S3C2410_CPUFREQ && CPU_FREQ_S3C24XX_PLL
61 default y
62 help
63 Select the PLL table for the S3C2410
64
48menu "S3C2410 Machines" 65menu "S3C2410 Machines"
49 66
50config ARCH_SMDK2410 67config ARCH_SMDK2410
@@ -79,6 +96,7 @@ config MACH_N30
79config ARCH_BAST 96config ARCH_BAST
80 bool "Simtec Electronics BAST (EB2410ITX)" 97 bool "Simtec Electronics BAST (EB2410ITX)"
81 select CPU_S3C2410 98 select CPU_S3C2410
99 select S3C2410_IOTIMING if S3C2410_CPUFREQ
82 select PM_SIMTEC if PM 100 select PM_SIMTEC if PM
83 select SIMTEC_NOR 101 select SIMTEC_NOR
84 select MACH_BAST_IDE 102 select MACH_BAST_IDE
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index fca02f82711c..2ab5ba4b266f 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o
15obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o 15obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o
16obj-$(CONFIG_S3C2410_PM) += pm.o sleep.o 16obj-$(CONFIG_S3C2410_PM) += pm.o sleep.o
17obj-$(CONFIG_S3C2410_GPIO) += gpio.o 17obj-$(CONFIG_S3C2410_GPIO) += gpio.o
18obj-$(CONFIG_S3C2410_CPUFREQ) += cpu-freq.o
19obj-$(CONFIG_S3C2410_PLLTABLE) += pll.o
18 20
19# Machine support 21# Machine support
20 22
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c2410/cpu-freq.c
new file mode 100644
index 000000000000..9d1186877d08
--- /dev/null
+++ b/arch/arm/mach-s3c2410/cpu-freq.c
@@ -0,0 +1,159 @@
1/* linux/arch/arm/mach-s3c2410/cpu-freq.c
2 *
3 * Copyright (c) 2006,2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2410 CPU Frequency scaling
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/cpufreq.h>
19#include <linux/sysdev.h>
20#include <linux/clk.h>
21#include <linux/err.h>
22#include <linux/io.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26
27#include <mach/regs-clock.h>
28
29#include <plat/cpu.h>
30#include <plat/clock.h>
31#include <plat/cpu-freq-core.h>
32
33/* Note, 2410A has an extra mode for 1:4:4 ratio, bit 2 of CLKDIV */
34
35static void s3c2410_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
36{
37 u32 clkdiv = 0;
38
39 if (cfg->divs.h_divisor == 2)
40 clkdiv |= S3C2410_CLKDIVN_HDIVN;
41
42 if (cfg->divs.p_divisor != cfg->divs.h_divisor)
43 clkdiv |= S3C2410_CLKDIVN_PDIVN;
44
45 __raw_writel(clkdiv, S3C2410_CLKDIVN);
46}
47
48static int s3c2410_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
49{
50 unsigned long hclk, fclk, pclk;
51 unsigned int hdiv, pdiv;
52 unsigned long hclk_max;
53
54 fclk = cfg->freq.fclk;
55 hclk_max = cfg->max.hclk;
56
57 cfg->freq.armclk = fclk;
58
59 s3c_freq_dbg("%s: fclk is %lu, max hclk %lu\n",
60 __func__, fclk, hclk_max);
61
62 hdiv = (fclk > cfg->max.hclk) ? 2 : 1;
63 hclk = fclk / hdiv;
64
65 if (hclk > cfg->max.hclk) {
66 s3c_freq_dbg("%s: hclk too big\n", __func__);
67 return -EINVAL;
68 }
69
70 pdiv = (hclk > cfg->max.pclk) ? 2 : 1;
71 pclk = hclk / pdiv;
72
73 if (pclk > cfg->max.pclk) {
74 s3c_freq_dbg("%s: pclk too big\n", __func__);
75 return -EINVAL;
76 }
77
78 pdiv *= hdiv;
79
80 /* record the result */
81 cfg->divs.p_divisor = pdiv;
82 cfg->divs.h_divisor = hdiv;
83
84 return 0 ;
85}
86
87static struct s3c_cpufreq_info s3c2410_cpufreq_info = {
88 .max = {
89 .fclk = 200000000,
90 .hclk = 100000000,
91 .pclk = 50000000,
92 },
93
94 /* transition latency is about 5ms worst-case, so
95 * set 10ms to be sure */
96 .latency = 10000000,
97
98 .locktime_m = 150,
99 .locktime_u = 150,
100 .locktime_bits = 12,
101
102 .need_pll = 1,
103
104 .name = "s3c2410",
105 .calc_iotiming = s3c2410_iotiming_calc,
106 .set_iotiming = s3c2410_iotiming_set,
107 .get_iotiming = s3c2410_iotiming_get,
108 .resume_clocks = s3c2410_setup_clocks,
109
110 .set_fvco = s3c2410_set_fvco,
111 .set_refresh = s3c2410_cpufreq_setrefresh,
112 .set_divs = s3c2410_cpufreq_setdivs,
113 .calc_divs = s3c2410_cpufreq_calcdivs,
114
115 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
116};
117
118static int s3c2410_cpufreq_add(struct sys_device *sysdev)
119{
120 return s3c_cpufreq_register(&s3c2410_cpufreq_info);
121}
122
123static struct sysdev_driver s3c2410_cpufreq_driver = {
124 .add = s3c2410_cpufreq_add,
125};
126
127static int __init s3c2410_cpufreq_init(void)
128{
129 return sysdev_driver_register(&s3c2410_sysclass,
130 &s3c2410_cpufreq_driver);
131}
132
133arch_initcall(s3c2410_cpufreq_init);
134
135static int s3c2410a_cpufreq_add(struct sys_device *sysdev)
136{
137 /* alter the maximum freq settings for S3C2410A. If a board knows
138 * it only has a maximum of 200, then it should register its own
139 * limits. */
140
141 s3c2410_cpufreq_info.max.fclk = 266000000;
142 s3c2410_cpufreq_info.max.hclk = 133000000;
143 s3c2410_cpufreq_info.max.pclk = 66500000;
144 s3c2410_cpufreq_info.name = "s3c2410a";
145
146 return s3c2410_cpufreq_add(sysdev);
147}
148
149static struct sysdev_driver s3c2410a_cpufreq_driver = {
150 .add = s3c2410a_cpufreq_add,
151};
152
153static int __init s3c2410a_cpufreq_init(void)
154{
155 return sysdev_driver_register(&s3c2410a_sysclass,
156 &s3c2410a_cpufreq_driver);
157}
158
159arch_initcall(s3c2410a_cpufreq_init);
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index dbf96e60d992..63b753f56c64 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -164,6 +164,17 @@ static int __init s3c2410_dma_drvinit(void)
164} 164}
165 165
166arch_initcall(s3c2410_dma_drvinit); 166arch_initcall(s3c2410_dma_drvinit);
167
168static struct sysdev_driver s3c2410a_dma_driver = {
169 .add = s3c2410_dma_add,
170};
171
172static int __init s3c2410a_dma_drvinit(void)
173{
174 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_dma_driver);
175}
176
177arch_initcall(s3c2410a_dma_drvinit);
167#endif 178#endif
168 179
169#if defined(CONFIG_CPU_S3C2442) 180#if defined(CONFIG_CPU_S3C2442)
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
index 8fe192081d3a..f8b879a7973c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-core.h
@@ -28,7 +28,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
28 return NULL; 28 return NULL;
29 29
30 chip = &s3c24xx_gpios[pin/32]; 30 chip = &s3c24xx_gpios[pin/32];
31 return (S3C2410_GPIO_OFFSET(pin) > chip->chip.ngpio) ? chip : NULL; 31 return (S3C2410_GPIO_OFFSET(pin) < chip->chip.ngpio) ? chip : NULL;
32} 32}
33 33
34#endif /* __ASM_ARCH_GPIO_CORE_H */ 34#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
index 2a2384ffa7b1..6c12c6312ad8 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
@@ -164,6 +164,12 @@
164#define IRQ_S3CUART_TX3 IRQ_S3C2443_TX3 164#define IRQ_S3CUART_TX3 IRQ_S3C2443_TX3
165#define IRQ_S3CUART_ERR3 IRQ_S3C2443_ERR3 165#define IRQ_S3CUART_ERR3 IRQ_S3C2443_ERR3
166 166
167#ifdef CONFIG_CPU_S3C2440
168#define IRQ_S3C244x_AC97 IRQ_S3C2440_AC97
169#else
170#define IRQ_S3C244x_AC97 IRQ_S3C2443_AC97
171#endif
172
167/* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */ 173/* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */
168#define FIQ_START IRQ_EINT0 174#define FIQ_START IRQ_EINT0
169 175
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index e99b212cb1ca..b049e61460b6 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -67,6 +67,13 @@
67#define S3C2443_PA_HSMMC (0x4A800000) 67#define S3C2443_PA_HSMMC (0x4A800000)
68#define S3C2443_SZ_HSMMC (256) 68#define S3C2443_SZ_HSMMC (256)
69 69
70/* S3C2412 memory and IO controls */
71#define S3C2412_PA_SSMC (0x4F000000)
72#define S3C2412_VA_SSMC S3C_ADDR_CPU(0x00000000)
73
74#define S3C2412_PA_EBI (0x48800000)
75#define S3C2412_VA_EBI S3C_ADDR_CPU(0x00010000)
76
70/* physical addresses of all the chip-select areas */ 77/* physical addresses of all the chip-select areas */
71 78
72#define S3C2410_CS0 (0x00000000) 79#define S3C2410_CS0 (0x00000000)
@@ -103,5 +110,6 @@
103#define S3C_PA_UART S3C24XX_PA_UART 110#define S3C_PA_UART S3C24XX_PA_UART
104#define S3C_PA_USBHOST S3C2410_PA_USBHOST 111#define S3C_PA_USBHOST S3C2410_PA_USBHOST
105#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 112#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC
113#define S3C_PA_NAND S3C24XX_PA_NAND
106 114
107#endif /* __ASM_ARCH_MAP_H */ 115#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
index b278d0c45ccf..f6e8eec879c8 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
@@ -328,13 +328,15 @@
328 328
329#define S3C2410_GPD8_VD16 (0x02 << 16) 329#define S3C2410_GPD8_VD16 (0x02 << 16)
330#define S3C2400_GPD8_TOUT3 (0x02 << 16) 330#define S3C2400_GPD8_TOUT3 (0x02 << 16)
331#define S3C2440_GPD8_SPIMISO1 (0x03 << 16)
331 332
332#define S3C2410_GPD9_VD17 (0x02 << 18) 333#define S3C2410_GPD9_VD17 (0x02 << 18)
333#define S3C2400_GPD9_TCLK0 (0x02 << 18) 334#define S3C2400_GPD9_TCLK0 (0x02 << 18)
334#define S3C2410_GPD9_MASK (0x03 << 18) 335#define S3C2440_GPD9_SPIMOSI1 (0x03 << 18)
335 336
336#define S3C2410_GPD10_VD18 (0x02 << 20) 337#define S3C2410_GPD10_VD18 (0x02 << 20)
337#define S3C2400_GPD10_nWAIT (0x02 << 20) 338#define S3C2400_GPD10_nWAIT (0x02 << 20)
339#define S3C2440_GPD10_SPICLK1 (0x03 << 20)
338 340
339#define S3C2410_GPD11_VD19 (0x02 << 22) 341#define S3C2410_GPD11_VD19 (0x02 << 22)
340 342
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-mem.h b/arch/arm/mach-s3c2410/include/mach/regs-mem.h
index 57759804e2fa..7f7c52947963 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-mem.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-mem.h
@@ -73,6 +73,16 @@
73#define S3C2410_BWSCON_WS7 (1<<30) 73#define S3C2410_BWSCON_WS7 (1<<30)
74#define S3C2410_BWSCON_ST7 (1<<31) 74#define S3C2410_BWSCON_ST7 (1<<31)
75 75
76/* accesor functions for getting BANK(n) configuration. (n != 0) */
77
78#define S3C2410_BWSCON_GET(_bwscon, _bank) (((_bwscon) >> ((_bank) * 4)) & 0xf)
79
80#define S3C2410_BWSCON_DW8 (0)
81#define S3C2410_BWSCON_DW16 (1)
82#define S3C2410_BWSCON_DW32 (2)
83#define S3C2410_BWSCON_WS (1 << 2)
84#define S3C2410_BWSCON_ST (1 << 3)
85
76/* memory set (rom, ram) */ 86/* memory set (rom, ram) */
77#define S3C2410_BANKCON0 S3C2410_MEMREG(0x0004) 87#define S3C2410_BANKCON0 S3C2410_MEMREG(0x0004)
78#define S3C2410_BANKCON1 S3C2410_MEMREG(0x0008) 88#define S3C2410_BANKCON1 S3C2410_MEMREG(0x0008)
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h
index a4bf27123170..fb6352515090 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h
@@ -14,9 +14,11 @@
14#ifndef __ASM_ARM_REGS_S3C2412_MEM 14#ifndef __ASM_ARM_REGS_S3C2412_MEM
15#define __ASM_ARM_REGS_S3C2412_MEM 15#define __ASM_ARM_REGS_S3C2412_MEM
16 16
17#ifndef S3C2412_MEMREG
18#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x)) 17#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
19#endif 18#define S3C2412_EBIREG(x) (S3C2412_VA_EBI + (x))
19
20#define S3C2412_SSMCREG(x) (S3C2412_VA_SSMC + (x))
21#define S3C2412_SSMC(x, o) (S3C2412_SSMCREG((x * 0x20) + (o)))
20 22
21#define S3C2412_BANKCFG S3C2412_MEMREG(0x00) 23#define S3C2412_BANKCFG S3C2412_MEMREG(0x00)
22#define S3C2412_BANKCON1 S3C2412_MEMREG(0x04) 24#define S3C2412_BANKCON1 S3C2412_MEMREG(0x04)
@@ -26,4 +28,21 @@
26#define S3C2412_REFRESH S3C2412_MEMREG(0x10) 28#define S3C2412_REFRESH S3C2412_MEMREG(0x10)
27#define S3C2412_TIMEOUT S3C2412_MEMREG(0x14) 29#define S3C2412_TIMEOUT S3C2412_MEMREG(0x14)
28 30
31/* EBI control registers */
32
33#define S3C2412_EBI_PR S3C2412_EBIREG(0x00)
34#define S3C2412_EBI_BANKCFG S3C2412_EBIREG(0x04)
35
36/* SSMC control registers */
37
38#define S3C2412_SSMC_BANK(x) S3C2412_SSMC(x, 0x00)
39#define S3C2412_SMIDCYR(x) S3C2412_SSMC(x, 0x00)
40#define S3C2412_SMBWSTRD(x) S3C2412_SSMC(x, 0x04)
41#define S3C2412_SMBWSTWRR(x) S3C2412_SSMC(x, 0x08)
42#define S3C2412_SMBWSTOENR(x) S3C2412_SSMC(x, 0x0C)
43#define S3C2412_SMBWSTWENR(x) S3C2412_SSMC(x, 0x10)
44#define S3C2412_SMBCR(x) S3C2412_SSMC(x, 0x14)
45#define S3C2412_SMBSR(x) S3C2412_SSMC(x, 0x18)
46#define S3C2412_SMBWSTBRDR(x) S3C2412_SSMC(x, 0x1C)
47
29#endif /* __ASM_ARM_REGS_S3C2412_MEM */ 48#endif /* __ASM_ARM_REGS_S3C2412_MEM */
diff --git a/arch/arm/mach-s3c2410/include/mach/spi.h b/arch/arm/mach-s3c2410/include/mach/spi.h
index 1d300fb112b1..193b39d654ed 100644
--- a/arch/arm/mach-s3c2410/include/mach/spi.h
+++ b/arch/arm/mach-s3c2410/include/mach/spi.h
@@ -30,4 +30,7 @@ extern void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi,
30extern void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, 30extern void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi,
31 int enable); 31 int enable);
32 32
33extern void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi,
34 int enable);
35
33#endif /* __ASM_ARCH_SPI_H */ 36#endif /* __ASM_ARCH_SPI_H */
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
index 92150399563b..5e2f35332056 100644
--- a/arch/arm/mach-s3c2410/irq.c
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -39,9 +39,22 @@ static struct sysdev_driver s3c2410_irq_driver = {
39 .resume = s3c24xx_irq_resume, 39 .resume = s3c24xx_irq_resume,
40}; 40};
41 41
42static int s3c2410_irq_init(void) 42static int __init s3c2410_irq_init(void)
43{ 43{
44 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver); 44 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver);
45} 45}
46 46
47arch_initcall(s3c2410_irq_init); 47arch_initcall(s3c2410_irq_init);
48
49static struct sysdev_driver s3c2410a_irq_driver = {
50 .add = s3c2410_irq_add,
51 .suspend = s3c24xx_irq_suspend,
52 .resume = s3c24xx_irq_resume,
53};
54
55static int __init s3c2410a_irq_init(void)
56{
57 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_irq_driver);
58}
59
60arch_initcall(s3c2410a_irq_init);
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index ce3baba2cd7f..647c9adb018f 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -45,6 +45,7 @@
45#include <mach/regs-mem.h> 45#include <mach/regs-mem.h>
46#include <mach/regs-lcd.h> 46#include <mach/regs-lcd.h>
47 47
48#include <plat/hwmon.h>
48#include <plat/nand.h> 49#include <plat/nand.h>
49#include <plat/iic.h> 50#include <plat/iic.h>
50#include <mach/fb.h> 51#include <mach/fb.h>
@@ -59,6 +60,7 @@
59#include <plat/clock.h> 60#include <plat/clock.h>
60#include <plat/devs.h> 61#include <plat/devs.h>
61#include <plat/cpu.h> 62#include <plat/cpu.h>
63#include <plat/cpu-freq.h>
62 64
63#include "usb-simtec.h" 65#include "usb-simtec.h"
64#include "nor-simtec.h" 66#include "nor-simtec.h"
@@ -547,7 +549,35 @@ static struct i2c_board_info bast_i2c_devs[] __initdata = {
547 }, 549 },
548}; 550};
549 551
552static struct s3c_hwmon_pdata bast_hwmon_info = {
553 /* LCD contrast (0-6.6V) */
554 .in[0] = &(struct s3c_hwmon_chcfg) {
555 .name = "lcd-contrast",
556 .mult = 3300,
557 .div = 512,
558 },
559 /* LED current feedback */
560 .in[1] = &(struct s3c_hwmon_chcfg) {
561 .name = "led-feedback",
562 .mult = 3300,
563 .div = 1024,
564 },
565 /* LCD feedback (0-6.6V) */
566 .in[2] = &(struct s3c_hwmon_chcfg) {
567 .name = "lcd-feedback",
568 .mult = 3300,
569 .div = 512,
570 },
571 /* Vcore (1.8-2.0V), Vref 3.3V */
572 .in[3] = &(struct s3c_hwmon_chcfg) {
573 .name = "vcore",
574 .mult = 3300,
575 .div = 1024,
576 },
577};
578
550/* Standard BAST devices */ 579/* Standard BAST devices */
580// cat /sys/devices/platform/s3c24xx-adc/s3c-hwmon/in_0
551 581
552static struct platform_device *bast_devices[] __initdata = { 582static struct platform_device *bast_devices[] __initdata = {
553 &s3c_device_usb, 583 &s3c_device_usb,
@@ -556,6 +586,8 @@ static struct platform_device *bast_devices[] __initdata = {
556 &s3c_device_i2c0, 586 &s3c_device_i2c0,
557 &s3c_device_rtc, 587 &s3c_device_rtc,
558 &s3c_device_nand, 588 &s3c_device_nand,
589 &s3c_device_adc,
590 &s3c_device_hwmon,
559 &bast_device_dm9k, 591 &bast_device_dm9k,
560 &bast_device_asix, 592 &bast_device_asix,
561 &bast_device_axpp, 593 &bast_device_axpp,
@@ -570,6 +602,12 @@ static struct clk *bast_clocks[] __initdata = {
570 &s3c24xx_uclk, 602 &s3c24xx_uclk,
571}; 603};
572 604
605static struct s3c_cpufreq_board __initdata bast_cpufreq = {
606 .refresh = 7800, /* 7.8usec */
607 .auto_io = 1,
608 .need_io = 1,
609};
610
573static void __init bast_map_io(void) 611static void __init bast_map_io(void)
574{ 612{
575 /* initialise the clocks */ 613 /* initialise the clocks */
@@ -588,6 +626,7 @@ static void __init bast_map_io(void)
588 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks)); 626 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
589 627
590 s3c_device_nand.dev.platform_data = &bast_nand_info; 628 s3c_device_nand.dev.platform_data = &bast_nand_info;
629 s3c_device_hwmon.dev.platform_data = &bast_hwmon_info;
591 630
592 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 631 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
593 s3c24xx_init_clocks(0); 632 s3c24xx_init_clocks(0);
@@ -608,6 +647,8 @@ static void __init bast_init(void)
608 647
609 usb_simtec_init(); 648 usb_simtec_init();
610 nor_simtec_init(); 649 nor_simtec_init();
650
651 s3c_cpufreq_setboard(&bast_cpufreq);
611} 652}
612 653
613MACHINE_START(BAST, "Simtec-BAST") 654MACHINE_START(BAST, "Simtec-BAST")
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c2410/pll.c
new file mode 100644
index 000000000000..f178c2fd9d85
--- /dev/null
+++ b/arch/arm/mach-s3c2410/pll.c
@@ -0,0 +1,95 @@
1/* arch/arm/mach-s3c2410/pll.c
2 *
3 * Copyright (c) 2006,2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk>
7 *
8 * S3C2410 CPU PLL tables
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 USA
23*/
24
25#include <linux/types.h>
26#include <linux/kernel.h>
27#include <linux/module.h>
28#include <linux/sysdev.h>
29#include <linux/list.h>
30#include <linux/clk.h>
31#include <linux/err.h>
32
33#include <plat/cpu.h>
34#include <plat/cpu-freq-core.h>
35
36static struct cpufreq_frequency_table pll_vals_12MHz[] = {
37 { .frequency = 34000000, .index = PLLVAL(82, 2, 3), },
38 { .frequency = 45000000, .index = PLLVAL(82, 1, 3), },
39 { .frequency = 51000000, .index = PLLVAL(161, 3, 3), },
40 { .frequency = 48000000, .index = PLLVAL(120, 2, 3), },
41 { .frequency = 56000000, .index = PLLVAL(142, 2, 3), },
42 { .frequency = 68000000, .index = PLLVAL(82, 2, 2), },
43 { .frequency = 79000000, .index = PLLVAL(71, 1, 2), },
44 { .frequency = 85000000, .index = PLLVAL(105, 2, 2), },
45 { .frequency = 90000000, .index = PLLVAL(112, 2, 2), },
46 { .frequency = 101000000, .index = PLLVAL(127, 2, 2), },
47 { .frequency = 113000000, .index = PLLVAL(105, 1, 2), },
48 { .frequency = 118000000, .index = PLLVAL(150, 2, 2), },
49 { .frequency = 124000000, .index = PLLVAL(116, 1, 2), },
50 { .frequency = 135000000, .index = PLLVAL(82, 2, 1), },
51 { .frequency = 147000000, .index = PLLVAL(90, 2, 1), },
52 { .frequency = 152000000, .index = PLLVAL(68, 1, 1), },
53 { .frequency = 158000000, .index = PLLVAL(71, 1, 1), },
54 { .frequency = 170000000, .index = PLLVAL(77, 1, 1), },
55 { .frequency = 180000000, .index = PLLVAL(82, 1, 1), },
56 { .frequency = 186000000, .index = PLLVAL(85, 1, 1), },
57 { .frequency = 192000000, .index = PLLVAL(88, 1, 1), },
58 { .frequency = 203000000, .index = PLLVAL(161, 3, 1), },
59
60 /* 2410A extras */
61
62 { .frequency = 210000000, .index = PLLVAL(132, 2, 1), },
63 { .frequency = 226000000, .index = PLLVAL(105, 1, 1), },
64 { .frequency = 266000000, .index = PLLVAL(125, 1, 1), },
65 { .frequency = 268000000, .index = PLLVAL(126, 1, 1), },
66 { .frequency = 270000000, .index = PLLVAL(127, 1, 1), },
67};
68
69static int s3c2410_plls_add(struct sys_device *dev)
70{
71 return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz));
72}
73
74static struct sysdev_driver s3c2410_plls_drv = {
75 .add = s3c2410_plls_add,
76};
77
78static int __init s3c2410_pll_init(void)
79{
80 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_plls_drv);
81
82}
83
84arch_initcall(s3c2410_pll_init);
85
86static struct sysdev_driver s3c2410a_plls_drv = {
87 .add = s3c2410_plls_add,
88};
89
90static int __init s3c2410a_pll_init(void)
91{
92 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_plls_drv);
93}
94
95arch_initcall(s3c2410a_pll_init);
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index 143e08a599d4..966119c8efee 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -119,6 +119,18 @@ static int __init s3c2410_pm_drvinit(void)
119} 119}
120 120
121arch_initcall(s3c2410_pm_drvinit); 121arch_initcall(s3c2410_pm_drvinit);
122
123static struct sysdev_driver s3c2410a_pm_driver = {
124 .add = s3c2410_pm_add,
125 .resume = s3c2410_pm_resume,
126};
127
128static int __init s3c2410a_pm_drvinit(void)
129{
130 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_pm_driver);
131}
132
133arch_initcall(s3c2410a_pm_drvinit);
122#endif 134#endif
123 135
124#if defined(CONFIG_CPU_S3C2440) 136#if defined(CONFIG_CPU_S3C2440)
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index feb141b1f915..91ba42f688ac 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -105,17 +105,33 @@ void __init_or_cpufreq s3c2410_setup_clocks(void)
105 s3c24xx_setup_clocks(fclk, hclk, pclk); 105 s3c24xx_setup_clocks(fclk, hclk, pclk);
106} 106}
107 107
108/* fake ARMCLK for use with cpufreq, etc. */
109
110static struct clk s3c2410_armclk = {
111 .name = "armclk",
112 .parent = &clk_f,
113 .id = -1,
114};
115
108void __init s3c2410_init_clocks(int xtal) 116void __init s3c2410_init_clocks(int xtal)
109{ 117{
110 s3c24xx_register_baseclocks(xtal); 118 s3c24xx_register_baseclocks(xtal);
111 s3c2410_setup_clocks(); 119 s3c2410_setup_clocks();
112 s3c2410_baseclk_add(); 120 s3c2410_baseclk_add();
121 s3c24xx_register_clock(&s3c2410_armclk);
113} 122}
114 123
115struct sysdev_class s3c2410_sysclass = { 124struct sysdev_class s3c2410_sysclass = {
116 .name = "s3c2410-core", 125 .name = "s3c2410-core",
117}; 126};
118 127
128/* Note, we would have liked to name this s3c2410-core, but we cannot
129 * register two sysdev_class with the same name.
130 */
131struct sysdev_class s3c2410a_sysclass = {
132 .name = "s3c2410a-core",
133};
134
119static struct sys_device s3c2410_sysdev = { 135static struct sys_device s3c2410_sysdev = {
120 .cls = &s3c2410_sysclass, 136 .cls = &s3c2410_sysclass,
121}; 137};
@@ -133,9 +149,22 @@ static int __init s3c2410_core_init(void)
133 149
134core_initcall(s3c2410_core_init); 150core_initcall(s3c2410_core_init);
135 151
152static int __init s3c2410a_core_init(void)
153{
154 return sysdev_class_register(&s3c2410a_sysclass);
155}
156
157core_initcall(s3c2410a_core_init);
158
136int __init s3c2410_init(void) 159int __init s3c2410_init(void)
137{ 160{
138 printk("S3C2410: Initialising architecture\n"); 161 printk("S3C2410: Initialising architecture\n");
139 162
140 return sysdev_register(&s3c2410_sysdev); 163 return sysdev_register(&s3c2410_sysdev);
141} 164}
165
166int __init s3c2410a_init(void)
167{
168 s3c2410_sysdev.cls = &s3c2410a_sysclass;
169 return s3c2410_init();
170}
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index 63586ffd0ae7..35c1bde89cf2 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -32,6 +32,15 @@ config S3C2412_PM
32 help 32 help
33 Internal config node to apply S3C2412 power management 33 Internal config node to apply S3C2412 power management
34 34
35# Note, the S3C2412 IOtiming support is in plat-s3c24xx
36
37config S3C2412_CPUFREQ
38 bool
39 depends on CPU_FREQ_S3C24XX && CPU_S3C2412
40 select S3C2412_IOTIMING
41 default y
42 help
43 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
35 44
36menu "S3C2412 Machines" 45menu "S3C2412 Machines"
37 46
diff --git a/arch/arm/mach-s3c2412/Makefile b/arch/arm/mach-s3c2412/Makefile
index 20918d5dc6a9..530ec46cbaea 100644
--- a/arch/arm/mach-s3c2412/Makefile
+++ b/arch/arm/mach-s3c2412/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_CPU_S3C2412) += clock.o
15obj-$(CONFIG_CPU_S3C2412) += gpio.o 15obj-$(CONFIG_CPU_S3C2412) += gpio.o
16obj-$(CONFIG_S3C2412_DMA) += dma.o 16obj-$(CONFIG_S3C2412_DMA) += dma.o
17obj-$(CONFIG_S3C2412_PM) += pm.o sleep.o 17obj-$(CONFIG_S3C2412_PM) += pm.o sleep.o
18obj-$(CONFIG_S3C2412_CPUFREQ) += cpu-freq.o
18 19
19# Machine support 20# Machine support
20 21
diff --git a/arch/arm/mach-s3c2412/cpu-freq.c b/arch/arm/mach-s3c2412/cpu-freq.c
new file mode 100644
index 000000000000..eb3ea1721335
--- /dev/null
+++ b/arch/arm/mach-s3c2412/cpu-freq.c
@@ -0,0 +1,257 @@
1/* linux/arch/arm/mach-s3c2412/cpu-freq.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2412 CPU Frequency scalling
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/cpufreq.h>
19#include <linux/sysdev.h>
20#include <linux/delay.h>
21#include <linux/clk.h>
22#include <linux/err.h>
23#include <linux/io.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27
28#include <mach/regs-clock.h>
29#include <mach/regs-s3c2412-mem.h>
30
31#include <plat/cpu.h>
32#include <plat/clock.h>
33#include <plat/cpu-freq-core.h>
34
35/* our clock resources. */
36static struct clk *xtal;
37static struct clk *fclk;
38static struct clk *hclk;
39static struct clk *armclk;
40
41/* HDIV: 1, 2, 3, 4, 6, 8 */
42
43static int s3c2412_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
44{
45 unsigned int hdiv, pdiv, armdiv, dvs;
46 unsigned long hclk, fclk, armclk, armdiv_clk;
47 unsigned long hclk_max;
48
49 fclk = cfg->freq.fclk;
50 armclk = cfg->freq.armclk;
51 hclk_max = cfg->max.hclk;
52
53 /* We can't run hclk above armclk as at the best we have to
54 * have armclk and hclk in dvs mode. */
55
56 if (hclk_max > armclk)
57 hclk_max = armclk;
58
59 s3c_freq_dbg("%s: fclk=%lu, armclk=%lu, hclk_max=%lu\n",
60 __func__, fclk, armclk, hclk_max);
61 s3c_freq_dbg("%s: want f=%lu, arm=%lu, h=%lu, p=%lu\n",
62 __func__, cfg->freq.fclk, cfg->freq.armclk,
63 cfg->freq.hclk, cfg->freq.pclk);
64
65 armdiv = fclk / armclk;
66
67 if (armdiv < 1)
68 armdiv = 1;
69 if (armdiv > 2)
70 armdiv = 2;
71
72 cfg->divs.arm_divisor = armdiv;
73 armdiv_clk = fclk / armdiv;
74
75 hdiv = armdiv_clk / hclk_max;
76 if (hdiv < 1)
77 hdiv = 1;
78
79 cfg->freq.hclk = hclk = armdiv_clk / hdiv;
80
81 /* set dvs depending on whether we reached armclk or not. */
82 cfg->divs.dvs = dvs = armclk < armdiv_clk;
83
84 /* update the actual armclk we achieved. */
85 cfg->freq.armclk = dvs ? hclk : armdiv_clk;
86
87 s3c_freq_dbg("%s: armclk %lu, hclk %lu, armdiv %d, hdiv %d, dvs %d\n",
88 __func__, armclk, hclk, armdiv, hdiv, cfg->divs.dvs);
89
90 if (hdiv > 4)
91 goto invalid;
92
93 pdiv = (hclk > cfg->max.pclk) ? 2 : 1;
94
95 if ((hclk / pdiv) > cfg->max.pclk)
96 pdiv++;
97
98 cfg->freq.pclk = hclk / pdiv;
99
100 s3c_freq_dbg("%s: pdiv %d\n", __func__, pdiv);
101
102 if (pdiv > 2)
103 goto invalid;
104
105 pdiv *= hdiv;
106
107 /* store the result, and then return */
108
109 cfg->divs.h_divisor = hdiv * armdiv;
110 cfg->divs.p_divisor = pdiv * armdiv;
111
112 return 0;
113
114 invalid:
115 return -EINVAL;
116}
117
118static void s3c2412_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
119{
120 unsigned long clkdiv;
121 unsigned long olddiv;
122
123 olddiv = clkdiv = __raw_readl(S3C2410_CLKDIVN);
124
125 /* clear off current clock info */
126
127 clkdiv &= ~S3C2412_CLKDIVN_ARMDIVN;
128 clkdiv &= ~S3C2412_CLKDIVN_HDIVN_MASK;
129 clkdiv &= ~S3C2412_CLKDIVN_PDIVN;
130
131 if (cfg->divs.arm_divisor == 2)
132 clkdiv |= S3C2412_CLKDIVN_ARMDIVN;
133
134 clkdiv |= ((cfg->divs.h_divisor / cfg->divs.arm_divisor) - 1);
135
136 if (cfg->divs.p_divisor != cfg->divs.h_divisor)
137 clkdiv |= S3C2412_CLKDIVN_PDIVN;
138
139 s3c_freq_dbg("%s: div %08lx => %08lx\n", __func__, olddiv, clkdiv);
140 __raw_writel(clkdiv, S3C2410_CLKDIVN);
141
142 clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk);
143}
144
145static void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
146{
147 struct s3c_cpufreq_board *board = cfg->board;
148 unsigned long refresh;
149
150 s3c_freq_dbg("%s: refresh %u ns, hclk %lu\n", __func__,
151 board->refresh, cfg->freq.hclk);
152
153 /* Reduce both the refresh time (in ns) and the frequency (in MHz)
154 * by 10 each to ensure that we do not overflow 32 bit numbers. This
155 * should work for HCLK up to 133MHz and refresh period up to 30usec.
156 */
157
158 refresh = (board->refresh / 10);
159 refresh *= (cfg->freq.hclk / 100);
160 refresh /= (1 * 1000 * 1000); /* 10^6 */
161
162 s3c_freq_dbg("%s: setting refresh 0x%08lx\n", __func__, refresh);
163 __raw_writel(refresh, S3C2412_REFRESH);
164}
165
166/* set the default cpu frequency information, based on an 200MHz part
167 * as we have no other way of detecting the speed rating in software.
168 */
169
170static struct s3c_cpufreq_info s3c2412_cpufreq_info = {
171 .max = {
172 .fclk = 200000000,
173 .hclk = 100000000,
174 .pclk = 50000000,
175 },
176
177 .latency = 5000000, /* 5ms */
178
179 .locktime_m = 150,
180 .locktime_u = 150,
181 .locktime_bits = 16,
182
183 .name = "s3c2412",
184 .set_refresh = s3c2412_cpufreq_setrefresh,
185 .set_divs = s3c2412_cpufreq_setdivs,
186 .calc_divs = s3c2412_cpufreq_calcdivs,
187
188 .calc_iotiming = s3c2412_iotiming_calc,
189 .set_iotiming = s3c2412_iotiming_set,
190 .get_iotiming = s3c2412_iotiming_get,
191
192 .resume_clocks = s3c2412_setup_clocks,
193
194 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs),
195};
196
197static int s3c2412_cpufreq_add(struct sys_device *sysdev)
198{
199 unsigned long fclk_rate;
200
201 hclk = clk_get(NULL, "hclk");
202 if (IS_ERR(hclk)) {
203 printk(KERN_ERR "%s: cannot find hclk clock\n", __func__);
204 return -ENOENT;
205 }
206
207 fclk = clk_get(NULL, "fclk");
208 if (IS_ERR(fclk)) {
209 printk(KERN_ERR "%s: cannot find fclk clock\n", __func__);
210 goto err_fclk;
211 }
212
213 fclk_rate = clk_get_rate(fclk);
214 if (fclk_rate > 200000000) {
215 printk(KERN_INFO
216 "%s: fclk %ld MHz, assuming 266MHz capable part\n",
217 __func__, fclk_rate / 1000000);
218 s3c2412_cpufreq_info.max.fclk = 266000000;
219 s3c2412_cpufreq_info.max.hclk = 133000000;
220 s3c2412_cpufreq_info.max.pclk = 66000000;
221 }
222
223 armclk = clk_get(NULL, "armclk");
224 if (IS_ERR(armclk)) {
225 printk(KERN_ERR "%s: cannot find arm clock\n", __func__);
226 goto err_armclk;
227 }
228
229 xtal = clk_get(NULL, "xtal");
230 if (IS_ERR(xtal)) {
231 printk(KERN_ERR "%s: cannot find xtal clock\n", __func__);
232 goto err_xtal;
233 }
234
235 return s3c_cpufreq_register(&s3c2412_cpufreq_info);
236
237err_xtal:
238 clk_put(armclk);
239err_armclk:
240 clk_put(fclk);
241err_fclk:
242 clk_put(hclk);
243
244 return -ENOENT;
245}
246
247static struct sysdev_driver s3c2412_cpufreq_driver = {
248 .add = s3c2412_cpufreq_add,
249};
250
251static int s3c2412_cpufreq_init(void)
252{
253 return sysdev_driver_register(&s3c2412_sysclass,
254 &s3c2412_cpufreq_driver);
255}
256
257arch_initcall(s3c2412_cpufreq_init);
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 5b5aba69ec3f..bef39f77729d 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -69,6 +69,18 @@ static struct map_desc s3c2412_iodesc[] __initdata = {
69 IODESC_ENT(CLKPWR), 69 IODESC_ENT(CLKPWR),
70 IODESC_ENT(TIMER), 70 IODESC_ENT(TIMER),
71 IODESC_ENT(WATCHDOG), 71 IODESC_ENT(WATCHDOG),
72 {
73 .virtual = (unsigned long)S3C2412_VA_SSMC,
74 .pfn = __phys_to_pfn(S3C2412_PA_SSMC),
75 .length = SZ_1M,
76 .type = MT_DEVICE,
77 },
78 {
79 .virtual = (unsigned long)S3C2412_VA_EBI,
80 .pfn = __phys_to_pfn(S3C2412_PA_EBI),
81 .length = SZ_1M,
82 .type = MT_DEVICE,
83 },
72}; 84};
73 85
74/* uart registration process */ 86/* uart registration process */
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index 8cfeaec37306..8ae1b288f7fa 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -33,6 +33,7 @@ config MACH_ANUBIS
33 select PM_SIMTEC if PM 33 select PM_SIMTEC if PM
34 select HAVE_PATA_PLATFORM 34 select HAVE_PATA_PLATFORM
35 select S3C24XX_GPIO_EXTRA64 35 select S3C24XX_GPIO_EXTRA64
36 select S3C2440_XTAL_12000000
36 select S3C_DEV_USB_HOST 37 select S3C_DEV_USB_HOST
37 help 38 help
38 Say Y here if you are using the Simtec Electronics ANUBIS 39 Say Y here if you are using the Simtec Electronics ANUBIS
@@ -44,6 +45,8 @@ config MACH_OSIRIS
44 select S3C24XX_DCLK 45 select S3C24XX_DCLK
45 select PM_SIMTEC if PM 46 select PM_SIMTEC if PM
46 select S3C24XX_GPIO_EXTRA128 47 select S3C24XX_GPIO_EXTRA128
48 select S3C2440_XTAL_12000000
49 select S3C2410_IOTIMING if S3C2440_CPUFREQ
47 select S3C_DEV_USB_HOST 50 select S3C_DEV_USB_HOST
48 help 51 help
49 Say Y here if you are using the Simtec IM2440D20 module, also 52 Say Y here if you are using the Simtec IM2440D20 module, also
@@ -52,6 +55,7 @@ config MACH_OSIRIS
52config MACH_RX3715 55config MACH_RX3715
53 bool "HP iPAQ rx3715" 56 bool "HP iPAQ rx3715"
54 select CPU_S3C2440 57 select CPU_S3C2440
58 select S3C2440_XTAL_16934400
55 select PM_H1940 if PM 59 select PM_H1940 if PM
56 help 60 help
57 Say Y here if you are using the HP iPAQ rx3715. 61 Say Y here if you are using the HP iPAQ rx3715.
@@ -59,6 +63,7 @@ config MACH_RX3715
59config ARCH_S3C2440 63config ARCH_S3C2440
60 bool "SMDK2440" 64 bool "SMDK2440"
61 select CPU_S3C2440 65 select CPU_S3C2440
66 select S3C2440_XTAL_16934400
62 select MACH_SMDK 67 select MACH_SMDK
63 select S3C_DEV_USB_HOST 68 select S3C_DEV_USB_HOST
64 help 69 help
@@ -67,6 +72,7 @@ config ARCH_S3C2440
67config MACH_NEXCODER_2440 72config MACH_NEXCODER_2440
68 bool "NexVision NEXCODER 2440 Light Board" 73 bool "NexVision NEXCODER 2440 Light Board"
69 select CPU_S3C2440 74 select CPU_S3C2440
75 select S3C2440_XTAL_12000000
70 select S3C_DEV_USB_HOST 76 select S3C_DEV_USB_HOST
71 help 77 help
72 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board 78 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
@@ -75,6 +81,7 @@ config SMDK2440_CPU2440
75 bool "SMDK2440 with S3C2440 CPU module" 81 bool "SMDK2440 with S3C2440 CPU module"
76 depends on ARCH_S3C2440 82 depends on ARCH_S3C2440
77 default y if ARCH_S3C2440 83 default y if ARCH_S3C2440
84 select S3C2440_XTAL_16934400
78 select CPU_S3C2440 85 select CPU_S3C2440
79 86
80config MACH_AT2440EVB 87config MACH_AT2440EVB
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index cba064b49a64..2105a41281a4 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -34,6 +34,7 @@
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36 36
37#include <plat/cpu-freq.h>
37#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
38#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
39#include <mach/regs-mem.h> 40#include <mach/regs-mem.h>
@@ -351,6 +352,12 @@ static struct clk *osiris_clocks[] __initdata = {
351 &s3c24xx_uclk, 352 &s3c24xx_uclk,
352}; 353};
353 354
355static struct s3c_cpufreq_board __initdata osiris_cpufreq = {
356 .refresh = 7800, /* refresh period is 7.8usec */
357 .auto_io = 1,
358 .need_io = 1,
359};
360
354static void __init osiris_map_io(void) 361static void __init osiris_map_io(void)
355{ 362{
356 unsigned long flags; 363 unsigned long flags;
@@ -402,6 +409,8 @@ static void __init osiris_init(void)
402 409
403 s3c_i2c0_set_platdata(NULL); 410 s3c_i2c0_set_platdata(NULL);
404 411
412 s3c_cpufreq_setboard(&osiris_cpufreq);
413
405 i2c_register_board_info(0, osiris_i2c_devs, 414 i2c_register_board_info(0, osiris_i2c_devs,
406 ARRAY_SIZE(osiris_i2c_devs)); 415 ARRAY_SIZE(osiris_i2c_devs));
407 416
diff --git a/arch/arm/mach-s3c24a0/include/mach/map.h b/arch/arm/mach-s3c24a0/include/mach/map.h
index a01132717e34..79e4d93ea2b6 100644
--- a/arch/arm/mach-s3c24a0/include/mach/map.h
+++ b/arch/arm/mach-s3c24a0/include/mach/map.h
@@ -81,5 +81,6 @@
81 81
82#define S3C_PA_UART S3C24A0_PA_UART 82#define S3C_PA_UART S3C24A0_PA_UART
83#define S3C_PA_IIC S3C24A0_PA_IIC 83#define S3C_PA_IIC S3C24A0_PA_IIC
84#define S3C_PA_NAND S3C24XX_PA_NAND
84 85
85#endif /* __ASM_ARCH_24A0_MAP_H */ 86#endif /* __ASM_ARCH_24A0_MAP_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index 5057d9948d35..fc8b223bad4f 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -38,18 +38,21 @@
38#define S3C_VA_UART2 S3C_VA_UARTx(2) 38#define S3C_VA_UART2 S3C_VA_UARTx(2)
39#define S3C_VA_UART3 S3C_VA_UARTx(3) 39#define S3C_VA_UART3 S3C_VA_UARTx(3)
40 40
41#define S3C64XX_PA_NAND (0x70200000)
41#define S3C64XX_PA_FB (0x77100000) 42#define S3C64XX_PA_FB (0x77100000)
42#define S3C64XX_PA_USB_HSOTG (0x7C000000) 43#define S3C64XX_PA_USB_HSOTG (0x7C000000)
43#define S3C64XX_PA_WATCHDOG (0x7E004000) 44#define S3C64XX_PA_WATCHDOG (0x7E004000)
44#define S3C64XX_PA_SYSCON (0x7E00F000) 45#define S3C64XX_PA_SYSCON (0x7E00F000)
46#define S3C64XX_PA_AC97 (0x7F001000)
45#define S3C64XX_PA_IIS0 (0x7F002000) 47#define S3C64XX_PA_IIS0 (0x7F002000)
46#define S3C64XX_PA_IIS1 (0x7F003000) 48#define S3C64XX_PA_IIS1 (0x7F003000)
47#define S3C64XX_PA_TIMER (0x7F006000) 49#define S3C64XX_PA_TIMER (0x7F006000)
48#define S3C64XX_PA_IIC0 (0x7F004000) 50#define S3C64XX_PA_IIC0 (0x7F004000)
51#define S3C64XX_PA_IISV4 (0x7F00D000)
49#define S3C64XX_PA_IIC1 (0x7F00F000) 52#define S3C64XX_PA_IIC1 (0x7F00F000)
50 53
51#define S3C64XX_PA_GPIO (0x7F008000) 54#define S3C64XX_PA_GPIO (0x7F008000)
52#define S3C64XX_VA_GPIO S3C_ADDR(0x00500000) 55#define S3C64XX_VA_GPIO S3C_ADDR_CPU(0x00000000)
53#define S3C64XX_SZ_GPIO SZ_4K 56#define S3C64XX_SZ_GPIO SZ_4K
54 57
55#define S3C64XX_PA_SDRAM (0x50000000) 58#define S3C64XX_PA_SDRAM (0x50000000)
@@ -57,7 +60,7 @@
57#define S3C64XX_PA_VIC1 (0x71300000) 60#define S3C64XX_PA_VIC1 (0x71300000)
58 61
59#define S3C64XX_PA_MODEM (0x74108000) 62#define S3C64XX_PA_MODEM (0x74108000)
60#define S3C64XX_VA_MODEM S3C_ADDR(0x00600000) 63#define S3C64XX_VA_MODEM S3C_ADDR_CPU(0x00100000)
61 64
62#define S3C64XX_PA_USBHOST (0x74300000) 65#define S3C64XX_PA_USBHOST (0x74300000)
63 66
@@ -72,6 +75,7 @@
72#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2 75#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2
73#define S3C_PA_IIC S3C64XX_PA_IIC0 76#define S3C_PA_IIC S3C64XX_PA_IIC0
74#define S3C_PA_IIC1 S3C64XX_PA_IIC1 77#define S3C_PA_IIC1 S3C64XX_PA_IIC1
78#define S3C_PA_NAND S3C64XX_PA_NAND
75#define S3C_PA_FB S3C64XX_PA_FB 79#define S3C_PA_FB S3C64XX_PA_FB
76#define S3C_PA_USBHOST S3C64XX_PA_USBHOST 80#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
77#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG 81#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
diff --git a/arch/arm/mach-s3c6400/s3c6400.c b/arch/arm/mach-s3c6400/s3c6400.c
index 1ece887d90bb..b42bdd0f2138 100644
--- a/arch/arm/mach-s3c6400/s3c6400.c
+++ b/arch/arm/mach-s3c6400/s3c6400.c
@@ -48,6 +48,8 @@ void __init s3c6400_map_io(void)
48 48
49 /* the i2c devices are directly compatible with s3c2440 */ 49 /* the i2c devices are directly compatible with s3c2440 */
50 s3c_i2c0_setname("s3c2440-i2c"); 50 s3c_i2c0_setname("s3c2440-i2c");
51
52 s3c_device_nand.name = "s3c6400-nand";
51} 53}
52 54
53void __init s3c6400_init_clocks(int xtal) 55void __init s3c6400_init_clocks(int xtal)
diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig
index e63aac7f4e5a..f9d0f09f9761 100644
--- a/arch/arm/mach-s3c6410/Kconfig
+++ b/arch/arm/mach-s3c6410/Kconfig
@@ -97,3 +97,13 @@ config MACH_NCP
97 select S3C64XX_SETUP_I2C1 97 select S3C64XX_SETUP_I2C1
98 help 98 help
99 Machine support for the Samsung NCP 99 Machine support for the Samsung NCP
100
101config MACH_HMT
102 bool "Airgoo HMT"
103 select CPU_S3C6410
104 select S3C_DEV_FB
105 select S3C_DEV_USB_HOST
106 select S3C64XX_SETUP_FB_24BPP
107 select HAVE_PWM
108 help
109 Machine support for the Airgoo HMT
diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile
index 6f9deac88612..3e48c3dbf973 100644
--- a/arch/arm/mach-s3c6410/Makefile
+++ b/arch/arm/mach-s3c6410/Makefile
@@ -23,5 +23,4 @@ obj-$(CONFIG_S3C6410_SETUP_SDHCI) += setup-sdhci.o
23obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o 23obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
24obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 24obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
25obj-$(CONFIG_MACH_NCP) += mach-ncp.o 25obj-$(CONFIG_MACH_NCP) += mach-ncp.o
26 26obj-$(CONFIG_MACH_HMT) += mach-hmt.o
27
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c
index ade904de8895..9b67c663d9d8 100644
--- a/arch/arm/mach-s3c6410/cpu.c
+++ b/arch/arm/mach-s3c6410/cpu.c
@@ -62,6 +62,8 @@ void __init s3c6410_map_io(void)
62 /* the i2c devices are directly compatible with s3c2440 */ 62 /* the i2c devices are directly compatible with s3c2440 */
63 s3c_i2c0_setname("s3c2440-i2c"); 63 s3c_i2c0_setname("s3c2440-i2c");
64 s3c_i2c1_setname("s3c2440-i2c"); 64 s3c_i2c1_setname("s3c2440-i2c");
65
66 s3c_device_nand.name = "s3c6400-nand";
65} 67}
66 68
67void __init s3c6410_init_clocks(int xtal) 69void __init s3c6410_init_clocks(int xtal)
diff --git a/arch/arm/mach-s3c6410/mach-hmt.c b/arch/arm/mach-s3c6410/mach-hmt.c
new file mode 100644
index 000000000000..c5741056193f
--- /dev/null
+++ b/arch/arm/mach-s3c6410/mach-hmt.c
@@ -0,0 +1,276 @@
1/* mach-hmt.c - Platform code for Airgoo HMT
2 *
3 * Copyright 2009 Peter Korsgaard <jacmet@sunsite.dk>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9*/
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/serial_core.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/i2c.h>
17#include <linux/fb.h>
18#include <linux/gpio.h>
19#include <linux/delay.h>
20#include <linux/leds.h>
21#include <linux/pwm_backlight.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/mach/irq.h>
28
29#include <mach/hardware.h>
30#include <mach/regs-fb.h>
31#include <mach/map.h>
32
33#include <asm/irq.h>
34#include <asm/mach-types.h>
35
36#include <plat/regs-serial.h>
37#include <plat/iic.h>
38#include <plat/fb.h>
39#include <plat/nand.h>
40
41#include <plat/s3c6410.h>
42#include <plat/clock.h>
43#include <plat/devs.h>
44#include <plat/cpu.h>
45
46#define UCON S3C2410_UCON_DEFAULT
47#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)
48#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
49
50static struct s3c2410_uartcfg hmt_uartcfgs[] __initdata = {
51 [0] = {
52 .hwport = 0,
53 .flags = 0,
54 .ucon = UCON,
55 .ulcon = ULCON,
56 .ufcon = UFCON,
57 },
58 [1] = {
59 .hwport = 1,
60 .flags = 0,
61 .ucon = UCON,
62 .ulcon = ULCON,
63 .ufcon = UFCON,
64 },
65 [2] = {
66 .hwport = 2,
67 .flags = 0,
68 .ucon = UCON,
69 .ulcon = ULCON,
70 .ufcon = UFCON,
71 },
72};
73
74static int hmt_bl_init(struct device *dev)
75{
76 int ret;
77
78 ret = gpio_request(S3C64XX_GPB(4), "lcd backlight enable");
79 if (!ret)
80 ret = gpio_direction_output(S3C64XX_GPB(4), 0);
81
82 return ret;
83}
84
85static int hmt_bl_notify(int brightness)
86{
87 /*
88 * translate from CIELUV/CIELAB L*->brightness, E.G. from
89 * perceived luminance to light output. Assumes range 0..25600
90 */
91 if (brightness < 0x800) {
92 /* Y = Yn * L / 903.3 */
93 brightness = (100*256 * brightness + 231245/2) / 231245;
94 } else {
95 /* Y = Yn * ((L + 16) / 116 )^3 */
96 int t = (brightness*4 + 16*1024 + 58)/116;
97 brightness = 25 * ((t * t * t + 0x100000/2) / 0x100000);
98 }
99
100 gpio_set_value(S3C64XX_GPB(4), brightness);
101
102 return brightness;
103}
104
105static void hmt_bl_exit(struct device *dev)
106{
107 gpio_free(S3C64XX_GPB(4));
108}
109
110static struct platform_pwm_backlight_data hmt_backlight_data = {
111 .pwm_id = 1,
112 .max_brightness = 100 * 256,
113 .dft_brightness = 40 * 256,
114 .pwm_period_ns = 1000000000 / (100 * 256 * 20),
115 .init = hmt_bl_init,
116 .notify = hmt_bl_notify,
117 .exit = hmt_bl_exit,
118
119};
120
121static struct platform_device hmt_backlight_device = {
122 .name = "pwm-backlight",
123 .dev = {
124 .parent = &s3c_device_timer[1].dev,
125 .platform_data = &hmt_backlight_data,
126 },
127};
128
129static struct s3c_fb_pd_win hmt_fb_win0 = {
130 .win_mode = {
131 .pixclock = 41094,
132 .left_margin = 8,
133 .right_margin = 13,
134 .upper_margin = 7,
135 .lower_margin = 5,
136 .hsync_len = 3,
137 .vsync_len = 1,
138 .xres = 800,
139 .yres = 480,
140 },
141 .max_bpp = 32,
142 .default_bpp = 16,
143};
144
145/* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
146static struct s3c_fb_platdata hmt_lcd_pdata __initdata = {
147 .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
148 .win[0] = &hmt_fb_win0,
149 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
150 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
151};
152
153static struct mtd_partition hmt_nand_part[] = {
154 [0] = {
155 .name = "uboot",
156 .size = SZ_512K,
157 .offset = 0,
158 },
159 [1] = {
160 .name = "uboot-env1",
161 .size = SZ_256K,
162 .offset = SZ_512K,
163 },
164 [2] = {
165 .name = "uboot-env2",
166 .size = SZ_256K,
167 .offset = SZ_512K + SZ_256K,
168 },
169 [3] = {
170 .name = "kernel",
171 .size = SZ_2M,
172 .offset = SZ_1M,
173 },
174 [4] = {
175 .name = "rootfs",
176 .size = MTDPART_SIZ_FULL,
177 .offset = SZ_1M + SZ_2M,
178 },
179};
180
181static struct s3c2410_nand_set hmt_nand_sets[] = {
182 [0] = {
183 .name = "nand",
184 .nr_chips = 1,
185 .nr_partitions = ARRAY_SIZE(hmt_nand_part),
186 .partitions = hmt_nand_part,
187 },
188};
189
190static struct s3c2410_platform_nand hmt_nand_info = {
191 .tacls = 25,
192 .twrph0 = 55,
193 .twrph1 = 40,
194 .nr_sets = ARRAY_SIZE(hmt_nand_sets),
195 .sets = hmt_nand_sets,
196};
197
198static struct gpio_led hmt_leds[] = {
199 { /* left function keys */
200 .name = "left:blue",
201 .gpio = S3C64XX_GPO(12),
202 .default_trigger = "default-on",
203 },
204 { /* right function keys - red */
205 .name = "right:red",
206 .gpio = S3C64XX_GPO(13),
207 },
208 { /* right function keys - green */
209 .name = "right:green",
210 .gpio = S3C64XX_GPO(14),
211 },
212 { /* right function keys - blue */
213 .name = "right:blue",
214 .gpio = S3C64XX_GPO(15),
215 .default_trigger = "default-on",
216 },
217};
218
219static struct gpio_led_platform_data hmt_led_data = {
220 .num_leds = ARRAY_SIZE(hmt_leds),
221 .leds = hmt_leds,
222};
223
224static struct platform_device hmt_leds_device = {
225 .name = "leds-gpio",
226 .id = -1,
227 .dev.platform_data = &hmt_led_data,
228};
229
230static struct map_desc hmt_iodesc[] = {};
231
232static struct platform_device *hmt_devices[] __initdata = {
233 &s3c_device_i2c0,
234 &s3c_device_nand,
235 &s3c_device_fb,
236 &s3c_device_usb,
237 &s3c_device_timer[1],
238 &hmt_backlight_device,
239 &hmt_leds_device,
240};
241
242static void __init hmt_map_io(void)
243{
244 s3c64xx_init_io(hmt_iodesc, ARRAY_SIZE(hmt_iodesc));
245 s3c24xx_init_clocks(12000000);
246 s3c24xx_init_uarts(hmt_uartcfgs, ARRAY_SIZE(hmt_uartcfgs));
247}
248
249static void __init hmt_machine_init(void)
250{
251 s3c_i2c0_set_platdata(NULL);
252 s3c_fb_set_platdata(&hmt_lcd_pdata);
253 s3c_device_nand.dev.platform_data = &hmt_nand_info;
254
255 gpio_request(S3C64XX_GPC(7), "usb power");
256 gpio_direction_output(S3C64XX_GPC(7), 0);
257 gpio_request(S3C64XX_GPM(0), "usb power");
258 gpio_direction_output(S3C64XX_GPM(0), 1);
259 gpio_request(S3C64XX_GPK(7), "usb power");
260 gpio_direction_output(S3C64XX_GPK(7), 1);
261 gpio_request(S3C64XX_GPF(13), "usb power");
262 gpio_direction_output(S3C64XX_GPF(13), 1);
263
264 platform_add_devices(hmt_devices, ARRAY_SIZE(hmt_devices));
265}
266
267MACHINE_START(HMT, "Airgoo-HMT")
268 /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */
269 .phys_io = S3C_PA_UART & 0xfff00000,
270 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
271 .boot_params = S3C64XX_PA_SDRAM + 0x100,
272 .init_irq = s3c6410_init_irq,
273 .map_io = hmt_map_io,
274 .init_machine = hmt_machine_init,
275 .timer = &s3c24xx_timer,
276MACHINE_END
diff --git a/arch/arm/mach-s3c6410/mach-ncp.c b/arch/arm/mach-s3c6410/mach-ncp.c
index 6030636f8548..55e9bbfaf68b 100644
--- a/arch/arm/mach-s3c6410/mach-ncp.c
+++ b/arch/arm/mach-s3c6410/mach-ncp.c
@@ -79,7 +79,7 @@ static struct platform_device *ncp_devices[] __initdata = {
79 &s3c_device_i2c0, 79 &s3c_device_i2c0,
80}; 80};
81 81
82struct map_desc ncp_iodesc[] = {}; 82static struct map_desc ncp_iodesc[] __initdata = {};
83 83
84static void __init ncp_map_io(void) 84static void __init ncp_map_io(void)
85{ 85{
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
index bc9a7dea567f..ea51dbe76e3e 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -65,16 +65,30 @@ static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = {
65 [0] = { 65 [0] = {
66 .hwport = 0, 66 .hwport = 0,
67 .flags = 0, 67 .flags = 0,
68 .ucon = 0x3c5, 68 .ucon = UCON,
69 .ulcon = 0x03, 69 .ulcon = ULCON,
70 .ufcon = 0x51, 70 .ufcon = UFCON,
71 }, 71 },
72 [1] = { 72 [1] = {
73 .hwport = 1, 73 .hwport = 1,
74 .flags = 0, 74 .flags = 0,
75 .ucon = 0x3c5, 75 .ucon = UCON,
76 .ulcon = 0x03, 76 .ulcon = ULCON,
77 .ufcon = 0x51, 77 .ufcon = UFCON,
78 },
79 [2] = {
80 .hwport = 2,
81 .flags = 0,
82 .ucon = UCON,
83 .ulcon = ULCON,
84 .ufcon = UFCON,
85 },
86 [3] = {
87 .hwport = 3,
88 .flags = 0,
89 .ucon = UCON,
90 .ulcon = ULCON,
91 .ufcon = UFCON,
78 }, 92 },
79}; 93};
80 94
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
new file mode 100644
index 000000000000..b1a4ba504416
--- /dev/null
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -0,0 +1,22 @@
1# arch/arm/mach-s5pc100/Kconfig
2#
3# Copyright 2009 Samsung Electronics Co.
4# Byungho Min <bhmin@samsung.com>
5#
6# Licensed under GPLv2
7
8# Configuration options for the S5PC100 CPU
9
10config CPU_S5PC100
11 bool
12 select CPU_S5PC100_INIT
13 select CPU_S5PC100_CLOCK
14 help
15 Enable S5PC100 CPU support
16
17config MACH_SMDKC100
18 bool "SMDKC100"
19 select CPU_S5PC100
20 select S5PC1XX_SETUP_I2C1
21 help
22 Machine support for the Samsung SMDKC100
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
new file mode 100644
index 000000000000..afc89b381d7a
--- /dev/null
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -0,0 +1,17 @@
1# arch/arm/mach-s5pc100/Makefile
2#
3# Copyright 2009 Samsung Electronics Co.
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12# Core support for S5PC100 system
13
14obj-$(CONFIG_CPU_S5PC100) += cpu.o
15
16# machine support
17obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
diff --git a/arch/arm/mach-s5pc100/Makefile.boot b/arch/arm/mach-s5pc100/Makefile.boot
new file mode 100644
index 000000000000..ff90aa13bd67
--- /dev/null
+++ b/arch/arm/mach-s5pc100/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x20008000
2params_phys-y := 0x20000100
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
new file mode 100644
index 000000000000..0e718890da32
--- /dev/null
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -0,0 +1,97 @@
1/* linux/arch/arm/mach-s5pc100/cpu.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on mach-s3c6410/cpu.c
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/timer.h>
18#include <linux/init.h>
19#include <linux/clk.h>
20#include <linux/io.h>
21#include <linux/sysdev.h>
22#include <linux/serial_core.h>
23#include <linux/platform_device.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/mach/irq.h>
28
29#include <mach/hardware.h>
30#include <mach/map.h>
31#include <asm/irq.h>
32
33#include <plat/cpu-freq.h>
34#include <plat/regs-serial.h>
35
36#include <plat/cpu.h>
37#include <plat/devs.h>
38#include <plat/clock.h>
39#include <plat/sdhci.h>
40#include <plat/iic-core.h>
41#include <plat/s5pc100.h>
42
43/* Initial IO mappings */
44
45static struct map_desc s5pc100_iodesc[] __initdata = {
46};
47
48/* s5pc100_map_io
49 *
50 * register the standard cpu IO areas
51*/
52
53void __init s5pc100_map_io(void)
54{
55 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
56
57 /* initialise device information early */
58}
59
60void __init s5pc100_init_clocks(int xtal)
61{
62 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
63 s3c24xx_register_baseclocks(xtal);
64 s5pc1xx_register_clocks();
65 s5pc100_register_clocks();
66 s5pc100_setup_clocks();
67}
68
69void __init s5pc100_init_irq(void)
70{
71 u32 vic_valid[] = {~0, ~0, ~0};
72
73 /* VIC0, VIC1, and VIC2 are fully populated. */
74 s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
75}
76
77struct sysdev_class s5pc100_sysclass = {
78 .name = "s5pc100-core",
79};
80
81static struct sys_device s5pc100_sysdev = {
82 .cls = &s5pc100_sysclass,
83};
84
85static int __init s5pc100_core_init(void)
86{
87 return sysdev_class_register(&s5pc100_sysclass);
88}
89
90core_initcall(s5pc100_core_init);
91
92int __init s5pc100_init(void)
93{
94 printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
95
96 return sysdev_register(&s5pc100_sysdev);
97}
diff --git a/arch/arm/mach-s5pc100/include/mach/debug-macro.S b/arch/arm/mach-s5pc100/include/mach/debug-macro.S
new file mode 100644
index 000000000000..9d142ccf654b
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/debug-macro.S
@@ -0,0 +1,38 @@
1/* arch/arm/mach-s5pc100/include/mach/debug-macro.S
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 *
7 * Based on mach-s3c6400/include/mach/debug-macro.S
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14/* pull in the relevant register and map files. */
15
16#include <mach/map.h>
17#include <plat/regs-serial.h>
18
19 /* note, for the boot process to work we have to keep the UART
20 * virtual address aligned to an 1MiB boundary for the L1
21 * mapping the head code makes. We keep the UART virtual address
22 * aligned and add in the offset when we load the value here.
23 */
24
25 .macro addruart, rx
26 mrc p15, 0, \rx, c1, c0
27 tst \rx, #1
28 ldreq \rx, = S3C_PA_UART
29 ldrne \rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
30 add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
31 .endm
32
33/* include the reset of the code which will do the work, we're only
34 * compiling for a single cpu processor type so the default of s3c2440
35 * will be fine with us.
36 */
37
38#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-s5pc100/include/mach/entry-macro.S b/arch/arm/mach-s5pc100/include/mach/entry-macro.S
new file mode 100644
index 000000000000..67131939e626
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/entry-macro.S
@@ -0,0 +1,50 @@
1/* arch/arm/mach-s5pc100/include/mach/entry-macro.S
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on mach-s3c6400/include/mach/entry-macro.S
7 *
8 * Low-level IRQ helper macros for the Samsung S5PC1XX series
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13*/
14
15#include <asm/hardware/vic.h>
16#include <mach/map.h>
17#include <plat/irqs.h>
18
19 .macro disable_fiq
20 .endm
21
22 .macro get_irqnr_preamble, base, tmp
23 ldr \base, =S3C_VA_VIC0
24 .endm
25
26 .macro arch_ret_to_user, tmp1, tmp2
27 .endm
28
29 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
30
31 @ check the vic0
32 mov \irqnr, # S3C_IRQ_OFFSET + 31
33 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
34 teq \irqstat, #0
35
36 @ otherwise try vic1
37 addeq \tmp, \base, #(S3C_VA_VIC1 - S3C_VA_VIC0)
38 addeq \irqnr, \irqnr, #32
39 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
40 teqeq \irqstat, #0
41
42 @ otherwise try vic2
43 addeq \tmp, \base, #(S3C_VA_VIC2 - S3C_VA_VIC0)
44 addeq \irqnr, \irqnr, #32
45 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
46 teqeq \irqstat, #0
47
48 clzne \irqstat, \irqstat
49 subne \irqnr, \irqnr, \irqstat
50 .endm
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio-core.h b/arch/arm/mach-s5pc100/include/mach/gpio-core.h
new file mode 100644
index 000000000000..ad28d8ec8a78
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/gpio-core.h
@@ -0,0 +1,21 @@
1/* arch/arm/mach-s5pc100/include/mach/gpio-core.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - GPIO core support
7 *
8 * Based on mach-s3c6400/include/mach/gpio-core.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_GPIO_CORE_H
16#define __ASM_ARCH_GPIO_CORE_H __FILE__
17
18/* currently we just include the platform support */
19#include <plat/gpio-core.h>
20
21#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h
new file mode 100644
index 000000000000..c74fc93d7d15
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -0,0 +1,146 @@
1/* arch/arm/mach-s5pc100/include/mach/gpio.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - GPIO lib support
7 *
8 * Base on mach-s3c6400/include/mach/gpio.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define gpio_get_value __gpio_get_value
16#define gpio_set_value __gpio_set_value
17#define gpio_cansleep __gpio_cansleep
18#define gpio_to_irq __gpio_to_irq
19
20/* GPIO bank sizes */
21#define S5PC1XX_GPIO_A0_NR (8)
22#define S5PC1XX_GPIO_A1_NR (5)
23#define S5PC1XX_GPIO_B_NR (8)
24#define S5PC1XX_GPIO_C_NR (5)
25#define S5PC1XX_GPIO_D_NR (7)
26#define S5PC1XX_GPIO_E0_NR (8)
27#define S5PC1XX_GPIO_E1_NR (6)
28#define S5PC1XX_GPIO_F0_NR (8)
29#define S5PC1XX_GPIO_F1_NR (8)
30#define S5PC1XX_GPIO_F2_NR (8)
31#define S5PC1XX_GPIO_F3_NR (4)
32#define S5PC1XX_GPIO_G0_NR (8)
33#define S5PC1XX_GPIO_G1_NR (3)
34#define S5PC1XX_GPIO_G2_NR (7)
35#define S5PC1XX_GPIO_G3_NR (7)
36#define S5PC1XX_GPIO_H0_NR (8)
37#define S5PC1XX_GPIO_H1_NR (8)
38#define S5PC1XX_GPIO_H2_NR (8)
39#define S5PC1XX_GPIO_H3_NR (8)
40#define S5PC1XX_GPIO_I_NR (8)
41#define S5PC1XX_GPIO_J0_NR (8)
42#define S5PC1XX_GPIO_J1_NR (5)
43#define S5PC1XX_GPIO_J2_NR (8)
44#define S5PC1XX_GPIO_J3_NR (8)
45#define S5PC1XX_GPIO_J4_NR (4)
46#define S5PC1XX_GPIO_K0_NR (8)
47#define S5PC1XX_GPIO_K1_NR (6)
48#define S5PC1XX_GPIO_K2_NR (8)
49#define S5PC1XX_GPIO_K3_NR (8)
50#define S5PC1XX_GPIO_MP00_NR (8)
51#define S5PC1XX_GPIO_MP01_NR (8)
52#define S5PC1XX_GPIO_MP02_NR (8)
53#define S5PC1XX_GPIO_MP03_NR (8)
54#define S5PC1XX_GPIO_MP04_NR (5)
55
56/* GPIO bank numbes */
57
58/* CONFIG_S3C_GPIO_SPACE allows the user to select extra
59 * space for debugging purposes so that any accidental
60 * change from one gpio bank to another can be caught.
61*/
62
63#define S5PC1XX_GPIO_NEXT(__gpio) \
64 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
65
66enum s3c_gpio_number {
67 S5PC1XX_GPIO_A0_START = 0,
68 S5PC1XX_GPIO_A1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_A0),
69 S5PC1XX_GPIO_B_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_A1),
70 S5PC1XX_GPIO_C_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_B),
71 S5PC1XX_GPIO_D_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_C),
72 S5PC1XX_GPIO_E0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_D),
73 S5PC1XX_GPIO_E1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_E0),
74 S5PC1XX_GPIO_F0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_E1),
75 S5PC1XX_GPIO_F1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F0),
76 S5PC1XX_GPIO_F2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F1),
77 S5PC1XX_GPIO_F3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F2),
78 S5PC1XX_GPIO_G0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F3),
79 S5PC1XX_GPIO_G1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G0),
80 S5PC1XX_GPIO_G2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G1),
81 S5PC1XX_GPIO_G3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G2),
82 S5PC1XX_GPIO_H0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G3),
83 S5PC1XX_GPIO_H1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H0),
84 S5PC1XX_GPIO_H2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H1),
85 S5PC1XX_GPIO_H3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H2),
86 S5PC1XX_GPIO_I_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H3),
87 S5PC1XX_GPIO_J0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_I),
88 S5PC1XX_GPIO_J1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J0),
89 S5PC1XX_GPIO_J2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J1),
90 S5PC1XX_GPIO_J3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J2),
91 S5PC1XX_GPIO_J4_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J3),
92 S5PC1XX_GPIO_K0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J4),
93 S5PC1XX_GPIO_K1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K0),
94 S5PC1XX_GPIO_K2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K1),
95 S5PC1XX_GPIO_K3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K2),
96 S5PC1XX_GPIO_MP00_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K3),
97 S5PC1XX_GPIO_MP01_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP00),
98 S5PC1XX_GPIO_MP02_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP01),
99 S5PC1XX_GPIO_MP03_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP02),
100 S5PC1XX_GPIO_MP04_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP03),
101};
102
103/* S5PC1XX GPIO number definitions. */
104#define S5PC1XX_GPA0(_nr) (S5PC1XX_GPIO_A0_START + (_nr))
105#define S5PC1XX_GPA1(_nr) (S5PC1XX_GPIO_A1_START + (_nr))
106#define S5PC1XX_GPB(_nr) (S5PC1XX_GPIO_B_START + (_nr))
107#define S5PC1XX_GPC(_nr) (S5PC1XX_GPIO_C_START + (_nr))
108#define S5PC1XX_GPD(_nr) (S5PC1XX_GPIO_D_START + (_nr))
109#define S5PC1XX_GPE0(_nr) (S5PC1XX_GPIO_E0_START + (_nr))
110#define S5PC1XX_GPE1(_nr) (S5PC1XX_GPIO_E1_START + (_nr))
111#define S5PC1XX_GPF0(_nr) (S5PC1XX_GPIO_F0_START + (_nr))
112#define S5PC1XX_GPF1(_nr) (S5PC1XX_GPIO_F1_START + (_nr))
113#define S5PC1XX_GPF2(_nr) (S5PC1XX_GPIO_F2_START + (_nr))
114#define S5PC1XX_GPF3(_nr) (S5PC1XX_GPIO_F3_START + (_nr))
115#define S5PC1XX_GPG0(_nr) (S5PC1XX_GPIO_G0_START + (_nr))
116#define S5PC1XX_GPG1(_nr) (S5PC1XX_GPIO_G1_START + (_nr))
117#define S5PC1XX_GPG2(_nr) (S5PC1XX_GPIO_G2_START + (_nr))
118#define S5PC1XX_GPG3(_nr) (S5PC1XX_GPIO_G3_START + (_nr))
119#define S5PC1XX_GPH0(_nr) (S5PC1XX_GPIO_H0_START + (_nr))
120#define S5PC1XX_GPH1(_nr) (S5PC1XX_GPIO_H1_START + (_nr))
121#define S5PC1XX_GPH2(_nr) (S5PC1XX_GPIO_H2_START + (_nr))
122#define S5PC1XX_GPH3(_nr) (S5PC1XX_GPIO_H3_START + (_nr))
123#define S5PC1XX_GPI(_nr) (S5PC1XX_GPIO_I_START + (_nr))
124#define S5PC1XX_GPJ0(_nr) (S5PC1XX_GPIO_J0_START + (_nr))
125#define S5PC1XX_GPJ1(_nr) (S5PC1XX_GPIO_J1_START + (_nr))
126#define S5PC1XX_GPJ2(_nr) (S5PC1XX_GPIO_J2_START + (_nr))
127#define S5PC1XX_GPJ3(_nr) (S5PC1XX_GPIO_J3_START + (_nr))
128#define S5PC1XX_GPJ4(_nr) (S5PC1XX_GPIO_J4_START + (_nr))
129#define S5PC1XX_GPK0(_nr) (S5PC1XX_GPIO_K0_START + (_nr))
130#define S5PC1XX_GPK1(_nr) (S5PC1XX_GPIO_K1_START + (_nr))
131#define S5PC1XX_GPK2(_nr) (S5PC1XX_GPIO_K2_START + (_nr))
132#define S5PC1XX_GPK3(_nr) (S5PC1XX_GPIO_K3_START + (_nr))
133#define S5PC1XX_MP00(_nr) (S5PC1XX_GPIO_MP00_START + (_nr))
134#define S5PC1XX_MP01(_nr) (S5PC1XX_GPIO_MP01_START + (_nr))
135#define S5PC1XX_MP02(_nr) (S5PC1XX_GPIO_MP02_START + (_nr))
136#define S5PC1XX_MP03(_nr) (S5PC1XX_GPIO_MP03_START + (_nr))
137#define S5PC1XX_MP04(_nr) (S5PC1XX_GPIO_MP04_START + (_nr))
138
139/* the end of the S5PC1XX specific gpios */
140#define S5PC1XX_GPIO_END (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1)
141#define S3C_GPIO_END S5PC1XX_GPIO_END
142
143/* define the number of gpios we need to the one after the MP04() range */
144#define ARCH_NR_GPIOS (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1)
145
146#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-s5pc100/include/mach/hardware.h b/arch/arm/mach-s5pc100/include/mach/hardware.h
new file mode 100644
index 000000000000..6b38618c2fd9
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/hardware.h
@@ -0,0 +1,14 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/hardware.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - Hardware support
7 */
8
9#ifndef __ASM_ARCH_HARDWARE_H
10#define __ASM_ARCH_HARDWARE_H __FILE__
11
12/* currently nothing here, placeholder */
13
14#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-s5pc100/include/mach/irqs.h
new file mode 100644
index 000000000000..622720dba289
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
@@ -0,0 +1,14 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/irqs.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - IRQ definitions
7 */
8
9#ifndef __ASM_ARCH_IRQS_H
10#define __ASM_ARCH_IRQS_H __FILE__
11
12#include <plat/irqs.h>
13
14#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
new file mode 100644
index 000000000000..9e9f39130b2c
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -0,0 +1,75 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/map.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on mach-s3c6400/include/mach/map.h
7 *
8 * S5PC1XX - Memory map definitions
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_MAP_H
16#define __ASM_ARCH_MAP_H __FILE__
17
18#include <plat/map-base.h>
19
20
21/* Chip ID */
22#define S5PC100_PA_CHIPID (0xE0000000)
23#define S5PC1XX_PA_CHIPID S5PC100_PA_CHIPID
24#define S5PC1XX_VA_CHIPID S3C_VA_SYS
25
26/* System */
27#define S5PC100_PA_SYS (0xE0100000)
28#define S5PC100_PA_CLK (S5PC100_PA_SYS + 0x0)
29#define S5PC100_PA_PWR (S5PC100_PA_SYS + 0x8000)
30#define S5PC1XX_PA_CLK S5PC100_PA_CLK
31#define S5PC1XX_PA_PWR S5PC100_PA_PWR
32#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)
33#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000)
34
35/* Interrupt */
36#define S5PC100_PA_VIC (0xE4000000)
37#define S5PC100_VA_VIC S3C_VA_IRQ
38#define S5PC100_PA_VIC_OFFSET 0x100000
39#define S5PC100_VA_VIC_OFFSET 0x10000
40#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET))
41#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))
42
43/* Timer */
44#define S5PC100_PA_TIMER (0xEA000000)
45#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER
46#define S5PC1XX_VA_TIMER S3C_VA_TIMER
47
48/* UART */
49#define S5PC100_PA_UART (0xEC000000)
50#define S5PC1XX_PA_UART S5PC100_PA_UART
51#define S5PC1XX_VA_UART S3C_VA_UART
52
53/* IIC */
54#define S5PC100_PA_IIC (0xEC100000)
55
56/* ETC */
57#define S5PC100_PA_SDRAM (0x20000000)
58
59/* compatibility defines. */
60#define S3C_PA_UART S5PC100_PA_UART
61#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0)
62#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400)
63#define S3C_PA_UART2 (S5PC100_PA_UART + 0x800)
64#define S3C_PA_UART3 (S5PC100_PA_UART + 0xC00)
65#define S3C_VA_UART0 (S3C_VA_UART + 0x0)
66#define S3C_VA_UART1 (S3C_VA_UART + 0x400)
67#define S3C_VA_UART2 (S3C_VA_UART + 0x800)
68#define S3C_VA_UART3 (S3C_VA_UART + 0xC00)
69#define S3C_UART_OFFSET 0x400
70#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0)
71#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
72#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000)
73#define S3C_PA_IIC S5PC100_PA_IIC
74
75#endif /* __ASM_ARCH_C100_MAP_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/memory.h b/arch/arm/mach-s5pc100/include/mach/memory.h
new file mode 100644
index 000000000000..4b60d18179f7
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/memory.h
@@ -0,0 +1,18 @@
1/* arch/arm/mach-s5pc100/include/mach/memory.h
2 *
3 * Copyright 2008 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on mach-s3c6400/include/mach/memory.h
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#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16#define PHYS_OFFSET UL(0x20000000)
17
18#endif
diff --git a/arch/arm/mach-s5pc100/include/mach/pwm-clock.h b/arch/arm/mach-s5pc100/include/mach/pwm-clock.h
new file mode 100644
index 000000000000..b34d2f7aae52
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/pwm-clock.h
@@ -0,0 +1,56 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/pwm-clock.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - pwm clock and timer support
7 *
8 * Based on mach-s3c6400/include/mach/pwm-clock.h
9 */
10
11/**
12 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
13 * @tcfg: The timer TCFG1 register bits shifted down to 0.
14 *
15 * Return true if the given configuration from TCFG1 is a TCLK instead
16 * any of the TDIV clocks.
17 */
18static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
19{
20 return tcfg >= S3C64XX_TCFG1_MUX_TCLK;
21}
22
23/**
24 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
25 * @tcfg1: The tcfg1 setting, shifted down.
26 *
27 * Get the divisor value for the given tcfg1 setting. We assume the
28 * caller has already checked to see if this is not a TCLK source.
29 */
30static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
31{
32 return 1 << tcfg1;
33}
34
35/**
36 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
37 *
38 * Return true if we have a /1 in the tdiv setting.
39 */
40static inline unsigned int pwm_tdiv_has_div1(void)
41{
42 return 1;
43}
44
45/**
46 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
47 * @div: The divisor to calculate the bit information for.
48 *
49 * Turn a divisor into the necessary bit field for TCFG1.
50 */
51static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
52{
53 return ilog2(div);
54}
55
56#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK
diff --git a/arch/arm/mach-s5pc100/include/mach/regs-irq.h b/arch/arm/mach-s5pc100/include/mach/regs-irq.h
new file mode 100644
index 000000000000..751ac15438c8
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/regs-irq.h
@@ -0,0 +1,24 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/regs-irq.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX - IRQ register definitions
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#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15
16#include <mach/map.h>
17#include <asm/hardware/vic.h>
18
19/* interrupt controller */
20#define S5PC1XX_VIC0REG(x) ((x) + S5PC1XX_VA_VIC(0))
21#define S5PC1XX_VIC1REG(x) ((x) + S5PC1XX_VA_VIC(1))
22#define S5PC1XX_VIC2REG(x) ((x) + S5PC1XX_VA_VIC(2))
23
24#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/system.h b/arch/arm/mach-s5pc100/include/mach/system.h
new file mode 100644
index 000000000000..e39014375470
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/system.h
@@ -0,0 +1,24 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/system.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX - system implementation
7 *
8 * Based on mach-s3c6400/include/mach/system.h
9 */
10
11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H __FILE__
13
14static void arch_idle(void)
15{
16 /* nothing here yet */
17}
18
19static void arch_reset(char mode, const char *cmd)
20{
21 /* nothing here yet */
22}
23
24#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/tick.h b/arch/arm/mach-s5pc100/include/mach/tick.h
new file mode 100644
index 000000000000..d3de0f3591ae
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/tick.h
@@ -0,0 +1,29 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/tick.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S3C64XX - Timer tick support definitions
7 *
8 * Based on mach-s3c6400/include/mach/tick.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__
17
18/* note, the timer interrutps turn up in 2 places, the vic and then
19 * the timer block. We take the VIC as the base at the moment.
20 */
21static inline u32 s3c24xx_ostimer_pending(void)
22{
23 u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS);
24 return pend & 1 << (IRQ_TIMER4 - S5PC1XX_IRQ_VIC0(0));
25}
26
27#define TICK_MAX (0xffffffff)
28
29#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/uncompress.h b/arch/arm/mach-s5pc100/include/mach/uncompress.h
new file mode 100644
index 000000000000..01ccf535e76c
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/uncompress.h
@@ -0,0 +1,28 @@
1/* arch/arm/mach-s5pc100/include/mach/uncompress.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - uncompress code
7 *
8 * Based on mach-s3c6400/include/mach/uncompress.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_UNCOMPRESS_H
16#define __ASM_ARCH_UNCOMPRESS_H
17
18#include <mach/map.h>
19#include <plat/uncompress.h>
20
21static void arch_detect_cpu(void)
22{
23 /* we do not need to do any cpu detection here at the moment. */
24 fifo_mask = S3C2440_UFSTAT_TXMASK;
25 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
26}
27
28#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
new file mode 100644
index 000000000000..214093cd7632
--- /dev/null
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -0,0 +1,103 @@
1/* linux/arch/arm/mach-s5pc100/mach-smdkc100.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Author: Byungho Min <bhmin@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10*/
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/gpio.h>
22#include <linux/i2c.h>
23#include <linux/fb.h>
24#include <linux/delay.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28
29#include <mach/map.h>
30
31#include <asm/irq.h>
32#include <asm/mach-types.h>
33
34#include <plat/regs-serial.h>
35
36#include <plat/clock.h>
37#include <plat/devs.h>
38#include <plat/cpu.h>
39#include <plat/s5pc100.h>
40
41#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
42#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
43#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
44
45static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
46 [0] = {
47 .hwport = 0,
48 .flags = 0,
49 .ucon = 0x3c5,
50 .ulcon = 0x03,
51 .ufcon = 0x51,
52 },
53 [1] = {
54 .hwport = 1,
55 .flags = 0,
56 .ucon = 0x3c5,
57 .ulcon = 0x03,
58 .ufcon = 0x51,
59 },
60 [2] = {
61 .hwport = 2,
62 .flags = 0,
63 .ucon = 0x3c5,
64 .ulcon = 0x03,
65 .ufcon = 0x51,
66 },
67 [3] = {
68 .hwport = 3,
69 .flags = 0,
70 .ucon = 0x3c5,
71 .ulcon = 0x03,
72 .ufcon = 0x51,
73 },
74};
75
76static struct map_desc smdkc100_iodesc[] = {};
77
78static struct platform_device *smdkc100_devices[] __initdata = {
79};
80
81static void __init smdkc100_map_io(void)
82{
83 s5pc1xx_init_io(smdkc100_iodesc, ARRAY_SIZE(smdkc100_iodesc));
84 s3c24xx_init_clocks(12000000);
85 s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
86}
87
88static void __init smdkc100_machine_init(void)
89{
90 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
91}
92
93MACHINE_START(SMDKC100, "SMDKC100")
94 /* Maintainer: Byungho Min <bhmin@samsung.com> */
95 .phys_io = S5PC1XX_PA_UART & 0xfff00000,
96 .io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc,
97 .boot_params = S5PC100_PA_SDRAM + 0x100,
98
99 .init_irq = s5pc100_init_irq,
100 .map_io = smdkc100_map_io,
101 .init_machine = smdkc100_machine_init,
102 .timer = &s3c24xx_timer,
103MACHINE_END
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 89b3ccf35e1b..7936085dd758 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -455,8 +455,8 @@ void __init u300_init_irq(void)
455 for (i = 0; i < NR_IRQS; i++) 455 for (i = 0; i < NR_IRQS; i++)
456 set_bit(i, (unsigned long *) &mask[0]); 456 set_bit(i, (unsigned long *) &mask[0]);
457 u300_enable_intcon_clock(); 457 u300_enable_intcon_clock();
458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], 0); 458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]);
459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], 0); 459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
460} 460}
461 461
462 462
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index afc0f87f3fa4..975eae41ee66 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -343,8 +343,7 @@ static struct platform_device versatile_i2c_device = {
343 343
344static struct i2c_board_info versatile_i2c_board_info[] = { 344static struct i2c_board_info versatile_i2c_board_info[] = {
345 { 345 {
346 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), 346 I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
347 .type = "ds1338",
348 }, 347 },
349}; 348};
350 349
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 83c025e72ceb..5fe595aeba69 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -758,7 +758,7 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
758config CACHE_L2X0 758config CACHE_L2X0
759 bool "Enable the L2x0 outer cache controller" 759 bool "Enable the L2x0 outer cache controller"
760 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 760 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
761 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX 761 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK
762 default y 762 default y
763 select OUTER_CACHE 763 select OUTER_CACHE
764 help 764 help
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 03cd27d917b9..b270d6228fe2 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -159,7 +159,9 @@ union offset_union {
159 159
160#define __get8_unaligned_check(ins,val,addr,err) \ 160#define __get8_unaligned_check(ins,val,addr,err) \
161 __asm__( \ 161 __asm__( \
162 "1: "ins" %1, [%2], #1\n" \ 162 ARM( "1: "ins" %1, [%2], #1\n" ) \
163 THUMB( "1: "ins" %1, [%2]\n" ) \
164 THUMB( " add %2, %2, #1\n" ) \
163 "2:\n" \ 165 "2:\n" \
164 " .section .fixup,\"ax\"\n" \ 166 " .section .fixup,\"ax\"\n" \
165 " .align 2\n" \ 167 " .align 2\n" \
@@ -215,7 +217,9 @@ union offset_union {
215 do { \ 217 do { \
216 unsigned int err = 0, v = val, a = addr; \ 218 unsigned int err = 0, v = val, a = addr; \
217 __asm__( FIRST_BYTE_16 \ 219 __asm__( FIRST_BYTE_16 \
218 "1: "ins" %1, [%2], #1\n" \ 220 ARM( "1: "ins" %1, [%2], #1\n" ) \
221 THUMB( "1: "ins" %1, [%2]\n" ) \
222 THUMB( " add %2, %2, #1\n" ) \
219 " mov %1, %1, "NEXT_BYTE"\n" \ 223 " mov %1, %1, "NEXT_BYTE"\n" \
220 "2: "ins" %1, [%2]\n" \ 224 "2: "ins" %1, [%2]\n" \
221 "3:\n" \ 225 "3:\n" \
@@ -245,11 +249,17 @@ union offset_union {
245 do { \ 249 do { \
246 unsigned int err = 0, v = val, a = addr; \ 250 unsigned int err = 0, v = val, a = addr; \
247 __asm__( FIRST_BYTE_32 \ 251 __asm__( FIRST_BYTE_32 \
248 "1: "ins" %1, [%2], #1\n" \ 252 ARM( "1: "ins" %1, [%2], #1\n" ) \
253 THUMB( "1: "ins" %1, [%2]\n" ) \
254 THUMB( " add %2, %2, #1\n" ) \
249 " mov %1, %1, "NEXT_BYTE"\n" \ 255 " mov %1, %1, "NEXT_BYTE"\n" \
250 "2: "ins" %1, [%2], #1\n" \ 256 ARM( "2: "ins" %1, [%2], #1\n" ) \
257 THUMB( "2: "ins" %1, [%2]\n" ) \
258 THUMB( " add %2, %2, #1\n" ) \
251 " mov %1, %1, "NEXT_BYTE"\n" \ 259 " mov %1, %1, "NEXT_BYTE"\n" \
252 "3: "ins" %1, [%2], #1\n" \ 260 ARM( "3: "ins" %1, [%2], #1\n" ) \
261 THUMB( "3: "ins" %1, [%2]\n" ) \
262 THUMB( " add %2, %2, #1\n" ) \
253 " mov %1, %1, "NEXT_BYTE"\n" \ 263 " mov %1, %1, "NEXT_BYTE"\n" \
254 "4: "ins" %1, [%2]\n" \ 264 "4: "ins" %1, [%2]\n" \
255 "5:\n" \ 265 "5:\n" \
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index be93ff02a98d..bda0ec31a4e2 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -21,7 +21,7 @@
21 * 21 *
22 * Flush the whole D-cache. 22 * Flush the whole D-cache.
23 * 23 *
24 * Corrupted registers: r0-r5, r7, r9-r11 24 * Corrupted registers: r0-r7, r9-r11 (r6 only in Thumb mode)
25 * 25 *
26 * - mm - mm_struct describing address space 26 * - mm - mm_struct describing address space
27 */ 27 */
@@ -51,8 +51,12 @@ loop1:
51loop2: 51loop2:
52 mov r9, r4 @ create working copy of max way size 52 mov r9, r4 @ create working copy of max way size
53loop3: 53loop3:
54 orr r11, r10, r9, lsl r5 @ factor way and cache number into r11 54 ARM( orr r11, r10, r9, lsl r5 ) @ factor way and cache number into r11
55 orr r11, r11, r7, lsl r2 @ factor index number into r11 55 THUMB( lsl r6, r9, r5 )
56 THUMB( orr r11, r10, r6 ) @ factor way and cache number into r11
57 ARM( orr r11, r11, r7, lsl r2 ) @ factor index number into r11
58 THUMB( lsl r6, r7, r2 )
59 THUMB( orr r11, r11, r6 ) @ factor index number into r11
56 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way 60 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way
57 subs r9, r9, #1 @ decrement the way 61 subs r9, r9, #1 @ decrement the way
58 bge loop3 62 bge loop3
@@ -82,11 +86,13 @@ ENDPROC(v7_flush_dcache_all)
82 * 86 *
83 */ 87 */
84ENTRY(v7_flush_kern_cache_all) 88ENTRY(v7_flush_kern_cache_all)
85 stmfd sp!, {r4-r5, r7, r9-r11, lr} 89 ARM( stmfd sp!, {r4-r5, r7, r9-r11, lr} )
90 THUMB( stmfd sp!, {r4-r7, r9-r11, lr} )
86 bl v7_flush_dcache_all 91 bl v7_flush_dcache_all
87 mov r0, #0 92 mov r0, #0
88 mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate 93 mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate
89 ldmfd sp!, {r4-r5, r7, r9-r11, lr} 94 ARM( ldmfd sp!, {r4-r5, r7, r9-r11, lr} )
95 THUMB( ldmfd sp!, {r4-r7, r9-r11, lr} )
90 mov pc, lr 96 mov pc, lr
91ENDPROC(v7_flush_kern_cache_all) 97ENDPROC(v7_flush_kern_cache_all)
92 98
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 510c179b0ac8..b30925fcbcdc 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -36,7 +36,34 @@
36#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT) 36#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
37#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT) 37#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
38 38
39static u64 get_coherent_dma_mask(struct device *dev)
40{
41 u64 mask = ISA_DMA_THRESHOLD;
42
43 if (dev) {
44 mask = dev->coherent_dma_mask;
45
46 /*
47 * Sanity check the DMA mask - it must be non-zero, and
48 * must be able to be satisfied by a DMA allocation.
49 */
50 if (mask == 0) {
51 dev_warn(dev, "coherent DMA mask is unset\n");
52 return 0;
53 }
54
55 if ((~mask) & ISA_DMA_THRESHOLD) {
56 dev_warn(dev, "coherent DMA mask %#llx is smaller "
57 "than system GFP_DMA mask %#llx\n",
58 mask, (unsigned long long)ISA_DMA_THRESHOLD);
59 return 0;
60 }
61 }
39 62
63 return mask;
64}
65
66#ifdef CONFIG_MMU
40/* 67/*
41 * These are the page tables (2MB each) covering uncached, DMA consistent allocations 68 * These are the page tables (2MB each) covering uncached, DMA consistent allocations
42 */ 69 */
@@ -152,7 +179,8 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
152 struct page *page; 179 struct page *page;
153 struct arm_vm_region *c; 180 struct arm_vm_region *c;
154 unsigned long order; 181 unsigned long order;
155 u64 mask = ISA_DMA_THRESHOLD, limit; 182 u64 mask = get_coherent_dma_mask(dev);
183 u64 limit;
156 184
157 if (!consistent_pte[0]) { 185 if (!consistent_pte[0]) {
158 printk(KERN_ERR "%s: not initialised\n", __func__); 186 printk(KERN_ERR "%s: not initialised\n", __func__);
@@ -160,25 +188,8 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
160 return NULL; 188 return NULL;
161 } 189 }
162 190
163 if (dev) { 191 if (!mask)
164 mask = dev->coherent_dma_mask; 192 goto no_page;
165
166 /*
167 * Sanity check the DMA mask - it must be non-zero, and
168 * must be able to be satisfied by a DMA allocation.
169 */
170 if (mask == 0) {
171 dev_warn(dev, "coherent DMA mask is unset\n");
172 goto no_page;
173 }
174
175 if ((~mask) & ISA_DMA_THRESHOLD) {
176 dev_warn(dev, "coherent DMA mask %#llx is smaller "
177 "than system GFP_DMA mask %#llx\n",
178 mask, (unsigned long long)ISA_DMA_THRESHOLD);
179 goto no_page;
180 }
181 }
182 193
183 /* 194 /*
184 * Sanity check the allocation size. 195 * Sanity check the allocation size.
@@ -267,6 +278,31 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
267 *handle = ~0; 278 *handle = ~0;
268 return NULL; 279 return NULL;
269} 280}
281#else /* !CONFIG_MMU */
282static void *
283__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
284 pgprot_t prot)
285{
286 void *virt;
287 u64 mask = get_coherent_dma_mask(dev);
288
289 if (!mask)
290 goto error;
291
292 if (mask != 0xffffffff)
293 gfp |= GFP_DMA;
294 virt = kmalloc(size, gfp);
295 if (!virt)
296 goto error;
297
298 *handle = virt_to_dma(dev, virt);
299 return virt;
300
301error:
302 *handle = ~0;
303 return NULL;
304}
305#endif /* CONFIG_MMU */
270 306
271/* 307/*
272 * Allocate DMA-coherent memory space and return both the kernel remapped 308 * Allocate DMA-coherent memory space and return both the kernel remapped
@@ -311,9 +347,10 @@ EXPORT_SYMBOL(dma_alloc_writecombine);
311static int dma_mmap(struct device *dev, struct vm_area_struct *vma, 347static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
312 void *cpu_addr, dma_addr_t dma_addr, size_t size) 348 void *cpu_addr, dma_addr_t dma_addr, size_t size)
313{ 349{
350 int ret = -ENXIO;
351#ifdef CONFIG_MMU
314 unsigned long flags, user_size, kern_size; 352 unsigned long flags, user_size, kern_size;
315 struct arm_vm_region *c; 353 struct arm_vm_region *c;
316 int ret = -ENXIO;
317 354
318 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 355 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
319 356
@@ -334,6 +371,7 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
334 vma->vm_page_prot); 371 vma->vm_page_prot);
335 } 372 }
336 } 373 }
374#endif /* CONFIG_MMU */
337 375
338 return ret; 376 return ret;
339} 377}
@@ -358,6 +396,7 @@ EXPORT_SYMBOL(dma_mmap_writecombine);
358 * free a page as defined by the above mapping. 396 * free a page as defined by the above mapping.
359 * Must not be called with IRQs disabled. 397 * Must not be called with IRQs disabled.
360 */ 398 */
399#ifdef CONFIG_MMU
361void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle) 400void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
362{ 401{
363 struct arm_vm_region *c; 402 struct arm_vm_region *c;
@@ -444,6 +483,14 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
444 __func__, cpu_addr); 483 __func__, cpu_addr);
445 dump_stack(); 484 dump_stack();
446} 485}
486#else /* !CONFIG_MMU */
487void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
488{
489 if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
490 return;
491 kfree(cpu_addr);
492}
493#endif /* CONFIG_MMU */
447EXPORT_SYMBOL(dma_free_coherent); 494EXPORT_SYMBOL(dma_free_coherent);
448 495
449/* 496/*
@@ -451,10 +498,12 @@ EXPORT_SYMBOL(dma_free_coherent);
451 */ 498 */
452static int __init consistent_init(void) 499static int __init consistent_init(void)
453{ 500{
501 int ret = 0;
502#ifdef CONFIG_MMU
454 pgd_t *pgd; 503 pgd_t *pgd;
455 pmd_t *pmd; 504 pmd_t *pmd;
456 pte_t *pte; 505 pte_t *pte;
457 int ret = 0, i = 0; 506 int i = 0;
458 u32 base = CONSISTENT_BASE; 507 u32 base = CONSISTENT_BASE;
459 508
460 do { 509 do {
@@ -477,6 +526,7 @@ static int __init consistent_init(void)
477 consistent_pte[i++] = pte; 526 consistent_pte[i++] = pte;
478 base += (1 << PGDIR_SHIFT); 527 base += (1 << PGDIR_SHIFT);
479 } while (base < CONSISTENT_END); 528 } while (base < CONSISTENT_END);
529#endif /* !CONFIG_MMU */
480 530
481 return ret; 531 return ret;
482} 532}
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 5fa8dea5a371..cc8829d7e116 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -16,6 +16,7 @@
16#include <linux/kprobes.h> 16#include <linux/kprobes.h>
17#include <linux/uaccess.h> 17#include <linux/uaccess.h>
18#include <linux/page-flags.h> 18#include <linux/page-flags.h>
19#include <linux/sched.h>
19#include <linux/highmem.h> 20#include <linux/highmem.h>
20 21
21#include <asm/system.h> 22#include <asm/system.h>
@@ -24,6 +25,7 @@
24 25
25#include "fault.h" 26#include "fault.h"
26 27
28#ifdef CONFIG_MMU
27 29
28#ifdef CONFIG_KPROBES 30#ifdef CONFIG_KPROBES
29static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) 31static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
@@ -98,6 +100,10 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
98 100
99 printk("\n"); 101 printk("\n");
100} 102}
103#else /* CONFIG_MMU */
104void show_pte(struct mm_struct *mm, unsigned long addr)
105{ }
106#endif /* CONFIG_MMU */
101 107
102/* 108/*
103 * Oops. The kernel tried to access some page that wasn't present. 109 * Oops. The kernel tried to access some page that wasn't present.
@@ -172,6 +178,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
172 __do_kernel_fault(mm, addr, fsr, regs); 178 __do_kernel_fault(mm, addr, fsr, regs);
173} 179}
174 180
181#ifdef CONFIG_MMU
175#define VM_FAULT_BADMAP 0x010000 182#define VM_FAULT_BADMAP 0x010000
176#define VM_FAULT_BADACCESS 0x020000 183#define VM_FAULT_BADACCESS 0x020000
177 184
@@ -323,6 +330,13 @@ no_context:
323 __do_kernel_fault(mm, addr, fsr, regs); 330 __do_kernel_fault(mm, addr, fsr, regs);
324 return 0; 331 return 0;
325} 332}
333#else /* CONFIG_MMU */
334static int
335do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
336{
337 return 0;
338}
339#endif /* CONFIG_MMU */
326 340
327/* 341/*
328 * First Level Translation Fault Handler 342 * First Level Translation Fault Handler
@@ -341,6 +355,7 @@ no_context:
341 * interrupt or a critical region, and should only copy the information 355 * interrupt or a critical region, and should only copy the information
342 * from the master page table, nothing more. 356 * from the master page table, nothing more.
343 */ 357 */
358#ifdef CONFIG_MMU
344static int __kprobes 359static int __kprobes
345do_translation_fault(unsigned long addr, unsigned int fsr, 360do_translation_fault(unsigned long addr, unsigned int fsr,
346 struct pt_regs *regs) 361 struct pt_regs *regs)
@@ -379,6 +394,14 @@ bad_area:
379 do_bad_area(addr, fsr, regs); 394 do_bad_area(addr, fsr, regs);
380 return 0; 395 return 0;
381} 396}
397#else /* CONFIG_MMU */
398static int
399do_translation_fault(unsigned long addr, unsigned int fsr,
400 struct pt_regs *regs)
401{
402 return 0;
403}
404#endif /* CONFIG_MMU */
382 405
383/* 406/*
384 * Some section permission faults need to be handled gracefully. 407 * Some section permission faults need to be handled gracefully.
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index ad7bacc693b2..900811cc9130 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -12,6 +12,7 @@
12#include <asm/cacheflush.h> 12#include <asm/cacheflush.h>
13#include <asm/sections.h> 13#include <asm/sections.h>
14#include <asm/page.h> 14#include <asm/page.h>
15#include <asm/setup.h>
15#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
16 17
17#include "mm.h" 18#include "mm.h"
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index a0b3f36f3178..7d63beaf9745 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -77,6 +77,7 @@
77 * Sanity check the PTE configuration for the code below - which makes 77 * Sanity check the PTE configuration for the code below - which makes
78 * certain assumptions about how these bits are layed out. 78 * certain assumptions about how these bits are layed out.
79 */ 79 */
80#ifdef CONFIG_MMU
80#if L_PTE_SHARED != PTE_EXT_SHARED 81#if L_PTE_SHARED != PTE_EXT_SHARED
81#error PTE shared bit mismatch 82#error PTE shared bit mismatch
82#endif 83#endif
@@ -84,6 +85,7 @@
84 L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED 85 L_PTE_FILE+L_PTE_PRESENT) > L_PTE_SHARED
85#error Invalid Linux PTE bit settings 86#error Invalid Linux PTE bit settings
86#endif 87#endif
88#endif /* CONFIG_MMU */
87 89
88/* 90/*
89 * The ARMv6 and ARMv7 set_pte_ext translation function. 91 * The ARMv6 and ARMv7 set_pte_ext translation function.
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 180a08d03a03..f3fa1c32fe92 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -127,7 +127,9 @@ ENDPROC(cpu_v7_switch_mm)
127 */ 127 */
128ENTRY(cpu_v7_set_pte_ext) 128ENTRY(cpu_v7_set_pte_ext)
129#ifdef CONFIG_MMU 129#ifdef CONFIG_MMU
130 str r1, [r0], #-2048 @ linux version 130 ARM( str r1, [r0], #-2048 ) @ linux version
131 THUMB( str r1, [r0] ) @ linux version
132 THUMB( sub r0, r0, #2048 )
131 133
132 bic r3, r1, #0x000003f0 134 bic r3, r1, #0x000003f0
133 bic r3, r3, #PTE_TYPE_MASK 135 bic r3, r3, #PTE_TYPE_MASK
@@ -232,7 +234,6 @@ __v7_setup:
232 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 234 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
233 mov r10, #0x1f @ domains 0, 1 = manager 235 mov r10, #0x1f @ domains 0, 1 = manager
234 mcr p15, 0, r10, c3, c0, 0 @ load domain access register 236 mcr p15, 0, r10, c3, c0, 0 @ load domain access register
235#endif
236 /* 237 /*
237 * Memory region attributes with SCTLR.TRE=1 238 * Memory region attributes with SCTLR.TRE=1
238 * 239 *
@@ -265,6 +266,7 @@ __v7_setup:
265 ldr r6, =0x40e040e0 @ NMRR 266 ldr r6, =0x40e040e0 @ NMRR
266 mcr p15, 0, r5, c10, c2, 0 @ write PRRR 267 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
267 mcr p15, 0, r6, c10, c2, 1 @ write NMRR 268 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
269#endif
268 adr r5, v7_crval 270 adr r5, v7_crval
269 ldmia r5, {r5, r6} 271 ldmia r5, {r5, r6}
270#ifdef CONFIG_CPU_ENDIAN_BE8 272#ifdef CONFIG_CPU_ENDIAN_BE8
@@ -273,6 +275,7 @@ __v7_setup:
273 mrc p15, 0, r0, c1, c0, 0 @ read control register 275 mrc p15, 0, r0, c1, c0, 0 @ read control register
274 bic r0, r0, r5 @ clear bits them 276 bic r0, r0, r5 @ clear bits them
275 orr r0, r0, r6 @ set them 277 orr r0, r0, r6 @ set them
278 THUMB( orr r0, r0, #1 << 30 ) @ Thumb exceptions
276 mov pc, lr @ return to head.S:__ret 279 mov pc, lr @ return to head.S:__ret
277ENDPROC(__v7_setup) 280ENDPROC(__v7_setup)
278 281
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 8986b7412235..ca5c7c226341 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -9,6 +9,7 @@ choice
9config ARCH_MX1 9config ARCH_MX1
10 bool "MX1-based" 10 bool "MX1-based"
11 select CPU_ARM920T 11 select CPU_ARM920T
12 select COMMON_CLKDEV
12 help 13 help
13 This enables support for systems based on the Freescale i.MX1 family 14 This enables support for systems based on the Freescale i.MX1 family
14 15
@@ -19,6 +20,13 @@ config ARCH_MX2
19 help 20 help
20 This enables support for systems based on the Freescale i.MX2 family 21 This enables support for systems based on the Freescale i.MX2 family
21 22
23config ARCH_MX25
24 bool "MX25-based"
25 select CPU_ARM926T
26 select COMMON_CLKDEV
27 help
28 This enables support for systems based on the Freescale i.MX25 family
29
22config ARCH_MX3 30config ARCH_MX3
23 bool "MX3-based" 31 bool "MX3-based"
24 select CPU_V6 32 select CPU_V6
@@ -26,11 +34,20 @@ config ARCH_MX3
26 help 34 help
27 This enables support for systems based on the Freescale i.MX3 family 35 This enables support for systems based on the Freescale i.MX3 family
28 36
37config ARCH_MXC91231
38 bool "MXC91231-based"
39 select CPU_V6
40 select COMMON_CLKDEV
41 help
42 This enables support for systems based on the Freescale MXC91231 family
43
29endchoice 44endchoice
30 45
31source "arch/arm/mach-mx1/Kconfig" 46source "arch/arm/mach-mx1/Kconfig"
32source "arch/arm/mach-mx2/Kconfig" 47source "arch/arm/mach-mx2/Kconfig"
33source "arch/arm/mach-mx3/Kconfig" 48source "arch/arm/mach-mx3/Kconfig"
49source "arch/arm/mach-mx25/Kconfig"
50source "arch/arm/mach-mxc91231/Kconfig"
34 51
35endmenu 52endmenu
36 53
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index 92e13566cd4f..9e8fbd57495c 100644
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -39,6 +39,7 @@
39#include <linux/string.h> 39#include <linux/string.h>
40 40
41#include <mach/clock.h> 41#include <mach/clock.h>
42#include <mach/hardware.h>
42 43
43static LIST_HEAD(clocks); 44static LIST_HEAD(clocks);
44static DEFINE_MUTEX(clocks_mutex); 45static DEFINE_MUTEX(clocks_mutex);
@@ -47,76 +48,6 @@ static DEFINE_MUTEX(clocks_mutex);
47 * Standard clock functions defined in include/linux/clk.h 48 * Standard clock functions defined in include/linux/clk.h
48 *-------------------------------------------------------------------------*/ 49 *-------------------------------------------------------------------------*/
49 50
50/*
51 * All the code inside #ifndef CONFIG_COMMON_CLKDEV can be removed once all
52 * MXC architectures have switched to using clkdev.
53 */
54#ifndef CONFIG_COMMON_CLKDEV
55/*
56 * Retrieve a clock by name.
57 *
58 * Note that we first try to use device id on the bus
59 * and clock name. If this fails, we try to use "<name>.<id>". If this fails,
60 * we try to use clock name only.
61 * The reference count to the clock's module owner ref count is incremented.
62 */
63struct clk *clk_get(struct device *dev, const char *id)
64{
65 struct clk *p, *clk = ERR_PTR(-ENOENT);
66 int idno;
67 const char *str;
68
69 if (id == NULL)
70 return clk;
71
72 if (dev == NULL || dev->bus != &platform_bus_type)
73 idno = -1;
74 else
75 idno = to_platform_device(dev)->id;
76
77 mutex_lock(&clocks_mutex);
78
79 list_for_each_entry(p, &clocks, node) {
80 if (p->id == idno &&
81 strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
82 clk = p;
83 goto found;
84 }
85 }
86
87 str = strrchr(id, '.');
88 if (str) {
89 int cnt = str - id;
90 str++;
91 idno = simple_strtol(str, NULL, 10);
92 list_for_each_entry(p, &clocks, node) {
93 if (p->id == idno &&
94 strlen(p->name) == cnt &&
95 strncmp(id, p->name, cnt) == 0 &&
96 try_module_get(p->owner)) {
97 clk = p;
98 goto found;
99 }
100 }
101 }
102
103 list_for_each_entry(p, &clocks, node) {
104 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
105 clk = p;
106 goto found;
107 }
108 }
109
110 printk(KERN_WARNING "clk: Unable to get requested clock: %s\n", id);
111
112found:
113 mutex_unlock(&clocks_mutex);
114
115 return clk;
116}
117EXPORT_SYMBOL(clk_get);
118#endif
119
120static void __clk_disable(struct clk *clk) 51static void __clk_disable(struct clk *clk)
121{ 52{
122 if (clk == NULL || IS_ERR(clk)) 53 if (clk == NULL || IS_ERR(clk))
@@ -193,16 +124,6 @@ unsigned long clk_get_rate(struct clk *clk)
193} 124}
194EXPORT_SYMBOL(clk_get_rate); 125EXPORT_SYMBOL(clk_get_rate);
195 126
196#ifndef CONFIG_COMMON_CLKDEV
197/* Decrement the clock's module reference count */
198void clk_put(struct clk *clk)
199{
200 if (clk && !IS_ERR(clk))
201 module_put(clk->owner);
202}
203EXPORT_SYMBOL(clk_put);
204#endif
205
206/* Round the requested clock rate to the nearest supported 127/* Round the requested clock rate to the nearest supported
207 * rate that is less than or equal to the requested rate. 128 * rate that is less than or equal to the requested rate.
208 * This is dependent on the clock's current parent. 129 * This is dependent on the clock's current parent.
@@ -265,80 +186,6 @@ struct clk *clk_get_parent(struct clk *clk)
265} 186}
266EXPORT_SYMBOL(clk_get_parent); 187EXPORT_SYMBOL(clk_get_parent);
267 188
268#ifndef CONFIG_COMMON_CLKDEV
269/*
270 * Add a new clock to the clock tree.
271 */
272int clk_register(struct clk *clk)
273{
274 if (clk == NULL || IS_ERR(clk))
275 return -EINVAL;
276
277 mutex_lock(&clocks_mutex);
278 list_add(&clk->node, &clocks);
279 mutex_unlock(&clocks_mutex);
280
281 return 0;
282}
283EXPORT_SYMBOL(clk_register);
284
285/* Remove a clock from the clock tree */
286void clk_unregister(struct clk *clk)
287{
288 if (clk == NULL || IS_ERR(clk))
289 return;
290
291 mutex_lock(&clocks_mutex);
292 list_del(&clk->node);
293 mutex_unlock(&clocks_mutex);
294}
295EXPORT_SYMBOL(clk_unregister);
296
297#ifdef CONFIG_PROC_FS
298static int mxc_clock_read_proc(char *page, char **start, off_t off,
299 int count, int *eof, void *data)
300{
301 struct clk *clkp;
302 char *p = page;
303 int len;
304
305 list_for_each_entry(clkp, &clocks, node) {
306 p += sprintf(p, "%s-%d:\t\t%lu, %d", clkp->name, clkp->id,
307 clk_get_rate(clkp), clkp->usecount);
308 if (clkp->parent)
309 p += sprintf(p, ", %s-%d\n", clkp->parent->name,
310 clkp->parent->id);
311 else
312 p += sprintf(p, "\n");
313 }
314
315 len = (p - page) - off;
316 if (len < 0)
317 len = 0;
318
319 *eof = (len <= count) ? 1 : 0;
320 *start = page + off;
321
322 return len;
323}
324
325static int __init mxc_setup_proc_entry(void)
326{
327 struct proc_dir_entry *res;
328
329 res = create_proc_read_entry("cpu/clocks", 0, NULL,
330 mxc_clock_read_proc, NULL);
331 if (!res) {
332 printk(KERN_ERR "Failed to create proc/cpu/clocks\n");
333 return -ENOMEM;
334 }
335 return 0;
336}
337
338late_initcall(mxc_setup_proc_entry);
339#endif /* CONFIG_PROC_FS */
340#endif
341
342/* 189/*
343 * Get the resulting clock rate from a PLL register value and the input 190 * Get the resulting clock rate from a PLL register value and the input
344 * frequency. PLLs with this register layout can at least be found on 191 * frequency. PLLs with this register layout can at least be found on
@@ -363,12 +210,11 @@ unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq)
363 210
364 mfn_abs = mfn; 211 mfn_abs = mfn;
365 212
366#if !defined CONFIG_ARCH_MX1 && !defined CONFIG_ARCH_MX21 213 /* On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit
367 if (mfn >= 0x200) { 214 * 2's complements number
368 mfn |= 0xFFFFFE00; 215 */
369 mfn_abs = -mfn; 216 if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200)
370 } 217 mfn_abs = 0x400 - mfn;
371#endif
372 218
373 freq *= 2; 219 freq *= 2;
374 freq /= pd + 1; 220 freq /= pd + 1;
@@ -376,8 +222,10 @@ unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq)
376 ll = (unsigned long long)freq * mfn_abs; 222 ll = (unsigned long long)freq * mfn_abs;
377 223
378 do_div(ll, mfd + 1); 224 do_div(ll, mfd + 1);
379 if (mfn < 0) 225
226 if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200)
380 ll = -ll; 227 ll = -ll;
228
381 ll = (freq * mfi) + ll; 229 ll = (freq * mfi) + ll;
382 230
383 return ll; 231 return ll;
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index 7506d963be4b..cfc4a8b43e6a 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -29,6 +29,23 @@
29static struct mxc_gpio_port *mxc_gpio_ports; 29static struct mxc_gpio_port *mxc_gpio_ports;
30static int gpio_table_size; 30static int gpio_table_size;
31 31
32#define cpu_is_mx1_mx2() (cpu_is_mx1() || cpu_is_mx2())
33
34#define GPIO_DR (cpu_is_mx1_mx2() ? 0x1c : 0x00)
35#define GPIO_GDIR (cpu_is_mx1_mx2() ? 0x00 : 0x04)
36#define GPIO_PSR (cpu_is_mx1_mx2() ? 0x24 : 0x08)
37#define GPIO_ICR1 (cpu_is_mx1_mx2() ? 0x28 : 0x0C)
38#define GPIO_ICR2 (cpu_is_mx1_mx2() ? 0x2C : 0x10)
39#define GPIO_IMR (cpu_is_mx1_mx2() ? 0x30 : 0x14)
40#define GPIO_ISR (cpu_is_mx1_mx2() ? 0x34 : 0x18)
41#define GPIO_ISR (cpu_is_mx1_mx2() ? 0x34 : 0x18)
42
43#define GPIO_INT_LOW_LEV (cpu_is_mx1_mx2() ? 0x3 : 0x0)
44#define GPIO_INT_HIGH_LEV (cpu_is_mx1_mx2() ? 0x2 : 0x1)
45#define GPIO_INT_RISE_EDGE (cpu_is_mx1_mx2() ? 0x0 : 0x2)
46#define GPIO_INT_FALL_EDGE (cpu_is_mx1_mx2() ? 0x1 : 0x3)
47#define GPIO_INT_NONE 0x4
48
32/* Note: This driver assumes 32 GPIOs are handled in one register */ 49/* Note: This driver assumes 32 GPIOs are handled in one register */
33 50
34static void _clear_gpio_irqstatus(struct mxc_gpio_port *port, u32 index) 51static void _clear_gpio_irqstatus(struct mxc_gpio_port *port, u32 index)
@@ -162,7 +179,6 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
162 } 179 }
163} 180}
164 181
165#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX1)
166/* MX1 and MX3 has one interrupt *per* gpio port */ 182/* MX1 and MX3 has one interrupt *per* gpio port */
167static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc) 183static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
168{ 184{
@@ -174,9 +190,7 @@ static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
174 190
175 mxc_gpio_irq_handler(port, irq_stat); 191 mxc_gpio_irq_handler(port, irq_stat);
176} 192}
177#endif
178 193
179#ifdef CONFIG_ARCH_MX2
180/* MX2 has one interrupt *for all* gpio ports */ 194/* MX2 has one interrupt *for all* gpio ports */
181static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc) 195static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
182{ 196{
@@ -195,7 +209,6 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
195 mxc_gpio_irq_handler(&port[i], irq_stat); 209 mxc_gpio_irq_handler(&port[i], irq_stat);
196 } 210 }
197} 211}
198#endif
199 212
200static struct irq_chip gpio_irq_chip = { 213static struct irq_chip gpio_irq_chip = {
201 .ack = gpio_ack_irq, 214 .ack = gpio_ack_irq,
@@ -284,17 +297,18 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
284 /* its a serious configuration bug when it fails */ 297 /* its a serious configuration bug when it fails */
285 BUG_ON( gpiochip_add(&port[i].chip) < 0 ); 298 BUG_ON( gpiochip_add(&port[i].chip) < 0 );
286 299
287#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX1) 300 if (cpu_is_mx1() || cpu_is_mx3() || cpu_is_mx25()) {
288 /* setup one handler for each entry */ 301 /* setup one handler for each entry */
289 set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler); 302 set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler);
290 set_irq_data(port[i].irq, &port[i]); 303 set_irq_data(port[i].irq, &port[i]);
291#endif 304 }
305 }
306
307 if (cpu_is_mx2()) {
308 /* setup one handler for all GPIO interrupts */
309 set_irq_chained_handler(port[0].irq, mx2_gpio_irq_handler);
310 set_irq_data(port[0].irq, port);
292 } 311 }
293 312
294#ifdef CONFIG_ARCH_MX2
295 /* setup one handler for all GPIO interrupts */
296 set_irq_chained_handler(port[0].irq, mx2_gpio_irq_handler);
297 set_irq_data(port[0].irq, port);
298#endif
299 return 0; 313 return 0;
300} 314}
diff --git a/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
index 8769e910e559..0376c133c9f4 100644
--- a/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
+++ b/arch/arm/plat-mxc/include/mach/board-armadillo5x0.h
@@ -12,11 +12,4 @@
12#ifndef __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__ 12#ifndef __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
13#define __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__ 13#define __ASM_ARCH_MXC_BOARD_ARMADILLO5X0_H__
14 14
15#include <mach/hardware.h>
16
17/* mandatory for CONFIG_DEBUG_LL */
18
19#define MXC_LL_UART_PADDR UART1_BASE_ADDR
20#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
21
22#endif 15#endif
diff --git a/arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx27.h b/arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx27.h
new file mode 100644
index 000000000000..a1fd5830af48
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx27.h
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2009 Eric Benard - eric@eukrea.com
3 *
4 * Based on board-pcm038.h which is :
5 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX27_H__
23#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX27_H__
24
25#ifndef __ASSEMBLY__
26/*
27 * This CPU module needs a baseboard to work. After basic initializing
28 * its own devices, it calls baseboard's init function.
29 * TODO: Add your own baseboard init function and call it from
30 * inside eukrea_cpuimx27_init().
31 *
32 * This example here is for the development board. Refer
33 * eukrea_mbimx27-baseboard.c
34 */
35
36extern void eukrea_mbimx27_baseboard_init(void);
37
38#endif
39
40#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx21ads.h b/arch/arm/plat-mxc/include/mach/board-mx21ads.h
index 06701df74c42..0cf4fa29510c 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx21ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx21ads.h
@@ -15,12 +15,6 @@
15#define __ASM_ARCH_MXC_BOARD_MX21ADS_H__ 15#define __ASM_ARCH_MXC_BOARD_MX21ADS_H__
16 16
17/* 17/*
18 * MXC UART EVB board level configurations
19 */
20#define MXC_LL_UART_PADDR UART1_BASE_ADDR
21#define MXC_LL_UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
22
23/*
24 * Memory-mapped I/O on MX21ADS base board 18 * Memory-mapped I/O on MX21ADS base board
25 */ 19 */
26#define MX21ADS_MMIO_BASE_ADDR 0xF5000000 20#define MX21ADS_MMIO_BASE_ADDR 0xF5000000
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27ads.h b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
index d42f4e6116f8..7776d230327f 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx27ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
@@ -26,12 +26,6 @@
26 MXC_MAX_VIRTUAL_INTS) 26 MXC_MAX_VIRTUAL_INTS)
27 27
28/* 28/*
29 * MXC UART EVB board level configurations
30 */
31#define MXC_LL_UART_PADDR UART1_BASE_ADDR
32#define MXC_LL_UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
33
34/*
35 * @name Memory Size parameters 29 * @name Memory Size parameters
36 */ 30 */
37 31
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27lite.h b/arch/arm/plat-mxc/include/mach/board-mx27lite.h
index a870f8ea2443..ea87551d2736 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx27lite.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx27lite.h
@@ -11,9 +11,4 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX27LITE_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX27LITE_H__
12#define __ASM_ARCH_MXC_BOARD_MX27LITE_H__ 12#define __ASM_ARCH_MXC_BOARD_MX27LITE_H__
13 13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19#endif /* __ASM_ARCH_MXC_BOARD_MX27LITE_H__ */ 14#endif /* __ASM_ARCH_MXC_BOARD_MX27LITE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27pdk.h b/arch/arm/plat-mxc/include/mach/board-mx27pdk.h
index 552b55d714d8..fec1bcfa9164 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx27pdk.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx27pdk.h
@@ -11,9 +11,4 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX27PDK_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX27PDK_H__
12#define __ASM_ARCH_MXC_BOARD_MX27PDK_H__ 12#define __ASM_ARCH_MXC_BOARD_MX27PDK_H__
13 13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19#endif /* __ASM_ARCH_MXC_BOARD_MX27PDK_H__ */ 14#endif /* __ASM_ARCH_MXC_BOARD_MX27PDK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
index 06e6895f7f65..2cbfa35e82ff 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
@@ -114,9 +114,4 @@
114 114
115#define MXC_MAX_EXP_IO_LINES 16 115#define MXC_MAX_EXP_IO_LINES 16
116 116
117/* mandatory for CONFIG_DEBUG_LL */
118
119#define MXC_LL_UART_PADDR UART1_BASE_ADDR
120#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
121
122#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */ 117#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h b/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
index 78cf31e22e4d..eb5a5024622e 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
@@ -22,11 +22,6 @@
22#ifndef __ASM_ARCH_MXC_BOARD_MX31LILLY_H__ 22#ifndef __ASM_ARCH_MXC_BOARD_MX31LILLY_H__
23#define __ASM_ARCH_MXC_BOARD_MX31LILLY_H__ 23#define __ASM_ARCH_MXC_BOARD_MX31LILLY_H__
24 24
25/* mandatory for CONFIG_LL_DEBUG */
26
27#define MXC_LL_UART_PADDR UART1_BASE_ADDR
28#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
29
30#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
31 26
32enum mx31lilly_boards { 27enum mx31lilly_boards {
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lite.h b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
index 52fbdf2d6f26..8e64325d6905 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lite.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
@@ -11,8 +11,5 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__
12#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
13 13
14#define MXC_LL_UART_PADDR UART1_BASE_ADDR
15#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
16
17#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */ 14#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */
18 15
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
index 303fd2434a21..d5be6b5a6acf 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
@@ -19,11 +19,6 @@
19#ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
20#define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ 20#define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
21 21
22/* mandatory for CONFIG_DEBUG_LL */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
26
27#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
28 23
29enum mx31moboard_boards { 24enum mx31moboard_boards {
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31pdk.h b/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
index 519bab3eb28b..2bbd6ed17f50 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31pdk.h
@@ -11,11 +11,6 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31PDK_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31PDK_H__
12#define __ASM_ARCH_MXC_BOARD_MX31PDK_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31PDK_H__
13 13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19/* Definitions for components on the Debug board */ 14/* Definitions for components on the Debug board */
20 15
21/* Base address of CPLD controller on the Debug board */ 16/* Base address of CPLD controller on the Debug board */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx35pdk.h b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
index 1111037d6d9d..383f1c04df06 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx35pdk.h
@@ -19,9 +19,4 @@
19#ifndef __ASM_ARCH_MXC_BOARD_MX35PDK_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_MX35PDK_H__
20#define __ASM_ARCH_MXC_BOARD_MX35PDK_H__ 20#define __ASM_ARCH_MXC_BOARD_MX35PDK_H__
21 21
22/* mandatory for CONFIG_DEBUG_LL */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
26
27#endif /* __ASM_ARCH_MXC_BOARD_MX35PDK_H__ */ 22#endif /* __ASM_ARCH_MXC_BOARD_MX35PDK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm037.h b/arch/arm/plat-mxc/include/mach/board-pcm037.h
index f0a1fa1938a2..13411709b13a 100644
--- a/arch/arm/plat-mxc/include/mach/board-pcm037.h
+++ b/arch/arm/plat-mxc/include/mach/board-pcm037.h
@@ -19,9 +19,4 @@
19#ifndef __ASM_ARCH_MXC_BOARD_PCM037_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_PCM037_H__
20#define __ASM_ARCH_MXC_BOARD_PCM037_H__ 20#define __ASM_ARCH_MXC_BOARD_PCM037_H__
21 21
22/* mandatory for CONFIG_DEBUG_LL */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
26
27#endif /* __ASM_ARCH_MXC_BOARD_PCM037_H__ */ 22#endif /* __ASM_ARCH_MXC_BOARD_PCM037_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm038.h b/arch/arm/plat-mxc/include/mach/board-pcm038.h
index 4fcd7499e092..410f9786ed22 100644
--- a/arch/arm/plat-mxc/include/mach/board-pcm038.h
+++ b/arch/arm/plat-mxc/include/mach/board-pcm038.h
@@ -19,11 +19,6 @@
19#ifndef __ASM_ARCH_MXC_BOARD_PCM038_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_PCM038_H__
20#define __ASM_ARCH_MXC_BOARD_PCM038_H__ 20#define __ASM_ARCH_MXC_BOARD_PCM038_H__
21 21
22/* mandatory for CONFIG_DEBUG_LL */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
26
27#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
28/* 23/*
29 * This CPU module needs a baseboard to work. After basic initializing 24 * This CPU module needs a baseboard to work. After basic initializing
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm043.h b/arch/arm/plat-mxc/include/mach/board-pcm043.h
index 15fbdf16abcd..1ac4e1682e5c 100644
--- a/arch/arm/plat-mxc/include/mach/board-pcm043.h
+++ b/arch/arm/plat-mxc/include/mach/board-pcm043.h
@@ -19,9 +19,4 @@
19#ifndef __ASM_ARCH_MXC_BOARD_PCM043_H__ 19#ifndef __ASM_ARCH_MXC_BOARD_PCM043_H__
20#define __ASM_ARCH_MXC_BOARD_PCM043_H__ 20#define __ASM_ARCH_MXC_BOARD_PCM043_H__
21 21
22/* mandatory for CONFIG_LL_DEBUG */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
26
27#endif /* __ASM_ARCH_MXC_BOARD_PCM043_H__ */ 22#endif /* __ASM_ARCH_MXC_BOARD_PCM043_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-qong.h b/arch/arm/plat-mxc/include/mach/board-qong.h
index 04033ec637d2..6d88c7af4b23 100644
--- a/arch/arm/plat-mxc/include/mach/board-qong.h
+++ b/arch/arm/plat-mxc/include/mach/board-qong.h
@@ -11,11 +11,6 @@
11#ifndef __ASM_ARCH_MXC_BOARD_QONG_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_QONG_H__
12#define __ASM_ARCH_MXC_BOARD_QONG_H__ 12#define __ASM_ARCH_MXC_BOARD_QONG_H__
13 13
14/* mandatory for CONFIG_DEBUG_LL */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19/* NOR FLASH */ 14/* NOR FLASH */
20#define QONG_NOR_SIZE (128*1024*1024) 15#define QONG_NOR_SIZE (128*1024*1024)
21 16
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 02c3cd004db3..286cb9b0a25b 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -16,18 +16,33 @@ struct clk;
16 16
17extern void mx1_map_io(void); 17extern void mx1_map_io(void);
18extern void mx21_map_io(void); 18extern void mx21_map_io(void);
19extern void mx25_map_io(void);
19extern void mx27_map_io(void); 20extern void mx27_map_io(void);
20extern void mx31_map_io(void); 21extern void mx31_map_io(void);
21extern void mx35_map_io(void); 22extern void mx35_map_io(void);
22extern void mxc_init_irq(void); 23extern void mxc91231_map_io(void);
23extern void mxc_timer_init(struct clk *timer_clk); 24extern void mxc_init_irq(void __iomem *);
25extern void mx1_init_irq(void);
26extern void mx21_init_irq(void);
27extern void mx25_init_irq(void);
28extern void mx27_init_irq(void);
29extern void mx31_init_irq(void);
30extern void mx35_init_irq(void);
31extern void mxc91231_init_irq(void);
32extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int);
24extern int mx1_clocks_init(unsigned long fref); 33extern int mx1_clocks_init(unsigned long fref);
25extern int mx21_clocks_init(unsigned long lref, unsigned long fref); 34extern int mx21_clocks_init(unsigned long lref, unsigned long fref);
35extern int mx25_clocks_init(unsigned long fref);
26extern int mx27_clocks_init(unsigned long fref); 36extern int mx27_clocks_init(unsigned long fref);
27extern int mx31_clocks_init(unsigned long fref); 37extern int mx31_clocks_init(unsigned long fref);
28extern int mx35_clocks_init(void); 38extern int mx35_clocks_init(void);
39extern int mxc91231_clocks_init(unsigned long fref);
29extern int mxc_register_gpios(void); 40extern int mxc_register_gpios(void);
30extern int mxc_register_device(struct platform_device *pdev, void *data); 41extern int mxc_register_device(struct platform_device *pdev, void *data);
31extern void mxc_set_cpu_type(unsigned int type); 42extern void mxc_set_cpu_type(unsigned int type);
43extern void mxc_arch_reset_init(void __iomem *);
44extern void mxc91231_power_off(void);
45extern void mxc91231_arch_reset(int, const char *);
46extern void mxc91231_prepare_idle(void);
32 47
33#endif 48#endif
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index bbc5f6753cfb..15b2b148a105 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -11,52 +11,52 @@
11 * 11 *
12 */ 12 */
13 13
14#include <mach/hardware.h> 14#ifdef CONFIG_ARCH_MX1
15 15#include <mach/mx1.h>
16#ifdef CONFIG_MACH_MX31ADS 16#define UART_PADDR UART1_BASE_ADDR
17#include <mach/board-mx31ads.h> 17#define UART_VADDR IO_ADDRESS(UART1_BASE_ADDR)
18#endif
19#ifdef CONFIG_MACH_PCM037
20#include <mach/board-pcm037.h>
21#endif
22#ifdef CONFIG_MACH_MX31LITE
23#include <mach/board-mx31lite.h>
24#endif
25#ifdef CONFIG_MACH_MX27ADS
26#include <mach/board-mx27ads.h>
27#endif
28#ifdef CONFIG_MACH_MX21ADS
29#include <mach/board-mx21ads.h>
30#endif 18#endif
31#ifdef CONFIG_MACH_PCM038 19
32#include <mach/board-pcm038.h> 20#ifdef CONFIG_ARCH_MX25
21#ifdef UART_PADDR
22#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
33#endif 23#endif
34#ifdef CONFIG_MACH_MX31_3DS 24#include <mach/mx25.h>
35#include <mach/board-mx31pdk.h> 25#define UART_PADDR UART1_BASE_ADDR
26#define UART_VADDR MX25_AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
36#endif 27#endif
37#ifdef CONFIG_MACH_QONG 28
38#include <mach/board-qong.h> 29#ifdef CONFIG_ARCH_MX2
30#ifdef UART_PADDR
31#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
39#endif 32#endif
40#ifdef CONFIG_MACH_PCM043 33#include <mach/mx2x.h>
41#include <mach/board-pcm043.h> 34#define UART_PADDR UART1_BASE_ADDR
35#define UART_VADDR AIPI_IO_ADDRESS(UART1_BASE_ADDR)
42#endif 36#endif
43#ifdef CONFIG_MACH_MX27_3DS 37
44#include <mach/board-mx27pdk.h> 38#ifdef CONFIG_ARCH_MX3
39#ifdef UART_PADDR
40#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
45#endif 41#endif
46#ifdef CONFIG_MACH_ARMADILLO5X0 42#include <mach/mx3x.h>
47#include <mach/board-armadillo5x0.h> 43#define UART_PADDR UART1_BASE_ADDR
44#define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
48#endif 45#endif
49#ifdef CONFIG_MACH_MX35_3DS 46
50#include <mach/board-mx35pdk.h> 47#ifdef CONFIG_ARCH_MXC91231
48#ifdef UART_PADDR
49#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
51#endif 50#endif
52#ifdef CONFIG_MACH_MX27LITE 51#include <mach/mxc91231.h>
53#include <mach/board-mx27lite.h> 52#define UART_PADDR MXC91231_UART2_BASE_ADDR
53#define UART_VADDR MXC91231_AIPS1_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
54#endif 54#endif
55 .macro addruart,rx 55 .macro addruart,rx
56 mrc p15, 0, \rx, c1, c0 56 mrc p15, 0, \rx, c1, c0
57 tst \rx, #1 @ MMU enabled? 57 tst \rx, #1 @ MMU enabled?
58 ldreq \rx, =MXC_LL_UART_PADDR @ physical 58 ldreq \rx, =UART_PADDR @ physical
59 ldrne \rx, =MXC_LL_UART_VADDR @ virtual 59 ldrne \rx, =UART_VADDR @ virtual
60 .endm 60 .endm
61 61
62 .macro senduart,rd,rx 62 .macro senduart,rd,rx
diff --git a/arch/arm/plat-mxc/include/mach/entry-macro.S b/arch/arm/plat-mxc/include/mach/entry-macro.S
index 5f01d60da845..7cf290efe768 100644
--- a/arch/arm/plat-mxc/include/mach/entry-macro.S
+++ b/arch/arm/plat-mxc/include/mach/entry-macro.S
@@ -18,7 +18,8 @@
18 .endm 18 .endm
19 19
20 .macro get_irqnr_preamble, base, tmp 20 .macro get_irqnr_preamble, base, tmp
21 ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR) 21 ldr \base, =avic_base
22 ldr \base, [\base]
22#ifdef CONFIG_MXC_IRQ_PRIOR 23#ifdef CONFIG_MXC_IRQ_PRIOR
23 ldr r4, [\base, #AVIC_NIMASK] 24 ldr r4, [\base, #AVIC_NIMASK]
24#endif 25#endif
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 42e4ee37ca1f..78db75475f69 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -42,6 +42,14 @@
42# include <mach/mx1.h> 42# include <mach/mx1.h>
43#endif 43#endif
44 44
45#ifdef CONFIG_ARCH_MX25
46# include <mach/mx25.h>
47#endif
48
49#ifdef CONFIG_ARCH_MXC91231
50# include <mach/mxc91231.h>
51#endif
52
45#include <mach/mxc.h> 53#include <mach/mxc.h>
46 54
47#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */ 55#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
index 9f0101157ec1..5263506b7ddf 100644
--- a/arch/arm/plat-mxc/include/mach/imxfb.h
+++ b/arch/arm/plat-mxc/include/mach/imxfb.h
@@ -2,6 +2,8 @@
2 * This structure describes the machine which we are running on. 2 * This structure describes the machine which we are running on.
3 */ 3 */
4 4
5#include <linux/fb.h>
6
5#define PCR_TFT (1 << 31) 7#define PCR_TFT (1 << 31)
6#define PCR_COLOR (1 << 30) 8#define PCR_COLOR (1 << 30)
7#define PCR_PBSIZ_1 (0 << 28) 9#define PCR_PBSIZ_1 (0 << 28)
@@ -13,7 +15,8 @@
13#define PCR_BPIX_4 (2 << 25) 15#define PCR_BPIX_4 (2 << 25)
14#define PCR_BPIX_8 (3 << 25) 16#define PCR_BPIX_8 (3 << 25)
15#define PCR_BPIX_12 (4 << 25) 17#define PCR_BPIX_12 (4 << 25)
16#define PCR_BPIX_16 (4 << 25) 18#define PCR_BPIX_16 (5 << 25)
19#define PCR_BPIX_18 (6 << 25)
17#define PCR_PIXPOL (1 << 24) 20#define PCR_PIXPOL (1 << 24)
18#define PCR_FLMPOL (1 << 23) 21#define PCR_FLMPOL (1 << 23)
19#define PCR_LPPOL (1 << 22) 22#define PCR_LPPOL (1 << 22)
@@ -46,29 +49,21 @@
46#define DMACR_HM(x) (((x) & 0xf) << 16) 49#define DMACR_HM(x) (((x) & 0xf) << 16)
47#define DMACR_TM(x) ((x) & 0xf) 50#define DMACR_TM(x) ((x) & 0xf)
48 51
49struct imx_fb_platform_data { 52struct imx_fb_videomode {
50 u_long pixclock; 53 struct fb_videomode mode;
51 54 u32 pcr;
52 u_short xres; 55 unsigned char bpp;
53 u_short yres; 56};
54
55 u_int nonstd;
56 u_char bpp;
57 u_char hsync_len;
58 u_char left_margin;
59 u_char right_margin;
60 57
61 u_char vsync_len; 58struct imx_fb_platform_data {
62 u_char upper_margin; 59 struct imx_fb_videomode *mode;
63 u_char lower_margin; 60 int num_modes;
64 u_char sync;
65 61
66 u_int cmap_greyscale:1, 62 u_int cmap_greyscale:1,
67 cmap_inverse:1, 63 cmap_inverse:1,
68 cmap_static:1, 64 cmap_static:1,
69 unused:29; 65 unused:29;
70 66
71 u_int pcr;
72 u_int pwmr; 67 u_int pwmr;
73 u_int lscr1; 68 u_int lscr1;
74 u_int dmacr; 69 u_int dmacr;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx25.h b/arch/arm/plat-mxc/include/mach/iomux-mx25.h
new file mode 100644
index 000000000000..810c47f56e77
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx25.h
@@ -0,0 +1,517 @@
1/*
2 * arch/arm/plat-mxc/include/mach/iomux-mx25.h
3 *
4 * Copyright (C) 2009 by Lothar Wassmann <LW@KARO-electronics.de>
5 *
6 * based on arch/arm/mach-mx25/mx25_pins.h
7 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
8 * and
9 * arch/arm/plat-mxc/include/mach/iomux-mx35.h
10 * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
11 *
12 * The code contained herein is licensed under the GNU General Public
13 * License. You may obtain a copy of the GNU General Public License
14 * Version 2 or later at the following locations:
15 *
16 * http://www.opensource.org/licenses/gpl-license.html
17 * http://www.gnu.org/copyleft/gpl.html
18 */
19#ifndef __IOMUX_MX25_H__
20#define __IOMUX_MX25_H__
21
22#include <mach/iomux-v3.h>
23
24#ifndef GPIO_PORTA
25#error Please include mach/iomux.h
26#endif
27
28/*
29 *
30 * @brief MX25 I/O Pin List
31 *
32 * @ingroup GPIO_MX25
33 */
34
35#ifndef __ASSEMBLY__
36
37/*
38 * IOMUX/PAD Bit field definitions
39 */
40
41#define MX25_PAD_A10__A10 IOMUX_PAD(0x000, 0x008, 0x00, 0, 0, NO_PAD_CTRL)
42#define MX25_PAD_A10__GPIO_4_0 IOMUX_PAD(0x000, 0x008, 0x05, 0, 0, NO_PAD_CTRL)
43
44#define MX25_PAD_A13__A13 IOMUX_PAD(0x22C, 0x00c, 0x00, 0, 0, NO_PAD_CTRL)
45#define MX25_PAD_A13__GPIO_4_1 IOMUX_PAD(0x22C, 0x00c, 0x05, 0, 0, NO_PAD_CTRL)
46
47#define MX25_PAD_A14__A14 IOMUX_PAD(0x230, 0x010, 0x10, 0, 0, NO_PAD_CTRL)
48#define MX25_PAD_A14__GPIO_2_0 IOMUX_PAD(0x230, 0x010, 0x15, 0, 0, NO_PAD_CTRL)
49
50#define MX25_PAD_A15__A15 IOMUX_PAD(0x234, 0x014, 0x10, 0, 0, NO_PAD_CTRL)
51#define MX25_PAD_A15__GPIO_2_1 IOMUX_PAD(0x234, 0x014, 0x15, 0, 0, NO_PAD_CTRL)
52
53#define MX25_PAD_A16__A16 IOMUX_PAD(0x000, 0x018, 0x10, 0, 0, NO_PAD_CTRL)
54#define MX25_PAD_A16__GPIO_2_2 IOMUX_PAD(0x000, 0x018, 0x15, 0, 0, NO_PAD_CTRL)
55
56#define MX25_PAD_A17__A17 IOMUX_PAD(0x238, 0x01c, 0x10, 0, 0, NO_PAD_CTRL)
57#define MX25_PAD_A17__GPIO_2_3 IOMUX_PAD(0x238, 0x01c, 0x15, 0, 0, NO_PAD_CTRL)
58
59#define MX25_PAD_A18__A18 IOMUX_PAD(0x23c, 0x020, 0x10, 0, 0, NO_PAD_CTRL)
60#define MX25_PAD_A18__GPIO_2_4 IOMUX_PAD(0x23c, 0x020, 0x15, 0, 0, NO_PAD_CTRL)
61#define MX25_PAD_A18__FEC_COL IOMUX_PAD(0x23c, 0x020, 0x17, 0x504, 0, NO_PAD_CTL)
62
63#define MX25_PAD_A19__A19 IOMUX_PAD(0x240, 0x024, 0x10, 0, 0, NO_PAD_CTRL)
64#define MX25_PAD_A19__FEC_RX_ER IOMUX_PAD(0x240, 0x024, 0x17, 0x518, 0, NO_PAD_CTL)
65#define MX25_PAD_A19__GPIO_2_5 IOMUX_PAD(0x240, 0x024, 0x15, 0, 0, NO_PAD_CTRL)
66
67#define MX25_PAD_A20__A20 IOMUX_PAD(0x244, 0x028, 0x10, 0, 0, NO_PAD_CTRL)
68#define MX25_PAD_A20__GPIO_2_6 IOMUX_PAD(0x244, 0x028, 0x15, 0, 0, NO_PAD_CTRL)
69#define MX25_PAD_A20__FEC_RDATA2 IOMUX_PAD(0x244, 0x028, 0x17, 0x50c, 0, NO_PAD_CTL)
70
71#define MX25_PAD_A21__A21 IOMUX_PAD(0x248, 0x02c, 0x10, 0, 0, NO_PAD_CTRL)
72#define MX25_PAD_A21__GPIO_2_7 IOMUX_PAD(0x248, 0x02c, 0x15, 0, 0, NO_PAD_CTRL)
73#define MX25_PAD_A21__FEC_RDATA3 IOMUX_PAD(0x248, 0x02c, 0x17, 0x510, 0, NO_PAD_CTL)
74
75#define MX25_PAD_A22__A22 IOMUX_PAD(0x000, 0x030, 0x10, 0, 0, NO_PAD_CTRL)
76#define MX25_PAD_A22__GPIO_2_8 IOMUX_PAD(0x000, 0x030, 0x15, 0, 0, NO_PAD_CTRL)
77
78#define MX25_PAD_A23__A23 IOMUX_PAD(0x24c, 0x034, 0x10, 0, 0, NO_PAD_CTRL)
79#define MX25_PAD_A23__GPIO_2_9 IOMUX_PAD(0x24c, 0x034, 0x15, 0, 0, NO_PAD_CTRL)
80
81#define MX25_PAD_A24__A24 IOMUX_PAD(0x250, 0x038, 0x10, 0, 0, NO_PAD_CTRL)
82#define MX25_PAD_A24__GPIO_2_10 IOMUX_PAD(0x250, 0x038, 0x15, 0, 0, NO_PAD_CTRL)
83#define MX25_PAD_A24__FEC_RX_CLK IOMUX_PAD(0x250, 0x038, 0x17, 0x514, 0, NO_PAD_CTL)
84
85#define MX25_PAD_A25__A25 IOMUX_PAD(0x254, 0x03c, 0x10, 0, 0, NO_PAD_CTRL)
86#define MX25_PAD_A25__GPIO_2_11 IOMUX_PAD(0x254, 0x03c, 0x15, 0, 0, NO_PAD_CTRL)
87#define MX25_PAD_A25__FEC_CRS IOMUX_PAD(0x254, 0x03c, 0x17, 0x508, 0, NO_PAD_CTL)
88
89#define MX25_PAD_EB0__EB0 IOMUX_PAD(0x258, 0x040, 0x10, 0, 0, NO_PAD_CTRL)
90#define MX25_PAD_EB0__AUD4_TXD IOMUX_PAD(0x258, 0x040, 0x14, 0x464, 0, NO_PAD_CTRL)
91#define MX25_PAD_EB0__GPIO_2_12 IOMUX_PAD(0x258, 0x040, 0x15, 0, 0, NO_PAD_CTRL)
92
93#define MX25_PAD_EB1__EB1 IOMUX_PAD(0x25c, 0x044, 0x10, 0, 0, NO_PAD_CTRL)
94#define MX25_PAD_EB1__AUD4_RXD IOMUX_PAD(0x25c, 0x044, 0x14, 0x460, 0, NO_PAD_CTRL)
95#define MX25_PAD_EB1__GPIO_2_13 IOMUX_PAD(0x25c, 0x044, 0x15, 0, 0, NO_PAD_CTRL)
96
97#define MX25_PAD_OE__OE IOMUX_PAD(0x260, 0x048, 0x10, 0, 0, NO_PAD_CTRL)
98#define MX25_PAD_OE__AUD4_TXC IOMUX_PAD(0x260, 0x048, 0x14, 0, 0, NO_PAD_CTRL)
99#define MX25_PAD_OE__GPIO_2_14 IOMUX_PAD(0x260, 0x048, 0x15, 0, 0, NO_PAD_CTRL)
100
101#define MX25_PAD_CS0__CS0 IOMUX_PAD(0x000, 0x04c, 0x00, 0, 0, NO_PAD_CTRL)
102#define MX25_PAD_CS0__GPIO_4_2 IOMUX_PAD(0x000, 0x04c, 0x05, 0, 0, NO_PAD_CTRL)
103
104#define MX25_PAD_CS1__CS1 IOMUX_PAD(0x000, 0x050, 0x00, 0, 0, NO_PAD_CTRL)
105#define MX25_PAD_CS1__GPIO_4_3 IOMUX_PAD(0x000, 0x050, 0x05, 0, 0, NO_PAD_CTRL)
106
107#define MX25_PAD_CS4__CS4 IOMUX_PAD(0x264, 0x054, 0x10, 0, 0, NO_PAD_CTRL)
108#define MX25_PAD_CS4__UART5_CTS IOMUX_PAD(0x264, 0x054, 0x13, 0, 0, NO_PAD_CTRL)
109#define MX25_PAD_CS4__GPIO_3_20 IOMUX_PAD(0x264, 0x054, 0x15, 0, 0, NO_PAD_CTRL)
110
111#define MX25_PAD_CS5__CS5 IOMUX_PAD(0x268, 0x058, 0x10, 0, 0, NO_PAD_CTRL)
112#define MX25_PAD_CS5__UART5_RTS IOMUX_PAD(0x268, 0x058, 0x13, 0x574, 0, NO_PAD_CTRL)
113#define MX25_PAD_CS5__GPIO_3_21 IOMUX_PAD(0x268, 0x058, 0x15, 0, 0, NO_PAD_CTRL)
114
115#define MX25_PAD_NF_CE0__NF_CE0 IOMUX_PAD(0x26c, 0x05c, 0x10, 0, 0, NO_PAD_CTL)
116#define MX25_PAD_NF_CE0__GPIO_3_22 IOMUX_PAD(0x26c, 0x05c, 0x15, 0, 0, NO_PAD_CTRL)
117
118#define MX25_PAD_ECB__ECB IOMUX_PAD(0x270, 0x060, 0x10, 0, 0, NO_PAD_CTRL)
119#define MX25_PAD_ECB__UART5_TXD_MUX IOMUX_PAD(0x270, 0x060, 0x13, 0, 0, NO_PAD_CTRL)
120#define MX25_PAD_ECB__GPIO_3_23 IOMUX_PAD(0x270, 0x060, 0x15, 0, 0, NO_PAD_CTRL)
121
122#define MX25_PAD_LBA__LBA IOMUX_PAD(0x274, 0x064, 0x10, 0, 0, NO_PAD_CTRL)
123#define MX25_PAD_LBA__UART5_RXD_MUX IOMUX_PAD(0x274, 0x064, 0x13, 0x578, 0, NO_PAD_CTRL)
124#define MX25_PAD_LBA__GPIO_3_24 IOMUX_PAD(0x274, 0x064, 0x15, 0, 0, NO_PAD_CTRL)
125
126#define MX25_PAD_BCLK__BCLK IOMUX_PAD(0x000, 0x068, 0x00, 0, 0, NO_PAD_CTRL)
127#define MX25_PAD_BCLK__GPIO_4_4 IOMUX_PAD(0x000, 0x068, 0x05, 0, 0, NO_PAD_CTRL)
128
129#define MX25_PAD_RW__RW IOMUX_PAD(0x278, 0x06c, 0x10, 0, 0, NO_PAD_CTRL)
130#define MX25_PAD_RW__AUD4_TXFS IOMUX_PAD(0x278, 0x06c, 0x14, 0x474, 0, NO_PAD_CTRL)
131#define MX25_PAD_RW__GPIO_3_25 IOMUX_PAD(0x278, 0x06c, 0x15, 0, 0, NO_PAD_CTRL)
132
133#define MX25_PAD_NFWE_B__NFWE_B IOMUX_PAD(0x000, 0x070, 0x10, 0, 0, NO_PAD_CTRL)
134#define MX25_PAD_NFWE_B__GPIO_3_26 IOMUX_PAD(0x000, 0x070, 0x15, 0, 0, NO_PAD_CTRL)
135
136#define MX25_PAD_NFRE_B__NFRE_B IOMUX_PAD(0x000, 0x074, 0x10, 0, 0, NO_PAD_CTRL)
137#define MX25_PAD_NFRE_B__GPIO_3_27 IOMUX_PAD(0x000, 0x074, 0x15, 0, 0, NO_PAD_CTRL)
138
139#define MX25_PAD_NFALE__NFALE IOMUX_PAD(0x000, 0x078, 0x10, 0, 0, NO_PAD_CTRL)
140#define MX25_PAD_NFALE__GPIO_3_28 IOMUX_PAD(0x000, 0x078, 0x15, 0, 0, NO_PAD_CTRL)
141
142#define MX25_PAD_NFCLE__NFCLE IOMUX_PAD(0x000, 0x07c, 0x10, 0, 0, NO_PAD_CTRL)
143#define MX25_PAD_NFCLE__GPIO_3_29 IOMUX_PAD(0x000, 0x07c, 0x15, 0, 0, NO_PAD_CTRL)
144
145#define MX25_PAD_NFWP_B__NFWP_B IOMUX_PAD(0x000, 0x080, 0x10, 0, 0, NO_PAD_CTRL)
146#define MX25_PAD_NFWP_B__GPIO_3_30 IOMUX_PAD(0x000, 0x080, 0x15, 0, 0, NO_PAD_CTRL)
147
148#define MX25_PAD_NFRB__NFRB IOMUX_PAD(0x27c, 0x084, 0x10, 0, 0, PAD_CTL_PKE)
149#define MX25_PAD_NFRB__GPIO_3_31 IOMUX_PAD(0x27c, 0x084, 0x15, 0, 0, NO_PAD_CTRL)
150
151#define MX25_PAD_D15__D15 IOMUX_PAD(0x280, 0x088, 0x00, 0, 0, NO_PAD_CTRL)
152#define MX25_PAD_D15__LD16 IOMUX_PAD(0x280, 0x088, 0x01, 0, 0, NO_PAD_CTRL)
153#define MX25_PAD_D15__GPIO_4_5 IOMUX_PAD(0x280, 0x088, 0x05, 0, 0, NO_PAD_CTRL)
154
155#define MX25_PAD_D14__D14 IOMUX_PAD(0x284, 0x08c, 0x00, 0, 0, NO_PAD_CTRL)
156#define MX25_PAD_D14__LD17 IOMUX_PAD(0x284, 0x08c, 0x01, 0, 0, NO_PAD_CTRL)
157#define MX25_PAD_D14__GPIO_4_6 IOMUX_PAD(0x284, 0x08c, 0x05, 0, 0, NO_PAD_CTRL)
158
159#define MX25_PAD_D13__D13 IOMUX_PAD(0x288, 0x090, 0x00, 0, 0, NO_PAD_CTRL)
160#define MX25_PAD_D13__LD18 IOMUX_PAD(0x288, 0x090, 0x01, 0, 0, NO_PAD_CTRL)
161#define MX25_PAD_D13__GPIO_4_7 IOMUX_PAD(0x288, 0x090, 0x05, 0, 0, NO_PAD_CTRL)
162
163#define MX25_PAD_D12__D12 IOMUX_PAD(0x28c, 0x094, 0x00, 0, 0, NO_PAD_CTRL)
164#define MX25_PAD_D12__GPIO_4_8 IOMUX_PAD(0x28c, 0x094, 0x05, 0, 0, NO_PAD_CTRL)
165
166#define MX25_PAD_D11__D11 IOMUX_PAD(0x290, 0x098, 0x00, 0, 0, NO_PAD_CTRL)
167#define MX25_PAD_D11__GPIO_4_9 IOMUX_PAD(0x290, 0x098, 0x05, 0, 0, NO_PAD_CTRL)
168
169#define MX25_PAD_D10__D10 IOMUX_PAD(0x294, 0x09c, 0x00, 0, 0, NO_PAD_CTRL)
170#define MX25_PAD_D10__GPIO_4_10 IOMUX_PAD(0x294, 0x09c, 0x05, 0, 0, NO_PAD_CTRL)
171#define MX25_PAD_D10__USBOTG_OC IOMUX_PAD(0x294, 0x09c, 0x06, 0x57c, 0, PAD_CTL_PUS_100K_UP)
172
173#define MX25_PAD_D9__D9 IOMUX_PAD(0x298, 0x0a0, 0x00, 0, 0, NO_PAD_CTRL)
174#define MX25_PAD_D9__GPIO_4_11 IOMUX_PAD(0x298, 0x0a0, 0x05, 0, 0, NO_PAD_CTRL)
175#define MX25_PAD_D9__USBH2_PWR IOMUX_PAD(0x298, 0x0a0, 0x06, 0, 0, PAD_CTL_PKE)
176
177#define MX25_PAD_D8__D8 IOMUX_PAD(0x29c, 0x0a4, 0x00, 0, 0, NO_PAD_CTRL)
178#define MX25_PAD_D8__GPIO_4_12 IOMUX_PAD(0x29c, 0x0a4, 0x05, 0, 0, NO_PAD_CTRL)
179#define MX25_PAD_D8__USBH2_OC IOMUX_PAD(0x29c, 0x0a4, 0x06, 0x580, 0, PAD_CTL_PUS_100K_UP)
180
181#define MX25_PAD_D7__D7 IOMUX_PAD(0x2a0, 0x0a8, 0x00, 0, 0, NO_PAD_CTRL)
182#define MX25_PAD_D7__GPIO_4_13 IOMUX_PAD(0x2a0, 0x0a8, 0x05, 0, 0, NO_PAD_CTRL)
183
184#define MX25_PAD_D6__D6 IOMUX_PAD(0x2a4, 0x0ac, 0x00, 0, 0, NO_PAD_CTRL)
185#define MX25_PAD_D6__GPIO_4_14 IOMUX_PAD(0x2a4, 0x0ac, 0x05, 0, 0, NO_PAD_CTRL)
186
187#define MX25_PAD_D5__D5 IOMUX_PAD(0x2a8, 0x0b0, 0x00, 0, 0, NO_PAD_CTRL)
188#define MX25_PAD_D5__GPIO_4_15 IOMUX_PAD(0x2a8, 0x0b0, 0x05, 0, 0, NO_PAD_CTRL)
189
190#define MX25_PAD_D4__D4 IOMUX_PAD(0x2ac, 0x0b4, 0x00, 0, 0, NO_PAD_CTRL)
191#define MX25_PAD_D4__GPIO_4_16 IOMUX_PAD(0x2ac, 0x0b4, 0x05, 0, 0, NO_PAD_CTRL)
192
193#define MX25_PAD_D3__D3 IOMUX_PAD(0x2b0, 0x0b8, 0x00, 0, 0, NO_PAD_CTRL)
194#define MX25_PAD_D3__GPIO_4_17 IOMUX_PAD(0x2b0, 0x0b8, 0x05, 0, 0, NO_PAD_CTRL)
195
196#define MX25_PAD_D2__D2 IOMUX_PAD(0x2b4, 0x0bc, 0x00, 0, 0, NO_PAD_CTRL)
197#define MX25_PAD_D2__GPIO_4_18 IOMUX_PAD(0x2b4, 0x0bc, 0x05, 0, 0, NO_PAD_CTRL)
198
199#define MX25_PAD_D1__D1 IOMUX_PAD(0x2b8, 0x0c0, 0x00, 0, 0, NO_PAD_CTRL)
200#define MX25_PAD_D1__GPIO_4_19 IOMUX_PAD(0x2b8, 0x0c0, 0x05, 0, 0, NO_PAD_CTRL)
201
202#define MX25_PAD_D0__D0 IOMUX_PAD(0x2bc, 0x0c4, 0x00, 0, 0, NO_PAD_CTRL)
203#define MX25_PAD_D0__GPIO_4_20 IOMUX_PAD(0x2bc, 0x0c4, 0x05, 0, 0, NO_PAD_CTRL)
204
205#define MX25_PAD_LD0__LD0 IOMUX_PAD(0x2c0, 0x0c8, 0x10, 0, 0, NO_PAD_CTRL)
206#define MX25_PAD_LD0__CSI_D0 IOMUX_PAD(0x2c0, 0x0c8, 0x12, 0x488, 0, NO_PAD_CTRL)
207#define MX25_PAD_LD0__GPIO_2_15 IOMUX_PAD(0x2c0, 0x0c8, 0x15, 0, 0, NO_PAD_CTRL)
208
209#define MX25_PAD_LD1__LD1 IOMUX_PAD(0x2c4, 0x0cc, 0x10, 0, 0, NO_PAD_CTRL)
210#define MX25_PAD_LD1__CSI_D1 IOMUX_PAD(0x2c4, 0x0cc, 0x12, 0x48c, 0, NO_PAD_CTRL)
211#define MX25_PAD_LD1__GPIO_2_16 IOMUX_PAD(0x2c4, 0x0cc, 0x15, 0, 0, NO_PAD_CTRL)
212
213#define MX25_PAD_LD2__LD2 IOMUX_PAD(0x2c8, 0x0d0, 0x10, 0, 0, NO_PAD_CTRL)
214#define MX25_PAD_LD2__GPIO_2_17 IOMUX_PAD(0x2c8, 0x0d0, 0x15, 0, 0, NO_PAD_CTRL)
215
216#define MX25_PAD_LD3__LD3 IOMUX_PAD(0x2cc, 0x0d4, 0x10, 0, 0, NO_PAD_CTRL)
217#define MX25_PAD_LD3__GPIO_2_18 IOMUX_PAD(0x2cc, 0x0d4, 0x15, 0, 0, NO_PAD_CTRL)
218
219#define MX25_PAD_LD4__LD4 IOMUX_PAD(0x2d0, 0x0d8, 0x10, 0, 0, NO_PAD_CTRL)
220#define MX25_PAD_LD4__GPIO_2_19 IOMUX_PAD(0x2d0, 0x0d8, 0x15, 0, 0, NO_PAD_CTRL)
221
222#define MX25_PAD_LD5__LD5 IOMUX_PAD(0x2d4, 0x0dc, 0x10, 0, 0, NO_PAD_CTRL)
223#define MX25_PAD_LD5__GPIO_1_19 IOMUX_PAD(0x2d4, 0x0dc, 0x15, 0, 0, NO_PAD_CTRL)
224
225#define MX25_PAD_LD6__LD6 IOMUX_PAD(0x2d8, 0x0e0, 0x10, 0, 0, NO_PAD_CTRL)
226#define MX25_PAD_LD6__GPIO_1_20 IOMUX_PAD(0x2d8, 0x0e0, 0x15, 0, 0, NO_PAD_CTRL)
227
228#define MX25_PAD_LD7__LD7 IOMUX_PAD(0x2dc, 0x0e4, 0x10, 0, 0, NO_PAD_CTRL)
229#define MX25_PAD_LD7__GPIO_1_21 IOMUX_PAD(0x2dc, 0x0e4, 0x15, 0, 0, NO_PAD_CTRL)
230
231#define MX25_PAD_LD8__LD8 IOMUX_PAD(0x2e0, 0x0e8, 0x10, 0, 0, NO_PAD_CTRL)
232#define MX25_PAD_LD8__FEC_TX_ERR IOMUX_PAD(0x2e0, 0x0e8, 0x15, 0, 0, NO_PAD_CTL)
233
234#define MX25_PAD_LD9__LD9 IOMUX_PAD(0x2e4, 0x0ec, 0x10, 0, 0, NO_PAD_CTRL)
235#define MX25_PAD_LD9__FEC_COL IOMUX_PAD(0x2e4, 0x0ec, 0x15, 0x504, 1, NO_PAD_CTL)
236
237#define MX25_PAD_LD10__LD10 IOMUX_PAD(0x2e8, 0x0f0, 0x10, 0, 0, NO_PAD_CTRL)
238#define MX25_PAD_LD10__FEC_RX_ER IOMUX_PAD(0x2e8, 0x0f0, 0x15, 0x518, 1, NO_PAD_CTL)
239
240#define MX25_PAD_LD11__LD11 IOMUX_PAD(0x2ec, 0x0f4, 0x10, 0, 0, NO_PAD_CTRL)
241#define MX25_PAD_LD11__FEC_RDATA2 IOMUX_PAD(0x2ec, 0x0f4, 0x15, 0x50c, 1, NO_PAD_CTL)
242
243#define MX25_PAD_LD12__LD12 IOMUX_PAD(0x2f0, 0x0f8, 0x10, 0, 0, NO_PAD_CTRL)
244#define MX25_PAD_LD12__FEC_RDATA3 IOMUX_PAD(0x2f0, 0x0f8, 0x15, 0x510, 1, NO_PAD_CTL)
245
246#define MX25_PAD_LD13__LD13 IOMUX_PAD(0x2f4, 0x0fc, 0x10, 0, 0, NO_PAD_CTRL)
247#define MX25_PAD_LD13__FEC_TDATA2 IOMUX_PAD(0x2f4, 0x0fc, 0x15, 0, 0, NO_PAD_CTL)
248
249#define MX25_PAD_LD14__LD14 IOMUX_PAD(0x2f8, 0x100, 0x10, 0, 0, NO_PAD_CTRL)
250#define MX25_PAD_LD14__FEC_TDATA3 IOMUX_PAD(0x2f8, 0x100, 0x15, 0, 0, NO_PAD_CTL)
251
252#define MX25_PAD_LD15__LD15 IOMUX_PAD(0x2fc, 0x104, 0x10, 0, 0, NO_PAD_CTRL)
253#define MX25_PAD_LD15__FEC_RX_CLK IOMUX_PAD(0x2fc, 0x104, 0x15, 0x514, 1, NO_PAD_CTL)
254
255#define MX25_PAD_HSYNC__HSYNC IOMUX_PAD(0x300, 0x108, 0x10, 0, 0, NO_PAD_CTRL)
256#define MX25_PAD_HSYNC__GPIO_1_22 IOMUX_PAD(0x300, 0x108, 0x15, 0, 0, NO_PAD_CTRL)
257
258#define MX25_PAD_VSYNC__VSYNC IOMUX_PAD(0x304, 0x10c, 0x10, 0, 0, NO_PAD_CTRL)
259#define MX25_PAD_VSYNC__GPIO_1_23 IOMUX_PAD(0x304, 0x10c, 0x15, 0, 0, NO_PAD_CTRL)
260
261#define MX25_PAD_LSCLK__LSCLK IOMUX_PAD(0x308, 0x110, 0x10, 0, 0, NO_PAD_CTRL)
262#define MX25_PAD_LSCLK__GPIO_1_24 IOMUX_PAD(0x308, 0x110, 0x15, 0, 0, NO_PAD_CTRL)
263
264#define MX25_PAD_OE_ACD__OE_ACD IOMUX_PAD(0x30c, 0x114, 0x10, 0, 0, NO_PAD_CTRL)
265#define MX25_PAD_OE_ACD__GPIO_1_25 IOMUX_PAD(0x30c, 0x114, 0x15, 0, 0, NO_PAD_CTRL)
266
267#define MX25_PAD_CONTRAST__CONTRAST IOMUX_PAD(0x310, 0x118, 0x10, 0, 0, NO_PAD_CTRL)
268#define MX25_PAD_CONTRAST__FEC_CRS IOMUX_PAD(0x310, 0x118, 0x15, 0x508, 1, NO_PAD_CTL)
269
270#define MX25_PAD_PWM__PWM IOMUX_PAD(0x314, 0x11c, 0x10, 0, 0, NO_PAD_CTRL)
271#define MX25_PAD_PWM__GPIO_1_26 IOMUX_PAD(0x314, 0x11c, 0x15, 0, 0, NO_PAD_CTRL)
272#define MX25_PAD_PWM__USBH2_OC IOMUX_PAD(0x314, 0x11c, 0x16, 0x580, 1, PAD_CTL_PUS_100K_UP)
273
274#define MX25_PAD_CSI_D2__CSI_D2 IOMUX_PAD(0x318, 0x120, 0x10, 0, 0, NO_PAD_CTRL)
275#define MX25_PAD_CSI_D2__UART5_RXD_MUX IOMUX_PAD(0x318, 0x120, 0x11, 0x578, 1, NO_PAD_CTRL)
276#define MX25_PAD_CSI_D2__GPIO_1_27 IOMUX_PAD(0x318, 0x120, 0x15, 0, 0, NO_PAD_CTRL)
277
278#define MX25_PAD_CSI_D3__CSI_D3 IOMUX_PAD(0x31c, 0x124, 0x10, 0, 0, NO_PAD_CTRL)
279#define MX25_PAD_CSI_D3__GPIO_1_28 IOMUX_PAD(0x31c, 0x124, 0x15, 0, 0, NO_PAD_CTRL)
280
281#define MX25_PAD_CSI_D4__CSI_D4 IOMUX_PAD(0x320, 0x128, 0x10, 0, 0, NO_PAD_CTRL)
282#define MX25_PAD_CSI_D4__UART5_RTS IOMUX_PAD(0x320, 0x128, 0x11, 0x574, 1, NO_PAD_CTRL)
283#define MX25_PAD_CSI_D4__GPIO_1_29 IOMUX_PAD(0x320, 0x128, 0x15, 0, 0, NO_PAD_CTRL)
284
285#define MX25_PAD_CSI_D5__CSI_D5 IOMUX_PAD(0x324, 0x12c, 0x10, 0, 0, NO_PAD_CTRL)
286#define MX25_PAD_CSI_D5__GPIO_1_30 IOMUX_PAD(0x324, 0x12c, 0x15, 0, 0, NO_PAD_CTRL)
287
288#define MX25_PAD_CSI_D6__CSI_D6 IOMUX_PAD(0x328, 0x130, 0x10, 0, 0, NO_PAD_CTRL)
289#define MX25_PAD_CSI_D6__GPIO_1_31 IOMUX_PAD(0x328, 0x130, 0x15, 0, 0, NO_PAD_CTRL)
290
291#define MX25_PAD_CSI_D7__CSI_D7 IOMUX_PAD(0x32c, 0x134, 0x10, 0, 0, NO_PAD_CTRL)
292#define MX25_PAD_CSI_D7__GPIO_1_6 IOMUX_PAD(0x32c, 0x134, 0x15, 0, 0, NO_PAD_CTRL)
293
294#define MX25_PAD_CSI_D8__CSI_D8 IOMUX_PAD(0x330, 0x138, 0x10, 0, 0, NO_PAD_CTRL)
295#define MX25_PAD_CSI_D8__GPIO_1_7 IOMUX_PAD(0x330, 0x138, 0x15, 0, 0, NO_PAD_CTRL)
296
297#define MX25_PAD_CSI_D9__CSI_D9 IOMUX_PAD(0x334, 0x13c, 0x10, 0, 0, NO_PAD_CTRL)
298#define MX25_PAD_CSI_D9__GPIO_4_21 IOMUX_PAD(0x334, 0x13c, 0x15, 0, 0, NO_PAD_CTRL)
299
300#define MX25_PAD_CSI_MCLK__CSI_MCLK IOMUX_PAD(0x338, 0x140, 0x10, 0, 0, NO_PAD_CTRL)
301#define MX25_PAD_CSI_MCLK__GPIO_1_8 IOMUX_PAD(0x338, 0x140, 0x15, 0, 0, NO_PAD_CTRL)
302
303#define MX25_PAD_CSI_VSYNC__CSI_VSYNC IOMUX_PAD(0x33c, 0x144, 0x10, 0, 0, NO_PAD_CTRL)
304#define MX25_PAD_CSI_VSYNC__GPIO_1_9 IOMUX_PAD(0x33c, 0x144, 0x15, 0, 0, NO_PAD_CTRL)
305
306#define MX25_PAD_CSI_HSYNC__CSI_HSYNC IOMUX_PAD(0x340, 0x148, 0x10, 0, 0, NO_PAD_CTRL)
307#define MX25_PAD_CSI_HSYNC__GPIO_1_10 IOMUX_PAD(0x340, 0x148, 0x15, 0, 0, NO_PAD_CTRL)
308
309#define MX25_PAD_CSI_PIXCLK__CSI_PIXCLK IOMUX_PAD(0x344, 0x14c, 0x10, 0, 0, NO_PAD_CTRL)
310#define MX25_PAD_CSI_PIXCLK__GPIO_1_11 IOMUX_PAD(0x344, 0x14c, 0x15, 0, 0, NO_PAD_CTRL)
311
312#define MX25_PAD_I2C1_CLK__I2C1_CLK IOMUX_PAD(0x348, 0x150, 0x10, 0, 0, NO_PAD_CTRL)
313#define MX25_PAD_I2C1_CLK__GPIO_1_12 IOMUX_PAD(0x348, 0x150, 0x15, 0, 0, NO_PAD_CTRL)
314
315#define MX25_PAD_I2C1_DAT__I2C1_DAT IOMUX_PAD(0x34c, 0x154, 0x10, 0, 0, NO_PAD_CTRL)
316#define MX25_PAD_I2C1_DAT__GPIO_1_13 IOMUX_PAD(0x34c, 0x154, 0x15, 0, 0, NO_PAD_CTRL)
317
318#define MX25_PAD_CSPI1_MOSI__CSPI1_MOSI IOMUX_PAD(0x350, 0x158, 0x10, 0, 0, NO_PAD_CTRL)
319#define MX25_PAD_CSPI1_MOSI__GPIO_1_14 IOMUX_PAD(0x350, 0x158, 0x15, 0, 0, NO_PAD_CTRL)
320
321#define MX25_PAD_CSPI1_MISO__CSPI1_MISO IOMUX_PAD(0x354, 0x15c, 0x10, 0, 0, NO_PAD_CTRL)
322#define MX25_PAD_CSPI1_MISO__GPIO_1_15 IOMUX_PAD(0x354, 0x15c, 0x15, 0, 0, NO_PAD_CTRL)
323
324#define MX25_PAD_CSPI1_SS0__CSPI1_SS0 IOMUX_PAD(0x358, 0x160, 0x10, 0, 0, NO_PAD_CTRL)
325#define MX25_PAD_CSPI1_SS0__GPIO_1_16 IOMUX_PAD(0x358, 0x160, 0x15, 0, 0, NO_PAD_CTRL)
326
327#define MX25_PAD_CSPI1_SS1__CSPI1_SS1 IOMUX_PAD(0x35c, 0x164, 0x10, 0, 0, NO_PAD_CTRL)
328#define MX25_PAD_CSPI1_SS1__GPIO_1_17 IOMUX_PAD(0x35c, 0x164, 0x15, 0, 0, NO_PAD_CTRL)
329
330#define MX25_PAD_CSPI1_SCLK__CSPI1_SCLK IOMUX_PAD(0x360, 0x168, 0x10, 0, 0, NO_PAD_CTRL)
331#define MX25_PAD_CSPI1_SCLK__GPIO_1_18 IOMUX_PAD(0x360, 0x168, 0x15, 0, 0, NO_PAD_CTRL)
332
333#define MX25_PAD_CSPI1_RDY__CSPI1_RDY IOMUX_PAD(0x364, 0x16c, 0x10, 0, 0, PAD_CTL_PKE)
334#define MX25_PAD_CSPI1_RDY__GPIO_2_22 IOMUX_PAD(0x364, 0x16c, 0x15, 0, 0, NO_PAD_CTRL)
335
336#define MX25_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x368, 0x170, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN)
337#define MX25_PAD_UART1_RXD__GPIO_4_22 IOMUX_PAD(0x368, 0x170, 0x15, 0, 0, NO_PAD_CTRL)
338
339#define MX25_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x36c, 0x174, 0x10, 0, 0, NO_PAD_CTRL)
340#define MX25_PAD_UART1_TXD__GPIO_4_23 IOMUX_PAD(0x36c, 0x174, 0x15, 0, 0, NO_PAD_CTRL)
341
342#define MX25_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x370, 0x178, 0x10, 0, 0, PAD_CTL_PUS_100K_UP)
343#define MX25_PAD_UART1_RTS__CSI_D0 IOMUX_PAD(0x370, 0x178, 0x11, 0x488, 1, NO_PAD_CTRL)
344#define MX25_PAD_UART1_RTS__GPIO_4_24 IOMUX_PAD(0x370, 0x178, 0x15, 0, 0, NO_PAD_CTRL)
345
346#define MX25_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x374, 0x17c, 0x10, 0, 0, PAD_CTL_PUS_100K_UP)
347#define MX25_PAD_UART1_CTS__CSI_D1 IOMUX_PAD(0x374, 0x17c, 0x11, 0x48c, 1, NO_PAD_CTRL)
348#define MX25_PAD_UART1_CTS__GPIO_4_25 IOMUX_PAD(0x374, 0x17c, 0x15, 0, 0, NO_PAD_CTRL)
349
350#define MX25_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x378, 0x180, 0x10, 0, 0, NO_PAD_CTRL)
351#define MX25_PAD_UART2_RXD__GPIO_4_26 IOMUX_PAD(0x378, 0x180, 0x15, 0, 0, NO_PAD_CTRL)
352
353#define MX25_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x37c, 0x184, 0x10, 0, 0, NO_PAD_CTRL)
354#define MX25_PAD_UART2_TXD__GPIO_4_27 IOMUX_PAD(0x37c, 0x184, 0x15, 0, 0, NO_PAD_CTRL)
355
356#define MX25_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(0x380, 0x188, 0x10, 0, 0, NO_PAD_CTRL)
357#define MX25_PAD_UART2_RTS__FEC_COL IOMUX_PAD(0x380, 0x188, 0x12, 0x504, 2, NO_PAD_CTL)
358#define MX25_PAD_UART2_RTS__GPIO_4_28 IOMUX_PAD(0x380, 0x188, 0x15, 0, 0, NO_PAD_CTRL)
359
360#define MX25_PAD_UART2_CTS__FEC_RX_ER IOMUX_PAD(0x384, 0x18c, 0x12, 0x518, 2, NO_PAD_CTL)
361#define MX25_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(0x384, 0x18c, 0x10, 0, 0, NO_PAD_CTRL)
362#define MX25_PAD_UART2_CTS__GPIO_4_29 IOMUX_PAD(0x384, 0x18c, 0x15, 0, 0, NO_PAD_CTRL)
363
364#define MX25_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x388, 0x190, 0x10, 0, 0, PAD_CTL_PUS_47K_UP)
365#define MX25_PAD_SD1_CMD__FEC_RDATA2 IOMUX_PAD(0x388, 0x190, 0x12, 0x50c, 2, NO_PAD_CTL)
366#define MX25_PAD_SD1_CMD__GPIO_2_23 IOMUX_PAD(0x388, 0x190, 0x15, 0, 0, NO_PAD_CTRL)
367
368#define MX25_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x38c, 0x194, 0x10, 0, 0, PAD_CTL_PUS_47K_UP)
369#define MX25_PAD_SD1_CLK__FEC_RDATA3 IOMUX_PAD(0x38c, 0x194, 0x12, 0x510, 2, NO_PAD_CTL)
370#define MX25_PAD_SD1_CLK__GPIO_2_24 IOMUX_PAD(0x38c, 0x194, 0x15, 0, 0, NO_PAD_CTRL)
371
372#define MX25_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x390, 0x198, 0x10, 0, 0, PAD_CTL_PUS_47K_UP)
373#define MX25_PAD_SD1_DATA0__GPIO_2_25 IOMUX_PAD(0x390, 0x198, 0x15, 0, 0, NO_PAD_CTRL)
374
375#define MX25_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(0x394, 0x19c, 0x10, 0, 0, PAD_CTL_PUS_47K_UP)
376#define MX25_PAD_SD1_DATA1__AUD7_RXD IOMUX_PAD(0x394, 0x19c, 0x13, 0x478, 0, NO_PAD_CTRL)
377#define MX25_PAD_SD1_DATA1__GPIO_2_26 IOMUX_PAD(0x394, 0x19c, 0x15, 0, 0, NO_PAD_CTRL)
378
379#define MX25_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x398, 0x1a0, 0x10, 0, 0, PAD_CTL_PUS_47K_UP)
380#define MX25_PAD_SD1_DATA2__FEC_RX_CLK IOMUX_PAD(0x398, 0x1a0, 0x15, 0x514, 2, NO_PAD_CTL)
381#define MX25_PAD_SD1_DATA2__GPIO_2_27 IOMUX_PAD(0x398, 0x1a0, 0x15, 0, 0, NO_PAD_CTRL)
382
383#define MX25_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x39c, 0x1a4, 0x10, 0, 0, PAD_CTL_PUS_47K_UP)
384#define MX25_PAD_SD1_DATA3__FEC_CRS IOMUX_PAD(0x39c, 0x1a4, 0x10, 0x508, 2, NO_PAD_CTL)
385#define MX25_PAD_SD1_DATA3__GPIO_2_28 IOMUX_PAD(0x39c, 0x1a4, 0x15, 0, 0, NO_PAD_CTRL)
386
387#define MX25_PAD_KPP_ROW0__KPP_ROW0 IOMUX_PAD(0x3a0, 0x1a8, 0x10, 0, 0, PAD_CTL_PKE)
388#define MX25_PAD_KPP_ROW0__GPIO_2_29 IOMUX_PAD(0x3a0, 0x1a8, 0x15, 0, 0, NO_PAD_CTRL)
389
390#define MX25_PAD_KPP_ROW1__KPP_ROW1 IOMUX_PAD(0x3a4, 0x1ac, 0x10, 0, 0, PAD_CTL_PKE)
391#define MX25_PAD_KPP_ROW1__GPIO_2_30 IOMUX_PAD(0x3a4, 0x1ac, 0x15, 0, 0, NO_PAD_CTRL)
392
393#define MX25_PAD_KPP_ROW2__KPP_ROW2 IOMUX_PAD(0x3a8, 0x1b0, 0x10, 0, 0, PAD_CTL_PKE)
394#define MX25_PAD_KPP_ROW2__CSI_D0 IOMUX_PAD(0x3a8, 0x1b0, 0x13, 0x488, 2, NO_PAD_CTRL)
395#define MX25_PAD_KPP_ROW2__GPIO_2_31 IOMUX_PAD(0x3a8, 0x1b0, 0x15, 0, 0, NO_PAD_CTRL)
396
397#define MX25_PAD_KPP_ROW3__KPP_ROW3 IOMUX_PAD(0x3ac, 0x1b4, 0x10, 0, 0, PAD_CTL_PKE)
398#define MX25_PAD_KPP_ROW3__CSI_LD1 IOMUX_PAD(0x3ac, 0x1b4, 0x13, 0x48c, 2, NO_PAD_CTRL)
399#define MX25_PAD_KPP_ROW3__GPIO_3_0 IOMUX_PAD(0x3ac, 0x1b4, 0x15, 0, 0, NO_PAD_CTRL)
400
401#define MX25_PAD_KPP_COL0__KPP_COL0 IOMUX_PAD(0x3b0, 0x1b8, 0x10, 0, 0, PAD_CTL_PKE | PAD_CTL_ODE)
402#define MX25_PAD_KPP_COL0__GPIO_3_1 IOMUX_PAD(0x3b0, 0x1b8, 0x15, 0, 0, NO_PAD_CTRL)
403
404#define MX25_PAD_KPP_COL1__KPP_COL1 IOMUX_PAD(0x3b4, 0x1bc, 0x10, 0, 0, PAD_CTL_PKE | PAD_CTL_ODE)
405#define MX25_PAD_KPP_COL1__GPIO_3_2 IOMUX_PAD(0x3b4, 0x1bc, 0x15, 0, 0, NO_PAD_CTRL)
406
407#define MX25_PAD_KPP_COL2__KPP_COL2 IOMUX_PAD(0x3b8, 0x1c0, 0x10, 0, 0, PAD_CTL_PKE | PAD_CTL_ODE)
408#define MX25_PAD_KPP_COL2__GPIO_3_3 IOMUX_PAD(0x3b8, 0x1c0, 0x15, 0, 0, NO_PAD_CTRL)
409
410#define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(0x3bc, 0x1c4, 0x10, 0, 0, PAD_CTL_PKE | PAD_CTL_ODE)
411#define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(0x3bc, 0x1c4, 0x15, 0, 0, NO_PAD_CTRL)
412
413#define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x3c0, 0x1c8, 0x10, 0, 0, NO_PAD_CTL)
414#define MX25_PAD_FEC_MDC__AUD4_TXD IOMUX_PAD(0x3c0, 0x1c8, 0x12, 0x464, 1, NO_PAD_CTRL)
415#define MX25_PAD_FEC_MDC__GPIO_3_5 IOMUX_PAD(0x3c0, 0x1c8, 0x15, 0, 0, NO_PAD_CTRL)
416
417#define MX25_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(0x3c4, 0x1cc, 0x10, 0, 0, PAD_CTL_HYS | PAD_CTL_PUS_22K_UP)
418#define MX25_PAD_FEC_MDIO__AUD4_RXD IOMUX_PAD(0x3c4, 0x1cc, 0x12, 0x460, 1, NO_PAD_CTRL)
419#define MX25_PAD_FEC_MDIO__GPIO_3_6 IOMUX_PAD(0x3c4, 0x1cc, 0x15, 0, 0, NO_PAD_CTRL)
420
421#define MX25_PAD_FEC_TDATA0__FEC_TDATA0 IOMUX_PAD(0x3c8, 0x1d0, 0x10, 0, 0, NO_PAD_CTL)
422#define MX25_PAD_FEC_TDATA0__GPIO_3_7 IOMUX_PAD(0x3c8, 0x1d0, 0x15, 0, 0, NO_PAD_CTRL)
423
424#define MX25_PAD_FEC_TDATA1__FEC_TDATA1 IOMUX_PAD(0x3cc, 0x1d4, 0x10, 0, 0, NO_PAD_CTL)
425#define MX25_PAD_FEC_TDATA1__AUD4_TXFS IOMUX_PAD(0x3cc, 0x1d4, 0x12, 0x474, 1, NO_PAD_CTRL)
426#define MX25_PAD_FEC_TDATA1__GPIO_3_8 IOMUX_PAD(0x3cc, 0x1d4, 0x15, 0, 0, NO_PAD_CTRL)
427
428#define MX25_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x3d0, 0x1d8, 0x10, 0, 0, NO_PAD_CTL)
429#define MX25_PAD_FEC_TX_EN__GPIO_3_9 IOMUX_PAD(0x3d0, 0x1d8, 0x15, 0, 0, NO_PAD_CTRL)
430
431#define MX25_PAD_FEC_RDATA0__FEC_RDATA0 IOMUX_PAD(0x3d4, 0x1dc, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTL)
432#define MX25_PAD_FEC_RDATA0__GPIO_3_10 IOMUX_PAD(0x3d4, 0x1dc, 0x15, 0, 0, NO_PAD_CTRL)
433
434#define MX25_PAD_FEC_RDATA1__FEC_RDATA1 IOMUX_PAD(0x3d8, 0x1e0, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTL)
435#define MX25_PAD_FEC_RDATA1__GPIO_3_11 IOMUX_PAD(0x3d8, 0x1e0, 0x15, 0, 0, NO_PAD_CTRL)
436
437#define MX25_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(0x3dc, 0x1e4, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTL)
438#define MX25_PAD_FEC_RX_DV__CAN2_RX IOMUX_PAD(0x3dc, 0x1e4, 0x14, 0x484, 0, PAD_CTL_PUS_22K_UP)
439#define MX25_PAD_FEC_RX_DV__GPIO_3_12 IOMUX_PAD(0x3dc, 0x1e4, 0x15, 0, 0, NO_PAD_CTRL)
440
441#define MX25_PAD_FEC_TX_CLK__FEC_TX_CLK IOMUX_PAD(0x3e0, 0x1e8, 0x10, 0, 0, PAD_CTL_HYS | PAD_CTL_PUS_100K_DOWN)
442#define MX25_PAD_FEC_TX_CLK__GPIO_3_13 IOMUX_PAD(0x3e0, 0x1e8, 0x15, 0, 0, NO_PAD_CTRL)
443
444#define MX25_PAD_RTCK__RTCK IOMUX_PAD(0x3e4, 0x1ec, 0x10, 0, 0, NO_PAD_CTRL)
445#define MX25_PAD_RTCK__OWIRE IOMUX_PAD(0x3e4, 0x1ec, 0x11, 0, 0, NO_PAD_CTRL)
446#define MX25_PAD_RTCK__GPIO_3_14 IOMUX_PAD(0x3e4, 0x1ec, 0x15, 0, 0, NO_PAD_CTRL)
447
448#define MX25_PAD_DE_B__DE_B IOMUX_PAD(0x3ec, 0x1f0, 0x10, 0, 0, NO_PAD_CTRL)
449#define MX25_PAD_DE_B__GPIO_2_20 IOMUX_PAD(0x3ec, 0x1f0, 0x15, 0, 0, NO_PAD_CTRL)
450
451#define MX25_PAD_TDO__TDO IOMUX_PAD(0x3e8, 0x000, 0x00, 0, 0, NO_PAD_CTRL)
452
453#define MX25_PAD_GPIO_A__GPIO_A IOMUX_PAD(0x3f0, 0x1f4, 0x10, 0, 0, NO_PAD_CTRL)
454#define MX25_PAD_GPIO_A__CAN1_TX IOMUX_PAD(0x3f0, 0x1f4, 0x16, 0, 0, PAD_CTL_PUS_22K_UP)
455#define MX25_PAD_GPIO_A__USBOTG_PWR IOMUX_PAD(0x3f0, 0x1f4, 0x12, 0, 0, PAD_CTL_PKE)
456
457#define MX25_PAD_GPIO_B__GPIO_B IOMUX_PAD(0x3f4, 0x1f8, 0x10, 0, 0, NO_PAD_CTRL)
458#define MX25_PAD_GPIO_B__CAN1_RX IOMUX_PAD(0x3f4, 0x1f8, 0x16, 0x480, 1, PAD_CTL_PUS_22K)
459#define MX25_PAD_GPIO_B__USBOTG_OC IOMUX_PAD(0x3f4, 0x1f8, 0x12, 0x57c, 1, PAD_CTL_PUS_100K_UP)
460
461#define MX25_PAD_GPIO_C__GPIO_C IOMUX_PAD(0x3f8, 0x1fc, 0x10, 0, 0, NO_PAD_CTRL)
462#define MX25_PAD_GPIO_C__CAN2_TX IOMUX_PAD(0x3f8, 0x1fc, 0x16, 0, 0, PAD_CTL_PUS_22K_UP)
463
464#define MX25_PAD_GPIO_D__GPIO_D IOMUX_PAD(0x3fc, 0x200, 0x10, 0, 0, NO_PAD_CTRL)
465#define MX25_PAD_GPIO_D__CAN2_RX IOMUX_PAD(0x3fc, 0x200, 0x16, 0x484, 1, PAD_CTL_PUS_22K_UP)
466
467#define MX25_PAD_GPIO_E__GPIO_E IOMUX_PAD(0x400, 0x204, 0x10, 0, 0, NO_PAD_CTRL)
468#define MX25_PAD_GPIO_E__AUD7_TXD IOMUX_PAD(0x400, 0x204, 0x14, 0, 0, NO_PAD_CTRL)
469
470#define MX25_PAD_GPIO_F__GPIO_F IOMUX_PAD(0x404, 0x208, 0x10, 0, 0, NO_PAD_CTRL)
471#define MX25_PAD_GPIO_F__AUD7_TXC IOMUX_PAD(0x404, 0x208, 0x14, 0, 0, NO_PAD_CTRL)
472
473#define MX25_PAD_EXT_ARMCLK__EXT_ARMCLK IOMUX_PAD(0x000, 0x20c, 0x10, 0, 0, NO_PAD_CTRL)
474#define MX25_PAD_EXT_ARMCLK__GPIO_3_15 IOMUX_PAD(0x000, 0x20c, 0x15, 0, 0, NO_PAD_CTRL)
475
476#define MX25_PAD_UPLL_BYPCLK__UPLL_BYPCLK IOMUX_PAD(0x000, 0x210, 0x10, 0, 0, NO_PAD_CTRL)
477#define MX25_PAD_UPLL_BYPCLK__GPIO_3_16 IOMUX_PAD(0x000, 0x210, 0x15, 0, 0, NO_PAD_CTRL)
478
479#define MX25_PAD_VSTBY_REQ__VSTBY_REQ IOMUX_PAD(0x408, 0x214, 0x10, 0, 0, NO_PAD_CTRL)
480#define MX25_PAD_VSTBY_REQ__AUD7_TXFS IOMUX_PAD(0x408, 0x214, 0x14, 0, 0, NO_PAD_CTRL)
481#define MX25_PAD_VSTBY_REQ__GPIO_3_17 IOMUX_PAD(0x408, 0x214, 0x15, 0, 0, NO_PAD_CTRL)
482#define MX25_PAD_VSTBY_ACK__VSTBY_ACK IOMUX_PAD(0x40c, 0x218, 0x10, 0, 0, NO_PAD_CTRL)
483#define MX25_PAD_VSTBY_ACK__GPIO_3_18 IOMUX_PAD(0x40c, 0x218, 0x15, 0, 0, NO_PAD_CTRL)
484
485#define MX25_PAD_POWER_FAIL__POWER_FAIL IOMUX_PAD(0x410, 0x21c, 0x10, 0, 0, NO_PAD_CTRL)
486#define MX25_PAD_POWER_FAIL__AUD7_RXD IOMUX_PAD(0x410, 0x21c, 0x14, 0x478, 1, NO_PAD_CTRL)
487#define MX25_PAD_POWER_FAIL__GPIO_3_19 IOMUX_PAD(0x410, 0x21c, 0x15, 0, 0, NO_PAD_CTRL)
488
489#define MX25_PAD_CLKO__CLKO IOMUX_PAD(0x414, 0x220, 0x10, 0, 0, NO_PAD_CTRL)
490#define MX25_PAD_CLKO__GPIO_2_21 IOMUX_PAD(0x414, 0x220, 0x15, 0, 0, NO_PAD_CTRL)
491
492#define MX25_PAD_BOOT_MODE0__BOOT_MODE0 IOMUX_PAD(0x000, 0x224, 0x00, 0, 0, NO_PAD_CTRL)
493#define MX25_PAD_BOOT_MODE0__GPIO_4_30 IOMUX_PAD(0x000, 0x224, 0x05, 0, 0, NO_PAD_CTRL)
494#define MX25_PAD_BOOT_MODE1__BOOT_MODE1 IOMUX_PAD(0x000, 0x228, 0x00, 0, 0, NO_PAD_CTRL)
495#define MX25_PAD_BOOT_MODE1__GPIO_4_31 IOMUX_PAD(0x000, 0x228, 0x05, 0, 0, NO_PAD_CTRL)
496
497#define MX25_PAD_CTL_GRP_DVS_MISC IOMUX_PAD(0x418, 0x000, 0, 0, 0, NO_PAD_CTRL)
498#define MX25_PAD_CTL_GRP_DSE_FEC IOMUX_PAD(0x41c, 0x000, 0, 0, 0, NO_PAD_CTRL)
499#define MX25_PAD_CTL_GRP_DVS_JTAG IOMUX_PAD(0x420, 0x000, 0, 0, 0, NO_PAD_CTRL)
500#define MX25_PAD_CTL_GRP_DSE_NFC IOMUX_PAD(0x424, 0x000, 0, 0, 0, NO_PAD_CTRL)
501#define MX25_PAD_CTL_GRP_DSE_CSI IOMUX_PAD(0x428, 0x000, 0, 0, 0, NO_PAD_CTRL)
502#define MX25_PAD_CTL_GRP_DSE_WEIM IOMUX_PAD(0x42c, 0x000, 0, 0, 0, NO_PAD_CTRL)
503#define MX25_PAD_CTL_GRP_DSE_DDR IOMUX_PAD(0x430, 0x000, 0, 0, 0, NO_PAD_CTRL)
504#define MX25_PAD_CTL_GRP_DVS_CRM IOMUX_PAD(0x434, 0x000, 0, 0, 0, NO_PAD_CTRL)
505#define MX25_PAD_CTL_GRP_DSE_KPP IOMUX_PAD(0x438, 0x000, 0, 0, 0, NO_PAD_CTRL)
506#define MX25_PAD_CTL_GRP_DSE_SDHC1 IOMUX_PAD(0x43c, 0x000, 0, 0, 0, NO_PAD_CTRL)
507#define MX25_PAD_CTL_GRP_DSE_LCD IOMUX_PAD(0x440, 0x000, 0, 0, 0, NO_PAD_CTRL)
508#define MX25_PAD_CTL_GRP_DSE_UART IOMUX_PAD(0x444, 0x000, 0, 0, 0, NO_PAD_CTRL)
509#define MX25_PAD_CTL_GRP_DVS_NFC IOMUX_PAD(0x448, 0x000, 0, 0, 0, NO_PAD_CTRL)
510#define MX25_PAD_CTL_GRP_DVS_CSI IOMUX_PAD(0x44c, 0x000, 0, 0, 0, NO_PAD_CTRL)
511#define MX25_PAD_CTL_GRP_DSE_CSPI1 IOMUX_PAD(0x450, 0x000, 0, 0, 0, NO_PAD_CTRL)
512#define MX25_PAD_CTL_GRP_DDRTYPE IOMUX_PAD(0x454, 0x000, 0, 0, 0, NO_PAD_CTRL)
513#define MX25_PAD_CTL_GRP_DVS_SDHC1 IOMUX_PAD(0x458, 0x000, 0, 0, 0, NO_PAD_CTRL)
514#define MX25_PAD_CTL_GRP_DVS_LCD IOMUX_PAD(0x45c, 0x000, 0, 0, 0, NO_PAD_CTRL)
515
516#endif // __ASSEMBLY__
517#endif // __IOMUX_MX25_H__
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 27f8d1b2bc6b..446f86763816 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -602,6 +602,8 @@ enum iomux_pins {
602#define MX31_PIN_I2C_DAT__SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 602#define MX31_PIN_I2C_DAT__SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
603#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2) 603#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2)
604#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2) 604#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2)
605#define MX31_PIN_CSPI2_SS2__I2C3_SDA IOMUX_MODE(MX31_PIN_CSPI2_SS2, IOMUX_CONFIG_ALT1)
606#define MX31_PIN_CSPI2_SCLK__I2C3_SCL IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_ALT1)
605#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC) 607#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC)
606#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC) 608#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC)
607#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC) 609#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC)
@@ -633,6 +635,19 @@ enum iomux_pins {
633#define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC) 635#define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC)
634#define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC) 636#define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC)
635#define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC) 637#define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC)
638#define MX31_PIN_CSPI1_MOSI__USBH1_RXDM IOMUX_MODE(MX31_PIN_CSPI1_MOSI, IOMUX_CONFIG_ALT1)
639#define MX31_PIN_CSPI1_MISO__USBH1_RXDP IOMUX_MODE(MX31_PIN_CSPI1_MISO, IOMUX_CONFIG_ALT1)
640#define MX31_PIN_CSPI1_SS0__USBH1_TXDM IOMUX_MODE(MX31_PIN_CSPI1_SS0, IOMUX_CONFIG_ALT1)
641#define MX31_PIN_CSPI1_SS1__USBH1_TXDP IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_ALT1)
642#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1)
643#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1)
644#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1)
645#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC)
646#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC)
647#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC)
648#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC)
649#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC)
650#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC)
636#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO) 651#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO)
637#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 652#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
638#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC) 653#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC)
@@ -667,6 +682,18 @@ enum iomux_pins {
667#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO) 682#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO)
668#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO) 683#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)
669#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO) 684#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO)
685#define MX31_PIN_GPIO1_0__GPIO1_0 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO)
686#define MX31_PIN_SVEN0__GPIO2_0 IOMUX_MODE(MX31_PIN_SVEN0, IOMUX_CONFIG_GPIO)
687#define MX31_PIN_STX0__GPIO2_1 IOMUX_MODE(MX31_PIN_STX0, IOMUX_CONFIG_GPIO)
688#define MX31_PIN_SRX0__GPIO2_2 IOMUX_MODE(MX31_PIN_SRX0, IOMUX_CONFIG_GPIO)
689#define MX31_PIN_SIMPD0__GPIO2_3 IOMUX_MODE(MX31_PIN_SIMPD0, IOMUX_CONFIG_GPIO)
690#define MX31_PIN_DTR_DCE1__GPIO2_8 IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO)
691#define MX31_PIN_DSR_DCE1__GPIO2_9 IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_GPIO)
692#define MX31_PIN_RI_DCE1__GPIO2_10 IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_GPIO)
693#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO)
694#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO)
695#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO)
696
670 697
671/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 698/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0
672 * cspi1_ss1*/ 699 * cspi1_ss1*/
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h b/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h
new file mode 100644
index 000000000000..9f13061192c8
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h
@@ -0,0 +1,287 @@
1/*
2 * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
4 * Copyright (C) 2009 by Dmitriy Taychenachev <dimichxp@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __MACH_IOMUX_MXC91231_H__
22#define __MACH_IOMUX_MXC91231_H__
23
24/*
25 * various IOMUX output functions
26 */
27
28#define IOMUX_OCONFIG_GPIO (0 << 4) /* used as GPIO */
29#define IOMUX_OCONFIG_FUNC (1 << 4) /* used as function */
30#define IOMUX_OCONFIG_ALT1 (2 << 4) /* used as alternate function 1 */
31#define IOMUX_OCONFIG_ALT2 (3 << 4) /* used as alternate function 2 */
32#define IOMUX_OCONFIG_ALT3 (4 << 4) /* used as alternate function 3 */
33#define IOMUX_OCONFIG_ALT4 (5 << 4) /* used as alternate function 4 */
34#define IOMUX_OCONFIG_ALT5 (6 << 4) /* used as alternate function 5 */
35#define IOMUX_OCONFIG_ALT6 (7 << 4) /* used as alternate function 6 */
36#define IOMUX_ICONFIG_NONE 0 /* not configured for input */
37#define IOMUX_ICONFIG_GPIO 1 /* used as GPIO */
38#define IOMUX_ICONFIG_FUNC 2 /* used as function */
39#define IOMUX_ICONFIG_ALT1 4 /* used as alternate function 1 */
40#define IOMUX_ICONFIG_ALT2 8 /* used as alternate function 2 */
41
42#define IOMUX_CONFIG_GPIO (IOMUX_OCONFIG_GPIO | IOMUX_ICONFIG_GPIO)
43#define IOMUX_CONFIG_FUNC (IOMUX_OCONFIG_FUNC | IOMUX_ICONFIG_FUNC)
44#define IOMUX_CONFIG_ALT1 (IOMUX_OCONFIG_ALT1 | IOMUX_ICONFIG_ALT1)
45#define IOMUX_CONFIG_ALT2 (IOMUX_OCONFIG_ALT2 | IOMUX_ICONFIG_ALT2)
46
47/*
48 * setups a single pin:
49 * - reserves the pin so that it is not claimed by another driver
50 * - setups the iomux according to the configuration
51 * - if the pin is configured as a GPIO, we claim it throug kernel gpiolib
52 */
53int mxc_iomux_alloc_pin(const unsigned int pin_mode, const char *label);
54/*
55 * setups mutliple pins
56 * convenient way to call the above function with tables
57 */
58int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
59 const char *label);
60
61/*
62 * releases a single pin:
63 * - make it available for a future use by another driver
64 * - frees the GPIO if the pin was configured as GPIO
65 * - DOES NOT reconfigure the IOMUX in its reset state
66 */
67void mxc_iomux_release_pin(const unsigned int pin_mode);
68/*
69 * releases multiple pins
70 * convenvient way to call the above function with tables
71 */
72void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count);
73
74#define MUX_SIDE_AP (0)
75#define MUX_SIDE_SP (1)
76
77#define MUX_SIDE_SHIFT (26)
78#define MUX_SIDE_MASK (0x1 << MUX_SIDE_SHIFT)
79
80#define MUX_GPIO_PORT_SHIFT (23)
81#define MUX_GPIO_PORT_MASK (0x7 << MUX_GPIO_PORT_SHIFT)
82
83#define MUX_GPIO_PIN_SHIFT (20)
84#define MUX_GPIO_PIN_MASK (0x1f << MUX_GPIO_PIN_SHIFT)
85
86#define MUX_REG_SHIFT (15)
87#define MUX_REG_MASK (0x1f << MUX_REG_SHIFT)
88
89#define MUX_FIELD_SHIFT (13)
90#define MUX_FIELD_MASK (0x3 << MUX_FIELD_SHIFT)
91
92#define MUX_PADGRP_SHIFT (8)
93#define MUX_PADGRP_MASK (0x1f << MUX_PADGRP_SHIFT)
94
95#define MUX_PIN_MASK (0xffffff << 8)
96
97#define GPIO_PORT_MAX (3)
98
99#define IOMUX_PIN(side, gport, gpin, ctlreg, ctlfield, padgrp) \
100 (((side) << MUX_SIDE_SHIFT) | \
101 (gport << MUX_GPIO_PORT_SHIFT) | \
102 ((gpin) << MUX_GPIO_PIN_SHIFT) | \
103 ((ctlreg) << MUX_REG_SHIFT) | \
104 ((ctlfield) << MUX_FIELD_SHIFT) | \
105 ((padgrp) << MUX_PADGRP_SHIFT))
106
107#define MUX_MODE_OUT_SHIFT (4)
108#define MUX_MODE_IN_SHIFT (0)
109#define MUX_MODE_SHIFT (0)
110#define MUX_MODE_MASK (0xff << MUX_MODE_SHIFT)
111
112#define IOMUX_MODE(pin, mode) \
113 (pin | (mode << MUX_MODE_SHIFT))
114
115enum iomux_pins {
116 /* AP Side pins */
117 MXC91231_PIN_AP_CLE = IOMUX_PIN(0, 0, 0, 0, 0, 24),
118 MXC91231_PIN_AP_ALE = IOMUX_PIN(0, 0, 1, 0, 1, 24),
119 MXC91231_PIN_AP_CE_B = IOMUX_PIN(0, 0, 2, 0, 2, 24),
120 MXC91231_PIN_AP_RE_B = IOMUX_PIN(0, 0, 3, 0, 3, 24),
121 MXC91231_PIN_AP_WE_B = IOMUX_PIN(0, 0, 4, 1, 0, 24),
122 MXC91231_PIN_AP_WP_B = IOMUX_PIN(0, 0, 5, 1, 1, 24),
123 MXC91231_PIN_AP_BSY_B = IOMUX_PIN(0, 0, 6, 1, 2, 24),
124 MXC91231_PIN_AP_U1_TXD = IOMUX_PIN(0, 0, 7, 1, 3, 28),
125 MXC91231_PIN_AP_U1_RXD = IOMUX_PIN(0, 0, 8, 2, 0, 28),
126 MXC91231_PIN_AP_U1_RTS_B = IOMUX_PIN(0, 0, 9, 2, 1, 28),
127 MXC91231_PIN_AP_U1_CTS_B = IOMUX_PIN(0, 0, 10, 2, 2, 28),
128 MXC91231_PIN_AP_AD1_TXD = IOMUX_PIN(0, 0, 11, 2, 3, 9),
129 MXC91231_PIN_AP_AD1_RXD = IOMUX_PIN(0, 0, 12, 3, 0, 9),
130 MXC91231_PIN_AP_AD1_TXC = IOMUX_PIN(0, 0, 13, 3, 1, 9),
131 MXC91231_PIN_AP_AD1_TXFS = IOMUX_PIN(0, 0, 14, 3, 2, 9),
132 MXC91231_PIN_AP_AD2_TXD = IOMUX_PIN(0, 0, 15, 3, 3, 9),
133 MXC91231_PIN_AP_AD2_RXD = IOMUX_PIN(0, 0, 16, 4, 0, 9),
134 MXC91231_PIN_AP_AD2_TXC = IOMUX_PIN(0, 0, 17, 4, 1, 9),
135 MXC91231_PIN_AP_AD2_TXFS = IOMUX_PIN(0, 0, 18, 4, 2, 9),
136 MXC91231_PIN_AP_OWDAT = IOMUX_PIN(0, 0, 19, 4, 3, 28),
137 MXC91231_PIN_AP_IPU_LD17 = IOMUX_PIN(0, 0, 20, 5, 0, 28),
138 MXC91231_PIN_AP_IPU_D3_VSYNC = IOMUX_PIN(0, 0, 21, 5, 1, 28),
139 MXC91231_PIN_AP_IPU_D3_HSYNC = IOMUX_PIN(0, 0, 22, 5, 2, 28),
140 MXC91231_PIN_AP_IPU_D3_CLK = IOMUX_PIN(0, 0, 23, 5, 3, 28),
141 MXC91231_PIN_AP_IPU_D3_DRDY = IOMUX_PIN(0, 0, 24, 6, 0, 28),
142 MXC91231_PIN_AP_IPU_D3_CONTR = IOMUX_PIN(0, 0, 25, 6, 1, 28),
143 MXC91231_PIN_AP_IPU_D0_CS = IOMUX_PIN(0, 0, 26, 6, 2, 28),
144 MXC91231_PIN_AP_IPU_LD16 = IOMUX_PIN(0, 0, 27, 6, 3, 28),
145 MXC91231_PIN_AP_IPU_D2_CS = IOMUX_PIN(0, 0, 28, 7, 0, 28),
146 MXC91231_PIN_AP_IPU_PAR_RS = IOMUX_PIN(0, 0, 29, 7, 1, 28),
147 MXC91231_PIN_AP_IPU_D3_PS = IOMUX_PIN(0, 0, 30, 7, 2, 28),
148 MXC91231_PIN_AP_IPU_D3_CLS = IOMUX_PIN(0, 0, 31, 7, 3, 28),
149 MXC91231_PIN_AP_IPU_RD = IOMUX_PIN(0, 1, 0, 8, 0, 28),
150 MXC91231_PIN_AP_IPU_WR = IOMUX_PIN(0, 1, 1, 8, 1, 28),
151 MXC91231_PIN_AP_IPU_LD0 = IOMUX_PIN(0, 7, 0, 8, 2, 28),
152 MXC91231_PIN_AP_IPU_LD1 = IOMUX_PIN(0, 7, 0, 8, 3, 28),
153 MXC91231_PIN_AP_IPU_LD2 = IOMUX_PIN(0, 7, 0, 9, 0, 28),
154 MXC91231_PIN_AP_IPU_LD3 = IOMUX_PIN(0, 1, 2, 9, 1, 28),
155 MXC91231_PIN_AP_IPU_LD4 = IOMUX_PIN(0, 1, 3, 9, 2, 28),
156 MXC91231_PIN_AP_IPU_LD5 = IOMUX_PIN(0, 1, 4, 9, 3, 28),
157 MXC91231_PIN_AP_IPU_LD6 = IOMUX_PIN(0, 1, 5, 10, 0, 28),
158 MXC91231_PIN_AP_IPU_LD7 = IOMUX_PIN(0, 1, 6, 10, 1, 28),
159 MXC91231_PIN_AP_IPU_LD8 = IOMUX_PIN(0, 1, 7, 10, 2, 28),
160 MXC91231_PIN_AP_IPU_LD9 = IOMUX_PIN(0, 1, 8, 10, 3, 28),
161 MXC91231_PIN_AP_IPU_LD10 = IOMUX_PIN(0, 1, 9, 11, 0, 28),
162 MXC91231_PIN_AP_IPU_LD11 = IOMUX_PIN(0, 1, 10, 11, 1, 28),
163 MXC91231_PIN_AP_IPU_LD12 = IOMUX_PIN(0, 1, 11, 11, 2, 28),
164 MXC91231_PIN_AP_IPU_LD13 = IOMUX_PIN(0, 1, 12, 11, 3, 28),
165 MXC91231_PIN_AP_IPU_LD14 = IOMUX_PIN(0, 1, 13, 12, 0, 28),
166 MXC91231_PIN_AP_IPU_LD15 = IOMUX_PIN(0, 1, 14, 12, 1, 28),
167 MXC91231_PIN_AP_KPROW4 = IOMUX_PIN(0, 7, 0, 12, 2, 10),
168 MXC91231_PIN_AP_KPROW5 = IOMUX_PIN(0, 1, 16, 12, 3, 10),
169 MXC91231_PIN_AP_GPIO_AP_B17 = IOMUX_PIN(0, 1, 17, 13, 0, 10),
170 MXC91231_PIN_AP_GPIO_AP_B18 = IOMUX_PIN(0, 1, 18, 13, 1, 10),
171 MXC91231_PIN_AP_KPCOL3 = IOMUX_PIN(0, 1, 19, 13, 2, 11),
172 MXC91231_PIN_AP_KPCOL4 = IOMUX_PIN(0, 1, 20, 13, 3, 11),
173 MXC91231_PIN_AP_KPCOL5 = IOMUX_PIN(0, 1, 21, 14, 0, 11),
174 MXC91231_PIN_AP_GPIO_AP_B22 = IOMUX_PIN(0, 1, 22, 14, 1, 11),
175 MXC91231_PIN_AP_GPIO_AP_B23 = IOMUX_PIN(0, 1, 23, 14, 2, 11),
176 MXC91231_PIN_AP_CSI_D0 = IOMUX_PIN(0, 1, 24, 14, 3, 21),
177 MXC91231_PIN_AP_CSI_D1 = IOMUX_PIN(0, 1, 25, 15, 0, 21),
178 MXC91231_PIN_AP_CSI_D2 = IOMUX_PIN(0, 1, 26, 15, 1, 21),
179 MXC91231_PIN_AP_CSI_D3 = IOMUX_PIN(0, 1, 27, 15, 2, 21),
180 MXC91231_PIN_AP_CSI_D4 = IOMUX_PIN(0, 1, 28, 15, 3, 21),
181 MXC91231_PIN_AP_CSI_D5 = IOMUX_PIN(0, 1, 29, 16, 0, 21),
182 MXC91231_PIN_AP_CSI_D6 = IOMUX_PIN(0, 1, 30, 16, 1, 21),
183 MXC91231_PIN_AP_CSI_D7 = IOMUX_PIN(0, 1, 31, 16, 2, 21),
184 MXC91231_PIN_AP_CSI_D8 = IOMUX_PIN(0, 2, 0, 16, 3, 21),
185 MXC91231_PIN_AP_CSI_D9 = IOMUX_PIN(0, 2, 1, 17, 0, 21),
186 MXC91231_PIN_AP_CSI_MCLK = IOMUX_PIN(0, 2, 2, 17, 1, 21),
187 MXC91231_PIN_AP_CSI_VSYNC = IOMUX_PIN(0, 2, 3, 17, 2, 21),
188 MXC91231_PIN_AP_CSI_HSYNC = IOMUX_PIN(0, 2, 4, 17, 3, 21),
189 MXC91231_PIN_AP_CSI_PIXCLK = IOMUX_PIN(0, 2, 5, 18, 0, 21),
190 MXC91231_PIN_AP_I2CLK = IOMUX_PIN(0, 2, 6, 18, 1, 12),
191 MXC91231_PIN_AP_I2DAT = IOMUX_PIN(0, 2, 7, 18, 2, 12),
192 MXC91231_PIN_AP_GPIO_AP_C8 = IOMUX_PIN(0, 2, 8, 18, 3, 9),
193 MXC91231_PIN_AP_GPIO_AP_C9 = IOMUX_PIN(0, 2, 9, 19, 0, 9),
194 MXC91231_PIN_AP_GPIO_AP_C10 = IOMUX_PIN(0, 2, 10, 19, 1, 9),
195 MXC91231_PIN_AP_GPIO_AP_C11 = IOMUX_PIN(0, 2, 11, 19, 2, 9),
196 MXC91231_PIN_AP_GPIO_AP_C12 = IOMUX_PIN(0, 2, 12, 19, 3, 9),
197 MXC91231_PIN_AP_GPIO_AP_C13 = IOMUX_PIN(0, 2, 13, 20, 0, 28),
198 MXC91231_PIN_AP_GPIO_AP_C14 = IOMUX_PIN(0, 2, 14, 20, 1, 28),
199 MXC91231_PIN_AP_GPIO_AP_C15 = IOMUX_PIN(0, 2, 15, 20, 2, 9),
200 MXC91231_PIN_AP_GPIO_AP_C16 = IOMUX_PIN(0, 2, 16, 20, 3, 9),
201 MXC91231_PIN_AP_GPIO_AP_C17 = IOMUX_PIN(0, 2, 17, 21, 0, 9),
202 MXC91231_PIN_AP_ED_INT0 = IOMUX_PIN(0, 2, 18, 21, 1, 22),
203 MXC91231_PIN_AP_ED_INT1 = IOMUX_PIN(0, 2, 19, 21, 2, 22),
204 MXC91231_PIN_AP_ED_INT2 = IOMUX_PIN(0, 2, 20, 21, 3, 22),
205 MXC91231_PIN_AP_ED_INT3 = IOMUX_PIN(0, 2, 21, 22, 0, 22),
206 MXC91231_PIN_AP_ED_INT4 = IOMUX_PIN(0, 2, 22, 22, 1, 23),
207 MXC91231_PIN_AP_ED_INT5 = IOMUX_PIN(0, 2, 23, 22, 2, 23),
208 MXC91231_PIN_AP_ED_INT6 = IOMUX_PIN(0, 2, 24, 22, 3, 23),
209 MXC91231_PIN_AP_ED_INT7 = IOMUX_PIN(0, 2, 25, 23, 0, 23),
210 MXC91231_PIN_AP_U2_DSR_B = IOMUX_PIN(0, 2, 26, 23, 1, 28),
211 MXC91231_PIN_AP_U2_RI_B = IOMUX_PIN(0, 2, 27, 23, 2, 28),
212 MXC91231_PIN_AP_U2_CTS_B = IOMUX_PIN(0, 2, 28, 23, 3, 28),
213 MXC91231_PIN_AP_U2_DTR_B = IOMUX_PIN(0, 2, 29, 24, 0, 28),
214 MXC91231_PIN_AP_KPROW0 = IOMUX_PIN(0, 7, 0, 24, 1, 10),
215 MXC91231_PIN_AP_KPROW1 = IOMUX_PIN(0, 1, 15, 24, 2, 10),
216 MXC91231_PIN_AP_KPROW2 = IOMUX_PIN(0, 7, 0, 24, 3, 10),
217 MXC91231_PIN_AP_KPROW3 = IOMUX_PIN(0, 7, 0, 25, 0, 10),
218 MXC91231_PIN_AP_KPCOL0 = IOMUX_PIN(0, 7, 0, 25, 1, 11),
219 MXC91231_PIN_AP_KPCOL1 = IOMUX_PIN(0, 7, 0, 25, 2, 11),
220 MXC91231_PIN_AP_KPCOL2 = IOMUX_PIN(0, 7, 0, 25, 3, 11),
221
222 /* Shared pins */
223 MXC91231_PIN_SP_U3_TXD = IOMUX_PIN(1, 3, 0, 0, 0, 28),
224 MXC91231_PIN_SP_U3_RXD = IOMUX_PIN(1, 3, 1, 0, 1, 28),
225 MXC91231_PIN_SP_U3_RTS_B = IOMUX_PIN(1, 3, 2, 0, 2, 28),
226 MXC91231_PIN_SP_U3_CTS_B = IOMUX_PIN(1, 3, 3, 0, 3, 28),
227 MXC91231_PIN_SP_USB_TXOE_B = IOMUX_PIN(1, 3, 4, 1, 0, 28),
228 MXC91231_PIN_SP_USB_DAT_VP = IOMUX_PIN(1, 3, 5, 1, 1, 28),
229 MXC91231_PIN_SP_USB_SE0_VM = IOMUX_PIN(1, 3, 6, 1, 2, 28),
230 MXC91231_PIN_SP_USB_RXD = IOMUX_PIN(1, 3, 7, 1, 3, 28),
231 MXC91231_PIN_SP_UH2_TXOE_B = IOMUX_PIN(1, 3, 8, 2, 0, 28),
232 MXC91231_PIN_SP_UH2_SPEED = IOMUX_PIN(1, 3, 9, 2, 1, 28),
233 MXC91231_PIN_SP_UH2_SUSPEN = IOMUX_PIN(1, 3, 10, 2, 2, 28),
234 MXC91231_PIN_SP_UH2_TXDP = IOMUX_PIN(1, 3, 11, 2, 3, 28),
235 MXC91231_PIN_SP_UH2_RXDP = IOMUX_PIN(1, 3, 12, 3, 0, 28),
236 MXC91231_PIN_SP_UH2_RXDM = IOMUX_PIN(1, 3, 13, 3, 1, 28),
237 MXC91231_PIN_SP_UH2_OVR = IOMUX_PIN(1, 3, 14, 3, 2, 28),
238 MXC91231_PIN_SP_UH2_PWR = IOMUX_PIN(1, 3, 15, 3, 3, 28),
239 MXC91231_PIN_SP_SD1_DAT0 = IOMUX_PIN(1, 3, 16, 4, 0, 25),
240 MXC91231_PIN_SP_SD1_DAT1 = IOMUX_PIN(1, 3, 17, 4, 1, 25),
241 MXC91231_PIN_SP_SD1_DAT2 = IOMUX_PIN(1, 3, 18, 4, 2, 25),
242 MXC91231_PIN_SP_SD1_DAT3 = IOMUX_PIN(1, 3, 19, 4, 3, 25),
243 MXC91231_PIN_SP_SD1_CMD = IOMUX_PIN(1, 3, 20, 5, 0, 25),
244 MXC91231_PIN_SP_SD1_CLK = IOMUX_PIN(1, 3, 21, 5, 1, 25),
245 MXC91231_PIN_SP_SD2_DAT0 = IOMUX_PIN(1, 3, 22, 5, 2, 26),
246 MXC91231_PIN_SP_SD2_DAT1 = IOMUX_PIN(1, 3, 23, 5, 3, 26),
247 MXC91231_PIN_SP_SD2_DAT2 = IOMUX_PIN(1, 3, 24, 6, 0, 26),
248 MXC91231_PIN_SP_SD2_DAT3 = IOMUX_PIN(1, 3, 25, 6, 1, 26),
249 MXC91231_PIN_SP_GPIO_SP_A26 = IOMUX_PIN(1, 3, 26, 6, 2, 28),
250 MXC91231_PIN_SP_SPI1_CLK = IOMUX_PIN(1, 3, 27, 6, 3, 13),
251 MXC91231_PIN_SP_SPI1_MOSI = IOMUX_PIN(1, 3, 28, 7, 0, 13),
252 MXC91231_PIN_SP_SPI1_MISO = IOMUX_PIN(1, 3, 29, 7, 1, 13),
253 MXC91231_PIN_SP_SPI1_SS0 = IOMUX_PIN(1, 3, 30, 7, 2, 13),
254 MXC91231_PIN_SP_SPI1_SS1 = IOMUX_PIN(1, 3, 31, 7, 3, 13),
255 MXC91231_PIN_SP_SD2_CMD = IOMUX_PIN(1, 7, 0, 8, 0, 26),
256 MXC91231_PIN_SP_SD2_CLK = IOMUX_PIN(1, 7, 0, 8, 1, 26),
257 MXC91231_PIN_SP_SIM1_RST_B = IOMUX_PIN(1, 2, 30, 8, 2, 28),
258 MXC91231_PIN_SP_SIM1_SVEN = IOMUX_PIN(1, 7, 0, 8, 3, 28),
259 MXC91231_PIN_SP_SIM1_CLK = IOMUX_PIN(1, 7, 0, 9, 0, 28),
260 MXC91231_PIN_SP_SIM1_TRXD = IOMUX_PIN(1, 7, 0, 9, 1, 28),
261 MXC91231_PIN_SP_SIM1_PD = IOMUX_PIN(1, 2, 31, 9, 2, 28),
262 MXC91231_PIN_SP_UH2_TXDM = IOMUX_PIN(1, 7, 0, 9, 3, 28),
263 MXC91231_PIN_SP_UH2_RXD = IOMUX_PIN(1, 7, 0, 10, 0, 28),
264};
265
266#define PIN_AP_MAX (104)
267#define PIN_SP_MAX (41)
268
269#define PIN_MAX (PIN_AP_MAX + PIN_SP_MAX)
270
271/*
272 * Convenience values for use with mxc_iomux_mode()
273 *
274 * Format here is MXC91231_PIN_(pin name)__(function)
275 */
276
277#define MXC91231_PIN_SP_USB_DAT_VP__USB_DAT_VP \
278 IOMUX_MODE(MXC91231_PIN_SP_USB_DAT_VP, IOMUX_CONFIG_FUNC)
279#define MXC91231_PIN_SP_USB_SE0_VM__USB_SE0_VM \
280 IOMUX_MODE(MXC91231_PIN_SP_USB_SE0_VM, IOMUX_CONFIG_FUNC)
281#define MXC91231_PIN_SP_USB_DAT_VP__RXD2 \
282 IOMUX_MODE(MXC91231_PIN_SP_USB_DAT_VP, IOMUX_CONFIG_ALT1)
283#define MXC91231_PIN_SP_USB_SE0_VM__TXD2 \
284 IOMUX_MODE(MXC91231_PIN_SP_USB_SE0_VM, IOMUX_CONFIG_ALT1)
285
286
287#endif /* __MACH_IOMUX_MXC91231_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index 7cd84547658f..a0fa40265468 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -68,28 +68,24 @@ struct pad_desc {
68/* 68/*
69 * Use to set PAD control 69 * Use to set PAD control
70 */ 70 */
71#define PAD_CTL_DRIVE_VOLTAGE_3_3_V 0
72#define PAD_CTL_DRIVE_VOLTAGE_1_8_V 1
73 71
74#define PAD_CTL_NO_HYSTERESIS 0 72#define PAD_CTL_DVS (1 << 13)
75#define PAD_CTL_HYSTERESIS 1 73#define PAD_CTL_HYS (1 << 8)
76 74
77#define PAD_CTL_PULL_DISABLED 0x0 75#define PAD_CTL_PKE (1 << 7)
78#define PAD_CTL_PULL_KEEPER 0xa 76#define PAD_CTL_PUE (1 << 6)
79#define PAD_CTL_PULL_DOWN_100K 0xc 77#define PAD_CTL_PUS_100K_DOWN (0 << 4)
80#define PAD_CTL_PULL_UP_47K 0xd 78#define PAD_CTL_PUS_47K_UP (1 << 4)
81#define PAD_CTL_PULL_UP_100K 0xe 79#define PAD_CTL_PUS_100K_UP (2 << 4)
82#define PAD_CTL_PULL_UP_22K 0xf 80#define PAD_CTL_PUS_22K_UP (3 << 4)
83 81
84#define PAD_CTL_OUTPUT_CMOS 0 82#define PAD_CTL_ODE (1 << 3)
85#define PAD_CTL_OUTPUT_OPEN_DRAIN 1
86 83
87#define PAD_CTL_DRIVE_STRENGTH_NORM 0 84#define PAD_CTL_DSE_STANDARD (0 << 1)
88#define PAD_CTL_DRIVE_STRENGTH_HIGH 1 85#define PAD_CTL_DSE_HIGH (1 << 1)
89#define PAD_CTL_DRIVE_STRENGTH_MAX 2 86#define PAD_CTL_DSE_MAX (2 << 1)
90 87
91#define PAD_CTL_SLEW_RATE_SLOW 0 88#define PAD_CTL_SRE_FAST (1 << 0)
92#define PAD_CTL_SLEW_RATE_FAST 1
93 89
94/* 90/*
95 * setups a single pad: 91 * setups a single pad:
@@ -117,5 +113,10 @@ void mxc_iomux_v3_release_pad(struct pad_desc *pad);
117 */ 113 */
118void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count); 114void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count);
119 115
116/*
117 * Initialise the iomux controller
118 */
119void mxc_iomux_v3_init(void __iomem *iomux_v3_base);
120
120#endif /* __MACH_IOMUX_V3_H__*/ 121#endif /* __MACH_IOMUX_V3_H__*/
121 122
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h
index 171f8adc1109..6d49f8ae3259 100644
--- a/arch/arm/plat-mxc/include/mach/iomux.h
+++ b/arch/arm/plat-mxc/include/mach/iomux.h
@@ -49,6 +49,9 @@
49#ifdef CONFIG_ARCH_MX2 49#ifdef CONFIG_ARCH_MX2
50# define GPIO_PORT_MAX 5 50# define GPIO_PORT_MAX 5
51#endif 51#endif
52#ifdef CONFIG_ARCH_MX25
53# define GPIO_PORT_MAX 3
54#endif
52 55
53#ifndef GPIO_PORT_MAX 56#ifndef GPIO_PORT_MAX
54# error "GPIO config port count unknown!" 57# error "GPIO config port count unknown!"
@@ -107,6 +110,9 @@
107#include <mach/iomux-mx27.h> 110#include <mach/iomux-mx27.h>
108#endif 111#endif
109#endif 112#endif
113#ifdef CONFIG_ARCH_MX25
114#include <mach/iomux-mx25.h>
115#endif
110 116
111 117
112/* decode irq number to use with IMR(x), ISR(x) and friends */ 118/* decode irq number to use with IMR(x), ISR(x) and friends */
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
index 518a36504b88..ead9d592168d 100644
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ b/arch/arm/plat-mxc/include/mach/irqs.h
@@ -24,6 +24,10 @@
24#define MXC_GPIO_IRQS (32 * 6) 24#define MXC_GPIO_IRQS (32 * 6)
25#elif defined CONFIG_ARCH_MX3 25#elif defined CONFIG_ARCH_MX3
26#define MXC_GPIO_IRQS (32 * 3) 26#define MXC_GPIO_IRQS (32 * 3)
27#elif defined CONFIG_ARCH_MX25
28#define MXC_GPIO_IRQS (32 * 4)
29#elif defined CONFIG_ARCH_MXC91231
30#define MXC_GPIO_IRQS (32 * 4)
27#endif 31#endif
28 32
29/* 33/*
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index 6065e00176ed..d3afafdcc0e5 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -22,6 +22,10 @@
22#endif 22#endif
23#elif defined CONFIG_ARCH_MX3 23#elif defined CONFIG_ARCH_MX3
24#define PHYS_OFFSET UL(0x80000000) 24#define PHYS_OFFSET UL(0x80000000)
25#elif defined CONFIG_ARCH_MX25
26#define PHYS_OFFSET UL(0x80000000)
27#elif defined CONFIG_ARCH_MXC91231
28#define PHYS_OFFSET UL(0x90000000)
25#endif 29#endif
26 30
27#if defined(CONFIG_MX1_VIDEO) 31#if defined(CONFIG_MX1_VIDEO)
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index 1000bf330bcd..1b2890a5c452 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -12,10 +12,6 @@
12#ifndef __ASM_ARCH_MXC_MX1_H__ 12#ifndef __ASM_ARCH_MXC_MX1_H__
13#define __ASM_ARCH_MXC_MX1_H__ 13#define __ASM_ARCH_MXC_MX1_H__
14 14
15#ifndef __ASM_ARCH_MXC_HARDWARE_H__
16#error "Do not include directly."
17#endif
18
19#include <mach/vmalloc.h> 15#include <mach/vmalloc.h>
20 16
21/* 17/*
@@ -138,20 +134,6 @@
138#define GPIO_INT_PORTD 62 134#define GPIO_INT_PORTD 62
139#define WDT_INT 63 135#define WDT_INT 63
140 136
141/* gpio and gpio based interrupt handling */
142#define GPIO_DR 0x1C
143#define GPIO_GDIR 0x00
144#define GPIO_PSR 0x24
145#define GPIO_ICR1 0x28
146#define GPIO_ICR2 0x2C
147#define GPIO_IMR 0x30
148#define GPIO_ISR 0x34
149#define GPIO_INT_LOW_LEV 0x3
150#define GPIO_INT_HIGH_LEV 0x2
151#define GPIO_INT_RISE_EDGE 0x0
152#define GPIO_INT_FALL_EDGE 0x1
153#define GPIO_INT_NONE 0x4
154
155/* DMA */ 137/* DMA */
156#define DMA_REQ_UART3_T 2 138#define DMA_REQ_UART3_T 2
157#define DMA_REQ_UART3_R 3 139#define DMA_REQ_UART3_R 3
@@ -179,8 +161,4 @@
179#define DMA_REQ_UART1_T 30 161#define DMA_REQ_UART1_T 30
180#define DMA_REQ_UART1_R 31 162#define DMA_REQ_UART1_R 31
181 163
182/* mandatory for CONFIG_DEBUG_LL */
183#define MXC_LL_UART_PADDR UART1_BASE_ADDR
184#define MXC_LL_UART_VADDR IO_ADDRESS(UART1_BASE_ADDR)
185
186#endif /* __ASM_ARCH_MXC_MX1_H__ */ 164#endif /* __ASM_ARCH_MXC_MX1_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h
index 8b070a041a99..21112c695ec5 100644
--- a/arch/arm/plat-mxc/include/mach/mx21.h
+++ b/arch/arm/plat-mxc/include/mach/mx21.h
@@ -25,11 +25,6 @@
25#ifndef __ASM_ARCH_MXC_MX21_H__ 25#ifndef __ASM_ARCH_MXC_MX21_H__
26#define __ASM_ARCH_MXC_MX21_H__ 26#define __ASM_ARCH_MXC_MX21_H__
27 27
28#ifndef __ASM_ARCH_MXC_HARDWARE_H__
29#error "Do not include directly."
30#endif
31
32
33/* Memory regions and CS */ 28/* Memory regions and CS */
34#define SDRAM_BASE_ADDR 0xC0000000 29#define SDRAM_BASE_ADDR 0xC0000000
35#define CSD1_BASE_ADDR 0xC4000000 30#define CSD1_BASE_ADDR 0xC4000000
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
new file mode 100644
index 000000000000..ec64bd9a8ab1
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -0,0 +1,44 @@
1#ifndef __MACH_MX25_H__
2#define __MACH_MX25_H__
3
4#define MX25_AIPS1_BASE_ADDR 0x43F00000
5#define MX25_AIPS1_BASE_ADDR_VIRT 0xFC000000
6#define MX25_AIPS1_SIZE SZ_1M
7#define MX25_AIPS2_BASE_ADDR 0x53F00000
8#define MX25_AIPS2_BASE_ADDR_VIRT 0xFC200000
9#define MX25_AIPS2_SIZE SZ_1M
10#define MX25_AVIC_BASE_ADDR 0x68000000
11#define MX25_AVIC_BASE_ADDR_VIRT 0xFC400000
12#define MX25_AVIC_SIZE SZ_1M
13
14#define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000)
15
16#define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000)
17#define MX25_GPT1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x90000)
18#define MX25_WDOG_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xdc000)
19
20#define MX25_GPIO1_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xcc000)
21#define MX25_GPIO2_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xd0000)
22#define MX25_GPIO3_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xa4000)
23#define MX25_GPIO4_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0x9c000)
24
25#define MX25_AIPS1_IO_ADDRESS(x) \
26 (((x) - MX25_AIPS1_BASE_ADDR) + MX25_AIPS1_BASE_ADDR_VIRT)
27#define MX25_AIPS2_IO_ADDRESS(x) \
28 (((x) - MX25_AIPS2_BASE_ADDR) + MX25_AIPS2_BASE_ADDR_VIRT)
29#define MX25_AVIC_IO_ADDRESS(x) \
30 (((x) - MX25_AVIC_BASE_ADDR) + MX25_AVIC_BASE_ADDR_VIRT)
31
32#define __in_range(addr, name) ((addr) >= name##_BASE_ADDR && (addr) < name##_BASE_ADDR + name##_SIZE)
33
34#define MX25_IO_ADDRESS(x) \
35 (void __force __iomem *) \
36 (__in_range(x, MX25_AIPS1) ? MX25_AIPS1_IO_ADDRESS(x) : \
37 __in_range(x, MX25_AIPS2) ? MX25_AIPS2_IO_ADDRESS(x) : \
38 __in_range(x, MX25_AVIC) ? MX25_AVIC_IO_ADDRESS(x) : \
39 0xDEADBEEF)
40
41#define UART1_BASE_ADDR 0x43f90000
42#define UART2_BASE_ADDR 0x43f94000
43
44#endif /* __MACH_MX25_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index 6e93f2c0b7bb..dc3ad9aa952a 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -24,10 +24,6 @@
24#ifndef __ASM_ARCH_MXC_MX27_H__ 24#ifndef __ASM_ARCH_MXC_MX27_H__
25#define __ASM_ARCH_MXC_MX27_H__ 25#define __ASM_ARCH_MXC_MX27_H__
26 26
27#ifndef __ASM_ARCH_MXC_HARDWARE_H__
28#error "Do not include directly."
29#endif
30
31/* IRAM */ 27/* IRAM */
32#define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */ 28#define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */
33 29
@@ -120,7 +116,4 @@ extern int mx27_revision(void);
120 116
121/* Mandatory defines used globally */ 117/* Mandatory defines used globally */
122 118
123/* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */
124#define ARCH_NR_GPIOS (192 + 16)
125
126#endif /* __ASM_ARCH_MXC_MX27_H__ */ 119#endif /* __ASM_ARCH_MXC_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h
index fc40d3ab8c5b..db5d921e0fe6 100644
--- a/arch/arm/plat-mxc/include/mach/mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/mx2x.h
@@ -23,10 +23,6 @@
23#ifndef __ASM_ARCH_MXC_MX2x_H__ 23#ifndef __ASM_ARCH_MXC_MX2x_H__
24#define __ASM_ARCH_MXC_MX2x_H__ 24#define __ASM_ARCH_MXC_MX2x_H__
25 25
26#ifndef __ASM_ARCH_MXC_HARDWARE_H__
27#error "Do not include directly."
28#endif
29
30/* The following addresses are common between i.MX21 and i.MX27 */ 26/* The following addresses are common between i.MX21 and i.MX27 */
31 27
32/* Register offests */ 28/* Register offests */
@@ -154,20 +150,6 @@
154#define MXC_INT_GPIO 8 150#define MXC_INT_GPIO 8
155#define MXC_INT_CSPI3 6 151#define MXC_INT_CSPI3 6
156 152
157/* gpio and gpio based interrupt handling */
158#define GPIO_DR 0x1C
159#define GPIO_GDIR 0x00
160#define GPIO_PSR 0x24
161#define GPIO_ICR1 0x28
162#define GPIO_ICR2 0x2C
163#define GPIO_IMR 0x30
164#define GPIO_ISR 0x34
165#define GPIO_INT_LOW_LEV 0x3
166#define GPIO_INT_HIGH_LEV 0x2
167#define GPIO_INT_RISE_EDGE 0x0
168#define GPIO_INT_FALL_EDGE 0x1
169#define GPIO_INT_NONE 0x4
170
171/* fixed DMA request numbers */ 153/* fixed DMA request numbers */
172#define DMA_REQ_CSI_RX 31 154#define DMA_REQ_CSI_RX 31
173#define DMA_REQ_CSI_STAT 30 155#define DMA_REQ_CSI_STAT 30
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 0b06941b6139..14ac0dcc82f4 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -4,7 +4,7 @@
4#define MX31_IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */ 4#define MX31_IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */
5#define MX31_IRAM_SIZE SZ_16K 5#define MX31_IRAM_SIZE SZ_16K
6 6
7#define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) 7#define MX31_OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
8#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) 8#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
9#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) 9#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
10#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000) 10#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
index 6465fefb42e3..ab4cfec6c8ab 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -5,6 +5,7 @@
5#define MX35_IRAM_SIZE SZ_128K 5#define MX35_IRAM_SIZE SZ_128K
6 6
7#define MXC_FEC_BASE_ADDR 0x50038000 7#define MXC_FEC_BASE_ADDR 0x50038000
8#define MX35_OTG_BASE_ADDR 0x53ff4000
8#define MX35_NFC_BASE_ADDR 0xBB000000 9#define MX35_NFC_BASE_ADDR 0xBB000000
9 10
10/* 11/*
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
index b559a4bb5769..009f4440276b 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -11,10 +11,6 @@
11#ifndef __ASM_ARCH_MXC_MX31_H__ 11#ifndef __ASM_ARCH_MXC_MX31_H__
12#define __ASM_ARCH_MXC_MX31_H__ 12#define __ASM_ARCH_MXC_MX31_H__
13 13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/* 14/*
19 * MX31 memory map: 15 * MX31 memory map:
20 * 16 *
@@ -263,25 +259,8 @@
263#define SYSTEM_REV_MIN CHIP_REV_1_0 259#define SYSTEM_REV_MIN CHIP_REV_1_0
264#define SYSTEM_REV_NUM 3 260#define SYSTEM_REV_NUM 3
265 261
266/* gpio and gpio based interrupt handling */
267#define GPIO_DR 0x00
268#define GPIO_GDIR 0x04
269#define GPIO_PSR 0x08
270#define GPIO_ICR1 0x0C
271#define GPIO_ICR2 0x10
272#define GPIO_IMR 0x14
273#define GPIO_ISR 0x18
274#define GPIO_INT_LOW_LEV 0x0
275#define GPIO_INT_HIGH_LEV 0x1
276#define GPIO_INT_RISE_EDGE 0x2
277#define GPIO_INT_FALL_EDGE 0x3
278#define GPIO_INT_NONE 0x4
279
280/* Mandatory defines used globally */ 262/* Mandatory defines used globally */
281 263
282/* this CPU supports up to 96 GPIOs */
283#define ARCH_NR_GPIOS 96
284
285#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) 264#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
286 265
287extern unsigned int system_rev; 266extern unsigned int system_rev;
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
index 5fa2a07f4eaf..51990536b845 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/plat-mxc/include/mach/mxc.h
@@ -26,9 +26,11 @@
26 26
27#define MXC_CPU_MX1 1 27#define MXC_CPU_MX1 1
28#define MXC_CPU_MX21 21 28#define MXC_CPU_MX21 21
29#define MXC_CPU_MX25 25
29#define MXC_CPU_MX27 27 30#define MXC_CPU_MX27 27
30#define MXC_CPU_MX31 31 31#define MXC_CPU_MX31 31
31#define MXC_CPU_MX35 35 32#define MXC_CPU_MX35 35
33#define MXC_CPU_MXC91231 91231
32 34
33#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
34extern unsigned int __mxc_cpu_type; 36extern unsigned int __mxc_cpu_type;
@@ -58,6 +60,18 @@ extern unsigned int __mxc_cpu_type;
58# define cpu_is_mx21() (0) 60# define cpu_is_mx21() (0)
59#endif 61#endif
60 62
63#ifdef CONFIG_ARCH_MX25
64# ifdef mxc_cpu_type
65# undef mxc_cpu_type
66# define mxc_cpu_type __mxc_cpu_type
67# else
68# define mxc_cpu_type MXC_CPU_MX25
69# endif
70# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25)
71#else
72# define cpu_is_mx25() (0)
73#endif
74
61#ifdef CONFIG_MACH_MX27 75#ifdef CONFIG_MACH_MX27
62# ifdef mxc_cpu_type 76# ifdef mxc_cpu_type
63# undef mxc_cpu_type 77# undef mxc_cpu_type
@@ -94,13 +108,25 @@ extern unsigned int __mxc_cpu_type;
94# define cpu_is_mx35() (0) 108# define cpu_is_mx35() (0)
95#endif 109#endif
96 110
111#ifdef CONFIG_ARCH_MXC91231
112# ifdef mxc_cpu_type
113# undef mxc_cpu_type
114# define mxc_cpu_type __mxc_cpu_type
115# else
116# define mxc_cpu_type MXC_CPU_MXC91231
117# endif
118# define cpu_is_mxc91231() (mxc_cpu_type == MXC_CPU_MXC91231)
119#else
120# define cpu_is_mxc91231() (0)
121#endif
122
97#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2) 123#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2)
98#define CSCR_U(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10) 124#define CSCR_U(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10)
99#define CSCR_L(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x4) 125#define CSCR_L(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x4)
100#define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8) 126#define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8)
101#endif 127#endif
102 128
103#define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) 129#define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35() || cpu_is_mxc91231())
104#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) 130#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
105 131
106#endif /* __ASM_ARCH_MXC_H__ */ 132#endif /* __ASM_ARCH_MXC_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mxc91231.h b/arch/arm/plat-mxc/include/mach/mxc91231.h
new file mode 100644
index 000000000000..81484d1ef232
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mxc91231.h
@@ -0,0 +1,315 @@
1/*
2 * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
3 * - Platform specific register memory map
4 *
5 * Copyright 2005-2007 Motorola, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef __MACH_MXC91231_H__
22#define __MACH_MXC91231_H__
23
24/*
25 * L2CC
26 */
27#define MXC91231_L2CC_BASE_ADDR 0x30000000
28#define MXC91231_L2CC_BASE_ADDR_VIRT 0xF9000000
29#define MXC91231_L2CC_SIZE SZ_64K
30
31/*
32 * AIPS 1
33 */
34#define MXC91231_AIPS1_BASE_ADDR 0x43F00000
35#define MXC91231_AIPS1_BASE_ADDR_VIRT 0xFC000000
36#define MXC91231_AIPS1_SIZE SZ_1M
37
38#define MXC91231_AIPS1_CTRL_BASE_ADDR MXC91231_AIPS1_BASE_ADDR
39#define MXC91231_MAX_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x04000)
40#define MXC91231_EVTMON_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x08000)
41#define MXC91231_CLKCTL_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x0C000)
42#define MXC91231_ETB_SLOT4_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x10000)
43#define MXC91231_ETB_SLOT5_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x14000)
44#define MXC91231_ECT_CTIO_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x18000)
45#define MXC91231_I2C_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x80000)
46#define MXC91231_MU_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x88000)
47#define MXC91231_UART1_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x90000)
48#define MXC91231_UART2_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x94000)
49#define MXC91231_DSM_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x98000)
50#define MXC91231_OWIRE_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0x9C000)
51#define MXC91231_SSI1_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xA0000)
52#define MXC91231_KPP_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xA8000)
53#define MXC91231_IOMUX_AP_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xAC000)
54#define MXC91231_CTI_AP_BASE_ADDR (MXC91231_AIPS1_BASE_ADDR + 0xB8000)
55
56/*
57 * AIPS 2
58 */
59#define MXC91231_AIPS2_BASE_ADDR 0x53F00000
60#define MXC91231_AIPS2_BASE_ADDR_VIRT 0xFC100000
61#define MXC91231_AIPS2_SIZE SZ_1M
62
63#define MXC91231_GEMK_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x8C000)
64#define MXC91231_GPT1_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x90000)
65#define MXC91231_EPIT1_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0x94000)
66#define MXC91231_SCC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xAC000)
67#define MXC91231_RNGA_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xB0000)
68#define MXC91231_IPU_CTRL_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xC0000)
69#define MXC91231_AUDMUX_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xC4000)
70#define MXC91231_EDIO_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xC8000)
71#define MXC91231_GPIO1_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xCC000)
72#define MXC91231_GPIO2_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xD0000)
73#define MXC91231_SDMA_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xD4000)
74#define MXC91231_RTC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xD8000)
75#define MXC91231_WDOG1_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xDC000)
76#define MXC91231_PWM_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xE0000)
77#define MXC91231_GPIO3_AP_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xE4000)
78#define MXC91231_WDOG2_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xE8000)
79#define MXC91231_RTIC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xEC000)
80#define MXC91231_LPMC_BASE_ADDR (MXC91231_AIPS2_BASE_ADDR + 0xF0000)
81
82/*
83 * SPBA global module 0
84 */
85#define MXC91231_SPBA0_BASE_ADDR 0x50000000
86#define MXC91231_SPBA0_BASE_ADDR_VIRT 0xFC200000
87#define MXC91231_SPBA0_SIZE SZ_1M
88
89#define MXC91231_MMC_SDHC1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x04000)
90#define MXC91231_MMC_SDHC2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x08000)
91#define MXC91231_UART3_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x0C000)
92#define MXC91231_CSPI2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x10000)
93#define MXC91231_SSI2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x14000)
94#define MXC91231_SIM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x18000)
95#define MXC91231_IIM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x1C000)
96#define MXC91231_CTI_SDMA_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x20000)
97#define MXC91231_USBOTG_CTRL_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x24000)
98#define MXC91231_USBOTG_DATA_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x28000)
99#define MXC91231_CSPI1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x30000)
100#define MXC91231_SPBA_CTRL_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x3C000)
101#define MXC91231_IOMUX_COM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x40000)
102#define MXC91231_CRM_COM_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x44000)
103#define MXC91231_CRM_AP_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x48000)
104#define MXC91231_PLL0_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x4C000)
105#define MXC91231_PLL1_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x50000)
106#define MXC91231_PLL2_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x54000)
107#define MXC91231_GPIO4_SH_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x58000)
108#define MXC91231_HAC_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x5C000)
109#define MXC91231_SAHARA_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x5C000)
110#define MXC91231_PLL3_BASE_ADDR (MXC91231_SPBA0_BASE_ADDR + 0x60000)
111
112/*
113 * SPBA global module 1
114 */
115#define MXC91231_SPBA1_BASE_ADDR 0x52000000
116#define MXC91231_SPBA1_BASE_ADDR_VIRT 0xFC300000
117#define MXC91231_SPBA1_SIZE SZ_1M
118
119#define MXC91231_MQSPI_BASE_ADDR (MXC91231_SPBA1_BASE_ADDR + 0x34000)
120#define MXC91231_EL1T_BASE_ADDR (MXC91231_SPBA1_BASE_ADDR + 0x38000)
121
122/*!
123 * Defines for SPBA modules
124 */
125#define MXC91231_SPBA_SDHC1 0x04
126#define MXC91231_SPBA_SDHC2 0x08
127#define MXC91231_SPBA_UART3 0x0C
128#define MXC91231_SPBA_CSPI2 0x10
129#define MXC91231_SPBA_SSI2 0x14
130#define MXC91231_SPBA_SIM 0x18
131#define MXC91231_SPBA_IIM 0x1C
132#define MXC91231_SPBA_CTI_SDMA 0x20
133#define MXC91231_SPBA_USBOTG_CTRL_REGS 0x24
134#define MXC91231_SPBA_USBOTG_DATA_REGS 0x28
135#define MXC91231_SPBA_CSPI1 0x30
136#define MXC91231_SPBA_MQSPI 0x34
137#define MXC91231_SPBA_EL1T 0x38
138#define MXC91231_SPBA_IOMUX 0x40
139#define MXC91231_SPBA_CRM_COM 0x44
140#define MXC91231_SPBA_CRM_AP 0x48
141#define MXC91231_SPBA_PLL0 0x4C
142#define MXC91231_SPBA_PLL1 0x50
143#define MXC91231_SPBA_PLL2 0x54
144#define MXC91231_SPBA_GPIO4 0x58
145#define MXC91231_SPBA_SAHARA 0x5C
146
147/*
148 * ROMP and AVIC
149 */
150#define MXC91231_ROMP_BASE_ADDR 0x60000000
151#define MXC91231_ROMP_BASE_ADDR_VIRT 0xFC400000
152#define MXC91231_ROMP_SIZE SZ_64K
153
154#define MXC91231_AVIC_BASE_ADDR 0x68000000
155#define MXC91231_AVIC_BASE_ADDR_VIRT 0xFC410000
156#define MXC91231_AVIC_SIZE SZ_64K
157
158/*
159 * NAND, SDRAM, WEIM, M3IF, EMI controllers
160 */
161#define MXC91231_X_MEMC_BASE_ADDR 0xB8000000
162#define MXC91231_X_MEMC_BASE_ADDR_VIRT 0xFC420000
163#define MXC91231_X_MEMC_SIZE SZ_64K
164
165#define MXC91231_NFC_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x0000)
166#define MXC91231_ESDCTL_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x1000)
167#define MXC91231_WEIM_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x2000)
168#define MXC91231_M3IF_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x3000)
169#define MXC91231_EMI_CTL_BASE_ADDR (MXC91231_X_MEMC_BASE_ADDR + 0x4000)
170
171/*
172 * Memory regions and CS
173 * CPLD is connected on CS4
174 * CS5 is TP1021 or it is not connected
175 * */
176#define MXC91231_FB_RAM_BASE_ADDR 0x78000000
177#define MXC91231_FB_RAM_SIZE SZ_256K
178#define MXC91231_CSD0_BASE_ADDR 0x80000000
179#define MXC91231_CSD1_BASE_ADDR 0x90000000
180#define MXC91231_CS0_BASE_ADDR 0xA0000000
181#define MXC91231_CS1_BASE_ADDR 0xA8000000
182#define MXC91231_CS2_BASE_ADDR 0xB0000000
183#define MXC91231_CS3_BASE_ADDR 0xB2000000
184#define MXC91231_CS4_BASE_ADDR 0xB4000000
185#define MXC91231_CS5_BASE_ADDR 0xB6000000
186
187/* Is given address belongs to the specified memory region? */
188#define ADDRESS_IN_REGION(addr, start, size) \
189 (((addr) >= (start)) && ((addr) < (start)+(size)))
190
191/* Is given address belongs to the specified named `module'? */
192#define MXC91231_IS_MODULE(addr, module) \
193 ADDRESS_IN_REGION(addr, MXC91231_ ## module ## _BASE_ADDR, \
194 MXC91231_ ## module ## _SIZE)
195/*
196 * This macro defines the physical to virtual address mapping for all the
197 * peripheral modules. It is used by passing in the physical address as x
198 * and returning the virtual address. If the physical address is not mapped,
199 * it returns 0xDEADBEEF
200 */
201
202#define MXC91231_IO_ADDRESS(x) \
203 (void __iomem *) \
204 (MXC91231_IS_MODULE(x, L2CC) ? MXC91231_L2CC_IO_ADDRESS(x) : \
205 MXC91231_IS_MODULE(x, AIPS1) ? MXC91231_AIPS1_IO_ADDRESS(x) : \
206 MXC91231_IS_MODULE(x, AIPS2) ? MXC91231_AIPS2_IO_ADDRESS(x) : \
207 MXC91231_IS_MODULE(x, SPBA0) ? MXC91231_SPBA0_IO_ADDRESS(x) : \
208 MXC91231_IS_MODULE(x, SPBA1) ? MXC91231_SPBA1_IO_ADDRESS(x) : \
209 MXC91231_IS_MODULE(x, ROMP) ? MXC91231_ROMP_IO_ADDRESS(x) : \
210 MXC91231_IS_MODULE(x, AVIC) ? MXC91231_AVIC_IO_ADDRESS(x) : \
211 MXC91231_IS_MODULE(x, X_MEMC) ? MXC91231_X_MEMC_IO_ADDRESS(x) : \
212 0xDEADBEEF)
213
214
215/*
216 * define the address mapping macros: in physical address order
217 */
218#define MXC91231_L2CC_IO_ADDRESS(x) \
219 (((x) - MXC91231_L2CC_BASE_ADDR) + MXC91231_L2CC_BASE_ADDR_VIRT)
220
221#define MXC91231_AIPS1_IO_ADDRESS(x) \
222 (((x) - MXC91231_AIPS1_BASE_ADDR) + MXC91231_AIPS1_BASE_ADDR_VIRT)
223
224#define MXC91231_SPBA0_IO_ADDRESS(x) \
225 (((x) - MXC91231_SPBA0_BASE_ADDR) + MXC91231_SPBA0_BASE_ADDR_VIRT)
226
227#define MXC91231_SPBA1_IO_ADDRESS(x) \
228 (((x) - MXC91231_SPBA1_BASE_ADDR) + MXC91231_SPBA1_BASE_ADDR_VIRT)
229
230#define MXC91231_AIPS2_IO_ADDRESS(x) \
231 (((x) - MXC91231_AIPS2_BASE_ADDR) + MXC91231_AIPS2_BASE_ADDR_VIRT)
232
233#define MXC91231_ROMP_IO_ADDRESS(x) \
234 (((x) - MXC91231_ROMP_BASE_ADDR) + MXC91231_ROMP_BASE_ADDR_VIRT)
235
236#define MXC91231_AVIC_IO_ADDRESS(x) \
237 (((x) - MXC91231_AVIC_BASE_ADDR) + MXC91231_AVIC_BASE_ADDR_VIRT)
238
239#define MXC91231_X_MEMC_IO_ADDRESS(x) \
240 (((x) - MXC91231_X_MEMC_BASE_ADDR) + MXC91231_X_MEMC_BASE_ADDR_VIRT)
241
242/*
243 * Interrupt numbers
244 */
245#define MXC91231_INT_GPIO3 0
246#define MXC91231_INT_EL1T_CI 1
247#define MXC91231_INT_EL1T_RFCI 2
248#define MXC91231_INT_EL1T_RFI 3
249#define MXC91231_INT_EL1T_MCU 4
250#define MXC91231_INT_EL1T_IPI 5
251#define MXC91231_INT_MU_GEN 6
252#define MXC91231_INT_GPIO4 7
253#define MXC91231_INT_MMC_SDHC2 8
254#define MXC91231_INT_MMC_SDHC1 9
255#define MXC91231_INT_I2C 10
256#define MXC91231_INT_SSI2 11
257#define MXC91231_INT_SSI1 12
258#define MXC91231_INT_CSPI2 13
259#define MXC91231_INT_CSPI1 14
260#define MXC91231_INT_RTIC 15
261#define MXC91231_INT_SAHARA 15
262#define MXC91231_INT_HAC 15
263#define MXC91231_INT_UART3_RX 16
264#define MXC91231_INT_UART3_TX 17
265#define MXC91231_INT_UART3_MINT 18
266#define MXC91231_INT_ECT 19
267#define MXC91231_INT_SIM_IPB 20
268#define MXC91231_INT_SIM_DATA 21
269#define MXC91231_INT_RNGA 22
270#define MXC91231_INT_DSM_AP 23
271#define MXC91231_INT_KPP 24
272#define MXC91231_INT_RTC 25
273#define MXC91231_INT_PWM 26
274#define MXC91231_INT_GEMK_AP 27
275#define MXC91231_INT_EPIT 28
276#define MXC91231_INT_GPT 29
277#define MXC91231_INT_UART2_RX 30
278#define MXC91231_INT_UART2_TX 31
279#define MXC91231_INT_UART2_MINT 32
280#define MXC91231_INT_NANDFC 33
281#define MXC91231_INT_SDMA 34
282#define MXC91231_INT_USB_WAKEUP 35
283#define MXC91231_INT_USB_SOF 36
284#define MXC91231_INT_PMU_EVTMON 37
285#define MXC91231_INT_USB_FUNC 38
286#define MXC91231_INT_USB_DMA 39
287#define MXC91231_INT_USB_CTRL 40
288#define MXC91231_INT_IPU_ERR 41
289#define MXC91231_INT_IPU_SYN 42
290#define MXC91231_INT_UART1_RX 43
291#define MXC91231_INT_UART1_TX 44
292#define MXC91231_INT_UART1_MINT 45
293#define MXC91231_INT_IIM 46
294#define MXC91231_INT_MU_RX_OR 47
295#define MXC91231_INT_MU_TX_OR 48
296#define MXC91231_INT_SCC_SCM 49
297#define MXC91231_INT_SCC_SMN 50
298#define MXC91231_INT_GPIO2 51
299#define MXC91231_INT_GPIO1 52
300#define MXC91231_INT_MQSPI1 53
301#define MXC91231_INT_MQSPI2 54
302#define MXC91231_INT_WDOG2 55
303#define MXC91231_INT_EXT_INT7 56
304#define MXC91231_INT_EXT_INT6 57
305#define MXC91231_INT_EXT_INT5 58
306#define MXC91231_INT_EXT_INT4 59
307#define MXC91231_INT_EXT_INT3 60
308#define MXC91231_INT_EXT_INT2 61
309#define MXC91231_INT_EXT_INT1 62
310#define MXC91231_INT_EXT_INT0 63
311
312#define MXC91231_MAX_INT_LINES 63
313#define MXC91231_MAX_EXT_LINES 8
314
315#endif /* __MACH_MXC91231_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/system.h b/arch/arm/plat-mxc/include/mach/system.h
index e56241af870e..ef00199568de 100644
--- a/arch/arm/plat-mxc/include/mach/system.h
+++ b/arch/arm/plat-mxc/include/mach/system.h
@@ -21,8 +21,18 @@
21#ifndef __ASM_ARCH_MXC_SYSTEM_H__ 21#ifndef __ASM_ARCH_MXC_SYSTEM_H__
22#define __ASM_ARCH_MXC_SYSTEM_H__ 22#define __ASM_ARCH_MXC_SYSTEM_H__
23 23
24#include <mach/hardware.h>
25#include <mach/common.h>
26
24static inline void arch_idle(void) 27static inline void arch_idle(void)
25{ 28{
29#ifdef CONFIG_ARCH_MXC91231
30 if (cpu_is_mxc91231()) {
31 /* Need this to set DSM low-power mode */
32 mxc91231_prepare_idle();
33 }
34#endif
35
26 cpu_do_idle(); 36 cpu_do_idle();
27} 37}
28 38
diff --git a/arch/arm/plat-mxc/include/mach/timex.h b/arch/arm/plat-mxc/include/mach/timex.h
index 07b4a73c9d2f..527a6c24788e 100644
--- a/arch/arm/plat-mxc/include/mach/timex.h
+++ b/arch/arm/plat-mxc/include/mach/timex.h
@@ -26,6 +26,10 @@
26#define CLOCK_TICK_RATE 13300000 26#define CLOCK_TICK_RATE 13300000
27#elif defined CONFIG_ARCH_MX3 27#elif defined CONFIG_ARCH_MX3
28#define CLOCK_TICK_RATE 16625000 28#define CLOCK_TICK_RATE 16625000
29#elif defined CONFIG_ARCH_MX25
30#define CLOCK_TICK_RATE 16000000
31#elif defined CONFIG_ARCH_MXC91231
32#define CLOCK_TICK_RATE 13000000
29#endif 33#endif
30 34
31#endif /* __ASM_ARCH_MXC_TIMEX_H__ */ 35#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index de6fe0365982..082a3908256b 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -26,8 +26,11 @@
26#define __MXC_BOOT_UNCOMPRESS 26#define __MXC_BOOT_UNCOMPRESS
27 27
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <asm/mach-types.h>
29 30
30#define UART(x) (*(volatile unsigned long *)(serial_port + (x))) 31static unsigned long uart_base;
32
33#define UART(x) (*(volatile unsigned long *)(uart_base + (x)))
31 34
32#define USR2 0x98 35#define USR2 0x98
33#define USR2_TXFE (1<<14) 36#define USR2_TXFE (1<<14)
@@ -46,19 +49,10 @@
46 49
47static void putc(int ch) 50static void putc(int ch)
48{ 51{
49 static unsigned long serial_port = 0; 52 if (!uart_base)
50 53 return;
51 if (unlikely(serial_port == 0)) { 54 if (!(UART(UCR1) & UCR1_UARTEN))
52 do { 55 return;
53 serial_port = UART1_BASE_ADDR;
54 if (UART(UCR1) & UCR1_UARTEN)
55 break;
56 serial_port = UART2_BASE_ADDR;
57 if (UART(UCR1) & UCR1_UARTEN)
58 break;
59 return;
60 } while (0);
61 }
62 56
63 while (!(UART(USR2) & USR2_TXFE)) 57 while (!(UART(USR2) & USR2_TXFE))
64 barrier(); 58 barrier();
@@ -68,11 +62,49 @@ static void putc(int ch)
68 62
69#define flush() do { } while (0) 63#define flush() do { } while (0)
70 64
71/* 65#define MX1_UART1_BASE_ADDR 0x00206000
72 * nothing to do 66#define MX25_UART1_BASE_ADDR 0x43f90000
73 */ 67#define MX2X_UART1_BASE_ADDR 0x1000a000
74#define arch_decomp_setup() 68#define MX3X_UART1_BASE_ADDR 0x43F90000
69#define MX3X_UART2_BASE_ADDR 0x43F94000
70
71static __inline__ void __arch_decomp_setup(unsigned long arch_id)
72{
73 switch (arch_id) {
74 case MACH_TYPE_MX1ADS:
75 case MACH_TYPE_SCB9328:
76 uart_base = MX1_UART1_BASE_ADDR;
77 break;
78 case MACH_TYPE_MX25_3DS:
79 uart_base = MX25_UART1_BASE_ADDR;
80 break;
81 case MACH_TYPE_IMX27LITE:
82 case MACH_TYPE_MX27_3DS:
83 case MACH_TYPE_MX27ADS:
84 case MACH_TYPE_PCM038:
85 case MACH_TYPE_MX21ADS:
86 uart_base = MX2X_UART1_BASE_ADDR;
87 break;
88 case MACH_TYPE_MX31LITE:
89 case MACH_TYPE_ARMADILLO5X0:
90 case MACH_TYPE_MX31MOBOARD:
91 case MACH_TYPE_QONG:
92 case MACH_TYPE_MX31_3DS:
93 case MACH_TYPE_PCM037:
94 case MACH_TYPE_MX31ADS:
95 case MACH_TYPE_MX35_3DS:
96 case MACH_TYPE_PCM043:
97 uart_base = MX3X_UART1_BASE_ADDR;
98 break;
99 case MACH_TYPE_MAGX_ZN5:
100 uart_base = MX3X_UART2_BASE_ADDR;
101 break;
102 default:
103 break;
104 }
105}
75 106
107#define arch_decomp_setup() __arch_decomp_setup(arch_id)
76#define arch_decomp_wdog() 108#define arch_decomp_wdog()
77 109
78#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */ 110#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c
index 77a078f9513f..851ca99bf1b1 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/plat-mxc/iomux-v3.c
@@ -29,7 +29,7 @@
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30#include <mach/iomux-v3.h> 30#include <mach/iomux-v3.h>
31 31
32#define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) 32static void __iomem *base;
33 33
34static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; 34static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG];
35 35
@@ -45,14 +45,14 @@ int mxc_iomux_v3_setup_pad(struct pad_desc *pad)
45 if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) 45 if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map))
46 return -EBUSY; 46 return -EBUSY;
47 if (pad->mux_ctrl_ofs) 47 if (pad->mux_ctrl_ofs)
48 __raw_writel(pad->mux_mode, IOMUX_BASE + pad->mux_ctrl_ofs); 48 __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs);
49 49
50 if (pad->select_input_ofs) 50 if (pad->select_input_ofs)
51 __raw_writel(pad->select_input, 51 __raw_writel(pad->select_input,
52 IOMUX_BASE + pad->select_input_ofs); 52 base + pad->select_input_ofs);
53 53
54 if (!(pad->pad_ctrl & NO_PAD_CTRL)) 54 if (!(pad->pad_ctrl & NO_PAD_CTRL) && pad->pad_ctrl_ofs)
55 __raw_writel(pad->pad_ctrl, IOMUX_BASE + pad->pad_ctrl_ofs); 55 __raw_writel(pad->pad_ctrl, base + pad->pad_ctrl_ofs);
56 return 0; 56 return 0;
57} 57}
58EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); 58EXPORT_SYMBOL(mxc_iomux_v3_setup_pad);
@@ -96,3 +96,8 @@ void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count)
96 } 96 }
97} 97}
98EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads); 98EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads);
99
100void mxc_iomux_v3_init(void __iomem *iomux_v3_base)
101{
102 base = iomux_v3_base;
103}
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c
index 8aee76304f8f..778ddfe57d89 100644
--- a/arch/arm/plat-mxc/irq.c
+++ b/arch/arm/plat-mxc/irq.c
@@ -44,7 +44,7 @@
44#define AVIC_FIPNDH 0x60 /* fast int pending high */ 44#define AVIC_FIPNDH 0x60 /* fast int pending high */
45#define AVIC_FIPNDL 0x64 /* fast int pending low */ 45#define AVIC_FIPNDL 0x64 /* fast int pending low */
46 46
47static void __iomem *avic_base; 47void __iomem *avic_base;
48 48
49int imx_irq_set_priority(unsigned char irq, unsigned char prio) 49int imx_irq_set_priority(unsigned char irq, unsigned char prio)
50{ 50{
@@ -113,11 +113,11 @@ static struct irq_chip mxc_avic_chip = {
113 * interrupts. It registers the interrupt enable and disable functions 113 * interrupts. It registers the interrupt enable and disable functions
114 * to the kernel for each interrupt source. 114 * to the kernel for each interrupt source.
115 */ 115 */
116void __init mxc_init_irq(void) 116void __init mxc_init_irq(void __iomem *irqbase)
117{ 117{
118 int i; 118 int i;
119 119
120 avic_base = IO_ADDRESS(AVIC_BASE_ADDR); 120 avic_base = irqbase;
121 121
122 /* put the AVIC into the reset value with 122 /* put the AVIC into the reset value with
123 * all interrupts disabled 123 * all interrupts disabled
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index ae34198a79dd..5cdbd605ac05 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -32,6 +32,7 @@
32#define MX3_PWMPR 0x10 /* PWM Period Register */ 32#define MX3_PWMPR 0x10 /* PWM Period Register */
33#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4) 33#define MX3_PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)
34#define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16) 34#define MX3_PWMCR_CLKSRC_IPG_HIGH (2 << 16)
35#define MX3_PWMCR_CLKSRC_IPG (1 << 16)
35#define MX3_PWMCR_EN (1 << 0) 36#define MX3_PWMCR_EN (1 << 0)
36 37
37 38
@@ -55,9 +56,11 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
55 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) 56 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
56 return -EINVAL; 57 return -EINVAL;
57 58
58 if (cpu_is_mx27() || cpu_is_mx3()) { 59 if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) {
59 unsigned long long c; 60 unsigned long long c;
60 unsigned long period_cycles, duty_cycles, prescale; 61 unsigned long period_cycles, duty_cycles, prescale;
62 u32 cr;
63
61 c = clk_get_rate(pwm->clk); 64 c = clk_get_rate(pwm->clk);
62 c = c * period_ns; 65 c = c * period_ns;
63 do_div(c, 1000000000); 66 do_div(c, 1000000000);
@@ -72,9 +75,15 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
72 75
73 writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR); 76 writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR);
74 writel(period_cycles, pwm->mmio_base + MX3_PWMPR); 77 writel(period_cycles, pwm->mmio_base + MX3_PWMPR);
75 writel(MX3_PWMCR_PRESCALER(prescale - 1) | 78
76 MX3_PWMCR_CLKSRC_IPG_HIGH | MX3_PWMCR_EN, 79 cr = MX3_PWMCR_PRESCALER(prescale) | MX3_PWMCR_EN;
77 pwm->mmio_base + MX3_PWMCR); 80
81 if (cpu_is_mx25())
82 cr |= MX3_PWMCR_CLKSRC_IPG;
83 else
84 cr |= MX3_PWMCR_CLKSRC_IPG_HIGH;
85
86 writel(cr, pwm->mmio_base + MX3_PWMCR);
78 } else if (cpu_is_mx1() || cpu_is_mx21()) { 87 } else if (cpu_is_mx1() || cpu_is_mx21()) {
79 /* The PWM subsystem allows for exact frequencies. However, 88 /* The PWM subsystem allows for exact frequencies. However,
80 * I cannot connect a scope on my device to the PWM line and 89 * I cannot connect a scope on my device to the PWM line and
@@ -118,6 +127,8 @@ EXPORT_SYMBOL(pwm_enable);
118 127
119void pwm_disable(struct pwm_device *pwm) 128void pwm_disable(struct pwm_device *pwm)
120{ 129{
130 writel(0, pwm->mmio_base + MX3_PWMCR);
131
121 if (pwm->clk_enabled) { 132 if (pwm->clk_enabled) {
122 clk_disable(pwm->clk); 133 clk_disable(pwm->clk);
123 pwm->clk_enabled = 0; 134 pwm->clk_enabled = 0;
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c
index 79c37577c916..97f42799fa58 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -27,32 +27,38 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/common.h>
30#include <asm/proc-fns.h> 31#include <asm/proc-fns.h>
31#include <asm/system.h> 32#include <asm/system.h>
32 33
33#ifdef CONFIG_ARCH_MX1 34static void __iomem *wdog_base;
34#define WDOG_WCR_REG IO_ADDRESS(WDT_BASE_ADDR)
35#define WDOG_WCR_ENABLE (1 << 0)
36#else
37#define WDOG_WCR_REG IO_ADDRESS(WDOG_BASE_ADDR)
38#define WDOG_WCR_ENABLE (1 << 2)
39#endif
40 35
41/* 36/*
42 * Reset the system. It is called by machine_restart(). 37 * Reset the system. It is called by machine_restart().
43 */ 38 */
44void arch_reset(char mode, const char *cmd) 39void arch_reset(char mode, const char *cmd)
45{ 40{
46 if (!cpu_is_mx1()) { 41 unsigned int wcr_enable;
42
43#ifdef CONFIG_ARCH_MXC91231
44 if (cpu_is_mxc91231()) {
45 mxc91231_arch_reset(mode, cmd);
46 return;
47 }
48#endif
49 if (cpu_is_mx1()) {
50 wcr_enable = (1 << 0);
51 } else {
47 struct clk *clk; 52 struct clk *clk;
48 53
49 clk = clk_get_sys("imx-wdt.0", NULL); 54 clk = clk_get_sys("imx-wdt.0", NULL);
50 if (!IS_ERR(clk)) 55 if (!IS_ERR(clk))
51 clk_enable(clk); 56 clk_enable(clk);
57 wcr_enable = (1 << 2);
52 } 58 }
53 59
54 /* Assert SRS signal */ 60 /* Assert SRS signal */
55 __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); 61 __raw_writew(wcr_enable, wdog_base);
56 62
57 /* wait for reset to assert... */ 63 /* wait for reset to assert... */
58 mdelay(500); 64 mdelay(500);
@@ -65,3 +71,8 @@ void arch_reset(char mode, const char *cmd)
65 /* we'll take a jump through zero as a poor second */ 71 /* we'll take a jump through zero as a poor second */
66 cpu_reset(0); 72 cpu_reset(0);
67} 73}
74
75void mxc_arch_reset_init(void __iomem *base)
76{
77 wdog_base = base;
78}
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 88fb3a57e029..844567ee35fe 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -47,7 +47,7 @@
47#define MX2_TSTAT_CAPT (1 << 1) 47#define MX2_TSTAT_CAPT (1 << 1)
48#define MX2_TSTAT_COMP (1 << 0) 48#define MX2_TSTAT_COMP (1 << 0)
49 49
50/* MX31, MX35 */ 50/* MX31, MX35, MX25, MXC91231 */
51#define MX3_TCTL_WAITEN (1 << 3) 51#define MX3_TCTL_WAITEN (1 << 3)
52#define MX3_TCTL_CLK_IPG (1 << 6) 52#define MX3_TCTL_CLK_IPG (1 << 6)
53#define MX3_TCTL_FRR (1 << 9) 53#define MX3_TCTL_FRR (1 << 9)
@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void)
66{ 66{
67 unsigned int tmp; 67 unsigned int tmp;
68 68
69 if (cpu_is_mx3()) 69 if (cpu_is_mx3() || cpu_is_mx25())
70 __raw_writel(0, timer_base + MX3_IR); 70 __raw_writel(0, timer_base + MX3_IR);
71 else { 71 else {
72 tmp = __raw_readl(timer_base + MXC_TCTL); 72 tmp = __raw_readl(timer_base + MXC_TCTL);
@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void)
76 76
77static inline void gpt_irq_enable(void) 77static inline void gpt_irq_enable(void)
78{ 78{
79 if (cpu_is_mx3()) 79 if (cpu_is_mx3() || cpu_is_mx25())
80 __raw_writel(1<<0, timer_base + MX3_IR); 80 __raw_writel(1<<0, timer_base + MX3_IR);
81 else { 81 else {
82 __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, 82 __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN,
@@ -90,7 +90,7 @@ static void gpt_irq_acknowledge(void)
90 __raw_writel(0, timer_base + MX1_2_TSTAT); 90 __raw_writel(0, timer_base + MX1_2_TSTAT);
91 if (cpu_is_mx2()) 91 if (cpu_is_mx2())
92 __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); 92 __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT);
93 if (cpu_is_mx3()) 93 if (cpu_is_mx3() || cpu_is_mx25())
94 __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); 94 __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT);
95} 95}
96 96
@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
117{ 117{
118 unsigned int c = clk_get_rate(timer_clk); 118 unsigned int c = clk_get_rate(timer_clk);
119 119
120 if (cpu_is_mx3()) 120 if (cpu_is_mx3() || cpu_is_mx25())
121 clocksource_mxc.read = mx3_get_cycles; 121 clocksource_mxc.read = mx3_get_cycles;
122 122
123 clocksource_mxc.mult = clocksource_hz2mult(c, 123 clocksource_mxc.mult = clocksource_hz2mult(c,
@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_event_mode mode,
180 180
181 if (mode != clockevent_mode) { 181 if (mode != clockevent_mode) {
182 /* Set event time into far-far future */ 182 /* Set event time into far-far future */
183 if (cpu_is_mx3()) 183 if (cpu_is_mx3() || cpu_is_mx25())
184 __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, 184 __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3,
185 timer_base + MX3_TCMP); 185 timer_base + MX3_TCMP);
186 else 186 else
@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
233 struct clock_event_device *evt = &clockevent_mxc; 233 struct clock_event_device *evt = &clockevent_mxc;
234 uint32_t tstat; 234 uint32_t tstat;
235 235
236 if (cpu_is_mx3()) 236 if (cpu_is_mx3() || cpu_is_mx25())
237 tstat = __raw_readl(timer_base + MX3_TSTAT); 237 tstat = __raw_readl(timer_base + MX3_TSTAT);
238 else 238 else
239 tstat = __raw_readl(timer_base + MX1_2_TSTAT); 239 tstat = __raw_readl(timer_base + MX1_2_TSTAT);
@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(struct clk *timer_clk)
264{ 264{
265 unsigned int c = clk_get_rate(timer_clk); 265 unsigned int c = clk_get_rate(timer_clk);
266 266
267 if (cpu_is_mx3()) 267 if (cpu_is_mx3() || cpu_is_mx25())
268 clockevent_mxc.set_next_event = mx3_set_next_event; 268 clockevent_mxc.set_next_event = mx3_set_next_event;
269 269
270 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, 270 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
@@ -281,30 +281,13 @@ static int __init mxc_clockevent_init(struct clk *timer_clk)
281 return 0; 281 return 0;
282} 282}
283 283
284void __init mxc_timer_init(struct clk *timer_clk) 284void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq)
285{ 285{
286 uint32_t tctl_val; 286 uint32_t tctl_val;
287 int irq;
288 287
289 clk_enable(timer_clk); 288 clk_enable(timer_clk);
290 289
291 if (cpu_is_mx1()) { 290 timer_base = base;
292#ifdef CONFIG_ARCH_MX1
293 timer_base = IO_ADDRESS(TIM1_BASE_ADDR);
294 irq = TIM1_INT;
295#endif
296 } else if (cpu_is_mx2()) {
297#ifdef CONFIG_ARCH_MX2
298 timer_base = IO_ADDRESS(GPT1_BASE_ADDR);
299 irq = MXC_INT_GPT1;
300#endif
301 } else if (cpu_is_mx3()) {
302#ifdef CONFIG_ARCH_MX3
303 timer_base = IO_ADDRESS(GPT1_BASE_ADDR);
304 irq = MXC_INT_GPT;
305#endif
306 } else
307 BUG();
308 291
309 /* 292 /*
310 * Initialise to a known state (all timers off, and timing reset) 293 * Initialise to a known state (all timers off, and timing reset)
@@ -313,7 +296,7 @@ void __init mxc_timer_init(struct clk *timer_clk)
313 __raw_writel(0, timer_base + MXC_TCTL); 296 __raw_writel(0, timer_base + MXC_TCTL);
314 __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ 297 __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */
315 298
316 if (cpu_is_mx3()) 299 if (cpu_is_mx3() || cpu_is_mx25())
317 tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN; 300 tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN;
318 else 301 else
319 tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN; 302 tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index 843e8af64066..1868c0d8f9b5 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -78,10 +78,10 @@ static int omap_target(struct cpufreq_policy *policy,
78 78
79 /* Ensure desired rate is within allowed range. Some govenors 79 /* Ensure desired rate is within allowed range. Some govenors
80 * (ondemand) will just pass target_freq=0 to get the minimum. */ 80 * (ondemand) will just pass target_freq=0 to get the minimum. */
81 if (target_freq < policy->cpuinfo.min_freq) 81 if (target_freq < policy->min)
82 target_freq = policy->cpuinfo.min_freq; 82 target_freq = policy->min;
83 if (target_freq > policy->cpuinfo.max_freq) 83 if (target_freq > policy->max)
84 target_freq = policy->cpuinfo.max_freq; 84 target_freq = policy->max;
85 85
86 freqs.old = omap_getspeed(0); 86 freqs.old = omap_getspeed(0);
87 freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000; 87 freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 26b387c12423..00940dc6bb50 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -138,6 +138,32 @@
138#define OMAP24XX_GPIO_CLEARDATAOUT 0x0090 138#define OMAP24XX_GPIO_CLEARDATAOUT 0x0090
139#define OMAP24XX_GPIO_SETDATAOUT 0x0094 139#define OMAP24XX_GPIO_SETDATAOUT 0x0094
140 140
141#define OMAP4_GPIO_REVISION 0x0000
142#define OMAP4_GPIO_SYSCONFIG 0x0010
143#define OMAP4_GPIO_EOI 0x0020
144#define OMAP4_GPIO_IRQSTATUSRAW0 0x0024
145#define OMAP4_GPIO_IRQSTATUSRAW1 0x0028
146#define OMAP4_GPIO_IRQSTATUS0 0x002c
147#define OMAP4_GPIO_IRQSTATUS1 0x0030
148#define OMAP4_GPIO_IRQSTATUSSET0 0x0034
149#define OMAP4_GPIO_IRQSTATUSSET1 0x0038
150#define OMAP4_GPIO_IRQSTATUSCLR0 0x003c
151#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040
152#define OMAP4_GPIO_IRQWAKEN0 0x0044
153#define OMAP4_GPIO_IRQWAKEN1 0x0048
154#define OMAP4_GPIO_SYSSTATUS 0x0104
155#define OMAP4_GPIO_CTRL 0x0130
156#define OMAP4_GPIO_OE 0x0134
157#define OMAP4_GPIO_DATAIN 0x0138
158#define OMAP4_GPIO_DATAOUT 0x013c
159#define OMAP4_GPIO_LEVELDETECT0 0x0140
160#define OMAP4_GPIO_LEVELDETECT1 0x0144
161#define OMAP4_GPIO_RISINGDETECT 0x0148
162#define OMAP4_GPIO_FALLINGDETECT 0x014c
163#define OMAP4_GPIO_DEBOUNCENABLE 0x0150
164#define OMAP4_GPIO_DEBOUNCINGTIME 0x0154
165#define OMAP4_GPIO_CLEARDATAOUT 0x0190
166#define OMAP4_GPIO_SETDATAOUT 0x0194
141/* 167/*
142 * omap34xx specific GPIO registers 168 * omap34xx specific GPIO registers
143 */ 169 */
@@ -386,12 +412,16 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
386 reg += OMAP850_GPIO_DIR_CONTROL; 412 reg += OMAP850_GPIO_DIR_CONTROL;
387 break; 413 break;
388#endif 414#endif
389#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 415#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
390 defined(CONFIG_ARCH_OMAP4)
391 case METHOD_GPIO_24XX: 416 case METHOD_GPIO_24XX:
392 reg += OMAP24XX_GPIO_OE; 417 reg += OMAP24XX_GPIO_OE;
393 break; 418 break;
394#endif 419#endif
420#if defined(CONFIG_ARCH_OMAP4)
421 case METHOD_GPIO_24XX:
422 reg += OMAP4_GPIO_OE;
423 break;
424#endif
395 default: 425 default:
396 WARN_ON(1); 426 WARN_ON(1);
397 return; 427 return;
@@ -459,8 +489,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
459 l &= ~(1 << gpio); 489 l &= ~(1 << gpio);
460 break; 490 break;
461#endif 491#endif
462#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 492#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
463 defined(CONFIG_ARCH_OMAP4)
464 case METHOD_GPIO_24XX: 493 case METHOD_GPIO_24XX:
465 if (enable) 494 if (enable)
466 reg += OMAP24XX_GPIO_SETDATAOUT; 495 reg += OMAP24XX_GPIO_SETDATAOUT;
@@ -469,6 +498,15 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
469 l = 1 << gpio; 498 l = 1 << gpio;
470 break; 499 break;
471#endif 500#endif
501#ifdef CONFIG_ARCH_OMAP4
502 case METHOD_GPIO_24XX:
503 if (enable)
504 reg += OMAP4_GPIO_SETDATAOUT;
505 else
506 reg += OMAP4_GPIO_CLEARDATAOUT;
507 l = 1 << gpio;
508 break;
509#endif
472 default: 510 default:
473 WARN_ON(1); 511 WARN_ON(1);
474 return; 512 return;
@@ -511,12 +549,16 @@ static int __omap_get_gpio_datain(int gpio)
511 reg += OMAP850_GPIO_DATA_INPUT; 549 reg += OMAP850_GPIO_DATA_INPUT;
512 break; 550 break;
513#endif 551#endif
514#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 552#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
515 defined(CONFIG_ARCH_OMAP4)
516 case METHOD_GPIO_24XX: 553 case METHOD_GPIO_24XX:
517 reg += OMAP24XX_GPIO_DATAIN; 554 reg += OMAP24XX_GPIO_DATAIN;
518 break; 555 break;
519#endif 556#endif
557#ifdef CONFIG_ARCH_OMAP4
558 case METHOD_GPIO_24XX:
559 reg += OMAP4_GPIO_DATAIN;
560 break;
561#endif
520 default: 562 default:
521 return -EINVAL; 563 return -EINVAL;
522 } 564 }
@@ -544,7 +586,11 @@ void omap_set_gpio_debounce(int gpio, int enable)
544 586
545 bank = get_gpio_bank(gpio); 587 bank = get_gpio_bank(gpio);
546 reg = bank->base; 588 reg = bank->base;
589#ifdef CONFIG_ARCH_OMAP4
590 reg += OMAP4_GPIO_DEBOUNCENABLE;
591#else
547 reg += OMAP24XX_GPIO_DEBOUNCE_EN; 592 reg += OMAP24XX_GPIO_DEBOUNCE_EN;
593#endif
548 594
549 spin_lock_irqsave(&bank->lock, flags); 595 spin_lock_irqsave(&bank->lock, flags);
550 val = __raw_readl(reg); 596 val = __raw_readl(reg);
@@ -581,7 +627,11 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time)
581 reg = bank->base; 627 reg = bank->base;
582 628
583 enc_time &= 0xff; 629 enc_time &= 0xff;
630#ifdef CONFIG_ARCH_OMAP4
631 reg += OMAP4_GPIO_DEBOUNCINGTIME;
632#else
584 reg += OMAP24XX_GPIO_DEBOUNCE_VAL; 633 reg += OMAP24XX_GPIO_DEBOUNCE_VAL;
634#endif
585 __raw_writel(enc_time, reg); 635 __raw_writel(enc_time, reg);
586} 636}
587EXPORT_SYMBOL(omap_set_gpio_debounce_time); 637EXPORT_SYMBOL(omap_set_gpio_debounce_time);
@@ -593,23 +643,46 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
593{ 643{
594 void __iomem *base = bank->base; 644 void __iomem *base = bank->base;
595 u32 gpio_bit = 1 << gpio; 645 u32 gpio_bit = 1 << gpio;
646 u32 val;
596 647
597 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit, 648 if (cpu_is_omap44xx()) {
598 trigger & IRQ_TYPE_LEVEL_LOW); 649 MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT0, gpio_bit,
599 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT1, gpio_bit, 650 trigger & IRQ_TYPE_LEVEL_LOW);
600 trigger & IRQ_TYPE_LEVEL_HIGH); 651 MOD_REG_BIT(OMAP4_GPIO_LEVELDETECT1, gpio_bit,
601 MOD_REG_BIT(OMAP24XX_GPIO_RISINGDETECT, gpio_bit, 652 trigger & IRQ_TYPE_LEVEL_HIGH);
602 trigger & IRQ_TYPE_EDGE_RISING); 653 MOD_REG_BIT(OMAP4_GPIO_RISINGDETECT, gpio_bit,
603 MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit, 654 trigger & IRQ_TYPE_EDGE_RISING);
604 trigger & IRQ_TYPE_EDGE_FALLING); 655 MOD_REG_BIT(OMAP4_GPIO_FALLINGDETECT, gpio_bit,
605 656 trigger & IRQ_TYPE_EDGE_FALLING);
657 } else {
658 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit,
659 trigger & IRQ_TYPE_LEVEL_LOW);
660 MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT1, gpio_bit,
661 trigger & IRQ_TYPE_LEVEL_HIGH);
662 MOD_REG_BIT(OMAP24XX_GPIO_RISINGDETECT, gpio_bit,
663 trigger & IRQ_TYPE_EDGE_RISING);
664 MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit,
665 trigger & IRQ_TYPE_EDGE_FALLING);
666 }
606 if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { 667 if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
607 if (trigger != 0) 668 if (cpu_is_omap44xx()) {
608 __raw_writel(1 << gpio, bank->base 669 if (trigger != 0)
670 __raw_writel(1 << gpio, bank->base+
671 OMAP4_GPIO_IRQWAKEN0);
672 else {
673 val = __raw_readl(bank->base +
674 OMAP4_GPIO_IRQWAKEN0);
675 __raw_writel(val & (~(1 << gpio)), bank->base +
676 OMAP4_GPIO_IRQWAKEN0);
677 }
678 } else {
679 if (trigger != 0)
680 __raw_writel(1 << gpio, bank->base
609 + OMAP24XX_GPIO_SETWKUENA); 681 + OMAP24XX_GPIO_SETWKUENA);
610 else 682 else
611 __raw_writel(1 << gpio, bank->base 683 __raw_writel(1 << gpio, bank->base
612 + OMAP24XX_GPIO_CLEARWKUENA); 684 + OMAP24XX_GPIO_CLEARWKUENA);
685 }
613 } else { 686 } else {
614 if (trigger != 0) 687 if (trigger != 0)
615 bank->enabled_non_wakeup_gpios |= gpio_bit; 688 bank->enabled_non_wakeup_gpios |= gpio_bit;
@@ -617,9 +690,15 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
617 bank->enabled_non_wakeup_gpios &= ~gpio_bit; 690 bank->enabled_non_wakeup_gpios &= ~gpio_bit;
618 } 691 }
619 692
620 bank->level_mask = 693 if (cpu_is_omap44xx()) {
621 __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0) | 694 bank->level_mask =
622 __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); 695 __raw_readl(bank->base + OMAP4_GPIO_LEVELDETECT0) |
696 __raw_readl(bank->base + OMAP4_GPIO_LEVELDETECT1);
697 } else {
698 bank->level_mask =
699 __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0) |
700 __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
701 }
623} 702}
624#endif 703#endif
625 704
@@ -783,12 +862,16 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
783 reg += OMAP850_GPIO_INT_STATUS; 862 reg += OMAP850_GPIO_INT_STATUS;
784 break; 863 break;
785#endif 864#endif
786#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 865#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
787 defined(CONFIG_ARCH_OMAP4)
788 case METHOD_GPIO_24XX: 866 case METHOD_GPIO_24XX:
789 reg += OMAP24XX_GPIO_IRQSTATUS1; 867 reg += OMAP24XX_GPIO_IRQSTATUS1;
790 break; 868 break;
791#endif 869#endif
870#if defined(CONFIG_ARCH_OMAP4)
871 case METHOD_GPIO_24XX:
872 reg += OMAP4_GPIO_IRQSTATUS0;
873 break;
874#endif
792 default: 875 default:
793 WARN_ON(1); 876 WARN_ON(1);
794 return; 877 return;
@@ -798,12 +881,16 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
798 /* Workaround for clearing DSP GPIO interrupts to allow retention */ 881 /* Workaround for clearing DSP GPIO interrupts to allow retention */
799#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 882#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
800 reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2; 883 reg = bank->base + OMAP24XX_GPIO_IRQSTATUS2;
801 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 884#endif
885#if defined(CONFIG_ARCH_OMAP4)
886 reg = bank->base + OMAP4_GPIO_IRQSTATUS1;
887#endif
888 if (cpu_is_omap24xx() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
802 __raw_writel(gpio_mask, reg); 889 __raw_writel(gpio_mask, reg);
803 890
804 /* Flush posted write for the irq status to avoid spurious interrupts */ 891 /* Flush posted write for the irq status to avoid spurious interrupts */
805 __raw_readl(reg); 892 __raw_readl(reg);
806#endif 893 }
807} 894}
808 895
809static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio) 896static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
@@ -853,13 +940,18 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
853 inv = 1; 940 inv = 1;
854 break; 941 break;
855#endif 942#endif
856#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 943#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
857 defined(CONFIG_ARCH_OMAP4)
858 case METHOD_GPIO_24XX: 944 case METHOD_GPIO_24XX:
859 reg += OMAP24XX_GPIO_IRQENABLE1; 945 reg += OMAP24XX_GPIO_IRQENABLE1;
860 mask = 0xffffffff; 946 mask = 0xffffffff;
861 break; 947 break;
862#endif 948#endif
949#if defined(CONFIG_ARCH_OMAP4)
950 case METHOD_GPIO_24XX:
951 reg += OMAP4_GPIO_IRQSTATUSSET0;
952 mask = 0xffffffff;
953 break;
954#endif
863 default: 955 default:
864 WARN_ON(1); 956 WARN_ON(1);
865 return 0; 957 return 0;
@@ -927,8 +1019,7 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
927 l |= gpio_mask; 1019 l |= gpio_mask;
928 break; 1020 break;
929#endif 1021#endif
930#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1022#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
931 defined(CONFIG_ARCH_OMAP4)
932 case METHOD_GPIO_24XX: 1023 case METHOD_GPIO_24XX:
933 if (enable) 1024 if (enable)
934 reg += OMAP24XX_GPIO_SETIRQENABLE1; 1025 reg += OMAP24XX_GPIO_SETIRQENABLE1;
@@ -937,6 +1028,15 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
937 l = gpio_mask; 1028 l = gpio_mask;
938 break; 1029 break;
939#endif 1030#endif
1031#ifdef CONFIG_ARCH_OMAP4
1032 case METHOD_GPIO_24XX:
1033 if (enable)
1034 reg += OMAP4_GPIO_IRQSTATUSSET0;
1035 else
1036 reg += OMAP4_GPIO_IRQSTATUSCLR0;
1037 l = gpio_mask;
1038 break;
1039#endif
940 default: 1040 default:
941 WARN_ON(1); 1041 WARN_ON(1);
942 return; 1042 return;
@@ -1112,11 +1212,14 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1112 if (bank->method == METHOD_GPIO_850) 1212 if (bank->method == METHOD_GPIO_850)
1113 isr_reg = bank->base + OMAP850_GPIO_INT_STATUS; 1213 isr_reg = bank->base + OMAP850_GPIO_INT_STATUS;
1114#endif 1214#endif
1115#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1215#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1116 defined(CONFIG_ARCH_OMAP4)
1117 if (bank->method == METHOD_GPIO_24XX) 1216 if (bank->method == METHOD_GPIO_24XX)
1118 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1; 1217 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1;
1119#endif 1218#endif
1219#if defined(CONFIG_ARCH_OMAP4)
1220 if (bank->method == METHOD_GPIO_24XX)
1221 isr_reg = bank->base + OMAP4_GPIO_IRQSTATUS0;
1222#endif
1120 while(1) { 1223 while(1) {
1121 u32 isr_saved, level_mask = 0; 1224 u32 isr_saved, level_mask = 0;
1122 u32 enabled; 1225 u32 enabled;
@@ -1189,6 +1292,7 @@ static void gpio_mask_irq(unsigned int irq)
1189 struct gpio_bank *bank = get_irq_chip_data(irq); 1292 struct gpio_bank *bank = get_irq_chip_data(irq);
1190 1293
1191 _set_gpio_irqenable(bank, gpio, 0); 1294 _set_gpio_irqenable(bank, gpio, 0);
1295 _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE);
1192} 1296}
1193 1297
1194static void gpio_unmask_irq(unsigned int irq) 1298static void gpio_unmask_irq(unsigned int irq)
@@ -1196,6 +1300,11 @@ static void gpio_unmask_irq(unsigned int irq)
1196 unsigned int gpio = irq - IH_GPIO_BASE; 1300 unsigned int gpio = irq - IH_GPIO_BASE;
1197 struct gpio_bank *bank = get_irq_chip_data(irq); 1301 struct gpio_bank *bank = get_irq_chip_data(irq);
1198 unsigned int irq_mask = 1 << get_gpio_index(gpio); 1302 unsigned int irq_mask = 1 << get_gpio_index(gpio);
1303 struct irq_desc *desc = irq_to_desc(irq);
1304 u32 trigger = desc->status & IRQ_TYPE_SENSE_MASK;
1305
1306 if (trigger)
1307 _set_gpio_triggering(bank, get_gpio_index(gpio), trigger);
1199 1308
1200 /* For level-triggered GPIOs, the clearing must be done after 1309 /* For level-triggered GPIOs, the clearing must be done after
1201 * the HW source is cleared, thus after the handler has run */ 1310 * the HW source is cleared, thus after the handler has run */
@@ -1547,7 +1656,7 @@ static int __init _omap_gpio_init(void)
1547 1656
1548 gpio_bank_count = OMAP34XX_NR_GPIOS; 1657 gpio_bank_count = OMAP34XX_NR_GPIOS;
1549 gpio_bank = gpio_bank_44xx; 1658 gpio_bank = gpio_bank_44xx;
1550 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); 1659 rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION);
1551 printk(KERN_INFO "OMAP44xx GPIO hardware version %d.%d\n", 1660 printk(KERN_INFO "OMAP44xx GPIO hardware version %d.%d\n",
1552 (rev >> 4) & 0x0f, rev & 0x0f); 1661 (rev >> 4) & 0x0f, rev & 0x0f);
1553 } 1662 }
@@ -1581,7 +1690,16 @@ static int __init _omap_gpio_init(void)
1581 static const u32 non_wakeup_gpios[] = { 1690 static const u32 non_wakeup_gpios[] = {
1582 0xe203ffc0, 0x08700040 1691 0xe203ffc0, 0x08700040
1583 }; 1692 };
1584 1693 if (cpu_is_omap44xx()) {
1694 __raw_writel(0xffffffff, bank->base +
1695 OMAP4_GPIO_IRQSTATUSCLR0);
1696 __raw_writew(0x0015, bank->base +
1697 OMAP4_GPIO_SYSCONFIG);
1698 __raw_writel(0x00000000, bank->base +
1699 OMAP4_GPIO_DEBOUNCENABLE);
1700 /* Initialize interface clock ungated, module enabled */
1701 __raw_writel(0, bank->base + OMAP4_GPIO_CTRL);
1702 } else {
1585 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1); 1703 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1);
1586 __raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1); 1704 __raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1);
1587 __raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG); 1705 __raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG);
@@ -1589,12 +1707,12 @@ static int __init _omap_gpio_init(void)
1589 1707
1590 /* Initialize interface clock ungated, module enabled */ 1708 /* Initialize interface clock ungated, module enabled */
1591 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL); 1709 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
1710 }
1592 if (i < ARRAY_SIZE(non_wakeup_gpios)) 1711 if (i < ARRAY_SIZE(non_wakeup_gpios))
1593 bank->non_wakeup_gpios = non_wakeup_gpios[i]; 1712 bank->non_wakeup_gpios = non_wakeup_gpios[i];
1594 gpio_count = 32; 1713 gpio_count = 32;
1595 } 1714 }
1596#endif 1715#endif
1597
1598 /* REVISIT eventually switch from OMAP-specific gpio structs 1716 /* REVISIT eventually switch from OMAP-specific gpio structs
1599 * over to the generic ones 1717 * over to the generic ones
1600 */ 1718 */
@@ -1680,14 +1798,20 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
1680 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA; 1798 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
1681 break; 1799 break;
1682#endif 1800#endif
1683#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1801#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1684 defined(CONFIG_ARCH_OMAP4)
1685 case METHOD_GPIO_24XX: 1802 case METHOD_GPIO_24XX:
1686 wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN; 1803 wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN;
1687 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA; 1804 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
1688 wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA; 1805 wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
1689 break; 1806 break;
1690#endif 1807#endif
1808#ifdef CONFIG_ARCH_OMAP4
1809 case METHOD_GPIO_24XX:
1810 wake_status = bank->base + OMAP4_GPIO_IRQWAKEN0;
1811 wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
1812 wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
1813 break;
1814#endif
1691 default: 1815 default:
1692 continue; 1816 continue;
1693 } 1817 }
@@ -1722,13 +1846,18 @@ static int omap_gpio_resume(struct sys_device *dev)
1722 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA; 1846 wake_set = bank->base + OMAP1610_GPIO_SET_WAKEUPENA;
1723 break; 1847 break;
1724#endif 1848#endif
1725#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1849#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1726 defined(CONFIG_ARCH_OMAP4)
1727 case METHOD_GPIO_24XX: 1850 case METHOD_GPIO_24XX:
1728 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA; 1851 wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
1729 wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA; 1852 wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
1730 break; 1853 break;
1731#endif 1854#endif
1855#ifdef CONFIG_ARCH_OMAP4
1856 case METHOD_GPIO_24XX:
1857 wake_clear = bank->base + OMAP4_GPIO_IRQWAKEN0;
1858 wake_set = bank->base + OMAP4_GPIO_IRQWAKEN0;
1859 break;
1860#endif
1732 default: 1861 default:
1733 continue; 1862 continue;
1734 } 1863 }
@@ -1772,21 +1901,29 @@ void omap2_gpio_prepare_for_retention(void)
1772 1901
1773 if (!(bank->enabled_non_wakeup_gpios)) 1902 if (!(bank->enabled_non_wakeup_gpios))
1774 continue; 1903 continue;
1775#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1904#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1776 defined(CONFIG_ARCH_OMAP4)
1777 bank->saved_datain = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN); 1905 bank->saved_datain = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
1778 l1 = __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT); 1906 l1 = __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
1779 l2 = __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT); 1907 l2 = __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
1780#endif 1908#endif
1909#ifdef CONFIG_ARCH_OMAP4
1910 bank->saved_datain = __raw_readl(bank->base +
1911 OMAP4_GPIO_DATAIN);
1912 l1 = __raw_readl(bank->base + OMAP4_GPIO_FALLINGDETECT);
1913 l2 = __raw_readl(bank->base + OMAP4_GPIO_RISINGDETECT);
1914#endif
1781 bank->saved_fallingdetect = l1; 1915 bank->saved_fallingdetect = l1;
1782 bank->saved_risingdetect = l2; 1916 bank->saved_risingdetect = l2;
1783 l1 &= ~bank->enabled_non_wakeup_gpios; 1917 l1 &= ~bank->enabled_non_wakeup_gpios;
1784 l2 &= ~bank->enabled_non_wakeup_gpios; 1918 l2 &= ~bank->enabled_non_wakeup_gpios;
1785#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1919#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1786 defined(CONFIG_ARCH_OMAP4)
1787 __raw_writel(l1, bank->base + OMAP24XX_GPIO_FALLINGDETECT); 1920 __raw_writel(l1, bank->base + OMAP24XX_GPIO_FALLINGDETECT);
1788 __raw_writel(l2, bank->base + OMAP24XX_GPIO_RISINGDETECT); 1921 __raw_writel(l2, bank->base + OMAP24XX_GPIO_RISINGDETECT);
1789#endif 1922#endif
1923#ifdef CONFIG_ARCH_OMAP4
1924 __raw_writel(l1, bank->base + OMAP4_GPIO_FALLINGDETECT);
1925 __raw_writel(l2, bank->base + OMAP4_GPIO_RISINGDETECT);
1926#endif
1790 c++; 1927 c++;
1791 } 1928 }
1792 if (!c) { 1929 if (!c) {
@@ -1808,27 +1945,29 @@ void omap2_gpio_resume_after_retention(void)
1808 1945
1809 if (!(bank->enabled_non_wakeup_gpios)) 1946 if (!(bank->enabled_non_wakeup_gpios))
1810 continue; 1947 continue;
1811#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1948#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1812 defined(CONFIG_ARCH_OMAP4)
1813 __raw_writel(bank->saved_fallingdetect, 1949 __raw_writel(bank->saved_fallingdetect,
1814 bank->base + OMAP24XX_GPIO_FALLINGDETECT); 1950 bank->base + OMAP24XX_GPIO_FALLINGDETECT);
1815 __raw_writel(bank->saved_risingdetect, 1951 __raw_writel(bank->saved_risingdetect,
1816 bank->base + OMAP24XX_GPIO_RISINGDETECT); 1952 bank->base + OMAP24XX_GPIO_RISINGDETECT);
1953 l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
1954#endif
1955#ifdef CONFIG_ARCH_OMAP4
1956 __raw_writel(bank->saved_fallingdetect,
1957 bank->base + OMAP4_GPIO_FALLINGDETECT);
1958 __raw_writel(bank->saved_risingdetect,
1959 bank->base + OMAP4_GPIO_RISINGDETECT);
1960 l = __raw_readl(bank->base + OMAP4_GPIO_DATAIN);
1817#endif 1961#endif
1818 /* Check if any of the non-wakeup interrupt GPIOs have changed 1962 /* Check if any of the non-wakeup interrupt GPIOs have changed
1819 * state. If so, generate an IRQ by software. This is 1963 * state. If so, generate an IRQ by software. This is
1820 * horribly racy, but it's the best we can do to work around 1964 * horribly racy, but it's the best we can do to work around
1821 * this silicon bug. */ 1965 * this silicon bug. */
1822#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1823 defined(CONFIG_ARCH_OMAP4)
1824 l = __raw_readl(bank->base + OMAP24XX_GPIO_DATAIN);
1825#endif
1826 l ^= bank->saved_datain; 1966 l ^= bank->saved_datain;
1827 l &= bank->non_wakeup_gpios; 1967 l &= bank->non_wakeup_gpios;
1828 if (l) { 1968 if (l) {
1829 u32 old0, old1; 1969 u32 old0, old1;
1830#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1970#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1831 defined(CONFIG_ARCH_OMAP4)
1832 old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1971 old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
1833 old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); 1972 old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
1834 __raw_writel(old0 | l, bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1973 __raw_writel(old0 | l, bank->base + OMAP24XX_GPIO_LEVELDETECT0);
@@ -1836,6 +1975,20 @@ void omap2_gpio_resume_after_retention(void)
1836 __raw_writel(old0, bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1975 __raw_writel(old0, bank->base + OMAP24XX_GPIO_LEVELDETECT0);
1837 __raw_writel(old1, bank->base + OMAP24XX_GPIO_LEVELDETECT1); 1976 __raw_writel(old1, bank->base + OMAP24XX_GPIO_LEVELDETECT1);
1838#endif 1977#endif
1978#ifdef CONFIG_ARCH_OMAP4
1979 old0 = __raw_readl(bank->base +
1980 OMAP4_GPIO_LEVELDETECT0);
1981 old1 = __raw_readl(bank->base +
1982 OMAP4_GPIO_LEVELDETECT1);
1983 __raw_writel(old0 | l, bank->base +
1984 OMAP4_GPIO_LEVELDETECT0);
1985 __raw_writel(old1 | l, bank->base +
1986 OMAP4_GPIO_LEVELDETECT1);
1987 __raw_writel(old0, bank->base +
1988 OMAP4_GPIO_LEVELDETECT0);
1989 __raw_writel(old1, bank->base +
1990 OMAP4_GPIO_LEVELDETECT1);
1991#endif
1839 } 1992 }
1840 } 1993 }
1841 1994
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 7b939cc01962..72f680b7180d 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -122,6 +122,11 @@
122#define OMAP_DMA4_CCFN(n) (0x60 * (n) + 0xc0) 122#define OMAP_DMA4_CCFN(n) (0x60 * (n) + 0xc0)
123#define OMAP_DMA4_COLOR(n) (0x60 * (n) + 0xc4) 123#define OMAP_DMA4_COLOR(n) (0x60 * (n) + 0xc4)
124 124
125/* Additional registers available on OMAP4 */
126#define OMAP_DMA4_CDP(n) (0x60 * (n) + 0xd0)
127#define OMAP_DMA4_CNDP(n) (0x60 * (n) + 0xd4)
128#define OMAP_DMA4_CCDN(n) (0x60 * (n) + 0xd8)
129
125/* Dummy defines to keep multi-omap compiles happy */ 130/* Dummy defines to keep multi-omap compiles happy */
126#define OMAP1_DMA_REVISION 0 131#define OMAP1_DMA_REVISION 0
127#define OMAP1_DMA_IRQSTATUS_L0 0 132#define OMAP1_DMA_IRQSTATUS_L0 0
@@ -311,6 +316,89 @@
311#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */ 316#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */
312#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */ 317#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */
313 318
319/* DMA request lines for 44xx */
320#define OMAP44XX_DMA_DSS_DISPC_REQ 6 /* S_DMA_5 */
321#define OMAP44XX_DMA_SYS_REQ2 7 /* S_DMA_6 */
322#define OMAP44XX_DMA_ISS_REQ1 9 /* S_DMA_8 */
323#define OMAP44XX_DMA_ISS_REQ2 10 /* S_DMA_9 */
324#define OMAP44XX_DMA_ISS_REQ3 12 /* S_DMA_11 */
325#define OMAP44XX_DMA_ISS_REQ4 13 /* S_DMA_12 */
326#define OMAP44XX_DMA_DSS_RFBI_REQ 14 /* S_DMA_13 */
327#define OMAP44XX_DMA_SPI3_TX0 15 /* S_DMA_14 */
328#define OMAP44XX_DMA_SPI3_RX0 16 /* S_DMA_15 */
329#define OMAP44XX_DMA_MCBSP2_TX 17 /* S_DMA_16 */
330#define OMAP44XX_DMA_MCBSP2_RX 18 /* S_DMA_17 */
331#define OMAP44XX_DMA_MCBSP3_TX 19 /* S_DMA_18 */
332#define OMAP44XX_DMA_MCBSP3_RX 20 /* S_DMA_19 */
333#define OMAP44XX_DMA_SPI3_TX1 23 /* S_DMA_22 */
334#define OMAP44XX_DMA_SPI3_RX1 24 /* S_DMA_23 */
335#define OMAP44XX_DMA_I2C3_TX 25 /* S_DMA_24 */
336#define OMAP44XX_DMA_I2C3_RX 26 /* S_DMA_25 */
337#define OMAP44XX_DMA_I2C1_TX 27 /* S_DMA_26 */
338#define OMAP44XX_DMA_I2C1_RX 28 /* S_DMA_27 */
339#define OMAP44XX_DMA_I2C2_TX 29 /* S_DMA_28 */
340#define OMAP44XX_DMA_I2C2_RX 30 /* S_DMA_29 */
341#define OMAP44XX_DMA_MCBSP4_TX 31 /* S_DMA_30 */
342#define OMAP44XX_DMA_MCBSP4_RX 32 /* S_DMA_31 */
343#define OMAP44XX_DMA_MCBSP1_TX 33 /* S_DMA_32 */
344#define OMAP44XX_DMA_MCBSP1_RX 34 /* S_DMA_33 */
345#define OMAP44XX_DMA_SPI1_TX0 35 /* S_DMA_34 */
346#define OMAP44XX_DMA_SPI1_RX0 36 /* S_DMA_35 */
347#define OMAP44XX_DMA_SPI1_TX1 37 /* S_DMA_36 */
348#define OMAP44XX_DMA_SPI1_RX1 38 /* S_DMA_37 */
349#define OMAP44XX_DMA_SPI1_TX2 39 /* S_DMA_38 */
350#define OMAP44XX_DMA_SPI1_RX2 40 /* S_DMA_39 */
351#define OMAP44XX_DMA_SPI1_TX3 41 /* S_DMA_40 */
352#define OMAP44XX_DMA_SPI1_RX3 42 /* S_DMA_41 */
353#define OMAP44XX_DMA_SPI2_TX0 43 /* S_DMA_42 */
354#define OMAP44XX_DMA_SPI2_RX0 44 /* S_DMA_43 */
355#define OMAP44XX_DMA_SPI2_TX1 45 /* S_DMA_44 */
356#define OMAP44XX_DMA_SPI2_RX1 46 /* S_DMA_45 */
357#define OMAP44XX_DMA_MMC2_TX 47 /* S_DMA_46 */
358#define OMAP44XX_DMA_MMC2_RX 48 /* S_DMA_47 */
359#define OMAP44XX_DMA_UART1_TX 49 /* S_DMA_48 */
360#define OMAP44XX_DMA_UART1_RX 50 /* S_DMA_49 */
361#define OMAP44XX_DMA_UART2_TX 51 /* S_DMA_50 */
362#define OMAP44XX_DMA_UART2_RX 52 /* S_DMA_51 */
363#define OMAP44XX_DMA_UART3_TX 53 /* S_DMA_52 */
364#define OMAP44XX_DMA_UART3_RX 54 /* S_DMA_53 */
365#define OMAP44XX_DMA_UART4_TX 55 /* S_DMA_54 */
366#define OMAP44XX_DMA_UART4_RX 56 /* S_DMA_55 */
367#define OMAP44XX_DMA_MMC4_TX 57 /* S_DMA_56 */
368#define OMAP44XX_DMA_MMC4_RX 58 /* S_DMA_57 */
369#define OMAP44XX_DMA_MMC5_TX 59 /* S_DMA_58 */
370#define OMAP44XX_DMA_MMC5_RX 60 /* S_DMA_59 */
371#define OMAP44XX_DMA_MMC1_TX 61 /* S_DMA_60 */
372#define OMAP44XX_DMA_MMC1_RX 62 /* S_DMA_61 */
373#define OMAP44XX_DMA_SYS_REQ3 64 /* S_DMA_63 */
374#define OMAP44XX_DMA_MCPDM_UP 65 /* S_DMA_64 */
375#define OMAP44XX_DMA_MCPDM_DL 66 /* S_DMA_65 */
376#define OMAP44XX_DMA_SPI4_TX0 70 /* S_DMA_69 */
377#define OMAP44XX_DMA_SPI4_RX0 71 /* S_DMA_70 */
378#define OMAP44XX_DMA_DSS_DSI1_REQ0 72 /* S_DMA_71 */
379#define OMAP44XX_DMA_DSS_DSI1_REQ1 73 /* S_DMA_72 */
380#define OMAP44XX_DMA_DSS_DSI1_REQ2 74 /* S_DMA_73 */
381#define OMAP44XX_DMA_DSS_DSI1_REQ3 75 /* S_DMA_74 */
382#define OMAP44XX_DMA_DSS_HDMI_REQ 76 /* S_DMA_75 */
383#define OMAP44XX_DMA_MMC3_TX 77 /* S_DMA_76 */
384#define OMAP44XX_DMA_MMC3_RX 78 /* S_DMA_77 */
385#define OMAP44XX_DMA_USIM_TX 79 /* S_DMA_78 */
386#define OMAP44XX_DMA_USIM_RX 80 /* S_DMA_79 */
387#define OMAP44XX_DMA_DSS_DSI2_REQ0 81 /* S_DMA_80 */
388#define OMAP44XX_DMA_DSS_DSI2_REQ1 82 /* S_DMA_81 */
389#define OMAP44XX_DMA_DSS_DSI2_REQ2 83 /* S_DMA_82 */
390#define OMAP44XX_DMA_DSS_DSI2_REQ3 84 /* S_DMA_83 */
391#define OMAP44XX_DMA_ABE_REQ0 101 /* S_DMA_100 */
392#define OMAP44XX_DMA_ABE_REQ1 102 /* S_DMA_101 */
393#define OMAP44XX_DMA_ABE_REQ2 103 /* S_DMA_102 */
394#define OMAP44XX_DMA_ABE_REQ3 104 /* S_DMA_103 */
395#define OMAP44XX_DMA_ABE_REQ4 105 /* S_DMA_104 */
396#define OMAP44XX_DMA_ABE_REQ5 106 /* S_DMA_105 */
397#define OMAP44XX_DMA_ABE_REQ6 107 /* S_DMA_106 */
398#define OMAP44XX_DMA_ABE_REQ7 108 /* S_DMA_107 */
399#define OMAP44XX_DMA_I2C4_TX 124 /* S_DMA_123 */
400#define OMAP44XX_DMA_I2C4_RX 125 /* S_DMA_124 */
401
314/*----------------------------------------------------------------------------*/ 402/*----------------------------------------------------------------------------*/
315 403
316/* Hardware registers for LCD DMA */ 404/* Hardware registers for LCD DMA */
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h
index bb154ea76769..ec6f81e06d39 100644
--- a/arch/arm/plat-omap/include/mach/mcbsp.h
+++ b/arch/arm/plat-omap/include/mach/mcbsp.h
@@ -53,6 +53,11 @@
53#define OMAP34XX_MCBSP4_BASE 0x49026000 53#define OMAP34XX_MCBSP4_BASE 0x49026000
54#define OMAP34XX_MCBSP5_BASE 0x48096000 54#define OMAP34XX_MCBSP5_BASE 0x48096000
55 55
56#define OMAP44XX_MCBSP1_BASE 0x49022000
57#define OMAP44XX_MCBSP2_BASE 0x49024000
58#define OMAP44XX_MCBSP3_BASE 0x49026000
59#define OMAP44XX_MCBSP4_BASE 0x48074000
60
56#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) 61#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730)
57 62
58#define OMAP_MCBSP_REG_DRR2 0x00 63#define OMAP_MCBSP_REG_DRR2 0x00
@@ -98,7 +103,8 @@
98#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX 103#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX
99#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX 104#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX
100 105
101#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 106#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
107 defined(CONFIG_ARCH_OMAP4)
102 108
103#define OMAP_MCBSP_REG_DRR2 0x00 109#define OMAP_MCBSP_REG_DRR2 0x00
104#define OMAP_MCBSP_REG_DRR1 0x04 110#define OMAP_MCBSP_REG_DRR1 0x04
diff --git a/arch/arm/plat-omap/include/mach/serial.h b/arch/arm/plat-omap/include/mach/serial.h
index 13abd02d1527..def0529c75eb 100644
--- a/arch/arm/plat-omap/include/mach/serial.h
+++ b/arch/arm/plat-omap/include/mach/serial.h
@@ -59,6 +59,7 @@ extern void omap_uart_check_wakeup(void);
59extern void omap_uart_prepare_suspend(void); 59extern void omap_uart_prepare_suspend(void);
60extern void omap_uart_prepare_idle(int num); 60extern void omap_uart_prepare_idle(int num);
61extern void omap_uart_resume_idle(int num); 61extern void omap_uart_resume_idle(int num);
62extern void omap_uart_enable_irqs(int enable);
62#endif 63#endif
63 64
64#endif 65#endif
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index efa0e0111f38..e42fa7cfc795 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -191,7 +191,7 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
191 OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2); 191 OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2);
192 OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1); 192 OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1);
193 OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0); 193 OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0);
194 if (cpu_is_omap2430() || cpu_is_omap34xx()) { 194 if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
195 OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr); 195 OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr);
196 OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr); 196 OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr);
197 } 197 }
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
index abc79d44acaa..98548c6903a0 100644
--- a/arch/arm/plat-pxa/gpio.c
+++ b/arch/arm/plat-pxa/gpio.c
@@ -16,7 +16,7 @@
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/sysdev.h> 18#include <linux/sysdev.h>
19#include <linux/bootmem.h> 19#include <linux/slab.h>
20 20
21#include <mach/gpio.h> 21#include <mach/gpio.h>
22 22
@@ -112,17 +112,12 @@ static int __init pxa_init_gpio_chip(int gpio_end)
112 int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1; 112 int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1;
113 struct pxa_gpio_chip *chips; 113 struct pxa_gpio_chip *chips;
114 114
115 /* this is early, we have to use bootmem allocator, and we really 115 chips = kzalloc(nbanks * sizeof(struct pxa_gpio_chip), GFP_KERNEL);
116 * want this to be allocated dynamically for different 'gpio_end'
117 */
118 chips = alloc_bootmem_low(nbanks * sizeof(struct pxa_gpio_chip));
119 if (chips == NULL) { 116 if (chips == NULL) {
120 pr_err("%s: failed to allocate GPIO chips\n", __func__); 117 pr_err("%s: failed to allocate GPIO chips\n", __func__);
121 return -ENOMEM; 118 return -ENOMEM;
122 } 119 }
123 120
124 memset(chips, 0, nbanks * sizeof(struct pxa_gpio_chip));
125
126 for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) { 121 for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) {
127 struct gpio_chip *c = &chips[i].chip; 122 struct gpio_chip *c = &chips[i].chip;
128 123
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index 935c7558469b..8931c5f0e46b 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -198,4 +198,9 @@ config S3C_DEV_USB_HSOTG
198 help 198 help
199 Compile in platform device definition for USB high-speed OtG 199 Compile in platform device definition for USB high-speed OtG
200 200
201config S3C_DEV_NAND
202 bool
203 help
204 Compile in platform device definition for NAND controller
205
201endif 206endif
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 0761766b1833..3c09109e9e84 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -28,13 +28,17 @@ obj-$(CONFIG_PM) += pm.o
28obj-$(CONFIG_PM) += pm-gpio.o 28obj-$(CONFIG_PM) += pm-gpio.o
29obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o 29obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o
30 30
31# PWM support
32
33obj-$(CONFIG_HAVE_PWM) += pwm.o
34
31# devices 35# devices
32 36
33obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o 37obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
34obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o 38obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
35obj-y += dev-i2c0.o 39obj-y += dev-i2c0.o
36obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 40obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
37obj-$(CONFIG_SND_S3C64XX_SOC_I2S) += dev-audio.o
38obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 41obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
39obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 42obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
40obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o 43obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
44obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c
new file mode 100644
index 000000000000..4e5323732434
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-nand.c
@@ -0,0 +1,30 @@
1/*
2 * S3C series device definition for nand device
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7*/
8
9#include <linux/kernel.h>
10#include <linux/platform_device.h>
11
12#include <mach/map.h>
13#include <plat/devs.h>
14
15static struct resource s3c_nand_resource[] = {
16 [0] = {
17 .start = S3C_PA_NAND,
18 .end = S3C_PA_NAND + SZ_1M,
19 .flags = IORESOURCE_MEM,
20 }
21};
22
23struct platform_device s3c_device_nand = {
24 .name = "s3c2410-nand",
25 .id = -1,
26 .num_resources = ARRAY_SIZE(s3c_nand_resource),
27 .resource = s3c_nand_resource,
28};
29
30EXPORT_SYMBOL(s3c_device_nand);
diff --git a/arch/arm/plat-s3c/include/plat/adc.h b/arch/arm/plat-s3c/include/plat/adc.h
index d847bd476b6c..5f3b1cd53b90 100644
--- a/arch/arm/plat-s3c/include/plat/adc.h
+++ b/arch/arm/plat-s3c/include/plat/adc.h
@@ -19,10 +19,14 @@ struct s3c_adc_client;
19extern int s3c_adc_start(struct s3c_adc_client *client, 19extern int s3c_adc_start(struct s3c_adc_client *client,
20 unsigned int channel, unsigned int nr_samples); 20 unsigned int channel, unsigned int nr_samples);
21 21
22extern int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch);
23
22extern struct s3c_adc_client * 24extern struct s3c_adc_client *
23 s3c_adc_register(struct platform_device *pdev, 25 s3c_adc_register(struct platform_device *pdev,
24 void (*select)(unsigned selected), 26 void (*select)(struct s3c_adc_client *client,
25 void (*conv)(unsigned d0, unsigned d1, 27 unsigned selected),
28 void (*conv)(struct s3c_adc_client *client,
29 unsigned d0, unsigned d1,
26 unsigned *samples_left), 30 unsigned *samples_left),
27 unsigned int is_ts); 31 unsigned int is_ts);
28 32
diff --git a/arch/arm/plat-s3c/include/plat/cpu-freq.h b/arch/arm/plat-s3c/include/plat/cpu-freq.h
index c86a13307e90..7b982b7f28cd 100644
--- a/arch/arm/plat-s3c/include/plat/cpu-freq.h
+++ b/arch/arm/plat-s3c/include/plat/cpu-freq.h
@@ -17,6 +17,21 @@ struct s3c_cpufreq_info;
17struct s3c_cpufreq_board; 17struct s3c_cpufreq_board;
18struct s3c_iotimings; 18struct s3c_iotimings;
19 19
20/**
21 * struct s3c_freq - frequency information (mainly for core drivers)
22 * @fclk: The FCLK frequency in Hz.
23 * @armclk: The ARMCLK frequency in Hz.
24 * @hclk_tns: HCLK cycle time in 10ths of nano-seconds.
25 * @hclk: The HCLK frequency in Hz.
26 * @pclk: The PCLK frequency in Hz.
27 *
28 * This contains the frequency information about the current configuration
29 * mainly for the core drivers to ensure we do not end up passing about
30 * a large number of parameters.
31 *
32 * The @hclk_tns field is a useful cache for the parts of the drivers that
33 * need to calculate IO timings and suchlike.
34 */
20struct s3c_freq { 35struct s3c_freq {
21 unsigned long fclk; 36 unsigned long fclk;
22 unsigned long armclk; 37 unsigned long armclk;
@@ -25,48 +40,84 @@ struct s3c_freq {
25 unsigned long pclk; 40 unsigned long pclk;
26}; 41};
27 42
28/* wrapper 'struct cpufreq_freqs' so that any drivers receiving the 43/**
44 * struct s3c_cpufreq_freqs - s3c cpufreq notification information.
45 * @freqs: The cpufreq setting information.
46 * @old: The old clock settings.
47 * @new: The new clock settings.
48 * @pll_changing: Set if the PLL is changing.
49 *
50 * Wrapper 'struct cpufreq_freqs' so that any drivers receiving the
29 * notification can use this information that is not provided by just 51 * notification can use this information that is not provided by just
30 * having the core frequency alone. 52 * having the core frequency alone.
53 *
54 * The pll_changing flag is used to indicate if the PLL itself is
55 * being set during this change. This is important as the clocks
56 * will temporarily be set to the XTAL clock during this time, so
57 * drivers may want to close down their output during this time.
58 *
59 * Note, this is not being used by any current drivers and therefore
60 * may be removed in the future.
31 */ 61 */
32
33struct s3c_cpufreq_freqs { 62struct s3c_cpufreq_freqs {
34 struct cpufreq_freqs freqs; 63 struct cpufreq_freqs freqs;
35 struct s3c_freq old; 64 struct s3c_freq old;
36 struct s3c_freq new; 65 struct s3c_freq new;
66
67 unsigned int pll_changing:1;
37}; 68};
38 69
39#define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs) 70#define to_s3c_cpufreq(_cf) container_of(_cf, struct s3c_cpufreq_freqs, freqs)
40 71
72/**
73 * struct s3c_clkdivs - clock divisor information
74 * @p_divisor: Divisor from FCLK to PCLK.
75 * @h_divisor: Divisor from FCLK to HCLK.
76 * @arm_divisor: Divisor from FCLK to ARMCLK (not all CPUs).
77 * @dvs: Non-zero if using DVS mode for ARMCLK.
78 *
79 * Divisor settings for the core clocks.
80 */
41struct s3c_clkdivs { 81struct s3c_clkdivs {
42 int p_divisor; /* fclk / pclk */ 82 int p_divisor;
43 int h_divisor; /* fclk / hclk */ 83 int h_divisor;
44 int arm_divisor; /* not all cpus have this. */ 84 int arm_divisor;
45 unsigned char dvs; /* using dvs mode to arm. */ 85 unsigned char dvs;
46}; 86};
47 87
48#define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s)) 88#define PLLVAL(_m, _p, _s) (((_m) << 12) | ((_p) << 4) | (_s))
49 89
90/**
91 * struct s3c_pllval - PLL value entry.
92 * @freq: The frequency for this entry in Hz.
93 * @pll_reg: The PLL register setting for this PLL value.
94 */
50struct s3c_pllval { 95struct s3c_pllval {
51 unsigned long freq; 96 unsigned long freq;
52 unsigned long pll_reg; 97 unsigned long pll_reg;
53}; 98};
54 99
55struct s3c_cpufreq_config { 100/**
56 struct s3c_freq freq; 101 * struct s3c_cpufreq_board - per-board cpu frequency informatin
57 struct s3c_pllval pll; 102 * @refresh: The SDRAM refresh period in nanoseconds.
58 struct s3c_clkdivs divs; 103 * @auto_io: Set if the IO timing settings should be generated from the
59 struct s3c_cpufreq_info *info; /* for core, not drivers */ 104 * initialisation time hardware registers.
60 struct s3c_cpufreq_board *board; 105 * @need_io: Set if the board has external IO on any of the chipselect
61}; 106 * lines that will require the hardware timing registers to be
62 107 * updated on a clock change.
63/* s3c_cpufreq_board 108 * @max: The maxium frequency limits for the system. Any field that
109 * is left at zero will use the CPU's settings.
110 *
111 * This contains the board specific settings that affect how the CPU
112 * drivers chose settings. These include the memory refresh and IO
113 * timing information.
64 * 114 *
65 * per-board configuraton information, such as memory refresh and 115 * Registration depends on the driver being used, the ARMCLK only
66 * how to initialise IO timings. 116 * implementation does not currently need this but the older style
117 * driver requires this to be available.
67 */ 118 */
68struct s3c_cpufreq_board { 119struct s3c_cpufreq_board {
69 unsigned int refresh; /* refresh period in ns */ 120 unsigned int refresh;
70 unsigned int auto_io:1; /* automatically init io timings. */ 121 unsigned int auto_io:1; /* automatically init io timings. */
71 unsigned int need_io:1; /* set if needs io timing support. */ 122 unsigned int need_io:1; /* set if needs io timing support. */
72 123
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h
index be541cbba070..fbc3d498e02e 100644
--- a/arch/arm/plat-s3c/include/plat/cpu.h
+++ b/arch/arm/plat-s3c/include/plat/cpu.h
@@ -65,6 +65,7 @@ extern struct sys_timer s3c24xx_timer;
65/* system device classes */ 65/* system device classes */
66 66
67extern struct sysdev_class s3c2410_sysclass; 67extern struct sysdev_class s3c2410_sysclass;
68extern struct sysdev_class s3c2410a_sysclass;
68extern struct sysdev_class s3c2412_sysclass; 69extern struct sysdev_class s3c2412_sysclass;
69extern struct sysdev_class s3c2440_sysclass; 70extern struct sysdev_class s3c2440_sysclass;
70extern struct sysdev_class s3c2442_sysclass; 71extern struct sysdev_class s3c2442_sysclass;
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index 2e170827e0b0..0f540ea1e999 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -46,6 +46,8 @@ extern struct platform_device s3c_device_hsmmc2;
46extern struct platform_device s3c_device_spi0; 46extern struct platform_device s3c_device_spi0;
47extern struct platform_device s3c_device_spi1; 47extern struct platform_device s3c_device_spi1;
48 48
49extern struct platform_device s3c_device_hwmon;
50
49extern struct platform_device s3c_device_nand; 51extern struct platform_device s3c_device_nand;
50 52
51extern struct platform_device s3c_device_usbgadget; 53extern struct platform_device s3c_device_usbgadget;
@@ -56,5 +58,6 @@ extern struct platform_device s3c_device_usb_hsotg;
56#ifdef CONFIG_CPU_S3C2440 58#ifdef CONFIG_CPU_S3C2440
57 59
58extern struct platform_device s3c_device_camif; 60extern struct platform_device s3c_device_camif;
61extern struct platform_device s3c_device_ac97;
59 62
60#endif 63#endif
diff --git a/arch/arm/plat-s3c/include/plat/hwmon.h b/arch/arm/plat-s3c/include/plat/hwmon.h
new file mode 100644
index 000000000000..1ba88ea0aa31
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/hwmon.h
@@ -0,0 +1,41 @@
1/* linux/arch/arm/plat-s3c/include/plat/hwmon.h
2 *
3 * Copyright 2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C - HWMon interface for ADC
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_ARCH_ADC_HWMON_H
15#define __ASM_ARCH_ADC_HWMON_H __FILE__
16
17/**
18 * s3c_hwmon_chcfg - channel configuration
19 * @name: The name to give this channel.
20 * @mult: Multiply the ADC value read by this.
21 * @div: Divide the value from the ADC by this.
22 *
23 * The value read from the ADC is converted to a value that
24 * hwmon expects (mV) by result = (value_read * @mult) / @div.
25 */
26struct s3c_hwmon_chcfg {
27 const char *name;
28 unsigned int mult;
29 unsigned int div;
30};
31
32/**
33 * s3c_hwmon_pdata - HWMON platform data
34 * @in: One configuration for each possible channel used.
35 */
36struct s3c_hwmon_pdata {
37 struct s3c_hwmon_chcfg *in[8];
38};
39
40#endif /* __ASM_ARCH_ADC_HWMON_H */
41
diff --git a/arch/arm/plat-s3c/include/plat/map-base.h b/arch/arm/plat-s3c/include/plat/map-base.h
index b84289d32a54..250be311c85b 100644
--- a/arch/arm/plat-s3c/include/plat/map-base.h
+++ b/arch/arm/plat-s3c/include/plat/map-base.h
@@ -32,9 +32,15 @@
32 32
33#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */ 33#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */
34#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */ 34#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */
35#define S3C_VA_MEM S3C_ADDR(0x00200000) /* system control */ 35#define S3C_VA_MEM S3C_ADDR(0x00200000) /* memory control */
36#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */ 36#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */
37#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */ 37#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */
38#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */ 38#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */
39 39
40/* This is used for the CPU specific mappings that may be needed, so that
41 * they do not need to directly used S3C_ADDR() and thus make it easier to
42 * modify the space for mapping.
43 */
44#define S3C_ADDR_CPU(x) S3C_ADDR(0x00500000 + (x))
45
40#endif /* __ASM_PLAT_MAP_H */ 46#endif /* __ASM_PLAT_MAP_H */
diff --git a/arch/arm/plat-s3c24xx/pwm.c b/arch/arm/plat-s3c/pwm.c
index 0120b760315b..f3d37ac5595b 100644
--- a/arch/arm/plat-s3c24xx/pwm.c
+++ b/arch/arm/plat-s3c/pwm.c
@@ -1,10 +1,10 @@
1/* arch/arm/plat-s3c24xx/pwm.c 1/* arch/arm/plat-s3c/pwm.c
2 * 2 *
3 * Copyright (c) 2007 Ben Dooks 3 * Copyright (c) 2007 Ben Dooks
4 * Copyright (c) 2008 Simtec Electronics 4 * Copyright (c) 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org> 5 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
6 * 6 *
7 * S3C24XX PWM device core 7 * S3C series PWM device core
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
20#include <linux/pwm.h> 20#include <linux/pwm.h>
21 21
22#include <mach/irqs.h> 22#include <mach/irqs.h>
23#include <mach/map.h>
23 24
24#include <plat/devs.h> 25#include <plat/devs.h>
25#include <plat/regs-timer.h> 26#include <plat/regs-timer.h>
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 5b0bc914f58e..9c7aca489643 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -10,6 +10,7 @@ config PLAT_S3C24XX
10 default y 10 default y
11 select NO_IOPORT 11 select NO_IOPORT
12 select ARCH_REQUIRE_GPIOLIB 12 select ARCH_REQUIRE_GPIOLIB
13 select S3C_DEVICE_NAND
13 help 14 help
14 Base platform code for any Samsung S3C24XX device 15 Base platform code for any Samsung S3C24XX device
15 16
@@ -34,6 +35,40 @@ config CPU_S3C244X
34 help 35 help
35 Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems. 36 Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems.
36 37
38config S3C2440_CPUFREQ
39 bool "S3C2440/S3C2442 CPU Frequency scaling support"
40 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
41 select S3C2410_CPUFREQ_UTILS
42 default y
43 help
44 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
45
46config S3C2440_XTAL_12000000
47 bool
48 help
49 Indicate that the build needs to support 12MHz system
50 crystal.
51
52config S3C2440_XTAL_16934400
53 bool
54 help
55 Indicate that the build needs to support 16.9344MHz system
56 crystal.
57
58config S3C2440_PLL_12000000
59 bool
60 depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
61 default y if CPU_FREQ_S3C24XX_PLL
62 help
63 PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals.
64
65config S3C2440_PLL_16934400
66 bool
67 depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
68 default y if CPU_FREQ_S3C24XX_PLL
69 help
70 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
71
37config S3C24XX_PWM 72config S3C24XX_PWM
38 bool "PWM device support" 73 bool "PWM device support"
39 select HAVE_PWM 74 select HAVE_PWM
@@ -105,8 +140,39 @@ config S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7
105 SPI GPIO configuration code for BUS 1 when connected to 140 SPI GPIO configuration code for BUS 1 when connected to
106 GPG5, GPG6 and GPG7. 141 GPG5, GPG6 and GPG7.
107 142
143config S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10
144 bool
145 help
146 SPI GPIO configuration code for BUS 1 when connected to
147 GPD8, GPD9 and GPD10.
148
108# common code for s3c24xx based machines, such as the SMDKs. 149# common code for s3c24xx based machines, such as the SMDKs.
109 150
151# cpu frequency items common between s3c2410 and s3c2440/s3c2442
152
153config S3C2410_IOTIMING
154 bool
155 depends on CPU_FREQ_S3C24XX
156 help
157 Internal node to select io timing code that is common to the s3c2410
158 and s3c2440/s3c2442 cpu frequency support.
159
160config S3C2410_CPUFREQ_UTILS
161 bool
162 depends on CPU_FREQ_S3C24XX
163 help
164 Internal node to select timing code that is common to the s3c2410
165 and s3c2440/s3c244 cpu frequency support.
166
167# cpu frequency support common to s3c2412, s3c2413 and s3c2442
168
169config S3C2412_IOTIMING
170 bool
171 depends on CPU_FREQ_S3C24XX && (CPU_S3C2412 || CPU_S3C2443)
172 help
173 Intel node to select io timing code that is common to the s3c2412
174 and the s3c2443.
175
110config MACH_SMDK 176config MACH_SMDK
111 bool 177 bool
112 help 178 help
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 579a165c2827..7780d2dd833a 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -20,19 +20,28 @@ obj-y += gpiolib.o
20obj-y += clock.o 20obj-y += clock.o
21obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o 21obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o
22 22
23obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpu-freq.o
24obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o
25
23# Architecture dependant builds 26# Architecture dependant builds
24 27
25obj-$(CONFIG_CPU_S3C244X) += s3c244x.o 28obj-$(CONFIG_CPU_S3C244X) += s3c244x.o
26obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o 29obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o
27obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o 30obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o
31obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o
32obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o
33obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o
34
28obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o 35obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
29obj-$(CONFIG_PM) += pm.o 36obj-$(CONFIG_PM) += pm.o
30obj-$(CONFIG_PM) += irq-pm.o 37obj-$(CONFIG_PM) += irq-pm.o
31obj-$(CONFIG_PM) += sleep.o 38obj-$(CONFIG_PM) += sleep.o
32obj-$(CONFIG_S3C24XX_PWM) += pwm.o
33obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 39obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
34obj-$(CONFIG_S3C2410_DMA) += dma.o 40obj-$(CONFIG_S3C2410_DMA) += dma.o
35obj-$(CONFIG_S3C24XX_ADC) += adc.o 41obj-$(CONFIG_S3C24XX_ADC) += adc.o
42obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
43obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o
44obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o
36 45
37# device specific setup and/or initialisation 46# device specific setup and/or initialisation
38obj-$(CONFIG_ARCH_S3C2410) += setup-i2c.o 47obj-$(CONFIG_ARCH_S3C2410) += setup-i2c.o
@@ -41,6 +50,7 @@ obj-$(CONFIG_ARCH_S3C2410) += setup-i2c.o
41 50
42obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o 51obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o
43obj-$(CONFIG_S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7) += spi-bus1-gpg5_6_7.o 52obj-$(CONFIG_S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7) += spi-bus1-gpg5_6_7.o
53obj-$(CONFIG_S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10) += spi-bus1-gpd8_9_10.o
44 54
45# machine common support 55# machine common support
46 56
diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c
index ee1baf11ad9e..11117a7ba911 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-s3c24xx/adc.c
@@ -39,13 +39,16 @@
39struct s3c_adc_client { 39struct s3c_adc_client {
40 struct platform_device *pdev; 40 struct platform_device *pdev;
41 struct list_head pend; 41 struct list_head pend;
42 wait_queue_head_t *wait;
42 43
43 unsigned int nr_samples; 44 unsigned int nr_samples;
45 int result;
44 unsigned char is_ts; 46 unsigned char is_ts;
45 unsigned char channel; 47 unsigned char channel;
46 48
47 void (*select_cb)(unsigned selected); 49 void (*select_cb)(struct s3c_adc_client *c, unsigned selected);
48 void (*convert_cb)(unsigned val1, unsigned val2, 50 void (*convert_cb)(struct s3c_adc_client *c,
51 unsigned val1, unsigned val2,
49 unsigned *samples_left); 52 unsigned *samples_left);
50}; 53};
51 54
@@ -81,7 +84,7 @@ static inline void s3c_adc_select(struct adc_device *adc,
81{ 84{
82 unsigned con = readl(adc->regs + S3C2410_ADCCON); 85 unsigned con = readl(adc->regs + S3C2410_ADCCON);
83 86
84 client->select_cb(1); 87 client->select_cb(client, 1);
85 88
86 con &= ~S3C2410_ADCCON_MUXMASK; 89 con &= ~S3C2410_ADCCON_MUXMASK;
87 con &= ~S3C2410_ADCCON_STDBM; 90 con &= ~S3C2410_ADCCON_STDBM;
@@ -153,25 +156,61 @@ int s3c_adc_start(struct s3c_adc_client *client,
153} 156}
154EXPORT_SYMBOL_GPL(s3c_adc_start); 157EXPORT_SYMBOL_GPL(s3c_adc_start);
155 158
156static void s3c_adc_default_select(unsigned select) 159static void s3c_convert_done(struct s3c_adc_client *client,
160 unsigned v, unsigned u, unsigned *left)
161{
162 client->result = v;
163 wake_up(client->wait);
164}
165
166int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch)
167{
168 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wake);
169 int ret;
170
171 client->convert_cb = s3c_convert_done;
172 client->wait = &wake;
173 client->result = -1;
174
175 ret = s3c_adc_start(client, ch, 1);
176 if (ret < 0)
177 goto err;
178
179 ret = wait_event_timeout(wake, client->result >= 0, HZ / 2);
180 if (client->result < 0) {
181 ret = -ETIMEDOUT;
182 goto err;
183 }
184
185 client->convert_cb = NULL;
186 return client->result;
187
188err:
189 return ret;
190}
191EXPORT_SYMBOL_GPL(s3c_adc_convert);
192
193static void s3c_adc_default_select(struct s3c_adc_client *client,
194 unsigned select)
157{ 195{
158} 196}
159 197
160struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, 198struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev,
161 void (*select)(unsigned int selected), 199 void (*select)(struct s3c_adc_client *client,
162 void (*conv)(unsigned d0, unsigned d1, 200 unsigned int selected),
201 void (*conv)(struct s3c_adc_client *client,
202 unsigned d0, unsigned d1,
163 unsigned *samples_left), 203 unsigned *samples_left),
164 unsigned int is_ts) 204 unsigned int is_ts)
165{ 205{
166 struct s3c_adc_client *client; 206 struct s3c_adc_client *client;
167 207
168 WARN_ON(!pdev); 208 WARN_ON(!pdev);
169 WARN_ON(!conv);
170 209
171 if (!select) 210 if (!select)
172 select = s3c_adc_default_select; 211 select = s3c_adc_default_select;
173 212
174 if (!conv || !pdev) 213 if (!pdev)
175 return ERR_PTR(-EINVAL); 214 return ERR_PTR(-EINVAL);
176 215
177 client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL); 216 client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL);
@@ -230,16 +269,19 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
230 adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1); 269 adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1);
231 270
232 client->nr_samples--; 271 client->nr_samples--;
233 (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff, &client->nr_samples); 272
273 if (client->convert_cb)
274 (client->convert_cb)(client, data0 & 0x3ff, data1 & 0x3ff,
275 &client->nr_samples);
234 276
235 if (client->nr_samples > 0) { 277 if (client->nr_samples > 0) {
236 /* fire another conversion for this */ 278 /* fire another conversion for this */
237 279
238 client->select_cb(1); 280 client->select_cb(client, 1);
239 s3c_adc_convert(adc); 281 s3c_adc_convert(adc);
240 } else { 282 } else {
241 local_irq_save(flags); 283 local_irq_save(flags);
242 (client->select_cb)(0); 284 (client->select_cb)(client, 0);
243 adc->cur = NULL; 285 adc->cur = NULL;
244 286
245 s3c_adc_try(adc); 287 s3c_adc_try(adc);
diff --git a/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c b/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
new file mode 100644
index 000000000000..a9276667c2fb
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
@@ -0,0 +1,199 @@
1/* linux/arch/arm/plat-s3c24xx/cpu-freq-debugfs.c
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX CPU Frequency scaling - debugfs status support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/cpufreq.h>
19#include <linux/debugfs.h>
20#include <linux/seq_file.h>
21#include <linux/err.h>
22
23#include <plat/cpu-freq-core.h>
24
25static struct dentry *dbgfs_root;
26static struct dentry *dbgfs_file_io;
27static struct dentry *dbgfs_file_info;
28static struct dentry *dbgfs_file_board;
29
30#define print_ns(x) ((x) / 10), ((x) % 10)
31
32static void show_max(struct seq_file *seq, struct s3c_freq *f)
33{
34 seq_printf(seq, "MAX: F=%lu, H=%lu, P=%lu, A=%lu\n",
35 f->fclk, f->hclk, f->pclk, f->armclk);
36}
37
38static int board_show(struct seq_file *seq, void *p)
39{
40 struct s3c_cpufreq_config *cfg;
41 struct s3c_cpufreq_board *brd;
42
43 cfg = s3c_cpufreq_getconfig();
44 if (!cfg) {
45 seq_printf(seq, "no configuration registered\n");
46 return 0;
47 }
48
49 brd = cfg->board;
50 if (!brd) {
51 seq_printf(seq, "no board definition set?\n");
52 return 0;
53 }
54
55 seq_printf(seq, "SDRAM refresh %u ns\n", brd->refresh);
56 seq_printf(seq, "auto_io=%u\n", brd->auto_io);
57 seq_printf(seq, "need_io=%u\n", brd->need_io);
58
59 show_max(seq, &brd->max);
60
61
62 return 0;
63}
64
65static int fops_board_open(struct inode *inode, struct file *file)
66{
67 return single_open(file, board_show, NULL);
68}
69
70static const struct file_operations fops_board = {
71 .open = fops_board_open,
72 .read = seq_read,
73 .llseek = seq_lseek,
74 .release = single_release,
75 .owner = THIS_MODULE,
76};
77
78static int info_show(struct seq_file *seq, void *p)
79{
80 struct s3c_cpufreq_config *cfg;
81
82 cfg = s3c_cpufreq_getconfig();
83 if (!cfg) {
84 seq_printf(seq, "no configuration registered\n");
85 return 0;
86 }
87
88 seq_printf(seq, " FCLK %ld Hz\n", cfg->freq.fclk);
89 seq_printf(seq, " HCLK %ld Hz (%lu.%lu ns)\n",
90 cfg->freq.hclk, print_ns(cfg->freq.hclk_tns));
91 seq_printf(seq, " PCLK %ld Hz\n", cfg->freq.hclk);
92 seq_printf(seq, "ARMCLK %ld Hz\n", cfg->freq.armclk);
93 seq_printf(seq, "\n");
94
95 show_max(seq, &cfg->max);
96
97 seq_printf(seq, "Divisors: P=%d, H=%d, A=%d, dvs=%s\n",
98 cfg->divs.h_divisor, cfg->divs.p_divisor,
99 cfg->divs.arm_divisor, cfg->divs.dvs ? "on" : "off");
100 seq_printf(seq, "\n");
101
102 seq_printf(seq, "lock_pll=%u\n", cfg->lock_pll);
103
104 return 0;
105}
106
107static int fops_info_open(struct inode *inode, struct file *file)
108{
109 return single_open(file, info_show, NULL);
110}
111
112static const struct file_operations fops_info = {
113 .open = fops_info_open,
114 .read = seq_read,
115 .llseek = seq_lseek,
116 .release = single_release,
117 .owner = THIS_MODULE,
118};
119
120static int io_show(struct seq_file *seq, void *p)
121{
122 void (*show_bank)(struct seq_file *, struct s3c_cpufreq_config *, union s3c_iobank *);
123 struct s3c_cpufreq_config *cfg;
124 struct s3c_iotimings *iot;
125 union s3c_iobank *iob;
126 int bank;
127
128 cfg = s3c_cpufreq_getconfig();
129 if (!cfg) {
130 seq_printf(seq, "no configuration registered\n");
131 return 0;
132 }
133
134 show_bank = cfg->info->debug_io_show;
135 if (!show_bank) {
136 seq_printf(seq, "no code to show bank timing\n");
137 return 0;
138 }
139
140 iot = s3c_cpufreq_getiotimings();
141 if (!iot) {
142 seq_printf(seq, "no io timings registered\n");
143 return 0;
144 }
145
146 seq_printf(seq, "hclk period is %lu.%lu ns\n", print_ns(cfg->freq.hclk_tns));
147
148 for (bank = 0; bank < MAX_BANKS; bank++) {
149 iob = &iot->bank[bank];
150
151 seq_printf(seq, "bank %d: ", bank);
152
153 if (!iob->io_2410) {
154 seq_printf(seq, "nothing set\n");
155 continue;
156 }
157
158 show_bank(seq, cfg, iob);
159 }
160
161 return 0;
162}
163
164static int fops_io_open(struct inode *inode, struct file *file)
165{
166 return single_open(file, io_show, NULL);
167}
168
169static const struct file_operations fops_io = {
170 .open = fops_io_open,
171 .read = seq_read,
172 .llseek = seq_lseek,
173 .release = single_release,
174 .owner = THIS_MODULE,
175};
176
177
178static int __init s3c_freq_debugfs_init(void)
179{
180 dbgfs_root = debugfs_create_dir("s3c-cpufreq", NULL);
181 if (IS_ERR(dbgfs_root)) {
182 printk(KERN_ERR "%s: error creating debugfs root\n", __func__);
183 return PTR_ERR(dbgfs_root);
184 }
185
186 dbgfs_file_io = debugfs_create_file("io-timing", S_IRUGO, dbgfs_root,
187 NULL, &fops_io);
188
189 dbgfs_file_info = debugfs_create_file("info", S_IRUGO, dbgfs_root,
190 NULL, &fops_info);
191
192 dbgfs_file_board = debugfs_create_file("board", S_IRUGO, dbgfs_root,
193 NULL, &fops_board);
194
195 return 0;
196}
197
198late_initcall(s3c_freq_debugfs_init);
199
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
new file mode 100644
index 000000000000..4f1b789a1173
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -0,0 +1,716 @@
1/* linux/arch/arm/plat-s3c24xx/cpu-freq.c
2 *
3 * Copyright (c) 2006,2007,2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX CPU Frequency scaling
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/cpufreq.h>
19#include <linux/cpu.h>
20#include <linux/clk.h>
21#include <linux/err.h>
22#include <linux/io.h>
23#include <linux/sysdev.h>
24#include <linux/kobject.h>
25#include <linux/sysfs.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29
30#include <plat/cpu.h>
31#include <plat/clock.h>
32#include <plat/cpu-freq-core.h>
33
34#include <mach/regs-clock.h>
35
36/* note, cpufreq support deals in kHz, no Hz */
37
38static struct cpufreq_driver s3c24xx_driver;
39static struct s3c_cpufreq_config cpu_cur;
40static struct s3c_iotimings s3c24xx_iotiming;
41static struct cpufreq_frequency_table *pll_reg;
42static unsigned int last_target = ~0;
43static unsigned int ftab_size;
44static struct cpufreq_frequency_table *ftab;
45
46static struct clk *_clk_mpll;
47static struct clk *_clk_xtal;
48static struct clk *clk_fclk;
49static struct clk *clk_hclk;
50static struct clk *clk_pclk;
51static struct clk *clk_arm;
52
53#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS
54struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void)
55{
56 return &cpu_cur;
57}
58
59struct s3c_iotimings *s3c_cpufreq_getiotimings(void)
60{
61 return &s3c24xx_iotiming;
62}
63#endif /* CONFIG_CPU_FREQ_S3C24XX_DEBUGFS */
64
65static void s3c_cpufreq_getcur(struct s3c_cpufreq_config *cfg)
66{
67 unsigned long fclk, pclk, hclk, armclk;
68
69 cfg->freq.fclk = fclk = clk_get_rate(clk_fclk);
70 cfg->freq.hclk = hclk = clk_get_rate(clk_hclk);
71 cfg->freq.pclk = pclk = clk_get_rate(clk_pclk);
72 cfg->freq.armclk = armclk = clk_get_rate(clk_arm);
73
74 cfg->pll.index = __raw_readl(S3C2410_MPLLCON);
75 cfg->pll.frequency = fclk;
76
77 cfg->freq.hclk_tns = 1000000000 / (cfg->freq.hclk / 10);
78
79 cfg->divs.h_divisor = fclk / hclk;
80 cfg->divs.p_divisor = fclk / pclk;
81}
82
83static inline void s3c_cpufreq_calc(struct s3c_cpufreq_config *cfg)
84{
85 unsigned long pll = cfg->pll.frequency;
86
87 cfg->freq.fclk = pll;
88 cfg->freq.hclk = pll / cfg->divs.h_divisor;
89 cfg->freq.pclk = pll / cfg->divs.p_divisor;
90
91 /* convert hclk into 10ths of nanoseconds for io calcs */
92 cfg->freq.hclk_tns = 1000000000 / (cfg->freq.hclk / 10);
93}
94
95static inline int closer(unsigned int target, unsigned int n, unsigned int c)
96{
97 int diff_cur = abs(target - c);
98 int diff_new = abs(target - n);
99
100 return (diff_new < diff_cur);
101}
102
103static void s3c_cpufreq_show(const char *pfx,
104 struct s3c_cpufreq_config *cfg)
105{
106 s3c_freq_dbg("%s: Fvco=%u, F=%lu, A=%lu, H=%lu (%u), P=%lu (%u)\n",
107 pfx, cfg->pll.frequency, cfg->freq.fclk, cfg->freq.armclk,
108 cfg->freq.hclk, cfg->divs.h_divisor,
109 cfg->freq.pclk, cfg->divs.p_divisor);
110}
111
112/* functions to wrapper the driver info calls to do the cpu specific work */
113
114static void s3c_cpufreq_setio(struct s3c_cpufreq_config *cfg)
115{
116 if (cfg->info->set_iotiming)
117 (cfg->info->set_iotiming)(cfg, &s3c24xx_iotiming);
118}
119
120static int s3c_cpufreq_calcio(struct s3c_cpufreq_config *cfg)
121{
122 if (cfg->info->calc_iotiming)
123 return (cfg->info->calc_iotiming)(cfg, &s3c24xx_iotiming);
124
125 return 0;
126}
127
128static void s3c_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
129{
130 (cfg->info->set_refresh)(cfg);
131}
132
133static void s3c_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
134{
135 (cfg->info->set_divs)(cfg);
136}
137
138static int s3c_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
139{
140 return (cfg->info->calc_divs)(cfg);
141}
142
143static void s3c_cpufreq_setfvco(struct s3c_cpufreq_config *cfg)
144{
145 (cfg->info->set_fvco)(cfg);
146}
147
148static inline void s3c_cpufreq_resume_clocks(void)
149{
150 cpu_cur.info->resume_clocks();
151}
152
153static inline void s3c_cpufreq_updateclk(struct clk *clk,
154 unsigned int freq)
155{
156 clk_set_rate(clk, freq);
157}
158
159static int s3c_cpufreq_settarget(struct cpufreq_policy *policy,
160 unsigned int target_freq,
161 struct cpufreq_frequency_table *pll)
162{
163 struct s3c_cpufreq_freqs freqs;
164 struct s3c_cpufreq_config cpu_new;
165 unsigned long flags;
166
167 cpu_new = cpu_cur; /* copy new from current */
168
169 s3c_cpufreq_show("cur", &cpu_cur);
170
171 /* TODO - check for DMA currently outstanding */
172
173 cpu_new.pll = pll ? *pll : cpu_cur.pll;
174
175 if (pll)
176 freqs.pll_changing = 1;
177
178 /* update our frequencies */
179
180 cpu_new.freq.armclk = target_freq;
181 cpu_new.freq.fclk = cpu_new.pll.frequency;
182
183 if (s3c_cpufreq_calcdivs(&cpu_new) < 0) {
184 printk(KERN_ERR "no divisors for %d\n", target_freq);
185 goto err_notpossible;
186 }
187
188 s3c_freq_dbg("%s: got divs\n", __func__);
189
190 s3c_cpufreq_calc(&cpu_new);
191
192 s3c_freq_dbg("%s: calculated frequencies for new\n", __func__);
193
194 if (cpu_new.freq.hclk != cpu_cur.freq.hclk) {
195 if (s3c_cpufreq_calcio(&cpu_new) < 0) {
196 printk(KERN_ERR "%s: no IO timings\n", __func__);
197 goto err_notpossible;
198 }
199 }
200
201 s3c_cpufreq_show("new", &cpu_new);
202
203 /* setup our cpufreq parameters */
204
205 freqs.old = cpu_cur.freq;
206 freqs.new = cpu_new.freq;
207
208 freqs.freqs.cpu = 0;
209 freqs.freqs.old = cpu_cur.freq.armclk / 1000;
210 freqs.freqs.new = cpu_new.freq.armclk / 1000;
211
212 /* update f/h/p clock settings before we issue the change
213 * notification, so that drivers do not need to do anything
214 * special if they want to recalculate on CPUFREQ_PRECHANGE. */
215
216 s3c_cpufreq_updateclk(_clk_mpll, cpu_new.pll.frequency);
217 s3c_cpufreq_updateclk(clk_fclk, cpu_new.freq.fclk);
218 s3c_cpufreq_updateclk(clk_hclk, cpu_new.freq.hclk);
219 s3c_cpufreq_updateclk(clk_pclk, cpu_new.freq.pclk);
220
221 /* start the frequency change */
222
223 if (policy)
224 cpufreq_notify_transition(&freqs.freqs, CPUFREQ_PRECHANGE);
225
226 /* If hclk is staying the same, then we do not need to
227 * re-write the IO or the refresh timings whilst we are changing
228 * speed. */
229
230 local_irq_save(flags);
231
232 /* is our memory clock slowing down? */
233 if (cpu_new.freq.hclk < cpu_cur.freq.hclk) {
234 s3c_cpufreq_setrefresh(&cpu_new);
235 s3c_cpufreq_setio(&cpu_new);
236 }
237
238 if (cpu_new.freq.fclk == cpu_cur.freq.fclk) {
239 /* not changing PLL, just set the divisors */
240
241 s3c_cpufreq_setdivs(&cpu_new);
242 } else {
243 if (cpu_new.freq.fclk < cpu_cur.freq.fclk) {
244 /* slow the cpu down, then set divisors */
245
246 s3c_cpufreq_setfvco(&cpu_new);
247 s3c_cpufreq_setdivs(&cpu_new);
248 } else {
249 /* set the divisors, then speed up */
250
251 s3c_cpufreq_setdivs(&cpu_new);
252 s3c_cpufreq_setfvco(&cpu_new);
253 }
254 }
255
256 /* did our memory clock speed up */
257 if (cpu_new.freq.hclk > cpu_cur.freq.hclk) {
258 s3c_cpufreq_setrefresh(&cpu_new);
259 s3c_cpufreq_setio(&cpu_new);
260 }
261
262 /* update our current settings */
263 cpu_cur = cpu_new;
264
265 local_irq_restore(flags);
266
267 /* notify everyone we've done this */
268 if (policy)
269 cpufreq_notify_transition(&freqs.freqs, CPUFREQ_POSTCHANGE);
270
271 s3c_freq_dbg("%s: finished\n", __func__);
272 return 0;
273
274 err_notpossible:
275 printk(KERN_ERR "no compatible settings for %d\n", target_freq);
276 return -EINVAL;
277}
278
279/* s3c_cpufreq_target
280 *
281 * called by the cpufreq core to adjust the frequency that the CPU
282 * is currently running at.
283 */
284
285static int s3c_cpufreq_target(struct cpufreq_policy *policy,
286 unsigned int target_freq,
287 unsigned int relation)
288{
289 struct cpufreq_frequency_table *pll;
290 unsigned int index;
291
292 /* avoid repeated calls which cause a needless amout of duplicated
293 * logging output (and CPU time as the calculation process is
294 * done) */
295 if (target_freq == last_target)
296 return 0;
297
298 last_target = target_freq;
299
300 s3c_freq_dbg("%s: policy %p, target %u, relation %u\n",
301 __func__, policy, target_freq, relation);
302
303 if (ftab) {
304 if (cpufreq_frequency_table_target(policy, ftab,
305 target_freq, relation,
306 &index)) {
307 s3c_freq_dbg("%s: table failed\n", __func__);
308 return -EINVAL;
309 }
310
311 s3c_freq_dbg("%s: adjust %d to entry %d (%u)\n", __func__,
312 target_freq, index, ftab[index].frequency);
313 target_freq = ftab[index].frequency;
314 }
315
316 target_freq *= 1000; /* convert target to Hz */
317
318 /* find the settings for our new frequency */
319
320 if (!pll_reg || cpu_cur.lock_pll) {
321 /* either we've not got any PLL values, or we've locked
322 * to the current one. */
323 pll = NULL;
324 } else {
325 struct cpufreq_policy tmp_policy;
326 int ret;
327
328 /* we keep the cpu pll table in Hz, to ensure we get an
329 * accurate value for the PLL output. */
330
331 tmp_policy.min = policy->min * 1000;
332 tmp_policy.max = policy->max * 1000;
333 tmp_policy.cpu = policy->cpu;
334
335 /* cpufreq_frequency_table_target uses a pointer to 'index'
336 * which is the number of the table entry, not the value of
337 * the table entry's index field. */
338
339 ret = cpufreq_frequency_table_target(&tmp_policy, pll_reg,
340 target_freq, relation,
341 &index);
342
343 if (ret < 0) {
344 printk(KERN_ERR "%s: no PLL available\n", __func__);
345 goto err_notpossible;
346 }
347
348 pll = pll_reg + index;
349
350 s3c_freq_dbg("%s: target %u => %u\n",
351 __func__, target_freq, pll->frequency);
352
353 target_freq = pll->frequency;
354 }
355
356 return s3c_cpufreq_settarget(policy, target_freq, pll);
357
358 err_notpossible:
359 printk(KERN_ERR "no compatible settings for %d\n", target_freq);
360 return -EINVAL;
361}
362
363static unsigned int s3c_cpufreq_get(unsigned int cpu)
364{
365 return clk_get_rate(clk_arm) / 1000;
366}
367
368struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name)
369{
370 struct clk *clk;
371
372 clk = clk_get(dev, name);
373 if (IS_ERR(clk))
374 printk(KERN_ERR "cpufreq: failed to get clock '%s'\n", name);
375
376 return clk;
377}
378
379static int s3c_cpufreq_init(struct cpufreq_policy *policy)
380{
381 printk(KERN_INFO "%s: initialising policy %p\n", __func__, policy);
382
383 if (policy->cpu != 0)
384 return -EINVAL;
385
386 policy->cur = s3c_cpufreq_get(0);
387 policy->min = policy->cpuinfo.min_freq = 0;
388 policy->max = policy->cpuinfo.max_freq = cpu_cur.info->max.fclk / 1000;
389 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
390
391 /* feed the latency information from the cpu driver */
392 policy->cpuinfo.transition_latency = cpu_cur.info->latency;
393
394 if (ftab)
395 cpufreq_frequency_table_cpuinfo(policy, ftab);
396
397 return 0;
398}
399
400static __init int s3c_cpufreq_initclks(void)
401{
402 _clk_mpll = s3c_cpufreq_clk_get(NULL, "mpll");
403 _clk_xtal = s3c_cpufreq_clk_get(NULL, "xtal");
404 clk_fclk = s3c_cpufreq_clk_get(NULL, "fclk");
405 clk_hclk = s3c_cpufreq_clk_get(NULL, "hclk");
406 clk_pclk = s3c_cpufreq_clk_get(NULL, "pclk");
407 clk_arm = s3c_cpufreq_clk_get(NULL, "armclk");
408
409 if (IS_ERR(clk_fclk) || IS_ERR(clk_hclk) || IS_ERR(clk_pclk) ||
410 IS_ERR(_clk_mpll) || IS_ERR(clk_arm) || IS_ERR(_clk_xtal)) {
411 printk(KERN_ERR "%s: could not get clock(s)\n", __func__);
412 return -ENOENT;
413 }
414
415 printk(KERN_INFO "%s: clocks f=%lu,h=%lu,p=%lu,a=%lu\n", __func__,
416 clk_get_rate(clk_fclk) / 1000,
417 clk_get_rate(clk_hclk) / 1000,
418 clk_get_rate(clk_pclk) / 1000,
419 clk_get_rate(clk_arm) / 1000);
420
421 return 0;
422}
423
424static int s3c_cpufreq_verify(struct cpufreq_policy *policy)
425{
426 if (policy->cpu != 0)
427 return -EINVAL;
428
429 return 0;
430}
431
432#ifdef CONFIG_PM
433static struct cpufreq_frequency_table suspend_pll;
434static unsigned int suspend_freq;
435
436static int s3c_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
437{
438 suspend_pll.frequency = clk_get_rate(_clk_mpll);
439 suspend_pll.index = __raw_readl(S3C2410_MPLLCON);
440 suspend_freq = s3c_cpufreq_get(0) * 1000;
441
442 return 0;
443}
444
445static int s3c_cpufreq_resume(struct cpufreq_policy *policy)
446{
447 int ret;
448
449 s3c_freq_dbg("%s: resuming with policy %p\n", __func__, policy);
450
451 last_target = ~0; /* invalidate last_target setting */
452
453 /* first, find out what speed we resumed at. */
454 s3c_cpufreq_resume_clocks();
455
456 /* whilst we will be called later on, we try and re-set the
457 * cpu frequencies as soon as possible so that we do not end
458 * up resuming devices and then immediatley having to re-set
459 * a number of settings once these devices have restarted.
460 *
461 * as a note, it is expected devices are not used until they
462 * have been un-suspended and at that time they should have
463 * used the updated clock settings.
464 */
465
466 ret = s3c_cpufreq_settarget(NULL, suspend_freq, &suspend_pll);
467 if (ret) {
468 printk(KERN_ERR "%s: failed to reset pll/freq\n", __func__);
469 return ret;
470 }
471
472 return 0;
473}
474#else
475#define s3c_cpufreq_resume NULL
476#define s3c_cpufreq_suspend NULL
477#endif
478
479static struct cpufreq_driver s3c24xx_driver = {
480 .flags = CPUFREQ_STICKY,
481 .verify = s3c_cpufreq_verify,
482 .target = s3c_cpufreq_target,
483 .get = s3c_cpufreq_get,
484 .init = s3c_cpufreq_init,
485 .suspend = s3c_cpufreq_suspend,
486 .resume = s3c_cpufreq_resume,
487 .name = "s3c24xx",
488};
489
490
491int __init s3c_cpufreq_register(struct s3c_cpufreq_info *info)
492{
493 if (!info || !info->name) {
494 printk(KERN_ERR "%s: failed to pass valid information\n",
495 __func__);
496 return -EINVAL;
497 }
498
499 printk(KERN_INFO "S3C24XX CPU Frequency driver, %s cpu support\n",
500 info->name);
501
502 /* check our driver info has valid data */
503
504 BUG_ON(info->set_refresh == NULL);
505 BUG_ON(info->set_divs == NULL);
506 BUG_ON(info->calc_divs == NULL);
507
508 /* info->set_fvco is optional, depending on whether there
509 * is a need to set the clock code. */
510
511 cpu_cur.info = info;
512
513 /* Note, driver registering should probably update locktime */
514
515 return 0;
516}
517
518int __init s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
519{
520 struct s3c_cpufreq_board *ours;
521
522 if (!board) {
523 printk(KERN_INFO "%s: no board data\n", __func__);
524 return -EINVAL;
525 }
526
527 /* Copy the board information so that each board can make this
528 * initdata. */
529
530 ours = kzalloc(sizeof(struct s3c_cpufreq_board), GFP_KERNEL);
531 if (ours == NULL) {
532 printk(KERN_ERR "%s: no memory\n", __func__);
533 return -ENOMEM;
534 }
535
536 *ours = *board;
537 cpu_cur.board = ours;
538
539 return 0;
540}
541
542int __init s3c_cpufreq_auto_io(void)
543{
544 int ret;
545
546 if (!cpu_cur.info->get_iotiming) {
547 printk(KERN_ERR "%s: get_iotiming undefined\n", __func__);
548 return -ENOENT;
549 }
550
551 printk(KERN_INFO "%s: working out IO settings\n", __func__);
552
553 ret = (cpu_cur.info->get_iotiming)(&cpu_cur, &s3c24xx_iotiming);
554 if (ret)
555 printk(KERN_ERR "%s: failed to get timings\n", __func__);
556
557 return ret;
558}
559
560/* if one or is zero, then return the other, otherwise return the min */
561#define do_min(_a, _b) ((_a) == 0 ? (_b) : (_b) == 0 ? (_a) : min(_a, _b))
562
563/**
564 * s3c_cpufreq_freq_min - find the minimum settings for the given freq.
565 * @dst: The destination structure
566 * @a: One argument.
567 * @b: The other argument.
568 *
569 * Create a minimum of each frequency entry in the 'struct s3c_freq',
570 * unless the entry is zero when it is ignored and the non-zero argument
571 * used.
572 */
573static void s3c_cpufreq_freq_min(struct s3c_freq *dst,
574 struct s3c_freq *a, struct s3c_freq *b)
575{
576 dst->fclk = do_min(a->fclk, b->fclk);
577 dst->hclk = do_min(a->hclk, b->hclk);
578 dst->pclk = do_min(a->pclk, b->pclk);
579 dst->armclk = do_min(a->armclk, b->armclk);
580}
581
582static inline u32 calc_locktime(u32 freq, u32 time_us)
583{
584 u32 result;
585
586 result = freq * time_us;
587 result = DIV_ROUND_UP(result, 1000 * 1000);
588
589 return result;
590}
591
592static void s3c_cpufreq_update_loctkime(void)
593{
594 unsigned int bits = cpu_cur.info->locktime_bits;
595 u32 rate = (u32)clk_get_rate(_clk_xtal);
596 u32 val;
597
598 if (bits == 0) {
599 WARN_ON(1);
600 return;
601 }
602
603 val = calc_locktime(rate, cpu_cur.info->locktime_u) << bits;
604 val |= calc_locktime(rate, cpu_cur.info->locktime_m);
605
606 printk(KERN_INFO "%s: new locktime is 0x%08x\n", __func__, val);
607 __raw_writel(val, S3C2410_LOCKTIME);
608}
609
610static int s3c_cpufreq_build_freq(void)
611{
612 int size, ret;
613
614 if (!cpu_cur.info->calc_freqtable)
615 return -EINVAL;
616
617 kfree(ftab);
618 ftab = NULL;
619
620 size = cpu_cur.info->calc_freqtable(&cpu_cur, NULL, 0);
621 size++;
622
623 ftab = kmalloc(sizeof(struct cpufreq_frequency_table) * size, GFP_KERNEL);
624 if (!ftab) {
625 printk(KERN_ERR "%s: no memory for tables\n", __func__);
626 return -ENOMEM;
627 }
628
629 ftab_size = size;
630
631 ret = cpu_cur.info->calc_freqtable(&cpu_cur, ftab, size);
632 s3c_cpufreq_addfreq(ftab, ret, size, CPUFREQ_TABLE_END);
633
634 return 0;
635}
636
637static int __init s3c_cpufreq_initcall(void)
638{
639 int ret = 0;
640
641 if (cpu_cur.info && cpu_cur.board) {
642 ret = s3c_cpufreq_initclks();
643 if (ret)
644 goto out;
645
646 /* get current settings */
647 s3c_cpufreq_getcur(&cpu_cur);
648 s3c_cpufreq_show("cur", &cpu_cur);
649
650 if (cpu_cur.board->auto_io) {
651 ret = s3c_cpufreq_auto_io();
652 if (ret) {
653 printk(KERN_ERR "%s: failed to get io timing\n",
654 __func__);
655 goto out;
656 }
657 }
658
659 if (cpu_cur.board->need_io && !cpu_cur.info->set_iotiming) {
660 printk(KERN_ERR "%s: no IO support registered\n",
661 __func__);
662 ret = -EINVAL;
663 goto out;
664 }
665
666 if (!cpu_cur.info->need_pll)
667 cpu_cur.lock_pll = 1;
668
669 s3c_cpufreq_update_loctkime();
670
671 s3c_cpufreq_freq_min(&cpu_cur.max, &cpu_cur.board->max,
672 &cpu_cur.info->max);
673
674 if (cpu_cur.info->calc_freqtable)
675 s3c_cpufreq_build_freq();
676
677 ret = cpufreq_register_driver(&s3c24xx_driver);
678 }
679
680 out:
681 return ret;
682}
683
684late_initcall(s3c_cpufreq_initcall);
685
686/**
687 * s3c_plltab_register - register CPU PLL table.
688 * @plls: The list of PLL entries.
689 * @plls_no: The size of the PLL entries @plls.
690 *
691 * Register the given set of PLLs with the system.
692 */
693int __init s3c_plltab_register(struct cpufreq_frequency_table *plls,
694 unsigned int plls_no)
695{
696 struct cpufreq_frequency_table *vals;
697 unsigned int size;
698
699 size = sizeof(struct cpufreq_frequency_table) * (plls_no + 1);
700
701 vals = kmalloc(size, GFP_KERNEL);
702 if (vals) {
703 memcpy(vals, plls, size);
704 pll_reg = vals;
705
706 /* write a terminating entry, we don't store it in the
707 * table that is stored in the kernel */
708 vals += plls_no;
709 vals->frequency = CPUFREQ_TABLE_END;
710
711 printk(KERN_INFO "cpufreq: %d PLL entries\n", plls_no);
712 } else
713 printk(KERN_ERR "cpufreq: no memory for PLL tables\n");
714
715 return vals ? 0 : -ENOMEM;
716}
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 1932b7e0da15..5447e60f3936 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -81,7 +81,7 @@ static struct cpu_table cpu_ids[] __initdata = {
81 .map_io = s3c2410_map_io, 81 .map_io = s3c2410_map_io,
82 .init_clocks = s3c2410_init_clocks, 82 .init_clocks = s3c2410_init_clocks,
83 .init_uarts = s3c2410_init_uarts, 83 .init_uarts = s3c2410_init_uarts,
84 .init = s3c2410_init, 84 .init = s3c2410a_init,
85 .name = name_s3c2410a 85 .name = name_s3c2410a
86 }, 86 },
87 { 87 {
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 4eb378c89a39..f52a92ce8dda 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -26,6 +26,8 @@
26#include <asm/mach/irq.h> 26#include <asm/mach/irq.h>
27#include <mach/fb.h> 27#include <mach/fb.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/dma.h>
30#include <mach/irqs.h>
29#include <asm/irq.h> 31#include <asm/irq.h>
30 32
31#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
@@ -180,25 +182,6 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
180 } 182 }
181} 183}
182 184
183/* NAND Controller */
184
185static struct resource s3c_nand_resource[] = {
186 [0] = {
187 .start = S3C24XX_PA_NAND,
188 .end = S3C24XX_PA_NAND + S3C24XX_SZ_NAND - 1,
189 .flags = IORESOURCE_MEM,
190 }
191};
192
193struct platform_device s3c_device_nand = {
194 .name = "s3c2410-nand",
195 .id = -1,
196 .num_resources = ARRAY_SIZE(s3c_nand_resource),
197 .resource = s3c_nand_resource,
198};
199
200EXPORT_SYMBOL(s3c_device_nand);
201
202/* USB Device (Gadget)*/ 185/* USB Device (Gadget)*/
203 186
204static struct resource s3c_usbgadget_resource[] = { 187static struct resource s3c_usbgadget_resource[] = {
@@ -348,7 +331,7 @@ struct platform_device s3c_device_adc = {
348/* HWMON */ 331/* HWMON */
349 332
350struct platform_device s3c_device_hwmon = { 333struct platform_device s3c_device_hwmon = {
351 .name = "s3c24xx-hwmon", 334 .name = "s3c-hwmon",
352 .id = -1, 335 .id = -1,
353 .dev.parent = &s3c_device_adc.dev, 336 .dev.parent = &s3c_device_adc.dev,
354}; 337};
@@ -473,4 +456,52 @@ struct platform_device s3c_device_camif = {
473 456
474EXPORT_SYMBOL(s3c_device_camif); 457EXPORT_SYMBOL(s3c_device_camif);
475 458
459/* AC97 */
460
461static struct resource s3c_ac97_resource[] = {
462 [0] = {
463 .start = S3C2440_PA_AC97,
464 .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1,
465 .flags = IORESOURCE_MEM,
466 },
467 [1] = {
468 .start = IRQ_S3C244x_AC97,
469 .end = IRQ_S3C244x_AC97,
470 .flags = IORESOURCE_IRQ,
471 },
472 [2] = {
473 .name = "PCM out",
474 .start = DMACH_PCM_OUT,
475 .end = DMACH_PCM_OUT,
476 .flags = IORESOURCE_DMA,
477 },
478 [3] = {
479 .name = "PCM in",
480 .start = DMACH_PCM_IN,
481 .end = DMACH_PCM_IN,
482 .flags = IORESOURCE_DMA,
483 },
484 [4] = {
485 .name = "Mic in",
486 .start = DMACH_MIC_IN,
487 .end = DMACH_MIC_IN,
488 .flags = IORESOURCE_DMA,
489 },
490};
491
492static u64 s3c_device_ac97_dmamask = 0xffffffffUL;
493
494struct platform_device s3c_device_ac97 = {
495 .name = "s3c-ac97",
496 .id = -1,
497 .num_resources = ARRAY_SIZE(s3c_ac97_resource),
498 .resource = s3c_ac97_resource,
499 .dev = {
500 .dma_mask = &s3c_device_ac97_dmamask,
501 .coherent_dma_mask = 0xffffffffUL
502 }
503};
504
505EXPORT_SYMBOL(s3c_device_ac97);
506
476#endif // CONFIG_CPU_S32440 507#endif // CONFIG_CPU_S32440
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
new file mode 100644
index 000000000000..efeb025affc7
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
@@ -0,0 +1,282 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h
2 *
3 * Copyright (c) 2006,2007,2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C CPU frequency scaling support - core support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <plat/cpu-freq.h>
15
16struct seq_file;
17
18#define MAX_BANKS (8)
19#define S3C2412_MAX_IO (8)
20
21/**
22 * struct s3c2410_iobank_timing - IO bank timings for S3C2410 style timings
23 * @bankcon: The cached version of settings in this structure.
24 * @tacp:
25 * @tacs: Time from address valid to nCS asserted.
26 * @tcos: Time from nCS asserted to nOE or nWE asserted.
27 * @tacc: Time that nOE or nWE is asserted.
28 * @tcoh: Time nCS is held after nOE or nWE are released.
29 * @tcah: Time address is held for after
30 * @nwait_en: Whether nWAIT is enabled for this bank.
31 *
32 * This structure represents the IO timings for a S3C2410 style IO bank
33 * used by the CPU frequency support if it needs to change the settings
34 * of the IO.
35 */
36struct s3c2410_iobank_timing {
37 unsigned long bankcon;
38 unsigned int tacp;
39 unsigned int tacs;
40 unsigned int tcos;
41 unsigned int tacc;
42 unsigned int tcoh; /* nCS hold afrer nOE/nWE */
43 unsigned int tcah; /* Address hold after nCS */
44 unsigned char nwait_en; /* nWait enabled for bank. */
45};
46
47/**
48 * struct s3c2412_iobank_timing - io timings for PL092 (S3C2412) style IO
49 * @idcy: The idle cycle time between transactions.
50 * @wstrd: nCS release to end of read cycle.
51 * @wstwr: nCS release to end of write cycle.
52 * @wstoen: nCS assertion to nOE assertion time.
53 * @wstwen: nCS assertion to nWE assertion time.
54 * @wstbrd: Burst ready delay.
55 * @smbidcyr: Register cache for smbidcyr value.
56 * @smbwstrd: Register cache for smbwstrd value.
57 * @smbwstwr: Register cache for smbwstwr value.
58 * @smbwstoen: Register cache for smbwstoen value.
59 * @smbwstwen: Register cache for smbwstwen value.
60 * @smbwstbrd: Register cache for smbwstbrd value.
61 *
62 * Timing information for a IO bank on an S3C2412 or similar system which
63 * uses a PL093 block.
64 */
65struct s3c2412_iobank_timing {
66 unsigned int idcy;
67 unsigned int wstrd;
68 unsigned int wstwr;
69 unsigned int wstoen;
70 unsigned int wstwen;
71 unsigned int wstbrd;
72
73 /* register cache */
74 unsigned char smbidcyr;
75 unsigned char smbwstrd;
76 unsigned char smbwstwr;
77 unsigned char smbwstoen;
78 unsigned char smbwstwen;
79 unsigned char smbwstbrd;
80};
81
82union s3c_iobank {
83 struct s3c2410_iobank_timing *io_2410;
84 struct s3c2412_iobank_timing *io_2412;
85};
86
87/**
88 * struct s3c_iotimings - Chip IO timings holder
89 * @bank: The timings for each IO bank.
90 */
91struct s3c_iotimings {
92 union s3c_iobank bank[MAX_BANKS];
93};
94
95/**
96 * struct s3c_plltab - PLL table information.
97 * @vals: List of PLL values.
98 * @size: Size of the PLL table @vals.
99 */
100struct s3c_plltab {
101 struct s3c_pllval *vals;
102 int size;
103};
104
105/**
106 * struct s3c_cpufreq_config - current cpu frequency configuration
107 * @freq: The current settings for the core clocks.
108 * @max: Maxium settings, derived from core, board and user settings.
109 * @pll: The PLL table entry for the current PLL settings.
110 * @divs: The divisor settings for the core clocks.
111 * @info: The current core driver information.
112 * @board: The information for the board we are running on.
113 * @lock_pll: Set if the PLL settings cannot be changed.
114 *
115 * This is for the core drivers that need to know information about
116 * the current settings and values. It should not be needed by any
117 * device drivers.
118*/
119struct s3c_cpufreq_config {
120 struct s3c_freq freq;
121 struct s3c_freq max;
122 struct cpufreq_frequency_table pll;
123 struct s3c_clkdivs divs;
124 struct s3c_cpufreq_info *info; /* for core, not drivers */
125 struct s3c_cpufreq_board *board;
126
127 unsigned int lock_pll:1;
128};
129
130/**
131 * struct s3c_cpufreq_info - Information for the CPU frequency driver.
132 * @name: The name of this implementation.
133 * @max: The maximum frequencies for the system.
134 * @latency: Transition latency to give to cpufreq.
135 * @locktime_m: The lock-time in uS for the MPLL.
136 * @locktime_u: The lock-time in uS for the UPLL.
137 * @locttime_bits: The number of bits each LOCKTIME field.
138 * @need_pll: Set if this driver needs to change the PLL values to acheive
139 * any frequency changes. This is really only need by devices like the
140 * S3C2410 where there is no or limited divider between the PLL and the
141 * ARMCLK.
142 * @resume_clocks: Update the clocks on resume.
143 * @get_iotiming: Get the current IO timing data, mainly for use at start.
144 * @set_iotiming: Update the IO timings from the cached copies calculated
145 * from the @calc_iotiming entry when changing the frequency.
146 * @calc_iotiming: Calculate and update the cached copies of the IO timings
147 * from the newly calculated frequencies.
148 * @calc_freqtable: Calculate (fill in) the given frequency table from the
149 * current frequency configuration. If the table passed in is NULL,
150 * then the return is the number of elements to be filled for allocation
151 * of the table.
152 * @set_refresh: Set the memory refresh configuration.
153 * @set_fvco: Set the PLL frequencies.
154 * @set_divs: Update the clock divisors.
155 * @calc_divs: Calculate the clock divisors.
156 */
157struct s3c_cpufreq_info {
158 const char *name;
159 struct s3c_freq max;
160
161 unsigned int latency;
162
163 unsigned int locktime_m;
164 unsigned int locktime_u;
165 unsigned char locktime_bits;
166
167 unsigned int need_pll:1;
168
169 /* driver routines */
170
171 void (*resume_clocks)(void);
172
173 int (*get_iotiming)(struct s3c_cpufreq_config *cfg,
174 struct s3c_iotimings *timings);
175
176 void (*set_iotiming)(struct s3c_cpufreq_config *cfg,
177 struct s3c_iotimings *timings);
178
179 int (*calc_iotiming)(struct s3c_cpufreq_config *cfg,
180 struct s3c_iotimings *timings);
181
182 int (*calc_freqtable)(struct s3c_cpufreq_config *cfg,
183 struct cpufreq_frequency_table *t,
184 size_t table_size);
185
186 void (*debug_io_show)(struct seq_file *seq,
187 struct s3c_cpufreq_config *cfg,
188 union s3c_iobank *iob);
189
190 void (*set_refresh)(struct s3c_cpufreq_config *cfg);
191 void (*set_fvco)(struct s3c_cpufreq_config *cfg);
192 void (*set_divs)(struct s3c_cpufreq_config *cfg);
193 int (*calc_divs)(struct s3c_cpufreq_config *cfg);
194};
195
196extern int s3c_cpufreq_register(struct s3c_cpufreq_info *info);
197
198extern int s3c_plltab_register(struct cpufreq_frequency_table *plls, unsigned int plls_no);
199
200/* exports and utilities for debugfs */
201extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void);
202extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void);
203
204extern void s3c2410_iotiming_debugfs(struct seq_file *seq,
205 struct s3c_cpufreq_config *cfg,
206 union s3c_iobank *iob);
207
208extern void s3c2412_iotiming_debugfs(struct seq_file *seq,
209 struct s3c_cpufreq_config *cfg,
210 union s3c_iobank *iob);
211
212#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS
213#define s3c_cpufreq_debugfs_call(x) x
214#else
215#define s3c_cpufreq_debugfs_call(x) NULL
216#endif
217
218/* Useful utility functions. */
219
220extern struct clk *s3c_cpufreq_clk_get(struct device *, const char *);
221
222/* S3C2410 and compatible exported functions */
223
224extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg);
225
226extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg,
227 struct s3c_iotimings *iot);
228
229extern int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg,
230 struct s3c_iotimings *timings);
231
232extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg,
233 struct s3c_iotimings *iot);
234
235extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg);
236
237/* S3C2412 compatible routines */
238
239extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
240 struct s3c_iotimings *timings);
241
242extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
243 struct s3c_iotimings *timings);
244
245extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg,
246 struct s3c_iotimings *iot);
247
248extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
249 struct s3c_iotimings *iot);
250
251#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG
252#define s3c_freq_dbg(x...) printk(KERN_INFO x)
253#else
254#define s3c_freq_dbg(x...) do { if (0) printk(x); } while (0)
255#endif /* CONFIG_CPU_FREQ_S3C24XX_DEBUG */
256
257#ifdef CONFIG_CPU_FREQ_S3C24XX_IODEBUG
258#define s3c_freq_iodbg(x...) printk(KERN_INFO x)
259#else
260#define s3c_freq_iodbg(x...) do { if (0) printk(x); } while (0)
261#endif /* CONFIG_CPU_FREQ_S3C24XX_IODEBUG */
262
263static inline int s3c_cpufreq_addfreq(struct cpufreq_frequency_table *table,
264 int index, size_t table_size,
265 unsigned int freq)
266{
267 if (index < 0)
268 return index;
269
270 if (table) {
271 if (index >= table_size)
272 return -ENOMEM;
273
274 s3c_freq_dbg("%s: { %d = %u kHz }\n",
275 __func__, index, freq);
276
277 table[index].index = index;
278 table[index].frequency = freq;
279 }
280
281 return index + 1;
282}
diff --git a/arch/arm/plat-s3c24xx/include/plat/fiq.h b/arch/arm/plat-s3c24xx/include/plat/fiq.h
new file mode 100644
index 000000000000..8521b8372c5f
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/include/plat/fiq.h
@@ -0,0 +1,13 @@
1/* linux/include/asm-arm/plat-s3c24xx/fiq.h
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU FIQ support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13extern int s3c24xx_set_fiq(unsigned int irq, bool on);
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
index a9ac9e29759e..b6deeef8f663 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
@@ -14,6 +14,7 @@
14#ifdef CONFIG_CPU_S3C2410 14#ifdef CONFIG_CPU_S3C2410
15 15
16extern int s3c2410_init(void); 16extern int s3c2410_init(void);
17extern int s3c2410a_init(void);
17 18
18extern void s3c2410_map_io(void); 19extern void s3c2410_map_io(void);
19 20
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index 958737775ad2..d02f5f02045e 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -493,6 +493,38 @@ s3c_irq_demux_extint4t7(unsigned int irq,
493 } 493 }
494} 494}
495 495
496#ifdef CONFIG_FIQ
497/**
498 * s3c24xx_set_fiq - set the FIQ routing
499 * @irq: IRQ number to route to FIQ on processor.
500 * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing.
501 *
502 * Change the state of the IRQ to FIQ routing depending on @irq and @on. If
503 * @on is true, the @irq is checked to see if it can be routed and the
504 * interrupt controller updated to route the IRQ. If @on is false, the FIQ
505 * routing is cleared, regardless of which @irq is specified.
506 */
507int s3c24xx_set_fiq(unsigned int irq, bool on)
508{
509 u32 intmod;
510 unsigned offs;
511
512 if (on) {
513 offs = irq - FIQ_START;
514 if (offs > 31)
515 return -EINVAL;
516
517 intmod = 1 << offs;
518 } else {
519 intmod = 0;
520 }
521
522 __raw_writel(intmod, S3C2410_INTMOD);
523 return 0;
524}
525#endif
526
527
496/* s3c24xx_init_irq 528/* s3c24xx_init_irq
497 * 529 *
498 * Initialise S3C2410 IRQ system 530 * Initialise S3C2410 IRQ system
@@ -505,6 +537,10 @@ void __init s3c24xx_init_irq(void)
505 int irqno; 537 int irqno;
506 int i; 538 int i;
507 539
540#ifdef CONFIG_FIQ
541 init_FIQ();
542#endif
543
508 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n"); 544 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
509 545
510 /* first, clear all interrupts pending... */ 546 /* first, clear all interrupts pending... */
diff --git a/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c b/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c
new file mode 100644
index 000000000000..43ea80190d87
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c
@@ -0,0 +1,64 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2410-cpufreq-utils.c
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX CPU Frequency scaling - utils for S3C2410/S3C2440/S3C2442
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/cpufreq.h>
17#include <linux/io.h>
18
19#include <mach/map.h>
20#include <mach/regs-mem.h>
21#include <mach/regs-clock.h>
22
23#include <plat/cpu-freq-core.h>
24
25/**
26 * s3c2410_cpufreq_setrefresh - set SDRAM refresh value
27 * @cfg: The frequency configuration
28 *
29 * Set the SDRAM refresh value appropriately for the configured
30 * frequency.
31 */
32void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
33{
34 struct s3c_cpufreq_board *board = cfg->board;
35 unsigned long refresh;
36 unsigned long refval;
37
38 /* Reduce both the refresh time (in ns) and the frequency (in MHz)
39 * down to ensure that we do not overflow 32 bit numbers.
40 *
41 * This should work for HCLK up to 133MHz and refresh period up
42 * to 30usec.
43 */
44
45 refresh = (cfg->freq.hclk / 100) * (board->refresh / 10);
46 refresh = DIV_ROUND_UP(refresh, (1000 * 1000)); /* apply scale */
47 refresh = (1 << 11) + 1 - refresh;
48
49 s3c_freq_dbg("%s: refresh value %lu\n", __func__, refresh);
50
51 refval = __raw_readl(S3C2410_REFRESH);
52 refval &= ~((1 << 12) - 1);
53 refval |= refresh;
54 __raw_writel(refval, S3C2410_REFRESH);
55}
56
57/**
58 * s3c2410_set_fvco - set the PLL value
59 * @cfg: The frequency configuration
60 */
61void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg)
62{
63 __raw_writel(cfg->pll.index, S3C2410_MPLLCON);
64}
diff --git a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
new file mode 100644
index 000000000000..d0a3a145cd4d
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
@@ -0,0 +1,477 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
2 *
3 * Copyright (c) 2006,2008,2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX CPU Frequency scaling - IO timing for S3C2410/S3C2440/S3C2442
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/cpufreq.h>
18#include <linux/seq_file.h>
19#include <linux/io.h>
20
21#include <mach/map.h>
22#include <mach/regs-mem.h>
23#include <mach/regs-clock.h>
24
25#include <plat/cpu-freq-core.h>
26
27#define print_ns(x) ((x) / 10), ((x) % 10)
28
29/**
30 * s3c2410_print_timing - print bank timing data for debug purposes
31 * @pfx: The prefix to put on the output
32 * @timings: The timing inforamtion to print.
33*/
34static void s3c2410_print_timing(const char *pfx,
35 struct s3c_iotimings *timings)
36{
37 struct s3c2410_iobank_timing *bt;
38 int bank;
39
40 for (bank = 0; bank < MAX_BANKS; bank++) {
41 bt = timings->bank[bank].io_2410;
42 if (!bt)
43 continue;
44
45 printk(KERN_DEBUG "%s %d: Tacs=%d.%d, Tcos=%d.%d, Tacc=%d.%d, "
46 "Tcoh=%d.%d, Tcah=%d.%d\n", pfx, bank,
47 print_ns(bt->tacs),
48 print_ns(bt->tcos),
49 print_ns(bt->tacc),
50 print_ns(bt->tcoh),
51 print_ns(bt->tcah));
52 }
53}
54
55/**
56 * bank_reg - convert bank number to pointer to the control register.
57 * @bank: The IO bank number.
58 */
59static inline void __iomem *bank_reg(unsigned int bank)
60{
61 return S3C2410_BANKCON0 + (bank << 2);
62}
63
64/**
65 * bank_is_io - test whether bank is used for IO
66 * @bankcon: The bank control register.
67 *
68 * This is a simplistic test to see if any BANKCON[x] is not an IO
69 * bank. It currently does not take into account whether BWSCON has
70 * an illegal width-setting in it, or if the pin connected to nCS[x]
71 * is actually being handled as a chip-select.
72 */
73static inline int bank_is_io(unsigned long bankcon)
74{
75 return !(bankcon & S3C2410_BANKCON_SDRAM);
76}
77
78/**
79 * to_div - convert cycle time to divisor
80 * @cyc: The cycle time, in 10ths of nanoseconds.
81 * @hclk_tns: The cycle time for HCLK, in 10ths of nanoseconds.
82 *
83 * Convert the given cycle time into the divisor to use to obtain it from
84 * HCLK.
85*/
86static inline unsigned int to_div(unsigned int cyc, unsigned int hclk_tns)
87{
88 if (cyc == 0)
89 return 0;
90
91 return DIV_ROUND_UP(cyc, hclk_tns);
92}
93
94/**
95 * calc_0124 - calculate divisor control for divisors that do /0, /1. /2 and /4
96 * @cyc: The cycle time, in 10ths of nanoseconds.
97 * @hclk_tns: The cycle time for HCLK, in 10ths of nanoseconds.
98 * @v: Pointer to register to alter.
99 * @shift: The shift to get to the control bits.
100 *
101 * Calculate the divisor, and turn it into the correct control bits to
102 * set in the result, @v.
103 */
104static unsigned int calc_0124(unsigned int cyc, unsigned long hclk_tns,
105 unsigned long *v, int shift)
106{
107 unsigned int div = to_div(cyc, hclk_tns);
108 unsigned long val;
109
110 s3c_freq_iodbg("%s: cyc=%d, hclk=%lu, shift=%d => div %d\n",
111 __func__, cyc, hclk_tns, shift, div);
112
113 switch (div) {
114 case 0:
115 val = 0;
116 break;
117 case 1:
118 val = 1;
119 break;
120 case 2:
121 val = 2;
122 break;
123 case 3:
124 case 4:
125 val = 3;
126 break;
127 default:
128 return -1;
129 }
130
131 *v |= val << shift;
132 return 0;
133}
134
135int calc_tacp(unsigned int cyc, unsigned long hclk, unsigned long *v)
136{
137 /* Currently no support for Tacp calculations. */
138 return 0;
139}
140
141/**
142 * calc_tacc - calculate divisor control for tacc.
143 * @cyc: The cycle time, in 10ths of nanoseconds.
144 * @nwait_en: IS nWAIT enabled for this bank.
145 * @hclk_tns: The cycle time for HCLK, in 10ths of nanoseconds.
146 * @v: Pointer to register to alter.
147 *
148 * Calculate the divisor control for tACC, taking into account whether
149 * the bank has nWAIT enabled. The result is used to modify the value
150 * pointed to by @v.
151*/
152static int calc_tacc(unsigned int cyc, int nwait_en,
153 unsigned long hclk_tns, unsigned long *v)
154{
155 unsigned int div = to_div(cyc, hclk_tns);
156 unsigned long val;
157
158 s3c_freq_iodbg("%s: cyc=%u, nwait=%d, hclk=%lu => div=%u\n",
159 __func__, cyc, nwait_en, hclk_tns, div);
160
161 /* if nWait enabled on an bank, Tacc must be at-least 4 cycles. */
162 if (nwait_en && div < 4)
163 div = 4;
164
165 switch (div) {
166 case 0:
167 val = 0;
168 break;
169
170 case 1:
171 case 2:
172 case 3:
173 case 4:
174 val = div - 1;
175 break;
176
177 case 5:
178 case 6:
179 val = 4;
180 break;
181
182 case 7:
183 case 8:
184 val = 5;
185 break;
186
187 case 9:
188 case 10:
189 val = 6;
190 break;
191
192 case 11:
193 case 12:
194 case 13:
195 case 14:
196 val = 7;
197 break;
198
199 default:
200 return -1;
201 }
202
203 *v |= val << 8;
204 return 0;
205}
206
207/**
208 * s3c2410_calc_bank - calculate bank timing infromation
209 * @cfg: The configuration we need to calculate for.
210 * @bt: The bank timing information.
211 *
212 * Given the cycle timine for a bank @bt, calculate the new BANKCON
213 * setting for the @cfg timing. This updates the timing information
214 * ready for the cpu frequency change.
215 */
216static int s3c2410_calc_bank(struct s3c_cpufreq_config *cfg,
217 struct s3c2410_iobank_timing *bt)
218{
219 unsigned long hclk = cfg->freq.hclk_tns;
220 unsigned long res;
221 int ret;
222
223 res = bt->bankcon;
224 res &= (S3C2410_BANKCON_SDRAM | S3C2410_BANKCON_PMC16);
225
226 /* tacp: 2,3,4,5 */
227 /* tcah: 0,1,2,4 */
228 /* tcoh: 0,1,2,4 */
229 /* tacc: 1,2,3,4,6,7,10,14 (>4 for nwait) */
230 /* tcos: 0,1,2,4 */
231 /* tacs: 0,1,2,4 */
232
233 ret = calc_0124(bt->tacs, hclk, &res, S3C2410_BANKCON_Tacs_SHIFT);
234 ret |= calc_0124(bt->tcos, hclk, &res, S3C2410_BANKCON_Tcos_SHIFT);
235 ret |= calc_0124(bt->tcah, hclk, &res, S3C2410_BANKCON_Tcah_SHIFT);
236 ret |= calc_0124(bt->tcoh, hclk, &res, S3C2410_BANKCON_Tcoh_SHIFT);
237
238 if (ret)
239 return -EINVAL;
240
241 ret |= calc_tacp(bt->tacp, hclk, &res);
242 ret |= calc_tacc(bt->tacc, bt->nwait_en, hclk, &res);
243
244 if (ret)
245 return -EINVAL;
246
247 bt->bankcon = res;
248 return 0;
249}
250
251static unsigned int tacc_tab[] = {
252 [0] = 1,
253 [1] = 2,
254 [2] = 3,
255 [3] = 4,
256 [4] = 6,
257 [5] = 9,
258 [6] = 10,
259 [7] = 14,
260};
261
262/**
263 * get_tacc - turn tACC value into cycle time
264 * @hclk_tns: The cycle time for HCLK, in 10ths of nanoseconds.
265 * @val: The bank timing register value, shifed down.
266 */
267static unsigned int get_tacc(unsigned long hclk_tns,
268 unsigned long val)
269{
270 val &= 7;
271 return hclk_tns * tacc_tab[val];
272}
273
274/**
275 * get_0124 - turn 0/1/2/4 divider into cycle time
276 * @hclk_tns: The cycle time for HCLK, in 10ths of nanoseconds.
277 * @val: The bank timing register value, shifed down.
278 */
279static unsigned int get_0124(unsigned long hclk_tns,
280 unsigned long val)
281{
282 val &= 3;
283 return hclk_tns * ((val == 3) ? 4 : val);
284}
285
286/**
287 * s3c2410_iotiming_getbank - turn BANKCON into cycle time information
288 * @cfg: The frequency configuration
289 * @bt: The bank timing to fill in (uses cached BANKCON)
290 *
291 * Given the BANKCON setting in @bt and the current frequency settings
292 * in @cfg, update the cycle timing information.
293 */
294void s3c2410_iotiming_getbank(struct s3c_cpufreq_config *cfg,
295 struct s3c2410_iobank_timing *bt)
296{
297 unsigned long bankcon = bt->bankcon;
298 unsigned long hclk = cfg->freq.hclk_tns;
299
300 bt->tcah = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcah_SHIFT);
301 bt->tcoh = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcoh_SHIFT);
302 bt->tcos = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcos_SHIFT);
303 bt->tacs = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tacs_SHIFT);
304 bt->tacc = get_tacc(hclk, bankcon >> S3C2410_BANKCON_Tacc_SHIFT);
305}
306
307/**
308 * s3c2410_iotiming_debugfs - debugfs show io bank timing information
309 * @seq: The seq_file to write output to using seq_printf().
310 * @cfg: The current configuration.
311 * @iob: The IO bank information to decode.
312 */
313void s3c2410_iotiming_debugfs(struct seq_file *seq,
314 struct s3c_cpufreq_config *cfg,
315 union s3c_iobank *iob)
316{
317 struct s3c2410_iobank_timing *bt = iob->io_2410;
318 unsigned long bankcon = bt->bankcon;
319 unsigned long hclk = cfg->freq.hclk_tns;
320 unsigned int tacs;
321 unsigned int tcos;
322 unsigned int tacc;
323 unsigned int tcoh;
324 unsigned int tcah;
325
326 seq_printf(seq, "BANKCON=0x%08lx\n", bankcon);
327
328 tcah = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcah_SHIFT);
329 tcoh = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcoh_SHIFT);
330 tcos = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tcos_SHIFT);
331 tacs = get_0124(hclk, bankcon >> S3C2410_BANKCON_Tacs_SHIFT);
332 tacc = get_tacc(hclk, bankcon >> S3C2410_BANKCON_Tacc_SHIFT);
333
334 seq_printf(seq,
335 "\tRead: Tacs=%d.%d, Tcos=%d.%d, Tacc=%d.%d, Tcoh=%d.%d, Tcah=%d.%d\n",
336 print_ns(bt->tacs),
337 print_ns(bt->tcos),
338 print_ns(bt->tacc),
339 print_ns(bt->tcoh),
340 print_ns(bt->tcah));
341
342 seq_printf(seq,
343 "\t Set: Tacs=%d.%d, Tcos=%d.%d, Tacc=%d.%d, Tcoh=%d.%d, Tcah=%d.%d\n",
344 print_ns(tacs),
345 print_ns(tcos),
346 print_ns(tacc),
347 print_ns(tcoh),
348 print_ns(tcah));
349}
350
351/**
352 * s3c2410_iotiming_calc - Calculate bank timing for frequency change.
353 * @cfg: The frequency configuration
354 * @iot: The IO timing information to fill out.
355 *
356 * Calculate the new values for the banks in @iot based on the new
357 * frequency information in @cfg. This is then used by s3c2410_iotiming_set()
358 * to update the timing when necessary.
359 */
360int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg,
361 struct s3c_iotimings *iot)
362{
363 struct s3c2410_iobank_timing *bt;
364 unsigned long bankcon;
365 int bank;
366 int ret;
367
368 for (bank = 0; bank < MAX_BANKS; bank++) {
369 bankcon = __raw_readl(bank_reg(bank));
370 bt = iot->bank[bank].io_2410;
371
372 if (!bt)
373 continue;
374
375 bt->bankcon = bankcon;
376
377 ret = s3c2410_calc_bank(cfg, bt);
378 if (ret) {
379 printk(KERN_ERR "%s: cannot calculate bank %d io\n",
380 __func__, bank);
381 goto err;
382 }
383
384 s3c_freq_iodbg("%s: bank %d: con=%08lx\n",
385 __func__, bank, bt->bankcon);
386 }
387
388 return 0;
389 err:
390 return ret;
391}
392
393/**
394 * s3c2410_iotiming_set - set the IO timings from the given setup.
395 * @cfg: The frequency configuration
396 * @iot: The IO timing information to use.
397 *
398 * Set all the currently used IO bank timing information generated
399 * by s3c2410_iotiming_calc() once the core has validated that all
400 * the new values are within permitted bounds.
401 */
402void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg,
403 struct s3c_iotimings *iot)
404{
405 struct s3c2410_iobank_timing *bt;
406 int bank;
407
408 /* set the io timings from the specifier */
409
410 for (bank = 0; bank < MAX_BANKS; bank++) {
411 bt = iot->bank[bank].io_2410;
412 if (!bt)
413 continue;
414
415 __raw_writel(bt->bankcon, bank_reg(bank));
416 }
417}
418
419/**
420 * s3c2410_iotiming_get - Get the timing information from current registers.
421 * @cfg: The frequency configuration
422 * @timings: The IO timing information to fill out.
423 *
424 * Calculate the @timings timing information from the current frequency
425 * information in @cfg, and the new frequency configur
426 * through all the IO banks, reading the state and then updating @iot
427 * as necessary.
428 *
429 * This is used at the moment on initialisation to get the current
430 * configuration so that boards do not have to carry their own setup
431 * if the timings are correct on initialisation.
432 */
433
434int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg,
435 struct s3c_iotimings *timings)
436{
437 struct s3c2410_iobank_timing *bt;
438 unsigned long bankcon;
439 unsigned long bwscon;
440 int bank;
441
442 bwscon = __raw_readl(S3C2410_BWSCON);
443
444 /* look through all banks to see what is currently set. */
445
446 for (bank = 0; bank < MAX_BANKS; bank++) {
447 bankcon = __raw_readl(bank_reg(bank));
448
449 if (!bank_is_io(bankcon))
450 continue;
451
452 s3c_freq_iodbg("%s: bank %d: con %08lx\n",
453 __func__, bank, bankcon);
454
455 bt = kzalloc(sizeof(struct s3c2410_iobank_timing), GFP_KERNEL);
456 if (!bt) {
457 printk(KERN_ERR "%s: no memory for bank\n", __func__);
458 return -ENOMEM;
459 }
460
461 /* find out in nWait is enabled for bank. */
462
463 if (bank != 0) {
464 unsigned long tmp = S3C2410_BWSCON_GET(bwscon, bank);
465 if (tmp & S3C2410_BWSCON_WS)
466 bt->nwait_en = 1;
467 }
468
469 timings->bank[bank].io_2410 = bt;
470 bt->bankcon = bankcon;
471
472 s3c2410_iotiming_getbank(cfg, bt);
473 }
474
475 s3c2410_print_timing("get", timings);
476 return 0;
477}
diff --git a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
new file mode 100644
index 000000000000..fd45e47facbc
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
@@ -0,0 +1,285 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
2 *
3 * Copyright (c) 2006,2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2412/S3C2443 (PL093 based) IO timing support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/cpufreq.h>
19#include <linux/seq_file.h>
20#include <linux/sysdev.h>
21#include <linux/delay.h>
22#include <linux/clk.h>
23#include <linux/err.h>
24
25#include <linux/amba/pl093.h>
26
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29
30#include <mach/regs-s3c2412-mem.h>
31
32#include <plat/cpu.h>
33#include <plat/cpu-freq-core.h>
34#include <plat/clock.h>
35
36#define print_ns(x) ((x) / 10), ((x) % 10)
37
38/**
39 * s3c2412_print_timing - print timing infromation via printk.
40 * @pfx: The prefix to print each line with.
41 * @iot: The IO timing information
42 */
43static void s3c2412_print_timing(const char *pfx, struct s3c_iotimings *iot)
44{
45 struct s3c2412_iobank_timing *bt;
46 unsigned int bank;
47
48 for (bank = 0; bank < MAX_BANKS; bank++) {
49 bt = iot->bank[bank].io_2412;
50 if (!bt)
51 continue;
52
53 printk(KERN_DEBUG "%s: %d: idcy=%d.%d wstrd=%d.%d wstwr=%d,%d"
54 "wstoen=%d.%d wstwen=%d.%d wstbrd=%d.%d\n", pfx, bank,
55 print_ns(bt->idcy),
56 print_ns(bt->wstrd),
57 print_ns(bt->wstwr),
58 print_ns(bt->wstoen),
59 print_ns(bt->wstwen),
60 print_ns(bt->wstbrd));
61 }
62}
63
64/**
65 * to_div - turn a cycle length into a divisor setting.
66 * @cyc_tns: The cycle time in 10ths of nanoseconds.
67 * @clk_tns: The clock period in 10ths of nanoseconds.
68 */
69static inline unsigned int to_div(unsigned int cyc_tns, unsigned int clk_tns)
70{
71 return cyc_tns ? DIV_ROUND_UP(cyc_tns, clk_tns) : 0;
72}
73
74/**
75 * calc_timing - calculate timing divisor value and check in range.
76 * @hwtm: The hardware timing in 10ths of nanoseconds.
77 * @clk_tns: The clock period in 10ths of nanoseconds.
78 * @err: Pointer to err variable to update in event of failure.
79 */
80static unsigned int calc_timing(unsigned int hwtm, unsigned int clk_tns,
81 unsigned int *err)
82{
83 unsigned int ret = to_div(hwtm, clk_tns);
84
85 if (ret > 0xf)
86 *err = -EINVAL;
87
88 return ret;
89}
90
91/**
92 * s3c2412_calc_bank - calculate the bank divisor settings.
93 * @cfg: The current frequency configuration.
94 * @bt: The bank timing.
95 */
96static int s3c2412_calc_bank(struct s3c_cpufreq_config *cfg,
97 struct s3c2412_iobank_timing *bt)
98{
99 unsigned int hclk = cfg->freq.hclk_tns;
100 int err = 0;
101
102 bt->smbidcyr = calc_timing(bt->idcy, hclk, &err);
103 bt->smbwstrd = calc_timing(bt->wstrd, hclk, &err);
104 bt->smbwstwr = calc_timing(bt->wstwr, hclk, &err);
105 bt->smbwstoen = calc_timing(bt->wstoen, hclk, &err);
106 bt->smbwstwen = calc_timing(bt->wstwen, hclk, &err);
107 bt->smbwstbrd = calc_timing(bt->wstbrd, hclk, &err);
108
109 return err;
110}
111
112/**
113 * s3c2412_iotiming_debugfs - debugfs show io bank timing information
114 * @seq: The seq_file to write output to using seq_printf().
115 * @cfg: The current configuration.
116 * @iob: The IO bank information to decode.
117*/
118void s3c2412_iotiming_debugfs(struct seq_file *seq,
119 struct s3c_cpufreq_config *cfg,
120 union s3c_iobank *iob)
121{
122 struct s3c2412_iobank_timing *bt = iob->io_2412;
123
124 seq_printf(seq,
125 "\tRead: idcy=%d.%d wstrd=%d.%d wstwr=%d,%d"
126 "wstoen=%d.%d wstwen=%d.%d wstbrd=%d.%d\n",
127 print_ns(bt->idcy),
128 print_ns(bt->wstrd),
129 print_ns(bt->wstwr),
130 print_ns(bt->wstoen),
131 print_ns(bt->wstwen),
132 print_ns(bt->wstbrd));
133}
134
135/**
136 * s3c2412_iotiming_calc - calculate all the bank divisor settings.
137 * @cfg: The current frequency configuration.
138 * @iot: The bank timing information.
139 *
140 * Calculate the timing information for all the banks that are
141 * configured as IO, using s3c2412_calc_bank().
142 */
143int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg,
144 struct s3c_iotimings *iot)
145{
146 struct s3c2412_iobank_timing *bt;
147 int bank;
148 int ret;
149
150 for (bank = 0; bank < MAX_BANKS; bank++) {
151 bt = iot->bank[bank].io_2412;
152 if (!bt)
153 continue;
154
155 ret = s3c2412_calc_bank(cfg, bt);
156 if (ret) {
157 printk(KERN_ERR "%s: cannot calculate bank %d io\n",
158 __func__, bank);
159 goto err;
160 }
161 }
162
163 return 0;
164 err:
165 return ret;
166}
167
168/**
169 * s3c2412_iotiming_set - set the timing information
170 * @cfg: The current frequency configuration.
171 * @iot: The bank timing information.
172 *
173 * Set the IO bank information from the details calculated earlier from
174 * calling s3c2412_iotiming_calc().
175 */
176void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
177 struct s3c_iotimings *iot)
178{
179 struct s3c2412_iobank_timing *bt;
180 void __iomem *regs;
181 int bank;
182
183 /* set the io timings from the specifier */
184
185 for (bank = 0; bank < MAX_BANKS; bank++) {
186 bt = iot->bank[bank].io_2412;
187 if (!bt)
188 continue;
189
190 regs = S3C2412_SSMC_BANK(bank);
191
192 __raw_writel(bt->smbidcyr, regs + SMBIDCYR);
193 __raw_writel(bt->smbwstrd, regs + SMBWSTRDR);
194 __raw_writel(bt->smbwstwr, regs + SMBWSTWRR);
195 __raw_writel(bt->smbwstoen, regs + SMBWSTOENR);
196 __raw_writel(bt->smbwstwen, regs + SMBWSTWENR);
197 __raw_writel(bt->smbwstbrd, regs + SMBWSTBRDR);
198 }
199}
200
201static inline unsigned int s3c2412_decode_timing(unsigned int clock, u32 reg)
202{
203 return (reg & 0xf) * clock;
204}
205
206static void s3c2412_iotiming_getbank(struct s3c_cpufreq_config *cfg,
207 struct s3c2412_iobank_timing *bt,
208 unsigned int bank)
209{
210 unsigned long clk = cfg->freq.hclk_tns; /* ssmc clock??? */
211 void __iomem *regs = S3C2412_SSMC_BANK(bank);
212
213 bt->idcy = s3c2412_decode_timing(clk, __raw_readl(regs + SMBIDCYR));
214 bt->wstrd = s3c2412_decode_timing(clk, __raw_readl(regs + SMBWSTRDR));
215 bt->wstoen = s3c2412_decode_timing(clk, __raw_readl(regs + SMBWSTOENR));
216 bt->wstwen = s3c2412_decode_timing(clk, __raw_readl(regs + SMBWSTWENR));
217 bt->wstbrd = s3c2412_decode_timing(clk, __raw_readl(regs + SMBWSTBRDR));
218}
219
220/**
221 * bank_is_io - return true if bank is (possibly) IO.
222 * @bank: The bank number.
223 * @bankcfg: The value of S3C2412_EBI_BANKCFG.
224 */
225static inline bool bank_is_io(unsigned int bank, u32 bankcfg)
226{
227 if (bank < 2)
228 return true;
229
230 return !(bankcfg & (1 << bank));
231}
232
233int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
234 struct s3c_iotimings *timings)
235{
236 struct s3c2412_iobank_timing *bt;
237 u32 bankcfg = __raw_readl(S3C2412_EBI_BANKCFG);
238 unsigned int bank;
239
240 /* look through all banks to see what is currently set. */
241
242 for (bank = 0; bank < MAX_BANKS; bank++) {
243 if (!bank_is_io(bank, bankcfg))
244 continue;
245
246 bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL);
247 if (!bt) {
248 printk(KERN_ERR "%s: no memory for bank\n", __func__);
249 return -ENOMEM;
250 }
251
252 timings->bank[bank].io_2412 = bt;
253 s3c2412_iotiming_getbank(cfg, bt, bank);
254 }
255
256 s3c2412_print_timing("get", timings);
257 return 0;
258}
259
260/* this is in here as it is so small, it doesn't currently warrant a file
261 * to itself. We expect that any s3c24xx needing this is going to also
262 * need the iotiming support.
263 */
264void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
265{
266 struct s3c_cpufreq_board *board = cfg->board;
267 u32 refresh;
268
269 WARN_ON(board == NULL);
270
271 /* Reduce both the refresh time (in ns) and the frequency (in MHz)
272 * down to ensure that we do not overflow 32 bit numbers.
273 *
274 * This should work for HCLK up to 133MHz and refresh period up
275 * to 30usec.
276 */
277
278 refresh = (cfg->freq.hclk / 100) * (board->refresh / 10);
279 refresh = DIV_ROUND_UP(refresh, (1000 * 1000)); /* apply scale */
280 refresh &= ((1 << 16) - 1);
281
282 s3c_freq_dbg("%s: refresh value %u\n", __func__, (unsigned int)refresh);
283
284 __raw_writel(refresh, S3C2412_REFRESH);
285}
diff --git a/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c b/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
new file mode 100644
index 000000000000..ae2e6c604f27
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
@@ -0,0 +1,311 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
2 *
3 * Copyright (c) 2006,2008,2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@simtec.co.uk>
7 *
8 * S3C2440/S3C2442 CPU Frequency scaling
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/cpufreq.h>
20#include <linux/sysdev.h>
21#include <linux/delay.h>
22#include <linux/clk.h>
23#include <linux/err.h>
24#include <linux/io.h>
25
26#include <mach/hardware.h>
27
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30
31#include <mach/regs-clock.h>
32
33#include <plat/cpu.h>
34#include <plat/cpu-freq-core.h>
35#include <plat/clock.h>
36
37static struct clk *xtal;
38static struct clk *fclk;
39static struct clk *hclk;
40static struct clk *armclk;
41
42/* HDIV: 1, 2, 3, 4, 6, 8 */
43
44static inline int within_khz(unsigned long a, unsigned long b)
45{
46 long diff = a - b;
47
48 return (diff >= -1000 && diff <= 1000);
49}
50
51/**
52 * s3c2440_cpufreq_calcdivs - calculate divider settings
53 * @cfg: The cpu frequency settings.
54 *
55 * Calcualte the divider values for the given frequency settings
56 * specified in @cfg. The values are stored in @cfg for later use
57 * by the relevant set routine if the request settings can be reached.
58 */
59int s3c2440_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
60{
61 unsigned int hdiv, pdiv;
62 unsigned long hclk, fclk, armclk;
63 unsigned long hclk_max;
64
65 fclk = cfg->freq.fclk;
66 armclk = cfg->freq.armclk;
67 hclk_max = cfg->max.hclk;
68
69 s3c_freq_dbg("%s: fclk is %lu, armclk %lu, max hclk %lu\n",
70 __func__, fclk, armclk, hclk_max);
71
72 if (armclk > fclk) {
73 printk(KERN_WARNING "%s: armclk > fclk\n", __func__);
74 armclk = fclk;
75 }
76
77 /* if we are in DVS, we need HCLK to be <= ARMCLK */
78 if (armclk < fclk && armclk < hclk_max)
79 hclk_max = armclk;
80
81 for (hdiv = 1; hdiv < 9; hdiv++) {
82 if (hdiv == 5 || hdiv == 7)
83 hdiv++;
84
85 hclk = (fclk / hdiv);
86 if (hclk <= hclk_max || within_khz(hclk, hclk_max))
87 break;
88 }
89
90 s3c_freq_dbg("%s: hclk %lu, div %d\n", __func__, hclk, hdiv);
91
92 if (hdiv > 8)
93 goto invalid;
94
95 pdiv = (hclk > cfg->max.pclk) ? 2 : 1;
96
97 if ((hclk / pdiv) > cfg->max.pclk)
98 pdiv++;
99
100 s3c_freq_dbg("%s: pdiv %d\n", __func__, pdiv);
101
102 if (pdiv > 2)
103 goto invalid;
104
105 pdiv *= hdiv;
106
107 /* calculate a valid armclk */
108
109 if (armclk < hclk)
110 armclk = hclk;
111
112 /* if we're running armclk lower than fclk, this really means
113 * that the system should go into dvs mode, which means that
114 * armclk is connected to hclk. */
115 if (armclk < fclk) {
116 cfg->divs.dvs = 1;
117 armclk = hclk;
118 } else
119 cfg->divs.dvs = 0;
120
121 cfg->freq.armclk = armclk;
122
123 /* store the result, and then return */
124
125 cfg->divs.h_divisor = hdiv;
126 cfg->divs.p_divisor = pdiv;
127
128 return 0;
129
130 invalid:
131 return -EINVAL;
132}
133
134#define CAMDIVN_HCLK_HALF (S3C2440_CAMDIVN_HCLK3_HALF | \
135 S3C2440_CAMDIVN_HCLK4_HALF)
136
137/**
138 * s3c2440_cpufreq_setdivs - set the cpu frequency divider settings
139 * @cfg: The cpu frequency settings.
140 *
141 * Set the divisors from the settings in @cfg, which where generated
142 * during the calculation phase by s3c2440_cpufreq_calcdivs().
143 */
144static void s3c2440_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
145{
146 unsigned long clkdiv, camdiv;
147
148 s3c_freq_dbg("%s: divsiors: h=%d, p=%d\n", __func__,
149 cfg->divs.h_divisor, cfg->divs.p_divisor);
150
151 clkdiv = __raw_readl(S3C2410_CLKDIVN);
152 camdiv = __raw_readl(S3C2440_CAMDIVN);
153
154 clkdiv &= ~(S3C2440_CLKDIVN_HDIVN_MASK | S3C2440_CLKDIVN_PDIVN);
155 camdiv &= ~CAMDIVN_HCLK_HALF;
156
157 switch (cfg->divs.h_divisor) {
158 case 1:
159 clkdiv |= S3C2440_CLKDIVN_HDIVN_1;
160 break;
161
162 case 2:
163 clkdiv |= S3C2440_CLKDIVN_HDIVN_2;
164 break;
165
166 case 6:
167 camdiv |= S3C2440_CAMDIVN_HCLK3_HALF;
168 case 3:
169 clkdiv |= S3C2440_CLKDIVN_HDIVN_3_6;
170 break;
171
172 case 8:
173 camdiv |= S3C2440_CAMDIVN_HCLK4_HALF;
174 case 4:
175 clkdiv |= S3C2440_CLKDIVN_HDIVN_4_8;
176 break;
177
178 default:
179 BUG(); /* we don't expect to get here. */
180 }
181
182 if (cfg->divs.p_divisor != cfg->divs.h_divisor)
183 clkdiv |= S3C2440_CLKDIVN_PDIVN;
184
185 /* todo - set pclk. */
186
187 /* Write the divisors first with hclk intentionally halved so that
188 * when we write clkdiv we will under-frequency instead of over. We
189 * then make a short delay and remove the hclk halving if necessary.
190 */
191
192 __raw_writel(camdiv | CAMDIVN_HCLK_HALF, S3C2440_CAMDIVN);
193 __raw_writel(clkdiv, S3C2410_CLKDIVN);
194
195 ndelay(20);
196 __raw_writel(camdiv, S3C2440_CAMDIVN);
197
198 clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk);
199}
200
201static int run_freq_for(unsigned long max_hclk, unsigned long fclk,
202 int *divs,
203 struct cpufreq_frequency_table *table,
204 size_t table_size)
205{
206 unsigned long freq;
207 int index = 0;
208 int div;
209
210 for (div = *divs; div > 0; div = *divs++) {
211 freq = fclk / div;
212
213 if (freq > max_hclk && div != 1)
214 continue;
215
216 freq /= 1000; /* table is in kHz */
217 index = s3c_cpufreq_addfreq(table, index, table_size, freq);
218 if (index < 0)
219 break;
220 }
221
222 return index;
223}
224
225static int hclk_divs[] = { 1, 2, 3, 4, 6, 8, -1 };
226
227static int s3c2440_cpufreq_calctable(struct s3c_cpufreq_config *cfg,
228 struct cpufreq_frequency_table *table,
229 size_t table_size)
230{
231 int ret;
232
233 WARN_ON(cfg->info == NULL);
234 WARN_ON(cfg->board == NULL);
235
236 ret = run_freq_for(cfg->info->max.hclk,
237 cfg->info->max.fclk,
238 hclk_divs,
239 table, table_size);
240
241 s3c_freq_dbg("%s: returning %d\n", __func__, ret);
242
243 return ret;
244}
245
246struct s3c_cpufreq_info s3c2440_cpufreq_info = {
247 .max = {
248 .fclk = 400000000,
249 .hclk = 133333333,
250 .pclk = 66666666,
251 },
252
253 .locktime_m = 300,
254 .locktime_u = 300,
255 .locktime_bits = 16,
256
257 .name = "s3c244x",
258 .calc_iotiming = s3c2410_iotiming_calc,
259 .set_iotiming = s3c2410_iotiming_set,
260 .get_iotiming = s3c2410_iotiming_get,
261 .set_fvco = s3c2410_set_fvco,
262
263 .set_refresh = s3c2410_cpufreq_setrefresh,
264 .set_divs = s3c2440_cpufreq_setdivs,
265 .calc_divs = s3c2440_cpufreq_calcdivs,
266 .calc_freqtable = s3c2440_cpufreq_calctable,
267
268 .resume_clocks = s3c244x_setup_clocks,
269
270 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
271};
272
273static int s3c2440_cpufreq_add(struct sys_device *sysdev)
274{
275 xtal = s3c_cpufreq_clk_get(NULL, "xtal");
276 hclk = s3c_cpufreq_clk_get(NULL, "hclk");
277 fclk = s3c_cpufreq_clk_get(NULL, "fclk");
278 armclk = s3c_cpufreq_clk_get(NULL, "armclk");
279
280 if (IS_ERR(xtal) || IS_ERR(hclk) || IS_ERR(fclk) || IS_ERR(armclk)) {
281 printk(KERN_ERR "%s: failed to get clocks\n", __func__);
282 return -ENOENT;
283 }
284
285 return s3c_cpufreq_register(&s3c2440_cpufreq_info);
286}
287
288static struct sysdev_driver s3c2440_cpufreq_driver = {
289 .add = s3c2440_cpufreq_add,
290};
291
292static int s3c2440_cpufreq_init(void)
293{
294 return sysdev_driver_register(&s3c2440_sysclass,
295 &s3c2440_cpufreq_driver);
296}
297
298/* arch_initcall adds the clocks we need, so use subsys_initcall. */
299subsys_initcall(s3c2440_cpufreq_init);
300
301static struct sysdev_driver s3c2442_cpufreq_driver = {
302 .add = s3c2440_cpufreq_add,
303};
304
305static int s3c2442_cpufreq_init(void)
306{
307 return sysdev_driver_register(&s3c2442_sysclass,
308 &s3c2442_cpufreq_driver);
309}
310
311subsys_initcall(s3c2442_cpufreq_init);
diff --git a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c b/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
new file mode 100644
index 000000000000..ff9443b233aa
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
@@ -0,0 +1,97 @@
1/* arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
2 *
3 * Copyright (c) 2006,2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk>
7 *
8 * S3C2440/S3C2442 CPU PLL tables (12MHz Crystal)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/sysdev.h>
18#include <linux/clk.h>
19#include <linux/err.h>
20
21#include <plat/cpu.h>
22#include <plat/cpu-freq-core.h>
23
24static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = {
25 { .frequency = 75000000, .index = PLLVAL(0x75, 3, 3), }, /* FVco 600.000000 */
26 { .frequency = 80000000, .index = PLLVAL(0x98, 4, 3), }, /* FVco 640.000000 */
27 { .frequency = 90000000, .index = PLLVAL(0x70, 2, 3), }, /* FVco 720.000000 */
28 { .frequency = 100000000, .index = PLLVAL(0x5c, 1, 3), }, /* FVco 800.000000 */
29 { .frequency = 110000000, .index = PLLVAL(0x66, 1, 3), }, /* FVco 880.000000 */
30 { .frequency = 120000000, .index = PLLVAL(0x70, 1, 3), }, /* FVco 960.000000 */
31 { .frequency = 150000000, .index = PLLVAL(0x75, 3, 2), }, /* FVco 600.000000 */
32 { .frequency = 160000000, .index = PLLVAL(0x98, 4, 2), }, /* FVco 640.000000 */
33 { .frequency = 170000000, .index = PLLVAL(0x4d, 1, 2), }, /* FVco 680.000000 */
34 { .frequency = 180000000, .index = PLLVAL(0x70, 2, 2), }, /* FVco 720.000000 */
35 { .frequency = 190000000, .index = PLLVAL(0x57, 1, 2), }, /* FVco 760.000000 */
36 { .frequency = 200000000, .index = PLLVAL(0x5c, 1, 2), }, /* FVco 800.000000 */
37 { .frequency = 210000000, .index = PLLVAL(0x84, 2, 2), }, /* FVco 840.000000 */
38 { .frequency = 220000000, .index = PLLVAL(0x66, 1, 2), }, /* FVco 880.000000 */
39 { .frequency = 230000000, .index = PLLVAL(0x6b, 1, 2), }, /* FVco 920.000000 */
40 { .frequency = 240000000, .index = PLLVAL(0x70, 1, 2), }, /* FVco 960.000000 */
41 { .frequency = 300000000, .index = PLLVAL(0x75, 3, 1), }, /* FVco 600.000000 */
42 { .frequency = 310000000, .index = PLLVAL(0x93, 4, 1), }, /* FVco 620.000000 */
43 { .frequency = 320000000, .index = PLLVAL(0x98, 4, 1), }, /* FVco 640.000000 */
44 { .frequency = 330000000, .index = PLLVAL(0x66, 2, 1), }, /* FVco 660.000000 */
45 { .frequency = 340000000, .index = PLLVAL(0x4d, 1, 1), }, /* FVco 680.000000 */
46 { .frequency = 350000000, .index = PLLVAL(0xa7, 4, 1), }, /* FVco 700.000000 */
47 { .frequency = 360000000, .index = PLLVAL(0x70, 2, 1), }, /* FVco 720.000000 */
48 { .frequency = 370000000, .index = PLLVAL(0xb1, 4, 1), }, /* FVco 740.000000 */
49 { .frequency = 380000000, .index = PLLVAL(0x57, 1, 1), }, /* FVco 760.000000 */
50 { .frequency = 390000000, .index = PLLVAL(0x7a, 2, 1), }, /* FVco 780.000000 */
51 { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */
52};
53
54static int s3c2440_plls12_add(struct sys_device *dev)
55{
56 struct clk *xtal_clk;
57 unsigned long xtal;
58
59 xtal_clk = clk_get(NULL, "xtal");
60 if (IS_ERR(xtal_clk))
61 return PTR_ERR(xtal_clk);
62
63 xtal = clk_get_rate(xtal_clk);
64 clk_put(xtal_clk);
65
66 if (xtal == 12000000) {
67 printk(KERN_INFO "Using PLL table for 12MHz crystal\n");
68 return s3c_plltab_register(s3c2440_plls_12,
69 ARRAY_SIZE(s3c2440_plls_12));
70 }
71
72 return 0;
73}
74
75static struct sysdev_driver s3c2440_plls12_drv = {
76 .add = s3c2440_plls12_add,
77};
78
79static int __init s3c2440_pll_12mhz(void)
80{
81 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_plls12_drv);
82
83}
84
85arch_initcall(s3c2440_pll_12mhz);
86
87static struct sysdev_driver s3c2442_plls12_drv = {
88 .add = s3c2440_plls12_add,
89};
90
91static int __init s3c2442_pll_12mhz(void)
92{
93 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_plls12_drv);
94
95}
96
97arch_initcall(s3c2442_pll_12mhz);
diff --git a/arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c b/arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c
new file mode 100644
index 000000000000..7679af13a94d
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c
@@ -0,0 +1,127 @@
1/* arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c
2 *
3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk>
7 *
8 * S3C2440/S3C2442 CPU PLL tables (16.93444MHz Crystal)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/sysdev.h>
18#include <linux/clk.h>
19#include <linux/err.h>
20
21#include <plat/cpu.h>
22#include <plat/cpu-freq-core.h>
23
24static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = {
25 { .frequency = 78019200, .index = PLLVAL(121, 5, 3), }, /* FVco 624.153600 */
26 { .frequency = 84067200, .index = PLLVAL(131, 5, 3), }, /* FVco 672.537600 */
27 { .frequency = 90115200, .index = PLLVAL(141, 5, 3), }, /* FVco 720.921600 */
28 { .frequency = 96163200, .index = PLLVAL(151, 5, 3), }, /* FVco 769.305600 */
29 { .frequency = 102135600, .index = PLLVAL(185, 6, 3), }, /* FVco 817.084800 */
30 { .frequency = 108259200, .index = PLLVAL(171, 5, 3), }, /* FVco 866.073600 */
31 { .frequency = 114307200, .index = PLLVAL(127, 3, 3), }, /* FVco 914.457600 */
32 { .frequency = 120234240, .index = PLLVAL(134, 3, 3), }, /* FVco 961.873920 */
33 { .frequency = 126161280, .index = PLLVAL(141, 3, 3), }, /* FVco 1009.290240 */
34 { .frequency = 132088320, .index = PLLVAL(148, 3, 3), }, /* FVco 1056.706560 */
35 { .frequency = 138015360, .index = PLLVAL(155, 3, 3), }, /* FVco 1104.122880 */
36 { .frequency = 144789120, .index = PLLVAL(163, 3, 3), }, /* FVco 1158.312960 */
37 { .frequency = 150100363, .index = PLLVAL(187, 9, 2), }, /* FVco 600.401454 */
38 { .frequency = 156038400, .index = PLLVAL(121, 5, 2), }, /* FVco 624.153600 */
39 { .frequency = 162086400, .index = PLLVAL(126, 5, 2), }, /* FVco 648.345600 */
40 { .frequency = 168134400, .index = PLLVAL(131, 5, 2), }, /* FVco 672.537600 */
41 { .frequency = 174048000, .index = PLLVAL(177, 7, 2), }, /* FVco 696.192000 */
42 { .frequency = 180230400, .index = PLLVAL(141, 5, 2), }, /* FVco 720.921600 */
43 { .frequency = 186278400, .index = PLLVAL(124, 4, 2), }, /* FVco 745.113600 */
44 { .frequency = 192326400, .index = PLLVAL(151, 5, 2), }, /* FVco 769.305600 */
45 { .frequency = 198132480, .index = PLLVAL(109, 3, 2), }, /* FVco 792.529920 */
46 { .frequency = 204271200, .index = PLLVAL(185, 6, 2), }, /* FVco 817.084800 */
47 { .frequency = 210268800, .index = PLLVAL(141, 4, 2), }, /* FVco 841.075200 */
48 { .frequency = 216518400, .index = PLLVAL(171, 5, 2), }, /* FVco 866.073600 */
49 { .frequency = 222264000, .index = PLLVAL(97, 2, 2), }, /* FVco 889.056000 */
50 { .frequency = 228614400, .index = PLLVAL(127, 3, 2), }, /* FVco 914.457600 */
51 { .frequency = 234259200, .index = PLLVAL(158, 4, 2), }, /* FVco 937.036800 */
52 { .frequency = 240468480, .index = PLLVAL(134, 3, 2), }, /* FVco 961.873920 */
53 { .frequency = 246960000, .index = PLLVAL(167, 4, 2), }, /* FVco 987.840000 */
54 { .frequency = 252322560, .index = PLLVAL(141, 3, 2), }, /* FVco 1009.290240 */
55 { .frequency = 258249600, .index = PLLVAL(114, 2, 2), }, /* FVco 1032.998400 */
56 { .frequency = 264176640, .index = PLLVAL(148, 3, 2), }, /* FVco 1056.706560 */
57 { .frequency = 270950400, .index = PLLVAL(120, 2, 2), }, /* FVco 1083.801600 */
58 { .frequency = 276030720, .index = PLLVAL(155, 3, 2), }, /* FVco 1104.122880 */
59 { .frequency = 282240000, .index = PLLVAL(92, 1, 2), }, /* FVco 1128.960000 */
60 { .frequency = 289578240, .index = PLLVAL(163, 3, 2), }, /* FVco 1158.312960 */
61 { .frequency = 294235200, .index = PLLVAL(131, 2, 2), }, /* FVco 1176.940800 */
62 { .frequency = 300200727, .index = PLLVAL(187, 9, 1), }, /* FVco 600.401454 */
63 { .frequency = 306358690, .index = PLLVAL(191, 9, 1), }, /* FVco 612.717380 */
64 { .frequency = 312076800, .index = PLLVAL(121, 5, 1), }, /* FVco 624.153600 */
65 { .frequency = 318366720, .index = PLLVAL(86, 3, 1), }, /* FVco 636.733440 */
66 { .frequency = 324172800, .index = PLLVAL(126, 5, 1), }, /* FVco 648.345600 */
67 { .frequency = 330220800, .index = PLLVAL(109, 4, 1), }, /* FVco 660.441600 */
68 { .frequency = 336268800, .index = PLLVAL(131, 5, 1), }, /* FVco 672.537600 */
69 { .frequency = 342074880, .index = PLLVAL(93, 3, 1), }, /* FVco 684.149760 */
70 { .frequency = 348096000, .index = PLLVAL(177, 7, 1), }, /* FVco 696.192000 */
71 { .frequency = 355622400, .index = PLLVAL(118, 4, 1), }, /* FVco 711.244800 */
72 { .frequency = 360460800, .index = PLLVAL(141, 5, 1), }, /* FVco 720.921600 */
73 { .frequency = 366206400, .index = PLLVAL(165, 6, 1), }, /* FVco 732.412800 */
74 { .frequency = 372556800, .index = PLLVAL(124, 4, 1), }, /* FVco 745.113600 */
75 { .frequency = 378201600, .index = PLLVAL(126, 4, 1), }, /* FVco 756.403200 */
76 { .frequency = 384652800, .index = PLLVAL(151, 5, 1), }, /* FVco 769.305600 */
77 { .frequency = 391608000, .index = PLLVAL(177, 6, 1), }, /* FVco 783.216000 */
78 { .frequency = 396264960, .index = PLLVAL(109, 3, 1), }, /* FVco 792.529920 */
79 { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */
80};
81
82static int s3c2440_plls169344_add(struct sys_device *dev)
83{
84 struct clk *xtal_clk;
85 unsigned long xtal;
86
87 xtal_clk = clk_get(NULL, "xtal");
88 if (IS_ERR(xtal_clk))
89 return PTR_ERR(xtal_clk);
90
91 xtal = clk_get_rate(xtal_clk);
92 clk_put(xtal_clk);
93
94 if (xtal == 169344000) {
95 printk(KERN_INFO "Using PLL table for 16.9344MHz crystal\n");
96 return s3c_plltab_register(s3c2440_plls_169344,
97 ARRAY_SIZE(s3c2440_plls_169344));
98 }
99
100 return 0;
101}
102
103static struct sysdev_driver s3c2440_plls169344_drv = {
104 .add = s3c2440_plls169344_add,
105};
106
107static int __init s3c2440_pll_16934400(void)
108{
109 return sysdev_driver_register(&s3c2440_sysclass,
110 &s3c2440_plls169344_drv);
111
112}
113
114arch_initcall(s3c2440_pll_16934400);
115
116static struct sysdev_driver s3c2442_plls169344_drv = {
117 .add = s3c2440_plls169344_add,
118};
119
120static int __init s3c2442_pll_16934400(void)
121{
122 return sysdev_driver_register(&s3c2442_sysclass,
123 &s3c2442_plls169344_drv);
124
125}
126
127arch_initcall(s3c2442_pll_16934400);
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c
new file mode 100644
index 000000000000..89fcf5308cf6
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c
@@ -0,0 +1,38 @@
1/* linux/arch/arm/plat-s3c24xx/spi-bus0-gpd8_9_10.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX SPI - gpio configuration for bus 1 on gpd8,9,10
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12*/
13
14#include <linux/kernel.h>
15#include <linux/gpio.h>
16
17#include <mach/spi.h>
18#include <mach/regs-gpio.h>
19
20void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi,
21 int enable)
22{
23
24 printk(KERN_INFO "%s(%d)\n", __func__, enable);
25 if (enable) {
26 s3c2410_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1);
27 s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1);
28 s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1);
29 s3c2410_gpio_pullup(S3C2410_GPD(10), 0);
30 s3c2410_gpio_pullup(S3C2410_GPD(9), 0);
31 } else {
32 s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT);
33 s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT);
34 s3c2410_gpio_pullup(S3C2410_GPD(10), 1);
35 s3c2410_gpio_pullup(S3C2410_GPD(9), 1);
36 s3c2410_gpio_pullup(S3C2410_GPD(8), 1);
37 }
38}
diff --git a/arch/arm/plat-s3c64xx/Kconfig b/arch/arm/plat-s3c64xx/Kconfig
index 5ebd8b425a54..bcfa778614d8 100644
--- a/arch/arm/plat-s3c64xx/Kconfig
+++ b/arch/arm/plat-s3c64xx/Kconfig
@@ -19,6 +19,7 @@ config PLAT_S3C64XX
19 select S3C_GPIO_PULL_UPDOWN 19 select S3C_GPIO_PULL_UPDOWN
20 select S3C_GPIO_CFG_S3C24XX 20 select S3C_GPIO_CFG_S3C24XX
21 select S3C_GPIO_CFG_S3C64XX 21 select S3C_GPIO_CFG_S3C64XX
22 select S3C_DEV_NAND
22 select USB_ARCH_HAS_OHCI 23 select USB_ARCH_HAS_OHCI
23 help 24 help
24 Base platform code for any Samsung S3C64XX device 25 Base platform code for any Samsung S3C64XX device
diff --git a/arch/arm/plat-s3c64xx/Makefile b/arch/arm/plat-s3c64xx/Makefile
index 3c8882cd6268..b85b4359e935 100644
--- a/arch/arm/plat-s3c64xx/Makefile
+++ b/arch/arm/plat-s3c64xx/Makefile
@@ -40,4 +40,5 @@ obj-$(CONFIG_S3C64XX_DMA) += dma.o
40obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o 40obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
41obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o 41obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
42obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o 42obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
43obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o \ No newline at end of file 43obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
44obj-$(CONFIG_SND_S3C24XX_SOC) += dev-audio.o
diff --git a/arch/arm/plat-s3c/dev-audio.c b/arch/arm/plat-s3c64xx/dev-audio.c
index 1322beb40dd7..1322beb40dd7 100644
--- a/arch/arm/plat-s3c/dev-audio.c
+++ b/arch/arm/plat-s3c64xx/dev-audio.c
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
index 1debc1f9f987..febac1950d8e 100644
--- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
+++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c
@@ -153,7 +153,7 @@ static unsigned long s3c64xx_clk_arm_round_rate(struct clk *clk,
153 u32 div; 153 u32 div;
154 154
155 if (parent < rate) 155 if (parent < rate)
156 return rate; 156 return parent;
157 157
158 div = (parent / rate) - 1; 158 div = (parent / rate) - 1;
159 if (div > armclk_mask) 159 if (div > armclk_mask)
@@ -175,7 +175,7 @@ static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate)
175 div = clk_get_rate(clk->parent) / rate; 175 div = clk_get_rate(clk->parent) / rate;
176 176
177 val = __raw_readl(S3C_CLK_DIV0); 177 val = __raw_readl(S3C_CLK_DIV0);
178 val &= armclk_mask; 178 val &= ~armclk_mask;
179 val |= (div - 1); 179 val |= (div - 1);
180 __raw_writel(val, S3C_CLK_DIV0); 180 __raw_writel(val, S3C_CLK_DIV0);
181 181
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
new file mode 100644
index 000000000000..a8a711c3c064
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -0,0 +1,50 @@
1# arch/arm/plat-s5pc1xx/Kconfig
2#
3# Copyright 2009 Samsung Electronics Co.
4# Byungho Min <bhmin@samsung.com>
5#
6# Licensed under GPLv2
7
8config PLAT_S5PC1XX
9 bool
10 depends on ARCH_S5PC1XX
11 default y
12 select PLAT_S3C
13 select ARM_VIC
14 select NO_IOPORT
15 select ARCH_REQUIRE_GPIOLIB
16 select S3C_GPIO_TRACK
17 select S3C_GPIO_PULL_UPDOWN
18 help
19 Base platform code for any Samsung S5PC1XX device
20
21if PLAT_S5PC1XX
22
23# Configuration options shared by all S3C64XX implementations
24
25config CPU_S5PC100_INIT
26 bool
27 help
28 Common initialisation code for the S5PC1XX
29
30config CPU_S5PC100_CLOCK
31 bool
32 help
33 Common clock support code for the S5PC1XX
34
35# platform specific device setup
36
37config S5PC100_SETUP_I2C0
38 bool
39 default y
40 help
41 Common setup code for i2c bus 0.
42
43 Note, currently since i2c0 is always compiled, this setup helper
44 is always compiled with it.
45
46config S5PC100_SETUP_I2C1
47 bool
48 help
49 Common setup code for i2c bus 1.
50endif
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
new file mode 100644
index 000000000000..f1ecb2c37ee2
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -0,0 +1,26 @@
1# arch/arm/plat-s5pc1xx/Makefile
2#
3# Copyright 2009 Samsung Electronics Co.
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n := dummy.o
10obj- :=
11
12# Core files
13
14obj-y += dev-uart.o
15obj-y += cpu.o
16obj-y += irq.o
17
18# CPU support
19
20obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o
21obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o
22
23# Device setup
24
25obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o
26obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
new file mode 100644
index 000000000000..715a7330794d
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -0,0 +1,112 @@
1/* linux/arch/arm/plat-s5pc1xx/cpu.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX CPU Support
7 *
8 * Based on plat-s3c64xx/cpu.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/serial_core.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22
23#include <mach/hardware.h>
24#include <mach/map.h>
25
26#include <asm/mach/map.h>
27
28#include <plat/regs-serial.h>
29
30#include <plat/cpu.h>
31#include <plat/devs.h>
32#include <plat/clock.h>
33
34#include <plat/s5pc100.h>
35
36/* table of supported CPUs */
37
38static const char name_s5pc100[] = "S5PC100";
39
40static struct cpu_table cpu_ids[] __initdata = {
41 {
42 .idcode = 0x43100000,
43 .idmask = 0xfffff000,
44 .map_io = s5pc100_map_io,
45 .init_clocks = s5pc100_init_clocks,
46 .init_uarts = s5pc100_init_uarts,
47 .init = s5pc100_init,
48 .name = name_s5pc100,
49 },
50};
51/* minimal IO mapping */
52
53/* see notes on uart map in arch/arm/mach-s5pc100/include/mach/debug-macro.S */
54#define UART_OFFS (S3C_PA_UART & 0xffff)
55
56static struct map_desc s5pc1xx_iodesc[] __initdata = {
57 {
58 .virtual = (unsigned long)S5PC1XX_VA_CHIPID,
59 .pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID),
60 .length = SZ_16,
61 .type = MT_DEVICE,
62 }, {
63 .virtual = (unsigned long)S5PC1XX_VA_CLK,
64 .pfn = __phys_to_pfn(S5PC1XX_PA_CLK),
65 .length = SZ_4K,
66 .type = MT_DEVICE,
67 }, {
68 .virtual = (unsigned long)S5PC1XX_VA_PWR,
69 .pfn = __phys_to_pfn(S5PC1XX_PA_PWR),
70 .length = SZ_4K,
71 .type = MT_DEVICE,
72 }, {
73 .virtual = (unsigned long)(S5PC1XX_VA_UART),
74 .pfn = __phys_to_pfn(S5PC1XX_PA_UART),
75 .length = SZ_4K,
76 .type = MT_DEVICE,
77 }, {
78 .virtual = (unsigned long)S5PC1XX_VA_VIC(0),
79 .pfn = __phys_to_pfn(S5PC1XX_PA_VIC(0)),
80 .length = SZ_4K,
81 .type = MT_DEVICE,
82 }, {
83 .virtual = (unsigned long)S5PC1XX_VA_VIC(1),
84 .pfn = __phys_to_pfn(S5PC1XX_PA_VIC(1)),
85 .length = SZ_4K,
86 .type = MT_DEVICE,
87 }, {
88 .virtual = (unsigned long)S5PC1XX_VA_VIC(2),
89 .pfn = __phys_to_pfn(S5PC1XX_PA_VIC(2)),
90 .length = SZ_4K,
91 .type = MT_DEVICE,
92 }, {
93 .virtual = (unsigned long)S5PC1XX_VA_TIMER,
94 .pfn = __phys_to_pfn(S5PC1XX_PA_TIMER),
95 .length = SZ_256,
96 .type = MT_DEVICE,
97 },
98};
99
100/* read cpu identification code */
101
102void __init s5pc1xx_init_io(struct map_desc *mach_desc, int size)
103{
104 unsigned long idcode;
105
106 /* initialise the io descriptors we need for initialisation */
107 iotable_init(s5pc1xx_iodesc, ARRAY_SIZE(s5pc1xx_iodesc));
108 iotable_init(mach_desc, size);
109
110 idcode = __raw_readl(S5PC1XX_VA_CHIPID);
111 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
112}
diff --git a/arch/arm/plat-s5pc1xx/dev-uart.c b/arch/arm/plat-s5pc1xx/dev-uart.c
new file mode 100644
index 000000000000..f749bc5407b5
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/dev-uart.c
@@ -0,0 +1,174 @@
1/* linux/arch/arm/plat-s5pc1xx/dev-uart.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on plat-s3c64xx/dev-uart.c
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
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/list.h>
18#include <linux/platform_device.h>
19
20#include <asm/mach/arch.h>
21#include <asm/mach/irq.h>
22#include <mach/hardware.h>
23#include <mach/map.h>
24
25#include <plat/devs.h>
26
27/* Serial port registrations */
28
29/* 64xx uarts are closer together */
30
31static struct resource s5pc1xx_uart0_resource[] = {
32 [0] = {
33 .start = S3C_PA_UART0,
34 .end = S3C_PA_UART0 + 0x100,
35 .flags = IORESOURCE_MEM,
36 },
37 [1] = {
38 .start = IRQ_S3CUART_RX0,
39 .end = IRQ_S3CUART_RX0,
40 .flags = IORESOURCE_IRQ,
41 },
42 [2] = {
43 .start = IRQ_S3CUART_TX0,
44 .end = IRQ_S3CUART_TX0,
45 .flags = IORESOURCE_IRQ,
46
47 },
48 [3] = {
49 .start = IRQ_S3CUART_ERR0,
50 .end = IRQ_S3CUART_ERR0,
51 .flags = IORESOURCE_IRQ,
52 }
53};
54
55static struct resource s5pc1xx_uart1_resource[] = {
56 [0] = {
57 .start = S3C_PA_UART1,
58 .end = S3C_PA_UART1 + 0x100,
59 .flags = IORESOURCE_MEM,
60 },
61 [1] = {
62 .start = IRQ_S3CUART_RX1,
63 .end = IRQ_S3CUART_RX1,
64 .flags = IORESOURCE_IRQ,
65 },
66 [2] = {
67 .start = IRQ_S3CUART_TX1,
68 .end = IRQ_S3CUART_TX1,
69 .flags = IORESOURCE_IRQ,
70
71 },
72 [3] = {
73 .start = IRQ_S3CUART_ERR1,
74 .end = IRQ_S3CUART_ERR1,
75 .flags = IORESOURCE_IRQ,
76 },
77};
78
79static struct resource s5pc1xx_uart2_resource[] = {
80 [0] = {
81 .start = S3C_PA_UART2,
82 .end = S3C_PA_UART2 + 0x100,
83 .flags = IORESOURCE_MEM,
84 },
85 [1] = {
86 .start = IRQ_S3CUART_RX2,
87 .end = IRQ_S3CUART_RX2,
88 .flags = IORESOURCE_IRQ,
89 },
90 [2] = {
91 .start = IRQ_S3CUART_TX2,
92 .end = IRQ_S3CUART_TX2,
93 .flags = IORESOURCE_IRQ,
94
95 },
96 [3] = {
97 .start = IRQ_S3CUART_ERR2,
98 .end = IRQ_S3CUART_ERR2,
99 .flags = IORESOURCE_IRQ,
100 },
101};
102
103static struct resource s5pc1xx_uart3_resource[] = {
104 [0] = {
105 .start = S3C_PA_UART3,
106 .end = S3C_PA_UART3 + 0x100,
107 .flags = IORESOURCE_MEM,
108 },
109 [1] = {
110 .start = IRQ_S3CUART_RX3,
111 .end = IRQ_S3CUART_RX3,
112 .flags = IORESOURCE_IRQ,
113 },
114 [2] = {
115 .start = IRQ_S3CUART_TX3,
116 .end = IRQ_S3CUART_TX3,
117 .flags = IORESOURCE_IRQ,
118
119 },
120 [3] = {
121 .start = IRQ_S3CUART_ERR3,
122 .end = IRQ_S3CUART_ERR3,
123 .flags = IORESOURCE_IRQ,
124 },
125};
126
127
128struct s3c24xx_uart_resources s5pc1xx_uart_resources[] __initdata = {
129 [0] = {
130 .resources = s5pc1xx_uart0_resource,
131 .nr_resources = ARRAY_SIZE(s5pc1xx_uart0_resource),
132 },
133 [1] = {
134 .resources = s5pc1xx_uart1_resource,
135 .nr_resources = ARRAY_SIZE(s5pc1xx_uart1_resource),
136 },
137 [2] = {
138 .resources = s5pc1xx_uart2_resource,
139 .nr_resources = ARRAY_SIZE(s5pc1xx_uart2_resource),
140 },
141 [3] = {
142 .resources = s5pc1xx_uart3_resource,
143 .nr_resources = ARRAY_SIZE(s5pc1xx_uart3_resource),
144 },
145};
146
147/* uart devices */
148
149static struct platform_device s3c24xx_uart_device0 = {
150 .id = 0,
151};
152
153static struct platform_device s3c24xx_uart_device1 = {
154 .id = 1,
155};
156
157static struct platform_device s3c24xx_uart_device2 = {
158 .id = 2,
159};
160
161static struct platform_device s3c24xx_uart_device3 = {
162 .id = 3,
163};
164
165struct platform_device *s3c24xx_uart_src[4] = {
166 &s3c24xx_uart_device0,
167 &s3c24xx_uart_device1,
168 &s3c24xx_uart_device2,
169 &s3c24xx_uart_device3,
170};
171
172struct platform_device *s3c24xx_uart_devs[4] = {
173};
174
diff --git a/arch/arm/plat-s5pc1xx/include/plat/irqs.h b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
new file mode 100644
index 000000000000..f07d8c3b25d6
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
@@ -0,0 +1,182 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/irqs.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX - Common IRQ support
7 *
8 * Based on plat-s3c64xx/include/plat/irqs.h
9 */
10
11#ifndef __ASM_PLAT_S5PC1XX_IRQS_H
12#define __ASM_PLAT_S5PC1XX_IRQS_H __FILE__
13
14/* we keep the first set of CPU IRQs out of the range of
15 * the ISA space, so that the PC104 has them to itself
16 * and we don't end up having to do horrible things to the
17 * standard ISA drivers....
18 *
19 * note, since we're using the VICs, our start must be a
20 * mulitple of 32 to allow the common code to work
21 */
22
23#define S3C_IRQ_OFFSET (32)
24
25#define S3C_IRQ(x) ((x) + S3C_IRQ_OFFSET)
26
27#define S3C_VIC0_BASE S3C_IRQ(0)
28#define S3C_VIC1_BASE S3C_IRQ(32)
29#define S3C_VIC2_BASE S3C_IRQ(64)
30
31/* UART interrupts, each UART has 4 intterupts per channel so
32 * use the space between the ISA and S3C main interrupts. Note, these
33 * are not in the same order as the S3C24XX series! */
34
35#define IRQ_S3CUART_BASE0 (16)
36#define IRQ_S3CUART_BASE1 (20)
37#define IRQ_S3CUART_BASE2 (24)
38#define IRQ_S3CUART_BASE3 (28)
39
40#define UART_IRQ_RXD (0)
41#define UART_IRQ_ERR (1)
42#define UART_IRQ_TXD (2)
43#define UART_IRQ_MODEM (3)
44
45#define IRQ_S3CUART_RX0 (IRQ_S3CUART_BASE0 + UART_IRQ_RXD)
46#define IRQ_S3CUART_TX0 (IRQ_S3CUART_BASE0 + UART_IRQ_TXD)
47#define IRQ_S3CUART_ERR0 (IRQ_S3CUART_BASE0 + UART_IRQ_ERR)
48
49#define IRQ_S3CUART_RX1 (IRQ_S3CUART_BASE1 + UART_IRQ_RXD)
50#define IRQ_S3CUART_TX1 (IRQ_S3CUART_BASE1 + UART_IRQ_TXD)
51#define IRQ_S3CUART_ERR1 (IRQ_S3CUART_BASE1 + UART_IRQ_ERR)
52
53#define IRQ_S3CUART_RX2 (IRQ_S3CUART_BASE2 + UART_IRQ_RXD)
54#define IRQ_S3CUART_TX2 (IRQ_S3CUART_BASE2 + UART_IRQ_TXD)
55#define IRQ_S3CUART_ERR2 (IRQ_S3CUART_BASE2 + UART_IRQ_ERR)
56
57#define IRQ_S3CUART_RX3 (IRQ_S3CUART_BASE3 + UART_IRQ_RXD)
58#define IRQ_S3CUART_TX3 (IRQ_S3CUART_BASE3 + UART_IRQ_TXD)
59#define IRQ_S3CUART_ERR3 (IRQ_S3CUART_BASE3 + UART_IRQ_ERR)
60
61/* VIC based IRQs */
62
63#define S5PC1XX_IRQ_VIC0(x) (S3C_VIC0_BASE + (x))
64#define S5PC1XX_IRQ_VIC1(x) (S3C_VIC1_BASE + (x))
65#define S5PC1XX_IRQ_VIC2(x) (S3C_VIC2_BASE + (x))
66
67/*
68 * VIC0: system, DMA, timer
69 */
70#define IRQ_EINT0 S5PC1XX_IRQ_VIC0(0)
71#define IRQ_EINT1 S5PC1XX_IRQ_VIC0(1)
72#define IRQ_EINT2 S5PC1XX_IRQ_VIC0(2)
73#define IRQ_EINT3 S5PC1XX_IRQ_VIC0(3)
74#define IRQ_EINT4 S5PC1XX_IRQ_VIC0(4)
75#define IRQ_EINT5 S5PC1XX_IRQ_VIC0(5)
76#define IRQ_EINT6 S5PC1XX_IRQ_VIC0(6)
77#define IRQ_EINT7 S5PC1XX_IRQ_VIC0(7)
78#define IRQ_EINT8 S5PC1XX_IRQ_VIC0(8)
79#define IRQ_EINT9 S5PC1XX_IRQ_VIC0(9)
80#define IRQ_EINT10 S5PC1XX_IRQ_VIC0(10)
81#define IRQ_EINT11 S5PC1XX_IRQ_VIC0(11)
82#define IRQ_EINT12 S5PC1XX_IRQ_VIC0(12)
83#define IRQ_EINT13 S5PC1XX_IRQ_VIC0(13)
84#define IRQ_EINT14 S5PC1XX_IRQ_VIC0(14)
85#define IRQ_EINT15 S5PC1XX_IRQ_VIC0(15)
86#define IRQ_EINT16_31 S5PC1XX_IRQ_VIC0(16)
87#define IRQ_BATF S5PC1XX_IRQ_VIC0(17)
88#define IRQ_MDMA S5PC1XX_IRQ_VIC0(18)
89#define IRQ_PDMA0 S5PC1XX_IRQ_VIC0(19)
90#define IRQ_PDMA1 S5PC1XX_IRQ_VIC0(20)
91#define IRQ_TIMER0 S5PC1XX_IRQ_VIC0(21)
92#define IRQ_TIMER1 S5PC1XX_IRQ_VIC0(22)
93#define IRQ_TIMER2 S5PC1XX_IRQ_VIC0(23)
94#define IRQ_TIMER3 S5PC1XX_IRQ_VIC0(24)
95#define IRQ_TIMER4 S5PC1XX_IRQ_VIC0(25)
96#define IRQ_SYSTIMER S5PC1XX_IRQ_VIC0(26)
97#define IRQ_WDT S5PC1XX_IRQ_VIC0(27)
98#define IRQ_RTC_ALARM S5PC1XX_IRQ_VIC0(28)
99#define IRQ_RTC_TIC S5PC1XX_IRQ_VIC0(29)
100#define IRQ_GPIOINT S5PC1XX_IRQ_VIC0(30)
101
102/*
103 * VIC1: ARM, power, memory, connectivity
104 */
105#define IRQ_CORTEX0 S5PC1XX_IRQ_VIC1(0)
106#define IRQ_CORTEX1 S5PC1XX_IRQ_VIC1(1)
107#define IRQ_CORTEX2 S5PC1XX_IRQ_VIC1(2)
108#define IRQ_CORTEX3 S5PC1XX_IRQ_VIC1(3)
109#define IRQ_CORTEX4 S5PC1XX_IRQ_VIC1(4)
110#define IRQ_IEMAPC S5PC1XX_IRQ_VIC1(5)
111#define IRQ_IEMIEC S5PC1XX_IRQ_VIC1(6)
112#define IRQ_ONENAND S5PC1XX_IRQ_VIC1(7)
113#define IRQ_NFC S5PC1XX_IRQ_VIC1(8)
114#define IRQ_CFC S5PC1XX_IRQ_VIC1(9)
115#define IRQ_UART0 S5PC1XX_IRQ_VIC1(10)
116#define IRQ_UART1 S5PC1XX_IRQ_VIC1(11)
117#define IRQ_UART2 S5PC1XX_IRQ_VIC1(12)
118#define IRQ_UART3 S5PC1XX_IRQ_VIC1(13)
119#define IRQ_IIC S5PC1XX_IRQ_VIC1(14)
120#define IRQ_SPI0 S5PC1XX_IRQ_VIC1(15)
121#define IRQ_SPI1 S5PC1XX_IRQ_VIC1(16)
122#define IRQ_SPI2 S5PC1XX_IRQ_VIC1(17)
123#define IRQ_IRDA S5PC1XX_IRQ_VIC1(18)
124#define IRQ_CAN0 S5PC1XX_IRQ_VIC1(19)
125#define IRQ_CAN1 S5PC1XX_IRQ_VIC1(20)
126#define IRQ_HSIRX S5PC1XX_IRQ_VIC1(21)
127#define IRQ_HSITX S5PC1XX_IRQ_VIC1(22)
128#define IRQ_UHOST S5PC1XX_IRQ_VIC1(23)
129#define IRQ_OTG S5PC1XX_IRQ_VIC1(24)
130#define IRQ_MSM S5PC1XX_IRQ_VIC1(25)
131#define IRQ_HSMMC0 S5PC1XX_IRQ_VIC1(26)
132#define IRQ_HSMMC1 S5PC1XX_IRQ_VIC1(27)
133#define IRQ_HSMMC2 S5PC1XX_IRQ_VIC1(28)
134#define IRQ_MIPICSI S5PC1XX_IRQ_VIC1(29)
135#define IRQ_MIPIDSI S5PC1XX_IRQ_VIC1(30)
136
137/*
138 * VIC2: multimedia, audio, security
139 */
140#define IRQ_LCD0 S5PC1XX_IRQ_VIC2(0)
141#define IRQ_LCD1 S5PC1XX_IRQ_VIC2(1)
142#define IRQ_LCD2 S5PC1XX_IRQ_VIC2(2)
143#define IRQ_LCD3 S5PC1XX_IRQ_VIC2(3)
144#define IRQ_ROTATOR S5PC1XX_IRQ_VIC2(4)
145#define IRQ_FIMC0 S5PC1XX_IRQ_VIC2(5)
146#define IRQ_FIMC1 S5PC1XX_IRQ_VIC2(6)
147#define IRQ_FIMC2 S5PC1XX_IRQ_VIC2(7)
148#define IRQ_JPEG S5PC1XX_IRQ_VIC2(8)
149#define IRQ_2D S5PC1XX_IRQ_VIC2(9)
150#define IRQ_3D S5PC1XX_IRQ_VIC2(10)
151#define IRQ_MIXER S5PC1XX_IRQ_VIC2(11)
152#define IRQ_HDMI S5PC1XX_IRQ_VIC2(12)
153#define IRQ_IIC1 S5PC1XX_IRQ_VIC2(13)
154#define IRQ_MFC S5PC1XX_IRQ_VIC2(14)
155#define IRQ_TVENC S5PC1XX_IRQ_VIC2(15)
156#define IRQ_I2S0 S5PC1XX_IRQ_VIC2(16)
157#define IRQ_I2S1 S5PC1XX_IRQ_VIC2(17)
158#define IRQ_I2S2 S5PC1XX_IRQ_VIC2(18)
159#define IRQ_AC97 S5PC1XX_IRQ_VIC2(19)
160#define IRQ_PCM0 S5PC1XX_IRQ_VIC2(20)
161#define IRQ_PCM1 S5PC1XX_IRQ_VIC2(21)
162#define IRQ_SPDIF S5PC1XX_IRQ_VIC2(22)
163#define IRQ_ADC S5PC1XX_IRQ_VIC2(23)
164#define IRQ_PENDN S5PC1XX_IRQ_VIC2(24)
165#define IRQ_TC IRQ_PENDN
166#define IRQ_KEYPAD S5PC1XX_IRQ_VIC2(25)
167#define IRQ_CG S5PC1XX_IRQ_VIC2(26)
168#define IRQ_SEC S5PC1XX_IRQ_VIC2(27)
169#define IRQ_SECRX S5PC1XX_IRQ_VIC2(28)
170#define IRQ_SECTX S5PC1XX_IRQ_VIC2(29)
171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)
172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31)
173
174#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1)
175
176#define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE)
177#define IRQ_EINT(x) S3C_EINT(x)
178
179#define NR_IRQS (IRQ_EINT(31)+1)
180
181#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */
182
diff --git a/arch/arm/plat-s5pc1xx/include/plat/pll.h b/arch/arm/plat-s5pc1xx/include/plat/pll.h
new file mode 100644
index 000000000000..21afef1573e7
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/pll.h
@@ -0,0 +1,38 @@
1/* arch/arm/plat-s5pc1xx/include/plat/pll.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX PLL code
7 *
8 * Based on plat-s3c64xx/include/plat/pll.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define S5P_PLL_MDIV_MASK ((1 << (25-16+1)) - 1)
16#define S5P_PLL_PDIV_MASK ((1 << (13-8+1)) - 1)
17#define S5P_PLL_SDIV_MASK ((1 << (2-0+1)) - 1)
18#define S5P_PLL_MDIV_SHIFT (16)
19#define S5P_PLL_PDIV_SHIFT (8)
20#define S5P_PLL_SDIV_SHIFT (0)
21
22#include <asm/div64.h>
23
24static inline unsigned long s5pc1xx_get_pll(unsigned long baseclk,
25 u32 pllcon)
26{
27 u32 mdiv, pdiv, sdiv;
28 u64 fvco = baseclk;
29
30 mdiv = (pllcon >> S5P_PLL_MDIV_SHIFT) & S5P_PLL_MDIV_MASK;
31 pdiv = (pllcon >> S5P_PLL_PDIV_SHIFT) & S5P_PLL_PDIV_MASK;
32 sdiv = (pllcon >> S5P_PLL_SDIV_SHIFT) & S5P_PLL_SDIV_MASK;
33
34 fvco *= mdiv;
35 do_div(fvco, (pdiv << sdiv));
36
37 return (unsigned long)fvco;
38}
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
new file mode 100644
index 000000000000..75c8390cb827
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
@@ -0,0 +1,421 @@
1/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX clock register definitions
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#ifndef __PLAT_REGS_CLOCK_H
14#define __PLAT_REGS_CLOCK_H __FILE__
15
16#define S5PC1XX_CLKREG(x) (S5PC1XX_VA_CLK + (x))
17
18#define S5PC1XX_APLL_LOCK S5PC1XX_CLKREG(0x00)
19#define S5PC1XX_MPLL_LOCK S5PC1XX_CLKREG(0x04)
20#define S5PC1XX_EPLL_LOCK S5PC1XX_CLKREG(0x08)
21#define S5PC100_HPLL_LOCK S5PC1XX_CLKREG(0x0C)
22
23#define S5PC1XX_APLL_CON S5PC1XX_CLKREG(0x100)
24#define S5PC1XX_MPLL_CON S5PC1XX_CLKREG(0x104)
25#define S5PC1XX_EPLL_CON S5PC1XX_CLKREG(0x108)
26#define S5PC100_HPLL_CON S5PC1XX_CLKREG(0x10C)
27
28#define S5PC1XX_CLK_SRC0 S5PC1XX_CLKREG(0x200)
29#define S5PC1XX_CLK_SRC1 S5PC1XX_CLKREG(0x204)
30#define S5PC1XX_CLK_SRC2 S5PC1XX_CLKREG(0x208)
31#define S5PC1XX_CLK_SRC3 S5PC1XX_CLKREG(0x20C)
32
33#define S5PC1XX_CLK_DIV0 S5PC1XX_CLKREG(0x300)
34#define S5PC1XX_CLK_DIV1 S5PC1XX_CLKREG(0x304)
35#define S5PC1XX_CLK_DIV2 S5PC1XX_CLKREG(0x308)
36#define S5PC1XX_CLK_DIV3 S5PC1XX_CLKREG(0x30C)
37#define S5PC1XX_CLK_DIV4 S5PC1XX_CLKREG(0x310)
38
39#define S5PC100_CLK_OUT S5PC1XX_CLKREG(0x400)
40
41#define S5PC100_CLKGATE_D00 S5PC1XX_CLKREG(0x500)
42#define S5PC100_CLKGATE_D01 S5PC1XX_CLKREG(0x504)
43#define S5PC100_CLKGATE_D02 S5PC1XX_CLKREG(0x508)
44
45#define S5PC100_CLKGATE_D10 S5PC1XX_CLKREG(0x520)
46#define S5PC100_CLKGATE_D11 S5PC1XX_CLKREG(0x524)
47#define S5PC100_CLKGATE_D12 S5PC1XX_CLKREG(0x528)
48#define S5PC100_CLKGATE_D13 S5PC1XX_CLKREG(0x52C)
49#define S5PC100_CLKGATE_D14 S5PC1XX_CLKREG(0x530)
50#define S5PC100_CLKGATE_D15 S5PC1XX_CLKREG(0x534)
51
52#define S5PC100_CLKGATE_D20 S5PC1XX_CLKREG(0x540)
53
54#define S5PC100_SCLKGATE0 S5PC1XX_CLKREG(0x560)
55#define S5PC100_SCLKGATE1 S5PC1XX_CLKREG(0x564)
56
57#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200)
58
59#define S5PC1XX_EPLL_EN (1<<31)
60#define S5PC1XX_EPLL_MASK 0xffffffff
61#define S5PC1XX_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))
62
63/* CLKSRC0 */
64#define S5PC1XX_CLKSRC0_APLL_MASK (0x1<<0)
65#define S5PC1XX_CLKSRC0_APLL_SHIFT (0)
66#define S5PC1XX_CLKSRC0_MPLL_MASK (0x1<<4)
67#define S5PC1XX_CLKSRC0_MPLL_SHIFT (4)
68#define S5PC1XX_CLKSRC0_EPLL_MASK (0x1<<8)
69#define S5PC1XX_CLKSRC0_EPLL_SHIFT (8)
70#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12)
71#define S5PC100_CLKSRC0_HPLL_SHIFT (12)
72#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16)
73#define S5PC100_CLKSRC0_AMMUX_SHIFT (16)
74#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20)
75#define S5PC100_CLKSRC0_HREF_SHIFT (20)
76#define S5PC1XX_CLKSRC0_ONENAND_MASK (0x1<<24)
77#define S5PC1XX_CLKSRC0_ONENAND_SHIFT (24)
78
79
80/* CLKSRC1 */
81#define S5PC100_CLKSRC1_UART_MASK (0x1<<0)
82#define S5PC100_CLKSRC1_UART_SHIFT (0)
83#define S5PC100_CLKSRC1_SPI0_MASK (0x3<<4)
84#define S5PC100_CLKSRC1_SPI0_SHIFT (4)
85#define S5PC100_CLKSRC1_SPI1_MASK (0x3<<8)
86#define S5PC100_CLKSRC1_SPI1_SHIFT (8)
87#define S5PC100_CLKSRC1_SPI2_MASK (0x3<<12)
88#define S5PC100_CLKSRC1_SPI2_SHIFT (12)
89#define S5PC100_CLKSRC1_IRDA_MASK (0x3<<16)
90#define S5PC100_CLKSRC1_IRDA_SHIFT (16)
91#define S5PC100_CLKSRC1_UHOST_MASK (0x3<<20)
92#define S5PC100_CLKSRC1_UHOST_SHIFT (20)
93#define S5PC100_CLKSRC1_CLK48M_MASK (0x1<<24)
94#define S5PC100_CLKSRC1_CLK48M_SHIFT (24)
95
96/* CLKSRC2 */
97#define S5PC100_CLKSRC2_MMC0_MASK (0x3<<0)
98#define S5PC100_CLKSRC2_MMC0_SHIFT (0)
99#define S5PC100_CLKSRC2_MMC1_MASK (0x3<<4)
100#define S5PC100_CLKSRC2_MMC1_SHIFT (4)
101#define S5PC100_CLKSRC2_MMC2_MASK (0x3<<8)
102#define S5PC100_CLKSRC2_MMC2_SHIFT (8)
103#define S5PC100_CLKSRC2_LCD_MASK (0x3<<12)
104#define S5PC100_CLKSRC2_LCD_SHIFT (12)
105#define S5PC100_CLKSRC2_FIMC0_MASK (0x3<<16)
106#define S5PC100_CLKSRC2_FIMC0_SHIFT (16)
107#define S5PC100_CLKSRC2_FIMC1_MASK (0x3<<20)
108#define S5PC100_CLKSRC2_FIMC1_SHIFT (20)
109#define S5PC100_CLKSRC2_FIMC2_MASK (0x3<<24)
110#define S5PC100_CLKSRC2_FIMC2_SHIFT (24)
111#define S5PC100_CLKSRC2_MIXER_MASK (0x3<<28)
112#define S5PC100_CLKSRC2_MIXER_SHIFT (28)
113
114/* CLKSRC3 */
115#define S5PC100_CLKSRC3_PWI_MASK (0x3<<0)
116#define S5PC100_CLKSRC3_PWI_SHIFT (0)
117#define S5PC100_CLKSRC3_HCLKD2_MASK (0x1<<4)
118#define S5PC100_CLKSRC3_HCLKD2_SHIFT (4)
119#define S5PC100_CLKSRC3_I2SD2_MASK (0x3<<8)
120#define S5PC100_CLKSRC3_I2SD2_SHIFT (8)
121#define S5PC100_CLKSRC3_AUDIO0_MASK (0x7<<12)
122#define S5PC100_CLKSRC3_AUDIO0_SHIFT (12)
123#define S5PC100_CLKSRC3_AUDIO1_MASK (0x7<<16)
124#define S5PC100_CLKSRC3_AUDIO1_SHIFT (16)
125#define S5PC100_CLKSRC3_AUDIO2_MASK (0x7<<20)
126#define S5PC100_CLKSRC3_AUDIO2_SHIFT (20)
127#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24)
128#define S5PC100_CLKSRC3_SPDIF_SHIFT (24)
129
130
131/* CLKDIV0 */
132#define S5PC1XX_CLKDIV0_APLL_MASK (0x1<<0)
133#define S5PC1XX_CLKDIV0_APLL_SHIFT (0)
134#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4)
135#define S5PC100_CLKDIV0_ARM_SHIFT (4)
136#define S5PC100_CLKDIV0_D0_MASK (0x7<<8)
137#define S5PC100_CLKDIV0_D0_SHIFT (8)
138#define S5PC100_CLKDIV0_PCLKD0_MASK (0x7<<12)
139#define S5PC100_CLKDIV0_PCLKD0_SHIFT (12)
140#define S5PC100_CLKDIV0_SECSS_MASK (0x7<<16)
141#define S5PC100_CLKDIV0_SECSS_SHIFT (16)
142
143/* CLKDIV1 */
144#define S5PC100_CLKDIV1_AM_MASK (0x7<<0)
145#define S5PC100_CLKDIV1_AM_SHIFT (0)
146#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4)
147#define S5PC100_CLKDIV1_MPLL_SHIFT (4)
148#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8)
149#define S5PC100_CLKDIV1_MPLL2_SHIFT (8)
150#define S5PC100_CLKDIV1_D1_MASK (0x7<<12)
151#define S5PC100_CLKDIV1_D1_SHIFT (12)
152#define S5PC100_CLKDIV1_PCLKD1_MASK (0x7<<16)
153#define S5PC100_CLKDIV1_PCLKD1_SHIFT (16)
154#define S5PC100_CLKDIV1_ONENAND_MASK (0x3<<20)
155#define S5PC100_CLKDIV1_ONENAND_SHIFT (20)
156#define S5PC100_CLKDIV1_CAM_MASK (0x1F<<24)
157#define S5PC100_CLKDIV1_CAM_SHIFT (24)
158
159/* CLKDIV2 */
160#define S5PC100_CLKDIV2_UART_MASK (0x7<<0)
161#define S5PC100_CLKDIV2_UART_SHIFT (0)
162#define S5PC100_CLKDIV2_SPI0_MASK (0xf<<4)
163#define S5PC100_CLKDIV2_SPI0_SHIFT (4)
164#define S5PC100_CLKDIV2_SPI1_MASK (0xf<<8)
165#define S5PC100_CLKDIV2_SPI1_SHIFT (8)
166#define S5PC100_CLKDIV2_SPI2_MASK (0xf<<12)
167#define S5PC100_CLKDIV2_SPI2_SHIFT (12)
168#define S5PC100_CLKDIV2_IRDA_MASK (0xf<<16)
169#define S5PC100_CLKDIV2_IRDA_SHIFT (16)
170#define S5PC100_CLKDIV2_UHOST_MASK (0xf<<20)
171#define S5PC100_CLKDIV2_UHOST_SHIFT (20)
172
173/* CLKDIV3 */
174#define S5PC100_CLKDIV3_MMC0_MASK (0xf<<0)
175#define S5PC100_CLKDIV3_MMC0_SHIFT (0)
176#define S5PC100_CLKDIV3_MMC1_MASK (0xf<<4)
177#define S5PC100_CLKDIV3_MMC1_SHIFT (4)
178#define S5PC100_CLKDIV3_MMC2_MASK (0xf<<8)
179#define S5PC100_CLKDIV3_MMC2_SHIFT (8)
180#define S5PC100_CLKDIV3_LCD_MASK (0xf<<12)
181#define S5PC100_CLKDIV3_LCD_SHIFT (12)
182#define S5PC100_CLKDIV3_FIMC0_MASK (0xf<<16)
183#define S5PC100_CLKDIV3_FIMC0_SHIFT (16)
184#define S5PC100_CLKDIV3_FIMC1_MASK (0xf<<20)
185#define S5PC100_CLKDIV3_FIMC1_SHIFT (20)
186#define S5PC100_CLKDIV3_FIMC2_MASK (0xf<<24)
187#define S5PC100_CLKDIV3_FIMC2_SHIFT (24)
188#define S5PC100_CLKDIV3_HDMI_MASK (0xf<<28)
189#define S5PC100_CLKDIV3_HDMI_SHIFT (28)
190
191/* CLKDIV4 */
192#define S5PC100_CLKDIV4_PWI_MASK (0x7<<0)
193#define S5PC100_CLKDIV4_PWI_SHIFT (0)
194#define S5PC100_CLKDIV4_HCLKD2_MASK (0x7<<4)
195#define S5PC100_CLKDIV4_HCLKD2_SHIFT (4)
196#define S5PC100_CLKDIV4_I2SD2_MASK (0xf<<8)
197#define S5PC100_CLKDIV4_I2SD2_SHIFT (8)
198#define S5PC100_CLKDIV4_AUDIO0_MASK (0xf<<12)
199#define S5PC100_CLKDIV4_AUDIO0_SHIFT (12)
200#define S5PC100_CLKDIV4_AUDIO1_MASK (0xf<<16)
201#define S5PC100_CLKDIV4_AUDIO1_SHIFT (16)
202#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20)
203#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20)
204
205
206/* HCLKD0/PCLKD0 Clock Gate 0 Registers */
207#define S5PC100_CLKGATE_D00_INTC (1<<0)
208#define S5PC100_CLKGATE_D00_TZIC (1<<1)
209#define S5PC100_CLKGATE_D00_CFCON (1<<2)
210#define S5PC100_CLKGATE_D00_MDMA (1<<3)
211#define S5PC100_CLKGATE_D00_G2D (1<<4)
212#define S5PC100_CLKGATE_D00_SECSS (1<<5)
213#define S5PC100_CLKGATE_D00_CSSYS (1<<6)
214
215/* HCLKD0/PCLKD0 Clock Gate 1 Registers */
216#define S5PC100_CLKGATE_D01_DMC (1<<0)
217#define S5PC100_CLKGATE_D01_SROMC (1<<1)
218#define S5PC100_CLKGATE_D01_ONENAND (1<<2)
219#define S5PC100_CLKGATE_D01_NFCON (1<<3)
220#define S5PC100_CLKGATE_D01_INTMEM (1<<4)
221#define S5PC100_CLKGATE_D01_EBI (1<<5)
222
223/* PCLKD0 Clock Gate 2 Registers */
224#define S5PC100_CLKGATE_D02_SECKEY (1<<1)
225#define S5PC100_CLKGATE_D02_SDM (1<<2)
226
227/* HCLKD1/PCLKD1 Clock Gate 0 Registers */
228#define S5PC100_CLKGATE_D10_PDMA0 (1<<0)
229#define S5PC100_CLKGATE_D10_PDMA1 (1<<1)
230#define S5PC100_CLKGATE_D10_USBHOST (1<<2)
231#define S5PC100_CLKGATE_D10_USBOTG (1<<3)
232#define S5PC100_CLKGATE_D10_MODEMIF (1<<4)
233#define S5PC100_CLKGATE_D10_HSMMC0 (1<<5)
234#define S5PC100_CLKGATE_D10_HSMMC1 (1<<6)
235#define S5PC100_CLKGATE_D10_HSMMC2 (1<<7)
236
237/* HCLKD1/PCLKD1 Clock Gate 1 Registers */
238#define S5PC100_CLKGATE_D11_LCD (1<<0)
239#define S5PC100_CLKGATE_D11_ROTATOR (1<<1)
240#define S5PC100_CLKGATE_D11_FIMC0 (1<<2)
241#define S5PC100_CLKGATE_D11_FIMC1 (1<<3)
242#define S5PC100_CLKGATE_D11_FIMC2 (1<<4)
243#define S5PC100_CLKGATE_D11_JPEG (1<<5)
244#define S5PC100_CLKGATE_D11_DSI (1<<6)
245#define S5PC100_CLKGATE_D11_CSI (1<<7)
246#define S5PC100_CLKGATE_D11_G3D (1<<8)
247
248/* HCLKD1/PCLKD1 Clock Gate 2 Registers */
249#define S5PC100_CLKGATE_D12_TV (1<<0)
250#define S5PC100_CLKGATE_D12_VP (1<<1)
251#define S5PC100_CLKGATE_D12_MIXER (1<<2)
252#define S5PC100_CLKGATE_D12_HDMI (1<<3)
253#define S5PC100_CLKGATE_D12_MFC (1<<4)
254
255/* HCLKD1/PCLKD1 Clock Gate 3 Registers */
256#define S5PC100_CLKGATE_D13_CHIPID (1<<0)
257#define S5PC100_CLKGATE_D13_GPIO (1<<1)
258#define S5PC100_CLKGATE_D13_APC (1<<2)
259#define S5PC100_CLKGATE_D13_IEC (1<<3)
260#define S5PC100_CLKGATE_D13_PWM (1<<6)
261#define S5PC100_CLKGATE_D13_SYSTIMER (1<<7)
262#define S5PC100_CLKGATE_D13_WDT (1<<8)
263#define S5PC100_CLKGATE_D13_RTC (1<<9)
264
265/* HCLKD1/PCLKD1 Clock Gate 4 Registers */
266#define S5PC100_CLKGATE_D14_UART0 (1<<0)
267#define S5PC100_CLKGATE_D14_UART1 (1<<1)
268#define S5PC100_CLKGATE_D14_UART2 (1<<2)
269#define S5PC100_CLKGATE_D14_UART3 (1<<3)
270#define S5PC100_CLKGATE_D14_IIC (1<<4)
271#define S5PC100_CLKGATE_D14_HDMI_IIC (1<<5)
272#define S5PC100_CLKGATE_D14_SPI0 (1<<6)
273#define S5PC100_CLKGATE_D14_SPI1 (1<<7)
274#define S5PC100_CLKGATE_D14_SPI2 (1<<8)
275#define S5PC100_CLKGATE_D14_IRDA (1<<9)
276#define S5PC100_CLKGATE_D14_CCAN0 (1<<10)
277#define S5PC100_CLKGATE_D14_CCAN1 (1<<11)
278#define S5PC100_CLKGATE_D14_HSITX (1<<12)
279#define S5PC100_CLKGATE_D14_HSIRX (1<<13)
280
281/* HCLKD1/PCLKD1 Clock Gate 5 Registers */
282#define S5PC100_CLKGATE_D15_IIS0 (1<<0)
283#define S5PC100_CLKGATE_D15_IIS1 (1<<1)
284#define S5PC100_CLKGATE_D15_IIS2 (1<<2)
285#define S5PC100_CLKGATE_D15_AC97 (1<<3)
286#define S5PC100_CLKGATE_D15_PCM0 (1<<4)
287#define S5PC100_CLKGATE_D15_PCM1 (1<<5)
288#define S5PC100_CLKGATE_D15_SPDIF (1<<6)
289#define S5PC100_CLKGATE_D15_TSADC (1<<7)
290#define S5PC100_CLKGATE_D15_KEYIF (1<<8)
291#define S5PC100_CLKGATE_D15_CG (1<<9)
292
293/* HCLKD2 Clock Gate 0 Registers */
294#define S5PC100_CLKGATE_D20_HCLKD2 (1<<0)
295#define S5PC100_CLKGATE_D20_I2SD2 (1<<1)
296
297/* Special Clock Gate 0 Registers */
298#define S5PC1XX_CLKGATE_SCLK0_HPM (1<<0)
299#define S5PC1XX_CLKGATE_SCLK0_PWI (1<<1)
300#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2)
301#define S5PC100_CLKGATE_SCLK0_UART (1<<3)
302#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4)
303#define S5PC100_CLKGATE_SCLK0_SPI1 (1<<5)
304#define S5PC100_CLKGATE_SCLK0_SPI2 (1<<6)
305#define S5PC100_CLKGATE_SCLK0_SPI0_48 (1<<7)
306#define S5PC100_CLKGATE_SCLK0_SPI1_48 (1<<8)
307#define S5PC100_CLKGATE_SCLK0_SPI2_48 (1<<9)
308#define S5PC100_CLKGATE_SCLK0_IRDA (1<<10)
309#define S5PC100_CLKGATE_SCLK0_USBHOST (1<<11)
310#define S5PC100_CLKGATE_SCLK0_MMC0 (1<<12)
311#define S5PC100_CLKGATE_SCLK0_MMC1 (1<<13)
312#define S5PC100_CLKGATE_SCLK0_MMC2 (1<<14)
313#define S5PC100_CLKGATE_SCLK0_MMC0_48 (1<<15)
314#define S5PC100_CLKGATE_SCLK0_MMC1_48 (1<<16)
315#define S5PC100_CLKGATE_SCLK0_MMC2_48 (1<<17)
316
317/* Special Clock Gate 1 Registers */
318#define S5PC100_CLKGATE_SCLK1_LCD (1<<0)
319#define S5PC100_CLKGATE_SCLK1_FIMC0 (1<<1)
320#define S5PC100_CLKGATE_SCLK1_FIMC1 (1<<2)
321#define S5PC100_CLKGATE_SCLK1_FIMC2 (1<<3)
322#define S5PC100_CLKGATE_SCLK1_TV54 (1<<4)
323#define S5PC100_CLKGATE_SCLK1_VDAC54 (1<<5)
324#define S5PC100_CLKGATE_SCLK1_MIXER (1<<6)
325#define S5PC100_CLKGATE_SCLK1_HDMI (1<<7)
326#define S5PC100_CLKGATE_SCLK1_AUDIO0 (1<<8)
327#define S5PC100_CLKGATE_SCLK1_AUDIO1 (1<<9)
328#define S5PC100_CLKGATE_SCLK1_AUDIO2 (1<<10)
329#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11)
330#define S5PC100_CLKGATE_SCLK1_CAM (1<<12)
331
332/* register for power management */
333#define S5PC100_PWR_CFG S5PC1XX_CLKREG(0x8000)
334#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_CLKREG(0x8004)
335#define S5PC100_NORMAL_CFG S5PC1XX_CLKREG(0x8010)
336#define S5PC100_STOP_CFG S5PC1XX_CLKREG(0x8014)
337#define S5PC100_SLEEP_CFG S5PC1XX_CLKREG(0x8018)
338#define S5PC100_STOP_MEM_CFG S5PC1XX_CLKREG(0x801C)
339#define S5PC100_OSC_FREQ S5PC1XX_CLKREG(0x8100)
340#define S5PC100_OSC_STABLE S5PC1XX_CLKREG(0x8104)
341#define S5PC100_PWR_STABLE S5PC1XX_CLKREG(0x8108)
342#define S5PC100_MTC_STABLE S5PC1XX_CLKREG(0x8110)
343#define S5PC100_CLAMP_STABLE S5PC1XX_CLKREG(0x8114)
344#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200)
345#define S5PC100_RST_STAT S5PC1XX_CLKREG(0x8300)
346#define S5PC100_WAKEUP_STAT S5PC1XX_CLKREG(0x8304)
347#define S5PC100_BLK_PWR_STAT S5PC1XX_CLKREG(0x8308)
348#define S5PC100_INFORM0 S5PC1XX_CLKREG(0x8400)
349#define S5PC100_INFORM1 S5PC1XX_CLKREG(0x8404)
350#define S5PC100_INFORM2 S5PC1XX_CLKREG(0x8408)
351#define S5PC100_INFORM3 S5PC1XX_CLKREG(0x840C)
352#define S5PC100_INFORM4 S5PC1XX_CLKREG(0x8410)
353#define S5PC100_INFORM5 S5PC1XX_CLKREG(0x8414)
354#define S5PC100_INFORM6 S5PC1XX_CLKREG(0x8418)
355#define S5PC100_INFORM7 S5PC1XX_CLKREG(0x841C)
356#define S5PC100_DCGIDX_MAP0 S5PC1XX_CLKREG(0x8500)
357#define S5PC100_DCGIDX_MAP1 S5PC1XX_CLKREG(0x8504)
358#define S5PC100_DCGIDX_MAP2 S5PC1XX_CLKREG(0x8508)
359#define S5PC100_DCGPERF_MAP0 S5PC1XX_CLKREG(0x850C)
360#define S5PC100_DCGPERF_MAP1 S5PC1XX_CLKREG(0x8510)
361#define S5PC100_DVCIDX_MAP S5PC1XX_CLKREG(0x8514)
362#define S5PC100_FREQ_CPU S5PC1XX_CLKREG(0x8518)
363#define S5PC100_FREQ_DPM S5PC1XX_CLKREG(0x851C)
364#define S5PC100_DVSEMCLK_EN S5PC1XX_CLKREG(0x8520)
365#define S5PC100_APLL_CON_L8 S5PC1XX_CLKREG(0x8600)
366#define S5PC100_APLL_CON_L7 S5PC1XX_CLKREG(0x8604)
367#define S5PC100_APLL_CON_L6 S5PC1XX_CLKREG(0x8608)
368#define S5PC100_APLL_CON_L5 S5PC1XX_CLKREG(0x860C)
369#define S5PC100_APLL_CON_L4 S5PC1XX_CLKREG(0x8610)
370#define S5PC100_APLL_CON_L3 S5PC1XX_CLKREG(0x8614)
371#define S5PC100_APLL_CON_L2 S5PC1XX_CLKREG(0x8618)
372#define S5PC100_APLL_CON_L1 S5PC1XX_CLKREG(0x861C)
373#define S5PC100_IEM_CONTROL S5PC1XX_CLKREG(0x8620)
374#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_CLKREG(0x8700)
375#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_CLKREG(0x8704)
376#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_CLKREG(0x8708)
377#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_CLKREG(0x870C)
378#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_CLKREG(0x8710)
379#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_CLKREG(0x8714)
380#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_CLKREG(0x8718)
381#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_CLKREG(0x871C)
382#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_CLKREG(0x8724)
383
384#define S5PC100_SWRESET S5PC1XX_CLKREG(0x100000)
385#define S5PC100_OND_SWRESET S5PC1XX_CLKREG(0x100008)
386#define S5PC100_GEN_CTRL S5PC1XX_CLKREG(0x100100)
387#define S5PC100_GEN_STATUS S5PC1XX_CLKREG(0x100104)
388#define S5PC100_MEM_SYS_CFG S5PC1XX_CLKREG(0x100200)
389#define S5PC100_CAM_MUX_SEL S5PC1XX_CLKREG(0x100300)
390#define S5PC100_MIXER_OUT_SEL S5PC1XX_CLKREG(0x100304)
391#define S5PC100_LPMP_MODE_SEL S5PC1XX_CLKREG(0x100308)
392#define S5PC100_MIPI_PHY_CON0 S5PC1XX_CLKREG(0x100400)
393#define S5PC100_MIPI_PHY_CON1 S5PC1XX_CLKREG(0x100414)
394#define S5PC100_HDMI_PHY_CON0 S5PC1XX_CLKREG(0x100420)
395
396#define S5PC100_CFG_WFI_CLEAN (~(3<<5))
397#define S5PC100_CFG_WFI_IDLE (1<<5)
398#define S5PC100_CFG_WFI_STOP (2<<5)
399#define S5PC100_CFG_WFI_SLEEP (3<<5)
400
401#define S5PC100_OTHER_SYS_INT 24
402#define S5PC100_OTHER_STA_TYPE 23
403#define STA_TYPE_EXPON 0
404#define STA_TYPE_SFR 1
405
406#define S5PC100_PWR_STA_EXP_SCALE 0
407#define S5PC100_PWR_STA_CNT 4
408
409#define S5PC100_PWR_STABLE_COUNT 85500
410
411#define S5PC100_SLEEP_CFG_OSC_EN 0
412
413/* OTHERS Resgister */
414#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16)
415#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28)
416
417/* MIPI D-PHY Control Register 0 */
418#define S5PC100_MIPI_PHY_CON0_M_RESETN (1 << 1)
419#define S5PC100_MIPI_PHY_CON0_S_RESETN (1 << 0)
420
421#endif /* _PLAT_REGS_CLOCK_H */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
new file mode 100644
index 000000000000..45e275131665
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
@@ -0,0 +1,65 @@
1/* arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Header file for s5pc100 cpu support
7 *
8 * Based on plat-s3c64xx/include/plat/s3c6400.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15/* Common init code for S5PC100 related SoCs */
16extern int s5pc100_init(void);
17extern void s5pc100_map_io(void);
18extern void s5pc100_init_clocks(int xtal);
19extern int s5pc100_register_baseclocks(unsigned long xtal);
20extern void s5pc100_init_irq(void);
21extern void s5pc100_init_io(struct map_desc *mach_desc, int size);
22extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
23extern void s5pc100_register_clocks(void);
24extern void s5pc100_setup_clocks(void);
25extern struct sysdev_class s5pc100_sysclass;
26
27#define s5pc100_init_uarts s5pc100_common_init_uarts
28
29/* Some day, belows will be moved to plat-s5pc/include/plat/cpu.h */
30extern void s5pc1xx_init_irq(u32 *vic_valid, int num);
31extern void s5pc1xx_init_io(struct map_desc *mach_desc, int size);
32
33/* Some day, belows will be moved to plat-s5pc/include/plat/clock.h */
34extern struct clk clk_hpll;
35extern struct clk clk_hd0;
36extern struct clk clk_pd0;
37extern struct clk clk_54m;
38extern struct clk clk_dout_mpll2;
39extern void s5pc1xx_register_clocks(void);
40extern int s5pc1xx_sclk0_ctrl(struct clk *clk, int enable);
41extern int s5pc1xx_sclk1_ctrl(struct clk *clk, int enable);
42
43/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */
44extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];
45extern struct platform_device s3c_device_g2d;
46extern struct platform_device s3c_device_g3d;
47extern struct platform_device s3c_device_vpp;
48extern struct platform_device s3c_device_tvenc;
49extern struct platform_device s3c_device_tvscaler;
50extern struct platform_device s3c_device_rotator;
51extern struct platform_device s3c_device_jpeg;
52extern struct platform_device s3c_device_onenand;
53extern struct platform_device s3c_device_usb_otghcd;
54extern struct platform_device s3c_device_keypad;
55extern struct platform_device s3c_device_ts;
56extern struct platform_device s3c_device_g3d;
57extern struct platform_device s3c_device_smc911x;
58extern struct platform_device s3c_device_fimc0;
59extern struct platform_device s3c_device_fimc1;
60extern struct platform_device s3c_device_mfc;
61extern struct platform_device s3c_device_ac97;
62extern struct platform_device s3c_device_fimc0;
63extern struct platform_device s3c_device_fimc1;
64extern struct platform_device s3c_device_fimc2;
65
diff --git a/arch/arm/plat-s5pc1xx/irq.c b/arch/arm/plat-s5pc1xx/irq.c
new file mode 100644
index 000000000000..80d6dd942cb8
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/irq.c
@@ -0,0 +1,259 @@
1/* arch/arm/plat-s5pc1xx/irq.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX - Interrupt handling
7 *
8 * Based on plat-s3c64xx/irq.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/interrupt.h>
17#include <linux/irq.h>
18#include <linux/io.h>
19
20#include <asm/hardware/vic.h>
21
22#include <mach/map.h>
23#include <plat/regs-timer.h>
24#include <plat/cpu.h>
25
26/* Timer interrupt handling */
27
28static void s3c_irq_demux_timer(unsigned int base_irq, unsigned int sub_irq)
29{
30 generic_handle_irq(sub_irq);
31}
32
33static void s3c_irq_demux_timer0(unsigned int irq, struct irq_desc *desc)
34{
35 s3c_irq_demux_timer(irq, IRQ_TIMER0);
36}
37
38static void s3c_irq_demux_timer1(unsigned int irq, struct irq_desc *desc)
39{
40 s3c_irq_demux_timer(irq, IRQ_TIMER1);
41}
42
43static void s3c_irq_demux_timer2(unsigned int irq, struct irq_desc *desc)
44{
45 s3c_irq_demux_timer(irq, IRQ_TIMER2);
46}
47
48static void s3c_irq_demux_timer3(unsigned int irq, struct irq_desc *desc)
49{
50 s3c_irq_demux_timer(irq, IRQ_TIMER3);
51}
52
53static void s3c_irq_demux_timer4(unsigned int irq, struct irq_desc *desc)
54{
55 s3c_irq_demux_timer(irq, IRQ_TIMER4);
56}
57
58/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
59
60static void s3c_irq_timer_mask(unsigned int irq)
61{
62 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
63
64 reg &= 0x1f; /* mask out pending interrupts */
65 reg &= ~(1 << (irq - IRQ_TIMER0));
66 __raw_writel(reg, S3C64XX_TINT_CSTAT);
67}
68
69static void s3c_irq_timer_unmask(unsigned int irq)
70{
71 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
72
73 reg &= 0x1f; /* mask out pending interrupts */
74 reg |= 1 << (irq - IRQ_TIMER0);
75 __raw_writel(reg, S3C64XX_TINT_CSTAT);
76}
77
78static void s3c_irq_timer_ack(unsigned int irq)
79{
80 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
81
82 reg &= 0x1f;
83 reg |= (1 << 5) << (irq - IRQ_TIMER0);
84 __raw_writel(reg, S3C64XX_TINT_CSTAT);
85}
86
87static struct irq_chip s3c_irq_timer = {
88 .name = "s3c-timer",
89 .mask = s3c_irq_timer_mask,
90 .unmask = s3c_irq_timer_unmask,
91 .ack = s3c_irq_timer_ack,
92};
93
94struct uart_irq {
95 void __iomem *regs;
96 unsigned int base_irq;
97 unsigned int parent_irq;
98};
99
100/* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
101 * are consecutive when looking up the interrupt in the demux routines.
102 */
103static struct uart_irq uart_irqs[] = {
104 [0] = {
105 .regs = (void *)S3C_VA_UART0,
106 .base_irq = IRQ_S3CUART_BASE0,
107 .parent_irq = IRQ_UART0,
108 },
109 [1] = {
110 .regs = (void *)S3C_VA_UART1,
111 .base_irq = IRQ_S3CUART_BASE1,
112 .parent_irq = IRQ_UART1,
113 },
114 [2] = {
115 .regs = (void *)S3C_VA_UART2,
116 .base_irq = IRQ_S3CUART_BASE2,
117 .parent_irq = IRQ_UART2,
118 },
119 [3] = {
120 .regs = (void *)S3C_VA_UART3,
121 .base_irq = IRQ_S3CUART_BASE3,
122 .parent_irq = IRQ_UART3,
123 },
124};
125
126static inline void __iomem *s3c_irq_uart_base(unsigned int irq)
127{
128 struct uart_irq *uirq = get_irq_chip_data(irq);
129 return uirq->regs;
130}
131
132static inline unsigned int s3c_irq_uart_bit(unsigned int irq)
133{
134 return irq & 3;
135}
136
137/* UART interrupt registers, not worth adding to seperate include header */
138#define S3C64XX_UINTP 0x30
139#define S3C64XX_UINTSP 0x34
140#define S3C64XX_UINTM 0x38
141
142static void s3c_irq_uart_mask(unsigned int irq)
143{
144 void __iomem *regs = s3c_irq_uart_base(irq);
145 unsigned int bit = s3c_irq_uart_bit(irq);
146 u32 reg;
147
148 reg = __raw_readl(regs + S3C64XX_UINTM);
149 reg |= (1 << bit);
150 __raw_writel(reg, regs + S3C64XX_UINTM);
151}
152
153static void s3c_irq_uart_maskack(unsigned int irq)
154{
155 void __iomem *regs = s3c_irq_uart_base(irq);
156 unsigned int bit = s3c_irq_uart_bit(irq);
157 u32 reg;
158
159 reg = __raw_readl(regs + S3C64XX_UINTM);
160 reg |= (1 << bit);
161 __raw_writel(reg, regs + S3C64XX_UINTM);
162 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
163}
164
165static void s3c_irq_uart_unmask(unsigned int irq)
166{
167 void __iomem *regs = s3c_irq_uart_base(irq);
168 unsigned int bit = s3c_irq_uart_bit(irq);
169 u32 reg;
170
171 reg = __raw_readl(regs + S3C64XX_UINTM);
172 reg &= ~(1 << bit);
173 __raw_writel(reg, regs + S3C64XX_UINTM);
174}
175
176static void s3c_irq_uart_ack(unsigned int irq)
177{
178 void __iomem *regs = s3c_irq_uart_base(irq);
179 unsigned int bit = s3c_irq_uart_bit(irq);
180
181 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
182}
183
184static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc)
185{
186 struct uart_irq *uirq = &uart_irqs[irq - IRQ_UART0];
187 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP);
188 int base = uirq->base_irq;
189
190 if (pend & (1 << 0))
191 generic_handle_irq(base);
192 if (pend & (1 << 1))
193 generic_handle_irq(base + 1);
194 if (pend & (1 << 2))
195 generic_handle_irq(base + 2);
196 if (pend & (1 << 3))
197 generic_handle_irq(base + 3);
198}
199
200static struct irq_chip s3c_irq_uart = {
201 .name = "s3c-uart",
202 .mask = s3c_irq_uart_mask,
203 .unmask = s3c_irq_uart_unmask,
204 .mask_ack = s3c_irq_uart_maskack,
205 .ack = s3c_irq_uart_ack,
206};
207
208static void __init s5pc1xx_uart_irq(struct uart_irq *uirq)
209{
210 void __iomem *reg_base = uirq->regs;
211 unsigned int irq;
212 int offs;
213
214 /* mask all interrupts at the start. */
215 __raw_writel(0xf, reg_base + S3C64XX_UINTM);
216
217 for (offs = 0; offs < 3; offs++) {
218 irq = uirq->base_irq + offs;
219
220 set_irq_chip(irq, &s3c_irq_uart);
221 set_irq_chip_data(irq, uirq);
222 set_irq_handler(irq, handle_level_irq);
223 set_irq_flags(irq, IRQF_VALID);
224 }
225
226 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart);
227}
228
229void __init s5pc1xx_init_irq(u32 *vic_valid, int num)
230{
231 int i;
232 int uart, irq;
233
234 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
235
236 /* initialise the pair of VICs */
237 for (i = 0; i < num; i++)
238 vic_init((void *)S5PC1XX_VA_VIC(i), S3C_IRQ(i * S3C_IRQ_OFFSET),
239 vic_valid[i], 0);
240
241 /* add the timer sub-irqs */
242
243 set_irq_chained_handler(IRQ_TIMER0, s3c_irq_demux_timer0);
244 set_irq_chained_handler(IRQ_TIMER1, s3c_irq_demux_timer1);
245 set_irq_chained_handler(IRQ_TIMER2, s3c_irq_demux_timer2);
246 set_irq_chained_handler(IRQ_TIMER3, s3c_irq_demux_timer3);
247 set_irq_chained_handler(IRQ_TIMER4, s3c_irq_demux_timer4);
248
249 for (irq = IRQ_TIMER0; irq <= IRQ_TIMER4; irq++) {
250 set_irq_chip(irq, &s3c_irq_timer);
251 set_irq_handler(irq, handle_level_irq);
252 set_irq_flags(irq, IRQF_VALID);
253 }
254
255 for (uart = 0; uart < ARRAY_SIZE(uart_irqs); uart++)
256 s5pc1xx_uart_irq(&uart_irqs[uart]);
257}
258
259
diff --git a/arch/arm/plat-s5pc1xx/s5pc100-clock.c b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
new file mode 100644
index 000000000000..6b24035172fa
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
@@ -0,0 +1,1139 @@
1/* linux/arch/arm/plat-s5pc1xx/s5pc100-clock.c
2 *
3 * Copyright 2009 Samsung Electronics, Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 based common clock support
7 *
8 * Based on plat-s3c64xx/s3c6400-clock.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/errno.h>
20#include <linux/err.h>
21#include <linux/clk.h>
22#include <linux/sysdev.h>
23#include <linux/io.h>
24
25#include <mach/hardware.h>
26#include <mach/map.h>
27
28#include <plat/cpu-freq.h>
29
30#include <plat/regs-clock.h>
31#include <plat/clock.h>
32#include <plat/cpu.h>
33#include <plat/pll.h>
34#include <plat/devs.h>
35#include <plat/s5pc100.h>
36
37/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
38 * ext_xtal_mux for want of an actual name from the manual.
39*/
40
41static struct clk clk_ext_xtal_mux = {
42 .name = "ext_xtal",
43 .id = -1,
44};
45
46#define clk_fin_apll clk_ext_xtal_mux
47#define clk_fin_mpll clk_ext_xtal_mux
48#define clk_fin_epll clk_ext_xtal_mux
49#define clk_fin_hpll clk_ext_xtal_mux
50
51#define clk_fout_mpll clk_mpll
52
53struct clk_sources {
54 unsigned int nr_sources;
55 struct clk **sources;
56};
57
58struct clksrc_clk {
59 struct clk clk;
60 unsigned int mask;
61 unsigned int shift;
62
63 struct clk_sources *sources;
64
65 unsigned int divider_shift;
66 void __iomem *reg_divider;
67 void __iomem *reg_source;
68};
69
70static int clk_default_setrate(struct clk *clk, unsigned long rate)
71{
72 clk->rate = rate;
73 return 1;
74}
75
76struct clk clk_27m = {
77 .name = "clk_27m",
78 .id = -1,
79 .rate = 27000000,
80};
81
82static int clk_48m_ctrl(struct clk *clk, int enable)
83{
84 unsigned long flags;
85 u32 val;
86
87 /* can't rely on clock lock, this register has other usages */
88 local_irq_save(flags);
89
90 val = __raw_readl(S5PC1XX_CLK_SRC1);
91 if (enable)
92 val |= S5PC100_CLKSRC1_CLK48M_MASK;
93 else
94 val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
95
96 __raw_writel(val, S5PC1XX_CLK_SRC1);
97 local_irq_restore(flags);
98
99 return 0;
100}
101
102struct clk clk_48m = {
103 .name = "clk_48m",
104 .id = -1,
105 .rate = 48000000,
106 .enable = clk_48m_ctrl,
107};
108
109struct clk clk_54m = {
110 .name = "clk_54m",
111 .id = -1,
112 .rate = 54000000,
113};
114
115struct clk clk_hpll = {
116 .name = "hpll",
117 .id = -1,
118};
119
120struct clk clk_hd0 = {
121 .name = "hclkd0",
122 .id = -1,
123 .rate = 0,
124 .parent = NULL,
125 .ctrlbit = 0,
126 .set_rate = clk_default_setrate,
127};
128
129struct clk clk_pd0 = {
130 .name = "pclkd0",
131 .id = -1,
132 .rate = 0,
133 .parent = NULL,
134 .ctrlbit = 0,
135 .set_rate = clk_default_setrate,
136};
137
138static int s5pc1xx_clk_gate(void __iomem *reg,
139 struct clk *clk,
140 int enable)
141{
142 unsigned int ctrlbit = clk->ctrlbit;
143 u32 con;
144
145 con = __raw_readl(reg);
146
147 if (enable)
148 con |= ctrlbit;
149 else
150 con &= ~ctrlbit;
151
152 __raw_writel(con, reg);
153 return 0;
154}
155
156static int s5pc1xx_clk_d00_ctrl(struct clk *clk, int enable)
157{
158 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable);
159}
160
161static int s5pc1xx_clk_d01_ctrl(struct clk *clk, int enable)
162{
163 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
164}
165
166static int s5pc1xx_clk_d02_ctrl(struct clk *clk, int enable)
167{
168 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
169}
170
171static int s5pc1xx_clk_d10_ctrl(struct clk *clk, int enable)
172{
173 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable);
174}
175
176static int s5pc1xx_clk_d11_ctrl(struct clk *clk, int enable)
177{
178 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
179}
180
181static int s5pc1xx_clk_d12_ctrl(struct clk *clk, int enable)
182{
183 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable);
184}
185
186static int s5pc1xx_clk_d13_ctrl(struct clk *clk, int enable)
187{
188 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable);
189}
190
191static int s5pc1xx_clk_d14_ctrl(struct clk *clk, int enable)
192{
193 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
194}
195
196static int s5pc1xx_clk_d15_ctrl(struct clk *clk, int enable)
197{
198 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
199}
200
201static int s5pc1xx_clk_d20_ctrl(struct clk *clk, int enable)
202{
203 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable);
204}
205
206int s5pc1xx_sclk0_ctrl(struct clk *clk, int enable)
207{
208 return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable);
209}
210
211int s5pc1xx_sclk1_ctrl(struct clk *clk, int enable)
212{
213 return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable);
214}
215
216static struct clk init_clocks_disable[] = {
217 {
218 .name = "dsi",
219 .id = -1,
220 .parent = &clk_p,
221 .enable = s5pc1xx_clk_d11_ctrl,
222 .ctrlbit = S5PC100_CLKGATE_D11_DSI,
223 }, {
224 .name = "csi",
225 .id = -1,
226 .parent = &clk_h,
227 .enable = s5pc1xx_clk_d11_ctrl,
228 .ctrlbit = S5PC100_CLKGATE_D11_CSI,
229 }, {
230 .name = "ccan0",
231 .id = 0,
232 .parent = &clk_p,
233 .enable = s5pc1xx_clk_d14_ctrl,
234 .ctrlbit = S5PC100_CLKGATE_D14_CCAN0,
235 }, {
236 .name = "ccan1",
237 .id = 1,
238 .parent = &clk_p,
239 .enable = s5pc1xx_clk_d14_ctrl,
240 .ctrlbit = S5PC100_CLKGATE_D14_CCAN1,
241 }, {
242 .name = "keypad",
243 .id = -1,
244 .parent = &clk_p,
245 .enable = s5pc1xx_clk_d15_ctrl,
246 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
247 }, {
248 .name = "hclkd2",
249 .id = -1,
250 .parent = NULL,
251 .enable = s5pc1xx_clk_d20_ctrl,
252 .ctrlbit = S5PC100_CLKGATE_D20_HCLKD2,
253 }, {
254 .name = "iis-d2",
255 .id = -1,
256 .parent = NULL,
257 .enable = s5pc1xx_clk_d20_ctrl,
258 .ctrlbit = S5PC100_CLKGATE_D20_I2SD2,
259 }, {
260 .name = "otg",
261 .id = -1,
262 .parent = &clk_h,
263 .enable = s5pc1xx_clk_d10_ctrl,
264 .ctrlbit = S5PC100_CLKGATE_D10_USBOTG,
265 },
266};
267
268static struct clk init_clocks[] = {
269 /* System1 (D0_0) devices */
270 {
271 .name = "intc",
272 .id = -1,
273 .parent = &clk_hd0,
274 .enable = s5pc1xx_clk_d00_ctrl,
275 .ctrlbit = S5PC100_CLKGATE_D00_INTC,
276 }, {
277 .name = "tzic",
278 .id = -1,
279 .parent = &clk_hd0,
280 .enable = s5pc1xx_clk_d00_ctrl,
281 .ctrlbit = S5PC100_CLKGATE_D00_TZIC,
282 }, {
283 .name = "cf-ata",
284 .id = -1,
285 .parent = &clk_hd0,
286 .enable = s5pc1xx_clk_d00_ctrl,
287 .ctrlbit = S5PC100_CLKGATE_D00_CFCON,
288 }, {
289 .name = "mdma",
290 .id = -1,
291 .parent = &clk_hd0,
292 .enable = s5pc1xx_clk_d00_ctrl,
293 .ctrlbit = S5PC100_CLKGATE_D00_MDMA,
294 }, {
295 .name = "g2d",
296 .id = -1,
297 .parent = &clk_hd0,
298 .enable = s5pc1xx_clk_d00_ctrl,
299 .ctrlbit = S5PC100_CLKGATE_D00_G2D,
300 }, {
301 .name = "secss",
302 .id = -1,
303 .parent = &clk_hd0,
304 .enable = s5pc1xx_clk_d00_ctrl,
305 .ctrlbit = S5PC100_CLKGATE_D00_SECSS,
306 }, {
307 .name = "cssys",
308 .id = -1,
309 .parent = &clk_hd0,
310 .enable = s5pc1xx_clk_d00_ctrl,
311 .ctrlbit = S5PC100_CLKGATE_D00_CSSYS,
312 },
313
314 /* Memory (D0_1) devices */
315 {
316 .name = "dmc",
317 .id = -1,
318 .parent = &clk_hd0,
319 .enable = s5pc1xx_clk_d01_ctrl,
320 .ctrlbit = S5PC100_CLKGATE_D01_DMC,
321 }, {
322 .name = "sromc",
323 .id = -1,
324 .parent = &clk_hd0,
325 .enable = s5pc1xx_clk_d01_ctrl,
326 .ctrlbit = S5PC100_CLKGATE_D01_SROMC,
327 }, {
328 .name = "onenand",
329 .id = -1,
330 .parent = &clk_hd0,
331 .enable = s5pc1xx_clk_d01_ctrl,
332 .ctrlbit = S5PC100_CLKGATE_D01_ONENAND,
333 }, {
334 .name = "nand",
335 .id = -1,
336 .parent = &clk_hd0,
337 .enable = s5pc1xx_clk_d01_ctrl,
338 .ctrlbit = S5PC100_CLKGATE_D01_NFCON,
339 }, {
340 .name = "intmem",
341 .id = -1,
342 .parent = &clk_hd0,
343 .enable = s5pc1xx_clk_d01_ctrl,
344 .ctrlbit = S5PC100_CLKGATE_D01_INTMEM,
345 }, {
346 .name = "ebi",
347 .id = -1,
348 .parent = &clk_hd0,
349 .enable = s5pc1xx_clk_d01_ctrl,
350 .ctrlbit = S5PC100_CLKGATE_D01_EBI,
351 },
352
353 /* System2 (D0_2) devices */
354 {
355 .name = "seckey",
356 .id = -1,
357 .parent = &clk_pd0,
358 .enable = s5pc1xx_clk_d02_ctrl,
359 .ctrlbit = S5PC100_CLKGATE_D02_SECKEY,
360 }, {
361 .name = "sdm",
362 .id = -1,
363 .parent = &clk_hd0,
364 .enable = s5pc1xx_clk_d02_ctrl,
365 .ctrlbit = S5PC100_CLKGATE_D02_SDM,
366 },
367
368 /* File (D1_0) devices */
369 {
370 .name = "pdma0",
371 .id = -1,
372 .parent = &clk_h,
373 .enable = s5pc1xx_clk_d10_ctrl,
374 .ctrlbit = S5PC100_CLKGATE_D10_PDMA0,
375 }, {
376 .name = "pdma1",
377 .id = -1,
378 .parent = &clk_h,
379 .enable = s5pc1xx_clk_d10_ctrl,
380 .ctrlbit = S5PC100_CLKGATE_D10_PDMA1,
381 }, {
382 .name = "usb-host",
383 .id = -1,
384 .parent = &clk_h,
385 .enable = s5pc1xx_clk_d10_ctrl,
386 .ctrlbit = S5PC100_CLKGATE_D10_USBHOST,
387 }, {
388 .name = "modem",
389 .id = -1,
390 .parent = &clk_h,
391 .enable = s5pc1xx_clk_d10_ctrl,
392 .ctrlbit = S5PC100_CLKGATE_D10_MODEMIF,
393 }, {
394 .name = "hsmmc",
395 .id = 0,
396 .parent = &clk_h,
397 .enable = s5pc1xx_clk_d10_ctrl,
398 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC0,
399 }, {
400 .name = "hsmmc",
401 .id = 1,
402 .parent = &clk_h,
403 .enable = s5pc1xx_clk_d10_ctrl,
404 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC1,
405 }, {
406 .name = "hsmmc",
407 .id = 2,
408 .parent = &clk_h,
409 .enable = s5pc1xx_clk_d10_ctrl,
410 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC2,
411 },
412
413 /* Multimedia1 (D1_1) devices */
414 {
415 .name = "lcd",
416 .id = -1,
417 .parent = &clk_h,
418 .enable = s5pc1xx_clk_d11_ctrl,
419 .ctrlbit = S5PC100_CLKGATE_D11_LCD,
420 }, {
421 .name = "rotator",
422 .id = -1,
423 .parent = &clk_h,
424 .enable = s5pc1xx_clk_d11_ctrl,
425 .ctrlbit = S5PC100_CLKGATE_D11_ROTATOR,
426 }, {
427 .name = "fimc",
428 .id = 0,
429 .parent = &clk_h,
430 .enable = s5pc1xx_clk_d11_ctrl,
431 .ctrlbit = S5PC100_CLKGATE_D11_FIMC0,
432 }, {
433 .name = "fimc",
434 .id = 1,
435 .parent = &clk_h,
436 .enable = s5pc1xx_clk_d11_ctrl,
437 .ctrlbit = S5PC100_CLKGATE_D11_FIMC1,
438 }, {
439 .name = "fimc",
440 .id = 2,
441 .parent = &clk_h,
442 .enable = s5pc1xx_clk_d11_ctrl,
443 .ctrlbit = S5PC100_CLKGATE_D11_FIMC2,
444 }, {
445 .name = "jpeg",
446 .id = -1,
447 .parent = &clk_h,
448 .enable = s5pc1xx_clk_d11_ctrl,
449 .ctrlbit = S5PC100_CLKGATE_D11_JPEG,
450 }, {
451 .name = "g3d",
452 .id = -1,
453 .parent = &clk_h,
454 .enable = s5pc1xx_clk_d11_ctrl,
455 .ctrlbit = S5PC100_CLKGATE_D11_G3D,
456 },
457
458 /* Multimedia2 (D1_2) devices */
459 {
460 .name = "tv",
461 .id = -1,
462 .parent = &clk_h,
463 .enable = s5pc1xx_clk_d12_ctrl,
464 .ctrlbit = S5PC100_CLKGATE_D12_TV,
465 }, {
466 .name = "vp",
467 .id = -1,
468 .parent = &clk_h,
469 .enable = s5pc1xx_clk_d12_ctrl,
470 .ctrlbit = S5PC100_CLKGATE_D12_VP,
471 }, {
472 .name = "mixer",
473 .id = -1,
474 .parent = &clk_h,
475 .enable = s5pc1xx_clk_d12_ctrl,
476 .ctrlbit = S5PC100_CLKGATE_D12_MIXER,
477 }, {
478 .name = "hdmi",
479 .id = -1,
480 .parent = &clk_h,
481 .enable = s5pc1xx_clk_d12_ctrl,
482 .ctrlbit = S5PC100_CLKGATE_D12_HDMI,
483 }, {
484 .name = "mfc",
485 .id = -1,
486 .parent = &clk_h,
487 .enable = s5pc1xx_clk_d12_ctrl,
488 .ctrlbit = S5PC100_CLKGATE_D12_MFC,
489 },
490
491 /* System (D1_3) devices */
492 {
493 .name = "chipid",
494 .id = -1,
495 .parent = &clk_p,
496 .enable = s5pc1xx_clk_d13_ctrl,
497 .ctrlbit = S5PC100_CLKGATE_D13_CHIPID,
498 }, {
499 .name = "gpio",
500 .id = -1,
501 .parent = &clk_p,
502 .enable = s5pc1xx_clk_d13_ctrl,
503 .ctrlbit = S5PC100_CLKGATE_D13_GPIO,
504 }, {
505 .name = "apc",
506 .id = -1,
507 .parent = &clk_p,
508 .enable = s5pc1xx_clk_d13_ctrl,
509 .ctrlbit = S5PC100_CLKGATE_D13_APC,
510 }, {
511 .name = "iec",
512 .id = -1,
513 .parent = &clk_p,
514 .enable = s5pc1xx_clk_d13_ctrl,
515 .ctrlbit = S5PC100_CLKGATE_D13_IEC,
516 }, {
517 .name = "timers",
518 .id = -1,
519 .parent = &clk_p,
520 .enable = s5pc1xx_clk_d13_ctrl,
521 .ctrlbit = S5PC100_CLKGATE_D13_PWM,
522 }, {
523 .name = "systimer",
524 .id = -1,
525 .parent = &clk_p,
526 .enable = s5pc1xx_clk_d13_ctrl,
527 .ctrlbit = S5PC100_CLKGATE_D13_SYSTIMER,
528 }, {
529 .name = "watchdog",
530 .id = -1,
531 .parent = &clk_p,
532 .enable = s5pc1xx_clk_d13_ctrl,
533 .ctrlbit = S5PC100_CLKGATE_D13_WDT,
534 }, {
535 .name = "rtc",
536 .id = -1,
537 .parent = &clk_p,
538 .enable = s5pc1xx_clk_d13_ctrl,
539 .ctrlbit = S5PC100_CLKGATE_D13_RTC,
540 },
541
542 /* Connectivity (D1_4) devices */
543 {
544 .name = "uart",
545 .id = 0,
546 .parent = &clk_p,
547 .enable = s5pc1xx_clk_d14_ctrl,
548 .ctrlbit = S5PC100_CLKGATE_D14_UART0,
549 }, {
550 .name = "uart",
551 .id = 1,
552 .parent = &clk_p,
553 .enable = s5pc1xx_clk_d14_ctrl,
554 .ctrlbit = S5PC100_CLKGATE_D14_UART1,
555 }, {
556 .name = "uart",
557 .id = 2,
558 .parent = &clk_p,
559 .enable = s5pc1xx_clk_d14_ctrl,
560 .ctrlbit = S5PC100_CLKGATE_D14_UART2,
561 }, {
562 .name = "uart",
563 .id = 3,
564 .parent = &clk_p,
565 .enable = s5pc1xx_clk_d14_ctrl,
566 .ctrlbit = S5PC100_CLKGATE_D14_UART3,
567 }, {
568 .name = "i2c",
569 .id = -1,
570 .parent = &clk_p,
571 .enable = s5pc1xx_clk_d14_ctrl,
572 .ctrlbit = S5PC100_CLKGATE_D14_IIC,
573 }, {
574 .name = "hdmi-i2c",
575 .id = -1,
576 .parent = &clk_p,
577 .enable = s5pc1xx_clk_d14_ctrl,
578 .ctrlbit = S5PC100_CLKGATE_D14_HDMI_IIC,
579 }, {
580 .name = "spi",
581 .id = 0,
582 .parent = &clk_p,
583 .enable = s5pc1xx_clk_d14_ctrl,
584 .ctrlbit = S5PC100_CLKGATE_D14_SPI0,
585 }, {
586 .name = "spi",
587 .id = 1,
588 .parent = &clk_p,
589 .enable = s5pc1xx_clk_d14_ctrl,
590 .ctrlbit = S5PC100_CLKGATE_D14_SPI1,
591 }, {
592 .name = "spi",
593 .id = 2,
594 .parent = &clk_p,
595 .enable = s5pc1xx_clk_d14_ctrl,
596 .ctrlbit = S5PC100_CLKGATE_D14_SPI2,
597 }, {
598 .name = "irda",
599 .id = -1,
600 .parent = &clk_p,
601 .enable = s5pc1xx_clk_d14_ctrl,
602 .ctrlbit = S5PC100_CLKGATE_D14_IRDA,
603 }, {
604 .name = "hsitx",
605 .id = -1,
606 .parent = &clk_p,
607 .enable = s5pc1xx_clk_d14_ctrl,
608 .ctrlbit = S5PC100_CLKGATE_D14_HSITX,
609 }, {
610 .name = "hsirx",
611 .id = -1,
612 .parent = &clk_p,
613 .enable = s5pc1xx_clk_d14_ctrl,
614 .ctrlbit = S5PC100_CLKGATE_D14_HSIRX,
615 },
616
617 /* Audio (D1_5) devices */
618 {
619 .name = "iis",
620 .id = 0,
621 .parent = &clk_p,
622 .enable = s5pc1xx_clk_d15_ctrl,
623 .ctrlbit = S5PC100_CLKGATE_D15_IIS0,
624 }, {
625 .name = "iis",
626 .id = 1,
627 .parent = &clk_p,
628 .enable = s5pc1xx_clk_d15_ctrl,
629 .ctrlbit = S5PC100_CLKGATE_D15_IIS1,
630 }, {
631 .name = "iis",
632 .id = 2,
633 .parent = &clk_p,
634 .enable = s5pc1xx_clk_d15_ctrl,
635 .ctrlbit = S5PC100_CLKGATE_D15_IIS2,
636 }, {
637 .name = "ac97",
638 .id = -1,
639 .parent = &clk_p,
640 .enable = s5pc1xx_clk_d15_ctrl,
641 .ctrlbit = S5PC100_CLKGATE_D15_AC97,
642 }, {
643 .name = "pcm",
644 .id = 0,
645 .parent = &clk_p,
646 .enable = s5pc1xx_clk_d15_ctrl,
647 .ctrlbit = S5PC100_CLKGATE_D15_PCM0,
648 }, {
649 .name = "pcm",
650 .id = 1,
651 .parent = &clk_p,
652 .enable = s5pc1xx_clk_d15_ctrl,
653 .ctrlbit = S5PC100_CLKGATE_D15_PCM1,
654 }, {
655 .name = "spdif",
656 .id = -1,
657 .parent = &clk_p,
658 .enable = s5pc1xx_clk_d15_ctrl,
659 .ctrlbit = S5PC100_CLKGATE_D15_SPDIF,
660 }, {
661 .name = "adc",
662 .id = -1,
663 .parent = &clk_p,
664 .enable = s5pc1xx_clk_d15_ctrl,
665 .ctrlbit = S5PC100_CLKGATE_D15_TSADC,
666 }, {
667 .name = "keyif",
668 .id = -1,
669 .parent = &clk_p,
670 .enable = s5pc1xx_clk_d15_ctrl,
671 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
672 }, {
673 .name = "cg",
674 .id = -1,
675 .parent = &clk_p,
676 .enable = s5pc1xx_clk_d15_ctrl,
677 .ctrlbit = S5PC100_CLKGATE_D15_CG,
678 },
679
680 /* Audio (D2_0) devices: all disabled */
681
682 /* Special Clocks 1 */
683 {
684 .name = "sclk_hpm",
685 .id = -1,
686 .parent = NULL,
687 .enable = s5pc1xx_sclk0_ctrl,
688 .ctrlbit = S5PC1XX_CLKGATE_SCLK0_HPM,
689 }, {
690 .name = "sclk_onenand",
691 .id = -1,
692 .parent = NULL,
693 .enable = s5pc1xx_sclk0_ctrl,
694 .ctrlbit = S5PC100_CLKGATE_SCLK0_ONENAND,
695 }, {
696 .name = "sclk_spi_48",
697 .id = 0,
698 .parent = &clk_48m,
699 .enable = s5pc1xx_sclk0_ctrl,
700 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0_48,
701 }, {
702 .name = "sclk_spi_48",
703 .id = 1,
704 .parent = &clk_48m,
705 .enable = s5pc1xx_sclk0_ctrl,
706 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1_48,
707 }, {
708 .name = "sclk_spi_48",
709 .id = 2,
710 .parent = &clk_48m,
711 .enable = s5pc1xx_sclk0_ctrl,
712 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2_48,
713 }, {
714 .name = "sclk_mmc_48",
715 .id = 0,
716 .parent = &clk_48m,
717 .enable = s5pc1xx_sclk0_ctrl,
718 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0_48,
719 }, {
720 .name = "sclk_mmc_48",
721 .id = 1,
722 .parent = &clk_48m,
723 .enable = s5pc1xx_sclk0_ctrl,
724 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1_48,
725 }, {
726 .name = "sclk_mmc_48",
727 .id = 2,
728 .parent = &clk_48m,
729 .enable = s5pc1xx_sclk0_ctrl,
730 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2_48,
731 },
732
733 /* Special Clocks 2 */
734 {
735 .name = "sclk_tv_54",
736 .id = -1,
737 .parent = &clk_54m,
738 .enable = s5pc1xx_sclk1_ctrl,
739 .ctrlbit = S5PC100_CLKGATE_SCLK1_TV54,
740 }, {
741 .name = "sclk_vdac_54",
742 .id = -1,
743 .parent = &clk_54m,
744 .enable = s5pc1xx_sclk1_ctrl,
745 .ctrlbit = S5PC100_CLKGATE_SCLK1_VDAC54,
746 }, {
747 .name = "sclk_spdif",
748 .id = -1,
749 .parent = NULL,
750 .enable = s5pc1xx_sclk1_ctrl,
751 .ctrlbit = S5PC100_CLKGATE_SCLK1_SPDIF,
752 },
753};
754
755void __init s5pc1xx_register_clocks(void)
756{
757 struct clk *clkp;
758 int ret;
759 int ptr;
760
761 clkp = init_clocks;
762 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
763 ret = s3c24xx_register_clock(clkp);
764 if (ret < 0) {
765 printk(KERN_ERR "Failed to register clock %s (%d)\n",
766 clkp->name, ret);
767 }
768 }
769
770 clkp = init_clocks_disable;
771 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
772
773 ret = s3c24xx_register_clock(clkp);
774 if (ret < 0) {
775 printk(KERN_ERR "Failed to register clock %s (%d)\n",
776 clkp->name, ret);
777 }
778
779 (clkp->enable)(clkp, 0);
780 }
781
782 s3c_pwmclk_init();
783}
784static struct clk clk_fout_apll = {
785 .name = "fout_apll",
786 .id = -1,
787};
788
789static struct clk *clk_src_apll_list[] = {
790 [0] = &clk_fin_apll,
791 [1] = &clk_fout_apll,
792};
793
794static struct clk_sources clk_src_apll = {
795 .sources = clk_src_apll_list,
796 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
797};
798
799static struct clksrc_clk clk_mout_apll = {
800 .clk = {
801 .name = "mout_apll",
802 .id = -1,
803 },
804 .shift = S5PC1XX_CLKSRC0_APLL_SHIFT,
805 .mask = S5PC1XX_CLKSRC0_APLL_MASK,
806 .sources = &clk_src_apll,
807 .reg_source = S5PC1XX_CLK_SRC0,
808};
809
810static struct clk clk_fout_epll = {
811 .name = "fout_epll",
812 .id = -1,
813};
814
815static struct clk *clk_src_epll_list[] = {
816 [0] = &clk_fin_epll,
817 [1] = &clk_fout_epll,
818};
819
820static struct clk_sources clk_src_epll = {
821 .sources = clk_src_epll_list,
822 .nr_sources = ARRAY_SIZE(clk_src_epll_list),
823};
824
825static struct clksrc_clk clk_mout_epll = {
826 .clk = {
827 .name = "mout_epll",
828 .id = -1,
829 },
830 .shift = S5PC1XX_CLKSRC0_EPLL_SHIFT,
831 .mask = S5PC1XX_CLKSRC0_EPLL_MASK,
832 .sources = &clk_src_epll,
833 .reg_source = S5PC1XX_CLK_SRC0,
834};
835
836static struct clk *clk_src_mpll_list[] = {
837 [0] = &clk_fin_mpll,
838 [1] = &clk_fout_mpll,
839};
840
841static struct clk_sources clk_src_mpll = {
842 .sources = clk_src_mpll_list,
843 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
844};
845
846static struct clksrc_clk clk_mout_mpll = {
847 .clk = {
848 .name = "mout_mpll",
849 .id = -1,
850 },
851 .shift = S5PC1XX_CLKSRC0_MPLL_SHIFT,
852 .mask = S5PC1XX_CLKSRC0_MPLL_MASK,
853 .sources = &clk_src_mpll,
854 .reg_source = S5PC1XX_CLK_SRC0,
855};
856
857static unsigned long s5pc1xx_clk_doutmpll_get_rate(struct clk *clk)
858{
859 unsigned long rate = clk_get_rate(clk->parent);
860 unsigned long clkdiv;
861
862 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
863
864 clkdiv = __raw_readl(S5PC1XX_CLK_DIV1) & S5PC100_CLKDIV1_MPLL_MASK;
865 rate /= (clkdiv >> S5PC100_CLKDIV1_MPLL_SHIFT) + 1;
866
867 return rate;
868}
869
870static struct clk clk_dout_mpll = {
871 .name = "dout_mpll",
872 .id = -1,
873 .parent = &clk_mout_mpll.clk,
874 .get_rate = s5pc1xx_clk_doutmpll_get_rate,
875};
876
877static unsigned long s5pc1xx_clk_doutmpll2_get_rate(struct clk *clk)
878{
879 unsigned long rate = clk_get_rate(clk->parent);
880 unsigned long clkdiv;
881
882 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
883
884 clkdiv = __raw_readl(S5PC1XX_CLK_DIV1) & S5PC100_CLKDIV1_MPLL2_MASK;
885 rate /= (clkdiv >> S5PC100_CLKDIV1_MPLL2_SHIFT) + 1;
886
887 return rate;
888}
889
890struct clk clk_dout_mpll2 = {
891 .name = "dout_mpll2",
892 .id = -1,
893 .parent = &clk_mout_mpll.clk,
894 .get_rate = s5pc1xx_clk_doutmpll2_get_rate,
895};
896
897static struct clk *clkset_uart_list[] = {
898 &clk_mout_epll.clk,
899 &clk_dout_mpll,
900 NULL,
901 NULL
902};
903
904static struct clk_sources clkset_uart = {
905 .sources = clkset_uart_list,
906 .nr_sources = ARRAY_SIZE(clkset_uart_list),
907};
908
909static inline struct clksrc_clk *to_clksrc(struct clk *clk)
910{
911 return container_of(clk, struct clksrc_clk, clk);
912}
913
914static unsigned long s5pc1xx_getrate_clksrc(struct clk *clk)
915{
916 struct clksrc_clk *sclk = to_clksrc(clk);
917 unsigned long rate = clk_get_rate(clk->parent);
918 u32 clkdiv = __raw_readl(sclk->reg_divider);
919
920 clkdiv >>= sclk->divider_shift;
921 clkdiv &= 0xf;
922 clkdiv++;
923
924 rate /= clkdiv;
925 return rate;
926}
927
928static int s5pc1xx_setrate_clksrc(struct clk *clk, unsigned long rate)
929{
930 struct clksrc_clk *sclk = to_clksrc(clk);
931 void __iomem *reg = sclk->reg_divider;
932 unsigned int div;
933 u32 val;
934
935 rate = clk_round_rate(clk, rate);
936 div = clk_get_rate(clk->parent) / rate;
937 if (div > 16)
938 return -EINVAL;
939
940 val = __raw_readl(reg);
941 val &= ~(0xf << sclk->shift);
942 val |= (div - 1) << sclk->shift;
943 __raw_writel(val, reg);
944
945 return 0;
946}
947
948static int s5pc1xx_setparent_clksrc(struct clk *clk, struct clk *parent)
949{
950 struct clksrc_clk *sclk = to_clksrc(clk);
951 struct clk_sources *srcs = sclk->sources;
952 u32 clksrc = __raw_readl(sclk->reg_source);
953 int src_nr = -1;
954 int ptr;
955
956 for (ptr = 0; ptr < srcs->nr_sources; ptr++)
957 if (srcs->sources[ptr] == parent) {
958 src_nr = ptr;
959 break;
960 }
961
962 if (src_nr >= 0) {
963 clksrc &= ~sclk->mask;
964 clksrc |= src_nr << sclk->shift;
965
966 __raw_writel(clksrc, sclk->reg_source);
967 return 0;
968 }
969
970 return -EINVAL;
971}
972
973static unsigned long s5pc1xx_roundrate_clksrc(struct clk *clk,
974 unsigned long rate)
975{
976 unsigned long parent_rate = clk_get_rate(clk->parent);
977 int div;
978
979 if (rate > parent_rate)
980 rate = parent_rate;
981 else {
982 div = rate / parent_rate;
983
984 if (div == 0)
985 div = 1;
986 if (div > 16)
987 div = 16;
988
989 rate = parent_rate / div;
990 }
991
992 return rate;
993}
994
995static struct clksrc_clk clk_uart_uclk1 = {
996 .clk = {
997 .name = "uclk1",
998 .id = -1,
999 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART,
1000 .enable = s5pc1xx_sclk0_ctrl,
1001 .set_parent = s5pc1xx_setparent_clksrc,
1002 .get_rate = s5pc1xx_getrate_clksrc,
1003 .set_rate = s5pc1xx_setrate_clksrc,
1004 .round_rate = s5pc1xx_roundrate_clksrc,
1005 },
1006 .shift = S5PC100_CLKSRC1_UART_SHIFT,
1007 .mask = S5PC100_CLKSRC1_UART_MASK,
1008 .sources = &clkset_uart,
1009 .divider_shift = S5PC100_CLKDIV2_UART_SHIFT,
1010 .reg_divider = S5PC1XX_CLK_DIV2,
1011 .reg_source = S5PC1XX_CLK_SRC1,
1012};
1013
1014/* Clock initialisation code */
1015
1016static struct clksrc_clk *init_parents[] = {
1017 &clk_mout_apll,
1018 &clk_mout_epll,
1019 &clk_mout_mpll,
1020 &clk_uart_uclk1,
1021};
1022
1023static void __init_or_cpufreq s5pc1xx_set_clksrc(struct clksrc_clk *clk)
1024{
1025 struct clk_sources *srcs = clk->sources;
1026 u32 clksrc = __raw_readl(clk->reg_source);
1027
1028 clksrc &= clk->mask;
1029 clksrc >>= clk->shift;
1030
1031 if (clksrc > srcs->nr_sources || !srcs->sources[clksrc]) {
1032 printk(KERN_ERR "%s: bad source %d\n",
1033 clk->clk.name, clksrc);
1034 return;
1035 }
1036
1037 clk->clk.parent = srcs->sources[clksrc];
1038
1039 printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n",
1040 clk->clk.name, clk->clk.parent->name, clksrc,
1041 clk_get_rate(&clk->clk));
1042}
1043
1044#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
1045
1046void __init_or_cpufreq s5pc100_setup_clocks(void)
1047{
1048 struct clk *xtal_clk;
1049 unsigned long xtal;
1050 unsigned long armclk;
1051 unsigned long hclkd0;
1052 unsigned long hclk;
1053 unsigned long pclkd0;
1054 unsigned long pclk;
1055 unsigned long apll;
1056 unsigned long mpll;
1057 unsigned long hpll;
1058 unsigned long epll;
1059 unsigned int ptr;
1060 u32 clkdiv0, clkdiv1;
1061
1062 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
1063
1064 clkdiv0 = __raw_readl(S5PC1XX_CLK_DIV0);
1065 clkdiv1 = __raw_readl(S5PC1XX_CLK_DIV1);
1066
1067 printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n",
1068 __func__, clkdiv0, clkdiv1);
1069
1070 xtal_clk = clk_get(NULL, "xtal");
1071 BUG_ON(IS_ERR(xtal_clk));
1072
1073 xtal = clk_get_rate(xtal_clk);
1074 clk_put(xtal_clk);
1075
1076 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
1077
1078 apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_APLL_CON));
1079 mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_MPLL_CON));
1080 epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_EPLL_CON));
1081 hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON));
1082
1083 printk(KERN_INFO "S5PC100: PLL settings, A=%ld, M=%ld, E=%ld, H=%ld\n",
1084 apll, mpll, epll, hpll);
1085
1086 armclk = apll / GET_DIV(clkdiv0, S5PC1XX_CLKDIV0_APLL);
1087 armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM);
1088 hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0);
1089 pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0);
1090 hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1);
1091 pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1);
1092
1093 printk(KERN_INFO "S5PC100: ARMCLK=%ld, HCLKD0=%ld, PCLKD0=%ld, HCLK=%ld, PCLK=%ld\n",
1094 armclk, hclkd0, pclkd0, hclk, pclk);
1095
1096 clk_fout_apll.rate = apll;
1097 clk_fout_mpll.rate = mpll;
1098 clk_fout_epll.rate = epll;
1099 clk_fout_apll.rate = apll;
1100
1101 clk_h.rate = hclk;
1102 clk_p.rate = pclk;
1103
1104 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
1105 s5pc1xx_set_clksrc(init_parents[ptr]);
1106}
1107
1108static struct clk *clks[] __initdata = {
1109 &clk_ext_xtal_mux,
1110 &clk_mout_epll.clk,
1111 &clk_fout_epll,
1112 &clk_mout_mpll.clk,
1113 &clk_dout_mpll,
1114 &clk_uart_uclk1.clk,
1115 &clk_ext,
1116 &clk_epll,
1117 &clk_27m,
1118 &clk_48m,
1119 &clk_54m,
1120};
1121
1122void __init s5pc100_register_clocks(void)
1123{
1124 struct clk *clkp;
1125 int ret;
1126 int ptr;
1127
1128 for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
1129 clkp = clks[ptr];
1130 ret = s3c24xx_register_clock(clkp);
1131 if (ret < 0) {
1132 printk(KERN_ERR "Failed to register clock %s (%d)\n",
1133 clkp->name, ret);
1134 }
1135 }
1136
1137 clk_mpll.parent = &clk_mout_mpll.clk;
1138 clk_epll.parent = &clk_mout_epll.clk;
1139}
diff --git a/arch/arm/plat-s5pc1xx/s5pc100-init.c b/arch/arm/plat-s5pc1xx/s5pc100-init.c
new file mode 100644
index 000000000000..c58710884ceb
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/s5pc100-init.c
@@ -0,0 +1,27 @@
1/* linux/arch/arm/plat-s5pc1xx/s5pc100-init.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - CPU initialisation (common with other S5PC1XX chips)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/init.h>
16
17#include <plat/cpu.h>
18#include <plat/devs.h>
19#include <plat/s5pc100.h>
20
21/* uart registration process */
22
23void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
24{
25 /* The driver name is s3c6400-uart to reuse s3c6400_serial_drv */
26 s3c24xx_init_uartdevs("s3c6400-uart", s5pc1xx_uart_resources, cfg, no);
27}
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c0.c b/arch/arm/plat-s5pc1xx/setup-i2c0.c
new file mode 100644
index 000000000000..3d00c025fffb
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/setup-i2c0.c
@@ -0,0 +1,25 @@
1/* linux/arch/arm/plat-s5pc1xx/setup-i2c0.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Base S5PC1XX I2C bus 0 gpio configuration
7 *
8 * Based on plat-s3c64xx/setup-i2c0.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17
18struct platform_device; /* don't need the contents */
19
20#include <plat/iic.h>
21
22void s3c_i2c0_cfg_gpio(struct platform_device *dev)
23{
24 /* Pin configuration would be needed */
25}
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c1.c b/arch/arm/plat-s5pc1xx/setup-i2c1.c
new file mode 100644
index 000000000000..c8f3ca42f51d
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/setup-i2c1.c
@@ -0,0 +1,25 @@
1/* linux/arch/arm/plat-s3c64xx/setup-i2c1.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Base S5PC1XX I2C bus 1 gpio configuration
7 *
8 * Based on plat-s3c64xx/setup-i2c1.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17
18struct platform_device; /* don't need the contents */
19
20#include <plat/iic.h>
21
22void s3c_i2c1_cfg_gpio(struct platform_device *dev)
23{
24 /* Pin configuration would be needed */
25}
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index a2bed62aec21..4fa9903b83cf 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -42,6 +42,7 @@ ENTRY(vfp_null_entry)
42 mov pc, lr 42 mov pc, lr
43ENDPROC(vfp_null_entry) 43ENDPROC(vfp_null_entry)
44 44
45 .align 2
45.LCvfp: 46.LCvfp:
46 .word vfp_vector 47 .word vfp_vector
47 48
@@ -61,6 +62,7 @@ ENTRY(vfp_testing_entry)
61 mov pc, r9 @ we have handled the fault 62 mov pc, r9 @ we have handled the fault
62ENDPROC(vfp_testing_entry) 63ENDPROC(vfp_testing_entry)
63 64
65 .align 2
64VFP_arch_address: 66VFP_arch_address:
65 .word VFP_arch 67 .word VFP_arch
66 68
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 1aeae38725dd..66dc2d03b7fc 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -209,40 +209,55 @@ ENDPROC(vfp_save_state)
209last_VFP_context_address: 209last_VFP_context_address:
210 .word last_VFP_context 210 .word last_VFP_context
211 211
212ENTRY(vfp_get_float) 212 .macro tbl_branch, base, tmp, shift
213 add pc, pc, r0, lsl #3 213#ifdef CONFIG_THUMB2_KERNEL
214 adr \tmp, 1f
215 add \tmp, \tmp, \base, lsl \shift
216 mov pc, \tmp
217#else
218 add pc, pc, \base, lsl \shift
214 mov r0, r0 219 mov r0, r0
220#endif
2211:
222 .endm
223
224ENTRY(vfp_get_float)
225 tbl_branch r0, r3, #3
215 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 226 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
216 mrc p10, 0, r0, c\dr, c0, 0 @ fmrs r0, s0 2271: mrc p10, 0, r0, c\dr, c0, 0 @ fmrs r0, s0
217 mov pc, lr 228 mov pc, lr
218 mrc p10, 0, r0, c\dr, c0, 4 @ fmrs r0, s1 229 .org 1b + 8
2301: mrc p10, 0, r0, c\dr, c0, 4 @ fmrs r0, s1
219 mov pc, lr 231 mov pc, lr
232 .org 1b + 8
220 .endr 233 .endr
221ENDPROC(vfp_get_float) 234ENDPROC(vfp_get_float)
222 235
223ENTRY(vfp_put_float) 236ENTRY(vfp_put_float)
224 add pc, pc, r1, lsl #3 237 tbl_branch r1, r3, #3
225 mov r0, r0
226 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 238 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
227 mcr p10, 0, r0, c\dr, c0, 0 @ fmsr r0, s0 2391: mcr p10, 0, r0, c\dr, c0, 0 @ fmsr r0, s0
228 mov pc, lr 240 mov pc, lr
229 mcr p10, 0, r0, c\dr, c0, 4 @ fmsr r0, s1 241 .org 1b + 8
2421: mcr p10, 0, r0, c\dr, c0, 4 @ fmsr r0, s1
230 mov pc, lr 243 mov pc, lr
244 .org 1b + 8
231 .endr 245 .endr
232ENDPROC(vfp_put_float) 246ENDPROC(vfp_put_float)
233 247
234ENTRY(vfp_get_double) 248ENTRY(vfp_get_double)
235 add pc, pc, r0, lsl #3 249 tbl_branch r0, r3, #3
236 mov r0, r0
237 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 250 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
238 fmrrd r0, r1, d\dr 2511: fmrrd r0, r1, d\dr
239 mov pc, lr 252 mov pc, lr
253 .org 1b + 8
240 .endr 254 .endr
241#ifdef CONFIG_VFPv3 255#ifdef CONFIG_VFPv3
242 @ d16 - d31 registers 256 @ d16 - d31 registers
243 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 257 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
244 mrrc p11, 3, r0, r1, c\dr @ fmrrd r0, r1, d\dr 2581: mrrc p11, 3, r0, r1, c\dr @ fmrrd r0, r1, d\dr
245 mov pc, lr 259 mov pc, lr
260 .org 1b + 8
246 .endr 261 .endr
247#endif 262#endif
248 263
@@ -253,17 +268,18 @@ ENTRY(vfp_get_double)
253ENDPROC(vfp_get_double) 268ENDPROC(vfp_get_double)
254 269
255ENTRY(vfp_put_double) 270ENTRY(vfp_put_double)
256 add pc, pc, r2, lsl #3 271 tbl_branch r2, r3, #3
257 mov r0, r0
258 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 272 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
259 fmdrr d\dr, r0, r1 2731: fmdrr d\dr, r0, r1
260 mov pc, lr 274 mov pc, lr
275 .org 1b + 8
261 .endr 276 .endr
262#ifdef CONFIG_VFPv3 277#ifdef CONFIG_VFPv3
263 @ d16 - d31 registers 278 @ d16 - d31 registers
264 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 279 .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
265 mcrr p11, 3, r1, r2, c\dr @ fmdrr r1, r2, d\dr 2801: mcrr p11, 3, r1, r2, c\dr @ fmdrr r1, r2, d\dr
266 mov pc, lr 281 mov pc, lr
282 .org 1b + 8
267 .endr 283 .endr
268#endif 284#endif
269ENDPROC(vfp_put_double) 285ENDPROC(vfp_put_double)
diff --git a/arch/avr32/include/asm/pgalloc.h b/arch/avr32/include/asm/pgalloc.h
index 640821323943..92ecd8446ef8 100644
--- a/arch/avr32/include/asm/pgalloc.h
+++ b/arch/avr32/include/asm/pgalloc.h
@@ -83,7 +83,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
83 quicklist_free_page(QUICK_PT, NULL, pte); 83 quicklist_free_page(QUICK_PT, NULL, pte);
84} 84}
85 85
86#define __pte_free_tlb(tlb,pte) \ 86#define __pte_free_tlb(tlb,pte,addr) \
87do { \ 87do { \
88 pgtable_page_dtor(pte); \ 88 pgtable_page_dtor(pte); \
89 tlb_remove_page((tlb), pte); \ 89 tlb_remove_page((tlb), pte); \
diff --git a/arch/blackfin/include/asm/context.S b/arch/blackfin/include/asm/context.S
index 16561ab18b38..f8a664f022b1 100644
--- a/arch/blackfin/include/asm/context.S
+++ b/arch/blackfin/include/asm/context.S
@@ -223,9 +223,10 @@
223 [--sp] = RETN; 223 [--sp] = RETN;
224 [--sp] = RETE; 224 [--sp] = RETE;
225 [--sp] = SEQSTAT; 225 [--sp] = SEQSTAT;
226#ifdef CONFIG_KGDB 226#ifdef CONFIG_DEBUG_KERNEL
227 r1.l = lo(IPEND); 227 p1.l = lo(IPEND);
228 r1.h = hi(IPEND); 228 p1.h = hi(IPEND);
229 r1 = [p1];
229 [--sp] = r1; 230 [--sp] = r1;
230#else 231#else
231 [--sp] = r0; /* Skip IPEND as well. */ 232 [--sp] = r0; /* Skip IPEND as well. */
diff --git a/arch/blackfin/include/asm/cpu.h b/arch/blackfin/include/asm/cpu.h
index 565b8136855e..fadfa82f93b2 100644
--- a/arch/blackfin/include/asm/cpu.h
+++ b/arch/blackfin/include/asm/cpu.h
@@ -32,7 +32,6 @@ struct blackfin_cpudata {
32 struct task_struct *idle; 32 struct task_struct *idle;
33 unsigned int imemctl; 33 unsigned int imemctl;
34 unsigned int dmemctl; 34 unsigned int dmemctl;
35 unsigned long loops_per_jiffy;
36 unsigned long dcache_invld_count; 35 unsigned long dcache_invld_count;
37 unsigned long icache_invld_count; 36 unsigned long icache_invld_count;
38}; 37};
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h
index cbd52f86bb9f..0b78b873df51 100644
--- a/arch/blackfin/include/asm/hardirq.h
+++ b/arch/blackfin/include/asm/hardirq.h
@@ -6,6 +6,9 @@
6extern void ack_bad_irq(unsigned int irq); 6extern void ack_bad_irq(unsigned int irq);
7#define ack_bad_irq ack_bad_irq 7#define ack_bad_irq ack_bad_irq
8 8
9/* Define until common code gets sane defaults */
10#define HARDIRQ_BITS 9
11
9#include <asm-generic/hardirq.h> 12#include <asm-generic/hardirq.h>
10 13
11#endif 14#endif
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index d0be99be8308..a36ad8dac068 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -105,23 +105,16 @@ static inline uint32_t __pure bfin_revid(void)
105 /* Always use CHIPID, to work around ANOMALY_05000234 */ 105 /* Always use CHIPID, to work around ANOMALY_05000234 */
106 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28; 106 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28;
107 107
108#ifdef CONFIG_BF52x 108#ifdef _BOOTROM_GET_DXE_ADDRESS_TWI
109 /* ANOMALY_05000357 109 /*
110 * ANOMALY_05000364
110 * Incorrect Revision Number in DSPID Register 111 * Incorrect Revision Number in DSPID Register
111 */ 112 */
112 if (revid == 0) 113 if (ANOMALY_05000364 &&
113 switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) { 114 bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI) == 0x2796)
114 case 0x0010: 115 revid = 1;
115 revid = 0;
116 break;
117 case 0x2796:
118 revid = 1;
119 break;
120 default:
121 revid = 0xFFFF;
122 break;
123 }
124#endif 116#endif
117
125 return revid; 118 return revid;
126} 119}
127 120
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index e0bf8cc06907..9f9b82816652 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -253,32 +253,31 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
253 BUG_ON(src % 4); 253 BUG_ON(src % 4);
254 BUG_ON(size % 4); 254 BUG_ON(size % 4);
255 255
256 /* Force a sync in case a previous config reset on this channel
257 * occurred. This is needed so subsequent writes to DMA registers
258 * are not spuriously lost/corrupted.
259 */
260 __builtin_bfin_ssync();
261
262 src_ch = 0; 256 src_ch = 0;
263 /* Find an avalible memDMA channel */ 257 /* Find an avalible memDMA channel */
264 while (1) { 258 while (1) {
265 if (!src_ch || src_ch == (struct dma_register *)MDMA_S1_NEXT_DESC_PTR) { 259 if (src_ch == (struct dma_register *)MDMA_S0_NEXT_DESC_PTR) {
266 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
267 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
268 } else {
269 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR; 260 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR;
270 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR; 261 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR;
262 } else {
263 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
264 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
271 } 265 }
272 266
273 if (!bfin_read16(&src_ch->cfg)) { 267 if (!bfin_read16(&src_ch->cfg))
268 break;
269 else if (bfin_read16(&dst_ch->irq_status) & DMA_DONE) {
270 bfin_write16(&src_ch->cfg, 0);
274 break; 271 break;
275 } else {
276 if (bfin_read16(&src_ch->irq_status) & DMA_DONE)
277 bfin_write16(&src_ch->cfg, 0);
278 } 272 }
279
280 } 273 }
281 274
275 /* Force a sync in case a previous config reset on this channel
276 * occurred. This is needed so subsequent writes to DMA registers
277 * are not spuriously lost/corrupted.
278 */
279 __builtin_bfin_ssync();
280
282 /* Destination */ 281 /* Destination */
283 bfin_write32(&dst_ch->start_addr, dst); 282 bfin_write32(&dst_ch->start_addr, dst);
284 bfin_write16(&dst_ch->x_count, size >> 2); 283 bfin_write16(&dst_ch->x_count, size >> 2);
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index beffa00a93c3..6b9446271371 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -686,14 +686,12 @@ void bfin_gpio_pm_hibernate_restore(void)
686 *port_fer[bank] = gpio_bank_saved[bank].fer; 686 *port_fer[bank] = gpio_bank_saved[bank].fer;
687#endif 687#endif
688 gpio_array[bank]->inen = gpio_bank_saved[bank].inen; 688 gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
689 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
690 & gpio_bank_saved[bank].dir;
689 gpio_array[bank]->dir = gpio_bank_saved[bank].dir; 691 gpio_array[bank]->dir = gpio_bank_saved[bank].dir;
690 gpio_array[bank]->polar = gpio_bank_saved[bank].polar; 692 gpio_array[bank]->polar = gpio_bank_saved[bank].polar;
691 gpio_array[bank]->edge = gpio_bank_saved[bank].edge; 693 gpio_array[bank]->edge = gpio_bank_saved[bank].edge;
692 gpio_array[bank]->both = gpio_bank_saved[bank].both; 694 gpio_array[bank]->both = gpio_bank_saved[bank].both;
693
694 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
695 | gpio_bank_saved[bank].dir;
696
697 gpio_array[bank]->maska = gpio_bank_saved[bank].maska; 695 gpio_array[bank]->maska = gpio_bank_saved[bank].maska;
698 } 696 }
699 AWA_DUMMY_READ(maska); 697 AWA_DUMMY_READ(maska);
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index d6c067782e63..685f160a5a36 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -72,13 +72,24 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
72 } 72 }
73 73
74 /* Cover L1 memory. One 4M area for code and data each is enough. */ 74 /* Cover L1 memory. One 4M area for code and data each is enough. */
75 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) { 75 if (cpu == 0) {
76 d_tbl[i_d].addr = L1_DATA_A_START; 76 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
77 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; 77 d_tbl[i_d].addr = L1_DATA_A_START;
78 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
79 }
80 i_tbl[i_i].addr = L1_CODE_START;
81 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
78 } 82 }
79 i_tbl[i_i].addr = L1_CODE_START; 83#ifdef CONFIG_SMP
80 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; 84 else {
81 85 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
86 d_tbl[i_d].addr = COREB_L1_DATA_A_START;
87 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
88 }
89 i_tbl[i_i].addr = COREB_L1_CODE_START;
90 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
91 }
92#endif
82 first_switched_dcplb = i_d; 93 first_switched_dcplb = i_d;
83 first_switched_icplb = i_i; 94 first_switched_icplb = i_i;
84 95
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 79cad0ac5892..9da36bab7ccb 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -361,7 +361,7 @@ static inline
361int in_mem_const(unsigned long addr, unsigned long size, 361int in_mem_const(unsigned long addr, unsigned long size,
362 unsigned long const_addr, unsigned long const_size) 362 unsigned long const_addr, unsigned long const_size)
363{ 363{
364 return in_mem_const_off(addr, 0, size, const_addr, const_size); 364 return in_mem_const_off(addr, size, 0, const_addr, const_size);
365} 365}
366#define IN_ASYNC(bnum, bctlnum) \ 366#define IN_ASYNC(bnum, bctlnum) \
367({ \ 367({ \
@@ -390,13 +390,13 @@ int bfin_mem_access_type(unsigned long addr, unsigned long size)
390 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH)) 390 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH))
391 return cpu == 0 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 391 return cpu == 0 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
392#ifdef COREB_L1_CODE_START 392#ifdef COREB_L1_CODE_START
393 if (in_mem_const(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH)) 393 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH))
394 return cpu == 1 ? BFIN_MEM_ACCESS_ITEST : BFIN_MEM_ACCESS_IDMA; 394 return cpu == 1 ? BFIN_MEM_ACCESS_ITEST : BFIN_MEM_ACCESS_IDMA;
395 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) 395 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
396 return cpu == 1 ? BFIN_MEM_ACCESS_CORE_ONLY : -EFAULT; 396 return cpu == 1 ? BFIN_MEM_ACCESS_CORE_ONLY : -EFAULT;
397 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH)) 397 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH))
398 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 398 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
399 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH)) 399 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH))
400 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 400 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
401#endif 401#endif
402 if (in_mem_const(addr, size, L2_START, L2_LENGTH)) 402 if (in_mem_const(addr, size, L2_START, L2_LENGTH))
@@ -472,13 +472,13 @@ int _access_ok(unsigned long addr, unsigned long size)
472 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH)) 472 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH))
473 return 1; 473 return 1;
474#ifdef COREB_L1_CODE_START 474#ifdef COREB_L1_CODE_START
475 if (in_mem_const(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH)) 475 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH))
476 return 1; 476 return 1;
477 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) 477 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
478 return 1; 478 return 1;
479 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH)) 479 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH))
480 return 1; 480 return 1;
481 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH)) 481 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH))
482 return 1; 482 return 1;
483#endif 483#endif
484 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH)) 484 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH))
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index d76618db50df..6a387eec6b65 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -31,7 +31,6 @@
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/smp_lock.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
36#include <linux/ptrace.h> 35#include <linux/ptrace.h>
37#include <linux/user.h> 36#include <linux/user.h>
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 6136c33e919f..6225edae488e 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -168,7 +168,6 @@ void __cpuinit bfin_setup_cpudata(unsigned int cpu)
168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu); 168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu);
169 169
170 cpudata->idle = current; 170 cpudata->idle = current;
171 cpudata->loops_per_jiffy = loops_per_jiffy;
172 cpudata->imemctl = bfin_read_IMEM_CONTROL(); 171 cpudata->imemctl = bfin_read_IMEM_CONTROL();
173 cpudata->dmemctl = bfin_read_DMEM_CONTROL(); 172 cpudata->dmemctl = bfin_read_DMEM_CONTROL();
174} 173}
@@ -568,17 +567,23 @@ static __init void memory_setup(void)
568# endif /* ANOMALY_05000263 */ 567# endif /* ANOMALY_05000263 */
569# endif /* CONFIG_ROMFS_FS */ 568# endif /* CONFIG_ROMFS_FS */
570 569
571 memory_end -= mtd_size; 570 /* Since the default MTD_UCLINUX has no magic number, we just blindly
572 571 * read 8 past the end of the kernel's image, and look at it.
573 if (mtd_size == 0) { 572 * When no image is attached, mtd_size is set to a random number
574 console_init(); 573 * Do some basic sanity checks before operating on things
575 panic("Don't boot kernel without rootfs attached."); 574 */
575 if (mtd_size == 0 || memory_end <= mtd_size) {
576 pr_emerg("Could not find valid ram mtd attached.\n");
577 } else {
578 memory_end -= mtd_size;
579
580 /* Relocate MTD image to the top of memory after the uncached memory area */
581 uclinux_ram_map.phys = memory_mtd_start = memory_end;
582 uclinux_ram_map.size = mtd_size;
583 pr_info("Found mtd parition at 0x%p, (len=0x%lx), moving to 0x%p\n",
584 _end, mtd_size, (void *)memory_mtd_start);
585 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
576 } 586 }
577
578 /* Relocate MTD image to the top of memory after the uncached memory area */
579 uclinux_ram_map.phys = memory_mtd_start = memory_end;
580 uclinux_ram_map.size = mtd_size;
581 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
582#endif /* CONFIG_MTD_UCLINUX */ 587#endif /* CONFIG_MTD_UCLINUX */
583 588
584#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263) 589#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263)
@@ -868,13 +873,6 @@ void __init setup_arch(char **cmdline_p)
868 else 873 else
869 printk(KERN_CONT "and Disabled\n"); 874 printk(KERN_CONT "and Disabled\n");
870 875
871#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
872 /* we need to initialize the Flashrom device here since we might
873 * do things with flash early on in the boot
874 */
875 flash_probe();
876#endif
877
878 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); 876 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF);
879 877
880 /* Newer parts mirror SWRST bits in SYSCR */ 878 /* Newer parts mirror SWRST bits in SYSCR */
@@ -938,10 +936,6 @@ void __init setup_arch(char **cmdline_p)
938 CPU, bfin_revid()); 936 CPU, bfin_revid());
939 } 937 }
940 938
941 /* We can't run on BF548-0.1 due to ANOMALY 05000448 */
942 if (bfin_cpuid() == 0x27de && bfin_revid() == 1)
943 panic("You can't run on this processor due to 05000448");
944
945 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 939 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
946 940
947 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", 941 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
@@ -1164,9 +1158,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1164 sclk/1000000, sclk%1000000); 1158 sclk/1000000, sclk%1000000);
1165 seq_printf(m, "bogomips\t: %lu.%02lu\n" 1159 seq_printf(m, "bogomips\t: %lu.%02lu\n"
1166 "Calibration\t: %lu loops\n", 1160 "Calibration\t: %lu loops\n",
1167 (cpudata->loops_per_jiffy * HZ) / 500000, 1161 (loops_per_jiffy * HZ) / 500000,
1168 ((cpudata->loops_per_jiffy * HZ) / 5000) % 100, 1162 ((loops_per_jiffy * HZ) / 5000) % 100,
1169 (cpudata->loops_per_jiffy * HZ)); 1163 (loops_per_jiffy * HZ));
1170 1164
1171 /* Check Cache configutation */ 1165 /* Check Cache configutation */
1172 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) { 1166 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) {
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index a8f1329c15a4..3da60fb13ce4 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -29,7 +29,6 @@
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 30 */
31 31
32#include <linux/smp_lock.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/sem.h> 33#include <linux/sem.h>
35#include <linux/msg.h> 34#include <linux/msg.h>
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 8a1caf2bb5b9..bf2b2d1f8ae5 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -570,11 +570,12 @@ asmlinkage void trap_c(struct pt_regs *fp)
570 if (kernel_mode_regs(fp) || (current && !current->mm)) { 570 if (kernel_mode_regs(fp) || (current && !current->mm)) {
571 console_verbose(); 571 console_verbose();
572 oops_in_progress = 1; 572 oops_in_progress = 1;
573 if (strerror)
574 verbose_printk(strerror);
575 } 573 }
576 574
577 if (sig != SIGTRAP) { 575 if (sig != SIGTRAP) {
576 if (strerror)
577 verbose_printk(strerror);
578
578 dump_bfin_process(fp); 579 dump_bfin_process(fp);
579 dump_bfin_mem(fp); 580 dump_bfin_mem(fp);
580 show_regs(fp); 581 show_regs(fp);
@@ -619,7 +620,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
619 force_sig_info(sig, &info, current); 620 force_sig_info(sig, &info, current);
620 } 621 }
621 622
622 if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) 623 if ((ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) ||
624 (ANOMALY_05000281 && trapnr == VEC_HWERR) ||
625 (ANOMALY_05000189 && (trapnr == VEC_CPLB_I_VL || trapnr == VEC_CPLB_VL)))
623 fp->pc = SAFE_USER_INSTRUCTION; 626 fp->pc = SAFE_USER_INSTRUCTION;
624 627
625 traps_done: 628 traps_done:
diff --git a/arch/blackfin/lib/lshrdi3.c b/arch/blackfin/lib/lshrdi3.c
index 84b9c5592220..e57bf6fbdf3f 100644
--- a/arch/blackfin/lib/lshrdi3.c
+++ b/arch/blackfin/lib/lshrdi3.c
@@ -27,21 +27,7 @@
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 28 */
29 29
30#define BITS_PER_UNIT 8 30#include "gcclib.h"
31
32typedef int SItype __attribute__ ((mode(SI)));
33typedef unsigned int USItype __attribute__ ((mode(SI)));
34typedef int DItype __attribute__ ((mode(DI)));
35typedef int word_type __attribute__ ((mode(__word__)));
36
37struct DIstruct {
38 SItype high, low;
39};
40
41typedef union {
42 struct DIstruct s;
43 DItype ll;
44} DIunion;
45 31
46#ifdef CONFIG_ARITHMETIC_OPS_L1 32#ifdef CONFIG_ARITHMETIC_OPS_L1
47DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text)); 33DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text));
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index d9791106be9f..809be268e42d 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -534,7 +534,7 @@ static struct platform_device i2c_bfin_twi_device = {
534#endif 534#endif
535 535
536static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 536static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
537#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 537#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
538 { 538 {
539 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 539 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
540 }, 540 },
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index 426e064062a0..753ed810e1c6 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -82,6 +82,7 @@
82#define ANOMALY_05000179 (0) 82#define ANOMALY_05000179 (0)
83#define ANOMALY_05000182 (0) 83#define ANOMALY_05000182 (0)
84#define ANOMALY_05000183 (0) 84#define ANOMALY_05000183 (0)
85#define ANOMALY_05000189 (0)
85#define ANOMALY_05000198 (0) 86#define ANOMALY_05000198 (0)
86#define ANOMALY_05000202 (0) 87#define ANOMALY_05000202 (0)
87#define ANOMALY_05000215 (0) 88#define ANOMALY_05000215 (0)
@@ -117,6 +118,7 @@
117#define ANOMALY_05000357 (0) 118#define ANOMALY_05000357 (0)
118#define ANOMALY_05000362 (1) 119#define ANOMALY_05000362 (1)
119#define ANOMALY_05000363 (0) 120#define ANOMALY_05000363 (0)
121#define ANOMALY_05000364 (0)
120#define ANOMALY_05000371 (0) 122#define ANOMALY_05000371 (0)
121#define ANOMALY_05000380 (0) 123#define ANOMALY_05000380 (0)
122#define ANOMALY_05000386 (0) 124#define ANOMALY_05000386 (0)
diff --git a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
index 0fb2ce5d840e..dbade93395eb 100644
--- a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index f4867ce0c618..b09484f538f4 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -793,7 +793,7 @@ static struct platform_device i2c_bfin_twi_device = {
793#endif 793#endif
794 794
795static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 795static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
797 { 797 {
798 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 798 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
799 .type = "pcf8574_lcd", 799 .type = "pcf8574_lcd",
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index b2f30f06b73e..2ad68cd10ae6 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -591,7 +591,7 @@ static struct platform_device i2c_bfin_twi_device = {
591#endif 591#endif
592 592
593static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 593static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
594#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 594#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
595 { 595 {
596 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 596 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
597 }, 597 },
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 799a1d1fa890..75e563d3f9d4 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -858,7 +858,7 @@ static struct platform_device i2c_bfin_twi_device = {
858#endif 858#endif
859 859
860static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 860static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
861#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 861#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
862 { 862 {
863 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 863 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
864 }, 864 },
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index 0d63f7406168..c438ca89d8c9 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -176,6 +176,8 @@
176#define ANOMALY_05000443 (1) 176#define ANOMALY_05000443 (1)
177/* The WURESET Bit in the SYSCR Register is not Functional */ 177/* The WURESET Bit in the SYSCR Register is not Functional */
178#define ANOMALY_05000445 (1) 178#define ANOMALY_05000445 (1)
179/* USB DMA Short Packet Data Corruption */
180#define ANOMALY_05000450 (1)
179/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */ 181/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */
180#define ANOMALY_05000451 (1) 182#define ANOMALY_05000451 (1)
181/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */ 183/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */
@@ -201,6 +203,7 @@
201#define ANOMALY_05000179 (0) 203#define ANOMALY_05000179 (0)
202#define ANOMALY_05000182 (0) 204#define ANOMALY_05000182 (0)
203#define ANOMALY_05000183 (0) 205#define ANOMALY_05000183 (0)
206#define ANOMALY_05000189 (0)
204#define ANOMALY_05000198 (0) 207#define ANOMALY_05000198 (0)
205#define ANOMALY_05000202 (0) 208#define ANOMALY_05000202 (0)
206#define ANOMALY_05000215 (0) 209#define ANOMALY_05000215 (0)
@@ -238,6 +241,5 @@
238#define ANOMALY_05000412 (0) 241#define ANOMALY_05000412 (0)
239#define ANOMALY_05000447 (0) 242#define ANOMALY_05000447 (0)
240#define ANOMALY_05000448 (0) 243#define ANOMALY_05000448 (0)
241#define ANOMALY_05000450 (0)
242 244
243#endif 245#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
index a625659dd67f..ebd6cebc1fbc 100644
--- a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index a68ade8a3ca2..3d743ccaff6a 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -453,7 +453,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
453 .irq = 39, 453 .irq = 39,
454 }, 454 },
455#endif 455#endif
456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
457 { 457 {
458 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 458 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
459 }, 459 },
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index 70a0ad69c610..cd83db2fb1a1 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -335,6 +335,7 @@
335#define ANOMALY_05000323 (0) 335#define ANOMALY_05000323 (0)
336#define ANOMALY_05000353 (1) 336#define ANOMALY_05000353 (1)
337#define ANOMALY_05000362 (1) 337#define ANOMALY_05000362 (1)
338#define ANOMALY_05000364 (0)
338#define ANOMALY_05000380 (0) 339#define ANOMALY_05000380 (0)
339#define ANOMALY_05000386 (1) 340#define ANOMALY_05000386 (1)
340#define ANOMALY_05000389 (0) 341#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
index a3789d7ccf8c..4062e24e759b 100644
--- a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index c1f76dd2c4ed..bd656907b8c0 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1313,10 +1313,10 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
1314 { 1314 {
1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C), 1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
1316 .irq = IRQ_PF5, 1316 .irq = IRQ_PG5,
1317 }, 1317 },
1318#endif 1318#endif
1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1320 { 1320 {
1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1322 }, 1322 },
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index 57c128cc3b64..e66aa131f517 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -167,6 +167,7 @@
167#define ANOMALY_05000179 (0) 167#define ANOMALY_05000179 (0)
168#define ANOMALY_05000182 (0) 168#define ANOMALY_05000182 (0)
169#define ANOMALY_05000183 (0) 169#define ANOMALY_05000183 (0)
170#define ANOMALY_05000189 (0)
170#define ANOMALY_05000198 (0) 171#define ANOMALY_05000198 (0)
171#define ANOMALY_05000202 (0) 172#define ANOMALY_05000202 (0)
172#define ANOMALY_05000215 (0) 173#define ANOMALY_05000215 (0)
@@ -186,6 +187,7 @@
186#define ANOMALY_05000353 (1) 187#define ANOMALY_05000353 (1)
187#define ANOMALY_05000362 (1) 188#define ANOMALY_05000362 (1)
188#define ANOMALY_05000363 (0) 189#define ANOMALY_05000363 (0)
190#define ANOMALY_05000364 (0)
189#define ANOMALY_05000380 (0) 191#define ANOMALY_05000380 (0)
190#define ANOMALY_05000386 (1) 192#define ANOMALY_05000386 (1)
191#define ANOMALY_05000389 (0) 193#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
index b86662fb9de7..e95d54f9af6c 100644
--- a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index c97acdf85cd3..451cf8a82a42 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -137,6 +137,7 @@
137#define ANOMALY_05000158 (0) 137#define ANOMALY_05000158 (0)
138#define ANOMALY_05000171 (0) 138#define ANOMALY_05000171 (0)
139#define ANOMALY_05000182 (0) 139#define ANOMALY_05000182 (0)
140#define ANOMALY_05000189 (0)
140#define ANOMALY_05000198 (0) 141#define ANOMALY_05000198 (0)
141#define ANOMALY_05000202 (0) 142#define ANOMALY_05000202 (0)
142#define ANOMALY_05000215 (0) 143#define ANOMALY_05000215 (0)
@@ -160,6 +161,7 @@
160#define ANOMALY_05000353 (1) 161#define ANOMALY_05000353 (1)
161#define ANOMALY_05000362 (1) 162#define ANOMALY_05000362 (1)
162#define ANOMALY_05000363 (0) 163#define ANOMALY_05000363 (0)
164#define ANOMALY_05000364 (0)
163#define ANOMALY_05000380 (0) 165#define ANOMALY_05000380 (0)
164#define ANOMALY_05000386 (1) 166#define ANOMALY_05000386 (1)
165#define ANOMALY_05000389 (0) 167#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
index c536551eb4b8..999f239fe1a6 100644
--- a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 81f5b95cc361..dc0dd9b2bcef 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -864,7 +864,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
864 864
865#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 865#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
866static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { 866static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
868 { 868 {
869 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 869 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
870 }, 870 },
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 18a4cd24f673..cd040fe0bc5c 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -195,6 +195,7 @@
195#define ANOMALY_05000179 (0) 195#define ANOMALY_05000179 (0)
196#define ANOMALY_05000182 (0) 196#define ANOMALY_05000182 (0)
197#define ANOMALY_05000183 (0) 197#define ANOMALY_05000183 (0)
198#define ANOMALY_05000189 (0)
198#define ANOMALY_05000198 (0) 199#define ANOMALY_05000198 (0)
199#define ANOMALY_05000202 (0) 200#define ANOMALY_05000202 (0)
200#define ANOMALY_05000215 (0) 201#define ANOMALY_05000215 (0)
@@ -226,6 +227,7 @@
226#define ANOMALY_05000323 (0) 227#define ANOMALY_05000323 (0)
227#define ANOMALY_05000362 (1) 228#define ANOMALY_05000362 (1)
228#define ANOMALY_05000363 (0) 229#define ANOMALY_05000363 (0)
230#define ANOMALY_05000364 (0)
229#define ANOMALY_05000380 (0) 231#define ANOMALY_05000380 (0)
230#define ANOMALY_05000400 (0) 232#define ANOMALY_05000400 (0)
231#define ANOMALY_05000412 (0) 233#define ANOMALY_05000412 (0)
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index 94b8e277f09d..a5312b2d267e 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -288,6 +288,7 @@
288#define ANOMALY_05000273 (0) 288#define ANOMALY_05000273 (0)
289#define ANOMALY_05000311 (0) 289#define ANOMALY_05000311 (0)
290#define ANOMALY_05000353 (1) 290#define ANOMALY_05000353 (1)
291#define ANOMALY_05000364 (0)
291#define ANOMALY_05000380 (0) 292#define ANOMALY_05000380 (0)
292#define ANOMALY_05000386 (1) 293#define ANOMALY_05000386 (1)
293#define ANOMALY_05000389 (0) 294#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
index a1b50878553f..fd5e8878b8c4 100644
--- a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf561/include/mach/mem_map.h b/arch/blackfin/mach-bf561/include/mach/mem_map.h
index a63e15c86d90..5b96ea549a04 100644
--- a/arch/blackfin/mach-bf561/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf561/include/mach/mem_map.h
@@ -37,7 +37,6 @@
37 37
38/* Memory Map for ADSP-BF561 processors */ 38/* Memory Map for ADSP-BF561 processors */
39 39
40#ifdef CONFIG_BF561
41#define COREA_L1_CODE_START 0xFFA00000 40#define COREA_L1_CODE_START 0xFFA00000
42#define COREA_L1_DATA_A_START 0xFF800000 41#define COREA_L1_DATA_A_START 0xFF800000
43#define COREA_L1_DATA_B_START 0xFF900000 42#define COREA_L1_DATA_B_START 0xFF900000
@@ -74,6 +73,28 @@
74#define BFIN_DCACHESIZE (0*1024) 73#define BFIN_DCACHESIZE (0*1024)
75#define BFIN_DSUPBANKS 0 74#define BFIN_DSUPBANKS 0
76#endif /*CONFIG_BFIN_DCACHE*/ 75#endif /*CONFIG_BFIN_DCACHE*/
76
77/*
78 * If we are in SMP mode, then the cache settings of Core B will match
79 * the settings of Core A. If we aren't, then we assume Core B is not
80 * using any cache. This allows the rest of the kernel to work with
81 * the core in either mode as we are only loading user code into it and
82 * it is the user's problem to make sure they aren't doing something
83 * stupid there.
84 *
85 * Note that we treat the L1 code region as a contiguous blob to make
86 * the rest of the kernel simpler. Easier to check one region than a
87 * bunch of small ones. Again, possible misbehavior here is the fault
88 * of the user -- don't try to use memory that doesn't exist.
89 */
90#ifdef CONFIG_SMP
91# define COREB_L1_CODE_LENGTH L1_CODE_LENGTH
92# define COREB_L1_DATA_A_LENGTH L1_DATA_A_LENGTH
93# define COREB_L1_DATA_B_LENGTH L1_DATA_B_LENGTH
94#else
95# define COREB_L1_CODE_LENGTH 0x14000
96# define COREB_L1_DATA_A_LENGTH 0x8000
97# define COREB_L1_DATA_B_LENGTH 0x8000
77#endif 98#endif
78 99
79/* Level 2 Memory */ 100/* Level 2 Memory */
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 5a4e7c7fd92c..fb1795d5be2a 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -218,7 +218,7 @@ ENTRY(_ex_single_step)
218 /* Single stepping only a single instruction, so clear the trace 218 /* Single stepping only a single instruction, so clear the trace
219 * bit here. */ 219 * bit here. */
220 r7 = syscfg; 220 r7 = syscfg;
221 bitclr (r7, 0); 221 bitclr (r7, SYSCFG_SSSTEP_P);
222 syscfg = R7; 222 syscfg = R7;
223 jump _ex_trap_c; 223 jump _ex_trap_c;
224 224
@@ -251,7 +251,7 @@ ENTRY(_ex_single_step)
251 if !cc jump _bfin_return_from_exception; 251 if !cc jump _bfin_return_from_exception;
252 252
253 r7 = syscfg; 253 r7 = syscfg;
254 bitclr (r7, 0); 254 bitclr (r7, SYSCFG_SSSTEP_P); /* Turn off single step */
255 syscfg = R7; 255 syscfg = R7;
256 256
257 /* Fall through to _bfin_return_from_exception. */ 257 /* Fall through to _bfin_return_from_exception. */
@@ -342,9 +342,11 @@ ENTRY(_ex_trap_c)
342 r6 = retx; 342 r6 = retx;
343 [p5 + PDA_RETX] = r6; 343 [p5 + PDA_RETX] = r6;
344#endif 344#endif
345 /* Save the state of single stepping */
345 r6 = SYSCFG; 346 r6 = SYSCFG;
346 [p5 + PDA_SYSCFG] = r6; 347 [p5 + PDA_SYSCFG] = r6;
347 BITCLR(r6, 0); 348 /* Clear it while we handle the exception in IRQ5 mode */
349 BITCLR(r6, SYSCFG_SSSTEP_P);
348 SYSCFG = r6; 350 SYSCFG = r6;
349 351
350 /* Disable all interrupts, but make sure level 5 is enabled so 352 /* Disable all interrupts, but make sure level 5 is enabled so
@@ -367,7 +369,7 @@ ENDPROC(_ex_trap_c)
367 * exception. This is a unrecoverable event, so crash. 369 * exception. This is a unrecoverable event, so crash.
368 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ... 370 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ...
369 */ 371 */
370_double_fault: 372ENTRY(_double_fault)
371 /* Turn caches & protection off, to ensure we don't get any more 373 /* Turn caches & protection off, to ensure we don't get any more
372 * double exceptions 374 * double exceptions
373 */ 375 */
@@ -872,7 +874,7 @@ ENTRY(_ret_from_exception)
872 raise 15; /* raise evt15 to do signal or reschedule */ 874 raise 15; /* raise evt15 to do signal or reschedule */
8734: 8754:
874 r0 = syscfg; 876 r0 = syscfg;
875 bitclr(r0, 0); 877 bitclr(r0, SYSCFG_SSSTEP_P); /* Turn off single step */
876 syscfg = r0; 878 syscfg = r0;
8775: 8795:
878 rts; 880 rts;
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 61840059dfac..349ee3f5466a 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -211,6 +211,8 @@ int smp_call_function(void (*func)(void *info), void *info, int wait)
211 return 0; 211 return 0;
212 212
213 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 213 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
214 if (!msg)
215 return -ENOMEM;
214 INIT_LIST_HEAD(&msg->list); 216 INIT_LIST_HEAD(&msg->list);
215 msg->call_struct.func = func; 217 msg->call_struct.func = func;
216 msg->call_struct.info = info; 218 msg->call_struct.info = info;
@@ -252,6 +254,8 @@ int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
252 cpu_set(cpu, callmap); 254 cpu_set(cpu, callmap);
253 255
254 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 256 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
257 if (!msg)
258 return -ENOMEM;
255 INIT_LIST_HEAD(&msg->list); 259 INIT_LIST_HEAD(&msg->list);
256 msg->call_struct.func = func; 260 msg->call_struct.func = func;
257 msg->call_struct.info = info; 261 msg->call_struct.info = info;
@@ -287,6 +291,8 @@ void smp_send_reschedule(int cpu)
287 return; 291 return;
288 292
289 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 293 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
294 if (!msg)
295 return;
290 memset(msg, 0, sizeof(msg)); 296 memset(msg, 0, sizeof(msg));
291 INIT_LIST_HEAD(&msg->list); 297 INIT_LIST_HEAD(&msg->list);
292 msg->type = BFIN_IPI_RESCHEDULE; 298 msg->type = BFIN_IPI_RESCHEDULE;
@@ -314,6 +320,8 @@ void smp_send_stop(void)
314 return; 320 return;
315 321
316 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 322 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
323 if (!msg)
324 return;
317 memset(msg, 0, sizeof(msg)); 325 memset(msg, 0, sizeof(msg));
318 INIT_LIST_HEAD(&msg->list); 326 INIT_LIST_HEAD(&msg->list);
319 msg->type = BFIN_IPI_CPU_STOP; 327 msg->type = BFIN_IPI_CPU_STOP;
@@ -450,7 +458,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
450 unsigned int cpu; 458 unsigned int cpu;
451 459
452 for_each_online_cpu(cpu) 460 for_each_online_cpu(cpu)
453 bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy; 461 bogosum += loops_per_jiffy;
454 462
455 printk(KERN_INFO "SMP: Total of %d processors activated " 463 printk(KERN_INFO "SMP: Total of %d processors activated "
456 "(%lu.%02lu BogoMIPS).\n", 464 "(%lu.%02lu BogoMIPS).\n",
diff --git a/arch/cris/include/asm/pgalloc.h b/arch/cris/include/asm/pgalloc.h
index a1ba761d0573..6da975db112f 100644
--- a/arch/cris/include/asm/pgalloc.h
+++ b/arch/cris/include/asm/pgalloc.h
@@ -47,7 +47,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
47 __free_page(pte); 47 __free_page(pte);
48} 48}
49 49
50#define __pte_free_tlb(tlb,pte) \ 50#define __pte_free_tlb(tlb,pte,address) \
51do { \ 51do { \
52 pgtable_page_dtor(pte); \ 52 pgtable_page_dtor(pte); \
53 tlb_remove_page((tlb), pte); \ 53 tlb_remove_page((tlb), pte); \
diff --git a/arch/cris/kernel/sys_cris.c b/arch/cris/kernel/sys_cris.c
index a79fbd87021b..2ad962c7e88e 100644
--- a/arch/cris/kernel/sys_cris.c
+++ b/arch/cris/kernel/sys_cris.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/sem.h> 18#include <linux/sem.h>
20#include <linux/msg.h> 19#include <linux/msg.h>
21#include <linux/shm.h> 20#include <linux/shm.h>
diff --git a/arch/frv/include/asm/pgalloc.h b/arch/frv/include/asm/pgalloc.h
index 971e6addb009..416d19a632f2 100644
--- a/arch/frv/include/asm/pgalloc.h
+++ b/arch/frv/include/asm/pgalloc.h
@@ -49,7 +49,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
49 __free_page(pte); 49 __free_page(pte);
50} 50}
51 51
52#define __pte_free_tlb(tlb,pte) \ 52#define __pte_free_tlb(tlb,pte,address) \
53do { \ 53do { \
54 pgtable_page_dtor(pte); \ 54 pgtable_page_dtor(pte); \
55 tlb_remove_page((tlb),(pte)); \ 55 tlb_remove_page((tlb),(pte)); \
@@ -62,7 +62,7 @@ do { \
62 */ 62 */
63#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) 63#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); })
64#define pmd_free(mm, x) do { } while (0) 64#define pmd_free(mm, x) do { } while (0)
65#define __pmd_free_tlb(tlb,x) do { } while (0) 65#define __pmd_free_tlb(tlb,x,a) do { } while (0)
66 66
67#endif /* CONFIG_MMU */ 67#endif /* CONFIG_MMU */
68 68
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index 33233011b1c1..22c60692b551 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -225,7 +225,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
225 */ 225 */
226#define pud_alloc_one(mm, address) NULL 226#define pud_alloc_one(mm, address) NULL
227#define pud_free(mm, x) do { } while (0) 227#define pud_free(mm, x) do { } while (0)
228#define __pud_free_tlb(tlb, x) do { } while (0) 228#define __pud_free_tlb(tlb, x, address) do { } while (0)
229 229
230/* 230/*
231 * The "pud_xxx()" functions here are trivial for a folded two-level 231 * The "pud_xxx()" functions here are trivial for a folded two-level
diff --git a/arch/ia64/include/asm/fpu.h b/arch/ia64/include/asm/fpu.h
index 0c26157cffa5..b6395ad1500a 100644
--- a/arch/ia64/include/asm/fpu.h
+++ b/arch/ia64/include/asm/fpu.h
@@ -6,6 +6,8 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/types.h>
10
9/* floating point status register: */ 11/* floating point status register: */
10#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */ 12#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */
11#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */ 13#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */
diff --git a/arch/ia64/include/asm/pgalloc.h b/arch/ia64/include/asm/pgalloc.h
index b9ac1a6fc216..96a8d927db28 100644
--- a/arch/ia64/include/asm/pgalloc.h
+++ b/arch/ia64/include/asm/pgalloc.h
@@ -48,7 +48,7 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
48{ 48{
49 quicklist_free(0, NULL, pud); 49 quicklist_free(0, NULL, pud);
50} 50}
51#define __pud_free_tlb(tlb, pud) pud_free((tlb)->mm, pud) 51#define __pud_free_tlb(tlb, pud, address) pud_free((tlb)->mm, pud)
52#endif /* CONFIG_PGTABLE_4 */ 52#endif /* CONFIG_PGTABLE_4 */
53 53
54static inline void 54static inline void
@@ -67,7 +67,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
67 quicklist_free(0, NULL, pmd); 67 quicklist_free(0, NULL, pmd);
68} 68}
69 69
70#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 70#define __pmd_free_tlb(tlb, pmd, address) pmd_free((tlb)->mm, pmd)
71 71
72static inline void 72static inline void
73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte) 73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, pgtable_t pte)
@@ -117,6 +117,6 @@ static inline void check_pgt_cache(void)
117 quicklist_trim(0, NULL, 25, 16); 117 quicklist_trim(0, NULL, 25, 16);
118} 118}
119 119
120#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 120#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
121 121
122#endif /* _ASM_IA64_PGALLOC_H */ 122#endif /* _ASM_IA64_PGALLOC_H */
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h
index 20d8a39680c2..85d965cb19a0 100644
--- a/arch/ia64/include/asm/tlb.h
+++ b/arch/ia64/include/asm/tlb.h
@@ -236,22 +236,22 @@ do { \
236 __tlb_remove_tlb_entry(tlb, ptep, addr); \ 236 __tlb_remove_tlb_entry(tlb, ptep, addr); \
237} while (0) 237} while (0)
238 238
239#define pte_free_tlb(tlb, ptep) \ 239#define pte_free_tlb(tlb, ptep, address) \
240do { \ 240do { \
241 tlb->need_flush = 1; \ 241 tlb->need_flush = 1; \
242 __pte_free_tlb(tlb, ptep); \ 242 __pte_free_tlb(tlb, ptep, address); \
243} while (0) 243} while (0)
244 244
245#define pmd_free_tlb(tlb, ptep) \ 245#define pmd_free_tlb(tlb, ptep, address) \
246do { \ 246do { \
247 tlb->need_flush = 1; \ 247 tlb->need_flush = 1; \
248 __pmd_free_tlb(tlb, ptep); \ 248 __pmd_free_tlb(tlb, ptep, address); \
249} while (0) 249} while (0)
250 250
251#define pud_free_tlb(tlb, pudp) \ 251#define pud_free_tlb(tlb, pudp, address) \
252do { \ 252do { \
253 tlb->need_flush = 1; \ 253 tlb->need_flush = 1; \
254 __pud_free_tlb(tlb, pudp); \ 254 __pud_free_tlb(tlb, pudp, address); \
255} while (0) 255} while (0)
256 256
257#endif /* _ASM_IA64_TLB_H */ 257#endif /* _ASM_IA64_TLB_H */
diff --git a/arch/ia64/include/asm/xen/hypervisor.h b/arch/ia64/include/asm/xen/hypervisor.h
index e425227a418e..88afb54501e4 100644
--- a/arch/ia64/include/asm/xen/hypervisor.h
+++ b/arch/ia64/include/asm/xen/hypervisor.h
@@ -33,6 +33,7 @@
33#ifndef _ASM_IA64_XEN_HYPERVISOR_H 33#ifndef _ASM_IA64_XEN_HYPERVISOR_H
34#define _ASM_IA64_XEN_HYPERVISOR_H 34#define _ASM_IA64_XEN_HYPERVISOR_H
35 35
36#include <linux/err.h>
36#include <xen/interface/xen.h> 37#include <xen/interface/xen.h>
37#include <xen/interface/version.h> /* to compile feature.c */ 38#include <xen/interface/version.h> /* to compile feature.c */
38#include <xen/features.h> /* to comiple xen-netfront.c */ 39#include <xen/features.h> /* to comiple xen-netfront.c */
diff --git a/arch/ia64/kernel/dma-mapping.c b/arch/ia64/kernel/dma-mapping.c
index 086a2aeb0404..39a3cd0a4173 100644
--- a/arch/ia64/kernel/dma-mapping.c
+++ b/arch/ia64/kernel/dma-mapping.c
@@ -6,6 +6,14 @@ int iommu_detected __read_mostly;
6struct dma_map_ops *dma_ops; 6struct dma_map_ops *dma_ops;
7EXPORT_SYMBOL(dma_ops); 7EXPORT_SYMBOL(dma_ops);
8 8
9#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
10
11static int __init dma_init(void)
12{
13 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
14}
15fs_initcall(dma_init);
16
9struct dma_map_ops *dma_get_ops(struct device *dev) 17struct dma_map_ops *dma_get_ops(struct device *dev)
10{ 18{
11 return dma_ops; 19 return dma_ops;
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 92c9689b7d97..9daa87fdb018 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/smp_lock.h>
19#include <linux/user.h> 18#include <linux/user.h>
20#include <linux/security.h> 19#include <linux/security.h>
21#include <linux/audit.h> 20#include <linux/audit.h>
diff --git a/arch/m32r/include/asm/pgalloc.h b/arch/m32r/include/asm/pgalloc.h
index f11a2b909cdb..0fc736198979 100644
--- a/arch/m32r/include/asm/pgalloc.h
+++ b/arch/m32r/include/asm/pgalloc.h
@@ -58,7 +58,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
58 __free_page(pte); 58 __free_page(pte);
59} 59}
60 60
61#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) 61#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))
62 62
63/* 63/*
64 * allocating and freeing a pmd is trivial: the 1-entry pmd is 64 * allocating and freeing a pmd is trivial: the 1-entry pmd is
@@ -68,7 +68,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
68 68
69#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) 69#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
70#define pmd_free(mm, x) do { } while (0) 70#define pmd_free(mm, x) do { } while (0)
71#define __pmd_free_tlb(tlb, x) do { } while (0) 71#define __pmd_free_tlb(tlb, x, addr) do { } while (0)
72#define pgd_populate(mm, pmd, pte) BUG() 72#define pgd_populate(mm, pmd, pte) BUG()
73 73
74#define check_pgt_cache() do { } while (0) 74#define check_pgt_cache() do { } while (0)
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index bf0abe9e1f73..98b8feb12ed8 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -19,7 +19,6 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/smp_lock.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
24#include <linux/ptrace.h> 23#include <linux/ptrace.h>
25#include <linux/user.h> 24#include <linux/user.h>
diff --git a/arch/m68k/include/asm/motorola_pgalloc.h b/arch/m68k/include/asm/motorola_pgalloc.h
index d08bf6261df8..15ee4c74a9f0 100644
--- a/arch/m68k/include/asm/motorola_pgalloc.h
+++ b/arch/m68k/include/asm/motorola_pgalloc.h
@@ -54,7 +54,8 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t page)
54 __free_page(page); 54 __free_page(page);
55} 55}
56 56
57static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page) 57static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
58 unsigned long address)
58{ 59{
59 pgtable_page_dtor(page); 60 pgtable_page_dtor(page);
60 cache_page(kmap(page)); 61 cache_page(kmap(page));
@@ -73,7 +74,8 @@ static inline int pmd_free(struct mm_struct *mm, pmd_t *pmd)
73 return free_pointer_table(pmd); 74 return free_pointer_table(pmd);
74} 75}
75 76
76static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 77static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
78 unsigned long address)
77{ 79{
78 return free_pointer_table(pmd); 80 return free_pointer_table(pmd);
79} 81}
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h
index d4c83f143816..48d80d5a666f 100644
--- a/arch/m68k/include/asm/sun3_pgalloc.h
+++ b/arch/m68k/include/asm/sun3_pgalloc.h
@@ -32,7 +32,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t page)
32 __free_page(page); 32 __free_page(page);
33} 33}
34 34
35#define __pte_free_tlb(tlb,pte) \ 35#define __pte_free_tlb(tlb,pte,addr) \
36do { \ 36do { \
37 pgtable_page_dtor(pte); \ 37 pgtable_page_dtor(pte); \
38 tlb_remove_page((tlb), pte); \ 38 tlb_remove_page((tlb), pte); \
@@ -80,7 +80,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t page
80 * inside the pgd, so has no extra memory associated with it. 80 * inside the pgd, so has no extra memory associated with it.
81 */ 81 */
82#define pmd_free(mm, x) do { } while (0) 82#define pmd_free(mm, x) do { } while (0)
83#define __pmd_free_tlb(tlb, x) do { } while (0) 83#define __pmd_free_tlb(tlb, x, addr) do { } while (0)
84 84
85static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 85static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
86{ 86{
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index d0bcf80a1136..8439598d4655 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -6,14 +6,16 @@ endif
6 6
7# What CPU vesion are we building for, and crack it open 7# What CPU vesion are we building for, and crack it open
8# as major.minor.rev 8# as major.minor.rev
9CPU_VER=$(subst ",,$(CONFIG_XILINX_MICROBLAZE0_HW_VER) ) 9CPU_VER := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER))
10CPU_MAJOR=$(shell echo $(CPU_VER) | cut -d '.' -f 1) 10CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1)
11CPU_MINOR=$(shell echo $(CPU_VER) | cut -d '.' -f 2) 11CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2)
12CPU_REV=$(shell echo $(CPU_VER) | cut -d '.' -f 3) 12CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3)
13 13
14export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV 14export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
15 15
16# Use cpu-related CONFIG_ vars to set compile options. 16# Use cpu-related CONFIG_ vars to set compile options.
17# The various CONFIG_XILINX cpu features options are integers 0/1/2...
18# rather than bools y/n
17 19
18# Work out HW multipler support. This is icky. 20# Work out HW multipler support. This is icky.
19# 1. Spartan2 has no HW multiplers. 21# 1. Spartan2 has no HW multiplers.
@@ -34,30 +36,29 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
34 36
35CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) 37CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
36 38
37# The various CONFIG_XILINX cpu features options are integers 0/1/2...
38# rather than bools y/n
39
40# r31 holds current when in kernel mode 39# r31 holds current when in kernel mode
41CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) 40KBUILD_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
42 41
43LDFLAGS := 42LDFLAGS :=
44LDFLAGS_vmlinux := 43LDFLAGS_vmlinux :=
45LDFLAGS_BLOB := --format binary --oformat elf32-microblaze
46 44
47LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name) 45LIBGCC := $(shell $(CC) $(KBUILD_KERNEL) -print-libgcc-file-name)
48 46
49head-y := arch/microblaze/kernel/head.o 47head-y := arch/microblaze/kernel/head.o
50libs-y += arch/microblaze/lib/ $(LIBGCC) 48libs-y += arch/microblaze/lib/
51core-y += arch/microblaze/kernel/ arch/microblaze/mm/ \ 49libs-y += $(LIBGCC)
52 arch/microblaze/platform/ 50core-y += arch/microblaze/kernel/
51core-y += arch/microblaze/mm/
52core-y += arch/microblaze/platform/
53 53
54boot := arch/$(ARCH)/boot 54boot := arch/microblaze/boot
55 55
56# defines filename extension depending memory management type 56# defines filename extension depending memory management type
57ifeq ($(CONFIG_MMU),) 57ifeq ($(CONFIG_MMU),)
58MMUEXT := -nommu 58MMU := -nommu
59endif 59endif
60export MMUEXT 60
61export MMU
61 62
62all: linux.bin 63all: linux.bin
63 64
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 5c173424d074..7c3ec13b44d8 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -14,7 +14,6 @@
14#include <asm/byteorder.h> 14#include <asm/byteorder.h>
15#include <asm/page.h> 15#include <asm/page.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <asm/byteorder.h>
18#include <linux/mm.h> /* Get struct page {...} */ 17#include <linux/mm.h> /* Get struct page {...} */
19 18
20 19
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index 59a757e46ba5..b0131da1387b 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -180,7 +180,7 @@ extern inline void pte_free(struct mm_struct *mm, struct page *ptepage)
180 __free_page(ptepage); 180 __free_page(ptepage);
181} 181}
182 182
183#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) 183#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))
184 184
185#define pmd_populate(mm, pmd, pte) (pmd_val(*(pmd)) = page_address(pte)) 185#define pmd_populate(mm, pmd, pte) (pmd_val(*(pmd)) = page_address(pte))
186 186
@@ -193,7 +193,7 @@ extern inline void pte_free(struct mm_struct *mm, struct page *ptepage)
193 */ 193 */
194#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); }) 194#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
195/*#define pmd_free(mm, x) do { } while (0)*/ 195/*#define pmd_free(mm, x) do { } while (0)*/
196#define __pmd_free_tlb(tlb, x) do { } while (0) 196#define __pmd_free_tlb(tlb, x, addr) do { } while (0)
197#define pgd_populate(mm, pmd, pte) BUG() 197#define pgd_populate(mm, pmd, pte) BUG()
198 198
199extern int do_check_pgt_cache(int, int); 199extern int do_check_pgt_cache(int, int);
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index 4c57a586a989..cc3a4dfc3eaa 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -185,6 +185,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
185 185
186/* Definitions for MicroBlaze. */ 186/* Definitions for MicroBlaze. */
187#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */ 187#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
188#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */
188#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */ 189#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
189#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */ 190#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
190#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */ 191#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
@@ -320,8 +321,7 @@ static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
320static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; } 321static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
321static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 322static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
322static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 323static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
323/* FIXME */ 324static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
324static inline int pte_file(pte_t pte) { return 0; }
325 325
326static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } 326static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
327static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } 327static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
@@ -488,7 +488,7 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
488/* Encode and decode a nonlinear file mapping entry */ 488/* Encode and decode a nonlinear file mapping entry */
489#define PTE_FILE_MAX_BITS 29 489#define PTE_FILE_MAX_BITS 29
490#define pte_to_pgoff(pte) (pte_val(pte) >> 3) 490#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
491#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) }) 491#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
492 492
493extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 493extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
494 494
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 20f7b3a926e8..37e6f305a68e 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -16,6 +16,18 @@
16#define _ASM_MICROBLAZE_PROM_H 16#define _ASM_MICROBLAZE_PROM_H
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19/* Definitions used by the flattened device tree */
20#define OF_DT_HEADER 0xd00dfeed /* marker */
21#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
22#define OF_DT_END_NODE 0x2 /* End node */
23#define OF_DT_PROP 0x3 /* Property: name off, size, content */
24#define OF_DT_NOP 0x4 /* nop */
25#define OF_DT_END 0x9
26
27#define OF_DT_VERSION 0x10
28
29#ifndef __ASSEMBLY__
30
19#include <linux/types.h> 31#include <linux/types.h>
20#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
21#include <linux/platform_device.h> 33#include <linux/platform_device.h>
@@ -29,16 +41,6 @@
29#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 41#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
30#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 42#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
31 43
32/* Definitions used by the flattened device tree */
33#define OF_DT_HEADER 0xd00dfeed /* marker */
34#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
35#define OF_DT_END_NODE 0x2 /* End node */
36#define OF_DT_PROP 0x3 /* Property: name off, size, content */
37#define OF_DT_NOP 0x4 /* nop */
38#define OF_DT_END 0x9
39
40#define OF_DT_VERSION 0x10
41
42/* 44/*
43 * This is what gets passed to the kernel by prom_init or kexec 45 * This is what gets passed to the kernel by prom_init or kexec
44 * 46 *
@@ -309,5 +311,6 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
309 */ 311 */
310#include <linux/of.h> 312#include <linux/of.h>
311 313
314#endif /* __ASSEMBLY__ */
312#endif /* __KERNEL__ */ 315#endif /* __KERNEL__ */
313#endif /* _ASM_MICROBLAZE_PROM_H */ 316#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/include/asm/tlb.h b/arch/microblaze/include/asm/tlb.h
index c472d2801132..e8abd4a0349c 100644
--- a/arch/microblaze/include/asm/tlb.h
+++ b/arch/microblaze/include/asm/tlb.h
@@ -11,7 +11,7 @@
11#ifndef _ASM_MICROBLAZE_TLB_H 11#ifndef _ASM_MICROBLAZE_TLB_H
12#define _ASM_MICROBLAZE_TLB_H 12#define _ASM_MICROBLAZE_TLB_H
13 13
14#define tlb_flush(tlb) do {} while (0) 14#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
15 15
16#include <asm-generic/tlb.h> 16#include <asm-generic/tlb.h>
17 17
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 65adad61e7e9..5431b4631a7a 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -189,7 +189,7 @@ extern long strnlen_user(const char *src, long count);
189 189
190#define __put_user(x, ptr) \ 190#define __put_user(x, ptr) \
191({ \ 191({ \
192 __typeof__(*(ptr)) __gu_val = x; \ 192 __typeof__(*(ptr)) volatile __gu_val = (x); \
193 long __gu_err = 0; \ 193 long __gu_err = 0; \
194 switch (sizeof(__gu_val)) { \ 194 switch (sizeof(__gu_val)) { \
195 case 1: \ 195 case 1: \
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile
index f4a5e19a20eb..d487729683de 100644
--- a/arch/microblaze/kernel/Makefile
+++ b/arch/microblaze/kernel/Makefile
@@ -17,4 +17,4 @@ obj-$(CONFIG_HEART_BEAT) += heartbeat.o
17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o 17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
18obj-$(CONFIG_MMU) += misc.o 18obj-$(CONFIG_MMU) += misc.o
19 19
20obj-y += entry$(MMUEXT).o 20obj-y += entry$(MMU).o
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
index 153f57c57b6d..c259786e7faa 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
@@ -22,7 +22,7 @@
22 22
23#define CI(c, p) { ci->c = PVR_##p(pvr); } 23#define CI(c, p) { ci->c = PVR_##p(pvr); }
24#define err_printk(x) \ 24#define err_printk(x) \
25 early_printk("ERROR: Microblaze " x " - different for PVR and DTS\n"); 25 early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");
26 26
27void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) 27void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
28{ 28{
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c
index 450ca6bb828d..adb448f93d5f 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo-static.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c
@@ -18,7 +18,7 @@ static const char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
18static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; 18static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
19 19
20#define err_printk(x) \ 20#define err_printk(x) \
21 early_printk("ERROR: Microblaze " x "- different for kernel and DTS\n"); 21 early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n");
22 22
23void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) 23void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
24{ 24{
diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c
index a10bea119b94..c411c6757deb 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo.c
@@ -26,6 +26,8 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
26 {"7.10.b", 0x09}, 26 {"7.10.b", 0x09},
27 {"7.10.c", 0x0a}, 27 {"7.10.c", 0x0a},
28 {"7.10.d", 0x0b}, 28 {"7.10.d", 0x0b},
29 {"7.20.a", 0x0c},
30 {"7.20.b", 0x0d},
29 /* FIXME There is no keycode defined in MBV for these versions */ 31 /* FIXME There is no keycode defined in MBV for these versions */
30 {"2.10.a", 0x10}, 32 {"2.10.a", 0x10},
31 {"3.00.a", 0x20}, 33 {"3.00.a", 0x20},
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index e568d6ec621b..e41c6ce2a7be 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -31,6 +31,7 @@
31#include <linux/linkage.h> 31#include <linux/linkage.h>
32#include <asm/thread_info.h> 32#include <asm/thread_info.h>
33#include <asm/page.h> 33#include <asm/page.h>
34#include <asm/prom.h> /* for OF_DT_HEADER */
34 35
35#ifdef CONFIG_MMU 36#ifdef CONFIG_MMU
36#include <asm/setup.h> /* COMMAND_LINE_SIZE */ 37#include <asm/setup.h> /* COMMAND_LINE_SIZE */
@@ -54,11 +55,19 @@ ENTRY(_start)
54 andi r1, r1, ~2 55 andi r1, r1, ~2
55 mts rmsr, r1 56 mts rmsr, r1
56 57
57/* save fdt to kernel location */ 58/* r7 may point to an FDT, or there may be one linked in.
58/* r7 stores pointer to fdt blob */ 59 if it's in r7, we've got to save it away ASAP.
59 beqi r7, no_fdt_arg 60 We ensure r7 points to a valid FDT, just in case the bootloader
61 is broken or non-existent */
62 beqi r7, no_fdt_arg /* NULL pointer? don't copy */
63 lw r11, r0, r7 /* Does r7 point to a */
64 rsubi r11, r11, OF_DT_HEADER /* valid FDT? */
65 beqi r11, _prepare_copy_fdt
66 or r7, r0, r0 /* clear R7 when not valid DTB */
67 bnei r11, no_fdt_arg /* No - get out of here */
68_prepare_copy_fdt:
60 or r11, r0, r0 /* incremment */ 69 or r11, r0, r0 /* incremment */
61 ori r4, r0, TOPHYS(_fdt_start) /* save bram context */ 70 ori r4, r0, TOPHYS(_fdt_start)
62 ori r3, r0, (0x4000 - 4) 71 ori r3, r0, (0x4000 - 4)
63_copy_fdt: 72_copy_fdt:
64 lw r12, r7, r11 /* r12 = r7 + r11 */ 73 lw r12, r7, r11 /* r12 = r7 + r11 */
diff --git a/arch/microblaze/kernel/hw_exception_handler.S b/arch/microblaze/kernel/hw_exception_handler.S
index 9d591cd74fc2..3288c9737671 100644
--- a/arch/microblaze/kernel/hw_exception_handler.S
+++ b/arch/microblaze/kernel/hw_exception_handler.S
@@ -74,6 +74,7 @@
74 74
75#include <asm/mmu.h> 75#include <asm/mmu.h>
76#include <asm/pgtable.h> 76#include <asm/pgtable.h>
77#include <asm/signal.h>
77#include <asm/asm-offsets.h> 78#include <asm/asm-offsets.h>
78 79
79/* Helpful Macros */ 80/* Helpful Macros */
@@ -428,19 +429,9 @@ handle_unaligned_ex:
428 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */ 429 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */
429 nop 430 nop
430_no_delayslot: 431_no_delayslot:
431#endif 432 /* jump to high level unaligned handler */
432 433 RESTORE_STATE;
433#ifdef CONFIG_MMU 434 bri unaligned_data_trap
434 /* Check if unaligned address is last on a 4k page */
435 andi r5, r4, 0xffc
436 xori r5, r5, 0xffc
437 bnei r5, _unaligned_ex2
438 _unaligned_ex1:
439 RESTORE_STATE;
440/* Another page must be accessed or physical address not in page table */
441 bri unaligned_data_trap
442
443 _unaligned_ex2:
444#endif 435#endif
445 andi r6, r3, 0x3E0; /* Mask and extract the register operand */ 436 andi r6, r3, 0x3E0; /* Mask and extract the register operand */
446 srl r6, r6; /* r6 >> 5 */ 437 srl r6, r6; /* r6 >> 5 */
@@ -450,45 +441,6 @@ _no_delayslot:
450 srl r6, r6; 441 srl r6, r6;
451 /* Store the register operand in a temporary location */ 442 /* Store the register operand in a temporary location */
452 sbi r6, r0, TOPHYS(ex_reg_op); 443 sbi r6, r0, TOPHYS(ex_reg_op);
453#ifdef CONFIG_MMU
454 /* Get physical address */
455 /* If we are faulting a kernel address, we have to use the
456 * kernel page tables.
457 */
458 ori r5, r0, CONFIG_KERNEL_START
459 cmpu r5, r4, r5
460 bgti r5, _unaligned_ex3
461 ori r5, r0, swapper_pg_dir
462 bri _unaligned_ex4
463
464 /* Get the PGD for the current thread. */
465_unaligned_ex3: /* user thread */
466 addi r5 ,CURRENT_TASK, TOPHYS(0); /* get current task address */
467 lwi r5, r5, TASK_THREAD + PGDIR
468_unaligned_ex4:
469 tophys(r5,r5)
470 BSRLI(r6,r4,20) /* Create L1 (pgdir/pmd) address */
471 andi r6, r6, 0xffc
472/* Assume pgdir aligned on 4K boundary, no need for "andi r5,r5,0xfffff003" */
473 or r5, r5, r6
474 lwi r6, r5, 0 /* Get L1 entry */
475 andi r5, r6, 0xfffff000 /* Extract L2 (pte) base address. */
476 beqi r5, _unaligned_ex1 /* Bail if no table */
477
478 tophys(r5,r5)
479 BSRLI(r6,r4,10) /* Compute PTE address */
480 andi r6, r6, 0xffc
481 andi r5, r5, 0xfffff003
482 or r5, r5, r6
483 lwi r5, r5, 0 /* Get Linux PTE */
484
485 andi r6, r5, _PAGE_PRESENT
486 beqi r6, _unaligned_ex1 /* Bail if no page */
487
488 andi r5, r5, 0xfffff000 /* Extract RPN */
489 andi r4, r4, 0x00000fff /* Extract offset */
490 or r4, r4, r5 /* Create physical address */
491#endif /* CONFIG_MMU */
492 444
493 andi r6, r3, 0x400; /* Extract ESR[S] */ 445 andi r6, r3, 0x400; /* Extract ESR[S] */
494 bnei r6, ex_sw; 446 bnei r6, ex_sw;
@@ -959,15 +911,15 @@ _unaligned_data_exception:
959 andi r6, r3, 0x800; /* Extract ESR[W] - delay slot */ 911 andi r6, r3, 0x800; /* Extract ESR[W] - delay slot */
960ex_lw_vm: 912ex_lw_vm:
961 beqid r6, ex_lhw_vm; 913 beqid r6, ex_lhw_vm;
962 lbui r5, r4, 0; /* Exception address in r4 - delay slot */ 914load1: lbui r5, r4, 0; /* Exception address in r4 - delay slot */
963/* Load a word, byte-by-byte from destination address and save it in tmp space*/ 915/* Load a word, byte-by-byte from destination address and save it in tmp space*/
964 la r6, r0, ex_tmp_data_loc_0; 916 la r6, r0, ex_tmp_data_loc_0;
965 sbi r5, r6, 0; 917 sbi r5, r6, 0;
966 lbui r5, r4, 1; 918load2: lbui r5, r4, 1;
967 sbi r5, r6, 1; 919 sbi r5, r6, 1;
968 lbui r5, r4, 2; 920load3: lbui r5, r4, 2;
969 sbi r5, r6, 2; 921 sbi r5, r6, 2;
970 lbui r5, r4, 3; 922load4: lbui r5, r4, 3;
971 sbi r5, r6, 3; 923 sbi r5, r6, 3;
972 brid ex_lw_tail_vm; 924 brid ex_lw_tail_vm;
973/* Get the destination register value into r3 - delay slot */ 925/* Get the destination register value into r3 - delay slot */
@@ -977,7 +929,7 @@ ex_lhw_vm:
977 * save it in tmp space */ 929 * save it in tmp space */
978 la r6, r0, ex_tmp_data_loc_0; 930 la r6, r0, ex_tmp_data_loc_0;
979 sbi r5, r6, 0; 931 sbi r5, r6, 0;
980 lbui r5, r4, 1; 932load5: lbui r5, r4, 1;
981 sbi r5, r6, 1; 933 sbi r5, r6, 1;
982 lhui r3, r6, 0; /* Get the destination register value into r3 */ 934 lhui r3, r6, 0; /* Get the destination register value into r3 */
983ex_lw_tail_vm: 935ex_lw_tail_vm:
@@ -996,22 +948,53 @@ ex_sw_tail_vm:
996 swi r3, r5, 0; /* Get the word - delay slot */ 948 swi r3, r5, 0; /* Get the word - delay slot */
997 /* Store the word, byte-by-byte into destination address */ 949 /* Store the word, byte-by-byte into destination address */
998 lbui r3, r5, 0; 950 lbui r3, r5, 0;
999 sbi r3, r4, 0; 951store1: sbi r3, r4, 0;
1000 lbui r3, r5, 1; 952 lbui r3, r5, 1;
1001 sbi r3, r4, 1; 953store2: sbi r3, r4, 1;
1002 lbui r3, r5, 2; 954 lbui r3, r5, 2;
1003 sbi r3, r4, 2; 955store3: sbi r3, r4, 2;
1004 lbui r3, r5, 3; 956 lbui r3, r5, 3;
1005 brid ret_from_exc; 957 brid ret_from_exc;
1006 sbi r3, r4, 3; /* Delay slot */ 958store4: sbi r3, r4, 3; /* Delay slot */
1007ex_shw_vm: 959ex_shw_vm:
1008 /* Store the lower half-word, byte-by-byte into destination address */ 960 /* Store the lower half-word, byte-by-byte into destination address */
1009 lbui r3, r5, 2; 961 lbui r3, r5, 2;
1010 sbi r3, r4, 0; 962store5: sbi r3, r4, 0;
1011 lbui r3, r5, 3; 963 lbui r3, r5, 3;
1012 brid ret_from_exc; 964 brid ret_from_exc;
1013 sbi r3, r4, 1; /* Delay slot */ 965store6: sbi r3, r4, 1; /* Delay slot */
1014ex_sw_end_vm: /* Exception handling of store word, ends. */ 966ex_sw_end_vm: /* Exception handling of store word, ends. */
967
968/* We have to prevent cases that get/put_user macros get unaligned pointer
969 * to bad page area. We have to find out which origin instruction caused it
970 * and called fixup for that origin instruction not instruction in unaligned
971 * handler */
972ex_unaligned_fixup:
973 ori r5, r7, 0 /* setup pointer to pt_regs */
974 lwi r6, r7, PT_PC; /* faulting address is one instruction above */
975 addik r6, r6, -4 /* for finding proper fixup */
976 swi r6, r7, PT_PC; /* a save back it to PT_PC */
977 addik r7, r0, SIGSEGV
978 /* call bad_page_fault for finding aligned fixup, fixup address is saved
979 * in PT_PC which is used as return address from exception */
980 la r15, r0, ret_from_exc-8 /* setup return address */
981 brid bad_page_fault
982 nop
983
984/* We prevent all load/store because it could failed any attempt to access */
985.section __ex_table,"a";
986 .word load1,ex_unaligned_fixup;
987 .word load2,ex_unaligned_fixup;
988 .word load3,ex_unaligned_fixup;
989 .word load4,ex_unaligned_fixup;
990 .word load5,ex_unaligned_fixup;
991 .word store1,ex_unaligned_fixup;
992 .word store2,ex_unaligned_fixup;
993 .word store3,ex_unaligned_fixup;
994 .word store4,ex_unaligned_fixup;
995 .word store5,ex_unaligned_fixup;
996 .word store6,ex_unaligned_fixup;
997.previous;
1015.end _unaligned_data_exception 998.end _unaligned_data_exception
1016#endif /* CONFIG_MMU */ 999#endif /* CONFIG_MMU */
1017 1000
diff --git a/arch/microblaze/kernel/module.c b/arch/microblaze/kernel/module.c
index 51414171326f..5a45b1adfef1 100644
--- a/arch/microblaze/kernel/module.c
+++ b/arch/microblaze/kernel/module.c
@@ -57,7 +57,6 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
57 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; 57 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
58 Elf32_Sym *sym; 58 Elf32_Sym *sym;
59 unsigned long int *location; 59 unsigned long int *location;
60 unsigned long int locoffs;
61 unsigned long int value; 60 unsigned long int value;
62#if __GNUC__ < 4 61#if __GNUC__ < 4
63 unsigned long int old_value; 62 unsigned long int old_value;
@@ -113,10 +112,12 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
113 break; 112 break;
114 113
115 case R_MICROBLAZE_64_PCREL: 114 case R_MICROBLAZE_64_PCREL:
116 locoffs = (location[0] & 0xFFFF) << 16 | 115#if __GNUC__ < 4
116 old_value = (location[0] & 0xFFFF) << 16 |
117 (location[1] & 0xFFFF); 117 (location[1] & 0xFFFF);
118 value -= (unsigned long int)(location) + 4 + 118 value -= old_value;
119 locoffs; 119#endif
120 value -= (unsigned long int)(location) + 4;
120 location[0] = (location[0] & 0xFFFF0000) | 121 location[0] = (location[0] & 0xFFFF0000) |
121 (value >> 16); 122 (value >> 16);
122 location[1] = (location[1] & 0xFFFF0000) | 123 location[1] = (location[1] & 0xFFFF0000) |
@@ -125,6 +126,14 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
125 value); 126 value);
126 break; 127 break;
127 128
129 case R_MICROBLAZE_32_PCREL_LO:
130 pr_debug("R_MICROBLAZE_32_PCREL_LO\n");
131 break;
132
133 case R_MICROBLAZE_64_NONE:
134 pr_debug("R_MICROBLAZE_NONE\n");
135 break;
136
128 case R_MICROBLAZE_NONE: 137 case R_MICROBLAZE_NONE:
129 pr_debug("R_MICROBLAZE_NONE\n"); 138 pr_debug("R_MICROBLAZE_NONE\n");
130 break; 139 break;
@@ -133,7 +142,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
133 printk(KERN_ERR "module %s: " 142 printk(KERN_ERR "module %s: "
134 "Unknown relocation: %u\n", 143 "Unknown relocation: %u\n",
135 module->name, 144 module->name,
136 ELF32_R_TYPE(rela->r_info)); 145 ELF32_R_TYPE(rela[i].r_info));
137 return -ENOEXEC; 146 return -ENOEXEC;
138 } 147 }
139 } 148 }
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
index b86aa623e36d..53ff39af6a5c 100644
--- a/arch/microblaze/kernel/ptrace.c
+++ b/arch/microblaze/kernel/ptrace.c
@@ -27,7 +27,6 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/smp_lock.h>
31#include <linux/ptrace.h> 30#include <linux/ptrace.h>
32#include <linux/signal.h> 31#include <linux/signal.h>
33 32
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 8709bea09604..2a97bf513b64 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -138,8 +138,12 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
138 setup_early_printk(NULL); 138 setup_early_printk(NULL);
139#endif 139#endif
140 140
141 early_printk("Ramdisk addr 0x%08x, FDT 0x%08x\n", ram, fdt); 141 early_printk("Ramdisk addr 0x%08x, ", ram);
142 printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt); 142 if (fdt)
143 early_printk("FDT at 0x%08x\n", fdt);
144 else
145 early_printk("Compiled-in FDT at 0x%08x\n",
146 (unsigned int)_fdt_start);
143 147
144#ifdef CONFIG_MTD_UCLINUX 148#ifdef CONFIG_MTD_UCLINUX
145 early_printk("Found romfs @ 0x%08x (0x%08x)\n", 149 early_printk("Found romfs @ 0x%08x (0x%08x)\n",
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index 493819c25fba..1c80e4fc40ce 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/signal.h> 25#include <linux/signal.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c
index 8c9ebac5da10..b96f1682bb24 100644
--- a/arch/microblaze/kernel/sys_microblaze.c
+++ b/arch/microblaze/kernel/sys_microblaze.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/syscalls.h> 18#include <linux/syscalls.h>
20#include <linux/sem.h> 19#include <linux/sem.h>
21#include <linux/msg.h> 20#include <linux/msg.h>
@@ -34,105 +33,6 @@
34#include <linux/unistd.h> 33#include <linux/unistd.h>
35 34
36#include <asm/syscalls.h> 35#include <asm/syscalls.h>
37/*
38 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
39 *
40 * This is really horribly ugly. This will be remove with new toolchain.
41 */
42asmlinkage long
43sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
44{
45 int version, ret;
46
47 version = call >> 16; /* hack for backward compatibility */
48 call &= 0xffff;
49
50 ret = -EINVAL;
51 switch (call) {
52 case SEMOP:
53 ret = sys_semop(first, (struct sembuf *)ptr, second);
54 break;
55 case SEMGET:
56 ret = sys_semget(first, second, third);
57 break;
58 case SEMCTL:
59 {
60 union semun fourth;
61
62 if (!ptr)
63 break;
64 ret = (access_ok(VERIFY_READ, ptr, sizeof(long)) ? 0 : -EFAULT)
65 || (get_user(fourth.__pad, (void **)ptr)) ;
66 if (ret)
67 break;
68 ret = sys_semctl(first, second, third, fourth);
69 break;
70 }
71 case MSGSND:
72 ret = sys_msgsnd(first, (struct msgbuf *) ptr, second, third);
73 break;
74 case MSGRCV:
75 switch (version) {
76 case 0: {
77 struct ipc_kludge tmp;
78
79 if (!ptr)
80 break;
81 ret = (access_ok(VERIFY_READ, ptr, sizeof(tmp))
82 ? 0 : -EFAULT) || copy_from_user(&tmp,
83 (struct ipc_kludge *) ptr, sizeof(tmp));
84 if (ret)
85 break;
86 ret = sys_msgrcv(first, tmp.msgp, second, tmp.msgtyp,
87 third);
88 break;
89 }
90 default:
91 ret = sys_msgrcv(first, (struct msgbuf *) ptr,
92 second, fifth, third);
93 break;
94 }
95 break;
96 case MSGGET:
97 ret = sys_msgget((key_t) first, second);
98 break;
99 case MSGCTL:
100 ret = sys_msgctl(first, second, (struct msqid_ds *) ptr);
101 break;
102 case SHMAT:
103 switch (version) {
104 default: {
105 ulong raddr;
106 ret = access_ok(VERIFY_WRITE, (ulong *) third,
107 sizeof(ulong)) ? 0 : -EFAULT;
108 if (ret)
109 break;
110 ret = do_shmat(first, (char *) ptr, second, &raddr);
111 if (ret)
112 break;
113 ret = put_user(raddr, (ulong *) third);
114 break;
115 }
116 case 1: /* iBCS2 emulator entry point */
117 if (!segment_eq(get_fs(), get_ds()))
118 break;
119 ret = do_shmat(first, (char *) ptr, second,
120 (ulong *) third);
121 break;
122 }
123 break;
124 case SHMDT:
125 ret = sys_shmdt((char *)ptr);
126 break;
127 case SHMGET:
128 ret = sys_shmget(first, second, third);
129 break;
130 case SHMCTL:
131 ret = sys_shmctl(first, second, (struct shmid_ds *) ptr);
132 break;
133 }
134 return ret;
135}
136 36
137asmlinkage long microblaze_vfork(struct pt_regs *regs) 37asmlinkage long microblaze_vfork(struct pt_regs *regs)
138{ 38{
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 31b32a6c5f4e..216db817beb6 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -121,7 +121,7 @@ ENTRY(sys_call_table)
121 .long sys_wait4 121 .long sys_wait4
122 .long sys_swapoff /* 115 */ 122 .long sys_swapoff /* 115 */
123 .long sys_sysinfo 123 .long sys_sysinfo
124 .long sys_ipc 124 .long sys_ni_syscall /* old sys_ipc */
125 .long sys_fsync 125 .long sys_fsync
126 .long sys_ni_syscall /* sys_sigreturn_wrapper */ 126 .long sys_ni_syscall /* sys_sigreturn_wrapper */
127 .long sys_clone /* 120 */ 127 .long sys_clone /* 120 */
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c
index 956607a63f4c..d9d249a66ff2 100644
--- a/arch/microblaze/mm/fault.c
+++ b/arch/microblaze/mm/fault.c
@@ -69,7 +69,7 @@ static int store_updates_sp(struct pt_regs *regs)
69 * It is called from do_page_fault above and from some of the procedures 69 * It is called from do_page_fault above and from some of the procedures
70 * in traps.c. 70 * in traps.c.
71 */ 71 */
72static void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) 72void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
73{ 73{
74 const struct exception_table_entry *fixup; 74 const struct exception_table_entry *fixup;
75/* MS: no context */ 75/* MS: no context */
@@ -122,15 +122,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
122 } 122 }
123#endif /* CONFIG_KGDB */ 123#endif /* CONFIG_KGDB */
124 124
125 if (in_atomic() || mm == NULL) { 125 if (in_atomic() || !mm) {
126 /* FIXME */ 126 if (kernel_mode(regs))
127 if (kernel_mode(regs)) { 127 goto bad_area_nosemaphore;
128 printk(KERN_EMERG 128
129 "Page fault in kernel mode - Oooou!!! pid %d\n",
130 current->pid);
131 _exception(SIGSEGV, regs, code, address);
132 return;
133 }
134 /* in_atomic() in user mode is really bad, 129 /* in_atomic() in user mode is really bad,
135 as is current->mm == NULL. */ 130 as is current->mm == NULL. */
136 printk(KERN_EMERG "Page fault in user mode with " 131 printk(KERN_EMERG "Page fault in user mode with "
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h
index 1275831dda29..3738f4b48cbd 100644
--- a/arch/mips/include/asm/pgalloc.h
+++ b/arch/mips/include/asm/pgalloc.h
@@ -98,23 +98,12 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
98 __free_pages(pte, PTE_ORDER); 98 __free_pages(pte, PTE_ORDER);
99} 99}
100 100
101#define __pte_free_tlb(tlb,pte) \ 101#define __pte_free_tlb(tlb,pte,address) \
102do { \ 102do { \
103 pgtable_page_dtor(pte); \ 103 pgtable_page_dtor(pte); \
104 tlb_remove_page((tlb), pte); \ 104 tlb_remove_page((tlb), pte); \
105} while (0) 105} while (0)
106 106
107#ifdef CONFIG_32BIT
108
109/*
110 * allocating and freeing a pmd is trivial: the 1-entry pmd is
111 * inside the pgd, so has no extra memory associated with it.
112 */
113#define pmd_free(mm, x) do { } while (0)
114#define __pmd_free_tlb(tlb, x) do { } while (0)
115
116#endif
117
118#ifdef CONFIG_64BIT 107#ifdef CONFIG_64BIT
119 108
120static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 109static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
@@ -132,7 +121,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
132 free_pages((unsigned long)pmd, PMD_ORDER); 121 free_pages((unsigned long)pmd, PMD_ORDER);
133} 122}
134 123
135#define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) 124#define __pmd_free_tlb(tlb, x, addr) pmd_free((tlb)->mm, x)
136 125
137#endif 126#endif
138 127
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index c4f9ac17474a..32644b4a0714 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -22,7 +22,6 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/ptrace.h> 23#include <linux/ptrace.h>
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/smp_lock.h>
26#include <linux/user.h> 25#include <linux/user.h>
27#include <linux/security.h> 26#include <linux/security.h>
28 27
diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c
index 471c09aa1614..8c2834f5919d 100644
--- a/arch/mips/mm/hugetlbpage.c
+++ b/arch/mips/mm/hugetlbpage.c
@@ -16,7 +16,6 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/hugetlb.h> 17#include <linux/hugetlb.h>
18#include <linux/pagemap.h> 18#include <linux/pagemap.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include <linux/err.h> 20#include <linux/err.h>
22#include <linux/sysctl.h> 21#include <linux/sysctl.h>
diff --git a/arch/mn10300/include/asm/pgalloc.h b/arch/mn10300/include/asm/pgalloc.h
index ec057e1bd4cf..a19f11327cd8 100644
--- a/arch/mn10300/include/asm/pgalloc.h
+++ b/arch/mn10300/include/asm/pgalloc.h
@@ -51,6 +51,6 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte)
51} 51}
52 52
53 53
54#define __pte_free_tlb(tlb, pte) tlb_remove_page((tlb), (pte)) 54#define __pte_free_tlb(tlb, pte, addr) tlb_remove_page((tlb), (pte))
55 55
56#endif /* _ASM_PGALLOC_H */ 56#endif /* _ASM_PGALLOC_H */
diff --git a/arch/mn10300/kernel/ptrace.c b/arch/mn10300/kernel/ptrace.c
index e143339ad28e..cf847dabc1bd 100644
--- a/arch/mn10300/kernel/ptrace.c
+++ b/arch/mn10300/kernel/ptrace.c
@@ -13,7 +13,6 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18#include <linux/ptrace.h> 17#include <linux/ptrace.h>
19#include <linux/user.h> 18#include <linux/user.h>
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 9f7572a0f578..feb2f2e810db 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -12,7 +12,6 @@
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/signal.h> 16#include <linux/signal.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c
index bca5a84dc72c..3e52a1054327 100644
--- a/arch/mn10300/kernel/sys_mn10300.c
+++ b/arch/mn10300/kernel/sys_mn10300.c
@@ -13,7 +13,6 @@
13#include <linux/syscalls.h> 13#include <linux/syscalls.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/sem.h> 16#include <linux/sem.h>
18#include <linux/msg.h> 17#include <linux/msg.h>
19#include <linux/shm.h> 18#include <linux/shm.h>
@@ -21,7 +20,6 @@
21#include <linux/mman.h> 20#include <linux/mman.h>
22#include <linux/file.h> 21#include <linux/file.h>
23#include <linux/utsname.h> 22#include <linux/utsname.h>
24#include <linux/syscalls.h>
25#include <linux/tty.h> 23#include <linux/tty.h>
26 24
27#include <asm/uaccess.h> 25#include <asm/uaccess.h>
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c
index 0dfdc5001124..91365adba4f5 100644
--- a/arch/mn10300/kernel/traps.c
+++ b/arch/mn10300/kernel/traps.c
@@ -17,7 +17,6 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index c96ba3da95ac..f4aa07934654 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -107,7 +107,7 @@ SECTIONS
107 __init_end = .; 107 __init_end = .;
108 /* freed after init ends here */ 108 /* freed after init ends here */
109 109
110 BSS(4) 110 BSS_SECTION(0, PAGE_SIZE, 4)
111 111
112 _end = . ; 112 _end = . ;
113 113
diff --git a/arch/mn10300/mm/fault.c b/arch/mn10300/mm/fault.c
index a62e1e138bc1..53bb17d0f068 100644
--- a/arch/mn10300/mm/fault.c
+++ b/arch/mn10300/mm/fault.c
@@ -20,7 +20,6 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/smp_lock.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/vt_kern.h> /* For unblank_screen() */ 25#include <linux/vt_kern.h> /* For unblank_screen() */
diff --git a/arch/mn10300/mm/misalignment.c b/arch/mn10300/mm/misalignment.c
index 94c4a4358065..30016251f658 100644
--- a/arch/mn10300/mm/misalignment.c
+++ b/arch/mn10300/mm/misalignment.c
@@ -17,7 +17,6 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
diff --git a/arch/parisc/include/asm/tlb.h b/arch/parisc/include/asm/tlb.h
index 383b1db310ee..07924903989e 100644
--- a/arch/parisc/include/asm/tlb.h
+++ b/arch/parisc/include/asm/tlb.h
@@ -21,7 +21,7 @@ do { if (!(tlb)->fullmm) \
21 21
22#include <asm-generic/tlb.h> 22#include <asm-generic/tlb.h>
23 23
24#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 24#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd)
25#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 25#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
26 26
27#endif 27#endif
diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts b/arch/powerpc/boot/dts/mpc8377_rdb.dts
index 224b4f0704b8..4f06dbc0d27e 100644
--- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -410,7 +410,7 @@
410 bus-range = <0 0>; 410 bus-range = <0 0>;
411 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 411 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
412 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 412 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
413 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 413 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
414 sleep = <&pmc 0x00010000>; 414 sleep = <&pmc 0x00010000>;
415 clock-frequency = <66666666>; 415 clock-frequency = <66666666>;
416 #interrupt-cells = <1>; 416 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts b/arch/powerpc/boot/dts/mpc8378_rdb.dts
index 474ea2fa3f86..aabf3437cadf 100644
--- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -394,7 +394,7 @@
394 bus-range = <0 0>; 394 bus-range = <0 0>;
395 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 395 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
396 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 396 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
397 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 397 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
398 sleep = <&pmc 0x00010000>; 398 sleep = <&pmc 0x00010000>;
399 clock-frequency = <66666666>; 399 clock-frequency = <66666666>;
400 #interrupt-cells = <1>; 400 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts b/arch/powerpc/boot/dts/mpc8379_rdb.dts
index d4838af8d379..9b1da864d890 100644
--- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -424,7 +424,7 @@
424 bus-range = <0x0 0x0>; 424 bus-range = <0x0 0x0>;
425 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000 425 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
426 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000 426 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
427 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 427 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
428 sleep = <&pmc 0x00010000>; 428 sleep = <&pmc 0x00010000>;
429 clock-frequency = <66666666>; 429 clock-frequency = <66666666>;
430 #interrupt-cells = <1>; 430 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index a680165292f2..9e4ce99e1613 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -501,6 +501,10 @@
501 reg = <0x6>; 501 reg = <0x6>;
502 device_type = "ethernet-phy"; 502 device_type = "ethernet-phy";
503 }; 503 };
504 tbi-phy@11 {
505 reg = <0x11>;
506 device_type = "tbi-phy";
507 };
504 }; 508 };
505 mdio@3520 { 509 mdio@3520 {
506 #address-cells = <1>; 510 #address-cells = <1>;
diff --git a/arch/powerpc/configs/83xx/asp8347_defconfig b/arch/powerpc/configs/83xx/asp8347_defconfig
index 278939713775..a2df0635b6de 100644
--- a/arch/powerpc/configs/83xx/asp8347_defconfig
+++ b/arch/powerpc/configs/83xx/asp8347_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:05 2009 4# Wed Jul 29 23:32:02 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19CONFIG_FSL_EMB_PERFMON=y 20CONFIG_FSL_EMB_PERFMON=y
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,6 +56,7 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 60# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_REDBOOT=y 61CONFIG_REDBOOT=y
58CONFIG_ARCH_SUSPEND_POSSIBLE=y 62CONFIG_ARCH_SUSPEND_POSSIBLE=y
@@ -60,6 +64,7 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -108,7 +113,6 @@ CONFIG_ANON_INODES=y
108CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
110# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,9 +125,16 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
126CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
129CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_PPC_83xx=y
190# CONFIG_MPC837x_RDB is not set 205# CONFIG_MPC837x_RDB is not set
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192CONFIG_ASP834x=y 207CONFIG_ASP834x=y
208# CONFIG_KMETER1 is not set
193CONFIG_PPC_MPC834x=y 209CONFIG_PPC_MPC834x=y
194# CONFIG_PPC_86xx is not set 210# CONFIG_PPC_86xx is not set
195# CONFIG_EMBEDDED6xx is not set 211# CONFIG_EMBEDDED6xx is not set
@@ -235,6 +251,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_HAVE_AOUT is not set 251# CONFIG_HAVE_AOUT is not set
236# CONFIG_BINFMT_MISC is not set 252# CONFIG_BINFMT_MISC is not set
237# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -490,6 +512,7 @@ CONFIG_MTD_PHYSMAP_OF=y
490# CONFIG_MTD_UBI is not set 512# CONFIG_MTD_UBI is not set
491CONFIG_OF_DEVICE=y 513CONFIG_OF_DEVICE=y
492CONFIG_OF_I2C=y 514CONFIG_OF_I2C=y
515CONFIG_OF_MDIO=y
493# CONFIG_PARPORT is not set 516# CONFIG_PARPORT is not set
494CONFIG_BLK_DEV=y 517CONFIG_BLK_DEV=y
495# CONFIG_BLK_DEV_FD is not set 518# CONFIG_BLK_DEV_FD is not set
@@ -525,7 +548,9 @@ CONFIG_MISC_DEVICES=y
525# 548#
526# CONFIG_EEPROM_AT24 is not set 549# CONFIG_EEPROM_AT24 is not set
527# CONFIG_EEPROM_LEGACY is not set 550# CONFIG_EEPROM_LEGACY is not set
551# CONFIG_EEPROM_MAX6875 is not set
528# CONFIG_EEPROM_93CX6 is not set 552# CONFIG_EEPROM_93CX6 is not set
553# CONFIG_CB710_CORE is not set
529CONFIG_HAVE_IDE=y 554CONFIG_HAVE_IDE=y
530# CONFIG_IDE is not set 555# CONFIG_IDE is not set
531 556
@@ -545,14 +570,17 @@ CONFIG_HAVE_IDE=y
545# 570#
546 571
547# 572#
548# Enable only one of the two stacks, unless you know what you are doing 573# You can enable one or both FireWire driver stacks.
574#
575
576#
577# See the help texts for more information.
549# 578#
550# CONFIG_FIREWIRE is not set 579# CONFIG_FIREWIRE is not set
551# CONFIG_IEEE1394 is not set 580# CONFIG_IEEE1394 is not set
552# CONFIG_I2O is not set 581# CONFIG_I2O is not set
553# CONFIG_MACINTOSH_DRIVERS is not set 582# CONFIG_MACINTOSH_DRIVERS is not set
554CONFIG_NETDEVICES=y 583CONFIG_NETDEVICES=y
555CONFIG_COMPAT_NET_DEV_OPS=y
556# CONFIG_DUMMY is not set 584# CONFIG_DUMMY is not set
557# CONFIG_BONDING is not set 585# CONFIG_BONDING is not set
558# CONFIG_MACVLAN is not set 586# CONFIG_MACVLAN is not set
@@ -599,6 +627,7 @@ CONFIG_MII=y
599# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 627# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
600# CONFIG_NET_PCI is not set 628# CONFIG_NET_PCI is not set
601# CONFIG_B44 is not set 629# CONFIG_B44 is not set
630# CONFIG_KS8842 is not set
602# CONFIG_ATL2 is not set 631# CONFIG_ATL2 is not set
603CONFIG_NETDEV_1000=y 632CONFIG_NETDEV_1000=y
604# CONFIG_ACENIC is not set 633# CONFIG_ACENIC is not set
@@ -618,8 +647,10 @@ CONFIG_NETDEV_1000=y
618# CONFIG_VIA_VELOCITY is not set 647# CONFIG_VIA_VELOCITY is not set
619# CONFIG_TIGON3 is not set 648# CONFIG_TIGON3 is not set
620# CONFIG_BNX2 is not set 649# CONFIG_BNX2 is not set
650# CONFIG_CNIC is not set
621CONFIG_FSL_PQ_MDIO=y 651CONFIG_FSL_PQ_MDIO=y
622CONFIG_GIANFAR=y 652CONFIG_GIANFAR=y
653# CONFIG_MV643XX_ETH is not set
623# CONFIG_QLA3XXX is not set 654# CONFIG_QLA3XXX is not set
624# CONFIG_ATL1 is not set 655# CONFIG_ATL1 is not set
625# CONFIG_ATL1E is not set 656# CONFIG_ATL1E is not set
@@ -786,13 +817,17 @@ CONFIG_I2C_MPC=y
786# CONFIG_SENSORS_PCF8574 is not set 817# CONFIG_SENSORS_PCF8574 is not set
787# CONFIG_PCF8575 is not set 818# CONFIG_PCF8575 is not set
788# CONFIG_SENSORS_PCA9539 is not set 819# CONFIG_SENSORS_PCA9539 is not set
789# CONFIG_SENSORS_MAX6875 is not set
790# CONFIG_SENSORS_TSL2550 is not set 820# CONFIG_SENSORS_TSL2550 is not set
791# CONFIG_I2C_DEBUG_CORE is not set 821# CONFIG_I2C_DEBUG_CORE is not set
792# CONFIG_I2C_DEBUG_ALGO is not set 822# CONFIG_I2C_DEBUG_ALGO is not set
793# CONFIG_I2C_DEBUG_BUS is not set 823# CONFIG_I2C_DEBUG_BUS is not set
794# CONFIG_I2C_DEBUG_CHIP is not set 824# CONFIG_I2C_DEBUG_CHIP is not set
795# CONFIG_SPI is not set 825# CONFIG_SPI is not set
826
827#
828# PPS support
829#
830# CONFIG_PPS is not set
796CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 831CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
797# CONFIG_GPIOLIB is not set 832# CONFIG_GPIOLIB is not set
798# CONFIG_W1 is not set 833# CONFIG_W1 is not set
@@ -847,6 +882,7 @@ CONFIG_HWMON=y
847# CONFIG_SENSORS_SMSC47B397 is not set 882# CONFIG_SENSORS_SMSC47B397 is not set
848# CONFIG_SENSORS_ADS7828 is not set 883# CONFIG_SENSORS_ADS7828 is not set
849# CONFIG_SENSORS_THMC50 is not set 884# CONFIG_SENSORS_THMC50 is not set
885# CONFIG_SENSORS_TMP401 is not set
850# CONFIG_SENSORS_VIA686A is not set 886# CONFIG_SENSORS_VIA686A is not set
851# CONFIG_SENSORS_VT1211 is not set 887# CONFIG_SENSORS_VT1211 is not set
852# CONFIG_SENSORS_VT8231 is not set 888# CONFIG_SENSORS_VT8231 is not set
@@ -900,24 +936,9 @@ CONFIG_SSB_POSSIBLE=y
900# CONFIG_MFD_WM8400 is not set 936# CONFIG_MFD_WM8400 is not set
901# CONFIG_MFD_WM8350_I2C is not set 937# CONFIG_MFD_WM8350_I2C is not set
902# CONFIG_MFD_PCF50633 is not set 938# CONFIG_MFD_PCF50633 is not set
939# CONFIG_AB3100_CORE is not set
903# CONFIG_REGULATOR is not set 940# CONFIG_REGULATOR is not set
904 941# CONFIG_MEDIA_SUPPORT is not set
905#
906# Multimedia devices
907#
908
909#
910# Multimedia core support
911#
912# CONFIG_VIDEO_DEV is not set
913# CONFIG_DVB_CORE is not set
914# CONFIG_VIDEO_MEDIA is not set
915
916#
917# Multimedia drivers
918#
919CONFIG_DAB=y
920# CONFIG_USB_DABUSB is not set
921 942
922# 943#
923# Graphics support 944# Graphics support
@@ -960,6 +981,7 @@ CONFIG_USB_MON=y
960# USB Host Controller Drivers 981# USB Host Controller Drivers
961# 982#
962# CONFIG_USB_C67X00_HCD is not set 983# CONFIG_USB_C67X00_HCD is not set
984# CONFIG_USB_XHCI_HCD is not set
963CONFIG_USB_EHCI_HCD=y 985CONFIG_USB_EHCI_HCD=y
964CONFIG_USB_EHCI_ROOT_HUB_TT=y 986CONFIG_USB_EHCI_ROOT_HUB_TT=y
965# CONFIG_USB_EHCI_TT_NEWSCHED is not set 987# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1069,6 +1091,7 @@ CONFIG_RTC_DRV_DS1374=y
1069# CONFIG_RTC_DRV_S35390A is not set 1091# CONFIG_RTC_DRV_S35390A is not set
1070# CONFIG_RTC_DRV_FM3130 is not set 1092# CONFIG_RTC_DRV_FM3130 is not set
1071# CONFIG_RTC_DRV_RX8581 is not set 1093# CONFIG_RTC_DRV_RX8581 is not set
1094# CONFIG_RTC_DRV_RX8025 is not set
1072 1095
1073# 1096#
1074# SPI RTC drivers 1097# SPI RTC drivers
@@ -1096,6 +1119,10 @@ CONFIG_RTC_DRV_DS1374=y
1096# CONFIG_DMADEVICES is not set 1119# CONFIG_DMADEVICES is not set
1097# CONFIG_AUXDISPLAY is not set 1120# CONFIG_AUXDISPLAY is not set
1098# CONFIG_UIO is not set 1121# CONFIG_UIO is not set
1122
1123#
1124# TI VLYNQ
1125#
1099# CONFIG_STAGING is not set 1126# CONFIG_STAGING is not set
1100 1127
1101# 1128#
@@ -1115,10 +1142,12 @@ CONFIG_FS_MBCACHE=y
1115# CONFIG_REISERFS_FS is not set 1142# CONFIG_REISERFS_FS is not set
1116# CONFIG_JFS_FS is not set 1143# CONFIG_JFS_FS is not set
1117# CONFIG_FS_POSIX_ACL is not set 1144# CONFIG_FS_POSIX_ACL is not set
1118CONFIG_FILE_LOCKING=y
1119# CONFIG_XFS_FS is not set 1145# CONFIG_XFS_FS is not set
1146# CONFIG_GFS2_FS is not set
1120# CONFIG_OCFS2_FS is not set 1147# CONFIG_OCFS2_FS is not set
1121# CONFIG_BTRFS_FS is not set 1148# CONFIG_BTRFS_FS is not set
1149CONFIG_FILE_LOCKING=y
1150CONFIG_FSNOTIFY=y
1122CONFIG_DNOTIFY=y 1151CONFIG_DNOTIFY=y
1123CONFIG_INOTIFY=y 1152CONFIG_INOTIFY=y
1124CONFIG_INOTIFY_USER=y 1153CONFIG_INOTIFY_USER=y
@@ -1192,6 +1221,7 @@ CONFIG_NFS_FS=y
1192CONFIG_NFS_V3=y 1221CONFIG_NFS_V3=y
1193# CONFIG_NFS_V3_ACL is not set 1222# CONFIG_NFS_V3_ACL is not set
1194CONFIG_NFS_V4=y 1223CONFIG_NFS_V4=y
1224# CONFIG_NFS_V4_1 is not set
1195CONFIG_ROOT_NFS=y 1225CONFIG_ROOT_NFS=y
1196# CONFIG_NFSD is not set 1226# CONFIG_NFSD is not set
1197CONFIG_LOCKD=y 1227CONFIG_LOCKD=y
@@ -1287,6 +1317,7 @@ CONFIG_HAS_IOPORT=y
1287CONFIG_HAS_DMA=y 1317CONFIG_HAS_DMA=y
1288CONFIG_HAVE_LMB=y 1318CONFIG_HAVE_LMB=y
1289CONFIG_NLATTR=y 1319CONFIG_NLATTR=y
1320CONFIG_GENERIC_ATOMIC64=y
1290 1321
1291# 1322#
1292# Kernel hacking 1323# Kernel hacking
@@ -1312,22 +1343,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1312CONFIG_HAVE_DYNAMIC_FTRACE=y 1343CONFIG_HAVE_DYNAMIC_FTRACE=y
1313CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1344CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1314CONFIG_TRACING_SUPPORT=y 1345CONFIG_TRACING_SUPPORT=y
1315 1346# CONFIG_FTRACE is not set
1316#
1317# Tracers
1318#
1319# CONFIG_FUNCTION_TRACER is not set
1320# CONFIG_SCHED_TRACER is not set
1321# CONFIG_CONTEXT_SWITCH_TRACER is not set
1322# CONFIG_EVENT_TRACER is not set
1323# CONFIG_BOOT_TRACER is not set
1324# CONFIG_TRACE_BRANCH_PROFILING is not set
1325# CONFIG_STACK_TRACER is not set
1326# CONFIG_KMEMTRACE is not set
1327# CONFIG_WORKQUEUE_TRACER is not set
1328# CONFIG_BLK_DEV_IO_TRACE is not set
1329# CONFIG_SAMPLES is not set 1347# CONFIG_SAMPLES is not set
1330CONFIG_HAVE_ARCH_KGDB=y 1348CONFIG_HAVE_ARCH_KGDB=y
1349# CONFIG_PPC_DISABLE_WERROR is not set
1350CONFIG_PPC_WERROR=y
1331CONFIG_PRINT_STACK_DEPTH=64 1351CONFIG_PRINT_STACK_DEPTH=64
1332# CONFIG_IRQSTACKS is not set 1352# CONFIG_IRQSTACKS is not set
1333# CONFIG_BOOTX_TEXT is not set 1353# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/kmeter1_defconfig b/arch/powerpc/configs/83xx/kmeter1_defconfig
index bf0853f29f31..93ebd443a18f 100644
--- a/arch/powerpc/configs/83xx/kmeter1_defconfig
+++ b/arch/powerpc/configs/83xx/kmeter1_defconfig
@@ -1,25 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28 3# Linux kernel version: 2.6.31-rc4
4# Fri Apr 3 10:34:33 2009 4# Wed Jul 29 23:32:03 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
17CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
18# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
19# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 26# CONFIG_SMP is not set
24CONFIG_PPC32=y 27CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -30,21 +33,22 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 48CONFIG_PPC=y
45CONFIG_EARLY_PRINTK=y 49CONFIG_EARLY_PRINTK=y
46CONFIG_GENERIC_NVRAM=y 50CONFIG_GENERIC_NVRAM=y
47CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 51CONFIG_SCHED_OMIT_FRAME_POINTER=y
48CONFIG_ARCH_MAY_HAVE_PC_FDC=y 52CONFIG_ARCH_MAY_HAVE_PC_FDC=y
49CONFIG_PPC_OF=y 53CONFIG_PPC_OF=y
50CONFIG_OF=y 54CONFIG_OF=y
@@ -52,11 +56,14 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
55CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
56CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
57# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
60 67
61# 68#
62# General setup 69# General setup
@@ -71,19 +78,30 @@ CONFIG_LOCALVERSION_AUTO=y
71CONFIG_SYSVIPC=y 78CONFIG_SYSVIPC=y
72CONFIG_SYSVIPC_SYSCTL=y 79CONFIG_SYSVIPC_SYSCTL=y
73CONFIG_POSIX_MQUEUE=y 80CONFIG_POSIX_MQUEUE=y
81CONFIG_POSIX_MQUEUE_SYSCTL=y
74# CONFIG_BSD_PROCESS_ACCT is not set 82# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 83# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 84# CONFIG_AUDIT is not set
85
86#
87# RCU Subsystem
88#
89CONFIG_CLASSIC_RCU=y
90# CONFIG_TREE_RCU is not set
91# CONFIG_PREEMPT_RCU is not set
92# CONFIG_TREE_RCU_TRACE is not set
93# CONFIG_PREEMPT_RCU_TRACE is not set
77# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
78CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
79# CONFIG_CGROUPS is not set
80# CONFIG_GROUP_SCHED is not set 96# CONFIG_GROUP_SCHED is not set
97# CONFIG_CGROUPS is not set
81# CONFIG_SYSFS_DEPRECATED_V2 is not set 98# CONFIG_SYSFS_DEPRECATED_V2 is not set
82# CONFIG_RELAY is not set 99# CONFIG_RELAY is not set
83# CONFIG_NAMESPACES is not set 100# CONFIG_NAMESPACES is not set
84# CONFIG_BLK_DEV_INITRD is not set 101# CONFIG_BLK_DEV_INITRD is not set
85CONFIG_CC_OPTIMIZE_FOR_SIZE=y 102CONFIG_CC_OPTIMIZE_FOR_SIZE=y
86CONFIG_SYSCTL=y 103CONFIG_SYSCTL=y
104CONFIG_ANON_INODES=y
87CONFIG_EMBEDDED=y 105CONFIG_EMBEDDED=y
88CONFIG_SYSCTL_SYSCALL=y 106CONFIG_SYSCTL_SYSCALL=y
89CONFIG_KALLSYMS=y 107CONFIG_KALLSYMS=y
@@ -93,17 +111,23 @@ CONFIG_KALLSYMS_ALL=y
93CONFIG_PRINTK=y 111CONFIG_PRINTK=y
94CONFIG_BUG=y 112CONFIG_BUG=y
95CONFIG_ELF_CORE=y 113CONFIG_ELF_CORE=y
96CONFIG_COMPAT_BRK=y
97CONFIG_BASE_FULL=y 114CONFIG_BASE_FULL=y
98CONFIG_FUTEX=y 115CONFIG_FUTEX=y
99CONFIG_ANON_INODES=y
100CONFIG_EPOLL=y 116CONFIG_EPOLL=y
101CONFIG_SIGNALFD=y 117CONFIG_SIGNALFD=y
102CONFIG_TIMERFD=y 118CONFIG_TIMERFD=y
103CONFIG_EVENTFD=y 119CONFIG_EVENTFD=y
104CONFIG_SHMEM=y 120CONFIG_SHMEM=y
105CONFIG_AIO=y 121CONFIG_AIO=y
122CONFIG_HAVE_PERF_COUNTERS=y
123
124#
125# Performance Counters
126#
127# CONFIG_PERF_COUNTERS is not set
106CONFIG_VM_EVENT_COUNTERS=y 128CONFIG_VM_EVENT_COUNTERS=y
129# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y
107CONFIG_SLAB=y 131CONFIG_SLAB=y
108# CONFIG_SLUB is not set 132# CONFIG_SLUB is not set
109# CONFIG_SLOB is not set 133# CONFIG_SLOB is not set
@@ -116,10 +140,15 @@ CONFIG_HAVE_IOREMAP_PROT=y
116CONFIG_HAVE_KPROBES=y 140CONFIG_HAVE_KPROBES=y
117CONFIG_HAVE_KRETPROBES=y 141CONFIG_HAVE_KRETPROBES=y
118CONFIG_HAVE_ARCH_TRACEHOOK=y 142CONFIG_HAVE_ARCH_TRACEHOOK=y
143
144#
145# GCOV-based kernel profiling
146#
147# CONFIG_GCOV_KERNEL is not set
148# CONFIG_SLOW_WORK is not set
119# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 149# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
120CONFIG_SLABINFO=y 150CONFIG_SLABINFO=y
121CONFIG_RT_MUTEXES=y 151CONFIG_RT_MUTEXES=y
122# CONFIG_TINY_SHMEM is not set
123CONFIG_BASE_SMALL=0 152CONFIG_BASE_SMALL=0
124CONFIG_MODULES=y 153CONFIG_MODULES=y
125# CONFIG_MODULE_FORCE_LOAD is not set 154# CONFIG_MODULE_FORCE_LOAD is not set
@@ -127,11 +156,8 @@ CONFIG_MODULE_UNLOAD=y
127# CONFIG_MODULE_FORCE_UNLOAD is not set 156# CONFIG_MODULE_FORCE_UNLOAD is not set
128# CONFIG_MODVERSIONS is not set 157# CONFIG_MODVERSIONS is not set
129# CONFIG_MODULE_SRCVERSION_ALL is not set 158# CONFIG_MODULE_SRCVERSION_ALL is not set
130CONFIG_KMOD=y
131CONFIG_BLOCK=y 159CONFIG_BLOCK=y
132# CONFIG_LBD is not set 160CONFIG_LBDAF=y
133# CONFIG_BLK_DEV_IO_TRACE is not set
134# CONFIG_LSF is not set
135# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
136# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
137 163
@@ -147,14 +173,11 @@ CONFIG_IOSCHED_NOOP=y
147# CONFIG_DEFAULT_CFQ is not set 173# CONFIG_DEFAULT_CFQ is not set
148CONFIG_DEFAULT_NOOP=y 174CONFIG_DEFAULT_NOOP=y
149CONFIG_DEFAULT_IOSCHED="noop" 175CONFIG_DEFAULT_IOSCHED="noop"
150CONFIG_CLASSIC_RCU=y
151# CONFIG_FREEZER is not set 176# CONFIG_FREEZER is not set
152 177
153# 178#
154# Platform support 179# Platform support
155# 180#
156CONFIG_PPC_MULTIPLATFORM=y
157CONFIG_CLASSIC32=y
158# CONFIG_PPC_CHRP is not set 181# CONFIG_PPC_CHRP is not set
159# CONFIG_MPC5121_ADS is not set 182# CONFIG_MPC5121_ADS is not set
160# CONFIG_MPC5121_GENERIC is not set 183# CONFIG_MPC5121_GENERIC is not set
@@ -179,6 +202,8 @@ CONFIG_PPC_83xx=y
179CONFIG_KMETER1=y 202CONFIG_KMETER1=y
180# CONFIG_PPC_86xx is not set 203# CONFIG_PPC_86xx is not set
181# CONFIG_EMBEDDED6xx is not set 204# CONFIG_EMBEDDED6xx is not set
205# CONFIG_AMIGAONE is not set
206CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
182CONFIG_IPIC=y 207CONFIG_IPIC=y
183# CONFIG_MPIC is not set 208# CONFIG_MPIC is not set
184# CONFIG_MPIC_WEIRD is not set 209# CONFIG_MPIC_WEIRD is not set
@@ -194,6 +219,8 @@ CONFIG_IPIC=y
194CONFIG_QUICC_ENGINE=y 219CONFIG_QUICC_ENGINE=y
195# CONFIG_QE_GPIO is not set 220# CONFIG_QE_GPIO is not set
196# CONFIG_FSL_ULI1575 is not set 221# CONFIG_FSL_ULI1575 is not set
222# CONFIG_SIMPLE_GPIO is not set
223# CONFIG_MCU_MPC8349EMITX is not set
197 224
198# 225#
199# Kernel options 226# Kernel options
@@ -212,16 +239,17 @@ CONFIG_SCHED_HRTICK=y
212# CONFIG_PREEMPT_NONE is not set 239# CONFIG_PREEMPT_NONE is not set
213# CONFIG_PREEMPT_VOLUNTARY is not set 240# CONFIG_PREEMPT_VOLUNTARY is not set
214CONFIG_PREEMPT=y 241CONFIG_PREEMPT=y
215# CONFIG_PREEMPT_RCU is not set
216CONFIG_BINFMT_ELF=y 242CONFIG_BINFMT_ELF=y
217# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 243# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
218# CONFIG_HAVE_AOUT is not set 244# CONFIG_HAVE_AOUT is not set
219# CONFIG_BINFMT_MISC is not set 245# CONFIG_BINFMT_MISC is not set
220# CONFIG_IOMMU_HELPER is not set 246# CONFIG_IOMMU_HELPER is not set
247# CONFIG_SWIOTLB is not set
221CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
222CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
223CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
224# CONFIG_KEXEC is not set 251# CONFIG_KEXEC is not set
252# CONFIG_CRASH_DUMP is not set
225CONFIG_ARCH_FLATMEM_ENABLE=y 253CONFIG_ARCH_FLATMEM_ENABLE=y
226CONFIG_ARCH_POPULATES_NODE_MAP=y 254CONFIG_ARCH_POPULATES_NODE_MAP=y
227CONFIG_SELECT_MEMORY_MODEL=y 255CONFIG_SELECT_MEMORY_MODEL=y
@@ -233,12 +261,17 @@ CONFIG_FLAT_NODE_MEM_MAP=y
233CONFIG_PAGEFLAGS_EXTENDED=y 261CONFIG_PAGEFLAGS_EXTENDED=y
234CONFIG_SPLIT_PTLOCK_CPUS=4 262CONFIG_SPLIT_PTLOCK_CPUS=4
235CONFIG_MIGRATION=y 263CONFIG_MIGRATION=y
236# CONFIG_RESOURCES_64BIT is not set
237# CONFIG_PHYS_ADDR_T_64BIT is not set 264# CONFIG_PHYS_ADDR_T_64BIT is not set
238CONFIG_ZONE_DMA_FLAG=1 265CONFIG_ZONE_DMA_FLAG=1
239CONFIG_BOUNCE=y 266CONFIG_BOUNCE=y
240CONFIG_VIRT_TO_BUS=y 267CONFIG_VIRT_TO_BUS=y
241CONFIG_UNEVICTABLE_LRU=y 268CONFIG_HAVE_MLOCK=y
269CONFIG_HAVE_MLOCKED_PAGE_BIT=y
270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
271CONFIG_PPC_4K_PAGES=y
272# CONFIG_PPC_16K_PAGES is not set
273# CONFIG_PPC_64K_PAGES is not set
274# CONFIG_PPC_256K_PAGES is not set
242CONFIG_FORCE_MAX_ZONEORDER=11 275CONFIG_FORCE_MAX_ZONEORDER=11
243CONFIG_PROC_DEVICETREE=y 276CONFIG_PROC_DEVICETREE=y
244# CONFIG_CMDLINE_BOOL is not set 277# CONFIG_CMDLINE_BOOL is not set
@@ -331,7 +364,10 @@ CONFIG_LLC=m
331# CONFIG_LAPB is not set 364# CONFIG_LAPB is not set
332# CONFIG_ECONET is not set 365# CONFIG_ECONET is not set
333# CONFIG_WAN_ROUTER is not set 366# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set
368# CONFIG_IEEE802154 is not set
334# CONFIG_NET_SCHED is not set 369# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set
335 371
336# 372#
337# Network testing 373# Network testing
@@ -342,8 +378,8 @@ CONFIG_LLC=m
342# CONFIG_IRDA is not set 378# CONFIG_IRDA is not set
343# CONFIG_BT is not set 379# CONFIG_BT is not set
344# CONFIG_AF_RXRPC is not set 380# CONFIG_AF_RXRPC is not set
345# CONFIG_PHONET is not set
346# CONFIG_WIRELESS is not set 381# CONFIG_WIRELESS is not set
382# CONFIG_WIMAX is not set
347# CONFIG_RFKILL is not set 383# CONFIG_RFKILL is not set
348# CONFIG_NET_9P is not set 384# CONFIG_NET_9P is not set
349 385
@@ -362,6 +398,7 @@ CONFIG_MTD=y
362# CONFIG_MTD_DEBUG is not set 398# CONFIG_MTD_DEBUG is not set
363CONFIG_MTD_CONCAT=y 399CONFIG_MTD_CONCAT=y
364CONFIG_MTD_PARTITIONS=y 400CONFIG_MTD_PARTITIONS=y
401# CONFIG_MTD_TESTS is not set
365# CONFIG_MTD_REDBOOT_PARTS is not set 402# CONFIG_MTD_REDBOOT_PARTS is not set
366CONFIG_MTD_CMDLINE_PARTS=y 403CONFIG_MTD_CMDLINE_PARTS=y
367CONFIG_MTD_OF_PARTS=y 404CONFIG_MTD_OF_PARTS=y
@@ -431,6 +468,11 @@ CONFIG_MTD_PHRAM=y
431# CONFIG_MTD_ONENAND is not set 468# CONFIG_MTD_ONENAND is not set
432 469
433# 470#
471# LPDDR flash memory drivers
472#
473# CONFIG_MTD_LPDDR is not set
474
475#
434# UBI - Unsorted block images 476# UBI - Unsorted block images
435# 477#
436CONFIG_MTD_UBI=y 478CONFIG_MTD_UBI=y
@@ -445,7 +487,6 @@ CONFIG_MTD_UBI_DEBUG=y
445# CONFIG_MTD_UBI_DEBUG_MSG is not set 487# CONFIG_MTD_UBI_DEBUG_MSG is not set
446# CONFIG_MTD_UBI_DEBUG_PARANOID is not set 488# CONFIG_MTD_UBI_DEBUG_PARANOID is not set
447# CONFIG_MTD_UBI_DEBUG_DISABLE_BGT is not set 489# CONFIG_MTD_UBI_DEBUG_DISABLE_BGT is not set
448# CONFIG_MTD_UBI_DEBUG_USERSPACE_IO is not set
449# CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS is not set 490# CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS is not set
450# CONFIG_MTD_UBI_DEBUG_EMULATE_WRITE_FAILURES is not set 491# CONFIG_MTD_UBI_DEBUG_EMULATE_WRITE_FAILURES is not set
451# CONFIG_MTD_UBI_DEBUG_EMULATE_ERASE_FAILURES is not set 492# CONFIG_MTD_UBI_DEBUG_EMULATE_ERASE_FAILURES is not set
@@ -459,6 +500,7 @@ CONFIG_MTD_UBI_DEBUG=y
459# CONFIG_MTD_UBI_DEBUG_MSG_IO is not set 500# CONFIG_MTD_UBI_DEBUG_MSG_IO is not set
460CONFIG_OF_DEVICE=y 501CONFIG_OF_DEVICE=y
461CONFIG_OF_I2C=y 502CONFIG_OF_I2C=y
503CONFIG_OF_MDIO=y
462# CONFIG_PARPORT is not set 504# CONFIG_PARPORT is not set
463CONFIG_BLK_DEV=y 505CONFIG_BLK_DEV=y
464# CONFIG_BLK_DEV_FD is not set 506# CONFIG_BLK_DEV_FD is not set
@@ -505,10 +547,15 @@ CONFIG_MARVELL_PHY=y
505# CONFIG_BROADCOM_PHY is not set 547# CONFIG_BROADCOM_PHY is not set
506# CONFIG_ICPLUS_PHY is not set 548# CONFIG_ICPLUS_PHY is not set
507# CONFIG_REALTEK_PHY is not set 549# CONFIG_REALTEK_PHY is not set
550# CONFIG_NATIONAL_PHY is not set
551# CONFIG_STE10XP is not set
552# CONFIG_LSI_ET1011C_PHY is not set
508# CONFIG_FIXED_PHY is not set 553# CONFIG_FIXED_PHY is not set
509# CONFIG_MDIO_BITBANG is not set 554# CONFIG_MDIO_BITBANG is not set
510CONFIG_NET_ETHERNET=y 555CONFIG_NET_ETHERNET=y
511CONFIG_MII=y 556CONFIG_MII=y
557# CONFIG_ETHOC is not set
558# CONFIG_DNET is not set
512# CONFIG_IBM_NEW_EMAC_ZMII is not set 559# CONFIG_IBM_NEW_EMAC_ZMII is not set
513# CONFIG_IBM_NEW_EMAC_RGMII is not set 560# CONFIG_IBM_NEW_EMAC_RGMII is not set
514# CONFIG_IBM_NEW_EMAC_TAH is not set 561# CONFIG_IBM_NEW_EMAC_TAH is not set
@@ -517,11 +564,12 @@ CONFIG_MII=y
517# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 564# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
518# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 565# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
519# CONFIG_B44 is not set 566# CONFIG_B44 is not set
567# CONFIG_KS8842 is not set
520CONFIG_NETDEV_1000=y 568CONFIG_NETDEV_1000=y
569CONFIG_FSL_PQ_MDIO=y
521# CONFIG_GIANFAR is not set 570# CONFIG_GIANFAR is not set
522CONFIG_UCC_GETH=y 571CONFIG_UCC_GETH=y
523# CONFIG_UGETH_MAGIC_PACKET is not set 572# CONFIG_UGETH_MAGIC_PACKET is not set
524# CONFIG_UGETH_FILTERING is not set
525# CONFIG_UGETH_TX_ON_DEMAND is not set 573# CONFIG_UGETH_TX_ON_DEMAND is not set
526# CONFIG_MV643XX_ETH is not set 574# CONFIG_MV643XX_ETH is not set
527# CONFIG_NETDEV_10000 is not set 575# CONFIG_NETDEV_10000 is not set
@@ -531,7 +579,10 @@ CONFIG_UCC_GETH=y
531# 579#
532# CONFIG_WLAN_PRE80211 is not set 580# CONFIG_WLAN_PRE80211 is not set
533# CONFIG_WLAN_80211 is not set 581# CONFIG_WLAN_80211 is not set
534# CONFIG_IWLWIFI_LEDS is not set 582
583#
584# Enable WiMAX (Networking options) to see the WiMAX drivers
585#
535CONFIG_WAN=y 586CONFIG_WAN=y
536CONFIG_HDLC=y 587CONFIG_HDLC=y
537# CONFIG_HDLC_RAW is not set 588# CONFIG_HDLC_RAW is not set
@@ -543,8 +594,6 @@ CONFIG_HDLC=y
543# 594#
544# X.25/LAPB support is disabled 595# X.25/LAPB support is disabled
545# 596#
546CONFIG_HDLC_KM=y
547CONFIG_FS_UCC_HDLC=y
548# CONFIG_DLCI is not set 597# CONFIG_DLCI is not set
549CONFIG_PPP=y 598CONFIG_PPP=y
550CONFIG_PPP_MULTILINK=y 599CONFIG_PPP_MULTILINK=y
@@ -600,16 +649,18 @@ CONFIG_SERIAL_CORE_CONSOLE=y
600# CONFIG_SERIAL_OF_PLATFORM is not set 649# CONFIG_SERIAL_OF_PLATFORM is not set
601# CONFIG_SERIAL_QE is not set 650# CONFIG_SERIAL_QE is not set
602CONFIG_UNIX98_PTYS=y 651CONFIG_UNIX98_PTYS=y
652# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
603CONFIG_LEGACY_PTYS=y 653CONFIG_LEGACY_PTYS=y
604CONFIG_LEGACY_PTY_COUNT=256 654CONFIG_LEGACY_PTY_COUNT=256
655# CONFIG_HVC_UDBG is not set
605# CONFIG_IPMI_HANDLER is not set 656# CONFIG_IPMI_HANDLER is not set
606CONFIG_HW_RANDOM=y 657CONFIG_HW_RANDOM=y
658# CONFIG_HW_RANDOM_TIMERIOMEM is not set
607# CONFIG_NVRAM is not set 659# CONFIG_NVRAM is not set
608# CONFIG_GEN_RTC is not set 660# CONFIG_GEN_RTC is not set
609# CONFIG_R3964 is not set 661# CONFIG_R3964 is not set
610# CONFIG_RAW_DRIVER is not set 662# CONFIG_RAW_DRIVER is not set
611# CONFIG_TCG_TPM is not set 663# CONFIG_TCG_TPM is not set
612CONFIG_BOOTCOUNT=y
613CONFIG_I2C=y 664CONFIG_I2C=y
614CONFIG_I2C_BOARDINFO=y 665CONFIG_I2C_BOARDINFO=y
615CONFIG_I2C_CHARDEV=y 666CONFIG_I2C_CHARDEV=y
@@ -642,20 +693,20 @@ CONFIG_I2C_MPC=y
642# Miscellaneous I2C Chip support 693# Miscellaneous I2C Chip support
643# 694#
644# CONFIG_DS1682 is not set 695# CONFIG_DS1682 is not set
645# CONFIG_AT24 is not set
646# CONFIG_SENSORS_EEPROM is not set
647# CONFIG_SENSORS_PCF8574 is not set 696# CONFIG_SENSORS_PCF8574 is not set
648# CONFIG_PCF8575 is not set 697# CONFIG_PCF8575 is not set
649# CONFIG_SENSORS_PCA9539 is not set 698# CONFIG_SENSORS_PCA9539 is not set
650# CONFIG_SENSORS_PCF8591 is not set
651# CONFIG_SENSORS_MAX6875 is not set
652# CONFIG_SENSORS_TSL2550 is not set 699# CONFIG_SENSORS_TSL2550 is not set
653# CONFIG_MCU_MPC8349EMITX is not set
654# CONFIG_I2C_DEBUG_CORE is not set 700# CONFIG_I2C_DEBUG_CORE is not set
655# CONFIG_I2C_DEBUG_ALGO is not set 701# CONFIG_I2C_DEBUG_ALGO is not set
656# CONFIG_I2C_DEBUG_BUS is not set 702# CONFIG_I2C_DEBUG_BUS is not set
657# CONFIG_I2C_DEBUG_CHIP is not set 703# CONFIG_I2C_DEBUG_CHIP is not set
658# CONFIG_SPI is not set 704# CONFIG_SPI is not set
705
706#
707# PPS support
708#
709# CONFIG_PPS is not set
659CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 710CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
660# CONFIG_GPIOLIB is not set 711# CONFIG_GPIOLIB is not set
661# CONFIG_W1 is not set 712# CONFIG_W1 is not set
@@ -677,27 +728,15 @@ CONFIG_SSB_POSSIBLE=y
677# CONFIG_MFD_CORE is not set 728# CONFIG_MFD_CORE is not set
678# CONFIG_MFD_SM501 is not set 729# CONFIG_MFD_SM501 is not set
679# CONFIG_HTC_PASIC3 is not set 730# CONFIG_HTC_PASIC3 is not set
731# CONFIG_TWL4030_CORE is not set
680# CONFIG_MFD_TMIO is not set 732# CONFIG_MFD_TMIO is not set
681# CONFIG_PMIC_DA903X is not set 733# CONFIG_PMIC_DA903X is not set
682# CONFIG_MFD_WM8400 is not set 734# CONFIG_MFD_WM8400 is not set
683# CONFIG_MFD_WM8350_I2C is not set 735# CONFIG_MFD_WM8350_I2C is not set
736# CONFIG_MFD_PCF50633 is not set
737# CONFIG_AB3100_CORE is not set
684# CONFIG_REGULATOR is not set 738# CONFIG_REGULATOR is not set
685 739# CONFIG_MEDIA_SUPPORT is not set
686#
687# Multimedia devices
688#
689
690#
691# Multimedia core support
692#
693# CONFIG_VIDEO_DEV is not set
694# CONFIG_DVB_CORE is not set
695# CONFIG_VIDEO_MEDIA is not set
696
697#
698# Multimedia drivers
699#
700# CONFIG_DAB is not set
701 740
702# 741#
703# Graphics support 742# Graphics support
@@ -720,11 +759,16 @@ CONFIG_SSB_POSSIBLE=y
720# CONFIG_EDAC is not set 759# CONFIG_EDAC is not set
721# CONFIG_RTC_CLASS is not set 760# CONFIG_RTC_CLASS is not set
722# CONFIG_DMADEVICES is not set 761# CONFIG_DMADEVICES is not set
762# CONFIG_AUXDISPLAY is not set
723CONFIG_UIO=y 763CONFIG_UIO=y
724# CONFIG_UIO_PDRV is not set 764# CONFIG_UIO_PDRV is not set
725# CONFIG_UIO_PDRV_GENIRQ is not set 765# CONFIG_UIO_PDRV_GENIRQ is not set
726# CONFIG_UIO_SMX is not set 766# CONFIG_UIO_SMX is not set
727# CONFIG_UIO_SERCOS3 is not set 767# CONFIG_UIO_SERCOS3 is not set
768
769#
770# TI VLYNQ
771#
728# CONFIG_STAGING is not set 772# CONFIG_STAGING is not set
729 773
730# 774#
@@ -736,9 +780,12 @@ CONFIG_UIO=y
736# CONFIG_REISERFS_FS is not set 780# CONFIG_REISERFS_FS is not set
737# CONFIG_JFS_FS is not set 781# CONFIG_JFS_FS is not set
738# CONFIG_FS_POSIX_ACL is not set 782# CONFIG_FS_POSIX_ACL is not set
739CONFIG_FILE_LOCKING=y
740# CONFIG_XFS_FS is not set 783# CONFIG_XFS_FS is not set
784# CONFIG_GFS2_FS is not set
741# CONFIG_OCFS2_FS is not set 785# CONFIG_OCFS2_FS is not set
786# CONFIG_BTRFS_FS is not set
787CONFIG_FILE_LOCKING=y
788CONFIG_FSNOTIFY=y
742# CONFIG_DNOTIFY is not set 789# CONFIG_DNOTIFY is not set
743CONFIG_INOTIFY=y 790CONFIG_INOTIFY=y
744CONFIG_INOTIFY_USER=y 791CONFIG_INOTIFY_USER=y
@@ -748,6 +795,11 @@ CONFIG_INOTIFY_USER=y
748# CONFIG_FUSE_FS is not set 795# CONFIG_FUSE_FS is not set
749 796
750# 797#
798# Caches
799#
800# CONFIG_FSCACHE is not set
801
802#
751# CD-ROM/DVD Filesystems 803# CD-ROM/DVD Filesystems
752# 804#
753# CONFIG_ISO9660_FS is not set 805# CONFIG_ISO9660_FS is not set
@@ -772,10 +824,7 @@ CONFIG_TMPFS=y
772# CONFIG_TMPFS_POSIX_ACL is not set 824# CONFIG_TMPFS_POSIX_ACL is not set
773# CONFIG_HUGETLB_PAGE is not set 825# CONFIG_HUGETLB_PAGE is not set
774# CONFIG_CONFIGFS_FS is not set 826# CONFIG_CONFIGFS_FS is not set
775 827CONFIG_MISC_FILESYSTEMS=y
776#
777# Miscellaneous filesystems
778#
779# CONFIG_ADFS_FS is not set 828# CONFIG_ADFS_FS is not set
780# CONFIG_AFFS_FS is not set 829# CONFIG_AFFS_FS is not set
781# CONFIG_HFS_FS is not set 830# CONFIG_HFS_FS is not set
@@ -796,6 +845,7 @@ CONFIG_JFFS2_RTIME=y
796# CONFIG_JFFS2_RUBIN is not set 845# CONFIG_JFFS2_RUBIN is not set
797# CONFIG_UBIFS_FS is not set 846# CONFIG_UBIFS_FS is not set
798# CONFIG_CRAMFS is not set 847# CONFIG_CRAMFS is not set
848# CONFIG_SQUASHFS is not set
799# CONFIG_VXFS_FS is not set 849# CONFIG_VXFS_FS is not set
800# CONFIG_MINIX_FS is not set 850# CONFIG_MINIX_FS is not set
801# CONFIG_OMFS_FS is not set 851# CONFIG_OMFS_FS is not set
@@ -804,6 +854,7 @@ CONFIG_JFFS2_RTIME=y
804# CONFIG_ROMFS_FS is not set 854# CONFIG_ROMFS_FS is not set
805# CONFIG_SYSV_FS is not set 855# CONFIG_SYSV_FS is not set
806# CONFIG_UFS_FS is not set 856# CONFIG_UFS_FS is not set
857# CONFIG_NILFS2_FS is not set
807CONFIG_NETWORK_FILESYSTEMS=y 858CONFIG_NETWORK_FILESYSTEMS=y
808CONFIG_NFS_FS=y 859CONFIG_NFS_FS=y
809CONFIG_NFS_V3=y 860CONFIG_NFS_V3=y
@@ -815,7 +866,6 @@ CONFIG_LOCKD=y
815CONFIG_LOCKD_V4=y 866CONFIG_LOCKD_V4=y
816CONFIG_NFS_COMMON=y 867CONFIG_NFS_COMMON=y
817CONFIG_SUNRPC=y 868CONFIG_SUNRPC=y
818# CONFIG_SUNRPC_REGISTER_V4 is not set
819# CONFIG_RPCSEC_GSS_KRB5 is not set 869# CONFIG_RPCSEC_GSS_KRB5 is not set
820# CONFIG_RPCSEC_GSS_SPKM3 is not set 870# CONFIG_RPCSEC_GSS_SPKM3 is not set
821# CONFIG_SMB_FS is not set 871# CONFIG_SMB_FS is not set
@@ -845,11 +895,13 @@ CONFIG_PARTITION_ADVANCED=y
845# CONFIG_DLM is not set 895# CONFIG_DLM is not set
846CONFIG_UCC_FAST=y 896CONFIG_UCC_FAST=y
847CONFIG_UCC=y 897CONFIG_UCC=y
898# CONFIG_BINARY_PRINTF is not set
848 899
849# 900#
850# Library routines 901# Library routines
851# 902#
852CONFIG_BITREVERSE=y 903CONFIG_BITREVERSE=y
904CONFIG_GENERIC_FIND_LAST_BIT=y
853# CONFIG_CRC_CCITT is not set 905# CONFIG_CRC_CCITT is not set
854# CONFIG_CRC16 is not set 906# CONFIG_CRC16 is not set
855# CONFIG_CRC_T10DIF is not set 907# CONFIG_CRC_T10DIF is not set
@@ -859,11 +911,12 @@ CONFIG_CRC32=y
859# CONFIG_LIBCRC32C is not set 911# CONFIG_LIBCRC32C is not set
860CONFIG_ZLIB_INFLATE=y 912CONFIG_ZLIB_INFLATE=y
861CONFIG_ZLIB_DEFLATE=y 913CONFIG_ZLIB_DEFLATE=y
862CONFIG_PLIST=y
863CONFIG_HAS_IOMEM=y 914CONFIG_HAS_IOMEM=y
864CONFIG_HAS_IOPORT=y 915CONFIG_HAS_IOPORT=y
865CONFIG_HAS_DMA=y 916CONFIG_HAS_DMA=y
866CONFIG_HAVE_LMB=y 917CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y
919CONFIG_GENERIC_ATOMIC64=y
867 920
868# 921#
869# Kernel hacking 922# Kernel hacking
@@ -883,13 +936,18 @@ CONFIG_DEBUG_FS=y
883# CONFIG_LATENCYTOP is not set 936# CONFIG_LATENCYTOP is not set
884CONFIG_SYSCTL_SYSCALL_CHECK=y 937CONFIG_SYSCTL_SYSCALL_CHECK=y
885CONFIG_HAVE_FUNCTION_TRACER=y 938CONFIG_HAVE_FUNCTION_TRACER=y
886 939CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
887# 940CONFIG_HAVE_DYNAMIC_FTRACE=y
888# Tracers 941CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
889# 942CONFIG_TRACING_SUPPORT=y
890# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 943# CONFIG_FTRACE is not set
944# CONFIG_DYNAMIC_DEBUG is not set
891# CONFIG_SAMPLES is not set 945# CONFIG_SAMPLES is not set
892CONFIG_HAVE_ARCH_KGDB=y 946CONFIG_HAVE_ARCH_KGDB=y
947# CONFIG_PPC_DISABLE_WERROR is not set
948CONFIG_PPC_WERROR=y
949CONFIG_PRINT_STACK_DEPTH=64
950# CONFIG_PPC_EMULATED_STATS is not set
893# CONFIG_IRQSTACKS is not set 951# CONFIG_IRQSTACKS is not set
894# CONFIG_VIRQ_DEBUG is not set 952# CONFIG_VIRQ_DEBUG is not set
895# CONFIG_BOOTX_TEXT is not set 953# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index c5c0fe71a438..ff33a7db2eab 100644
--- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:06 2009 4# Wed Jul 29 23:32:04 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC831x_RDB=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC831x=y 208CONFIG_PPC_MPC831x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -503,6 +525,7 @@ CONFIG_MTD_NAND_FSL_ELBC=y
503CONFIG_OF_DEVICE=y 525CONFIG_OF_DEVICE=y
504CONFIG_OF_I2C=y 526CONFIG_OF_I2C=y
505CONFIG_OF_SPI=y 527CONFIG_OF_SPI=y
528CONFIG_OF_MDIO=y
506# CONFIG_PARPORT is not set 529# CONFIG_PARPORT is not set
507CONFIG_BLK_DEV=y 530CONFIG_BLK_DEV=y
508# CONFIG_BLK_DEV_FD is not set 531# CONFIG_BLK_DEV_FD is not set
@@ -539,7 +562,9 @@ CONFIG_MISC_DEVICES=y
539# CONFIG_EEPROM_AT24 is not set 562# CONFIG_EEPROM_AT24 is not set
540# CONFIG_EEPROM_AT25 is not set 563# CONFIG_EEPROM_AT25 is not set
541# CONFIG_EEPROM_LEGACY is not set 564# CONFIG_EEPROM_LEGACY is not set
565# CONFIG_EEPROM_MAX6875 is not set
542# CONFIG_EEPROM_93CX6 is not set 566# CONFIG_EEPROM_93CX6 is not set
567# CONFIG_CB710_CORE is not set
543CONFIG_HAVE_IDE=y 568CONFIG_HAVE_IDE=y
544# CONFIG_IDE is not set 569# CONFIG_IDE is not set
545 570
@@ -562,10 +587,6 @@ CONFIG_SCSI_PROC_FS=y
562# CONFIG_BLK_DEV_SR is not set 587# CONFIG_BLK_DEV_SR is not set
563CONFIG_CHR_DEV_SG=y 588CONFIG_CHR_DEV_SG=y
564# CONFIG_CHR_DEV_SCH is not set 589# CONFIG_CHR_DEV_SCH is not set
565
566#
567# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
568#
569# CONFIG_SCSI_MULTI_LUN is not set 590# CONFIG_SCSI_MULTI_LUN is not set
570# CONFIG_SCSI_CONSTANTS is not set 591# CONFIG_SCSI_CONSTANTS is not set
571# CONFIG_SCSI_LOGGING is not set 592# CONFIG_SCSI_LOGGING is not set
@@ -583,6 +604,7 @@ CONFIG_SCSI_SPI_ATTRS=y
583CONFIG_SCSI_LOWLEVEL=y 604CONFIG_SCSI_LOWLEVEL=y
584# CONFIG_ISCSI_TCP is not set 605# CONFIG_ISCSI_TCP is not set
585# CONFIG_SCSI_CXGB3_ISCSI is not set 606# CONFIG_SCSI_CXGB3_ISCSI is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set
586# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
587# CONFIG_SCSI_3W_9XXX is not set 609# CONFIG_SCSI_3W_9XXX is not set
588# CONFIG_SCSI_ACARD is not set 610# CONFIG_SCSI_ACARD is not set
@@ -591,6 +613,7 @@ CONFIG_SCSI_LOWLEVEL=y
591# CONFIG_SCSI_AIC7XXX_OLD is not set 613# CONFIG_SCSI_AIC7XXX_OLD is not set
592# CONFIG_SCSI_AIC79XX is not set 614# CONFIG_SCSI_AIC79XX is not set
593# CONFIG_SCSI_AIC94XX is not set 615# CONFIG_SCSI_AIC94XX is not set
616# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_DPT_I2O is not set 617# CONFIG_SCSI_DPT_I2O is not set
595# CONFIG_SCSI_ADVANSYS is not set 618# CONFIG_SCSI_ADVANSYS is not set
596# CONFIG_SCSI_ARCMSR is not set 619# CONFIG_SCSI_ARCMSR is not set
@@ -610,7 +633,6 @@ CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_SCSI_IPS is not set 633# CONFIG_SCSI_IPS is not set
611# CONFIG_SCSI_INITIO is not set 634# CONFIG_SCSI_INITIO is not set
612# CONFIG_SCSI_INIA100 is not set 635# CONFIG_SCSI_INIA100 is not set
613# CONFIG_SCSI_MVSAS is not set
614# CONFIG_SCSI_STEX is not set 636# CONFIG_SCSI_STEX is not set
615# CONFIG_SCSI_SYM53C8XX_2 is not set 637# CONFIG_SCSI_SYM53C8XX_2 is not set
616# CONFIG_SCSI_QLOGIC_1280 is not set 638# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -643,14 +665,17 @@ CONFIG_MD_RAID1=y
643# 665#
644 666
645# 667#
646# Enable only one of the two stacks, unless you know what you are doing 668# You can enable one or both FireWire driver stacks.
669#
670
671#
672# See the help texts for more information.
647# 673#
648# CONFIG_FIREWIRE is not set 674# CONFIG_FIREWIRE is not set
649# CONFIG_IEEE1394 is not set 675# CONFIG_IEEE1394 is not set
650# CONFIG_I2O is not set 676# CONFIG_I2O is not set
651# CONFIG_MACINTOSH_DRIVERS is not set 677# CONFIG_MACINTOSH_DRIVERS is not set
652CONFIG_NETDEVICES=y 678CONFIG_NETDEVICES=y
653CONFIG_COMPAT_NET_DEV_OPS=y
654# CONFIG_DUMMY is not set 679# CONFIG_DUMMY is not set
655# CONFIG_BONDING is not set 680# CONFIG_BONDING is not set
656# CONFIG_MACVLAN is not set 681# CONFIG_MACVLAN is not set
@@ -714,6 +739,8 @@ CONFIG_E100=y
714# CONFIG_SMSC9420 is not set 739# CONFIG_SMSC9420 is not set
715# CONFIG_SUNDANCE is not set 740# CONFIG_SUNDANCE is not set
716# CONFIG_TLAN is not set 741# CONFIG_TLAN is not set
742# CONFIG_KS8842 is not set
743# CONFIG_KS8851 is not set
717# CONFIG_VIA_RHINE is not set 744# CONFIG_VIA_RHINE is not set
718# CONFIG_SC92031 is not set 745# CONFIG_SC92031 is not set
719# CONFIG_ATL2 is not set 746# CONFIG_ATL2 is not set
@@ -735,8 +762,10 @@ CONFIG_NETDEV_1000=y
735# CONFIG_VIA_VELOCITY is not set 762# CONFIG_VIA_VELOCITY is not set
736# CONFIG_TIGON3 is not set 763# CONFIG_TIGON3 is not set
737# CONFIG_BNX2 is not set 764# CONFIG_BNX2 is not set
765# CONFIG_CNIC is not set
738CONFIG_FSL_PQ_MDIO=y 766CONFIG_FSL_PQ_MDIO=y
739CONFIG_GIANFAR=y 767CONFIG_GIANFAR=y
768# CONFIG_MV643XX_ETH is not set
740# CONFIG_QLA3XXX is not set 769# CONFIG_QLA3XXX is not set
741# CONFIG_ATL1 is not set 770# CONFIG_ATL1 is not set
742# CONFIG_ATL1E is not set 771# CONFIG_ATL1E is not set
@@ -924,7 +953,6 @@ CONFIG_I2C_MPC=y
924# CONFIG_SENSORS_PCF8574 is not set 953# CONFIG_SENSORS_PCF8574 is not set
925# CONFIG_PCF8575 is not set 954# CONFIG_PCF8575 is not set
926# CONFIG_SENSORS_PCA9539 is not set 955# CONFIG_SENSORS_PCA9539 is not set
927# CONFIG_SENSORS_MAX6875 is not set
928# CONFIG_SENSORS_TSL2550 is not set 956# CONFIG_SENSORS_TSL2550 is not set
929# CONFIG_I2C_DEBUG_CORE is not set 957# CONFIG_I2C_DEBUG_CORE is not set
930# CONFIG_I2C_DEBUG_ALGO is not set 958# CONFIG_I2C_DEBUG_ALGO is not set
@@ -938,13 +966,18 @@ CONFIG_SPI_MASTER=y
938# SPI Master Controller Drivers 966# SPI Master Controller Drivers
939# 967#
940CONFIG_SPI_BITBANG=y 968CONFIG_SPI_BITBANG=y
941CONFIG_SPI_MPC83xx=y 969# CONFIG_SPI_MPC8xxx is not set
942 970
943# 971#
944# SPI Protocol Masters 972# SPI Protocol Masters
945# 973#
946# CONFIG_SPI_SPIDEV is not set 974# CONFIG_SPI_SPIDEV is not set
947# CONFIG_SPI_TLE62X0 is not set 975# CONFIG_SPI_TLE62X0 is not set
976
977#
978# PPS support
979#
980# CONFIG_PPS is not set
948CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 981CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
949# CONFIG_GPIOLIB is not set 982# CONFIG_GPIOLIB is not set
950# CONFIG_W1 is not set 983# CONFIG_W1 is not set
@@ -1002,6 +1035,7 @@ CONFIG_HWMON=y
1002# CONFIG_SENSORS_SMSC47B397 is not set 1035# CONFIG_SENSORS_SMSC47B397 is not set
1003# CONFIG_SENSORS_ADS7828 is not set 1036# CONFIG_SENSORS_ADS7828 is not set
1004# CONFIG_SENSORS_THMC50 is not set 1037# CONFIG_SENSORS_THMC50 is not set
1038# CONFIG_SENSORS_TMP401 is not set
1005# CONFIG_SENSORS_VIA686A is not set 1039# CONFIG_SENSORS_VIA686A is not set
1006# CONFIG_SENSORS_VT1211 is not set 1040# CONFIG_SENSORS_VT1211 is not set
1007# CONFIG_SENSORS_VT8231 is not set 1041# CONFIG_SENSORS_VT8231 is not set
@@ -1056,24 +1090,10 @@ CONFIG_SSB_POSSIBLE=y
1056# CONFIG_MFD_WM8400 is not set 1090# CONFIG_MFD_WM8400 is not set
1057# CONFIG_MFD_WM8350_I2C is not set 1091# CONFIG_MFD_WM8350_I2C is not set
1058# CONFIG_MFD_PCF50633 is not set 1092# CONFIG_MFD_PCF50633 is not set
1093# CONFIG_AB3100_CORE is not set
1094# CONFIG_EZX_PCAP is not set
1059# CONFIG_REGULATOR is not set 1095# CONFIG_REGULATOR is not set
1060 1096# CONFIG_MEDIA_SUPPORT is not set
1061#
1062# Multimedia devices
1063#
1064
1065#
1066# Multimedia core support
1067#
1068# CONFIG_VIDEO_DEV is not set
1069# CONFIG_DVB_CORE is not set
1070# CONFIG_VIDEO_MEDIA is not set
1071
1072#
1073# Multimedia drivers
1074#
1075CONFIG_DAB=y
1076# CONFIG_USB_DABUSB is not set
1077 1097
1078# 1098#
1079# Graphics support 1099# Graphics support
@@ -1135,6 +1155,7 @@ CONFIG_USB_MON=y
1135# USB Host Controller Drivers 1155# USB Host Controller Drivers
1136# 1156#
1137# CONFIG_USB_C67X00_HCD is not set 1157# CONFIG_USB_C67X00_HCD is not set
1158# CONFIG_USB_XHCI_HCD is not set
1138CONFIG_USB_EHCI_HCD=y 1159CONFIG_USB_EHCI_HCD=y
1139CONFIG_USB_EHCI_ROOT_HUB_TT=y 1160CONFIG_USB_EHCI_ROOT_HUB_TT=y
1140# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1161# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1144,9 +1165,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1144# CONFIG_USB_ISP116X_HCD is not set 1165# CONFIG_USB_ISP116X_HCD is not set
1145# CONFIG_USB_ISP1760_HCD is not set 1166# CONFIG_USB_ISP1760_HCD is not set
1146CONFIG_USB_OHCI_HCD=y 1167CONFIG_USB_OHCI_HCD=y
1147CONFIG_USB_OHCI_HCD_PPC_OF=y
1148CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1168CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1149# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1169# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1170CONFIG_USB_OHCI_HCD_PPC_OF=y
1150CONFIG_USB_OHCI_HCD_PCI=y 1171CONFIG_USB_OHCI_HCD_PCI=y
1151CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1172CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1152CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1173CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1235,8 +1256,9 @@ CONFIG_USB_GADGET_SELECTED=y
1235# CONFIG_USB_GADGET_OMAP is not set 1256# CONFIG_USB_GADGET_OMAP is not set
1236# CONFIG_USB_GADGET_PXA25X is not set 1257# CONFIG_USB_GADGET_PXA25X is not set
1237# CONFIG_USB_GADGET_PXA27X is not set 1258# CONFIG_USB_GADGET_PXA27X is not set
1238# CONFIG_USB_GADGET_S3C2410 is not set 1259# CONFIG_USB_GADGET_S3C_HSOTG is not set
1239# CONFIG_USB_GADGET_IMX is not set 1260# CONFIG_USB_GADGET_IMX is not set
1261# CONFIG_USB_GADGET_S3C2410 is not set
1240# CONFIG_USB_GADGET_M66592 is not set 1262# CONFIG_USB_GADGET_M66592 is not set
1241# CONFIG_USB_GADGET_AMD5536UDC is not set 1263# CONFIG_USB_GADGET_AMD5536UDC is not set
1242# CONFIG_USB_GADGET_FSL_QE is not set 1264# CONFIG_USB_GADGET_FSL_QE is not set
@@ -1244,9 +1266,11 @@ CONFIG_USB_GADGET_SELECTED=y
1244CONFIG_USB_GADGET_NET2280=y 1266CONFIG_USB_GADGET_NET2280=y
1245CONFIG_USB_NET2280=y 1267CONFIG_USB_NET2280=y
1246# CONFIG_USB_GADGET_GOKU is not set 1268# CONFIG_USB_GADGET_GOKU is not set
1269# CONFIG_USB_GADGET_LANGWELL is not set
1247# CONFIG_USB_GADGET_DUMMY_HCD is not set 1270# CONFIG_USB_GADGET_DUMMY_HCD is not set
1248CONFIG_USB_GADGET_DUALSPEED=y 1271CONFIG_USB_GADGET_DUALSPEED=y
1249# CONFIG_USB_ZERO is not set 1272# CONFIG_USB_ZERO is not set
1273# CONFIG_USB_AUDIO is not set
1250CONFIG_USB_ETH=y 1274CONFIG_USB_ETH=y
1251CONFIG_USB_ETH_RNDIS=y 1275CONFIG_USB_ETH_RNDIS=y
1252# CONFIG_USB_GADGETFS is not set 1276# CONFIG_USB_GADGETFS is not set
@@ -1298,6 +1322,7 @@ CONFIG_RTC_DRV_DS1307=y
1298# CONFIG_RTC_DRV_S35390A is not set 1322# CONFIG_RTC_DRV_S35390A is not set
1299# CONFIG_RTC_DRV_FM3130 is not set 1323# CONFIG_RTC_DRV_FM3130 is not set
1300# CONFIG_RTC_DRV_RX8581 is not set 1324# CONFIG_RTC_DRV_RX8581 is not set
1325# CONFIG_RTC_DRV_RX8025 is not set
1301 1326
1302# 1327#
1303# SPI RTC drivers 1328# SPI RTC drivers
@@ -1332,6 +1357,10 @@ CONFIG_RTC_DRV_DS1307=y
1332# CONFIG_DMADEVICES is not set 1357# CONFIG_DMADEVICES is not set
1333# CONFIG_AUXDISPLAY is not set 1358# CONFIG_AUXDISPLAY is not set
1334# CONFIG_UIO is not set 1359# CONFIG_UIO is not set
1360
1361#
1362# TI VLYNQ
1363#
1335# CONFIG_STAGING is not set 1364# CONFIG_STAGING is not set
1336 1365
1337# 1366#
@@ -1351,10 +1380,12 @@ CONFIG_FS_MBCACHE=y
1351# CONFIG_REISERFS_FS is not set 1380# CONFIG_REISERFS_FS is not set
1352# CONFIG_JFS_FS is not set 1381# CONFIG_JFS_FS is not set
1353# CONFIG_FS_POSIX_ACL is not set 1382# CONFIG_FS_POSIX_ACL is not set
1354CONFIG_FILE_LOCKING=y
1355# CONFIG_XFS_FS is not set 1383# CONFIG_XFS_FS is not set
1384# CONFIG_GFS2_FS is not set
1356# CONFIG_OCFS2_FS is not set 1385# CONFIG_OCFS2_FS is not set
1357# CONFIG_BTRFS_FS is not set 1386# CONFIG_BTRFS_FS is not set
1387CONFIG_FILE_LOCKING=y
1388CONFIG_FSNOTIFY=y
1358CONFIG_DNOTIFY=y 1389CONFIG_DNOTIFY=y
1359CONFIG_INOTIFY=y 1390CONFIG_INOTIFY=y
1360CONFIG_INOTIFY_USER=y 1391CONFIG_INOTIFY_USER=y
@@ -1428,6 +1459,7 @@ CONFIG_NFS_FS=y
1428CONFIG_NFS_V3=y 1459CONFIG_NFS_V3=y
1429# CONFIG_NFS_V3_ACL is not set 1460# CONFIG_NFS_V3_ACL is not set
1430CONFIG_NFS_V4=y 1461CONFIG_NFS_V4=y
1462# CONFIG_NFS_V4_1 is not set
1431CONFIG_ROOT_NFS=y 1463CONFIG_ROOT_NFS=y
1432# CONFIG_NFSD is not set 1464# CONFIG_NFSD is not set
1433CONFIG_LOCKD=y 1465CONFIG_LOCKD=y
@@ -1464,7 +1496,46 @@ CONFIG_MSDOS_PARTITION=y
1464# CONFIG_KARMA_PARTITION is not set 1496# CONFIG_KARMA_PARTITION is not set
1465# CONFIG_EFI_PARTITION is not set 1497# CONFIG_EFI_PARTITION is not set
1466# CONFIG_SYSV68_PARTITION is not set 1498# CONFIG_SYSV68_PARTITION is not set
1467# CONFIG_NLS is not set 1499CONFIG_NLS=y
1500CONFIG_NLS_DEFAULT="iso8859-1"
1501# CONFIG_NLS_CODEPAGE_437 is not set
1502# CONFIG_NLS_CODEPAGE_737 is not set
1503# CONFIG_NLS_CODEPAGE_775 is not set
1504# CONFIG_NLS_CODEPAGE_850 is not set
1505# CONFIG_NLS_CODEPAGE_852 is not set
1506# CONFIG_NLS_CODEPAGE_855 is not set
1507# CONFIG_NLS_CODEPAGE_857 is not set
1508# CONFIG_NLS_CODEPAGE_860 is not set
1509# CONFIG_NLS_CODEPAGE_861 is not set
1510# CONFIG_NLS_CODEPAGE_862 is not set
1511# CONFIG_NLS_CODEPAGE_863 is not set
1512# CONFIG_NLS_CODEPAGE_864 is not set
1513# CONFIG_NLS_CODEPAGE_865 is not set
1514# CONFIG_NLS_CODEPAGE_866 is not set
1515# CONFIG_NLS_CODEPAGE_869 is not set
1516# CONFIG_NLS_CODEPAGE_936 is not set
1517# CONFIG_NLS_CODEPAGE_950 is not set
1518# CONFIG_NLS_CODEPAGE_932 is not set
1519# CONFIG_NLS_CODEPAGE_949 is not set
1520# CONFIG_NLS_CODEPAGE_874 is not set
1521# CONFIG_NLS_ISO8859_8 is not set
1522# CONFIG_NLS_CODEPAGE_1250 is not set
1523# CONFIG_NLS_CODEPAGE_1251 is not set
1524# CONFIG_NLS_ASCII is not set
1525# CONFIG_NLS_ISO8859_1 is not set
1526# CONFIG_NLS_ISO8859_2 is not set
1527# CONFIG_NLS_ISO8859_3 is not set
1528# CONFIG_NLS_ISO8859_4 is not set
1529# CONFIG_NLS_ISO8859_5 is not set
1530# CONFIG_NLS_ISO8859_6 is not set
1531# CONFIG_NLS_ISO8859_7 is not set
1532# CONFIG_NLS_ISO8859_9 is not set
1533# CONFIG_NLS_ISO8859_13 is not set
1534# CONFIG_NLS_ISO8859_14 is not set
1535# CONFIG_NLS_ISO8859_15 is not set
1536# CONFIG_NLS_KOI8_R is not set
1537# CONFIG_NLS_KOI8_U is not set
1538# CONFIG_NLS_UTF8 is not set
1468# CONFIG_DLM is not set 1539# CONFIG_DLM is not set
1469# CONFIG_BINARY_PRINTF is not set 1540# CONFIG_BINARY_PRINTF is not set
1470 1541
@@ -1488,6 +1559,7 @@ CONFIG_HAS_IOPORT=y
1488CONFIG_HAS_DMA=y 1559CONFIG_HAS_DMA=y
1489CONFIG_HAVE_LMB=y 1560CONFIG_HAVE_LMB=y
1490CONFIG_NLATTR=y 1561CONFIG_NLATTR=y
1562CONFIG_GENERIC_ATOMIC64=y
1491 1563
1492# 1564#
1493# Kernel hacking 1565# Kernel hacking
@@ -1518,6 +1590,9 @@ CONFIG_SCHED_DEBUG=y
1518# CONFIG_RT_MUTEX_TESTER is not set 1590# CONFIG_RT_MUTEX_TESTER is not set
1519# CONFIG_DEBUG_SPINLOCK is not set 1591# CONFIG_DEBUG_SPINLOCK is not set
1520# CONFIG_DEBUG_MUTEXES is not set 1592# CONFIG_DEBUG_MUTEXES is not set
1593# CONFIG_DEBUG_LOCK_ALLOC is not set
1594# CONFIG_PROVE_LOCKING is not set
1595# CONFIG_LOCK_STAT is not set
1521# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1596# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1522# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1597# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1523# CONFIG_DEBUG_KOBJECT is not set 1598# CONFIG_DEBUG_KOBJECT is not set
@@ -1529,7 +1604,6 @@ CONFIG_SCHED_DEBUG=y
1529# CONFIG_DEBUG_LIST is not set 1604# CONFIG_DEBUG_LIST is not set
1530# CONFIG_DEBUG_SG is not set 1605# CONFIG_DEBUG_SG is not set
1531# CONFIG_DEBUG_NOTIFIERS is not set 1606# CONFIG_DEBUG_NOTIFIERS is not set
1532# CONFIG_BOOT_PRINTK_DELAY is not set
1533# CONFIG_RCU_TORTURE_TEST is not set 1607# CONFIG_RCU_TORTURE_TEST is not set
1534# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1608# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1535# CONFIG_BACKTRACE_SELF_TEST is not set 1609# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1543,16 +1617,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1543CONFIG_HAVE_DYNAMIC_FTRACE=y 1617CONFIG_HAVE_DYNAMIC_FTRACE=y
1544CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1618CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1545CONFIG_TRACING_SUPPORT=y 1619CONFIG_TRACING_SUPPORT=y
1546 1620CONFIG_FTRACE=y
1547#
1548# Tracers
1549#
1550# CONFIG_FUNCTION_TRACER is not set 1621# CONFIG_FUNCTION_TRACER is not set
1622# CONFIG_IRQSOFF_TRACER is not set
1551# CONFIG_SCHED_TRACER is not set 1623# CONFIG_SCHED_TRACER is not set
1552# CONFIG_CONTEXT_SWITCH_TRACER is not set 1624# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1553# CONFIG_EVENT_TRACER is not set
1554# CONFIG_BOOT_TRACER is not set 1625# CONFIG_BOOT_TRACER is not set
1555# CONFIG_TRACE_BRANCH_PROFILING is not set 1626CONFIG_BRANCH_PROFILE_NONE=y
1627# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1628# CONFIG_PROFILE_ALL_BRANCHES is not set
1556# CONFIG_STACK_TRACER is not set 1629# CONFIG_STACK_TRACER is not set
1557# CONFIG_KMEMTRACE is not set 1630# CONFIG_KMEMTRACE is not set
1558# CONFIG_WORKQUEUE_TRACER is not set 1631# CONFIG_WORKQUEUE_TRACER is not set
@@ -1560,6 +1633,9 @@ CONFIG_TRACING_SUPPORT=y
1560# CONFIG_SAMPLES is not set 1633# CONFIG_SAMPLES is not set
1561CONFIG_HAVE_ARCH_KGDB=y 1634CONFIG_HAVE_ARCH_KGDB=y
1562# CONFIG_KGDB is not set 1635# CONFIG_KGDB is not set
1636# CONFIG_KMEMCHECK is not set
1637# CONFIG_PPC_DISABLE_WERROR is not set
1638CONFIG_PPC_WERROR=y
1563CONFIG_PRINT_STACK_DEPTH=64 1639CONFIG_PRINT_STACK_DEPTH=64
1564# CONFIG_DEBUG_STACKOVERFLOW is not set 1640# CONFIG_DEBUG_STACKOVERFLOW is not set
1565# CONFIG_DEBUG_STACK_USAGE is not set 1641# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
index af4952feba36..76237d466702 100644
--- a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:06 2009 4# Wed Jul 29 23:32:05 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC831x_RDB=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC831x=y 208CONFIG_PPC_MPC831x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -503,6 +525,7 @@ CONFIG_MTD_NAND_IDS=y
503CONFIG_OF_DEVICE=y 525CONFIG_OF_DEVICE=y
504CONFIG_OF_I2C=y 526CONFIG_OF_I2C=y
505CONFIG_OF_SPI=y 527CONFIG_OF_SPI=y
528CONFIG_OF_MDIO=y
506# CONFIG_PARPORT is not set 529# CONFIG_PARPORT is not set
507CONFIG_BLK_DEV=y 530CONFIG_BLK_DEV=y
508# CONFIG_BLK_DEV_FD is not set 531# CONFIG_BLK_DEV_FD is not set
@@ -539,7 +562,9 @@ CONFIG_MISC_DEVICES=y
539# CONFIG_EEPROM_AT24 is not set 562# CONFIG_EEPROM_AT24 is not set
540# CONFIG_EEPROM_AT25 is not set 563# CONFIG_EEPROM_AT25 is not set
541# CONFIG_EEPROM_LEGACY is not set 564# CONFIG_EEPROM_LEGACY is not set
565# CONFIG_EEPROM_MAX6875 is not set
542# CONFIG_EEPROM_93CX6 is not set 566# CONFIG_EEPROM_93CX6 is not set
567# CONFIG_CB710_CORE is not set
543CONFIG_HAVE_IDE=y 568CONFIG_HAVE_IDE=y
544# CONFIG_IDE is not set 569# CONFIG_IDE is not set
545 570
@@ -562,10 +587,6 @@ CONFIG_SCSI_PROC_FS=y
562# CONFIG_BLK_DEV_SR is not set 587# CONFIG_BLK_DEV_SR is not set
563CONFIG_CHR_DEV_SG=y 588CONFIG_CHR_DEV_SG=y
564# CONFIG_CHR_DEV_SCH is not set 589# CONFIG_CHR_DEV_SCH is not set
565
566#
567# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
568#
569# CONFIG_SCSI_MULTI_LUN is not set 590# CONFIG_SCSI_MULTI_LUN is not set
570# CONFIG_SCSI_CONSTANTS is not set 591# CONFIG_SCSI_CONSTANTS is not set
571# CONFIG_SCSI_LOGGING is not set 592# CONFIG_SCSI_LOGGING is not set
@@ -583,6 +604,7 @@ CONFIG_SCSI_SPI_ATTRS=y
583CONFIG_SCSI_LOWLEVEL=y 604CONFIG_SCSI_LOWLEVEL=y
584# CONFIG_ISCSI_TCP is not set 605# CONFIG_ISCSI_TCP is not set
585# CONFIG_SCSI_CXGB3_ISCSI is not set 606# CONFIG_SCSI_CXGB3_ISCSI is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set
586# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
587# CONFIG_SCSI_3W_9XXX is not set 609# CONFIG_SCSI_3W_9XXX is not set
588# CONFIG_SCSI_ACARD is not set 610# CONFIG_SCSI_ACARD is not set
@@ -591,6 +613,7 @@ CONFIG_SCSI_LOWLEVEL=y
591# CONFIG_SCSI_AIC7XXX_OLD is not set 613# CONFIG_SCSI_AIC7XXX_OLD is not set
592# CONFIG_SCSI_AIC79XX is not set 614# CONFIG_SCSI_AIC79XX is not set
593# CONFIG_SCSI_AIC94XX is not set 615# CONFIG_SCSI_AIC94XX is not set
616# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_DPT_I2O is not set 617# CONFIG_SCSI_DPT_I2O is not set
595# CONFIG_SCSI_ADVANSYS is not set 618# CONFIG_SCSI_ADVANSYS is not set
596# CONFIG_SCSI_ARCMSR is not set 619# CONFIG_SCSI_ARCMSR is not set
@@ -610,7 +633,6 @@ CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_SCSI_IPS is not set 633# CONFIG_SCSI_IPS is not set
611# CONFIG_SCSI_INITIO is not set 634# CONFIG_SCSI_INITIO is not set
612# CONFIG_SCSI_INIA100 is not set 635# CONFIG_SCSI_INIA100 is not set
613# CONFIG_SCSI_MVSAS is not set
614# CONFIG_SCSI_STEX is not set 636# CONFIG_SCSI_STEX is not set
615# CONFIG_SCSI_SYM53C8XX_2 is not set 637# CONFIG_SCSI_SYM53C8XX_2 is not set
616# CONFIG_SCSI_IPR is not set 638# CONFIG_SCSI_IPR is not set
@@ -704,14 +726,17 @@ CONFIG_MD_RAID1=y
704# 726#
705 727
706# 728#
707# Enable only one of the two stacks, unless you know what you are doing 729# You can enable one or both FireWire driver stacks.
730#
731
732#
733# See the help texts for more information.
708# 734#
709# CONFIG_FIREWIRE is not set 735# CONFIG_FIREWIRE is not set
710# CONFIG_IEEE1394 is not set 736# CONFIG_IEEE1394 is not set
711# CONFIG_I2O is not set 737# CONFIG_I2O is not set
712# CONFIG_MACINTOSH_DRIVERS is not set 738# CONFIG_MACINTOSH_DRIVERS is not set
713CONFIG_NETDEVICES=y 739CONFIG_NETDEVICES=y
714CONFIG_COMPAT_NET_DEV_OPS=y
715# CONFIG_DUMMY is not set 740# CONFIG_DUMMY is not set
716# CONFIG_BONDING is not set 741# CONFIG_BONDING is not set
717# CONFIG_MACVLAN is not set 742# CONFIG_MACVLAN is not set
@@ -775,6 +800,8 @@ CONFIG_E100=y
775# CONFIG_SMSC9420 is not set 800# CONFIG_SMSC9420 is not set
776# CONFIG_SUNDANCE is not set 801# CONFIG_SUNDANCE is not set
777# CONFIG_TLAN is not set 802# CONFIG_TLAN is not set
803# CONFIG_KS8842 is not set
804# CONFIG_KS8851 is not set
778# CONFIG_VIA_RHINE is not set 805# CONFIG_VIA_RHINE is not set
779# CONFIG_SC92031 is not set 806# CONFIG_SC92031 is not set
780# CONFIG_ATL2 is not set 807# CONFIG_ATL2 is not set
@@ -796,8 +823,10 @@ CONFIG_NETDEV_1000=y
796# CONFIG_VIA_VELOCITY is not set 823# CONFIG_VIA_VELOCITY is not set
797# CONFIG_TIGON3 is not set 824# CONFIG_TIGON3 is not set
798# CONFIG_BNX2 is not set 825# CONFIG_BNX2 is not set
826# CONFIG_CNIC is not set
799CONFIG_FSL_PQ_MDIO=y 827CONFIG_FSL_PQ_MDIO=y
800CONFIG_GIANFAR=y 828CONFIG_GIANFAR=y
829# CONFIG_MV643XX_ETH is not set
801# CONFIG_QLA3XXX is not set 830# CONFIG_QLA3XXX is not set
802# CONFIG_ATL1 is not set 831# CONFIG_ATL1 is not set
803# CONFIG_ATL1E is not set 832# CONFIG_ATL1E is not set
@@ -985,7 +1014,6 @@ CONFIG_I2C_MPC=y
985# CONFIG_SENSORS_PCF8574 is not set 1014# CONFIG_SENSORS_PCF8574 is not set
986# CONFIG_PCF8575 is not set 1015# CONFIG_PCF8575 is not set
987# CONFIG_SENSORS_PCA9539 is not set 1016# CONFIG_SENSORS_PCA9539 is not set
988# CONFIG_SENSORS_MAX6875 is not set
989# CONFIG_SENSORS_TSL2550 is not set 1017# CONFIG_SENSORS_TSL2550 is not set
990# CONFIG_I2C_DEBUG_CORE is not set 1018# CONFIG_I2C_DEBUG_CORE is not set
991# CONFIG_I2C_DEBUG_ALGO is not set 1019# CONFIG_I2C_DEBUG_ALGO is not set
@@ -999,13 +1027,18 @@ CONFIG_SPI_MASTER=y
999# SPI Master Controller Drivers 1027# SPI Master Controller Drivers
1000# 1028#
1001CONFIG_SPI_BITBANG=y 1029CONFIG_SPI_BITBANG=y
1002CONFIG_SPI_MPC83xx=y 1030# CONFIG_SPI_MPC8xxx is not set
1003 1031
1004# 1032#
1005# SPI Protocol Masters 1033# SPI Protocol Masters
1006# 1034#
1007# CONFIG_SPI_SPIDEV is not set 1035# CONFIG_SPI_SPIDEV is not set
1008# CONFIG_SPI_TLE62X0 is not set 1036# CONFIG_SPI_TLE62X0 is not set
1037
1038#
1039# PPS support
1040#
1041# CONFIG_PPS is not set
1009CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1042CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1010# CONFIG_GPIOLIB is not set 1043# CONFIG_GPIOLIB is not set
1011# CONFIG_W1 is not set 1044# CONFIG_W1 is not set
@@ -1063,6 +1096,7 @@ CONFIG_HWMON=y
1063# CONFIG_SENSORS_SMSC47B397 is not set 1096# CONFIG_SENSORS_SMSC47B397 is not set
1064# CONFIG_SENSORS_ADS7828 is not set 1097# CONFIG_SENSORS_ADS7828 is not set
1065# CONFIG_SENSORS_THMC50 is not set 1098# CONFIG_SENSORS_THMC50 is not set
1099# CONFIG_SENSORS_TMP401 is not set
1066# CONFIG_SENSORS_VIA686A is not set 1100# CONFIG_SENSORS_VIA686A is not set
1067# CONFIG_SENSORS_VT1211 is not set 1101# CONFIG_SENSORS_VT1211 is not set
1068# CONFIG_SENSORS_VT8231 is not set 1102# CONFIG_SENSORS_VT8231 is not set
@@ -1117,24 +1151,10 @@ CONFIG_SSB_POSSIBLE=y
1117# CONFIG_MFD_WM8400 is not set 1151# CONFIG_MFD_WM8400 is not set
1118# CONFIG_MFD_WM8350_I2C is not set 1152# CONFIG_MFD_WM8350_I2C is not set
1119# CONFIG_MFD_PCF50633 is not set 1153# CONFIG_MFD_PCF50633 is not set
1154# CONFIG_AB3100_CORE is not set
1155# CONFIG_EZX_PCAP is not set
1120# CONFIG_REGULATOR is not set 1156# CONFIG_REGULATOR is not set
1121 1157# CONFIG_MEDIA_SUPPORT is not set
1122#
1123# Multimedia devices
1124#
1125
1126#
1127# Multimedia core support
1128#
1129# CONFIG_VIDEO_DEV is not set
1130# CONFIG_DVB_CORE is not set
1131# CONFIG_VIDEO_MEDIA is not set
1132
1133#
1134# Multimedia drivers
1135#
1136CONFIG_DAB=y
1137# CONFIG_USB_DABUSB is not set
1138 1158
1139# 1159#
1140# Graphics support 1160# Graphics support
@@ -1196,6 +1216,7 @@ CONFIG_USB_MON=y
1196# USB Host Controller Drivers 1216# USB Host Controller Drivers
1197# 1217#
1198# CONFIG_USB_C67X00_HCD is not set 1218# CONFIG_USB_C67X00_HCD is not set
1219# CONFIG_USB_XHCI_HCD is not set
1199CONFIG_USB_EHCI_HCD=y 1220CONFIG_USB_EHCI_HCD=y
1200CONFIG_USB_EHCI_ROOT_HUB_TT=y 1221CONFIG_USB_EHCI_ROOT_HUB_TT=y
1201# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1222# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1205,9 +1226,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1205# CONFIG_USB_ISP116X_HCD is not set 1226# CONFIG_USB_ISP116X_HCD is not set
1206# CONFIG_USB_ISP1760_HCD is not set 1227# CONFIG_USB_ISP1760_HCD is not set
1207CONFIG_USB_OHCI_HCD=y 1228CONFIG_USB_OHCI_HCD=y
1208CONFIG_USB_OHCI_HCD_PPC_OF=y
1209CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1229CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1210# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1230# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1231CONFIG_USB_OHCI_HCD_PPC_OF=y
1211CONFIG_USB_OHCI_HCD_PCI=y 1232CONFIG_USB_OHCI_HCD_PCI=y
1212CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1233CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1213CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1234CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1296,8 +1317,9 @@ CONFIG_USB_GADGET_SELECTED=y
1296# CONFIG_USB_GADGET_OMAP is not set 1317# CONFIG_USB_GADGET_OMAP is not set
1297# CONFIG_USB_GADGET_PXA25X is not set 1318# CONFIG_USB_GADGET_PXA25X is not set
1298# CONFIG_USB_GADGET_PXA27X is not set 1319# CONFIG_USB_GADGET_PXA27X is not set
1299# CONFIG_USB_GADGET_S3C2410 is not set 1320# CONFIG_USB_GADGET_S3C_HSOTG is not set
1300# CONFIG_USB_GADGET_IMX is not set 1321# CONFIG_USB_GADGET_IMX is not set
1322# CONFIG_USB_GADGET_S3C2410 is not set
1301# CONFIG_USB_GADGET_M66592 is not set 1323# CONFIG_USB_GADGET_M66592 is not set
1302# CONFIG_USB_GADGET_AMD5536UDC is not set 1324# CONFIG_USB_GADGET_AMD5536UDC is not set
1303# CONFIG_USB_GADGET_FSL_QE is not set 1325# CONFIG_USB_GADGET_FSL_QE is not set
@@ -1305,9 +1327,11 @@ CONFIG_USB_GADGET_SELECTED=y
1305CONFIG_USB_GADGET_NET2280=y 1327CONFIG_USB_GADGET_NET2280=y
1306CONFIG_USB_NET2280=y 1328CONFIG_USB_NET2280=y
1307# CONFIG_USB_GADGET_GOKU is not set 1329# CONFIG_USB_GADGET_GOKU is not set
1330# CONFIG_USB_GADGET_LANGWELL is not set
1308# CONFIG_USB_GADGET_DUMMY_HCD is not set 1331# CONFIG_USB_GADGET_DUMMY_HCD is not set
1309CONFIG_USB_GADGET_DUALSPEED=y 1332CONFIG_USB_GADGET_DUALSPEED=y
1310# CONFIG_USB_ZERO is not set 1333# CONFIG_USB_ZERO is not set
1334# CONFIG_USB_AUDIO is not set
1311CONFIG_USB_ETH=y 1335CONFIG_USB_ETH=y
1312CONFIG_USB_ETH_RNDIS=y 1336CONFIG_USB_ETH_RNDIS=y
1313# CONFIG_USB_GADGETFS is not set 1337# CONFIG_USB_GADGETFS is not set
@@ -1359,6 +1383,7 @@ CONFIG_RTC_DRV_DS1307=y
1359# CONFIG_RTC_DRV_S35390A is not set 1383# CONFIG_RTC_DRV_S35390A is not set
1360# CONFIG_RTC_DRV_FM3130 is not set 1384# CONFIG_RTC_DRV_FM3130 is not set
1361# CONFIG_RTC_DRV_RX8581 is not set 1385# CONFIG_RTC_DRV_RX8581 is not set
1386# CONFIG_RTC_DRV_RX8025 is not set
1362 1387
1363# 1388#
1364# SPI RTC drivers 1389# SPI RTC drivers
@@ -1393,6 +1418,10 @@ CONFIG_RTC_DRV_DS1307=y
1393# CONFIG_DMADEVICES is not set 1418# CONFIG_DMADEVICES is not set
1394# CONFIG_AUXDISPLAY is not set 1419# CONFIG_AUXDISPLAY is not set
1395# CONFIG_UIO is not set 1420# CONFIG_UIO is not set
1421
1422#
1423# TI VLYNQ
1424#
1396# CONFIG_STAGING is not set 1425# CONFIG_STAGING is not set
1397 1426
1398# 1427#
@@ -1412,10 +1441,12 @@ CONFIG_FS_MBCACHE=y
1412# CONFIG_REISERFS_FS is not set 1441# CONFIG_REISERFS_FS is not set
1413# CONFIG_JFS_FS is not set 1442# CONFIG_JFS_FS is not set
1414# CONFIG_FS_POSIX_ACL is not set 1443# CONFIG_FS_POSIX_ACL is not set
1415CONFIG_FILE_LOCKING=y
1416# CONFIG_XFS_FS is not set 1444# CONFIG_XFS_FS is not set
1445# CONFIG_GFS2_FS is not set
1417# CONFIG_OCFS2_FS is not set 1446# CONFIG_OCFS2_FS is not set
1418# CONFIG_BTRFS_FS is not set 1447# CONFIG_BTRFS_FS is not set
1448CONFIG_FILE_LOCKING=y
1449CONFIG_FSNOTIFY=y
1419CONFIG_DNOTIFY=y 1450CONFIG_DNOTIFY=y
1420CONFIG_INOTIFY=y 1451CONFIG_INOTIFY=y
1421CONFIG_INOTIFY_USER=y 1452CONFIG_INOTIFY_USER=y
@@ -1489,6 +1520,7 @@ CONFIG_NFS_FS=y
1489CONFIG_NFS_V3=y 1520CONFIG_NFS_V3=y
1490# CONFIG_NFS_V3_ACL is not set 1521# CONFIG_NFS_V3_ACL is not set
1491CONFIG_NFS_V4=y 1522CONFIG_NFS_V4=y
1523# CONFIG_NFS_V4_1 is not set
1492CONFIG_ROOT_NFS=y 1524CONFIG_ROOT_NFS=y
1493# CONFIG_NFSD is not set 1525# CONFIG_NFSD is not set
1494CONFIG_LOCKD=y 1526CONFIG_LOCKD=y
@@ -1525,7 +1557,46 @@ CONFIG_MSDOS_PARTITION=y
1525# CONFIG_KARMA_PARTITION is not set 1557# CONFIG_KARMA_PARTITION is not set
1526# CONFIG_EFI_PARTITION is not set 1558# CONFIG_EFI_PARTITION is not set
1527# CONFIG_SYSV68_PARTITION is not set 1559# CONFIG_SYSV68_PARTITION is not set
1528# CONFIG_NLS is not set 1560CONFIG_NLS=y
1561CONFIG_NLS_DEFAULT="iso8859-1"
1562# CONFIG_NLS_CODEPAGE_437 is not set
1563# CONFIG_NLS_CODEPAGE_737 is not set
1564# CONFIG_NLS_CODEPAGE_775 is not set
1565# CONFIG_NLS_CODEPAGE_850 is not set
1566# CONFIG_NLS_CODEPAGE_852 is not set
1567# CONFIG_NLS_CODEPAGE_855 is not set
1568# CONFIG_NLS_CODEPAGE_857 is not set
1569# CONFIG_NLS_CODEPAGE_860 is not set
1570# CONFIG_NLS_CODEPAGE_861 is not set
1571# CONFIG_NLS_CODEPAGE_862 is not set
1572# CONFIG_NLS_CODEPAGE_863 is not set
1573# CONFIG_NLS_CODEPAGE_864 is not set
1574# CONFIG_NLS_CODEPAGE_865 is not set
1575# CONFIG_NLS_CODEPAGE_866 is not set
1576# CONFIG_NLS_CODEPAGE_869 is not set
1577# CONFIG_NLS_CODEPAGE_936 is not set
1578# CONFIG_NLS_CODEPAGE_950 is not set
1579# CONFIG_NLS_CODEPAGE_932 is not set
1580# CONFIG_NLS_CODEPAGE_949 is not set
1581# CONFIG_NLS_CODEPAGE_874 is not set
1582# CONFIG_NLS_ISO8859_8 is not set
1583# CONFIG_NLS_CODEPAGE_1250 is not set
1584# CONFIG_NLS_CODEPAGE_1251 is not set
1585# CONFIG_NLS_ASCII is not set
1586# CONFIG_NLS_ISO8859_1 is not set
1587# CONFIG_NLS_ISO8859_2 is not set
1588# CONFIG_NLS_ISO8859_3 is not set
1589# CONFIG_NLS_ISO8859_4 is not set
1590# CONFIG_NLS_ISO8859_5 is not set
1591# CONFIG_NLS_ISO8859_6 is not set
1592# CONFIG_NLS_ISO8859_7 is not set
1593# CONFIG_NLS_ISO8859_9 is not set
1594# CONFIG_NLS_ISO8859_13 is not set
1595# CONFIG_NLS_ISO8859_14 is not set
1596# CONFIG_NLS_ISO8859_15 is not set
1597# CONFIG_NLS_KOI8_R is not set
1598# CONFIG_NLS_KOI8_U is not set
1599# CONFIG_NLS_UTF8 is not set
1529# CONFIG_DLM is not set 1600# CONFIG_DLM is not set
1530# CONFIG_BINARY_PRINTF is not set 1601# CONFIG_BINARY_PRINTF is not set
1531 1602
@@ -1549,6 +1620,7 @@ CONFIG_HAS_IOPORT=y
1549CONFIG_HAS_DMA=y 1620CONFIG_HAS_DMA=y
1550CONFIG_HAVE_LMB=y 1621CONFIG_HAVE_LMB=y
1551CONFIG_NLATTR=y 1622CONFIG_NLATTR=y
1623CONFIG_GENERIC_ATOMIC64=y
1552 1624
1553# 1625#
1554# Kernel hacking 1626# Kernel hacking
@@ -1579,6 +1651,9 @@ CONFIG_SCHED_DEBUG=y
1579# CONFIG_RT_MUTEX_TESTER is not set 1651# CONFIG_RT_MUTEX_TESTER is not set
1580# CONFIG_DEBUG_SPINLOCK is not set 1652# CONFIG_DEBUG_SPINLOCK is not set
1581# CONFIG_DEBUG_MUTEXES is not set 1653# CONFIG_DEBUG_MUTEXES is not set
1654# CONFIG_DEBUG_LOCK_ALLOC is not set
1655# CONFIG_PROVE_LOCKING is not set
1656# CONFIG_LOCK_STAT is not set
1582# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1657# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1583# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1658# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1584# CONFIG_DEBUG_KOBJECT is not set 1659# CONFIG_DEBUG_KOBJECT is not set
@@ -1590,7 +1665,6 @@ CONFIG_SCHED_DEBUG=y
1590# CONFIG_DEBUG_LIST is not set 1665# CONFIG_DEBUG_LIST is not set
1591# CONFIG_DEBUG_SG is not set 1666# CONFIG_DEBUG_SG is not set
1592# CONFIG_DEBUG_NOTIFIERS is not set 1667# CONFIG_DEBUG_NOTIFIERS is not set
1593# CONFIG_BOOT_PRINTK_DELAY is not set
1594# CONFIG_RCU_TORTURE_TEST is not set 1668# CONFIG_RCU_TORTURE_TEST is not set
1595# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1669# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1596# CONFIG_BACKTRACE_SELF_TEST is not set 1670# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1604,16 +1678,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1604CONFIG_HAVE_DYNAMIC_FTRACE=y 1678CONFIG_HAVE_DYNAMIC_FTRACE=y
1605CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1679CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1606CONFIG_TRACING_SUPPORT=y 1680CONFIG_TRACING_SUPPORT=y
1607 1681CONFIG_FTRACE=y
1608#
1609# Tracers
1610#
1611# CONFIG_FUNCTION_TRACER is not set 1682# CONFIG_FUNCTION_TRACER is not set
1683# CONFIG_IRQSOFF_TRACER is not set
1612# CONFIG_SCHED_TRACER is not set 1684# CONFIG_SCHED_TRACER is not set
1613# CONFIG_CONTEXT_SWITCH_TRACER is not set 1685# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1614# CONFIG_EVENT_TRACER is not set
1615# CONFIG_BOOT_TRACER is not set 1686# CONFIG_BOOT_TRACER is not set
1616# CONFIG_TRACE_BRANCH_PROFILING is not set 1687CONFIG_BRANCH_PROFILE_NONE=y
1688# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1689# CONFIG_PROFILE_ALL_BRANCHES is not set
1617# CONFIG_STACK_TRACER is not set 1690# CONFIG_STACK_TRACER is not set
1618# CONFIG_KMEMTRACE is not set 1691# CONFIG_KMEMTRACE is not set
1619# CONFIG_WORKQUEUE_TRACER is not set 1692# CONFIG_WORKQUEUE_TRACER is not set
@@ -1621,6 +1694,9 @@ CONFIG_TRACING_SUPPORT=y
1621# CONFIG_SAMPLES is not set 1694# CONFIG_SAMPLES is not set
1622CONFIG_HAVE_ARCH_KGDB=y 1695CONFIG_HAVE_ARCH_KGDB=y
1623# CONFIG_KGDB is not set 1696# CONFIG_KGDB is not set
1697# CONFIG_KMEMCHECK is not set
1698# CONFIG_PPC_DISABLE_WERROR is not set
1699CONFIG_PPC_WERROR=y
1624CONFIG_PRINT_STACK_DEPTH=64 1700CONFIG_PRINT_STACK_DEPTH=64
1625# CONFIG_DEBUG_STACKOVERFLOW is not set 1701# CONFIG_DEBUG_STACKOVERFLOW is not set
1626# CONFIG_DEBUG_STACK_USAGE is not set 1702# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/83xx/mpc832x_mds_defconfig b/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
index 8c8f660b4fc7..e0e36a113409 100644
--- a/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:07 2009 4# Wed Jul 29 23:32:06 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC832x_MDS=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC832x=y 208CONFIG_PPC_MPC832x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -235,6 +251,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236CONFIG_MATH_EMULATION=y 252CONFIG_MATH_EMULATION=y
237# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -404,6 +426,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
404# CONFIG_MTD is not set 426# CONFIG_MTD is not set
405CONFIG_OF_DEVICE=y 427CONFIG_OF_DEVICE=y
406CONFIG_OF_I2C=y 428CONFIG_OF_I2C=y
429CONFIG_OF_MDIO=y
407# CONFIG_PARPORT is not set 430# CONFIG_PARPORT is not set
408CONFIG_BLK_DEV=y 431CONFIG_BLK_DEV=y
409# CONFIG_BLK_DEV_FD is not set 432# CONFIG_BLK_DEV_FD is not set
@@ -438,7 +461,9 @@ CONFIG_MISC_DEVICES=y
438# 461#
439# CONFIG_EEPROM_AT24 is not set 462# CONFIG_EEPROM_AT24 is not set
440# CONFIG_EEPROM_LEGACY is not set 463# CONFIG_EEPROM_LEGACY is not set
464# CONFIG_EEPROM_MAX6875 is not set
441# CONFIG_EEPROM_93CX6 is not set 465# CONFIG_EEPROM_93CX6 is not set
466# CONFIG_CB710_CORE is not set
442CONFIG_HAVE_IDE=y 467CONFIG_HAVE_IDE=y
443# CONFIG_IDE is not set 468# CONFIG_IDE is not set
444 469
@@ -461,10 +486,6 @@ CONFIG_SCSI_PROC_FS=y
461# CONFIG_BLK_DEV_SR is not set 486# CONFIG_BLK_DEV_SR is not set
462# CONFIG_CHR_DEV_SG is not set 487# CONFIG_CHR_DEV_SG is not set
463# CONFIG_CHR_DEV_SCH is not set 488# CONFIG_CHR_DEV_SCH is not set
464
465#
466# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
467#
468# CONFIG_SCSI_MULTI_LUN is not set 489# CONFIG_SCSI_MULTI_LUN is not set
469# CONFIG_SCSI_CONSTANTS is not set 490# CONFIG_SCSI_CONSTANTS is not set
470# CONFIG_SCSI_LOGGING is not set 491# CONFIG_SCSI_LOGGING is not set
@@ -482,6 +503,7 @@ CONFIG_SCSI_WAIT_SCAN=m
482CONFIG_SCSI_LOWLEVEL=y 503CONFIG_SCSI_LOWLEVEL=y
483# CONFIG_ISCSI_TCP is not set 504# CONFIG_ISCSI_TCP is not set
484# CONFIG_SCSI_CXGB3_ISCSI is not set 505# CONFIG_SCSI_CXGB3_ISCSI is not set
506# CONFIG_SCSI_BNX2_ISCSI is not set
485# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 507# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
486# CONFIG_SCSI_3W_9XXX is not set 508# CONFIG_SCSI_3W_9XXX is not set
487# CONFIG_SCSI_ACARD is not set 509# CONFIG_SCSI_ACARD is not set
@@ -490,6 +512,7 @@ CONFIG_SCSI_LOWLEVEL=y
490# CONFIG_SCSI_AIC7XXX_OLD is not set 512# CONFIG_SCSI_AIC7XXX_OLD is not set
491# CONFIG_SCSI_AIC79XX is not set 513# CONFIG_SCSI_AIC79XX is not set
492# CONFIG_SCSI_AIC94XX is not set 514# CONFIG_SCSI_AIC94XX is not set
515# CONFIG_SCSI_MVSAS is not set
493# CONFIG_SCSI_DPT_I2O is not set 516# CONFIG_SCSI_DPT_I2O is not set
494# CONFIG_SCSI_ADVANSYS is not set 517# CONFIG_SCSI_ADVANSYS is not set
495# CONFIG_SCSI_ARCMSR is not set 518# CONFIG_SCSI_ARCMSR is not set
@@ -509,7 +532,6 @@ CONFIG_SCSI_LOWLEVEL=y
509# CONFIG_SCSI_IPS is not set 532# CONFIG_SCSI_IPS is not set
510# CONFIG_SCSI_INITIO is not set 533# CONFIG_SCSI_INITIO is not set
511# CONFIG_SCSI_INIA100 is not set 534# CONFIG_SCSI_INIA100 is not set
512# CONFIG_SCSI_MVSAS is not set
513# CONFIG_SCSI_STEX is not set 535# CONFIG_SCSI_STEX is not set
514# CONFIG_SCSI_SYM53C8XX_2 is not set 536# CONFIG_SCSI_SYM53C8XX_2 is not set
515# CONFIG_SCSI_QLOGIC_1280 is not set 537# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -532,14 +554,17 @@ CONFIG_SCSI_LOWLEVEL=y
532# 554#
533 555
534# 556#
535# Enable only one of the two stacks, unless you know what you are doing 557# You can enable one or both FireWire driver stacks.
558#
559
560#
561# See the help texts for more information.
536# 562#
537# CONFIG_FIREWIRE is not set 563# CONFIG_FIREWIRE is not set
538# CONFIG_IEEE1394 is not set 564# CONFIG_IEEE1394 is not set
539# CONFIG_I2O is not set 565# CONFIG_I2O is not set
540# CONFIG_MACINTOSH_DRIVERS is not set 566# CONFIG_MACINTOSH_DRIVERS is not set
541CONFIG_NETDEVICES=y 567CONFIG_NETDEVICES=y
542CONFIG_COMPAT_NET_DEV_OPS=y
543# CONFIG_DUMMY is not set 568# CONFIG_DUMMY is not set
544# CONFIG_BONDING is not set 569# CONFIG_BONDING is not set
545# CONFIG_MACVLAN is not set 570# CONFIG_MACVLAN is not set
@@ -586,6 +611,7 @@ CONFIG_MII=y
586# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 611# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
587# CONFIG_NET_PCI is not set 612# CONFIG_NET_PCI is not set
588# CONFIG_B44 is not set 613# CONFIG_B44 is not set
614# CONFIG_KS8842 is not set
589# CONFIG_ATL2 is not set 615# CONFIG_ATL2 is not set
590CONFIG_NETDEV_1000=y 616CONFIG_NETDEV_1000=y
591# CONFIG_ACENIC is not set 617# CONFIG_ACENIC is not set
@@ -605,11 +631,13 @@ CONFIG_NETDEV_1000=y
605# CONFIG_VIA_VELOCITY is not set 631# CONFIG_VIA_VELOCITY is not set
606# CONFIG_TIGON3 is not set 632# CONFIG_TIGON3 is not set
607# CONFIG_BNX2 is not set 633# CONFIG_BNX2 is not set
634# CONFIG_CNIC is not set
608CONFIG_FSL_PQ_MDIO=y 635CONFIG_FSL_PQ_MDIO=y
609# CONFIG_GIANFAR is not set 636# CONFIG_GIANFAR is not set
610CONFIG_UCC_GETH=y 637CONFIG_UCC_GETH=y
611# CONFIG_UGETH_MAGIC_PACKET is not set 638# CONFIG_UGETH_MAGIC_PACKET is not set
612# CONFIG_UGETH_TX_ON_DEMAND is not set 639# CONFIG_UGETH_TX_ON_DEMAND is not set
640# CONFIG_MV643XX_ETH is not set
613# CONFIG_QLA3XXX is not set 641# CONFIG_QLA3XXX is not set
614# CONFIG_ATL1 is not set 642# CONFIG_ATL1 is not set
615# CONFIG_ATL1E is not set 643# CONFIG_ATL1E is not set
@@ -787,13 +815,17 @@ CONFIG_I2C_MPC=y
787# CONFIG_SENSORS_PCF8574 is not set 815# CONFIG_SENSORS_PCF8574 is not set
788# CONFIG_PCF8575 is not set 816# CONFIG_PCF8575 is not set
789# CONFIG_SENSORS_PCA9539 is not set 817# CONFIG_SENSORS_PCA9539 is not set
790# CONFIG_SENSORS_MAX6875 is not set
791# CONFIG_SENSORS_TSL2550 is not set 818# CONFIG_SENSORS_TSL2550 is not set
792# CONFIG_I2C_DEBUG_CORE is not set 819# CONFIG_I2C_DEBUG_CORE is not set
793# CONFIG_I2C_DEBUG_ALGO is not set 820# CONFIG_I2C_DEBUG_ALGO is not set
794# CONFIG_I2C_DEBUG_BUS is not set 821# CONFIG_I2C_DEBUG_BUS is not set
795# CONFIG_I2C_DEBUG_CHIP is not set 822# CONFIG_I2C_DEBUG_CHIP is not set
796# CONFIG_SPI is not set 823# CONFIG_SPI is not set
824
825#
826# PPS support
827#
828# CONFIG_PPS is not set
797CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 829CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
798# CONFIG_GPIOLIB is not set 830# CONFIG_GPIOLIB is not set
799# CONFIG_W1 is not set 831# CONFIG_W1 is not set
@@ -848,6 +880,7 @@ CONFIG_HWMON=y
848# CONFIG_SENSORS_SMSC47B397 is not set 880# CONFIG_SENSORS_SMSC47B397 is not set
849# CONFIG_SENSORS_ADS7828 is not set 881# CONFIG_SENSORS_ADS7828 is not set
850# CONFIG_SENSORS_THMC50 is not set 882# CONFIG_SENSORS_THMC50 is not set
883# CONFIG_SENSORS_TMP401 is not set
851# CONFIG_SENSORS_VIA686A is not set 884# CONFIG_SENSORS_VIA686A is not set
852# CONFIG_SENSORS_VT1211 is not set 885# CONFIG_SENSORS_VT1211 is not set
853# CONFIG_SENSORS_VT8231 is not set 886# CONFIG_SENSORS_VT8231 is not set
@@ -896,23 +929,9 @@ CONFIG_SSB_POSSIBLE=y
896# CONFIG_MFD_WM8400 is not set 929# CONFIG_MFD_WM8400 is not set
897# CONFIG_MFD_WM8350_I2C is not set 930# CONFIG_MFD_WM8350_I2C is not set
898# CONFIG_MFD_PCF50633 is not set 931# CONFIG_MFD_PCF50633 is not set
932# CONFIG_AB3100_CORE is not set
899# CONFIG_REGULATOR is not set 933# CONFIG_REGULATOR is not set
900 934# CONFIG_MEDIA_SUPPORT is not set
901#
902# Multimedia devices
903#
904
905#
906# Multimedia core support
907#
908# CONFIG_VIDEO_DEV is not set
909# CONFIG_DVB_CORE is not set
910# CONFIG_VIDEO_MEDIA is not set
911
912#
913# Multimedia drivers
914#
915CONFIG_DAB=y
916 935
917# 936#
918# Graphics support 937# Graphics support
@@ -996,6 +1015,7 @@ CONFIG_RTC_DRV_DS1374=y
996# CONFIG_RTC_DRV_S35390A is not set 1015# CONFIG_RTC_DRV_S35390A is not set
997# CONFIG_RTC_DRV_FM3130 is not set 1016# CONFIG_RTC_DRV_FM3130 is not set
998# CONFIG_RTC_DRV_RX8581 is not set 1017# CONFIG_RTC_DRV_RX8581 is not set
1018# CONFIG_RTC_DRV_RX8025 is not set
999 1019
1000# 1020#
1001# SPI RTC drivers 1021# SPI RTC drivers
@@ -1023,6 +1043,10 @@ CONFIG_RTC_DRV_DS1374=y
1023# CONFIG_DMADEVICES is not set 1043# CONFIG_DMADEVICES is not set
1024# CONFIG_AUXDISPLAY is not set 1044# CONFIG_AUXDISPLAY is not set
1025# CONFIG_UIO is not set 1045# CONFIG_UIO is not set
1046
1047#
1048# TI VLYNQ
1049#
1026# CONFIG_STAGING is not set 1050# CONFIG_STAGING is not set
1027 1051
1028# 1052#
@@ -1042,10 +1066,12 @@ CONFIG_FS_MBCACHE=y
1042# CONFIG_REISERFS_FS is not set 1066# CONFIG_REISERFS_FS is not set
1043# CONFIG_JFS_FS is not set 1067# CONFIG_JFS_FS is not set
1044# CONFIG_FS_POSIX_ACL is not set 1068# CONFIG_FS_POSIX_ACL is not set
1045CONFIG_FILE_LOCKING=y
1046# CONFIG_XFS_FS is not set 1069# CONFIG_XFS_FS is not set
1070# CONFIG_GFS2_FS is not set
1047# CONFIG_OCFS2_FS is not set 1071# CONFIG_OCFS2_FS is not set
1048# CONFIG_BTRFS_FS is not set 1072# CONFIG_BTRFS_FS is not set
1073CONFIG_FILE_LOCKING=y
1074CONFIG_FSNOTIFY=y
1049CONFIG_DNOTIFY=y 1075CONFIG_DNOTIFY=y
1050CONFIG_INOTIFY=y 1076CONFIG_INOTIFY=y
1051CONFIG_INOTIFY_USER=y 1077CONFIG_INOTIFY_USER=y
@@ -1108,6 +1134,7 @@ CONFIG_NFS_FS=y
1108CONFIG_NFS_V3=y 1134CONFIG_NFS_V3=y
1109# CONFIG_NFS_V3_ACL is not set 1135# CONFIG_NFS_V3_ACL is not set
1110CONFIG_NFS_V4=y 1136CONFIG_NFS_V4=y
1137# CONFIG_NFS_V4_1 is not set
1111CONFIG_ROOT_NFS=y 1138CONFIG_ROOT_NFS=y
1112# CONFIG_NFSD is not set 1139# CONFIG_NFSD is not set
1113CONFIG_LOCKD=y 1140CONFIG_LOCKD=y
@@ -1165,6 +1192,7 @@ CONFIG_HAS_IOPORT=y
1165CONFIG_HAS_DMA=y 1192CONFIG_HAS_DMA=y
1166CONFIG_HAVE_LMB=y 1193CONFIG_HAVE_LMB=y
1167CONFIG_NLATTR=y 1194CONFIG_NLATTR=y
1195CONFIG_GENERIC_ATOMIC64=y
1168 1196
1169# 1197#
1170# Kernel hacking 1198# Kernel hacking
@@ -1190,22 +1218,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1190CONFIG_HAVE_DYNAMIC_FTRACE=y 1218CONFIG_HAVE_DYNAMIC_FTRACE=y
1191CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1219CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1192CONFIG_TRACING_SUPPORT=y 1220CONFIG_TRACING_SUPPORT=y
1193 1221# CONFIG_FTRACE is not set
1194#
1195# Tracers
1196#
1197# CONFIG_FUNCTION_TRACER is not set
1198# CONFIG_SCHED_TRACER is not set
1199# CONFIG_CONTEXT_SWITCH_TRACER is not set
1200# CONFIG_EVENT_TRACER is not set
1201# CONFIG_BOOT_TRACER is not set
1202# CONFIG_TRACE_BRANCH_PROFILING is not set
1203# CONFIG_STACK_TRACER is not set
1204# CONFIG_KMEMTRACE is not set
1205# CONFIG_WORKQUEUE_TRACER is not set
1206# CONFIG_BLK_DEV_IO_TRACE is not set
1207# CONFIG_SAMPLES is not set 1222# CONFIG_SAMPLES is not set
1208CONFIG_HAVE_ARCH_KGDB=y 1223CONFIG_HAVE_ARCH_KGDB=y
1224# CONFIG_PPC_DISABLE_WERROR is not set
1225CONFIG_PPC_WERROR=y
1209CONFIG_PRINT_STACK_DEPTH=64 1226CONFIG_PRINT_STACK_DEPTH=64
1210# CONFIG_IRQSTACKS is not set 1227# CONFIG_IRQSTACKS is not set
1211# CONFIG_BOOTX_TEXT is not set 1228# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig b/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
index 227dbba76795..4f27d4548223 100644
--- a/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:08 2009 4# Wed Jul 29 23:32:07 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC832x_RDB=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC832x=y 208CONFIG_PPC_MPC832x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -235,6 +251,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236CONFIG_MATH_EMULATION=y 252CONFIG_MATH_EMULATION=y
237# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -405,6 +427,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
405CONFIG_OF_DEVICE=y 427CONFIG_OF_DEVICE=y
406CONFIG_OF_I2C=y 428CONFIG_OF_I2C=y
407CONFIG_OF_SPI=y 429CONFIG_OF_SPI=y
430CONFIG_OF_MDIO=y
408# CONFIG_PARPORT is not set 431# CONFIG_PARPORT is not set
409CONFIG_BLK_DEV=y 432CONFIG_BLK_DEV=y
410# CONFIG_BLK_DEV_FD is not set 433# CONFIG_BLK_DEV_FD is not set
@@ -441,7 +464,9 @@ CONFIG_MISC_DEVICES=y
441# CONFIG_EEPROM_AT24 is not set 464# CONFIG_EEPROM_AT24 is not set
442# CONFIG_EEPROM_AT25 is not set 465# CONFIG_EEPROM_AT25 is not set
443# CONFIG_EEPROM_LEGACY is not set 466# CONFIG_EEPROM_LEGACY is not set
467# CONFIG_EEPROM_MAX6875 is not set
444# CONFIG_EEPROM_93CX6 is not set 468# CONFIG_EEPROM_93CX6 is not set
469# CONFIG_CB710_CORE is not set
445CONFIG_HAVE_IDE=y 470CONFIG_HAVE_IDE=y
446# CONFIG_IDE is not set 471# CONFIG_IDE is not set
447 472
@@ -464,10 +489,6 @@ CONFIG_BLK_DEV_SD=y
464# CONFIG_BLK_DEV_SR is not set 489# CONFIG_BLK_DEV_SR is not set
465# CONFIG_CHR_DEV_SG is not set 490# CONFIG_CHR_DEV_SG is not set
466# CONFIG_CHR_DEV_SCH is not set 491# CONFIG_CHR_DEV_SCH is not set
467
468#
469# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
470#
471# CONFIG_SCSI_MULTI_LUN is not set 492# CONFIG_SCSI_MULTI_LUN is not set
472# CONFIG_SCSI_CONSTANTS is not set 493# CONFIG_SCSI_CONSTANTS is not set
473# CONFIG_SCSI_LOGGING is not set 494# CONFIG_SCSI_LOGGING is not set
@@ -485,6 +506,7 @@ CONFIG_SCSI_WAIT_SCAN=m
485CONFIG_SCSI_LOWLEVEL=y 506CONFIG_SCSI_LOWLEVEL=y
486# CONFIG_ISCSI_TCP is not set 507# CONFIG_ISCSI_TCP is not set
487# CONFIG_SCSI_CXGB3_ISCSI is not set 508# CONFIG_SCSI_CXGB3_ISCSI is not set
509# CONFIG_SCSI_BNX2_ISCSI is not set
488# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 510# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
489# CONFIG_SCSI_3W_9XXX is not set 511# CONFIG_SCSI_3W_9XXX is not set
490# CONFIG_SCSI_ACARD is not set 512# CONFIG_SCSI_ACARD is not set
@@ -493,6 +515,7 @@ CONFIG_SCSI_LOWLEVEL=y
493# CONFIG_SCSI_AIC7XXX_OLD is not set 515# CONFIG_SCSI_AIC7XXX_OLD is not set
494# CONFIG_SCSI_AIC79XX is not set 516# CONFIG_SCSI_AIC79XX is not set
495# CONFIG_SCSI_AIC94XX is not set 517# CONFIG_SCSI_AIC94XX is not set
518# CONFIG_SCSI_MVSAS is not set
496# CONFIG_SCSI_DPT_I2O is not set 519# CONFIG_SCSI_DPT_I2O is not set
497# CONFIG_SCSI_ADVANSYS is not set 520# CONFIG_SCSI_ADVANSYS is not set
498# CONFIG_SCSI_ARCMSR is not set 521# CONFIG_SCSI_ARCMSR is not set
@@ -512,7 +535,6 @@ CONFIG_SCSI_LOWLEVEL=y
512# CONFIG_SCSI_IPS is not set 535# CONFIG_SCSI_IPS is not set
513# CONFIG_SCSI_INITIO is not set 536# CONFIG_SCSI_INITIO is not set
514# CONFIG_SCSI_INIA100 is not set 537# CONFIG_SCSI_INIA100 is not set
515# CONFIG_SCSI_MVSAS is not set
516# CONFIG_SCSI_STEX is not set 538# CONFIG_SCSI_STEX is not set
517# CONFIG_SCSI_SYM53C8XX_2 is not set 539# CONFIG_SCSI_SYM53C8XX_2 is not set
518# CONFIG_SCSI_QLOGIC_1280 is not set 540# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -535,14 +557,17 @@ CONFIG_SCSI_LOWLEVEL=y
535# 557#
536 558
537# 559#
538# Enable only one of the two stacks, unless you know what you are doing 560# You can enable one or both FireWire driver stacks.
561#
562
563#
564# See the help texts for more information.
539# 565#
540# CONFIG_FIREWIRE is not set 566# CONFIG_FIREWIRE is not set
541# CONFIG_IEEE1394 is not set 567# CONFIG_IEEE1394 is not set
542# CONFIG_I2O is not set 568# CONFIG_I2O is not set
543# CONFIG_MACINTOSH_DRIVERS is not set 569# CONFIG_MACINTOSH_DRIVERS is not set
544CONFIG_NETDEVICES=y 570CONFIG_NETDEVICES=y
545CONFIG_COMPAT_NET_DEV_OPS=y
546# CONFIG_DUMMY is not set 571# CONFIG_DUMMY is not set
547# CONFIG_BONDING is not set 572# CONFIG_BONDING is not set
548# CONFIG_MACVLAN is not set 573# CONFIG_MACVLAN is not set
@@ -590,6 +615,8 @@ CONFIG_MII=y
590# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 615# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
591# CONFIG_NET_PCI is not set 616# CONFIG_NET_PCI is not set
592# CONFIG_B44 is not set 617# CONFIG_B44 is not set
618# CONFIG_KS8842 is not set
619# CONFIG_KS8851 is not set
593# CONFIG_ATL2 is not set 620# CONFIG_ATL2 is not set
594CONFIG_NETDEV_1000=y 621CONFIG_NETDEV_1000=y
595# CONFIG_ACENIC is not set 622# CONFIG_ACENIC is not set
@@ -609,11 +636,13 @@ CONFIG_E1000=y
609# CONFIG_VIA_VELOCITY is not set 636# CONFIG_VIA_VELOCITY is not set
610# CONFIG_TIGON3 is not set 637# CONFIG_TIGON3 is not set
611# CONFIG_BNX2 is not set 638# CONFIG_BNX2 is not set
639# CONFIG_CNIC is not set
612CONFIG_FSL_PQ_MDIO=y 640CONFIG_FSL_PQ_MDIO=y
613# CONFIG_GIANFAR is not set 641# CONFIG_GIANFAR is not set
614CONFIG_UCC_GETH=y 642CONFIG_UCC_GETH=y
615# CONFIG_UGETH_MAGIC_PACKET is not set 643# CONFIG_UGETH_MAGIC_PACKET is not set
616# CONFIG_UGETH_TX_ON_DEMAND is not set 644# CONFIG_UGETH_TX_ON_DEMAND is not set
645# CONFIG_MV643XX_ETH is not set
617# CONFIG_QLA3XXX is not set 646# CONFIG_QLA3XXX is not set
618# CONFIG_ATL1 is not set 647# CONFIG_ATL1 is not set
619# CONFIG_ATL1E is not set 648# CONFIG_ATL1E is not set
@@ -804,7 +833,6 @@ CONFIG_I2C_MPC=y
804# CONFIG_SENSORS_PCF8574 is not set 833# CONFIG_SENSORS_PCF8574 is not set
805# CONFIG_PCF8575 is not set 834# CONFIG_PCF8575 is not set
806# CONFIG_SENSORS_PCA9539 is not set 835# CONFIG_SENSORS_PCA9539 is not set
807# CONFIG_SENSORS_MAX6875 is not set
808# CONFIG_SENSORS_TSL2550 is not set 836# CONFIG_SENSORS_TSL2550 is not set
809# CONFIG_I2C_DEBUG_CORE is not set 837# CONFIG_I2C_DEBUG_CORE is not set
810# CONFIG_I2C_DEBUG_ALGO is not set 838# CONFIG_I2C_DEBUG_ALGO is not set
@@ -817,13 +845,18 @@ CONFIG_SPI_MASTER=y
817# SPI Master Controller Drivers 845# SPI Master Controller Drivers
818# 846#
819CONFIG_SPI_BITBANG=y 847CONFIG_SPI_BITBANG=y
820CONFIG_SPI_MPC83xx=y 848# CONFIG_SPI_MPC8xxx is not set
821 849
822# 850#
823# SPI Protocol Masters 851# SPI Protocol Masters
824# 852#
825# CONFIG_SPI_SPIDEV is not set 853# CONFIG_SPI_SPIDEV is not set
826# CONFIG_SPI_TLE62X0 is not set 854# CONFIG_SPI_TLE62X0 is not set
855
856#
857# PPS support
858#
859# CONFIG_PPS is not set
827CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 860CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
828# CONFIG_GPIOLIB is not set 861# CONFIG_GPIOLIB is not set
829# CONFIG_W1 is not set 862# CONFIG_W1 is not set
@@ -881,6 +914,7 @@ CONFIG_HWMON=y
881# CONFIG_SENSORS_SMSC47B397 is not set 914# CONFIG_SENSORS_SMSC47B397 is not set
882# CONFIG_SENSORS_ADS7828 is not set 915# CONFIG_SENSORS_ADS7828 is not set
883# CONFIG_SENSORS_THMC50 is not set 916# CONFIG_SENSORS_THMC50 is not set
917# CONFIG_SENSORS_TMP401 is not set
884# CONFIG_SENSORS_VIA686A is not set 918# CONFIG_SENSORS_VIA686A is not set
885# CONFIG_SENSORS_VT1211 is not set 919# CONFIG_SENSORS_VT1211 is not set
886# CONFIG_SENSORS_VT8231 is not set 920# CONFIG_SENSORS_VT8231 is not set
@@ -935,24 +969,10 @@ CONFIG_SSB_POSSIBLE=y
935# CONFIG_MFD_WM8400 is not set 969# CONFIG_MFD_WM8400 is not set
936# CONFIG_MFD_WM8350_I2C is not set 970# CONFIG_MFD_WM8350_I2C is not set
937# CONFIG_MFD_PCF50633 is not set 971# CONFIG_MFD_PCF50633 is not set
972# CONFIG_AB3100_CORE is not set
973# CONFIG_EZX_PCAP is not set
938# CONFIG_REGULATOR is not set 974# CONFIG_REGULATOR is not set
939 975# CONFIG_MEDIA_SUPPORT is not set
940#
941# Multimedia devices
942#
943
944#
945# Multimedia core support
946#
947# CONFIG_VIDEO_DEV is not set
948# CONFIG_DVB_CORE is not set
949# CONFIG_VIDEO_MEDIA is not set
950
951#
952# Multimedia drivers
953#
954CONFIG_DAB=y
955# CONFIG_USB_DABUSB is not set
956 976
957# 977#
958# Graphics support 978# Graphics support
@@ -1014,6 +1034,7 @@ CONFIG_USB_MON=y
1014# USB Host Controller Drivers 1034# USB Host Controller Drivers
1015# 1035#
1016# CONFIG_USB_C67X00_HCD is not set 1036# CONFIG_USB_C67X00_HCD is not set
1037# CONFIG_USB_XHCI_HCD is not set
1017CONFIG_USB_EHCI_HCD=y 1038CONFIG_USB_EHCI_HCD=y
1018# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1039# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1019# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1040# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1023,9 +1044,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1023# CONFIG_USB_ISP116X_HCD is not set 1044# CONFIG_USB_ISP116X_HCD is not set
1024# CONFIG_USB_ISP1760_HCD is not set 1045# CONFIG_USB_ISP1760_HCD is not set
1025CONFIG_USB_OHCI_HCD=y 1046CONFIG_USB_OHCI_HCD=y
1026CONFIG_USB_OHCI_HCD_PPC_OF=y
1027CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1047CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1028# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1048# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1049CONFIG_USB_OHCI_HCD_PPC_OF=y
1029CONFIG_USB_OHCI_HCD_PCI=y 1050CONFIG_USB_OHCI_HCD_PCI=y
1030CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1051CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1031CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1052CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1127,6 +1148,8 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1127# CONFIG_MMC_WBSD is not set 1148# CONFIG_MMC_WBSD is not set
1128# CONFIG_MMC_TIFM_SD is not set 1149# CONFIG_MMC_TIFM_SD is not set
1129CONFIG_MMC_SPI=y 1150CONFIG_MMC_SPI=y
1151# CONFIG_MMC_CB710 is not set
1152# CONFIG_MMC_VIA_SDMMC is not set
1130# CONFIG_MEMSTICK is not set 1153# CONFIG_MEMSTICK is not set
1131# CONFIG_NEW_LEDS is not set 1154# CONFIG_NEW_LEDS is not set
1132# CONFIG_ACCESSIBILITY is not set 1155# CONFIG_ACCESSIBILITY is not set
@@ -1136,6 +1159,10 @@ CONFIG_MMC_SPI=y
1136# CONFIG_DMADEVICES is not set 1159# CONFIG_DMADEVICES is not set
1137# CONFIG_AUXDISPLAY is not set 1160# CONFIG_AUXDISPLAY is not set
1138# CONFIG_UIO is not set 1161# CONFIG_UIO is not set
1162
1163#
1164# TI VLYNQ
1165#
1139# CONFIG_STAGING is not set 1166# CONFIG_STAGING is not set
1140 1167
1141# 1168#
@@ -1155,10 +1182,12 @@ CONFIG_FS_MBCACHE=y
1155# CONFIG_REISERFS_FS is not set 1182# CONFIG_REISERFS_FS is not set
1156# CONFIG_JFS_FS is not set 1183# CONFIG_JFS_FS is not set
1157# CONFIG_FS_POSIX_ACL is not set 1184# CONFIG_FS_POSIX_ACL is not set
1158CONFIG_FILE_LOCKING=y
1159# CONFIG_XFS_FS is not set 1185# CONFIG_XFS_FS is not set
1186# CONFIG_GFS2_FS is not set
1160# CONFIG_OCFS2_FS is not set 1187# CONFIG_OCFS2_FS is not set
1161# CONFIG_BTRFS_FS is not set 1188# CONFIG_BTRFS_FS is not set
1189CONFIG_FILE_LOCKING=y
1190CONFIG_FSNOTIFY=y
1162CONFIG_DNOTIFY=y 1191CONFIG_DNOTIFY=y
1163CONFIG_INOTIFY=y 1192CONFIG_INOTIFY=y
1164CONFIG_INOTIFY_USER=y 1193CONFIG_INOTIFY_USER=y
@@ -1224,6 +1253,7 @@ CONFIG_NFS_FS=y
1224CONFIG_NFS_V3=y 1253CONFIG_NFS_V3=y
1225# CONFIG_NFS_V3_ACL is not set 1254# CONFIG_NFS_V3_ACL is not set
1226CONFIG_NFS_V4=y 1255CONFIG_NFS_V4=y
1256# CONFIG_NFS_V4_1 is not set
1227CONFIG_ROOT_NFS=y 1257CONFIG_ROOT_NFS=y
1228# CONFIG_NFSD is not set 1258# CONFIG_NFSD is not set
1229CONFIG_LOCKD=y 1259CONFIG_LOCKD=y
@@ -1325,6 +1355,7 @@ CONFIG_HAS_IOPORT=y
1325CONFIG_HAS_DMA=y 1355CONFIG_HAS_DMA=y
1326CONFIG_HAVE_LMB=y 1356CONFIG_HAVE_LMB=y
1327CONFIG_NLATTR=y 1357CONFIG_NLATTR=y
1358CONFIG_GENERIC_ATOMIC64=y
1328 1359
1329# 1360#
1330# Kernel hacking 1361# Kernel hacking
@@ -1350,22 +1381,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1350CONFIG_HAVE_DYNAMIC_FTRACE=y 1381CONFIG_HAVE_DYNAMIC_FTRACE=y
1351CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1382CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1352CONFIG_TRACING_SUPPORT=y 1383CONFIG_TRACING_SUPPORT=y
1353 1384# CONFIG_FTRACE is not set
1354#
1355# Tracers
1356#
1357# CONFIG_FUNCTION_TRACER is not set
1358# CONFIG_SCHED_TRACER is not set
1359# CONFIG_CONTEXT_SWITCH_TRACER is not set
1360# CONFIG_EVENT_TRACER is not set
1361# CONFIG_BOOT_TRACER is not set
1362# CONFIG_TRACE_BRANCH_PROFILING is not set
1363# CONFIG_STACK_TRACER is not set
1364# CONFIG_KMEMTRACE is not set
1365# CONFIG_WORKQUEUE_TRACER is not set
1366# CONFIG_BLK_DEV_IO_TRACE is not set
1367# CONFIG_SAMPLES is not set 1385# CONFIG_SAMPLES is not set
1368CONFIG_HAVE_ARCH_KGDB=y 1386CONFIG_HAVE_ARCH_KGDB=y
1387# CONFIG_PPC_DISABLE_WERROR is not set
1388CONFIG_PPC_WERROR=y
1369CONFIG_PRINT_STACK_DEPTH=64 1389CONFIG_PRINT_STACK_DEPTH=64
1370# CONFIG_IRQSTACKS is not set 1390# CONFIG_IRQSTACKS is not set
1371# CONFIG_BOOTX_TEXT is not set 1391# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
index 24ee7fcac87e..648dac0c9d8d 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:09 2009 4# Wed Jul 29 23:32:07 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC834x_ITX=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC834x=y 208CONFIG_PPC_MPC834x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -487,6 +509,7 @@ CONFIG_MTD_PHYSMAP=y
487CONFIG_OF_DEVICE=y 509CONFIG_OF_DEVICE=y
488CONFIG_OF_I2C=y 510CONFIG_OF_I2C=y
489CONFIG_OF_SPI=y 511CONFIG_OF_SPI=y
512CONFIG_OF_MDIO=y
490# CONFIG_PARPORT is not set 513# CONFIG_PARPORT is not set
491CONFIG_BLK_DEV=y 514CONFIG_BLK_DEV=y
492# CONFIG_BLK_DEV_FD is not set 515# CONFIG_BLK_DEV_FD is not set
@@ -523,7 +546,9 @@ CONFIG_MISC_DEVICES=y
523# CONFIG_EEPROM_AT24 is not set 546# CONFIG_EEPROM_AT24 is not set
524# CONFIG_EEPROM_AT25 is not set 547# CONFIG_EEPROM_AT25 is not set
525# CONFIG_EEPROM_LEGACY is not set 548# CONFIG_EEPROM_LEGACY is not set
549# CONFIG_EEPROM_MAX6875 is not set
526# CONFIG_EEPROM_93CX6 is not set 550# CONFIG_EEPROM_93CX6 is not set
551# CONFIG_CB710_CORE is not set
527CONFIG_HAVE_IDE=y 552CONFIG_HAVE_IDE=y
528CONFIG_IDE=y 553CONFIG_IDE=y
529 554
@@ -594,10 +619,6 @@ CONFIG_BLK_DEV_SD=y
594# CONFIG_BLK_DEV_SR is not set 619# CONFIG_BLK_DEV_SR is not set
595CONFIG_CHR_DEV_SG=y 620CONFIG_CHR_DEV_SG=y
596# CONFIG_CHR_DEV_SCH is not set 621# CONFIG_CHR_DEV_SCH is not set
597
598#
599# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
600#
601# CONFIG_SCSI_MULTI_LUN is not set 622# CONFIG_SCSI_MULTI_LUN is not set
602# CONFIG_SCSI_CONSTANTS is not set 623# CONFIG_SCSI_CONSTANTS is not set
603# CONFIG_SCSI_LOGGING is not set 624# CONFIG_SCSI_LOGGING is not set
@@ -615,6 +636,7 @@ CONFIG_SCSI_SPI_ATTRS=y
615CONFIG_SCSI_LOWLEVEL=y 636CONFIG_SCSI_LOWLEVEL=y
616# CONFIG_ISCSI_TCP is not set 637# CONFIG_ISCSI_TCP is not set
617# CONFIG_SCSI_CXGB3_ISCSI is not set 638# CONFIG_SCSI_CXGB3_ISCSI is not set
639# CONFIG_SCSI_BNX2_ISCSI is not set
618# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 640# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
619# CONFIG_SCSI_3W_9XXX is not set 641# CONFIG_SCSI_3W_9XXX is not set
620# CONFIG_SCSI_ACARD is not set 642# CONFIG_SCSI_ACARD is not set
@@ -623,6 +645,7 @@ CONFIG_SCSI_LOWLEVEL=y
623# CONFIG_SCSI_AIC7XXX_OLD is not set 645# CONFIG_SCSI_AIC7XXX_OLD is not set
624# CONFIG_SCSI_AIC79XX is not set 646# CONFIG_SCSI_AIC79XX is not set
625# CONFIG_SCSI_AIC94XX is not set 647# CONFIG_SCSI_AIC94XX is not set
648# CONFIG_SCSI_MVSAS is not set
626# CONFIG_SCSI_DPT_I2O is not set 649# CONFIG_SCSI_DPT_I2O is not set
627# CONFIG_SCSI_ADVANSYS is not set 650# CONFIG_SCSI_ADVANSYS is not set
628# CONFIG_SCSI_ARCMSR is not set 651# CONFIG_SCSI_ARCMSR is not set
@@ -642,7 +665,6 @@ CONFIG_SCSI_LOWLEVEL=y
642# CONFIG_SCSI_IPS is not set 665# CONFIG_SCSI_IPS is not set
643# CONFIG_SCSI_INITIO is not set 666# CONFIG_SCSI_INITIO is not set
644# CONFIG_SCSI_INIA100 is not set 667# CONFIG_SCSI_INIA100 is not set
645# CONFIG_SCSI_MVSAS is not set
646# CONFIG_SCSI_STEX is not set 668# CONFIG_SCSI_STEX is not set
647# CONFIG_SCSI_SYM53C8XX_2 is not set 669# CONFIG_SCSI_SYM53C8XX_2 is not set
648# CONFIG_SCSI_IPR is not set 670# CONFIG_SCSI_IPR is not set
@@ -737,14 +759,17 @@ CONFIG_MD_RAID1=y
737# 759#
738 760
739# 761#
740# Enable only one of the two stacks, unless you know what you are doing 762# You can enable one or both FireWire driver stacks.
763#
764
765#
766# See the help texts for more information.
741# 767#
742# CONFIG_FIREWIRE is not set 768# CONFIG_FIREWIRE is not set
743# CONFIG_IEEE1394 is not set 769# CONFIG_IEEE1394 is not set
744# CONFIG_I2O is not set 770# CONFIG_I2O is not set
745# CONFIG_MACINTOSH_DRIVERS is not set 771# CONFIG_MACINTOSH_DRIVERS is not set
746CONFIG_NETDEVICES=y 772CONFIG_NETDEVICES=y
747CONFIG_COMPAT_NET_DEV_OPS=y
748# CONFIG_DUMMY is not set 773# CONFIG_DUMMY is not set
749# CONFIG_BONDING is not set 774# CONFIG_BONDING is not set
750# CONFIG_MACVLAN is not set 775# CONFIG_MACVLAN is not set
@@ -791,8 +816,10 @@ CONFIG_NETDEV_1000=y
791# CONFIG_VIA_VELOCITY is not set 816# CONFIG_VIA_VELOCITY is not set
792# CONFIG_TIGON3 is not set 817# CONFIG_TIGON3 is not set
793# CONFIG_BNX2 is not set 818# CONFIG_BNX2 is not set
819# CONFIG_CNIC is not set
794CONFIG_FSL_PQ_MDIO=y 820CONFIG_FSL_PQ_MDIO=y
795CONFIG_GIANFAR=y 821CONFIG_GIANFAR=y
822# CONFIG_MV643XX_ETH is not set
796# CONFIG_QLA3XXX is not set 823# CONFIG_QLA3XXX is not set
797# CONFIG_ATL1 is not set 824# CONFIG_ATL1 is not set
798# CONFIG_ATL1E is not set 825# CONFIG_ATL1E is not set
@@ -960,7 +987,6 @@ CONFIG_I2C_MPC=y
960CONFIG_SENSORS_PCF8574=y 987CONFIG_SENSORS_PCF8574=y
961# CONFIG_PCF8575 is not set 988# CONFIG_PCF8575 is not set
962# CONFIG_SENSORS_PCA9539 is not set 989# CONFIG_SENSORS_PCA9539 is not set
963# CONFIG_SENSORS_MAX6875 is not set
964# CONFIG_SENSORS_TSL2550 is not set 990# CONFIG_SENSORS_TSL2550 is not set
965# CONFIG_I2C_DEBUG_CORE is not set 991# CONFIG_I2C_DEBUG_CORE is not set
966# CONFIG_I2C_DEBUG_ALGO is not set 992# CONFIG_I2C_DEBUG_ALGO is not set
@@ -973,13 +999,18 @@ CONFIG_SPI_MASTER=y
973# SPI Master Controller Drivers 999# SPI Master Controller Drivers
974# 1000#
975CONFIG_SPI_BITBANG=y 1001CONFIG_SPI_BITBANG=y
976CONFIG_SPI_MPC83xx=y 1002# CONFIG_SPI_MPC8xxx is not set
977 1003
978# 1004#
979# SPI Protocol Masters 1005# SPI Protocol Masters
980# 1006#
981# CONFIG_SPI_SPIDEV is not set 1007# CONFIG_SPI_SPIDEV is not set
982# CONFIG_SPI_TLE62X0 is not set 1008# CONFIG_SPI_TLE62X0 is not set
1009
1010#
1011# PPS support
1012#
1013# CONFIG_PPS is not set
983CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1014CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
984# CONFIG_GPIOLIB is not set 1015# CONFIG_GPIOLIB is not set
985# CONFIG_W1 is not set 1016# CONFIG_W1 is not set
@@ -1026,24 +1057,10 @@ CONFIG_SSB_POSSIBLE=y
1026# CONFIG_MFD_WM8400 is not set 1057# CONFIG_MFD_WM8400 is not set
1027# CONFIG_MFD_WM8350_I2C is not set 1058# CONFIG_MFD_WM8350_I2C is not set
1028# CONFIG_MFD_PCF50633 is not set 1059# CONFIG_MFD_PCF50633 is not set
1060# CONFIG_AB3100_CORE is not set
1061# CONFIG_EZX_PCAP is not set
1029# CONFIG_REGULATOR is not set 1062# CONFIG_REGULATOR is not set
1030 1063# CONFIG_MEDIA_SUPPORT is not set
1031#
1032# Multimedia devices
1033#
1034
1035#
1036# Multimedia core support
1037#
1038# CONFIG_VIDEO_DEV is not set
1039# CONFIG_DVB_CORE is not set
1040# CONFIG_VIDEO_MEDIA is not set
1041
1042#
1043# Multimedia drivers
1044#
1045CONFIG_DAB=y
1046# CONFIG_USB_DABUSB is not set
1047 1064
1048# 1065#
1049# Graphics support 1066# Graphics support
@@ -1085,6 +1102,7 @@ CONFIG_USB_MON=y
1085# USB Host Controller Drivers 1102# USB Host Controller Drivers
1086# 1103#
1087# CONFIG_USB_C67X00_HCD is not set 1104# CONFIG_USB_C67X00_HCD is not set
1105# CONFIG_USB_XHCI_HCD is not set
1088CONFIG_USB_EHCI_HCD=y 1106CONFIG_USB_EHCI_HCD=y
1089CONFIG_USB_EHCI_ROOT_HUB_TT=y 1107CONFIG_USB_EHCI_ROOT_HUB_TT=y
1090# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1108# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1208,6 +1226,7 @@ CONFIG_RTC_DRV_DS1307=y
1208# CONFIG_RTC_DRV_S35390A is not set 1226# CONFIG_RTC_DRV_S35390A is not set
1209# CONFIG_RTC_DRV_FM3130 is not set 1227# CONFIG_RTC_DRV_FM3130 is not set
1210# CONFIG_RTC_DRV_RX8581 is not set 1228# CONFIG_RTC_DRV_RX8581 is not set
1229# CONFIG_RTC_DRV_RX8025 is not set
1211 1230
1212# 1231#
1213# SPI RTC drivers 1232# SPI RTC drivers
@@ -1242,6 +1261,10 @@ CONFIG_RTC_DRV_DS1307=y
1242# CONFIG_DMADEVICES is not set 1261# CONFIG_DMADEVICES is not set
1243# CONFIG_AUXDISPLAY is not set 1262# CONFIG_AUXDISPLAY is not set
1244# CONFIG_UIO is not set 1263# CONFIG_UIO is not set
1264
1265#
1266# TI VLYNQ
1267#
1245# CONFIG_STAGING is not set 1268# CONFIG_STAGING is not set
1246 1269
1247# 1270#
@@ -1261,10 +1284,12 @@ CONFIG_FS_MBCACHE=y
1261# CONFIG_REISERFS_FS is not set 1284# CONFIG_REISERFS_FS is not set
1262# CONFIG_JFS_FS is not set 1285# CONFIG_JFS_FS is not set
1263# CONFIG_FS_POSIX_ACL is not set 1286# CONFIG_FS_POSIX_ACL is not set
1264CONFIG_FILE_LOCKING=y
1265# CONFIG_XFS_FS is not set 1287# CONFIG_XFS_FS is not set
1288# CONFIG_GFS2_FS is not set
1266# CONFIG_OCFS2_FS is not set 1289# CONFIG_OCFS2_FS is not set
1267# CONFIG_BTRFS_FS is not set 1290# CONFIG_BTRFS_FS is not set
1291CONFIG_FILE_LOCKING=y
1292CONFIG_FSNOTIFY=y
1268CONFIG_DNOTIFY=y 1293CONFIG_DNOTIFY=y
1269CONFIG_INOTIFY=y 1294CONFIG_INOTIFY=y
1270CONFIG_INOTIFY_USER=y 1295CONFIG_INOTIFY_USER=y
@@ -1331,6 +1356,7 @@ CONFIG_NFS_FS=y
1331CONFIG_NFS_V3=y 1356CONFIG_NFS_V3=y
1332# CONFIG_NFS_V3_ACL is not set 1357# CONFIG_NFS_V3_ACL is not set
1333CONFIG_NFS_V4=y 1358CONFIG_NFS_V4=y
1359# CONFIG_NFS_V4_1 is not set
1334CONFIG_ROOT_NFS=y 1360CONFIG_ROOT_NFS=y
1335# CONFIG_NFSD is not set 1361# CONFIG_NFSD is not set
1336CONFIG_LOCKD=y 1362CONFIG_LOCKD=y
@@ -1429,6 +1455,7 @@ CONFIG_HAS_IOPORT=y
1429CONFIG_HAS_DMA=y 1455CONFIG_HAS_DMA=y
1430CONFIG_HAVE_LMB=y 1456CONFIG_HAVE_LMB=y
1431CONFIG_NLATTR=y 1457CONFIG_NLATTR=y
1458CONFIG_GENERIC_ATOMIC64=y
1432 1459
1433# 1460#
1434# Kernel hacking 1461# Kernel hacking
@@ -1454,22 +1481,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1454CONFIG_HAVE_DYNAMIC_FTRACE=y 1481CONFIG_HAVE_DYNAMIC_FTRACE=y
1455CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1482CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1456CONFIG_TRACING_SUPPORT=y 1483CONFIG_TRACING_SUPPORT=y
1457 1484# CONFIG_FTRACE is not set
1458#
1459# Tracers
1460#
1461# CONFIG_FUNCTION_TRACER is not set
1462# CONFIG_SCHED_TRACER is not set
1463# CONFIG_CONTEXT_SWITCH_TRACER is not set
1464# CONFIG_EVENT_TRACER is not set
1465# CONFIG_BOOT_TRACER is not set
1466# CONFIG_TRACE_BRANCH_PROFILING is not set
1467# CONFIG_STACK_TRACER is not set
1468# CONFIG_KMEMTRACE is not set
1469# CONFIG_WORKQUEUE_TRACER is not set
1470# CONFIG_BLK_DEV_IO_TRACE is not set
1471# CONFIG_SAMPLES is not set 1485# CONFIG_SAMPLES is not set
1472CONFIG_HAVE_ARCH_KGDB=y 1486CONFIG_HAVE_ARCH_KGDB=y
1487# CONFIG_PPC_DISABLE_WERROR is not set
1488CONFIG_PPC_WERROR=y
1473CONFIG_PRINT_STACK_DEPTH=64 1489CONFIG_PRINT_STACK_DEPTH=64
1474# CONFIG_IRQSTACKS is not set 1490# CONFIG_IRQSTACKS is not set
1475# CONFIG_BOOTX_TEXT is not set 1491# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig b/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
index 7f39543205a9..bf6deb831dc3 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:10 2009 4# Wed Jul 29 23:32:08 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC834x_ITX=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC834x=y 208CONFIG_PPC_MPC834x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -487,6 +509,7 @@ CONFIG_MTD_PHYSMAP=y
487CONFIG_OF_DEVICE=y 509CONFIG_OF_DEVICE=y
488CONFIG_OF_I2C=y 510CONFIG_OF_I2C=y
489CONFIG_OF_SPI=y 511CONFIG_OF_SPI=y
512CONFIG_OF_MDIO=y
490# CONFIG_PARPORT is not set 513# CONFIG_PARPORT is not set
491CONFIG_BLK_DEV=y 514CONFIG_BLK_DEV=y
492# CONFIG_BLK_DEV_FD is not set 515# CONFIG_BLK_DEV_FD is not set
@@ -523,7 +546,9 @@ CONFIG_MISC_DEVICES=y
523# CONFIG_EEPROM_AT24 is not set 546# CONFIG_EEPROM_AT24 is not set
524# CONFIG_EEPROM_AT25 is not set 547# CONFIG_EEPROM_AT25 is not set
525# CONFIG_EEPROM_LEGACY is not set 548# CONFIG_EEPROM_LEGACY is not set
549# CONFIG_EEPROM_MAX6875 is not set
526# CONFIG_EEPROM_93CX6 is not set 550# CONFIG_EEPROM_93CX6 is not set
551# CONFIG_CB710_CORE is not set
527CONFIG_HAVE_IDE=y 552CONFIG_HAVE_IDE=y
528# CONFIG_IDE is not set 553# CONFIG_IDE is not set
529 554
@@ -546,10 +571,6 @@ CONFIG_BLK_DEV_SD=y
546# CONFIG_BLK_DEV_SR is not set 571# CONFIG_BLK_DEV_SR is not set
547CONFIG_CHR_DEV_SG=y 572CONFIG_CHR_DEV_SG=y
548# CONFIG_CHR_DEV_SCH is not set 573# CONFIG_CHR_DEV_SCH is not set
549
550#
551# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
552#
553# CONFIG_SCSI_MULTI_LUN is not set 574# CONFIG_SCSI_MULTI_LUN is not set
554# CONFIG_SCSI_CONSTANTS is not set 575# CONFIG_SCSI_CONSTANTS is not set
555# CONFIG_SCSI_LOGGING is not set 576# CONFIG_SCSI_LOGGING is not set
@@ -567,6 +588,7 @@ CONFIG_SCSI_SPI_ATTRS=y
567CONFIG_SCSI_LOWLEVEL=y 588CONFIG_SCSI_LOWLEVEL=y
568# CONFIG_ISCSI_TCP is not set 589# CONFIG_ISCSI_TCP is not set
569# CONFIG_SCSI_CXGB3_ISCSI is not set 590# CONFIG_SCSI_CXGB3_ISCSI is not set
591# CONFIG_SCSI_BNX2_ISCSI is not set
570# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 592# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
571# CONFIG_SCSI_3W_9XXX is not set 593# CONFIG_SCSI_3W_9XXX is not set
572# CONFIG_SCSI_ACARD is not set 594# CONFIG_SCSI_ACARD is not set
@@ -575,6 +597,7 @@ CONFIG_SCSI_LOWLEVEL=y
575# CONFIG_SCSI_AIC7XXX_OLD is not set 597# CONFIG_SCSI_AIC7XXX_OLD is not set
576# CONFIG_SCSI_AIC79XX is not set 598# CONFIG_SCSI_AIC79XX is not set
577# CONFIG_SCSI_AIC94XX is not set 599# CONFIG_SCSI_AIC94XX is not set
600# CONFIG_SCSI_MVSAS is not set
578# CONFIG_SCSI_DPT_I2O is not set 601# CONFIG_SCSI_DPT_I2O is not set
579# CONFIG_SCSI_ADVANSYS is not set 602# CONFIG_SCSI_ADVANSYS is not set
580# CONFIG_SCSI_ARCMSR is not set 603# CONFIG_SCSI_ARCMSR is not set
@@ -594,7 +617,6 @@ CONFIG_SCSI_LOWLEVEL=y
594# CONFIG_SCSI_IPS is not set 617# CONFIG_SCSI_IPS is not set
595# CONFIG_SCSI_INITIO is not set 618# CONFIG_SCSI_INITIO is not set
596# CONFIG_SCSI_INIA100 is not set 619# CONFIG_SCSI_INIA100 is not set
597# CONFIG_SCSI_MVSAS is not set
598# CONFIG_SCSI_STEX is not set 620# CONFIG_SCSI_STEX is not set
599# CONFIG_SCSI_SYM53C8XX_2 is not set 621# CONFIG_SCSI_SYM53C8XX_2 is not set
600# CONFIG_SCSI_QLOGIC_1280 is not set 622# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -617,14 +639,17 @@ CONFIG_SCSI_LOWLEVEL=y
617# 639#
618 640
619# 641#
620# Enable only one of the two stacks, unless you know what you are doing 642# You can enable one or both FireWire driver stacks.
643#
644
645#
646# See the help texts for more information.
621# 647#
622# CONFIG_FIREWIRE is not set 648# CONFIG_FIREWIRE is not set
623# CONFIG_IEEE1394 is not set 649# CONFIG_IEEE1394 is not set
624# CONFIG_I2O is not set 650# CONFIG_I2O is not set
625# CONFIG_MACINTOSH_DRIVERS is not set 651# CONFIG_MACINTOSH_DRIVERS is not set
626CONFIG_NETDEVICES=y 652CONFIG_NETDEVICES=y
627CONFIG_COMPAT_NET_DEV_OPS=y
628# CONFIG_DUMMY is not set 653# CONFIG_DUMMY is not set
629# CONFIG_BONDING is not set 654# CONFIG_BONDING is not set
630# CONFIG_MACVLAN is not set 655# CONFIG_MACVLAN is not set
@@ -671,8 +696,10 @@ CONFIG_NETDEV_1000=y
671# CONFIG_VIA_VELOCITY is not set 696# CONFIG_VIA_VELOCITY is not set
672# CONFIG_TIGON3 is not set 697# CONFIG_TIGON3 is not set
673# CONFIG_BNX2 is not set 698# CONFIG_BNX2 is not set
699# CONFIG_CNIC is not set
674CONFIG_FSL_PQ_MDIO=y 700CONFIG_FSL_PQ_MDIO=y
675CONFIG_GIANFAR=y 701CONFIG_GIANFAR=y
702# CONFIG_MV643XX_ETH is not set
676# CONFIG_QLA3XXX is not set 703# CONFIG_QLA3XXX is not set
677# CONFIG_ATL1 is not set 704# CONFIG_ATL1 is not set
678# CONFIG_ATL1E is not set 705# CONFIG_ATL1E is not set
@@ -840,7 +867,6 @@ CONFIG_I2C_MPC=y
840CONFIG_SENSORS_PCF8574=y 867CONFIG_SENSORS_PCF8574=y
841# CONFIG_PCF8575 is not set 868# CONFIG_PCF8575 is not set
842# CONFIG_SENSORS_PCA9539 is not set 869# CONFIG_SENSORS_PCA9539 is not set
843# CONFIG_SENSORS_MAX6875 is not set
844# CONFIG_SENSORS_TSL2550 is not set 870# CONFIG_SENSORS_TSL2550 is not set
845# CONFIG_I2C_DEBUG_CORE is not set 871# CONFIG_I2C_DEBUG_CORE is not set
846# CONFIG_I2C_DEBUG_ALGO is not set 872# CONFIG_I2C_DEBUG_ALGO is not set
@@ -853,13 +879,18 @@ CONFIG_SPI_MASTER=y
853# SPI Master Controller Drivers 879# SPI Master Controller Drivers
854# 880#
855CONFIG_SPI_BITBANG=y 881CONFIG_SPI_BITBANG=y
856CONFIG_SPI_MPC83xx=y 882# CONFIG_SPI_MPC8xxx is not set
857 883
858# 884#
859# SPI Protocol Masters 885# SPI Protocol Masters
860# 886#
861# CONFIG_SPI_SPIDEV is not set 887# CONFIG_SPI_SPIDEV is not set
862# CONFIG_SPI_TLE62X0 is not set 888# CONFIG_SPI_TLE62X0 is not set
889
890#
891# PPS support
892#
893# CONFIG_PPS is not set
863CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 894CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
864# CONFIG_GPIOLIB is not set 895# CONFIG_GPIOLIB is not set
865# CONFIG_W1 is not set 896# CONFIG_W1 is not set
@@ -906,24 +937,10 @@ CONFIG_SSB_POSSIBLE=y
906# CONFIG_MFD_WM8400 is not set 937# CONFIG_MFD_WM8400 is not set
907# CONFIG_MFD_WM8350_I2C is not set 938# CONFIG_MFD_WM8350_I2C is not set
908# CONFIG_MFD_PCF50633 is not set 939# CONFIG_MFD_PCF50633 is not set
940# CONFIG_AB3100_CORE is not set
941# CONFIG_EZX_PCAP is not set
909# CONFIG_REGULATOR is not set 942# CONFIG_REGULATOR is not set
910 943# CONFIG_MEDIA_SUPPORT is not set
911#
912# Multimedia devices
913#
914
915#
916# Multimedia core support
917#
918# CONFIG_VIDEO_DEV is not set
919# CONFIG_DVB_CORE is not set
920# CONFIG_VIDEO_MEDIA is not set
921
922#
923# Multimedia drivers
924#
925CONFIG_DAB=y
926# CONFIG_USB_DABUSB is not set
927 944
928# 945#
929# Graphics support 946# Graphics support
@@ -965,6 +982,7 @@ CONFIG_USB_MON=y
965# USB Host Controller Drivers 982# USB Host Controller Drivers
966# 983#
967# CONFIG_USB_C67X00_HCD is not set 984# CONFIG_USB_C67X00_HCD is not set
985# CONFIG_USB_XHCI_HCD is not set
968CONFIG_USB_EHCI_HCD=y 986CONFIG_USB_EHCI_HCD=y
969CONFIG_USB_EHCI_ROOT_HUB_TT=y 987CONFIG_USB_EHCI_ROOT_HUB_TT=y
970# CONFIG_USB_EHCI_TT_NEWSCHED is not set 988# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1087,6 +1105,7 @@ CONFIG_RTC_DRV_DS1307=y
1087# CONFIG_RTC_DRV_S35390A is not set 1105# CONFIG_RTC_DRV_S35390A is not set
1088# CONFIG_RTC_DRV_FM3130 is not set 1106# CONFIG_RTC_DRV_FM3130 is not set
1089# CONFIG_RTC_DRV_RX8581 is not set 1107# CONFIG_RTC_DRV_RX8581 is not set
1108# CONFIG_RTC_DRV_RX8025 is not set
1090 1109
1091# 1110#
1092# SPI RTC drivers 1111# SPI RTC drivers
@@ -1121,6 +1140,10 @@ CONFIG_RTC_DRV_DS1307=y
1121# CONFIG_DMADEVICES is not set 1140# CONFIG_DMADEVICES is not set
1122# CONFIG_AUXDISPLAY is not set 1141# CONFIG_AUXDISPLAY is not set
1123# CONFIG_UIO is not set 1142# CONFIG_UIO is not set
1143
1144#
1145# TI VLYNQ
1146#
1124# CONFIG_STAGING is not set 1147# CONFIG_STAGING is not set
1125 1148
1126# 1149#
@@ -1140,10 +1163,12 @@ CONFIG_FS_MBCACHE=y
1140# CONFIG_REISERFS_FS is not set 1163# CONFIG_REISERFS_FS is not set
1141# CONFIG_JFS_FS is not set 1164# CONFIG_JFS_FS is not set
1142# CONFIG_FS_POSIX_ACL is not set 1165# CONFIG_FS_POSIX_ACL is not set
1143CONFIG_FILE_LOCKING=y
1144# CONFIG_XFS_FS is not set 1166# CONFIG_XFS_FS is not set
1167# CONFIG_GFS2_FS is not set
1145# CONFIG_OCFS2_FS is not set 1168# CONFIG_OCFS2_FS is not set
1146# CONFIG_BTRFS_FS is not set 1169# CONFIG_BTRFS_FS is not set
1170CONFIG_FILE_LOCKING=y
1171CONFIG_FSNOTIFY=y
1147CONFIG_DNOTIFY=y 1172CONFIG_DNOTIFY=y
1148CONFIG_INOTIFY=y 1173CONFIG_INOTIFY=y
1149CONFIG_INOTIFY_USER=y 1174CONFIG_INOTIFY_USER=y
@@ -1210,6 +1235,7 @@ CONFIG_NFS_FS=y
1210CONFIG_NFS_V3=y 1235CONFIG_NFS_V3=y
1211# CONFIG_NFS_V3_ACL is not set 1236# CONFIG_NFS_V3_ACL is not set
1212CONFIG_NFS_V4=y 1237CONFIG_NFS_V4=y
1238# CONFIG_NFS_V4_1 is not set
1213CONFIG_ROOT_NFS=y 1239CONFIG_ROOT_NFS=y
1214# CONFIG_NFSD is not set 1240# CONFIG_NFSD is not set
1215CONFIG_LOCKD=y 1241CONFIG_LOCKD=y
@@ -1308,6 +1334,7 @@ CONFIG_HAS_IOPORT=y
1308CONFIG_HAS_DMA=y 1334CONFIG_HAS_DMA=y
1309CONFIG_HAVE_LMB=y 1335CONFIG_HAVE_LMB=y
1310CONFIG_NLATTR=y 1336CONFIG_NLATTR=y
1337CONFIG_GENERIC_ATOMIC64=y
1311 1338
1312# 1339#
1313# Kernel hacking 1340# Kernel hacking
@@ -1333,22 +1360,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1333CONFIG_HAVE_DYNAMIC_FTRACE=y 1360CONFIG_HAVE_DYNAMIC_FTRACE=y
1334CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1361CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1335CONFIG_TRACING_SUPPORT=y 1362CONFIG_TRACING_SUPPORT=y
1336 1363# CONFIG_FTRACE is not set
1337#
1338# Tracers
1339#
1340# CONFIG_FUNCTION_TRACER is not set
1341# CONFIG_SCHED_TRACER is not set
1342# CONFIG_CONTEXT_SWITCH_TRACER is not set
1343# CONFIG_EVENT_TRACER is not set
1344# CONFIG_BOOT_TRACER is not set
1345# CONFIG_TRACE_BRANCH_PROFILING is not set
1346# CONFIG_STACK_TRACER is not set
1347# CONFIG_KMEMTRACE is not set
1348# CONFIG_WORKQUEUE_TRACER is not set
1349# CONFIG_BLK_DEV_IO_TRACE is not set
1350# CONFIG_SAMPLES is not set 1364# CONFIG_SAMPLES is not set
1351CONFIG_HAVE_ARCH_KGDB=y 1365CONFIG_HAVE_ARCH_KGDB=y
1366# CONFIG_PPC_DISABLE_WERROR is not set
1367CONFIG_PPC_WERROR=y
1352CONFIG_PRINT_STACK_DEPTH=64 1368CONFIG_PRINT_STACK_DEPTH=64
1353# CONFIG_IRQSTACKS is not set 1369# CONFIG_IRQSTACKS is not set
1354# CONFIG_BOOTX_TEXT is not set 1370# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_mds_defconfig b/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
index 1cd1fcac22c8..3236c47712c2 100644
--- a/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:11 2009 4# Wed Jul 29 23:32:09 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC834x_MDS=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192CONFIG_PPC_MPC834x=y 208CONFIG_PPC_MPC834x=y
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -403,6 +425,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
403# CONFIG_MTD is not set 425# CONFIG_MTD is not set
404CONFIG_OF_DEVICE=y 426CONFIG_OF_DEVICE=y
405CONFIG_OF_I2C=y 427CONFIG_OF_I2C=y
428CONFIG_OF_MDIO=y
406# CONFIG_PARPORT is not set 429# CONFIG_PARPORT is not set
407CONFIG_BLK_DEV=y 430CONFIG_BLK_DEV=y
408# CONFIG_BLK_DEV_FD is not set 431# CONFIG_BLK_DEV_FD is not set
@@ -437,7 +460,9 @@ CONFIG_MISC_DEVICES=y
437# 460#
438# CONFIG_EEPROM_AT24 is not set 461# CONFIG_EEPROM_AT24 is not set
439# CONFIG_EEPROM_LEGACY is not set 462# CONFIG_EEPROM_LEGACY is not set
463# CONFIG_EEPROM_MAX6875 is not set
440# CONFIG_EEPROM_93CX6 is not set 464# CONFIG_EEPROM_93CX6 is not set
465# CONFIG_CB710_CORE is not set
441CONFIG_HAVE_IDE=y 466CONFIG_HAVE_IDE=y
442# CONFIG_IDE is not set 467# CONFIG_IDE is not set
443 468
@@ -457,14 +482,17 @@ CONFIG_HAVE_IDE=y
457# 482#
458 483
459# 484#
460# Enable only one of the two stacks, unless you know what you are doing 485# You can enable one or both FireWire driver stacks.
486#
487
488#
489# See the help texts for more information.
461# 490#
462# CONFIG_FIREWIRE is not set 491# CONFIG_FIREWIRE is not set
463# CONFIG_IEEE1394 is not set 492# CONFIG_IEEE1394 is not set
464# CONFIG_I2O is not set 493# CONFIG_I2O is not set
465# CONFIG_MACINTOSH_DRIVERS is not set 494# CONFIG_MACINTOSH_DRIVERS is not set
466CONFIG_NETDEVICES=y 495CONFIG_NETDEVICES=y
467CONFIG_COMPAT_NET_DEV_OPS=y
468# CONFIG_DUMMY is not set 496# CONFIG_DUMMY is not set
469# CONFIG_BONDING is not set 497# CONFIG_BONDING is not set
470# CONFIG_MACVLAN is not set 498# CONFIG_MACVLAN is not set
@@ -527,6 +555,7 @@ CONFIG_E100=y
527# CONFIG_SMSC9420 is not set 555# CONFIG_SMSC9420 is not set
528# CONFIG_SUNDANCE is not set 556# CONFIG_SUNDANCE is not set
529# CONFIG_TLAN is not set 557# CONFIG_TLAN is not set
558# CONFIG_KS8842 is not set
530# CONFIG_VIA_RHINE is not set 559# CONFIG_VIA_RHINE is not set
531# CONFIG_SC92031 is not set 560# CONFIG_SC92031 is not set
532# CONFIG_ATL2 is not set 561# CONFIG_ATL2 is not set
@@ -548,8 +577,10 @@ CONFIG_NETDEV_1000=y
548# CONFIG_VIA_VELOCITY is not set 577# CONFIG_VIA_VELOCITY is not set
549# CONFIG_TIGON3 is not set 578# CONFIG_TIGON3 is not set
550# CONFIG_BNX2 is not set 579# CONFIG_BNX2 is not set
580# CONFIG_CNIC is not set
551CONFIG_FSL_PQ_MDIO=y 581CONFIG_FSL_PQ_MDIO=y
552CONFIG_GIANFAR=y 582CONFIG_GIANFAR=y
583# CONFIG_MV643XX_ETH is not set
553# CONFIG_QLA3XXX is not set 584# CONFIG_QLA3XXX is not set
554# CONFIG_ATL1 is not set 585# CONFIG_ATL1 is not set
555# CONFIG_ATL1E is not set 586# CONFIG_ATL1E is not set
@@ -724,13 +755,17 @@ CONFIG_I2C_MPC=y
724# CONFIG_SENSORS_PCF8574 is not set 755# CONFIG_SENSORS_PCF8574 is not set
725# CONFIG_PCF8575 is not set 756# CONFIG_PCF8575 is not set
726# CONFIG_SENSORS_PCA9539 is not set 757# CONFIG_SENSORS_PCA9539 is not set
727# CONFIG_SENSORS_MAX6875 is not set
728# CONFIG_SENSORS_TSL2550 is not set 758# CONFIG_SENSORS_TSL2550 is not set
729# CONFIG_I2C_DEBUG_CORE is not set 759# CONFIG_I2C_DEBUG_CORE is not set
730# CONFIG_I2C_DEBUG_ALGO is not set 760# CONFIG_I2C_DEBUG_ALGO is not set
731# CONFIG_I2C_DEBUG_BUS is not set 761# CONFIG_I2C_DEBUG_BUS is not set
732# CONFIG_I2C_DEBUG_CHIP is not set 762# CONFIG_I2C_DEBUG_CHIP is not set
733# CONFIG_SPI is not set 763# CONFIG_SPI is not set
764
765#
766# PPS support
767#
768# CONFIG_PPS is not set
734CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 769CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
735# CONFIG_GPIOLIB is not set 770# CONFIG_GPIOLIB is not set
736# CONFIG_W1 is not set 771# CONFIG_W1 is not set
@@ -785,6 +820,7 @@ CONFIG_HWMON=y
785# CONFIG_SENSORS_SMSC47B397 is not set 820# CONFIG_SENSORS_SMSC47B397 is not set
786# CONFIG_SENSORS_ADS7828 is not set 821# CONFIG_SENSORS_ADS7828 is not set
787# CONFIG_SENSORS_THMC50 is not set 822# CONFIG_SENSORS_THMC50 is not set
823# CONFIG_SENSORS_TMP401 is not set
788# CONFIG_SENSORS_VIA686A is not set 824# CONFIG_SENSORS_VIA686A is not set
789# CONFIG_SENSORS_VT1211 is not set 825# CONFIG_SENSORS_VT1211 is not set
790# CONFIG_SENSORS_VT8231 is not set 826# CONFIG_SENSORS_VT8231 is not set
@@ -833,23 +869,9 @@ CONFIG_SSB_POSSIBLE=y
833# CONFIG_MFD_WM8400 is not set 869# CONFIG_MFD_WM8400 is not set
834# CONFIG_MFD_WM8350_I2C is not set 870# CONFIG_MFD_WM8350_I2C is not set
835# CONFIG_MFD_PCF50633 is not set 871# CONFIG_MFD_PCF50633 is not set
872# CONFIG_AB3100_CORE is not set
836# CONFIG_REGULATOR is not set 873# CONFIG_REGULATOR is not set
837 874# CONFIG_MEDIA_SUPPORT is not set
838#
839# Multimedia devices
840#
841
842#
843# Multimedia core support
844#
845# CONFIG_VIDEO_DEV is not set
846# CONFIG_DVB_CORE is not set
847# CONFIG_VIDEO_MEDIA is not set
848
849#
850# Multimedia drivers
851#
852CONFIG_DAB=y
853 875
854# 876#
855# Graphics support 877# Graphics support
@@ -933,6 +955,7 @@ CONFIG_RTC_DRV_DS1374=y
933# CONFIG_RTC_DRV_S35390A is not set 955# CONFIG_RTC_DRV_S35390A is not set
934# CONFIG_RTC_DRV_FM3130 is not set 956# CONFIG_RTC_DRV_FM3130 is not set
935# CONFIG_RTC_DRV_RX8581 is not set 957# CONFIG_RTC_DRV_RX8581 is not set
958# CONFIG_RTC_DRV_RX8025 is not set
936 959
937# 960#
938# SPI RTC drivers 961# SPI RTC drivers
@@ -960,6 +983,10 @@ CONFIG_RTC_DRV_DS1374=y
960# CONFIG_DMADEVICES is not set 983# CONFIG_DMADEVICES is not set
961# CONFIG_AUXDISPLAY is not set 984# CONFIG_AUXDISPLAY is not set
962# CONFIG_UIO is not set 985# CONFIG_UIO is not set
986
987#
988# TI VLYNQ
989#
963# CONFIG_STAGING is not set 990# CONFIG_STAGING is not set
964 991
965# 992#
@@ -979,10 +1006,12 @@ CONFIG_FS_MBCACHE=y
979# CONFIG_REISERFS_FS is not set 1006# CONFIG_REISERFS_FS is not set
980# CONFIG_JFS_FS is not set 1007# CONFIG_JFS_FS is not set
981# CONFIG_FS_POSIX_ACL is not set 1008# CONFIG_FS_POSIX_ACL is not set
982CONFIG_FILE_LOCKING=y
983# CONFIG_XFS_FS is not set 1009# CONFIG_XFS_FS is not set
1010# CONFIG_GFS2_FS is not set
984# CONFIG_OCFS2_FS is not set 1011# CONFIG_OCFS2_FS is not set
985# CONFIG_BTRFS_FS is not set 1012# CONFIG_BTRFS_FS is not set
1013CONFIG_FILE_LOCKING=y
1014CONFIG_FSNOTIFY=y
986CONFIG_DNOTIFY=y 1015CONFIG_DNOTIFY=y
987CONFIG_INOTIFY=y 1016CONFIG_INOTIFY=y
988CONFIG_INOTIFY_USER=y 1017CONFIG_INOTIFY_USER=y
@@ -1045,6 +1074,7 @@ CONFIG_NFS_FS=y
1045CONFIG_NFS_V3=y 1074CONFIG_NFS_V3=y
1046# CONFIG_NFS_V3_ACL is not set 1075# CONFIG_NFS_V3_ACL is not set
1047CONFIG_NFS_V4=y 1076CONFIG_NFS_V4=y
1077# CONFIG_NFS_V4_1 is not set
1048CONFIG_ROOT_NFS=y 1078CONFIG_ROOT_NFS=y
1049# CONFIG_NFSD is not set 1079# CONFIG_NFSD is not set
1050CONFIG_LOCKD=y 1080CONFIG_LOCKD=y
@@ -1100,6 +1130,7 @@ CONFIG_HAS_IOPORT=y
1100CONFIG_HAS_DMA=y 1130CONFIG_HAS_DMA=y
1101CONFIG_HAVE_LMB=y 1131CONFIG_HAVE_LMB=y
1102CONFIG_NLATTR=y 1132CONFIG_NLATTR=y
1133CONFIG_GENERIC_ATOMIC64=y
1103 1134
1104# 1135#
1105# Kernel hacking 1136# Kernel hacking
@@ -1125,22 +1156,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1125CONFIG_HAVE_DYNAMIC_FTRACE=y 1156CONFIG_HAVE_DYNAMIC_FTRACE=y
1126CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1157CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1127CONFIG_TRACING_SUPPORT=y 1158CONFIG_TRACING_SUPPORT=y
1128 1159# CONFIG_FTRACE is not set
1129#
1130# Tracers
1131#
1132# CONFIG_FUNCTION_TRACER is not set
1133# CONFIG_SCHED_TRACER is not set
1134# CONFIG_CONTEXT_SWITCH_TRACER is not set
1135# CONFIG_EVENT_TRACER is not set
1136# CONFIG_BOOT_TRACER is not set
1137# CONFIG_TRACE_BRANCH_PROFILING is not set
1138# CONFIG_STACK_TRACER is not set
1139# CONFIG_KMEMTRACE is not set
1140# CONFIG_WORKQUEUE_TRACER is not set
1141# CONFIG_BLK_DEV_IO_TRACE is not set
1142# CONFIG_SAMPLES is not set 1160# CONFIG_SAMPLES is not set
1143CONFIG_HAVE_ARCH_KGDB=y 1161CONFIG_HAVE_ARCH_KGDB=y
1162# CONFIG_PPC_DISABLE_WERROR is not set
1163CONFIG_PPC_WERROR=y
1144CONFIG_PRINT_STACK_DEPTH=64 1164CONFIG_PRINT_STACK_DEPTH=64
1145# CONFIG_IRQSTACKS is not set 1165# CONFIG_IRQSTACKS is not set
1146# CONFIG_BOOTX_TEXT is not set 1166# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
index ce5177393a0d..8c5299d74813 100644
--- a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:12 2009 4# Wed Jul 29 23:32:10 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,9 +124,16 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
125CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
128CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -135,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
135CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
138# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
139# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
140CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -147,7 +162,7 @@ CONFIG_MODULE_UNLOAD=y
147# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
148# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
149CONFIG_BLOCK=y 164CONFIG_BLOCK=y
150# CONFIG_LBD is not set 165CONFIG_LBDAF=y
151# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
152# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
153 168
@@ -189,6 +204,7 @@ CONFIG_MPC836x_MDS=y
189# CONFIG_MPC837x_RDB is not set 204# CONFIG_MPC837x_RDB is not set
190# CONFIG_SBC834x is not set 205# CONFIG_SBC834x is not set
191# CONFIG_ASP834x is not set 206# CONFIG_ASP834x is not set
207# CONFIG_KMETER1 is not set
192# CONFIG_PPC_86xx is not set 208# CONFIG_PPC_86xx is not set
193# CONFIG_EMBEDDED6xx is not set 209# CONFIG_EMBEDDED6xx is not set
194# CONFIG_AMIGAONE is not set 210# CONFIG_AMIGAONE is not set
@@ -233,6 +249,7 @@ CONFIG_BINFMT_ELF=y
233# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
234# CONFIG_BINFMT_MISC is not set 250# CONFIG_BINFMT_MISC is not set
235# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
236CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
237CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -253,9 +270,9 @@ CONFIG_MIGRATION=y
253CONFIG_ZONE_DMA_FLAG=1 270CONFIG_ZONE_DMA_FLAG=1
254CONFIG_BOUNCE=y 271CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y 272CONFIG_VIRT_TO_BUS=y
256CONFIG_UNEVICTABLE_LRU=y
257CONFIG_HAVE_MLOCK=y 273CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y 274CONFIG_HAVE_MLOCKED_PAGE_BIT=y
275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
259CONFIG_PPC_4K_PAGES=y 276CONFIG_PPC_4K_PAGES=y
260# CONFIG_PPC_16K_PAGES is not set 277# CONFIG_PPC_16K_PAGES is not set
261# CONFIG_PPC_64K_PAGES is not set 278# CONFIG_PPC_64K_PAGES is not set
@@ -364,6 +381,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
364# CONFIG_ECONET is not set 381# CONFIG_ECONET is not set
365# CONFIG_WAN_ROUTER is not set 382# CONFIG_WAN_ROUTER is not set
366# CONFIG_PHONET is not set 383# CONFIG_PHONET is not set
384# CONFIG_IEEE802154 is not set
367# CONFIG_NET_SCHED is not set 385# CONFIG_NET_SCHED is not set
368# CONFIG_DCB is not set 386# CONFIG_DCB is not set
369 387
@@ -381,7 +399,11 @@ CONFIG_WIRELESS=y
381CONFIG_WIRELESS_OLD_REGULATORY=y 399CONFIG_WIRELESS_OLD_REGULATORY=y
382# CONFIG_WIRELESS_EXT is not set 400# CONFIG_WIRELESS_EXT is not set
383# CONFIG_LIB80211 is not set 401# CONFIG_LIB80211 is not set
384# CONFIG_MAC80211 is not set 402
403#
404# CFG80211 needs to be enabled for MAC80211
405#
406CONFIG_MAC80211_DEFAULT_PS_VALUE=0
385# CONFIG_WIMAX is not set 407# CONFIG_WIMAX is not set
386# CONFIG_RFKILL is not set 408# CONFIG_RFKILL is not set
387# CONFIG_NET_9P is not set 409# CONFIG_NET_9P is not set
@@ -485,6 +507,7 @@ CONFIG_MTD_PHYSMAP_OF=y
485# CONFIG_MTD_UBI is not set 507# CONFIG_MTD_UBI is not set
486CONFIG_OF_DEVICE=y 508CONFIG_OF_DEVICE=y
487CONFIG_OF_I2C=y 509CONFIG_OF_I2C=y
510CONFIG_OF_MDIO=y
488# CONFIG_PARPORT is not set 511# CONFIG_PARPORT is not set
489CONFIG_BLK_DEV=y 512CONFIG_BLK_DEV=y
490# CONFIG_BLK_DEV_FD is not set 513# CONFIG_BLK_DEV_FD is not set
@@ -519,7 +542,9 @@ CONFIG_MISC_DEVICES=y
519# 542#
520# CONFIG_EEPROM_AT24 is not set 543# CONFIG_EEPROM_AT24 is not set
521# CONFIG_EEPROM_LEGACY is not set 544# CONFIG_EEPROM_LEGACY is not set
545# CONFIG_EEPROM_MAX6875 is not set
522# CONFIG_EEPROM_93CX6 is not set 546# CONFIG_EEPROM_93CX6 is not set
547# CONFIG_CB710_CORE is not set
523CONFIG_HAVE_IDE=y 548CONFIG_HAVE_IDE=y
524# CONFIG_IDE is not set 549# CONFIG_IDE is not set
525 550
@@ -542,10 +567,6 @@ CONFIG_SCSI_PROC_FS=y
542# CONFIG_BLK_DEV_SR is not set 567# CONFIG_BLK_DEV_SR is not set
543# CONFIG_CHR_DEV_SG is not set 568# CONFIG_CHR_DEV_SG is not set
544# CONFIG_CHR_DEV_SCH is not set 569# CONFIG_CHR_DEV_SCH is not set
545
546#
547# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
548#
549# CONFIG_SCSI_MULTI_LUN is not set 570# CONFIG_SCSI_MULTI_LUN is not set
550# CONFIG_SCSI_CONSTANTS is not set 571# CONFIG_SCSI_CONSTANTS is not set
551# CONFIG_SCSI_LOGGING is not set 572# CONFIG_SCSI_LOGGING is not set
@@ -563,6 +584,7 @@ CONFIG_SCSI_WAIT_SCAN=m
563CONFIG_SCSI_LOWLEVEL=y 584CONFIG_SCSI_LOWLEVEL=y
564# CONFIG_ISCSI_TCP is not set 585# CONFIG_ISCSI_TCP is not set
565# CONFIG_SCSI_CXGB3_ISCSI is not set 586# CONFIG_SCSI_CXGB3_ISCSI is not set
587# CONFIG_SCSI_BNX2_ISCSI is not set
566# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 588# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
567# CONFIG_SCSI_3W_9XXX is not set 589# CONFIG_SCSI_3W_9XXX is not set
568# CONFIG_SCSI_ACARD is not set 590# CONFIG_SCSI_ACARD is not set
@@ -571,6 +593,7 @@ CONFIG_SCSI_LOWLEVEL=y
571# CONFIG_SCSI_AIC7XXX_OLD is not set 593# CONFIG_SCSI_AIC7XXX_OLD is not set
572# CONFIG_SCSI_AIC79XX is not set 594# CONFIG_SCSI_AIC79XX is not set
573# CONFIG_SCSI_AIC94XX is not set 595# CONFIG_SCSI_AIC94XX is not set
596# CONFIG_SCSI_MVSAS is not set
574# CONFIG_SCSI_DPT_I2O is not set 597# CONFIG_SCSI_DPT_I2O is not set
575# CONFIG_SCSI_ADVANSYS is not set 598# CONFIG_SCSI_ADVANSYS is not set
576# CONFIG_SCSI_ARCMSR is not set 599# CONFIG_SCSI_ARCMSR is not set
@@ -590,7 +613,6 @@ CONFIG_SCSI_LOWLEVEL=y
590# CONFIG_SCSI_IPS is not set 613# CONFIG_SCSI_IPS is not set
591# CONFIG_SCSI_INITIO is not set 614# CONFIG_SCSI_INITIO is not set
592# CONFIG_SCSI_INIA100 is not set 615# CONFIG_SCSI_INIA100 is not set
593# CONFIG_SCSI_MVSAS is not set
594# CONFIG_SCSI_STEX is not set 616# CONFIG_SCSI_STEX is not set
595# CONFIG_SCSI_SYM53C8XX_2 is not set 617# CONFIG_SCSI_SYM53C8XX_2 is not set
596# CONFIG_SCSI_QLOGIC_1280 is not set 618# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -613,14 +635,17 @@ CONFIG_SCSI_LOWLEVEL=y
613# 635#
614 636
615# 637#
616# Enable only one of the two stacks, unless you know what you are doing 638# You can enable one or both FireWire driver stacks.
639#
640
641#
642# See the help texts for more information.
617# 643#
618# CONFIG_FIREWIRE is not set 644# CONFIG_FIREWIRE is not set
619# CONFIG_IEEE1394 is not set 645# CONFIG_IEEE1394 is not set
620# CONFIG_I2O is not set 646# CONFIG_I2O is not set
621# CONFIG_MACINTOSH_DRIVERS is not set 647# CONFIG_MACINTOSH_DRIVERS is not set
622CONFIG_NETDEVICES=y 648CONFIG_NETDEVICES=y
623CONFIG_COMPAT_NET_DEV_OPS=y
624# CONFIG_DUMMY is not set 649# CONFIG_DUMMY is not set
625# CONFIG_BONDING is not set 650# CONFIG_BONDING is not set
626# CONFIG_MACVLAN is not set 651# CONFIG_MACVLAN is not set
@@ -667,6 +692,7 @@ CONFIG_MII=y
667# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 692# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
668# CONFIG_NET_PCI is not set 693# CONFIG_NET_PCI is not set
669# CONFIG_B44 is not set 694# CONFIG_B44 is not set
695# CONFIG_KS8842 is not set
670# CONFIG_ATL2 is not set 696# CONFIG_ATL2 is not set
671CONFIG_NETDEV_1000=y 697CONFIG_NETDEV_1000=y
672# CONFIG_ACENIC is not set 698# CONFIG_ACENIC is not set
@@ -686,11 +712,13 @@ CONFIG_NETDEV_1000=y
686# CONFIG_VIA_VELOCITY is not set 712# CONFIG_VIA_VELOCITY is not set
687# CONFIG_TIGON3 is not set 713# CONFIG_TIGON3 is not set
688# CONFIG_BNX2 is not set 714# CONFIG_BNX2 is not set
715# CONFIG_CNIC is not set
689CONFIG_FSL_PQ_MDIO=y 716CONFIG_FSL_PQ_MDIO=y
690# CONFIG_GIANFAR is not set 717# CONFIG_GIANFAR is not set
691CONFIG_UCC_GETH=y 718CONFIG_UCC_GETH=y
692# CONFIG_UGETH_MAGIC_PACKET is not set 719# CONFIG_UGETH_MAGIC_PACKET is not set
693# CONFIG_UGETH_TX_ON_DEMAND is not set 720# CONFIG_UGETH_TX_ON_DEMAND is not set
721# CONFIG_MV643XX_ETH is not set
694# CONFIG_QLA3XXX is not set 722# CONFIG_QLA3XXX is not set
695# CONFIG_ATL1 is not set 723# CONFIG_ATL1 is not set
696# CONFIG_ATL1E is not set 724# CONFIG_ATL1E is not set
@@ -868,13 +896,17 @@ CONFIG_I2C_MPC=y
868# CONFIG_SENSORS_PCF8574 is not set 896# CONFIG_SENSORS_PCF8574 is not set
869# CONFIG_PCF8575 is not set 897# CONFIG_PCF8575 is not set
870# CONFIG_SENSORS_PCA9539 is not set 898# CONFIG_SENSORS_PCA9539 is not set
871# CONFIG_SENSORS_MAX6875 is not set
872# CONFIG_SENSORS_TSL2550 is not set 899# CONFIG_SENSORS_TSL2550 is not set
873# CONFIG_I2C_DEBUG_CORE is not set 900# CONFIG_I2C_DEBUG_CORE is not set
874# CONFIG_I2C_DEBUG_ALGO is not set 901# CONFIG_I2C_DEBUG_ALGO is not set
875# CONFIG_I2C_DEBUG_BUS is not set 902# CONFIG_I2C_DEBUG_BUS is not set
876# CONFIG_I2C_DEBUG_CHIP is not set 903# CONFIG_I2C_DEBUG_CHIP is not set
877# CONFIG_SPI is not set 904# CONFIG_SPI is not set
905
906#
907# PPS support
908#
909# CONFIG_PPS is not set
878CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 910CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
879# CONFIG_GPIOLIB is not set 911# CONFIG_GPIOLIB is not set
880# CONFIG_W1 is not set 912# CONFIG_W1 is not set
@@ -929,6 +961,7 @@ CONFIG_HWMON=y
929# CONFIG_SENSORS_SMSC47B397 is not set 961# CONFIG_SENSORS_SMSC47B397 is not set
930# CONFIG_SENSORS_ADS7828 is not set 962# CONFIG_SENSORS_ADS7828 is not set
931# CONFIG_SENSORS_THMC50 is not set 963# CONFIG_SENSORS_THMC50 is not set
964# CONFIG_SENSORS_TMP401 is not set
932# CONFIG_SENSORS_VIA686A is not set 965# CONFIG_SENSORS_VIA686A is not set
933# CONFIG_SENSORS_VT1211 is not set 966# CONFIG_SENSORS_VT1211 is not set
934# CONFIG_SENSORS_VT8231 is not set 967# CONFIG_SENSORS_VT8231 is not set
@@ -977,23 +1010,9 @@ CONFIG_SSB_POSSIBLE=y
977# CONFIG_MFD_WM8400 is not set 1010# CONFIG_MFD_WM8400 is not set
978# CONFIG_MFD_WM8350_I2C is not set 1011# CONFIG_MFD_WM8350_I2C is not set
979# CONFIG_MFD_PCF50633 is not set 1012# CONFIG_MFD_PCF50633 is not set
1013# CONFIG_AB3100_CORE is not set
980# CONFIG_REGULATOR is not set 1014# CONFIG_REGULATOR is not set
981 1015# CONFIG_MEDIA_SUPPORT is not set
982#
983# Multimedia devices
984#
985
986#
987# Multimedia core support
988#
989# CONFIG_VIDEO_DEV is not set
990# CONFIG_DVB_CORE is not set
991# CONFIG_VIDEO_MEDIA is not set
992
993#
994# Multimedia drivers
995#
996CONFIG_DAB=y
997 1016
998# 1017#
999# Graphics support 1018# Graphics support
@@ -1077,6 +1096,7 @@ CONFIG_RTC_DRV_DS1374=y
1077# CONFIG_RTC_DRV_S35390A is not set 1096# CONFIG_RTC_DRV_S35390A is not set
1078# CONFIG_RTC_DRV_FM3130 is not set 1097# CONFIG_RTC_DRV_FM3130 is not set
1079# CONFIG_RTC_DRV_RX8581 is not set 1098# CONFIG_RTC_DRV_RX8581 is not set
1099# CONFIG_RTC_DRV_RX8025 is not set
1080 1100
1081# 1101#
1082# SPI RTC drivers 1102# SPI RTC drivers
@@ -1104,6 +1124,10 @@ CONFIG_RTC_DRV_DS1374=y
1104# CONFIG_DMADEVICES is not set 1124# CONFIG_DMADEVICES is not set
1105# CONFIG_AUXDISPLAY is not set 1125# CONFIG_AUXDISPLAY is not set
1106# CONFIG_UIO is not set 1126# CONFIG_UIO is not set
1127
1128#
1129# TI VLYNQ
1130#
1107# CONFIG_STAGING is not set 1131# CONFIG_STAGING is not set
1108 1132
1109# 1133#
@@ -1123,10 +1147,12 @@ CONFIG_FS_MBCACHE=y
1123# CONFIG_REISERFS_FS is not set 1147# CONFIG_REISERFS_FS is not set
1124# CONFIG_JFS_FS is not set 1148# CONFIG_JFS_FS is not set
1125# CONFIG_FS_POSIX_ACL is not set 1149# CONFIG_FS_POSIX_ACL is not set
1126CONFIG_FILE_LOCKING=y
1127# CONFIG_XFS_FS is not set 1150# CONFIG_XFS_FS is not set
1151# CONFIG_GFS2_FS is not set
1128# CONFIG_OCFS2_FS is not set 1152# CONFIG_OCFS2_FS is not set
1129# CONFIG_BTRFS_FS is not set 1153# CONFIG_BTRFS_FS is not set
1154CONFIG_FILE_LOCKING=y
1155CONFIG_FSNOTIFY=y
1130CONFIG_DNOTIFY=y 1156CONFIG_DNOTIFY=y
1131CONFIG_INOTIFY=y 1157CONFIG_INOTIFY=y
1132CONFIG_INOTIFY_USER=y 1158CONFIG_INOTIFY_USER=y
@@ -1190,6 +1216,7 @@ CONFIG_NFS_FS=y
1190CONFIG_NFS_V3=y 1216CONFIG_NFS_V3=y
1191# CONFIG_NFS_V3_ACL is not set 1217# CONFIG_NFS_V3_ACL is not set
1192CONFIG_NFS_V4=y 1218CONFIG_NFS_V4=y
1219# CONFIG_NFS_V4_1 is not set
1193CONFIG_ROOT_NFS=y 1220CONFIG_ROOT_NFS=y
1194# CONFIG_NFSD is not set 1221# CONFIG_NFSD is not set
1195CONFIG_LOCKD=y 1222CONFIG_LOCKD=y
@@ -1247,6 +1274,7 @@ CONFIG_HAS_IOPORT=y
1247CONFIG_HAS_DMA=y 1274CONFIG_HAS_DMA=y
1248CONFIG_HAVE_LMB=y 1275CONFIG_HAVE_LMB=y
1249CONFIG_NLATTR=y 1276CONFIG_NLATTR=y
1277CONFIG_GENERIC_ATOMIC64=y
1250 1278
1251# 1279#
1252# Kernel hacking 1280# Kernel hacking
@@ -1272,22 +1300,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1272CONFIG_HAVE_DYNAMIC_FTRACE=y 1300CONFIG_HAVE_DYNAMIC_FTRACE=y
1273CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1301CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1274CONFIG_TRACING_SUPPORT=y 1302CONFIG_TRACING_SUPPORT=y
1275 1303# CONFIG_FTRACE is not set
1276#
1277# Tracers
1278#
1279# CONFIG_FUNCTION_TRACER is not set
1280# CONFIG_SCHED_TRACER is not set
1281# CONFIG_CONTEXT_SWITCH_TRACER is not set
1282# CONFIG_EVENT_TRACER is not set
1283# CONFIG_BOOT_TRACER is not set
1284# CONFIG_TRACE_BRANCH_PROFILING is not set
1285# CONFIG_STACK_TRACER is not set
1286# CONFIG_KMEMTRACE is not set
1287# CONFIG_WORKQUEUE_TRACER is not set
1288# CONFIG_BLK_DEV_IO_TRACE is not set
1289# CONFIG_SAMPLES is not set 1304# CONFIG_SAMPLES is not set
1290CONFIG_HAVE_ARCH_KGDB=y 1305CONFIG_HAVE_ARCH_KGDB=y
1306# CONFIG_PPC_DISABLE_WERROR is not set
1307CONFIG_PPC_WERROR=y
1291CONFIG_PRINT_STACK_DEPTH=64 1308CONFIG_PRINT_STACK_DEPTH=64
1292# CONFIG_IRQSTACKS is not set 1309# CONFIG_IRQSTACKS is not set
1293# CONFIG_BOOTX_TEXT is not set 1310# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
index 7f1d1383a249..ff31667a890b 100644
--- a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:13 2009 4# Wed Jul 29 23:32:12 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44CONFIG_GENERIC_GPIO=y 47CONFIG_GENERIC_GPIO=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -54,12 +57,14 @@ CONFIG_PPC_UDBG_16550=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
58CONFIG_ARCH_SUSPEND_POSSIBLE=y 62CONFIG_ARCH_SUSPEND_POSSIBLE=y
59# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -108,7 +113,6 @@ CONFIG_ANON_INODES=y
108CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
110# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,9 +125,16 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
126CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
129CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_MPC836x_RDK=y
190# CONFIG_MPC837x_RDB is not set 205# CONFIG_MPC837x_RDB is not set
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192# CONFIG_ASP834x is not set 207# CONFIG_ASP834x is not set
208# CONFIG_KMETER1 is not set
193# CONFIG_PPC_86xx is not set 209# CONFIG_PPC_86xx is not set
194# CONFIG_EMBEDDED6xx is not set 210# CONFIG_EMBEDDED6xx is not set
195# CONFIG_AMIGAONE is not set 211# CONFIG_AMIGAONE is not set
@@ -233,6 +249,7 @@ CONFIG_BINFMT_ELF=y
233# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
234# CONFIG_BINFMT_MISC is not set 250# CONFIG_BINFMT_MISC is not set
235# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
236CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
237CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -253,9 +270,9 @@ CONFIG_MIGRATION=y
253CONFIG_ZONE_DMA_FLAG=1 270CONFIG_ZONE_DMA_FLAG=1
254CONFIG_BOUNCE=y 271CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y 272CONFIG_VIRT_TO_BUS=y
256CONFIG_UNEVICTABLE_LRU=y
257CONFIG_HAVE_MLOCK=y 273CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y 274CONFIG_HAVE_MLOCKED_PAGE_BIT=y
275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
259CONFIG_PPC_4K_PAGES=y 276CONFIG_PPC_4K_PAGES=y
260# CONFIG_PPC_16K_PAGES is not set 277# CONFIG_PPC_16K_PAGES is not set
261# CONFIG_PPC_64K_PAGES is not set 278# CONFIG_PPC_64K_PAGES is not set
@@ -366,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
369# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
370# CONFIG_DCB is not set 388# CONFIG_DCB is not set
371 389
@@ -383,7 +401,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 401CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 402# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 403# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 404
405#
406# CFG80211 needs to be enabled for MAC80211
407#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -498,6 +520,7 @@ CONFIG_OF_DEVICE=y
498CONFIG_OF_GPIO=y 520CONFIG_OF_GPIO=y
499CONFIG_OF_I2C=y 521CONFIG_OF_I2C=y
500CONFIG_OF_SPI=y 522CONFIG_OF_SPI=y
523CONFIG_OF_MDIO=y
501# CONFIG_PARPORT is not set 524# CONFIG_PARPORT is not set
502CONFIG_BLK_DEV=y 525CONFIG_BLK_DEV=y
503# CONFIG_BLK_DEV_FD is not set 526# CONFIG_BLK_DEV_FD is not set
@@ -533,7 +556,9 @@ CONFIG_MISC_DEVICES=y
533# CONFIG_EEPROM_AT24 is not set 556# CONFIG_EEPROM_AT24 is not set
534# CONFIG_EEPROM_AT25 is not set 557# CONFIG_EEPROM_AT25 is not set
535# CONFIG_EEPROM_LEGACY is not set 558# CONFIG_EEPROM_LEGACY is not set
559# CONFIG_EEPROM_MAX6875 is not set
536# CONFIG_EEPROM_93CX6 is not set 560# CONFIG_EEPROM_93CX6 is not set
561# CONFIG_CB710_CORE is not set
537CONFIG_HAVE_IDE=y 562CONFIG_HAVE_IDE=y
538# CONFIG_IDE is not set 563# CONFIG_IDE is not set
539 564
@@ -553,14 +578,17 @@ CONFIG_HAVE_IDE=y
553# 578#
554 579
555# 580#
556# Enable only one of the two stacks, unless you know what you are doing 581# You can enable one or both FireWire driver stacks.
582#
583
584#
585# See the help texts for more information.
557# 586#
558# CONFIG_FIREWIRE is not set 587# CONFIG_FIREWIRE is not set
559# CONFIG_IEEE1394 is not set 588# CONFIG_IEEE1394 is not set
560# CONFIG_I2O is not set 589# CONFIG_I2O is not set
561# CONFIG_MACINTOSH_DRIVERS is not set 590# CONFIG_MACINTOSH_DRIVERS is not set
562CONFIG_NETDEVICES=y 591CONFIG_NETDEVICES=y
563CONFIG_COMPAT_NET_DEV_OPS=y
564# CONFIG_DUMMY is not set 592# CONFIG_DUMMY is not set
565# CONFIG_BONDING is not set 593# CONFIG_BONDING is not set
566# CONFIG_MACVLAN is not set 594# CONFIG_MACVLAN is not set
@@ -607,11 +635,13 @@ CONFIG_NETDEV_1000=y
607# CONFIG_VIA_VELOCITY is not set 635# CONFIG_VIA_VELOCITY is not set
608# CONFIG_TIGON3 is not set 636# CONFIG_TIGON3 is not set
609# CONFIG_BNX2 is not set 637# CONFIG_BNX2 is not set
638# CONFIG_CNIC is not set
610CONFIG_FSL_PQ_MDIO=y 639CONFIG_FSL_PQ_MDIO=y
611# CONFIG_GIANFAR is not set 640# CONFIG_GIANFAR is not set
612CONFIG_UCC_GETH=y 641CONFIG_UCC_GETH=y
613# CONFIG_UGETH_MAGIC_PACKET is not set 642# CONFIG_UGETH_MAGIC_PACKET is not set
614# CONFIG_UGETH_TX_ON_DEMAND is not set 643# CONFIG_UGETH_TX_ON_DEMAND is not set
644# CONFIG_MV643XX_ETH is not set
615# CONFIG_QLA3XXX is not set 645# CONFIG_QLA3XXX is not set
616# CONFIG_ATL1 is not set 646# CONFIG_ATL1 is not set
617# CONFIG_ATL1E is not set 647# CONFIG_ATL1E is not set
@@ -777,7 +807,6 @@ CONFIG_I2C_MPC=y
777# CONFIG_SENSORS_PCF8574 is not set 807# CONFIG_SENSORS_PCF8574 is not set
778# CONFIG_PCF8575 is not set 808# CONFIG_PCF8575 is not set
779# CONFIG_SENSORS_PCA9539 is not set 809# CONFIG_SENSORS_PCA9539 is not set
780# CONFIG_SENSORS_MAX6875 is not set
781# CONFIG_SENSORS_TSL2550 is not set 810# CONFIG_SENSORS_TSL2550 is not set
782# CONFIG_I2C_DEBUG_CORE is not set 811# CONFIG_I2C_DEBUG_CORE is not set
783# CONFIG_I2C_DEBUG_ALGO is not set 812# CONFIG_I2C_DEBUG_ALGO is not set
@@ -791,13 +820,18 @@ CONFIG_SPI_MASTER=y
791# 820#
792CONFIG_SPI_BITBANG=y 821CONFIG_SPI_BITBANG=y
793# CONFIG_SPI_GPIO is not set 822# CONFIG_SPI_GPIO is not set
794CONFIG_SPI_MPC83xx=y 823# CONFIG_SPI_MPC8xxx is not set
795 824
796# 825#
797# SPI Protocol Masters 826# SPI Protocol Masters
798# 827#
799CONFIG_SPI_SPIDEV=y 828CONFIG_SPI_SPIDEV=y
800# CONFIG_SPI_TLE62X0 is not set 829# CONFIG_SPI_TLE62X0 is not set
830
831#
832# PPS support
833#
834# CONFIG_PPS is not set
801CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 835CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
802CONFIG_ARCH_REQUIRE_GPIOLIB=y 836CONFIG_ARCH_REQUIRE_GPIOLIB=y
803CONFIG_GPIOLIB=y 837CONFIG_GPIOLIB=y
@@ -865,23 +899,10 @@ CONFIG_SSB_POSSIBLE=y
865# CONFIG_MFD_WM8400 is not set 899# CONFIG_MFD_WM8400 is not set
866# CONFIG_MFD_WM8350_I2C is not set 900# CONFIG_MFD_WM8350_I2C is not set
867# CONFIG_MFD_PCF50633 is not set 901# CONFIG_MFD_PCF50633 is not set
902# CONFIG_AB3100_CORE is not set
903# CONFIG_EZX_PCAP is not set
868# CONFIG_REGULATOR is not set 904# CONFIG_REGULATOR is not set
869 905# CONFIG_MEDIA_SUPPORT is not set
870#
871# Multimedia devices
872#
873
874#
875# Multimedia core support
876#
877# CONFIG_VIDEO_DEV is not set
878# CONFIG_DVB_CORE is not set
879# CONFIG_VIDEO_MEDIA is not set
880
881#
882# Multimedia drivers
883#
884CONFIG_DAB=y
885 906
886# 907#
887# Graphics support 908# Graphics support
@@ -990,6 +1011,10 @@ CONFIG_HID=y
990# CONFIG_DMADEVICES is not set 1011# CONFIG_DMADEVICES is not set
991# CONFIG_AUXDISPLAY is not set 1012# CONFIG_AUXDISPLAY is not set
992# CONFIG_UIO is not set 1013# CONFIG_UIO is not set
1014
1015#
1016# TI VLYNQ
1017#
993# CONFIG_STAGING is not set 1018# CONFIG_STAGING is not set
994 1019
995# 1020#
@@ -1009,10 +1034,12 @@ CONFIG_FS_MBCACHE=y
1009# CONFIG_REISERFS_FS is not set 1034# CONFIG_REISERFS_FS is not set
1010# CONFIG_JFS_FS is not set 1035# CONFIG_JFS_FS is not set
1011# CONFIG_FS_POSIX_ACL is not set 1036# CONFIG_FS_POSIX_ACL is not set
1012CONFIG_FILE_LOCKING=y
1013# CONFIG_XFS_FS is not set 1037# CONFIG_XFS_FS is not set
1038# CONFIG_GFS2_FS is not set
1014# CONFIG_OCFS2_FS is not set 1039# CONFIG_OCFS2_FS is not set
1015# CONFIG_BTRFS_FS is not set 1040# CONFIG_BTRFS_FS is not set
1041CONFIG_FILE_LOCKING=y
1042CONFIG_FSNOTIFY=y
1016CONFIG_DNOTIFY=y 1043CONFIG_DNOTIFY=y
1017CONFIG_INOTIFY=y 1044CONFIG_INOTIFY=y
1018CONFIG_INOTIFY_USER=y 1045CONFIG_INOTIFY_USER=y
@@ -1086,6 +1113,7 @@ CONFIG_NFS_FS=y
1086CONFIG_NFS_V3=y 1113CONFIG_NFS_V3=y
1087# CONFIG_NFS_V3_ACL is not set 1114# CONFIG_NFS_V3_ACL is not set
1088CONFIG_NFS_V4=y 1115CONFIG_NFS_V4=y
1116# CONFIG_NFS_V4_1 is not set
1089CONFIG_ROOT_NFS=y 1117CONFIG_ROOT_NFS=y
1090# CONFIG_NFSD is not set 1118# CONFIG_NFSD is not set
1091CONFIG_LOCKD=y 1119CONFIG_LOCKD=y
@@ -1145,6 +1173,7 @@ CONFIG_HAS_IOPORT=y
1145CONFIG_HAS_DMA=y 1173CONFIG_HAS_DMA=y
1146CONFIG_HAVE_LMB=y 1174CONFIG_HAVE_LMB=y
1147CONFIG_NLATTR=y 1175CONFIG_NLATTR=y
1176CONFIG_GENERIC_ATOMIC64=y
1148 1177
1149# 1178#
1150# Kernel hacking 1179# Kernel hacking
@@ -1170,22 +1199,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1170CONFIG_HAVE_DYNAMIC_FTRACE=y 1199CONFIG_HAVE_DYNAMIC_FTRACE=y
1171CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1200CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1172CONFIG_TRACING_SUPPORT=y 1201CONFIG_TRACING_SUPPORT=y
1173 1202# CONFIG_FTRACE is not set
1174#
1175# Tracers
1176#
1177# CONFIG_FUNCTION_TRACER is not set
1178# CONFIG_SCHED_TRACER is not set
1179# CONFIG_CONTEXT_SWITCH_TRACER is not set
1180# CONFIG_EVENT_TRACER is not set
1181# CONFIG_BOOT_TRACER is not set
1182# CONFIG_TRACE_BRANCH_PROFILING is not set
1183# CONFIG_STACK_TRACER is not set
1184# CONFIG_KMEMTRACE is not set
1185# CONFIG_WORKQUEUE_TRACER is not set
1186# CONFIG_BLK_DEV_IO_TRACE is not set
1187# CONFIG_SAMPLES is not set 1203# CONFIG_SAMPLES is not set
1188CONFIG_HAVE_ARCH_KGDB=y 1204CONFIG_HAVE_ARCH_KGDB=y
1205# CONFIG_PPC_DISABLE_WERROR is not set
1206CONFIG_PPC_WERROR=y
1189CONFIG_PRINT_STACK_DEPTH=64 1207CONFIG_PRINT_STACK_DEPTH=64
1190# CONFIG_IRQSTACKS is not set 1208# CONFIG_IRQSTACKS is not set
1191# CONFIG_BOOTX_TEXT is not set 1209# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_mds_defconfig b/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
index bf636fd560ad..e285ec0fe958 100644
--- a/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:12 2009 4# Wed Jul 29 23:32:11 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -108,7 +113,6 @@ CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
110# CONFIG_KALLSYMS_EXTRA_PASS is not set 115# CONFIG_KALLSYMS_EXTRA_PASS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,8 +125,15 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127CONFIG_SLAB=y 138CONFIG_SLAB=y
128# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_MPC837x_MDS=y
190# CONFIG_MPC837x_RDB is not set 205# CONFIG_MPC837x_RDB is not set
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192# CONFIG_ASP834x is not set 207# CONFIG_ASP834x is not set
208# CONFIG_KMETER1 is not set
193CONFIG_PPC_MPC837x=y 209CONFIG_PPC_MPC837x=y
194# CONFIG_PPC_86xx is not set 210# CONFIG_PPC_86xx is not set
195# CONFIG_EMBEDDED6xx is not set 211# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -365,6 +382,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
365# CONFIG_ECONET is not set 382# CONFIG_ECONET is not set
366# CONFIG_WAN_ROUTER is not set 383# CONFIG_WAN_ROUTER is not set
367# CONFIG_PHONET is not set 384# CONFIG_PHONET is not set
385# CONFIG_IEEE802154 is not set
368# CONFIG_NET_SCHED is not set 386# CONFIG_NET_SCHED is not set
369# CONFIG_DCB is not set 387# CONFIG_DCB is not set
370 388
@@ -382,7 +400,11 @@ CONFIG_WIRELESS=y
382CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 410# CONFIG_NET_9P is not set
@@ -403,6 +425,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
403# CONFIG_MTD is not set 425# CONFIG_MTD is not set
404CONFIG_OF_DEVICE=y 426CONFIG_OF_DEVICE=y
405CONFIG_OF_I2C=y 427CONFIG_OF_I2C=y
428CONFIG_OF_MDIO=y
406# CONFIG_PARPORT is not set 429# CONFIG_PARPORT is not set
407CONFIG_BLK_DEV=y 430CONFIG_BLK_DEV=y
408# CONFIG_BLK_DEV_FD is not set 431# CONFIG_BLK_DEV_FD is not set
@@ -437,7 +460,9 @@ CONFIG_MISC_DEVICES=y
437# 460#
438# CONFIG_EEPROM_AT24 is not set 461# CONFIG_EEPROM_AT24 is not set
439# CONFIG_EEPROM_LEGACY is not set 462# CONFIG_EEPROM_LEGACY is not set
463# CONFIG_EEPROM_MAX6875 is not set
440# CONFIG_EEPROM_93CX6 is not set 464# CONFIG_EEPROM_93CX6 is not set
465# CONFIG_CB710_CORE is not set
441CONFIG_HAVE_IDE=y 466CONFIG_HAVE_IDE=y
442# CONFIG_IDE is not set 467# CONFIG_IDE is not set
443 468
@@ -460,10 +485,6 @@ CONFIG_BLK_DEV_SD=y
460# CONFIG_BLK_DEV_SR is not set 485# CONFIG_BLK_DEV_SR is not set
461CONFIG_CHR_DEV_SG=y 486CONFIG_CHR_DEV_SG=y
462# CONFIG_CHR_DEV_SCH is not set 487# CONFIG_CHR_DEV_SCH is not set
463
464#
465# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
466#
467# CONFIG_SCSI_MULTI_LUN is not set 488# CONFIG_SCSI_MULTI_LUN is not set
468# CONFIG_SCSI_CONSTANTS is not set 489# CONFIG_SCSI_CONSTANTS is not set
469# CONFIG_SCSI_LOGGING is not set 490# CONFIG_SCSI_LOGGING is not set
@@ -481,6 +502,7 @@ CONFIG_SCSI_WAIT_SCAN=m
481CONFIG_SCSI_LOWLEVEL=y 502CONFIG_SCSI_LOWLEVEL=y
482# CONFIG_ISCSI_TCP is not set 503# CONFIG_ISCSI_TCP is not set
483# CONFIG_SCSI_CXGB3_ISCSI is not set 504# CONFIG_SCSI_CXGB3_ISCSI is not set
505# CONFIG_SCSI_BNX2_ISCSI is not set
484# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 506# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
485# CONFIG_SCSI_3W_9XXX is not set 507# CONFIG_SCSI_3W_9XXX is not set
486# CONFIG_SCSI_ACARD is not set 508# CONFIG_SCSI_ACARD is not set
@@ -489,6 +511,7 @@ CONFIG_SCSI_LOWLEVEL=y
489# CONFIG_SCSI_AIC7XXX_OLD is not set 511# CONFIG_SCSI_AIC7XXX_OLD is not set
490# CONFIG_SCSI_AIC79XX is not set 512# CONFIG_SCSI_AIC79XX is not set
491# CONFIG_SCSI_AIC94XX is not set 513# CONFIG_SCSI_AIC94XX is not set
514# CONFIG_SCSI_MVSAS is not set
492# CONFIG_SCSI_DPT_I2O is not set 515# CONFIG_SCSI_DPT_I2O is not set
493# CONFIG_SCSI_ADVANSYS is not set 516# CONFIG_SCSI_ADVANSYS is not set
494# CONFIG_SCSI_ARCMSR is not set 517# CONFIG_SCSI_ARCMSR is not set
@@ -508,7 +531,6 @@ CONFIG_SCSI_LOWLEVEL=y
508# CONFIG_SCSI_IPS is not set 531# CONFIG_SCSI_IPS is not set
509# CONFIG_SCSI_INITIO is not set 532# CONFIG_SCSI_INITIO is not set
510# CONFIG_SCSI_INIA100 is not set 533# CONFIG_SCSI_INIA100 is not set
511# CONFIG_SCSI_MVSAS is not set
512# CONFIG_SCSI_STEX is not set 534# CONFIG_SCSI_STEX is not set
513# CONFIG_SCSI_SYM53C8XX_2 is not set 535# CONFIG_SCSI_SYM53C8XX_2 is not set
514# CONFIG_SCSI_IPR is not set 536# CONFIG_SCSI_IPR is not set
@@ -592,14 +614,17 @@ CONFIG_ATA_SFF=y
592# 614#
593 615
594# 616#
595# Enable only one of the two stacks, unless you know what you are doing 617# You can enable one or both FireWire driver stacks.
618#
619
620#
621# See the help texts for more information.
596# 622#
597# CONFIG_FIREWIRE is not set 623# CONFIG_FIREWIRE is not set
598# CONFIG_IEEE1394 is not set 624# CONFIG_IEEE1394 is not set
599# CONFIG_I2O is not set 625# CONFIG_I2O is not set
600# CONFIG_MACINTOSH_DRIVERS is not set 626# CONFIG_MACINTOSH_DRIVERS is not set
601CONFIG_NETDEVICES=y 627CONFIG_NETDEVICES=y
602CONFIG_COMPAT_NET_DEV_OPS=y
603# CONFIG_DUMMY is not set 628# CONFIG_DUMMY is not set
604# CONFIG_BONDING is not set 629# CONFIG_BONDING is not set
605# CONFIG_MACVLAN is not set 630# CONFIG_MACVLAN is not set
@@ -646,6 +671,7 @@ CONFIG_MII=y
646# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 671# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
647# CONFIG_NET_PCI is not set 672# CONFIG_NET_PCI is not set
648# CONFIG_B44 is not set 673# CONFIG_B44 is not set
674# CONFIG_KS8842 is not set
649# CONFIG_ATL2 is not set 675# CONFIG_ATL2 is not set
650CONFIG_NETDEV_1000=y 676CONFIG_NETDEV_1000=y
651# CONFIG_ACENIC is not set 677# CONFIG_ACENIC is not set
@@ -665,8 +691,10 @@ CONFIG_NETDEV_1000=y
665# CONFIG_VIA_VELOCITY is not set 691# CONFIG_VIA_VELOCITY is not set
666# CONFIG_TIGON3 is not set 692# CONFIG_TIGON3 is not set
667# CONFIG_BNX2 is not set 693# CONFIG_BNX2 is not set
694# CONFIG_CNIC is not set
668CONFIG_FSL_PQ_MDIO=y 695CONFIG_FSL_PQ_MDIO=y
669CONFIG_GIANFAR=y 696CONFIG_GIANFAR=y
697# CONFIG_MV643XX_ETH is not set
670# CONFIG_QLA3XXX is not set 698# CONFIG_QLA3XXX is not set
671# CONFIG_ATL1 is not set 699# CONFIG_ATL1 is not set
672# CONFIG_ATL1E is not set 700# CONFIG_ATL1E is not set
@@ -844,13 +872,17 @@ CONFIG_I2C_MPC=y
844# CONFIG_SENSORS_PCF8574 is not set 872# CONFIG_SENSORS_PCF8574 is not set
845# CONFIG_PCF8575 is not set 873# CONFIG_PCF8575 is not set
846# CONFIG_SENSORS_PCA9539 is not set 874# CONFIG_SENSORS_PCA9539 is not set
847# CONFIG_SENSORS_MAX6875 is not set
848# CONFIG_SENSORS_TSL2550 is not set 875# CONFIG_SENSORS_TSL2550 is not set
849# CONFIG_I2C_DEBUG_CORE is not set 876# CONFIG_I2C_DEBUG_CORE is not set
850# CONFIG_I2C_DEBUG_ALGO is not set 877# CONFIG_I2C_DEBUG_ALGO is not set
851# CONFIG_I2C_DEBUG_BUS is not set 878# CONFIG_I2C_DEBUG_BUS is not set
852# CONFIG_I2C_DEBUG_CHIP is not set 879# CONFIG_I2C_DEBUG_CHIP is not set
853# CONFIG_SPI is not set 880# CONFIG_SPI is not set
881
882#
883# PPS support
884#
885# CONFIG_PPS is not set
854CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 886CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
855# CONFIG_GPIOLIB is not set 887# CONFIG_GPIOLIB is not set
856# CONFIG_W1 is not set 888# CONFIG_W1 is not set
@@ -905,6 +937,7 @@ CONFIG_HWMON=y
905# CONFIG_SENSORS_SMSC47B397 is not set 937# CONFIG_SENSORS_SMSC47B397 is not set
906# CONFIG_SENSORS_ADS7828 is not set 938# CONFIG_SENSORS_ADS7828 is not set
907# CONFIG_SENSORS_THMC50 is not set 939# CONFIG_SENSORS_THMC50 is not set
940# CONFIG_SENSORS_TMP401 is not set
908# CONFIG_SENSORS_VIA686A is not set 941# CONFIG_SENSORS_VIA686A is not set
909# CONFIG_SENSORS_VT1211 is not set 942# CONFIG_SENSORS_VT1211 is not set
910# CONFIG_SENSORS_VT8231 is not set 943# CONFIG_SENSORS_VT8231 is not set
@@ -953,23 +986,9 @@ CONFIG_SSB_POSSIBLE=y
953# CONFIG_MFD_WM8400 is not set 986# CONFIG_MFD_WM8400 is not set
954# CONFIG_MFD_WM8350_I2C is not set 987# CONFIG_MFD_WM8350_I2C is not set
955# CONFIG_MFD_PCF50633 is not set 988# CONFIG_MFD_PCF50633 is not set
989# CONFIG_AB3100_CORE is not set
956# CONFIG_REGULATOR is not set 990# CONFIG_REGULATOR is not set
957 991# CONFIG_MEDIA_SUPPORT is not set
958#
959# Multimedia devices
960#
961
962#
963# Multimedia core support
964#
965# CONFIG_VIDEO_DEV is not set
966# CONFIG_DVB_CORE is not set
967# CONFIG_VIDEO_MEDIA is not set
968
969#
970# Multimedia drivers
971#
972CONFIG_DAB=y
973 992
974# 993#
975# Graphics support 994# Graphics support
@@ -1026,6 +1045,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1026# CONFIG_DMADEVICES is not set 1045# CONFIG_DMADEVICES is not set
1027# CONFIG_AUXDISPLAY is not set 1046# CONFIG_AUXDISPLAY is not set
1028# CONFIG_UIO is not set 1047# CONFIG_UIO is not set
1048
1049#
1050# TI VLYNQ
1051#
1029# CONFIG_STAGING is not set 1052# CONFIG_STAGING is not set
1030 1053
1031# 1054#
@@ -1045,10 +1068,12 @@ CONFIG_FS_MBCACHE=y
1045# CONFIG_REISERFS_FS is not set 1068# CONFIG_REISERFS_FS is not set
1046# CONFIG_JFS_FS is not set 1069# CONFIG_JFS_FS is not set
1047# CONFIG_FS_POSIX_ACL is not set 1070# CONFIG_FS_POSIX_ACL is not set
1048CONFIG_FILE_LOCKING=y
1049# CONFIG_XFS_FS is not set 1071# CONFIG_XFS_FS is not set
1072# CONFIG_GFS2_FS is not set
1050# CONFIG_OCFS2_FS is not set 1073# CONFIG_OCFS2_FS is not set
1051# CONFIG_BTRFS_FS is not set 1074# CONFIG_BTRFS_FS is not set
1075CONFIG_FILE_LOCKING=y
1076CONFIG_FSNOTIFY=y
1052CONFIG_DNOTIFY=y 1077CONFIG_DNOTIFY=y
1053CONFIG_INOTIFY=y 1078CONFIG_INOTIFY=y
1054CONFIG_INOTIFY_USER=y 1079CONFIG_INOTIFY_USER=y
@@ -1111,6 +1136,7 @@ CONFIG_NFS_FS=y
1111CONFIG_NFS_V3=y 1136CONFIG_NFS_V3=y
1112# CONFIG_NFS_V3_ACL is not set 1137# CONFIG_NFS_V3_ACL is not set
1113CONFIG_NFS_V4=y 1138CONFIG_NFS_V4=y
1139# CONFIG_NFS_V4_1 is not set
1114CONFIG_ROOT_NFS=y 1140CONFIG_ROOT_NFS=y
1115# CONFIG_NFSD is not set 1141# CONFIG_NFSD is not set
1116CONFIG_LOCKD=y 1142CONFIG_LOCKD=y
@@ -1170,6 +1196,7 @@ CONFIG_HAS_IOPORT=y
1170CONFIG_HAS_DMA=y 1196CONFIG_HAS_DMA=y
1171CONFIG_HAVE_LMB=y 1197CONFIG_HAVE_LMB=y
1172CONFIG_NLATTR=y 1198CONFIG_NLATTR=y
1199CONFIG_GENERIC_ATOMIC64=y
1173 1200
1174# 1201#
1175# Kernel hacking 1202# Kernel hacking
@@ -1193,22 +1220,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1193CONFIG_HAVE_DYNAMIC_FTRACE=y 1220CONFIG_HAVE_DYNAMIC_FTRACE=y
1194CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1221CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1195CONFIG_TRACING_SUPPORT=y 1222CONFIG_TRACING_SUPPORT=y
1196 1223# CONFIG_FTRACE is not set
1197#
1198# Tracers
1199#
1200# CONFIG_FUNCTION_TRACER is not set
1201# CONFIG_SCHED_TRACER is not set
1202# CONFIG_CONTEXT_SWITCH_TRACER is not set
1203# CONFIG_EVENT_TRACER is not set
1204# CONFIG_BOOT_TRACER is not set
1205# CONFIG_TRACE_BRANCH_PROFILING is not set
1206# CONFIG_STACK_TRACER is not set
1207# CONFIG_KMEMTRACE is not set
1208# CONFIG_WORKQUEUE_TRACER is not set
1209# CONFIG_BLK_DEV_IO_TRACE is not set
1210# CONFIG_SAMPLES is not set 1224# CONFIG_SAMPLES is not set
1211CONFIG_HAVE_ARCH_KGDB=y 1225CONFIG_HAVE_ARCH_KGDB=y
1226# CONFIG_PPC_DISABLE_WERROR is not set
1227CONFIG_PPC_WERROR=y
1212CONFIG_PRINT_STACK_DEPTH=64 1228CONFIG_PRINT_STACK_DEPTH=64
1213# CONFIG_IRQSTACKS is not set 1229# CONFIG_IRQSTACKS is not set
1214# CONFIG_BOOTX_TEXT is not set 1230# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
index fe6454eacbdb..1ab3e4cd3018 100644
--- a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:14 2009 4# Wed Jul 29 23:32:13 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -108,7 +113,6 @@ CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
110# CONFIG_KALLSYMS_EXTRA_PASS is not set 115# CONFIG_KALLSYMS_EXTRA_PASS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 117CONFIG_PRINTK=y
114CONFIG_BUG=y 118CONFIG_BUG=y
@@ -121,8 +125,15 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 126CONFIG_SHMEM=y
123CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
127CONFIG_SLAB=y 138CONFIG_SLAB=y
128# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -136,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
139# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -148,7 +163,7 @@ CONFIG_MODULE_UNLOAD=y
148# CONFIG_MODVERSIONS is not set 163# CONFIG_MODVERSIONS is not set
149# CONFIG_MODULE_SRCVERSION_ALL is not set 164# CONFIG_MODULE_SRCVERSION_ALL is not set
150CONFIG_BLOCK=y 165CONFIG_BLOCK=y
151# CONFIG_LBD is not set 166CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 167# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 168# CONFIG_BLK_DEV_INTEGRITY is not set
154 169
@@ -190,6 +205,7 @@ CONFIG_PPC_83xx=y
190CONFIG_MPC837x_RDB=y 205CONFIG_MPC837x_RDB=y
191# CONFIG_SBC834x is not set 206# CONFIG_SBC834x is not set
192# CONFIG_ASP834x is not set 207# CONFIG_ASP834x is not set
208# CONFIG_KMETER1 is not set
193CONFIG_PPC_MPC837x=y 209CONFIG_PPC_MPC837x=y
194# CONFIG_PPC_86xx is not set 210# CONFIG_PPC_86xx is not set
195# CONFIG_EMBEDDED6xx is not set 211# CONFIG_EMBEDDED6xx is not set
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -254,9 +271,9 @@ CONFIG_MIGRATION=y
254CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
255CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
262# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -360,6 +377,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
360# CONFIG_ECONET is not set 377# CONFIG_ECONET is not set
361# CONFIG_WAN_ROUTER is not set 378# CONFIG_WAN_ROUTER is not set
362# CONFIG_PHONET is not set 379# CONFIG_PHONET is not set
380# CONFIG_IEEE802154 is not set
363# CONFIG_NET_SCHED is not set 381# CONFIG_NET_SCHED is not set
364# CONFIG_DCB is not set 382# CONFIG_DCB is not set
365 383
@@ -377,7 +395,11 @@ CONFIG_WIRELESS=y
377CONFIG_WIRELESS_OLD_REGULATORY=y 395CONFIG_WIRELESS_OLD_REGULATORY=y
378# CONFIG_WIRELESS_EXT is not set 396# CONFIG_WIRELESS_EXT is not set
379# CONFIG_LIB80211 is not set 397# CONFIG_LIB80211 is not set
380# CONFIG_MAC80211 is not set 398
399#
400# CFG80211 needs to be enabled for MAC80211
401#
402CONFIG_MAC80211_DEFAULT_PS_VALUE=0
381# CONFIG_WIMAX is not set 403# CONFIG_WIMAX is not set
382# CONFIG_RFKILL is not set 404# CONFIG_RFKILL is not set
383# CONFIG_NET_9P is not set 405# CONFIG_NET_9P is not set
@@ -398,6 +420,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
398# CONFIG_MTD is not set 420# CONFIG_MTD is not set
399CONFIG_OF_DEVICE=y 421CONFIG_OF_DEVICE=y
400CONFIG_OF_I2C=y 422CONFIG_OF_I2C=y
423CONFIG_OF_MDIO=y
401# CONFIG_PARPORT is not set 424# CONFIG_PARPORT is not set
402CONFIG_BLK_DEV=y 425CONFIG_BLK_DEV=y
403# CONFIG_BLK_DEV_FD is not set 426# CONFIG_BLK_DEV_FD is not set
@@ -433,7 +456,9 @@ CONFIG_MISC_DEVICES=y
433# 456#
434# CONFIG_EEPROM_AT24 is not set 457# CONFIG_EEPROM_AT24 is not set
435# CONFIG_EEPROM_LEGACY is not set 458# CONFIG_EEPROM_LEGACY is not set
459# CONFIG_EEPROM_MAX6875 is not set
436# CONFIG_EEPROM_93CX6 is not set 460# CONFIG_EEPROM_93CX6 is not set
461# CONFIG_CB710_CORE is not set
437CONFIG_HAVE_IDE=y 462CONFIG_HAVE_IDE=y
438# CONFIG_IDE is not set 463# CONFIG_IDE is not set
439 464
@@ -456,10 +481,6 @@ CONFIG_BLK_DEV_SD=y
456# CONFIG_BLK_DEV_SR is not set 481# CONFIG_BLK_DEV_SR is not set
457CONFIG_CHR_DEV_SG=y 482CONFIG_CHR_DEV_SG=y
458# CONFIG_CHR_DEV_SCH is not set 483# CONFIG_CHR_DEV_SCH is not set
459
460#
461# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
462#
463# CONFIG_SCSI_MULTI_LUN is not set 484# CONFIG_SCSI_MULTI_LUN is not set
464# CONFIG_SCSI_CONSTANTS is not set 485# CONFIG_SCSI_CONSTANTS is not set
465# CONFIG_SCSI_LOGGING is not set 486# CONFIG_SCSI_LOGGING is not set
@@ -476,6 +497,7 @@ CONFIG_SCSI_WAIT_SCAN=m
476# CONFIG_SCSI_SRP_ATTRS is not set 497# CONFIG_SCSI_SRP_ATTRS is not set
477CONFIG_SCSI_LOWLEVEL=y 498CONFIG_SCSI_LOWLEVEL=y
478# CONFIG_ISCSI_TCP is not set 499# CONFIG_ISCSI_TCP is not set
500# CONFIG_SCSI_BNX2_ISCSI is not set
479# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 501# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
480# CONFIG_SCSI_3W_9XXX is not set 502# CONFIG_SCSI_3W_9XXX is not set
481# CONFIG_SCSI_ACARD is not set 503# CONFIG_SCSI_ACARD is not set
@@ -484,6 +506,7 @@ CONFIG_SCSI_LOWLEVEL=y
484# CONFIG_SCSI_AIC7XXX_OLD is not set 506# CONFIG_SCSI_AIC7XXX_OLD is not set
485# CONFIG_SCSI_AIC79XX is not set 507# CONFIG_SCSI_AIC79XX is not set
486# CONFIG_SCSI_AIC94XX is not set 508# CONFIG_SCSI_AIC94XX is not set
509# CONFIG_SCSI_MVSAS is not set
487# CONFIG_SCSI_DPT_I2O is not set 510# CONFIG_SCSI_DPT_I2O is not set
488# CONFIG_SCSI_ADVANSYS is not set 511# CONFIG_SCSI_ADVANSYS is not set
489# CONFIG_SCSI_ARCMSR is not set 512# CONFIG_SCSI_ARCMSR is not set
@@ -503,7 +526,6 @@ CONFIG_SCSI_LOWLEVEL=y
503# CONFIG_SCSI_IPS is not set 526# CONFIG_SCSI_IPS is not set
504# CONFIG_SCSI_INITIO is not set 527# CONFIG_SCSI_INITIO is not set
505# CONFIG_SCSI_INIA100 is not set 528# CONFIG_SCSI_INIA100 is not set
506# CONFIG_SCSI_MVSAS is not set
507# CONFIG_SCSI_STEX is not set 529# CONFIG_SCSI_STEX is not set
508# CONFIG_SCSI_SYM53C8XX_2 is not set 530# CONFIG_SCSI_SYM53C8XX_2 is not set
509# CONFIG_SCSI_IPR is not set 531# CONFIG_SCSI_IPR is not set
@@ -598,14 +620,17 @@ CONFIG_MD_RAID6_PQ=y
598# 620#
599 621
600# 622#
601# Enable only one of the two stacks, unless you know what you are doing 623# You can enable one or both FireWire driver stacks.
624#
625
626#
627# See the help texts for more information.
602# 628#
603# CONFIG_FIREWIRE is not set 629# CONFIG_FIREWIRE is not set
604# CONFIG_IEEE1394 is not set 630# CONFIG_IEEE1394 is not set
605# CONFIG_I2O is not set 631# CONFIG_I2O is not set
606# CONFIG_MACINTOSH_DRIVERS is not set 632# CONFIG_MACINTOSH_DRIVERS is not set
607CONFIG_NETDEVICES=y 633CONFIG_NETDEVICES=y
608CONFIG_COMPAT_NET_DEV_OPS=y
609# CONFIG_DUMMY is not set 634# CONFIG_DUMMY is not set
610# CONFIG_BONDING is not set 635# CONFIG_BONDING is not set
611# CONFIG_MACVLAN is not set 636# CONFIG_MACVLAN is not set
@@ -652,6 +677,7 @@ CONFIG_MII=y
652# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 677# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
653# CONFIG_NET_PCI is not set 678# CONFIG_NET_PCI is not set
654# CONFIG_B44 is not set 679# CONFIG_B44 is not set
680# CONFIG_KS8842 is not set
655# CONFIG_ATL2 is not set 681# CONFIG_ATL2 is not set
656CONFIG_NETDEV_1000=y 682CONFIG_NETDEV_1000=y
657# CONFIG_ACENIC is not set 683# CONFIG_ACENIC is not set
@@ -671,8 +697,10 @@ CONFIG_NETDEV_1000=y
671# CONFIG_VIA_VELOCITY is not set 697# CONFIG_VIA_VELOCITY is not set
672# CONFIG_TIGON3 is not set 698# CONFIG_TIGON3 is not set
673# CONFIG_BNX2 is not set 699# CONFIG_BNX2 is not set
700# CONFIG_CNIC is not set
674CONFIG_FSL_PQ_MDIO=y 701CONFIG_FSL_PQ_MDIO=y
675CONFIG_GIANFAR=y 702CONFIG_GIANFAR=y
703# CONFIG_MV643XX_ETH is not set
676# CONFIG_QLA3XXX is not set 704# CONFIG_QLA3XXX is not set
677# CONFIG_ATL1 is not set 705# CONFIG_ATL1 is not set
678# CONFIG_ATL1E is not set 706# CONFIG_ATL1E is not set
@@ -842,13 +870,17 @@ CONFIG_I2C_MPC=y
842# CONFIG_SENSORS_PCF8574 is not set 870# CONFIG_SENSORS_PCF8574 is not set
843# CONFIG_PCF8575 is not set 871# CONFIG_PCF8575 is not set
844# CONFIG_SENSORS_PCA9539 is not set 872# CONFIG_SENSORS_PCA9539 is not set
845# CONFIG_SENSORS_MAX6875 is not set
846# CONFIG_SENSORS_TSL2550 is not set 873# CONFIG_SENSORS_TSL2550 is not set
847# CONFIG_I2C_DEBUG_CORE is not set 874# CONFIG_I2C_DEBUG_CORE is not set
848# CONFIG_I2C_DEBUG_ALGO is not set 875# CONFIG_I2C_DEBUG_ALGO is not set
849# CONFIG_I2C_DEBUG_BUS is not set 876# CONFIG_I2C_DEBUG_BUS is not set
850# CONFIG_I2C_DEBUG_CHIP is not set 877# CONFIG_I2C_DEBUG_CHIP is not set
851# CONFIG_SPI is not set 878# CONFIG_SPI is not set
879
880#
881# PPS support
882#
883# CONFIG_PPS is not set
852CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 884CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
853# CONFIG_GPIOLIB is not set 885# CONFIG_GPIOLIB is not set
854# CONFIG_W1 is not set 886# CONFIG_W1 is not set
@@ -903,6 +935,7 @@ CONFIG_HWMON=y
903# CONFIG_SENSORS_SMSC47B397 is not set 935# CONFIG_SENSORS_SMSC47B397 is not set
904# CONFIG_SENSORS_ADS7828 is not set 936# CONFIG_SENSORS_ADS7828 is not set
905# CONFIG_SENSORS_THMC50 is not set 937# CONFIG_SENSORS_THMC50 is not set
938# CONFIG_SENSORS_TMP401 is not set
906# CONFIG_SENSORS_VIA686A is not set 939# CONFIG_SENSORS_VIA686A is not set
907# CONFIG_SENSORS_VT1211 is not set 940# CONFIG_SENSORS_VT1211 is not set
908# CONFIG_SENSORS_VT8231 is not set 941# CONFIG_SENSORS_VT8231 is not set
@@ -956,24 +989,9 @@ CONFIG_SSB_POSSIBLE=y
956# CONFIG_MFD_WM8400 is not set 989# CONFIG_MFD_WM8400 is not set
957# CONFIG_MFD_WM8350_I2C is not set 990# CONFIG_MFD_WM8350_I2C is not set
958# CONFIG_MFD_PCF50633 is not set 991# CONFIG_MFD_PCF50633 is not set
992# CONFIG_AB3100_CORE is not set
959# CONFIG_REGULATOR is not set 993# CONFIG_REGULATOR is not set
960 994# CONFIG_MEDIA_SUPPORT is not set
961#
962# Multimedia devices
963#
964
965#
966# Multimedia core support
967#
968# CONFIG_VIDEO_DEV is not set
969# CONFIG_DVB_CORE is not set
970# CONFIG_VIDEO_MEDIA is not set
971
972#
973# Multimedia drivers
974#
975CONFIG_DAB=y
976# CONFIG_USB_DABUSB is not set
977 995
978# 996#
979# Graphics support 997# Graphics support
@@ -1011,7 +1029,7 @@ CONFIG_HID_BELKIN=y
1011CONFIG_HID_CHERRY=y 1029CONFIG_HID_CHERRY=y
1012CONFIG_HID_CHICONY=y 1030CONFIG_HID_CHICONY=y
1013CONFIG_HID_CYPRESS=y 1031CONFIG_HID_CYPRESS=y
1014# CONFIG_DRAGONRISE_FF is not set 1032# CONFIG_HID_DRAGONRISE is not set
1015CONFIG_HID_EZKEY=y 1033CONFIG_HID_EZKEY=y
1016# CONFIG_HID_KYE is not set 1034# CONFIG_HID_KYE is not set
1017CONFIG_HID_GYRATION=y 1035CONFIG_HID_GYRATION=y
@@ -1028,10 +1046,11 @@ CONFIG_HID_PETALYNX=y
1028CONFIG_HID_SAMSUNG=y 1046CONFIG_HID_SAMSUNG=y
1029CONFIG_HID_SONY=y 1047CONFIG_HID_SONY=y
1030CONFIG_HID_SUNPLUS=y 1048CONFIG_HID_SUNPLUS=y
1031# CONFIG_GREENASIA_FF is not set 1049# CONFIG_HID_GREENASIA is not set
1050# CONFIG_HID_SMARTJOYPLUS is not set
1032# CONFIG_HID_TOPSEED is not set 1051# CONFIG_HID_TOPSEED is not set
1033CONFIG_THRUSTMASTER_FF=m 1052# CONFIG_HID_THRUSTMASTER is not set
1034CONFIG_ZEROPLUS_FF=m 1053# CONFIG_HID_ZEROPLUS is not set
1035CONFIG_USB_SUPPORT=y 1054CONFIG_USB_SUPPORT=y
1036CONFIG_USB_ARCH_HAS_HCD=y 1055CONFIG_USB_ARCH_HAS_HCD=y
1037CONFIG_USB_ARCH_HAS_OHCI=y 1056CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1057,6 +1076,7 @@ CONFIG_USB_MON=y
1057# USB Host Controller Drivers 1076# USB Host Controller Drivers
1058# 1077#
1059# CONFIG_USB_C67X00_HCD is not set 1078# CONFIG_USB_C67X00_HCD is not set
1079# CONFIG_USB_XHCI_HCD is not set
1060CONFIG_USB_EHCI_HCD=y 1080CONFIG_USB_EHCI_HCD=y
1061CONFIG_USB_EHCI_ROOT_HUB_TT=y 1081CONFIG_USB_EHCI_ROOT_HUB_TT=y
1062# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1082# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1141,6 +1161,10 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1141# CONFIG_DMADEVICES is not set 1161# CONFIG_DMADEVICES is not set
1142# CONFIG_AUXDISPLAY is not set 1162# CONFIG_AUXDISPLAY is not set
1143# CONFIG_UIO is not set 1163# CONFIG_UIO is not set
1164
1165#
1166# TI VLYNQ
1167#
1144# CONFIG_STAGING is not set 1168# CONFIG_STAGING is not set
1145 1169
1146# 1170#
@@ -1160,10 +1184,12 @@ CONFIG_FS_MBCACHE=y
1160# CONFIG_REISERFS_FS is not set 1184# CONFIG_REISERFS_FS is not set
1161# CONFIG_JFS_FS is not set 1185# CONFIG_JFS_FS is not set
1162# CONFIG_FS_POSIX_ACL is not set 1186# CONFIG_FS_POSIX_ACL is not set
1163CONFIG_FILE_LOCKING=y
1164# CONFIG_XFS_FS is not set 1187# CONFIG_XFS_FS is not set
1188# CONFIG_GFS2_FS is not set
1165# CONFIG_OCFS2_FS is not set 1189# CONFIG_OCFS2_FS is not set
1166# CONFIG_BTRFS_FS is not set 1190# CONFIG_BTRFS_FS is not set
1191CONFIG_FILE_LOCKING=y
1192CONFIG_FSNOTIFY=y
1167CONFIG_DNOTIFY=y 1193CONFIG_DNOTIFY=y
1168CONFIG_INOTIFY=y 1194CONFIG_INOTIFY=y
1169CONFIG_INOTIFY_USER=y 1195CONFIG_INOTIFY_USER=y
@@ -1226,6 +1252,7 @@ CONFIG_NFS_FS=y
1226CONFIG_NFS_V3=y 1252CONFIG_NFS_V3=y
1227# CONFIG_NFS_V3_ACL is not set 1253# CONFIG_NFS_V3_ACL is not set
1228CONFIG_NFS_V4=y 1254CONFIG_NFS_V4=y
1255# CONFIG_NFS_V4_1 is not set
1229CONFIG_ROOT_NFS=y 1256CONFIG_ROOT_NFS=y
1230# CONFIG_NFSD is not set 1257# CONFIG_NFSD is not set
1231CONFIG_LOCKD=y 1258CONFIG_LOCKD=y
@@ -1262,7 +1289,46 @@ CONFIG_MSDOS_PARTITION=y
1262# CONFIG_KARMA_PARTITION is not set 1289# CONFIG_KARMA_PARTITION is not set
1263# CONFIG_EFI_PARTITION is not set 1290# CONFIG_EFI_PARTITION is not set
1264# CONFIG_SYSV68_PARTITION is not set 1291# CONFIG_SYSV68_PARTITION is not set
1265# CONFIG_NLS is not set 1292CONFIG_NLS=y
1293CONFIG_NLS_DEFAULT="iso8859-1"
1294# CONFIG_NLS_CODEPAGE_437 is not set
1295# CONFIG_NLS_CODEPAGE_737 is not set
1296# CONFIG_NLS_CODEPAGE_775 is not set
1297# CONFIG_NLS_CODEPAGE_850 is not set
1298# CONFIG_NLS_CODEPAGE_852 is not set
1299# CONFIG_NLS_CODEPAGE_855 is not set
1300# CONFIG_NLS_CODEPAGE_857 is not set
1301# CONFIG_NLS_CODEPAGE_860 is not set
1302# CONFIG_NLS_CODEPAGE_861 is not set
1303# CONFIG_NLS_CODEPAGE_862 is not set
1304# CONFIG_NLS_CODEPAGE_863 is not set
1305# CONFIG_NLS_CODEPAGE_864 is not set
1306# CONFIG_NLS_CODEPAGE_865 is not set
1307# CONFIG_NLS_CODEPAGE_866 is not set
1308# CONFIG_NLS_CODEPAGE_869 is not set
1309# CONFIG_NLS_CODEPAGE_936 is not set
1310# CONFIG_NLS_CODEPAGE_950 is not set
1311# CONFIG_NLS_CODEPAGE_932 is not set
1312# CONFIG_NLS_CODEPAGE_949 is not set
1313# CONFIG_NLS_CODEPAGE_874 is not set
1314# CONFIG_NLS_ISO8859_8 is not set
1315# CONFIG_NLS_CODEPAGE_1250 is not set
1316# CONFIG_NLS_CODEPAGE_1251 is not set
1317# CONFIG_NLS_ASCII is not set
1318# CONFIG_NLS_ISO8859_1 is not set
1319# CONFIG_NLS_ISO8859_2 is not set
1320# CONFIG_NLS_ISO8859_3 is not set
1321# CONFIG_NLS_ISO8859_4 is not set
1322# CONFIG_NLS_ISO8859_5 is not set
1323# CONFIG_NLS_ISO8859_6 is not set
1324# CONFIG_NLS_ISO8859_7 is not set
1325# CONFIG_NLS_ISO8859_9 is not set
1326# CONFIG_NLS_ISO8859_13 is not set
1327# CONFIG_NLS_ISO8859_14 is not set
1328# CONFIG_NLS_ISO8859_15 is not set
1329# CONFIG_NLS_KOI8_R is not set
1330# CONFIG_NLS_KOI8_U is not set
1331# CONFIG_NLS_UTF8 is not set
1266# CONFIG_DLM is not set 1332# CONFIG_DLM is not set
1267# CONFIG_BINARY_PRINTF is not set 1333# CONFIG_BINARY_PRINTF is not set
1268 1334
@@ -1285,6 +1351,7 @@ CONFIG_HAS_IOPORT=y
1285CONFIG_HAS_DMA=y 1351CONFIG_HAS_DMA=y
1286CONFIG_HAVE_LMB=y 1352CONFIG_HAVE_LMB=y
1287CONFIG_NLATTR=y 1353CONFIG_NLATTR=y
1354CONFIG_GENERIC_ATOMIC64=y
1288 1355
1289# 1356#
1290# Kernel hacking 1357# Kernel hacking
@@ -1308,22 +1375,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1308CONFIG_HAVE_DYNAMIC_FTRACE=y 1375CONFIG_HAVE_DYNAMIC_FTRACE=y
1309CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1376CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1310CONFIG_TRACING_SUPPORT=y 1377CONFIG_TRACING_SUPPORT=y
1311 1378# CONFIG_FTRACE is not set
1312#
1313# Tracers
1314#
1315# CONFIG_FUNCTION_TRACER is not set
1316# CONFIG_SCHED_TRACER is not set
1317# CONFIG_CONTEXT_SWITCH_TRACER is not set
1318# CONFIG_EVENT_TRACER is not set
1319# CONFIG_BOOT_TRACER is not set
1320# CONFIG_TRACE_BRANCH_PROFILING is not set
1321# CONFIG_STACK_TRACER is not set
1322# CONFIG_KMEMTRACE is not set
1323# CONFIG_WORKQUEUE_TRACER is not set
1324# CONFIG_BLK_DEV_IO_TRACE is not set
1325# CONFIG_SAMPLES is not set 1379# CONFIG_SAMPLES is not set
1326CONFIG_HAVE_ARCH_KGDB=y 1380CONFIG_HAVE_ARCH_KGDB=y
1381# CONFIG_PPC_DISABLE_WERROR is not set
1382CONFIG_PPC_WERROR=y
1327CONFIG_PRINT_STACK_DEPTH=64 1383CONFIG_PRINT_STACK_DEPTH=64
1328# CONFIG_IRQSTACKS is not set 1384# CONFIG_IRQSTACKS is not set
1329# CONFIG_BOOTX_TEXT is not set 1385# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/83xx/sbc834x_defconfig b/arch/powerpc/configs/83xx/sbc834x_defconfig
index fe08f672cb27..a592b5efdc4d 100644
--- a/arch/powerpc/configs/83xx/sbc834x_defconfig
+++ b/arch/powerpc/configs/83xx/sbc834x_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:15 2009 4# Wed Jul 29 23:32:13 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,12 +56,14 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57CONFIG_ARCH_SUSPEND_POSSIBLE=y 61CONFIG_ARCH_SUSPEND_POSSIBLE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -107,7 +112,6 @@ CONFIG_ANON_INODES=y
107CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
108CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
109# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
110# CONFIG_STRIP_ASM_SYMS is not set
111CONFIG_HOTPLUG=y 115CONFIG_HOTPLUG=y
112CONFIG_PRINTK=y 116CONFIG_PRINTK=y
113CONFIG_BUG=y 117CONFIG_BUG=y
@@ -120,8 +124,15 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 125CONFIG_SHMEM=y
122CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
123CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
124CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
135# CONFIG_STRIP_ASM_SYMS is not set
125CONFIG_COMPAT_BRK=y 136CONFIG_COMPAT_BRK=y
126CONFIG_SLAB=y 137CONFIG_SLAB=y
127# CONFIG_SLUB is not set 138# CONFIG_SLUB is not set
@@ -134,6 +145,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y 145CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y 146CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y 147CONFIG_HAVE_ARCH_TRACEHOOK=y
148
149#
150# GCOV-based kernel profiling
151#
137# CONFIG_SLOW_WORK is not set 152# CONFIG_SLOW_WORK is not set
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
@@ -146,7 +161,7 @@ CONFIG_MODULE_UNLOAD=y
146# CONFIG_MODVERSIONS is not set 161# CONFIG_MODVERSIONS is not set
147# CONFIG_MODULE_SRCVERSION_ALL is not set 162# CONFIG_MODULE_SRCVERSION_ALL is not set
148CONFIG_BLOCK=y 163CONFIG_BLOCK=y
149# CONFIG_LBD is not set 164CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
152 167
@@ -188,6 +203,7 @@ CONFIG_PPC_83xx=y
188# CONFIG_MPC837x_RDB is not set 203# CONFIG_MPC837x_RDB is not set
189CONFIG_SBC834x=y 204CONFIG_SBC834x=y
190# CONFIG_ASP834x is not set 205# CONFIG_ASP834x is not set
206# CONFIG_KMETER1 is not set
191CONFIG_PPC_MPC834x=y 207CONFIG_PPC_MPC834x=y
192# CONFIG_PPC_86xx is not set 208# CONFIG_PPC_86xx is not set
193# CONFIG_EMBEDDED6xx is not set 209# CONFIG_EMBEDDED6xx is not set
@@ -232,6 +248,7 @@ CONFIG_BINFMT_ELF=y
232# CONFIG_HAVE_AOUT is not set 248# CONFIG_HAVE_AOUT is not set
233# CONFIG_BINFMT_MISC is not set 249# CONFIG_BINFMT_MISC is not set
234# CONFIG_IOMMU_HELPER is not set 250# CONFIG_IOMMU_HELPER is not set
251# CONFIG_SWIOTLB is not set
235CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
236CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
237CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +269,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 269CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 270CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 271CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 272CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 273CONFIG_HAVE_MLOCKED_PAGE_BIT=y
274CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 275CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 276# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 277# CONFIG_PPC_64K_PAGES is not set
@@ -363,6 +380,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
363# CONFIG_ECONET is not set 380# CONFIG_ECONET is not set
364# CONFIG_WAN_ROUTER is not set 381# CONFIG_WAN_ROUTER is not set
365# CONFIG_PHONET is not set 382# CONFIG_PHONET is not set
383# CONFIG_IEEE802154 is not set
366# CONFIG_NET_SCHED is not set 384# CONFIG_NET_SCHED is not set
367# CONFIG_DCB is not set 385# CONFIG_DCB is not set
368 386
@@ -380,7 +398,11 @@ CONFIG_WIRELESS=y
380CONFIG_WIRELESS_OLD_REGULATORY=y 398CONFIG_WIRELESS_OLD_REGULATORY=y
381# CONFIG_WIRELESS_EXT is not set 399# CONFIG_WIRELESS_EXT is not set
382# CONFIG_LIB80211 is not set 400# CONFIG_LIB80211 is not set
383# CONFIG_MAC80211 is not set 401
402#
403# CFG80211 needs to be enabled for MAC80211
404#
405CONFIG_MAC80211_DEFAULT_PS_VALUE=0
384# CONFIG_WIMAX is not set 406# CONFIG_WIMAX is not set
385# CONFIG_RFKILL is not set 407# CONFIG_RFKILL is not set
386# CONFIG_NET_9P is not set 408# CONFIG_NET_9P is not set
@@ -401,6 +423,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
401# CONFIG_MTD is not set 423# CONFIG_MTD is not set
402CONFIG_OF_DEVICE=y 424CONFIG_OF_DEVICE=y
403CONFIG_OF_I2C=y 425CONFIG_OF_I2C=y
426CONFIG_OF_MDIO=y
404# CONFIG_PARPORT is not set 427# CONFIG_PARPORT is not set
405CONFIG_BLK_DEV=y 428CONFIG_BLK_DEV=y
406# CONFIG_BLK_DEV_FD is not set 429# CONFIG_BLK_DEV_FD is not set
@@ -435,7 +458,9 @@ CONFIG_MISC_DEVICES=y
435# 458#
436# CONFIG_EEPROM_AT24 is not set 459# CONFIG_EEPROM_AT24 is not set
437# CONFIG_EEPROM_LEGACY is not set 460# CONFIG_EEPROM_LEGACY is not set
461# CONFIG_EEPROM_MAX6875 is not set
438# CONFIG_EEPROM_93CX6 is not set 462# CONFIG_EEPROM_93CX6 is not set
463# CONFIG_CB710_CORE is not set
439CONFIG_HAVE_IDE=y 464CONFIG_HAVE_IDE=y
440# CONFIG_IDE is not set 465# CONFIG_IDE is not set
441 466
@@ -455,14 +480,17 @@ CONFIG_HAVE_IDE=y
455# 480#
456 481
457# 482#
458# Enable only one of the two stacks, unless you know what you are doing 483# You can enable one or both FireWire driver stacks.
484#
485
486#
487# See the help texts for more information.
459# 488#
460# CONFIG_FIREWIRE is not set 489# CONFIG_FIREWIRE is not set
461# CONFIG_IEEE1394 is not set 490# CONFIG_IEEE1394 is not set
462# CONFIG_I2O is not set 491# CONFIG_I2O is not set
463# CONFIG_MACINTOSH_DRIVERS is not set 492# CONFIG_MACINTOSH_DRIVERS is not set
464CONFIG_NETDEVICES=y 493CONFIG_NETDEVICES=y
465CONFIG_COMPAT_NET_DEV_OPS=y
466# CONFIG_DUMMY is not set 494# CONFIG_DUMMY is not set
467# CONFIG_BONDING is not set 495# CONFIG_BONDING is not set
468# CONFIG_MACVLAN is not set 496# CONFIG_MACVLAN is not set
@@ -509,6 +537,7 @@ CONFIG_MII=y
509# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 537# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
510# CONFIG_NET_PCI is not set 538# CONFIG_NET_PCI is not set
511# CONFIG_B44 is not set 539# CONFIG_B44 is not set
540# CONFIG_KS8842 is not set
512# CONFIG_ATL2 is not set 541# CONFIG_ATL2 is not set
513CONFIG_NETDEV_1000=y 542CONFIG_NETDEV_1000=y
514# CONFIG_ACENIC is not set 543# CONFIG_ACENIC is not set
@@ -528,8 +557,10 @@ CONFIG_NETDEV_1000=y
528# CONFIG_VIA_VELOCITY is not set 557# CONFIG_VIA_VELOCITY is not set
529# CONFIG_TIGON3 is not set 558# CONFIG_TIGON3 is not set
530# CONFIG_BNX2 is not set 559# CONFIG_BNX2 is not set
560# CONFIG_CNIC is not set
531CONFIG_FSL_PQ_MDIO=y 561CONFIG_FSL_PQ_MDIO=y
532CONFIG_GIANFAR=y 562CONFIG_GIANFAR=y
563# CONFIG_MV643XX_ETH is not set
533# CONFIG_QLA3XXX is not set 564# CONFIG_QLA3XXX is not set
534# CONFIG_ATL1 is not set 565# CONFIG_ATL1 is not set
535# CONFIG_ATL1E is not set 566# CONFIG_ATL1E is not set
@@ -688,13 +719,17 @@ CONFIG_I2C_MPC=y
688# CONFIG_SENSORS_PCF8574 is not set 719# CONFIG_SENSORS_PCF8574 is not set
689# CONFIG_PCF8575 is not set 720# CONFIG_PCF8575 is not set
690# CONFIG_SENSORS_PCA9539 is not set 721# CONFIG_SENSORS_PCA9539 is not set
691# CONFIG_SENSORS_MAX6875 is not set
692# CONFIG_SENSORS_TSL2550 is not set 722# CONFIG_SENSORS_TSL2550 is not set
693# CONFIG_I2C_DEBUG_CORE is not set 723# CONFIG_I2C_DEBUG_CORE is not set
694# CONFIG_I2C_DEBUG_ALGO is not set 724# CONFIG_I2C_DEBUG_ALGO is not set
695# CONFIG_I2C_DEBUG_BUS is not set 725# CONFIG_I2C_DEBUG_BUS is not set
696# CONFIG_I2C_DEBUG_CHIP is not set 726# CONFIG_I2C_DEBUG_CHIP is not set
697# CONFIG_SPI is not set 727# CONFIG_SPI is not set
728
729#
730# PPS support
731#
732# CONFIG_PPS is not set
698CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 733CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
699# CONFIG_GPIOLIB is not set 734# CONFIG_GPIOLIB is not set
700# CONFIG_W1 is not set 735# CONFIG_W1 is not set
@@ -749,6 +784,7 @@ CONFIG_HWMON=y
749# CONFIG_SENSORS_SMSC47B397 is not set 784# CONFIG_SENSORS_SMSC47B397 is not set
750# CONFIG_SENSORS_ADS7828 is not set 785# CONFIG_SENSORS_ADS7828 is not set
751# CONFIG_SENSORS_THMC50 is not set 786# CONFIG_SENSORS_THMC50 is not set
787# CONFIG_SENSORS_TMP401 is not set
752# CONFIG_SENSORS_VIA686A is not set 788# CONFIG_SENSORS_VIA686A is not set
753# CONFIG_SENSORS_VT1211 is not set 789# CONFIG_SENSORS_VT1211 is not set
754# CONFIG_SENSORS_VT8231 is not set 790# CONFIG_SENSORS_VT8231 is not set
@@ -797,23 +833,9 @@ CONFIG_SSB_POSSIBLE=y
797# CONFIG_MFD_WM8400 is not set 833# CONFIG_MFD_WM8400 is not set
798# CONFIG_MFD_WM8350_I2C is not set 834# CONFIG_MFD_WM8350_I2C is not set
799# CONFIG_MFD_PCF50633 is not set 835# CONFIG_MFD_PCF50633 is not set
836# CONFIG_AB3100_CORE is not set
800# CONFIG_REGULATOR is not set 837# CONFIG_REGULATOR is not set
801 838# CONFIG_MEDIA_SUPPORT is not set
802#
803# Multimedia devices
804#
805
806#
807# Multimedia core support
808#
809# CONFIG_VIDEO_DEV is not set
810# CONFIG_DVB_CORE is not set
811# CONFIG_VIDEO_MEDIA is not set
812
813#
814# Multimedia drivers
815#
816# CONFIG_DAB is not set
817 839
818# 840#
819# Graphics support 841# Graphics support
@@ -851,6 +873,10 @@ CONFIG_HID=y
851# CONFIG_DMADEVICES is not set 873# CONFIG_DMADEVICES is not set
852# CONFIG_AUXDISPLAY is not set 874# CONFIG_AUXDISPLAY is not set
853# CONFIG_UIO is not set 875# CONFIG_UIO is not set
876
877#
878# TI VLYNQ
879#
854# CONFIG_STAGING is not set 880# CONFIG_STAGING is not set
855 881
856# 882#
@@ -862,10 +888,12 @@ CONFIG_HID=y
862# CONFIG_REISERFS_FS is not set 888# CONFIG_REISERFS_FS is not set
863# CONFIG_JFS_FS is not set 889# CONFIG_JFS_FS is not set
864# CONFIG_FS_POSIX_ACL is not set 890# CONFIG_FS_POSIX_ACL is not set
865CONFIG_FILE_LOCKING=y
866# CONFIG_XFS_FS is not set 891# CONFIG_XFS_FS is not set
892# CONFIG_GFS2_FS is not set
867# CONFIG_OCFS2_FS is not set 893# CONFIG_OCFS2_FS is not set
868# CONFIG_BTRFS_FS is not set 894# CONFIG_BTRFS_FS is not set
895CONFIG_FILE_LOCKING=y
896CONFIG_FSNOTIFY=y
869CONFIG_DNOTIFY=y 897CONFIG_DNOTIFY=y
870CONFIG_INOTIFY=y 898CONFIG_INOTIFY=y
871CONFIG_INOTIFY_USER=y 899CONFIG_INOTIFY_USER=y
@@ -928,6 +956,7 @@ CONFIG_NFS_FS=y
928CONFIG_NFS_V3=y 956CONFIG_NFS_V3=y
929# CONFIG_NFS_V3_ACL is not set 957# CONFIG_NFS_V3_ACL is not set
930CONFIG_NFS_V4=y 958CONFIG_NFS_V4=y
959# CONFIG_NFS_V4_1 is not set
931CONFIG_ROOT_NFS=y 960CONFIG_ROOT_NFS=y
932# CONFIG_NFSD is not set 961# CONFIG_NFSD is not set
933CONFIG_LOCKD=y 962CONFIG_LOCKD=y
@@ -971,6 +1000,7 @@ CONFIG_HAS_IOPORT=y
971CONFIG_HAS_DMA=y 1000CONFIG_HAS_DMA=y
972CONFIG_HAVE_LMB=y 1001CONFIG_HAVE_LMB=y
973CONFIG_NLATTR=y 1002CONFIG_NLATTR=y
1003CONFIG_GENERIC_ATOMIC64=y
974 1004
975# 1005#
976# Kernel hacking 1006# Kernel hacking
@@ -994,22 +1024,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
994CONFIG_HAVE_DYNAMIC_FTRACE=y 1024CONFIG_HAVE_DYNAMIC_FTRACE=y
995CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1025CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
996CONFIG_TRACING_SUPPORT=y 1026CONFIG_TRACING_SUPPORT=y
997 1027# CONFIG_FTRACE is not set
998#
999# Tracers
1000#
1001# CONFIG_FUNCTION_TRACER is not set
1002# CONFIG_SCHED_TRACER is not set
1003# CONFIG_CONTEXT_SWITCH_TRACER is not set
1004# CONFIG_EVENT_TRACER is not set
1005# CONFIG_BOOT_TRACER is not set
1006# CONFIG_TRACE_BRANCH_PROFILING is not set
1007# CONFIG_STACK_TRACER is not set
1008# CONFIG_KMEMTRACE is not set
1009# CONFIG_WORKQUEUE_TRACER is not set
1010# CONFIG_BLK_DEV_IO_TRACE is not set
1011# CONFIG_SAMPLES is not set 1028# CONFIG_SAMPLES is not set
1012CONFIG_HAVE_ARCH_KGDB=y 1029CONFIG_HAVE_ARCH_KGDB=y
1030# CONFIG_PPC_DISABLE_WERROR is not set
1031CONFIG_PPC_WERROR=y
1013CONFIG_PRINT_STACK_DEPTH=64 1032CONFIG_PRINT_STACK_DEPTH=64
1014# CONFIG_IRQSTACKS is not set 1033# CONFIG_IRQSTACKS is not set
1015# CONFIG_BOOTX_TEXT is not set 1034# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/85xx/ksi8560_defconfig b/arch/powerpc/configs/85xx/ksi8560_defconfig
index 09146ddaa3ca..ff04e1028f5e 100644
--- a/arch/powerpc/configs/85xx/ksi8560_defconfig
+++ b/arch/powerpc/configs/85xx/ksi8560_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:16 2009 4# Wed Jul 29 23:32:14 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -108,7 +111,6 @@ CONFIG_SYSCTL_SYSCALL=y
108CONFIG_KALLSYMS=y 111CONFIG_KALLSYMS=y
109# CONFIG_KALLSYMS_ALL is not set 112# CONFIG_KALLSYMS_ALL is not set
110# CONFIG_KALLSYMS_EXTRA_PASS is not set 113# CONFIG_KALLSYMS_EXTRA_PASS is not set
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 114CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 115CONFIG_PRINTK=y
114CONFIG_BUG=y 116CONFIG_BUG=y
@@ -121,8 +123,15 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 123CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 124CONFIG_SHMEM=y
123CONFIG_AIO=y 125CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y
127
128#
129# Performance Counters
130#
131# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_SLUB_DEBUG=y 133CONFIG_SLUB_DEBUG=y
134# CONFIG_STRIP_ASM_SYMS is not set
126CONFIG_COMPAT_BRK=y 135CONFIG_COMPAT_BRK=y
127# CONFIG_SLAB is not set 136# CONFIG_SLAB is not set
128CONFIG_SLUB=y 137CONFIG_SLUB=y
@@ -136,6 +145,11 @@ CONFIG_HAVE_KPROBES=y
136CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
137CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
138CONFIG_HAVE_CLK=y 147CONFIG_HAVE_CLK=y
148
149#
150# GCOV-based kernel profiling
151#
152# CONFIG_GCOV_KERNEL is not set
139# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
140# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
141CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -143,7 +157,7 @@ CONFIG_RT_MUTEXES=y
143CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
144# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
145CONFIG_BLOCK=y 159CONFIG_BLOCK=y
146# CONFIG_LBD is not set 160CONFIG_LBDAF=y
147# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
148# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
149 163
@@ -176,6 +190,7 @@ CONFIG_MPC85xx=y
176# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
177# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
178CONFIG_KSI8560=y 192CONFIG_KSI8560=y
193# CONFIG_XES_MPC85xx is not set
179# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
180# CONFIG_TQM8540 is not set 195# CONFIG_TQM8540 is not set
181# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -224,6 +239,7 @@ CONFIG_BINFMT_ELF=y
224CONFIG_BINFMT_MISC=y 239CONFIG_BINFMT_MISC=y
225CONFIG_MATH_EMULATION=y 240CONFIG_MATH_EMULATION=y
226# CONFIG_IOMMU_HELPER is not set 241# CONFIG_IOMMU_HELPER is not set
242# CONFIG_SWIOTLB is not set
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
228CONFIG_ARCH_HAS_WALK_MEMORY=y 244CONFIG_ARCH_HAS_WALK_MEMORY=y
229CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +258,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 258CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 259CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 266# CONFIG_PPC_64K_PAGES is not set
@@ -346,6 +362,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
346# CONFIG_ECONET is not set 362# CONFIG_ECONET is not set
347# CONFIG_WAN_ROUTER is not set 363# CONFIG_WAN_ROUTER is not set
348# CONFIG_PHONET is not set 364# CONFIG_PHONET is not set
365# CONFIG_IEEE802154 is not set
349# CONFIG_NET_SCHED is not set 366# CONFIG_NET_SCHED is not set
350# CONFIG_DCB is not set 367# CONFIG_DCB is not set
351 368
@@ -363,7 +380,11 @@ CONFIG_WIRELESS=y
363CONFIG_WIRELESS_OLD_REGULATORY=y 380CONFIG_WIRELESS_OLD_REGULATORY=y
364# CONFIG_WIRELESS_EXT is not set 381# CONFIG_WIRELESS_EXT is not set
365# CONFIG_LIB80211 is not set 382# CONFIG_LIB80211 is not set
366# CONFIG_MAC80211 is not set 383
384#
385# CFG80211 needs to be enabled for MAC80211
386#
387CONFIG_MAC80211_DEFAULT_PS_VALUE=0
367# CONFIG_WIMAX is not set 388# CONFIG_WIMAX is not set
368# CONFIG_RFKILL is not set 389# CONFIG_RFKILL is not set
369# CONFIG_NET_9P is not set 390# CONFIG_NET_9P is not set
@@ -466,6 +487,7 @@ CONFIG_MTD_PHYSMAP_OF=y
466# CONFIG_MTD_UBI is not set 487# CONFIG_MTD_UBI is not set
467CONFIG_OF_DEVICE=y 488CONFIG_OF_DEVICE=y
468CONFIG_OF_GPIO=y 489CONFIG_OF_GPIO=y
490CONFIG_OF_MDIO=y
469# CONFIG_PARPORT is not set 491# CONFIG_PARPORT is not set
470CONFIG_BLK_DEV=y 492CONFIG_BLK_DEV=y
471# CONFIG_BLK_DEV_FD is not set 493# CONFIG_BLK_DEV_FD is not set
@@ -520,7 +542,6 @@ CONFIG_IDE_PROC_FS=y
520# CONFIG_MD is not set 542# CONFIG_MD is not set
521# CONFIG_MACINTOSH_DRIVERS is not set 543# CONFIG_MACINTOSH_DRIVERS is not set
522CONFIG_NETDEVICES=y 544CONFIG_NETDEVICES=y
523CONFIG_COMPAT_NET_DEV_OPS=y
524# CONFIG_DUMMY is not set 545# CONFIG_DUMMY is not set
525# CONFIG_BONDING is not set 546# CONFIG_BONDING is not set
526# CONFIG_MACVLAN is not set 547# CONFIG_MACVLAN is not set
@@ -560,6 +581,7 @@ CONFIG_MII=y
560# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 581# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
561# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 582# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
562# CONFIG_B44 is not set 583# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set
563CONFIG_FS_ENET=y 585CONFIG_FS_ENET=y
564# CONFIG_FS_ENET_HAS_SCC is not set 586# CONFIG_FS_ENET_HAS_SCC is not set
565CONFIG_FS_ENET_HAS_FCC=y 587CONFIG_FS_ENET_HAS_FCC=y
@@ -567,6 +589,7 @@ CONFIG_FS_ENET_MDIO_FCC=y
567CONFIG_NETDEV_1000=y 589CONFIG_NETDEV_1000=y
568CONFIG_FSL_PQ_MDIO=y 590CONFIG_FSL_PQ_MDIO=y
569CONFIG_GIANFAR=y 591CONFIG_GIANFAR=y
592# CONFIG_MV643XX_ETH is not set
570CONFIG_NETDEV_10000=y 593CONFIG_NETDEV_10000=y
571 594
572# 595#
@@ -654,6 +677,11 @@ CONFIG_GEN_RTC=y
654# CONFIG_TCG_TPM is not set 677# CONFIG_TCG_TPM is not set
655# CONFIG_I2C is not set 678# CONFIG_I2C is not set
656# CONFIG_SPI is not set 679# CONFIG_SPI is not set
680
681#
682# PPS support
683#
684# CONFIG_PPS is not set
657CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 685CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
658CONFIG_ARCH_REQUIRE_GPIOLIB=y 686CONFIG_ARCH_REQUIRE_GPIOLIB=y
659CONFIG_GPIOLIB=y 687CONFIG_GPIOLIB=y
@@ -710,22 +738,7 @@ CONFIG_SSB_POSSIBLE=y
710# CONFIG_HTC_PASIC3 is not set 738# CONFIG_HTC_PASIC3 is not set
711# CONFIG_MFD_TMIO is not set 739# CONFIG_MFD_TMIO is not set
712# CONFIG_REGULATOR is not set 740# CONFIG_REGULATOR is not set
713 741# CONFIG_MEDIA_SUPPORT is not set
714#
715# Multimedia devices
716#
717
718#
719# Multimedia core support
720#
721# CONFIG_VIDEO_DEV is not set
722# CONFIG_DVB_CORE is not set
723# CONFIG_VIDEO_MEDIA is not set
724
725#
726# Multimedia drivers
727#
728CONFIG_DAB=y
729 742
730# 743#
731# Graphics support 744# Graphics support
@@ -777,6 +790,10 @@ CONFIG_USB_SUPPORT=y
777# CONFIG_DMADEVICES is not set 790# CONFIG_DMADEVICES is not set
778# CONFIG_AUXDISPLAY is not set 791# CONFIG_AUXDISPLAY is not set
779# CONFIG_UIO is not set 792# CONFIG_UIO is not set
793
794#
795# TI VLYNQ
796#
780# CONFIG_STAGING is not set 797# CONFIG_STAGING is not set
781 798
782# 799#
@@ -797,10 +814,12 @@ CONFIG_FS_MBCACHE=y
797# CONFIG_REISERFS_FS is not set 814# CONFIG_REISERFS_FS is not set
798# CONFIG_JFS_FS is not set 815# CONFIG_JFS_FS is not set
799# CONFIG_FS_POSIX_ACL is not set 816# CONFIG_FS_POSIX_ACL is not set
800CONFIG_FILE_LOCKING=y
801# CONFIG_XFS_FS is not set 817# CONFIG_XFS_FS is not set
818# CONFIG_GFS2_FS is not set
802# CONFIG_OCFS2_FS is not set 819# CONFIG_OCFS2_FS is not set
803# CONFIG_BTRFS_FS is not set 820# CONFIG_BTRFS_FS is not set
821CONFIG_FILE_LOCKING=y
822CONFIG_FSNOTIFY=y
804CONFIG_DNOTIFY=y 823CONFIG_DNOTIFY=y
805CONFIG_INOTIFY=y 824CONFIG_INOTIFY=y
806CONFIG_INOTIFY_USER=y 825CONFIG_INOTIFY_USER=y
@@ -916,6 +935,7 @@ CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y 935CONFIG_HAS_DMA=y
917CONFIG_HAVE_LMB=y 936CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y 937CONFIG_NLATTR=y
938CONFIG_GENERIC_ATOMIC64=y
919 939
920# 940#
921# Kernel hacking 941# Kernel hacking
@@ -946,6 +966,9 @@ CONFIG_SCHED_DEBUG=y
946# CONFIG_RT_MUTEX_TESTER is not set 966# CONFIG_RT_MUTEX_TESTER is not set
947# CONFIG_DEBUG_SPINLOCK is not set 967# CONFIG_DEBUG_SPINLOCK is not set
948CONFIG_DEBUG_MUTEXES=y 968CONFIG_DEBUG_MUTEXES=y
969# CONFIG_DEBUG_LOCK_ALLOC is not set
970# CONFIG_PROVE_LOCKING is not set
971# CONFIG_LOCK_STAT is not set
949# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 972# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
950# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 973# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
951# CONFIG_DEBUG_KOBJECT is not set 974# CONFIG_DEBUG_KOBJECT is not set
@@ -958,7 +981,6 @@ CONFIG_DEBUG_MUTEXES=y
958# CONFIG_DEBUG_LIST is not set 981# CONFIG_DEBUG_LIST is not set
959# CONFIG_DEBUG_SG is not set 982# CONFIG_DEBUG_SG is not set
960# CONFIG_DEBUG_NOTIFIERS is not set 983# CONFIG_DEBUG_NOTIFIERS is not set
961# CONFIG_BOOT_PRINTK_DELAY is not set
962# CONFIG_RCU_TORTURE_TEST is not set 984# CONFIG_RCU_TORTURE_TEST is not set
963# CONFIG_RCU_CPU_STALL_DETECTOR is not set 985# CONFIG_RCU_CPU_STALL_DETECTOR is not set
964# CONFIG_BACKTRACE_SELF_TEST is not set 986# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -972,16 +994,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
972CONFIG_HAVE_DYNAMIC_FTRACE=y 994CONFIG_HAVE_DYNAMIC_FTRACE=y
973CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 995CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
974CONFIG_TRACING_SUPPORT=y 996CONFIG_TRACING_SUPPORT=y
975 997CONFIG_FTRACE=y
976#
977# Tracers
978#
979# CONFIG_FUNCTION_TRACER is not set 998# CONFIG_FUNCTION_TRACER is not set
999# CONFIG_IRQSOFF_TRACER is not set
980# CONFIG_SCHED_TRACER is not set 1000# CONFIG_SCHED_TRACER is not set
981# CONFIG_CONTEXT_SWITCH_TRACER is not set 1001# CONFIG_ENABLE_DEFAULT_TRACERS is not set
982# CONFIG_EVENT_TRACER is not set
983# CONFIG_BOOT_TRACER is not set 1002# CONFIG_BOOT_TRACER is not set
984# CONFIG_TRACE_BRANCH_PROFILING is not set 1003CONFIG_BRANCH_PROFILE_NONE=y
1004# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1005# CONFIG_PROFILE_ALL_BRANCHES is not set
985# CONFIG_STACK_TRACER is not set 1006# CONFIG_STACK_TRACER is not set
986# CONFIG_KMEMTRACE is not set 1007# CONFIG_KMEMTRACE is not set
987# CONFIG_WORKQUEUE_TRACER is not set 1008# CONFIG_WORKQUEUE_TRACER is not set
@@ -990,9 +1011,13 @@ CONFIG_TRACING_SUPPORT=y
990# CONFIG_SAMPLES is not set 1011# CONFIG_SAMPLES is not set
991CONFIG_HAVE_ARCH_KGDB=y 1012CONFIG_HAVE_ARCH_KGDB=y
992# CONFIG_KGDB is not set 1013# CONFIG_KGDB is not set
1014# CONFIG_KMEMCHECK is not set
1015# CONFIG_PPC_DISABLE_WERROR is not set
1016CONFIG_PPC_WERROR=y
993CONFIG_PRINT_STACK_DEPTH=64 1017CONFIG_PRINT_STACK_DEPTH=64
994# CONFIG_DEBUG_STACKOVERFLOW is not set 1018# CONFIG_DEBUG_STACKOVERFLOW is not set
995# CONFIG_DEBUG_STACK_USAGE is not set 1019# CONFIG_DEBUG_STACK_USAGE is not set
1020# CONFIG_PPC_EMULATED_STATS is not set
996# CONFIG_CODE_PATCHING_SELFTEST is not set 1021# CONFIG_CODE_PATCHING_SELFTEST is not set
997# CONFIG_FTR_FIXUP_SELFTEST is not set 1022# CONFIG_FTR_FIXUP_SELFTEST is not set
998# CONFIG_MSI_BITMAP_SELFTEST is not set 1023# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/85xx/mpc8540_ads_defconfig b/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
index 7b43be7586b6..fb10cc83702e 100644
--- a/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:17 2009 4# Wed Jul 29 23:32:15 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,8 +126,15 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -138,6 +147,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150
151#
152# GCOV-based kernel profiling
153#
141# CONFIG_SLOW_WORK is not set 154# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 155# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 156CONFIG_SLABINFO=y
@@ -145,7 +158,7 @@ CONFIG_RT_MUTEXES=y
145CONFIG_BASE_SMALL=0 158CONFIG_BASE_SMALL=0
146# CONFIG_MODULES is not set 159# CONFIG_MODULES is not set
147CONFIG_BLOCK=y 160CONFIG_BLOCK=y
148# CONFIG_LBD is not set 161CONFIG_LBDAF=y
149# CONFIG_BLK_DEV_BSG is not set 162# CONFIG_BLK_DEV_BSG is not set
150# CONFIG_BLK_DEV_INTEGRITY is not set 163# CONFIG_BLK_DEV_INTEGRITY is not set
151 164
@@ -178,6 +191,7 @@ CONFIG_MPC8540_ADS=y
178# CONFIG_MPC85xx_DS is not set 191# CONFIG_MPC85xx_DS is not set
179# CONFIG_SOCRATES is not set 192# CONFIG_SOCRATES is not set
180# CONFIG_KSI8560 is not set 193# CONFIG_KSI8560 is not set
194# CONFIG_XES_MPC85xx is not set
181# CONFIG_STX_GP3 is not set 195# CONFIG_STX_GP3 is not set
182# CONFIG_TQM8540 is not set 196# CONFIG_TQM8540 is not set
183# CONFIG_TQM8541 is not set 197# CONFIG_TQM8541 is not set
@@ -226,6 +240,7 @@ CONFIG_BINFMT_ELF=y
226CONFIG_BINFMT_MISC=y 240CONFIG_BINFMT_MISC=y
227CONFIG_MATH_EMULATION=y 241CONFIG_MATH_EMULATION=y
228# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set
229CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
230CONFIG_ARCH_HAS_WALK_MEMORY=y 245CONFIG_ARCH_HAS_WALK_MEMORY=y
231CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -244,9 +259,9 @@ CONFIG_MIGRATION=y
244CONFIG_ZONE_DMA_FLAG=1 259CONFIG_ZONE_DMA_FLAG=1
245CONFIG_BOUNCE=y 260CONFIG_BOUNCE=y
246CONFIG_VIRT_TO_BUS=y 261CONFIG_VIRT_TO_BUS=y
247CONFIG_UNEVICTABLE_LRU=y
248CONFIG_HAVE_MLOCK=y 262CONFIG_HAVE_MLOCK=y
249CONFIG_HAVE_MLOCKED_PAGE_BIT=y 263CONFIG_HAVE_MLOCKED_PAGE_BIT=y
264CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
250CONFIG_PPC_4K_PAGES=y 265CONFIG_PPC_4K_PAGES=y
251# CONFIG_PPC_16K_PAGES is not set 266# CONFIG_PPC_16K_PAGES is not set
252# CONFIG_PPC_64K_PAGES is not set 267# CONFIG_PPC_64K_PAGES is not set
@@ -348,6 +363,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_ECONET is not set 363# CONFIG_ECONET is not set
349# CONFIG_WAN_ROUTER is not set 364# CONFIG_WAN_ROUTER is not set
350# CONFIG_PHONET is not set 365# CONFIG_PHONET is not set
366# CONFIG_IEEE802154 is not set
351# CONFIG_NET_SCHED is not set 367# CONFIG_NET_SCHED is not set
352# CONFIG_DCB is not set 368# CONFIG_DCB is not set
353 369
@@ -365,7 +381,11 @@ CONFIG_WIRELESS=y
365CONFIG_WIRELESS_OLD_REGULATORY=y 381CONFIG_WIRELESS_OLD_REGULATORY=y
366# CONFIG_WIRELESS_EXT is not set 382# CONFIG_WIRELESS_EXT is not set
367# CONFIG_LIB80211 is not set 383# CONFIG_LIB80211 is not set
368# CONFIG_MAC80211 is not set 384
385#
386# CFG80211 needs to be enabled for MAC80211
387#
388CONFIG_MAC80211_DEFAULT_PS_VALUE=0
369# CONFIG_WIMAX is not set 389# CONFIG_WIMAX is not set
370# CONFIG_RFKILL is not set 390# CONFIG_RFKILL is not set
371# CONFIG_NET_9P is not set 391# CONFIG_NET_9P is not set
@@ -387,6 +407,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
387# CONFIG_CONNECTOR is not set 407# CONFIG_CONNECTOR is not set
388# CONFIG_MTD is not set 408# CONFIG_MTD is not set
389CONFIG_OF_DEVICE=y 409CONFIG_OF_DEVICE=y
410CONFIG_OF_MDIO=y
390# CONFIG_PARPORT is not set 411# CONFIG_PARPORT is not set
391CONFIG_BLK_DEV=y 412CONFIG_BLK_DEV=y
392# CONFIG_BLK_DEV_FD is not set 413# CONFIG_BLK_DEV_FD is not set
@@ -423,7 +444,6 @@ CONFIG_HAVE_IDE=y
423# CONFIG_MD is not set 444# CONFIG_MD is not set
424# CONFIG_MACINTOSH_DRIVERS is not set 445# CONFIG_MACINTOSH_DRIVERS is not set
425CONFIG_NETDEVICES=y 446CONFIG_NETDEVICES=y
426CONFIG_COMPAT_NET_DEV_OPS=y
427# CONFIG_DUMMY is not set 447# CONFIG_DUMMY is not set
428# CONFIG_BONDING is not set 448# CONFIG_BONDING is not set
429# CONFIG_MACVLAN is not set 449# CONFIG_MACVLAN is not set
@@ -462,9 +482,11 @@ CONFIG_MII=y
462# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 482# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
463# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 483# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
464# CONFIG_B44 is not set 484# CONFIG_B44 is not set
485# CONFIG_KS8842 is not set
465CONFIG_NETDEV_1000=y 486CONFIG_NETDEV_1000=y
466CONFIG_FSL_PQ_MDIO=y 487CONFIG_FSL_PQ_MDIO=y
467CONFIG_GIANFAR=y 488CONFIG_GIANFAR=y
489# CONFIG_MV643XX_ETH is not set
468CONFIG_NETDEV_10000=y 490CONFIG_NETDEV_10000=y
469 491
470# 492#
@@ -555,6 +577,11 @@ CONFIG_GEN_RTC=y
555# CONFIG_TCG_TPM is not set 577# CONFIG_TCG_TPM is not set
556# CONFIG_I2C is not set 578# CONFIG_I2C is not set
557# CONFIG_SPI is not set 579# CONFIG_SPI is not set
580
581#
582# PPS support
583#
584# CONFIG_PPS is not set
558CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 585CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
559# CONFIG_GPIOLIB is not set 586# CONFIG_GPIOLIB is not set
560# CONFIG_W1 is not set 587# CONFIG_W1 is not set
@@ -590,22 +617,7 @@ CONFIG_SSB_POSSIBLE=y
590# CONFIG_HTC_PASIC3 is not set 617# CONFIG_HTC_PASIC3 is not set
591# CONFIG_MFD_TMIO is not set 618# CONFIG_MFD_TMIO is not set
592# CONFIG_REGULATOR is not set 619# CONFIG_REGULATOR is not set
593 620# CONFIG_MEDIA_SUPPORT is not set
594#
595# Multimedia devices
596#
597
598#
599# Multimedia core support
600#
601# CONFIG_VIDEO_DEV is not set
602# CONFIG_DVB_CORE is not set
603# CONFIG_VIDEO_MEDIA is not set
604
605#
606# Multimedia drivers
607#
608CONFIG_DAB=y
609 621
610# 622#
611# Graphics support 623# Graphics support
@@ -657,6 +669,10 @@ CONFIG_USB_SUPPORT=y
657# CONFIG_DMADEVICES is not set 669# CONFIG_DMADEVICES is not set
658# CONFIG_AUXDISPLAY is not set 670# CONFIG_AUXDISPLAY is not set
659# CONFIG_UIO is not set 671# CONFIG_UIO is not set
672
673#
674# TI VLYNQ
675#
660# CONFIG_STAGING is not set 676# CONFIG_STAGING is not set
661 677
662# 678#
@@ -676,10 +692,12 @@ CONFIG_FS_MBCACHE=y
676# CONFIG_REISERFS_FS is not set 692# CONFIG_REISERFS_FS is not set
677# CONFIG_JFS_FS is not set 693# CONFIG_JFS_FS is not set
678# CONFIG_FS_POSIX_ACL is not set 694# CONFIG_FS_POSIX_ACL is not set
679CONFIG_FILE_LOCKING=y
680# CONFIG_XFS_FS is not set 695# CONFIG_XFS_FS is not set
696# CONFIG_GFS2_FS is not set
681# CONFIG_OCFS2_FS is not set 697# CONFIG_OCFS2_FS is not set
682# CONFIG_BTRFS_FS is not set 698# CONFIG_BTRFS_FS is not set
699CONFIG_FILE_LOCKING=y
700CONFIG_FSNOTIFY=y
683CONFIG_DNOTIFY=y 701CONFIG_DNOTIFY=y
684CONFIG_INOTIFY=y 702CONFIG_INOTIFY=y
685CONFIG_INOTIFY_USER=y 703CONFIG_INOTIFY_USER=y
@@ -794,6 +812,7 @@ CONFIG_HAS_IOPORT=y
794CONFIG_HAS_DMA=y 812CONFIG_HAS_DMA=y
795CONFIG_HAVE_LMB=y 813CONFIG_HAVE_LMB=y
796CONFIG_NLATTR=y 814CONFIG_NLATTR=y
815CONFIG_GENERIC_ATOMIC64=y
797 816
798# 817#
799# Kernel hacking 818# Kernel hacking
@@ -824,6 +843,9 @@ CONFIG_SCHED_DEBUG=y
824# CONFIG_RT_MUTEX_TESTER is not set 843# CONFIG_RT_MUTEX_TESTER is not set
825# CONFIG_DEBUG_SPINLOCK is not set 844# CONFIG_DEBUG_SPINLOCK is not set
826CONFIG_DEBUG_MUTEXES=y 845CONFIG_DEBUG_MUTEXES=y
846# CONFIG_DEBUG_LOCK_ALLOC is not set
847# CONFIG_PROVE_LOCKING is not set
848# CONFIG_LOCK_STAT is not set
827# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 849# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
828# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 850# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
829# CONFIG_DEBUG_KOBJECT is not set 851# CONFIG_DEBUG_KOBJECT is not set
@@ -835,7 +857,6 @@ CONFIG_DEBUG_MUTEXES=y
835# CONFIG_DEBUG_LIST is not set 857# CONFIG_DEBUG_LIST is not set
836# CONFIG_DEBUG_SG is not set 858# CONFIG_DEBUG_SG is not set
837# CONFIG_DEBUG_NOTIFIERS is not set 859# CONFIG_DEBUG_NOTIFIERS is not set
838# CONFIG_BOOT_PRINTK_DELAY is not set
839# CONFIG_RCU_TORTURE_TEST is not set 860# CONFIG_RCU_TORTURE_TEST is not set
840# CONFIG_RCU_CPU_STALL_DETECTOR is not set 861# CONFIG_RCU_CPU_STALL_DETECTOR is not set
841# CONFIG_BACKTRACE_SELF_TEST is not set 862# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -849,16 +870,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
849CONFIG_HAVE_DYNAMIC_FTRACE=y 870CONFIG_HAVE_DYNAMIC_FTRACE=y
850CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 871CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
851CONFIG_TRACING_SUPPORT=y 872CONFIG_TRACING_SUPPORT=y
852 873CONFIG_FTRACE=y
853#
854# Tracers
855#
856# CONFIG_FUNCTION_TRACER is not set 874# CONFIG_FUNCTION_TRACER is not set
875# CONFIG_IRQSOFF_TRACER is not set
857# CONFIG_SCHED_TRACER is not set 876# CONFIG_SCHED_TRACER is not set
858# CONFIG_CONTEXT_SWITCH_TRACER is not set 877# CONFIG_ENABLE_DEFAULT_TRACERS is not set
859# CONFIG_EVENT_TRACER is not set
860# CONFIG_BOOT_TRACER is not set 878# CONFIG_BOOT_TRACER is not set
861# CONFIG_TRACE_BRANCH_PROFILING is not set 879CONFIG_BRANCH_PROFILE_NONE=y
880# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
881# CONFIG_PROFILE_ALL_BRANCHES is not set
862# CONFIG_STACK_TRACER is not set 882# CONFIG_STACK_TRACER is not set
863# CONFIG_KMEMTRACE is not set 883# CONFIG_KMEMTRACE is not set
864# CONFIG_WORKQUEUE_TRACER is not set 884# CONFIG_WORKQUEUE_TRACER is not set
@@ -866,6 +886,9 @@ CONFIG_TRACING_SUPPORT=y
866# CONFIG_SAMPLES is not set 886# CONFIG_SAMPLES is not set
867CONFIG_HAVE_ARCH_KGDB=y 887CONFIG_HAVE_ARCH_KGDB=y
868# CONFIG_KGDB is not set 888# CONFIG_KGDB is not set
889# CONFIG_KMEMCHECK is not set
890# CONFIG_PPC_DISABLE_WERROR is not set
891CONFIG_PPC_WERROR=y
869CONFIG_PRINT_STACK_DEPTH=64 892CONFIG_PRINT_STACK_DEPTH=64
870# CONFIG_DEBUG_STACKOVERFLOW is not set 893# CONFIG_DEBUG_STACKOVERFLOW is not set
871# CONFIG_DEBUG_STACK_USAGE is not set 894# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/mpc8560_ads_defconfig b/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
index 62adb71a5d4f..5c8ce6978825 100644
--- a/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:17 2009 4# Wed Jul 29 23:32:16 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -112,7 +115,6 @@ CONFIG_SYSCTL_SYSCALL=y
112CONFIG_KALLSYMS=y 115CONFIG_KALLSYMS=y
113# CONFIG_KALLSYMS_ALL is not set 116# CONFIG_KALLSYMS_ALL is not set
114# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
115# CONFIG_STRIP_ASM_SYMS is not set
116CONFIG_HOTPLUG=y 118CONFIG_HOTPLUG=y
117CONFIG_PRINTK=y 119CONFIG_PRINTK=y
118CONFIG_BUG=y 120CONFIG_BUG=y
@@ -125,9 +127,16 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y
131
132#
133# Performance Counters
134#
135# CONFIG_PERF_COUNTERS is not set
128CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
129CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
130CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
139# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
132# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
133CONFIG_SLUB=y 142CONFIG_SLUB=y
@@ -141,6 +150,10 @@ CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
142CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
143CONFIG_HAVE_CLK=y 152CONFIG_HAVE_CLK=y
153
154#
155# GCOV-based kernel profiling
156#
144# CONFIG_SLOW_WORK is not set 157# CONFIG_SLOW_WORK is not set
145# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 158# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
146CONFIG_SLABINFO=y 159CONFIG_SLABINFO=y
@@ -148,7 +161,7 @@ CONFIG_RT_MUTEXES=y
148CONFIG_BASE_SMALL=0 161CONFIG_BASE_SMALL=0
149# CONFIG_MODULES is not set 162# CONFIG_MODULES is not set
150CONFIG_BLOCK=y 163CONFIG_BLOCK=y
151# CONFIG_LBD is not set 164CONFIG_LBDAF=y
152# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
153# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
154 167
@@ -181,6 +194,7 @@ CONFIG_MPC8560_ADS=y
181# CONFIG_MPC85xx_DS is not set 194# CONFIG_MPC85xx_DS is not set
182# CONFIG_SOCRATES is not set 195# CONFIG_SOCRATES is not set
183# CONFIG_KSI8560 is not set 196# CONFIG_KSI8560 is not set
197# CONFIG_XES_MPC85xx is not set
184# CONFIG_STX_GP3 is not set 198# CONFIG_STX_GP3 is not set
185# CONFIG_TQM8540 is not set 199# CONFIG_TQM8540 is not set
186# CONFIG_TQM8541 is not set 200# CONFIG_TQM8541 is not set
@@ -229,6 +243,7 @@ CONFIG_BINFMT_ELF=y
229CONFIG_BINFMT_MISC=y 243CONFIG_BINFMT_MISC=y
230CONFIG_MATH_EMULATION=y 244CONFIG_MATH_EMULATION=y
231# CONFIG_IOMMU_HELPER is not set 245# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set
232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 248CONFIG_ARCH_HAS_WALK_MEMORY=y
234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -247,9 +262,9 @@ CONFIG_MIGRATION=y
247CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
248CONFIG_BOUNCE=y 263CONFIG_BOUNCE=y
249CONFIG_VIRT_TO_BUS=y 264CONFIG_VIRT_TO_BUS=y
250CONFIG_UNEVICTABLE_LRU=y
251CONFIG_HAVE_MLOCK=y 265CONFIG_HAVE_MLOCK=y
252CONFIG_HAVE_MLOCKED_PAGE_BIT=y 266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
253CONFIG_PPC_4K_PAGES=y 268CONFIG_PPC_4K_PAGES=y
254# CONFIG_PPC_16K_PAGES is not set 269# CONFIG_PPC_16K_PAGES is not set
255# CONFIG_PPC_64K_PAGES is not set 270# CONFIG_PPC_64K_PAGES is not set
@@ -360,6 +375,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
360# CONFIG_ECONET is not set 375# CONFIG_ECONET is not set
361# CONFIG_WAN_ROUTER is not set 376# CONFIG_WAN_ROUTER is not set
362# CONFIG_PHONET is not set 377# CONFIG_PHONET is not set
378# CONFIG_IEEE802154 is not set
363# CONFIG_NET_SCHED is not set 379# CONFIG_NET_SCHED is not set
364# CONFIG_DCB is not set 380# CONFIG_DCB is not set
365 381
@@ -377,7 +393,11 @@ CONFIG_WIRELESS=y
377CONFIG_WIRELESS_OLD_REGULATORY=y 393CONFIG_WIRELESS_OLD_REGULATORY=y
378# CONFIG_WIRELESS_EXT is not set 394# CONFIG_WIRELESS_EXT is not set
379# CONFIG_LIB80211 is not set 395# CONFIG_LIB80211 is not set
380# CONFIG_MAC80211 is not set 396
397#
398# CFG80211 needs to be enabled for MAC80211
399#
400CONFIG_MAC80211_DEFAULT_PS_VALUE=0
381# CONFIG_WIMAX is not set 401# CONFIG_WIMAX is not set
382# CONFIG_RFKILL is not set 402# CONFIG_RFKILL is not set
383# CONFIG_NET_9P is not set 403# CONFIG_NET_9P is not set
@@ -400,6 +420,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
400# CONFIG_MTD is not set 420# CONFIG_MTD is not set
401CONFIG_OF_DEVICE=y 421CONFIG_OF_DEVICE=y
402CONFIG_OF_GPIO=y 422CONFIG_OF_GPIO=y
423CONFIG_OF_MDIO=y
403# CONFIG_PARPORT is not set 424# CONFIG_PARPORT is not set
404CONFIG_BLK_DEV=y 425CONFIG_BLK_DEV=y
405# CONFIG_BLK_DEV_FD is not set 426# CONFIG_BLK_DEV_FD is not set
@@ -431,6 +452,7 @@ CONFIG_MISC_DEVICES=y
431# EEPROM support 452# EEPROM support
432# 453#
433# CONFIG_EEPROM_93CX6 is not set 454# CONFIG_EEPROM_93CX6 is not set
455# CONFIG_CB710_CORE is not set
434CONFIG_HAVE_IDE=y 456CONFIG_HAVE_IDE=y
435# CONFIG_IDE is not set 457# CONFIG_IDE is not set
436 458
@@ -450,14 +472,17 @@ CONFIG_HAVE_IDE=y
450# 472#
451 473
452# 474#
453# Enable only one of the two stacks, unless you know what you are doing 475# You can enable one or both FireWire driver stacks.
476#
477
478#
479# See the help texts for more information.
454# 480#
455# CONFIG_FIREWIRE is not set 481# CONFIG_FIREWIRE is not set
456# CONFIG_IEEE1394 is not set 482# CONFIG_IEEE1394 is not set
457# CONFIG_I2O is not set 483# CONFIG_I2O is not set
458# CONFIG_MACINTOSH_DRIVERS is not set 484# CONFIG_MACINTOSH_DRIVERS is not set
459CONFIG_NETDEVICES=y 485CONFIG_NETDEVICES=y
460CONFIG_COMPAT_NET_DEV_OPS=y
461# CONFIG_DUMMY is not set 486# CONFIG_DUMMY is not set
462# CONFIG_BONDING is not set 487# CONFIG_BONDING is not set
463# CONFIG_MACVLAN is not set 488# CONFIG_MACVLAN is not set
@@ -504,6 +529,7 @@ CONFIG_MII=y
504# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 529# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
505# CONFIG_NET_PCI is not set 530# CONFIG_NET_PCI is not set
506# CONFIG_B44 is not set 531# CONFIG_B44 is not set
532# CONFIG_KS8842 is not set
507# CONFIG_ATL2 is not set 533# CONFIG_ATL2 is not set
508CONFIG_FS_ENET=y 534CONFIG_FS_ENET=y
509# CONFIG_FS_ENET_HAS_SCC is not set 535# CONFIG_FS_ENET_HAS_SCC is not set
@@ -527,8 +553,10 @@ CONFIG_E1000=y
527# CONFIG_VIA_VELOCITY is not set 553# CONFIG_VIA_VELOCITY is not set
528# CONFIG_TIGON3 is not set 554# CONFIG_TIGON3 is not set
529# CONFIG_BNX2 is not set 555# CONFIG_BNX2 is not set
556# CONFIG_CNIC is not set
530CONFIG_FSL_PQ_MDIO=y 557CONFIG_FSL_PQ_MDIO=y
531CONFIG_GIANFAR=y 558CONFIG_GIANFAR=y
559# CONFIG_MV643XX_ETH is not set
532# CONFIG_QLA3XXX is not set 560# CONFIG_QLA3XXX is not set
533# CONFIG_ATL1 is not set 561# CONFIG_ATL1 is not set
534# CONFIG_ATL1E is not set 562# CONFIG_ATL1E is not set
@@ -646,6 +674,11 @@ CONFIG_GEN_RTC=y
646CONFIG_DEVPORT=y 674CONFIG_DEVPORT=y
647# CONFIG_I2C is not set 675# CONFIG_I2C is not set
648# CONFIG_SPI is not set 676# CONFIG_SPI is not set
677
678#
679# PPS support
680#
681# CONFIG_PPS is not set
649CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 682CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
650CONFIG_ARCH_REQUIRE_GPIOLIB=y 683CONFIG_ARCH_REQUIRE_GPIOLIB=y
651CONFIG_GPIOLIB=y 684CONFIG_GPIOLIB=y
@@ -707,22 +740,7 @@ CONFIG_SSB_POSSIBLE=y
707# CONFIG_HTC_PASIC3 is not set 740# CONFIG_HTC_PASIC3 is not set
708# CONFIG_MFD_TMIO is not set 741# CONFIG_MFD_TMIO is not set
709# CONFIG_REGULATOR is not set 742# CONFIG_REGULATOR is not set
710 743# CONFIG_MEDIA_SUPPORT is not set
711#
712# Multimedia devices
713#
714
715#
716# Multimedia core support
717#
718# CONFIG_VIDEO_DEV is not set
719# CONFIG_DVB_CORE is not set
720# CONFIG_VIDEO_MEDIA is not set
721
722#
723# Multimedia drivers
724#
725CONFIG_DAB=y
726 744
727# 745#
728# Graphics support 746# Graphics support
@@ -779,6 +797,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
779# CONFIG_DMADEVICES is not set 797# CONFIG_DMADEVICES is not set
780# CONFIG_AUXDISPLAY is not set 798# CONFIG_AUXDISPLAY is not set
781# CONFIG_UIO is not set 799# CONFIG_UIO is not set
800
801#
802# TI VLYNQ
803#
782# CONFIG_STAGING is not set 804# CONFIG_STAGING is not set
783 805
784# 806#
@@ -798,10 +820,12 @@ CONFIG_FS_MBCACHE=y
798# CONFIG_REISERFS_FS is not set 820# CONFIG_REISERFS_FS is not set
799# CONFIG_JFS_FS is not set 821# CONFIG_JFS_FS is not set
800# CONFIG_FS_POSIX_ACL is not set 822# CONFIG_FS_POSIX_ACL is not set
801CONFIG_FILE_LOCKING=y
802# CONFIG_XFS_FS is not set 823# CONFIG_XFS_FS is not set
824# CONFIG_GFS2_FS is not set
803# CONFIG_OCFS2_FS is not set 825# CONFIG_OCFS2_FS is not set
804# CONFIG_BTRFS_FS is not set 826# CONFIG_BTRFS_FS is not set
827CONFIG_FILE_LOCKING=y
828CONFIG_FSNOTIFY=y
805CONFIG_DNOTIFY=y 829CONFIG_DNOTIFY=y
806CONFIG_INOTIFY=y 830CONFIG_INOTIFY=y
807CONFIG_INOTIFY_USER=y 831CONFIG_INOTIFY_USER=y
@@ -916,6 +940,7 @@ CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y 940CONFIG_HAS_DMA=y
917CONFIG_HAVE_LMB=y 941CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y 942CONFIG_NLATTR=y
943CONFIG_GENERIC_ATOMIC64=y
919 944
920# 945#
921# Kernel hacking 946# Kernel hacking
@@ -946,6 +971,9 @@ CONFIG_SCHED_DEBUG=y
946# CONFIG_RT_MUTEX_TESTER is not set 971# CONFIG_RT_MUTEX_TESTER is not set
947# CONFIG_DEBUG_SPINLOCK is not set 972# CONFIG_DEBUG_SPINLOCK is not set
948CONFIG_DEBUG_MUTEXES=y 973CONFIG_DEBUG_MUTEXES=y
974# CONFIG_DEBUG_LOCK_ALLOC is not set
975# CONFIG_PROVE_LOCKING is not set
976# CONFIG_LOCK_STAT is not set
949# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 977# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
950# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 978# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
951# CONFIG_DEBUG_KOBJECT is not set 979# CONFIG_DEBUG_KOBJECT is not set
@@ -957,7 +985,6 @@ CONFIG_DEBUG_MUTEXES=y
957# CONFIG_DEBUG_LIST is not set 985# CONFIG_DEBUG_LIST is not set
958# CONFIG_DEBUG_SG is not set 986# CONFIG_DEBUG_SG is not set
959# CONFIG_DEBUG_NOTIFIERS is not set 987# CONFIG_DEBUG_NOTIFIERS is not set
960# CONFIG_BOOT_PRINTK_DELAY is not set
961# CONFIG_RCU_TORTURE_TEST is not set 988# CONFIG_RCU_TORTURE_TEST is not set
962# CONFIG_RCU_CPU_STALL_DETECTOR is not set 989# CONFIG_RCU_CPU_STALL_DETECTOR is not set
963# CONFIG_BACKTRACE_SELF_TEST is not set 990# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -971,16 +998,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
971CONFIG_HAVE_DYNAMIC_FTRACE=y 998CONFIG_HAVE_DYNAMIC_FTRACE=y
972CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 999CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
973CONFIG_TRACING_SUPPORT=y 1000CONFIG_TRACING_SUPPORT=y
974 1001CONFIG_FTRACE=y
975#
976# Tracers
977#
978# CONFIG_FUNCTION_TRACER is not set 1002# CONFIG_FUNCTION_TRACER is not set
1003# CONFIG_IRQSOFF_TRACER is not set
979# CONFIG_SCHED_TRACER is not set 1004# CONFIG_SCHED_TRACER is not set
980# CONFIG_CONTEXT_SWITCH_TRACER is not set 1005# CONFIG_ENABLE_DEFAULT_TRACERS is not set
981# CONFIG_EVENT_TRACER is not set
982# CONFIG_BOOT_TRACER is not set 1006# CONFIG_BOOT_TRACER is not set
983# CONFIG_TRACE_BRANCH_PROFILING is not set 1007CONFIG_BRANCH_PROFILE_NONE=y
1008# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1009# CONFIG_PROFILE_ALL_BRANCHES is not set
984# CONFIG_STACK_TRACER is not set 1010# CONFIG_STACK_TRACER is not set
985# CONFIG_KMEMTRACE is not set 1011# CONFIG_KMEMTRACE is not set
986# CONFIG_WORKQUEUE_TRACER is not set 1012# CONFIG_WORKQUEUE_TRACER is not set
@@ -988,6 +1014,9 @@ CONFIG_TRACING_SUPPORT=y
988# CONFIG_SAMPLES is not set 1014# CONFIG_SAMPLES is not set
989CONFIG_HAVE_ARCH_KGDB=y 1015CONFIG_HAVE_ARCH_KGDB=y
990# CONFIG_KGDB is not set 1016# CONFIG_KGDB is not set
1017# CONFIG_KMEMCHECK is not set
1018# CONFIG_PPC_DISABLE_WERROR is not set
1019CONFIG_PPC_WERROR=y
991CONFIG_PRINT_STACK_DEPTH=64 1020CONFIG_PRINT_STACK_DEPTH=64
992# CONFIG_DEBUG_STACKOVERFLOW is not set 1021# CONFIG_DEBUG_STACKOVERFLOW is not set
993# CONFIG_DEBUG_STACK_USAGE is not set 1022# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
index 41209e3a6545..158e63e8607f 100644
--- a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
+++ b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:18 2009 4# Wed Jul 29 23:32:17 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,9 +126,16 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
129CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
131# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
132CONFIG_SLUB=y 141CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
139CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
140CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
141CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx_CDS=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184# CONFIG_TQM8541 is not set 198# CONFIG_TQM8541 is not set
@@ -227,6 +241,7 @@ CONFIG_BINFMT_ELF=y
227CONFIG_BINFMT_MISC=y 241CONFIG_BINFMT_MISC=y
228CONFIG_MATH_EMULATION=y 242CONFIG_MATH_EMULATION=y
229# CONFIG_IOMMU_HELPER is not set 243# CONFIG_IOMMU_HELPER is not set
244# CONFIG_SWIOTLB is not set
230CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
231CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
232CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -245,9 +260,9 @@ CONFIG_MIGRATION=y
245CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=1
246CONFIG_BOUNCE=y 261CONFIG_BOUNCE=y
247CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
248CONFIG_UNEVICTABLE_LRU=y
249CONFIG_HAVE_MLOCK=y 263CONFIG_HAVE_MLOCK=y
250CONFIG_HAVE_MLOCKED_PAGE_BIT=y 264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
251CONFIG_PPC_4K_PAGES=y 266CONFIG_PPC_4K_PAGES=y
252# CONFIG_PPC_16K_PAGES is not set 267# CONFIG_PPC_16K_PAGES is not set
253# CONFIG_PPC_64K_PAGES is not set 268# CONFIG_PPC_64K_PAGES is not set
@@ -358,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
358# CONFIG_ECONET is not set 373# CONFIG_ECONET is not set
359# CONFIG_WAN_ROUTER is not set 374# CONFIG_WAN_ROUTER is not set
360# CONFIG_PHONET is not set 375# CONFIG_PHONET is not set
376# CONFIG_IEEE802154 is not set
361# CONFIG_NET_SCHED is not set 377# CONFIG_NET_SCHED is not set
362# CONFIG_DCB is not set 378# CONFIG_DCB is not set
363 379
@@ -375,7 +391,11 @@ CONFIG_WIRELESS=y
375CONFIG_WIRELESS_OLD_REGULATORY=y 391CONFIG_WIRELESS_OLD_REGULATORY=y
376# CONFIG_WIRELESS_EXT is not set 392# CONFIG_WIRELESS_EXT is not set
377# CONFIG_LIB80211 is not set 393# CONFIG_LIB80211 is not set
378# CONFIG_MAC80211 is not set 394
395#
396# CFG80211 needs to be enabled for MAC80211
397#
398CONFIG_MAC80211_DEFAULT_PS_VALUE=0
379# CONFIG_WIMAX is not set 399# CONFIG_WIMAX is not set
380# CONFIG_RFKILL is not set 400# CONFIG_RFKILL is not set
381# CONFIG_NET_9P is not set 401# CONFIG_NET_9P is not set
@@ -397,6 +417,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
397# CONFIG_CONNECTOR is not set 417# CONFIG_CONNECTOR is not set
398# CONFIG_MTD is not set 418# CONFIG_MTD is not set
399CONFIG_OF_DEVICE=y 419CONFIG_OF_DEVICE=y
420CONFIG_OF_MDIO=y
400# CONFIG_PARPORT is not set 421# CONFIG_PARPORT is not set
401CONFIG_BLK_DEV=y 422CONFIG_BLK_DEV=y
402# CONFIG_BLK_DEV_FD is not set 423# CONFIG_BLK_DEV_FD is not set
@@ -428,6 +449,7 @@ CONFIG_MISC_DEVICES=y
428# EEPROM support 449# EEPROM support
429# 450#
430# CONFIG_EEPROM_93CX6 is not set 451# CONFIG_EEPROM_93CX6 is not set
452# CONFIG_CB710_CORE is not set
431CONFIG_HAVE_IDE=y 453CONFIG_HAVE_IDE=y
432CONFIG_IDE=y 454CONFIG_IDE=y
433 455
@@ -502,14 +524,17 @@ CONFIG_BLK_DEV_IDEDMA=y
502# 524#
503 525
504# 526#
505# Enable only one of the two stacks, unless you know what you are doing 527# You can enable one or both FireWire driver stacks.
528#
529
530#
531# See the help texts for more information.
506# 532#
507# CONFIG_FIREWIRE is not set 533# CONFIG_FIREWIRE is not set
508# CONFIG_IEEE1394 is not set 534# CONFIG_IEEE1394 is not set
509# CONFIG_I2O is not set 535# CONFIG_I2O is not set
510# CONFIG_MACINTOSH_DRIVERS is not set 536# CONFIG_MACINTOSH_DRIVERS is not set
511CONFIG_NETDEVICES=y 537CONFIG_NETDEVICES=y
512CONFIG_COMPAT_NET_DEV_OPS=y
513# CONFIG_DUMMY is not set 538# CONFIG_DUMMY is not set
514# CONFIG_BONDING is not set 539# CONFIG_BONDING is not set
515# CONFIG_MACVLAN is not set 540# CONFIG_MACVLAN is not set
@@ -556,6 +581,7 @@ CONFIG_MII=y
556# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 581# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
557# CONFIG_NET_PCI is not set 582# CONFIG_NET_PCI is not set
558# CONFIG_B44 is not set 583# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set
559# CONFIG_ATL2 is not set 585# CONFIG_ATL2 is not set
560CONFIG_NETDEV_1000=y 586CONFIG_NETDEV_1000=y
561# CONFIG_ACENIC is not set 587# CONFIG_ACENIC is not set
@@ -575,8 +601,10 @@ CONFIG_E1000=y
575# CONFIG_VIA_VELOCITY is not set 601# CONFIG_VIA_VELOCITY is not set
576# CONFIG_TIGON3 is not set 602# CONFIG_TIGON3 is not set
577# CONFIG_BNX2 is not set 603# CONFIG_BNX2 is not set
604# CONFIG_CNIC is not set
578CONFIG_FSL_PQ_MDIO=y 605CONFIG_FSL_PQ_MDIO=y
579CONFIG_GIANFAR=y 606CONFIG_GIANFAR=y
607# CONFIG_MV643XX_ETH is not set
580# CONFIG_QLA3XXX is not set 608# CONFIG_QLA3XXX is not set
581# CONFIG_ATL1 is not set 609# CONFIG_ATL1 is not set
582# CONFIG_ATL1E is not set 610# CONFIG_ATL1E is not set
@@ -698,6 +726,11 @@ CONFIG_GEN_RTC=y
698CONFIG_DEVPORT=y 726CONFIG_DEVPORT=y
699# CONFIG_I2C is not set 727# CONFIG_I2C is not set
700# CONFIG_SPI is not set 728# CONFIG_SPI is not set
729
730#
731# PPS support
732#
733# CONFIG_PPS is not set
701CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 734CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
702# CONFIG_GPIOLIB is not set 735# CONFIG_GPIOLIB is not set
703# CONFIG_W1 is not set 736# CONFIG_W1 is not set
@@ -737,22 +770,7 @@ CONFIG_SSB_POSSIBLE=y
737# CONFIG_HTC_PASIC3 is not set 770# CONFIG_HTC_PASIC3 is not set
738# CONFIG_MFD_TMIO is not set 771# CONFIG_MFD_TMIO is not set
739# CONFIG_REGULATOR is not set 772# CONFIG_REGULATOR is not set
740 773# CONFIG_MEDIA_SUPPORT is not set
741#
742# Multimedia devices
743#
744
745#
746# Multimedia core support
747#
748# CONFIG_VIDEO_DEV is not set
749# CONFIG_DVB_CORE is not set
750# CONFIG_VIDEO_MEDIA is not set
751
752#
753# Multimedia drivers
754#
755CONFIG_DAB=y
756 774
757# 775#
758# Graphics support 776# Graphics support
@@ -809,6 +827,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
809# CONFIG_DMADEVICES is not set 827# CONFIG_DMADEVICES is not set
810# CONFIG_AUXDISPLAY is not set 828# CONFIG_AUXDISPLAY is not set
811# CONFIG_UIO is not set 829# CONFIG_UIO is not set
830
831#
832# TI VLYNQ
833#
812# CONFIG_STAGING is not set 834# CONFIG_STAGING is not set
813 835
814# 836#
@@ -828,10 +850,12 @@ CONFIG_FS_MBCACHE=y
828# CONFIG_REISERFS_FS is not set 850# CONFIG_REISERFS_FS is not set
829# CONFIG_JFS_FS is not set 851# CONFIG_JFS_FS is not set
830# CONFIG_FS_POSIX_ACL is not set 852# CONFIG_FS_POSIX_ACL is not set
831CONFIG_FILE_LOCKING=y
832# CONFIG_XFS_FS is not set 853# CONFIG_XFS_FS is not set
854# CONFIG_GFS2_FS is not set
833# CONFIG_OCFS2_FS is not set 855# CONFIG_OCFS2_FS is not set
834# CONFIG_BTRFS_FS is not set 856# CONFIG_BTRFS_FS is not set
857CONFIG_FILE_LOCKING=y
858CONFIG_FSNOTIFY=y
835CONFIG_DNOTIFY=y 859CONFIG_DNOTIFY=y
836CONFIG_INOTIFY=y 860CONFIG_INOTIFY=y
837CONFIG_INOTIFY_USER=y 861CONFIG_INOTIFY_USER=y
@@ -946,6 +970,7 @@ CONFIG_HAS_IOPORT=y
946CONFIG_HAS_DMA=y 970CONFIG_HAS_DMA=y
947CONFIG_HAVE_LMB=y 971CONFIG_HAVE_LMB=y
948CONFIG_NLATTR=y 972CONFIG_NLATTR=y
973CONFIG_GENERIC_ATOMIC64=y
949 974
950# 975#
951# Kernel hacking 976# Kernel hacking
@@ -976,6 +1001,9 @@ CONFIG_SCHED_DEBUG=y
976# CONFIG_RT_MUTEX_TESTER is not set 1001# CONFIG_RT_MUTEX_TESTER is not set
977# CONFIG_DEBUG_SPINLOCK is not set 1002# CONFIG_DEBUG_SPINLOCK is not set
978CONFIG_DEBUG_MUTEXES=y 1003CONFIG_DEBUG_MUTEXES=y
1004# CONFIG_DEBUG_LOCK_ALLOC is not set
1005# CONFIG_PROVE_LOCKING is not set
1006# CONFIG_LOCK_STAT is not set
979# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1007# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
980# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1008# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
981# CONFIG_DEBUG_KOBJECT is not set 1009# CONFIG_DEBUG_KOBJECT is not set
@@ -987,7 +1015,6 @@ CONFIG_DEBUG_MUTEXES=y
987# CONFIG_DEBUG_LIST is not set 1015# CONFIG_DEBUG_LIST is not set
988# CONFIG_DEBUG_SG is not set 1016# CONFIG_DEBUG_SG is not set
989# CONFIG_DEBUG_NOTIFIERS is not set 1017# CONFIG_DEBUG_NOTIFIERS is not set
990# CONFIG_BOOT_PRINTK_DELAY is not set
991# CONFIG_RCU_TORTURE_TEST is not set 1018# CONFIG_RCU_TORTURE_TEST is not set
992# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1019# CONFIG_RCU_CPU_STALL_DETECTOR is not set
993# CONFIG_BACKTRACE_SELF_TEST is not set 1020# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1001,16 +1028,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1001CONFIG_HAVE_DYNAMIC_FTRACE=y 1028CONFIG_HAVE_DYNAMIC_FTRACE=y
1002CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1029CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1003CONFIG_TRACING_SUPPORT=y 1030CONFIG_TRACING_SUPPORT=y
1004 1031CONFIG_FTRACE=y
1005#
1006# Tracers
1007#
1008# CONFIG_FUNCTION_TRACER is not set 1032# CONFIG_FUNCTION_TRACER is not set
1033# CONFIG_IRQSOFF_TRACER is not set
1009# CONFIG_SCHED_TRACER is not set 1034# CONFIG_SCHED_TRACER is not set
1010# CONFIG_CONTEXT_SWITCH_TRACER is not set 1035# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1011# CONFIG_EVENT_TRACER is not set
1012# CONFIG_BOOT_TRACER is not set 1036# CONFIG_BOOT_TRACER is not set
1013# CONFIG_TRACE_BRANCH_PROFILING is not set 1037CONFIG_BRANCH_PROFILE_NONE=y
1038# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1039# CONFIG_PROFILE_ALL_BRANCHES is not set
1014# CONFIG_STACK_TRACER is not set 1040# CONFIG_STACK_TRACER is not set
1015# CONFIG_KMEMTRACE is not set 1041# CONFIG_KMEMTRACE is not set
1016# CONFIG_WORKQUEUE_TRACER is not set 1042# CONFIG_WORKQUEUE_TRACER is not set
@@ -1018,6 +1044,9 @@ CONFIG_TRACING_SUPPORT=y
1018# CONFIG_SAMPLES is not set 1044# CONFIG_SAMPLES is not set
1019CONFIG_HAVE_ARCH_KGDB=y 1045CONFIG_HAVE_ARCH_KGDB=y
1020# CONFIG_KGDB is not set 1046# CONFIG_KGDB is not set
1047# CONFIG_KMEMCHECK is not set
1048# CONFIG_PPC_DISABLE_WERROR is not set
1049CONFIG_PPC_WERROR=y
1021CONFIG_PRINT_STACK_DEPTH=64 1050CONFIG_PRINT_STACK_DEPTH=64
1022# CONFIG_DEBUG_STACKOVERFLOW is not set 1051# CONFIG_DEBUG_STACKOVERFLOW is not set
1023# CONFIG_DEBUG_STACK_USAGE is not set 1052# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/sbc8548_defconfig b/arch/powerpc/configs/85xx/sbc8548_defconfig
index 6c36c9c7abfd..2726fca1d694 100644
--- a/arch/powerpc/configs/85xx/sbc8548_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8548_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:19 2009 4# Wed Jul 29 23:32:18 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -110,7 +113,6 @@ CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_EXTRA_PASS is not set 115# CONFIG_KALLSYMS_EXTRA_PASS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114CONFIG_HOTPLUG=y 116CONFIG_HOTPLUG=y
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,8 +125,15 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 138CONFIG_SLAB=y
130# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -144,7 +157,7 @@ CONFIG_RT_MUTEXES=y
144CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
145# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
146CONFIG_BLOCK=y 159CONFIG_BLOCK=y
147# CONFIG_LBD is not set 160CONFIG_LBDAF=y
148# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
149# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
150 163
@@ -177,6 +190,7 @@ CONFIG_MPC85xx=y
177# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
178# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
179# CONFIG_KSI8560 is not set 192# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set
180# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
181# CONFIG_TQM8540 is not set 195# CONFIG_TQM8540 is not set
182# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -224,6 +238,7 @@ CONFIG_BINFMT_ELF=y
224CONFIG_BINFMT_MISC=y 238CONFIG_BINFMT_MISC=y
225CONFIG_MATH_EMULATION=y 239CONFIG_MATH_EMULATION=y
226# CONFIG_IOMMU_HELPER is not set 240# CONFIG_IOMMU_HELPER is not set
241# CONFIG_SWIOTLB is not set
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
228CONFIG_ARCH_HAS_WALK_MEMORY=y 243CONFIG_ARCH_HAS_WALK_MEMORY=y
229CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +257,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 257CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 258CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 265# CONFIG_PPC_64K_PAGES is not set
@@ -354,6 +369,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
354# CONFIG_ECONET is not set 369# CONFIG_ECONET is not set
355# CONFIG_WAN_ROUTER is not set 370# CONFIG_WAN_ROUTER is not set
356# CONFIG_PHONET is not set 371# CONFIG_PHONET is not set
372# CONFIG_IEEE802154 is not set
357# CONFIG_NET_SCHED is not set 373# CONFIG_NET_SCHED is not set
358# CONFIG_DCB is not set 374# CONFIG_DCB is not set
359 375
@@ -371,7 +387,11 @@ CONFIG_WIRELESS=y
371CONFIG_WIRELESS_OLD_REGULATORY=y 387CONFIG_WIRELESS_OLD_REGULATORY=y
372# CONFIG_WIRELESS_EXT is not set 388# CONFIG_WIRELESS_EXT is not set
373# CONFIG_LIB80211 is not set 389# CONFIG_LIB80211 is not set
374# CONFIG_MAC80211 is not set 390
391#
392# CFG80211 needs to be enabled for MAC80211
393#
394CONFIG_MAC80211_DEFAULT_PS_VALUE=0
375# CONFIG_WIMAX is not set 395# CONFIG_WIMAX is not set
376# CONFIG_RFKILL is not set 396# CONFIG_RFKILL is not set
377# CONFIG_NET_9P is not set 397# CONFIG_NET_9P is not set
@@ -391,6 +411,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
391# CONFIG_CONNECTOR is not set 411# CONFIG_CONNECTOR is not set
392# CONFIG_MTD is not set 412# CONFIG_MTD is not set
393CONFIG_OF_DEVICE=y 413CONFIG_OF_DEVICE=y
414CONFIG_OF_MDIO=y
394# CONFIG_PARPORT is not set 415# CONFIG_PARPORT is not set
395CONFIG_BLK_DEV=y 416CONFIG_BLK_DEV=y
396# CONFIG_BLK_DEV_FD is not set 417# CONFIG_BLK_DEV_FD is not set
@@ -422,6 +443,7 @@ CONFIG_MISC_DEVICES=y
422# EEPROM support 443# EEPROM support
423# 444#
424# CONFIG_EEPROM_93CX6 is not set 445# CONFIG_EEPROM_93CX6 is not set
446# CONFIG_CB710_CORE is not set
425CONFIG_HAVE_IDE=y 447CONFIG_HAVE_IDE=y
426# CONFIG_IDE is not set 448# CONFIG_IDE is not set
427 449
@@ -441,14 +463,17 @@ CONFIG_HAVE_IDE=y
441# 463#
442 464
443# 465#
444# Enable only one of the two stacks, unless you know what you are doing 466# You can enable one or both FireWire driver stacks.
467#
468
469#
470# See the help texts for more information.
445# 471#
446# CONFIG_FIREWIRE is not set 472# CONFIG_FIREWIRE is not set
447# CONFIG_IEEE1394 is not set 473# CONFIG_IEEE1394 is not set
448# CONFIG_I2O is not set 474# CONFIG_I2O is not set
449# CONFIG_MACINTOSH_DRIVERS is not set 475# CONFIG_MACINTOSH_DRIVERS is not set
450CONFIG_NETDEVICES=y 476CONFIG_NETDEVICES=y
451CONFIG_COMPAT_NET_DEV_OPS=y
452# CONFIG_DUMMY is not set 477# CONFIG_DUMMY is not set
453# CONFIG_BONDING is not set 478# CONFIG_BONDING is not set
454# CONFIG_MACVLAN is not set 479# CONFIG_MACVLAN is not set
@@ -495,6 +520,7 @@ CONFIG_MII=y
495# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 520# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
496# CONFIG_NET_PCI is not set 521# CONFIG_NET_PCI is not set
497# CONFIG_B44 is not set 522# CONFIG_B44 is not set
523# CONFIG_KS8842 is not set
498# CONFIG_ATL2 is not set 524# CONFIG_ATL2 is not set
499CONFIG_NETDEV_1000=y 525CONFIG_NETDEV_1000=y
500# CONFIG_ACENIC is not set 526# CONFIG_ACENIC is not set
@@ -514,8 +540,10 @@ CONFIG_NETDEV_1000=y
514# CONFIG_VIA_VELOCITY is not set 540# CONFIG_VIA_VELOCITY is not set
515# CONFIG_TIGON3 is not set 541# CONFIG_TIGON3 is not set
516# CONFIG_BNX2 is not set 542# CONFIG_BNX2 is not set
543# CONFIG_CNIC is not set
517CONFIG_FSL_PQ_MDIO=y 544CONFIG_FSL_PQ_MDIO=y
518CONFIG_GIANFAR=y 545CONFIG_GIANFAR=y
546# CONFIG_MV643XX_ETH is not set
519# CONFIG_QLA3XXX is not set 547# CONFIG_QLA3XXX is not set
520# CONFIG_ATL1 is not set 548# CONFIG_ATL1 is not set
521# CONFIG_ATL1E is not set 549# CONFIG_ATL1E is not set
@@ -637,6 +665,11 @@ CONFIG_GEN_RTC=y
637CONFIG_DEVPORT=y 665CONFIG_DEVPORT=y
638# CONFIG_I2C is not set 666# CONFIG_I2C is not set
639# CONFIG_SPI is not set 667# CONFIG_SPI is not set
668
669#
670# PPS support
671#
672# CONFIG_PPS is not set
640CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 673CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
641# CONFIG_GPIOLIB is not set 674# CONFIG_GPIOLIB is not set
642# CONFIG_W1 is not set 675# CONFIG_W1 is not set
@@ -676,22 +709,7 @@ CONFIG_SSB_POSSIBLE=y
676# CONFIG_HTC_PASIC3 is not set 709# CONFIG_HTC_PASIC3 is not set
677# CONFIG_MFD_TMIO is not set 710# CONFIG_MFD_TMIO is not set
678# CONFIG_REGULATOR is not set 711# CONFIG_REGULATOR is not set
679 712# CONFIG_MEDIA_SUPPORT is not set
680#
681# Multimedia devices
682#
683
684#
685# Multimedia core support
686#
687# CONFIG_VIDEO_DEV is not set
688# CONFIG_DVB_CORE is not set
689# CONFIG_VIDEO_MEDIA is not set
690
691#
692# Multimedia drivers
693#
694CONFIG_DAB=y
695 713
696# 714#
697# Graphics support 715# Graphics support
@@ -721,6 +739,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
721# CONFIG_DMADEVICES is not set 739# CONFIG_DMADEVICES is not set
722# CONFIG_AUXDISPLAY is not set 740# CONFIG_AUXDISPLAY is not set
723# CONFIG_UIO is not set 741# CONFIG_UIO is not set
742
743#
744# TI VLYNQ
745#
724# CONFIG_STAGING is not set 746# CONFIG_STAGING is not set
725 747
726# 748#
@@ -732,10 +754,12 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
732# CONFIG_REISERFS_FS is not set 754# CONFIG_REISERFS_FS is not set
733# CONFIG_JFS_FS is not set 755# CONFIG_JFS_FS is not set
734# CONFIG_FS_POSIX_ACL is not set 756# CONFIG_FS_POSIX_ACL is not set
735CONFIG_FILE_LOCKING=y
736# CONFIG_XFS_FS is not set 757# CONFIG_XFS_FS is not set
758# CONFIG_GFS2_FS is not set
737# CONFIG_OCFS2_FS is not set 759# CONFIG_OCFS2_FS is not set
738# CONFIG_BTRFS_FS is not set 760# CONFIG_BTRFS_FS is not set
761CONFIG_FILE_LOCKING=y
762CONFIG_FSNOTIFY=y
739CONFIG_DNOTIFY=y 763CONFIG_DNOTIFY=y
740CONFIG_INOTIFY=y 764CONFIG_INOTIFY=y
741CONFIG_INOTIFY_USER=y 765CONFIG_INOTIFY_USER=y
@@ -838,6 +862,7 @@ CONFIG_HAS_IOPORT=y
838CONFIG_HAS_DMA=y 862CONFIG_HAS_DMA=y
839CONFIG_HAVE_LMB=y 863CONFIG_HAVE_LMB=y
840CONFIG_NLATTR=y 864CONFIG_NLATTR=y
865CONFIG_GENERIC_ATOMIC64=y
841 866
842# 867#
843# Kernel hacking 868# Kernel hacking
@@ -861,22 +886,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
861CONFIG_HAVE_DYNAMIC_FTRACE=y 886CONFIG_HAVE_DYNAMIC_FTRACE=y
862CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 887CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
863CONFIG_TRACING_SUPPORT=y 888CONFIG_TRACING_SUPPORT=y
864 889# CONFIG_FTRACE is not set
865#
866# Tracers
867#
868# CONFIG_FUNCTION_TRACER is not set
869# CONFIG_SCHED_TRACER is not set
870# CONFIG_CONTEXT_SWITCH_TRACER is not set
871# CONFIG_EVENT_TRACER is not set
872# CONFIG_BOOT_TRACER is not set
873# CONFIG_TRACE_BRANCH_PROFILING is not set
874# CONFIG_STACK_TRACER is not set
875# CONFIG_KMEMTRACE is not set
876# CONFIG_WORKQUEUE_TRACER is not set
877# CONFIG_BLK_DEV_IO_TRACE is not set
878# CONFIG_SAMPLES is not set 890# CONFIG_SAMPLES is not set
879CONFIG_HAVE_ARCH_KGDB=y 891CONFIG_HAVE_ARCH_KGDB=y
892# CONFIG_PPC_DISABLE_WERROR is not set
893CONFIG_PPC_WERROR=y
880CONFIG_PRINT_STACK_DEPTH=64 894CONFIG_PRINT_STACK_DEPTH=64
881# CONFIG_IRQSTACKS is not set 895# CONFIG_IRQSTACKS is not set
882# CONFIG_PPC_EARLY_DEBUG is not set 896# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/sbc8560_defconfig b/arch/powerpc/configs/85xx/sbc8560_defconfig
index 4aaf1a6bdc7d..b0c469823b02 100644
--- a/arch/powerpc/configs/85xx/sbc8560_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8560_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:20 2009 4# Wed Jul 29 23:32:19 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,7 +126,14 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 138CONFIG_SLAB=y
130# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -144,7 +157,7 @@ CONFIG_RT_MUTEXES=y
144CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
145# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
146CONFIG_BLOCK=y 159CONFIG_BLOCK=y
147# CONFIG_LBD is not set 160CONFIG_LBDAF=y
148# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
149# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
150 163
@@ -177,6 +190,7 @@ CONFIG_MPC85xx=y
177# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
178# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
179# CONFIG_KSI8560 is not set 192# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set
180# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
181# CONFIG_TQM8540 is not set 195# CONFIG_TQM8540 is not set
182# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -224,6 +238,7 @@ CONFIG_BINFMT_ELF=y
224CONFIG_BINFMT_MISC=y 238CONFIG_BINFMT_MISC=y
225# CONFIG_MATH_EMULATION is not set 239# CONFIG_MATH_EMULATION is not set
226# CONFIG_IOMMU_HELPER is not set 240# CONFIG_IOMMU_HELPER is not set
241# CONFIG_SWIOTLB is not set
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
228CONFIG_ARCH_HAS_WALK_MEMORY=y 243CONFIG_ARCH_HAS_WALK_MEMORY=y
229CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +257,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 257CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 258CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 265# CONFIG_PPC_64K_PAGES is not set
@@ -346,6 +361,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
346# CONFIG_ECONET is not set 361# CONFIG_ECONET is not set
347# CONFIG_WAN_ROUTER is not set 362# CONFIG_WAN_ROUTER is not set
348# CONFIG_PHONET is not set 363# CONFIG_PHONET is not set
364# CONFIG_IEEE802154 is not set
349# CONFIG_NET_SCHED is not set 365# CONFIG_NET_SCHED is not set
350# CONFIG_DCB is not set 366# CONFIG_DCB is not set
351 367
@@ -363,7 +379,11 @@ CONFIG_WIRELESS=y
363CONFIG_WIRELESS_OLD_REGULATORY=y 379CONFIG_WIRELESS_OLD_REGULATORY=y
364# CONFIG_WIRELESS_EXT is not set 380# CONFIG_WIRELESS_EXT is not set
365# CONFIG_LIB80211 is not set 381# CONFIG_LIB80211 is not set
366# CONFIG_MAC80211 is not set 382
383#
384# CFG80211 needs to be enabled for MAC80211
385#
386CONFIG_MAC80211_DEFAULT_PS_VALUE=0
367# CONFIG_WIMAX is not set 387# CONFIG_WIMAX is not set
368# CONFIG_RFKILL is not set 388# CONFIG_RFKILL is not set
369# CONFIG_NET_9P is not set 389# CONFIG_NET_9P is not set
@@ -385,6 +405,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
385# CONFIG_CONNECTOR is not set 405# CONFIG_CONNECTOR is not set
386# CONFIG_MTD is not set 406# CONFIG_MTD is not set
387CONFIG_OF_DEVICE=y 407CONFIG_OF_DEVICE=y
408CONFIG_OF_MDIO=y
388# CONFIG_PARPORT is not set 409# CONFIG_PARPORT is not set
389CONFIG_BLK_DEV=y 410CONFIG_BLK_DEV=y
390# CONFIG_BLK_DEV_FD is not set 411# CONFIG_BLK_DEV_FD is not set
@@ -421,7 +442,6 @@ CONFIG_HAVE_IDE=y
421# CONFIG_MD is not set 442# CONFIG_MD is not set
422# CONFIG_MACINTOSH_DRIVERS is not set 443# CONFIG_MACINTOSH_DRIVERS is not set
423CONFIG_NETDEVICES=y 444CONFIG_NETDEVICES=y
424CONFIG_COMPAT_NET_DEV_OPS=y
425# CONFIG_DUMMY is not set 445# CONFIG_DUMMY is not set
426# CONFIG_BONDING is not set 446# CONFIG_BONDING is not set
427# CONFIG_MACVLAN is not set 447# CONFIG_MACVLAN is not set
@@ -460,9 +480,11 @@ CONFIG_MII=y
460# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 480# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
461# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 481# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
462# CONFIG_B44 is not set 482# CONFIG_B44 is not set
483# CONFIG_KS8842 is not set
463CONFIG_NETDEV_1000=y 484CONFIG_NETDEV_1000=y
464CONFIG_FSL_PQ_MDIO=y 485CONFIG_FSL_PQ_MDIO=y
465CONFIG_GIANFAR=y 486CONFIG_GIANFAR=y
487# CONFIG_MV643XX_ETH is not set
466CONFIG_NETDEV_10000=y 488CONFIG_NETDEV_10000=y
467 489
468# 490#
@@ -551,6 +573,11 @@ CONFIG_LEGACY_PTY_COUNT=256
551# CONFIG_TCG_TPM is not set 573# CONFIG_TCG_TPM is not set
552# CONFIG_I2C is not set 574# CONFIG_I2C is not set
553# CONFIG_SPI is not set 575# CONFIG_SPI is not set
576
577#
578# PPS support
579#
580# CONFIG_PPS is not set
554CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 581CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
555# CONFIG_GPIOLIB is not set 582# CONFIG_GPIOLIB is not set
556# CONFIG_W1 is not set 583# CONFIG_W1 is not set
@@ -586,22 +613,7 @@ CONFIG_SSB_POSSIBLE=y
586# CONFIG_HTC_PASIC3 is not set 613# CONFIG_HTC_PASIC3 is not set
587# CONFIG_MFD_TMIO is not set 614# CONFIG_MFD_TMIO is not set
588# CONFIG_REGULATOR is not set 615# CONFIG_REGULATOR is not set
589 616# CONFIG_MEDIA_SUPPORT is not set
590#
591# Multimedia devices
592#
593
594#
595# Multimedia core support
596#
597# CONFIG_VIDEO_DEV is not set
598# CONFIG_DVB_CORE is not set
599# CONFIG_VIDEO_MEDIA is not set
600
601#
602# Multimedia drivers
603#
604CONFIG_DAB=y
605 617
606# 618#
607# Graphics support 619# Graphics support
@@ -690,6 +702,10 @@ CONFIG_RTC_DRV_M48T59=y
690# CONFIG_DMADEVICES is not set 702# CONFIG_DMADEVICES is not set
691# CONFIG_AUXDISPLAY is not set 703# CONFIG_AUXDISPLAY is not set
692# CONFIG_UIO is not set 704# CONFIG_UIO is not set
705
706#
707# TI VLYNQ
708#
693# CONFIG_STAGING is not set 709# CONFIG_STAGING is not set
694 710
695# 711#
@@ -701,10 +717,12 @@ CONFIG_RTC_DRV_M48T59=y
701# CONFIG_REISERFS_FS is not set 717# CONFIG_REISERFS_FS is not set
702# CONFIG_JFS_FS is not set 718# CONFIG_JFS_FS is not set
703# CONFIG_FS_POSIX_ACL is not set 719# CONFIG_FS_POSIX_ACL is not set
704CONFIG_FILE_LOCKING=y
705# CONFIG_XFS_FS is not set 720# CONFIG_XFS_FS is not set
721# CONFIG_GFS2_FS is not set
706# CONFIG_OCFS2_FS is not set 722# CONFIG_OCFS2_FS is not set
707# CONFIG_BTRFS_FS is not set 723# CONFIG_BTRFS_FS is not set
724CONFIG_FILE_LOCKING=y
725CONFIG_FSNOTIFY=y
708CONFIG_DNOTIFY=y 726CONFIG_DNOTIFY=y
709CONFIG_INOTIFY=y 727CONFIG_INOTIFY=y
710CONFIG_INOTIFY_USER=y 728CONFIG_INOTIFY_USER=y
@@ -819,6 +837,7 @@ CONFIG_HAS_IOPORT=y
819CONFIG_HAS_DMA=y 837CONFIG_HAS_DMA=y
820CONFIG_HAVE_LMB=y 838CONFIG_HAVE_LMB=y
821CONFIG_NLATTR=y 839CONFIG_NLATTR=y
840CONFIG_GENERIC_ATOMIC64=y
822 841
823# 842#
824# Kernel hacking 843# Kernel hacking
@@ -848,6 +867,9 @@ CONFIG_SCHED_DEBUG=y
848# CONFIG_RT_MUTEX_TESTER is not set 867# CONFIG_RT_MUTEX_TESTER is not set
849# CONFIG_DEBUG_SPINLOCK is not set 868# CONFIG_DEBUG_SPINLOCK is not set
850CONFIG_DEBUG_MUTEXES=y 869CONFIG_DEBUG_MUTEXES=y
870# CONFIG_DEBUG_LOCK_ALLOC is not set
871# CONFIG_PROVE_LOCKING is not set
872# CONFIG_LOCK_STAT is not set
851# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 873# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
852# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 874# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
853# CONFIG_DEBUG_KOBJECT is not set 875# CONFIG_DEBUG_KOBJECT is not set
@@ -859,7 +881,6 @@ CONFIG_DEBUG_MUTEXES=y
859# CONFIG_DEBUG_LIST is not set 881# CONFIG_DEBUG_LIST is not set
860# CONFIG_DEBUG_SG is not set 882# CONFIG_DEBUG_SG is not set
861# CONFIG_DEBUG_NOTIFIERS is not set 883# CONFIG_DEBUG_NOTIFIERS is not set
862# CONFIG_BOOT_PRINTK_DELAY is not set
863# CONFIG_RCU_TORTURE_TEST is not set 884# CONFIG_RCU_TORTURE_TEST is not set
864# CONFIG_RCU_CPU_STALL_DETECTOR is not set 885# CONFIG_RCU_CPU_STALL_DETECTOR is not set
865# CONFIG_BACKTRACE_SELF_TEST is not set 886# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -873,16 +894,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
873CONFIG_HAVE_DYNAMIC_FTRACE=y 894CONFIG_HAVE_DYNAMIC_FTRACE=y
874CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 895CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
875CONFIG_TRACING_SUPPORT=y 896CONFIG_TRACING_SUPPORT=y
876 897CONFIG_FTRACE=y
877#
878# Tracers
879#
880# CONFIG_FUNCTION_TRACER is not set 898# CONFIG_FUNCTION_TRACER is not set
899# CONFIG_IRQSOFF_TRACER is not set
881# CONFIG_SCHED_TRACER is not set 900# CONFIG_SCHED_TRACER is not set
882# CONFIG_CONTEXT_SWITCH_TRACER is not set 901# CONFIG_ENABLE_DEFAULT_TRACERS is not set
883# CONFIG_EVENT_TRACER is not set
884# CONFIG_BOOT_TRACER is not set 902# CONFIG_BOOT_TRACER is not set
885# CONFIG_TRACE_BRANCH_PROFILING is not set 903CONFIG_BRANCH_PROFILE_NONE=y
904# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
905# CONFIG_PROFILE_ALL_BRANCHES is not set
886# CONFIG_STACK_TRACER is not set 906# CONFIG_STACK_TRACER is not set
887# CONFIG_KMEMTRACE is not set 907# CONFIG_KMEMTRACE is not set
888# CONFIG_WORKQUEUE_TRACER is not set 908# CONFIG_WORKQUEUE_TRACER is not set
@@ -890,6 +910,9 @@ CONFIG_TRACING_SUPPORT=y
890# CONFIG_SAMPLES is not set 910# CONFIG_SAMPLES is not set
891CONFIG_HAVE_ARCH_KGDB=y 911CONFIG_HAVE_ARCH_KGDB=y
892# CONFIG_KGDB is not set 912# CONFIG_KGDB is not set
913# CONFIG_KMEMCHECK is not set
914# CONFIG_PPC_DISABLE_WERROR is not set
915CONFIG_PPC_WERROR=y
893CONFIG_PRINT_STACK_DEPTH=64 916CONFIG_PRINT_STACK_DEPTH=64
894# CONFIG_DEBUG_STACKOVERFLOW is not set 917# CONFIG_DEBUG_STACKOVERFLOW is not set
895# CONFIG_DEBUG_STACK_USAGE is not set 918# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/socrates_defconfig b/arch/powerpc/configs/85xx/socrates_defconfig
index 79984589db69..04c85dada845 100644
--- a/arch/powerpc/configs/85xx/socrates_defconfig
+++ b/arch/powerpc/configs/85xx/socrates_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:21 2009 4# Wed Jul 29 23:32:19 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -109,7 +112,6 @@ CONFIG_ANON_INODES=y
109CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
111# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
112# CONFIG_STRIP_ASM_SYMS is not set
113# CONFIG_HOTPLUG is not set 115# CONFIG_HOTPLUG is not set
114CONFIG_PRINTK=y 116CONFIG_PRINTK=y
115CONFIG_BUG=y 117CONFIG_BUG=y
@@ -122,9 +124,16 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 125CONFIG_SHMEM=y
124CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
130CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -149,7 +162,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
149# CONFIG_MODVERSIONS is not set 162# CONFIG_MODVERSIONS is not set
150# CONFIG_MODULE_SRCVERSION_ALL is not set 163# CONFIG_MODULE_SRCVERSION_ALL is not set
151CONFIG_BLOCK=y 164CONFIG_BLOCK=y
152# CONFIG_LBD is not set 165CONFIG_LBDAF=y
153# CONFIG_BLK_DEV_BSG is not set 166# CONFIG_BLK_DEV_BSG is not set
154# CONFIG_BLK_DEV_INTEGRITY is not set 167# CONFIG_BLK_DEV_INTEGRITY is not set
155 168
@@ -182,6 +195,7 @@ CONFIG_MPC85xx=y
182# CONFIG_MPC85xx_DS is not set 195# CONFIG_MPC85xx_DS is not set
183CONFIG_SOCRATES=y 196CONFIG_SOCRATES=y
184# CONFIG_KSI8560 is not set 197# CONFIG_KSI8560 is not set
198# CONFIG_XES_MPC85xx is not set
185# CONFIG_STX_GP3 is not set 199# CONFIG_STX_GP3 is not set
186# CONFIG_TQM8540 is not set 200# CONFIG_TQM8540 is not set
187# CONFIG_TQM8541 is not set 201# CONFIG_TQM8541 is not set
@@ -229,6 +243,7 @@ CONFIG_BINFMT_ELF=y
229# CONFIG_BINFMT_MISC is not set 243# CONFIG_BINFMT_MISC is not set
230CONFIG_MATH_EMULATION=y 244CONFIG_MATH_EMULATION=y
231# CONFIG_IOMMU_HELPER is not set 245# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set
232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 248CONFIG_ARCH_HAS_WALK_MEMORY=y
234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -247,9 +262,9 @@ CONFIG_MIGRATION=y
247CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
248CONFIG_BOUNCE=y 263CONFIG_BOUNCE=y
249CONFIG_VIRT_TO_BUS=y 264CONFIG_VIRT_TO_BUS=y
250CONFIG_UNEVICTABLE_LRU=y
251CONFIG_HAVE_MLOCK=y 265CONFIG_HAVE_MLOCK=y
252CONFIG_HAVE_MLOCKED_PAGE_BIT=y 266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
253CONFIG_PPC_4K_PAGES=y 268CONFIG_PPC_4K_PAGES=y
254# CONFIG_PPC_16K_PAGES is not set 269# CONFIG_PPC_16K_PAGES is not set
255# CONFIG_PPC_64K_PAGES is not set 270# CONFIG_PPC_64K_PAGES is not set
@@ -357,6 +372,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_ECONET is not set 372# CONFIG_ECONET is not set
358# CONFIG_WAN_ROUTER is not set 373# CONFIG_WAN_ROUTER is not set
359# CONFIG_PHONET is not set 374# CONFIG_PHONET is not set
375# CONFIG_IEEE802154 is not set
360# CONFIG_NET_SCHED is not set 376# CONFIG_NET_SCHED is not set
361# CONFIG_DCB is not set 377# CONFIG_DCB is not set
362 378
@@ -373,6 +389,7 @@ CONFIG_CAN_BCM=y
373# CAN Device Drivers 389# CAN Device Drivers
374# 390#
375# CONFIG_CAN_VCAN is not set 391# CONFIG_CAN_VCAN is not set
392# CONFIG_CAN_DEV is not set
376# CONFIG_CAN_DEBUG_DEVICES is not set 393# CONFIG_CAN_DEBUG_DEVICES is not set
377# CONFIG_IRDA is not set 394# CONFIG_IRDA is not set
378# CONFIG_BT is not set 395# CONFIG_BT is not set
@@ -382,7 +399,11 @@ CONFIG_WIRELESS=y
382# CONFIG_WIRELESS_OLD_REGULATORY is not set 399# CONFIG_WIRELESS_OLD_REGULATORY is not set
383# CONFIG_WIRELESS_EXT is not set 400# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 401# CONFIG_LIB80211 is not set
385# CONFIG_MAC80211 is not set 402
403#
404# CFG80211 needs to be enabled for MAC80211
405#
406CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# CONFIG_WIMAX is not set 407# CONFIG_WIMAX is not set
387# CONFIG_RFKILL is not set 408# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set 409# CONFIG_NET_9P is not set
@@ -499,6 +520,7 @@ CONFIG_MTD_NAND_SOCRATES=y
499CONFIG_OF_DEVICE=y 520CONFIG_OF_DEVICE=y
500CONFIG_OF_I2C=y 521CONFIG_OF_I2C=y
501CONFIG_OF_SPI=y 522CONFIG_OF_SPI=y
523CONFIG_OF_MDIO=y
502# CONFIG_PARPORT is not set 524# CONFIG_PARPORT is not set
503CONFIG_BLK_DEV=y 525CONFIG_BLK_DEV=y
504# CONFIG_BLK_DEV_FD is not set 526# CONFIG_BLK_DEV_FD is not set
@@ -535,7 +557,9 @@ CONFIG_MISC_DEVICES=y
535# CONFIG_EEPROM_AT24 is not set 557# CONFIG_EEPROM_AT24 is not set
536# CONFIG_EEPROM_AT25 is not set 558# CONFIG_EEPROM_AT25 is not set
537# CONFIG_EEPROM_LEGACY is not set 559# CONFIG_EEPROM_LEGACY is not set
560# CONFIG_EEPROM_MAX6875 is not set
538# CONFIG_EEPROM_93CX6 is not set 561# CONFIG_EEPROM_93CX6 is not set
562# CONFIG_CB710_CORE is not set
539CONFIG_HAVE_IDE=y 563CONFIG_HAVE_IDE=y
540# CONFIG_IDE is not set 564# CONFIG_IDE is not set
541 565
@@ -558,10 +582,6 @@ CONFIG_BLK_DEV_SD=y
558# CONFIG_BLK_DEV_SR is not set 582# CONFIG_BLK_DEV_SR is not set
559# CONFIG_CHR_DEV_SG is not set 583# CONFIG_CHR_DEV_SG is not set
560# CONFIG_CHR_DEV_SCH is not set 584# CONFIG_CHR_DEV_SCH is not set
561
562#
563# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
564#
565# CONFIG_SCSI_MULTI_LUN is not set 585# CONFIG_SCSI_MULTI_LUN is not set
566# CONFIG_SCSI_CONSTANTS is not set 586# CONFIG_SCSI_CONSTANTS is not set
567# CONFIG_SCSI_LOGGING is not set 587# CONFIG_SCSI_LOGGING is not set
@@ -588,14 +608,17 @@ CONFIG_SCSI_WAIT_SCAN=m
588# 608#
589 609
590# 610#
591# Enable only one of the two stacks, unless you know what you are doing 611# You can enable one or both FireWire driver stacks.
612#
613
614#
615# See the help texts for more information.
592# 616#
593# CONFIG_FIREWIRE is not set 617# CONFIG_FIREWIRE is not set
594# CONFIG_IEEE1394 is not set 618# CONFIG_IEEE1394 is not set
595# CONFIG_I2O is not set 619# CONFIG_I2O is not set
596# CONFIG_MACINTOSH_DRIVERS is not set 620# CONFIG_MACINTOSH_DRIVERS is not set
597CONFIG_NETDEVICES=y 621CONFIG_NETDEVICES=y
598CONFIG_COMPAT_NET_DEV_OPS=y
599# CONFIG_DUMMY is not set 622# CONFIG_DUMMY is not set
600# CONFIG_BONDING is not set 623# CONFIG_BONDING is not set
601# CONFIG_MACVLAN is not set 624# CONFIG_MACVLAN is not set
@@ -643,6 +666,8 @@ CONFIG_MII=y
643# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 666# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
644# CONFIG_NET_PCI is not set 667# CONFIG_NET_PCI is not set
645# CONFIG_B44 is not set 668# CONFIG_B44 is not set
669# CONFIG_KS8842 is not set
670# CONFIG_KS8851 is not set
646# CONFIG_ATL2 is not set 671# CONFIG_ATL2 is not set
647CONFIG_NETDEV_1000=y 672CONFIG_NETDEV_1000=y
648# CONFIG_ACENIC is not set 673# CONFIG_ACENIC is not set
@@ -662,8 +687,10 @@ CONFIG_NETDEV_1000=y
662# CONFIG_VIA_VELOCITY is not set 687# CONFIG_VIA_VELOCITY is not set
663# CONFIG_TIGON3 is not set 688# CONFIG_TIGON3 is not set
664# CONFIG_BNX2 is not set 689# CONFIG_BNX2 is not set
690# CONFIG_CNIC is not set
665CONFIG_FSL_PQ_MDIO=y 691CONFIG_FSL_PQ_MDIO=y
666CONFIG_GIANFAR=y 692CONFIG_GIANFAR=y
693# CONFIG_MV643XX_ETH is not set
667# CONFIG_QLA3XXX is not set 694# CONFIG_QLA3XXX is not set
668# CONFIG_ATL1 is not set 695# CONFIG_ATL1 is not set
669# CONFIG_ATL1E is not set 696# CONFIG_ATL1E is not set
@@ -733,6 +760,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
733# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 760# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
734# CONFIG_TOUCHSCREEN_AD7879_SPI is not set 761# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
735# CONFIG_TOUCHSCREEN_AD7879 is not set 762# CONFIG_TOUCHSCREEN_AD7879 is not set
763# CONFIG_TOUCHSCREEN_EETI is not set
736# CONFIG_TOUCHSCREEN_FUJITSU is not set 764# CONFIG_TOUCHSCREEN_FUJITSU is not set
737# CONFIG_TOUCHSCREEN_GUNZE is not set 765# CONFIG_TOUCHSCREEN_GUNZE is not set
738# CONFIG_TOUCHSCREEN_ELO is not set 766# CONFIG_TOUCHSCREEN_ELO is not set
@@ -746,6 +774,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
746# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 774# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
747# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 775# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
748# CONFIG_TOUCHSCREEN_TSC2007 is not set 776# CONFIG_TOUCHSCREEN_TSC2007 is not set
777# CONFIG_TOUCHSCREEN_W90X900 is not set
749# CONFIG_INPUT_MISC is not set 778# CONFIG_INPUT_MISC is not set
750 779
751# 780#
@@ -862,7 +891,6 @@ CONFIG_I2C_MPC=y
862# CONFIG_SENSORS_PCF8574 is not set 891# CONFIG_SENSORS_PCF8574 is not set
863# CONFIG_PCF8575 is not set 892# CONFIG_PCF8575 is not set
864# CONFIG_SENSORS_PCA9539 is not set 893# CONFIG_SENSORS_PCA9539 is not set
865# CONFIG_SENSORS_MAX6875 is not set
866# CONFIG_SENSORS_TSL2550 is not set 894# CONFIG_SENSORS_TSL2550 is not set
867# CONFIG_I2C_DEBUG_CORE is not set 895# CONFIG_I2C_DEBUG_CORE is not set
868# CONFIG_I2C_DEBUG_ALGO is not set 896# CONFIG_I2C_DEBUG_ALGO is not set
@@ -875,12 +903,18 @@ CONFIG_SPI_MASTER=y
875# SPI Master Controller Drivers 903# SPI Master Controller Drivers
876# 904#
877# CONFIG_SPI_BITBANG is not set 905# CONFIG_SPI_BITBANG is not set
906# CONFIG_SPI_MPC8xxx is not set
878 907
879# 908#
880# SPI Protocol Masters 909# SPI Protocol Masters
881# 910#
882# CONFIG_SPI_SPIDEV is not set 911# CONFIG_SPI_SPIDEV is not set
883# CONFIG_SPI_TLE62X0 is not set 912# CONFIG_SPI_TLE62X0 is not set
913
914#
915# PPS support
916#
917# CONFIG_PPS is not set
884CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 918CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
885# CONFIG_GPIOLIB is not set 919# CONFIG_GPIOLIB is not set
886# CONFIG_W1 is not set 920# CONFIG_W1 is not set
@@ -938,6 +972,7 @@ CONFIG_SENSORS_LM75=y
938# CONFIG_SENSORS_SMSC47B397 is not set 972# CONFIG_SENSORS_SMSC47B397 is not set
939# CONFIG_SENSORS_ADS7828 is not set 973# CONFIG_SENSORS_ADS7828 is not set
940# CONFIG_SENSORS_THMC50 is not set 974# CONFIG_SENSORS_THMC50 is not set
975# CONFIG_SENSORS_TMP401 is not set
941# CONFIG_SENSORS_VIA686A is not set 976# CONFIG_SENSORS_VIA686A is not set
942# CONFIG_SENSORS_VT1211 is not set 977# CONFIG_SENSORS_VT1211 is not set
943# CONFIG_SENSORS_VT8231 is not set 978# CONFIG_SENSORS_VT8231 is not set
@@ -973,24 +1008,10 @@ CONFIG_SSB_POSSIBLE=y
973# CONFIG_MFD_WM8400 is not set 1008# CONFIG_MFD_WM8400 is not set
974# CONFIG_MFD_WM8350_I2C is not set 1009# CONFIG_MFD_WM8350_I2C is not set
975# CONFIG_MFD_PCF50633 is not set 1010# CONFIG_MFD_PCF50633 is not set
1011# CONFIG_AB3100_CORE is not set
1012# CONFIG_EZX_PCAP is not set
976# CONFIG_REGULATOR is not set 1013# CONFIG_REGULATOR is not set
977 1014# CONFIG_MEDIA_SUPPORT is not set
978#
979# Multimedia devices
980#
981
982#
983# Multimedia core support
984#
985# CONFIG_VIDEO_DEV is not set
986# CONFIG_DVB_CORE is not set
987# CONFIG_VIDEO_MEDIA is not set
988
989#
990# Multimedia drivers
991#
992CONFIG_DAB=y
993# CONFIG_USB_DABUSB is not set
994 1015
995# 1016#
996# Graphics support 1017# Graphics support
@@ -1110,7 +1131,7 @@ CONFIG_USB_HID=y
1110# CONFIG_HID_CHERRY is not set 1131# CONFIG_HID_CHERRY is not set
1111# CONFIG_HID_CHICONY is not set 1132# CONFIG_HID_CHICONY is not set
1112# CONFIG_HID_CYPRESS is not set 1133# CONFIG_HID_CYPRESS is not set
1113# CONFIG_DRAGONRISE_FF is not set 1134# CONFIG_HID_DRAGONRISE is not set
1114# CONFIG_HID_EZKEY is not set 1135# CONFIG_HID_EZKEY is not set
1115# CONFIG_HID_KYE is not set 1136# CONFIG_HID_KYE is not set
1116# CONFIG_HID_GYRATION is not set 1137# CONFIG_HID_GYRATION is not set
@@ -1124,10 +1145,11 @@ CONFIG_USB_HID=y
1124# CONFIG_HID_SAMSUNG is not set 1145# CONFIG_HID_SAMSUNG is not set
1125# CONFIG_HID_SONY is not set 1146# CONFIG_HID_SONY is not set
1126# CONFIG_HID_SUNPLUS is not set 1147# CONFIG_HID_SUNPLUS is not set
1127# CONFIG_GREENASIA_FF is not set 1148# CONFIG_HID_GREENASIA is not set
1149# CONFIG_HID_SMARTJOYPLUS is not set
1128# CONFIG_HID_TOPSEED is not set 1150# CONFIG_HID_TOPSEED is not set
1129# CONFIG_THRUSTMASTER_FF is not set 1151# CONFIG_HID_THRUSTMASTER is not set
1130# CONFIG_ZEROPLUS_FF is not set 1152# CONFIG_HID_ZEROPLUS is not set
1131CONFIG_USB_SUPPORT=y 1153CONFIG_USB_SUPPORT=y
1132CONFIG_USB_ARCH_HAS_HCD=y 1154CONFIG_USB_ARCH_HAS_HCD=y
1133CONFIG_USB_ARCH_HAS_OHCI=y 1155CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1153,6 +1175,7 @@ CONFIG_USB_MON=y
1153# USB Host Controller Drivers 1175# USB Host Controller Drivers
1154# 1176#
1155# CONFIG_USB_C67X00_HCD is not set 1177# CONFIG_USB_C67X00_HCD is not set
1178# CONFIG_USB_XHCI_HCD is not set
1156CONFIG_USB_EHCI_HCD=y 1179CONFIG_USB_EHCI_HCD=y
1157# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1180# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1158# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1181# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1162,9 +1185,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1162# CONFIG_USB_ISP116X_HCD is not set 1185# CONFIG_USB_ISP116X_HCD is not set
1163# CONFIG_USB_ISP1760_HCD is not set 1186# CONFIG_USB_ISP1760_HCD is not set
1164CONFIG_USB_OHCI_HCD=y 1187CONFIG_USB_OHCI_HCD=y
1165CONFIG_USB_OHCI_HCD_PPC_OF=y
1166CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1188CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1167# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1189# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1190CONFIG_USB_OHCI_HCD_PPC_OF=y
1168CONFIG_USB_OHCI_HCD_PCI=y 1191CONFIG_USB_OHCI_HCD_PCI=y
1169CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1192CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1170CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1193CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1284,6 +1307,7 @@ CONFIG_RTC_INTF_DEV=y
1284# CONFIG_RTC_DRV_S35390A is not set 1307# CONFIG_RTC_DRV_S35390A is not set
1285# CONFIG_RTC_DRV_FM3130 is not set 1308# CONFIG_RTC_DRV_FM3130 is not set
1286# CONFIG_RTC_DRV_RX8581 is not set 1309# CONFIG_RTC_DRV_RX8581 is not set
1310# CONFIG_RTC_DRV_RX8025 is not set
1287 1311
1288# 1312#
1289# SPI RTC drivers 1313# SPI RTC drivers
@@ -1318,6 +1342,10 @@ CONFIG_RTC_INTF_DEV=y
1318# CONFIG_DMADEVICES is not set 1342# CONFIG_DMADEVICES is not set
1319# CONFIG_AUXDISPLAY is not set 1343# CONFIG_AUXDISPLAY is not set
1320# CONFIG_UIO is not set 1344# CONFIG_UIO is not set
1345
1346#
1347# TI VLYNQ
1348#
1321# CONFIG_STAGING is not set 1349# CONFIG_STAGING is not set
1322 1350
1323# 1351#
@@ -1337,10 +1365,12 @@ CONFIG_FS_MBCACHE=y
1337# CONFIG_REISERFS_FS is not set 1365# CONFIG_REISERFS_FS is not set
1338# CONFIG_JFS_FS is not set 1366# CONFIG_JFS_FS is not set
1339# CONFIG_FS_POSIX_ACL is not set 1367# CONFIG_FS_POSIX_ACL is not set
1340CONFIG_FILE_LOCKING=y
1341# CONFIG_XFS_FS is not set 1368# CONFIG_XFS_FS is not set
1369# CONFIG_GFS2_FS is not set
1342# CONFIG_OCFS2_FS is not set 1370# CONFIG_OCFS2_FS is not set
1343# CONFIG_BTRFS_FS is not set 1371# CONFIG_BTRFS_FS is not set
1372CONFIG_FILE_LOCKING=y
1373CONFIG_FSNOTIFY=y
1344CONFIG_DNOTIFY=y 1374CONFIG_DNOTIFY=y
1345CONFIG_INOTIFY=y 1375CONFIG_INOTIFY=y
1346CONFIG_INOTIFY_USER=y 1376CONFIG_INOTIFY_USER=y
@@ -1449,7 +1479,46 @@ CONFIG_MSDOS_PARTITION=y
1449# CONFIG_KARMA_PARTITION is not set 1479# CONFIG_KARMA_PARTITION is not set
1450# CONFIG_EFI_PARTITION is not set 1480# CONFIG_EFI_PARTITION is not set
1451# CONFIG_SYSV68_PARTITION is not set 1481# CONFIG_SYSV68_PARTITION is not set
1452# CONFIG_NLS is not set 1482CONFIG_NLS=y
1483CONFIG_NLS_DEFAULT="iso8859-1"
1484# CONFIG_NLS_CODEPAGE_437 is not set
1485# CONFIG_NLS_CODEPAGE_737 is not set
1486# CONFIG_NLS_CODEPAGE_775 is not set
1487# CONFIG_NLS_CODEPAGE_850 is not set
1488# CONFIG_NLS_CODEPAGE_852 is not set
1489# CONFIG_NLS_CODEPAGE_855 is not set
1490# CONFIG_NLS_CODEPAGE_857 is not set
1491# CONFIG_NLS_CODEPAGE_860 is not set
1492# CONFIG_NLS_CODEPAGE_861 is not set
1493# CONFIG_NLS_CODEPAGE_862 is not set
1494# CONFIG_NLS_CODEPAGE_863 is not set
1495# CONFIG_NLS_CODEPAGE_864 is not set
1496# CONFIG_NLS_CODEPAGE_865 is not set
1497# CONFIG_NLS_CODEPAGE_866 is not set
1498# CONFIG_NLS_CODEPAGE_869 is not set
1499# CONFIG_NLS_CODEPAGE_936 is not set
1500# CONFIG_NLS_CODEPAGE_950 is not set
1501# CONFIG_NLS_CODEPAGE_932 is not set
1502# CONFIG_NLS_CODEPAGE_949 is not set
1503# CONFIG_NLS_CODEPAGE_874 is not set
1504# CONFIG_NLS_ISO8859_8 is not set
1505# CONFIG_NLS_CODEPAGE_1250 is not set
1506# CONFIG_NLS_CODEPAGE_1251 is not set
1507# CONFIG_NLS_ASCII is not set
1508# CONFIG_NLS_ISO8859_1 is not set
1509# CONFIG_NLS_ISO8859_2 is not set
1510# CONFIG_NLS_ISO8859_3 is not set
1511# CONFIG_NLS_ISO8859_4 is not set
1512# CONFIG_NLS_ISO8859_5 is not set
1513# CONFIG_NLS_ISO8859_6 is not set
1514# CONFIG_NLS_ISO8859_7 is not set
1515# CONFIG_NLS_ISO8859_9 is not set
1516# CONFIG_NLS_ISO8859_13 is not set
1517# CONFIG_NLS_ISO8859_14 is not set
1518# CONFIG_NLS_ISO8859_15 is not set
1519# CONFIG_NLS_KOI8_R is not set
1520# CONFIG_NLS_KOI8_U is not set
1521# CONFIG_NLS_UTF8 is not set
1453# CONFIG_DLM is not set 1522# CONFIG_DLM is not set
1454# CONFIG_BINARY_PRINTF is not set 1523# CONFIG_BINARY_PRINTF is not set
1455 1524
@@ -1473,6 +1542,7 @@ CONFIG_HAS_IOPORT=y
1473CONFIG_HAS_DMA=y 1542CONFIG_HAS_DMA=y
1474CONFIG_HAVE_LMB=y 1543CONFIG_HAVE_LMB=y
1475CONFIG_NLATTR=y 1544CONFIG_NLATTR=y
1545CONFIG_GENERIC_ATOMIC64=y
1476 1546
1477# 1547#
1478# Kernel hacking 1548# Kernel hacking
@@ -1498,22 +1568,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1498CONFIG_HAVE_DYNAMIC_FTRACE=y 1568CONFIG_HAVE_DYNAMIC_FTRACE=y
1499CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1569CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1500CONFIG_TRACING_SUPPORT=y 1570CONFIG_TRACING_SUPPORT=y
1501 1571# CONFIG_FTRACE is not set
1502#
1503# Tracers
1504#
1505# CONFIG_FUNCTION_TRACER is not set
1506# CONFIG_SCHED_TRACER is not set
1507# CONFIG_CONTEXT_SWITCH_TRACER is not set
1508# CONFIG_EVENT_TRACER is not set
1509# CONFIG_BOOT_TRACER is not set
1510# CONFIG_TRACE_BRANCH_PROFILING is not set
1511# CONFIG_STACK_TRACER is not set
1512# CONFIG_KMEMTRACE is not set
1513# CONFIG_WORKQUEUE_TRACER is not set
1514# CONFIG_BLK_DEV_IO_TRACE is not set
1515# CONFIG_SAMPLES is not set 1572# CONFIG_SAMPLES is not set
1516CONFIG_HAVE_ARCH_KGDB=y 1573CONFIG_HAVE_ARCH_KGDB=y
1574# CONFIG_PPC_DISABLE_WERROR is not set
1575CONFIG_PPC_WERROR=y
1517CONFIG_PRINT_STACK_DEPTH=64 1576CONFIG_PRINT_STACK_DEPTH=64
1518# CONFIG_IRQSTACKS is not set 1577# CONFIG_IRQSTACKS is not set
1519# CONFIG_PPC_EARLY_DEBUG is not set 1578# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/stx_gp3_defconfig b/arch/powerpc/configs/85xx/stx_gp3_defconfig
index bd1bfcddbd0c..e7e81d6769fe 100644
--- a/arch/powerpc/configs/85xx/stx_gp3_defconfig
+++ b/arch/powerpc/configs/85xx/stx_gp3_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:22 2009 4# Wed Jul 29 23:32:20 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -112,7 +115,6 @@ CONFIG_SYSCTL_SYSCALL=y
112CONFIG_KALLSYMS=y 115CONFIG_KALLSYMS=y
113# CONFIG_KALLSYMS_ALL is not set 116# CONFIG_KALLSYMS_ALL is not set
114# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
115# CONFIG_STRIP_ASM_SYMS is not set
116CONFIG_HOTPLUG=y 118CONFIG_HOTPLUG=y
117CONFIG_PRINTK=y 119CONFIG_PRINTK=y
118CONFIG_BUG=y 120CONFIG_BUG=y
@@ -125,9 +127,16 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y
131
132#
133# Performance Counters
134#
135# CONFIG_PERF_COUNTERS is not set
128CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
129CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
130CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
139# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
132# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
133CONFIG_SLUB=y 142CONFIG_SLUB=y
@@ -142,6 +151,10 @@ CONFIG_HAVE_KPROBES=y
142CONFIG_HAVE_KRETPROBES=y 151CONFIG_HAVE_KRETPROBES=y
143CONFIG_HAVE_ARCH_TRACEHOOK=y 152CONFIG_HAVE_ARCH_TRACEHOOK=y
144CONFIG_HAVE_CLK=y 153CONFIG_HAVE_CLK=y
154
155#
156# GCOV-based kernel profiling
157#
145# CONFIG_SLOW_WORK is not set 158# CONFIG_SLOW_WORK is not set
146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 159# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
147CONFIG_SLABINFO=y 160CONFIG_SLABINFO=y
@@ -153,7 +166,7 @@ CONFIG_MODULES=y
153CONFIG_MODVERSIONS=y 166CONFIG_MODVERSIONS=y
154# CONFIG_MODULE_SRCVERSION_ALL is not set 167# CONFIG_MODULE_SRCVERSION_ALL is not set
155CONFIG_BLOCK=y 168CONFIG_BLOCK=y
156# CONFIG_LBD is not set 169CONFIG_LBDAF=y
157# CONFIG_BLK_DEV_BSG is not set 170# CONFIG_BLK_DEV_BSG is not set
158# CONFIG_BLK_DEV_INTEGRITY is not set 171# CONFIG_BLK_DEV_INTEGRITY is not set
159 172
@@ -186,6 +199,7 @@ CONFIG_MPC85xx=y
186# CONFIG_MPC85xx_DS is not set 199# CONFIG_MPC85xx_DS is not set
187# CONFIG_SOCRATES is not set 200# CONFIG_SOCRATES is not set
188# CONFIG_KSI8560 is not set 201# CONFIG_KSI8560 is not set
202# CONFIG_XES_MPC85xx is not set
189CONFIG_STX_GP3=y 203CONFIG_STX_GP3=y
190# CONFIG_TQM8540 is not set 204# CONFIG_TQM8540 is not set
191# CONFIG_TQM8541 is not set 205# CONFIG_TQM8541 is not set
@@ -234,6 +248,7 @@ CONFIG_BINFMT_ELF=y
234CONFIG_BINFMT_MISC=m 248CONFIG_BINFMT_MISC=m
235CONFIG_MATH_EMULATION=y 249CONFIG_MATH_EMULATION=y
236# CONFIG_IOMMU_HELPER is not set 250# CONFIG_IOMMU_HELPER is not set
251# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +267,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 267CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 268CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 273CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 274# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 275# CONFIG_PPC_64K_PAGES is not set
@@ -425,6 +440,7 @@ CONFIG_IP_NF_FILTER=m
425# CONFIG_ECONET is not set 440# CONFIG_ECONET is not set
426# CONFIG_WAN_ROUTER is not set 441# CONFIG_WAN_ROUTER is not set
427# CONFIG_PHONET is not set 442# CONFIG_PHONET is not set
443# CONFIG_IEEE802154 is not set
428# CONFIG_NET_SCHED is not set 444# CONFIG_NET_SCHED is not set
429# CONFIG_DCB is not set 445# CONFIG_DCB is not set
430 446
@@ -442,7 +458,11 @@ CONFIG_WIRELESS=y
442CONFIG_WIRELESS_OLD_REGULATORY=y 458CONFIG_WIRELESS_OLD_REGULATORY=y
443# CONFIG_WIRELESS_EXT is not set 459# CONFIG_WIRELESS_EXT is not set
444# CONFIG_LIB80211 is not set 460# CONFIG_LIB80211 is not set
445# CONFIG_MAC80211 is not set 461
462#
463# CFG80211 needs to be enabled for MAC80211
464#
465CONFIG_MAC80211_DEFAULT_PS_VALUE=0
446# CONFIG_WIMAX is not set 466# CONFIG_WIMAX is not set
447# CONFIG_RFKILL is not set 467# CONFIG_RFKILL is not set
448# CONFIG_NET_9P is not set 468# CONFIG_NET_9P is not set
@@ -466,6 +486,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
466CONFIG_OF_DEVICE=y 486CONFIG_OF_DEVICE=y
467CONFIG_OF_GPIO=y 487CONFIG_OF_GPIO=y
468CONFIG_OF_I2C=m 488CONFIG_OF_I2C=m
489CONFIG_OF_MDIO=y
469CONFIG_PARPORT=m 490CONFIG_PARPORT=m
470CONFIG_PARPORT_PC=m 491CONFIG_PARPORT_PC=m
471# CONFIG_PARPORT_PC_FIFO is not set 492# CONFIG_PARPORT_PC_FIFO is not set
@@ -507,7 +528,9 @@ CONFIG_MISC_DEVICES=y
507# 528#
508# CONFIG_EEPROM_AT24 is not set 529# CONFIG_EEPROM_AT24 is not set
509# CONFIG_EEPROM_LEGACY is not set 530# CONFIG_EEPROM_LEGACY is not set
531# CONFIG_EEPROM_MAX6875 is not set
510# CONFIG_EEPROM_93CX6 is not set 532# CONFIG_EEPROM_93CX6 is not set
533# CONFIG_CB710_CORE is not set
511CONFIG_HAVE_IDE=y 534CONFIG_HAVE_IDE=y
512CONFIG_IDE=y 535CONFIG_IDE=y
513 536
@@ -581,10 +604,6 @@ CONFIG_BLK_DEV_SR=m
581# CONFIG_BLK_DEV_SR_VENDOR is not set 604# CONFIG_BLK_DEV_SR_VENDOR is not set
582CONFIG_CHR_DEV_SG=m 605CONFIG_CHR_DEV_SG=m
583# CONFIG_CHR_DEV_SCH is not set 606# CONFIG_CHR_DEV_SCH is not set
584
585#
586# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
587#
588CONFIG_SCSI_MULTI_LUN=y 607CONFIG_SCSI_MULTI_LUN=y
589CONFIG_SCSI_CONSTANTS=y 608CONFIG_SCSI_CONSTANTS=y
590# CONFIG_SCSI_LOGGING is not set 609# CONFIG_SCSI_LOGGING is not set
@@ -602,6 +621,7 @@ CONFIG_SCSI_WAIT_SCAN=m
602CONFIG_SCSI_LOWLEVEL=y 621CONFIG_SCSI_LOWLEVEL=y
603# CONFIG_ISCSI_TCP is not set 622# CONFIG_ISCSI_TCP is not set
604# CONFIG_SCSI_CXGB3_ISCSI is not set 623# CONFIG_SCSI_CXGB3_ISCSI is not set
624# CONFIG_SCSI_BNX2_ISCSI is not set
605# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 625# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
606# CONFIG_SCSI_3W_9XXX is not set 626# CONFIG_SCSI_3W_9XXX is not set
607# CONFIG_SCSI_ACARD is not set 627# CONFIG_SCSI_ACARD is not set
@@ -610,6 +630,7 @@ CONFIG_SCSI_LOWLEVEL=y
610# CONFIG_SCSI_AIC7XXX_OLD is not set 630# CONFIG_SCSI_AIC7XXX_OLD is not set
611# CONFIG_SCSI_AIC79XX is not set 631# CONFIG_SCSI_AIC79XX is not set
612# CONFIG_SCSI_AIC94XX is not set 632# CONFIG_SCSI_AIC94XX is not set
633# CONFIG_SCSI_MVSAS is not set
613# CONFIG_SCSI_DPT_I2O is not set 634# CONFIG_SCSI_DPT_I2O is not set
614# CONFIG_SCSI_ADVANSYS is not set 635# CONFIG_SCSI_ADVANSYS is not set
615# CONFIG_SCSI_ARCMSR is not set 636# CONFIG_SCSI_ARCMSR is not set
@@ -631,7 +652,6 @@ CONFIG_SCSI_LOWLEVEL=y
631# CONFIG_SCSI_INIA100 is not set 652# CONFIG_SCSI_INIA100 is not set
632# CONFIG_SCSI_PPA is not set 653# CONFIG_SCSI_PPA is not set
633# CONFIG_SCSI_IMM is not set 654# CONFIG_SCSI_IMM is not set
634# CONFIG_SCSI_MVSAS is not set
635# CONFIG_SCSI_STEX is not set 655# CONFIG_SCSI_STEX is not set
636# CONFIG_SCSI_SYM53C8XX_2 is not set 656# CONFIG_SCSI_SYM53C8XX_2 is not set
637# CONFIG_SCSI_QLOGIC_1280 is not set 657# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -654,14 +674,17 @@ CONFIG_SCSI_LOWLEVEL=y
654# 674#
655 675
656# 676#
657# Enable only one of the two stacks, unless you know what you are doing 677# You can enable one or both FireWire driver stacks.
678#
679
680#
681# See the help texts for more information.
658# 682#
659# CONFIG_FIREWIRE is not set 683# CONFIG_FIREWIRE is not set
660# CONFIG_IEEE1394 is not set 684# CONFIG_IEEE1394 is not set
661# CONFIG_I2O is not set 685# CONFIG_I2O is not set
662# CONFIG_MACINTOSH_DRIVERS is not set 686# CONFIG_MACINTOSH_DRIVERS is not set
663CONFIG_NETDEVICES=y 687CONFIG_NETDEVICES=y
664CONFIG_COMPAT_NET_DEV_OPS=y
665# CONFIG_DUMMY is not set 688# CONFIG_DUMMY is not set
666# CONFIG_BONDING is not set 689# CONFIG_BONDING is not set
667# CONFIG_MACVLAN is not set 690# CONFIG_MACVLAN is not set
@@ -708,6 +731,7 @@ CONFIG_NET_ETHERNET=y
708# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 731# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
709# CONFIG_NET_PCI is not set 732# CONFIG_NET_PCI is not set
710# CONFIG_B44 is not set 733# CONFIG_B44 is not set
734# CONFIG_KS8842 is not set
711# CONFIG_NET_POCKET is not set 735# CONFIG_NET_POCKET is not set
712# CONFIG_ATL2 is not set 736# CONFIG_ATL2 is not set
713# CONFIG_FS_ENET is not set 737# CONFIG_FS_ENET is not set
@@ -729,8 +753,10 @@ CONFIG_NETDEV_1000=y
729# CONFIG_VIA_VELOCITY is not set 753# CONFIG_VIA_VELOCITY is not set
730# CONFIG_TIGON3 is not set 754# CONFIG_TIGON3 is not set
731# CONFIG_BNX2 is not set 755# CONFIG_BNX2 is not set
756# CONFIG_CNIC is not set
732CONFIG_FSL_PQ_MDIO=y 757CONFIG_FSL_PQ_MDIO=y
733CONFIG_GIANFAR=y 758CONFIG_GIANFAR=y
759# CONFIG_MV643XX_ETH is not set
734# CONFIG_QLA3XXX is not set 760# CONFIG_QLA3XXX is not set
735# CONFIG_ATL1 is not set 761# CONFIG_ATL1 is not set
736# CONFIG_ATL1E is not set 762# CONFIG_ATL1E is not set
@@ -802,12 +828,13 @@ CONFIG_INPUT_EVDEV=m
802# 828#
803CONFIG_INPUT_KEYBOARD=y 829CONFIG_INPUT_KEYBOARD=y
804CONFIG_KEYBOARD_ATKBD=y 830CONFIG_KEYBOARD_ATKBD=y
805# CONFIG_KEYBOARD_SUNKBD is not set
806# CONFIG_KEYBOARD_LKKBD is not set 831# CONFIG_KEYBOARD_LKKBD is not set
807# CONFIG_KEYBOARD_XTKBD is not set 832# CONFIG_KEYBOARD_GPIO is not set
833# CONFIG_KEYBOARD_MATRIX is not set
808# CONFIG_KEYBOARD_NEWTON is not set 834# CONFIG_KEYBOARD_NEWTON is not set
809# CONFIG_KEYBOARD_STOWAWAY is not set 835# CONFIG_KEYBOARD_STOWAWAY is not set
810# CONFIG_KEYBOARD_GPIO is not set 836# CONFIG_KEYBOARD_SUNKBD is not set
837# CONFIG_KEYBOARD_XTKBD is not set
811CONFIG_INPUT_MOUSE=y 838CONFIG_INPUT_MOUSE=y
812CONFIG_MOUSE_PS2=y 839CONFIG_MOUSE_PS2=y
813CONFIG_MOUSE_PS2_ALPS=y 840CONFIG_MOUSE_PS2_ALPS=y
@@ -821,6 +848,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y
821# CONFIG_MOUSE_BCM5974 is not set 848# CONFIG_MOUSE_BCM5974 is not set
822# CONFIG_MOUSE_VSXXXAA is not set 849# CONFIG_MOUSE_VSXXXAA is not set
823# CONFIG_MOUSE_GPIO is not set 850# CONFIG_MOUSE_GPIO is not set
851# CONFIG_MOUSE_SYNAPTICS_I2C is not set
824# CONFIG_INPUT_JOYSTICK is not set 852# CONFIG_INPUT_JOYSTICK is not set
825# CONFIG_INPUT_TABLET is not set 853# CONFIG_INPUT_TABLET is not set
826# CONFIG_INPUT_TOUCHSCREEN is not set 854# CONFIG_INPUT_TOUCHSCREEN is not set
@@ -911,6 +939,7 @@ CONFIG_I2C_ALGOBIT=m
911# I2C system bus drivers (mostly embedded / system-on-chip) 939# I2C system bus drivers (mostly embedded / system-on-chip)
912# 940#
913# CONFIG_I2C_CPM is not set 941# CONFIG_I2C_CPM is not set
942# CONFIG_I2C_DESIGNWARE is not set
914# CONFIG_I2C_GPIO is not set 943# CONFIG_I2C_GPIO is not set
915# CONFIG_I2C_MPC is not set 944# CONFIG_I2C_MPC is not set
916# CONFIG_I2C_OCORES is not set 945# CONFIG_I2C_OCORES is not set
@@ -941,13 +970,17 @@ CONFIG_I2C_ALGOBIT=m
941# CONFIG_SENSORS_PCF8574 is not set 970# CONFIG_SENSORS_PCF8574 is not set
942# CONFIG_PCF8575 is not set 971# CONFIG_PCF8575 is not set
943# CONFIG_SENSORS_PCA9539 is not set 972# CONFIG_SENSORS_PCA9539 is not set
944# CONFIG_SENSORS_MAX6875 is not set
945# CONFIG_SENSORS_TSL2550 is not set 973# CONFIG_SENSORS_TSL2550 is not set
946# CONFIG_I2C_DEBUG_CORE is not set 974# CONFIG_I2C_DEBUG_CORE is not set
947# CONFIG_I2C_DEBUG_ALGO is not set 975# CONFIG_I2C_DEBUG_ALGO is not set
948# CONFIG_I2C_DEBUG_BUS is not set 976# CONFIG_I2C_DEBUG_BUS is not set
949# CONFIG_I2C_DEBUG_CHIP is not set 977# CONFIG_I2C_DEBUG_CHIP is not set
950# CONFIG_SPI is not set 978# CONFIG_SPI is not set
979
980#
981# PPS support
982#
983# CONFIG_PPS is not set
951CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 984CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
952CONFIG_ARCH_REQUIRE_GPIOLIB=y 985CONFIG_ARCH_REQUIRE_GPIOLIB=y
953CONFIG_GPIOLIB=y 986CONFIG_GPIOLIB=y
@@ -1027,6 +1060,7 @@ CONFIG_HWMON=y
1027# CONFIG_SENSORS_SMSC47B397 is not set 1060# CONFIG_SENSORS_SMSC47B397 is not set
1028# CONFIG_SENSORS_ADS7828 is not set 1061# CONFIG_SENSORS_ADS7828 is not set
1029# CONFIG_SENSORS_THMC50 is not set 1062# CONFIG_SENSORS_THMC50 is not set
1063# CONFIG_SENSORS_TMP401 is not set
1030# CONFIG_SENSORS_VIA686A is not set 1064# CONFIG_SENSORS_VIA686A is not set
1031# CONFIG_SENSORS_VT1211 is not set 1065# CONFIG_SENSORS_VT1211 is not set
1032# CONFIG_SENSORS_VT8231 is not set 1066# CONFIG_SENSORS_VT8231 is not set
@@ -1060,23 +1094,9 @@ CONFIG_SSB_POSSIBLE=y
1060# CONFIG_MFD_WM8400 is not set 1094# CONFIG_MFD_WM8400 is not set
1061# CONFIG_MFD_WM8350_I2C is not set 1095# CONFIG_MFD_WM8350_I2C is not set
1062# CONFIG_MFD_PCF50633 is not set 1096# CONFIG_MFD_PCF50633 is not set
1097# CONFIG_AB3100_CORE is not set
1063# CONFIG_REGULATOR is not set 1098# CONFIG_REGULATOR is not set
1064 1099# CONFIG_MEDIA_SUPPORT is not set
1065#
1066# Multimedia devices
1067#
1068
1069#
1070# Multimedia core support
1071#
1072# CONFIG_VIDEO_DEV is not set
1073# CONFIG_DVB_CORE is not set
1074# CONFIG_VIDEO_MEDIA is not set
1075
1076#
1077# Multimedia drivers
1078#
1079CONFIG_DAB=y
1080 1100
1081# 1101#
1082# Graphics support 1102# Graphics support
@@ -1143,6 +1163,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1143# CONFIG_DMADEVICES is not set 1163# CONFIG_DMADEVICES is not set
1144# CONFIG_AUXDISPLAY is not set 1164# CONFIG_AUXDISPLAY is not set
1145# CONFIG_UIO is not set 1165# CONFIG_UIO is not set
1166
1167#
1168# TI VLYNQ
1169#
1146# CONFIG_STAGING is not set 1170# CONFIG_STAGING is not set
1147 1171
1148# 1172#
@@ -1162,10 +1186,12 @@ CONFIG_FS_MBCACHE=y
1162# CONFIG_REISERFS_FS is not set 1186# CONFIG_REISERFS_FS is not set
1163# CONFIG_JFS_FS is not set 1187# CONFIG_JFS_FS is not set
1164# CONFIG_FS_POSIX_ACL is not set 1188# CONFIG_FS_POSIX_ACL is not set
1165CONFIG_FILE_LOCKING=y
1166# CONFIG_XFS_FS is not set 1189# CONFIG_XFS_FS is not set
1190# CONFIG_GFS2_FS is not set
1167# CONFIG_OCFS2_FS is not set 1191# CONFIG_OCFS2_FS is not set
1168# CONFIG_BTRFS_FS is not set 1192# CONFIG_BTRFS_FS is not set
1193CONFIG_FILE_LOCKING=y
1194CONFIG_FSNOTIFY=y
1169CONFIG_DNOTIFY=y 1195CONFIG_DNOTIFY=y
1170CONFIG_INOTIFY=y 1196CONFIG_INOTIFY=y
1171CONFIG_INOTIFY_USER=y 1197CONFIG_INOTIFY_USER=y
@@ -1316,6 +1342,7 @@ CONFIG_HAS_IOPORT=y
1316CONFIG_HAS_DMA=y 1342CONFIG_HAS_DMA=y
1317CONFIG_HAVE_LMB=y 1343CONFIG_HAVE_LMB=y
1318CONFIG_NLATTR=y 1344CONFIG_NLATTR=y
1345CONFIG_GENERIC_ATOMIC64=y
1319 1346
1320# 1347#
1321# Kernel hacking 1348# Kernel hacking
@@ -1346,6 +1373,9 @@ CONFIG_SCHED_DEBUG=y
1346# CONFIG_RT_MUTEX_TESTER is not set 1373# CONFIG_RT_MUTEX_TESTER is not set
1347# CONFIG_DEBUG_SPINLOCK is not set 1374# CONFIG_DEBUG_SPINLOCK is not set
1348# CONFIG_DEBUG_MUTEXES is not set 1375# CONFIG_DEBUG_MUTEXES is not set
1376# CONFIG_DEBUG_LOCK_ALLOC is not set
1377# CONFIG_PROVE_LOCKING is not set
1378# CONFIG_LOCK_STAT is not set
1349# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1379# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1350# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1380# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1351# CONFIG_DEBUG_KOBJECT is not set 1381# CONFIG_DEBUG_KOBJECT is not set
@@ -1358,7 +1388,6 @@ CONFIG_SCHED_DEBUG=y
1358# CONFIG_DEBUG_LIST is not set 1388# CONFIG_DEBUG_LIST is not set
1359# CONFIG_DEBUG_SG is not set 1389# CONFIG_DEBUG_SG is not set
1360# CONFIG_DEBUG_NOTIFIERS is not set 1390# CONFIG_DEBUG_NOTIFIERS is not set
1361# CONFIG_BOOT_PRINTK_DELAY is not set
1362# CONFIG_RCU_TORTURE_TEST is not set 1391# CONFIG_RCU_TORTURE_TEST is not set
1363# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1392# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1364# CONFIG_BACKTRACE_SELF_TEST is not set 1393# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1372,16 +1401,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1372CONFIG_HAVE_DYNAMIC_FTRACE=y 1401CONFIG_HAVE_DYNAMIC_FTRACE=y
1373CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1402CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1374CONFIG_TRACING_SUPPORT=y 1403CONFIG_TRACING_SUPPORT=y
1375 1404CONFIG_FTRACE=y
1376#
1377# Tracers
1378#
1379# CONFIG_FUNCTION_TRACER is not set 1405# CONFIG_FUNCTION_TRACER is not set
1406# CONFIG_IRQSOFF_TRACER is not set
1380# CONFIG_SCHED_TRACER is not set 1407# CONFIG_SCHED_TRACER is not set
1381# CONFIG_CONTEXT_SWITCH_TRACER is not set 1408# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1382# CONFIG_EVENT_TRACER is not set
1383# CONFIG_BOOT_TRACER is not set 1409# CONFIG_BOOT_TRACER is not set
1384# CONFIG_TRACE_BRANCH_PROFILING is not set 1410CONFIG_BRANCH_PROFILE_NONE=y
1411# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1412# CONFIG_PROFILE_ALL_BRANCHES is not set
1385# CONFIG_STACK_TRACER is not set 1413# CONFIG_STACK_TRACER is not set
1386# CONFIG_KMEMTRACE is not set 1414# CONFIG_KMEMTRACE is not set
1387# CONFIG_WORKQUEUE_TRACER is not set 1415# CONFIG_WORKQUEUE_TRACER is not set
@@ -1389,6 +1417,9 @@ CONFIG_TRACING_SUPPORT=y
1389# CONFIG_SAMPLES is not set 1417# CONFIG_SAMPLES is not set
1390CONFIG_HAVE_ARCH_KGDB=y 1418CONFIG_HAVE_ARCH_KGDB=y
1391# CONFIG_KGDB is not set 1419# CONFIG_KGDB is not set
1420# CONFIG_KMEMCHECK is not set
1421# CONFIG_PPC_DISABLE_WERROR is not set
1422CONFIG_PPC_WERROR=y
1392CONFIG_PRINT_STACK_DEPTH=64 1423CONFIG_PRINT_STACK_DEPTH=64
1393# CONFIG_DEBUG_STACKOVERFLOW is not set 1424# CONFIG_DEBUG_STACKOVERFLOW is not set
1394# CONFIG_DEBUG_STACK_USAGE is not set 1425# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/tqm8540_defconfig b/arch/powerpc/configs/85xx/tqm8540_defconfig
index 767600145fb2..2c407523aad2 100644
--- a/arch/powerpc/configs/85xx/tqm8540_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8540_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:23 2009 4# Wed Jul 29 23:32:21 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -109,7 +112,6 @@ CONFIG_ANON_INODES=y
109CONFIG_EMBEDDED=y 112CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 113CONFIG_SYSCTL_SYSCALL=y
111# CONFIG_KALLSYMS is not set 114# CONFIG_KALLSYMS is not set
112# CONFIG_STRIP_ASM_SYMS is not set
113# CONFIG_HOTPLUG is not set 115# CONFIG_HOTPLUG is not set
114CONFIG_PRINTK=y 116CONFIG_PRINTK=y
115CONFIG_BUG=y 117CONFIG_BUG=y
@@ -122,9 +124,16 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 124CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 125CONFIG_SHMEM=y
124CONFIG_AIO=y 126CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y
128
129#
130# Performance Counters
131#
132# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 133CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 134CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 135CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 138# CONFIG_SLAB is not set
130CONFIG_SLUB=y 139CONFIG_SLUB=y
@@ -137,6 +146,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149
150#
151# GCOV-based kernel profiling
152#
140# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -144,7 +157,7 @@ CONFIG_RT_MUTEXES=y
144CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
145# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
146CONFIG_BLOCK=y 159CONFIG_BLOCK=y
147# CONFIG_LBD is not set 160CONFIG_LBDAF=y
148# CONFIG_BLK_DEV_BSG is not set 161# CONFIG_BLK_DEV_BSG is not set
149# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
150 163
@@ -177,6 +190,7 @@ CONFIG_MPC85xx=y
177# CONFIG_MPC85xx_DS is not set 190# CONFIG_MPC85xx_DS is not set
178# CONFIG_SOCRATES is not set 191# CONFIG_SOCRATES is not set
179# CONFIG_KSI8560 is not set 192# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set
180# CONFIG_STX_GP3 is not set 194# CONFIG_STX_GP3 is not set
181CONFIG_TQM8540=y 195CONFIG_TQM8540=y
182# CONFIG_TQM8541 is not set 196# CONFIG_TQM8541 is not set
@@ -225,6 +239,7 @@ CONFIG_BINFMT_ELF=y
225# CONFIG_BINFMT_MISC is not set 239# CONFIG_BINFMT_MISC is not set
226CONFIG_MATH_EMULATION=y 240CONFIG_MATH_EMULATION=y
227# CONFIG_IOMMU_HELPER is not set 241# CONFIG_IOMMU_HELPER is not set
242# CONFIG_SWIOTLB is not set
228CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
229CONFIG_ARCH_HAS_WALK_MEMORY=y 244CONFIG_ARCH_HAS_WALK_MEMORY=y
230CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -243,9 +258,9 @@ CONFIG_MIGRATION=y
243CONFIG_ZONE_DMA_FLAG=1 258CONFIG_ZONE_DMA_FLAG=1
244CONFIG_BOUNCE=y 259CONFIG_BOUNCE=y
245CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
246CONFIG_UNEVICTABLE_LRU=y
247CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
248CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
249CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
250# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
251# CONFIG_PPC_64K_PAGES is not set 266# CONFIG_PPC_64K_PAGES is not set
@@ -353,6 +368,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
353# CONFIG_ECONET is not set 368# CONFIG_ECONET is not set
354# CONFIG_WAN_ROUTER is not set 369# CONFIG_WAN_ROUTER is not set
355# CONFIG_PHONET is not set 370# CONFIG_PHONET is not set
371# CONFIG_IEEE802154 is not set
356# CONFIG_NET_SCHED is not set 372# CONFIG_NET_SCHED is not set
357# CONFIG_DCB is not set 373# CONFIG_DCB is not set
358 374
@@ -370,7 +386,11 @@ CONFIG_WIRELESS=y
370CONFIG_WIRELESS_OLD_REGULATORY=y 386CONFIG_WIRELESS_OLD_REGULATORY=y
371# CONFIG_WIRELESS_EXT is not set 387# CONFIG_WIRELESS_EXT is not set
372# CONFIG_LIB80211 is not set 388# CONFIG_LIB80211 is not set
373# CONFIG_MAC80211 is not set 389
390#
391# CFG80211 needs to be enabled for MAC80211
392#
393CONFIG_MAC80211_DEFAULT_PS_VALUE=0
374# CONFIG_WIMAX is not set 394# CONFIG_WIMAX is not set
375# CONFIG_RFKILL is not set 395# CONFIG_RFKILL is not set
376# CONFIG_NET_9P is not set 396# CONFIG_NET_9P is not set
@@ -471,6 +491,7 @@ CONFIG_MTD_CFI_UTIL=y
471# CONFIG_MTD_UBI is not set 491# CONFIG_MTD_UBI is not set
472CONFIG_OF_DEVICE=y 492CONFIG_OF_DEVICE=y
473CONFIG_OF_I2C=y 493CONFIG_OF_I2C=y
494CONFIG_OF_MDIO=y
474# CONFIG_PARPORT is not set 495# CONFIG_PARPORT is not set
475CONFIG_BLK_DEV=y 496CONFIG_BLK_DEV=y
476# CONFIG_BLK_DEV_FD is not set 497# CONFIG_BLK_DEV_FD is not set
@@ -505,7 +526,9 @@ CONFIG_MISC_DEVICES=y
505# 526#
506# CONFIG_EEPROM_AT24 is not set 527# CONFIG_EEPROM_AT24 is not set
507# CONFIG_EEPROM_LEGACY is not set 528# CONFIG_EEPROM_LEGACY is not set
529# CONFIG_EEPROM_MAX6875 is not set
508# CONFIG_EEPROM_93CX6 is not set 530# CONFIG_EEPROM_93CX6 is not set
531# CONFIG_CB710_CORE is not set
509CONFIG_HAVE_IDE=y 532CONFIG_HAVE_IDE=y
510CONFIG_IDE=y 533CONFIG_IDE=y
511 534
@@ -580,14 +603,17 @@ CONFIG_BLK_DEV_IDEDMA=y
580# 603#
581 604
582# 605#
583# Enable only one of the two stacks, unless you know what you are doing 606# You can enable one or both FireWire driver stacks.
607#
608
609#
610# See the help texts for more information.
584# 611#
585# CONFIG_FIREWIRE is not set 612# CONFIG_FIREWIRE is not set
586# CONFIG_IEEE1394 is not set 613# CONFIG_IEEE1394 is not set
587# CONFIG_I2O is not set 614# CONFIG_I2O is not set
588# CONFIG_MACINTOSH_DRIVERS is not set 615# CONFIG_MACINTOSH_DRIVERS is not set
589CONFIG_NETDEVICES=y 616CONFIG_NETDEVICES=y
590CONFIG_COMPAT_NET_DEV_OPS=y
591# CONFIG_DUMMY is not set 617# CONFIG_DUMMY is not set
592# CONFIG_BONDING is not set 618# CONFIG_BONDING is not set
593# CONFIG_MACVLAN is not set 619# CONFIG_MACVLAN is not set
@@ -650,6 +676,7 @@ CONFIG_E100=y
650# CONFIG_SMSC9420 is not set 676# CONFIG_SMSC9420 is not set
651# CONFIG_SUNDANCE is not set 677# CONFIG_SUNDANCE is not set
652# CONFIG_TLAN is not set 678# CONFIG_TLAN is not set
679# CONFIG_KS8842 is not set
653# CONFIG_VIA_RHINE is not set 680# CONFIG_VIA_RHINE is not set
654# CONFIG_SC92031 is not set 681# CONFIG_SC92031 is not set
655# CONFIG_ATL2 is not set 682# CONFIG_ATL2 is not set
@@ -671,8 +698,10 @@ CONFIG_NETDEV_1000=y
671# CONFIG_VIA_VELOCITY is not set 698# CONFIG_VIA_VELOCITY is not set
672# CONFIG_TIGON3 is not set 699# CONFIG_TIGON3 is not set
673# CONFIG_BNX2 is not set 700# CONFIG_BNX2 is not set
701# CONFIG_CNIC is not set
674CONFIG_FSL_PQ_MDIO=y 702CONFIG_FSL_PQ_MDIO=y
675CONFIG_GIANFAR=y 703CONFIG_GIANFAR=y
704# CONFIG_MV643XX_ETH is not set
676# CONFIG_QLA3XXX is not set 705# CONFIG_QLA3XXX is not set
677# CONFIG_ATL1 is not set 706# CONFIG_ATL1 is not set
678# CONFIG_ATL1E is not set 707# CONFIG_ATL1E is not set
@@ -850,13 +879,17 @@ CONFIG_I2C_MPC=y
850# CONFIG_SENSORS_PCF8574 is not set 879# CONFIG_SENSORS_PCF8574 is not set
851# CONFIG_PCF8575 is not set 880# CONFIG_PCF8575 is not set
852# CONFIG_SENSORS_PCA9539 is not set 881# CONFIG_SENSORS_PCA9539 is not set
853# CONFIG_SENSORS_MAX6875 is not set
854# CONFIG_SENSORS_TSL2550 is not set 882# CONFIG_SENSORS_TSL2550 is not set
855# CONFIG_I2C_DEBUG_CORE is not set 883# CONFIG_I2C_DEBUG_CORE is not set
856# CONFIG_I2C_DEBUG_ALGO is not set 884# CONFIG_I2C_DEBUG_ALGO is not set
857# CONFIG_I2C_DEBUG_BUS is not set 885# CONFIG_I2C_DEBUG_BUS is not set
858# CONFIG_I2C_DEBUG_CHIP is not set 886# CONFIG_I2C_DEBUG_CHIP is not set
859# CONFIG_SPI is not set 887# CONFIG_SPI is not set
888
889#
890# PPS support
891#
892# CONFIG_PPS is not set
860CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 893CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
861# CONFIG_GPIOLIB is not set 894# CONFIG_GPIOLIB is not set
862# CONFIG_W1 is not set 895# CONFIG_W1 is not set
@@ -911,6 +944,7 @@ CONFIG_SENSORS_LM75=y
911# CONFIG_SENSORS_SMSC47B397 is not set 944# CONFIG_SENSORS_SMSC47B397 is not set
912# CONFIG_SENSORS_ADS7828 is not set 945# CONFIG_SENSORS_ADS7828 is not set
913# CONFIG_SENSORS_THMC50 is not set 946# CONFIG_SENSORS_THMC50 is not set
947# CONFIG_SENSORS_TMP401 is not set
914# CONFIG_SENSORS_VIA686A is not set 948# CONFIG_SENSORS_VIA686A is not set
915# CONFIG_SENSORS_VT1211 is not set 949# CONFIG_SENSORS_VT1211 is not set
916# CONFIG_SENSORS_VT8231 is not set 950# CONFIG_SENSORS_VT8231 is not set
@@ -945,23 +979,9 @@ CONFIG_SSB_POSSIBLE=y
945# CONFIG_MFD_WM8400 is not set 979# CONFIG_MFD_WM8400 is not set
946# CONFIG_MFD_WM8350_I2C is not set 980# CONFIG_MFD_WM8350_I2C is not set
947# CONFIG_MFD_PCF50633 is not set 981# CONFIG_MFD_PCF50633 is not set
982# CONFIG_AB3100_CORE is not set
948# CONFIG_REGULATOR is not set 983# CONFIG_REGULATOR is not set
949 984# CONFIG_MEDIA_SUPPORT is not set
950#
951# Multimedia devices
952#
953
954#
955# Multimedia core support
956#
957# CONFIG_VIDEO_DEV is not set
958# CONFIG_DVB_CORE is not set
959# CONFIG_VIDEO_MEDIA is not set
960
961#
962# Multimedia drivers
963#
964CONFIG_DAB=y
965 985
966# 986#
967# Graphics support 987# Graphics support
@@ -1018,6 +1038,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1018# CONFIG_DMADEVICES is not set 1038# CONFIG_DMADEVICES is not set
1019# CONFIG_AUXDISPLAY is not set 1039# CONFIG_AUXDISPLAY is not set
1020# CONFIG_UIO is not set 1040# CONFIG_UIO is not set
1041
1042#
1043# TI VLYNQ
1044#
1021# CONFIG_STAGING is not set 1045# CONFIG_STAGING is not set
1022 1046
1023# 1047#
@@ -1037,10 +1061,12 @@ CONFIG_FS_MBCACHE=y
1037# CONFIG_REISERFS_FS is not set 1061# CONFIG_REISERFS_FS is not set
1038# CONFIG_JFS_FS is not set 1062# CONFIG_JFS_FS is not set
1039# CONFIG_FS_POSIX_ACL is not set 1063# CONFIG_FS_POSIX_ACL is not set
1040CONFIG_FILE_LOCKING=y
1041# CONFIG_XFS_FS is not set 1064# CONFIG_XFS_FS is not set
1065# CONFIG_GFS2_FS is not set
1042# CONFIG_OCFS2_FS is not set 1066# CONFIG_OCFS2_FS is not set
1043# CONFIG_BTRFS_FS is not set 1067# CONFIG_BTRFS_FS is not set
1068CONFIG_FILE_LOCKING=y
1069CONFIG_FSNOTIFY=y
1044CONFIG_DNOTIFY=y 1070CONFIG_DNOTIFY=y
1045CONFIG_INOTIFY=y 1071CONFIG_INOTIFY=y
1046CONFIG_INOTIFY_USER=y 1072CONFIG_INOTIFY_USER=y
@@ -1167,6 +1193,7 @@ CONFIG_HAS_IOPORT=y
1167CONFIG_HAS_DMA=y 1193CONFIG_HAS_DMA=y
1168CONFIG_HAVE_LMB=y 1194CONFIG_HAVE_LMB=y
1169CONFIG_NLATTR=y 1195CONFIG_NLATTR=y
1196CONFIG_GENERIC_ATOMIC64=y
1170 1197
1171# 1198#
1172# Kernel hacking 1199# Kernel hacking
@@ -1192,22 +1219,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1192CONFIG_HAVE_DYNAMIC_FTRACE=y 1219CONFIG_HAVE_DYNAMIC_FTRACE=y
1193CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1220CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1194CONFIG_TRACING_SUPPORT=y 1221CONFIG_TRACING_SUPPORT=y
1195 1222# CONFIG_FTRACE is not set
1196#
1197# Tracers
1198#
1199# CONFIG_FUNCTION_TRACER is not set
1200# CONFIG_SCHED_TRACER is not set
1201# CONFIG_CONTEXT_SWITCH_TRACER is not set
1202# CONFIG_EVENT_TRACER is not set
1203# CONFIG_BOOT_TRACER is not set
1204# CONFIG_TRACE_BRANCH_PROFILING is not set
1205# CONFIG_STACK_TRACER is not set
1206# CONFIG_KMEMTRACE is not set
1207# CONFIG_WORKQUEUE_TRACER is not set
1208# CONFIG_BLK_DEV_IO_TRACE is not set
1209# CONFIG_SAMPLES is not set 1223# CONFIG_SAMPLES is not set
1210CONFIG_HAVE_ARCH_KGDB=y 1224CONFIG_HAVE_ARCH_KGDB=y
1225# CONFIG_PPC_DISABLE_WERROR is not set
1226CONFIG_PPC_WERROR=y
1211CONFIG_PRINT_STACK_DEPTH=64 1227CONFIG_PRINT_STACK_DEPTH=64
1212# CONFIG_IRQSTACKS is not set 1228# CONFIG_IRQSTACKS is not set
1213# CONFIG_PPC_EARLY_DEBUG is not set 1229# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/tqm8541_defconfig b/arch/powerpc/configs/85xx/tqm8541_defconfig
index 52fafc006dd0..845731dc51c6 100644
--- a/arch/powerpc/configs/85xx/tqm8541_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8541_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:23 2009 4# Wed Jul 29 23:32:22 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -110,7 +113,6 @@ CONFIG_ANON_INODES=y
110CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
111CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
112# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114# CONFIG_HOTPLUG is not set 116# CONFIG_HOTPLUG is not set
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,9 +125,16 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184CONFIG_TQM8541=y 198CONFIG_TQM8541=y
@@ -228,6 +242,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 242# CONFIG_BINFMT_MISC is not set
229CONFIG_MATH_EMULATION=y 243CONFIG_MATH_EMULATION=y
230# CONFIG_IOMMU_HELPER is not set 244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 247CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -246,9 +261,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 262CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 263CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 264CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
@@ -356,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
357# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
358# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
374# CONFIG_IEEE802154 is not set
359# CONFIG_NET_SCHED is not set 375# CONFIG_NET_SCHED is not set
360# CONFIG_DCB is not set 376# CONFIG_DCB is not set
361 377
@@ -373,7 +389,11 @@ CONFIG_WIRELESS=y
373CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
374# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
375# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
376# CONFIG_MAC80211 is not set 392
393#
394# CFG80211 needs to be enabled for MAC80211
395#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -475,6 +495,7 @@ CONFIG_MTD_CFI_UTIL=y
475CONFIG_OF_DEVICE=y 495CONFIG_OF_DEVICE=y
476CONFIG_OF_GPIO=y 496CONFIG_OF_GPIO=y
477CONFIG_OF_I2C=y 497CONFIG_OF_I2C=y
498CONFIG_OF_MDIO=y
478# CONFIG_PARPORT is not set 499# CONFIG_PARPORT is not set
479CONFIG_BLK_DEV=y 500CONFIG_BLK_DEV=y
480# CONFIG_BLK_DEV_FD is not set 501# CONFIG_BLK_DEV_FD is not set
@@ -509,7 +530,9 @@ CONFIG_MISC_DEVICES=y
509# 530#
510# CONFIG_EEPROM_AT24 is not set 531# CONFIG_EEPROM_AT24 is not set
511# CONFIG_EEPROM_LEGACY is not set 532# CONFIG_EEPROM_LEGACY is not set
533# CONFIG_EEPROM_MAX6875 is not set
512# CONFIG_EEPROM_93CX6 is not set 534# CONFIG_EEPROM_93CX6 is not set
535# CONFIG_CB710_CORE is not set
513CONFIG_HAVE_IDE=y 536CONFIG_HAVE_IDE=y
514CONFIG_IDE=y 537CONFIG_IDE=y
515 538
@@ -584,14 +607,17 @@ CONFIG_BLK_DEV_IDEDMA=y
584# 607#
585 608
586# 609#
587# Enable only one of the two stacks, unless you know what you are doing 610# You can enable one or both FireWire driver stacks.
611#
612
613#
614# See the help texts for more information.
588# 615#
589# CONFIG_FIREWIRE is not set 616# CONFIG_FIREWIRE is not set
590# CONFIG_IEEE1394 is not set 617# CONFIG_IEEE1394 is not set
591# CONFIG_I2O is not set 618# CONFIG_I2O is not set
592# CONFIG_MACINTOSH_DRIVERS is not set 619# CONFIG_MACINTOSH_DRIVERS is not set
593CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
594CONFIG_COMPAT_NET_DEV_OPS=y
595# CONFIG_DUMMY is not set 621# CONFIG_DUMMY is not set
596# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
597# CONFIG_MACVLAN is not set 623# CONFIG_MACVLAN is not set
@@ -654,6 +680,7 @@ CONFIG_E100=y
654# CONFIG_SMSC9420 is not set 680# CONFIG_SMSC9420 is not set
655# CONFIG_SUNDANCE is not set 681# CONFIG_SUNDANCE is not set
656# CONFIG_TLAN is not set 682# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set
657# CONFIG_VIA_RHINE is not set 684# CONFIG_VIA_RHINE is not set
658# CONFIG_SC92031 is not set 685# CONFIG_SC92031 is not set
659# CONFIG_ATL2 is not set 686# CONFIG_ATL2 is not set
@@ -676,8 +703,10 @@ CONFIG_NETDEV_1000=y
676# CONFIG_VIA_VELOCITY is not set 703# CONFIG_VIA_VELOCITY is not set
677# CONFIG_TIGON3 is not set 704# CONFIG_TIGON3 is not set
678# CONFIG_BNX2 is not set 705# CONFIG_BNX2 is not set
706# CONFIG_CNIC is not set
679CONFIG_FSL_PQ_MDIO=y 707CONFIG_FSL_PQ_MDIO=y
680CONFIG_GIANFAR=y 708CONFIG_GIANFAR=y
709# CONFIG_MV643XX_ETH is not set
681# CONFIG_QLA3XXX is not set 710# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set 711# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set 712# CONFIG_ATL1E is not set
@@ -831,6 +860,7 @@ CONFIG_I2C_HELPER_AUTO=y
831# I2C system bus drivers (mostly embedded / system-on-chip) 860# I2C system bus drivers (mostly embedded / system-on-chip)
832# 861#
833# CONFIG_I2C_CPM is not set 862# CONFIG_I2C_CPM is not set
863# CONFIG_I2C_DESIGNWARE is not set
834# CONFIG_I2C_GPIO is not set 864# CONFIG_I2C_GPIO is not set
835CONFIG_I2C_MPC=y 865CONFIG_I2C_MPC=y
836# CONFIG_I2C_OCORES is not set 866# CONFIG_I2C_OCORES is not set
@@ -859,13 +889,17 @@ CONFIG_I2C_MPC=y
859# CONFIG_SENSORS_PCF8574 is not set 889# CONFIG_SENSORS_PCF8574 is not set
860# CONFIG_PCF8575 is not set 890# CONFIG_PCF8575 is not set
861# CONFIG_SENSORS_PCA9539 is not set 891# CONFIG_SENSORS_PCA9539 is not set
862# CONFIG_SENSORS_MAX6875 is not set
863# CONFIG_SENSORS_TSL2550 is not set 892# CONFIG_SENSORS_TSL2550 is not set
864# CONFIG_I2C_DEBUG_CORE is not set 893# CONFIG_I2C_DEBUG_CORE is not set
865# CONFIG_I2C_DEBUG_ALGO is not set 894# CONFIG_I2C_DEBUG_ALGO is not set
866# CONFIG_I2C_DEBUG_BUS is not set 895# CONFIG_I2C_DEBUG_BUS is not set
867# CONFIG_I2C_DEBUG_CHIP is not set 896# CONFIG_I2C_DEBUG_CHIP is not set
868# CONFIG_SPI is not set 897# CONFIG_SPI is not set
898
899#
900# PPS support
901#
902# CONFIG_PPS is not set
869CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 903CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
870CONFIG_ARCH_REQUIRE_GPIOLIB=y 904CONFIG_ARCH_REQUIRE_GPIOLIB=y
871CONFIG_GPIOLIB=y 905CONFIG_GPIOLIB=y
@@ -944,6 +978,7 @@ CONFIG_SENSORS_LM75=y
944# CONFIG_SENSORS_SMSC47B397 is not set 978# CONFIG_SENSORS_SMSC47B397 is not set
945# CONFIG_SENSORS_ADS7828 is not set 979# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 980# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set
947# CONFIG_SENSORS_VIA686A is not set 982# CONFIG_SENSORS_VIA686A is not set
948# CONFIG_SENSORS_VT1211 is not set 983# CONFIG_SENSORS_VT1211 is not set
949# CONFIG_SENSORS_VT8231 is not set 984# CONFIG_SENSORS_VT8231 is not set
@@ -979,23 +1014,9 @@ CONFIG_SSB_POSSIBLE=y
979# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 1016# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set
982# CONFIG_REGULATOR is not set 1018# CONFIG_REGULATOR is not set
983 1019# CONFIG_MEDIA_SUPPORT is not set
984#
985# Multimedia devices
986#
987
988#
989# Multimedia core support
990#
991# CONFIG_VIDEO_DEV is not set
992# CONFIG_DVB_CORE is not set
993# CONFIG_VIDEO_MEDIA is not set
994
995#
996# Multimedia drivers
997#
998CONFIG_DAB=y
999 1020
1000# 1021#
1001# Graphics support 1022# Graphics support
@@ -1052,6 +1073,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1052# CONFIG_DMADEVICES is not set 1073# CONFIG_DMADEVICES is not set
1053# CONFIG_AUXDISPLAY is not set 1074# CONFIG_AUXDISPLAY is not set
1054# CONFIG_UIO is not set 1075# CONFIG_UIO is not set
1076
1077#
1078# TI VLYNQ
1079#
1055# CONFIG_STAGING is not set 1080# CONFIG_STAGING is not set
1056 1081
1057# 1082#
@@ -1071,10 +1096,12 @@ CONFIG_FS_MBCACHE=y
1071# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1072# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1073# CONFIG_FS_POSIX_ACL is not set 1098# CONFIG_FS_POSIX_ACL is not set
1074CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1099# CONFIG_XFS_FS is not set
1100# CONFIG_GFS2_FS is not set
1076# CONFIG_OCFS2_FS is not set 1101# CONFIG_OCFS2_FS is not set
1077# CONFIG_BTRFS_FS is not set 1102# CONFIG_BTRFS_FS is not set
1103CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y
1078CONFIG_DNOTIFY=y 1105CONFIG_DNOTIFY=y
1079CONFIG_INOTIFY=y 1106CONFIG_INOTIFY=y
1080CONFIG_INOTIFY_USER=y 1107CONFIG_INOTIFY_USER=y
@@ -1201,6 +1228,7 @@ CONFIG_HAS_IOPORT=y
1201CONFIG_HAS_DMA=y 1228CONFIG_HAS_DMA=y
1202CONFIG_HAVE_LMB=y 1229CONFIG_HAVE_LMB=y
1203CONFIG_NLATTR=y 1230CONFIG_NLATTR=y
1231CONFIG_GENERIC_ATOMIC64=y
1204 1232
1205# 1233#
1206# Kernel hacking 1234# Kernel hacking
@@ -1226,22 +1254,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1226CONFIG_HAVE_DYNAMIC_FTRACE=y 1254CONFIG_HAVE_DYNAMIC_FTRACE=y
1227CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1228CONFIG_TRACING_SUPPORT=y 1256CONFIG_TRACING_SUPPORT=y
1229 1257# CONFIG_FTRACE is not set
1230#
1231# Tracers
1232#
1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_SCHED_TRACER is not set
1235# CONFIG_CONTEXT_SWITCH_TRACER is not set
1236# CONFIG_EVENT_TRACER is not set
1237# CONFIG_BOOT_TRACER is not set
1238# CONFIG_TRACE_BRANCH_PROFILING is not set
1239# CONFIG_STACK_TRACER is not set
1240# CONFIG_KMEMTRACE is not set
1241# CONFIG_WORKQUEUE_TRACER is not set
1242# CONFIG_BLK_DEV_IO_TRACE is not set
1243# CONFIG_SAMPLES is not set 1258# CONFIG_SAMPLES is not set
1244CONFIG_HAVE_ARCH_KGDB=y 1259CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set
1261CONFIG_PPC_WERROR=y
1245CONFIG_PRINT_STACK_DEPTH=64 1262CONFIG_PRINT_STACK_DEPTH=64
1246# CONFIG_IRQSTACKS is not set 1263# CONFIG_IRQSTACKS is not set
1247# CONFIG_PPC_EARLY_DEBUG is not set 1264# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/tqm8548_defconfig b/arch/powerpc/configs/85xx/tqm8548_defconfig
index 8b4faae7a9a1..4f228a905274 100644
--- a/arch/powerpc/configs/85xx/tqm8548_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8548_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:24 2009 4# Wed Jul 29 23:32:23 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
48CONFIG_PPC=y 49CONFIG_PPC=y
@@ -56,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
56# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
57CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
64 67
65# 68#
66# General setup 69# General setup
@@ -111,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
113# CONFIG_KALLSYMS_EXTRA_PASS is not set 116# CONFIG_KALLSYMS_EXTRA_PASS is not set
114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
116CONFIG_PRINTK=y 118CONFIG_PRINTK=y
117CONFIG_BUG=y 119CONFIG_BUG=y
@@ -124,9 +126,16 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
129CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
131# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
132CONFIG_SLUB=y 141CONFIG_SLUB=y
@@ -140,6 +149,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
140CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
142CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152
153#
154# GCOV-based kernel profiling
155#
143# CONFIG_SLOW_WORK is not set 156# CONFIG_SLOW_WORK is not set
144# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 157# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
145CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
@@ -152,7 +165,7 @@ CONFIG_MODULE_UNLOAD=y
152# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
153# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
154CONFIG_BLOCK=y 167CONFIG_BLOCK=y
155# CONFIG_LBD is not set 168CONFIG_LBDAF=y
156# CONFIG_BLK_DEV_BSG is not set 169# CONFIG_BLK_DEV_BSG is not set
157# CONFIG_BLK_DEV_INTEGRITY is not set 170# CONFIG_BLK_DEV_INTEGRITY is not set
158 171
@@ -185,6 +198,7 @@ CONFIG_MPC85xx=y
185# CONFIG_MPC85xx_DS is not set 198# CONFIG_MPC85xx_DS is not set
186# CONFIG_SOCRATES is not set 199# CONFIG_SOCRATES is not set
187# CONFIG_KSI8560 is not set 200# CONFIG_KSI8560 is not set
201# CONFIG_XES_MPC85xx is not set
188# CONFIG_STX_GP3 is not set 202# CONFIG_STX_GP3 is not set
189# CONFIG_TQM8540 is not set 203# CONFIG_TQM8540 is not set
190# CONFIG_TQM8541 is not set 204# CONFIG_TQM8541 is not set
@@ -234,6 +248,7 @@ CONFIG_BINFMT_ELF=y
234CONFIG_BINFMT_MISC=y 248CONFIG_BINFMT_MISC=y
235CONFIG_MATH_EMULATION=y 249CONFIG_MATH_EMULATION=y
236# CONFIG_IOMMU_HELPER is not set 250# CONFIG_IOMMU_HELPER is not set
251# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +267,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 267CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 268CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 273CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 274# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 275# CONFIG_PPC_64K_PAGES is not set
@@ -281,6 +296,8 @@ CONFIG_PCI_DOMAINS=y
281CONFIG_PCI_SYSCALL=y 296CONFIG_PCI_SYSCALL=y
282CONFIG_PCIEPORTBUS=y 297CONFIG_PCIEPORTBUS=y
283CONFIG_PCIEAER=y 298CONFIG_PCIEAER=y
299# CONFIG_PCIE_ECRC is not set
300# CONFIG_PCIEAER_INJECT is not set
284# CONFIG_PCIEASPM is not set 301# CONFIG_PCIEASPM is not set
285CONFIG_ARCH_SUPPORTS_MSI=y 302CONFIG_ARCH_SUPPORTS_MSI=y
286# CONFIG_PCI_MSI is not set 303# CONFIG_PCI_MSI is not set
@@ -368,6 +385,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_ECONET is not set 385# CONFIG_ECONET is not set
369# CONFIG_WAN_ROUTER is not set 386# CONFIG_WAN_ROUTER is not set
370# CONFIG_PHONET is not set 387# CONFIG_PHONET is not set
388# CONFIG_IEEE802154 is not set
371# CONFIG_NET_SCHED is not set 389# CONFIG_NET_SCHED is not set
372# CONFIG_DCB is not set 390# CONFIG_DCB is not set
373 391
@@ -497,6 +515,7 @@ CONFIG_MTD_NAND_FSL_UPM=y
497# CONFIG_MTD_UBI is not set 515# CONFIG_MTD_UBI is not set
498CONFIG_OF_DEVICE=y 516CONFIG_OF_DEVICE=y
499CONFIG_OF_I2C=y 517CONFIG_OF_I2C=y
518CONFIG_OF_MDIO=y
500# CONFIG_PARPORT is not set 519# CONFIG_PARPORT is not set
501CONFIG_BLK_DEV=y 520CONFIG_BLK_DEV=y
502# CONFIG_BLK_DEV_FD is not set 521# CONFIG_BLK_DEV_FD is not set
@@ -531,7 +550,9 @@ CONFIG_MISC_DEVICES=y
531# 550#
532# CONFIG_EEPROM_AT24 is not set 551# CONFIG_EEPROM_AT24 is not set
533# CONFIG_EEPROM_LEGACY is not set 552# CONFIG_EEPROM_LEGACY is not set
553# CONFIG_EEPROM_MAX6875 is not set
534# CONFIG_EEPROM_93CX6 is not set 554# CONFIG_EEPROM_93CX6 is not set
555# CONFIG_CB710_CORE is not set
535CONFIG_HAVE_IDE=y 556CONFIG_HAVE_IDE=y
536# CONFIG_IDE is not set 557# CONFIG_IDE is not set
537 558
@@ -551,14 +572,17 @@ CONFIG_HAVE_IDE=y
551# 572#
552 573
553# 574#
554# Enable only one of the two stacks, unless you know what you are doing 575# You can enable one or both FireWire driver stacks.
576#
577
578#
579# See the help texts for more information.
555# 580#
556# CONFIG_FIREWIRE is not set 581# CONFIG_FIREWIRE is not set
557# CONFIG_IEEE1394 is not set 582# CONFIG_IEEE1394 is not set
558# CONFIG_I2O is not set 583# CONFIG_I2O is not set
559# CONFIG_MACINTOSH_DRIVERS is not set 584# CONFIG_MACINTOSH_DRIVERS is not set
560CONFIG_NETDEVICES=y 585CONFIG_NETDEVICES=y
561CONFIG_COMPAT_NET_DEV_OPS=y
562# CONFIG_DUMMY is not set 586# CONFIG_DUMMY is not set
563# CONFIG_BONDING is not set 587# CONFIG_BONDING is not set
564# CONFIG_MACVLAN is not set 588# CONFIG_MACVLAN is not set
@@ -605,6 +629,7 @@ CONFIG_MII=y
605# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 629# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
606# CONFIG_NET_PCI is not set 630# CONFIG_NET_PCI is not set
607# CONFIG_B44 is not set 631# CONFIG_B44 is not set
632# CONFIG_KS8842 is not set
608# CONFIG_ATL2 is not set 633# CONFIG_ATL2 is not set
609CONFIG_NETDEV_1000=y 634CONFIG_NETDEV_1000=y
610# CONFIG_ACENIC is not set 635# CONFIG_ACENIC is not set
@@ -624,8 +649,10 @@ CONFIG_NETDEV_1000=y
624# CONFIG_VIA_VELOCITY is not set 649# CONFIG_VIA_VELOCITY is not set
625# CONFIG_TIGON3 is not set 650# CONFIG_TIGON3 is not set
626# CONFIG_BNX2 is not set 651# CONFIG_BNX2 is not set
652# CONFIG_CNIC is not set
627CONFIG_FSL_PQ_MDIO=y 653CONFIG_FSL_PQ_MDIO=y
628CONFIG_GIANFAR=y 654CONFIG_GIANFAR=y
655# CONFIG_MV643XX_ETH is not set
629# CONFIG_QLA3XXX is not set 656# CONFIG_QLA3XXX is not set
630# CONFIG_ATL1 is not set 657# CONFIG_ATL1 is not set
631# CONFIG_ATL1E is not set 658# CONFIG_ATL1E is not set
@@ -801,13 +828,17 @@ CONFIG_I2C_MPC=y
801# CONFIG_SENSORS_PCF8574 is not set 828# CONFIG_SENSORS_PCF8574 is not set
802# CONFIG_PCF8575 is not set 829# CONFIG_PCF8575 is not set
803# CONFIG_SENSORS_PCA9539 is not set 830# CONFIG_SENSORS_PCA9539 is not set
804# CONFIG_SENSORS_MAX6875 is not set
805# CONFIG_SENSORS_TSL2550 is not set 831# CONFIG_SENSORS_TSL2550 is not set
806# CONFIG_I2C_DEBUG_CORE is not set 832# CONFIG_I2C_DEBUG_CORE is not set
807# CONFIG_I2C_DEBUG_ALGO is not set 833# CONFIG_I2C_DEBUG_ALGO is not set
808# CONFIG_I2C_DEBUG_BUS is not set 834# CONFIG_I2C_DEBUG_BUS is not set
809# CONFIG_I2C_DEBUG_CHIP is not set 835# CONFIG_I2C_DEBUG_CHIP is not set
810# CONFIG_SPI is not set 836# CONFIG_SPI is not set
837
838#
839# PPS support
840#
841# CONFIG_PPS is not set
811CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 842CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
812# CONFIG_GPIOLIB is not set 843# CONFIG_GPIOLIB is not set
813# CONFIG_W1 is not set 844# CONFIG_W1 is not set
@@ -862,6 +893,7 @@ CONFIG_SENSORS_LM75=y
862# CONFIG_SENSORS_SMSC47B397 is not set 893# CONFIG_SENSORS_SMSC47B397 is not set
863# CONFIG_SENSORS_ADS7828 is not set 894# CONFIG_SENSORS_ADS7828 is not set
864# CONFIG_SENSORS_THMC50 is not set 895# CONFIG_SENSORS_THMC50 is not set
896# CONFIG_SENSORS_TMP401 is not set
865# CONFIG_SENSORS_VIA686A is not set 897# CONFIG_SENSORS_VIA686A is not set
866# CONFIG_SENSORS_VT1211 is not set 898# CONFIG_SENSORS_VT1211 is not set
867# CONFIG_SENSORS_VT8231 is not set 899# CONFIG_SENSORS_VT8231 is not set
@@ -896,23 +928,9 @@ CONFIG_SSB_POSSIBLE=y
896# CONFIG_MFD_WM8400 is not set 928# CONFIG_MFD_WM8400 is not set
897# CONFIG_MFD_WM8350_I2C is not set 929# CONFIG_MFD_WM8350_I2C is not set
898# CONFIG_MFD_PCF50633 is not set 930# CONFIG_MFD_PCF50633 is not set
931# CONFIG_AB3100_CORE is not set
899# CONFIG_REGULATOR is not set 932# CONFIG_REGULATOR is not set
900 933# CONFIG_MEDIA_SUPPORT is not set
901#
902# Multimedia devices
903#
904
905#
906# Multimedia core support
907#
908# CONFIG_VIDEO_DEV is not set
909# CONFIG_DVB_CORE is not set
910# CONFIG_VIDEO_MEDIA is not set
911
912#
913# Multimedia drivers
914#
915CONFIG_DAB=y
916 934
917# 935#
918# Graphics support 936# Graphics support
@@ -977,6 +995,7 @@ CONFIG_RTC_DRV_DS1307=y
977# CONFIG_RTC_DRV_S35390A is not set 995# CONFIG_RTC_DRV_S35390A is not set
978# CONFIG_RTC_DRV_FM3130 is not set 996# CONFIG_RTC_DRV_FM3130 is not set
979# CONFIG_RTC_DRV_RX8581 is not set 997# CONFIG_RTC_DRV_RX8581 is not set
998# CONFIG_RTC_DRV_RX8025 is not set
980 999
981# 1000#
982# SPI RTC drivers 1001# SPI RTC drivers
@@ -1004,6 +1023,10 @@ CONFIG_RTC_DRV_DS1307=y
1004# CONFIG_DMADEVICES is not set 1023# CONFIG_DMADEVICES is not set
1005# CONFIG_AUXDISPLAY is not set 1024# CONFIG_AUXDISPLAY is not set
1006# CONFIG_UIO is not set 1025# CONFIG_UIO is not set
1026
1027#
1028# TI VLYNQ
1029#
1007# CONFIG_STAGING is not set 1030# CONFIG_STAGING is not set
1008 1031
1009# 1032#
@@ -1015,10 +1038,12 @@ CONFIG_RTC_DRV_DS1307=y
1015# CONFIG_REISERFS_FS is not set 1038# CONFIG_REISERFS_FS is not set
1016# CONFIG_JFS_FS is not set 1039# CONFIG_JFS_FS is not set
1017# CONFIG_FS_POSIX_ACL is not set 1040# CONFIG_FS_POSIX_ACL is not set
1018CONFIG_FILE_LOCKING=y
1019# CONFIG_XFS_FS is not set 1041# CONFIG_XFS_FS is not set
1042# CONFIG_GFS2_FS is not set
1020# CONFIG_OCFS2_FS is not set 1043# CONFIG_OCFS2_FS is not set
1021# CONFIG_BTRFS_FS is not set 1044# CONFIG_BTRFS_FS is not set
1045CONFIG_FILE_LOCKING=y
1046CONFIG_FSNOTIFY=y
1022CONFIG_DNOTIFY=y 1047CONFIG_DNOTIFY=y
1023CONFIG_INOTIFY=y 1048CONFIG_INOTIFY=y
1024CONFIG_INOTIFY_USER=y 1049CONFIG_INOTIFY_USER=y
@@ -1145,6 +1170,7 @@ CONFIG_HAS_IOPORT=y
1145CONFIG_HAS_DMA=y 1170CONFIG_HAS_DMA=y
1146CONFIG_HAVE_LMB=y 1171CONFIG_HAVE_LMB=y
1147CONFIG_NLATTR=y 1172CONFIG_NLATTR=y
1173CONFIG_GENERIC_ATOMIC64=y
1148 1174
1149# 1175#
1150# Kernel hacking 1176# Kernel hacking
@@ -1175,6 +1201,9 @@ CONFIG_SCHED_DEBUG=y
1175# CONFIG_RT_MUTEX_TESTER is not set 1201# CONFIG_RT_MUTEX_TESTER is not set
1176# CONFIG_DEBUG_SPINLOCK is not set 1202# CONFIG_DEBUG_SPINLOCK is not set
1177CONFIG_DEBUG_MUTEXES=y 1203CONFIG_DEBUG_MUTEXES=y
1204# CONFIG_DEBUG_LOCK_ALLOC is not set
1205# CONFIG_PROVE_LOCKING is not set
1206# CONFIG_LOCK_STAT is not set
1178# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1207# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1179# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1208# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1180# CONFIG_DEBUG_KOBJECT is not set 1209# CONFIG_DEBUG_KOBJECT is not set
@@ -1187,7 +1216,6 @@ CONFIG_DEBUG_MUTEXES=y
1187# CONFIG_DEBUG_LIST is not set 1216# CONFIG_DEBUG_LIST is not set
1188# CONFIG_DEBUG_SG is not set 1217# CONFIG_DEBUG_SG is not set
1189# CONFIG_DEBUG_NOTIFIERS is not set 1218# CONFIG_DEBUG_NOTIFIERS is not set
1190# CONFIG_BOOT_PRINTK_DELAY is not set
1191# CONFIG_RCU_TORTURE_TEST is not set 1219# CONFIG_RCU_TORTURE_TEST is not set
1192# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1220# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1193# CONFIG_BACKTRACE_SELF_TEST is not set 1221# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1201,16 +1229,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1201CONFIG_HAVE_DYNAMIC_FTRACE=y 1229CONFIG_HAVE_DYNAMIC_FTRACE=y
1202CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1230CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1203CONFIG_TRACING_SUPPORT=y 1231CONFIG_TRACING_SUPPORT=y
1204 1232CONFIG_FTRACE=y
1205#
1206# Tracers
1207#
1208# CONFIG_FUNCTION_TRACER is not set 1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_IRQSOFF_TRACER is not set
1209# CONFIG_SCHED_TRACER is not set 1235# CONFIG_SCHED_TRACER is not set
1210# CONFIG_CONTEXT_SWITCH_TRACER is not set 1236# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1211# CONFIG_EVENT_TRACER is not set
1212# CONFIG_BOOT_TRACER is not set 1237# CONFIG_BOOT_TRACER is not set
1213# CONFIG_TRACE_BRANCH_PROFILING is not set 1238CONFIG_BRANCH_PROFILE_NONE=y
1239# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1240# CONFIG_PROFILE_ALL_BRANCHES is not set
1214# CONFIG_STACK_TRACER is not set 1241# CONFIG_STACK_TRACER is not set
1215# CONFIG_KMEMTRACE is not set 1242# CONFIG_KMEMTRACE is not set
1216# CONFIG_WORKQUEUE_TRACER is not set 1243# CONFIG_WORKQUEUE_TRACER is not set
@@ -1218,6 +1245,9 @@ CONFIG_TRACING_SUPPORT=y
1218# CONFIG_SAMPLES is not set 1245# CONFIG_SAMPLES is not set
1219CONFIG_HAVE_ARCH_KGDB=y 1246CONFIG_HAVE_ARCH_KGDB=y
1220# CONFIG_KGDB is not set 1247# CONFIG_KGDB is not set
1248# CONFIG_KMEMCHECK is not set
1249# CONFIG_PPC_DISABLE_WERROR is not set
1250CONFIG_PPC_WERROR=y
1221CONFIG_PRINT_STACK_DEPTH=64 1251CONFIG_PRINT_STACK_DEPTH=64
1222# CONFIG_DEBUG_STACKOVERFLOW is not set 1252# CONFIG_DEBUG_STACKOVERFLOW is not set
1223# CONFIG_DEBUG_STACK_USAGE is not set 1253# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/85xx/tqm8555_defconfig b/arch/powerpc/configs/85xx/tqm8555_defconfig
index 170360934cec..9196724bebc7 100644
--- a/arch/powerpc/configs/85xx/tqm8555_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8555_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:25 2009 4# Wed Jul 29 23:32:24 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -110,7 +113,6 @@ CONFIG_ANON_INODES=y
110CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
111CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
112# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114# CONFIG_HOTPLUG is not set 116# CONFIG_HOTPLUG is not set
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,9 +125,16 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184# CONFIG_TQM8541 is not set 198# CONFIG_TQM8541 is not set
@@ -228,6 +242,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 242# CONFIG_BINFMT_MISC is not set
229CONFIG_MATH_EMULATION=y 243CONFIG_MATH_EMULATION=y
230# CONFIG_IOMMU_HELPER is not set 244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 247CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -246,9 +261,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 262CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 263CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 264CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
@@ -356,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
357# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
358# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
374# CONFIG_IEEE802154 is not set
359# CONFIG_NET_SCHED is not set 375# CONFIG_NET_SCHED is not set
360# CONFIG_DCB is not set 376# CONFIG_DCB is not set
361 377
@@ -373,7 +389,11 @@ CONFIG_WIRELESS=y
373CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
374# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
375# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
376# CONFIG_MAC80211 is not set 392
393#
394# CFG80211 needs to be enabled for MAC80211
395#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -475,6 +495,7 @@ CONFIG_MTD_CFI_UTIL=y
475CONFIG_OF_DEVICE=y 495CONFIG_OF_DEVICE=y
476CONFIG_OF_GPIO=y 496CONFIG_OF_GPIO=y
477CONFIG_OF_I2C=y 497CONFIG_OF_I2C=y
498CONFIG_OF_MDIO=y
478# CONFIG_PARPORT is not set 499# CONFIG_PARPORT is not set
479CONFIG_BLK_DEV=y 500CONFIG_BLK_DEV=y
480# CONFIG_BLK_DEV_FD is not set 501# CONFIG_BLK_DEV_FD is not set
@@ -509,7 +530,9 @@ CONFIG_MISC_DEVICES=y
509# 530#
510# CONFIG_EEPROM_AT24 is not set 531# CONFIG_EEPROM_AT24 is not set
511# CONFIG_EEPROM_LEGACY is not set 532# CONFIG_EEPROM_LEGACY is not set
533# CONFIG_EEPROM_MAX6875 is not set
512# CONFIG_EEPROM_93CX6 is not set 534# CONFIG_EEPROM_93CX6 is not set
535# CONFIG_CB710_CORE is not set
513CONFIG_HAVE_IDE=y 536CONFIG_HAVE_IDE=y
514CONFIG_IDE=y 537CONFIG_IDE=y
515 538
@@ -584,14 +607,17 @@ CONFIG_BLK_DEV_IDEDMA=y
584# 607#
585 608
586# 609#
587# Enable only one of the two stacks, unless you know what you are doing 610# You can enable one or both FireWire driver stacks.
611#
612
613#
614# See the help texts for more information.
588# 615#
589# CONFIG_FIREWIRE is not set 616# CONFIG_FIREWIRE is not set
590# CONFIG_IEEE1394 is not set 617# CONFIG_IEEE1394 is not set
591# CONFIG_I2O is not set 618# CONFIG_I2O is not set
592# CONFIG_MACINTOSH_DRIVERS is not set 619# CONFIG_MACINTOSH_DRIVERS is not set
593CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
594CONFIG_COMPAT_NET_DEV_OPS=y
595# CONFIG_DUMMY is not set 621# CONFIG_DUMMY is not set
596# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
597# CONFIG_MACVLAN is not set 623# CONFIG_MACVLAN is not set
@@ -654,6 +680,7 @@ CONFIG_E100=y
654# CONFIG_SMSC9420 is not set 680# CONFIG_SMSC9420 is not set
655# CONFIG_SUNDANCE is not set 681# CONFIG_SUNDANCE is not set
656# CONFIG_TLAN is not set 682# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set
657# CONFIG_VIA_RHINE is not set 684# CONFIG_VIA_RHINE is not set
658# CONFIG_SC92031 is not set 685# CONFIG_SC92031 is not set
659# CONFIG_ATL2 is not set 686# CONFIG_ATL2 is not set
@@ -676,8 +703,10 @@ CONFIG_NETDEV_1000=y
676# CONFIG_VIA_VELOCITY is not set 703# CONFIG_VIA_VELOCITY is not set
677# CONFIG_TIGON3 is not set 704# CONFIG_TIGON3 is not set
678# CONFIG_BNX2 is not set 705# CONFIG_BNX2 is not set
706# CONFIG_CNIC is not set
679CONFIG_FSL_PQ_MDIO=y 707CONFIG_FSL_PQ_MDIO=y
680CONFIG_GIANFAR=y 708CONFIG_GIANFAR=y
709# CONFIG_MV643XX_ETH is not set
681# CONFIG_QLA3XXX is not set 710# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set 711# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set 712# CONFIG_ATL1E is not set
@@ -831,6 +860,7 @@ CONFIG_I2C_HELPER_AUTO=y
831# I2C system bus drivers (mostly embedded / system-on-chip) 860# I2C system bus drivers (mostly embedded / system-on-chip)
832# 861#
833# CONFIG_I2C_CPM is not set 862# CONFIG_I2C_CPM is not set
863# CONFIG_I2C_DESIGNWARE is not set
834# CONFIG_I2C_GPIO is not set 864# CONFIG_I2C_GPIO is not set
835CONFIG_I2C_MPC=y 865CONFIG_I2C_MPC=y
836# CONFIG_I2C_OCORES is not set 866# CONFIG_I2C_OCORES is not set
@@ -859,13 +889,17 @@ CONFIG_I2C_MPC=y
859# CONFIG_SENSORS_PCF8574 is not set 889# CONFIG_SENSORS_PCF8574 is not set
860# CONFIG_PCF8575 is not set 890# CONFIG_PCF8575 is not set
861# CONFIG_SENSORS_PCA9539 is not set 891# CONFIG_SENSORS_PCA9539 is not set
862# CONFIG_SENSORS_MAX6875 is not set
863# CONFIG_SENSORS_TSL2550 is not set 892# CONFIG_SENSORS_TSL2550 is not set
864# CONFIG_I2C_DEBUG_CORE is not set 893# CONFIG_I2C_DEBUG_CORE is not set
865# CONFIG_I2C_DEBUG_ALGO is not set 894# CONFIG_I2C_DEBUG_ALGO is not set
866# CONFIG_I2C_DEBUG_BUS is not set 895# CONFIG_I2C_DEBUG_BUS is not set
867# CONFIG_I2C_DEBUG_CHIP is not set 896# CONFIG_I2C_DEBUG_CHIP is not set
868# CONFIG_SPI is not set 897# CONFIG_SPI is not set
898
899#
900# PPS support
901#
902# CONFIG_PPS is not set
869CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 903CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
870CONFIG_ARCH_REQUIRE_GPIOLIB=y 904CONFIG_ARCH_REQUIRE_GPIOLIB=y
871CONFIG_GPIOLIB=y 905CONFIG_GPIOLIB=y
@@ -944,6 +978,7 @@ CONFIG_SENSORS_LM75=y
944# CONFIG_SENSORS_SMSC47B397 is not set 978# CONFIG_SENSORS_SMSC47B397 is not set
945# CONFIG_SENSORS_ADS7828 is not set 979# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 980# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set
947# CONFIG_SENSORS_VIA686A is not set 982# CONFIG_SENSORS_VIA686A is not set
948# CONFIG_SENSORS_VT1211 is not set 983# CONFIG_SENSORS_VT1211 is not set
949# CONFIG_SENSORS_VT8231 is not set 984# CONFIG_SENSORS_VT8231 is not set
@@ -979,23 +1014,9 @@ CONFIG_SSB_POSSIBLE=y
979# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 1016# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set
982# CONFIG_REGULATOR is not set 1018# CONFIG_REGULATOR is not set
983 1019# CONFIG_MEDIA_SUPPORT is not set
984#
985# Multimedia devices
986#
987
988#
989# Multimedia core support
990#
991# CONFIG_VIDEO_DEV is not set
992# CONFIG_DVB_CORE is not set
993# CONFIG_VIDEO_MEDIA is not set
994
995#
996# Multimedia drivers
997#
998CONFIG_DAB=y
999 1020
1000# 1021#
1001# Graphics support 1022# Graphics support
@@ -1052,6 +1073,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1052# CONFIG_DMADEVICES is not set 1073# CONFIG_DMADEVICES is not set
1053# CONFIG_AUXDISPLAY is not set 1074# CONFIG_AUXDISPLAY is not set
1054# CONFIG_UIO is not set 1075# CONFIG_UIO is not set
1076
1077#
1078# TI VLYNQ
1079#
1055# CONFIG_STAGING is not set 1080# CONFIG_STAGING is not set
1056 1081
1057# 1082#
@@ -1071,10 +1096,12 @@ CONFIG_FS_MBCACHE=y
1071# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1072# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1073# CONFIG_FS_POSIX_ACL is not set 1098# CONFIG_FS_POSIX_ACL is not set
1074CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1099# CONFIG_XFS_FS is not set
1100# CONFIG_GFS2_FS is not set
1076# CONFIG_OCFS2_FS is not set 1101# CONFIG_OCFS2_FS is not set
1077# CONFIG_BTRFS_FS is not set 1102# CONFIG_BTRFS_FS is not set
1103CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y
1078CONFIG_DNOTIFY=y 1105CONFIG_DNOTIFY=y
1079CONFIG_INOTIFY=y 1106CONFIG_INOTIFY=y
1080CONFIG_INOTIFY_USER=y 1107CONFIG_INOTIFY_USER=y
@@ -1201,6 +1228,7 @@ CONFIG_HAS_IOPORT=y
1201CONFIG_HAS_DMA=y 1228CONFIG_HAS_DMA=y
1202CONFIG_HAVE_LMB=y 1229CONFIG_HAVE_LMB=y
1203CONFIG_NLATTR=y 1230CONFIG_NLATTR=y
1231CONFIG_GENERIC_ATOMIC64=y
1204 1232
1205# 1233#
1206# Kernel hacking 1234# Kernel hacking
@@ -1226,22 +1254,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1226CONFIG_HAVE_DYNAMIC_FTRACE=y 1254CONFIG_HAVE_DYNAMIC_FTRACE=y
1227CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1228CONFIG_TRACING_SUPPORT=y 1256CONFIG_TRACING_SUPPORT=y
1229 1257# CONFIG_FTRACE is not set
1230#
1231# Tracers
1232#
1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_SCHED_TRACER is not set
1235# CONFIG_CONTEXT_SWITCH_TRACER is not set
1236# CONFIG_EVENT_TRACER is not set
1237# CONFIG_BOOT_TRACER is not set
1238# CONFIG_TRACE_BRANCH_PROFILING is not set
1239# CONFIG_STACK_TRACER is not set
1240# CONFIG_KMEMTRACE is not set
1241# CONFIG_WORKQUEUE_TRACER is not set
1242# CONFIG_BLK_DEV_IO_TRACE is not set
1243# CONFIG_SAMPLES is not set 1258# CONFIG_SAMPLES is not set
1244CONFIG_HAVE_ARCH_KGDB=y 1259CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set
1261CONFIG_PPC_WERROR=y
1245CONFIG_PRINT_STACK_DEPTH=64 1262CONFIG_PRINT_STACK_DEPTH=64
1246# CONFIG_IRQSTACKS is not set 1263# CONFIG_IRQSTACKS is not set
1247# CONFIG_PPC_EARLY_DEBUG is not set 1264# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/tqm8560_defconfig b/arch/powerpc/configs/85xx/tqm8560_defconfig
index f41cc2444d48..2e49a6e9faf2 100644
--- a/arch/powerpc/configs/85xx/tqm8560_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8560_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:26 2009 4# Wed Jul 29 23:32:25 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -110,7 +113,6 @@ CONFIG_ANON_INODES=y
110CONFIG_EMBEDDED=y 113CONFIG_EMBEDDED=y
111CONFIG_SYSCTL_SYSCALL=y 114CONFIG_SYSCTL_SYSCALL=y
112# CONFIG_KALLSYMS is not set 115# CONFIG_KALLSYMS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114# CONFIG_HOTPLUG is not set 116# CONFIG_HOTPLUG is not set
115CONFIG_PRINTK=y 117CONFIG_PRINTK=y
116CONFIG_BUG=y 118CONFIG_BUG=y
@@ -123,9 +125,16 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y
129
130#
131# Performance Counters
132#
133# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 134CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 135CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 136CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
131CONFIG_SLUB=y 140CONFIG_SLUB=y
@@ -139,6 +148,10 @@ CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151
152#
153# GCOV-based kernel profiling
154#
142# CONFIG_SLOW_WORK is not set 155# CONFIG_SLOW_WORK is not set
143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 156# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
144CONFIG_SLABINFO=y 157CONFIG_SLABINFO=y
@@ -146,7 +159,7 @@ CONFIG_RT_MUTEXES=y
146CONFIG_BASE_SMALL=0 159CONFIG_BASE_SMALL=0
147# CONFIG_MODULES is not set 160# CONFIG_MODULES is not set
148CONFIG_BLOCK=y 161CONFIG_BLOCK=y
149# CONFIG_LBD is not set 162CONFIG_LBDAF=y
150# CONFIG_BLK_DEV_BSG is not set 163# CONFIG_BLK_DEV_BSG is not set
151# CONFIG_BLK_DEV_INTEGRITY is not set 164# CONFIG_BLK_DEV_INTEGRITY is not set
152 165
@@ -179,6 +192,7 @@ CONFIG_MPC85xx=y
179# CONFIG_MPC85xx_DS is not set 192# CONFIG_MPC85xx_DS is not set
180# CONFIG_SOCRATES is not set 193# CONFIG_SOCRATES is not set
181# CONFIG_KSI8560 is not set 194# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set
182# CONFIG_STX_GP3 is not set 196# CONFIG_STX_GP3 is not set
183# CONFIG_TQM8540 is not set 197# CONFIG_TQM8540 is not set
184# CONFIG_TQM8541 is not set 198# CONFIG_TQM8541 is not set
@@ -228,6 +242,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_BINFMT_MISC is not set 242# CONFIG_BINFMT_MISC is not set
229CONFIG_MATH_EMULATION=y 243CONFIG_MATH_EMULATION=y
230# CONFIG_IOMMU_HELPER is not set 244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 247CONFIG_ARCH_HAS_WALK_MEMORY=y
233CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -246,9 +261,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 262CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 263CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 264CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
@@ -356,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
357# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
358# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
374# CONFIG_IEEE802154 is not set
359# CONFIG_NET_SCHED is not set 375# CONFIG_NET_SCHED is not set
360# CONFIG_DCB is not set 376# CONFIG_DCB is not set
361 377
@@ -373,7 +389,11 @@ CONFIG_WIRELESS=y
373CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
374# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
375# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
376# CONFIG_MAC80211 is not set 392
393#
394# CFG80211 needs to be enabled for MAC80211
395#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -475,6 +495,7 @@ CONFIG_MTD_CFI_UTIL=y
475CONFIG_OF_DEVICE=y 495CONFIG_OF_DEVICE=y
476CONFIG_OF_GPIO=y 496CONFIG_OF_GPIO=y
477CONFIG_OF_I2C=y 497CONFIG_OF_I2C=y
498CONFIG_OF_MDIO=y
478# CONFIG_PARPORT is not set 499# CONFIG_PARPORT is not set
479CONFIG_BLK_DEV=y 500CONFIG_BLK_DEV=y
480# CONFIG_BLK_DEV_FD is not set 501# CONFIG_BLK_DEV_FD is not set
@@ -509,7 +530,9 @@ CONFIG_MISC_DEVICES=y
509# 530#
510# CONFIG_EEPROM_AT24 is not set 531# CONFIG_EEPROM_AT24 is not set
511# CONFIG_EEPROM_LEGACY is not set 532# CONFIG_EEPROM_LEGACY is not set
533# CONFIG_EEPROM_MAX6875 is not set
512# CONFIG_EEPROM_93CX6 is not set 534# CONFIG_EEPROM_93CX6 is not set
535# CONFIG_CB710_CORE is not set
513CONFIG_HAVE_IDE=y 536CONFIG_HAVE_IDE=y
514CONFIG_IDE=y 537CONFIG_IDE=y
515 538
@@ -584,14 +607,17 @@ CONFIG_BLK_DEV_IDEDMA=y
584# 607#
585 608
586# 609#
587# Enable only one of the two stacks, unless you know what you are doing 610# You can enable one or both FireWire driver stacks.
611#
612
613#
614# See the help texts for more information.
588# 615#
589# CONFIG_FIREWIRE is not set 616# CONFIG_FIREWIRE is not set
590# CONFIG_IEEE1394 is not set 617# CONFIG_IEEE1394 is not set
591# CONFIG_I2O is not set 618# CONFIG_I2O is not set
592# CONFIG_MACINTOSH_DRIVERS is not set 619# CONFIG_MACINTOSH_DRIVERS is not set
593CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
594CONFIG_COMPAT_NET_DEV_OPS=y
595# CONFIG_DUMMY is not set 621# CONFIG_DUMMY is not set
596# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
597# CONFIG_MACVLAN is not set 623# CONFIG_MACVLAN is not set
@@ -654,6 +680,7 @@ CONFIG_E100=y
654# CONFIG_SMSC9420 is not set 680# CONFIG_SMSC9420 is not set
655# CONFIG_SUNDANCE is not set 681# CONFIG_SUNDANCE is not set
656# CONFIG_TLAN is not set 682# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set
657# CONFIG_VIA_RHINE is not set 684# CONFIG_VIA_RHINE is not set
658# CONFIG_SC92031 is not set 685# CONFIG_SC92031 is not set
659# CONFIG_ATL2 is not set 686# CONFIG_ATL2 is not set
@@ -676,8 +703,10 @@ CONFIG_NETDEV_1000=y
676# CONFIG_VIA_VELOCITY is not set 703# CONFIG_VIA_VELOCITY is not set
677# CONFIG_TIGON3 is not set 704# CONFIG_TIGON3 is not set
678# CONFIG_BNX2 is not set 705# CONFIG_BNX2 is not set
706# CONFIG_CNIC is not set
679CONFIG_FSL_PQ_MDIO=y 707CONFIG_FSL_PQ_MDIO=y
680CONFIG_GIANFAR=y 708CONFIG_GIANFAR=y
709# CONFIG_MV643XX_ETH is not set
681# CONFIG_QLA3XXX is not set 710# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set 711# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set 712# CONFIG_ATL1E is not set
@@ -831,6 +860,7 @@ CONFIG_I2C_HELPER_AUTO=y
831# I2C system bus drivers (mostly embedded / system-on-chip) 860# I2C system bus drivers (mostly embedded / system-on-chip)
832# 861#
833# CONFIG_I2C_CPM is not set 862# CONFIG_I2C_CPM is not set
863# CONFIG_I2C_DESIGNWARE is not set
834# CONFIG_I2C_GPIO is not set 864# CONFIG_I2C_GPIO is not set
835CONFIG_I2C_MPC=y 865CONFIG_I2C_MPC=y
836# CONFIG_I2C_OCORES is not set 866# CONFIG_I2C_OCORES is not set
@@ -859,13 +889,17 @@ CONFIG_I2C_MPC=y
859# CONFIG_SENSORS_PCF8574 is not set 889# CONFIG_SENSORS_PCF8574 is not set
860# CONFIG_PCF8575 is not set 890# CONFIG_PCF8575 is not set
861# CONFIG_SENSORS_PCA9539 is not set 891# CONFIG_SENSORS_PCA9539 is not set
862# CONFIG_SENSORS_MAX6875 is not set
863# CONFIG_SENSORS_TSL2550 is not set 892# CONFIG_SENSORS_TSL2550 is not set
864# CONFIG_I2C_DEBUG_CORE is not set 893# CONFIG_I2C_DEBUG_CORE is not set
865# CONFIG_I2C_DEBUG_ALGO is not set 894# CONFIG_I2C_DEBUG_ALGO is not set
866# CONFIG_I2C_DEBUG_BUS is not set 895# CONFIG_I2C_DEBUG_BUS is not set
867# CONFIG_I2C_DEBUG_CHIP is not set 896# CONFIG_I2C_DEBUG_CHIP is not set
868# CONFIG_SPI is not set 897# CONFIG_SPI is not set
898
899#
900# PPS support
901#
902# CONFIG_PPS is not set
869CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 903CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
870CONFIG_ARCH_REQUIRE_GPIOLIB=y 904CONFIG_ARCH_REQUIRE_GPIOLIB=y
871CONFIG_GPIOLIB=y 905CONFIG_GPIOLIB=y
@@ -944,6 +978,7 @@ CONFIG_SENSORS_LM75=y
944# CONFIG_SENSORS_SMSC47B397 is not set 978# CONFIG_SENSORS_SMSC47B397 is not set
945# CONFIG_SENSORS_ADS7828 is not set 979# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 980# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set
947# CONFIG_SENSORS_VIA686A is not set 982# CONFIG_SENSORS_VIA686A is not set
948# CONFIG_SENSORS_VT1211 is not set 983# CONFIG_SENSORS_VT1211 is not set
949# CONFIG_SENSORS_VT8231 is not set 984# CONFIG_SENSORS_VT8231 is not set
@@ -979,23 +1014,9 @@ CONFIG_SSB_POSSIBLE=y
979# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 1016# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set
982# CONFIG_REGULATOR is not set 1018# CONFIG_REGULATOR is not set
983 1019# CONFIG_MEDIA_SUPPORT is not set
984#
985# Multimedia devices
986#
987
988#
989# Multimedia core support
990#
991# CONFIG_VIDEO_DEV is not set
992# CONFIG_DVB_CORE is not set
993# CONFIG_VIDEO_MEDIA is not set
994
995#
996# Multimedia drivers
997#
998CONFIG_DAB=y
999 1020
1000# 1021#
1001# Graphics support 1022# Graphics support
@@ -1052,6 +1073,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1052# CONFIG_DMADEVICES is not set 1073# CONFIG_DMADEVICES is not set
1053# CONFIG_AUXDISPLAY is not set 1074# CONFIG_AUXDISPLAY is not set
1054# CONFIG_UIO is not set 1075# CONFIG_UIO is not set
1076
1077#
1078# TI VLYNQ
1079#
1055# CONFIG_STAGING is not set 1080# CONFIG_STAGING is not set
1056 1081
1057# 1082#
@@ -1071,10 +1096,12 @@ CONFIG_FS_MBCACHE=y
1071# CONFIG_REISERFS_FS is not set 1096# CONFIG_REISERFS_FS is not set
1072# CONFIG_JFS_FS is not set 1097# CONFIG_JFS_FS is not set
1073# CONFIG_FS_POSIX_ACL is not set 1098# CONFIG_FS_POSIX_ACL is not set
1074CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1099# CONFIG_XFS_FS is not set
1100# CONFIG_GFS2_FS is not set
1076# CONFIG_OCFS2_FS is not set 1101# CONFIG_OCFS2_FS is not set
1077# CONFIG_BTRFS_FS is not set 1102# CONFIG_BTRFS_FS is not set
1103CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y
1078CONFIG_DNOTIFY=y 1105CONFIG_DNOTIFY=y
1079CONFIG_INOTIFY=y 1106CONFIG_INOTIFY=y
1080CONFIG_INOTIFY_USER=y 1107CONFIG_INOTIFY_USER=y
@@ -1201,6 +1228,7 @@ CONFIG_HAS_IOPORT=y
1201CONFIG_HAS_DMA=y 1228CONFIG_HAS_DMA=y
1202CONFIG_HAVE_LMB=y 1229CONFIG_HAVE_LMB=y
1203CONFIG_NLATTR=y 1230CONFIG_NLATTR=y
1231CONFIG_GENERIC_ATOMIC64=y
1204 1232
1205# 1233#
1206# Kernel hacking 1234# Kernel hacking
@@ -1226,22 +1254,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1226CONFIG_HAVE_DYNAMIC_FTRACE=y 1254CONFIG_HAVE_DYNAMIC_FTRACE=y
1227CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1228CONFIG_TRACING_SUPPORT=y 1256CONFIG_TRACING_SUPPORT=y
1229 1257# CONFIG_FTRACE is not set
1230#
1231# Tracers
1232#
1233# CONFIG_FUNCTION_TRACER is not set
1234# CONFIG_SCHED_TRACER is not set
1235# CONFIG_CONTEXT_SWITCH_TRACER is not set
1236# CONFIG_EVENT_TRACER is not set
1237# CONFIG_BOOT_TRACER is not set
1238# CONFIG_TRACE_BRANCH_PROFILING is not set
1239# CONFIG_STACK_TRACER is not set
1240# CONFIG_KMEMTRACE is not set
1241# CONFIG_WORKQUEUE_TRACER is not set
1242# CONFIG_BLK_DEV_IO_TRACE is not set
1243# CONFIG_SAMPLES is not set 1258# CONFIG_SAMPLES is not set
1244CONFIG_HAVE_ARCH_KGDB=y 1259CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set
1261CONFIG_PPC_WERROR=y
1245CONFIG_PRINT_STACK_DEPTH=64 1262CONFIG_PRINT_STACK_DEPTH=64
1246# CONFIG_IRQSTACKS is not set 1263# CONFIG_IRQSTACKS is not set
1247# CONFIG_PPC_EARLY_DEBUG is not set 1264# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
index 2552cbefba6b..1025da2bf069 100644
--- a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
+++ b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc6 3# Linux kernel version: 2.6.31-rc4
4# Thu Jun 11 11:25:17 2009 4# Wed Jul 29 23:32:25 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -35,15 +35,16 @@ CONFIG_GENERIC_TIME=y
35CONFIG_GENERIC_TIME_VSYSCALL=y 35CONFIG_GENERIC_TIME_VSYSCALL=y
36CONFIG_GENERIC_CLOCKEVENTS=y 36CONFIG_GENERIC_CLOCKEVENTS=y
37CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
38CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 39# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39CONFIG_IRQ_PER_CPU=y 40CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 41CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 42CONFIG_HAVE_LATENCYTOP_SUPPORT=y
43CONFIG_TRACE_IRQFLAGS_SUPPORT=y
42CONFIG_LOCKDEP_SUPPORT=y 44CONFIG_LOCKDEP_SUPPORT=y
43CONFIG_RWSEM_XCHGADD_ALGORITHM=y 45CONFIG_RWSEM_XCHGADD_ALGORITHM=y
44CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
45CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
46CONFIG_GENERIC_CALIBRATE_DELAY=y
47CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
48CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -64,6 +65,7 @@ CONFIG_DEFAULT_UIMAGE=y
64# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
67 69
68# 70#
69# General setup 71# General setup
@@ -114,7 +116,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 116CONFIG_KALLSYMS=y
115CONFIG_KALLSYMS_ALL=y 117CONFIG_KALLSYMS_ALL=y
116CONFIG_KALLSYMS_EXTRA_PASS=y 118CONFIG_KALLSYMS_EXTRA_PASS=y
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 119CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 120CONFIG_PRINTK=y
120CONFIG_BUG=y 121CONFIG_BUG=y
@@ -127,9 +128,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 129CONFIG_SHMEM=y
129CONFIG_AIO=y 130CONFIG_AIO=y
131CONFIG_HAVE_PERF_COUNTERS=y
132
133#
134# Performance Counters
135#
136# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 139CONFIG_SLUB_DEBUG=y
140# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
135CONFIG_SLUB=y 143CONFIG_SLUB=y
@@ -144,6 +152,10 @@ CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 152CONFIG_HAVE_KRETPROBES=y
145CONFIG_HAVE_ARCH_TRACEHOOK=y 153CONFIG_HAVE_ARCH_TRACEHOOK=y
146CONFIG_USE_GENERIC_SMP_HELPERS=y 154CONFIG_USE_GENERIC_SMP_HELPERS=y
155
156#
157# GCOV-based kernel profiling
158#
147# CONFIG_SLOW_WORK is not set 159# CONFIG_SLOW_WORK is not set
148# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 160# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
149CONFIG_SLABINFO=y 161CONFIG_SLABINFO=y
@@ -157,7 +169,7 @@ CONFIG_MODVERSIONS=y
157# CONFIG_MODULE_SRCVERSION_ALL is not set 169# CONFIG_MODULE_SRCVERSION_ALL is not set
158CONFIG_STOP_MACHINE=y 170CONFIG_STOP_MACHINE=y
159CONFIG_BLOCK=y 171CONFIG_BLOCK=y
160CONFIG_LBD=y 172CONFIG_LBDAF=y
161# CONFIG_BLK_DEV_BSG is not set 173# CONFIG_BLK_DEV_BSG is not set
162# CONFIG_BLK_DEV_INTEGRITY is not set 174# CONFIG_BLK_DEV_INTEGRITY is not set
163 175
@@ -239,6 +251,7 @@ CONFIG_BINFMT_ELF=y
239# CONFIG_BINFMT_MISC is not set 251# CONFIG_BINFMT_MISC is not set
240CONFIG_MATH_EMULATION=y 252CONFIG_MATH_EMULATION=y
241# CONFIG_IOMMU_HELPER is not set 253# CONFIG_IOMMU_HELPER is not set
254# CONFIG_SWIOTLB is not set
242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
243CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -258,9 +271,9 @@ CONFIG_MIGRATION=y
258CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
259CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
266# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -287,6 +300,8 @@ CONFIG_PCI_DOMAINS=y
287CONFIG_PCI_SYSCALL=y 300CONFIG_PCI_SYSCALL=y
288CONFIG_PCIEPORTBUS=y 301CONFIG_PCIEPORTBUS=y
289CONFIG_PCIEAER=y 302CONFIG_PCIEAER=y
303# CONFIG_PCIE_ECRC is not set
304# CONFIG_PCIEAER_INJECT is not set
290# CONFIG_PCIEASPM is not set 305# CONFIG_PCIEASPM is not set
291CONFIG_ARCH_SUPPORTS_MSI=y 306CONFIG_ARCH_SUPPORTS_MSI=y
292CONFIG_PCI_MSI=y 307CONFIG_PCI_MSI=y
@@ -404,6 +419,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
404# CONFIG_ECONET is not set 419# CONFIG_ECONET is not set
405# CONFIG_WAN_ROUTER is not set 420# CONFIG_WAN_ROUTER is not set
406# CONFIG_PHONET is not set 421# CONFIG_PHONET is not set
422# CONFIG_IEEE802154 is not set
407# CONFIG_NET_SCHED is not set 423# CONFIG_NET_SCHED is not set
408# CONFIG_DCB is not set 424# CONFIG_DCB is not set
409 425
@@ -540,6 +556,7 @@ CONFIG_MTD_NAND_FSL_UPM=y
540CONFIG_OF_DEVICE=y 556CONFIG_OF_DEVICE=y
541CONFIG_OF_GPIO=y 557CONFIG_OF_GPIO=y
542CONFIG_OF_I2C=y 558CONFIG_OF_I2C=y
559CONFIG_OF_MDIO=y
543# CONFIG_PARPORT is not set 560# CONFIG_PARPORT is not set
544CONFIG_BLK_DEV=y 561CONFIG_BLK_DEV=y
545# CONFIG_BLK_DEV_FD is not set 562# CONFIG_BLK_DEV_FD is not set
@@ -575,7 +592,9 @@ CONFIG_MISC_DEVICES=y
575# 592#
576# CONFIG_EEPROM_AT24 is not set 593# CONFIG_EEPROM_AT24 is not set
577# CONFIG_EEPROM_LEGACY is not set 594# CONFIG_EEPROM_LEGACY is not set
595# CONFIG_EEPROM_MAX6875 is not set
578# CONFIG_EEPROM_93CX6 is not set 596# CONFIG_EEPROM_93CX6 is not set
597# CONFIG_CB710_CORE is not set
579CONFIG_HAVE_IDE=y 598CONFIG_HAVE_IDE=y
580# CONFIG_IDE is not set 599# CONFIG_IDE is not set
581 600
@@ -599,10 +618,6 @@ CONFIG_BLK_DEV_SR=y
599# CONFIG_BLK_DEV_SR_VENDOR is not set 618# CONFIG_BLK_DEV_SR_VENDOR is not set
600CONFIG_CHR_DEV_SG=y 619CONFIG_CHR_DEV_SG=y
601# CONFIG_CHR_DEV_SCH is not set 620# CONFIG_CHR_DEV_SCH is not set
602
603#
604# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
605#
606CONFIG_SCSI_MULTI_LUN=y 621CONFIG_SCSI_MULTI_LUN=y
607# CONFIG_SCSI_CONSTANTS is not set 622# CONFIG_SCSI_CONSTANTS is not set
608CONFIG_SCSI_LOGGING=y 623CONFIG_SCSI_LOGGING=y
@@ -619,6 +634,7 @@ CONFIG_SCSI_WAIT_SCAN=m
619# CONFIG_SCSI_SRP_ATTRS is not set 634# CONFIG_SCSI_SRP_ATTRS is not set
620CONFIG_SCSI_LOWLEVEL=y 635CONFIG_SCSI_LOWLEVEL=y
621# CONFIG_ISCSI_TCP is not set 636# CONFIG_ISCSI_TCP is not set
637# CONFIG_SCSI_BNX2_ISCSI is not set
622# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 638# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
623# CONFIG_SCSI_3W_9XXX is not set 639# CONFIG_SCSI_3W_9XXX is not set
624# CONFIG_SCSI_ACARD is not set 640# CONFIG_SCSI_ACARD is not set
@@ -627,6 +643,7 @@ CONFIG_SCSI_LOWLEVEL=y
627# CONFIG_SCSI_AIC7XXX_OLD is not set 643# CONFIG_SCSI_AIC7XXX_OLD is not set
628# CONFIG_SCSI_AIC79XX is not set 644# CONFIG_SCSI_AIC79XX is not set
629# CONFIG_SCSI_AIC94XX is not set 645# CONFIG_SCSI_AIC94XX is not set
646# CONFIG_SCSI_MVSAS is not set
630# CONFIG_SCSI_DPT_I2O is not set 647# CONFIG_SCSI_DPT_I2O is not set
631# CONFIG_SCSI_ADVANSYS is not set 648# CONFIG_SCSI_ADVANSYS is not set
632# CONFIG_SCSI_ARCMSR is not set 649# CONFIG_SCSI_ARCMSR is not set
@@ -646,7 +663,6 @@ CONFIG_SCSI_LOWLEVEL=y
646# CONFIG_SCSI_IPS is not set 663# CONFIG_SCSI_IPS is not set
647# CONFIG_SCSI_INITIO is not set 664# CONFIG_SCSI_INITIO is not set
648# CONFIG_SCSI_INIA100 is not set 665# CONFIG_SCSI_INIA100 is not set
649# CONFIG_SCSI_MVSAS is not set
650# CONFIG_SCSI_STEX is not set 666# CONFIG_SCSI_STEX is not set
651# CONFIG_SCSI_SYM53C8XX_2 is not set 667# CONFIG_SCSI_SYM53C8XX_2 is not set
652# CONFIG_SCSI_IPR is not set 668# CONFIG_SCSI_IPR is not set
@@ -730,14 +746,17 @@ CONFIG_PATA_ALI=y
730# 746#
731 747
732# 748#
733# Enable only one of the two stacks, unless you know what you are doing 749# You can enable one or both FireWire driver stacks.
750#
751
752#
753# See the help texts for more information.
734# 754#
735# CONFIG_FIREWIRE is not set 755# CONFIG_FIREWIRE is not set
736# CONFIG_IEEE1394 is not set 756# CONFIG_IEEE1394 is not set
737# CONFIG_I2O is not set 757# CONFIG_I2O is not set
738# CONFIG_MACINTOSH_DRIVERS is not set 758# CONFIG_MACINTOSH_DRIVERS is not set
739CONFIG_NETDEVICES=y 759CONFIG_NETDEVICES=y
740CONFIG_COMPAT_NET_DEV_OPS=y
741CONFIG_DUMMY=y 760CONFIG_DUMMY=y
742# CONFIG_BONDING is not set 761# CONFIG_BONDING is not set
743# CONFIG_MACVLAN is not set 762# CONFIG_MACVLAN is not set
@@ -784,6 +803,7 @@ CONFIG_MII=y
784# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 803# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
785# CONFIG_NET_PCI is not set 804# CONFIG_NET_PCI is not set
786# CONFIG_B44 is not set 805# CONFIG_B44 is not set
806# CONFIG_KS8842 is not set
787# CONFIG_ATL2 is not set 807# CONFIG_ATL2 is not set
788CONFIG_NETDEV_1000=y 808CONFIG_NETDEV_1000=y
789# CONFIG_ACENIC is not set 809# CONFIG_ACENIC is not set
@@ -803,8 +823,10 @@ CONFIG_E1000=y
803# CONFIG_VIA_VELOCITY is not set 823# CONFIG_VIA_VELOCITY is not set
804# CONFIG_TIGON3 is not set 824# CONFIG_TIGON3 is not set
805# CONFIG_BNX2 is not set 825# CONFIG_BNX2 is not set
826# CONFIG_CNIC is not set
806CONFIG_FSL_PQ_MDIO=y 827CONFIG_FSL_PQ_MDIO=y
807CONFIG_GIANFAR=y 828CONFIG_GIANFAR=y
829# CONFIG_MV643XX_ETH is not set
808# CONFIG_QLA3XXX is not set 830# CONFIG_QLA3XXX is not set
809# CONFIG_ATL1 is not set 831# CONFIG_ATL1 is not set
810# CONFIG_ATL1E is not set 832# CONFIG_ATL1E is not set
@@ -986,13 +1008,17 @@ CONFIG_I2C_MPC=y
986# CONFIG_DS1682 is not set 1008# CONFIG_DS1682 is not set
987# CONFIG_SENSORS_PCF8574 is not set 1009# CONFIG_SENSORS_PCF8574 is not set
988# CONFIG_PCF8575 is not set 1010# CONFIG_PCF8575 is not set
989# CONFIG_SENSORS_MAX6875 is not set
990# CONFIG_SENSORS_TSL2550 is not set 1011# CONFIG_SENSORS_TSL2550 is not set
991# CONFIG_I2C_DEBUG_CORE is not set 1012# CONFIG_I2C_DEBUG_CORE is not set
992# CONFIG_I2C_DEBUG_ALGO is not set 1013# CONFIG_I2C_DEBUG_ALGO is not set
993# CONFIG_I2C_DEBUG_BUS is not set 1014# CONFIG_I2C_DEBUG_BUS is not set
994# CONFIG_I2C_DEBUG_CHIP is not set 1015# CONFIG_I2C_DEBUG_CHIP is not set
995# CONFIG_SPI is not set 1016# CONFIG_SPI is not set
1017
1018#
1019# PPS support
1020#
1021# CONFIG_PPS is not set
996CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1022CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
997CONFIG_ARCH_REQUIRE_GPIOLIB=y 1023CONFIG_ARCH_REQUIRE_GPIOLIB=y
998CONFIG_GPIOLIB=y 1024CONFIG_GPIOLIB=y
@@ -1072,6 +1098,7 @@ CONFIG_SENSORS_LM90=y
1072# CONFIG_SENSORS_SMSC47B397 is not set 1098# CONFIG_SENSORS_SMSC47B397 is not set
1073# CONFIG_SENSORS_ADS7828 is not set 1099# CONFIG_SENSORS_ADS7828 is not set
1074# CONFIG_SENSORS_THMC50 is not set 1100# CONFIG_SENSORS_THMC50 is not set
1101# CONFIG_SENSORS_TMP401 is not set
1075# CONFIG_SENSORS_VIA686A is not set 1102# CONFIG_SENSORS_VIA686A is not set
1076# CONFIG_SENSORS_VT1211 is not set 1103# CONFIG_SENSORS_VT1211 is not set
1077# CONFIG_SENSORS_VT8231 is not set 1104# CONFIG_SENSORS_VT8231 is not set
@@ -1126,23 +1153,9 @@ CONFIG_SSB_POSSIBLE=y
1126# CONFIG_MFD_WM8400 is not set 1153# CONFIG_MFD_WM8400 is not set
1127# CONFIG_MFD_WM8350_I2C is not set 1154# CONFIG_MFD_WM8350_I2C is not set
1128# CONFIG_MFD_PCF50633 is not set 1155# CONFIG_MFD_PCF50633 is not set
1156# CONFIG_AB3100_CORE is not set
1129# CONFIG_REGULATOR is not set 1157# CONFIG_REGULATOR is not set
1130 1158# CONFIG_MEDIA_SUPPORT is not set
1131#
1132# Multimedia devices
1133#
1134
1135#
1136# Multimedia core support
1137#
1138# CONFIG_VIDEO_DEV is not set
1139# CONFIG_DVB_CORE is not set
1140# CONFIG_VIDEO_MEDIA is not set
1141
1142#
1143# Multimedia drivers
1144#
1145# CONFIG_DAB is not set
1146 1159
1147# 1160#
1148# Graphics support 1161# Graphics support
@@ -1187,7 +1200,7 @@ CONFIG_USB_HID=y
1187# CONFIG_HID_CHERRY is not set 1200# CONFIG_HID_CHERRY is not set
1188# CONFIG_HID_CHICONY is not set 1201# CONFIG_HID_CHICONY is not set
1189# CONFIG_HID_CYPRESS is not set 1202# CONFIG_HID_CYPRESS is not set
1190# CONFIG_DRAGONRISE_FF is not set 1203# CONFIG_HID_DRAGONRISE is not set
1191# CONFIG_HID_EZKEY is not set 1204# CONFIG_HID_EZKEY is not set
1192# CONFIG_HID_KYE is not set 1205# CONFIG_HID_KYE is not set
1193# CONFIG_HID_GYRATION is not set 1206# CONFIG_HID_GYRATION is not set
@@ -1201,10 +1214,11 @@ CONFIG_USB_HID=y
1201# CONFIG_HID_SAMSUNG is not set 1214# CONFIG_HID_SAMSUNG is not set
1202# CONFIG_HID_SONY is not set 1215# CONFIG_HID_SONY is not set
1203# CONFIG_HID_SUNPLUS is not set 1216# CONFIG_HID_SUNPLUS is not set
1204# CONFIG_GREENASIA_FF is not set 1217# CONFIG_HID_GREENASIA is not set
1218# CONFIG_HID_SMARTJOYPLUS is not set
1205# CONFIG_HID_TOPSEED is not set 1219# CONFIG_HID_TOPSEED is not set
1206# CONFIG_THRUSTMASTER_FF is not set 1220# CONFIG_HID_THRUSTMASTER is not set
1207# CONFIG_ZEROPLUS_FF is not set 1221# CONFIG_HID_ZEROPLUS is not set
1208CONFIG_USB_SUPPORT=y 1222CONFIG_USB_SUPPORT=y
1209CONFIG_USB_ARCH_HAS_HCD=y 1223CONFIG_USB_ARCH_HAS_HCD=y
1210CONFIG_USB_ARCH_HAS_OHCI=y 1224CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1230,6 +1244,7 @@ CONFIG_USB_MON=y
1230# USB Host Controller Drivers 1244# USB Host Controller Drivers
1231# 1245#
1232# CONFIG_USB_C67X00_HCD is not set 1246# CONFIG_USB_C67X00_HCD is not set
1247# CONFIG_USB_XHCI_HCD is not set
1233# CONFIG_USB_EHCI_HCD is not set 1248# CONFIG_USB_EHCI_HCD is not set
1234# CONFIG_USB_OXU210HP_HCD is not set 1249# CONFIG_USB_OXU210HP_HCD is not set
1235# CONFIG_USB_ISP116X_HCD is not set 1250# CONFIG_USB_ISP116X_HCD is not set
@@ -1325,7 +1340,7 @@ CONFIG_LEDS_CLASS=y
1325CONFIG_LEDS_GPIO=y 1340CONFIG_LEDS_GPIO=y
1326CONFIG_LEDS_GPIO_PLATFORM=y 1341CONFIG_LEDS_GPIO_PLATFORM=y
1327CONFIG_LEDS_GPIO_OF=y 1342CONFIG_LEDS_GPIO_OF=y
1328# CONFIG_LEDS_LP5521 is not set 1343# CONFIG_LEDS_LP3944 is not set
1329CONFIG_LEDS_PCA955X=y 1344CONFIG_LEDS_PCA955X=y
1330# CONFIG_LEDS_BD2802 is not set 1345# CONFIG_LEDS_BD2802 is not set
1331 1346
@@ -1352,8 +1367,6 @@ CONFIG_EDAC=y
1352# CONFIG_EDAC_DEBUG is not set 1367# CONFIG_EDAC_DEBUG is not set
1353CONFIG_EDAC_MM_EDAC=y 1368CONFIG_EDAC_MM_EDAC=y
1354CONFIG_EDAC_MPC85XX=y 1369CONFIG_EDAC_MPC85XX=y
1355# CONFIG_EDAC_AMD8131 is not set
1356# CONFIG_EDAC_AMD8111 is not set
1357CONFIG_RTC_LIB=y 1370CONFIG_RTC_LIB=y
1358CONFIG_RTC_CLASS=y 1371CONFIG_RTC_CLASS=y
1359CONFIG_RTC_HCTOSYS=y 1372CONFIG_RTC_HCTOSYS=y
@@ -1385,6 +1398,7 @@ CONFIG_RTC_DRV_DS1307=y
1385# CONFIG_RTC_DRV_S35390A is not set 1398# CONFIG_RTC_DRV_S35390A is not set
1386# CONFIG_RTC_DRV_FM3130 is not set 1399# CONFIG_RTC_DRV_FM3130 is not set
1387# CONFIG_RTC_DRV_RX8581 is not set 1400# CONFIG_RTC_DRV_RX8581 is not set
1401# CONFIG_RTC_DRV_RX8025 is not set
1388 1402
1389# 1403#
1390# SPI RTC drivers 1404# SPI RTC drivers
@@ -1425,6 +1439,10 @@ CONFIG_NET_DMA=y
1425# CONFIG_DMATEST is not set 1439# CONFIG_DMATEST is not set
1426# CONFIG_AUXDISPLAY is not set 1440# CONFIG_AUXDISPLAY is not set
1427# CONFIG_UIO is not set 1441# CONFIG_UIO is not set
1442
1443#
1444# TI VLYNQ
1445#
1428# CONFIG_STAGING is not set 1446# CONFIG_STAGING is not set
1429 1447
1430# 1448#
@@ -1444,11 +1462,12 @@ CONFIG_FS_MBCACHE=y
1444# CONFIG_REISERFS_FS is not set 1462# CONFIG_REISERFS_FS is not set
1445# CONFIG_JFS_FS is not set 1463# CONFIG_JFS_FS is not set
1446# CONFIG_FS_POSIX_ACL is not set 1464# CONFIG_FS_POSIX_ACL is not set
1447CONFIG_FILE_LOCKING=y
1448# CONFIG_XFS_FS is not set 1465# CONFIG_XFS_FS is not set
1449# CONFIG_GFS2_FS is not set 1466# CONFIG_GFS2_FS is not set
1450# CONFIG_OCFS2_FS is not set 1467# CONFIG_OCFS2_FS is not set
1451# CONFIG_BTRFS_FS is not set 1468# CONFIG_BTRFS_FS is not set
1469CONFIG_FILE_LOCKING=y
1470CONFIG_FSNOTIFY=y
1452CONFIG_DNOTIFY=y 1471CONFIG_DNOTIFY=y
1453CONFIG_INOTIFY=y 1472CONFIG_INOTIFY=y
1454CONFIG_INOTIFY_USER=y 1473CONFIG_INOTIFY_USER=y
@@ -1629,6 +1648,7 @@ CONFIG_HAS_IOPORT=y
1629CONFIG_HAS_DMA=y 1648CONFIG_HAS_DMA=y
1630CONFIG_HAVE_LMB=y 1649CONFIG_HAVE_LMB=y
1631CONFIG_NLATTR=y 1650CONFIG_NLATTR=y
1651CONFIG_GENERIC_ATOMIC64=y
1632 1652
1633# 1653#
1634# Kernel hacking 1654# Kernel hacking
@@ -1659,6 +1679,9 @@ CONFIG_SCHED_DEBUG=y
1659# CONFIG_RT_MUTEX_TESTER is not set 1679# CONFIG_RT_MUTEX_TESTER is not set
1660# CONFIG_DEBUG_SPINLOCK is not set 1680# CONFIG_DEBUG_SPINLOCK is not set
1661# CONFIG_DEBUG_MUTEXES is not set 1681# CONFIG_DEBUG_MUTEXES is not set
1682# CONFIG_DEBUG_LOCK_ALLOC is not set
1683# CONFIG_PROVE_LOCKING is not set
1684# CONFIG_LOCK_STAT is not set
1662# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1685# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1663# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1686# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1664# CONFIG_DEBUG_KOBJECT is not set 1687# CONFIG_DEBUG_KOBJECT is not set
@@ -1671,7 +1694,6 @@ CONFIG_SCHED_DEBUG=y
1671# CONFIG_DEBUG_LIST is not set 1694# CONFIG_DEBUG_LIST is not set
1672# CONFIG_DEBUG_SG is not set 1695# CONFIG_DEBUG_SG is not set
1673# CONFIG_DEBUG_NOTIFIERS is not set 1696# CONFIG_DEBUG_NOTIFIERS is not set
1674# CONFIG_BOOT_PRINTK_DELAY is not set
1675# CONFIG_RCU_TORTURE_TEST is not set 1697# CONFIG_RCU_TORTURE_TEST is not set
1676# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1698# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1677# CONFIG_BACKTRACE_SELF_TEST is not set 1699# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1685,16 +1707,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1685CONFIG_HAVE_DYNAMIC_FTRACE=y 1707CONFIG_HAVE_DYNAMIC_FTRACE=y
1686CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1708CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1687CONFIG_TRACING_SUPPORT=y 1709CONFIG_TRACING_SUPPORT=y
1688 1710CONFIG_FTRACE=y
1689#
1690# Tracers
1691#
1692# CONFIG_FUNCTION_TRACER is not set 1711# CONFIG_FUNCTION_TRACER is not set
1712# CONFIG_IRQSOFF_TRACER is not set
1693# CONFIG_SCHED_TRACER is not set 1713# CONFIG_SCHED_TRACER is not set
1694# CONFIG_CONTEXT_SWITCH_TRACER is not set 1714# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1695# CONFIG_EVENT_TRACER is not set
1696# CONFIG_BOOT_TRACER is not set 1715# CONFIG_BOOT_TRACER is not set
1697# CONFIG_TRACE_BRANCH_PROFILING is not set 1716CONFIG_BRANCH_PROFILE_NONE=y
1717# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1718# CONFIG_PROFILE_ALL_BRANCHES is not set
1698# CONFIG_STACK_TRACER is not set 1719# CONFIG_STACK_TRACER is not set
1699# CONFIG_KMEMTRACE is not set 1720# CONFIG_KMEMTRACE is not set
1700# CONFIG_WORKQUEUE_TRACER is not set 1721# CONFIG_WORKQUEUE_TRACER is not set
@@ -1702,6 +1723,9 @@ CONFIG_TRACING_SUPPORT=y
1702# CONFIG_SAMPLES is not set 1723# CONFIG_SAMPLES is not set
1703CONFIG_HAVE_ARCH_KGDB=y 1724CONFIG_HAVE_ARCH_KGDB=y
1704# CONFIG_KGDB is not set 1725# CONFIG_KGDB is not set
1726# CONFIG_KMEMCHECK is not set
1727# CONFIG_PPC_DISABLE_WERROR is not set
1728CONFIG_PPC_WERROR=y
1705CONFIG_PRINT_STACK_DEPTH=64 1729CONFIG_PRINT_STACK_DEPTH=64
1706# CONFIG_DEBUG_STACKOVERFLOW is not set 1730# CONFIG_DEBUG_STACKOVERFLOW is not set
1707# CONFIG_DEBUG_STACK_USAGE is not set 1731# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
index b6a23af57f46..527ad1a5e802 100644
--- a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:31 2009 4# Wed Jul 29 23:32:31 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -56,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
56CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
57CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -112,9 +117,7 @@ CONFIG_ANON_INODES=y
112CONFIG_EMBEDDED=y 117CONFIG_EMBEDDED=y
113CONFIG_SYSCTL_SYSCALL=y 118CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115# CONFIG_KALLSYMS_ALL is not set
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 120# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 122CONFIG_PRINTK=y
120CONFIG_BUG=y 123CONFIG_BUG=y
@@ -127,8 +130,15 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 131CONFIG_SHMEM=y
129CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
132CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
133CONFIG_SLAB=y 143CONFIG_SLAB=y
134# CONFIG_SLUB is not set 144# CONFIG_SLUB is not set
@@ -143,6 +153,10 @@ CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
145CONFIG_USE_GENERIC_SMP_HELPERS=y 155CONFIG_USE_GENERIC_SMP_HELPERS=y
156
157#
158# GCOV-based kernel profiling
159#
146# CONFIG_SLOW_WORK is not set 160# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 162CONFIG_SLABINFO=y
@@ -156,7 +170,7 @@ CONFIG_MODULE_UNLOAD=y
156# CONFIG_MODULE_SRCVERSION_ALL is not set 170# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_STOP_MACHINE=y 171CONFIG_STOP_MACHINE=y
158CONFIG_BLOCK=y 172CONFIG_BLOCK=y
159# CONFIG_LBD is not set 173CONFIG_LBDAF=y
160# CONFIG_BLK_DEV_BSG is not set 174# CONFIG_BLK_DEV_BSG is not set
161# CONFIG_BLK_DEV_INTEGRITY is not set 175# CONFIG_BLK_DEV_INTEGRITY is not set
162 176
@@ -216,7 +230,7 @@ CONFIG_MPIC=y
216# 230#
217# Kernel options 231# Kernel options
218# 232#
219# CONFIG_HIGHMEM is not set 233CONFIG_HIGHMEM=y
220CONFIG_TICK_ONESHOT=y 234CONFIG_TICK_ONESHOT=y
221# CONFIG_NO_HZ is not set 235# CONFIG_NO_HZ is not set
222CONFIG_HIGH_RES_TIMERS=y 236CONFIG_HIGH_RES_TIMERS=y
@@ -235,6 +249,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
236CONFIG_BINFMT_MISC=m 250CONFIG_BINFMT_MISC=m
237# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -256,9 +271,9 @@ CONFIG_MIGRATION=y
256CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
257CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
259CONFIG_UNEVICTABLE_LRU=y
260CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
264# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -285,14 +300,32 @@ CONFIG_PCI_DOMAINS=y
285CONFIG_PCI_SYSCALL=y 300CONFIG_PCI_SYSCALL=y
286CONFIG_PCIEPORTBUS=y 301CONFIG_PCIEPORTBUS=y
287CONFIG_PCIEAER=y 302CONFIG_PCIEAER=y
303# CONFIG_PCIE_ECRC is not set
304# CONFIG_PCIEAER_INJECT is not set
288# CONFIG_PCIEASPM is not set 305# CONFIG_PCIEASPM is not set
289CONFIG_ARCH_SUPPORTS_MSI=y 306CONFIG_ARCH_SUPPORTS_MSI=y
290# CONFIG_PCI_MSI is not set 307# CONFIG_PCI_MSI is not set
291# CONFIG_PCI_LEGACY is not set 308# CONFIG_PCI_LEGACY is not set
292CONFIG_PCI_DEBUG=y
293# CONFIG_PCI_STUB is not set 309# CONFIG_PCI_STUB is not set
294# CONFIG_PCI_IOV is not set 310# CONFIG_PCI_IOV is not set
295# CONFIG_PCCARD is not set 311CONFIG_PCCARD=y
312# CONFIG_PCMCIA_DEBUG is not set
313CONFIG_PCMCIA=y
314# CONFIG_PCMCIA_LOAD_CIS is not set
315# CONFIG_PCMCIA_IOCTL is not set
316# CONFIG_CARDBUS is not set
317
318#
319# PC-card bridges
320#
321CONFIG_YENTA=y
322# CONFIG_YENTA_O2 is not set
323# CONFIG_YENTA_RICOH is not set
324CONFIG_YENTA_TI=y
325# CONFIG_YENTA_TOSHIBA is not set
326# CONFIG_PD6729 is not set
327# CONFIG_I82092 is not set
328CONFIG_PCCARD_NONSTATIC=y
296# CONFIG_HOTPLUG_PCI is not set 329# CONFIG_HOTPLUG_PCI is not set
297# CONFIG_HAS_RAPIDIO is not set 330# CONFIG_HAS_RAPIDIO is not set
298 331
@@ -353,8 +386,8 @@ CONFIG_INET_XFRM_TUNNEL=m
353CONFIG_INET_TUNNEL=m 386CONFIG_INET_TUNNEL=m
354CONFIG_INET_XFRM_MODE_TRANSPORT=y 387CONFIG_INET_XFRM_MODE_TRANSPORT=y
355CONFIG_INET_XFRM_MODE_TUNNEL=y 388CONFIG_INET_XFRM_MODE_TUNNEL=y
356CONFIG_INET_XFRM_MODE_BEET=y 389# CONFIG_INET_XFRM_MODE_BEET is not set
357# CONFIG_INET_LRO is not set 390CONFIG_INET_LRO=y
358CONFIG_INET_DIAG=y 391CONFIG_INET_DIAG=y
359CONFIG_INET_TCP_DIAG=y 392CONFIG_INET_TCP_DIAG=y
360# CONFIG_TCP_CONG_ADVANCED is not set 393# CONFIG_TCP_CONG_ADVANCED is not set
@@ -380,174 +413,26 @@ CONFIG_IPV6_NDISC_NODETYPE=y
380CONFIG_IPV6_TUNNEL=m 413CONFIG_IPV6_TUNNEL=m
381# CONFIG_IPV6_MULTIPLE_TABLES is not set 414# CONFIG_IPV6_MULTIPLE_TABLES is not set
382# CONFIG_IPV6_MROUTE is not set 415# CONFIG_IPV6_MROUTE is not set
383# CONFIG_NETLABEL is not set
384# CONFIG_NETWORK_SECMARK is not set 416# CONFIG_NETWORK_SECMARK is not set
385CONFIG_NETFILTER=y 417# CONFIG_NETFILTER is not set
386# CONFIG_NETFILTER_DEBUG is not set
387CONFIG_NETFILTER_ADVANCED=y
388CONFIG_BRIDGE_NETFILTER=y
389
390#
391# Core Netfilter Configuration
392#
393# CONFIG_NETFILTER_NETLINK_QUEUE is not set
394# CONFIG_NETFILTER_NETLINK_LOG is not set
395# CONFIG_NF_CONNTRACK is not set
396# CONFIG_NETFILTER_TPROXY is not set
397CONFIG_NETFILTER_XTABLES=m
398# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
399# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
400# CONFIG_NETFILTER_XT_TARGET_HL is not set
401# CONFIG_NETFILTER_XT_TARGET_MARK is not set
402# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
403# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
404# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
405# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
406# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
407# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
408# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
409# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
410# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
411# CONFIG_NETFILTER_XT_MATCH_ESP is not set
412# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
413CONFIG_NETFILTER_XT_MATCH_HL=m
414# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
415# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
416# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
417# CONFIG_NETFILTER_XT_MATCH_MAC is not set
418# CONFIG_NETFILTER_XT_MATCH_MARK is not set
419# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
420# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
421# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
422# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
423# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
424# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
425# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
426# CONFIG_NETFILTER_XT_MATCH_REALM is not set
427# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
428# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
429# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
430# CONFIG_NETFILTER_XT_MATCH_STRING is not set
431# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
432# CONFIG_NETFILTER_XT_MATCH_TIME is not set
433# CONFIG_NETFILTER_XT_MATCH_U32 is not set
434# CONFIG_IP_VS is not set
435
436#
437# IP: Netfilter Configuration
438#
439# CONFIG_NF_DEFRAG_IPV4 is not set
440CONFIG_IP_NF_QUEUE=m
441CONFIG_IP_NF_IPTABLES=m
442CONFIG_IP_NF_MATCH_ADDRTYPE=m
443# CONFIG_IP_NF_MATCH_AH is not set
444CONFIG_IP_NF_MATCH_ECN=m
445CONFIG_IP_NF_MATCH_TTL=m
446CONFIG_IP_NF_FILTER=m
447CONFIG_IP_NF_TARGET_REJECT=m
448CONFIG_IP_NF_TARGET_LOG=m
449CONFIG_IP_NF_TARGET_ULOG=m
450CONFIG_IP_NF_MANGLE=m
451CONFIG_IP_NF_TARGET_ECN=m
452# CONFIG_IP_NF_TARGET_TTL is not set
453CONFIG_IP_NF_RAW=m
454# CONFIG_IP_NF_SECURITY is not set
455CONFIG_IP_NF_ARPTABLES=m
456CONFIG_IP_NF_ARPFILTER=m
457CONFIG_IP_NF_ARP_MANGLE=m
458
459#
460# IPv6: Netfilter Configuration
461#
462CONFIG_IP6_NF_QUEUE=m
463CONFIG_IP6_NF_IPTABLES=m
464# CONFIG_IP6_NF_MATCH_AH is not set
465CONFIG_IP6_NF_MATCH_EUI64=m
466CONFIG_IP6_NF_MATCH_FRAG=m
467CONFIG_IP6_NF_MATCH_OPTS=m
468CONFIG_IP6_NF_MATCH_HL=m
469CONFIG_IP6_NF_MATCH_IPV6HEADER=m
470# CONFIG_IP6_NF_MATCH_MH is not set
471CONFIG_IP6_NF_MATCH_RT=m
472# CONFIG_IP6_NF_TARGET_HL is not set
473CONFIG_IP6_NF_TARGET_LOG=m
474CONFIG_IP6_NF_FILTER=m
475# CONFIG_IP6_NF_TARGET_REJECT is not set
476CONFIG_IP6_NF_MANGLE=m
477CONFIG_IP6_NF_RAW=m
478# CONFIG_IP6_NF_SECURITY is not set
479# CONFIG_BRIDGE_NF_EBTABLES is not set
480# CONFIG_IP_DCCP is not set 418# CONFIG_IP_DCCP is not set
481CONFIG_IP_SCTP=m 419# CONFIG_IP_SCTP is not set
482# CONFIG_SCTP_DBG_MSG is not set 420# CONFIG_TIPC is not set
483# CONFIG_SCTP_DBG_OBJCNT is not set 421# CONFIG_ATM is not set
484# CONFIG_SCTP_HMAC_NONE is not set 422# CONFIG_BRIDGE is not set
485# CONFIG_SCTP_HMAC_SHA1 is not set
486CONFIG_SCTP_HMAC_MD5=y
487CONFIG_TIPC=m
488# CONFIG_TIPC_ADVANCED is not set
489# CONFIG_TIPC_DEBUG is not set
490CONFIG_ATM=m
491CONFIG_ATM_CLIP=m
492# CONFIG_ATM_CLIP_NO_ICMP is not set
493CONFIG_ATM_LANE=m
494CONFIG_ATM_MPOA=m
495CONFIG_ATM_BR2684=m
496# CONFIG_ATM_BR2684_IPFILTER is not set
497CONFIG_STP=m
498CONFIG_BRIDGE=m
499# CONFIG_NET_DSA is not set 423# CONFIG_NET_DSA is not set
500CONFIG_VLAN_8021Q=m 424# CONFIG_VLAN_8021Q is not set
501# CONFIG_VLAN_8021Q_GVRP is not set
502# CONFIG_DECNET is not set 425# CONFIG_DECNET is not set
503CONFIG_LLC=m
504# CONFIG_LLC2 is not set 426# CONFIG_LLC2 is not set
505# CONFIG_IPX is not set 427# CONFIG_IPX is not set
506# CONFIG_ATALK is not set 428# CONFIG_ATALK is not set
507# CONFIG_X25 is not set 429# CONFIG_X25 is not set
508# CONFIG_LAPB is not set 430# CONFIG_LAPB is not set
509# CONFIG_ECONET is not set 431# CONFIG_ECONET is not set
510CONFIG_WAN_ROUTER=m 432# CONFIG_WAN_ROUTER is not set
511# CONFIG_PHONET is not set 433# CONFIG_PHONET is not set
512CONFIG_NET_SCHED=y 434# CONFIG_IEEE802154 is not set
513 435# CONFIG_NET_SCHED is not set
514#
515# Queueing/Scheduling
516#
517CONFIG_NET_SCH_CBQ=m
518CONFIG_NET_SCH_HTB=m
519CONFIG_NET_SCH_HFSC=m
520CONFIG_NET_SCH_ATM=m
521CONFIG_NET_SCH_PRIO=m
522# CONFIG_NET_SCH_MULTIQ is not set
523CONFIG_NET_SCH_RED=m
524CONFIG_NET_SCH_SFQ=m
525CONFIG_NET_SCH_TEQL=m
526CONFIG_NET_SCH_TBF=m
527CONFIG_NET_SCH_GRED=m
528CONFIG_NET_SCH_DSMARK=m
529CONFIG_NET_SCH_NETEM=m
530# CONFIG_NET_SCH_DRR is not set
531
532#
533# Classification
534#
535CONFIG_NET_CLS=y
536# CONFIG_NET_CLS_BASIC is not set
537CONFIG_NET_CLS_TCINDEX=m
538CONFIG_NET_CLS_ROUTE4=m
539CONFIG_NET_CLS_ROUTE=y
540CONFIG_NET_CLS_FW=m
541CONFIG_NET_CLS_U32=m
542# CONFIG_CLS_U32_PERF is not set
543# CONFIG_CLS_U32_MARK is not set
544CONFIG_NET_CLS_RSVP=m
545CONFIG_NET_CLS_RSVP6=m
546# CONFIG_NET_CLS_FLOW is not set
547# CONFIG_NET_EMATCH is not set
548# CONFIG_NET_CLS_ACT is not set
549# CONFIG_NET_CLS_IND is not set
550CONFIG_NET_SCH_FIFO=y
551# CONFIG_DCB is not set 436# CONFIG_DCB is not set
552 437
553# 438#
@@ -560,12 +445,7 @@ CONFIG_NET_PKTGEN=m
560# CONFIG_BT is not set 445# CONFIG_BT is not set
561# CONFIG_AF_RXRPC is not set 446# CONFIG_AF_RXRPC is not set
562CONFIG_FIB_RULES=y 447CONFIG_FIB_RULES=y
563CONFIG_WIRELESS=y 448# CONFIG_WIRELESS is not set
564# CONFIG_CFG80211 is not set
565CONFIG_WIRELESS_OLD_REGULATORY=y
566# CONFIG_WIRELESS_EXT is not set
567# CONFIG_LIB80211 is not set
568# CONFIG_MAC80211 is not set
569# CONFIG_WIMAX is not set 449# CONFIG_WIMAX is not set
570# CONFIG_RFKILL is not set 450# CONFIG_RFKILL is not set
571# CONFIG_NET_9P is not set 451# CONFIG_NET_9P is not set
@@ -580,9 +460,9 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
580CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 460CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
581CONFIG_STANDALONE=y 461CONFIG_STANDALONE=y
582CONFIG_PREVENT_FIRMWARE_BUILD=y 462CONFIG_PREVENT_FIRMWARE_BUILD=y
583# CONFIG_FW_LOADER is not set 463CONFIG_FW_LOADER=y
584# CONFIG_DEBUG_DRIVER is not set 464CONFIG_FIRMWARE_IN_KERNEL=y
585# CONFIG_DEBUG_DEVRES is not set 465CONFIG_EXTRA_FIRMWARE=""
586# CONFIG_SYS_HYPERVISOR is not set 466# CONFIG_SYS_HYPERVISOR is not set
587# CONFIG_CONNECTOR is not set 467# CONFIG_CONNECTOR is not set
588CONFIG_MTD=y 468CONFIG_MTD=y
@@ -672,6 +552,7 @@ CONFIG_MTD_PHYSMAP_OF=y
672CONFIG_OF_DEVICE=y 552CONFIG_OF_DEVICE=y
673CONFIG_OF_GPIO=y 553CONFIG_OF_GPIO=y
674CONFIG_OF_I2C=y 554CONFIG_OF_I2C=y
555CONFIG_OF_MDIO=y
675# CONFIG_PARPORT is not set 556# CONFIG_PARPORT is not set
676CONFIG_BLK_DEV=y 557CONFIG_BLK_DEV=y
677# CONFIG_BLK_DEV_FD is not set 558# CONFIG_BLK_DEV_FD is not set
@@ -707,9 +588,60 @@ CONFIG_MISC_DEVICES=y
707# 588#
708# CONFIG_EEPROM_AT24 is not set 589# CONFIG_EEPROM_AT24 is not set
709# CONFIG_EEPROM_LEGACY is not set 590# CONFIG_EEPROM_LEGACY is not set
591# CONFIG_EEPROM_MAX6875 is not set
710# CONFIG_EEPROM_93CX6 is not set 592# CONFIG_EEPROM_93CX6 is not set
593# CONFIG_CB710_CORE is not set
711CONFIG_HAVE_IDE=y 594CONFIG_HAVE_IDE=y
712# CONFIG_IDE is not set 595CONFIG_IDE=y
596
597#
598# Please see Documentation/ide/ide.txt for help/info on IDE drives
599#
600# CONFIG_BLK_DEV_IDE_SATA is not set
601CONFIG_IDE_GD=y
602CONFIG_IDE_GD_ATA=y
603# CONFIG_IDE_GD_ATAPI is not set
604CONFIG_BLK_DEV_IDECS=y
605# CONFIG_BLK_DEV_IDECD is not set
606# CONFIG_BLK_DEV_IDETAPE is not set
607# CONFIG_IDE_TASK_IOCTL is not set
608CONFIG_IDE_PROC_FS=y
609
610#
611# IDE chipset support/bugfixes
612#
613# CONFIG_BLK_DEV_PLATFORM is not set
614
615#
616# PCI IDE chipsets support
617#
618# CONFIG_BLK_DEV_GENERIC is not set
619# CONFIG_BLK_DEV_OPTI621 is not set
620# CONFIG_BLK_DEV_AEC62XX is not set
621# CONFIG_BLK_DEV_ALI15X3 is not set
622# CONFIG_BLK_DEV_AMD74XX is not set
623# CONFIG_BLK_DEV_CMD64X is not set
624# CONFIG_BLK_DEV_TRIFLEX is not set
625# CONFIG_BLK_DEV_CS5520 is not set
626# CONFIG_BLK_DEV_CS5530 is not set
627# CONFIG_BLK_DEV_HPT366 is not set
628# CONFIG_BLK_DEV_JMICRON is not set
629# CONFIG_BLK_DEV_SC1200 is not set
630# CONFIG_BLK_DEV_PIIX is not set
631# CONFIG_BLK_DEV_IT8172 is not set
632# CONFIG_BLK_DEV_IT8213 is not set
633# CONFIG_BLK_DEV_IT821X is not set
634# CONFIG_BLK_DEV_NS87415 is not set
635# CONFIG_BLK_DEV_PDC202XX_OLD is not set
636# CONFIG_BLK_DEV_PDC202XX_NEW is not set
637# CONFIG_BLK_DEV_SVWKS is not set
638# CONFIG_BLK_DEV_SIIMAGE is not set
639# CONFIG_BLK_DEV_SL82C105 is not set
640# CONFIG_BLK_DEV_SLC90E66 is not set
641# CONFIG_BLK_DEV_TRM290 is not set
642# CONFIG_BLK_DEV_VIA82CXXX is not set
643# CONFIG_BLK_DEV_TC86C001 is not set
644# CONFIG_BLK_DEV_IDEDMA is not set
713 645
714# 646#
715# SCSI device support 647# SCSI device support
@@ -731,10 +663,6 @@ CONFIG_BLK_DEV_SR=y
731# CONFIG_BLK_DEV_SR_VENDOR is not set 663# CONFIG_BLK_DEV_SR_VENDOR is not set
732# CONFIG_CHR_DEV_SG is not set 664# CONFIG_CHR_DEV_SG is not set
733# CONFIG_CHR_DEV_SCH is not set 665# CONFIG_CHR_DEV_SCH is not set
734
735#
736# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
737#
738# CONFIG_SCSI_MULTI_LUN is not set 666# CONFIG_SCSI_MULTI_LUN is not set
739# CONFIG_SCSI_CONSTANTS is not set 667# CONFIG_SCSI_CONSTANTS is not set
740# CONFIG_SCSI_LOGGING is not set 668# CONFIG_SCSI_LOGGING is not set
@@ -751,6 +679,7 @@ CONFIG_SCSI_WAIT_SCAN=m
751# CONFIG_SCSI_SRP_ATTRS is not set 679# CONFIG_SCSI_SRP_ATTRS is not set
752CONFIG_SCSI_LOWLEVEL=y 680CONFIG_SCSI_LOWLEVEL=y
753# CONFIG_ISCSI_TCP is not set 681# CONFIG_ISCSI_TCP is not set
682# CONFIG_SCSI_BNX2_ISCSI is not set
754# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 683# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
755# CONFIG_SCSI_3W_9XXX is not set 684# CONFIG_SCSI_3W_9XXX is not set
756# CONFIG_SCSI_ACARD is not set 685# CONFIG_SCSI_ACARD is not set
@@ -759,6 +688,7 @@ CONFIG_SCSI_LOWLEVEL=y
759# CONFIG_SCSI_AIC7XXX_OLD is not set 688# CONFIG_SCSI_AIC7XXX_OLD is not set
760# CONFIG_SCSI_AIC79XX is not set 689# CONFIG_SCSI_AIC79XX is not set
761# CONFIG_SCSI_AIC94XX is not set 690# CONFIG_SCSI_AIC94XX is not set
691# CONFIG_SCSI_MVSAS is not set
762# CONFIG_SCSI_DPT_I2O is not set 692# CONFIG_SCSI_DPT_I2O is not set
763# CONFIG_SCSI_ADVANSYS is not set 693# CONFIG_SCSI_ADVANSYS is not set
764# CONFIG_SCSI_ARCMSR is not set 694# CONFIG_SCSI_ARCMSR is not set
@@ -778,7 +708,6 @@ CONFIG_SCSI_LOWLEVEL=y
778# CONFIG_SCSI_IPS is not set 708# CONFIG_SCSI_IPS is not set
779# CONFIG_SCSI_INITIO is not set 709# CONFIG_SCSI_INITIO is not set
780# CONFIG_SCSI_INIA100 is not set 710# CONFIG_SCSI_INIA100 is not set
781# CONFIG_SCSI_MVSAS is not set
782# CONFIG_SCSI_STEX is not set 711# CONFIG_SCSI_STEX is not set
783# CONFIG_SCSI_SYM53C8XX_2 is not set 712# CONFIG_SCSI_SYM53C8XX_2 is not set
784# CONFIG_SCSI_IPR is not set 713# CONFIG_SCSI_IPR is not set
@@ -791,6 +720,7 @@ CONFIG_SCSI_LOWLEVEL=y
791# CONFIG_SCSI_NSP32 is not set 720# CONFIG_SCSI_NSP32 is not set
792# CONFIG_SCSI_DEBUG is not set 721# CONFIG_SCSI_DEBUG is not set
793# CONFIG_SCSI_SRP is not set 722# CONFIG_SCSI_SRP is not set
723# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
794# CONFIG_SCSI_DH is not set 724# CONFIG_SCSI_DH is not set
795# CONFIG_SCSI_OSD_INITIATOR is not set 725# CONFIG_SCSI_OSD_INITIATOR is not set
796CONFIG_ATA=y 726CONFIG_ATA=y
@@ -842,6 +772,7 @@ CONFIG_SATA_SIL=y
842# CONFIG_PATA_NS87415 is not set 772# CONFIG_PATA_NS87415 is not set
843# CONFIG_PATA_OPTI is not set 773# CONFIG_PATA_OPTI is not set
844# CONFIG_PATA_OPTIDMA is not set 774# CONFIG_PATA_OPTIDMA is not set
775# CONFIG_PATA_PCMCIA is not set
845# CONFIG_PATA_PDC_OLD is not set 776# CONFIG_PATA_PDC_OLD is not set
846# CONFIG_PATA_RADISYS is not set 777# CONFIG_PATA_RADISYS is not set
847# CONFIG_PATA_RZ1000 is not set 778# CONFIG_PATA_RZ1000 is not set
@@ -862,14 +793,17 @@ CONFIG_SATA_SIL=y
862# 793#
863 794
864# 795#
865# Enable only one of the two stacks, unless you know what you are doing 796# You can enable one or both FireWire driver stacks.
797#
798
799#
800# See the help texts for more information.
866# 801#
867# CONFIG_FIREWIRE is not set 802# CONFIG_FIREWIRE is not set
868# CONFIG_IEEE1394 is not set 803# CONFIG_IEEE1394 is not set
869# CONFIG_I2O is not set 804# CONFIG_I2O is not set
870# CONFIG_MACINTOSH_DRIVERS is not set 805# CONFIG_MACINTOSH_DRIVERS is not set
871CONFIG_NETDEVICES=y 806CONFIG_NETDEVICES=y
872CONFIG_COMPAT_NET_DEV_OPS=y
873CONFIG_DUMMY=m 807CONFIG_DUMMY=m
874CONFIG_BONDING=m 808CONFIG_BONDING=m
875# CONFIG_MACVLAN is not set 809# CONFIG_MACVLAN is not set
@@ -916,6 +850,7 @@ CONFIG_MII=y
916# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 850# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
917# CONFIG_NET_PCI is not set 851# CONFIG_NET_PCI is not set
918# CONFIG_B44 is not set 852# CONFIG_B44 is not set
853# CONFIG_KS8842 is not set
919# CONFIG_ATL2 is not set 854# CONFIG_ATL2 is not set
920CONFIG_NETDEV_1000=y 855CONFIG_NETDEV_1000=y
921# CONFIG_ACENIC is not set 856# CONFIG_ACENIC is not set
@@ -935,8 +870,10 @@ CONFIG_NETDEV_1000=y
935# CONFIG_VIA_VELOCITY is not set 870# CONFIG_VIA_VELOCITY is not set
936# CONFIG_TIGON3 is not set 871# CONFIG_TIGON3 is not set
937# CONFIG_BNX2 is not set 872# CONFIG_BNX2 is not set
873# CONFIG_CNIC is not set
938CONFIG_FSL_PQ_MDIO=y 874CONFIG_FSL_PQ_MDIO=y
939CONFIG_GIANFAR=y 875CONFIG_GIANFAR=y
876# CONFIG_MV643XX_ETH is not set
940# CONFIG_QLA3XXX is not set 877# CONFIG_QLA3XXX is not set
941# CONFIG_ATL1 is not set 878# CONFIG_ATL1 is not set
942# CONFIG_ATL1E is not set 879# CONFIG_ATL1E is not set
@@ -963,22 +900,8 @@ CONFIG_GIANFAR=y
963# CONFIG_USB_PEGASUS is not set 900# CONFIG_USB_PEGASUS is not set
964# CONFIG_USB_RTL8150 is not set 901# CONFIG_USB_RTL8150 is not set
965# CONFIG_USB_USBNET is not set 902# CONFIG_USB_USBNET is not set
903# CONFIG_NET_PCMCIA is not set
966# CONFIG_WAN is not set 904# CONFIG_WAN is not set
967CONFIG_ATM_DRIVERS=y
968# CONFIG_ATM_DUMMY is not set
969# CONFIG_ATM_TCP is not set
970# CONFIG_ATM_LANAI is not set
971# CONFIG_ATM_ENI is not set
972# CONFIG_ATM_FIRESTREAM is not set
973# CONFIG_ATM_ZATM is not set
974# CONFIG_ATM_NICSTAR is not set
975# CONFIG_ATM_IDT77252 is not set
976# CONFIG_ATM_AMBASSADOR is not set
977# CONFIG_ATM_HORIZON is not set
978# CONFIG_ATM_IA is not set
979# CONFIG_ATM_FORE200E is not set
980# CONFIG_ATM_HE is not set
981# CONFIG_ATM_SOLOS is not set
982# CONFIG_FDDI is not set 905# CONFIG_FDDI is not set
983# CONFIG_HIPPI is not set 906# CONFIG_HIPPI is not set
984CONFIG_PPP=m 907CONFIG_PPP=m
@@ -990,7 +913,6 @@ CONFIG_PPP_DEFLATE=m
990CONFIG_PPP_BSDCOMP=m 913CONFIG_PPP_BSDCOMP=m
991# CONFIG_PPP_MPPE is not set 914# CONFIG_PPP_MPPE is not set
992CONFIG_PPPOE=m 915CONFIG_PPPOE=m
993CONFIG_PPPOATM=m
994# CONFIG_PPPOL2TP is not set 916# CONFIG_PPPOL2TP is not set
995CONFIG_SLIP=m 917CONFIG_SLIP=m
996CONFIG_SLIP_COMPRESSED=y 918CONFIG_SLIP_COMPRESSED=y
@@ -1010,7 +932,7 @@ CONFIG_NET_POLL_CONTROLLER=y
1010# Input device support 932# Input device support
1011# 933#
1012CONFIG_INPUT=y 934CONFIG_INPUT=y
1013CONFIG_INPUT_FF_MEMLESS=m 935# CONFIG_INPUT_FF_MEMLESS is not set
1014# CONFIG_INPUT_POLLDEV is not set 936# CONFIG_INPUT_POLLDEV is not set
1015 937
1016# 938#
@@ -1058,6 +980,7 @@ CONFIG_DEVKMEM=y
1058CONFIG_SERIAL_8250=y 980CONFIG_SERIAL_8250=y
1059CONFIG_SERIAL_8250_CONSOLE=y 981CONFIG_SERIAL_8250_CONSOLE=y
1060# CONFIG_SERIAL_8250_PCI is not set 982# CONFIG_SERIAL_8250_PCI is not set
983# CONFIG_SERIAL_8250_CS is not set
1061CONFIG_SERIAL_8250_NR_UARTS=2 984CONFIG_SERIAL_8250_NR_UARTS=2
1062CONFIG_SERIAL_8250_RUNTIME_UARTS=2 985CONFIG_SERIAL_8250_RUNTIME_UARTS=2
1063# CONFIG_SERIAL_8250_EXTENDED is not set 986# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -1080,6 +1003,14 @@ CONFIG_HW_RANDOM=y
1080CONFIG_NVRAM=y 1003CONFIG_NVRAM=y
1081# CONFIG_R3964 is not set 1004# CONFIG_R3964 is not set
1082# CONFIG_APPLICOM is not set 1005# CONFIG_APPLICOM is not set
1006
1007#
1008# PCMCIA character devices
1009#
1010# CONFIG_SYNCLINK_CS is not set
1011# CONFIG_CARDMAN_4000 is not set
1012# CONFIG_CARDMAN_4040 is not set
1013# CONFIG_IPWIRELESS is not set
1083# CONFIG_RAW_DRIVER is not set 1014# CONFIG_RAW_DRIVER is not set
1084# CONFIG_TCG_TPM is not set 1015# CONFIG_TCG_TPM is not set
1085CONFIG_DEVPORT=y 1016CONFIG_DEVPORT=y
@@ -1143,18 +1074,21 @@ CONFIG_DS1682=y
1143# CONFIG_SENSORS_PCF8574 is not set 1074# CONFIG_SENSORS_PCF8574 is not set
1144# CONFIG_PCF8575 is not set 1075# CONFIG_PCF8575 is not set
1145# CONFIG_SENSORS_PCA9539 is not set 1076# CONFIG_SENSORS_PCA9539 is not set
1146# CONFIG_SENSORS_MAX6875 is not set
1147# CONFIG_SENSORS_TSL2550 is not set 1077# CONFIG_SENSORS_TSL2550 is not set
1148# CONFIG_I2C_DEBUG_CORE is not set 1078# CONFIG_I2C_DEBUG_CORE is not set
1149# CONFIG_I2C_DEBUG_ALGO is not set 1079# CONFIG_I2C_DEBUG_ALGO is not set
1150# CONFIG_I2C_DEBUG_BUS is not set 1080# CONFIG_I2C_DEBUG_BUS is not set
1151# CONFIG_I2C_DEBUG_CHIP is not set 1081# CONFIG_I2C_DEBUG_CHIP is not set
1152# CONFIG_SPI is not set 1082# CONFIG_SPI is not set
1083
1084#
1085# PPS support
1086#
1087# CONFIG_PPS is not set
1153CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1088CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1154CONFIG_ARCH_REQUIRE_GPIOLIB=y 1089CONFIG_ARCH_REQUIRE_GPIOLIB=y
1155CONFIG_GPIOLIB=y 1090CONFIG_GPIOLIB=y
1156# CONFIG_DEBUG_GPIO is not set 1091CONFIG_GPIO_SYSFS=y
1157# CONFIG_GPIO_SYSFS is not set
1158 1092
1159# 1093#
1160# Memory mapped GPIO expanders: 1094# Memory mapped GPIO expanders:
@@ -1229,6 +1163,7 @@ CONFIG_SENSORS_LM92=y
1229# CONFIG_SENSORS_SMSC47B397 is not set 1163# CONFIG_SENSORS_SMSC47B397 is not set
1230# CONFIG_SENSORS_ADS7828 is not set 1164# CONFIG_SENSORS_ADS7828 is not set
1231# CONFIG_SENSORS_THMC50 is not set 1165# CONFIG_SENSORS_THMC50 is not set
1166# CONFIG_SENSORS_TMP401 is not set
1232# CONFIG_SENSORS_VIA686A is not set 1167# CONFIG_SENSORS_VIA686A is not set
1233# CONFIG_SENSORS_VT1211 is not set 1168# CONFIG_SENSORS_VT1211 is not set
1234# CONFIG_SENSORS_VT8231 is not set 1169# CONFIG_SENSORS_VT8231 is not set
@@ -1284,24 +1219,9 @@ CONFIG_SSB_POSSIBLE=y
1284# CONFIG_MFD_WM8400 is not set 1219# CONFIG_MFD_WM8400 is not set
1285# CONFIG_MFD_WM8350_I2C is not set 1220# CONFIG_MFD_WM8350_I2C is not set
1286# CONFIG_MFD_PCF50633 is not set 1221# CONFIG_MFD_PCF50633 is not set
1222# CONFIG_AB3100_CORE is not set
1287# CONFIG_REGULATOR is not set 1223# CONFIG_REGULATOR is not set
1288 1224# CONFIG_MEDIA_SUPPORT is not set
1289#
1290# Multimedia devices
1291#
1292
1293#
1294# Multimedia core support
1295#
1296# CONFIG_VIDEO_DEV is not set
1297# CONFIG_DVB_CORE is not set
1298# CONFIG_VIDEO_MEDIA is not set
1299
1300#
1301# Multimedia drivers
1302#
1303CONFIG_DAB=y
1304# CONFIG_USB_DABUSB is not set
1305 1225
1306# 1226#
1307# Graphics support 1227# Graphics support
@@ -1346,7 +1266,7 @@ CONFIG_HID_BELKIN=y
1346CONFIG_HID_CHERRY=y 1266CONFIG_HID_CHERRY=y
1347CONFIG_HID_CHICONY=y 1267CONFIG_HID_CHICONY=y
1348CONFIG_HID_CYPRESS=y 1268CONFIG_HID_CYPRESS=y
1349# CONFIG_DRAGONRISE_FF is not set 1269# CONFIG_HID_DRAGONRISE is not set
1350CONFIG_HID_EZKEY=y 1270CONFIG_HID_EZKEY=y
1351# CONFIG_HID_KYE is not set 1271# CONFIG_HID_KYE is not set
1352CONFIG_HID_GYRATION=y 1272CONFIG_HID_GYRATION=y
@@ -1363,10 +1283,11 @@ CONFIG_HID_PETALYNX=y
1363CONFIG_HID_SAMSUNG=y 1283CONFIG_HID_SAMSUNG=y
1364CONFIG_HID_SONY=y 1284CONFIG_HID_SONY=y
1365CONFIG_HID_SUNPLUS=y 1285CONFIG_HID_SUNPLUS=y
1366# CONFIG_GREENASIA_FF is not set 1286# CONFIG_HID_GREENASIA is not set
1287# CONFIG_HID_SMARTJOYPLUS is not set
1367# CONFIG_HID_TOPSEED is not set 1288# CONFIG_HID_TOPSEED is not set
1368CONFIG_THRUSTMASTER_FF=m 1289# CONFIG_HID_THRUSTMASTER is not set
1369CONFIG_ZEROPLUS_FF=m 1290# CONFIG_HID_ZEROPLUS is not set
1370CONFIG_USB_SUPPORT=y 1291CONFIG_USB_SUPPORT=y
1371CONFIG_USB_ARCH_HAS_HCD=y 1292CONFIG_USB_ARCH_HAS_HCD=y
1372CONFIG_USB_ARCH_HAS_OHCI=y 1293CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1392,6 +1313,7 @@ CONFIG_USB=y
1392# USB Host Controller Drivers 1313# USB Host Controller Drivers
1393# 1314#
1394# CONFIG_USB_C67X00_HCD is not set 1315# CONFIG_USB_C67X00_HCD is not set
1316# CONFIG_USB_XHCI_HCD is not set
1395CONFIG_USB_EHCI_HCD=y 1317CONFIG_USB_EHCI_HCD=y
1396# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1318# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1397# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1319# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1401,6 +1323,8 @@ CONFIG_USB_EHCI_HCD=y
1401# CONFIG_USB_ISP116X_HCD is not set 1323# CONFIG_USB_ISP116X_HCD is not set
1402# CONFIG_USB_ISP1760_HCD is not set 1324# CONFIG_USB_ISP1760_HCD is not set
1403CONFIG_USB_OHCI_HCD=y 1325CONFIG_USB_OHCI_HCD=y
1326# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1327# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1404# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1328# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1405# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1329# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1406# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1330# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1475,7 +1399,6 @@ CONFIG_USB_STORAGE=y
1475# CONFIG_USB_IOWARRIOR is not set 1399# CONFIG_USB_IOWARRIOR is not set
1476# CONFIG_USB_ISIGHTFW is not set 1400# CONFIG_USB_ISIGHTFW is not set
1477# CONFIG_USB_VST is not set 1401# CONFIG_USB_VST is not set
1478# CONFIG_USB_ATM is not set
1479# CONFIG_USB_GADGET is not set 1402# CONFIG_USB_GADGET is not set
1480 1403
1481# 1404#
@@ -1521,6 +1444,7 @@ CONFIG_RTC_INTF_DEV=y
1521# CONFIG_RTC_DRV_S35390A is not set 1444# CONFIG_RTC_DRV_S35390A is not set
1522# CONFIG_RTC_DRV_FM3130 is not set 1445# CONFIG_RTC_DRV_FM3130 is not set
1523CONFIG_RTC_DRV_RX8581=y 1446CONFIG_RTC_DRV_RX8581=y
1447# CONFIG_RTC_DRV_RX8025 is not set
1524 1448
1525# 1449#
1526# SPI RTC drivers 1450# SPI RTC drivers
@@ -1548,6 +1472,10 @@ CONFIG_RTC_DRV_RX8581=y
1548# CONFIG_DMADEVICES is not set 1472# CONFIG_DMADEVICES is not set
1549# CONFIG_AUXDISPLAY is not set 1473# CONFIG_AUXDISPLAY is not set
1550# CONFIG_UIO is not set 1474# CONFIG_UIO is not set
1475
1476#
1477# TI VLYNQ
1478#
1551# CONFIG_STAGING is not set 1479# CONFIG_STAGING is not set
1552 1480
1553# 1481#
@@ -1569,10 +1497,12 @@ CONFIG_FS_MBCACHE=y
1569# CONFIG_REISERFS_FS is not set 1497# CONFIG_REISERFS_FS is not set
1570# CONFIG_JFS_FS is not set 1498# CONFIG_JFS_FS is not set
1571CONFIG_FS_POSIX_ACL=y 1499CONFIG_FS_POSIX_ACL=y
1572CONFIG_FILE_LOCKING=y
1573# CONFIG_XFS_FS is not set 1500# CONFIG_XFS_FS is not set
1501# CONFIG_GFS2_FS is not set
1574# CONFIG_OCFS2_FS is not set 1502# CONFIG_OCFS2_FS is not set
1575# CONFIG_BTRFS_FS is not set 1503# CONFIG_BTRFS_FS is not set
1504CONFIG_FILE_LOCKING=y
1505CONFIG_FSNOTIFY=y
1576CONFIG_DNOTIFY=y 1506CONFIG_DNOTIFY=y
1577CONFIG_INOTIFY=y 1507CONFIG_INOTIFY=y
1578CONFIG_INOTIFY_USER=y 1508CONFIG_INOTIFY_USER=y
@@ -1589,8 +1519,11 @@ CONFIG_INOTIFY_USER=y
1589# 1519#
1590# CD-ROM/DVD Filesystems 1520# CD-ROM/DVD Filesystems
1591# 1521#
1592# CONFIG_ISO9660_FS is not set 1522CONFIG_ISO9660_FS=y
1593# CONFIG_UDF_FS is not set 1523CONFIG_JOLIET=y
1524CONFIG_ZISOFS=y
1525CONFIG_UDF_FS=y
1526CONFIG_UDF_NLS=y
1594 1527
1595# 1528#
1596# DOS/FAT/NT Filesystems 1529# DOS/FAT/NT Filesystems
@@ -1598,8 +1531,8 @@ CONFIG_INOTIFY_USER=y
1598CONFIG_FAT_FS=y 1531CONFIG_FAT_FS=y
1599CONFIG_MSDOS_FS=y 1532CONFIG_MSDOS_FS=y
1600CONFIG_VFAT_FS=y 1533CONFIG_VFAT_FS=y
1601CONFIG_FAT_DEFAULT_CODEPAGE=437 1534CONFIG_FAT_DEFAULT_CODEPAGE=850
1602CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1535CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
1603# CONFIG_NTFS_FS is not set 1536# CONFIG_NTFS_FS is not set
1604 1537
1605# 1538#
@@ -1649,6 +1582,7 @@ CONFIG_NFS_FS=y
1649CONFIG_NFS_V3=y 1582CONFIG_NFS_V3=y
1650# CONFIG_NFS_V3_ACL is not set 1583# CONFIG_NFS_V3_ACL is not set
1651CONFIG_NFS_V4=y 1584CONFIG_NFS_V4=y
1585# CONFIG_NFS_V4_1 is not set
1652CONFIG_ROOT_NFS=y 1586CONFIG_ROOT_NFS=y
1653# CONFIG_NFSD is not set 1587# CONFIG_NFSD is not set
1654CONFIG_LOCKD=y 1588CONFIG_LOCKD=y
@@ -1723,13 +1657,13 @@ CONFIG_NLS_UTF8=m
1723# 1657#
1724CONFIG_BITREVERSE=y 1658CONFIG_BITREVERSE=y
1725CONFIG_GENERIC_FIND_LAST_BIT=y 1659CONFIG_GENERIC_FIND_LAST_BIT=y
1726CONFIG_CRC_CCITT=m 1660CONFIG_CRC_CCITT=y
1727# CONFIG_CRC16 is not set 1661# CONFIG_CRC16 is not set
1728# CONFIG_CRC_T10DIF is not set 1662CONFIG_CRC_T10DIF=y
1729# CONFIG_CRC_ITU_T is not set 1663CONFIG_CRC_ITU_T=y
1730CONFIG_CRC32=y 1664CONFIG_CRC32=y
1731# CONFIG_CRC7 is not set 1665# CONFIG_CRC7 is not set
1732CONFIG_LIBCRC32C=m 1666CONFIG_LIBCRC32C=y
1733CONFIG_ZLIB_INFLATE=y 1667CONFIG_ZLIB_INFLATE=y
1734CONFIG_ZLIB_DEFLATE=y 1668CONFIG_ZLIB_DEFLATE=y
1735CONFIG_DECOMPRESS_GZIP=y 1669CONFIG_DECOMPRESS_GZIP=y
@@ -1738,6 +1672,7 @@ CONFIG_HAS_IOPORT=y
1738CONFIG_HAS_DMA=y 1672CONFIG_HAS_DMA=y
1739CONFIG_HAVE_LMB=y 1673CONFIG_HAVE_LMB=y
1740CONFIG_NLATTR=y 1674CONFIG_NLATTR=y
1675CONFIG_GENERIC_ATOMIC64=y
1741 1676
1742# 1677#
1743# Kernel hacking 1678# Kernel hacking
@@ -1750,75 +1685,24 @@ CONFIG_MAGIC_SYSRQ=y
1750# CONFIG_UNUSED_SYMBOLS is not set 1685# CONFIG_UNUSED_SYMBOLS is not set
1751# CONFIG_DEBUG_FS is not set 1686# CONFIG_DEBUG_FS is not set
1752# CONFIG_HEADERS_CHECK is not set 1687# CONFIG_HEADERS_CHECK is not set
1753CONFIG_DEBUG_KERNEL=y 1688# CONFIG_DEBUG_KERNEL is not set
1754# CONFIG_DEBUG_SHIRQ is not set
1755CONFIG_DETECT_SOFTLOCKUP=y
1756# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1757CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1758CONFIG_DETECT_HUNG_TASK=y
1759# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1760CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1761CONFIG_SCHED_DEBUG=y
1762# CONFIG_SCHEDSTATS is not set
1763# CONFIG_TIMER_STATS is not set
1764# CONFIG_DEBUG_OBJECTS is not set
1765# CONFIG_DEBUG_SLAB is not set
1766# CONFIG_DEBUG_RT_MUTEXES is not set
1767# CONFIG_RT_MUTEX_TESTER is not set
1768# CONFIG_DEBUG_SPINLOCK is not set
1769# CONFIG_DEBUG_MUTEXES is not set
1770# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1771# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1772# CONFIG_DEBUG_KOBJECT is not set
1773# CONFIG_DEBUG_BUGVERBOSE is not set 1689# CONFIG_DEBUG_BUGVERBOSE is not set
1774CONFIG_DEBUG_INFO=y
1775# CONFIG_DEBUG_VM is not set
1776# CONFIG_DEBUG_WRITECOUNT is not set
1777# CONFIG_DEBUG_MEMORY_INIT is not set 1690# CONFIG_DEBUG_MEMORY_INIT is not set
1778# CONFIG_DEBUG_LIST is not set
1779# CONFIG_DEBUG_SG is not set
1780# CONFIG_DEBUG_NOTIFIERS is not set
1781# CONFIG_BOOT_PRINTK_DELAY is not set
1782# CONFIG_RCU_TORTURE_TEST is not set
1783# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1691# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1784# CONFIG_BACKTRACE_SELF_TEST is not set
1785# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1786# CONFIG_FAULT_INJECTION is not set
1787# CONFIG_LATENCYTOP is not set 1692# CONFIG_LATENCYTOP is not set
1788CONFIG_SYSCTL_SYSCALL_CHECK=y 1693CONFIG_SYSCTL_SYSCALL_CHECK=y
1789# CONFIG_DEBUG_PAGEALLOC is not set
1790CONFIG_HAVE_FUNCTION_TRACER=y 1694CONFIG_HAVE_FUNCTION_TRACER=y
1791CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y 1695CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1792CONFIG_HAVE_DYNAMIC_FTRACE=y 1696CONFIG_HAVE_DYNAMIC_FTRACE=y
1793CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1697CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1794CONFIG_TRACING_SUPPORT=y 1698CONFIG_TRACING_SUPPORT=y
1795 1699# CONFIG_FTRACE is not set
1796#
1797# Tracers
1798#
1799# CONFIG_FUNCTION_TRACER is not set
1800# CONFIG_PREEMPT_TRACER is not set
1801# CONFIG_SCHED_TRACER is not set
1802# CONFIG_CONTEXT_SWITCH_TRACER is not set
1803# CONFIG_EVENT_TRACER is not set
1804# CONFIG_BOOT_TRACER is not set
1805# CONFIG_TRACE_BRANCH_PROFILING is not set
1806# CONFIG_STACK_TRACER is not set
1807# CONFIG_KMEMTRACE is not set
1808# CONFIG_WORKQUEUE_TRACER is not set
1809# CONFIG_BLK_DEV_IO_TRACE is not set
1810# CONFIG_SAMPLES is not set 1700# CONFIG_SAMPLES is not set
1811CONFIG_HAVE_ARCH_KGDB=y 1701CONFIG_HAVE_ARCH_KGDB=y
1812# CONFIG_KGDB is not set 1702# CONFIG_PPC_DISABLE_WERROR is not set
1703CONFIG_PPC_WERROR=y
1813CONFIG_PRINT_STACK_DEPTH=64 1704CONFIG_PRINT_STACK_DEPTH=64
1814# CONFIG_DEBUG_STACKOVERFLOW is not set
1815# CONFIG_DEBUG_STACK_USAGE is not set
1816# CONFIG_CODE_PATCHING_SELFTEST is not set
1817# CONFIG_FTR_FIXUP_SELFTEST is not set
1818# CONFIG_MSI_BITMAP_SELFTEST is not set
1819# CONFIG_XMON is not set
1820# CONFIG_IRQSTACKS is not set 1705# CONFIG_IRQSTACKS is not set
1821# CONFIG_BDI_SWITCH is not set
1822# CONFIG_BOOTX_TEXT is not set 1706# CONFIG_BOOTX_TEXT is not set
1823# CONFIG_PPC_EARLY_DEBUG is not set 1707# CONFIG_PPC_EARLY_DEBUG is not set
1824 1708
@@ -1826,15 +1710,9 @@ CONFIG_PRINT_STACK_DEPTH=64
1826# Security options 1710# Security options
1827# 1711#
1828# CONFIG_KEYS is not set 1712# CONFIG_KEYS is not set
1829CONFIG_SECURITY=y 1713# CONFIG_SECURITY is not set
1830# CONFIG_SECURITYFS is not set 1714# CONFIG_SECURITYFS is not set
1831CONFIG_SECURITY_NETWORK=y
1832# CONFIG_SECURITY_NETWORK_XFRM is not set
1833# CONFIG_SECURITY_PATH is not set
1834# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1715# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1835# CONFIG_SECURITY_ROOTPLUG is not set
1836CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1837# CONFIG_SECURITY_TOMOYO is not set
1838CONFIG_CRYPTO=y 1716CONFIG_CRYPTO=y
1839 1717
1840# 1718#
@@ -1854,11 +1732,11 @@ CONFIG_CRYPTO_PCOMP=y
1854CONFIG_CRYPTO_MANAGER=y 1732CONFIG_CRYPTO_MANAGER=y
1855CONFIG_CRYPTO_MANAGER2=y 1733CONFIG_CRYPTO_MANAGER2=y
1856# CONFIG_CRYPTO_GF128MUL is not set 1734# CONFIG_CRYPTO_GF128MUL is not set
1857CONFIG_CRYPTO_NULL=m 1735# CONFIG_CRYPTO_NULL is not set
1858CONFIG_CRYPTO_WORKQUEUE=y 1736CONFIG_CRYPTO_WORKQUEUE=y
1859# CONFIG_CRYPTO_CRYPTD is not set 1737# CONFIG_CRYPTO_CRYPTD is not set
1860CONFIG_CRYPTO_AUTHENC=m 1738CONFIG_CRYPTO_AUTHENC=m
1861CONFIG_CRYPTO_TEST=m 1739# CONFIG_CRYPTO_TEST is not set
1862 1740
1863# 1741#
1864# Authenticated Encryption with Associated Data 1742# Authenticated Encryption with Associated Data
@@ -1873,53 +1751,52 @@ CONFIG_CRYPTO_TEST=m
1873CONFIG_CRYPTO_CBC=y 1751CONFIG_CRYPTO_CBC=y
1874# CONFIG_CRYPTO_CTR is not set 1752# CONFIG_CRYPTO_CTR is not set
1875# CONFIG_CRYPTO_CTS is not set 1753# CONFIG_CRYPTO_CTS is not set
1876CONFIG_CRYPTO_ECB=m 1754# CONFIG_CRYPTO_ECB is not set
1877# CONFIG_CRYPTO_LRW is not set 1755# CONFIG_CRYPTO_LRW is not set
1878CONFIG_CRYPTO_PCBC=m 1756# CONFIG_CRYPTO_PCBC is not set
1879# CONFIG_CRYPTO_XTS is not set 1757# CONFIG_CRYPTO_XTS is not set
1880 1758
1881# 1759#
1882# Hash modes 1760# Hash modes
1883# 1761#
1884CONFIG_CRYPTO_HMAC=y 1762CONFIG_CRYPTO_HMAC=m
1885# CONFIG_CRYPTO_XCBC is not set 1763# CONFIG_CRYPTO_XCBC is not set
1886 1764
1887# 1765#
1888# Digest 1766# Digest
1889# 1767#
1890CONFIG_CRYPTO_CRC32C=m 1768CONFIG_CRYPTO_CRC32C=y
1891CONFIG_CRYPTO_MD4=m 1769# CONFIG_CRYPTO_MD4 is not set
1892CONFIG_CRYPTO_MD5=y 1770CONFIG_CRYPTO_MD5=y
1893CONFIG_CRYPTO_MICHAEL_MIC=m 1771# CONFIG_CRYPTO_MICHAEL_MIC is not set
1894# CONFIG_CRYPTO_RMD128 is not set 1772# CONFIG_CRYPTO_RMD128 is not set
1895# CONFIG_CRYPTO_RMD160 is not set 1773# CONFIG_CRYPTO_RMD160 is not set
1896# CONFIG_CRYPTO_RMD256 is not set 1774# CONFIG_CRYPTO_RMD256 is not set
1897# CONFIG_CRYPTO_RMD320 is not set 1775# CONFIG_CRYPTO_RMD320 is not set
1898CONFIG_CRYPTO_SHA1=m 1776CONFIG_CRYPTO_SHA1=m
1899CONFIG_CRYPTO_SHA256=m 1777# CONFIG_CRYPTO_SHA256 is not set
1900CONFIG_CRYPTO_SHA512=m 1778# CONFIG_CRYPTO_SHA512 is not set
1901# CONFIG_CRYPTO_TGR192 is not set 1779# CONFIG_CRYPTO_TGR192 is not set
1902CONFIG_CRYPTO_WP512=m 1780# CONFIG_CRYPTO_WP512 is not set
1903 1781
1904# 1782#
1905# Ciphers 1783# Ciphers
1906# 1784#
1907CONFIG_CRYPTO_AES=m 1785# CONFIG_CRYPTO_AES is not set
1908CONFIG_CRYPTO_ANUBIS=m 1786# CONFIG_CRYPTO_ANUBIS is not set
1909CONFIG_CRYPTO_ARC4=m 1787# CONFIG_CRYPTO_ARC4 is not set
1910CONFIG_CRYPTO_BLOWFISH=m 1788# CONFIG_CRYPTO_BLOWFISH is not set
1911# CONFIG_CRYPTO_CAMELLIA is not set 1789# CONFIG_CRYPTO_CAMELLIA is not set
1912CONFIG_CRYPTO_CAST5=m 1790# CONFIG_CRYPTO_CAST5 is not set
1913CONFIG_CRYPTO_CAST6=m 1791# CONFIG_CRYPTO_CAST6 is not set
1914CONFIG_CRYPTO_DES=y 1792CONFIG_CRYPTO_DES=y
1915# CONFIG_CRYPTO_FCRYPT is not set 1793# CONFIG_CRYPTO_FCRYPT is not set
1916CONFIG_CRYPTO_KHAZAD=m 1794# CONFIG_CRYPTO_KHAZAD is not set
1917# CONFIG_CRYPTO_SALSA20 is not set 1795# CONFIG_CRYPTO_SALSA20 is not set
1918# CONFIG_CRYPTO_SEED is not set 1796# CONFIG_CRYPTO_SEED is not set
1919CONFIG_CRYPTO_SERPENT=m 1797# CONFIG_CRYPTO_SERPENT is not set
1920CONFIG_CRYPTO_TEA=m 1798# CONFIG_CRYPTO_TEA is not set
1921CONFIG_CRYPTO_TWOFISH=m 1799# CONFIG_CRYPTO_TWOFISH is not set
1922CONFIG_CRYPTO_TWOFISH_COMMON=m
1923 1800
1924# 1801#
1925# Compression 1802# Compression
diff --git a/arch/powerpc/configs/86xx/gef_sbc310_defconfig b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
index a66910e63345..cd338d493bed 100644
--- a/arch/powerpc/configs/86xx/gef_sbc310_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:29 2009 4# Wed Jul 29 23:32:29 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -56,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
56CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
57CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -91,7 +96,11 @@ CONFIG_CLASSIC_RCU=y
91CONFIG_IKCONFIG=y 96CONFIG_IKCONFIG=y
92CONFIG_IKCONFIG_PROC=y 97CONFIG_IKCONFIG_PROC=y
93CONFIG_LOG_BUF_SHIFT=14 98CONFIG_LOG_BUF_SHIFT=14
94# CONFIG_GROUP_SCHED is not set 99CONFIG_GROUP_SCHED=y
100CONFIG_FAIR_GROUP_SCHED=y
101# CONFIG_RT_GROUP_SCHED is not set
102CONFIG_USER_SCHED=y
103# CONFIG_CGROUP_SCHED is not set
95# CONFIG_CGROUPS is not set 104# CONFIG_CGROUPS is not set
96CONFIG_SYSFS_DEPRECATED=y 105CONFIG_SYSFS_DEPRECATED=y
97CONFIG_SYSFS_DEPRECATED_V2=y 106CONFIG_SYSFS_DEPRECATED_V2=y
@@ -109,7 +118,6 @@ CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y 118CONFIG_SYSCTL_SYSCALL=y
110CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
111# CONFIG_KALLSYMS_EXTRA_PASS is not set 120# CONFIG_KALLSYMS_EXTRA_PASS is not set
112# CONFIG_STRIP_ASM_SYMS is not set
113CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
114CONFIG_PRINTK=y 122CONFIG_PRINTK=y
115CONFIG_BUG=y 123CONFIG_BUG=y
@@ -122,8 +130,15 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 131CONFIG_SHMEM=y
124CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
128CONFIG_SLAB=y 143CONFIG_SLAB=y
129# CONFIG_SLUB is not set 144# CONFIG_SLUB is not set
@@ -138,6 +153,10 @@ CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
140CONFIG_USE_GENERIC_SMP_HELPERS=y 155CONFIG_USE_GENERIC_SMP_HELPERS=y
156
157#
158# GCOV-based kernel profiling
159#
141# CONFIG_SLOW_WORK is not set 160# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 162CONFIG_SLABINFO=y
@@ -151,7 +170,7 @@ CONFIG_MODULE_UNLOAD=y
151# CONFIG_MODULE_SRCVERSION_ALL is not set 170# CONFIG_MODULE_SRCVERSION_ALL is not set
152CONFIG_STOP_MACHINE=y 171CONFIG_STOP_MACHINE=y
153CONFIG_BLOCK=y 172CONFIG_BLOCK=y
154# CONFIG_LBD is not set 173CONFIG_LBDAF=y
155# CONFIG_BLK_DEV_BSG is not set 174# CONFIG_BLK_DEV_BSG is not set
156# CONFIG_BLK_DEV_INTEGRITY is not set 175# CONFIG_BLK_DEV_INTEGRITY is not set
157 176
@@ -168,7 +187,6 @@ CONFIG_DEFAULT_CFQ=y
168# CONFIG_DEFAULT_NOOP is not set 187# CONFIG_DEFAULT_NOOP is not set
169CONFIG_DEFAULT_IOSCHED="cfq" 188CONFIG_DEFAULT_IOSCHED="cfq"
170# CONFIG_FREEZER is not set 189# CONFIG_FREEZER is not set
171CONFIG_PPC_MSI_BITMAP=y
172 190
173# 191#
174# Platform support 192# Platform support
@@ -212,7 +230,7 @@ CONFIG_MPIC=y
212# 230#
213# Kernel options 231# Kernel options
214# 232#
215# CONFIG_HIGHMEM is not set 233CONFIG_HIGHMEM=y
216CONFIG_TICK_ONESHOT=y 234CONFIG_TICK_ONESHOT=y
217# CONFIG_NO_HZ is not set 235# CONFIG_NO_HZ is not set
218CONFIG_HIGH_RES_TIMERS=y 236CONFIG_HIGH_RES_TIMERS=y
@@ -231,6 +249,7 @@ CONFIG_BINFMT_ELF=y
231# CONFIG_HAVE_AOUT is not set 249# CONFIG_HAVE_AOUT is not set
232CONFIG_BINFMT_MISC=y 250CONFIG_BINFMT_MISC=y
233# CONFIG_IOMMU_HELPER is not set 251# CONFIG_IOMMU_HELPER is not set
252# CONFIG_SWIOTLB is not set
234CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
235CONFIG_ARCH_HAS_WALK_MEMORY=y 254CONFIG_ARCH_HAS_WALK_MEMORY=y
236CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -252,9 +271,9 @@ CONFIG_MIGRATION=y
252CONFIG_ZONE_DMA_FLAG=1 271CONFIG_ZONE_DMA_FLAG=1
253CONFIG_BOUNCE=y 272CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 273CONFIG_VIRT_TO_BUS=y
255CONFIG_UNEVICTABLE_LRU=y
256CONFIG_HAVE_MLOCK=y 274CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 275CONFIG_HAVE_MLOCKED_PAGE_BIT=y
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
260# CONFIG_PPC_64K_PAGES is not set 279# CONFIG_PPC_64K_PAGES is not set
@@ -281,13 +300,32 @@ CONFIG_PCI_DOMAINS=y
281CONFIG_PCI_SYSCALL=y 300CONFIG_PCI_SYSCALL=y
282CONFIG_PCIEPORTBUS=y 301CONFIG_PCIEPORTBUS=y
283CONFIG_PCIEAER=y 302CONFIG_PCIEAER=y
303# CONFIG_PCIE_ECRC is not set
304# CONFIG_PCIEAER_INJECT is not set
284# CONFIG_PCIEASPM is not set 305# CONFIG_PCIEASPM is not set
285CONFIG_ARCH_SUPPORTS_MSI=y 306CONFIG_ARCH_SUPPORTS_MSI=y
286CONFIG_PCI_MSI=y 307# CONFIG_PCI_MSI is not set
287# CONFIG_PCI_LEGACY is not set 308# CONFIG_PCI_LEGACY is not set
288# CONFIG_PCI_STUB is not set 309# CONFIG_PCI_STUB is not set
289# CONFIG_PCI_IOV is not set 310# CONFIG_PCI_IOV is not set
290# CONFIG_PCCARD is not set 311CONFIG_PCCARD=y
312# CONFIG_PCMCIA_DEBUG is not set
313CONFIG_PCMCIA=y
314# CONFIG_PCMCIA_LOAD_CIS is not set
315# CONFIG_PCMCIA_IOCTL is not set
316# CONFIG_CARDBUS is not set
317
318#
319# PC-card bridges
320#
321CONFIG_YENTA=y
322# CONFIG_YENTA_O2 is not set
323# CONFIG_YENTA_RICOH is not set
324CONFIG_YENTA_TI=y
325# CONFIG_YENTA_TOSHIBA is not set
326# CONFIG_PD6729 is not set
327# CONFIG_I82092 is not set
328CONFIG_PCCARD_NONSTATIC=y
291# CONFIG_HOTPLUG_PCI is not set 329# CONFIG_HOTPLUG_PCI is not set
292# CONFIG_HAS_RAPIDIO is not set 330# CONFIG_HAS_RAPIDIO is not set
293 331
@@ -393,6 +431,7 @@ CONFIG_IPV6_TUNNEL=m
393# CONFIG_ECONET is not set 431# CONFIG_ECONET is not set
394# CONFIG_WAN_ROUTER is not set 432# CONFIG_WAN_ROUTER is not set
395# CONFIG_PHONET is not set 433# CONFIG_PHONET is not set
434# CONFIG_IEEE802154 is not set
396# CONFIG_NET_SCHED is not set 435# CONFIG_NET_SCHED is not set
397# CONFIG_DCB is not set 436# CONFIG_DCB is not set
398 437
@@ -421,7 +460,9 @@ CONFIG_FIB_RULES=y
421CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 460CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
422CONFIG_STANDALONE=y 461CONFIG_STANDALONE=y
423CONFIG_PREVENT_FIRMWARE_BUILD=y 462CONFIG_PREVENT_FIRMWARE_BUILD=y
424# CONFIG_FW_LOADER is not set 463CONFIG_FW_LOADER=y
464CONFIG_FIRMWARE_IN_KERNEL=y
465CONFIG_EXTRA_FIRMWARE=""
425# CONFIG_SYS_HYPERVISOR is not set 466# CONFIG_SYS_HYPERVISOR is not set
426# CONFIG_CONNECTOR is not set 467# CONFIG_CONNECTOR is not set
427CONFIG_MTD=y 468CONFIG_MTD=y
@@ -511,6 +552,7 @@ CONFIG_MTD_PHYSMAP_OF=y
511CONFIG_OF_DEVICE=y 552CONFIG_OF_DEVICE=y
512CONFIG_OF_GPIO=y 553CONFIG_OF_GPIO=y
513CONFIG_OF_I2C=y 554CONFIG_OF_I2C=y
555CONFIG_OF_MDIO=y
514# CONFIG_PARPORT is not set 556# CONFIG_PARPORT is not set
515CONFIG_BLK_DEV=y 557CONFIG_BLK_DEV=y
516# CONFIG_BLK_DEV_FD is not set 558# CONFIG_BLK_DEV_FD is not set
@@ -546,9 +588,60 @@ CONFIG_MISC_DEVICES=y
546# 588#
547# CONFIG_EEPROM_AT24 is not set 589# CONFIG_EEPROM_AT24 is not set
548# CONFIG_EEPROM_LEGACY is not set 590# CONFIG_EEPROM_LEGACY is not set
591# CONFIG_EEPROM_MAX6875 is not set
549# CONFIG_EEPROM_93CX6 is not set 592# CONFIG_EEPROM_93CX6 is not set
593# CONFIG_CB710_CORE is not set
550CONFIG_HAVE_IDE=y 594CONFIG_HAVE_IDE=y
551# CONFIG_IDE is not set 595CONFIG_IDE=y
596
597#
598# Please see Documentation/ide/ide.txt for help/info on IDE drives
599#
600# CONFIG_BLK_DEV_IDE_SATA is not set
601CONFIG_IDE_GD=y
602CONFIG_IDE_GD_ATA=y
603# CONFIG_IDE_GD_ATAPI is not set
604CONFIG_BLK_DEV_IDECS=y
605# CONFIG_BLK_DEV_IDECD is not set
606# CONFIG_BLK_DEV_IDETAPE is not set
607# CONFIG_IDE_TASK_IOCTL is not set
608CONFIG_IDE_PROC_FS=y
609
610#
611# IDE chipset support/bugfixes
612#
613# CONFIG_BLK_DEV_PLATFORM is not set
614
615#
616# PCI IDE chipsets support
617#
618# CONFIG_BLK_DEV_GENERIC is not set
619# CONFIG_BLK_DEV_OPTI621 is not set
620# CONFIG_BLK_DEV_AEC62XX is not set
621# CONFIG_BLK_DEV_ALI15X3 is not set
622# CONFIG_BLK_DEV_AMD74XX is not set
623# CONFIG_BLK_DEV_CMD64X is not set
624# CONFIG_BLK_DEV_TRIFLEX is not set
625# CONFIG_BLK_DEV_CS5520 is not set
626# CONFIG_BLK_DEV_CS5530 is not set
627# CONFIG_BLK_DEV_HPT366 is not set
628# CONFIG_BLK_DEV_JMICRON is not set
629# CONFIG_BLK_DEV_SC1200 is not set
630# CONFIG_BLK_DEV_PIIX is not set
631# CONFIG_BLK_DEV_IT8172 is not set
632# CONFIG_BLK_DEV_IT8213 is not set
633# CONFIG_BLK_DEV_IT821X is not set
634# CONFIG_BLK_DEV_NS87415 is not set
635# CONFIG_BLK_DEV_PDC202XX_OLD is not set
636# CONFIG_BLK_DEV_PDC202XX_NEW is not set
637# CONFIG_BLK_DEV_SVWKS is not set
638# CONFIG_BLK_DEV_SIIMAGE is not set
639# CONFIG_BLK_DEV_SL82C105 is not set
640# CONFIG_BLK_DEV_SLC90E66 is not set
641# CONFIG_BLK_DEV_TRM290 is not set
642# CONFIG_BLK_DEV_VIA82CXXX is not set
643# CONFIG_BLK_DEV_TC86C001 is not set
644# CONFIG_BLK_DEV_IDEDMA is not set
552 645
553# 646#
554# SCSI device support 647# SCSI device support
@@ -570,10 +663,6 @@ CONFIG_BLK_DEV_SR=y
570# CONFIG_BLK_DEV_SR_VENDOR is not set 663# CONFIG_BLK_DEV_SR_VENDOR is not set
571# CONFIG_CHR_DEV_SG is not set 664# CONFIG_CHR_DEV_SG is not set
572# CONFIG_CHR_DEV_SCH is not set 665# CONFIG_CHR_DEV_SCH is not set
573
574#
575# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
576#
577# CONFIG_SCSI_MULTI_LUN is not set 666# CONFIG_SCSI_MULTI_LUN is not set
578# CONFIG_SCSI_CONSTANTS is not set 667# CONFIG_SCSI_CONSTANTS is not set
579# CONFIG_SCSI_LOGGING is not set 668# CONFIG_SCSI_LOGGING is not set
@@ -590,6 +679,7 @@ CONFIG_SCSI_WAIT_SCAN=m
590# CONFIG_SCSI_SRP_ATTRS is not set 679# CONFIG_SCSI_SRP_ATTRS is not set
591CONFIG_SCSI_LOWLEVEL=y 680CONFIG_SCSI_LOWLEVEL=y
592# CONFIG_ISCSI_TCP is not set 681# CONFIG_ISCSI_TCP is not set
682# CONFIG_SCSI_BNX2_ISCSI is not set
593# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 683# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
594# CONFIG_SCSI_3W_9XXX is not set 684# CONFIG_SCSI_3W_9XXX is not set
595# CONFIG_SCSI_ACARD is not set 685# CONFIG_SCSI_ACARD is not set
@@ -598,6 +688,7 @@ CONFIG_SCSI_LOWLEVEL=y
598# CONFIG_SCSI_AIC7XXX_OLD is not set 688# CONFIG_SCSI_AIC7XXX_OLD is not set
599# CONFIG_SCSI_AIC79XX is not set 689# CONFIG_SCSI_AIC79XX is not set
600# CONFIG_SCSI_AIC94XX is not set 690# CONFIG_SCSI_AIC94XX is not set
691# CONFIG_SCSI_MVSAS is not set
601# CONFIG_SCSI_DPT_I2O is not set 692# CONFIG_SCSI_DPT_I2O is not set
602# CONFIG_SCSI_ADVANSYS is not set 693# CONFIG_SCSI_ADVANSYS is not set
603# CONFIG_SCSI_ARCMSR is not set 694# CONFIG_SCSI_ARCMSR is not set
@@ -617,7 +708,6 @@ CONFIG_SCSI_LOWLEVEL=y
617# CONFIG_SCSI_IPS is not set 708# CONFIG_SCSI_IPS is not set
618# CONFIG_SCSI_INITIO is not set 709# CONFIG_SCSI_INITIO is not set
619# CONFIG_SCSI_INIA100 is not set 710# CONFIG_SCSI_INIA100 is not set
620# CONFIG_SCSI_MVSAS is not set
621# CONFIG_SCSI_STEX is not set 711# CONFIG_SCSI_STEX is not set
622# CONFIG_SCSI_SYM53C8XX_2 is not set 712# CONFIG_SCSI_SYM53C8XX_2 is not set
623# CONFIG_SCSI_IPR is not set 713# CONFIG_SCSI_IPR is not set
@@ -630,6 +720,7 @@ CONFIG_SCSI_LOWLEVEL=y
630# CONFIG_SCSI_NSP32 is not set 720# CONFIG_SCSI_NSP32 is not set
631# CONFIG_SCSI_DEBUG is not set 721# CONFIG_SCSI_DEBUG is not set
632# CONFIG_SCSI_SRP is not set 722# CONFIG_SCSI_SRP is not set
723# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
633# CONFIG_SCSI_DH is not set 724# CONFIG_SCSI_DH is not set
634# CONFIG_SCSI_OSD_INITIATOR is not set 725# CONFIG_SCSI_OSD_INITIATOR is not set
635CONFIG_ATA=y 726CONFIG_ATA=y
@@ -647,14 +738,17 @@ CONFIG_SATA_SIL24=y
647# 738#
648 739
649# 740#
650# Enable only one of the two stacks, unless you know what you are doing 741# You can enable one or both FireWire driver stacks.
742#
743
744#
745# See the help texts for more information.
651# 746#
652# CONFIG_FIREWIRE is not set 747# CONFIG_FIREWIRE is not set
653# CONFIG_IEEE1394 is not set 748# CONFIG_IEEE1394 is not set
654# CONFIG_I2O is not set 749# CONFIG_I2O is not set
655# CONFIG_MACINTOSH_DRIVERS is not set 750# CONFIG_MACINTOSH_DRIVERS is not set
656CONFIG_NETDEVICES=y 751CONFIG_NETDEVICES=y
657CONFIG_COMPAT_NET_DEV_OPS=y
658CONFIG_DUMMY=m 752CONFIG_DUMMY=m
659CONFIG_BONDING=m 753CONFIG_BONDING=m
660# CONFIG_MACVLAN is not set 754# CONFIG_MACVLAN is not set
@@ -701,6 +795,7 @@ CONFIG_MII=y
701# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 795# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
702# CONFIG_NET_PCI is not set 796# CONFIG_NET_PCI is not set
703# CONFIG_B44 is not set 797# CONFIG_B44 is not set
798# CONFIG_KS8842 is not set
704# CONFIG_ATL2 is not set 799# CONFIG_ATL2 is not set
705CONFIG_NETDEV_1000=y 800CONFIG_NETDEV_1000=y
706# CONFIG_ACENIC is not set 801# CONFIG_ACENIC is not set
@@ -720,8 +815,10 @@ CONFIG_NETDEV_1000=y
720# CONFIG_VIA_VELOCITY is not set 815# CONFIG_VIA_VELOCITY is not set
721# CONFIG_TIGON3 is not set 816# CONFIG_TIGON3 is not set
722# CONFIG_BNX2 is not set 817# CONFIG_BNX2 is not set
818# CONFIG_CNIC is not set
723CONFIG_FSL_PQ_MDIO=y 819CONFIG_FSL_PQ_MDIO=y
724CONFIG_GIANFAR=y 820CONFIG_GIANFAR=y
821# CONFIG_MV643XX_ETH is not set
725# CONFIG_QLA3XXX is not set 822# CONFIG_QLA3XXX is not set
726# CONFIG_ATL1 is not set 823# CONFIG_ATL1 is not set
727# CONFIG_ATL1E is not set 824# CONFIG_ATL1E is not set
@@ -748,6 +845,7 @@ CONFIG_GIANFAR=y
748# CONFIG_USB_PEGASUS is not set 845# CONFIG_USB_PEGASUS is not set
749# CONFIG_USB_RTL8150 is not set 846# CONFIG_USB_RTL8150 is not set
750# CONFIG_USB_USBNET is not set 847# CONFIG_USB_USBNET is not set
848# CONFIG_NET_PCMCIA is not set
751# CONFIG_WAN is not set 849# CONFIG_WAN is not set
752# CONFIG_FDDI is not set 850# CONFIG_FDDI is not set
753# CONFIG_HIPPI is not set 851# CONFIG_HIPPI is not set
@@ -827,6 +925,7 @@ CONFIG_DEVKMEM=y
827CONFIG_SERIAL_8250=y 925CONFIG_SERIAL_8250=y
828CONFIG_SERIAL_8250_CONSOLE=y 926CONFIG_SERIAL_8250_CONSOLE=y
829# CONFIG_SERIAL_8250_PCI is not set 927# CONFIG_SERIAL_8250_PCI is not set
928# CONFIG_SERIAL_8250_CS is not set
830CONFIG_SERIAL_8250_NR_UARTS=2 929CONFIG_SERIAL_8250_NR_UARTS=2
831CONFIG_SERIAL_8250_RUNTIME_UARTS=2 930CONFIG_SERIAL_8250_RUNTIME_UARTS=2
832# CONFIG_SERIAL_8250_EXTENDED is not set 931# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -849,6 +948,14 @@ CONFIG_HW_RANDOM=y
849CONFIG_NVRAM=y 948CONFIG_NVRAM=y
850# CONFIG_R3964 is not set 949# CONFIG_R3964 is not set
851# CONFIG_APPLICOM is not set 950# CONFIG_APPLICOM is not set
951
952#
953# PCMCIA character devices
954#
955# CONFIG_SYNCLINK_CS is not set
956# CONFIG_CARDMAN_4000 is not set
957# CONFIG_CARDMAN_4040 is not set
958# CONFIG_IPWIRELESS is not set
852# CONFIG_RAW_DRIVER is not set 959# CONFIG_RAW_DRIVER is not set
853# CONFIG_TCG_TPM is not set 960# CONFIG_TCG_TPM is not set
854CONFIG_DEVPORT=y 961CONFIG_DEVPORT=y
@@ -912,13 +1019,17 @@ CONFIG_DS1682=y
912# CONFIG_SENSORS_PCF8574 is not set 1019# CONFIG_SENSORS_PCF8574 is not set
913# CONFIG_PCF8575 is not set 1020# CONFIG_PCF8575 is not set
914# CONFIG_SENSORS_PCA9539 is not set 1021# CONFIG_SENSORS_PCA9539 is not set
915# CONFIG_SENSORS_MAX6875 is not set
916# CONFIG_SENSORS_TSL2550 is not set 1022# CONFIG_SENSORS_TSL2550 is not set
917# CONFIG_I2C_DEBUG_CORE is not set 1023# CONFIG_I2C_DEBUG_CORE is not set
918# CONFIG_I2C_DEBUG_ALGO is not set 1024# CONFIG_I2C_DEBUG_ALGO is not set
919# CONFIG_I2C_DEBUG_BUS is not set 1025# CONFIG_I2C_DEBUG_BUS is not set
920# CONFIG_I2C_DEBUG_CHIP is not set 1026# CONFIG_I2C_DEBUG_CHIP is not set
921# CONFIG_SPI is not set 1027# CONFIG_SPI is not set
1028
1029#
1030# PPS support
1031#
1032# CONFIG_PPS is not set
922CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1033CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
923CONFIG_ARCH_REQUIRE_GPIOLIB=y 1034CONFIG_ARCH_REQUIRE_GPIOLIB=y
924CONFIG_GPIOLIB=y 1035CONFIG_GPIOLIB=y
@@ -997,6 +1108,7 @@ CONFIG_SENSORS_LM92=y
997# CONFIG_SENSORS_SMSC47B397 is not set 1108# CONFIG_SENSORS_SMSC47B397 is not set
998# CONFIG_SENSORS_ADS7828 is not set 1109# CONFIG_SENSORS_ADS7828 is not set
999# CONFIG_SENSORS_THMC50 is not set 1110# CONFIG_SENSORS_THMC50 is not set
1111# CONFIG_SENSORS_TMP401 is not set
1000# CONFIG_SENSORS_VIA686A is not set 1112# CONFIG_SENSORS_VIA686A is not set
1001# CONFIG_SENSORS_VT1211 is not set 1113# CONFIG_SENSORS_VT1211 is not set
1002# CONFIG_SENSORS_VT8231 is not set 1114# CONFIG_SENSORS_VT8231 is not set
@@ -1052,24 +1164,9 @@ CONFIG_SSB_POSSIBLE=y
1052# CONFIG_MFD_WM8400 is not set 1164# CONFIG_MFD_WM8400 is not set
1053# CONFIG_MFD_WM8350_I2C is not set 1165# CONFIG_MFD_WM8350_I2C is not set
1054# CONFIG_MFD_PCF50633 is not set 1166# CONFIG_MFD_PCF50633 is not set
1167# CONFIG_AB3100_CORE is not set
1055# CONFIG_REGULATOR is not set 1168# CONFIG_REGULATOR is not set
1056 1169# CONFIG_MEDIA_SUPPORT is not set
1057#
1058# Multimedia devices
1059#
1060
1061#
1062# Multimedia core support
1063#
1064# CONFIG_VIDEO_DEV is not set
1065# CONFIG_DVB_CORE is not set
1066# CONFIG_VIDEO_MEDIA is not set
1067
1068#
1069# Multimedia drivers
1070#
1071CONFIG_DAB=y
1072# CONFIG_USB_DABUSB is not set
1073 1170
1074# 1171#
1075# Graphics support 1172# Graphics support
@@ -1114,7 +1211,7 @@ CONFIG_HID_BELKIN=y
1114CONFIG_HID_CHERRY=y 1211CONFIG_HID_CHERRY=y
1115CONFIG_HID_CHICONY=y 1212CONFIG_HID_CHICONY=y
1116CONFIG_HID_CYPRESS=y 1213CONFIG_HID_CYPRESS=y
1117# CONFIG_DRAGONRISE_FF is not set 1214# CONFIG_HID_DRAGONRISE is not set
1118CONFIG_HID_EZKEY=y 1215CONFIG_HID_EZKEY=y
1119# CONFIG_HID_KYE is not set 1216# CONFIG_HID_KYE is not set
1120CONFIG_HID_GYRATION=y 1217CONFIG_HID_GYRATION=y
@@ -1131,10 +1228,11 @@ CONFIG_HID_PETALYNX=y
1131CONFIG_HID_SAMSUNG=y 1228CONFIG_HID_SAMSUNG=y
1132CONFIG_HID_SONY=y 1229CONFIG_HID_SONY=y
1133CONFIG_HID_SUNPLUS=y 1230CONFIG_HID_SUNPLUS=y
1134# CONFIG_GREENASIA_FF is not set 1231# CONFIG_HID_GREENASIA is not set
1232# CONFIG_HID_SMARTJOYPLUS is not set
1135# CONFIG_HID_TOPSEED is not set 1233# CONFIG_HID_TOPSEED is not set
1136# CONFIG_THRUSTMASTER_FF is not set 1234# CONFIG_HID_THRUSTMASTER is not set
1137# CONFIG_ZEROPLUS_FF is not set 1235# CONFIG_HID_ZEROPLUS is not set
1138CONFIG_USB_SUPPORT=y 1236CONFIG_USB_SUPPORT=y
1139CONFIG_USB_ARCH_HAS_HCD=y 1237CONFIG_USB_ARCH_HAS_HCD=y
1140CONFIG_USB_ARCH_HAS_OHCI=y 1238CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1160,6 +1258,7 @@ CONFIG_USB=y
1160# USB Host Controller Drivers 1258# USB Host Controller Drivers
1161# 1259#
1162# CONFIG_USB_C67X00_HCD is not set 1260# CONFIG_USB_C67X00_HCD is not set
1261# CONFIG_USB_XHCI_HCD is not set
1163CONFIG_USB_EHCI_HCD=y 1262CONFIG_USB_EHCI_HCD=y
1164# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1263# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1165# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1264# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1169,6 +1268,8 @@ CONFIG_USB_EHCI_HCD=y
1169# CONFIG_USB_ISP116X_HCD is not set 1268# CONFIG_USB_ISP116X_HCD is not set
1170# CONFIG_USB_ISP1760_HCD is not set 1269# CONFIG_USB_ISP1760_HCD is not set
1171CONFIG_USB_OHCI_HCD=y 1270CONFIG_USB_OHCI_HCD=y
1271# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1272# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1172# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1273# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1173# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1274# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1174# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1275# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1288,6 +1389,7 @@ CONFIG_RTC_INTF_DEV=y
1288# CONFIG_RTC_DRV_S35390A is not set 1389# CONFIG_RTC_DRV_S35390A is not set
1289# CONFIG_RTC_DRV_FM3130 is not set 1390# CONFIG_RTC_DRV_FM3130 is not set
1290CONFIG_RTC_DRV_RX8581=y 1391CONFIG_RTC_DRV_RX8581=y
1392# CONFIG_RTC_DRV_RX8025 is not set
1291 1393
1292# 1394#
1293# SPI RTC drivers 1395# SPI RTC drivers
@@ -1315,6 +1417,10 @@ CONFIG_RTC_DRV_RX8581=y
1315# CONFIG_DMADEVICES is not set 1417# CONFIG_DMADEVICES is not set
1316# CONFIG_AUXDISPLAY is not set 1418# CONFIG_AUXDISPLAY is not set
1317# CONFIG_UIO is not set 1419# CONFIG_UIO is not set
1420
1421#
1422# TI VLYNQ
1423#
1318# CONFIG_STAGING is not set 1424# CONFIG_STAGING is not set
1319 1425
1320# 1426#
@@ -1336,10 +1442,12 @@ CONFIG_FS_MBCACHE=y
1336# CONFIG_REISERFS_FS is not set 1442# CONFIG_REISERFS_FS is not set
1337# CONFIG_JFS_FS is not set 1443# CONFIG_JFS_FS is not set
1338CONFIG_FS_POSIX_ACL=y 1444CONFIG_FS_POSIX_ACL=y
1339CONFIG_FILE_LOCKING=y
1340# CONFIG_XFS_FS is not set 1445# CONFIG_XFS_FS is not set
1446# CONFIG_GFS2_FS is not set
1341# CONFIG_OCFS2_FS is not set 1447# CONFIG_OCFS2_FS is not set
1342# CONFIG_BTRFS_FS is not set 1448# CONFIG_BTRFS_FS is not set
1449CONFIG_FILE_LOCKING=y
1450CONFIG_FSNOTIFY=y
1343CONFIG_DNOTIFY=y 1451CONFIG_DNOTIFY=y
1344CONFIG_INOTIFY=y 1452CONFIG_INOTIFY=y
1345CONFIG_INOTIFY_USER=y 1453CONFIG_INOTIFY_USER=y
@@ -1419,6 +1527,7 @@ CONFIG_NFS_FS=y
1419CONFIG_NFS_V3=y 1527CONFIG_NFS_V3=y
1420# CONFIG_NFS_V3_ACL is not set 1528# CONFIG_NFS_V3_ACL is not set
1421CONFIG_NFS_V4=y 1529CONFIG_NFS_V4=y
1530# CONFIG_NFS_V4_1 is not set
1422CONFIG_ROOT_NFS=y 1531CONFIG_ROOT_NFS=y
1423# CONFIG_NFSD is not set 1532# CONFIG_NFSD is not set
1424CONFIG_LOCKD=y 1533CONFIG_LOCKD=y
@@ -1508,6 +1617,7 @@ CONFIG_HAS_IOPORT=y
1508CONFIG_HAS_DMA=y 1617CONFIG_HAS_DMA=y
1509CONFIG_HAVE_LMB=y 1618CONFIG_HAVE_LMB=y
1510CONFIG_NLATTR=y 1619CONFIG_NLATTR=y
1620CONFIG_GENERIC_ATOMIC64=y
1511 1621
1512# 1622#
1513# Kernel hacking 1623# Kernel hacking
@@ -1531,23 +1641,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1531CONFIG_HAVE_DYNAMIC_FTRACE=y 1641CONFIG_HAVE_DYNAMIC_FTRACE=y
1532CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1642CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1533CONFIG_TRACING_SUPPORT=y 1643CONFIG_TRACING_SUPPORT=y
1534 1644# CONFIG_FTRACE is not set
1535#
1536# Tracers
1537#
1538# CONFIG_FUNCTION_TRACER is not set
1539# CONFIG_PREEMPT_TRACER is not set
1540# CONFIG_SCHED_TRACER is not set
1541# CONFIG_CONTEXT_SWITCH_TRACER is not set
1542# CONFIG_EVENT_TRACER is not set
1543# CONFIG_BOOT_TRACER is not set
1544# CONFIG_TRACE_BRANCH_PROFILING is not set
1545# CONFIG_STACK_TRACER is not set
1546# CONFIG_KMEMTRACE is not set
1547# CONFIG_WORKQUEUE_TRACER is not set
1548# CONFIG_BLK_DEV_IO_TRACE is not set
1549# CONFIG_SAMPLES is not set 1645# CONFIG_SAMPLES is not set
1550CONFIG_HAVE_ARCH_KGDB=y 1646CONFIG_HAVE_ARCH_KGDB=y
1647# CONFIG_PPC_DISABLE_WERROR is not set
1648CONFIG_PPC_WERROR=y
1551CONFIG_PRINT_STACK_DEPTH=64 1649CONFIG_PRINT_STACK_DEPTH=64
1552# CONFIG_IRQSTACKS is not set 1650# CONFIG_IRQSTACKS is not set
1553# CONFIG_BOOTX_TEXT is not set 1651# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index c6a7fc82b69a..ba47883f4aa0 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:30 2009 4# Wed Jul 29 23:32:30 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -56,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
56CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
57CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
58CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
59CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
60# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -114,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115# CONFIG_KALLSYMS_ALL is not set 120# CONFIG_KALLSYMS_ALL is not set
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 121# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,8 +131,15 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
142# CONFIG_STRIP_ASM_SYMS is not set
132CONFIG_COMPAT_BRK=y 143CONFIG_COMPAT_BRK=y
133CONFIG_SLAB=y 144CONFIG_SLAB=y
134# CONFIG_SLUB is not set 145# CONFIG_SLUB is not set
@@ -143,6 +154,10 @@ CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
145CONFIG_USE_GENERIC_SMP_HELPERS=y 156CONFIG_USE_GENERIC_SMP_HELPERS=y
157
158#
159# GCOV-based kernel profiling
160#
146# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -156,7 +171,7 @@ CONFIG_MODULE_UNLOAD=y
156# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_STOP_MACHINE=y 172CONFIG_STOP_MACHINE=y
158CONFIG_BLOCK=y 173CONFIG_BLOCK=y
159# CONFIG_LBD is not set 174CONFIG_LBDAF=y
160# CONFIG_BLK_DEV_BSG is not set 175# CONFIG_BLK_DEV_BSG is not set
161# CONFIG_BLK_DEV_INTEGRITY is not set 176# CONFIG_BLK_DEV_INTEGRITY is not set
162 177
@@ -235,6 +250,7 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
236CONFIG_BINFMT_MISC=m 251CONFIG_BINFMT_MISC=m
237# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -256,9 +272,9 @@ CONFIG_MIGRATION=y
256CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
257CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
259CONFIG_UNEVICTABLE_LRU=y
260CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
264# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -285,6 +301,8 @@ CONFIG_PCI_DOMAINS=y
285CONFIG_PCI_SYSCALL=y 301CONFIG_PCI_SYSCALL=y
286CONFIG_PCIEPORTBUS=y 302CONFIG_PCIEPORTBUS=y
287CONFIG_PCIEAER=y 303CONFIG_PCIEAER=y
304# CONFIG_PCIE_ECRC is not set
305# CONFIG_PCIEAER_INJECT is not set
288# CONFIG_PCIEASPM is not set 306# CONFIG_PCIEASPM is not set
289CONFIG_ARCH_SUPPORTS_MSI=y 307CONFIG_ARCH_SUPPORTS_MSI=y
290# CONFIG_PCI_MSI is not set 308# CONFIG_PCI_MSI is not set
@@ -510,6 +528,7 @@ CONFIG_LLC=m
510# CONFIG_ECONET is not set 528# CONFIG_ECONET is not set
511CONFIG_WAN_ROUTER=m 529CONFIG_WAN_ROUTER=m
512# CONFIG_PHONET is not set 530# CONFIG_PHONET is not set
531# CONFIG_IEEE802154 is not set
513CONFIG_NET_SCHED=y 532CONFIG_NET_SCHED=y
514 533
515# 534#
@@ -566,7 +585,11 @@ CONFIG_WIRELESS=y
566CONFIG_WIRELESS_OLD_REGULATORY=y 585CONFIG_WIRELESS_OLD_REGULATORY=y
567# CONFIG_WIRELESS_EXT is not set 586# CONFIG_WIRELESS_EXT is not set
568# CONFIG_LIB80211 is not set 587# CONFIG_LIB80211 is not set
569# CONFIG_MAC80211 is not set 588
589#
590# CFG80211 needs to be enabled for MAC80211
591#
592CONFIG_MAC80211_DEFAULT_PS_VALUE=0
570# CONFIG_WIMAX is not set 593# CONFIG_WIMAX is not set
571# CONFIG_RFKILL is not set 594# CONFIG_RFKILL is not set
572# CONFIG_NET_9P is not set 595# CONFIG_NET_9P is not set
@@ -678,6 +701,7 @@ CONFIG_MTD_PHYSMAP_OF=y
678CONFIG_OF_DEVICE=y 701CONFIG_OF_DEVICE=y
679CONFIG_OF_GPIO=y 702CONFIG_OF_GPIO=y
680CONFIG_OF_I2C=y 703CONFIG_OF_I2C=y
704CONFIG_OF_MDIO=y
681# CONFIG_PARPORT is not set 705# CONFIG_PARPORT is not set
682CONFIG_BLK_DEV=y 706CONFIG_BLK_DEV=y
683# CONFIG_BLK_DEV_FD is not set 707# CONFIG_BLK_DEV_FD is not set
@@ -713,7 +737,9 @@ CONFIG_MISC_DEVICES=y
713# 737#
714# CONFIG_EEPROM_AT24 is not set 738# CONFIG_EEPROM_AT24 is not set
715# CONFIG_EEPROM_LEGACY is not set 739# CONFIG_EEPROM_LEGACY is not set
740# CONFIG_EEPROM_MAX6875 is not set
716# CONFIG_EEPROM_93CX6 is not set 741# CONFIG_EEPROM_93CX6 is not set
742# CONFIG_CB710_CORE is not set
717CONFIG_HAVE_IDE=y 743CONFIG_HAVE_IDE=y
718# CONFIG_IDE is not set 744# CONFIG_IDE is not set
719 745
@@ -737,10 +763,6 @@ CONFIG_BLK_DEV_SR=y
737# CONFIG_BLK_DEV_SR_VENDOR is not set 763# CONFIG_BLK_DEV_SR_VENDOR is not set
738# CONFIG_CHR_DEV_SG is not set 764# CONFIG_CHR_DEV_SG is not set
739# CONFIG_CHR_DEV_SCH is not set 765# CONFIG_CHR_DEV_SCH is not set
740
741#
742# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
743#
744# CONFIG_SCSI_MULTI_LUN is not set 766# CONFIG_SCSI_MULTI_LUN is not set
745# CONFIG_SCSI_CONSTANTS is not set 767# CONFIG_SCSI_CONSTANTS is not set
746# CONFIG_SCSI_LOGGING is not set 768# CONFIG_SCSI_LOGGING is not set
@@ -757,6 +779,7 @@ CONFIG_SCSI_WAIT_SCAN=m
757# CONFIG_SCSI_SRP_ATTRS is not set 779# CONFIG_SCSI_SRP_ATTRS is not set
758CONFIG_SCSI_LOWLEVEL=y 780CONFIG_SCSI_LOWLEVEL=y
759# CONFIG_ISCSI_TCP is not set 781# CONFIG_ISCSI_TCP is not set
782# CONFIG_SCSI_BNX2_ISCSI is not set
760# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 783# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
761# CONFIG_SCSI_3W_9XXX is not set 784# CONFIG_SCSI_3W_9XXX is not set
762# CONFIG_SCSI_ACARD is not set 785# CONFIG_SCSI_ACARD is not set
@@ -765,6 +788,7 @@ CONFIG_SCSI_LOWLEVEL=y
765# CONFIG_SCSI_AIC7XXX_OLD is not set 788# CONFIG_SCSI_AIC7XXX_OLD is not set
766# CONFIG_SCSI_AIC79XX is not set 789# CONFIG_SCSI_AIC79XX is not set
767# CONFIG_SCSI_AIC94XX is not set 790# CONFIG_SCSI_AIC94XX is not set
791# CONFIG_SCSI_MVSAS is not set
768# CONFIG_SCSI_DPT_I2O is not set 792# CONFIG_SCSI_DPT_I2O is not set
769# CONFIG_SCSI_ADVANSYS is not set 793# CONFIG_SCSI_ADVANSYS is not set
770# CONFIG_SCSI_ARCMSR is not set 794# CONFIG_SCSI_ARCMSR is not set
@@ -784,7 +808,6 @@ CONFIG_SCSI_LOWLEVEL=y
784# CONFIG_SCSI_IPS is not set 808# CONFIG_SCSI_IPS is not set
785# CONFIG_SCSI_INITIO is not set 809# CONFIG_SCSI_INITIO is not set
786# CONFIG_SCSI_INIA100 is not set 810# CONFIG_SCSI_INIA100 is not set
787# CONFIG_SCSI_MVSAS is not set
788# CONFIG_SCSI_STEX is not set 811# CONFIG_SCSI_STEX is not set
789# CONFIG_SCSI_SYM53C8XX_2 is not set 812# CONFIG_SCSI_SYM53C8XX_2 is not set
790# CONFIG_SCSI_IPR is not set 813# CONFIG_SCSI_IPR is not set
@@ -868,14 +891,17 @@ CONFIG_SATA_SIL=y
868# 891#
869 892
870# 893#
871# Enable only one of the two stacks, unless you know what you are doing 894# You can enable one or both FireWire driver stacks.
895#
896
897#
898# See the help texts for more information.
872# 899#
873# CONFIG_FIREWIRE is not set 900# CONFIG_FIREWIRE is not set
874# CONFIG_IEEE1394 is not set 901# CONFIG_IEEE1394 is not set
875# CONFIG_I2O is not set 902# CONFIG_I2O is not set
876# CONFIG_MACINTOSH_DRIVERS is not set 903# CONFIG_MACINTOSH_DRIVERS is not set
877CONFIG_NETDEVICES=y 904CONFIG_NETDEVICES=y
878CONFIG_COMPAT_NET_DEV_OPS=y
879CONFIG_DUMMY=m 905CONFIG_DUMMY=m
880CONFIG_BONDING=m 906CONFIG_BONDING=m
881# CONFIG_MACVLAN is not set 907# CONFIG_MACVLAN is not set
@@ -922,6 +948,7 @@ CONFIG_MII=y
922# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 948# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
923# CONFIG_NET_PCI is not set 949# CONFIG_NET_PCI is not set
924# CONFIG_B44 is not set 950# CONFIG_B44 is not set
951# CONFIG_KS8842 is not set
925# CONFIG_ATL2 is not set 952# CONFIG_ATL2 is not set
926CONFIG_NETDEV_1000=y 953CONFIG_NETDEV_1000=y
927# CONFIG_ACENIC is not set 954# CONFIG_ACENIC is not set
@@ -941,8 +968,10 @@ CONFIG_NETDEV_1000=y
941# CONFIG_VIA_VELOCITY is not set 968# CONFIG_VIA_VELOCITY is not set
942# CONFIG_TIGON3 is not set 969# CONFIG_TIGON3 is not set
943# CONFIG_BNX2 is not set 970# CONFIG_BNX2 is not set
971# CONFIG_CNIC is not set
944CONFIG_FSL_PQ_MDIO=y 972CONFIG_FSL_PQ_MDIO=y
945CONFIG_GIANFAR=y 973CONFIG_GIANFAR=y
974# CONFIG_MV643XX_ETH is not set
946# CONFIG_QLA3XXX is not set 975# CONFIG_QLA3XXX is not set
947# CONFIG_ATL1 is not set 976# CONFIG_ATL1 is not set
948# CONFIG_ATL1E is not set 977# CONFIG_ATL1E is not set
@@ -1149,13 +1178,17 @@ CONFIG_DS1682=y
1149# CONFIG_SENSORS_PCF8574 is not set 1178# CONFIG_SENSORS_PCF8574 is not set
1150# CONFIG_PCF8575 is not set 1179# CONFIG_PCF8575 is not set
1151# CONFIG_SENSORS_PCA9539 is not set 1180# CONFIG_SENSORS_PCA9539 is not set
1152# CONFIG_SENSORS_MAX6875 is not set
1153# CONFIG_SENSORS_TSL2550 is not set 1181# CONFIG_SENSORS_TSL2550 is not set
1154# CONFIG_I2C_DEBUG_CORE is not set 1182# CONFIG_I2C_DEBUG_CORE is not set
1155# CONFIG_I2C_DEBUG_ALGO is not set 1183# CONFIG_I2C_DEBUG_ALGO is not set
1156# CONFIG_I2C_DEBUG_BUS is not set 1184# CONFIG_I2C_DEBUG_BUS is not set
1157# CONFIG_I2C_DEBUG_CHIP is not set 1185# CONFIG_I2C_DEBUG_CHIP is not set
1158# CONFIG_SPI is not set 1186# CONFIG_SPI is not set
1187
1188#
1189# PPS support
1190#
1191# CONFIG_PPS is not set
1159CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1192CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1160CONFIG_ARCH_REQUIRE_GPIOLIB=y 1193CONFIG_ARCH_REQUIRE_GPIOLIB=y
1161CONFIG_GPIOLIB=y 1194CONFIG_GPIOLIB=y
@@ -1235,6 +1268,7 @@ CONFIG_SENSORS_LM92=y
1235# CONFIG_SENSORS_SMSC47B397 is not set 1268# CONFIG_SENSORS_SMSC47B397 is not set
1236# CONFIG_SENSORS_ADS7828 is not set 1269# CONFIG_SENSORS_ADS7828 is not set
1237# CONFIG_SENSORS_THMC50 is not set 1270# CONFIG_SENSORS_THMC50 is not set
1271# CONFIG_SENSORS_TMP401 is not set
1238# CONFIG_SENSORS_VIA686A is not set 1272# CONFIG_SENSORS_VIA686A is not set
1239# CONFIG_SENSORS_VT1211 is not set 1273# CONFIG_SENSORS_VT1211 is not set
1240# CONFIG_SENSORS_VT8231 is not set 1274# CONFIG_SENSORS_VT8231 is not set
@@ -1290,24 +1324,9 @@ CONFIG_SSB_POSSIBLE=y
1290# CONFIG_MFD_WM8400 is not set 1324# CONFIG_MFD_WM8400 is not set
1291# CONFIG_MFD_WM8350_I2C is not set 1325# CONFIG_MFD_WM8350_I2C is not set
1292# CONFIG_MFD_PCF50633 is not set 1326# CONFIG_MFD_PCF50633 is not set
1327# CONFIG_AB3100_CORE is not set
1293# CONFIG_REGULATOR is not set 1328# CONFIG_REGULATOR is not set
1294 1329# CONFIG_MEDIA_SUPPORT is not set
1295#
1296# Multimedia devices
1297#
1298
1299#
1300# Multimedia core support
1301#
1302# CONFIG_VIDEO_DEV is not set
1303# CONFIG_DVB_CORE is not set
1304# CONFIG_VIDEO_MEDIA is not set
1305
1306#
1307# Multimedia drivers
1308#
1309CONFIG_DAB=y
1310# CONFIG_USB_DABUSB is not set
1311 1330
1312# 1331#
1313# Graphics support 1332# Graphics support
@@ -1352,7 +1371,7 @@ CONFIG_HID_BELKIN=y
1352CONFIG_HID_CHERRY=y 1371CONFIG_HID_CHERRY=y
1353CONFIG_HID_CHICONY=y 1372CONFIG_HID_CHICONY=y
1354CONFIG_HID_CYPRESS=y 1373CONFIG_HID_CYPRESS=y
1355# CONFIG_DRAGONRISE_FF is not set 1374# CONFIG_HID_DRAGONRISE is not set
1356CONFIG_HID_EZKEY=y 1375CONFIG_HID_EZKEY=y
1357# CONFIG_HID_KYE is not set 1376# CONFIG_HID_KYE is not set
1358CONFIG_HID_GYRATION=y 1377CONFIG_HID_GYRATION=y
@@ -1369,10 +1388,11 @@ CONFIG_HID_PETALYNX=y
1369CONFIG_HID_SAMSUNG=y 1388CONFIG_HID_SAMSUNG=y
1370CONFIG_HID_SONY=y 1389CONFIG_HID_SONY=y
1371CONFIG_HID_SUNPLUS=y 1390CONFIG_HID_SUNPLUS=y
1372# CONFIG_GREENASIA_FF is not set 1391# CONFIG_HID_GREENASIA is not set
1392# CONFIG_HID_SMARTJOYPLUS is not set
1373# CONFIG_HID_TOPSEED is not set 1393# CONFIG_HID_TOPSEED is not set
1374CONFIG_THRUSTMASTER_FF=m 1394# CONFIG_HID_THRUSTMASTER is not set
1375CONFIG_ZEROPLUS_FF=m 1395# CONFIG_HID_ZEROPLUS is not set
1376CONFIG_USB_SUPPORT=y 1396CONFIG_USB_SUPPORT=y
1377CONFIG_USB_ARCH_HAS_HCD=y 1397CONFIG_USB_ARCH_HAS_HCD=y
1378CONFIG_USB_ARCH_HAS_OHCI=y 1398CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1398,6 +1418,7 @@ CONFIG_USB=y
1398# USB Host Controller Drivers 1418# USB Host Controller Drivers
1399# 1419#
1400# CONFIG_USB_C67X00_HCD is not set 1420# CONFIG_USB_C67X00_HCD is not set
1421# CONFIG_USB_XHCI_HCD is not set
1401CONFIG_USB_EHCI_HCD=y 1422CONFIG_USB_EHCI_HCD=y
1402# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1423# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1403# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1424# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1407,6 +1428,8 @@ CONFIG_USB_EHCI_HCD=y
1407# CONFIG_USB_ISP116X_HCD is not set 1428# CONFIG_USB_ISP116X_HCD is not set
1408# CONFIG_USB_ISP1760_HCD is not set 1429# CONFIG_USB_ISP1760_HCD is not set
1409CONFIG_USB_OHCI_HCD=y 1430CONFIG_USB_OHCI_HCD=y
1431# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1432# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1410# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1433# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1411# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1434# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1412# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1435# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1527,6 +1550,7 @@ CONFIG_RTC_INTF_DEV=y
1527# CONFIG_RTC_DRV_S35390A is not set 1550# CONFIG_RTC_DRV_S35390A is not set
1528# CONFIG_RTC_DRV_FM3130 is not set 1551# CONFIG_RTC_DRV_FM3130 is not set
1529CONFIG_RTC_DRV_RX8581=y 1552CONFIG_RTC_DRV_RX8581=y
1553# CONFIG_RTC_DRV_RX8025 is not set
1530 1554
1531# 1555#
1532# SPI RTC drivers 1556# SPI RTC drivers
@@ -1554,6 +1578,10 @@ CONFIG_RTC_DRV_RX8581=y
1554# CONFIG_DMADEVICES is not set 1578# CONFIG_DMADEVICES is not set
1555# CONFIG_AUXDISPLAY is not set 1579# CONFIG_AUXDISPLAY is not set
1556# CONFIG_UIO is not set 1580# CONFIG_UIO is not set
1581
1582#
1583# TI VLYNQ
1584#
1557# CONFIG_STAGING is not set 1585# CONFIG_STAGING is not set
1558 1586
1559# 1587#
@@ -1575,10 +1603,12 @@ CONFIG_FS_MBCACHE=y
1575# CONFIG_REISERFS_FS is not set 1603# CONFIG_REISERFS_FS is not set
1576# CONFIG_JFS_FS is not set 1604# CONFIG_JFS_FS is not set
1577CONFIG_FS_POSIX_ACL=y 1605CONFIG_FS_POSIX_ACL=y
1578CONFIG_FILE_LOCKING=y
1579# CONFIG_XFS_FS is not set 1606# CONFIG_XFS_FS is not set
1607# CONFIG_GFS2_FS is not set
1580# CONFIG_OCFS2_FS is not set 1608# CONFIG_OCFS2_FS is not set
1581# CONFIG_BTRFS_FS is not set 1609# CONFIG_BTRFS_FS is not set
1610CONFIG_FILE_LOCKING=y
1611CONFIG_FSNOTIFY=y
1582CONFIG_DNOTIFY=y 1612CONFIG_DNOTIFY=y
1583CONFIG_INOTIFY=y 1613CONFIG_INOTIFY=y
1584CONFIG_INOTIFY_USER=y 1614CONFIG_INOTIFY_USER=y
@@ -1645,6 +1675,7 @@ CONFIG_NFS_FS=y
1645CONFIG_NFS_V3=y 1675CONFIG_NFS_V3=y
1646# CONFIG_NFS_V3_ACL is not set 1676# CONFIG_NFS_V3_ACL is not set
1647CONFIG_NFS_V4=y 1677CONFIG_NFS_V4=y
1678# CONFIG_NFS_V4_1 is not set
1648CONFIG_ROOT_NFS=y 1679CONFIG_ROOT_NFS=y
1649# CONFIG_NFSD is not set 1680# CONFIG_NFSD is not set
1650CONFIG_LOCKD=y 1681CONFIG_LOCKD=y
@@ -1734,6 +1765,7 @@ CONFIG_HAS_IOPORT=y
1734CONFIG_HAS_DMA=y 1765CONFIG_HAS_DMA=y
1735CONFIG_HAVE_LMB=y 1766CONFIG_HAVE_LMB=y
1736CONFIG_NLATTR=y 1767CONFIG_NLATTR=y
1768CONFIG_GENERIC_ATOMIC64=y
1737 1769
1738# 1770#
1739# Kernel hacking 1771# Kernel hacking
@@ -1759,10 +1791,14 @@ CONFIG_SCHED_DEBUG=y
1759# CONFIG_TIMER_STATS is not set 1791# CONFIG_TIMER_STATS is not set
1760# CONFIG_DEBUG_OBJECTS is not set 1792# CONFIG_DEBUG_OBJECTS is not set
1761# CONFIG_DEBUG_SLAB is not set 1793# CONFIG_DEBUG_SLAB is not set
1794CONFIG_DEBUG_PREEMPT=y
1762# CONFIG_DEBUG_RT_MUTEXES is not set 1795# CONFIG_DEBUG_RT_MUTEXES is not set
1763# CONFIG_RT_MUTEX_TESTER is not set 1796# CONFIG_RT_MUTEX_TESTER is not set
1764# CONFIG_DEBUG_SPINLOCK is not set 1797# CONFIG_DEBUG_SPINLOCK is not set
1765# CONFIG_DEBUG_MUTEXES is not set 1798# CONFIG_DEBUG_MUTEXES is not set
1799# CONFIG_DEBUG_LOCK_ALLOC is not set
1800# CONFIG_PROVE_LOCKING is not set
1801# CONFIG_LOCK_STAT is not set
1766# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1802# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1767# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1803# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1768# CONFIG_DEBUG_KOBJECT is not set 1804# CONFIG_DEBUG_KOBJECT is not set
@@ -1774,7 +1810,6 @@ CONFIG_DEBUG_INFO=y
1774# CONFIG_DEBUG_LIST is not set 1810# CONFIG_DEBUG_LIST is not set
1775# CONFIG_DEBUG_SG is not set 1811# CONFIG_DEBUG_SG is not set
1776# CONFIG_DEBUG_NOTIFIERS is not set 1812# CONFIG_DEBUG_NOTIFIERS is not set
1777# CONFIG_BOOT_PRINTK_DELAY is not set
1778# CONFIG_RCU_TORTURE_TEST is not set 1813# CONFIG_RCU_TORTURE_TEST is not set
1779# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1814# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1780# CONFIG_BACKTRACE_SELF_TEST is not set 1815# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1788,17 +1823,16 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1788CONFIG_HAVE_DYNAMIC_FTRACE=y 1823CONFIG_HAVE_DYNAMIC_FTRACE=y
1789CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1824CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1790CONFIG_TRACING_SUPPORT=y 1825CONFIG_TRACING_SUPPORT=y
1791 1826CONFIG_FTRACE=y
1792#
1793# Tracers
1794#
1795# CONFIG_FUNCTION_TRACER is not set 1827# CONFIG_FUNCTION_TRACER is not set
1828# CONFIG_IRQSOFF_TRACER is not set
1796# CONFIG_PREEMPT_TRACER is not set 1829# CONFIG_PREEMPT_TRACER is not set
1797# CONFIG_SCHED_TRACER is not set 1830# CONFIG_SCHED_TRACER is not set
1798# CONFIG_CONTEXT_SWITCH_TRACER is not set 1831# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1799# CONFIG_EVENT_TRACER is not set
1800# CONFIG_BOOT_TRACER is not set 1832# CONFIG_BOOT_TRACER is not set
1801# CONFIG_TRACE_BRANCH_PROFILING is not set 1833CONFIG_BRANCH_PROFILE_NONE=y
1834# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1835# CONFIG_PROFILE_ALL_BRANCHES is not set
1802# CONFIG_STACK_TRACER is not set 1836# CONFIG_STACK_TRACER is not set
1803# CONFIG_KMEMTRACE is not set 1837# CONFIG_KMEMTRACE is not set
1804# CONFIG_WORKQUEUE_TRACER is not set 1838# CONFIG_WORKQUEUE_TRACER is not set
@@ -1806,6 +1840,9 @@ CONFIG_TRACING_SUPPORT=y
1806# CONFIG_SAMPLES is not set 1840# CONFIG_SAMPLES is not set
1807CONFIG_HAVE_ARCH_KGDB=y 1841CONFIG_HAVE_ARCH_KGDB=y
1808# CONFIG_KGDB is not set 1842# CONFIG_KGDB is not set
1843# CONFIG_KMEMCHECK is not set
1844# CONFIG_PPC_DISABLE_WERROR is not set
1845CONFIG_PPC_WERROR=y
1809CONFIG_PRINT_STACK_DEPTH=64 1846CONFIG_PRINT_STACK_DEPTH=64
1810# CONFIG_DEBUG_STACKOVERFLOW is not set 1847# CONFIG_DEBUG_STACKOVERFLOW is not set
1811# CONFIG_DEBUG_STACK_USAGE is not set 1848# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1829,7 +1866,6 @@ CONFIG_SECURITY_NETWORK=y
1829# CONFIG_SECURITY_PATH is not set 1866# CONFIG_SECURITY_PATH is not set
1830# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1867# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1831# CONFIG_SECURITY_ROOTPLUG is not set 1868# CONFIG_SECURITY_ROOTPLUG is not set
1832CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1833# CONFIG_SECURITY_TOMOYO is not set 1869# CONFIG_SECURITY_TOMOYO is not set
1834CONFIG_CRYPTO=y 1870CONFIG_CRYPTO=y
1835 1871
diff --git a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
index cfd2efcc6bce..a61f183f7186 100644
--- a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:28 2009 4# Wed Jul 29 23:32:27 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 48CONFIG_PPC=y
@@ -53,11 +56,13 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -109,7 +114,6 @@ CONFIG_SYSCTL_SYSCALL=y
109CONFIG_KALLSYMS=y 114CONFIG_KALLSYMS=y
110# CONFIG_KALLSYMS_ALL is not set 115# CONFIG_KALLSYMS_ALL is not set
111CONFIG_KALLSYMS_EXTRA_PASS=y 116CONFIG_KALLSYMS_EXTRA_PASS=y
112# CONFIG_STRIP_ASM_SYMS is not set
113CONFIG_HOTPLUG=y 117CONFIG_HOTPLUG=y
114CONFIG_PRINTK=y 118CONFIG_PRINTK=y
115CONFIG_BUG=y 119CONFIG_BUG=y
@@ -122,9 +126,16 @@ CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
123CONFIG_SHMEM=y 127CONFIG_SHMEM=y
124CONFIG_AIO=y 128CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y
130
131#
132# Performance Counters
133#
134# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
130CONFIG_SLUB=y 141CONFIG_SLUB=y
@@ -138,6 +149,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152
153#
154# GCOV-based kernel profiling
155#
141# CONFIG_SLOW_WORK is not set 156# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 157# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
@@ -150,7 +165,7 @@ CONFIG_MODULE_UNLOAD=y
150# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
151# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
152CONFIG_BLOCK=y 167CONFIG_BLOCK=y
153# CONFIG_LBD is not set 168CONFIG_LBDAF=y
154# CONFIG_BLK_DEV_BSG is not set 169# CONFIG_BLK_DEV_BSG is not set
155# CONFIG_BLK_DEV_INTEGRITY is not set 170# CONFIG_BLK_DEV_INTEGRITY is not set
156 171
@@ -230,6 +245,7 @@ CONFIG_BINFMT_ELF=y
230# CONFIG_HAVE_AOUT is not set 245# CONFIG_HAVE_AOUT is not set
231# CONFIG_BINFMT_MISC is not set 246# CONFIG_BINFMT_MISC is not set
232# CONFIG_IOMMU_HELPER is not set 247# CONFIG_IOMMU_HELPER is not set
248# CONFIG_SWIOTLB is not set
233CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
234CONFIG_ARCH_HAS_WALK_MEMORY=y 250CONFIG_ARCH_HAS_WALK_MEMORY=y
235CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -250,9 +266,9 @@ CONFIG_MIGRATION=y
250CONFIG_ZONE_DMA_FLAG=1 266CONFIG_ZONE_DMA_FLAG=1
251CONFIG_BOUNCE=y 267CONFIG_BOUNCE=y
252CONFIG_VIRT_TO_BUS=y 268CONFIG_VIRT_TO_BUS=y
253CONFIG_UNEVICTABLE_LRU=y
254CONFIG_HAVE_MLOCK=y 269CONFIG_HAVE_MLOCK=y
255CONFIG_HAVE_MLOCKED_PAGE_BIT=y 270CONFIG_HAVE_MLOCKED_PAGE_BIT=y
271CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
256CONFIG_PPC_4K_PAGES=y 272CONFIG_PPC_4K_PAGES=y
257# CONFIG_PPC_16K_PAGES is not set 273# CONFIG_PPC_16K_PAGES is not set
258# CONFIG_PPC_64K_PAGES is not set 274# CONFIG_PPC_64K_PAGES is not set
@@ -279,6 +295,8 @@ CONFIG_PCI_DOMAINS=y
279CONFIG_PCI_SYSCALL=y 295CONFIG_PCI_SYSCALL=y
280CONFIG_PCIEPORTBUS=y 296CONFIG_PCIEPORTBUS=y
281CONFIG_PCIEAER=y 297CONFIG_PCIEAER=y
298# CONFIG_PCIE_ECRC is not set
299# CONFIG_PCIEAER_INJECT is not set
282# CONFIG_PCIEASPM is not set 300# CONFIG_PCIEASPM is not set
283CONFIG_ARCH_SUPPORTS_MSI=y 301CONFIG_ARCH_SUPPORTS_MSI=y
284# CONFIG_PCI_MSI is not set 302# CONFIG_PCI_MSI is not set
@@ -381,6 +399,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
381# CONFIG_ECONET is not set 399# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set 400# CONFIG_WAN_ROUTER is not set
383# CONFIG_PHONET is not set 401# CONFIG_PHONET is not set
402# CONFIG_IEEE802154 is not set
384# CONFIG_NET_SCHED is not set 403# CONFIG_NET_SCHED is not set
385# CONFIG_DCB is not set 404# CONFIG_DCB is not set
386 405
@@ -398,7 +417,11 @@ CONFIG_WIRELESS=y
398CONFIG_WIRELESS_OLD_REGULATORY=y 417CONFIG_WIRELESS_OLD_REGULATORY=y
399# CONFIG_WIRELESS_EXT is not set 418# CONFIG_WIRELESS_EXT is not set
400# CONFIG_LIB80211 is not set 419# CONFIG_LIB80211 is not set
401# CONFIG_MAC80211 is not set 420
421#
422# CFG80211 needs to be enabled for MAC80211
423#
424CONFIG_MAC80211_DEFAULT_PS_VALUE=0
402# CONFIG_WIMAX is not set 425# CONFIG_WIMAX is not set
403# CONFIG_RFKILL is not set 426# CONFIG_RFKILL is not set
404# CONFIG_NET_9P is not set 427# CONFIG_NET_9P is not set
@@ -549,7 +572,9 @@ CONFIG_MISC_DEVICES=y
549# 572#
550# CONFIG_EEPROM_AT24 is not set 573# CONFIG_EEPROM_AT24 is not set
551# CONFIG_EEPROM_LEGACY is not set 574# CONFIG_EEPROM_LEGACY is not set
575# CONFIG_EEPROM_MAX6875 is not set
552# CONFIG_EEPROM_93CX6 is not set 576# CONFIG_EEPROM_93CX6 is not set
577# CONFIG_CB710_CORE is not set
553CONFIG_HAVE_IDE=y 578CONFIG_HAVE_IDE=y
554CONFIG_IDE=y 579CONFIG_IDE=y
555 580
@@ -620,10 +645,6 @@ CONFIG_BLK_DEV_SD=y
620# CONFIG_BLK_DEV_SR is not set 645# CONFIG_BLK_DEV_SR is not set
621CONFIG_CHR_DEV_SG=y 646CONFIG_CHR_DEV_SG=y
622# CONFIG_CHR_DEV_SCH is not set 647# CONFIG_CHR_DEV_SCH is not set
623
624#
625# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
626#
627# CONFIG_SCSI_MULTI_LUN is not set 648# CONFIG_SCSI_MULTI_LUN is not set
628# CONFIG_SCSI_CONSTANTS is not set 649# CONFIG_SCSI_CONSTANTS is not set
629# CONFIG_SCSI_LOGGING is not set 650# CONFIG_SCSI_LOGGING is not set
@@ -640,6 +661,7 @@ CONFIG_SCSI_WAIT_SCAN=m
640# CONFIG_SCSI_SRP_ATTRS is not set 661# CONFIG_SCSI_SRP_ATTRS is not set
641CONFIG_SCSI_LOWLEVEL=y 662CONFIG_SCSI_LOWLEVEL=y
642# CONFIG_ISCSI_TCP is not set 663# CONFIG_ISCSI_TCP is not set
664# CONFIG_SCSI_BNX2_ISCSI is not set
643# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 665# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
644# CONFIG_SCSI_3W_9XXX is not set 666# CONFIG_SCSI_3W_9XXX is not set
645# CONFIG_SCSI_ACARD is not set 667# CONFIG_SCSI_ACARD is not set
@@ -648,6 +670,7 @@ CONFIG_SCSI_LOWLEVEL=y
648# CONFIG_SCSI_AIC7XXX_OLD is not set 670# CONFIG_SCSI_AIC7XXX_OLD is not set
649# CONFIG_SCSI_AIC79XX is not set 671# CONFIG_SCSI_AIC79XX is not set
650# CONFIG_SCSI_AIC94XX is not set 672# CONFIG_SCSI_AIC94XX is not set
673# CONFIG_SCSI_MVSAS is not set
651# CONFIG_SCSI_DPT_I2O is not set 674# CONFIG_SCSI_DPT_I2O is not set
652# CONFIG_SCSI_ADVANSYS is not set 675# CONFIG_SCSI_ADVANSYS is not set
653# CONFIG_SCSI_ARCMSR is not set 676# CONFIG_SCSI_ARCMSR is not set
@@ -667,7 +690,6 @@ CONFIG_SCSI_LOWLEVEL=y
667# CONFIG_SCSI_IPS is not set 690# CONFIG_SCSI_IPS is not set
668# CONFIG_SCSI_INITIO is not set 691# CONFIG_SCSI_INITIO is not set
669# CONFIG_SCSI_INIA100 is not set 692# CONFIG_SCSI_INIA100 is not set
670# CONFIG_SCSI_MVSAS is not set
671# CONFIG_SCSI_STEX is not set 693# CONFIG_SCSI_STEX is not set
672# CONFIG_SCSI_SYM53C8XX_2 is not set 694# CONFIG_SCSI_SYM53C8XX_2 is not set
673# CONFIG_SCSI_IPR is not set 695# CONFIG_SCSI_IPR is not set
@@ -751,14 +773,17 @@ CONFIG_PATA_ALI=y
751# 773#
752 774
753# 775#
754# Enable only one of the two stacks, unless you know what you are doing 776# You can enable one or both FireWire driver stacks.
777#
778
779#
780# See the help texts for more information.
755# 781#
756# CONFIG_FIREWIRE is not set 782# CONFIG_FIREWIRE is not set
757# CONFIG_IEEE1394 is not set 783# CONFIG_IEEE1394 is not set
758# CONFIG_I2O is not set 784# CONFIG_I2O is not set
759# CONFIG_MACINTOSH_DRIVERS is not set 785# CONFIG_MACINTOSH_DRIVERS is not set
760CONFIG_NETDEVICES=y 786CONFIG_NETDEVICES=y
761CONFIG_COMPAT_NET_DEV_OPS=y
762CONFIG_DUMMY=y 787CONFIG_DUMMY=y
763# CONFIG_BONDING is not set 788# CONFIG_BONDING is not set
764# CONFIG_MACVLAN is not set 789# CONFIG_MACVLAN is not set
@@ -792,6 +817,7 @@ CONFIG_ULI526X=y
792# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 817# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
793# CONFIG_NET_PCI is not set 818# CONFIG_NET_PCI is not set
794# CONFIG_B44 is not set 819# CONFIG_B44 is not set
820# CONFIG_KS8842 is not set
795# CONFIG_ATL2 is not set 821# CONFIG_ATL2 is not set
796# CONFIG_NETDEV_1000 is not set 822# CONFIG_NETDEV_1000 is not set
797# CONFIG_NETDEV_10000 is not set 823# CONFIG_NETDEV_10000 is not set
@@ -959,13 +985,17 @@ CONFIG_I2C_MPC=y
959# CONFIG_SENSORS_PCF8574 is not set 985# CONFIG_SENSORS_PCF8574 is not set
960# CONFIG_PCF8575 is not set 986# CONFIG_PCF8575 is not set
961# CONFIG_SENSORS_PCA9539 is not set 987# CONFIG_SENSORS_PCA9539 is not set
962# CONFIG_SENSORS_MAX6875 is not set
963# CONFIG_SENSORS_TSL2550 is not set 988# CONFIG_SENSORS_TSL2550 is not set
964# CONFIG_I2C_DEBUG_CORE is not set 989# CONFIG_I2C_DEBUG_CORE is not set
965# CONFIG_I2C_DEBUG_ALGO is not set 990# CONFIG_I2C_DEBUG_ALGO is not set
966# CONFIG_I2C_DEBUG_BUS is not set 991# CONFIG_I2C_DEBUG_BUS is not set
967# CONFIG_I2C_DEBUG_CHIP is not set 992# CONFIG_I2C_DEBUG_CHIP is not set
968# CONFIG_SPI is not set 993# CONFIG_SPI is not set
994
995#
996# PPS support
997#
998# CONFIG_PPS is not set
969CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 999CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
970# CONFIG_GPIOLIB is not set 1000# CONFIG_GPIOLIB is not set
971# CONFIG_W1 is not set 1001# CONFIG_W1 is not set
@@ -993,23 +1023,9 @@ CONFIG_SSB_POSSIBLE=y
993# CONFIG_MFD_WM8400 is not set 1023# CONFIG_MFD_WM8400 is not set
994# CONFIG_MFD_WM8350_I2C is not set 1024# CONFIG_MFD_WM8350_I2C is not set
995# CONFIG_MFD_PCF50633 is not set 1025# CONFIG_MFD_PCF50633 is not set
1026# CONFIG_AB3100_CORE is not set
996# CONFIG_REGULATOR is not set 1027# CONFIG_REGULATOR is not set
997 1028# CONFIG_MEDIA_SUPPORT is not set
998#
999# Multimedia devices
1000#
1001
1002#
1003# Multimedia core support
1004#
1005# CONFIG_VIDEO_DEV is not set
1006# CONFIG_DVB_CORE is not set
1007# CONFIG_VIDEO_MEDIA is not set
1008
1009#
1010# Multimedia drivers
1011#
1012CONFIG_DAB=y
1013 1029
1014# 1030#
1015# Graphics support 1031# Graphics support
@@ -1106,6 +1122,11 @@ CONFIG_SND_PCM_OSS_PLUGINS=y
1106CONFIG_SND_VERBOSE_PROCFS=y 1122CONFIG_SND_VERBOSE_PROCFS=y
1107# CONFIG_SND_VERBOSE_PRINTK is not set 1123# CONFIG_SND_VERBOSE_PRINTK is not set
1108# CONFIG_SND_DEBUG is not set 1124# CONFIG_SND_DEBUG is not set
1125# CONFIG_SND_RAWMIDI_SEQ is not set
1126# CONFIG_SND_OPL3_LIB_SEQ is not set
1127# CONFIG_SND_OPL4_LIB_SEQ is not set
1128# CONFIG_SND_SBAWE_SEQ is not set
1129# CONFIG_SND_EMU10K1_SEQ is not set
1109CONFIG_SND_DRIVERS=y 1130CONFIG_SND_DRIVERS=y
1110# CONFIG_SND_DUMMY is not set 1131# CONFIG_SND_DUMMY is not set
1111# CONFIG_SND_MTPAV is not set 1132# CONFIG_SND_MTPAV is not set
@@ -1130,6 +1151,7 @@ CONFIG_SND_PCI=y
1130# CONFIG_SND_CS4281 is not set 1151# CONFIG_SND_CS4281 is not set
1131# CONFIG_SND_CS46XX is not set 1152# CONFIG_SND_CS46XX is not set
1132# CONFIG_SND_CS5530 is not set 1153# CONFIG_SND_CS5530 is not set
1154# CONFIG_SND_CTXFI is not set
1133# CONFIG_SND_DARLA20 is not set 1155# CONFIG_SND_DARLA20 is not set
1134# CONFIG_SND_GINA20 is not set 1156# CONFIG_SND_GINA20 is not set
1135# CONFIG_SND_LAYLA20 is not set 1157# CONFIG_SND_LAYLA20 is not set
@@ -1160,6 +1182,7 @@ CONFIG_SND_PCI=y
1160# CONFIG_SND_INTEL8X0 is not set 1182# CONFIG_SND_INTEL8X0 is not set
1161# CONFIG_SND_INTEL8X0M is not set 1183# CONFIG_SND_INTEL8X0M is not set
1162# CONFIG_SND_KORG1212 is not set 1184# CONFIG_SND_KORG1212 is not set
1185# CONFIG_SND_LX6464ES is not set
1163# CONFIG_SND_MAESTRO3 is not set 1186# CONFIG_SND_MAESTRO3 is not set
1164# CONFIG_SND_MIXART is not set 1187# CONFIG_SND_MIXART is not set
1165# CONFIG_SND_NM256 is not set 1188# CONFIG_SND_NM256 is not set
@@ -1251,6 +1274,7 @@ CONFIG_RTC_INTF_DEV=y
1251# CONFIG_RTC_DRV_S35390A is not set 1274# CONFIG_RTC_DRV_S35390A is not set
1252# CONFIG_RTC_DRV_FM3130 is not set 1275# CONFIG_RTC_DRV_FM3130 is not set
1253# CONFIG_RTC_DRV_RX8581 is not set 1276# CONFIG_RTC_DRV_RX8581 is not set
1277# CONFIG_RTC_DRV_RX8025 is not set
1254 1278
1255# 1279#
1256# SPI RTC drivers 1280# SPI RTC drivers
@@ -1278,6 +1302,10 @@ CONFIG_RTC_DRV_CMOS=y
1278# CONFIG_DMADEVICES is not set 1302# CONFIG_DMADEVICES is not set
1279# CONFIG_AUXDISPLAY is not set 1303# CONFIG_AUXDISPLAY is not set
1280# CONFIG_UIO is not set 1304# CONFIG_UIO is not set
1305
1306#
1307# TI VLYNQ
1308#
1281# CONFIG_STAGING is not set 1309# CONFIG_STAGING is not set
1282 1310
1283# 1311#
@@ -1297,12 +1325,15 @@ CONFIG_FS_MBCACHE=y
1297# CONFIG_REISERFS_FS is not set 1325# CONFIG_REISERFS_FS is not set
1298# CONFIG_JFS_FS is not set 1326# CONFIG_JFS_FS is not set
1299# CONFIG_FS_POSIX_ACL is not set 1327# CONFIG_FS_POSIX_ACL is not set
1300CONFIG_FILE_LOCKING=y
1301# CONFIG_XFS_FS is not set 1328# CONFIG_XFS_FS is not set
1329# CONFIG_GFS2_FS is not set
1302# CONFIG_OCFS2_FS is not set 1330# CONFIG_OCFS2_FS is not set
1303# CONFIG_BTRFS_FS is not set 1331# CONFIG_BTRFS_FS is not set
1332CONFIG_FILE_LOCKING=y
1333CONFIG_FSNOTIFY=y
1304# CONFIG_DNOTIFY is not set 1334# CONFIG_DNOTIFY is not set
1305# CONFIG_INOTIFY is not set 1335# CONFIG_INOTIFY is not set
1336CONFIG_INOTIFY_USER=y
1306# CONFIG_QUOTA is not set 1337# CONFIG_QUOTA is not set
1307# CONFIG_AUTOFS_FS is not set 1338# CONFIG_AUTOFS_FS is not set
1308# CONFIG_AUTOFS4_FS is not set 1339# CONFIG_AUTOFS4_FS is not set
@@ -1464,6 +1495,7 @@ CONFIG_HAS_IOPORT=y
1464CONFIG_HAS_DMA=y 1495CONFIG_HAS_DMA=y
1465CONFIG_HAVE_LMB=y 1496CONFIG_HAVE_LMB=y
1466CONFIG_NLATTR=y 1497CONFIG_NLATTR=y
1498CONFIG_GENERIC_ATOMIC64=y
1467 1499
1468# 1500#
1469# Kernel hacking 1501# Kernel hacking
@@ -1494,6 +1526,9 @@ CONFIG_SCHED_DEBUG=y
1494# CONFIG_RT_MUTEX_TESTER is not set 1526# CONFIG_RT_MUTEX_TESTER is not set
1495# CONFIG_DEBUG_SPINLOCK is not set 1527# CONFIG_DEBUG_SPINLOCK is not set
1496# CONFIG_DEBUG_MUTEXES is not set 1528# CONFIG_DEBUG_MUTEXES is not set
1529# CONFIG_DEBUG_LOCK_ALLOC is not set
1530# CONFIG_PROVE_LOCKING is not set
1531# CONFIG_LOCK_STAT is not set
1497# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1532# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1498# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1533# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1499# CONFIG_DEBUG_KOBJECT is not set 1534# CONFIG_DEBUG_KOBJECT is not set
@@ -1506,7 +1541,6 @@ CONFIG_DEBUG_INFO=y
1506# CONFIG_DEBUG_LIST is not set 1541# CONFIG_DEBUG_LIST is not set
1507# CONFIG_DEBUG_SG is not set 1542# CONFIG_DEBUG_SG is not set
1508# CONFIG_DEBUG_NOTIFIERS is not set 1543# CONFIG_DEBUG_NOTIFIERS is not set
1509# CONFIG_BOOT_PRINTK_DELAY is not set
1510# CONFIG_RCU_TORTURE_TEST is not set 1544# CONFIG_RCU_TORTURE_TEST is not set
1511# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1545# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1512# CONFIG_BACKTRACE_SELF_TEST is not set 1546# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1520,16 +1554,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1520CONFIG_HAVE_DYNAMIC_FTRACE=y 1554CONFIG_HAVE_DYNAMIC_FTRACE=y
1521CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1555CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1522CONFIG_TRACING_SUPPORT=y 1556CONFIG_TRACING_SUPPORT=y
1523 1557CONFIG_FTRACE=y
1524#
1525# Tracers
1526#
1527# CONFIG_FUNCTION_TRACER is not set 1558# CONFIG_FUNCTION_TRACER is not set
1559# CONFIG_IRQSOFF_TRACER is not set
1528# CONFIG_SCHED_TRACER is not set 1560# CONFIG_SCHED_TRACER is not set
1529# CONFIG_CONTEXT_SWITCH_TRACER is not set 1561# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1530# CONFIG_EVENT_TRACER is not set
1531# CONFIG_BOOT_TRACER is not set 1562# CONFIG_BOOT_TRACER is not set
1532# CONFIG_TRACE_BRANCH_PROFILING is not set 1563CONFIG_BRANCH_PROFILE_NONE=y
1564# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1565# CONFIG_PROFILE_ALL_BRANCHES is not set
1533# CONFIG_STACK_TRACER is not set 1566# CONFIG_STACK_TRACER is not set
1534# CONFIG_KMEMTRACE is not set 1567# CONFIG_KMEMTRACE is not set
1535# CONFIG_WORKQUEUE_TRACER is not set 1568# CONFIG_WORKQUEUE_TRACER is not set
@@ -1537,6 +1570,9 @@ CONFIG_TRACING_SUPPORT=y
1537# CONFIG_SAMPLES is not set 1570# CONFIG_SAMPLES is not set
1538CONFIG_HAVE_ARCH_KGDB=y 1571CONFIG_HAVE_ARCH_KGDB=y
1539# CONFIG_KGDB is not set 1572# CONFIG_KGDB is not set
1573# CONFIG_KMEMCHECK is not set
1574# CONFIG_PPC_DISABLE_WERROR is not set
1575CONFIG_PPC_WERROR=y
1540CONFIG_PRINT_STACK_DEPTH=64 1576CONFIG_PRINT_STACK_DEPTH=64
1541# CONFIG_DEBUG_STACKOVERFLOW is not set 1577# CONFIG_DEBUG_STACKOVERFLOW is not set
1542# CONFIG_DEBUG_STACK_USAGE is not set 1578# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig b/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
index 0bee3e303942..7016ce732605 100644
--- a/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:28 2009 4# Wed Jul 29 23:32:28 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
46CONFIG_PPC=y 49CONFIG_PPC=y
@@ -54,11 +57,13 @@ CONFIG_PPC_UDBG_16550=y
54CONFIG_GENERIC_TBSYNC=y 57CONFIG_GENERIC_TBSYNC=y
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -113,7 +118,6 @@ CONFIG_SYSCTL_SYSCALL=y
113CONFIG_KALLSYMS=y 118CONFIG_KALLSYMS=y
114CONFIG_KALLSYMS_ALL=y 119CONFIG_KALLSYMS_ALL=y
115CONFIG_KALLSYMS_EXTRA_PASS=y 120CONFIG_KALLSYMS_EXTRA_PASS=y
116# CONFIG_STRIP_ASM_SYMS is not set
117CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
118CONFIG_PRINTK=y 122CONFIG_PRINTK=y
119CONFIG_BUG=y 123CONFIG_BUG=y
@@ -126,9 +130,16 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 131CONFIG_SHMEM=y
128CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
129CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
130CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
131CONFIG_SLUB_DEBUG=y 141CONFIG_SLUB_DEBUG=y
142# CONFIG_STRIP_ASM_SYMS is not set
132CONFIG_COMPAT_BRK=y 143CONFIG_COMPAT_BRK=y
133# CONFIG_SLAB is not set 144# CONFIG_SLAB is not set
134CONFIG_SLUB=y 145CONFIG_SLUB=y
@@ -143,6 +154,10 @@ CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
145CONFIG_USE_GENERIC_SMP_HELPERS=y 156CONFIG_USE_GENERIC_SMP_HELPERS=y
157
158#
159# GCOV-based kernel profiling
160#
146# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -156,7 +171,7 @@ CONFIG_MODVERSIONS=y
156# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_STOP_MACHINE=y 172CONFIG_STOP_MACHINE=y
158CONFIG_BLOCK=y 173CONFIG_BLOCK=y
159CONFIG_LBD=y 174CONFIG_LBDAF=y
160# CONFIG_BLK_DEV_BSG is not set 175# CONFIG_BLK_DEV_BSG is not set
161# CONFIG_BLK_DEV_INTEGRITY is not set 176# CONFIG_BLK_DEV_INTEGRITY is not set
162 177
@@ -234,7 +249,9 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 249# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
235# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
236CONFIG_BINFMT_MISC=m 251CONFIG_BINFMT_MISC=m
237# CONFIG_IOMMU_HELPER is not set 252CONFIG_IOMMU_HELPER=y
253CONFIG_SWIOTLB=y
254CONFIG_PPC_NEED_DMA_SYNC_OPS=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 256CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -256,9 +273,9 @@ CONFIG_MIGRATION=y
256CONFIG_ZONE_DMA_FLAG=1 273CONFIG_ZONE_DMA_FLAG=1
257CONFIG_BOUNCE=y 274CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
259CONFIG_UNEVICTABLE_LRU=y
260CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 279CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 280# CONFIG_PPC_16K_PAGES is not set
264# CONFIG_PPC_64K_PAGES is not set 281# CONFIG_PPC_64K_PAGES is not set
@@ -401,6 +418,7 @@ CONFIG_SCTP_HMAC_MD5=y
401# CONFIG_ECONET is not set 418# CONFIG_ECONET is not set
402# CONFIG_WAN_ROUTER is not set 419# CONFIG_WAN_ROUTER is not set
403# CONFIG_PHONET is not set 420# CONFIG_PHONET is not set
421# CONFIG_IEEE802154 is not set
404# CONFIG_NET_SCHED is not set 422# CONFIG_NET_SCHED is not set
405# CONFIG_DCB is not set 423# CONFIG_DCB is not set
406 424
@@ -419,7 +437,11 @@ CONFIG_WIRELESS=y
419CONFIG_WIRELESS_OLD_REGULATORY=y 437CONFIG_WIRELESS_OLD_REGULATORY=y
420# CONFIG_WIRELESS_EXT is not set 438# CONFIG_WIRELESS_EXT is not set
421# CONFIG_LIB80211 is not set 439# CONFIG_LIB80211 is not set
422# CONFIG_MAC80211 is not set 440
441#
442# CFG80211 needs to be enabled for MAC80211
443#
444CONFIG_MAC80211_DEFAULT_PS_VALUE=0
423# CONFIG_WIMAX is not set 445# CONFIG_WIMAX is not set
424# CONFIG_RFKILL is not set 446# CONFIG_RFKILL is not set
425# CONFIG_NET_9P is not set 447# CONFIG_NET_9P is not set
@@ -444,6 +466,7 @@ CONFIG_EXTRA_FIRMWARE=""
444# CONFIG_MTD is not set 466# CONFIG_MTD is not set
445CONFIG_OF_DEVICE=y 467CONFIG_OF_DEVICE=y
446CONFIG_OF_I2C=y 468CONFIG_OF_I2C=y
469CONFIG_OF_MDIO=y
447# CONFIG_PARPORT is not set 470# CONFIG_PARPORT is not set
448CONFIG_BLK_DEV=y 471CONFIG_BLK_DEV=y
449# CONFIG_BLK_DEV_FD is not set 472# CONFIG_BLK_DEV_FD is not set
@@ -479,7 +502,9 @@ CONFIG_MISC_DEVICES=y
479# 502#
480# CONFIG_EEPROM_AT24 is not set 503# CONFIG_EEPROM_AT24 is not set
481CONFIG_EEPROM_LEGACY=y 504CONFIG_EEPROM_LEGACY=y
505# CONFIG_EEPROM_MAX6875 is not set
482# CONFIG_EEPROM_93CX6 is not set 506# CONFIG_EEPROM_93CX6 is not set
507# CONFIG_CB710_CORE is not set
483CONFIG_HAVE_IDE=y 508CONFIG_HAVE_IDE=y
484# CONFIG_IDE is not set 509# CONFIG_IDE is not set
485 510
@@ -503,10 +528,6 @@ CONFIG_BLK_DEV_SR=y
503# CONFIG_BLK_DEV_SR_VENDOR is not set 528# CONFIG_BLK_DEV_SR_VENDOR is not set
504CONFIG_CHR_DEV_SG=y 529CONFIG_CHR_DEV_SG=y
505# CONFIG_CHR_DEV_SCH is not set 530# CONFIG_CHR_DEV_SCH is not set
506
507#
508# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
509#
510CONFIG_SCSI_MULTI_LUN=y 531CONFIG_SCSI_MULTI_LUN=y
511# CONFIG_SCSI_CONSTANTS is not set 532# CONFIG_SCSI_CONSTANTS is not set
512CONFIG_SCSI_LOGGING=y 533CONFIG_SCSI_LOGGING=y
@@ -524,6 +545,7 @@ CONFIG_SCSI_WAIT_SCAN=m
524CONFIG_SCSI_LOWLEVEL=y 545CONFIG_SCSI_LOWLEVEL=y
525# CONFIG_ISCSI_TCP is not set 546# CONFIG_ISCSI_TCP is not set
526# CONFIG_SCSI_CXGB3_ISCSI is not set 547# CONFIG_SCSI_CXGB3_ISCSI is not set
548# CONFIG_SCSI_BNX2_ISCSI is not set
527# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 549# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
528# CONFIG_SCSI_3W_9XXX is not set 550# CONFIG_SCSI_3W_9XXX is not set
529# CONFIG_SCSI_ACARD is not set 551# CONFIG_SCSI_ACARD is not set
@@ -532,6 +554,7 @@ CONFIG_SCSI_LOWLEVEL=y
532# CONFIG_SCSI_AIC7XXX_OLD is not set 554# CONFIG_SCSI_AIC7XXX_OLD is not set
533# CONFIG_SCSI_AIC79XX is not set 555# CONFIG_SCSI_AIC79XX is not set
534# CONFIG_SCSI_AIC94XX is not set 556# CONFIG_SCSI_AIC94XX is not set
557# CONFIG_SCSI_MVSAS is not set
535# CONFIG_SCSI_DPT_I2O is not set 558# CONFIG_SCSI_DPT_I2O is not set
536# CONFIG_SCSI_ADVANSYS is not set 559# CONFIG_SCSI_ADVANSYS is not set
537# CONFIG_SCSI_ARCMSR is not set 560# CONFIG_SCSI_ARCMSR is not set
@@ -551,7 +574,6 @@ CONFIG_SCSI_LOWLEVEL=y
551# CONFIG_SCSI_IPS is not set 574# CONFIG_SCSI_IPS is not set
552# CONFIG_SCSI_INITIO is not set 575# CONFIG_SCSI_INITIO is not set
553# CONFIG_SCSI_INIA100 is not set 576# CONFIG_SCSI_INIA100 is not set
554# CONFIG_SCSI_MVSAS is not set
555# CONFIG_SCSI_STEX is not set 577# CONFIG_SCSI_STEX is not set
556# CONFIG_SCSI_SYM53C8XX_2 is not set 578# CONFIG_SCSI_SYM53C8XX_2 is not set
557# CONFIG_SCSI_IPR is not set 579# CONFIG_SCSI_IPR is not set
@@ -635,14 +657,17 @@ CONFIG_PATA_ALI=y
635# 657#
636 658
637# 659#
638# Enable only one of the two stacks, unless you know what you are doing 660# You can enable one or both FireWire driver stacks.
661#
662
663#
664# See the help texts for more information.
639# 665#
640# CONFIG_FIREWIRE is not set 666# CONFIG_FIREWIRE is not set
641# CONFIG_IEEE1394 is not set 667# CONFIG_IEEE1394 is not set
642# CONFIG_I2O is not set 668# CONFIG_I2O is not set
643# CONFIG_MACINTOSH_DRIVERS is not set 669# CONFIG_MACINTOSH_DRIVERS is not set
644CONFIG_NETDEVICES=y 670CONFIG_NETDEVICES=y
645CONFIG_COMPAT_NET_DEV_OPS=y
646CONFIG_DUMMY=y 671CONFIG_DUMMY=y
647# CONFIG_BONDING is not set 672# CONFIG_BONDING is not set
648# CONFIG_MACVLAN is not set 673# CONFIG_MACVLAN is not set
@@ -689,6 +714,7 @@ CONFIG_MII=y
689# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 714# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
690# CONFIG_NET_PCI is not set 715# CONFIG_NET_PCI is not set
691# CONFIG_B44 is not set 716# CONFIG_B44 is not set
717# CONFIG_KS8842 is not set
692# CONFIG_ATL2 is not set 718# CONFIG_ATL2 is not set
693CONFIG_NETDEV_1000=y 719CONFIG_NETDEV_1000=y
694# CONFIG_ACENIC is not set 720# CONFIG_ACENIC is not set
@@ -708,8 +734,10 @@ CONFIG_NETDEV_1000=y
708# CONFIG_VIA_VELOCITY is not set 734# CONFIG_VIA_VELOCITY is not set
709# CONFIG_TIGON3 is not set 735# CONFIG_TIGON3 is not set
710# CONFIG_BNX2 is not set 736# CONFIG_BNX2 is not set
737# CONFIG_CNIC is not set
711CONFIG_FSL_PQ_MDIO=y 738CONFIG_FSL_PQ_MDIO=y
712CONFIG_GIANFAR=y 739CONFIG_GIANFAR=y
740# CONFIG_MV643XX_ETH is not set
713# CONFIG_QLA3XXX is not set 741# CONFIG_QLA3XXX is not set
714# CONFIG_ATL1 is not set 742# CONFIG_ATL1 is not set
715# CONFIG_ATL1E is not set 743# CONFIG_ATL1E is not set
@@ -909,13 +937,17 @@ CONFIG_I2C_MPC=y
909# CONFIG_SENSORS_PCF8574 is not set 937# CONFIG_SENSORS_PCF8574 is not set
910# CONFIG_PCF8575 is not set 938# CONFIG_PCF8575 is not set
911# CONFIG_SENSORS_PCA9539 is not set 939# CONFIG_SENSORS_PCA9539 is not set
912# CONFIG_SENSORS_MAX6875 is not set
913# CONFIG_SENSORS_TSL2550 is not set 940# CONFIG_SENSORS_TSL2550 is not set
914# CONFIG_I2C_DEBUG_CORE is not set 941# CONFIG_I2C_DEBUG_CORE is not set
915# CONFIG_I2C_DEBUG_ALGO is not set 942# CONFIG_I2C_DEBUG_ALGO is not set
916# CONFIG_I2C_DEBUG_BUS is not set 943# CONFIG_I2C_DEBUG_BUS is not set
917# CONFIG_I2C_DEBUG_CHIP is not set 944# CONFIG_I2C_DEBUG_CHIP is not set
918# CONFIG_SPI is not set 945# CONFIG_SPI is not set
946
947#
948# PPS support
949#
950# CONFIG_PPS is not set
919CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 951CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
920# CONFIG_GPIOLIB is not set 952# CONFIG_GPIOLIB is not set
921# CONFIG_W1 is not set 953# CONFIG_W1 is not set
@@ -943,76 +975,9 @@ CONFIG_SSB_POSSIBLE=y
943# CONFIG_MFD_WM8400 is not set 975# CONFIG_MFD_WM8400 is not set
944# CONFIG_MFD_WM8350_I2C is not set 976# CONFIG_MFD_WM8350_I2C is not set
945# CONFIG_MFD_PCF50633 is not set 977# CONFIG_MFD_PCF50633 is not set
978# CONFIG_AB3100_CORE is not set
946# CONFIG_REGULATOR is not set 979# CONFIG_REGULATOR is not set
947 980# CONFIG_MEDIA_SUPPORT is not set
948#
949# Multimedia devices
950#
951
952#
953# Multimedia core support
954#
955# CONFIG_VIDEO_DEV is not set
956CONFIG_DVB_CORE=m
957CONFIG_VIDEO_MEDIA=m
958
959#
960# Multimedia drivers
961#
962# CONFIG_MEDIA_ATTACH is not set
963CONFIG_MEDIA_TUNER=m
964# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
965CONFIG_MEDIA_TUNER_SIMPLE=m
966CONFIG_MEDIA_TUNER_TDA8290=m
967CONFIG_MEDIA_TUNER_TDA9887=m
968CONFIG_MEDIA_TUNER_TEA5761=m
969CONFIG_MEDIA_TUNER_TEA5767=m
970CONFIG_MEDIA_TUNER_MT20XX=m
971CONFIG_MEDIA_TUNER_XC2028=m
972CONFIG_MEDIA_TUNER_XC5000=m
973CONFIG_MEDIA_TUNER_MC44S803=m
974# CONFIG_DVB_DYNAMIC_MINORS is not set
975CONFIG_DVB_CAPTURE_DRIVERS=y
976
977#
978# Supported SAA7146 based PCI Adapters
979#
980# CONFIG_TTPCI_EEPROM is not set
981# CONFIG_DVB_BUDGET_CORE is not set
982
983#
984# Supported USB Adapters
985#
986# CONFIG_DVB_USB is not set
987# CONFIG_DVB_TTUSB_BUDGET is not set
988# CONFIG_DVB_TTUSB_DEC is not set
989# CONFIG_DVB_SIANO_SMS1XXX is not set
990
991#
992# Supported FlexCopII (B2C2) Adapters
993#
994# CONFIG_DVB_B2C2_FLEXCOP is not set
995
996#
997# Supported BT878 Adapters
998#
999
1000#
1001# Supported Pluto2 Adapters
1002#
1003# CONFIG_DVB_PLUTO2 is not set
1004
1005#
1006# Supported SDMC DM1105 Adapters
1007#
1008# CONFIG_DVB_DM1105 is not set
1009
1010#
1011# Supported DVB Frontends
1012#
1013# CONFIG_DVB_FE_CUSTOMISE is not set
1014CONFIG_DAB=y
1015# CONFIG_USB_DABUSB is not set
1016 981
1017# 982#
1018# Graphics support 983# Graphics support
@@ -1052,6 +1017,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1052# CONFIG_SND_VERBOSE_PRINTK is not set 1017# CONFIG_SND_VERBOSE_PRINTK is not set
1053# CONFIG_SND_DEBUG is not set 1018# CONFIG_SND_DEBUG is not set
1054CONFIG_SND_VMASTER=y 1019CONFIG_SND_VMASTER=y
1020# CONFIG_SND_RAWMIDI_SEQ is not set
1021# CONFIG_SND_OPL3_LIB_SEQ is not set
1022# CONFIG_SND_OPL4_LIB_SEQ is not set
1023# CONFIG_SND_SBAWE_SEQ is not set
1024# CONFIG_SND_EMU10K1_SEQ is not set
1055CONFIG_SND_AC97_CODEC=y 1025CONFIG_SND_AC97_CODEC=y
1056CONFIG_SND_DRIVERS=y 1026CONFIG_SND_DRIVERS=y
1057# CONFIG_SND_DUMMY is not set 1027# CONFIG_SND_DUMMY is not set
@@ -1078,6 +1048,7 @@ CONFIG_SND_PCI=y
1078# CONFIG_SND_CS4281 is not set 1048# CONFIG_SND_CS4281 is not set
1079# CONFIG_SND_CS46XX is not set 1049# CONFIG_SND_CS46XX is not set
1080# CONFIG_SND_CS5530 is not set 1050# CONFIG_SND_CS5530 is not set
1051# CONFIG_SND_CTXFI is not set
1081# CONFIG_SND_DARLA20 is not set 1052# CONFIG_SND_DARLA20 is not set
1082# CONFIG_SND_GINA20 is not set 1053# CONFIG_SND_GINA20 is not set
1083# CONFIG_SND_LAYLA20 is not set 1054# CONFIG_SND_LAYLA20 is not set
@@ -1108,6 +1079,7 @@ CONFIG_SND_PCI=y
1108CONFIG_SND_INTEL8X0=y 1079CONFIG_SND_INTEL8X0=y
1109# CONFIG_SND_INTEL8X0M is not set 1080# CONFIG_SND_INTEL8X0M is not set
1110# CONFIG_SND_KORG1212 is not set 1081# CONFIG_SND_KORG1212 is not set
1082# CONFIG_SND_LX6464ES is not set
1111# CONFIG_SND_MAESTRO3 is not set 1083# CONFIG_SND_MAESTRO3 is not set
1112# CONFIG_SND_MIXART is not set 1084# CONFIG_SND_MIXART is not set
1113# CONFIG_SND_NM256 is not set 1085# CONFIG_SND_NM256 is not set
@@ -1152,7 +1124,7 @@ CONFIG_HID_BELKIN=y
1152CONFIG_HID_CHERRY=y 1124CONFIG_HID_CHERRY=y
1153CONFIG_HID_CHICONY=y 1125CONFIG_HID_CHICONY=y
1154CONFIG_HID_CYPRESS=y 1126CONFIG_HID_CYPRESS=y
1155# CONFIG_DRAGONRISE_FF is not set 1127# CONFIG_HID_DRAGONRISE is not set
1156CONFIG_HID_EZKEY=y 1128CONFIG_HID_EZKEY=y
1157# CONFIG_HID_KYE is not set 1129# CONFIG_HID_KYE is not set
1158CONFIG_HID_GYRATION=y 1130CONFIG_HID_GYRATION=y
@@ -1169,10 +1141,11 @@ CONFIG_HID_PETALYNX=y
1169CONFIG_HID_SAMSUNG=y 1141CONFIG_HID_SAMSUNG=y
1170CONFIG_HID_SONY=y 1142CONFIG_HID_SONY=y
1171CONFIG_HID_SUNPLUS=y 1143CONFIG_HID_SUNPLUS=y
1172# CONFIG_GREENASIA_FF is not set 1144# CONFIG_HID_GREENASIA is not set
1145# CONFIG_HID_SMARTJOYPLUS is not set
1173# CONFIG_HID_TOPSEED is not set 1146# CONFIG_HID_TOPSEED is not set
1174CONFIG_THRUSTMASTER_FF=m 1147# CONFIG_HID_THRUSTMASTER is not set
1175CONFIG_ZEROPLUS_FF=m 1148# CONFIG_HID_ZEROPLUS is not set
1176CONFIG_USB_SUPPORT=y 1149CONFIG_USB_SUPPORT=y
1177CONFIG_USB_ARCH_HAS_HCD=y 1150CONFIG_USB_ARCH_HAS_HCD=y
1178CONFIG_USB_ARCH_HAS_OHCI=y 1151CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1198,6 +1171,7 @@ CONFIG_USB_MON=y
1198# USB Host Controller Drivers 1171# USB Host Controller Drivers
1199# 1172#
1200# CONFIG_USB_C67X00_HCD is not set 1173# CONFIG_USB_C67X00_HCD is not set
1174# CONFIG_USB_XHCI_HCD is not set
1201CONFIG_USB_EHCI_HCD=y 1175CONFIG_USB_EHCI_HCD=y
1202# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1176# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1203# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1177# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1207,9 +1181,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1207# CONFIG_USB_ISP116X_HCD is not set 1181# CONFIG_USB_ISP116X_HCD is not set
1208# CONFIG_USB_ISP1760_HCD is not set 1182# CONFIG_USB_ISP1760_HCD is not set
1209CONFIG_USB_OHCI_HCD=y 1183CONFIG_USB_OHCI_HCD=y
1210CONFIG_USB_OHCI_HCD_PPC_OF=y
1211CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1184CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1212CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1185CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1186CONFIG_USB_OHCI_HCD_PPC_OF=y
1213CONFIG_USB_OHCI_HCD_PCI=y 1187CONFIG_USB_OHCI_HCD_PCI=y
1214CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1188CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1215CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1189CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1329,6 +1303,7 @@ CONFIG_RTC_INTF_DEV=y
1329# CONFIG_RTC_DRV_S35390A is not set 1303# CONFIG_RTC_DRV_S35390A is not set
1330# CONFIG_RTC_DRV_FM3130 is not set 1304# CONFIG_RTC_DRV_FM3130 is not set
1331# CONFIG_RTC_DRV_RX8581 is not set 1305# CONFIG_RTC_DRV_RX8581 is not set
1306# CONFIG_RTC_DRV_RX8025 is not set
1332 1307
1333# 1308#
1334# SPI RTC drivers 1309# SPI RTC drivers
@@ -1356,6 +1331,10 @@ CONFIG_RTC_DRV_CMOS=y
1356# CONFIG_DMADEVICES is not set 1331# CONFIG_DMADEVICES is not set
1357# CONFIG_AUXDISPLAY is not set 1332# CONFIG_AUXDISPLAY is not set
1358# CONFIG_UIO is not set 1333# CONFIG_UIO is not set
1334
1335#
1336# TI VLYNQ
1337#
1359# CONFIG_STAGING is not set 1338# CONFIG_STAGING is not set
1360 1339
1361# 1340#
@@ -1375,11 +1354,12 @@ CONFIG_FS_MBCACHE=y
1375# CONFIG_REISERFS_FS is not set 1354# CONFIG_REISERFS_FS is not set
1376# CONFIG_JFS_FS is not set 1355# CONFIG_JFS_FS is not set
1377# CONFIG_FS_POSIX_ACL is not set 1356# CONFIG_FS_POSIX_ACL is not set
1378CONFIG_FILE_LOCKING=y
1379# CONFIG_XFS_FS is not set 1357# CONFIG_XFS_FS is not set
1380# CONFIG_GFS2_FS is not set 1358# CONFIG_GFS2_FS is not set
1381# CONFIG_OCFS2_FS is not set 1359# CONFIG_OCFS2_FS is not set
1382# CONFIG_BTRFS_FS is not set 1360# CONFIG_BTRFS_FS is not set
1361CONFIG_FILE_LOCKING=y
1362CONFIG_FSNOTIFY=y
1383CONFIG_DNOTIFY=y 1363CONFIG_DNOTIFY=y
1384CONFIG_INOTIFY=y 1364CONFIG_INOTIFY=y
1385CONFIG_INOTIFY_USER=y 1365CONFIG_INOTIFY_USER=y
@@ -1454,6 +1434,7 @@ CONFIG_NFS_FS=y
1454CONFIG_NFS_V3=y 1434CONFIG_NFS_V3=y
1455# CONFIG_NFS_V3_ACL is not set 1435# CONFIG_NFS_V3_ACL is not set
1456CONFIG_NFS_V4=y 1436CONFIG_NFS_V4=y
1437# CONFIG_NFS_V4_1 is not set
1457CONFIG_ROOT_NFS=y 1438CONFIG_ROOT_NFS=y
1458CONFIG_NFSD=y 1439CONFIG_NFSD=y
1459# CONFIG_NFSD_V3 is not set 1440# CONFIG_NFSD_V3 is not set
@@ -1555,6 +1536,7 @@ CONFIG_HAS_IOPORT=y
1555CONFIG_HAS_DMA=y 1536CONFIG_HAS_DMA=y
1556CONFIG_HAVE_LMB=y 1537CONFIG_HAVE_LMB=y
1557CONFIG_NLATTR=y 1538CONFIG_NLATTR=y
1539CONFIG_GENERIC_ATOMIC64=y
1558 1540
1559# 1541#
1560# Kernel hacking 1542# Kernel hacking
@@ -1585,6 +1567,9 @@ CONFIG_SCHED_DEBUG=y
1585# CONFIG_RT_MUTEX_TESTER is not set 1567# CONFIG_RT_MUTEX_TESTER is not set
1586# CONFIG_DEBUG_SPINLOCK is not set 1568# CONFIG_DEBUG_SPINLOCK is not set
1587# CONFIG_DEBUG_MUTEXES is not set 1569# CONFIG_DEBUG_MUTEXES is not set
1570# CONFIG_DEBUG_LOCK_ALLOC is not set
1571# CONFIG_PROVE_LOCKING is not set
1572# CONFIG_LOCK_STAT is not set
1588# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1573# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1589# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1574# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1590# CONFIG_DEBUG_KOBJECT is not set 1575# CONFIG_DEBUG_KOBJECT is not set
@@ -1597,7 +1582,6 @@ CONFIG_DEBUG_INFO=y
1597# CONFIG_DEBUG_LIST is not set 1582# CONFIG_DEBUG_LIST is not set
1598# CONFIG_DEBUG_SG is not set 1583# CONFIG_DEBUG_SG is not set
1599# CONFIG_DEBUG_NOTIFIERS is not set 1584# CONFIG_DEBUG_NOTIFIERS is not set
1600# CONFIG_BOOT_PRINTK_DELAY is not set
1601# CONFIG_RCU_TORTURE_TEST is not set 1585# CONFIG_RCU_TORTURE_TEST is not set
1602# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1586# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1603# CONFIG_BACKTRACE_SELF_TEST is not set 1587# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1611,16 +1595,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1611CONFIG_HAVE_DYNAMIC_FTRACE=y 1595CONFIG_HAVE_DYNAMIC_FTRACE=y
1612CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1596CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1613CONFIG_TRACING_SUPPORT=y 1597CONFIG_TRACING_SUPPORT=y
1614 1598CONFIG_FTRACE=y
1615#
1616# Tracers
1617#
1618# CONFIG_FUNCTION_TRACER is not set 1599# CONFIG_FUNCTION_TRACER is not set
1600# CONFIG_IRQSOFF_TRACER is not set
1619# CONFIG_SCHED_TRACER is not set 1601# CONFIG_SCHED_TRACER is not set
1620# CONFIG_CONTEXT_SWITCH_TRACER is not set 1602# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1621# CONFIG_EVENT_TRACER is not set
1622# CONFIG_BOOT_TRACER is not set 1603# CONFIG_BOOT_TRACER is not set
1623# CONFIG_TRACE_BRANCH_PROFILING is not set 1604CONFIG_BRANCH_PROFILE_NONE=y
1605# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1606# CONFIG_PROFILE_ALL_BRANCHES is not set
1624# CONFIG_STACK_TRACER is not set 1607# CONFIG_STACK_TRACER is not set
1625# CONFIG_KMEMTRACE is not set 1608# CONFIG_KMEMTRACE is not set
1626# CONFIG_WORKQUEUE_TRACER is not set 1609# CONFIG_WORKQUEUE_TRACER is not set
@@ -1628,6 +1611,9 @@ CONFIG_TRACING_SUPPORT=y
1628# CONFIG_SAMPLES is not set 1611# CONFIG_SAMPLES is not set
1629CONFIG_HAVE_ARCH_KGDB=y 1612CONFIG_HAVE_ARCH_KGDB=y
1630# CONFIG_KGDB is not set 1613# CONFIG_KGDB is not set
1614# CONFIG_KMEMCHECK is not set
1615# CONFIG_PPC_DISABLE_WERROR is not set
1616CONFIG_PPC_WERROR=y
1631CONFIG_PRINT_STACK_DEPTH=64 1617CONFIG_PRINT_STACK_DEPTH=64
1632# CONFIG_DEBUG_STACKOVERFLOW is not set 1618# CONFIG_DEBUG_STACKOVERFLOW is not set
1633# CONFIG_DEBUG_STACK_USAGE is not set 1619# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/86xx/sbc8641d_defconfig b/arch/powerpc/configs/86xx/sbc8641d_defconfig
index c30a0c715873..f5ca2e0cd402 100644
--- a/arch/powerpc/configs/86xx/sbc8641d_defconfig
+++ b/arch/powerpc/configs/86xx/sbc8641d_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:27 2009 4# Wed Jul 29 23:32:26 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,16 +34,17 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_GENERIC_LOCKBREAK=y 45CONFIG_GENERIC_LOCKBREAK=y
42CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
43CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
44CONFIG_GENERIC_CALIBRATE_DELAY=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
47CONFIG_PPC=y 50CONFIG_PPC=y
@@ -55,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
55CONFIG_GENERIC_TBSYNC=y 58CONFIG_GENERIC_TBSYNC=y
56CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
58CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
59# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -113,7 +118,6 @@ CONFIG_SYSCTL_SYSCALL=y
113CONFIG_KALLSYMS=y 118CONFIG_KALLSYMS=y
114# CONFIG_KALLSYMS_ALL is not set 119# CONFIG_KALLSYMS_ALL is not set
115# CONFIG_KALLSYMS_EXTRA_PASS is not set 120# CONFIG_KALLSYMS_EXTRA_PASS is not set
116# CONFIG_STRIP_ASM_SYMS is not set
117CONFIG_HOTPLUG=y 121CONFIG_HOTPLUG=y
118CONFIG_PRINTK=y 122CONFIG_PRINTK=y
119CONFIG_BUG=y 123CONFIG_BUG=y
@@ -126,8 +130,15 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 131CONFIG_SHMEM=y
128CONFIG_AIO=y 132CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y
134
135#
136# Performance Counters
137#
138# CONFIG_PERF_COUNTERS is not set
129CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
130CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
132CONFIG_SLAB=y 143CONFIG_SLAB=y
133# CONFIG_SLUB is not set 144# CONFIG_SLUB is not set
@@ -142,6 +153,11 @@ CONFIG_HAVE_KPROBES=y
142CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
143CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
144CONFIG_USE_GENERIC_SMP_HELPERS=y 155CONFIG_USE_GENERIC_SMP_HELPERS=y
156
157#
158# GCOV-based kernel profiling
159#
160# CONFIG_GCOV_KERNEL is not set
145# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
147CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -155,7 +171,7 @@ CONFIG_MODULE_UNLOAD=y
155# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
156CONFIG_STOP_MACHINE=y 172CONFIG_STOP_MACHINE=y
157CONFIG_BLOCK=y 173CONFIG_BLOCK=y
158# CONFIG_LBD is not set 174CONFIG_LBDAF=y
159# CONFIG_BLK_DEV_BSG is not set 175# CONFIG_BLK_DEV_BSG is not set
160# CONFIG_BLK_DEV_INTEGRITY is not set 176# CONFIG_BLK_DEV_INTEGRITY is not set
161 177
@@ -234,6 +250,7 @@ CONFIG_BINFMT_ELF=y
234# CONFIG_HAVE_AOUT is not set 250# CONFIG_HAVE_AOUT is not set
235CONFIG_BINFMT_MISC=m 251CONFIG_BINFMT_MISC=m
236# CONFIG_IOMMU_HELPER is not set 252# CONFIG_IOMMU_HELPER is not set
253# CONFIG_SWIOTLB is not set
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 255CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -255,9 +272,9 @@ CONFIG_MIGRATION=y
255CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
256CONFIG_BOUNCE=y 273CONFIG_BOUNCE=y
257CONFIG_VIRT_TO_BUS=y 274CONFIG_VIRT_TO_BUS=y
258CONFIG_UNEVICTABLE_LRU=y
259CONFIG_HAVE_MLOCK=y 275CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_PPC_4K_PAGES=y 278CONFIG_PPC_4K_PAGES=y
262# CONFIG_PPC_16K_PAGES is not set 279# CONFIG_PPC_16K_PAGES is not set
263# CONFIG_PPC_64K_PAGES is not set 280# CONFIG_PPC_64K_PAGES is not set
@@ -284,6 +301,8 @@ CONFIG_PCI_DOMAINS=y
284CONFIG_PCI_SYSCALL=y 301CONFIG_PCI_SYSCALL=y
285CONFIG_PCIEPORTBUS=y 302CONFIG_PCIEPORTBUS=y
286CONFIG_PCIEAER=y 303CONFIG_PCIEAER=y
304# CONFIG_PCIE_ECRC is not set
305# CONFIG_PCIEAER_INJECT is not set
287# CONFIG_PCIEASPM is not set 306# CONFIG_PCIEASPM is not set
288CONFIG_ARCH_SUPPORTS_MSI=y 307CONFIG_ARCH_SUPPORTS_MSI=y
289# CONFIG_PCI_MSI is not set 308# CONFIG_PCI_MSI is not set
@@ -508,6 +527,7 @@ CONFIG_LLC=m
508# CONFIG_ECONET is not set 527# CONFIG_ECONET is not set
509CONFIG_WAN_ROUTER=m 528CONFIG_WAN_ROUTER=m
510# CONFIG_PHONET is not set 529# CONFIG_PHONET is not set
530# CONFIG_IEEE802154 is not set
511CONFIG_NET_SCHED=y 531CONFIG_NET_SCHED=y
512 532
513# 533#
@@ -564,7 +584,11 @@ CONFIG_WIRELESS=y
564CONFIG_WIRELESS_OLD_REGULATORY=y 584CONFIG_WIRELESS_OLD_REGULATORY=y
565# CONFIG_WIRELESS_EXT is not set 585# CONFIG_WIRELESS_EXT is not set
566# CONFIG_LIB80211 is not set 586# CONFIG_LIB80211 is not set
567# CONFIG_MAC80211 is not set 587
588#
589# CFG80211 needs to be enabled for MAC80211
590#
591CONFIG_MAC80211_DEFAULT_PS_VALUE=0
568# CONFIG_WIMAX is not set 592# CONFIG_WIMAX is not set
569# CONFIG_RFKILL is not set 593# CONFIG_RFKILL is not set
570# CONFIG_NET_9P is not set 594# CONFIG_NET_9P is not set
@@ -675,6 +699,7 @@ CONFIG_MTD_PHYSMAP_OF=y
675# CONFIG_MTD_UBI is not set 699# CONFIG_MTD_UBI is not set
676CONFIG_OF_DEVICE=y 700CONFIG_OF_DEVICE=y
677CONFIG_OF_I2C=y 701CONFIG_OF_I2C=y
702CONFIG_OF_MDIO=y
678# CONFIG_PARPORT is not set 703# CONFIG_PARPORT is not set
679CONFIG_BLK_DEV=y 704CONFIG_BLK_DEV=y
680# CONFIG_BLK_DEV_FD is not set 705# CONFIG_BLK_DEV_FD is not set
@@ -709,7 +734,9 @@ CONFIG_MISC_DEVICES=y
709# 734#
710# CONFIG_EEPROM_AT24 is not set 735# CONFIG_EEPROM_AT24 is not set
711# CONFIG_EEPROM_LEGACY is not set 736# CONFIG_EEPROM_LEGACY is not set
737# CONFIG_EEPROM_MAX6875 is not set
712# CONFIG_EEPROM_93CX6 is not set 738# CONFIG_EEPROM_93CX6 is not set
739# CONFIG_CB710_CORE is not set
713CONFIG_HAVE_IDE=y 740CONFIG_HAVE_IDE=y
714# CONFIG_IDE is not set 741# CONFIG_IDE is not set
715 742
@@ -736,6 +763,7 @@ CONFIG_BLK_DEV_DM=y
736CONFIG_DM_CRYPT=y 763CONFIG_DM_CRYPT=y
737CONFIG_DM_SNAPSHOT=y 764CONFIG_DM_SNAPSHOT=y
738CONFIG_DM_MIRROR=y 765CONFIG_DM_MIRROR=y
766# CONFIG_DM_LOG_USERSPACE is not set
739CONFIG_DM_ZERO=y 767CONFIG_DM_ZERO=y
740# CONFIG_DM_MULTIPATH is not set 768# CONFIG_DM_MULTIPATH is not set
741# CONFIG_DM_DELAY is not set 769# CONFIG_DM_DELAY is not set
@@ -747,14 +775,17 @@ CONFIG_DM_ZERO=y
747# 775#
748 776
749# 777#
750# Enable only one of the two stacks, unless you know what you are doing 778# You can enable one or both FireWire driver stacks.
779#
780
781#
782# See the help texts for more information.
751# 783#
752# CONFIG_FIREWIRE is not set 784# CONFIG_FIREWIRE is not set
753# CONFIG_IEEE1394 is not set 785# CONFIG_IEEE1394 is not set
754# CONFIG_I2O is not set 786# CONFIG_I2O is not set
755# CONFIG_MACINTOSH_DRIVERS is not set 787# CONFIG_MACINTOSH_DRIVERS is not set
756CONFIG_NETDEVICES=y 788CONFIG_NETDEVICES=y
757CONFIG_COMPAT_NET_DEV_OPS=y
758CONFIG_DUMMY=m 789CONFIG_DUMMY=m
759CONFIG_BONDING=m 790CONFIG_BONDING=m
760# CONFIG_MACVLAN is not set 791# CONFIG_MACVLAN is not set
@@ -801,6 +832,7 @@ CONFIG_MII=y
801# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 832# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
802# CONFIG_NET_PCI is not set 833# CONFIG_NET_PCI is not set
803# CONFIG_B44 is not set 834# CONFIG_B44 is not set
835# CONFIG_KS8842 is not set
804# CONFIG_ATL2 is not set 836# CONFIG_ATL2 is not set
805CONFIG_NETDEV_1000=y 837CONFIG_NETDEV_1000=y
806# CONFIG_ACENIC is not set 838# CONFIG_ACENIC is not set
@@ -820,8 +852,10 @@ CONFIG_NETDEV_1000=y
820# CONFIG_VIA_VELOCITY is not set 852# CONFIG_VIA_VELOCITY is not set
821# CONFIG_TIGON3 is not set 853# CONFIG_TIGON3 is not set
822# CONFIG_BNX2 is not set 854# CONFIG_BNX2 is not set
855# CONFIG_CNIC is not set
823CONFIG_FSL_PQ_MDIO=y 856CONFIG_FSL_PQ_MDIO=y
824CONFIG_GIANFAR=y 857CONFIG_GIANFAR=y
858# CONFIG_MV643XX_ETH is not set
825# CONFIG_QLA3XXX is not set 859# CONFIG_QLA3XXX is not set
826# CONFIG_ATL1 is not set 860# CONFIG_ATL1 is not set
827# CONFIG_ATL1E is not set 861# CONFIG_ATL1E is not set
@@ -1018,13 +1052,17 @@ CONFIG_I2C_MPC=y
1018# CONFIG_SENSORS_PCF8574 is not set 1052# CONFIG_SENSORS_PCF8574 is not set
1019# CONFIG_PCF8575 is not set 1053# CONFIG_PCF8575 is not set
1020# CONFIG_SENSORS_PCA9539 is not set 1054# CONFIG_SENSORS_PCA9539 is not set
1021# CONFIG_SENSORS_MAX6875 is not set
1022# CONFIG_SENSORS_TSL2550 is not set 1055# CONFIG_SENSORS_TSL2550 is not set
1023# CONFIG_I2C_DEBUG_CORE is not set 1056# CONFIG_I2C_DEBUG_CORE is not set
1024# CONFIG_I2C_DEBUG_ALGO is not set 1057# CONFIG_I2C_DEBUG_ALGO is not set
1025# CONFIG_I2C_DEBUG_BUS is not set 1058# CONFIG_I2C_DEBUG_BUS is not set
1026# CONFIG_I2C_DEBUG_CHIP is not set 1059# CONFIG_I2C_DEBUG_CHIP is not set
1027# CONFIG_SPI is not set 1060# CONFIG_SPI is not set
1061
1062#
1063# PPS support
1064#
1065# CONFIG_PPS is not set
1028CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1066CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1029# CONFIG_GPIOLIB is not set 1067# CONFIG_GPIOLIB is not set
1030# CONFIG_W1 is not set 1068# CONFIG_W1 is not set
@@ -1079,6 +1117,7 @@ CONFIG_HWMON=y
1079# CONFIG_SENSORS_SMSC47B397 is not set 1117# CONFIG_SENSORS_SMSC47B397 is not set
1080# CONFIG_SENSORS_ADS7828 is not set 1118# CONFIG_SENSORS_ADS7828 is not set
1081# CONFIG_SENSORS_THMC50 is not set 1119# CONFIG_SENSORS_THMC50 is not set
1120# CONFIG_SENSORS_TMP401 is not set
1082# CONFIG_SENSORS_VIA686A is not set 1121# CONFIG_SENSORS_VIA686A is not set
1083# CONFIG_SENSORS_VT1211 is not set 1122# CONFIG_SENSORS_VT1211 is not set
1084# CONFIG_SENSORS_VT8231 is not set 1123# CONFIG_SENSORS_VT8231 is not set
@@ -1127,23 +1166,9 @@ CONFIG_SSB_POSSIBLE=y
1127# CONFIG_MFD_WM8400 is not set 1166# CONFIG_MFD_WM8400 is not set
1128# CONFIG_MFD_WM8350_I2C is not set 1167# CONFIG_MFD_WM8350_I2C is not set
1129# CONFIG_MFD_PCF50633 is not set 1168# CONFIG_MFD_PCF50633 is not set
1169# CONFIG_AB3100_CORE is not set
1130# CONFIG_REGULATOR is not set 1170# CONFIG_REGULATOR is not set
1131 1171# CONFIG_MEDIA_SUPPORT is not set
1132#
1133# Multimedia devices
1134#
1135
1136#
1137# Multimedia core support
1138#
1139# CONFIG_VIDEO_DEV is not set
1140# CONFIG_DVB_CORE is not set
1141# CONFIG_VIDEO_MEDIA is not set
1142
1143#
1144# Multimedia drivers
1145#
1146CONFIG_DAB=y
1147 1172
1148# 1173#
1149# Graphics support 1174# Graphics support
@@ -1207,6 +1232,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
1207# CONFIG_DMADEVICES is not set 1232# CONFIG_DMADEVICES is not set
1208# CONFIG_AUXDISPLAY is not set 1233# CONFIG_AUXDISPLAY is not set
1209# CONFIG_UIO is not set 1234# CONFIG_UIO is not set
1235
1236#
1237# TI VLYNQ
1238#
1210# CONFIG_STAGING is not set 1239# CONFIG_STAGING is not set
1211 1240
1212# 1241#
@@ -1236,8 +1265,8 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
1236# CONFIG_REISERFS_FS_SECURITY is not set 1265# CONFIG_REISERFS_FS_SECURITY is not set
1237# CONFIG_JFS_FS is not set 1266# CONFIG_JFS_FS is not set
1238CONFIG_FS_POSIX_ACL=y 1267CONFIG_FS_POSIX_ACL=y
1239CONFIG_FILE_LOCKING=y
1240# CONFIG_XFS_FS is not set 1268# CONFIG_XFS_FS is not set
1269# CONFIG_GFS2_FS is not set
1241CONFIG_OCFS2_FS=m 1270CONFIG_OCFS2_FS=m
1242CONFIG_OCFS2_FS_O2CB=m 1271CONFIG_OCFS2_FS_O2CB=m
1243CONFIG_OCFS2_FS_STATS=y 1272CONFIG_OCFS2_FS_STATS=y
@@ -1245,6 +1274,8 @@ CONFIG_OCFS2_DEBUG_MASKLOG=y
1245# CONFIG_OCFS2_DEBUG_FS is not set 1274# CONFIG_OCFS2_DEBUG_FS is not set
1246# CONFIG_OCFS2_FS_POSIX_ACL is not set 1275# CONFIG_OCFS2_FS_POSIX_ACL is not set
1247# CONFIG_BTRFS_FS is not set 1276# CONFIG_BTRFS_FS is not set
1277CONFIG_FILE_LOCKING=y
1278CONFIG_FSNOTIFY=y
1248CONFIG_DNOTIFY=y 1279CONFIG_DNOTIFY=y
1249CONFIG_INOTIFY=y 1280CONFIG_INOTIFY=y
1250CONFIG_INOTIFY_USER=y 1281CONFIG_INOTIFY_USER=y
@@ -1318,6 +1349,7 @@ CONFIG_NFS_FS=y
1318CONFIG_NFS_V3=y 1349CONFIG_NFS_V3=y
1319# CONFIG_NFS_V3_ACL is not set 1350# CONFIG_NFS_V3_ACL is not set
1320CONFIG_NFS_V4=y 1351CONFIG_NFS_V4=y
1352# CONFIG_NFS_V4_1 is not set
1321CONFIG_ROOT_NFS=y 1353CONFIG_ROOT_NFS=y
1322# CONFIG_NFSD is not set 1354# CONFIG_NFSD is not set
1323CONFIG_LOCKD=y 1355CONFIG_LOCKD=y
@@ -1409,6 +1441,7 @@ CONFIG_HAS_IOPORT=y
1409CONFIG_HAS_DMA=y 1441CONFIG_HAS_DMA=y
1410CONFIG_HAVE_LMB=y 1442CONFIG_HAVE_LMB=y
1411CONFIG_NLATTR=y 1443CONFIG_NLATTR=y
1444CONFIG_GENERIC_ATOMIC64=y
1412 1445
1413# 1446#
1414# Kernel hacking 1447# Kernel hacking
@@ -1434,10 +1467,14 @@ CONFIG_SCHED_DEBUG=y
1434# CONFIG_TIMER_STATS is not set 1467# CONFIG_TIMER_STATS is not set
1435# CONFIG_DEBUG_OBJECTS is not set 1468# CONFIG_DEBUG_OBJECTS is not set
1436# CONFIG_DEBUG_SLAB is not set 1469# CONFIG_DEBUG_SLAB is not set
1470CONFIG_DEBUG_PREEMPT=y
1437# CONFIG_DEBUG_RT_MUTEXES is not set 1471# CONFIG_DEBUG_RT_MUTEXES is not set
1438# CONFIG_RT_MUTEX_TESTER is not set 1472# CONFIG_RT_MUTEX_TESTER is not set
1439# CONFIG_DEBUG_SPINLOCK is not set 1473# CONFIG_DEBUG_SPINLOCK is not set
1440# CONFIG_DEBUG_MUTEXES is not set 1474# CONFIG_DEBUG_MUTEXES is not set
1475# CONFIG_DEBUG_LOCK_ALLOC is not set
1476# CONFIG_PROVE_LOCKING is not set
1477# CONFIG_LOCK_STAT is not set
1441# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1478# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1442# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1479# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1443# CONFIG_DEBUG_KOBJECT is not set 1480# CONFIG_DEBUG_KOBJECT is not set
@@ -1449,7 +1486,6 @@ CONFIG_DEBUG_INFO=y
1449# CONFIG_DEBUG_LIST is not set 1486# CONFIG_DEBUG_LIST is not set
1450# CONFIG_DEBUG_SG is not set 1487# CONFIG_DEBUG_SG is not set
1451# CONFIG_DEBUG_NOTIFIERS is not set 1488# CONFIG_DEBUG_NOTIFIERS is not set
1452# CONFIG_BOOT_PRINTK_DELAY is not set
1453# CONFIG_RCU_TORTURE_TEST is not set 1489# CONFIG_RCU_TORTURE_TEST is not set
1454# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1490# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1455# CONFIG_BACKTRACE_SELF_TEST is not set 1491# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1463,17 +1499,16 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1463CONFIG_HAVE_DYNAMIC_FTRACE=y 1499CONFIG_HAVE_DYNAMIC_FTRACE=y
1464CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1500CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1465CONFIG_TRACING_SUPPORT=y 1501CONFIG_TRACING_SUPPORT=y
1466 1502CONFIG_FTRACE=y
1467#
1468# Tracers
1469#
1470# CONFIG_FUNCTION_TRACER is not set 1503# CONFIG_FUNCTION_TRACER is not set
1504# CONFIG_IRQSOFF_TRACER is not set
1471# CONFIG_PREEMPT_TRACER is not set 1505# CONFIG_PREEMPT_TRACER is not set
1472# CONFIG_SCHED_TRACER is not set 1506# CONFIG_SCHED_TRACER is not set
1473# CONFIG_CONTEXT_SWITCH_TRACER is not set 1507# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1474# CONFIG_EVENT_TRACER is not set
1475# CONFIG_BOOT_TRACER is not set 1508# CONFIG_BOOT_TRACER is not set
1476# CONFIG_TRACE_BRANCH_PROFILING is not set 1509CONFIG_BRANCH_PROFILE_NONE=y
1510# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1511# CONFIG_PROFILE_ALL_BRANCHES is not set
1477# CONFIG_STACK_TRACER is not set 1512# CONFIG_STACK_TRACER is not set
1478# CONFIG_KMEMTRACE is not set 1513# CONFIG_KMEMTRACE is not set
1479# CONFIG_WORKQUEUE_TRACER is not set 1514# CONFIG_WORKQUEUE_TRACER is not set
@@ -1482,9 +1517,13 @@ CONFIG_TRACING_SUPPORT=y
1482# CONFIG_SAMPLES is not set 1517# CONFIG_SAMPLES is not set
1483CONFIG_HAVE_ARCH_KGDB=y 1518CONFIG_HAVE_ARCH_KGDB=y
1484# CONFIG_KGDB is not set 1519# CONFIG_KGDB is not set
1520# CONFIG_KMEMCHECK is not set
1521# CONFIG_PPC_DISABLE_WERROR is not set
1522CONFIG_PPC_WERROR=y
1485CONFIG_PRINT_STACK_DEPTH=64 1523CONFIG_PRINT_STACK_DEPTH=64
1486# CONFIG_DEBUG_STACKOVERFLOW is not set 1524# CONFIG_DEBUG_STACKOVERFLOW is not set
1487# CONFIG_DEBUG_STACK_USAGE is not set 1525# CONFIG_DEBUG_STACK_USAGE is not set
1526# CONFIG_PPC_EMULATED_STATS is not set
1488# CONFIG_CODE_PATCHING_SELFTEST is not set 1527# CONFIG_CODE_PATCHING_SELFTEST is not set
1489# CONFIG_FTR_FIXUP_SELFTEST is not set 1528# CONFIG_FTR_FIXUP_SELFTEST is not set
1490# CONFIG_MSI_BITMAP_SELFTEST is not set 1529# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -1505,7 +1544,6 @@ CONFIG_SECURITY_NETWORK=y
1505# CONFIG_SECURITY_NETWORK_XFRM is not set 1544# CONFIG_SECURITY_NETWORK_XFRM is not set
1506# CONFIG_SECURITY_PATH is not set 1545# CONFIG_SECURITY_PATH is not set
1507# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1546# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1508CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1509# CONFIG_SECURITY_TOMOYO is not set 1547# CONFIG_SECURITY_TOMOYO is not set
1510CONFIG_CRYPTO=y 1548CONFIG_CRYPTO=y
1511 1549
diff --git a/arch/powerpc/configs/adder875_defconfig b/arch/powerpc/configs/adder875_defconfig
index 74f7f7c6fdc4..aece6bb5f733 100644
--- a/arch/powerpc/configs/adder875_defconfig
+++ b/arch/powerpc/configs/adder875_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:50 2009 4# Wed Jul 29 23:31:47 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -49,12 +50,14 @@ CONFIG_OF=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53CONFIG_REDBOOT=y 55CONFIG_REDBOOT=y
54# CONFIG_PPC_DCR_NATIVE is not set 56# CONFIG_PPC_DCR_NATIVE is not set
55# CONFIG_PPC_DCR_MMIO is not set 57# CONFIG_PPC_DCR_MMIO is not set
56CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
60CONFIG_CONSTRUCTORS=y
58 61
59# 62#
60# General setup 63# General setup
@@ -101,7 +104,6 @@ CONFIG_EMBEDDED=y
101CONFIG_KALLSYMS=y 104CONFIG_KALLSYMS=y
102# CONFIG_KALLSYMS_ALL is not set 105# CONFIG_KALLSYMS_ALL is not set
103# CONFIG_KALLSYMS_EXTRA_PASS is not set 106# CONFIG_KALLSYMS_EXTRA_PASS is not set
104# CONFIG_STRIP_ASM_SYMS is not set
105CONFIG_HOTPLUG=y 107CONFIG_HOTPLUG=y
106CONFIG_PRINTK=y 108CONFIG_PRINTK=y
107CONFIG_BUG=y 109CONFIG_BUG=y
@@ -114,8 +116,15 @@ CONFIG_TIMERFD=y
114CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
115CONFIG_SHMEM=y 117CONFIG_SHMEM=y
116CONFIG_AIO=y 118CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y
120
121#
122# Performance Counters
123#
124# CONFIG_PERF_COUNTERS is not set
117# CONFIG_VM_EVENT_COUNTERS is not set 125# CONFIG_VM_EVENT_COUNTERS is not set
118CONFIG_SLUB_DEBUG=y 126CONFIG_SLUB_DEBUG=y
127# CONFIG_STRIP_ASM_SYMS is not set
119CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
120# CONFIG_SLAB is not set 129# CONFIG_SLAB is not set
121CONFIG_SLUB=y 130CONFIG_SLUB=y
@@ -129,13 +138,18 @@ CONFIG_HAVE_KPROBES=y
129CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
130CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
131CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141
142#
143# GCOV-based kernel profiling
144#
145# CONFIG_GCOV_KERNEL is not set
132# CONFIG_SLOW_WORK is not set 146# CONFIG_SLOW_WORK is not set
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y 148CONFIG_SLABINFO=y
135CONFIG_BASE_SMALL=1 149CONFIG_BASE_SMALL=1
136# CONFIG_MODULES is not set 150# CONFIG_MODULES is not set
137CONFIG_BLOCK=y 151CONFIG_BLOCK=y
138# CONFIG_LBD is not set 152CONFIG_LBDAF=y
139# CONFIG_BLK_DEV_BSG is not set 153# CONFIG_BLK_DEV_BSG is not set
140# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
141 155
@@ -220,6 +234,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_MATH_EMULATION is not set 234# CONFIG_MATH_EMULATION is not set
221# CONFIG_8XX_MINIMAL_FPEMU is not set 235# CONFIG_8XX_MINIMAL_FPEMU is not set
222# CONFIG_IOMMU_HELPER is not set 236# CONFIG_IOMMU_HELPER is not set
237# CONFIG_SWIOTLB is not set
223CONFIG_PPC_NEED_DMA_SYNC_OPS=y 238CONFIG_PPC_NEED_DMA_SYNC_OPS=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 239CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
225CONFIG_ARCH_HAS_WALK_MEMORY=y 240CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -239,9 +254,9 @@ CONFIG_MIGRATION=y
239CONFIG_ZONE_DMA_FLAG=1 254CONFIG_ZONE_DMA_FLAG=1
240CONFIG_BOUNCE=y 255CONFIG_BOUNCE=y
241CONFIG_VIRT_TO_BUS=y 256CONFIG_VIRT_TO_BUS=y
242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y 257CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y 258CONFIG_HAVE_MLOCKED_PAGE_BIT=y
259CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
245CONFIG_PPC_4K_PAGES=y 260CONFIG_PPC_4K_PAGES=y
246# CONFIG_PPC_16K_PAGES is not set 261# CONFIG_PPC_16K_PAGES is not set
247# CONFIG_PPC_64K_PAGES is not set 262# CONFIG_PPC_64K_PAGES is not set
@@ -280,6 +295,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
280CONFIG_KERNEL_START=0xc0000000 295CONFIG_KERNEL_START=0xc0000000
281CONFIG_PHYSICAL_START=0x00000000 296CONFIG_PHYSICAL_START=0x00000000
282CONFIG_TASK_SIZE=0x80000000 297CONFIG_TASK_SIZE=0x80000000
298CONFIG_CONSISTENT_SIZE=0x00200000
283CONFIG_NET=y 299CONFIG_NET=y
284 300
285# 301#
@@ -336,6 +352,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
336# CONFIG_ECONET is not set 352# CONFIG_ECONET is not set
337# CONFIG_WAN_ROUTER is not set 353# CONFIG_WAN_ROUTER is not set
338# CONFIG_PHONET is not set 354# CONFIG_PHONET is not set
355# CONFIG_IEEE802154 is not set
339# CONFIG_NET_SCHED is not set 356# CONFIG_NET_SCHED is not set
340# CONFIG_DCB is not set 357# CONFIG_DCB is not set
341 358
@@ -353,7 +370,11 @@ CONFIG_WIRELESS=y
353CONFIG_WIRELESS_OLD_REGULATORY=y 370CONFIG_WIRELESS_OLD_REGULATORY=y
354# CONFIG_WIRELESS_EXT is not set 371# CONFIG_WIRELESS_EXT is not set
355# CONFIG_LIB80211 is not set 372# CONFIG_LIB80211 is not set
356# CONFIG_MAC80211 is not set 373
374#
375# CFG80211 needs to be enabled for MAC80211
376#
377CONFIG_MAC80211_DEFAULT_PS_VALUE=0
357# CONFIG_WIMAX is not set 378# CONFIG_WIMAX is not set
358# CONFIG_RFKILL is not set 379# CONFIG_RFKILL is not set
359# CONFIG_NET_9P is not set 380# CONFIG_NET_9P is not set
@@ -452,6 +473,7 @@ CONFIG_MTD_PHYSMAP_OF=y
452# 473#
453# CONFIG_MTD_UBI is not set 474# CONFIG_MTD_UBI is not set
454CONFIG_OF_DEVICE=y 475CONFIG_OF_DEVICE=y
476CONFIG_OF_MDIO=y
455# CONFIG_PARPORT is not set 477# CONFIG_PARPORT is not set
456# CONFIG_BLK_DEV is not set 478# CONFIG_BLK_DEV is not set
457# CONFIG_MISC_DEVICES is not set 479# CONFIG_MISC_DEVICES is not set
@@ -469,7 +491,6 @@ CONFIG_HAVE_IDE=y
469# CONFIG_MD is not set 491# CONFIG_MD is not set
470# CONFIG_MACINTOSH_DRIVERS is not set 492# CONFIG_MACINTOSH_DRIVERS is not set
471CONFIG_NETDEVICES=y 493CONFIG_NETDEVICES=y
472CONFIG_COMPAT_NET_DEV_OPS=y
473# CONFIG_DUMMY is not set 494# CONFIG_DUMMY is not set
474# CONFIG_BONDING is not set 495# CONFIG_BONDING is not set
475# CONFIG_MACVLAN is not set 496# CONFIG_MACVLAN is not set
@@ -508,6 +529,7 @@ CONFIG_MII=y
508# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 529# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
509# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 530# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
510# CONFIG_B44 is not set 531# CONFIG_B44 is not set
532# CONFIG_KS8842 is not set
511CONFIG_FS_ENET=y 533CONFIG_FS_ENET=y
512# CONFIG_FS_ENET_HAS_SCC is not set 534# CONFIG_FS_ENET_HAS_SCC is not set
513CONFIG_FS_ENET_HAS_FEC=y 535CONFIG_FS_ENET_HAS_FEC=y
@@ -556,11 +578,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
556# 578#
557CONFIG_INPUT_KEYBOARD=y 579CONFIG_INPUT_KEYBOARD=y
558CONFIG_KEYBOARD_ATKBD=y 580CONFIG_KEYBOARD_ATKBD=y
559# CONFIG_KEYBOARD_SUNKBD is not set
560# CONFIG_KEYBOARD_LKKBD is not set 581# CONFIG_KEYBOARD_LKKBD is not set
561# CONFIG_KEYBOARD_XTKBD is not set
562# CONFIG_KEYBOARD_NEWTON is not set 582# CONFIG_KEYBOARD_NEWTON is not set
563# CONFIG_KEYBOARD_STOWAWAY is not set 583# CONFIG_KEYBOARD_STOWAWAY is not set
584# CONFIG_KEYBOARD_SUNKBD is not set
585# CONFIG_KEYBOARD_XTKBD is not set
564CONFIG_INPUT_MOUSE=y 586CONFIG_INPUT_MOUSE=y
565CONFIG_MOUSE_PS2=y 587CONFIG_MOUSE_PS2=y
566CONFIG_MOUSE_PS2_ALPS=y 588CONFIG_MOUSE_PS2_ALPS=y
@@ -622,6 +644,11 @@ CONFIG_GEN_RTC=y
622# CONFIG_TCG_TPM is not set 644# CONFIG_TCG_TPM is not set
623# CONFIG_I2C is not set 645# CONFIG_I2C is not set
624# CONFIG_SPI is not set 646# CONFIG_SPI is not set
647
648#
649# PPS support
650#
651# CONFIG_PPS is not set
625CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 652CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
626# CONFIG_GPIOLIB is not set 653# CONFIG_GPIOLIB is not set
627# CONFIG_W1 is not set 654# CONFIG_W1 is not set
@@ -644,22 +671,7 @@ CONFIG_SSB_POSSIBLE=y
644# CONFIG_HTC_PASIC3 is not set 671# CONFIG_HTC_PASIC3 is not set
645# CONFIG_MFD_TMIO is not set 672# CONFIG_MFD_TMIO is not set
646# CONFIG_REGULATOR is not set 673# CONFIG_REGULATOR is not set
647 674# CONFIG_MEDIA_SUPPORT is not set
648#
649# Multimedia devices
650#
651
652#
653# Multimedia core support
654#
655# CONFIG_VIDEO_DEV is not set
656# CONFIG_DVB_CORE is not set
657# CONFIG_VIDEO_MEDIA is not set
658
659#
660# Multimedia drivers
661#
662CONFIG_DAB=y
663 675
664# 676#
665# Graphics support 677# Graphics support
@@ -685,6 +697,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
685# CONFIG_DMADEVICES is not set 697# CONFIG_DMADEVICES is not set
686# CONFIG_AUXDISPLAY is not set 698# CONFIG_AUXDISPLAY is not set
687# CONFIG_UIO is not set 699# CONFIG_UIO is not set
700
701#
702# TI VLYNQ
703#
688# CONFIG_STAGING is not set 704# CONFIG_STAGING is not set
689 705
690# 706#
@@ -696,12 +712,15 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
696# CONFIG_REISERFS_FS is not set 712# CONFIG_REISERFS_FS is not set
697# CONFIG_JFS_FS is not set 713# CONFIG_JFS_FS is not set
698# CONFIG_FS_POSIX_ACL is not set 714# CONFIG_FS_POSIX_ACL is not set
699CONFIG_FILE_LOCKING=y
700# CONFIG_XFS_FS is not set 715# CONFIG_XFS_FS is not set
716# CONFIG_GFS2_FS is not set
701# CONFIG_OCFS2_FS is not set 717# CONFIG_OCFS2_FS is not set
702# CONFIG_BTRFS_FS is not set 718# CONFIG_BTRFS_FS is not set
719CONFIG_FILE_LOCKING=y
720CONFIG_FSNOTIFY=y
703# CONFIG_DNOTIFY is not set 721# CONFIG_DNOTIFY is not set
704# CONFIG_INOTIFY is not set 722# CONFIG_INOTIFY is not set
723CONFIG_INOTIFY_USER=y
705# CONFIG_QUOTA is not set 724# CONFIG_QUOTA is not set
706# CONFIG_AUTOFS_FS is not set 725# CONFIG_AUTOFS_FS is not set
707# CONFIG_AUTOFS4_FS is not set 726# CONFIG_AUTOFS4_FS is not set
@@ -818,6 +837,7 @@ CONFIG_HAS_IOPORT=y
818CONFIG_HAS_DMA=y 837CONFIG_HAS_DMA=y
819CONFIG_HAVE_LMB=y 838CONFIG_HAVE_LMB=y
820CONFIG_NLATTR=y 839CONFIG_NLATTR=y
840CONFIG_GENERIC_ATOMIC64=y
821 841
822# 842#
823# Kernel hacking 843# Kernel hacking
@@ -846,6 +866,9 @@ CONFIG_SCHED_DEBUG=y
846# CONFIG_SLUB_STATS is not set 866# CONFIG_SLUB_STATS is not set
847# CONFIG_DEBUG_SPINLOCK is not set 867# CONFIG_DEBUG_SPINLOCK is not set
848# CONFIG_DEBUG_MUTEXES is not set 868# CONFIG_DEBUG_MUTEXES is not set
869# CONFIG_DEBUG_LOCK_ALLOC is not set
870# CONFIG_PROVE_LOCKING is not set
871# CONFIG_LOCK_STAT is not set
849# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 872# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
850# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 873# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
851# CONFIG_DEBUG_KOBJECT is not set 874# CONFIG_DEBUG_KOBJECT is not set
@@ -857,7 +880,6 @@ CONFIG_DEBUG_INFO=y
857# CONFIG_DEBUG_LIST is not set 880# CONFIG_DEBUG_LIST is not set
858# CONFIG_DEBUG_SG is not set 881# CONFIG_DEBUG_SG is not set
859# CONFIG_DEBUG_NOTIFIERS is not set 882# CONFIG_DEBUG_NOTIFIERS is not set
860# CONFIG_BOOT_PRINTK_DELAY is not set
861# CONFIG_RCU_TORTURE_TEST is not set 883# CONFIG_RCU_TORTURE_TEST is not set
862# CONFIG_RCU_CPU_STALL_DETECTOR is not set 884# CONFIG_RCU_CPU_STALL_DETECTOR is not set
863# CONFIG_BACKTRACE_SELF_TEST is not set 885# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -870,16 +892,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
870CONFIG_HAVE_DYNAMIC_FTRACE=y 892CONFIG_HAVE_DYNAMIC_FTRACE=y
871CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 893CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
872CONFIG_TRACING_SUPPORT=y 894CONFIG_TRACING_SUPPORT=y
873 895CONFIG_FTRACE=y
874#
875# Tracers
876#
877# CONFIG_FUNCTION_TRACER is not set 896# CONFIG_FUNCTION_TRACER is not set
897# CONFIG_IRQSOFF_TRACER is not set
878# CONFIG_SCHED_TRACER is not set 898# CONFIG_SCHED_TRACER is not set
879# CONFIG_CONTEXT_SWITCH_TRACER is not set 899# CONFIG_ENABLE_DEFAULT_TRACERS is not set
880# CONFIG_EVENT_TRACER is not set
881# CONFIG_BOOT_TRACER is not set 900# CONFIG_BOOT_TRACER is not set
882# CONFIG_TRACE_BRANCH_PROFILING is not set 901CONFIG_BRANCH_PROFILE_NONE=y
902# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
903# CONFIG_PROFILE_ALL_BRANCHES is not set
883# CONFIG_STACK_TRACER is not set 904# CONFIG_STACK_TRACER is not set
884# CONFIG_KMEMTRACE is not set 905# CONFIG_KMEMTRACE is not set
885# CONFIG_WORKQUEUE_TRACER is not set 906# CONFIG_WORKQUEUE_TRACER is not set
@@ -888,9 +909,13 @@ CONFIG_TRACING_SUPPORT=y
888# CONFIG_SAMPLES is not set 909# CONFIG_SAMPLES is not set
889CONFIG_HAVE_ARCH_KGDB=y 910CONFIG_HAVE_ARCH_KGDB=y
890# CONFIG_KGDB is not set 911# CONFIG_KGDB is not set
912# CONFIG_KMEMCHECK is not set
913# CONFIG_PPC_DISABLE_WERROR is not set
914CONFIG_PPC_WERROR=y
891CONFIG_PRINT_STACK_DEPTH=64 915CONFIG_PRINT_STACK_DEPTH=64
892# CONFIG_DEBUG_STACKOVERFLOW is not set 916# CONFIG_DEBUG_STACKOVERFLOW is not set
893# CONFIG_DEBUG_STACK_USAGE is not set 917# CONFIG_DEBUG_STACK_USAGE is not set
918# CONFIG_PPC_EMULATED_STATS is not set
894# CONFIG_CODE_PATCHING_SELFTEST is not set 919# CONFIG_CODE_PATCHING_SELFTEST is not set
895# CONFIG_FTR_FIXUP_SELFTEST is not set 920# CONFIG_FTR_FIXUP_SELFTEST is not set
896# CONFIG_MSI_BITMAP_SELFTEST is not set 921# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/c2k_defconfig b/arch/powerpc/configs/c2k_defconfig
index 9ffa8de92803..8105360d53f4 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:51 2009 4# Wed Jul 29 23:31:48 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_NOT_COHERENT_CACHE=y 26CONFIG_NOT_COHERENT_CACHE=y
25CONFIG_CHECK_CACHE_COHERENCY=y 27CONFIG_CHECK_CACHE_COHERENCY=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
46CONFIG_PPC=y 49CONFIG_PPC=y
@@ -54,11 +57,13 @@ CONFIG_OF=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57# CONFIG_DEFAULT_UIMAGE is not set 61# CONFIG_DEFAULT_UIMAGE is not set
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -118,7 +123,6 @@ CONFIG_SYSCTL_SYSCALL=y
118CONFIG_KALLSYMS=y 123CONFIG_KALLSYMS=y
119# CONFIG_KALLSYMS_ALL is not set 124# CONFIG_KALLSYMS_ALL is not set
120CONFIG_KALLSYMS_EXTRA_PASS=y 125CONFIG_KALLSYMS_EXTRA_PASS=y
121# CONFIG_STRIP_ASM_SYMS is not set
122CONFIG_HOTPLUG=y 126CONFIG_HOTPLUG=y
123CONFIG_PRINTK=y 127CONFIG_PRINTK=y
124CONFIG_BUG=y 128CONFIG_BUG=y
@@ -131,16 +135,23 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 135CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 136CONFIG_SHMEM=y
133CONFIG_AIO=y 137CONFIG_AIO=y
138CONFIG_HAVE_PERF_COUNTERS=y
139
140#
141# Performance Counters
142#
143# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 144CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 145CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 146CONFIG_SLUB_DEBUG=y
147# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 148CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 149# CONFIG_SLAB is not set
139CONFIG_SLUB=y 150CONFIG_SLUB=y
140# CONFIG_SLOB is not set 151# CONFIG_SLOB is not set
141CONFIG_PROFILING=y 152CONFIG_PROFILING=y
142CONFIG_TRACEPOINTS=y 153CONFIG_TRACEPOINTS=y
143# CONFIG_MARKERS is not set 154CONFIG_MARKERS=y
144CONFIG_OPROFILE=m 155CONFIG_OPROFILE=m
145CONFIG_HAVE_OPROFILE=y 156CONFIG_HAVE_OPROFILE=y
146CONFIG_KPROBES=y 157CONFIG_KPROBES=y
@@ -150,6 +161,11 @@ CONFIG_HAVE_IOREMAP_PROT=y
150CONFIG_HAVE_KPROBES=y 161CONFIG_HAVE_KPROBES=y
151CONFIG_HAVE_KRETPROBES=y 162CONFIG_HAVE_KRETPROBES=y
152CONFIG_HAVE_ARCH_TRACEHOOK=y 163CONFIG_HAVE_ARCH_TRACEHOOK=y
164
165#
166# GCOV-based kernel profiling
167#
168# CONFIG_GCOV_KERNEL is not set
153# CONFIG_SLOW_WORK is not set 169# CONFIG_SLOW_WORK is not set
154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 170# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
155CONFIG_SLABINFO=y 171CONFIG_SLABINFO=y
@@ -162,7 +178,7 @@ CONFIG_MODULE_UNLOAD=y
162CONFIG_MODVERSIONS=y 178CONFIG_MODVERSIONS=y
163# CONFIG_MODULE_SRCVERSION_ALL is not set 179# CONFIG_MODULE_SRCVERSION_ALL is not set
164CONFIG_BLOCK=y 180CONFIG_BLOCK=y
165CONFIG_LBD=y 181CONFIG_LBDAF=y
166# CONFIG_BLK_DEV_BSG is not set 182# CONFIG_BLK_DEV_BSG is not set
167# CONFIG_BLK_DEV_INTEGRITY is not set 183# CONFIG_BLK_DEV_INTEGRITY is not set
168 184
@@ -258,6 +274,7 @@ CONFIG_BINFMT_ELF=y
258# CONFIG_HAVE_AOUT is not set 274# CONFIG_HAVE_AOUT is not set
259CONFIG_BINFMT_MISC=y 275CONFIG_BINFMT_MISC=y
260# CONFIG_IOMMU_HELPER is not set 276# CONFIG_IOMMU_HELPER is not set
277# CONFIG_SWIOTLB is not set
261CONFIG_PPC_NEED_DMA_SYNC_OPS=y 278CONFIG_PPC_NEED_DMA_SYNC_OPS=y
262CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 279CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
263CONFIG_ARCH_HAS_WALK_MEMORY=y 280CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -279,9 +296,9 @@ CONFIG_MIGRATION=y
279CONFIG_ZONE_DMA_FLAG=1 296CONFIG_ZONE_DMA_FLAG=1
280CONFIG_BOUNCE=y 297CONFIG_BOUNCE=y
281CONFIG_VIRT_TO_BUS=y 298CONFIG_VIRT_TO_BUS=y
282CONFIG_UNEVICTABLE_LRU=y
283CONFIG_HAVE_MLOCK=y 299CONFIG_HAVE_MLOCK=y
284CONFIG_HAVE_MLOCKED_PAGE_BIT=y 300CONFIG_HAVE_MLOCKED_PAGE_BIT=y
301CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
285CONFIG_PPC_4K_PAGES=y 302CONFIG_PPC_4K_PAGES=y
286# CONFIG_PPC_16K_PAGES is not set 303# CONFIG_PPC_16K_PAGES is not set
287# CONFIG_PPC_64K_PAGES is not set 304# CONFIG_PPC_64K_PAGES is not set
@@ -331,6 +348,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
331CONFIG_KERNEL_START=0xc0000000 348CONFIG_KERNEL_START=0xc0000000
332CONFIG_PHYSICAL_START=0x00000000 349CONFIG_PHYSICAL_START=0x00000000
333CONFIG_TASK_SIZE=0xc0000000 350CONFIG_TASK_SIZE=0xc0000000
351CONFIG_CONSISTENT_SIZE=0x00200000
334CONFIG_NET=y 352CONFIG_NET=y
335 353
336# 354#
@@ -583,6 +601,7 @@ CONFIG_LLC=m
583# CONFIG_ECONET is not set 601# CONFIG_ECONET is not set
584# CONFIG_WAN_ROUTER is not set 602# CONFIG_WAN_ROUTER is not set
585# CONFIG_PHONET is not set 603# CONFIG_PHONET is not set
604# CONFIG_IEEE802154 is not set
586CONFIG_NET_SCHED=y 605CONFIG_NET_SCHED=y
587 606
588# 607#
@@ -663,7 +682,11 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
663CONFIG_WIRELESS_EXT=y 682CONFIG_WIRELESS_EXT=y
664CONFIG_WIRELESS_EXT_SYSFS=y 683CONFIG_WIRELESS_EXT_SYSFS=y
665# CONFIG_LIB80211 is not set 684# CONFIG_LIB80211 is not set
666# CONFIG_MAC80211 is not set 685
686#
687# CFG80211 needs to be enabled for MAC80211
688#
689CONFIG_MAC80211_DEFAULT_PS_VALUE=0
667# CONFIG_WIMAX is not set 690# CONFIG_WIMAX is not set
668# CONFIG_RFKILL is not set 691# CONFIG_RFKILL is not set
669# CONFIG_NET_9P is not set 692# CONFIG_NET_9P is not set
@@ -772,6 +795,7 @@ CONFIG_MTD_PHYSMAP_OF=y
772# CONFIG_MTD_UBI is not set 795# CONFIG_MTD_UBI is not set
773CONFIG_OF_DEVICE=y 796CONFIG_OF_DEVICE=y
774CONFIG_OF_I2C=m 797CONFIG_OF_I2C=m
798CONFIG_OF_MDIO=y
775# CONFIG_PARPORT is not set 799# CONFIG_PARPORT is not set
776CONFIG_BLK_DEV=y 800CONFIG_BLK_DEV=y
777# CONFIG_BLK_DEV_FD is not set 801# CONFIG_BLK_DEV_FD is not set
@@ -816,10 +840,6 @@ CONFIG_BLK_DEV_SR=m
816CONFIG_BLK_DEV_SR_VENDOR=y 840CONFIG_BLK_DEV_SR_VENDOR=y
817CONFIG_CHR_DEV_SG=m 841CONFIG_CHR_DEV_SG=m
818# CONFIG_CHR_DEV_SCH is not set 842# CONFIG_CHR_DEV_SCH is not set
819
820#
821# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
822#
823# CONFIG_SCSI_MULTI_LUN is not set 843# CONFIG_SCSI_MULTI_LUN is not set
824CONFIG_SCSI_CONSTANTS=y 844CONFIG_SCSI_CONSTANTS=y
825CONFIG_SCSI_LOGGING=y 845CONFIG_SCSI_LOGGING=y
@@ -836,6 +856,7 @@ CONFIG_SCSI_ISCSI_ATTRS=m
836CONFIG_SCSI_SRP_ATTRS=m 856CONFIG_SCSI_SRP_ATTRS=m
837CONFIG_SCSI_LOWLEVEL=y 857CONFIG_SCSI_LOWLEVEL=y
838# CONFIG_ISCSI_TCP is not set 858# CONFIG_ISCSI_TCP is not set
859# CONFIG_SCSI_BNX2_ISCSI is not set
839CONFIG_BLK_DEV_3W_XXXX_RAID=m 860CONFIG_BLK_DEV_3W_XXXX_RAID=m
840CONFIG_SCSI_3W_9XXX=m 861CONFIG_SCSI_3W_9XXX=m
841CONFIG_SCSI_ACARD=m 862CONFIG_SCSI_ACARD=m
@@ -854,6 +875,7 @@ CONFIG_AIC79XX_RESET_DELAY_MS=15000
854CONFIG_AIC79XX_DEBUG_MASK=0 875CONFIG_AIC79XX_DEBUG_MASK=0
855# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set 876# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
856# CONFIG_SCSI_AIC94XX is not set 877# CONFIG_SCSI_AIC94XX is not set
878# CONFIG_SCSI_MVSAS is not set
857# CONFIG_SCSI_DPT_I2O is not set 879# CONFIG_SCSI_DPT_I2O is not set
858# CONFIG_SCSI_ADVANSYS is not set 880# CONFIG_SCSI_ADVANSYS is not set
859CONFIG_SCSI_ARCMSR=m 881CONFIG_SCSI_ARCMSR=m
@@ -875,7 +897,6 @@ CONFIG_SCSI_GDTH=m
875CONFIG_SCSI_IPS=m 897CONFIG_SCSI_IPS=m
876CONFIG_SCSI_INITIO=m 898CONFIG_SCSI_INITIO=m
877# CONFIG_SCSI_INIA100 is not set 899# CONFIG_SCSI_INIA100 is not set
878# CONFIG_SCSI_MVSAS is not set
879# CONFIG_SCSI_STEX is not set 900# CONFIG_SCSI_STEX is not set
880CONFIG_SCSI_SYM53C8XX_2=m 901CONFIG_SCSI_SYM53C8XX_2=m
881CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 902CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
@@ -903,14 +924,17 @@ CONFIG_SCSI_LPFC=m
903# 924#
904 925
905# 926#
906# Enable only one of the two stacks, unless you know what you are doing 927# You can enable one or both FireWire driver stacks.
928#
929
930#
931# See the help texts for more information.
907# 932#
908# CONFIG_FIREWIRE is not set 933# CONFIG_FIREWIRE is not set
909# CONFIG_IEEE1394 is not set 934# CONFIG_IEEE1394 is not set
910# CONFIG_I2O is not set 935# CONFIG_I2O is not set
911# CONFIG_MACINTOSH_DRIVERS is not set 936# CONFIG_MACINTOSH_DRIVERS is not set
912CONFIG_NETDEVICES=y 937CONFIG_NETDEVICES=y
913CONFIG_COMPAT_NET_DEV_OPS=y
914CONFIG_DUMMY=m 938CONFIG_DUMMY=m
915CONFIG_BONDING=m 939CONFIG_BONDING=m
916# CONFIG_MACVLAN is not set 940# CONFIG_MACVLAN is not set
@@ -957,6 +981,7 @@ CONFIG_MII=y
957# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 981# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
958# CONFIG_NET_PCI is not set 982# CONFIG_NET_PCI is not set
959# CONFIG_B44 is not set 983# CONFIG_B44 is not set
984# CONFIG_KS8842 is not set
960# CONFIG_ATL2 is not set 985# CONFIG_ATL2 is not set
961CONFIG_NETDEV_1000=y 986CONFIG_NETDEV_1000=y
962# CONFIG_ACENIC is not set 987# CONFIG_ACENIC is not set
@@ -976,6 +1001,7 @@ CONFIG_NETDEV_1000=y
976# CONFIG_VIA_VELOCITY is not set 1001# CONFIG_VIA_VELOCITY is not set
977# CONFIG_TIGON3 is not set 1002# CONFIG_TIGON3 is not set
978# CONFIG_BNX2 is not set 1003# CONFIG_BNX2 is not set
1004# CONFIG_CNIC is not set
979CONFIG_MV643XX_ETH=y 1005CONFIG_MV643XX_ETH=y
980# CONFIG_QLA3XXX is not set 1006# CONFIG_QLA3XXX is not set
981# CONFIG_ATL1 is not set 1007# CONFIG_ATL1 is not set
@@ -1177,13 +1203,17 @@ CONFIG_I2C_MV64XXX=m
1177CONFIG_SENSORS_PCF8574=m 1203CONFIG_SENSORS_PCF8574=m
1178# CONFIG_PCF8575 is not set 1204# CONFIG_PCF8575 is not set
1179# CONFIG_SENSORS_PCA9539 is not set 1205# CONFIG_SENSORS_PCA9539 is not set
1180# CONFIG_SENSORS_MAX6875 is not set
1181# CONFIG_SENSORS_TSL2550 is not set 1206# CONFIG_SENSORS_TSL2550 is not set
1182# CONFIG_I2C_DEBUG_CORE is not set 1207# CONFIG_I2C_DEBUG_CORE is not set
1183# CONFIG_I2C_DEBUG_ALGO is not set 1208# CONFIG_I2C_DEBUG_ALGO is not set
1184# CONFIG_I2C_DEBUG_BUS is not set 1209# CONFIG_I2C_DEBUG_BUS is not set
1185# CONFIG_I2C_DEBUG_CHIP is not set 1210# CONFIG_I2C_DEBUG_CHIP is not set
1186# CONFIG_SPI is not set 1211# CONFIG_SPI is not set
1212
1213#
1214# PPS support
1215#
1216# CONFIG_PPS is not set
1187CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1217CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1188# CONFIG_GPIOLIB is not set 1218# CONFIG_GPIOLIB is not set
1189# CONFIG_W1 is not set 1219# CONFIG_W1 is not set
@@ -1238,6 +1268,7 @@ CONFIG_SENSORS_SMSC47M1=m
1238CONFIG_SENSORS_SMSC47B397=m 1268CONFIG_SENSORS_SMSC47B397=m
1239# CONFIG_SENSORS_ADS7828 is not set 1269# CONFIG_SENSORS_ADS7828 is not set
1240# CONFIG_SENSORS_THMC50 is not set 1270# CONFIG_SENSORS_THMC50 is not set
1271# CONFIG_SENSORS_TMP401 is not set
1241CONFIG_SENSORS_VIA686A=m 1272CONFIG_SENSORS_VIA686A=m
1242# CONFIG_SENSORS_VT1211 is not set 1273# CONFIG_SENSORS_VT1211 is not set
1243# CONFIG_SENSORS_VT8231 is not set 1274# CONFIG_SENSORS_VT8231 is not set
@@ -1266,7 +1297,6 @@ CONFIG_SOFT_WATCHDOG=m
1266# 1297#
1267CONFIG_PCIPCWATCHDOG=m 1298CONFIG_PCIPCWATCHDOG=m
1268CONFIG_WDTPCI=m 1299CONFIG_WDTPCI=m
1269CONFIG_WDT_501_PCI=y
1270 1300
1271# 1301#
1272# USB-based Watchdog Cards 1302# USB-based Watchdog Cards
@@ -1289,23 +1319,9 @@ CONFIG_SSB_POSSIBLE=y
1289# CONFIG_MFD_WM8400 is not set 1319# CONFIG_MFD_WM8400 is not set
1290# CONFIG_MFD_WM8350_I2C is not set 1320# CONFIG_MFD_WM8350_I2C is not set
1291# CONFIG_MFD_PCF50633 is not set 1321# CONFIG_MFD_PCF50633 is not set
1322# CONFIG_AB3100_CORE is not set
1292# CONFIG_REGULATOR is not set 1323# CONFIG_REGULATOR is not set
1293 1324# CONFIG_MEDIA_SUPPORT is not set
1294#
1295# Multimedia devices
1296#
1297
1298#
1299# Multimedia core support
1300#
1301# CONFIG_VIDEO_DEV is not set
1302# CONFIG_DVB_CORE is not set
1303# CONFIG_VIDEO_MEDIA is not set
1304
1305#
1306# Multimedia drivers
1307#
1308# CONFIG_DAB is not set
1309 1325
1310# 1326#
1311# Graphics support 1327# Graphics support
@@ -1354,6 +1370,7 @@ CONFIG_USB_MON=m
1354# USB Host Controller Drivers 1370# USB Host Controller Drivers
1355# 1371#
1356# CONFIG_USB_C67X00_HCD is not set 1372# CONFIG_USB_C67X00_HCD is not set
1373# CONFIG_USB_XHCI_HCD is not set
1357CONFIG_USB_EHCI_HCD=m 1374CONFIG_USB_EHCI_HCD=m
1358CONFIG_USB_EHCI_ROOT_HUB_TT=y 1375CONFIG_USB_EHCI_ROOT_HUB_TT=y
1359# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1376# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1362,9 +1379,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1362# CONFIG_USB_ISP116X_HCD is not set 1379# CONFIG_USB_ISP116X_HCD is not set
1363# CONFIG_USB_ISP1760_HCD is not set 1380# CONFIG_USB_ISP1760_HCD is not set
1364CONFIG_USB_OHCI_HCD=m 1381CONFIG_USB_OHCI_HCD=m
1365CONFIG_USB_OHCI_HCD_PPC_OF=y
1366CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1382CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1367# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1383# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1384CONFIG_USB_OHCI_HCD_PPC_OF=y
1368CONFIG_USB_OHCI_HCD_PCI=y 1385CONFIG_USB_OHCI_HCD_PCI=y
1369CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1386CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1370CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1387CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1545,6 +1562,10 @@ CONFIG_DMADEVICES=y
1545# 1562#
1546# CONFIG_AUXDISPLAY is not set 1563# CONFIG_AUXDISPLAY is not set
1547# CONFIG_UIO is not set 1564# CONFIG_UIO is not set
1565
1566#
1567# TI VLYNQ
1568#
1548# CONFIG_STAGING is not set 1569# CONFIG_STAGING is not set
1549 1570
1550# 1571#
@@ -1563,11 +1584,12 @@ CONFIG_FS_MBCACHE=m
1563# CONFIG_REISERFS_FS is not set 1584# CONFIG_REISERFS_FS is not set
1564# CONFIG_JFS_FS is not set 1585# CONFIG_JFS_FS is not set
1565CONFIG_FS_POSIX_ACL=y 1586CONFIG_FS_POSIX_ACL=y
1566CONFIG_FILE_LOCKING=y
1567# CONFIG_XFS_FS is not set 1587# CONFIG_XFS_FS is not set
1568# CONFIG_GFS2_FS is not set 1588# CONFIG_GFS2_FS is not set
1569# CONFIG_OCFS2_FS is not set 1589# CONFIG_OCFS2_FS is not set
1570# CONFIG_BTRFS_FS is not set 1590# CONFIG_BTRFS_FS is not set
1591CONFIG_FILE_LOCKING=y
1592CONFIG_FSNOTIFY=y
1571CONFIG_DNOTIFY=y 1593CONFIG_DNOTIFY=y
1572CONFIG_INOTIFY=y 1594CONFIG_INOTIFY=y
1573CONFIG_INOTIFY_USER=y 1595CONFIG_INOTIFY_USER=y
@@ -1652,6 +1674,7 @@ CONFIG_NFS_FS=y
1652CONFIG_NFS_V3=y 1674CONFIG_NFS_V3=y
1653CONFIG_NFS_V3_ACL=y 1675CONFIG_NFS_V3_ACL=y
1654CONFIG_NFS_V4=y 1676CONFIG_NFS_V4=y
1677# CONFIG_NFS_V4_1 is not set
1655CONFIG_ROOT_NFS=y 1678CONFIG_ROOT_NFS=y
1656# CONFIG_NFSD is not set 1679# CONFIG_NFSD is not set
1657CONFIG_LOCKD=y 1680CONFIG_LOCKD=y
@@ -1764,6 +1787,7 @@ CONFIG_HAS_DMA=y
1764CONFIG_CHECK_SIGNATURE=y 1787CONFIG_CHECK_SIGNATURE=y
1765CONFIG_HAVE_LMB=y 1788CONFIG_HAVE_LMB=y
1766CONFIG_NLATTR=y 1789CONFIG_NLATTR=y
1790CONFIG_GENERIC_ATOMIC64=y
1767 1791
1768# 1792#
1769# Kernel hacking 1793# Kernel hacking
@@ -1794,6 +1818,9 @@ CONFIG_SCHED_DEBUG=y
1794# CONFIG_RT_MUTEX_TESTER is not set 1818# CONFIG_RT_MUTEX_TESTER is not set
1795CONFIG_DEBUG_SPINLOCK=y 1819CONFIG_DEBUG_SPINLOCK=y
1796# CONFIG_DEBUG_MUTEXES is not set 1820# CONFIG_DEBUG_MUTEXES is not set
1821# CONFIG_DEBUG_LOCK_ALLOC is not set
1822# CONFIG_PROVE_LOCKING is not set
1823# CONFIG_LOCK_STAT is not set
1797CONFIG_DEBUG_SPINLOCK_SLEEP=y 1824CONFIG_DEBUG_SPINLOCK_SLEEP=y
1798# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1825# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1799CONFIG_STACKTRACE=y 1826CONFIG_STACKTRACE=y
@@ -1807,7 +1834,6 @@ CONFIG_DEBUG_MEMORY_INIT=y
1807# CONFIG_DEBUG_LIST is not set 1834# CONFIG_DEBUG_LIST is not set
1808# CONFIG_DEBUG_SG is not set 1835# CONFIG_DEBUG_SG is not set
1809# CONFIG_DEBUG_NOTIFIERS is not set 1836# CONFIG_DEBUG_NOTIFIERS is not set
1810# CONFIG_BOOT_PRINTK_DELAY is not set
1811# CONFIG_RCU_TORTURE_TEST is not set 1837# CONFIG_RCU_TORTURE_TEST is not set
1812# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1838# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1813# CONFIG_KPROBES_SANITY_TEST is not set 1839# CONFIG_KPROBES_SANITY_TEST is not set
@@ -1824,30 +1850,34 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1824CONFIG_HAVE_DYNAMIC_FTRACE=y 1850CONFIG_HAVE_DYNAMIC_FTRACE=y
1825CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1851CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1826CONFIG_RING_BUFFER=y 1852CONFIG_RING_BUFFER=y
1853CONFIG_EVENT_TRACING=y
1854CONFIG_CONTEXT_SWITCH_TRACER=y
1827CONFIG_TRACING=y 1855CONFIG_TRACING=y
1828CONFIG_TRACING_SUPPORT=y 1856CONFIG_TRACING_SUPPORT=y
1829 1857CONFIG_FTRACE=y
1830#
1831# Tracers
1832#
1833# CONFIG_FUNCTION_TRACER is not set 1858# CONFIG_FUNCTION_TRACER is not set
1859# CONFIG_IRQSOFF_TRACER is not set
1834# CONFIG_SCHED_TRACER is not set 1860# CONFIG_SCHED_TRACER is not set
1835# CONFIG_CONTEXT_SWITCH_TRACER is not set 1861# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1836# CONFIG_EVENT_TRACER is not set
1837# CONFIG_BOOT_TRACER is not set 1862# CONFIG_BOOT_TRACER is not set
1838# CONFIG_TRACE_BRANCH_PROFILING is not set 1863CONFIG_BRANCH_PROFILE_NONE=y
1864# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1865# CONFIG_PROFILE_ALL_BRANCHES is not set
1839# CONFIG_STACK_TRACER is not set 1866# CONFIG_STACK_TRACER is not set
1840# CONFIG_KMEMTRACE is not set 1867# CONFIG_KMEMTRACE is not set
1841# CONFIG_WORKQUEUE_TRACER is not set 1868# CONFIG_WORKQUEUE_TRACER is not set
1842# CONFIG_BLK_DEV_IO_TRACE is not set 1869# CONFIG_BLK_DEV_IO_TRACE is not set
1843# CONFIG_FTRACE_STARTUP_TEST is not set 1870# CONFIG_RING_BUFFER_BENCHMARK is not set
1844# CONFIG_DYNAMIC_DEBUG is not set 1871# CONFIG_DYNAMIC_DEBUG is not set
1845# CONFIG_SAMPLES is not set 1872# CONFIG_SAMPLES is not set
1846CONFIG_HAVE_ARCH_KGDB=y 1873CONFIG_HAVE_ARCH_KGDB=y
1847# CONFIG_KGDB is not set 1874# CONFIG_KGDB is not set
1875# CONFIG_PPC_DISABLE_WERROR is not set
1876CONFIG_PPC_WERROR=y
1848CONFIG_PRINT_STACK_DEPTH=64 1877CONFIG_PRINT_STACK_DEPTH=64
1849CONFIG_DEBUG_STACKOVERFLOW=y 1878CONFIG_DEBUG_STACKOVERFLOW=y
1850CONFIG_DEBUG_STACK_USAGE=y 1879CONFIG_DEBUG_STACK_USAGE=y
1880# CONFIG_PPC_EMULATED_STATS is not set
1851# CONFIG_CODE_PATCHING_SELFTEST is not set 1881# CONFIG_CODE_PATCHING_SELFTEST is not set
1852# CONFIG_FTR_FIXUP_SELFTEST is not set 1882# CONFIG_FTR_FIXUP_SELFTEST is not set
1853# CONFIG_MSI_BITMAP_SELFTEST is not set 1883# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -1869,7 +1899,6 @@ CONFIG_SECURITY_NETWORK=y
1869# CONFIG_SECURITY_NETWORK_XFRM is not set 1899# CONFIG_SECURITY_NETWORK_XFRM is not set
1870# CONFIG_SECURITY_PATH is not set 1900# CONFIG_SECURITY_PATH is not set
1871# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1901# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1872CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1873CONFIG_SECURITY_SELINUX=y 1902CONFIG_SECURITY_SELINUX=y
1874CONFIG_SECURITY_SELINUX_BOOTPARAM=y 1903CONFIG_SECURITY_SELINUX_BOOTPARAM=y
1875CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 1904CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
diff --git a/arch/powerpc/configs/ep8248e_defconfig b/arch/powerpc/configs/ep8248e_defconfig
index 04915c3a43f6..0aa5b43ffeb2 100644
--- a/arch/powerpc/configs/ep8248e_defconfig
+++ b/arch/powerpc/configs/ep8248e_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:52 2009 4# Wed Jul 29 23:31:49 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,11 +56,13 @@ CONFIG_OF=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 60# CONFIG_DEFAULT_UIMAGE is not set
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -99,7 +104,6 @@ CONFIG_SYSCTL_SYSCALL=y
99CONFIG_KALLSYMS=y 104CONFIG_KALLSYMS=y
100CONFIG_KALLSYMS_ALL=y 105CONFIG_KALLSYMS_ALL=y
101# CONFIG_KALLSYMS_EXTRA_PASS is not set 106# CONFIG_KALLSYMS_EXTRA_PASS is not set
102# CONFIG_STRIP_ASM_SYMS is not set
103CONFIG_HOTPLUG=y 107CONFIG_HOTPLUG=y
104CONFIG_PRINTK=y 108CONFIG_PRINTK=y
105CONFIG_BUG=y 109CONFIG_BUG=y
@@ -112,8 +116,15 @@ CONFIG_TIMERFD=y
112CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
113CONFIG_SHMEM=y 117CONFIG_SHMEM=y
114CONFIG_AIO=y 118CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y
120
121#
122# Performance Counters
123#
124# CONFIG_PERF_COUNTERS is not set
115CONFIG_VM_EVENT_COUNTERS=y 125CONFIG_VM_EVENT_COUNTERS=y
116CONFIG_PCI_QUIRKS=y 126CONFIG_PCI_QUIRKS=y
127# CONFIG_STRIP_ASM_SYMS is not set
117CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
118CONFIG_SLAB=y 129CONFIG_SLAB=y
119# CONFIG_SLUB is not set 130# CONFIG_SLUB is not set
@@ -127,6 +138,10 @@ CONFIG_HAVE_KPROBES=y
127CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
128CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
129CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141
142#
143# GCOV-based kernel profiling
144#
130# CONFIG_SLOW_WORK is not set 145# CONFIG_SLOW_WORK is not set
131# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
132CONFIG_SLABINFO=y 147CONFIG_SLABINFO=y
@@ -134,7 +149,7 @@ CONFIG_RT_MUTEXES=y
134CONFIG_BASE_SMALL=0 149CONFIG_BASE_SMALL=0
135# CONFIG_MODULES is not set 150# CONFIG_MODULES is not set
136CONFIG_BLOCK=y 151CONFIG_BLOCK=y
137# CONFIG_LBD is not set 152CONFIG_LBDAF=y
138# CONFIG_BLK_DEV_INTEGRITY is not set 153# CONFIG_BLK_DEV_INTEGRITY is not set
139 154
140# 155#
@@ -213,6 +228,7 @@ CONFIG_BINFMT_ELF=y
213# CONFIG_HAVE_AOUT is not set 228# CONFIG_HAVE_AOUT is not set
214CONFIG_BINFMT_MISC=y 229CONFIG_BINFMT_MISC=y
215# CONFIG_IOMMU_HELPER is not set 230# CONFIG_IOMMU_HELPER is not set
231# CONFIG_SWIOTLB is not set
216CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
217CONFIG_ARCH_HAS_WALK_MEMORY=y 233CONFIG_ARCH_HAS_WALK_MEMORY=y
218CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -228,9 +244,9 @@ CONFIG_MIGRATION=y
228CONFIG_ZONE_DMA_FLAG=1 244CONFIG_ZONE_DMA_FLAG=1
229CONFIG_BOUNCE=y 245CONFIG_BOUNCE=y
230CONFIG_VIRT_TO_BUS=y 246CONFIG_VIRT_TO_BUS=y
231CONFIG_UNEVICTABLE_LRU=y
232CONFIG_HAVE_MLOCK=y 247CONFIG_HAVE_MLOCK=y
233CONFIG_HAVE_MLOCKED_PAGE_BIT=y 248CONFIG_HAVE_MLOCKED_PAGE_BIT=y
249CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
234CONFIG_PPC_4K_PAGES=y 250CONFIG_PPC_4K_PAGES=y
235# CONFIG_PPC_16K_PAGES is not set 251# CONFIG_PPC_16K_PAGES is not set
236# CONFIG_PPC_64K_PAGES is not set 252# CONFIG_PPC_64K_PAGES is not set
@@ -300,6 +316,7 @@ CONFIG_IP_PNP_BOOTP=y
300# CONFIG_NET_IPIP is not set 316# CONFIG_NET_IPIP is not set
301# CONFIG_NET_IPGRE is not set 317# CONFIG_NET_IPGRE is not set
302# CONFIG_IP_MROUTE is not set 318# CONFIG_IP_MROUTE is not set
319# CONFIG_ARPD is not set
303CONFIG_SYN_COOKIES=y 320CONFIG_SYN_COOKIES=y
304# CONFIG_INET_AH is not set 321# CONFIG_INET_AH is not set
305# CONFIG_INET_ESP is not set 322# CONFIG_INET_ESP is not set
@@ -380,7 +397,11 @@ CONFIG_WIRELESS=y
380CONFIG_WIRELESS_OLD_REGULATORY=y 397CONFIG_WIRELESS_OLD_REGULATORY=y
381# CONFIG_WIRELESS_EXT is not set 398# CONFIG_WIRELESS_EXT is not set
382# CONFIG_LIB80211 is not set 399# CONFIG_LIB80211 is not set
383# CONFIG_MAC80211 is not set 400
401#
402# CFG80211 needs to be enabled for MAC80211
403#
404CONFIG_MAC80211_DEFAULT_PS_VALUE=0
384# CONFIG_WIMAX is not set 405# CONFIG_WIMAX is not set
385# CONFIG_RFKILL is not set 406# CONFIG_RFKILL is not set
386 407
@@ -485,6 +506,7 @@ CONFIG_MTD_PHYSMAP_OF=y
485# CONFIG_MTD_UBI is not set 506# CONFIG_MTD_UBI is not set
486CONFIG_OF_DEVICE=y 507CONFIG_OF_DEVICE=y
487CONFIG_OF_GPIO=y 508CONFIG_OF_GPIO=y
509CONFIG_OF_MDIO=y
488# CONFIG_PARPORT is not set 510# CONFIG_PARPORT is not set
489CONFIG_BLK_DEV=y 511CONFIG_BLK_DEV=y
490# CONFIG_BLK_DEV_FD is not set 512# CONFIG_BLK_DEV_FD is not set
@@ -520,13 +542,17 @@ CONFIG_HAVE_IDE=y
520# 542#
521 543
522# 544#
523# A new alternative FireWire stack is available with EXPERIMENTAL=y 545# You can enable one or both FireWire driver stacks.
524# 546#
547
548#
549# See the help texts for more information.
550#
551# CONFIG_FIREWIRE is not set
525# CONFIG_IEEE1394 is not set 552# CONFIG_IEEE1394 is not set
526# CONFIG_I2O is not set 553# CONFIG_I2O is not set
527# CONFIG_MACINTOSH_DRIVERS is not set 554# CONFIG_MACINTOSH_DRIVERS is not set
528CONFIG_NETDEVICES=y 555CONFIG_NETDEVICES=y
529CONFIG_COMPAT_NET_DEV_OPS=y
530# CONFIG_DUMMY is not set 556# CONFIG_DUMMY is not set
531# CONFIG_BONDING is not set 557# CONFIG_BONDING is not set
532# CONFIG_EQUALIZER is not set 558# CONFIG_EQUALIZER is not set
@@ -573,6 +599,7 @@ CONFIG_MII=y
573# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 599# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
574# CONFIG_NET_PCI is not set 600# CONFIG_NET_PCI is not set
575# CONFIG_B44 is not set 601# CONFIG_B44 is not set
602# CONFIG_KS8842 is not set
576# CONFIG_ATL2 is not set 603# CONFIG_ATL2 is not set
577CONFIG_FS_ENET=y 604CONFIG_FS_ENET=y
578# CONFIG_FS_ENET_HAS_SCC is not set 605# CONFIG_FS_ENET_HAS_SCC is not set
@@ -594,8 +621,10 @@ CONFIG_NETDEV_1000=y
594# CONFIG_VIA_VELOCITY is not set 621# CONFIG_VIA_VELOCITY is not set
595# CONFIG_TIGON3 is not set 622# CONFIG_TIGON3 is not set
596# CONFIG_BNX2 is not set 623# CONFIG_BNX2 is not set
624# CONFIG_CNIC is not set
597# CONFIG_FSL_PQ_MDIO is not set 625# CONFIG_FSL_PQ_MDIO is not set
598# CONFIG_GIANFAR is not set 626# CONFIG_GIANFAR is not set
627# CONFIG_MV643XX_ETH is not set
599# CONFIG_QLA3XXX is not set 628# CONFIG_QLA3XXX is not set
600# CONFIG_ATL1 is not set 629# CONFIG_ATL1 is not set
601# CONFIG_JME is not set 630# CONFIG_JME is not set
@@ -685,6 +714,10 @@ CONFIG_HW_RANDOM=y
685CONFIG_DEVPORT=y 714CONFIG_DEVPORT=y
686# CONFIG_I2C is not set 715# CONFIG_I2C is not set
687# CONFIG_SPI is not set 716# CONFIG_SPI is not set
717
718#
719# PPS support
720#
688CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 721CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
689CONFIG_ARCH_REQUIRE_GPIOLIB=y 722CONFIG_ARCH_REQUIRE_GPIOLIB=y
690CONFIG_GPIOLIB=y 723CONFIG_GPIOLIB=y
@@ -728,22 +761,7 @@ CONFIG_SSB_POSSIBLE=y
728# CONFIG_HTC_PASIC3 is not set 761# CONFIG_HTC_PASIC3 is not set
729# CONFIG_MFD_TMIO is not set 762# CONFIG_MFD_TMIO is not set
730# CONFIG_REGULATOR is not set 763# CONFIG_REGULATOR is not set
731 764# CONFIG_MEDIA_SUPPORT is not set
732#
733# Multimedia devices
734#
735
736#
737# Multimedia core support
738#
739# CONFIG_VIDEO_DEV is not set
740# CONFIG_DVB_CORE is not set
741# CONFIG_VIDEO_MEDIA is not set
742
743#
744# Multimedia drivers
745#
746CONFIG_DAB=y
747 765
748# 766#
749# Graphics support 767# Graphics support
@@ -771,6 +789,10 @@ CONFIG_DAB=y
771# CONFIG_DMADEVICES is not set 789# CONFIG_DMADEVICES is not set
772# CONFIG_AUXDISPLAY is not set 790# CONFIG_AUXDISPLAY is not set
773# CONFIG_UIO is not set 791# CONFIG_UIO is not set
792
793#
794# TI VLYNQ
795#
774# CONFIG_STAGING is not set 796# CONFIG_STAGING is not set
775 797
776# 798#
@@ -787,9 +809,10 @@ CONFIG_JBD=y
787# CONFIG_REISERFS_FS is not set 809# CONFIG_REISERFS_FS is not set
788# CONFIG_JFS_FS is not set 810# CONFIG_JFS_FS is not set
789# CONFIG_FS_POSIX_ACL is not set 811# CONFIG_FS_POSIX_ACL is not set
790CONFIG_FILE_LOCKING=y
791# CONFIG_XFS_FS is not set 812# CONFIG_XFS_FS is not set
792# CONFIG_OCFS2_FS is not set 813# CONFIG_OCFS2_FS is not set
814CONFIG_FILE_LOCKING=y
815CONFIG_FSNOTIFY=y
793CONFIG_DNOTIFY=y 816CONFIG_DNOTIFY=y
794CONFIG_INOTIFY=y 817CONFIG_INOTIFY=y
795CONFIG_INOTIFY_USER=y 818CONFIG_INOTIFY_USER=y
@@ -935,6 +958,7 @@ CONFIG_HAS_IOPORT=y
935CONFIG_HAS_DMA=y 958CONFIG_HAS_DMA=y
936CONFIG_HAVE_LMB=y 959CONFIG_HAVE_LMB=y
937CONFIG_NLATTR=y 960CONFIG_NLATTR=y
961CONFIG_GENERIC_ATOMIC64=y
938 962
939# 963#
940# Kernel hacking 964# Kernel hacking
@@ -960,6 +984,9 @@ CONFIG_DEBUG_KERNEL=y
960# CONFIG_RT_MUTEX_TESTER is not set 984# CONFIG_RT_MUTEX_TESTER is not set
961# CONFIG_DEBUG_SPINLOCK is not set 985# CONFIG_DEBUG_SPINLOCK is not set
962# CONFIG_DEBUG_MUTEXES is not set 986# CONFIG_DEBUG_MUTEXES is not set
987# CONFIG_DEBUG_LOCK_ALLOC is not set
988# CONFIG_PROVE_LOCKING is not set
989# CONFIG_LOCK_STAT is not set
963# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 990# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
964# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 991# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
965# CONFIG_DEBUG_KOBJECT is not set 992# CONFIG_DEBUG_KOBJECT is not set
@@ -971,7 +998,6 @@ CONFIG_DEBUG_INFO=y
971# CONFIG_DEBUG_LIST is not set 998# CONFIG_DEBUG_LIST is not set
972# CONFIG_DEBUG_SG is not set 999# CONFIG_DEBUG_SG is not set
973# CONFIG_DEBUG_NOTIFIERS is not set 1000# CONFIG_DEBUG_NOTIFIERS is not set
974# CONFIG_BOOT_PRINTK_DELAY is not set
975# CONFIG_RCU_TORTURE_TEST is not set 1001# CONFIG_RCU_TORTURE_TEST is not set
976# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1002# CONFIG_RCU_CPU_STALL_DETECTOR is not set
977# CONFIG_BACKTRACE_SELF_TEST is not set 1003# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -985,22 +1011,23 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
985CONFIG_HAVE_DYNAMIC_FTRACE=y 1011CONFIG_HAVE_DYNAMIC_FTRACE=y
986CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1012CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
987CONFIG_TRACING_SUPPORT=y 1013CONFIG_TRACING_SUPPORT=y
988 1014CONFIG_FTRACE=y
989#
990# Tracers
991#
992# CONFIG_FUNCTION_TRACER is not set 1015# CONFIG_FUNCTION_TRACER is not set
1016# CONFIG_IRQSOFF_TRACER is not set
993# CONFIG_SCHED_TRACER is not set 1017# CONFIG_SCHED_TRACER is not set
994# CONFIG_CONTEXT_SWITCH_TRACER is not set 1018# CONFIG_ENABLE_DEFAULT_TRACERS is not set
995# CONFIG_EVENT_TRACER is not set
996# CONFIG_BOOT_TRACER is not set 1019# CONFIG_BOOT_TRACER is not set
997# CONFIG_TRACE_BRANCH_PROFILING is not set 1020CONFIG_BRANCH_PROFILE_NONE=y
1021# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1022# CONFIG_PROFILE_ALL_BRANCHES is not set
998# CONFIG_STACK_TRACER is not set 1023# CONFIG_STACK_TRACER is not set
999# CONFIG_KMEMTRACE is not set 1024# CONFIG_KMEMTRACE is not set
1000# CONFIG_WORKQUEUE_TRACER is not set 1025# CONFIG_WORKQUEUE_TRACER is not set
1001# CONFIG_BLK_DEV_IO_TRACE is not set 1026# CONFIG_BLK_DEV_IO_TRACE is not set
1002# CONFIG_SAMPLES is not set 1027# CONFIG_SAMPLES is not set
1003CONFIG_HAVE_ARCH_KGDB=y 1028CONFIG_HAVE_ARCH_KGDB=y
1029# CONFIG_PPC_DISABLE_WERROR is not set
1030CONFIG_PPC_WERROR=y
1004CONFIG_PRINT_STACK_DEPTH=64 1031CONFIG_PRINT_STACK_DEPTH=64
1005# CONFIG_DEBUG_STACKOVERFLOW is not set 1032# CONFIG_DEBUG_STACKOVERFLOW is not set
1006# CONFIG_DEBUG_STACK_USAGE is not set 1033# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/ep88xc_defconfig b/arch/powerpc/configs/ep88xc_defconfig
index c2a439595f4d..2c292e25cc01 100644
--- a/arch/powerpc/configs/ep88xc_defconfig
+++ b/arch/powerpc/configs/ep88xc_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:53 2009 4# Wed Jul 29 23:31:49 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -49,11 +50,13 @@ CONFIG_OF=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53# CONFIG_PPC_DCR_NATIVE is not set 55# CONFIG_PPC_DCR_NATIVE is not set
54# CONFIG_PPC_DCR_MMIO is not set 56# CONFIG_PPC_DCR_MMIO is not set
55CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 57CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
56CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 58CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
59CONFIG_CONSTRUCTORS=y
57 60
58# 61#
59# General setup 62# General setup
@@ -100,7 +103,6 @@ CONFIG_EMBEDDED=y
100CONFIG_KALLSYMS=y 103CONFIG_KALLSYMS=y
101# CONFIG_KALLSYMS_ALL is not set 104# CONFIG_KALLSYMS_ALL is not set
102# CONFIG_KALLSYMS_EXTRA_PASS is not set 105# CONFIG_KALLSYMS_EXTRA_PASS is not set
103# CONFIG_STRIP_ASM_SYMS is not set
104CONFIG_HOTPLUG=y 106CONFIG_HOTPLUG=y
105CONFIG_PRINTK=y 107CONFIG_PRINTK=y
106CONFIG_BUG=y 108CONFIG_BUG=y
@@ -113,8 +115,15 @@ CONFIG_TIMERFD=y
113CONFIG_EVENTFD=y 115CONFIG_EVENTFD=y
114CONFIG_SHMEM=y 116CONFIG_SHMEM=y
115CONFIG_AIO=y 117CONFIG_AIO=y
118CONFIG_HAVE_PERF_COUNTERS=y
119
120#
121# Performance Counters
122#
123# CONFIG_PERF_COUNTERS is not set
116# CONFIG_VM_EVENT_COUNTERS is not set 124# CONFIG_VM_EVENT_COUNTERS is not set
117CONFIG_SLUB_DEBUG=y 125CONFIG_SLUB_DEBUG=y
126# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_COMPAT_BRK=y 127CONFIG_COMPAT_BRK=y
119# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
120CONFIG_SLUB=y 129CONFIG_SLUB=y
@@ -128,13 +137,17 @@ CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 137CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 138CONFIG_HAVE_ARCH_TRACEHOOK=y
130CONFIG_HAVE_CLK=y 139CONFIG_HAVE_CLK=y
140
141#
142# GCOV-based kernel profiling
143#
131# CONFIG_SLOW_WORK is not set 144# CONFIG_SLOW_WORK is not set
132# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 145# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
133CONFIG_SLABINFO=y 146CONFIG_SLABINFO=y
134CONFIG_BASE_SMALL=1 147CONFIG_BASE_SMALL=1
135# CONFIG_MODULES is not set 148# CONFIG_MODULES is not set
136CONFIG_BLOCK=y 149CONFIG_BLOCK=y
137# CONFIG_LBD is not set 150CONFIG_LBDAF=y
138# CONFIG_BLK_DEV_BSG is not set 151# CONFIG_BLK_DEV_BSG is not set
139# CONFIG_BLK_DEV_INTEGRITY is not set 152# CONFIG_BLK_DEV_INTEGRITY is not set
140 153
@@ -220,6 +233,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_MATH_EMULATION is not set 233# CONFIG_MATH_EMULATION is not set
221CONFIG_8XX_MINIMAL_FPEMU=y 234CONFIG_8XX_MINIMAL_FPEMU=y
222# CONFIG_IOMMU_HELPER is not set 235# CONFIG_IOMMU_HELPER is not set
236# CONFIG_SWIOTLB is not set
223CONFIG_PPC_NEED_DMA_SYNC_OPS=y 237CONFIG_PPC_NEED_DMA_SYNC_OPS=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
225CONFIG_ARCH_HAS_WALK_MEMORY=y 239CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -239,9 +253,9 @@ CONFIG_MIGRATION=y
239CONFIG_ZONE_DMA_FLAG=1 253CONFIG_ZONE_DMA_FLAG=1
240CONFIG_BOUNCE=y 254CONFIG_BOUNCE=y
241CONFIG_VIRT_TO_BUS=y 255CONFIG_VIRT_TO_BUS=y
242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y 256CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y 257CONFIG_HAVE_MLOCKED_PAGE_BIT=y
258CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
245CONFIG_PPC_4K_PAGES=y 259CONFIG_PPC_4K_PAGES=y
246# CONFIG_PPC_16K_PAGES is not set 260# CONFIG_PPC_16K_PAGES is not set
247# CONFIG_PPC_64K_PAGES is not set 261# CONFIG_PPC_64K_PAGES is not set
@@ -280,6 +294,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
280CONFIG_KERNEL_START=0xc0000000 294CONFIG_KERNEL_START=0xc0000000
281CONFIG_PHYSICAL_START=0x00000000 295CONFIG_PHYSICAL_START=0x00000000
282CONFIG_TASK_SIZE=0x80000000 296CONFIG_TASK_SIZE=0x80000000
297CONFIG_CONSISTENT_SIZE=0x00200000
283CONFIG_NET=y 298CONFIG_NET=y
284 299
285# 300#
@@ -336,6 +351,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
336# CONFIG_ECONET is not set 351# CONFIG_ECONET is not set
337# CONFIG_WAN_ROUTER is not set 352# CONFIG_WAN_ROUTER is not set
338# CONFIG_PHONET is not set 353# CONFIG_PHONET is not set
354# CONFIG_IEEE802154 is not set
339# CONFIG_NET_SCHED is not set 355# CONFIG_NET_SCHED is not set
340# CONFIG_DCB is not set 356# CONFIG_DCB is not set
341 357
@@ -353,7 +369,11 @@ CONFIG_WIRELESS=y
353CONFIG_WIRELESS_OLD_REGULATORY=y 369CONFIG_WIRELESS_OLD_REGULATORY=y
354# CONFIG_WIRELESS_EXT is not set 370# CONFIG_WIRELESS_EXT is not set
355# CONFIG_LIB80211 is not set 371# CONFIG_LIB80211 is not set
356# CONFIG_MAC80211 is not set 372
373#
374# CFG80211 needs to be enabled for MAC80211
375#
376CONFIG_MAC80211_DEFAULT_PS_VALUE=0
357# CONFIG_WIMAX is not set 377# CONFIG_WIMAX is not set
358# CONFIG_RFKILL is not set 378# CONFIG_RFKILL is not set
359# CONFIG_NET_9P is not set 379# CONFIG_NET_9P is not set
@@ -452,6 +472,7 @@ CONFIG_MTD_PHYSMAP_OF=y
452# 472#
453# CONFIG_MTD_UBI is not set 473# CONFIG_MTD_UBI is not set
454CONFIG_OF_DEVICE=y 474CONFIG_OF_DEVICE=y
475CONFIG_OF_MDIO=y
455# CONFIG_PARPORT is not set 476# CONFIG_PARPORT is not set
456# CONFIG_BLK_DEV is not set 477# CONFIG_BLK_DEV is not set
457# CONFIG_MISC_DEVICES is not set 478# CONFIG_MISC_DEVICES is not set
@@ -469,7 +490,6 @@ CONFIG_HAVE_IDE=y
469# CONFIG_MD is not set 490# CONFIG_MD is not set
470# CONFIG_MACINTOSH_DRIVERS is not set 491# CONFIG_MACINTOSH_DRIVERS is not set
471CONFIG_NETDEVICES=y 492CONFIG_NETDEVICES=y
472CONFIG_COMPAT_NET_DEV_OPS=y
473# CONFIG_DUMMY is not set 493# CONFIG_DUMMY is not set
474# CONFIG_BONDING is not set 494# CONFIG_BONDING is not set
475# CONFIG_MACVLAN is not set 495# CONFIG_MACVLAN is not set
@@ -508,6 +528,7 @@ CONFIG_MII=y
508# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 528# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
509# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 529# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
510# CONFIG_B44 is not set 530# CONFIG_B44 is not set
531# CONFIG_KS8842 is not set
511CONFIG_FS_ENET=y 532CONFIG_FS_ENET=y
512# CONFIG_FS_ENET_HAS_SCC is not set 533# CONFIG_FS_ENET_HAS_SCC is not set
513CONFIG_FS_ENET_HAS_FEC=y 534CONFIG_FS_ENET_HAS_FEC=y
@@ -579,6 +600,11 @@ CONFIG_GEN_RTC=y
579# CONFIG_TCG_TPM is not set 600# CONFIG_TCG_TPM is not set
580# CONFIG_I2C is not set 601# CONFIG_I2C is not set
581# CONFIG_SPI is not set 602# CONFIG_SPI is not set
603
604#
605# PPS support
606#
607# CONFIG_PPS is not set
582CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 608CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
583# CONFIG_GPIOLIB is not set 609# CONFIG_GPIOLIB is not set
584# CONFIG_W1 is not set 610# CONFIG_W1 is not set
@@ -602,22 +628,7 @@ CONFIG_SSB_POSSIBLE=y
602# CONFIG_HTC_PASIC3 is not set 628# CONFIG_HTC_PASIC3 is not set
603# CONFIG_MFD_TMIO is not set 629# CONFIG_MFD_TMIO is not set
604# CONFIG_REGULATOR is not set 630# CONFIG_REGULATOR is not set
605 631# CONFIG_MEDIA_SUPPORT is not set
606#
607# Multimedia devices
608#
609
610#
611# Multimedia core support
612#
613# CONFIG_VIDEO_DEV is not set
614# CONFIG_DVB_CORE is not set
615# CONFIG_VIDEO_MEDIA is not set
616
617#
618# Multimedia drivers
619#
620CONFIG_DAB=y
621 632
622# 633#
623# Graphics support 634# Graphics support
@@ -642,6 +653,10 @@ CONFIG_DAB=y
642# CONFIG_DMADEVICES is not set 653# CONFIG_DMADEVICES is not set
643# CONFIG_AUXDISPLAY is not set 654# CONFIG_AUXDISPLAY is not set
644# CONFIG_UIO is not set 655# CONFIG_UIO is not set
656
657#
658# TI VLYNQ
659#
645# CONFIG_STAGING is not set 660# CONFIG_STAGING is not set
646 661
647# 662#
@@ -653,12 +668,15 @@ CONFIG_DAB=y
653# CONFIG_REISERFS_FS is not set 668# CONFIG_REISERFS_FS is not set
654# CONFIG_JFS_FS is not set 669# CONFIG_JFS_FS is not set
655# CONFIG_FS_POSIX_ACL is not set 670# CONFIG_FS_POSIX_ACL is not set
656CONFIG_FILE_LOCKING=y
657# CONFIG_XFS_FS is not set 671# CONFIG_XFS_FS is not set
672# CONFIG_GFS2_FS is not set
658# CONFIG_OCFS2_FS is not set 673# CONFIG_OCFS2_FS is not set
659# CONFIG_BTRFS_FS is not set 674# CONFIG_BTRFS_FS is not set
675CONFIG_FILE_LOCKING=y
676CONFIG_FSNOTIFY=y
660# CONFIG_DNOTIFY is not set 677# CONFIG_DNOTIFY is not set
661# CONFIG_INOTIFY is not set 678# CONFIG_INOTIFY is not set
679CONFIG_INOTIFY_USER=y
662# CONFIG_QUOTA is not set 680# CONFIG_QUOTA is not set
663# CONFIG_AUTOFS_FS is not set 681# CONFIG_AUTOFS_FS is not set
664# CONFIG_AUTOFS4_FS is not set 682# CONFIG_AUTOFS4_FS is not set
@@ -775,6 +793,7 @@ CONFIG_HAS_IOPORT=y
775CONFIG_HAS_DMA=y 793CONFIG_HAS_DMA=y
776CONFIG_HAVE_LMB=y 794CONFIG_HAVE_LMB=y
777CONFIG_NLATTR=y 795CONFIG_NLATTR=y
796CONFIG_GENERIC_ATOMIC64=y
778 797
779# 798#
780# Kernel hacking 799# Kernel hacking
@@ -803,6 +822,9 @@ CONFIG_SCHED_DEBUG=y
803# CONFIG_SLUB_STATS is not set 822# CONFIG_SLUB_STATS is not set
804# CONFIG_DEBUG_SPINLOCK is not set 823# CONFIG_DEBUG_SPINLOCK is not set
805# CONFIG_DEBUG_MUTEXES is not set 824# CONFIG_DEBUG_MUTEXES is not set
825# CONFIG_DEBUG_LOCK_ALLOC is not set
826# CONFIG_PROVE_LOCKING is not set
827# CONFIG_LOCK_STAT is not set
806# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 828# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
807# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 829# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
808# CONFIG_DEBUG_KOBJECT is not set 830# CONFIG_DEBUG_KOBJECT is not set
@@ -814,7 +836,6 @@ CONFIG_DEBUG_INFO=y
814# CONFIG_DEBUG_LIST is not set 836# CONFIG_DEBUG_LIST is not set
815# CONFIG_DEBUG_SG is not set 837# CONFIG_DEBUG_SG is not set
816# CONFIG_DEBUG_NOTIFIERS is not set 838# CONFIG_DEBUG_NOTIFIERS is not set
817# CONFIG_BOOT_PRINTK_DELAY is not set
818# CONFIG_RCU_TORTURE_TEST is not set 839# CONFIG_RCU_TORTURE_TEST is not set
819# CONFIG_RCU_CPU_STALL_DETECTOR is not set 840# CONFIG_RCU_CPU_STALL_DETECTOR is not set
820# CONFIG_BACKTRACE_SELF_TEST is not set 841# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -827,16 +848,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
827CONFIG_HAVE_DYNAMIC_FTRACE=y 848CONFIG_HAVE_DYNAMIC_FTRACE=y
828CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 849CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
829CONFIG_TRACING_SUPPORT=y 850CONFIG_TRACING_SUPPORT=y
830 851CONFIG_FTRACE=y
831#
832# Tracers
833#
834# CONFIG_FUNCTION_TRACER is not set 852# CONFIG_FUNCTION_TRACER is not set
853# CONFIG_IRQSOFF_TRACER is not set
835# CONFIG_SCHED_TRACER is not set 854# CONFIG_SCHED_TRACER is not set
836# CONFIG_CONTEXT_SWITCH_TRACER is not set 855# CONFIG_ENABLE_DEFAULT_TRACERS is not set
837# CONFIG_EVENT_TRACER is not set
838# CONFIG_BOOT_TRACER is not set 856# CONFIG_BOOT_TRACER is not set
839# CONFIG_TRACE_BRANCH_PROFILING is not set 857CONFIG_BRANCH_PROFILE_NONE=y
858# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
859# CONFIG_PROFILE_ALL_BRANCHES is not set
840# CONFIG_STACK_TRACER is not set 860# CONFIG_STACK_TRACER is not set
841# CONFIG_KMEMTRACE is not set 861# CONFIG_KMEMTRACE is not set
842# CONFIG_WORKQUEUE_TRACER is not set 862# CONFIG_WORKQUEUE_TRACER is not set
@@ -844,6 +864,9 @@ CONFIG_TRACING_SUPPORT=y
844# CONFIG_SAMPLES is not set 864# CONFIG_SAMPLES is not set
845CONFIG_HAVE_ARCH_KGDB=y 865CONFIG_HAVE_ARCH_KGDB=y
846# CONFIG_KGDB is not set 866# CONFIG_KGDB is not set
867# CONFIG_KMEMCHECK is not set
868# CONFIG_PPC_DISABLE_WERROR is not set
869CONFIG_PPC_WERROR=y
847CONFIG_PRINT_STACK_DEPTH=64 870CONFIG_PRINT_STACK_DEPTH=64
848# CONFIG_DEBUG_STACKOVERFLOW is not set 871# CONFIG_DEBUG_STACKOVERFLOW is not set
849# CONFIG_DEBUG_STACK_USAGE is not set 872# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/linkstation_defconfig b/arch/powerpc/configs/linkstation_defconfig
index a4053ab9e244..45671e7dd2c7 100644
--- a/arch/powerpc/configs/linkstation_defconfig
+++ b/arch/powerpc/configs/linkstation_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:54 2009 4# Wed Jul 29 23:31:50 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 47CONFIG_PPC=y
@@ -52,11 +55,13 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 55# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 56CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
55CONFIG_DEFAULT_UIMAGE=y 59CONFIG_DEFAULT_UIMAGE=y
56# CONFIG_PPC_DCR_NATIVE is not set 60# CONFIG_PPC_DCR_NATIVE is not set
57# CONFIG_PPC_DCR_MMIO is not set 61# CONFIG_PPC_DCR_MMIO is not set
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
64CONFIG_CONSTRUCTORS=y
60 65
61# 66#
62# General setup 67# General setup
@@ -114,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115# CONFIG_KALLSYMS_ALL is not set 120# CONFIG_KALLSYMS_ALL is not set
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 121# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,9 +131,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
133# CONFIG_COMPAT_BRK is not set 144# CONFIG_COMPAT_BRK is not set
134# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
135CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -143,6 +154,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
143CONFIG_HAVE_KPROBES=y 154CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
145CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
157
158#
159# GCOV-based kernel profiling
160#
146# CONFIG_SLOW_WORK is not set 161# CONFIG_SLOW_WORK is not set
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 163CONFIG_SLABINFO=y
@@ -155,7 +170,7 @@ CONFIG_MODULE_UNLOAD=y
155# CONFIG_MODVERSIONS is not set 170# CONFIG_MODVERSIONS is not set
156# CONFIG_MODULE_SRCVERSION_ALL is not set 171# CONFIG_MODULE_SRCVERSION_ALL is not set
157CONFIG_BLOCK=y 172CONFIG_BLOCK=y
158# CONFIG_LBD is not set 173CONFIG_LBDAF=y
159# CONFIG_BLK_DEV_BSG is not set 174# CONFIG_BLK_DEV_BSG is not set
160# CONFIG_BLK_DEV_INTEGRITY is not set 175# CONFIG_BLK_DEV_INTEGRITY is not set
161 176
@@ -237,6 +252,7 @@ CONFIG_BINFMT_ELF=y
237# CONFIG_HAVE_AOUT is not set 252# CONFIG_HAVE_AOUT is not set
238# CONFIG_BINFMT_MISC is not set 253# CONFIG_BINFMT_MISC is not set
239# CONFIG_IOMMU_HELPER is not set 254# CONFIG_IOMMU_HELPER is not set
255# CONFIG_SWIOTLB is not set
240CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 256CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
241CONFIG_ARCH_HAS_WALK_MEMORY=y 257CONFIG_ARCH_HAS_WALK_MEMORY=y
242CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 258CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -257,9 +273,9 @@ CONFIG_MIGRATION=y
257CONFIG_ZONE_DMA_FLAG=1 273CONFIG_ZONE_DMA_FLAG=1
258CONFIG_BOUNCE=y 274CONFIG_BOUNCE=y
259CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
260CONFIG_UNEVICTABLE_LRU=y
261CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_PPC_4K_PAGES=y 279CONFIG_PPC_4K_PAGES=y
264# CONFIG_PPC_16K_PAGES is not set 280# CONFIG_PPC_16K_PAGES is not set
265# CONFIG_PPC_64K_PAGES is not set 281# CONFIG_PPC_64K_PAGES is not set
@@ -480,6 +496,7 @@ CONFIG_IP_NF_ARP_MANGLE=m
480# CONFIG_ECONET is not set 496# CONFIG_ECONET is not set
481# CONFIG_WAN_ROUTER is not set 497# CONFIG_WAN_ROUTER is not set
482# CONFIG_PHONET is not set 498# CONFIG_PHONET is not set
499# CONFIG_IEEE802154 is not set
483# CONFIG_NET_SCHED is not set 500# CONFIG_NET_SCHED is not set
484# CONFIG_DCB is not set 501# CONFIG_DCB is not set
485 502
@@ -498,7 +515,11 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
498CONFIG_WIRELESS_EXT=y 515CONFIG_WIRELESS_EXT=y
499CONFIG_WIRELESS_EXT_SYSFS=y 516CONFIG_WIRELESS_EXT_SYSFS=y
500# CONFIG_LIB80211 is not set 517# CONFIG_LIB80211 is not set
501# CONFIG_MAC80211 is not set 518
519#
520# CFG80211 needs to be enabled for MAC80211
521#
522CONFIG_MAC80211_DEFAULT_PS_VALUE=0
502# CONFIG_WIMAX is not set 523# CONFIG_WIMAX is not set
503# CONFIG_RFKILL is not set 524# CONFIG_RFKILL is not set
504# CONFIG_NET_9P is not set 525# CONFIG_NET_9P is not set
@@ -647,7 +668,9 @@ CONFIG_MISC_DEVICES=y
647# 668#
648# CONFIG_EEPROM_AT24 is not set 669# CONFIG_EEPROM_AT24 is not set
649CONFIG_EEPROM_LEGACY=m 670CONFIG_EEPROM_LEGACY=m
671# CONFIG_EEPROM_MAX6875 is not set
650# CONFIG_EEPROM_93CX6 is not set 672# CONFIG_EEPROM_93CX6 is not set
673# CONFIG_CB710_CORE is not set
651CONFIG_HAVE_IDE=y 674CONFIG_HAVE_IDE=y
652# CONFIG_IDE is not set 675# CONFIG_IDE is not set
653 676
@@ -670,10 +693,6 @@ CONFIG_BLK_DEV_SD=y
670# CONFIG_BLK_DEV_SR is not set 693# CONFIG_BLK_DEV_SR is not set
671CONFIG_CHR_DEV_SG=y 694CONFIG_CHR_DEV_SG=y
672# CONFIG_CHR_DEV_SCH is not set 695# CONFIG_CHR_DEV_SCH is not set
673
674#
675# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
676#
677CONFIG_SCSI_MULTI_LUN=y 696CONFIG_SCSI_MULTI_LUN=y
678# CONFIG_SCSI_CONSTANTS is not set 697# CONFIG_SCSI_CONSTANTS is not set
679# CONFIG_SCSI_LOGGING is not set 698# CONFIG_SCSI_LOGGING is not set
@@ -691,6 +710,7 @@ CONFIG_SCSI_WAIT_SCAN=m
691CONFIG_SCSI_LOWLEVEL=y 710CONFIG_SCSI_LOWLEVEL=y
692# CONFIG_ISCSI_TCP is not set 711# CONFIG_ISCSI_TCP is not set
693# CONFIG_SCSI_CXGB3_ISCSI is not set 712# CONFIG_SCSI_CXGB3_ISCSI is not set
713# CONFIG_SCSI_BNX2_ISCSI is not set
694# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 714# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
695# CONFIG_SCSI_3W_9XXX is not set 715# CONFIG_SCSI_3W_9XXX is not set
696# CONFIG_SCSI_ACARD is not set 716# CONFIG_SCSI_ACARD is not set
@@ -699,6 +719,7 @@ CONFIG_SCSI_LOWLEVEL=y
699# CONFIG_SCSI_AIC7XXX_OLD is not set 719# CONFIG_SCSI_AIC7XXX_OLD is not set
700# CONFIG_SCSI_AIC79XX is not set 720# CONFIG_SCSI_AIC79XX is not set
701# CONFIG_SCSI_AIC94XX is not set 721# CONFIG_SCSI_AIC94XX is not set
722# CONFIG_SCSI_MVSAS is not set
702# CONFIG_SCSI_DPT_I2O is not set 723# CONFIG_SCSI_DPT_I2O is not set
703# CONFIG_SCSI_ADVANSYS is not set 724# CONFIG_SCSI_ADVANSYS is not set
704# CONFIG_SCSI_ARCMSR is not set 725# CONFIG_SCSI_ARCMSR is not set
@@ -718,7 +739,6 @@ CONFIG_SCSI_LOWLEVEL=y
718# CONFIG_SCSI_IPS is not set 739# CONFIG_SCSI_IPS is not set
719# CONFIG_SCSI_INITIO is not set 740# CONFIG_SCSI_INITIO is not set
720# CONFIG_SCSI_INIA100 is not set 741# CONFIG_SCSI_INIA100 is not set
721# CONFIG_SCSI_MVSAS is not set
722# CONFIG_SCSI_STEX is not set 742# CONFIG_SCSI_STEX is not set
723# CONFIG_SCSI_SYM53C8XX_2 is not set 743# CONFIG_SCSI_SYM53C8XX_2 is not set
724# CONFIG_SCSI_IPR is not set 744# CONFIG_SCSI_IPR is not set
@@ -802,14 +822,17 @@ CONFIG_PATA_SIL680=y
802# 822#
803 823
804# 824#
805# Enable only one of the two stacks, unless you know what you are doing 825# You can enable one or both FireWire driver stacks.
826#
827
828#
829# See the help texts for more information.
806# 830#
807# CONFIG_FIREWIRE is not set 831# CONFIG_FIREWIRE is not set
808# CONFIG_IEEE1394 is not set 832# CONFIG_IEEE1394 is not set
809# CONFIG_I2O is not set 833# CONFIG_I2O is not set
810# CONFIG_MACINTOSH_DRIVERS is not set 834# CONFIG_MACINTOSH_DRIVERS is not set
811CONFIG_NETDEVICES=y 835CONFIG_NETDEVICES=y
812CONFIG_COMPAT_NET_DEV_OPS=y
813# CONFIG_DUMMY is not set 836# CONFIG_DUMMY is not set
814# CONFIG_BONDING is not set 837# CONFIG_BONDING is not set
815# CONFIG_MACVLAN is not set 838# CONFIG_MACVLAN is not set
@@ -846,6 +869,7 @@ CONFIG_TULIP_MMIO=y
846# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 869# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
847# CONFIG_NET_PCI is not set 870# CONFIG_NET_PCI is not set
848# CONFIG_B44 is not set 871# CONFIG_B44 is not set
872# CONFIG_KS8842 is not set
849# CONFIG_ATL2 is not set 873# CONFIG_ATL2 is not set
850CONFIG_NETDEV_1000=y 874CONFIG_NETDEV_1000=y
851# CONFIG_ACENIC is not set 875# CONFIG_ACENIC is not set
@@ -865,8 +889,10 @@ CONFIG_R8169=y
865# CONFIG_VIA_VELOCITY is not set 889# CONFIG_VIA_VELOCITY is not set
866# CONFIG_TIGON3 is not set 890# CONFIG_TIGON3 is not set
867# CONFIG_BNX2 is not set 891# CONFIG_BNX2 is not set
892# CONFIG_CNIC is not set
868# CONFIG_FSL_PQ_MDIO is not set 893# CONFIG_FSL_PQ_MDIO is not set
869# CONFIG_GIANFAR is not set 894# CONFIG_GIANFAR is not set
895# CONFIG_MV643XX_ETH is not set
870# CONFIG_QLA3XXX is not set 896# CONFIG_QLA3XXX is not set
871# CONFIG_ATL1 is not set 897# CONFIG_ATL1 is not set
872# CONFIG_ATL1E is not set 898# CONFIG_ATL1E is not set
@@ -1074,13 +1100,17 @@ CONFIG_I2C_MPC=y
1074# CONFIG_SENSORS_PCF8574 is not set 1100# CONFIG_SENSORS_PCF8574 is not set
1075# CONFIG_PCF8575 is not set 1101# CONFIG_PCF8575 is not set
1076# CONFIG_SENSORS_PCA9539 is not set 1102# CONFIG_SENSORS_PCA9539 is not set
1077# CONFIG_SENSORS_MAX6875 is not set
1078# CONFIG_SENSORS_TSL2550 is not set 1103# CONFIG_SENSORS_TSL2550 is not set
1079# CONFIG_I2C_DEBUG_CORE is not set 1104# CONFIG_I2C_DEBUG_CORE is not set
1080# CONFIG_I2C_DEBUG_ALGO is not set 1105# CONFIG_I2C_DEBUG_ALGO is not set
1081# CONFIG_I2C_DEBUG_BUS is not set 1106# CONFIG_I2C_DEBUG_BUS is not set
1082# CONFIG_I2C_DEBUG_CHIP is not set 1107# CONFIG_I2C_DEBUG_CHIP is not set
1083# CONFIG_SPI is not set 1108# CONFIG_SPI is not set
1109
1110#
1111# PPS support
1112#
1113# CONFIG_PPS is not set
1084CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1114CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1085# CONFIG_GPIOLIB is not set 1115# CONFIG_GPIOLIB is not set
1086# CONFIG_W1 is not set 1116# CONFIG_W1 is not set
@@ -1135,6 +1165,7 @@ CONFIG_HWMON=y
1135# CONFIG_SENSORS_SMSC47B397 is not set 1165# CONFIG_SENSORS_SMSC47B397 is not set
1136# CONFIG_SENSORS_ADS7828 is not set 1166# CONFIG_SENSORS_ADS7828 is not set
1137# CONFIG_SENSORS_THMC50 is not set 1167# CONFIG_SENSORS_THMC50 is not set
1168# CONFIG_SENSORS_TMP401 is not set
1138# CONFIG_SENSORS_VIA686A is not set 1169# CONFIG_SENSORS_VIA686A is not set
1139# CONFIG_SENSORS_VT1211 is not set 1170# CONFIG_SENSORS_VT1211 is not set
1140# CONFIG_SENSORS_VT8231 is not set 1171# CONFIG_SENSORS_VT8231 is not set
@@ -1169,23 +1200,9 @@ CONFIG_SSB_POSSIBLE=y
1169# CONFIG_MFD_WM8400 is not set 1200# CONFIG_MFD_WM8400 is not set
1170# CONFIG_MFD_WM8350_I2C is not set 1201# CONFIG_MFD_WM8350_I2C is not set
1171# CONFIG_MFD_PCF50633 is not set 1202# CONFIG_MFD_PCF50633 is not set
1203# CONFIG_AB3100_CORE is not set
1172# CONFIG_REGULATOR is not set 1204# CONFIG_REGULATOR is not set
1173 1205# CONFIG_MEDIA_SUPPORT is not set
1174#
1175# Multimedia devices
1176#
1177
1178#
1179# Multimedia core support
1180#
1181# CONFIG_VIDEO_DEV is not set
1182# CONFIG_DVB_CORE is not set
1183# CONFIG_VIDEO_MEDIA is not set
1184
1185#
1186# Multimedia drivers
1187#
1188# CONFIG_DAB is not set
1189 1206
1190# 1207#
1191# Graphics support 1208# Graphics support
@@ -1245,6 +1262,7 @@ CONFIG_USB_MON=y
1245# USB Host Controller Drivers 1262# USB Host Controller Drivers
1246# 1263#
1247# CONFIG_USB_C67X00_HCD is not set 1264# CONFIG_USB_C67X00_HCD is not set
1265# CONFIG_USB_XHCI_HCD is not set
1248CONFIG_USB_EHCI_HCD=y 1266CONFIG_USB_EHCI_HCD=y
1249# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1267# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1250# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1268# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1254,9 +1272,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1254# CONFIG_USB_ISP116X_HCD is not set 1272# CONFIG_USB_ISP116X_HCD is not set
1255# CONFIG_USB_ISP1760_HCD is not set 1273# CONFIG_USB_ISP1760_HCD is not set
1256CONFIG_USB_OHCI_HCD=y 1274CONFIG_USB_OHCI_HCD=y
1257CONFIG_USB_OHCI_HCD_PPC_OF=y
1258CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1275CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1259# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1276# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1277CONFIG_USB_OHCI_HCD_PPC_OF=y
1260CONFIG_USB_OHCI_HCD_PCI=y 1278CONFIG_USB_OHCI_HCD_PCI=y
1261CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1279CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1262CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1280CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1423,6 +1441,7 @@ CONFIG_RTC_DRV_RS5C372=y
1423# CONFIG_RTC_DRV_S35390A is not set 1441# CONFIG_RTC_DRV_S35390A is not set
1424# CONFIG_RTC_DRV_FM3130 is not set 1442# CONFIG_RTC_DRV_FM3130 is not set
1425# CONFIG_RTC_DRV_RX8581 is not set 1443# CONFIG_RTC_DRV_RX8581 is not set
1444# CONFIG_RTC_DRV_RX8025 is not set
1426 1445
1427# 1446#
1428# SPI RTC drivers 1447# SPI RTC drivers
@@ -1450,6 +1469,10 @@ CONFIG_RTC_DRV_RS5C372=y
1450# CONFIG_DMADEVICES is not set 1469# CONFIG_DMADEVICES is not set
1451# CONFIG_AUXDISPLAY is not set 1470# CONFIG_AUXDISPLAY is not set
1452# CONFIG_UIO is not set 1471# CONFIG_UIO is not set
1472
1473#
1474# TI VLYNQ
1475#
1453# CONFIG_STAGING is not set 1476# CONFIG_STAGING is not set
1454 1477
1455# 1478#
@@ -1469,14 +1492,16 @@ CONFIG_FS_MBCACHE=y
1469# CONFIG_REISERFS_FS is not set 1492# CONFIG_REISERFS_FS is not set
1470# CONFIG_JFS_FS is not set 1493# CONFIG_JFS_FS is not set
1471CONFIG_FS_POSIX_ACL=y 1494CONFIG_FS_POSIX_ACL=y
1472CONFIG_FILE_LOCKING=y
1473CONFIG_XFS_FS=m 1495CONFIG_XFS_FS=m
1474# CONFIG_XFS_QUOTA is not set 1496# CONFIG_XFS_QUOTA is not set
1475# CONFIG_XFS_POSIX_ACL is not set 1497# CONFIG_XFS_POSIX_ACL is not set
1476# CONFIG_XFS_RT is not set 1498# CONFIG_XFS_RT is not set
1477# CONFIG_XFS_DEBUG is not set 1499# CONFIG_XFS_DEBUG is not set
1500# CONFIG_GFS2_FS is not set
1478# CONFIG_OCFS2_FS is not set 1501# CONFIG_OCFS2_FS is not set
1479# CONFIG_BTRFS_FS is not set 1502# CONFIG_BTRFS_FS is not set
1503CONFIG_FILE_LOCKING=y
1504CONFIG_FSNOTIFY=y
1480CONFIG_DNOTIFY=y 1505CONFIG_DNOTIFY=y
1481CONFIG_INOTIFY=y 1506CONFIG_INOTIFY=y
1482CONFIG_INOTIFY_USER=y 1507CONFIG_INOTIFY_USER=y
@@ -1548,6 +1573,7 @@ CONFIG_NFS_FS=y
1548CONFIG_NFS_V3=y 1573CONFIG_NFS_V3=y
1549CONFIG_NFS_V3_ACL=y 1574CONFIG_NFS_V3_ACL=y
1550CONFIG_NFS_V4=y 1575CONFIG_NFS_V4=y
1576# CONFIG_NFS_V4_1 is not set
1551CONFIG_ROOT_NFS=y 1577CONFIG_ROOT_NFS=y
1552CONFIG_NFSD=m 1578CONFIG_NFSD=m
1553CONFIG_NFSD_V3=y 1579CONFIG_NFSD_V3=y
@@ -1578,7 +1604,7 @@ CONFIG_CIFS=m
1578# 1604#
1579# CONFIG_PARTITION_ADVANCED is not set 1605# CONFIG_PARTITION_ADVANCED is not set
1580CONFIG_MSDOS_PARTITION=y 1606CONFIG_MSDOS_PARTITION=y
1581CONFIG_NLS=m 1607CONFIG_NLS=y
1582CONFIG_NLS_DEFAULT="iso8859-1" 1608CONFIG_NLS_DEFAULT="iso8859-1"
1583CONFIG_NLS_CODEPAGE_437=m 1609CONFIG_NLS_CODEPAGE_437=m
1584# CONFIG_NLS_CODEPAGE_737 is not set 1610# CONFIG_NLS_CODEPAGE_737 is not set
@@ -1645,6 +1671,7 @@ CONFIG_HAS_IOPORT=y
1645CONFIG_HAS_DMA=y 1671CONFIG_HAS_DMA=y
1646CONFIG_HAVE_LMB=y 1672CONFIG_HAVE_LMB=y
1647CONFIG_NLATTR=y 1673CONFIG_NLATTR=y
1674CONFIG_GENERIC_ATOMIC64=y
1648 1675
1649# 1676#
1650# Kernel hacking 1677# Kernel hacking
@@ -1675,6 +1702,9 @@ CONFIG_SCHED_DEBUG=y
1675# CONFIG_RT_MUTEX_TESTER is not set 1702# CONFIG_RT_MUTEX_TESTER is not set
1676# CONFIG_DEBUG_SPINLOCK is not set 1703# CONFIG_DEBUG_SPINLOCK is not set
1677# CONFIG_DEBUG_MUTEXES is not set 1704# CONFIG_DEBUG_MUTEXES is not set
1705# CONFIG_DEBUG_LOCK_ALLOC is not set
1706# CONFIG_PROVE_LOCKING is not set
1707# CONFIG_LOCK_STAT is not set
1678# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1708# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1679# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1709# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1680# CONFIG_DEBUG_KOBJECT is not set 1710# CONFIG_DEBUG_KOBJECT is not set
@@ -1686,7 +1716,6 @@ CONFIG_DEBUG_MEMORY_INIT=y
1686# CONFIG_DEBUG_LIST is not set 1716# CONFIG_DEBUG_LIST is not set
1687# CONFIG_DEBUG_SG is not set 1717# CONFIG_DEBUG_SG is not set
1688# CONFIG_DEBUG_NOTIFIERS is not set 1718# CONFIG_DEBUG_NOTIFIERS is not set
1689# CONFIG_BOOT_PRINTK_DELAY is not set
1690# CONFIG_RCU_TORTURE_TEST is not set 1719# CONFIG_RCU_TORTURE_TEST is not set
1691# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1720# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1692# CONFIG_BACKTRACE_SELF_TEST is not set 1721# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1700,16 +1729,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1700CONFIG_HAVE_DYNAMIC_FTRACE=y 1729CONFIG_HAVE_DYNAMIC_FTRACE=y
1701CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1730CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1702CONFIG_TRACING_SUPPORT=y 1731CONFIG_TRACING_SUPPORT=y
1703 1732CONFIG_FTRACE=y
1704#
1705# Tracers
1706#
1707# CONFIG_FUNCTION_TRACER is not set 1733# CONFIG_FUNCTION_TRACER is not set
1734# CONFIG_IRQSOFF_TRACER is not set
1708# CONFIG_SCHED_TRACER is not set 1735# CONFIG_SCHED_TRACER is not set
1709# CONFIG_CONTEXT_SWITCH_TRACER is not set 1736# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1710# CONFIG_EVENT_TRACER is not set
1711# CONFIG_BOOT_TRACER is not set 1737# CONFIG_BOOT_TRACER is not set
1712# CONFIG_TRACE_BRANCH_PROFILING is not set 1738CONFIG_BRANCH_PROFILE_NONE=y
1739# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1740# CONFIG_PROFILE_ALL_BRANCHES is not set
1713# CONFIG_STACK_TRACER is not set 1741# CONFIG_STACK_TRACER is not set
1714# CONFIG_KMEMTRACE is not set 1742# CONFIG_KMEMTRACE is not set
1715# CONFIG_WORKQUEUE_TRACER is not set 1743# CONFIG_WORKQUEUE_TRACER is not set
@@ -1717,6 +1745,8 @@ CONFIG_TRACING_SUPPORT=y
1717# CONFIG_SAMPLES is not set 1745# CONFIG_SAMPLES is not set
1718CONFIG_HAVE_ARCH_KGDB=y 1746CONFIG_HAVE_ARCH_KGDB=y
1719# CONFIG_KGDB is not set 1747# CONFIG_KGDB is not set
1748# CONFIG_PPC_DISABLE_WERROR is not set
1749CONFIG_PPC_WERROR=y
1720CONFIG_PRINT_STACK_DEPTH=64 1750CONFIG_PRINT_STACK_DEPTH=64
1721# CONFIG_DEBUG_STACKOVERFLOW is not set 1751# CONFIG_DEBUG_STACKOVERFLOW is not set
1722# CONFIG_DEBUG_STACK_USAGE is not set 1752# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/mgcoge_defconfig b/arch/powerpc/configs/mgcoge_defconfig
index 31e1df665157..e9491c1c3f31 100644
--- a/arch/powerpc/configs/mgcoge_defconfig
+++ b/arch/powerpc/configs/mgcoge_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:55 2009 4# Wed Jul 29 23:31:51 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,6 +56,7 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 60# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_HIBERNATE_32=y 61CONFIG_HIBERNATE_32=y
58CONFIG_ARCH_HIBERNATION_POSSIBLE=y 62CONFIG_ARCH_HIBERNATION_POSSIBLE=y
@@ -60,6 +64,7 @@ CONFIG_ARCH_HIBERNATION_POSSIBLE=y
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -105,7 +110,6 @@ CONFIG_SYSCTL_SYSCALL=y
105CONFIG_KALLSYMS=y 110CONFIG_KALLSYMS=y
106CONFIG_KALLSYMS_ALL=y 111CONFIG_KALLSYMS_ALL=y
107# CONFIG_KALLSYMS_EXTRA_PASS is not set 112# CONFIG_KALLSYMS_EXTRA_PASS is not set
108# CONFIG_STRIP_ASM_SYMS is not set
109CONFIG_HOTPLUG=y 113CONFIG_HOTPLUG=y
110CONFIG_PRINTK=y 114CONFIG_PRINTK=y
111CONFIG_BUG=y 115CONFIG_BUG=y
@@ -119,8 +123,15 @@ CONFIG_TIMERFD=y
119CONFIG_EVENTFD=y 123CONFIG_EVENTFD=y
120CONFIG_SHMEM=y 124CONFIG_SHMEM=y
121CONFIG_AIO=y 125CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y
127
128#
129# Performance Counters
130#
131# CONFIG_PERF_COUNTERS is not set
122CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
123CONFIG_PCI_QUIRKS=y 133CONFIG_PCI_QUIRKS=y
134# CONFIG_STRIP_ASM_SYMS is not set
124CONFIG_COMPAT_BRK=y 135CONFIG_COMPAT_BRK=y
125CONFIG_SLAB=y 136CONFIG_SLAB=y
126# CONFIG_SLUB is not set 137# CONFIG_SLUB is not set
@@ -134,6 +145,11 @@ CONFIG_HAVE_KPROBES=y
134CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
135CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
136CONFIG_HAVE_CLK=y 147CONFIG_HAVE_CLK=y
148
149#
150# GCOV-based kernel profiling
151#
152# CONFIG_GCOV_KERNEL is not set
137# CONFIG_SLOW_WORK is not set 153# CONFIG_SLOW_WORK is not set
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y 155CONFIG_SLABINFO=y
@@ -141,7 +157,7 @@ CONFIG_RT_MUTEXES=y
141CONFIG_BASE_SMALL=0 157CONFIG_BASE_SMALL=0
142# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
143CONFIG_BLOCK=y 159CONFIG_BLOCK=y
144# CONFIG_LBD is not set 160CONFIG_LBDAF=y
145# CONFIG_BLK_DEV_INTEGRITY is not set 161# CONFIG_BLK_DEV_INTEGRITY is not set
146 162
147# 163#
@@ -225,6 +241,7 @@ CONFIG_BINFMT_ELF=y
225# CONFIG_HAVE_AOUT is not set 241# CONFIG_HAVE_AOUT is not set
226CONFIG_BINFMT_MISC=y 242CONFIG_BINFMT_MISC=y
227# CONFIG_IOMMU_HELPER is not set 243# CONFIG_IOMMU_HELPER is not set
244# CONFIG_SWIOTLB is not set
228CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
229CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
230CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -240,9 +257,9 @@ CONFIG_MIGRATION=y
240CONFIG_ZONE_DMA_FLAG=1 257CONFIG_ZONE_DMA_FLAG=1
241CONFIG_BOUNCE=y 258CONFIG_BOUNCE=y
242CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y
244CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
245CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
246CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
247# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
248# CONFIG_PPC_64K_PAGES is not set 265# CONFIG_PPC_64K_PAGES is not set
@@ -313,6 +330,7 @@ CONFIG_IP_PNP_BOOTP=y
313# CONFIG_NET_IPIP is not set 330# CONFIG_NET_IPIP is not set
314# CONFIG_NET_IPGRE is not set 331# CONFIG_NET_IPGRE is not set
315# CONFIG_IP_MROUTE is not set 332# CONFIG_IP_MROUTE is not set
333# CONFIG_ARPD is not set
316CONFIG_SYN_COOKIES=y 334CONFIG_SYN_COOKIES=y
317# CONFIG_INET_AH is not set 335# CONFIG_INET_AH is not set
318# CONFIG_INET_ESP is not set 336# CONFIG_INET_ESP is not set
@@ -374,7 +392,11 @@ CONFIG_WIRELESS=y
374CONFIG_WIRELESS_OLD_REGULATORY=y 392CONFIG_WIRELESS_OLD_REGULATORY=y
375# CONFIG_WIRELESS_EXT is not set 393# CONFIG_WIRELESS_EXT is not set
376# CONFIG_LIB80211 is not set 394# CONFIG_LIB80211 is not set
377# CONFIG_MAC80211 is not set 395
396#
397# CFG80211 needs to be enabled for MAC80211
398#
399CONFIG_MAC80211_DEFAULT_PS_VALUE=0
378# CONFIG_WIMAX is not set 400# CONFIG_WIMAX is not set
379# CONFIG_RFKILL is not set 401# CONFIG_RFKILL is not set
380 402
@@ -484,6 +506,7 @@ CONFIG_MTD_PHYSMAP_OF=y
484# CONFIG_MTD_UBI is not set 506# CONFIG_MTD_UBI is not set
485CONFIG_OF_DEVICE=y 507CONFIG_OF_DEVICE=y
486CONFIG_OF_GPIO=y 508CONFIG_OF_GPIO=y
509CONFIG_OF_MDIO=y
487# CONFIG_PARPORT is not set 510# CONFIG_PARPORT is not set
488CONFIG_BLK_DEV=y 511CONFIG_BLK_DEV=y
489# CONFIG_BLK_DEV_FD is not set 512# CONFIG_BLK_DEV_FD is not set
@@ -523,13 +546,17 @@ CONFIG_HAVE_IDE=y
523# 546#
524 547
525# 548#
526# A new alternative FireWire stack is available with EXPERIMENTAL=y 549# You can enable one or both FireWire driver stacks.
527# 550#
551
552#
553# See the help texts for more information.
554#
555# CONFIG_FIREWIRE is not set
528# CONFIG_IEEE1394 is not set 556# CONFIG_IEEE1394 is not set
529# CONFIG_I2O is not set 557# CONFIG_I2O is not set
530# CONFIG_MACINTOSH_DRIVERS is not set 558# CONFIG_MACINTOSH_DRIVERS is not set
531CONFIG_NETDEVICES=y 559CONFIG_NETDEVICES=y
532CONFIG_COMPAT_NET_DEV_OPS=y
533# CONFIG_DUMMY is not set 560# CONFIG_DUMMY is not set
534# CONFIG_BONDING is not set 561# CONFIG_BONDING is not set
535# CONFIG_EQUALIZER is not set 562# CONFIG_EQUALIZER is not set
@@ -577,6 +604,7 @@ CONFIG_MII=y
577# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 604# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
578# CONFIG_NET_PCI is not set 605# CONFIG_NET_PCI is not set
579# CONFIG_B44 is not set 606# CONFIG_B44 is not set
607# CONFIG_KS8842 is not set
580# CONFIG_ATL2 is not set 608# CONFIG_ATL2 is not set
581CONFIG_FS_ENET=y 609CONFIG_FS_ENET=y
582CONFIG_FS_ENET_HAS_SCC=y 610CONFIG_FS_ENET_HAS_SCC=y
@@ -654,6 +682,10 @@ CONFIG_HW_RANDOM=y
654CONFIG_DEVPORT=y 682CONFIG_DEVPORT=y
655# CONFIG_I2C is not set 683# CONFIG_I2C is not set
656# CONFIG_SPI is not set 684# CONFIG_SPI is not set
685
686#
687# PPS support
688#
657CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 689CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
658CONFIG_ARCH_REQUIRE_GPIOLIB=y 690CONFIG_ARCH_REQUIRE_GPIOLIB=y
659CONFIG_GPIOLIB=y 691CONFIG_GPIOLIB=y
@@ -697,22 +729,7 @@ CONFIG_SSB_POSSIBLE=y
697# CONFIG_HTC_PASIC3 is not set 729# CONFIG_HTC_PASIC3 is not set
698# CONFIG_MFD_TMIO is not set 730# CONFIG_MFD_TMIO is not set
699# CONFIG_REGULATOR is not set 731# CONFIG_REGULATOR is not set
700 732# CONFIG_MEDIA_SUPPORT is not set
701#
702# Multimedia devices
703#
704
705#
706# Multimedia core support
707#
708# CONFIG_VIDEO_DEV is not set
709# CONFIG_DVB_CORE is not set
710# CONFIG_VIDEO_MEDIA is not set
711
712#
713# Multimedia drivers
714#
715# CONFIG_DAB is not set
716 733
717# 734#
718# Graphics support 735# Graphics support
@@ -740,6 +757,10 @@ CONFIG_SSB_POSSIBLE=y
740# CONFIG_DMADEVICES is not set 757# CONFIG_DMADEVICES is not set
741# CONFIG_AUXDISPLAY is not set 758# CONFIG_AUXDISPLAY is not set
742# CONFIG_UIO is not set 759# CONFIG_UIO is not set
760
761#
762# TI VLYNQ
763#
743# CONFIG_STAGING is not set 764# CONFIG_STAGING is not set
744 765
745# 766#
@@ -757,9 +778,10 @@ CONFIG_JBD=y
757# CONFIG_REISERFS_FS is not set 778# CONFIG_REISERFS_FS is not set
758# CONFIG_JFS_FS is not set 779# CONFIG_JFS_FS is not set
759# CONFIG_FS_POSIX_ACL is not set 780# CONFIG_FS_POSIX_ACL is not set
760CONFIG_FILE_LOCKING=y
761# CONFIG_XFS_FS is not set 781# CONFIG_XFS_FS is not set
762# CONFIG_OCFS2_FS is not set 782# CONFIG_OCFS2_FS is not set
783CONFIG_FILE_LOCKING=y
784CONFIG_FSNOTIFY=y
763CONFIG_DNOTIFY=y 785CONFIG_DNOTIFY=y
764CONFIG_INOTIFY=y 786CONFIG_INOTIFY=y
765CONFIG_INOTIFY_USER=y 787CONFIG_INOTIFY_USER=y
@@ -916,6 +938,7 @@ CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y 938CONFIG_HAS_DMA=y
917CONFIG_HAVE_LMB=y 939CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y 940CONFIG_NLATTR=y
941CONFIG_GENERIC_ATOMIC64=y
919 942
920# 943#
921# Kernel hacking 944# Kernel hacking
@@ -941,6 +964,9 @@ CONFIG_DEBUG_KERNEL=y
941# CONFIG_RT_MUTEX_TESTER is not set 964# CONFIG_RT_MUTEX_TESTER is not set
942# CONFIG_DEBUG_SPINLOCK is not set 965# CONFIG_DEBUG_SPINLOCK is not set
943# CONFIG_DEBUG_MUTEXES is not set 966# CONFIG_DEBUG_MUTEXES is not set
967# CONFIG_DEBUG_LOCK_ALLOC is not set
968# CONFIG_PROVE_LOCKING is not set
969# CONFIG_LOCK_STAT is not set
944# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 970# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
945# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 971# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
946# CONFIG_DEBUG_KOBJECT is not set 972# CONFIG_DEBUG_KOBJECT is not set
@@ -952,7 +978,6 @@ CONFIG_DEBUG_INFO=y
952# CONFIG_DEBUG_LIST is not set 978# CONFIG_DEBUG_LIST is not set
953# CONFIG_DEBUG_SG is not set 979# CONFIG_DEBUG_SG is not set
954# CONFIG_DEBUG_NOTIFIERS is not set 980# CONFIG_DEBUG_NOTIFIERS is not set
955# CONFIG_BOOT_PRINTK_DELAY is not set
956# CONFIG_RCU_TORTURE_TEST is not set 981# CONFIG_RCU_TORTURE_TEST is not set
957# CONFIG_RCU_CPU_STALL_DETECTOR is not set 982# CONFIG_RCU_CPU_STALL_DETECTOR is not set
958# CONFIG_BACKTRACE_SELF_TEST is not set 983# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -966,16 +991,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
966CONFIG_HAVE_DYNAMIC_FTRACE=y 991CONFIG_HAVE_DYNAMIC_FTRACE=y
967CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 992CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
968CONFIG_TRACING_SUPPORT=y 993CONFIG_TRACING_SUPPORT=y
969 994CONFIG_FTRACE=y
970#
971# Tracers
972#
973# CONFIG_FUNCTION_TRACER is not set 995# CONFIG_FUNCTION_TRACER is not set
996# CONFIG_IRQSOFF_TRACER is not set
974# CONFIG_SCHED_TRACER is not set 997# CONFIG_SCHED_TRACER is not set
975# CONFIG_CONTEXT_SWITCH_TRACER is not set 998# CONFIG_ENABLE_DEFAULT_TRACERS is not set
976# CONFIG_EVENT_TRACER is not set
977# CONFIG_BOOT_TRACER is not set 999# CONFIG_BOOT_TRACER is not set
978# CONFIG_TRACE_BRANCH_PROFILING is not set 1000CONFIG_BRANCH_PROFILE_NONE=y
1001# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1002# CONFIG_PROFILE_ALL_BRANCHES is not set
979# CONFIG_STACK_TRACER is not set 1003# CONFIG_STACK_TRACER is not set
980# CONFIG_KMEMTRACE is not set 1004# CONFIG_KMEMTRACE is not set
981# CONFIG_WORKQUEUE_TRACER is not set 1005# CONFIG_WORKQUEUE_TRACER is not set
@@ -983,9 +1007,12 @@ CONFIG_TRACING_SUPPORT=y
983# CONFIG_DYNAMIC_DEBUG is not set 1007# CONFIG_DYNAMIC_DEBUG is not set
984# CONFIG_SAMPLES is not set 1008# CONFIG_SAMPLES is not set
985CONFIG_HAVE_ARCH_KGDB=y 1009CONFIG_HAVE_ARCH_KGDB=y
1010# CONFIG_PPC_DISABLE_WERROR is not set
1011CONFIG_PPC_WERROR=y
986CONFIG_PRINT_STACK_DEPTH=64 1012CONFIG_PRINT_STACK_DEPTH=64
987# CONFIG_DEBUG_STACKOVERFLOW is not set 1013# CONFIG_DEBUG_STACKOVERFLOW is not set
988# CONFIG_DEBUG_STACK_USAGE is not set 1014# CONFIG_DEBUG_STACK_USAGE is not set
1015# CONFIG_PPC_EMULATED_STATS is not set
989# CONFIG_CODE_PATCHING_SELFTEST is not set 1016# CONFIG_CODE_PATCHING_SELFTEST is not set
990# CONFIG_FTR_FIXUP_SELFTEST is not set 1017# CONFIG_FTR_FIXUP_SELFTEST is not set
991# CONFIG_MSI_BITMAP_SELFTEST is not set 1018# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/mgsuvd_defconfig b/arch/powerpc/configs/mgsuvd_defconfig
index 24fa90792c54..1ae85a3b2942 100644
--- a/arch/powerpc/configs/mgsuvd_defconfig
+++ b/arch/powerpc/configs/mgsuvd_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:55 2009 4# Wed Jul 29 23:31:52 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -48,11 +49,13 @@ CONFIG_OF=y
48# CONFIG_PPC_UDBG_16550 is not set 49# CONFIG_PPC_UDBG_16550 is not set
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
52CONFIG_DTC=y
51# CONFIG_DEFAULT_UIMAGE is not set 53# CONFIG_DEFAULT_UIMAGE is not set
52# CONFIG_PPC_DCR_NATIVE is not set 54# CONFIG_PPC_DCR_NATIVE is not set
53# CONFIG_PPC_DCR_MMIO is not set 55# CONFIG_PPC_DCR_MMIO is not set
54CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 56CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
55CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
58CONFIG_CONSTRUCTORS=y
56 59
57# 60#
58# General setup 61# General setup
@@ -102,7 +105,6 @@ CONFIG_EMBEDDED=y
102# CONFIG_SYSCTL_SYSCALL is not set 105# CONFIG_SYSCTL_SYSCALL is not set
103CONFIG_KALLSYMS=y 106CONFIG_KALLSYMS=y
104# CONFIG_KALLSYMS_EXTRA_PASS is not set 107# CONFIG_KALLSYMS_EXTRA_PASS is not set
105# CONFIG_STRIP_ASM_SYMS is not set
106# CONFIG_HOTPLUG is not set 108# CONFIG_HOTPLUG is not set
107CONFIG_PRINTK=y 109CONFIG_PRINTK=y
108# CONFIG_BUG is not set 110# CONFIG_BUG is not set
@@ -115,7 +117,14 @@ CONFIG_TIMERFD=y
115CONFIG_EVENTFD=y 117CONFIG_EVENTFD=y
116CONFIG_SHMEM=y 118CONFIG_SHMEM=y
117CONFIG_AIO=y 119CONFIG_AIO=y
120CONFIG_HAVE_PERF_COUNTERS=y
121
122#
123# Performance Counters
124#
125# CONFIG_PERF_COUNTERS is not set
118# CONFIG_VM_EVENT_COUNTERS is not set 126# CONFIG_VM_EVENT_COUNTERS is not set
127# CONFIG_STRIP_ASM_SYMS is not set
119CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
120CONFIG_SLAB=y 129CONFIG_SLAB=y
121# CONFIG_SLUB is not set 130# CONFIG_SLUB is not set
@@ -129,6 +138,11 @@ CONFIG_HAVE_KPROBES=y
129CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
130CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
131CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141
142#
143# GCOV-based kernel profiling
144#
145# CONFIG_GCOV_KERNEL is not set
132# CONFIG_SLOW_WORK is not set 146# CONFIG_SLOW_WORK is not set
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y 148CONFIG_SLABINFO=y
@@ -136,7 +150,7 @@ CONFIG_RT_MUTEXES=y
136CONFIG_BASE_SMALL=1 150CONFIG_BASE_SMALL=1
137# CONFIG_MODULES is not set 151# CONFIG_MODULES is not set
138CONFIG_BLOCK=y 152CONFIG_BLOCK=y
139# CONFIG_LBD is not set 153CONFIG_LBDAF=y
140# CONFIG_BLK_DEV_BSG is not set 154# CONFIG_BLK_DEV_BSG is not set
141# CONFIG_BLK_DEV_INTEGRITY is not set 155# CONFIG_BLK_DEV_INTEGRITY is not set
142 156
@@ -222,6 +236,7 @@ CONFIG_BINFMT_ELF=y
222# CONFIG_BINFMT_MISC is not set 236# CONFIG_BINFMT_MISC is not set
223CONFIG_MATH_EMULATION=y 237CONFIG_MATH_EMULATION=y
224# CONFIG_IOMMU_HELPER is not set 238# CONFIG_IOMMU_HELPER is not set
239# CONFIG_SWIOTLB is not set
225CONFIG_PPC_NEED_DMA_SYNC_OPS=y 240CONFIG_PPC_NEED_DMA_SYNC_OPS=y
226CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
227CONFIG_ARCH_HAS_WALK_MEMORY=y 242CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -241,9 +256,9 @@ CONFIG_MIGRATION=y
241CONFIG_ZONE_DMA_FLAG=1 256CONFIG_ZONE_DMA_FLAG=1
242CONFIG_BOUNCE=y 257CONFIG_BOUNCE=y
243CONFIG_VIRT_TO_BUS=y 258CONFIG_VIRT_TO_BUS=y
244CONFIG_UNEVICTABLE_LRU=y
245CONFIG_HAVE_MLOCK=y 259CONFIG_HAVE_MLOCK=y
246CONFIG_HAVE_MLOCKED_PAGE_BIT=y 260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
247CONFIG_PPC_4K_PAGES=y 262CONFIG_PPC_4K_PAGES=y
248# CONFIG_PPC_16K_PAGES is not set 263# CONFIG_PPC_16K_PAGES is not set
249# CONFIG_PPC_64K_PAGES is not set 264# CONFIG_PPC_64K_PAGES is not set
@@ -281,6 +296,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
281CONFIG_KERNEL_START=0xc0000000 296CONFIG_KERNEL_START=0xc0000000
282CONFIG_PHYSICAL_START=0x00000000 297CONFIG_PHYSICAL_START=0x00000000
283CONFIG_TASK_SIZE=0x80000000 298CONFIG_TASK_SIZE=0x80000000
299CONFIG_CONSISTENT_SIZE=0x00200000
284CONFIG_NET=y 300CONFIG_NET=y
285 301
286# 302#
@@ -342,6 +358,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
342# CONFIG_ECONET is not set 358# CONFIG_ECONET is not set
343# CONFIG_WAN_ROUTER is not set 359# CONFIG_WAN_ROUTER is not set
344# CONFIG_PHONET is not set 360# CONFIG_PHONET is not set
361# CONFIG_IEEE802154 is not set
345# CONFIG_NET_SCHED is not set 362# CONFIG_NET_SCHED is not set
346# CONFIG_DCB is not set 363# CONFIG_DCB is not set
347 364
@@ -359,7 +376,11 @@ CONFIG_WIRELESS=y
359CONFIG_WIRELESS_OLD_REGULATORY=y 376CONFIG_WIRELESS_OLD_REGULATORY=y
360# CONFIG_WIRELESS_EXT is not set 377# CONFIG_WIRELESS_EXT is not set
361# CONFIG_LIB80211 is not set 378# CONFIG_LIB80211 is not set
362# CONFIG_MAC80211 is not set 379
380#
381# CFG80211 needs to be enabled for MAC80211
382#
383CONFIG_MAC80211_DEFAULT_PS_VALUE=0
363# CONFIG_WIMAX is not set 384# CONFIG_WIMAX is not set
364# CONFIG_RFKILL is not set 385# CONFIG_RFKILL is not set
365# CONFIG_NET_9P is not set 386# CONFIG_NET_9P is not set
@@ -463,6 +484,7 @@ CONFIG_MTD_PHYSMAP_OF=y
463# 484#
464# CONFIG_MTD_UBI is not set 485# CONFIG_MTD_UBI is not set
465CONFIG_OF_DEVICE=y 486CONFIG_OF_DEVICE=y
487CONFIG_OF_MDIO=y
466# CONFIG_PARPORT is not set 488# CONFIG_PARPORT is not set
467CONFIG_BLK_DEV=y 489CONFIG_BLK_DEV=y
468# CONFIG_BLK_DEV_FD is not set 490# CONFIG_BLK_DEV_FD is not set
@@ -492,7 +514,6 @@ CONFIG_HAVE_IDE=y
492# CONFIG_MD is not set 514# CONFIG_MD is not set
493# CONFIG_MACINTOSH_DRIVERS is not set 515# CONFIG_MACINTOSH_DRIVERS is not set
494CONFIG_NETDEVICES=y 516CONFIG_NETDEVICES=y
495CONFIG_COMPAT_NET_DEV_OPS=y
496# CONFIG_DUMMY is not set 517# CONFIG_DUMMY is not set
497# CONFIG_BONDING is not set 518# CONFIG_BONDING is not set
498# CONFIG_MACVLAN is not set 519# CONFIG_MACVLAN is not set
@@ -531,6 +552,7 @@ CONFIG_MII=y
531# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 552# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
532# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 553# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
533# CONFIG_B44 is not set 554# CONFIG_B44 is not set
555# CONFIG_KS8842 is not set
534CONFIG_FS_ENET=y 556CONFIG_FS_ENET=y
535CONFIG_FS_ENET_HAS_SCC=y 557CONFIG_FS_ENET_HAS_SCC=y
536# CONFIG_FS_ENET_HAS_FEC is not set 558# CONFIG_FS_ENET_HAS_FEC is not set
@@ -602,6 +624,11 @@ CONFIG_GEN_RTC=y
602# CONFIG_TCG_TPM is not set 624# CONFIG_TCG_TPM is not set
603# CONFIG_I2C is not set 625# CONFIG_I2C is not set
604# CONFIG_SPI is not set 626# CONFIG_SPI is not set
627
628#
629# PPS support
630#
631# CONFIG_PPS is not set
605CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 632CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
606# CONFIG_GPIOLIB is not set 633# CONFIG_GPIOLIB is not set
607# CONFIG_W1 is not set 634# CONFIG_W1 is not set
@@ -625,22 +652,7 @@ CONFIG_SSB_POSSIBLE=y
625# CONFIG_HTC_PASIC3 is not set 652# CONFIG_HTC_PASIC3 is not set
626# CONFIG_MFD_TMIO is not set 653# CONFIG_MFD_TMIO is not set
627# CONFIG_REGULATOR is not set 654# CONFIG_REGULATOR is not set
628 655# CONFIG_MEDIA_SUPPORT is not set
629#
630# Multimedia devices
631#
632
633#
634# Multimedia core support
635#
636# CONFIG_VIDEO_DEV is not set
637# CONFIG_DVB_CORE is not set
638# CONFIG_VIDEO_MEDIA is not set
639
640#
641# Multimedia drivers
642#
643# CONFIG_DAB is not set
644 656
645# 657#
646# Graphics support 658# Graphics support
@@ -665,6 +677,10 @@ CONFIG_SSB_POSSIBLE=y
665# CONFIG_DMADEVICES is not set 677# CONFIG_DMADEVICES is not set
666# CONFIG_AUXDISPLAY is not set 678# CONFIG_AUXDISPLAY is not set
667# CONFIG_UIO is not set 679# CONFIG_UIO is not set
680
681#
682# TI VLYNQ
683#
668# CONFIG_STAGING is not set 684# CONFIG_STAGING is not set
669 685
670# 686#
@@ -687,10 +703,12 @@ CONFIG_FS_MBCACHE=y
687# CONFIG_REISERFS_FS is not set 703# CONFIG_REISERFS_FS is not set
688# CONFIG_JFS_FS is not set 704# CONFIG_JFS_FS is not set
689# CONFIG_FS_POSIX_ACL is not set 705# CONFIG_FS_POSIX_ACL is not set
690CONFIG_FILE_LOCKING=y
691# CONFIG_XFS_FS is not set 706# CONFIG_XFS_FS is not set
707# CONFIG_GFS2_FS is not set
692# CONFIG_OCFS2_FS is not set 708# CONFIG_OCFS2_FS is not set
693# CONFIG_BTRFS_FS is not set 709# CONFIG_BTRFS_FS is not set
710CONFIG_FILE_LOCKING=y
711CONFIG_FSNOTIFY=y
694CONFIG_DNOTIFY=y 712CONFIG_DNOTIFY=y
695CONFIG_INOTIFY=y 713CONFIG_INOTIFY=y
696CONFIG_INOTIFY_USER=y 714CONFIG_INOTIFY_USER=y
@@ -823,6 +841,7 @@ CONFIG_HAS_IOPORT=y
823CONFIG_HAS_DMA=y 841CONFIG_HAS_DMA=y
824CONFIG_HAVE_LMB=y 842CONFIG_HAVE_LMB=y
825CONFIG_NLATTR=y 843CONFIG_NLATTR=y
844CONFIG_GENERIC_ATOMIC64=y
826 845
827# 846#
828# Kernel hacking 847# Kernel hacking
@@ -844,24 +863,14 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
844CONFIG_HAVE_DYNAMIC_FTRACE=y 863CONFIG_HAVE_DYNAMIC_FTRACE=y
845CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 864CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
846CONFIG_TRACING_SUPPORT=y 865CONFIG_TRACING_SUPPORT=y
847 866# CONFIG_FTRACE is not set
848#
849# Tracers
850#
851# CONFIG_FUNCTION_TRACER is not set
852# CONFIG_SCHED_TRACER is not set
853# CONFIG_CONTEXT_SWITCH_TRACER is not set
854# CONFIG_EVENT_TRACER is not set
855# CONFIG_BOOT_TRACER is not set
856# CONFIG_TRACE_BRANCH_PROFILING is not set
857# CONFIG_STACK_TRACER is not set
858# CONFIG_KMEMTRACE is not set
859# CONFIG_WORKQUEUE_TRACER is not set
860# CONFIG_BLK_DEV_IO_TRACE is not set
861# CONFIG_DYNAMIC_DEBUG is not set 867# CONFIG_DYNAMIC_DEBUG is not set
862# CONFIG_SAMPLES is not set 868# CONFIG_SAMPLES is not set
863CONFIG_HAVE_ARCH_KGDB=y 869CONFIG_HAVE_ARCH_KGDB=y
870# CONFIG_PPC_DISABLE_WERROR is not set
871CONFIG_PPC_WERROR=y
864CONFIG_PRINT_STACK_DEPTH=64 872CONFIG_PRINT_STACK_DEPTH=64
873# CONFIG_PPC_EMULATED_STATS is not set
865# CONFIG_IRQSTACKS is not set 874# CONFIG_IRQSTACKS is not set
866# CONFIG_VIRQ_DEBUG is not set 875# CONFIG_VIRQ_DEBUG is not set
867# CONFIG_PPC_EARLY_DEBUG is not set 876# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/mpc7448_hpc2_defconfig b/arch/powerpc/configs/mpc7448_hpc2_defconfig
index 642ab67c8431..f23428c3b34e 100644
--- a/arch/powerpc/configs/mpc7448_hpc2_defconfig
+++ b/arch/powerpc/configs/mpc7448_hpc2_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:56 2009 4# Wed Jul 29 23:31:53 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19CONFIG_ALTIVEC=y 20CONFIG_ALTIVEC=y
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 47CONFIG_PPC=y
@@ -52,11 +55,13 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 55# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 56CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
55CONFIG_DEFAULT_UIMAGE=y 59CONFIG_DEFAULT_UIMAGE=y
56# CONFIG_PPC_DCR_NATIVE is not set 60# CONFIG_PPC_DCR_NATIVE is not set
57# CONFIG_PPC_DCR_MMIO is not set 61# CONFIG_PPC_DCR_MMIO is not set
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
64CONFIG_CONSTRUCTORS=y
60 65
61# 66#
62# General setup 67# General setup
@@ -106,7 +111,6 @@ CONFIG_EMBEDDED=y
106CONFIG_SYSCTL_SYSCALL=y 111CONFIG_SYSCTL_SYSCALL=y
107CONFIG_KALLSYMS=y 112CONFIG_KALLSYMS=y
108# CONFIG_KALLSYMS_EXTRA_PASS is not set 113# CONFIG_KALLSYMS_EXTRA_PASS is not set
109# CONFIG_STRIP_ASM_SYMS is not set
110CONFIG_HOTPLUG=y 114CONFIG_HOTPLUG=y
111CONFIG_PRINTK=y 115CONFIG_PRINTK=y
112CONFIG_BUG=y 116CONFIG_BUG=y
@@ -119,9 +123,16 @@ CONFIG_TIMERFD=y
119CONFIG_EVENTFD=y 123CONFIG_EVENTFD=y
120CONFIG_SHMEM=y 124CONFIG_SHMEM=y
121CONFIG_AIO=y 125CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y
127
128#
129# Performance Counters
130#
131# CONFIG_PERF_COUNTERS is not set
122CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
123CONFIG_PCI_QUIRKS=y 133CONFIG_PCI_QUIRKS=y
124CONFIG_SLUB_DEBUG=y 134CONFIG_SLUB_DEBUG=y
135# CONFIG_STRIP_ASM_SYMS is not set
125CONFIG_COMPAT_BRK=y 136CONFIG_COMPAT_BRK=y
126# CONFIG_SLAB is not set 137# CONFIG_SLAB is not set
127CONFIG_SLUB=y 138CONFIG_SLUB=y
@@ -134,6 +145,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y 145CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y 146CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y 147CONFIG_HAVE_ARCH_TRACEHOOK=y
148
149#
150# GCOV-based kernel profiling
151#
137# CONFIG_SLOW_WORK is not set 152# CONFIG_SLOW_WORK is not set
138# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
139CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
@@ -141,7 +156,7 @@ CONFIG_RT_MUTEXES=y
141CONFIG_BASE_SMALL=0 156CONFIG_BASE_SMALL=0
142# CONFIG_MODULES is not set 157# CONFIG_MODULES is not set
143CONFIG_BLOCK=y 158CONFIG_BLOCK=y
144CONFIG_LBD=y 159CONFIG_LBDAF=y
145# CONFIG_BLK_DEV_BSG is not set 160# CONFIG_BLK_DEV_BSG is not set
146# CONFIG_BLK_DEV_INTEGRITY is not set 161# CONFIG_BLK_DEV_INTEGRITY is not set
147 162
@@ -220,6 +235,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_HAVE_AOUT is not set 235# CONFIG_HAVE_AOUT is not set
221CONFIG_BINFMT_MISC=y 236CONFIG_BINFMT_MISC=y
222# CONFIG_IOMMU_HELPER is not set 237# CONFIG_IOMMU_HELPER is not set
238# CONFIG_SWIOTLB is not set
223CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 239CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
224CONFIG_ARCH_HAS_WALK_MEMORY=y 240CONFIG_ARCH_HAS_WALK_MEMORY=y
225CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -240,9 +256,9 @@ CONFIG_MIGRATION=y
240CONFIG_ZONE_DMA_FLAG=1 256CONFIG_ZONE_DMA_FLAG=1
241CONFIG_BOUNCE=y 257CONFIG_BOUNCE=y
242CONFIG_VIRT_TO_BUS=y 258CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y
244CONFIG_HAVE_MLOCK=y 259CONFIG_HAVE_MLOCK=y
245CONFIG_HAVE_MLOCKED_PAGE_BIT=y 260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
246CONFIG_PPC_4K_PAGES=y 262CONFIG_PPC_4K_PAGES=y
247# CONFIG_PPC_16K_PAGES is not set 263# CONFIG_PPC_16K_PAGES is not set
248# CONFIG_PPC_64K_PAGES is not set 264# CONFIG_PPC_64K_PAGES is not set
@@ -348,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_ECONET is not set 364# CONFIG_ECONET is not set
349# CONFIG_WAN_ROUTER is not set 365# CONFIG_WAN_ROUTER is not set
350# CONFIG_PHONET is not set 366# CONFIG_PHONET is not set
367# CONFIG_IEEE802154 is not set
351# CONFIG_NET_SCHED is not set 368# CONFIG_NET_SCHED is not set
352# CONFIG_DCB is not set 369# CONFIG_DCB is not set
353 370
@@ -365,7 +382,11 @@ CONFIG_WIRELESS=y
365CONFIG_WIRELESS_OLD_REGULATORY=y 382CONFIG_WIRELESS_OLD_REGULATORY=y
366# CONFIG_WIRELESS_EXT is not set 383# CONFIG_WIRELESS_EXT is not set
367# CONFIG_LIB80211 is not set 384# CONFIG_LIB80211 is not set
368# CONFIG_MAC80211 is not set 385
386#
387# CFG80211 needs to be enabled for MAC80211
388#
389CONFIG_MAC80211_DEFAULT_PS_VALUE=0
369# CONFIG_WIMAX is not set 390# CONFIG_WIMAX is not set
370# CONFIG_RFKILL is not set 391# CONFIG_RFKILL is not set
371# CONFIG_NET_9P is not set 392# CONFIG_NET_9P is not set
@@ -385,6 +406,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
385# CONFIG_CONNECTOR is not set 406# CONFIG_CONNECTOR is not set
386# CONFIG_MTD is not set 407# CONFIG_MTD is not set
387CONFIG_OF_DEVICE=y 408CONFIG_OF_DEVICE=y
409CONFIG_OF_MDIO=y
388# CONFIG_PARPORT is not set 410# CONFIG_PARPORT is not set
389CONFIG_BLK_DEV=y 411CONFIG_BLK_DEV=y
390# CONFIG_BLK_DEV_FD is not set 412# CONFIG_BLK_DEV_FD is not set
@@ -416,6 +438,7 @@ CONFIG_MISC_DEVICES=y
416# EEPROM support 438# EEPROM support
417# 439#
418# CONFIG_EEPROM_93CX6 is not set 440# CONFIG_EEPROM_93CX6 is not set
441# CONFIG_CB710_CORE is not set
419CONFIG_HAVE_IDE=y 442CONFIG_HAVE_IDE=y
420# CONFIG_IDE is not set 443# CONFIG_IDE is not set
421 444
@@ -438,10 +461,6 @@ CONFIG_BLK_DEV_SD=y
438# CONFIG_BLK_DEV_SR is not set 461# CONFIG_BLK_DEV_SR is not set
439# CONFIG_CHR_DEV_SG is not set 462# CONFIG_CHR_DEV_SG is not set
440# CONFIG_CHR_DEV_SCH is not set 463# CONFIG_CHR_DEV_SCH is not set
441
442#
443# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
444#
445# CONFIG_SCSI_MULTI_LUN is not set 464# CONFIG_SCSI_MULTI_LUN is not set
446# CONFIG_SCSI_CONSTANTS is not set 465# CONFIG_SCSI_CONSTANTS is not set
447# CONFIG_SCSI_LOGGING is not set 466# CONFIG_SCSI_LOGGING is not set
@@ -458,6 +477,7 @@ CONFIG_BLK_DEV_SD=y
458CONFIG_SCSI_LOWLEVEL=y 477CONFIG_SCSI_LOWLEVEL=y
459# CONFIG_ISCSI_TCP is not set 478# CONFIG_ISCSI_TCP is not set
460# CONFIG_SCSI_CXGB3_ISCSI is not set 479# CONFIG_SCSI_CXGB3_ISCSI is not set
480# CONFIG_SCSI_BNX2_ISCSI is not set
461# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 481# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
462# CONFIG_SCSI_3W_9XXX is not set 482# CONFIG_SCSI_3W_9XXX is not set
463# CONFIG_SCSI_ACARD is not set 483# CONFIG_SCSI_ACARD is not set
@@ -466,6 +486,7 @@ CONFIG_SCSI_LOWLEVEL=y
466# CONFIG_SCSI_AIC7XXX_OLD is not set 486# CONFIG_SCSI_AIC7XXX_OLD is not set
467# CONFIG_SCSI_AIC79XX is not set 487# CONFIG_SCSI_AIC79XX is not set
468# CONFIG_SCSI_AIC94XX is not set 488# CONFIG_SCSI_AIC94XX is not set
489# CONFIG_SCSI_MVSAS is not set
469# CONFIG_SCSI_DPT_I2O is not set 490# CONFIG_SCSI_DPT_I2O is not set
470# CONFIG_SCSI_ADVANSYS is not set 491# CONFIG_SCSI_ADVANSYS is not set
471# CONFIG_SCSI_ARCMSR is not set 492# CONFIG_SCSI_ARCMSR is not set
@@ -485,7 +506,6 @@ CONFIG_SCSI_LOWLEVEL=y
485# CONFIG_SCSI_IPS is not set 506# CONFIG_SCSI_IPS is not set
486# CONFIG_SCSI_INITIO is not set 507# CONFIG_SCSI_INITIO is not set
487# CONFIG_SCSI_INIA100 is not set 508# CONFIG_SCSI_INIA100 is not set
488# CONFIG_SCSI_MVSAS is not set
489# CONFIG_SCSI_STEX is not set 509# CONFIG_SCSI_STEX is not set
490# CONFIG_SCSI_SYM53C8XX_2 is not set 510# CONFIG_SCSI_SYM53C8XX_2 is not set
491# CONFIG_SCSI_IPR is not set 511# CONFIG_SCSI_IPR is not set
@@ -568,14 +588,17 @@ CONFIG_SATA_MV=y
568# 588#
569 589
570# 590#
571# Enable only one of the two stacks, unless you know what you are doing 591# You can enable one or both FireWire driver stacks.
592#
593
594#
595# See the help texts for more information.
572# 596#
573# CONFIG_FIREWIRE is not set 597# CONFIG_FIREWIRE is not set
574# CONFIG_IEEE1394 is not set 598# CONFIG_IEEE1394 is not set
575# CONFIG_I2O is not set 599# CONFIG_I2O is not set
576# CONFIG_MACINTOSH_DRIVERS is not set 600# CONFIG_MACINTOSH_DRIVERS is not set
577CONFIG_NETDEVICES=y 601CONFIG_NETDEVICES=y
578CONFIG_COMPAT_NET_DEV_OPS=y
579# CONFIG_DUMMY is not set 602# CONFIG_DUMMY is not set
580# CONFIG_BONDING is not set 603# CONFIG_BONDING is not set
581# CONFIG_MACVLAN is not set 604# CONFIG_MACVLAN is not set
@@ -642,6 +665,7 @@ CONFIG_8139TOO=y
642# CONFIG_SMSC9420 is not set 665# CONFIG_SMSC9420 is not set
643# CONFIG_SUNDANCE is not set 666# CONFIG_SUNDANCE is not set
644# CONFIG_TLAN is not set 667# CONFIG_TLAN is not set
668# CONFIG_KS8842 is not set
645# CONFIG_VIA_RHINE is not set 669# CONFIG_VIA_RHINE is not set
646# CONFIG_SC92031 is not set 670# CONFIG_SC92031 is not set
647# CONFIG_ATL2 is not set 671# CONFIG_ATL2 is not set
@@ -663,7 +687,9 @@ CONFIG_NETDEV_1000=y
663# CONFIG_VIA_VELOCITY is not set 687# CONFIG_VIA_VELOCITY is not set
664# CONFIG_TIGON3 is not set 688# CONFIG_TIGON3 is not set
665# CONFIG_BNX2 is not set 689# CONFIG_BNX2 is not set
690# CONFIG_CNIC is not set
666CONFIG_TSI108_ETH=y 691CONFIG_TSI108_ETH=y
692# CONFIG_MV643XX_ETH is not set
667# CONFIG_QLA3XXX is not set 693# CONFIG_QLA3XXX is not set
668# CONFIG_ATL1 is not set 694# CONFIG_ATL1 is not set
669# CONFIG_ATL1E is not set 695# CONFIG_ATL1E is not set
@@ -785,6 +811,11 @@ CONFIG_GEN_RTC=y
785CONFIG_DEVPORT=y 811CONFIG_DEVPORT=y
786# CONFIG_I2C is not set 812# CONFIG_I2C is not set
787# CONFIG_SPI is not set 813# CONFIG_SPI is not set
814
815#
816# PPS support
817#
818# CONFIG_PPS is not set
788CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 819CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
789# CONFIG_GPIOLIB is not set 820# CONFIG_GPIOLIB is not set
790# CONFIG_W1 is not set 821# CONFIG_W1 is not set
@@ -824,22 +855,7 @@ CONFIG_SSB_POSSIBLE=y
824# CONFIG_HTC_PASIC3 is not set 855# CONFIG_HTC_PASIC3 is not set
825# CONFIG_MFD_TMIO is not set 856# CONFIG_MFD_TMIO is not set
826# CONFIG_REGULATOR is not set 857# CONFIG_REGULATOR is not set
827 858# CONFIG_MEDIA_SUPPORT is not set
828#
829# Multimedia devices
830#
831
832#
833# Multimedia core support
834#
835# CONFIG_VIDEO_DEV is not set
836# CONFIG_DVB_CORE is not set
837# CONFIG_VIDEO_MEDIA is not set
838
839#
840# Multimedia drivers
841#
842CONFIG_DAB=y
843 859
844# 860#
845# Graphics support 861# Graphics support
@@ -896,6 +912,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
896# CONFIG_DMADEVICES is not set 912# CONFIG_DMADEVICES is not set
897# CONFIG_AUXDISPLAY is not set 913# CONFIG_AUXDISPLAY is not set
898# CONFIG_UIO is not set 914# CONFIG_UIO is not set
915
916#
917# TI VLYNQ
918#
899# CONFIG_STAGING is not set 919# CONFIG_STAGING is not set
900 920
901# 921#
@@ -915,11 +935,12 @@ CONFIG_FS_MBCACHE=y
915# CONFIG_REISERFS_FS is not set 935# CONFIG_REISERFS_FS is not set
916# CONFIG_JFS_FS is not set 936# CONFIG_JFS_FS is not set
917# CONFIG_FS_POSIX_ACL is not set 937# CONFIG_FS_POSIX_ACL is not set
918CONFIG_FILE_LOCKING=y
919# CONFIG_XFS_FS is not set 938# CONFIG_XFS_FS is not set
920# CONFIG_GFS2_FS is not set 939# CONFIG_GFS2_FS is not set
921# CONFIG_OCFS2_FS is not set 940# CONFIG_OCFS2_FS is not set
922# CONFIG_BTRFS_FS is not set 941# CONFIG_BTRFS_FS is not set
942CONFIG_FILE_LOCKING=y
943CONFIG_FSNOTIFY=y
923CONFIG_DNOTIFY=y 944CONFIG_DNOTIFY=y
924CONFIG_INOTIFY=y 945CONFIG_INOTIFY=y
925CONFIG_INOTIFY_USER=y 946CONFIG_INOTIFY_USER=y
@@ -1038,6 +1059,7 @@ CONFIG_HAS_IOPORT=y
1038CONFIG_HAS_DMA=y 1059CONFIG_HAS_DMA=y
1039CONFIG_HAVE_LMB=y 1060CONFIG_HAVE_LMB=y
1040CONFIG_NLATTR=y 1061CONFIG_NLATTR=y
1062CONFIG_GENERIC_ATOMIC64=y
1041 1063
1042# 1064#
1043# Kernel hacking 1065# Kernel hacking
@@ -1063,22 +1085,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1063CONFIG_HAVE_DYNAMIC_FTRACE=y 1085CONFIG_HAVE_DYNAMIC_FTRACE=y
1064CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1086CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1065CONFIG_TRACING_SUPPORT=y 1087CONFIG_TRACING_SUPPORT=y
1066 1088# CONFIG_FTRACE is not set
1067#
1068# Tracers
1069#
1070# CONFIG_FUNCTION_TRACER is not set
1071# CONFIG_SCHED_TRACER is not set
1072# CONFIG_CONTEXT_SWITCH_TRACER is not set
1073# CONFIG_EVENT_TRACER is not set
1074# CONFIG_BOOT_TRACER is not set
1075# CONFIG_TRACE_BRANCH_PROFILING is not set
1076# CONFIG_STACK_TRACER is not set
1077# CONFIG_KMEMTRACE is not set
1078# CONFIG_WORKQUEUE_TRACER is not set
1079# CONFIG_BLK_DEV_IO_TRACE is not set
1080# CONFIG_SAMPLES is not set 1089# CONFIG_SAMPLES is not set
1081CONFIG_HAVE_ARCH_KGDB=y 1090CONFIG_HAVE_ARCH_KGDB=y
1091# CONFIG_PPC_DISABLE_WERROR is not set
1092CONFIG_PPC_WERROR=y
1082CONFIG_PRINT_STACK_DEPTH=64 1093CONFIG_PRINT_STACK_DEPTH=64
1083# CONFIG_IRQSTACKS is not set 1094# CONFIG_IRQSTACKS is not set
1084# CONFIG_BOOTX_TEXT is not set 1095# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/mpc8272_ads_defconfig b/arch/powerpc/configs/mpc8272_ads_defconfig
index cb966ca2ce89..02716f72db6f 100644
--- a/arch/powerpc/configs/mpc8272_ads_defconfig
+++ b/arch/powerpc/configs/mpc8272_ads_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:57 2009 4# Wed Jul 29 23:31:54 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,11 +56,13 @@ CONFIG_OF=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -99,7 +104,6 @@ CONFIG_SYSCTL_SYSCALL=y
99CONFIG_KALLSYMS=y 104CONFIG_KALLSYMS=y
100CONFIG_KALLSYMS_ALL=y 105CONFIG_KALLSYMS_ALL=y
101# CONFIG_KALLSYMS_EXTRA_PASS is not set 106# CONFIG_KALLSYMS_EXTRA_PASS is not set
102# CONFIG_STRIP_ASM_SYMS is not set
103CONFIG_HOTPLUG=y 107CONFIG_HOTPLUG=y
104CONFIG_PRINTK=y 108CONFIG_PRINTK=y
105CONFIG_BUG=y 109CONFIG_BUG=y
@@ -112,9 +116,16 @@ CONFIG_TIMERFD=y
112CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
113CONFIG_SHMEM=y 117CONFIG_SHMEM=y
114CONFIG_AIO=y 118CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y
120
121#
122# Performance Counters
123#
124# CONFIG_PERF_COUNTERS is not set
115CONFIG_VM_EVENT_COUNTERS=y 125CONFIG_VM_EVENT_COUNTERS=y
116CONFIG_PCI_QUIRKS=y 126CONFIG_PCI_QUIRKS=y
117CONFIG_SLUB_DEBUG=y 127CONFIG_SLUB_DEBUG=y
128# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_COMPAT_BRK=y 129CONFIG_COMPAT_BRK=y
119# CONFIG_SLAB is not set 130# CONFIG_SLAB is not set
120CONFIG_SLUB=y 131CONFIG_SLUB=y
@@ -128,6 +139,10 @@ CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 139CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 140CONFIG_HAVE_ARCH_TRACEHOOK=y
130CONFIG_HAVE_CLK=y 141CONFIG_HAVE_CLK=y
142
143#
144# GCOV-based kernel profiling
145#
131# CONFIG_SLOW_WORK is not set 146# CONFIG_SLOW_WORK is not set
132# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
133CONFIG_SLABINFO=y 148CONFIG_SLABINFO=y
@@ -135,7 +150,7 @@ CONFIG_RT_MUTEXES=y
135CONFIG_BASE_SMALL=0 150CONFIG_BASE_SMALL=0
136# CONFIG_MODULES is not set 151# CONFIG_MODULES is not set
137CONFIG_BLOCK=y 152CONFIG_BLOCK=y
138# CONFIG_LBD is not set 153CONFIG_LBDAF=y
139# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
140 155
141# 156#
@@ -216,6 +231,7 @@ CONFIG_BINFMT_ELF=y
216# CONFIG_HAVE_AOUT is not set 231# CONFIG_HAVE_AOUT is not set
217CONFIG_BINFMT_MISC=y 232CONFIG_BINFMT_MISC=y
218# CONFIG_IOMMU_HELPER is not set 233# CONFIG_IOMMU_HELPER is not set
234# CONFIG_SWIOTLB is not set
219CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 235CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
220CONFIG_ARCH_HAS_WALK_MEMORY=y 236CONFIG_ARCH_HAS_WALK_MEMORY=y
221CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 237CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -231,9 +247,9 @@ CONFIG_MIGRATION=y
231CONFIG_ZONE_DMA_FLAG=1 247CONFIG_ZONE_DMA_FLAG=1
232CONFIG_BOUNCE=y 248CONFIG_BOUNCE=y
233CONFIG_VIRT_TO_BUS=y 249CONFIG_VIRT_TO_BUS=y
234CONFIG_UNEVICTABLE_LRU=y
235CONFIG_HAVE_MLOCK=y 250CONFIG_HAVE_MLOCK=y
236CONFIG_HAVE_MLOCKED_PAGE_BIT=y 251CONFIG_HAVE_MLOCKED_PAGE_BIT=y
252CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
237CONFIG_PPC_4K_PAGES=y 253CONFIG_PPC_4K_PAGES=y
238# CONFIG_PPC_16K_PAGES is not set 254# CONFIG_PPC_16K_PAGES is not set
239# CONFIG_PPC_64K_PAGES is not set 255# CONFIG_PPC_64K_PAGES is not set
@@ -303,6 +319,7 @@ CONFIG_IP_PNP_BOOTP=y
303# CONFIG_NET_IPIP is not set 319# CONFIG_NET_IPIP is not set
304# CONFIG_NET_IPGRE is not set 320# CONFIG_NET_IPGRE is not set
305# CONFIG_IP_MROUTE is not set 321# CONFIG_IP_MROUTE is not set
322# CONFIG_ARPD is not set
306CONFIG_SYN_COOKIES=y 323CONFIG_SYN_COOKIES=y
307# CONFIG_INET_AH is not set 324# CONFIG_INET_AH is not set
308# CONFIG_INET_ESP is not set 325# CONFIG_INET_ESP is not set
@@ -383,7 +400,11 @@ CONFIG_WIRELESS=y
383CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
384# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
385# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
386# CONFIG_MAC80211 is not set 403
404#
405# CFG80211 needs to be enabled for MAC80211
406#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 408# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 409# CONFIG_RFKILL is not set
389 410
@@ -489,6 +510,7 @@ CONFIG_MTD_PHYSMAP_OF=y
489# CONFIG_MTD_UBI is not set 510# CONFIG_MTD_UBI is not set
490CONFIG_OF_DEVICE=y 511CONFIG_OF_DEVICE=y
491CONFIG_OF_GPIO=y 512CONFIG_OF_GPIO=y
513CONFIG_OF_MDIO=y
492# CONFIG_PARPORT is not set 514# CONFIG_PARPORT is not set
493CONFIG_BLK_DEV=y 515CONFIG_BLK_DEV=y
494# CONFIG_BLK_DEV_FD is not set 516# CONFIG_BLK_DEV_FD is not set
@@ -524,13 +546,17 @@ CONFIG_HAVE_IDE=y
524# 546#
525 547
526# 548#
527# A new alternative FireWire stack is available with EXPERIMENTAL=y 549# You can enable one or both FireWire driver stacks.
550#
551
552#
553# See the help texts for more information.
528# 554#
555# CONFIG_FIREWIRE is not set
529# CONFIG_IEEE1394 is not set 556# CONFIG_IEEE1394 is not set
530# CONFIG_I2O is not set 557# CONFIG_I2O is not set
531# CONFIG_MACINTOSH_DRIVERS is not set 558# CONFIG_MACINTOSH_DRIVERS is not set
532CONFIG_NETDEVICES=y 559CONFIG_NETDEVICES=y
533CONFIG_COMPAT_NET_DEV_OPS=y
534# CONFIG_DUMMY is not set 560# CONFIG_DUMMY is not set
535# CONFIG_BONDING is not set 561# CONFIG_BONDING is not set
536# CONFIG_EQUALIZER is not set 562# CONFIG_EQUALIZER is not set
@@ -577,6 +603,7 @@ CONFIG_MII=y
577# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 603# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
578# CONFIG_NET_PCI is not set 604# CONFIG_NET_PCI is not set
579# CONFIG_B44 is not set 605# CONFIG_B44 is not set
606# CONFIG_KS8842 is not set
580# CONFIG_ATL2 is not set 607# CONFIG_ATL2 is not set
581CONFIG_FS_ENET=y 608CONFIG_FS_ENET=y
582# CONFIG_FS_ENET_HAS_SCC is not set 609# CONFIG_FS_ENET_HAS_SCC is not set
@@ -598,8 +625,10 @@ CONFIG_NETDEV_1000=y
598# CONFIG_VIA_VELOCITY is not set 625# CONFIG_VIA_VELOCITY is not set
599# CONFIG_TIGON3 is not set 626# CONFIG_TIGON3 is not set
600# CONFIG_BNX2 is not set 627# CONFIG_BNX2 is not set
628# CONFIG_CNIC is not set
601# CONFIG_FSL_PQ_MDIO is not set 629# CONFIG_FSL_PQ_MDIO is not set
602# CONFIG_GIANFAR is not set 630# CONFIG_GIANFAR is not set
631# CONFIG_MV643XX_ETH is not set
603# CONFIG_QLA3XXX is not set 632# CONFIG_QLA3XXX is not set
604# CONFIG_ATL1 is not set 633# CONFIG_ATL1 is not set
605# CONFIG_JME is not set 634# CONFIG_JME is not set
@@ -671,12 +700,13 @@ CONFIG_INPUT_EVDEV=y
671# 700#
672CONFIG_INPUT_KEYBOARD=y 701CONFIG_INPUT_KEYBOARD=y
673CONFIG_KEYBOARD_ATKBD=y 702CONFIG_KEYBOARD_ATKBD=y
674# CONFIG_KEYBOARD_SUNKBD is not set
675# CONFIG_KEYBOARD_LKKBD is not set 703# CONFIG_KEYBOARD_LKKBD is not set
676# CONFIG_KEYBOARD_XTKBD is not set 704# CONFIG_KEYBOARD_GPIO is not set
705# CONFIG_KEYBOARD_MATRIX is not set
677# CONFIG_KEYBOARD_NEWTON is not set 706# CONFIG_KEYBOARD_NEWTON is not set
678# CONFIG_KEYBOARD_STOWAWAY is not set 707# CONFIG_KEYBOARD_STOWAWAY is not set
679# CONFIG_KEYBOARD_GPIO is not set 708# CONFIG_KEYBOARD_SUNKBD is not set
709# CONFIG_KEYBOARD_XTKBD is not set
680CONFIG_INPUT_MOUSE=y 710CONFIG_INPUT_MOUSE=y
681CONFIG_MOUSE_PS2=y 711CONFIG_MOUSE_PS2=y
682CONFIG_MOUSE_PS2_ALPS=y 712CONFIG_MOUSE_PS2_ALPS=y
@@ -741,6 +771,10 @@ CONFIG_HW_RANDOM=y
741CONFIG_DEVPORT=y 771CONFIG_DEVPORT=y
742# CONFIG_I2C is not set 772# CONFIG_I2C is not set
743# CONFIG_SPI is not set 773# CONFIG_SPI is not set
774
775#
776# PPS support
777#
744CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 778CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
745CONFIG_ARCH_REQUIRE_GPIOLIB=y 779CONFIG_ARCH_REQUIRE_GPIOLIB=y
746CONFIG_GPIOLIB=y 780CONFIG_GPIOLIB=y
@@ -784,22 +818,7 @@ CONFIG_SSB_POSSIBLE=y
784# CONFIG_HTC_PASIC3 is not set 818# CONFIG_HTC_PASIC3 is not set
785# CONFIG_MFD_TMIO is not set 819# CONFIG_MFD_TMIO is not set
786# CONFIG_REGULATOR is not set 820# CONFIG_REGULATOR is not set
787 821# CONFIG_MEDIA_SUPPORT is not set
788#
789# Multimedia devices
790#
791
792#
793# Multimedia core support
794#
795# CONFIG_VIDEO_DEV is not set
796# CONFIG_DVB_CORE is not set
797# CONFIG_VIDEO_MEDIA is not set
798
799#
800# Multimedia drivers
801#
802CONFIG_DAB=y
803 822
804# 823#
805# Graphics support 824# Graphics support
@@ -828,6 +847,10 @@ CONFIG_DAB=y
828# CONFIG_DMADEVICES is not set 847# CONFIG_DMADEVICES is not set
829# CONFIG_AUXDISPLAY is not set 848# CONFIG_AUXDISPLAY is not set
830# CONFIG_UIO is not set 849# CONFIG_UIO is not set
850
851#
852# TI VLYNQ
853#
831# CONFIG_STAGING is not set 854# CONFIG_STAGING is not set
832 855
833# 856#
@@ -847,9 +870,10 @@ CONFIG_FS_MBCACHE=y
847# CONFIG_REISERFS_FS is not set 870# CONFIG_REISERFS_FS is not set
848# CONFIG_JFS_FS is not set 871# CONFIG_JFS_FS is not set
849CONFIG_FS_POSIX_ACL=y 872CONFIG_FS_POSIX_ACL=y
850CONFIG_FILE_LOCKING=y
851# CONFIG_XFS_FS is not set 873# CONFIG_XFS_FS is not set
852# CONFIG_OCFS2_FS is not set 874# CONFIG_OCFS2_FS is not set
875CONFIG_FILE_LOCKING=y
876CONFIG_FSNOTIFY=y
853CONFIG_DNOTIFY=y 877CONFIG_DNOTIFY=y
854CONFIG_INOTIFY=y 878CONFIG_INOTIFY=y
855CONFIG_INOTIFY_USER=y 879CONFIG_INOTIFY_USER=y
@@ -998,6 +1022,7 @@ CONFIG_HAS_IOPORT=y
998CONFIG_HAS_DMA=y 1022CONFIG_HAS_DMA=y
999CONFIG_HAVE_LMB=y 1023CONFIG_HAVE_LMB=y
1000CONFIG_NLATTR=y 1024CONFIG_NLATTR=y
1025CONFIG_GENERIC_ATOMIC64=y
1001 1026
1002# 1027#
1003# Kernel hacking 1028# Kernel hacking
@@ -1028,6 +1053,9 @@ CONFIG_SCHED_DEBUG=y
1028# CONFIG_RT_MUTEX_TESTER is not set 1053# CONFIG_RT_MUTEX_TESTER is not set
1029# CONFIG_DEBUG_SPINLOCK is not set 1054# CONFIG_DEBUG_SPINLOCK is not set
1030# CONFIG_DEBUG_MUTEXES is not set 1055# CONFIG_DEBUG_MUTEXES is not set
1056# CONFIG_DEBUG_LOCK_ALLOC is not set
1057# CONFIG_PROVE_LOCKING is not set
1058# CONFIG_LOCK_STAT is not set
1031# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1059# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1032# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1060# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1033# CONFIG_DEBUG_KOBJECT is not set 1061# CONFIG_DEBUG_KOBJECT is not set
@@ -1039,7 +1067,6 @@ CONFIG_DEBUG_INFO=y
1039# CONFIG_DEBUG_LIST is not set 1067# CONFIG_DEBUG_LIST is not set
1040# CONFIG_DEBUG_SG is not set 1068# CONFIG_DEBUG_SG is not set
1041# CONFIG_DEBUG_NOTIFIERS is not set 1069# CONFIG_DEBUG_NOTIFIERS is not set
1042# CONFIG_BOOT_PRINTK_DELAY is not set
1043# CONFIG_RCU_TORTURE_TEST is not set 1070# CONFIG_RCU_TORTURE_TEST is not set
1044# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1071# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1045# CONFIG_BACKTRACE_SELF_TEST is not set 1072# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1053,22 +1080,23 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1053CONFIG_HAVE_DYNAMIC_FTRACE=y 1080CONFIG_HAVE_DYNAMIC_FTRACE=y
1054CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1081CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1055CONFIG_TRACING_SUPPORT=y 1082CONFIG_TRACING_SUPPORT=y
1056 1083CONFIG_FTRACE=y
1057#
1058# Tracers
1059#
1060# CONFIG_FUNCTION_TRACER is not set 1084# CONFIG_FUNCTION_TRACER is not set
1085# CONFIG_IRQSOFF_TRACER is not set
1061# CONFIG_SCHED_TRACER is not set 1086# CONFIG_SCHED_TRACER is not set
1062# CONFIG_CONTEXT_SWITCH_TRACER is not set 1087# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1063# CONFIG_EVENT_TRACER is not set
1064# CONFIG_BOOT_TRACER is not set 1088# CONFIG_BOOT_TRACER is not set
1065# CONFIG_TRACE_BRANCH_PROFILING is not set 1089CONFIG_BRANCH_PROFILE_NONE=y
1090# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1091# CONFIG_PROFILE_ALL_BRANCHES is not set
1066# CONFIG_STACK_TRACER is not set 1092# CONFIG_STACK_TRACER is not set
1067# CONFIG_KMEMTRACE is not set 1093# CONFIG_KMEMTRACE is not set
1068# CONFIG_WORKQUEUE_TRACER is not set 1094# CONFIG_WORKQUEUE_TRACER is not set
1069# CONFIG_BLK_DEV_IO_TRACE is not set 1095# CONFIG_BLK_DEV_IO_TRACE is not set
1070# CONFIG_SAMPLES is not set 1096# CONFIG_SAMPLES is not set
1071CONFIG_HAVE_ARCH_KGDB=y 1097CONFIG_HAVE_ARCH_KGDB=y
1098# CONFIG_PPC_DISABLE_WERROR is not set
1099CONFIG_PPC_WERROR=y
1072CONFIG_PRINT_STACK_DEPTH=64 1100CONFIG_PRINT_STACK_DEPTH=64
1073# CONFIG_DEBUG_STACKOVERFLOW is not set 1101# CONFIG_DEBUG_STACKOVERFLOW is not set
1074# CONFIG_DEBUG_STACK_USAGE is not set 1102# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig
index 433c303eb82b..4a96cb6925b4 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:21:58 2009 4# Wed Jul 29 23:31:55 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_FSL_EMB_PERFMON is not set 20# CONFIG_FSL_EMB_PERFMON is not set
20# CONFIG_ALTIVEC is not set 21# CONFIG_ALTIVEC is not set
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24# CONFIG_SMP is not set 26# CONFIG_SMP is not set
25CONFIG_PPC32=y 27CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 28CONFIG_WORD_SIZE=32
@@ -31,15 +33,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 33CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 34CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
41CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 42CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 43CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 44CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 45CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 46CONFIG_GENERIC_FIND_NEXT_BIT=y
44CONFIG_GENERIC_GPIO=y 47CONFIG_GENERIC_GPIO=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -54,6 +57,7 @@ CONFIG_PPC_UDBG_16550=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57CONFIG_DEFAULT_UIMAGE=y 61CONFIG_DEFAULT_UIMAGE=y
58CONFIG_REDBOOT=y 62CONFIG_REDBOOT=y
59CONFIG_ARCH_SUSPEND_POSSIBLE=y 63CONFIG_ARCH_SUSPEND_POSSIBLE=y
@@ -61,6 +65,7 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
61# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
64 69
65# 70#
66# General setup 71# General setup
@@ -110,7 +115,6 @@ CONFIG_EMBEDDED=y
110CONFIG_SYSCTL_SYSCALL=y 115CONFIG_SYSCTL_SYSCALL=y
111CONFIG_KALLSYMS=y 116CONFIG_KALLSYMS=y
112# CONFIG_KALLSYMS_EXTRA_PASS is not set 117# CONFIG_KALLSYMS_EXTRA_PASS is not set
113# CONFIG_STRIP_ASM_SYMS is not set
114CONFIG_HOTPLUG=y 118CONFIG_HOTPLUG=y
115CONFIG_PRINTK=y 119CONFIG_PRINTK=y
116CONFIG_BUG=y 120CONFIG_BUG=y
@@ -123,8 +127,15 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 128CONFIG_SHMEM=y
125CONFIG_AIO=y 129CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y
131
132#
133# Performance Counters
134#
135# CONFIG_PERF_COUNTERS is not set
126CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
127CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
138# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 140CONFIG_SLAB=y
130# CONFIG_SLUB is not set 141# CONFIG_SLUB is not set
@@ -138,6 +149,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152
153#
154# GCOV-based kernel profiling
155#
141# CONFIG_SLOW_WORK is not set 156# CONFIG_SLOW_WORK is not set
142# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 157# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
143CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
@@ -150,7 +165,7 @@ CONFIG_MODULE_UNLOAD=y
150# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
151# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
152CONFIG_BLOCK=y 167CONFIG_BLOCK=y
153# CONFIG_LBD is not set 168CONFIG_LBDAF=y
154# CONFIG_BLK_DEV_BSG is not set 169# CONFIG_BLK_DEV_BSG is not set
155# CONFIG_BLK_DEV_INTEGRITY is not set 170# CONFIG_BLK_DEV_INTEGRITY is not set
156 171
@@ -192,6 +207,7 @@ CONFIG_MPC837x_MDS=y
192CONFIG_MPC837x_RDB=y 207CONFIG_MPC837x_RDB=y
193CONFIG_SBC834x=y 208CONFIG_SBC834x=y
194CONFIG_ASP834x=y 209CONFIG_ASP834x=y
210# CONFIG_KMETER1 is not set
195CONFIG_PPC_MPC831x=y 211CONFIG_PPC_MPC831x=y
196CONFIG_PPC_MPC832x=y 212CONFIG_PPC_MPC832x=y
197CONFIG_PPC_MPC834x=y 213CONFIG_PPC_MPC834x=y
@@ -241,6 +257,7 @@ CONFIG_BINFMT_ELF=y
241# CONFIG_BINFMT_MISC is not set 257# CONFIG_BINFMT_MISC is not set
242CONFIG_MATH_EMULATION=y 258CONFIG_MATH_EMULATION=y
243# CONFIG_IOMMU_HELPER is not set 259# CONFIG_IOMMU_HELPER is not set
260# CONFIG_SWIOTLB is not set
244CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 261CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
245CONFIG_ARCH_HAS_WALK_MEMORY=y 262CONFIG_ARCH_HAS_WALK_MEMORY=y
246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 263CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -261,9 +278,9 @@ CONFIG_MIGRATION=y
261CONFIG_ZONE_DMA_FLAG=1 278CONFIG_ZONE_DMA_FLAG=1
262CONFIG_BOUNCE=y 279CONFIG_BOUNCE=y
263CONFIG_VIRT_TO_BUS=y 280CONFIG_VIRT_TO_BUS=y
264CONFIG_UNEVICTABLE_LRU=y
265CONFIG_HAVE_MLOCK=y 281CONFIG_HAVE_MLOCK=y
266CONFIG_HAVE_MLOCKED_PAGE_BIT=y 282CONFIG_HAVE_MLOCKED_PAGE_BIT=y
283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
267CONFIG_PPC_4K_PAGES=y 284CONFIG_PPC_4K_PAGES=y
268# CONFIG_PPC_16K_PAGES is not set 285# CONFIG_PPC_16K_PAGES is not set
269# CONFIG_PPC_64K_PAGES is not set 286# CONFIG_PPC_64K_PAGES is not set
@@ -374,6 +391,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
374# CONFIG_ECONET is not set 391# CONFIG_ECONET is not set
375# CONFIG_WAN_ROUTER is not set 392# CONFIG_WAN_ROUTER is not set
376# CONFIG_PHONET is not set 393# CONFIG_PHONET is not set
394# CONFIG_IEEE802154 is not set
377# CONFIG_NET_SCHED is not set 395# CONFIG_NET_SCHED is not set
378# CONFIG_DCB is not set 396# CONFIG_DCB is not set
379 397
@@ -391,7 +409,11 @@ CONFIG_WIRELESS=y
391CONFIG_WIRELESS_OLD_REGULATORY=y 409CONFIG_WIRELESS_OLD_REGULATORY=y
392# CONFIG_WIRELESS_EXT is not set 410# CONFIG_WIRELESS_EXT is not set
393# CONFIG_LIB80211 is not set 411# CONFIG_LIB80211 is not set
394# CONFIG_MAC80211 is not set 412
413#
414# CFG80211 needs to be enabled for MAC80211
415#
416CONFIG_MAC80211_DEFAULT_PS_VALUE=0
395# CONFIG_WIMAX is not set 417# CONFIG_WIMAX is not set
396# CONFIG_RFKILL is not set 418# CONFIG_RFKILL is not set
397# CONFIG_NET_9P is not set 419# CONFIG_NET_9P is not set
@@ -507,6 +529,7 @@ CONFIG_MTD_NAND_FSL_ELBC=y
507CONFIG_OF_DEVICE=y 529CONFIG_OF_DEVICE=y
508CONFIG_OF_GPIO=y 530CONFIG_OF_GPIO=y
509CONFIG_OF_I2C=y 531CONFIG_OF_I2C=y
532CONFIG_OF_MDIO=y
510# CONFIG_PARPORT is not set 533# CONFIG_PARPORT is not set
511CONFIG_BLK_DEV=y 534CONFIG_BLK_DEV=y
512# CONFIG_BLK_DEV_FD is not set 535# CONFIG_BLK_DEV_FD is not set
@@ -542,7 +565,9 @@ CONFIG_MISC_DEVICES=y
542# 565#
543# CONFIG_EEPROM_AT24 is not set 566# CONFIG_EEPROM_AT24 is not set
544# CONFIG_EEPROM_LEGACY is not set 567# CONFIG_EEPROM_LEGACY is not set
568# CONFIG_EEPROM_MAX6875 is not set
545# CONFIG_EEPROM_93CX6 is not set 569# CONFIG_EEPROM_93CX6 is not set
570# CONFIG_CB710_CORE is not set
546CONFIG_HAVE_IDE=y 571CONFIG_HAVE_IDE=y
547# CONFIG_IDE is not set 572# CONFIG_IDE is not set
548 573
@@ -565,10 +590,6 @@ CONFIG_BLK_DEV_SD=y
565# CONFIG_BLK_DEV_SR is not set 590# CONFIG_BLK_DEV_SR is not set
566CONFIG_CHR_DEV_SG=y 591CONFIG_CHR_DEV_SG=y
567# CONFIG_CHR_DEV_SCH is not set 592# CONFIG_CHR_DEV_SCH is not set
568
569#
570# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
571#
572# CONFIG_SCSI_MULTI_LUN is not set 593# CONFIG_SCSI_MULTI_LUN is not set
573# CONFIG_SCSI_CONSTANTS is not set 594# CONFIG_SCSI_CONSTANTS is not set
574# CONFIG_SCSI_LOGGING is not set 595# CONFIG_SCSI_LOGGING is not set
@@ -586,6 +607,7 @@ CONFIG_SCSI_WAIT_SCAN=m
586CONFIG_SCSI_LOWLEVEL=y 607CONFIG_SCSI_LOWLEVEL=y
587# CONFIG_ISCSI_TCP is not set 608# CONFIG_ISCSI_TCP is not set
588# CONFIG_SCSI_CXGB3_ISCSI is not set 609# CONFIG_SCSI_CXGB3_ISCSI is not set
610# CONFIG_SCSI_BNX2_ISCSI is not set
589# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 611# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
590# CONFIG_SCSI_3W_9XXX is not set 612# CONFIG_SCSI_3W_9XXX is not set
591# CONFIG_SCSI_ACARD is not set 613# CONFIG_SCSI_ACARD is not set
@@ -594,6 +616,7 @@ CONFIG_SCSI_LOWLEVEL=y
594# CONFIG_SCSI_AIC7XXX_OLD is not set 616# CONFIG_SCSI_AIC7XXX_OLD is not set
595# CONFIG_SCSI_AIC79XX is not set 617# CONFIG_SCSI_AIC79XX is not set
596# CONFIG_SCSI_AIC94XX is not set 618# CONFIG_SCSI_AIC94XX is not set
619# CONFIG_SCSI_MVSAS is not set
597# CONFIG_SCSI_DPT_I2O is not set 620# CONFIG_SCSI_DPT_I2O is not set
598# CONFIG_SCSI_ADVANSYS is not set 621# CONFIG_SCSI_ADVANSYS is not set
599# CONFIG_SCSI_ARCMSR is not set 622# CONFIG_SCSI_ARCMSR is not set
@@ -613,7 +636,6 @@ CONFIG_SCSI_LOWLEVEL=y
613# CONFIG_SCSI_IPS is not set 636# CONFIG_SCSI_IPS is not set
614# CONFIG_SCSI_INITIO is not set 637# CONFIG_SCSI_INITIO is not set
615# CONFIG_SCSI_INIA100 is not set 638# CONFIG_SCSI_INIA100 is not set
616# CONFIG_SCSI_MVSAS is not set
617# CONFIG_SCSI_STEX is not set 639# CONFIG_SCSI_STEX is not set
618# CONFIG_SCSI_SYM53C8XX_2 is not set 640# CONFIG_SCSI_SYM53C8XX_2 is not set
619# CONFIG_SCSI_IPR is not set 641# CONFIG_SCSI_IPR is not set
@@ -697,14 +719,17 @@ CONFIG_ATA_SFF=y
697# 719#
698 720
699# 721#
700# Enable only one of the two stacks, unless you know what you are doing 722# You can enable one or both FireWire driver stacks.
723#
724
725#
726# See the help texts for more information.
701# 727#
702# CONFIG_FIREWIRE is not set 728# CONFIG_FIREWIRE is not set
703# CONFIG_IEEE1394 is not set 729# CONFIG_IEEE1394 is not set
704# CONFIG_I2O is not set 730# CONFIG_I2O is not set
705# CONFIG_MACINTOSH_DRIVERS is not set 731# CONFIG_MACINTOSH_DRIVERS is not set
706CONFIG_NETDEVICES=y 732CONFIG_NETDEVICES=y
707CONFIG_COMPAT_NET_DEV_OPS=y
708# CONFIG_DUMMY is not set 733# CONFIG_DUMMY is not set
709# CONFIG_BONDING is not set 734# CONFIG_BONDING is not set
710# CONFIG_MACVLAN is not set 735# CONFIG_MACVLAN is not set
@@ -751,6 +776,7 @@ CONFIG_MII=y
751# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 776# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
752# CONFIG_NET_PCI is not set 777# CONFIG_NET_PCI is not set
753# CONFIG_B44 is not set 778# CONFIG_B44 is not set
779# CONFIG_KS8842 is not set
754# CONFIG_ATL2 is not set 780# CONFIG_ATL2 is not set
755CONFIG_NETDEV_1000=y 781CONFIG_NETDEV_1000=y
756# CONFIG_ACENIC is not set 782# CONFIG_ACENIC is not set
@@ -770,11 +796,13 @@ CONFIG_NETDEV_1000=y
770# CONFIG_VIA_VELOCITY is not set 796# CONFIG_VIA_VELOCITY is not set
771# CONFIG_TIGON3 is not set 797# CONFIG_TIGON3 is not set
772# CONFIG_BNX2 is not set 798# CONFIG_BNX2 is not set
799# CONFIG_CNIC is not set
773CONFIG_FSL_PQ_MDIO=y 800CONFIG_FSL_PQ_MDIO=y
774CONFIG_GIANFAR=y 801CONFIG_GIANFAR=y
775CONFIG_UCC_GETH=y 802CONFIG_UCC_GETH=y
776# CONFIG_UGETH_MAGIC_PACKET is not set 803# CONFIG_UGETH_MAGIC_PACKET is not set
777# CONFIG_UGETH_TX_ON_DEMAND is not set 804# CONFIG_UGETH_TX_ON_DEMAND is not set
805# CONFIG_MV643XX_ETH is not set
778# CONFIG_QLA3XXX is not set 806# CONFIG_QLA3XXX is not set
779# CONFIG_ATL1 is not set 807# CONFIG_ATL1 is not set
780# CONFIG_ATL1E is not set 808# CONFIG_ATL1E is not set
@@ -965,13 +993,17 @@ CONFIG_I2C_MPC=y
965# CONFIG_SENSORS_PCF8574 is not set 993# CONFIG_SENSORS_PCF8574 is not set
966# CONFIG_PCF8575 is not set 994# CONFIG_PCF8575 is not set
967# CONFIG_SENSORS_PCA9539 is not set 995# CONFIG_SENSORS_PCA9539 is not set
968# CONFIG_SENSORS_MAX6875 is not set
969# CONFIG_SENSORS_TSL2550 is not set 996# CONFIG_SENSORS_TSL2550 is not set
970# CONFIG_I2C_DEBUG_CORE is not set 997# CONFIG_I2C_DEBUG_CORE is not set
971# CONFIG_I2C_DEBUG_ALGO is not set 998# CONFIG_I2C_DEBUG_ALGO is not set
972# CONFIG_I2C_DEBUG_BUS is not set 999# CONFIG_I2C_DEBUG_BUS is not set
973# CONFIG_I2C_DEBUG_CHIP is not set 1000# CONFIG_I2C_DEBUG_CHIP is not set
974# CONFIG_SPI is not set 1001# CONFIG_SPI is not set
1002
1003#
1004# PPS support
1005#
1006# CONFIG_PPS is not set
975CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1007CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
976CONFIG_ARCH_REQUIRE_GPIOLIB=y 1008CONFIG_ARCH_REQUIRE_GPIOLIB=y
977CONFIG_GPIOLIB=y 1009CONFIG_GPIOLIB=y
@@ -1050,6 +1082,7 @@ CONFIG_HWMON=y
1050# CONFIG_SENSORS_SMSC47B397 is not set 1082# CONFIG_SENSORS_SMSC47B397 is not set
1051# CONFIG_SENSORS_ADS7828 is not set 1083# CONFIG_SENSORS_ADS7828 is not set
1052# CONFIG_SENSORS_THMC50 is not set 1084# CONFIG_SENSORS_THMC50 is not set
1085# CONFIG_SENSORS_TMP401 is not set
1053# CONFIG_SENSORS_VIA686A is not set 1086# CONFIG_SENSORS_VIA686A is not set
1054# CONFIG_SENSORS_VT1211 is not set 1087# CONFIG_SENSORS_VT1211 is not set
1055# CONFIG_SENSORS_VT8231 is not set 1088# CONFIG_SENSORS_VT8231 is not set
@@ -1104,24 +1137,9 @@ CONFIG_SSB_POSSIBLE=y
1104# CONFIG_MFD_WM8400 is not set 1137# CONFIG_MFD_WM8400 is not set
1105# CONFIG_MFD_WM8350_I2C is not set 1138# CONFIG_MFD_WM8350_I2C is not set
1106# CONFIG_MFD_PCF50633 is not set 1139# CONFIG_MFD_PCF50633 is not set
1140# CONFIG_AB3100_CORE is not set
1107# CONFIG_REGULATOR is not set 1141# CONFIG_REGULATOR is not set
1108 1142# CONFIG_MEDIA_SUPPORT is not set
1109#
1110# Multimedia devices
1111#
1112
1113#
1114# Multimedia core support
1115#
1116# CONFIG_VIDEO_DEV is not set
1117# CONFIG_DVB_CORE is not set
1118# CONFIG_VIDEO_MEDIA is not set
1119
1120#
1121# Multimedia drivers
1122#
1123CONFIG_DAB=y
1124# CONFIG_USB_DABUSB is not set
1125 1143
1126# 1144#
1127# Graphics support 1145# Graphics support
@@ -1159,7 +1177,7 @@ CONFIG_HID_BELKIN=y
1159CONFIG_HID_CHERRY=y 1177CONFIG_HID_CHERRY=y
1160CONFIG_HID_CHICONY=y 1178CONFIG_HID_CHICONY=y
1161CONFIG_HID_CYPRESS=y 1179CONFIG_HID_CYPRESS=y
1162# CONFIG_DRAGONRISE_FF is not set 1180# CONFIG_HID_DRAGONRISE is not set
1163CONFIG_HID_EZKEY=y 1181CONFIG_HID_EZKEY=y
1164# CONFIG_HID_KYE is not set 1182# CONFIG_HID_KYE is not set
1165CONFIG_HID_GYRATION=y 1183CONFIG_HID_GYRATION=y
@@ -1176,10 +1194,11 @@ CONFIG_HID_PETALYNX=y
1176CONFIG_HID_SAMSUNG=y 1194CONFIG_HID_SAMSUNG=y
1177CONFIG_HID_SONY=y 1195CONFIG_HID_SONY=y
1178CONFIG_HID_SUNPLUS=y 1196CONFIG_HID_SUNPLUS=y
1179# CONFIG_GREENASIA_FF is not set 1197# CONFIG_HID_GREENASIA is not set
1198# CONFIG_HID_SMARTJOYPLUS is not set
1180# CONFIG_HID_TOPSEED is not set 1199# CONFIG_HID_TOPSEED is not set
1181CONFIG_THRUSTMASTER_FF=m 1200# CONFIG_HID_THRUSTMASTER is not set
1182CONFIG_ZEROPLUS_FF=m 1201# CONFIG_HID_ZEROPLUS is not set
1183CONFIG_USB_SUPPORT=y 1202CONFIG_USB_SUPPORT=y
1184CONFIG_USB_ARCH_HAS_HCD=y 1203CONFIG_USB_ARCH_HAS_HCD=y
1185CONFIG_USB_ARCH_HAS_OHCI=y 1204CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1205,6 +1224,7 @@ CONFIG_USB_MON=y
1205# USB Host Controller Drivers 1224# USB Host Controller Drivers
1206# 1225#
1207# CONFIG_USB_C67X00_HCD is not set 1226# CONFIG_USB_C67X00_HCD is not set
1227# CONFIG_USB_XHCI_HCD is not set
1208CONFIG_USB_EHCI_HCD=y 1228CONFIG_USB_EHCI_HCD=y
1209CONFIG_USB_EHCI_ROOT_HUB_TT=y 1229CONFIG_USB_EHCI_ROOT_HUB_TT=y
1210# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1230# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1291,6 +1311,10 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1291# CONFIG_DMADEVICES is not set 1311# CONFIG_DMADEVICES is not set
1292# CONFIG_AUXDISPLAY is not set 1312# CONFIG_AUXDISPLAY is not set
1293# CONFIG_UIO is not set 1313# CONFIG_UIO is not set
1314
1315#
1316# TI VLYNQ
1317#
1294# CONFIG_STAGING is not set 1318# CONFIG_STAGING is not set
1295 1319
1296# 1320#
@@ -1310,10 +1334,12 @@ CONFIG_FS_MBCACHE=y
1310# CONFIG_REISERFS_FS is not set 1334# CONFIG_REISERFS_FS is not set
1311# CONFIG_JFS_FS is not set 1335# CONFIG_JFS_FS is not set
1312# CONFIG_FS_POSIX_ACL is not set 1336# CONFIG_FS_POSIX_ACL is not set
1313CONFIG_FILE_LOCKING=y
1314# CONFIG_XFS_FS is not set 1337# CONFIG_XFS_FS is not set
1338# CONFIG_GFS2_FS is not set
1315# CONFIG_OCFS2_FS is not set 1339# CONFIG_OCFS2_FS is not set
1316# CONFIG_BTRFS_FS is not set 1340# CONFIG_BTRFS_FS is not set
1341CONFIG_FILE_LOCKING=y
1342CONFIG_FSNOTIFY=y
1317CONFIG_DNOTIFY=y 1343CONFIG_DNOTIFY=y
1318CONFIG_INOTIFY=y 1344CONFIG_INOTIFY=y
1319CONFIG_INOTIFY_USER=y 1345CONFIG_INOTIFY_USER=y
@@ -1377,6 +1403,7 @@ CONFIG_NFS_FS=y
1377CONFIG_NFS_V3=y 1403CONFIG_NFS_V3=y
1378# CONFIG_NFS_V3_ACL is not set 1404# CONFIG_NFS_V3_ACL is not set
1379CONFIG_NFS_V4=y 1405CONFIG_NFS_V4=y
1406# CONFIG_NFS_V4_1 is not set
1380CONFIG_ROOT_NFS=y 1407CONFIG_ROOT_NFS=y
1381# CONFIG_NFSD is not set 1408# CONFIG_NFSD is not set
1382CONFIG_LOCKD=y 1409CONFIG_LOCKD=y
@@ -1413,7 +1440,46 @@ CONFIG_MSDOS_PARTITION=y
1413# CONFIG_KARMA_PARTITION is not set 1440# CONFIG_KARMA_PARTITION is not set
1414# CONFIG_EFI_PARTITION is not set 1441# CONFIG_EFI_PARTITION is not set
1415# CONFIG_SYSV68_PARTITION is not set 1442# CONFIG_SYSV68_PARTITION is not set
1416# CONFIG_NLS is not set 1443CONFIG_NLS=y
1444CONFIG_NLS_DEFAULT="iso8859-1"
1445# CONFIG_NLS_CODEPAGE_437 is not set
1446# CONFIG_NLS_CODEPAGE_737 is not set
1447# CONFIG_NLS_CODEPAGE_775 is not set
1448# CONFIG_NLS_CODEPAGE_850 is not set
1449# CONFIG_NLS_CODEPAGE_852 is not set
1450# CONFIG_NLS_CODEPAGE_855 is not set
1451# CONFIG_NLS_CODEPAGE_857 is not set
1452# CONFIG_NLS_CODEPAGE_860 is not set
1453# CONFIG_NLS_CODEPAGE_861 is not set
1454# CONFIG_NLS_CODEPAGE_862 is not set
1455# CONFIG_NLS_CODEPAGE_863 is not set
1456# CONFIG_NLS_CODEPAGE_864 is not set
1457# CONFIG_NLS_CODEPAGE_865 is not set
1458# CONFIG_NLS_CODEPAGE_866 is not set
1459# CONFIG_NLS_CODEPAGE_869 is not set
1460# CONFIG_NLS_CODEPAGE_936 is not set
1461# CONFIG_NLS_CODEPAGE_950 is not set
1462# CONFIG_NLS_CODEPAGE_932 is not set
1463# CONFIG_NLS_CODEPAGE_949 is not set
1464# CONFIG_NLS_CODEPAGE_874 is not set
1465# CONFIG_NLS_ISO8859_8 is not set
1466# CONFIG_NLS_CODEPAGE_1250 is not set
1467# CONFIG_NLS_CODEPAGE_1251 is not set
1468# CONFIG_NLS_ASCII is not set
1469# CONFIG_NLS_ISO8859_1 is not set
1470# CONFIG_NLS_ISO8859_2 is not set
1471# CONFIG_NLS_ISO8859_3 is not set
1472# CONFIG_NLS_ISO8859_4 is not set
1473# CONFIG_NLS_ISO8859_5 is not set
1474# CONFIG_NLS_ISO8859_6 is not set
1475# CONFIG_NLS_ISO8859_7 is not set
1476# CONFIG_NLS_ISO8859_9 is not set
1477# CONFIG_NLS_ISO8859_13 is not set
1478# CONFIG_NLS_ISO8859_14 is not set
1479# CONFIG_NLS_ISO8859_15 is not set
1480# CONFIG_NLS_KOI8_R is not set
1481# CONFIG_NLS_KOI8_U is not set
1482# CONFIG_NLS_UTF8 is not set
1417# CONFIG_DLM is not set 1483# CONFIG_DLM is not set
1418CONFIG_UCC_FAST=y 1484CONFIG_UCC_FAST=y
1419CONFIG_UCC=y 1485CONFIG_UCC=y
@@ -1438,6 +1504,7 @@ CONFIG_HAS_IOPORT=y
1438CONFIG_HAS_DMA=y 1504CONFIG_HAS_DMA=y
1439CONFIG_HAVE_LMB=y 1505CONFIG_HAVE_LMB=y
1440CONFIG_NLATTR=y 1506CONFIG_NLATTR=y
1507CONFIG_GENERIC_ATOMIC64=y
1441 1508
1442# 1509#
1443# Kernel hacking 1510# Kernel hacking
@@ -1461,22 +1528,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1461CONFIG_HAVE_DYNAMIC_FTRACE=y 1528CONFIG_HAVE_DYNAMIC_FTRACE=y
1462CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1529CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1463CONFIG_TRACING_SUPPORT=y 1530CONFIG_TRACING_SUPPORT=y
1464 1531# CONFIG_FTRACE is not set
1465#
1466# Tracers
1467#
1468# CONFIG_FUNCTION_TRACER is not set
1469# CONFIG_SCHED_TRACER is not set
1470# CONFIG_CONTEXT_SWITCH_TRACER is not set
1471# CONFIG_EVENT_TRACER is not set
1472# CONFIG_BOOT_TRACER is not set
1473# CONFIG_TRACE_BRANCH_PROFILING is not set
1474# CONFIG_STACK_TRACER is not set
1475# CONFIG_KMEMTRACE is not set
1476# CONFIG_WORKQUEUE_TRACER is not set
1477# CONFIG_BLK_DEV_IO_TRACE is not set
1478# CONFIG_SAMPLES is not set 1532# CONFIG_SAMPLES is not set
1479CONFIG_HAVE_ARCH_KGDB=y 1533CONFIG_HAVE_ARCH_KGDB=y
1534# CONFIG_PPC_DISABLE_WERROR is not set
1535CONFIG_PPC_WERROR=y
1480CONFIG_PRINT_STACK_DEPTH=64 1536CONFIG_PRINT_STACK_DEPTH=64
1481# CONFIG_IRQSTACKS is not set 1537# CONFIG_IRQSTACKS is not set
1482# CONFIG_BOOTX_TEXT is not set 1538# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index c162724fed4f..ada595898af1 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc2 3# Linux kernel version: 2.6.31-rc4
4# Tue Apr 21 15:40:23 2009 4# Wed Jul 29 23:31:55 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -34,15 +34,16 @@ CONFIG_GENERIC_TIME=y
34CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
35CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
39CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
40CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_CALIBRATE_DELAY=y
46CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
47CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -57,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
57# CONFIG_GENERIC_TBSYNC is not set 58# CONFIG_GENERIC_TBSYNC is not set
58CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
59CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
60CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
61# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
62# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
65 68
66# 69#
67# General setup 70# General setup
@@ -116,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
116CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
117CONFIG_KALLSYMS_ALL=y 120CONFIG_KALLSYMS_ALL=y
118CONFIG_KALLSYMS_EXTRA_PASS=y 121CONFIG_KALLSYMS_EXTRA_PASS=y
119# CONFIG_STRIP_ASM_SYMS is not set
120CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
121CONFIG_PRINTK=y 123CONFIG_PRINTK=y
122CONFIG_BUG=y 124CONFIG_BUG=y
@@ -129,9 +131,16 @@ CONFIG_TIMERFD=y
129CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
130CONFIG_SHMEM=y 132CONFIG_SHMEM=y
131CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
132CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
133CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
134CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
135CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
136# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
137CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -146,6 +155,11 @@ CONFIG_HAVE_KPROBES=y
146CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
147CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
148CONFIG_HAVE_CLK=y 157CONFIG_HAVE_CLK=y
158
159#
160# GCOV-based kernel profiling
161#
162# CONFIG_GCOV_KERNEL is not set
149# CONFIG_SLOW_WORK is not set 163# CONFIG_SLOW_WORK is not set
150# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 164# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
151CONFIG_SLABINFO=y 165CONFIG_SLABINFO=y
@@ -158,7 +172,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
158CONFIG_MODVERSIONS=y 172CONFIG_MODVERSIONS=y
159# CONFIG_MODULE_SRCVERSION_ALL is not set 173# CONFIG_MODULE_SRCVERSION_ALL is not set
160CONFIG_BLOCK=y 174CONFIG_BLOCK=y
161CONFIG_LBD=y 175CONFIG_LBDAF=y
162# CONFIG_BLK_DEV_BSG is not set 176# CONFIG_BLK_DEV_BSG is not set
163# CONFIG_BLK_DEV_INTEGRITY is not set 177# CONFIG_BLK_DEV_INTEGRITY is not set
164 178
@@ -191,6 +205,7 @@ CONFIG_MPC8536_DS=y
191CONFIG_MPC85xx_DS=y 205CONFIG_MPC85xx_DS=y
192CONFIG_SOCRATES=y 206CONFIG_SOCRATES=y
193CONFIG_KSI8560=y 207CONFIG_KSI8560=y
208# CONFIG_XES_MPC85xx is not set
194CONFIG_STX_GP3=y 209CONFIG_STX_GP3=y
195CONFIG_TQM8540=y 210CONFIG_TQM8540=y
196CONFIG_TQM8541=y 211CONFIG_TQM8541=y
@@ -241,7 +256,9 @@ CONFIG_BINFMT_ELF=y
241# CONFIG_HAVE_AOUT is not set 256# CONFIG_HAVE_AOUT is not set
242CONFIG_BINFMT_MISC=m 257CONFIG_BINFMT_MISC=m
243CONFIG_MATH_EMULATION=y 258CONFIG_MATH_EMULATION=y
244# CONFIG_IOMMU_HELPER is not set 259CONFIG_IOMMU_HELPER=y
260CONFIG_SWIOTLB=y
261CONFIG_PPC_NEED_DMA_SYNC_OPS=y
245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 262CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
246CONFIG_ARCH_HAS_WALK_MEMORY=y 263CONFIG_ARCH_HAS_WALK_MEMORY=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 264CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -260,9 +277,9 @@ CONFIG_MIGRATION=y
260CONFIG_ZONE_DMA_FLAG=1 277CONFIG_ZONE_DMA_FLAG=1
261CONFIG_BOUNCE=y 278CONFIG_BOUNCE=y
262CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
263CONFIG_UNEVICTABLE_LRU=y
264CONFIG_HAVE_MLOCK=y 280CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y 281CONFIG_HAVE_MLOCKED_PAGE_BIT=y
282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
266CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
267# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
268# CONFIG_PPC_64K_PAGES is not set 285# CONFIG_PPC_64K_PAGES is not set
@@ -296,7 +313,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
296# CONFIG_PCI_IOV is not set 313# CONFIG_PCI_IOV is not set
297# CONFIG_PCCARD is not set 314# CONFIG_PCCARD is not set
298# CONFIG_HOTPLUG_PCI is not set 315# CONFIG_HOTPLUG_PCI is not set
299# CONFIG_HAS_RAPIDIO is not set 316CONFIG_HAS_RAPIDIO=y
317# CONFIG_RAPIDIO is not set
300 318
301# 319#
302# Advanced setup 320# Advanced setup
@@ -406,6 +424,7 @@ CONFIG_SCTP_HMAC_MD5=y
406# CONFIG_ECONET is not set 424# CONFIG_ECONET is not set
407# CONFIG_WAN_ROUTER is not set 425# CONFIG_WAN_ROUTER is not set
408# CONFIG_PHONET is not set 426# CONFIG_PHONET is not set
427# CONFIG_IEEE802154 is not set
409# CONFIG_NET_SCHED is not set 428# CONFIG_NET_SCHED is not set
410# CONFIG_DCB is not set 429# CONFIG_DCB is not set
411 430
@@ -424,7 +443,11 @@ CONFIG_WIRELESS=y
424CONFIG_WIRELESS_OLD_REGULATORY=y 443CONFIG_WIRELESS_OLD_REGULATORY=y
425# CONFIG_WIRELESS_EXT is not set 444# CONFIG_WIRELESS_EXT is not set
426# CONFIG_LIB80211 is not set 445# CONFIG_LIB80211 is not set
427# CONFIG_MAC80211 is not set 446
447#
448# CFG80211 needs to be enabled for MAC80211
449#
450CONFIG_MAC80211_DEFAULT_PS_VALUE=0
428# CONFIG_WIMAX is not set 451# CONFIG_WIMAX is not set
429# CONFIG_RFKILL is not set 452# CONFIG_RFKILL is not set
430# CONFIG_NET_9P is not set 453# CONFIG_NET_9P is not set
@@ -450,6 +473,7 @@ CONFIG_EXTRA_FIRMWARE=""
450CONFIG_OF_DEVICE=y 473CONFIG_OF_DEVICE=y
451CONFIG_OF_GPIO=y 474CONFIG_OF_GPIO=y
452CONFIG_OF_I2C=y 475CONFIG_OF_I2C=y
476CONFIG_OF_MDIO=y
453# CONFIG_PARPORT is not set 477# CONFIG_PARPORT is not set
454CONFIG_BLK_DEV=y 478CONFIG_BLK_DEV=y
455# CONFIG_BLK_DEV_FD is not set 479# CONFIG_BLK_DEV_FD is not set
@@ -485,7 +509,9 @@ CONFIG_MISC_DEVICES=y
485# 509#
486# CONFIG_EEPROM_AT24 is not set 510# CONFIG_EEPROM_AT24 is not set
487CONFIG_EEPROM_LEGACY=y 511CONFIG_EEPROM_LEGACY=y
512# CONFIG_EEPROM_MAX6875 is not set
488# CONFIG_EEPROM_93CX6 is not set 513# CONFIG_EEPROM_93CX6 is not set
514# CONFIG_CB710_CORE is not set
489CONFIG_HAVE_IDE=y 515CONFIG_HAVE_IDE=y
490# CONFIG_IDE is not set 516# CONFIG_IDE is not set
491 517
@@ -509,10 +535,6 @@ CONFIG_BLK_DEV_SR=y
509# CONFIG_BLK_DEV_SR_VENDOR is not set 535# CONFIG_BLK_DEV_SR_VENDOR is not set
510CONFIG_CHR_DEV_SG=y 536CONFIG_CHR_DEV_SG=y
511# CONFIG_CHR_DEV_SCH is not set 537# CONFIG_CHR_DEV_SCH is not set
512
513#
514# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
515#
516CONFIG_SCSI_MULTI_LUN=y 538CONFIG_SCSI_MULTI_LUN=y
517# CONFIG_SCSI_CONSTANTS is not set 539# CONFIG_SCSI_CONSTANTS is not set
518CONFIG_SCSI_LOGGING=y 540CONFIG_SCSI_LOGGING=y
@@ -530,6 +552,7 @@ CONFIG_SCSI_WAIT_SCAN=m
530CONFIG_SCSI_LOWLEVEL=y 552CONFIG_SCSI_LOWLEVEL=y
531# CONFIG_ISCSI_TCP is not set 553# CONFIG_ISCSI_TCP is not set
532# CONFIG_SCSI_CXGB3_ISCSI is not set 554# CONFIG_SCSI_CXGB3_ISCSI is not set
555# CONFIG_SCSI_BNX2_ISCSI is not set
533# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 556# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
534# CONFIG_SCSI_3W_9XXX is not set 557# CONFIG_SCSI_3W_9XXX is not set
535# CONFIG_SCSI_ACARD is not set 558# CONFIG_SCSI_ACARD is not set
@@ -538,6 +561,7 @@ CONFIG_SCSI_LOWLEVEL=y
538# CONFIG_SCSI_AIC7XXX_OLD is not set 561# CONFIG_SCSI_AIC7XXX_OLD is not set
539# CONFIG_SCSI_AIC79XX is not set 562# CONFIG_SCSI_AIC79XX is not set
540# CONFIG_SCSI_AIC94XX is not set 563# CONFIG_SCSI_AIC94XX is not set
564# CONFIG_SCSI_MVSAS is not set
541# CONFIG_SCSI_DPT_I2O is not set 565# CONFIG_SCSI_DPT_I2O is not set
542# CONFIG_SCSI_ADVANSYS is not set 566# CONFIG_SCSI_ADVANSYS is not set
543# CONFIG_SCSI_ARCMSR is not set 567# CONFIG_SCSI_ARCMSR is not set
@@ -557,7 +581,6 @@ CONFIG_SCSI_LOWLEVEL=y
557# CONFIG_SCSI_IPS is not set 581# CONFIG_SCSI_IPS is not set
558# CONFIG_SCSI_INITIO is not set 582# CONFIG_SCSI_INITIO is not set
559# CONFIG_SCSI_INIA100 is not set 583# CONFIG_SCSI_INIA100 is not set
560# CONFIG_SCSI_MVSAS is not set
561# CONFIG_SCSI_STEX is not set 584# CONFIG_SCSI_STEX is not set
562# CONFIG_SCSI_SYM53C8XX_2 is not set 585# CONFIG_SCSI_SYM53C8XX_2 is not set
563# CONFIG_SCSI_IPR is not set 586# CONFIG_SCSI_IPR is not set
@@ -641,14 +664,17 @@ CONFIG_PATA_ALI=y
641# 664#
642 665
643# 666#
644# Enable only one of the two stacks, unless you know what you are doing 667# You can enable one or both FireWire driver stacks.
668#
669
670#
671# See the help texts for more information.
645# 672#
646# CONFIG_FIREWIRE is not set 673# CONFIG_FIREWIRE is not set
647# CONFIG_IEEE1394 is not set 674# CONFIG_IEEE1394 is not set
648# CONFIG_I2O is not set 675# CONFIG_I2O is not set
649# CONFIG_MACINTOSH_DRIVERS is not set 676# CONFIG_MACINTOSH_DRIVERS is not set
650CONFIG_NETDEVICES=y 677CONFIG_NETDEVICES=y
651CONFIG_COMPAT_NET_DEV_OPS=y
652CONFIG_DUMMY=y 678CONFIG_DUMMY=y
653# CONFIG_BONDING is not set 679# CONFIG_BONDING is not set
654# CONFIG_MACVLAN is not set 680# CONFIG_MACVLAN is not set
@@ -695,6 +721,7 @@ CONFIG_MII=y
695# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 721# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
696# CONFIG_NET_PCI is not set 722# CONFIG_NET_PCI is not set
697# CONFIG_B44 is not set 723# CONFIG_B44 is not set
724# CONFIG_KS8842 is not set
698# CONFIG_ATL2 is not set 725# CONFIG_ATL2 is not set
699CONFIG_FS_ENET=y 726CONFIG_FS_ENET=y
700CONFIG_FS_ENET_HAS_SCC=y 727CONFIG_FS_ENET_HAS_SCC=y
@@ -718,11 +745,13 @@ CONFIG_NETDEV_1000=y
718# CONFIG_VIA_VELOCITY is not set 745# CONFIG_VIA_VELOCITY is not set
719# CONFIG_TIGON3 is not set 746# CONFIG_TIGON3 is not set
720# CONFIG_BNX2 is not set 747# CONFIG_BNX2 is not set
748# CONFIG_CNIC is not set
721CONFIG_FSL_PQ_MDIO=y 749CONFIG_FSL_PQ_MDIO=y
722CONFIG_GIANFAR=y 750CONFIG_GIANFAR=y
723CONFIG_UCC_GETH=y 751CONFIG_UCC_GETH=y
724# CONFIG_UGETH_MAGIC_PACKET is not set 752# CONFIG_UGETH_MAGIC_PACKET is not set
725# CONFIG_UGETH_TX_ON_DEMAND is not set 753# CONFIG_UGETH_TX_ON_DEMAND is not set
754# CONFIG_MV643XX_ETH is not set
726# CONFIG_QLA3XXX is not set 755# CONFIG_QLA3XXX is not set
727# CONFIG_ATL1 is not set 756# CONFIG_ATL1 is not set
728# CONFIG_ATL1E is not set 757# CONFIG_ATL1E is not set
@@ -897,6 +926,7 @@ CONFIG_I2C_HELPER_AUTO=y
897# I2C system bus drivers (mostly embedded / system-on-chip) 926# I2C system bus drivers (mostly embedded / system-on-chip)
898# 927#
899CONFIG_I2C_CPM=m 928CONFIG_I2C_CPM=m
929# CONFIG_I2C_DESIGNWARE is not set
900# CONFIG_I2C_GPIO is not set 930# CONFIG_I2C_GPIO is not set
901CONFIG_I2C_MPC=y 931CONFIG_I2C_MPC=y
902# CONFIG_I2C_OCORES is not set 932# CONFIG_I2C_OCORES is not set
@@ -927,13 +957,17 @@ CONFIG_I2C_MPC=y
927# CONFIG_SENSORS_PCF8574 is not set 957# CONFIG_SENSORS_PCF8574 is not set
928# CONFIG_PCF8575 is not set 958# CONFIG_PCF8575 is not set
929# CONFIG_SENSORS_PCA9539 is not set 959# CONFIG_SENSORS_PCA9539 is not set
930# CONFIG_SENSORS_MAX6875 is not set
931# CONFIG_SENSORS_TSL2550 is not set 960# CONFIG_SENSORS_TSL2550 is not set
932# CONFIG_I2C_DEBUG_CORE is not set 961# CONFIG_I2C_DEBUG_CORE is not set
933# CONFIG_I2C_DEBUG_ALGO is not set 962# CONFIG_I2C_DEBUG_ALGO is not set
934# CONFIG_I2C_DEBUG_BUS is not set 963# CONFIG_I2C_DEBUG_BUS is not set
935# CONFIG_I2C_DEBUG_CHIP is not set 964# CONFIG_I2C_DEBUG_CHIP is not set
936# CONFIG_SPI is not set 965# CONFIG_SPI is not set
966
967#
968# PPS support
969#
970# CONFIG_PPS is not set
937CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 971CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
938CONFIG_ARCH_REQUIRE_GPIOLIB=y 972CONFIG_ARCH_REQUIRE_GPIOLIB=y
939CONFIG_GPIOLIB=y 973CONFIG_GPIOLIB=y
@@ -987,76 +1021,9 @@ CONFIG_SSB_POSSIBLE=y
987# CONFIG_MFD_WM8400 is not set 1021# CONFIG_MFD_WM8400 is not set
988# CONFIG_MFD_WM8350_I2C is not set 1022# CONFIG_MFD_WM8350_I2C is not set
989# CONFIG_MFD_PCF50633 is not set 1023# CONFIG_MFD_PCF50633 is not set
1024# CONFIG_AB3100_CORE is not set
990# CONFIG_REGULATOR is not set 1025# CONFIG_REGULATOR is not set
991 1026# CONFIG_MEDIA_SUPPORT is not set
992#
993# Multimedia devices
994#
995
996#
997# Multimedia core support
998#
999# CONFIG_VIDEO_DEV is not set
1000CONFIG_DVB_CORE=m
1001CONFIG_VIDEO_MEDIA=m
1002
1003#
1004# Multimedia drivers
1005#
1006# CONFIG_MEDIA_ATTACH is not set
1007CONFIG_MEDIA_TUNER=m
1008# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
1009CONFIG_MEDIA_TUNER_SIMPLE=m
1010CONFIG_MEDIA_TUNER_TDA8290=m
1011CONFIG_MEDIA_TUNER_TDA9887=m
1012CONFIG_MEDIA_TUNER_TEA5761=m
1013CONFIG_MEDIA_TUNER_TEA5767=m
1014CONFIG_MEDIA_TUNER_MT20XX=m
1015CONFIG_MEDIA_TUNER_XC2028=m
1016CONFIG_MEDIA_TUNER_XC5000=m
1017CONFIG_MEDIA_TUNER_MC44S803=m
1018# CONFIG_DVB_DYNAMIC_MINORS is not set
1019CONFIG_DVB_CAPTURE_DRIVERS=y
1020
1021#
1022# Supported SAA7146 based PCI Adapters
1023#
1024# CONFIG_TTPCI_EEPROM is not set
1025# CONFIG_DVB_BUDGET_CORE is not set
1026
1027#
1028# Supported USB Adapters
1029#
1030# CONFIG_DVB_USB is not set
1031# CONFIG_DVB_TTUSB_BUDGET is not set
1032# CONFIG_DVB_TTUSB_DEC is not set
1033# CONFIG_DVB_SIANO_SMS1XXX is not set
1034
1035#
1036# Supported FlexCopII (B2C2) Adapters
1037#
1038# CONFIG_DVB_B2C2_FLEXCOP is not set
1039
1040#
1041# Supported BT878 Adapters
1042#
1043
1044#
1045# Supported Pluto2 Adapters
1046#
1047# CONFIG_DVB_PLUTO2 is not set
1048
1049#
1050# Supported SDMC DM1105 Adapters
1051#
1052# CONFIG_DVB_DM1105 is not set
1053
1054#
1055# Supported DVB Frontends
1056#
1057# CONFIG_DVB_FE_CUSTOMISE is not set
1058CONFIG_DAB=y
1059# CONFIG_USB_DABUSB is not set
1060 1027
1061# 1028#
1062# Graphics support 1029# Graphics support
@@ -1096,6 +1063,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1096# CONFIG_SND_VERBOSE_PRINTK is not set 1063# CONFIG_SND_VERBOSE_PRINTK is not set
1097# CONFIG_SND_DEBUG is not set 1064# CONFIG_SND_DEBUG is not set
1098CONFIG_SND_VMASTER=y 1065CONFIG_SND_VMASTER=y
1066# CONFIG_SND_RAWMIDI_SEQ is not set
1067# CONFIG_SND_OPL3_LIB_SEQ is not set
1068# CONFIG_SND_OPL4_LIB_SEQ is not set
1069# CONFIG_SND_SBAWE_SEQ is not set
1070# CONFIG_SND_EMU10K1_SEQ is not set
1099CONFIG_SND_AC97_CODEC=y 1071CONFIG_SND_AC97_CODEC=y
1100CONFIG_SND_DRIVERS=y 1072CONFIG_SND_DRIVERS=y
1101# CONFIG_SND_DUMMY is not set 1073# CONFIG_SND_DUMMY is not set
@@ -1122,6 +1094,7 @@ CONFIG_SND_PCI=y
1122# CONFIG_SND_CS4281 is not set 1094# CONFIG_SND_CS4281 is not set
1123# CONFIG_SND_CS46XX is not set 1095# CONFIG_SND_CS46XX is not set
1124# CONFIG_SND_CS5530 is not set 1096# CONFIG_SND_CS5530 is not set
1097# CONFIG_SND_CTXFI is not set
1125# CONFIG_SND_DARLA20 is not set 1098# CONFIG_SND_DARLA20 is not set
1126# CONFIG_SND_GINA20 is not set 1099# CONFIG_SND_GINA20 is not set
1127# CONFIG_SND_LAYLA20 is not set 1100# CONFIG_SND_LAYLA20 is not set
@@ -1152,6 +1125,7 @@ CONFIG_SND_PCI=y
1152CONFIG_SND_INTEL8X0=y 1125CONFIG_SND_INTEL8X0=y
1153# CONFIG_SND_INTEL8X0M is not set 1126# CONFIG_SND_INTEL8X0M is not set
1154# CONFIG_SND_KORG1212 is not set 1127# CONFIG_SND_KORG1212 is not set
1128# CONFIG_SND_LX6464ES is not set
1155# CONFIG_SND_MAESTRO3 is not set 1129# CONFIG_SND_MAESTRO3 is not set
1156# CONFIG_SND_MIXART is not set 1130# CONFIG_SND_MIXART is not set
1157# CONFIG_SND_NM256 is not set 1131# CONFIG_SND_NM256 is not set
@@ -1196,7 +1170,7 @@ CONFIG_HID_BELKIN=y
1196CONFIG_HID_CHERRY=y 1170CONFIG_HID_CHERRY=y
1197CONFIG_HID_CHICONY=y 1171CONFIG_HID_CHICONY=y
1198CONFIG_HID_CYPRESS=y 1172CONFIG_HID_CYPRESS=y
1199# CONFIG_DRAGONRISE_FF is not set 1173# CONFIG_HID_DRAGONRISE is not set
1200CONFIG_HID_EZKEY=y 1174CONFIG_HID_EZKEY=y
1201# CONFIG_HID_KYE is not set 1175# CONFIG_HID_KYE is not set
1202CONFIG_HID_GYRATION=y 1176CONFIG_HID_GYRATION=y
@@ -1213,10 +1187,11 @@ CONFIG_HID_PETALYNX=y
1213CONFIG_HID_SAMSUNG=y 1187CONFIG_HID_SAMSUNG=y
1214CONFIG_HID_SONY=y 1188CONFIG_HID_SONY=y
1215CONFIG_HID_SUNPLUS=y 1189CONFIG_HID_SUNPLUS=y
1216# CONFIG_GREENASIA_FF is not set 1190# CONFIG_HID_GREENASIA is not set
1191# CONFIG_HID_SMARTJOYPLUS is not set
1217# CONFIG_HID_TOPSEED is not set 1192# CONFIG_HID_TOPSEED is not set
1218CONFIG_THRUSTMASTER_FF=m 1193# CONFIG_HID_THRUSTMASTER is not set
1219CONFIG_ZEROPLUS_FF=m 1194# CONFIG_HID_ZEROPLUS is not set
1220CONFIG_USB_SUPPORT=y 1195CONFIG_USB_SUPPORT=y
1221CONFIG_USB_ARCH_HAS_HCD=y 1196CONFIG_USB_ARCH_HAS_HCD=y
1222CONFIG_USB_ARCH_HAS_OHCI=y 1197CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1242,6 +1217,7 @@ CONFIG_USB_MON=y
1242# USB Host Controller Drivers 1217# USB Host Controller Drivers
1243# 1218#
1244# CONFIG_USB_C67X00_HCD is not set 1219# CONFIG_USB_C67X00_HCD is not set
1220# CONFIG_USB_XHCI_HCD is not set
1245CONFIG_USB_EHCI_HCD=y 1221CONFIG_USB_EHCI_HCD=y
1246CONFIG_USB_EHCI_ROOT_HUB_TT=y 1222CONFIG_USB_EHCI_ROOT_HUB_TT=y
1247# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1223# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1251,9 +1227,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1251# CONFIG_USB_ISP116X_HCD is not set 1227# CONFIG_USB_ISP116X_HCD is not set
1252# CONFIG_USB_ISP1760_HCD is not set 1228# CONFIG_USB_ISP1760_HCD is not set
1253CONFIG_USB_OHCI_HCD=y 1229CONFIG_USB_OHCI_HCD=y
1254CONFIG_USB_OHCI_HCD_PPC_OF=y
1255CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1230CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1256CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1231CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1232CONFIG_USB_OHCI_HCD_PPC_OF=y
1257CONFIG_USB_OHCI_HCD_PCI=y 1233CONFIG_USB_OHCI_HCD_PCI=y
1258CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1234CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1259CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1235CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1352,8 +1328,6 @@ CONFIG_EDAC=y
1352# CONFIG_EDAC_DEBUG is not set 1328# CONFIG_EDAC_DEBUG is not set
1353CONFIG_EDAC_MM_EDAC=y 1329CONFIG_EDAC_MM_EDAC=y
1354CONFIG_EDAC_MPC85XX=y 1330CONFIG_EDAC_MPC85XX=y
1355# CONFIG_EDAC_AMD8131 is not set
1356# CONFIG_EDAC_AMD8111 is not set
1357CONFIG_RTC_LIB=y 1331CONFIG_RTC_LIB=y
1358CONFIG_RTC_CLASS=y 1332CONFIG_RTC_CLASS=y
1359CONFIG_RTC_HCTOSYS=y 1333CONFIG_RTC_HCTOSYS=y
@@ -1385,6 +1359,7 @@ CONFIG_RTC_INTF_DEV=y
1385# CONFIG_RTC_DRV_S35390A is not set 1359# CONFIG_RTC_DRV_S35390A is not set
1386# CONFIG_RTC_DRV_FM3130 is not set 1360# CONFIG_RTC_DRV_FM3130 is not set
1387# CONFIG_RTC_DRV_RX8581 is not set 1361# CONFIG_RTC_DRV_RX8581 is not set
1362# CONFIG_RTC_DRV_RX8025 is not set
1388 1363
1389# 1364#
1390# SPI RTC drivers 1365# SPI RTC drivers
@@ -1425,6 +1400,10 @@ CONFIG_DMA_ENGINE=y
1425# CONFIG_DMATEST is not set 1400# CONFIG_DMATEST is not set
1426# CONFIG_AUXDISPLAY is not set 1401# CONFIG_AUXDISPLAY is not set
1427# CONFIG_UIO is not set 1402# CONFIG_UIO is not set
1403
1404#
1405# TI VLYNQ
1406#
1428# CONFIG_STAGING is not set 1407# CONFIG_STAGING is not set
1429 1408
1430# 1409#
@@ -1445,11 +1424,12 @@ CONFIG_FS_MBCACHE=y
1445# CONFIG_REISERFS_FS is not set 1424# CONFIG_REISERFS_FS is not set
1446# CONFIG_JFS_FS is not set 1425# CONFIG_JFS_FS is not set
1447# CONFIG_FS_POSIX_ACL is not set 1426# CONFIG_FS_POSIX_ACL is not set
1448CONFIG_FILE_LOCKING=y
1449# CONFIG_XFS_FS is not set 1427# CONFIG_XFS_FS is not set
1450# CONFIG_GFS2_FS is not set 1428# CONFIG_GFS2_FS is not set
1451# CONFIG_OCFS2_FS is not set 1429# CONFIG_OCFS2_FS is not set
1452# CONFIG_BTRFS_FS is not set 1430# CONFIG_BTRFS_FS is not set
1431CONFIG_FILE_LOCKING=y
1432CONFIG_FSNOTIFY=y
1453CONFIG_DNOTIFY=y 1433CONFIG_DNOTIFY=y
1454CONFIG_INOTIFY=y 1434CONFIG_INOTIFY=y
1455CONFIG_INOTIFY_USER=y 1435CONFIG_INOTIFY_USER=y
@@ -1524,6 +1504,7 @@ CONFIG_NFS_FS=y
1524CONFIG_NFS_V3=y 1504CONFIG_NFS_V3=y
1525# CONFIG_NFS_V3_ACL is not set 1505# CONFIG_NFS_V3_ACL is not set
1526CONFIG_NFS_V4=y 1506CONFIG_NFS_V4=y
1507# CONFIG_NFS_V4_1 is not set
1527CONFIG_ROOT_NFS=y 1508CONFIG_ROOT_NFS=y
1528CONFIG_NFSD=y 1509CONFIG_NFSD=y
1529# CONFIG_NFSD_V3 is not set 1510# CONFIG_NFSD_V3 is not set
@@ -1628,6 +1609,7 @@ CONFIG_HAS_IOPORT=y
1628CONFIG_HAS_DMA=y 1609CONFIG_HAS_DMA=y
1629CONFIG_HAVE_LMB=y 1610CONFIG_HAVE_LMB=y
1630CONFIG_NLATTR=y 1611CONFIG_NLATTR=y
1612CONFIG_GENERIC_ATOMIC64=y
1631 1613
1632# 1614#
1633# Kernel hacking 1615# Kernel hacking
@@ -1658,6 +1640,9 @@ CONFIG_SCHED_DEBUG=y
1658# CONFIG_RT_MUTEX_TESTER is not set 1640# CONFIG_RT_MUTEX_TESTER is not set
1659# CONFIG_DEBUG_SPINLOCK is not set 1641# CONFIG_DEBUG_SPINLOCK is not set
1660# CONFIG_DEBUG_MUTEXES is not set 1642# CONFIG_DEBUG_MUTEXES is not set
1643# CONFIG_DEBUG_LOCK_ALLOC is not set
1644# CONFIG_PROVE_LOCKING is not set
1645# CONFIG_LOCK_STAT is not set
1661# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1646# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1662# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1647# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1663# CONFIG_DEBUG_KOBJECT is not set 1648# CONFIG_DEBUG_KOBJECT is not set
@@ -1670,7 +1655,6 @@ CONFIG_DEBUG_INFO=y
1670# CONFIG_DEBUG_LIST is not set 1655# CONFIG_DEBUG_LIST is not set
1671# CONFIG_DEBUG_SG is not set 1656# CONFIG_DEBUG_SG is not set
1672# CONFIG_DEBUG_NOTIFIERS is not set 1657# CONFIG_DEBUG_NOTIFIERS is not set
1673# CONFIG_BOOT_PRINTK_DELAY is not set
1674# CONFIG_RCU_TORTURE_TEST is not set 1658# CONFIG_RCU_TORTURE_TEST is not set
1675# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1659# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1676# CONFIG_BACKTRACE_SELF_TEST is not set 1660# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1684,16 +1668,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1684CONFIG_HAVE_DYNAMIC_FTRACE=y 1668CONFIG_HAVE_DYNAMIC_FTRACE=y
1685CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1669CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1686CONFIG_TRACING_SUPPORT=y 1670CONFIG_TRACING_SUPPORT=y
1687 1671CONFIG_FTRACE=y
1688#
1689# Tracers
1690#
1691# CONFIG_FUNCTION_TRACER is not set 1672# CONFIG_FUNCTION_TRACER is not set
1673# CONFIG_IRQSOFF_TRACER is not set
1692# CONFIG_SCHED_TRACER is not set 1674# CONFIG_SCHED_TRACER is not set
1693# CONFIG_CONTEXT_SWITCH_TRACER is not set 1675# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1694# CONFIG_EVENT_TRACER is not set
1695# CONFIG_BOOT_TRACER is not set 1676# CONFIG_BOOT_TRACER is not set
1696# CONFIG_TRACE_BRANCH_PROFILING is not set 1677CONFIG_BRANCH_PROFILE_NONE=y
1678# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1679# CONFIG_PROFILE_ALL_BRANCHES is not set
1697# CONFIG_STACK_TRACER is not set 1680# CONFIG_STACK_TRACER is not set
1698# CONFIG_KMEMTRACE is not set 1681# CONFIG_KMEMTRACE is not set
1699# CONFIG_WORKQUEUE_TRACER is not set 1682# CONFIG_WORKQUEUE_TRACER is not set
@@ -1702,9 +1685,13 @@ CONFIG_TRACING_SUPPORT=y
1702# CONFIG_SAMPLES is not set 1685# CONFIG_SAMPLES is not set
1703CONFIG_HAVE_ARCH_KGDB=y 1686CONFIG_HAVE_ARCH_KGDB=y
1704# CONFIG_KGDB is not set 1687# CONFIG_KGDB is not set
1688# CONFIG_KMEMCHECK is not set
1689# CONFIG_PPC_DISABLE_WERROR is not set
1690CONFIG_PPC_WERROR=y
1705CONFIG_PRINT_STACK_DEPTH=64 1691CONFIG_PRINT_STACK_DEPTH=64
1706# CONFIG_DEBUG_STACKOVERFLOW is not set 1692# CONFIG_DEBUG_STACKOVERFLOW is not set
1707# CONFIG_DEBUG_STACK_USAGE is not set 1693# CONFIG_DEBUG_STACK_USAGE is not set
1694# CONFIG_PPC_EMULATED_STATS is not set
1708# CONFIG_CODE_PATCHING_SELFTEST is not set 1695# CONFIG_CODE_PATCHING_SELFTEST is not set
1709# CONFIG_FTR_FIXUP_SELFTEST is not set 1696# CONFIG_FTR_FIXUP_SELFTEST is not set
1710# CONFIG_MSI_BITMAP_SELFTEST is not set 1697# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index 1aa1c508d600..db082ce5a1c5 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc2 3# Linux kernel version: 2.6.31-rc4
4# Tue Apr 21 15:41:18 2009 4# Wed Jul 29 23:31:56 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12CONFIG_PPC_85xx=y 12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -35,15 +35,16 @@ CONFIG_GENERIC_TIME=y
35CONFIG_GENERIC_TIME_VSYSCALL=y 35CONFIG_GENERIC_TIME_VSYSCALL=y
36CONFIG_GENERIC_CLOCKEVENTS=y 36CONFIG_GENERIC_CLOCKEVENTS=y
37CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
38CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 39# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39CONFIG_IRQ_PER_CPU=y 40CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 41CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 42CONFIG_HAVE_LATENCYTOP_SUPPORT=y
43CONFIG_TRACE_IRQFLAGS_SUPPORT=y
42CONFIG_LOCKDEP_SUPPORT=y 44CONFIG_LOCKDEP_SUPPORT=y
43CONFIG_RWSEM_XCHGADD_ALGORITHM=y 45CONFIG_RWSEM_XCHGADD_ALGORITHM=y
44CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
45CONFIG_GENERIC_HWEIGHT=y 47CONFIG_GENERIC_HWEIGHT=y
46CONFIG_GENERIC_CALIBRATE_DELAY=y
47CONFIG_GENERIC_FIND_NEXT_BIT=y 48CONFIG_GENERIC_FIND_NEXT_BIT=y
48CONFIG_GENERIC_GPIO=y 49CONFIG_GENERIC_GPIO=y
49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 50# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -58,11 +59,13 @@ CONFIG_PPC_UDBG_16550=y
58CONFIG_GENERIC_TBSYNC=y 59CONFIG_GENERIC_TBSYNC=y
59CONFIG_AUDIT_ARCH=y 60CONFIG_AUDIT_ARCH=y
60CONFIG_GENERIC_BUG=y 61CONFIG_GENERIC_BUG=y
62CONFIG_DTC=y
61CONFIG_DEFAULT_UIMAGE=y 63CONFIG_DEFAULT_UIMAGE=y
62# CONFIG_PPC_DCR_NATIVE is not set 64# CONFIG_PPC_DCR_NATIVE is not set
63# CONFIG_PPC_DCR_MMIO is not set 65# CONFIG_PPC_DCR_MMIO is not set
64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 66CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 67CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
68CONFIG_CONSTRUCTORS=y
66 69
67# 70#
68# General setup 71# General setup
@@ -117,7 +120,6 @@ CONFIG_SYSCTL_SYSCALL=y
117CONFIG_KALLSYMS=y 120CONFIG_KALLSYMS=y
118CONFIG_KALLSYMS_ALL=y 121CONFIG_KALLSYMS_ALL=y
119CONFIG_KALLSYMS_EXTRA_PASS=y 122CONFIG_KALLSYMS_EXTRA_PASS=y
120# CONFIG_STRIP_ASM_SYMS is not set
121CONFIG_HOTPLUG=y 123CONFIG_HOTPLUG=y
122CONFIG_PRINTK=y 124CONFIG_PRINTK=y
123CONFIG_BUG=y 125CONFIG_BUG=y
@@ -130,9 +132,16 @@ CONFIG_TIMERFD=y
130CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
131CONFIG_SHMEM=y 133CONFIG_SHMEM=y
132CONFIG_AIO=y 134CONFIG_AIO=y
135CONFIG_HAVE_PERF_COUNTERS=y
136
137#
138# Performance Counters
139#
140# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 141CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 142CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 143CONFIG_SLUB_DEBUG=y
144# CONFIG_STRIP_ASM_SYMS is not set
136CONFIG_COMPAT_BRK=y 145CONFIG_COMPAT_BRK=y
137# CONFIG_SLAB is not set 146# CONFIG_SLAB is not set
138CONFIG_SLUB=y 147CONFIG_SLUB=y
@@ -148,6 +157,11 @@ CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 157CONFIG_HAVE_ARCH_TRACEHOOK=y
149CONFIG_USE_GENERIC_SMP_HELPERS=y 158CONFIG_USE_GENERIC_SMP_HELPERS=y
150CONFIG_HAVE_CLK=y 159CONFIG_HAVE_CLK=y
160
161#
162# GCOV-based kernel profiling
163#
164# CONFIG_GCOV_KERNEL is not set
151# CONFIG_SLOW_WORK is not set 165# CONFIG_SLOW_WORK is not set
152# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 166# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
153CONFIG_SLABINFO=y 167CONFIG_SLABINFO=y
@@ -161,7 +175,7 @@ CONFIG_MODVERSIONS=y
161# CONFIG_MODULE_SRCVERSION_ALL is not set 175# CONFIG_MODULE_SRCVERSION_ALL is not set
162CONFIG_STOP_MACHINE=y 176CONFIG_STOP_MACHINE=y
163CONFIG_BLOCK=y 177CONFIG_BLOCK=y
164CONFIG_LBD=y 178CONFIG_LBDAF=y
165# CONFIG_BLK_DEV_BSG is not set 179# CONFIG_BLK_DEV_BSG is not set
166# CONFIG_BLK_DEV_INTEGRITY is not set 180# CONFIG_BLK_DEV_INTEGRITY is not set
167 181
@@ -194,6 +208,7 @@ CONFIG_MPC8536_DS=y
194CONFIG_MPC85xx_DS=y 208CONFIG_MPC85xx_DS=y
195CONFIG_SOCRATES=y 209CONFIG_SOCRATES=y
196CONFIG_KSI8560=y 210CONFIG_KSI8560=y
211# CONFIG_XES_MPC85xx is not set
197CONFIG_STX_GP3=y 212CONFIG_STX_GP3=y
198CONFIG_TQM8540=y 213CONFIG_TQM8540=y
199CONFIG_TQM8541=y 214CONFIG_TQM8541=y
@@ -244,7 +259,9 @@ CONFIG_BINFMT_ELF=y
244# CONFIG_HAVE_AOUT is not set 259# CONFIG_HAVE_AOUT is not set
245CONFIG_BINFMT_MISC=m 260CONFIG_BINFMT_MISC=m
246CONFIG_MATH_EMULATION=y 261CONFIG_MATH_EMULATION=y
247# CONFIG_IOMMU_HELPER is not set 262CONFIG_IOMMU_HELPER=y
263CONFIG_SWIOTLB=y
264CONFIG_PPC_NEED_DMA_SYNC_OPS=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 265CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
249CONFIG_ARCH_HAS_WALK_MEMORY=y 266CONFIG_ARCH_HAS_WALK_MEMORY=y
250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 267CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -264,9 +281,9 @@ CONFIG_MIGRATION=y
264CONFIG_ZONE_DMA_FLAG=1 281CONFIG_ZONE_DMA_FLAG=1
265CONFIG_BOUNCE=y 282CONFIG_BOUNCE=y
266CONFIG_VIRT_TO_BUS=y 283CONFIG_VIRT_TO_BUS=y
267CONFIG_UNEVICTABLE_LRU=y
268CONFIG_HAVE_MLOCK=y 284CONFIG_HAVE_MLOCK=y
269CONFIG_HAVE_MLOCKED_PAGE_BIT=y 285CONFIG_HAVE_MLOCKED_PAGE_BIT=y
286CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
270CONFIG_PPC_4K_PAGES=y 287CONFIG_PPC_4K_PAGES=y
271# CONFIG_PPC_16K_PAGES is not set 288# CONFIG_PPC_16K_PAGES is not set
272# CONFIG_PPC_64K_PAGES is not set 289# CONFIG_PPC_64K_PAGES is not set
@@ -300,7 +317,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
300# CONFIG_PCI_IOV is not set 317# CONFIG_PCI_IOV is not set
301# CONFIG_PCCARD is not set 318# CONFIG_PCCARD is not set
302# CONFIG_HOTPLUG_PCI is not set 319# CONFIG_HOTPLUG_PCI is not set
303# CONFIG_HAS_RAPIDIO is not set 320CONFIG_HAS_RAPIDIO=y
321# CONFIG_RAPIDIO is not set
304 322
305# 323#
306# Advanced setup 324# Advanced setup
@@ -410,6 +428,7 @@ CONFIG_SCTP_HMAC_MD5=y
410# CONFIG_ECONET is not set 428# CONFIG_ECONET is not set
411# CONFIG_WAN_ROUTER is not set 429# CONFIG_WAN_ROUTER is not set
412# CONFIG_PHONET is not set 430# CONFIG_PHONET is not set
431# CONFIG_IEEE802154 is not set
413# CONFIG_NET_SCHED is not set 432# CONFIG_NET_SCHED is not set
414# CONFIG_DCB is not set 433# CONFIG_DCB is not set
415 434
@@ -428,7 +447,11 @@ CONFIG_WIRELESS=y
428CONFIG_WIRELESS_OLD_REGULATORY=y 447CONFIG_WIRELESS_OLD_REGULATORY=y
429# CONFIG_WIRELESS_EXT is not set 448# CONFIG_WIRELESS_EXT is not set
430# CONFIG_LIB80211 is not set 449# CONFIG_LIB80211 is not set
431# CONFIG_MAC80211 is not set 450
451#
452# CFG80211 needs to be enabled for MAC80211
453#
454CONFIG_MAC80211_DEFAULT_PS_VALUE=0
432# CONFIG_WIMAX is not set 455# CONFIG_WIMAX is not set
433# CONFIG_RFKILL is not set 456# CONFIG_RFKILL is not set
434# CONFIG_NET_9P is not set 457# CONFIG_NET_9P is not set
@@ -454,6 +477,7 @@ CONFIG_EXTRA_FIRMWARE=""
454CONFIG_OF_DEVICE=y 477CONFIG_OF_DEVICE=y
455CONFIG_OF_GPIO=y 478CONFIG_OF_GPIO=y
456CONFIG_OF_I2C=y 479CONFIG_OF_I2C=y
480CONFIG_OF_MDIO=y
457# CONFIG_PARPORT is not set 481# CONFIG_PARPORT is not set
458CONFIG_BLK_DEV=y 482CONFIG_BLK_DEV=y
459# CONFIG_BLK_DEV_FD is not set 483# CONFIG_BLK_DEV_FD is not set
@@ -489,7 +513,9 @@ CONFIG_MISC_DEVICES=y
489# 513#
490# CONFIG_EEPROM_AT24 is not set 514# CONFIG_EEPROM_AT24 is not set
491CONFIG_EEPROM_LEGACY=y 515CONFIG_EEPROM_LEGACY=y
516# CONFIG_EEPROM_MAX6875 is not set
492# CONFIG_EEPROM_93CX6 is not set 517# CONFIG_EEPROM_93CX6 is not set
518# CONFIG_CB710_CORE is not set
493CONFIG_HAVE_IDE=y 519CONFIG_HAVE_IDE=y
494# CONFIG_IDE is not set 520# CONFIG_IDE is not set
495 521
@@ -513,10 +539,6 @@ CONFIG_BLK_DEV_SR=y
513# CONFIG_BLK_DEV_SR_VENDOR is not set 539# CONFIG_BLK_DEV_SR_VENDOR is not set
514CONFIG_CHR_DEV_SG=y 540CONFIG_CHR_DEV_SG=y
515# CONFIG_CHR_DEV_SCH is not set 541# CONFIG_CHR_DEV_SCH is not set
516
517#
518# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
519#
520CONFIG_SCSI_MULTI_LUN=y 542CONFIG_SCSI_MULTI_LUN=y
521# CONFIG_SCSI_CONSTANTS is not set 543# CONFIG_SCSI_CONSTANTS is not set
522CONFIG_SCSI_LOGGING=y 544CONFIG_SCSI_LOGGING=y
@@ -534,6 +556,7 @@ CONFIG_SCSI_WAIT_SCAN=m
534CONFIG_SCSI_LOWLEVEL=y 556CONFIG_SCSI_LOWLEVEL=y
535# CONFIG_ISCSI_TCP is not set 557# CONFIG_ISCSI_TCP is not set
536# CONFIG_SCSI_CXGB3_ISCSI is not set 558# CONFIG_SCSI_CXGB3_ISCSI is not set
559# CONFIG_SCSI_BNX2_ISCSI is not set
537# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 560# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
538# CONFIG_SCSI_3W_9XXX is not set 561# CONFIG_SCSI_3W_9XXX is not set
539# CONFIG_SCSI_ACARD is not set 562# CONFIG_SCSI_ACARD is not set
@@ -542,6 +565,7 @@ CONFIG_SCSI_LOWLEVEL=y
542# CONFIG_SCSI_AIC7XXX_OLD is not set 565# CONFIG_SCSI_AIC7XXX_OLD is not set
543# CONFIG_SCSI_AIC79XX is not set 566# CONFIG_SCSI_AIC79XX is not set
544# CONFIG_SCSI_AIC94XX is not set 567# CONFIG_SCSI_AIC94XX is not set
568# CONFIG_SCSI_MVSAS is not set
545# CONFIG_SCSI_DPT_I2O is not set 569# CONFIG_SCSI_DPT_I2O is not set
546# CONFIG_SCSI_ADVANSYS is not set 570# CONFIG_SCSI_ADVANSYS is not set
547# CONFIG_SCSI_ARCMSR is not set 571# CONFIG_SCSI_ARCMSR is not set
@@ -561,7 +585,6 @@ CONFIG_SCSI_LOWLEVEL=y
561# CONFIG_SCSI_IPS is not set 585# CONFIG_SCSI_IPS is not set
562# CONFIG_SCSI_INITIO is not set 586# CONFIG_SCSI_INITIO is not set
563# CONFIG_SCSI_INIA100 is not set 587# CONFIG_SCSI_INIA100 is not set
564# CONFIG_SCSI_MVSAS is not set
565# CONFIG_SCSI_STEX is not set 588# CONFIG_SCSI_STEX is not set
566# CONFIG_SCSI_SYM53C8XX_2 is not set 589# CONFIG_SCSI_SYM53C8XX_2 is not set
567# CONFIG_SCSI_IPR is not set 590# CONFIG_SCSI_IPR is not set
@@ -645,14 +668,17 @@ CONFIG_PATA_ALI=y
645# 668#
646 669
647# 670#
648# Enable only one of the two stacks, unless you know what you are doing 671# You can enable one or both FireWire driver stacks.
672#
673
674#
675# See the help texts for more information.
649# 676#
650# CONFIG_FIREWIRE is not set 677# CONFIG_FIREWIRE is not set
651# CONFIG_IEEE1394 is not set 678# CONFIG_IEEE1394 is not set
652# CONFIG_I2O is not set 679# CONFIG_I2O is not set
653# CONFIG_MACINTOSH_DRIVERS is not set 680# CONFIG_MACINTOSH_DRIVERS is not set
654CONFIG_NETDEVICES=y 681CONFIG_NETDEVICES=y
655CONFIG_COMPAT_NET_DEV_OPS=y
656CONFIG_DUMMY=y 682CONFIG_DUMMY=y
657# CONFIG_BONDING is not set 683# CONFIG_BONDING is not set
658# CONFIG_MACVLAN is not set 684# CONFIG_MACVLAN is not set
@@ -699,6 +725,7 @@ CONFIG_MII=y
699# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 725# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
700# CONFIG_NET_PCI is not set 726# CONFIG_NET_PCI is not set
701# CONFIG_B44 is not set 727# CONFIG_B44 is not set
728# CONFIG_KS8842 is not set
702# CONFIG_ATL2 is not set 729# CONFIG_ATL2 is not set
703CONFIG_FS_ENET=y 730CONFIG_FS_ENET=y
704CONFIG_FS_ENET_HAS_SCC=y 731CONFIG_FS_ENET_HAS_SCC=y
@@ -722,11 +749,13 @@ CONFIG_NETDEV_1000=y
722# CONFIG_VIA_VELOCITY is not set 749# CONFIG_VIA_VELOCITY is not set
723# CONFIG_TIGON3 is not set 750# CONFIG_TIGON3 is not set
724# CONFIG_BNX2 is not set 751# CONFIG_BNX2 is not set
752# CONFIG_CNIC is not set
725CONFIG_FSL_PQ_MDIO=y 753CONFIG_FSL_PQ_MDIO=y
726CONFIG_GIANFAR=y 754CONFIG_GIANFAR=y
727CONFIG_UCC_GETH=y 755CONFIG_UCC_GETH=y
728# CONFIG_UGETH_MAGIC_PACKET is not set 756# CONFIG_UGETH_MAGIC_PACKET is not set
729# CONFIG_UGETH_TX_ON_DEMAND is not set 757# CONFIG_UGETH_TX_ON_DEMAND is not set
758# CONFIG_MV643XX_ETH is not set
730# CONFIG_QLA3XXX is not set 759# CONFIG_QLA3XXX is not set
731# CONFIG_ATL1 is not set 760# CONFIG_ATL1 is not set
732# CONFIG_ATL1E is not set 761# CONFIG_ATL1E is not set
@@ -901,6 +930,7 @@ CONFIG_I2C_HELPER_AUTO=y
901# I2C system bus drivers (mostly embedded / system-on-chip) 930# I2C system bus drivers (mostly embedded / system-on-chip)
902# 931#
903CONFIG_I2C_CPM=m 932CONFIG_I2C_CPM=m
933# CONFIG_I2C_DESIGNWARE is not set
904# CONFIG_I2C_GPIO is not set 934# CONFIG_I2C_GPIO is not set
905CONFIG_I2C_MPC=y 935CONFIG_I2C_MPC=y
906# CONFIG_I2C_OCORES is not set 936# CONFIG_I2C_OCORES is not set
@@ -931,13 +961,17 @@ CONFIG_I2C_MPC=y
931# CONFIG_SENSORS_PCF8574 is not set 961# CONFIG_SENSORS_PCF8574 is not set
932# CONFIG_PCF8575 is not set 962# CONFIG_PCF8575 is not set
933# CONFIG_SENSORS_PCA9539 is not set 963# CONFIG_SENSORS_PCA9539 is not set
934# CONFIG_SENSORS_MAX6875 is not set
935# CONFIG_SENSORS_TSL2550 is not set 964# CONFIG_SENSORS_TSL2550 is not set
936# CONFIG_I2C_DEBUG_CORE is not set 965# CONFIG_I2C_DEBUG_CORE is not set
937# CONFIG_I2C_DEBUG_ALGO is not set 966# CONFIG_I2C_DEBUG_ALGO is not set
938# CONFIG_I2C_DEBUG_BUS is not set 967# CONFIG_I2C_DEBUG_BUS is not set
939# CONFIG_I2C_DEBUG_CHIP is not set 968# CONFIG_I2C_DEBUG_CHIP is not set
940# CONFIG_SPI is not set 969# CONFIG_SPI is not set
970
971#
972# PPS support
973#
974# CONFIG_PPS is not set
941CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 975CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
942CONFIG_ARCH_REQUIRE_GPIOLIB=y 976CONFIG_ARCH_REQUIRE_GPIOLIB=y
943CONFIG_GPIOLIB=y 977CONFIG_GPIOLIB=y
@@ -991,76 +1025,9 @@ CONFIG_SSB_POSSIBLE=y
991# CONFIG_MFD_WM8400 is not set 1025# CONFIG_MFD_WM8400 is not set
992# CONFIG_MFD_WM8350_I2C is not set 1026# CONFIG_MFD_WM8350_I2C is not set
993# CONFIG_MFD_PCF50633 is not set 1027# CONFIG_MFD_PCF50633 is not set
1028# CONFIG_AB3100_CORE is not set
994# CONFIG_REGULATOR is not set 1029# CONFIG_REGULATOR is not set
995 1030# CONFIG_MEDIA_SUPPORT is not set
996#
997# Multimedia devices
998#
999
1000#
1001# Multimedia core support
1002#
1003# CONFIG_VIDEO_DEV is not set
1004CONFIG_DVB_CORE=m
1005CONFIG_VIDEO_MEDIA=m
1006
1007#
1008# Multimedia drivers
1009#
1010# CONFIG_MEDIA_ATTACH is not set
1011CONFIG_MEDIA_TUNER=m
1012# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
1013CONFIG_MEDIA_TUNER_SIMPLE=m
1014CONFIG_MEDIA_TUNER_TDA8290=m
1015CONFIG_MEDIA_TUNER_TDA9887=m
1016CONFIG_MEDIA_TUNER_TEA5761=m
1017CONFIG_MEDIA_TUNER_TEA5767=m
1018CONFIG_MEDIA_TUNER_MT20XX=m
1019CONFIG_MEDIA_TUNER_XC2028=m
1020CONFIG_MEDIA_TUNER_XC5000=m
1021CONFIG_MEDIA_TUNER_MC44S803=m
1022# CONFIG_DVB_DYNAMIC_MINORS is not set
1023CONFIG_DVB_CAPTURE_DRIVERS=y
1024
1025#
1026# Supported SAA7146 based PCI Adapters
1027#
1028# CONFIG_TTPCI_EEPROM is not set
1029# CONFIG_DVB_BUDGET_CORE is not set
1030
1031#
1032# Supported USB Adapters
1033#
1034# CONFIG_DVB_USB is not set
1035# CONFIG_DVB_TTUSB_BUDGET is not set
1036# CONFIG_DVB_TTUSB_DEC is not set
1037# CONFIG_DVB_SIANO_SMS1XXX is not set
1038
1039#
1040# Supported FlexCopII (B2C2) Adapters
1041#
1042# CONFIG_DVB_B2C2_FLEXCOP is not set
1043
1044#
1045# Supported BT878 Adapters
1046#
1047
1048#
1049# Supported Pluto2 Adapters
1050#
1051# CONFIG_DVB_PLUTO2 is not set
1052
1053#
1054# Supported SDMC DM1105 Adapters
1055#
1056# CONFIG_DVB_DM1105 is not set
1057
1058#
1059# Supported DVB Frontends
1060#
1061# CONFIG_DVB_FE_CUSTOMISE is not set
1062CONFIG_DAB=y
1063# CONFIG_USB_DABUSB is not set
1064 1031
1065# 1032#
1066# Graphics support 1033# Graphics support
@@ -1100,6 +1067,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1100# CONFIG_SND_VERBOSE_PRINTK is not set 1067# CONFIG_SND_VERBOSE_PRINTK is not set
1101# CONFIG_SND_DEBUG is not set 1068# CONFIG_SND_DEBUG is not set
1102CONFIG_SND_VMASTER=y 1069CONFIG_SND_VMASTER=y
1070# CONFIG_SND_RAWMIDI_SEQ is not set
1071# CONFIG_SND_OPL3_LIB_SEQ is not set
1072# CONFIG_SND_OPL4_LIB_SEQ is not set
1073# CONFIG_SND_SBAWE_SEQ is not set
1074# CONFIG_SND_EMU10K1_SEQ is not set
1103CONFIG_SND_AC97_CODEC=y 1075CONFIG_SND_AC97_CODEC=y
1104CONFIG_SND_DRIVERS=y 1076CONFIG_SND_DRIVERS=y
1105# CONFIG_SND_DUMMY is not set 1077# CONFIG_SND_DUMMY is not set
@@ -1126,6 +1098,7 @@ CONFIG_SND_PCI=y
1126# CONFIG_SND_CS4281 is not set 1098# CONFIG_SND_CS4281 is not set
1127# CONFIG_SND_CS46XX is not set 1099# CONFIG_SND_CS46XX is not set
1128# CONFIG_SND_CS5530 is not set 1100# CONFIG_SND_CS5530 is not set
1101# CONFIG_SND_CTXFI is not set
1129# CONFIG_SND_DARLA20 is not set 1102# CONFIG_SND_DARLA20 is not set
1130# CONFIG_SND_GINA20 is not set 1103# CONFIG_SND_GINA20 is not set
1131# CONFIG_SND_LAYLA20 is not set 1104# CONFIG_SND_LAYLA20 is not set
@@ -1156,6 +1129,7 @@ CONFIG_SND_PCI=y
1156CONFIG_SND_INTEL8X0=y 1129CONFIG_SND_INTEL8X0=y
1157# CONFIG_SND_INTEL8X0M is not set 1130# CONFIG_SND_INTEL8X0M is not set
1158# CONFIG_SND_KORG1212 is not set 1131# CONFIG_SND_KORG1212 is not set
1132# CONFIG_SND_LX6464ES is not set
1159# CONFIG_SND_MAESTRO3 is not set 1133# CONFIG_SND_MAESTRO3 is not set
1160# CONFIG_SND_MIXART is not set 1134# CONFIG_SND_MIXART is not set
1161# CONFIG_SND_NM256 is not set 1135# CONFIG_SND_NM256 is not set
@@ -1200,7 +1174,7 @@ CONFIG_HID_BELKIN=y
1200CONFIG_HID_CHERRY=y 1174CONFIG_HID_CHERRY=y
1201CONFIG_HID_CHICONY=y 1175CONFIG_HID_CHICONY=y
1202CONFIG_HID_CYPRESS=y 1176CONFIG_HID_CYPRESS=y
1203# CONFIG_DRAGONRISE_FF is not set 1177# CONFIG_HID_DRAGONRISE is not set
1204CONFIG_HID_EZKEY=y 1178CONFIG_HID_EZKEY=y
1205# CONFIG_HID_KYE is not set 1179# CONFIG_HID_KYE is not set
1206CONFIG_HID_GYRATION=y 1180CONFIG_HID_GYRATION=y
@@ -1217,10 +1191,11 @@ CONFIG_HID_PETALYNX=y
1217CONFIG_HID_SAMSUNG=y 1191CONFIG_HID_SAMSUNG=y
1218CONFIG_HID_SONY=y 1192CONFIG_HID_SONY=y
1219CONFIG_HID_SUNPLUS=y 1193CONFIG_HID_SUNPLUS=y
1220# CONFIG_GREENASIA_FF is not set 1194# CONFIG_HID_GREENASIA is not set
1195# CONFIG_HID_SMARTJOYPLUS is not set
1221# CONFIG_HID_TOPSEED is not set 1196# CONFIG_HID_TOPSEED is not set
1222CONFIG_THRUSTMASTER_FF=m 1197# CONFIG_HID_THRUSTMASTER is not set
1223CONFIG_ZEROPLUS_FF=m 1198# CONFIG_HID_ZEROPLUS is not set
1224CONFIG_USB_SUPPORT=y 1199CONFIG_USB_SUPPORT=y
1225CONFIG_USB_ARCH_HAS_HCD=y 1200CONFIG_USB_ARCH_HAS_HCD=y
1226CONFIG_USB_ARCH_HAS_OHCI=y 1201CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1246,6 +1221,7 @@ CONFIG_USB_MON=y
1246# USB Host Controller Drivers 1221# USB Host Controller Drivers
1247# 1222#
1248# CONFIG_USB_C67X00_HCD is not set 1223# CONFIG_USB_C67X00_HCD is not set
1224# CONFIG_USB_XHCI_HCD is not set
1249CONFIG_USB_EHCI_HCD=y 1225CONFIG_USB_EHCI_HCD=y
1250CONFIG_USB_EHCI_ROOT_HUB_TT=y 1226CONFIG_USB_EHCI_ROOT_HUB_TT=y
1251# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1227# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1255,9 +1231,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1255# CONFIG_USB_ISP116X_HCD is not set 1231# CONFIG_USB_ISP116X_HCD is not set
1256# CONFIG_USB_ISP1760_HCD is not set 1232# CONFIG_USB_ISP1760_HCD is not set
1257CONFIG_USB_OHCI_HCD=y 1233CONFIG_USB_OHCI_HCD=y
1258CONFIG_USB_OHCI_HCD_PPC_OF=y
1259CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1234CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1260CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1235CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1236CONFIG_USB_OHCI_HCD_PPC_OF=y
1261CONFIG_USB_OHCI_HCD_PCI=y 1237CONFIG_USB_OHCI_HCD_PCI=y
1262CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1238CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1263CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1239CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1356,8 +1332,6 @@ CONFIG_EDAC=y
1356# CONFIG_EDAC_DEBUG is not set 1332# CONFIG_EDAC_DEBUG is not set
1357CONFIG_EDAC_MM_EDAC=y 1333CONFIG_EDAC_MM_EDAC=y
1358CONFIG_EDAC_MPC85XX=y 1334CONFIG_EDAC_MPC85XX=y
1359# CONFIG_EDAC_AMD8131 is not set
1360# CONFIG_EDAC_AMD8111 is not set
1361CONFIG_RTC_LIB=y 1335CONFIG_RTC_LIB=y
1362CONFIG_RTC_CLASS=y 1336CONFIG_RTC_CLASS=y
1363CONFIG_RTC_HCTOSYS=y 1337CONFIG_RTC_HCTOSYS=y
@@ -1389,6 +1363,7 @@ CONFIG_RTC_INTF_DEV=y
1389# CONFIG_RTC_DRV_S35390A is not set 1363# CONFIG_RTC_DRV_S35390A is not set
1390# CONFIG_RTC_DRV_FM3130 is not set 1364# CONFIG_RTC_DRV_FM3130 is not set
1391# CONFIG_RTC_DRV_RX8581 is not set 1365# CONFIG_RTC_DRV_RX8581 is not set
1366# CONFIG_RTC_DRV_RX8025 is not set
1392 1367
1393# 1368#
1394# SPI RTC drivers 1369# SPI RTC drivers
@@ -1429,6 +1404,10 @@ CONFIG_DMA_ENGINE=y
1429# CONFIG_DMATEST is not set 1404# CONFIG_DMATEST is not set
1430# CONFIG_AUXDISPLAY is not set 1405# CONFIG_AUXDISPLAY is not set
1431# CONFIG_UIO is not set 1406# CONFIG_UIO is not set
1407
1408#
1409# TI VLYNQ
1410#
1432# CONFIG_STAGING is not set 1411# CONFIG_STAGING is not set
1433 1412
1434# 1413#
@@ -1449,11 +1428,12 @@ CONFIG_FS_MBCACHE=y
1449# CONFIG_REISERFS_FS is not set 1428# CONFIG_REISERFS_FS is not set
1450# CONFIG_JFS_FS is not set 1429# CONFIG_JFS_FS is not set
1451# CONFIG_FS_POSIX_ACL is not set 1430# CONFIG_FS_POSIX_ACL is not set
1452CONFIG_FILE_LOCKING=y
1453# CONFIG_XFS_FS is not set 1431# CONFIG_XFS_FS is not set
1454# CONFIG_GFS2_FS is not set 1432# CONFIG_GFS2_FS is not set
1455# CONFIG_OCFS2_FS is not set 1433# CONFIG_OCFS2_FS is not set
1456# CONFIG_BTRFS_FS is not set 1434# CONFIG_BTRFS_FS is not set
1435CONFIG_FILE_LOCKING=y
1436CONFIG_FSNOTIFY=y
1457CONFIG_DNOTIFY=y 1437CONFIG_DNOTIFY=y
1458CONFIG_INOTIFY=y 1438CONFIG_INOTIFY=y
1459CONFIG_INOTIFY_USER=y 1439CONFIG_INOTIFY_USER=y
@@ -1528,6 +1508,7 @@ CONFIG_NFS_FS=y
1528CONFIG_NFS_V3=y 1508CONFIG_NFS_V3=y
1529# CONFIG_NFS_V3_ACL is not set 1509# CONFIG_NFS_V3_ACL is not set
1530CONFIG_NFS_V4=y 1510CONFIG_NFS_V4=y
1511# CONFIG_NFS_V4_1 is not set
1531CONFIG_ROOT_NFS=y 1512CONFIG_ROOT_NFS=y
1532CONFIG_NFSD=y 1513CONFIG_NFSD=y
1533# CONFIG_NFSD_V3 is not set 1514# CONFIG_NFSD_V3 is not set
@@ -1632,6 +1613,7 @@ CONFIG_HAS_IOPORT=y
1632CONFIG_HAS_DMA=y 1613CONFIG_HAS_DMA=y
1633CONFIG_HAVE_LMB=y 1614CONFIG_HAVE_LMB=y
1634CONFIG_NLATTR=y 1615CONFIG_NLATTR=y
1616CONFIG_GENERIC_ATOMIC64=y
1635 1617
1636# 1618#
1637# Kernel hacking 1619# Kernel hacking
@@ -1662,6 +1644,9 @@ CONFIG_SCHED_DEBUG=y
1662# CONFIG_RT_MUTEX_TESTER is not set 1644# CONFIG_RT_MUTEX_TESTER is not set
1663# CONFIG_DEBUG_SPINLOCK is not set 1645# CONFIG_DEBUG_SPINLOCK is not set
1664# CONFIG_DEBUG_MUTEXES is not set 1646# CONFIG_DEBUG_MUTEXES is not set
1647# CONFIG_DEBUG_LOCK_ALLOC is not set
1648# CONFIG_PROVE_LOCKING is not set
1649# CONFIG_LOCK_STAT is not set
1665# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1650# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1666# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1651# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1667# CONFIG_DEBUG_KOBJECT is not set 1652# CONFIG_DEBUG_KOBJECT is not set
@@ -1674,7 +1659,6 @@ CONFIG_DEBUG_INFO=y
1674# CONFIG_DEBUG_LIST is not set 1659# CONFIG_DEBUG_LIST is not set
1675# CONFIG_DEBUG_SG is not set 1660# CONFIG_DEBUG_SG is not set
1676# CONFIG_DEBUG_NOTIFIERS is not set 1661# CONFIG_DEBUG_NOTIFIERS is not set
1677# CONFIG_BOOT_PRINTK_DELAY is not set
1678# CONFIG_RCU_TORTURE_TEST is not set 1662# CONFIG_RCU_TORTURE_TEST is not set
1679# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1663# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1680# CONFIG_BACKTRACE_SELF_TEST is not set 1664# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1688,16 +1672,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1688CONFIG_HAVE_DYNAMIC_FTRACE=y 1672CONFIG_HAVE_DYNAMIC_FTRACE=y
1689CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1673CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1690CONFIG_TRACING_SUPPORT=y 1674CONFIG_TRACING_SUPPORT=y
1691 1675CONFIG_FTRACE=y
1692#
1693# Tracers
1694#
1695# CONFIG_FUNCTION_TRACER is not set 1676# CONFIG_FUNCTION_TRACER is not set
1677# CONFIG_IRQSOFF_TRACER is not set
1696# CONFIG_SCHED_TRACER is not set 1678# CONFIG_SCHED_TRACER is not set
1697# CONFIG_CONTEXT_SWITCH_TRACER is not set 1679# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1698# CONFIG_EVENT_TRACER is not set
1699# CONFIG_BOOT_TRACER is not set 1680# CONFIG_BOOT_TRACER is not set
1700# CONFIG_TRACE_BRANCH_PROFILING is not set 1681CONFIG_BRANCH_PROFILE_NONE=y
1682# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1683# CONFIG_PROFILE_ALL_BRANCHES is not set
1701# CONFIG_STACK_TRACER is not set 1684# CONFIG_STACK_TRACER is not set
1702# CONFIG_KMEMTRACE is not set 1685# CONFIG_KMEMTRACE is not set
1703# CONFIG_WORKQUEUE_TRACER is not set 1686# CONFIG_WORKQUEUE_TRACER is not set
@@ -1706,9 +1689,13 @@ CONFIG_TRACING_SUPPORT=y
1706# CONFIG_SAMPLES is not set 1689# CONFIG_SAMPLES is not set
1707CONFIG_HAVE_ARCH_KGDB=y 1690CONFIG_HAVE_ARCH_KGDB=y
1708# CONFIG_KGDB is not set 1691# CONFIG_KGDB is not set
1692# CONFIG_KMEMCHECK is not set
1693# CONFIG_PPC_DISABLE_WERROR is not set
1694CONFIG_PPC_WERROR=y
1709CONFIG_PRINT_STACK_DEPTH=64 1695CONFIG_PRINT_STACK_DEPTH=64
1710# CONFIG_DEBUG_STACKOVERFLOW is not set 1696# CONFIG_DEBUG_STACKOVERFLOW is not set
1711# CONFIG_DEBUG_STACK_USAGE is not set 1697# CONFIG_DEBUG_STACK_USAGE is not set
1698# CONFIG_PPC_EMULATED_STATS is not set
1712# CONFIG_CODE_PATCHING_SELFTEST is not set 1699# CONFIG_CODE_PATCHING_SELFTEST is not set
1713# CONFIG_FTR_FIXUP_SELFTEST is not set 1700# CONFIG_FTR_FIXUP_SELFTEST is not set
1714# CONFIG_MSI_BITMAP_SELFTEST is not set 1701# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/mpc866_ads_defconfig b/arch/powerpc/configs/mpc866_ads_defconfig
index 3add6f62b21e..6809b61ed3de 100644
--- a/arch/powerpc/configs/mpc866_ads_defconfig
+++ b/arch/powerpc/configs/mpc866_ads_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:00 2009 4# Wed Jul 29 23:31:57 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -48,11 +49,13 @@ CONFIG_OF=y
48# CONFIG_PPC_UDBG_16550 is not set 49# CONFIG_PPC_UDBG_16550 is not set
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
52CONFIG_DTC=y
51# CONFIG_DEFAULT_UIMAGE is not set 53# CONFIG_DEFAULT_UIMAGE is not set
52# CONFIG_PPC_DCR_NATIVE is not set 54# CONFIG_PPC_DCR_NATIVE is not set
53# CONFIG_PPC_DCR_MMIO is not set 55# CONFIG_PPC_DCR_MMIO is not set
54CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 56CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
55CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 57CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
58CONFIG_CONSTRUCTORS=y
56 59
57# 60#
58# General setup 61# General setup
@@ -98,7 +101,6 @@ CONFIG_EMBEDDED=y
98# CONFIG_SYSCTL_SYSCALL is not set 101# CONFIG_SYSCTL_SYSCALL is not set
99CONFIG_KALLSYMS=y 102CONFIG_KALLSYMS=y
100# CONFIG_KALLSYMS_EXTRA_PASS is not set 103# CONFIG_KALLSYMS_EXTRA_PASS is not set
101# CONFIG_STRIP_ASM_SYMS is not set
102# CONFIG_HOTPLUG is not set 104# CONFIG_HOTPLUG is not set
103CONFIG_PRINTK=y 105CONFIG_PRINTK=y
104# CONFIG_BUG is not set 106# CONFIG_BUG is not set
@@ -111,8 +113,15 @@ CONFIG_TIMERFD=y
111CONFIG_EVENTFD=y 113CONFIG_EVENTFD=y
112CONFIG_SHMEM=y 114CONFIG_SHMEM=y
113CONFIG_AIO=y 115CONFIG_AIO=y
116CONFIG_HAVE_PERF_COUNTERS=y
117
118#
119# Performance Counters
120#
121# CONFIG_PERF_COUNTERS is not set
114# CONFIG_VM_EVENT_COUNTERS is not set 122# CONFIG_VM_EVENT_COUNTERS is not set
115CONFIG_SLUB_DEBUG=y 123CONFIG_SLUB_DEBUG=y
124# CONFIG_STRIP_ASM_SYMS is not set
116CONFIG_COMPAT_BRK=y 125CONFIG_COMPAT_BRK=y
117# CONFIG_SLAB is not set 126# CONFIG_SLAB is not set
118CONFIG_SLUB=y 127CONFIG_SLUB=y
@@ -126,6 +135,10 @@ CONFIG_HAVE_KPROBES=y
126CONFIG_HAVE_KRETPROBES=y 135CONFIG_HAVE_KRETPROBES=y
127CONFIG_HAVE_ARCH_TRACEHOOK=y 136CONFIG_HAVE_ARCH_TRACEHOOK=y
128CONFIG_HAVE_CLK=y 137CONFIG_HAVE_CLK=y
138
139#
140# GCOV-based kernel profiling
141#
129# CONFIG_SLOW_WORK is not set 142# CONFIG_SLOW_WORK is not set
130# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
131CONFIG_SLABINFO=y 144CONFIG_SLABINFO=y
@@ -133,7 +146,7 @@ CONFIG_RT_MUTEXES=y
133CONFIG_BASE_SMALL=1 146CONFIG_BASE_SMALL=1
134# CONFIG_MODULES is not set 147# CONFIG_MODULES is not set
135CONFIG_BLOCK=y 148CONFIG_BLOCK=y
136# CONFIG_LBD is not set 149CONFIG_LBDAF=y
137# CONFIG_BLK_DEV_BSG is not set 150# CONFIG_BLK_DEV_BSG is not set
138# CONFIG_BLK_DEV_INTEGRITY is not set 151# CONFIG_BLK_DEV_INTEGRITY is not set
139 152
@@ -219,6 +232,7 @@ CONFIG_BINFMT_ELF=y
219# CONFIG_BINFMT_MISC is not set 232# CONFIG_BINFMT_MISC is not set
220CONFIG_MATH_EMULATION=y 233CONFIG_MATH_EMULATION=y
221# CONFIG_IOMMU_HELPER is not set 234# CONFIG_IOMMU_HELPER is not set
235# CONFIG_SWIOTLB is not set
222CONFIG_PPC_NEED_DMA_SYNC_OPS=y 236CONFIG_PPC_NEED_DMA_SYNC_OPS=y
223CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
224CONFIG_ARCH_HAS_WALK_MEMORY=y 238CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -238,9 +252,9 @@ CONFIG_MIGRATION=y
238CONFIG_ZONE_DMA_FLAG=1 252CONFIG_ZONE_DMA_FLAG=1
239CONFIG_BOUNCE=y 253CONFIG_BOUNCE=y
240CONFIG_VIRT_TO_BUS=y 254CONFIG_VIRT_TO_BUS=y
241CONFIG_UNEVICTABLE_LRU=y
242CONFIG_HAVE_MLOCK=y 255CONFIG_HAVE_MLOCK=y
243CONFIG_HAVE_MLOCKED_PAGE_BIT=y 256CONFIG_HAVE_MLOCKED_PAGE_BIT=y
257CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
244CONFIG_PPC_4K_PAGES=y 258CONFIG_PPC_4K_PAGES=y
245# CONFIG_PPC_16K_PAGES is not set 259# CONFIG_PPC_16K_PAGES is not set
246# CONFIG_PPC_64K_PAGES is not set 260# CONFIG_PPC_64K_PAGES is not set
@@ -278,6 +292,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
278CONFIG_KERNEL_START=0xc0000000 292CONFIG_KERNEL_START=0xc0000000
279CONFIG_PHYSICAL_START=0x00000000 293CONFIG_PHYSICAL_START=0x00000000
280CONFIG_TASK_SIZE=0x80000000 294CONFIG_TASK_SIZE=0x80000000
295CONFIG_CONSISTENT_SIZE=0x00200000
281CONFIG_NET=y 296CONFIG_NET=y
282 297
283# 298#
@@ -339,6 +354,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
339# CONFIG_ECONET is not set 354# CONFIG_ECONET is not set
340# CONFIG_WAN_ROUTER is not set 355# CONFIG_WAN_ROUTER is not set
341# CONFIG_PHONET is not set 356# CONFIG_PHONET is not set
357# CONFIG_IEEE802154 is not set
342# CONFIG_NET_SCHED is not set 358# CONFIG_NET_SCHED is not set
343# CONFIG_DCB is not set 359# CONFIG_DCB is not set
344 360
@@ -356,7 +372,11 @@ CONFIG_WIRELESS=y
356CONFIG_WIRELESS_OLD_REGULATORY=y 372CONFIG_WIRELESS_OLD_REGULATORY=y
357# CONFIG_WIRELESS_EXT is not set 373# CONFIG_WIRELESS_EXT is not set
358# CONFIG_LIB80211 is not set 374# CONFIG_LIB80211 is not set
359# CONFIG_MAC80211 is not set 375
376#
377# CFG80211 needs to be enabled for MAC80211
378#
379CONFIG_MAC80211_DEFAULT_PS_VALUE=0
360# CONFIG_WIMAX is not set 380# CONFIG_WIMAX is not set
361# CONFIG_RFKILL is not set 381# CONFIG_RFKILL is not set
362# CONFIG_NET_9P is not set 382# CONFIG_NET_9P is not set
@@ -374,6 +394,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
374# CONFIG_CONNECTOR is not set 394# CONFIG_CONNECTOR is not set
375# CONFIG_MTD is not set 395# CONFIG_MTD is not set
376CONFIG_OF_DEVICE=y 396CONFIG_OF_DEVICE=y
397CONFIG_OF_MDIO=y
377# CONFIG_PARPORT is not set 398# CONFIG_PARPORT is not set
378CONFIG_BLK_DEV=y 399CONFIG_BLK_DEV=y
379# CONFIG_BLK_DEV_FD is not set 400# CONFIG_BLK_DEV_FD is not set
@@ -407,7 +428,6 @@ CONFIG_HAVE_IDE=y
407# CONFIG_MD is not set 428# CONFIG_MD is not set
408# CONFIG_MACINTOSH_DRIVERS is not set 429# CONFIG_MACINTOSH_DRIVERS is not set
409CONFIG_NETDEVICES=y 430CONFIG_NETDEVICES=y
410CONFIG_COMPAT_NET_DEV_OPS=y
411# CONFIG_DUMMY is not set 431# CONFIG_DUMMY is not set
412# CONFIG_BONDING is not set 432# CONFIG_BONDING is not set
413# CONFIG_MACVLAN is not set 433# CONFIG_MACVLAN is not set
@@ -446,6 +466,7 @@ CONFIG_MII=y
446# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 466# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
447# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 467# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
448# CONFIG_B44 is not set 468# CONFIG_B44 is not set
469# CONFIG_KS8842 is not set
449CONFIG_FS_ENET=y 470CONFIG_FS_ENET=y
450CONFIG_FS_ENET_HAS_SCC=y 471CONFIG_FS_ENET_HAS_SCC=y
451CONFIG_FS_ENET_HAS_FEC=y 472CONFIG_FS_ENET_HAS_FEC=y
@@ -453,6 +474,7 @@ CONFIG_FS_ENET_MDIO_FEC=y
453CONFIG_NETDEV_1000=y 474CONFIG_NETDEV_1000=y
454# CONFIG_FSL_PQ_MDIO is not set 475# CONFIG_FSL_PQ_MDIO is not set
455# CONFIG_GIANFAR is not set 476# CONFIG_GIANFAR is not set
477# CONFIG_MV643XX_ETH is not set
456CONFIG_NETDEV_10000=y 478CONFIG_NETDEV_10000=y
457 479
458# 480#
@@ -496,11 +518,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
496# 518#
497CONFIG_INPUT_KEYBOARD=y 519CONFIG_INPUT_KEYBOARD=y
498CONFIG_KEYBOARD_ATKBD=y 520CONFIG_KEYBOARD_ATKBD=y
499# CONFIG_KEYBOARD_SUNKBD is not set
500# CONFIG_KEYBOARD_LKKBD is not set 521# CONFIG_KEYBOARD_LKKBD is not set
501# CONFIG_KEYBOARD_XTKBD is not set
502# CONFIG_KEYBOARD_NEWTON is not set 522# CONFIG_KEYBOARD_NEWTON is not set
503# CONFIG_KEYBOARD_STOWAWAY is not set 523# CONFIG_KEYBOARD_STOWAWAY is not set
524# CONFIG_KEYBOARD_SUNKBD is not set
525# CONFIG_KEYBOARD_XTKBD is not set
504CONFIG_INPUT_MOUSE=y 526CONFIG_INPUT_MOUSE=y
505CONFIG_MOUSE_PS2=y 527CONFIG_MOUSE_PS2=y
506CONFIG_MOUSE_PS2_ALPS=y 528CONFIG_MOUSE_PS2_ALPS=y
@@ -562,6 +584,11 @@ CONFIG_GEN_RTC=y
562# CONFIG_TCG_TPM is not set 584# CONFIG_TCG_TPM is not set
563# CONFIG_I2C is not set 585# CONFIG_I2C is not set
564# CONFIG_SPI is not set 586# CONFIG_SPI is not set
587
588#
589# PPS support
590#
591# CONFIG_PPS is not set
565CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 592CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
566# CONFIG_GPIOLIB is not set 593# CONFIG_GPIOLIB is not set
567# CONFIG_W1 is not set 594# CONFIG_W1 is not set
@@ -597,22 +624,7 @@ CONFIG_SSB_POSSIBLE=y
597# CONFIG_HTC_PASIC3 is not set 624# CONFIG_HTC_PASIC3 is not set
598# CONFIG_MFD_TMIO is not set 625# CONFIG_MFD_TMIO is not set
599# CONFIG_REGULATOR is not set 626# CONFIG_REGULATOR is not set
600 627# CONFIG_MEDIA_SUPPORT is not set
601#
602# Multimedia devices
603#
604
605#
606# Multimedia core support
607#
608# CONFIG_VIDEO_DEV is not set
609# CONFIG_DVB_CORE is not set
610# CONFIG_VIDEO_MEDIA is not set
611
612#
613# Multimedia drivers
614#
615CONFIG_DAB=y
616 628
617# 629#
618# Graphics support 630# Graphics support
@@ -664,6 +676,10 @@ CONFIG_USB_SUPPORT=y
664# CONFIG_DMADEVICES is not set 676# CONFIG_DMADEVICES is not set
665# CONFIG_AUXDISPLAY is not set 677# CONFIG_AUXDISPLAY is not set
666# CONFIG_UIO is not set 678# CONFIG_UIO is not set
679
680#
681# TI VLYNQ
682#
667# CONFIG_STAGING is not set 683# CONFIG_STAGING is not set
668 684
669# 685#
@@ -685,10 +701,12 @@ CONFIG_FS_MBCACHE=y
685# CONFIG_REISERFS_FS is not set 701# CONFIG_REISERFS_FS is not set
686# CONFIG_JFS_FS is not set 702# CONFIG_JFS_FS is not set
687# CONFIG_FS_POSIX_ACL is not set 703# CONFIG_FS_POSIX_ACL is not set
688CONFIG_FILE_LOCKING=y
689# CONFIG_XFS_FS is not set 704# CONFIG_XFS_FS is not set
705# CONFIG_GFS2_FS is not set
690# CONFIG_OCFS2_FS is not set 706# CONFIG_OCFS2_FS is not set
691# CONFIG_BTRFS_FS is not set 707# CONFIG_BTRFS_FS is not set
708CONFIG_FILE_LOCKING=y
709CONFIG_FSNOTIFY=y
692CONFIG_DNOTIFY=y 710CONFIG_DNOTIFY=y
693CONFIG_INOTIFY=y 711CONFIG_INOTIFY=y
694CONFIG_INOTIFY_USER=y 712CONFIG_INOTIFY_USER=y
@@ -808,6 +826,7 @@ CONFIG_HAS_IOPORT=y
808CONFIG_HAS_DMA=y 826CONFIG_HAS_DMA=y
809CONFIG_HAVE_LMB=y 827CONFIG_HAVE_LMB=y
810CONFIG_NLATTR=y 828CONFIG_NLATTR=y
829CONFIG_GENERIC_ATOMIC64=y
811 830
812# 831#
813# Kernel hacking 832# Kernel hacking
@@ -831,22 +850,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
831CONFIG_HAVE_DYNAMIC_FTRACE=y 850CONFIG_HAVE_DYNAMIC_FTRACE=y
832CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 851CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
833CONFIG_TRACING_SUPPORT=y 852CONFIG_TRACING_SUPPORT=y
834 853# CONFIG_FTRACE is not set
835#
836# Tracers
837#
838# CONFIG_FUNCTION_TRACER is not set
839# CONFIG_SCHED_TRACER is not set
840# CONFIG_CONTEXT_SWITCH_TRACER is not set
841# CONFIG_EVENT_TRACER is not set
842# CONFIG_BOOT_TRACER is not set
843# CONFIG_TRACE_BRANCH_PROFILING is not set
844# CONFIG_STACK_TRACER is not set
845# CONFIG_KMEMTRACE is not set
846# CONFIG_WORKQUEUE_TRACER is not set
847# CONFIG_BLK_DEV_IO_TRACE is not set
848# CONFIG_SAMPLES is not set 854# CONFIG_SAMPLES is not set
849CONFIG_HAVE_ARCH_KGDB=y 855CONFIG_HAVE_ARCH_KGDB=y
856# CONFIG_PPC_DISABLE_WERROR is not set
857CONFIG_PPC_WERROR=y
850CONFIG_PRINT_STACK_DEPTH=64 858CONFIG_PRINT_STACK_DEPTH=64
851# CONFIG_IRQSTACKS is not set 859# CONFIG_IRQSTACKS is not set
852# CONFIG_PPC_EARLY_DEBUG is not set 860# CONFIG_PPC_EARLY_DEBUG is not set
diff --git a/arch/powerpc/configs/mpc86xx_defconfig b/arch/powerpc/configs/mpc86xx_defconfig
index 5bb1b8eb0b49..0e8684a3138d 100644
--- a/arch/powerpc/configs/mpc86xx_defconfig
+++ b/arch/powerpc/configs/mpc86xx_defconfig
@@ -1,26 +1,28 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:00 2009 4# Wed Jul 29 23:31:58 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_PHYS_64BIT is not set 20# CONFIG_PHYS_64BIT is not set
20CONFIG_ALTIVEC=y 21CONFIG_ALTIVEC=y
21CONFIG_PPC_STD_MMU=y 22CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 23CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_PPC_HAVE_PMU_SUPPORT=y
24CONFIG_SMP=y 26CONFIG_SMP=y
25CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
26CONFIG_PPC32=y 28CONFIG_PPC32=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45CONFIG_GENERIC_GPIO=y 48CONFIG_GENERIC_GPIO=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 49# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -55,11 +58,13 @@ CONFIG_PPC_UDBG_16550=y
55CONFIG_GENERIC_TBSYNC=y 58CONFIG_GENERIC_TBSYNC=y
56CONFIG_AUDIT_ARCH=y 59CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y 60CONFIG_GENERIC_BUG=y
61CONFIG_DTC=y
58CONFIG_DEFAULT_UIMAGE=y 62CONFIG_DEFAULT_UIMAGE=y
59# CONFIG_PPC_DCR_NATIVE is not set 63# CONFIG_PPC_DCR_NATIVE is not set
60# CONFIG_PPC_DCR_MMIO is not set 64# CONFIG_PPC_DCR_MMIO is not set
61CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 65CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
62CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 66CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
67CONFIG_CONSTRUCTORS=y
63 68
64# 69#
65# General setup 70# General setup
@@ -114,7 +119,6 @@ CONFIG_SYSCTL_SYSCALL=y
114CONFIG_KALLSYMS=y 119CONFIG_KALLSYMS=y
115CONFIG_KALLSYMS_ALL=y 120CONFIG_KALLSYMS_ALL=y
116CONFIG_KALLSYMS_EXTRA_PASS=y 121CONFIG_KALLSYMS_EXTRA_PASS=y
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,9 +131,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
135CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -144,6 +155,10 @@ CONFIG_HAVE_KPROBES=y
144CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
145CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
146CONFIG_USE_GENERIC_SMP_HELPERS=y 157CONFIG_USE_GENERIC_SMP_HELPERS=y
158
159#
160# GCOV-based kernel profiling
161#
147# CONFIG_SLOW_WORK is not set 162# CONFIG_SLOW_WORK is not set
148# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 163# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
149CONFIG_SLABINFO=y 164CONFIG_SLABINFO=y
@@ -157,7 +172,7 @@ CONFIG_MODVERSIONS=y
157# CONFIG_MODULE_SRCVERSION_ALL is not set 172# CONFIG_MODULE_SRCVERSION_ALL is not set
158CONFIG_STOP_MACHINE=y 173CONFIG_STOP_MACHINE=y
159CONFIG_BLOCK=y 174CONFIG_BLOCK=y
160CONFIG_LBD=y 175CONFIG_LBDAF=y
161# CONFIG_BLK_DEV_BSG is not set 176# CONFIG_BLK_DEV_BSG is not set
162# CONFIG_BLK_DEV_INTEGRITY is not set 177# CONFIG_BLK_DEV_INTEGRITY is not set
163 178
@@ -236,7 +251,9 @@ CONFIG_BINFMT_ELF=y
236# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 251# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
237# CONFIG_HAVE_AOUT is not set 252# CONFIG_HAVE_AOUT is not set
238CONFIG_BINFMT_MISC=m 253CONFIG_BINFMT_MISC=m
239# CONFIG_IOMMU_HELPER is not set 254CONFIG_IOMMU_HELPER=y
255CONFIG_SWIOTLB=y
256CONFIG_PPC_NEED_DMA_SYNC_OPS=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
241CONFIG_ARCH_HAS_WALK_MEMORY=y 258CONFIG_ARCH_HAS_WALK_MEMORY=y
242CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -258,9 +275,9 @@ CONFIG_MIGRATION=y
258CONFIG_ZONE_DMA_FLAG=1 275CONFIG_ZONE_DMA_FLAG=1
259CONFIG_BOUNCE=y 276CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 281CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 282# CONFIG_PPC_16K_PAGES is not set
266# CONFIG_PPC_64K_PAGES is not set 283# CONFIG_PPC_64K_PAGES is not set
@@ -403,6 +420,7 @@ CONFIG_SCTP_HMAC_MD5=y
403# CONFIG_ECONET is not set 420# CONFIG_ECONET is not set
404# CONFIG_WAN_ROUTER is not set 421# CONFIG_WAN_ROUTER is not set
405# CONFIG_PHONET is not set 422# CONFIG_PHONET is not set
423# CONFIG_IEEE802154 is not set
406# CONFIG_NET_SCHED is not set 424# CONFIG_NET_SCHED is not set
407# CONFIG_DCB is not set 425# CONFIG_DCB is not set
408 426
@@ -421,7 +439,11 @@ CONFIG_WIRELESS=y
421CONFIG_WIRELESS_OLD_REGULATORY=y 439CONFIG_WIRELESS_OLD_REGULATORY=y
422# CONFIG_WIRELESS_EXT is not set 440# CONFIG_WIRELESS_EXT is not set
423# CONFIG_LIB80211 is not set 441# CONFIG_LIB80211 is not set
424# CONFIG_MAC80211 is not set 442
443#
444# CFG80211 needs to be enabled for MAC80211
445#
446CONFIG_MAC80211_DEFAULT_PS_VALUE=0
425# CONFIG_WIMAX is not set 447# CONFIG_WIMAX is not set
426# CONFIG_RFKILL is not set 448# CONFIG_RFKILL is not set
427# CONFIG_NET_9P is not set 449# CONFIG_NET_9P is not set
@@ -447,6 +469,7 @@ CONFIG_EXTRA_FIRMWARE=""
447CONFIG_OF_DEVICE=y 469CONFIG_OF_DEVICE=y
448CONFIG_OF_GPIO=y 470CONFIG_OF_GPIO=y
449CONFIG_OF_I2C=y 471CONFIG_OF_I2C=y
472CONFIG_OF_MDIO=y
450# CONFIG_PARPORT is not set 473# CONFIG_PARPORT is not set
451CONFIG_BLK_DEV=y 474CONFIG_BLK_DEV=y
452# CONFIG_BLK_DEV_FD is not set 475# CONFIG_BLK_DEV_FD is not set
@@ -482,7 +505,9 @@ CONFIG_MISC_DEVICES=y
482# 505#
483# CONFIG_EEPROM_AT24 is not set 506# CONFIG_EEPROM_AT24 is not set
484CONFIG_EEPROM_LEGACY=y 507CONFIG_EEPROM_LEGACY=y
508# CONFIG_EEPROM_MAX6875 is not set
485# CONFIG_EEPROM_93CX6 is not set 509# CONFIG_EEPROM_93CX6 is not set
510# CONFIG_CB710_CORE is not set
486CONFIG_HAVE_IDE=y 511CONFIG_HAVE_IDE=y
487# CONFIG_IDE is not set 512# CONFIG_IDE is not set
488 513
@@ -506,10 +531,6 @@ CONFIG_BLK_DEV_SR=y
506# CONFIG_BLK_DEV_SR_VENDOR is not set 531# CONFIG_BLK_DEV_SR_VENDOR is not set
507CONFIG_CHR_DEV_SG=y 532CONFIG_CHR_DEV_SG=y
508# CONFIG_CHR_DEV_SCH is not set 533# CONFIG_CHR_DEV_SCH is not set
509
510#
511# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
512#
513CONFIG_SCSI_MULTI_LUN=y 534CONFIG_SCSI_MULTI_LUN=y
514# CONFIG_SCSI_CONSTANTS is not set 535# CONFIG_SCSI_CONSTANTS is not set
515CONFIG_SCSI_LOGGING=y 536CONFIG_SCSI_LOGGING=y
@@ -527,6 +548,7 @@ CONFIG_SCSI_WAIT_SCAN=m
527CONFIG_SCSI_LOWLEVEL=y 548CONFIG_SCSI_LOWLEVEL=y
528# CONFIG_ISCSI_TCP is not set 549# CONFIG_ISCSI_TCP is not set
529# CONFIG_SCSI_CXGB3_ISCSI is not set 550# CONFIG_SCSI_CXGB3_ISCSI is not set
551# CONFIG_SCSI_BNX2_ISCSI is not set
530# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 552# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
531# CONFIG_SCSI_3W_9XXX is not set 553# CONFIG_SCSI_3W_9XXX is not set
532# CONFIG_SCSI_ACARD is not set 554# CONFIG_SCSI_ACARD is not set
@@ -535,6 +557,7 @@ CONFIG_SCSI_LOWLEVEL=y
535# CONFIG_SCSI_AIC7XXX_OLD is not set 557# CONFIG_SCSI_AIC7XXX_OLD is not set
536# CONFIG_SCSI_AIC79XX is not set 558# CONFIG_SCSI_AIC79XX is not set
537# CONFIG_SCSI_AIC94XX is not set 559# CONFIG_SCSI_AIC94XX is not set
560# CONFIG_SCSI_MVSAS is not set
538# CONFIG_SCSI_DPT_I2O is not set 561# CONFIG_SCSI_DPT_I2O is not set
539# CONFIG_SCSI_ADVANSYS is not set 562# CONFIG_SCSI_ADVANSYS is not set
540# CONFIG_SCSI_ARCMSR is not set 563# CONFIG_SCSI_ARCMSR is not set
@@ -554,7 +577,6 @@ CONFIG_SCSI_LOWLEVEL=y
554# CONFIG_SCSI_IPS is not set 577# CONFIG_SCSI_IPS is not set
555# CONFIG_SCSI_INITIO is not set 578# CONFIG_SCSI_INITIO is not set
556# CONFIG_SCSI_INIA100 is not set 579# CONFIG_SCSI_INIA100 is not set
557# CONFIG_SCSI_MVSAS is not set
558# CONFIG_SCSI_STEX is not set 580# CONFIG_SCSI_STEX is not set
559# CONFIG_SCSI_SYM53C8XX_2 is not set 581# CONFIG_SCSI_SYM53C8XX_2 is not set
560# CONFIG_SCSI_IPR is not set 582# CONFIG_SCSI_IPR is not set
@@ -638,14 +660,17 @@ CONFIG_PATA_ALI=y
638# 660#
639 661
640# 662#
641# Enable only one of the two stacks, unless you know what you are doing 663# You can enable one or both FireWire driver stacks.
664#
665
666#
667# See the help texts for more information.
642# 668#
643# CONFIG_FIREWIRE is not set 669# CONFIG_FIREWIRE is not set
644# CONFIG_IEEE1394 is not set 670# CONFIG_IEEE1394 is not set
645# CONFIG_I2O is not set 671# CONFIG_I2O is not set
646# CONFIG_MACINTOSH_DRIVERS is not set 672# CONFIG_MACINTOSH_DRIVERS is not set
647CONFIG_NETDEVICES=y 673CONFIG_NETDEVICES=y
648CONFIG_COMPAT_NET_DEV_OPS=y
649CONFIG_DUMMY=y 674CONFIG_DUMMY=y
650# CONFIG_BONDING is not set 675# CONFIG_BONDING is not set
651# CONFIG_MACVLAN is not set 676# CONFIG_MACVLAN is not set
@@ -692,6 +717,7 @@ CONFIG_MII=y
692# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 717# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
693# CONFIG_NET_PCI is not set 718# CONFIG_NET_PCI is not set
694# CONFIG_B44 is not set 719# CONFIG_B44 is not set
720# CONFIG_KS8842 is not set
695# CONFIG_ATL2 is not set 721# CONFIG_ATL2 is not set
696CONFIG_NETDEV_1000=y 722CONFIG_NETDEV_1000=y
697# CONFIG_ACENIC is not set 723# CONFIG_ACENIC is not set
@@ -711,8 +737,10 @@ CONFIG_NETDEV_1000=y
711# CONFIG_VIA_VELOCITY is not set 737# CONFIG_VIA_VELOCITY is not set
712# CONFIG_TIGON3 is not set 738# CONFIG_TIGON3 is not set
713# CONFIG_BNX2 is not set 739# CONFIG_BNX2 is not set
740# CONFIG_CNIC is not set
714CONFIG_FSL_PQ_MDIO=y 741CONFIG_FSL_PQ_MDIO=y
715CONFIG_GIANFAR=y 742CONFIG_GIANFAR=y
743# CONFIG_MV643XX_ETH is not set
716# CONFIG_QLA3XXX is not set 744# CONFIG_QLA3XXX is not set
717# CONFIG_ATL1 is not set 745# CONFIG_ATL1 is not set
718# CONFIG_ATL1E is not set 746# CONFIG_ATL1E is not set
@@ -913,13 +941,17 @@ CONFIG_I2C_MPC=y
913# CONFIG_SENSORS_PCF8574 is not set 941# CONFIG_SENSORS_PCF8574 is not set
914# CONFIG_PCF8575 is not set 942# CONFIG_PCF8575 is not set
915# CONFIG_SENSORS_PCA9539 is not set 943# CONFIG_SENSORS_PCA9539 is not set
916# CONFIG_SENSORS_MAX6875 is not set
917# CONFIG_SENSORS_TSL2550 is not set 944# CONFIG_SENSORS_TSL2550 is not set
918# CONFIG_I2C_DEBUG_CORE is not set 945# CONFIG_I2C_DEBUG_CORE is not set
919# CONFIG_I2C_DEBUG_ALGO is not set 946# CONFIG_I2C_DEBUG_ALGO is not set
920# CONFIG_I2C_DEBUG_BUS is not set 947# CONFIG_I2C_DEBUG_BUS is not set
921# CONFIG_I2C_DEBUG_CHIP is not set 948# CONFIG_I2C_DEBUG_CHIP is not set
922# CONFIG_SPI is not set 949# CONFIG_SPI is not set
950
951#
952# PPS support
953#
954# CONFIG_PPS is not set
923CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 955CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
924CONFIG_ARCH_REQUIRE_GPIOLIB=y 956CONFIG_ARCH_REQUIRE_GPIOLIB=y
925CONFIG_GPIOLIB=y 957CONFIG_GPIOLIB=y
@@ -973,76 +1005,9 @@ CONFIG_SSB_POSSIBLE=y
973# CONFIG_MFD_WM8400 is not set 1005# CONFIG_MFD_WM8400 is not set
974# CONFIG_MFD_WM8350_I2C is not set 1006# CONFIG_MFD_WM8350_I2C is not set
975# CONFIG_MFD_PCF50633 is not set 1007# CONFIG_MFD_PCF50633 is not set
1008# CONFIG_AB3100_CORE is not set
976# CONFIG_REGULATOR is not set 1009# CONFIG_REGULATOR is not set
977 1010# CONFIG_MEDIA_SUPPORT is not set
978#
979# Multimedia devices
980#
981
982#
983# Multimedia core support
984#
985# CONFIG_VIDEO_DEV is not set
986CONFIG_DVB_CORE=m
987CONFIG_VIDEO_MEDIA=m
988
989#
990# Multimedia drivers
991#
992# CONFIG_MEDIA_ATTACH is not set
993CONFIG_MEDIA_TUNER=m
994# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
995CONFIG_MEDIA_TUNER_SIMPLE=m
996CONFIG_MEDIA_TUNER_TDA8290=m
997CONFIG_MEDIA_TUNER_TDA9887=m
998CONFIG_MEDIA_TUNER_TEA5761=m
999CONFIG_MEDIA_TUNER_TEA5767=m
1000CONFIG_MEDIA_TUNER_MT20XX=m
1001CONFIG_MEDIA_TUNER_XC2028=m
1002CONFIG_MEDIA_TUNER_XC5000=m
1003CONFIG_MEDIA_TUNER_MC44S803=m
1004# CONFIG_DVB_DYNAMIC_MINORS is not set
1005CONFIG_DVB_CAPTURE_DRIVERS=y
1006
1007#
1008# Supported SAA7146 based PCI Adapters
1009#
1010# CONFIG_TTPCI_EEPROM is not set
1011# CONFIG_DVB_BUDGET_CORE is not set
1012
1013#
1014# Supported USB Adapters
1015#
1016# CONFIG_DVB_USB is not set
1017# CONFIG_DVB_TTUSB_BUDGET is not set
1018# CONFIG_DVB_TTUSB_DEC is not set
1019# CONFIG_DVB_SIANO_SMS1XXX is not set
1020
1021#
1022# Supported FlexCopII (B2C2) Adapters
1023#
1024# CONFIG_DVB_B2C2_FLEXCOP is not set
1025
1026#
1027# Supported BT878 Adapters
1028#
1029
1030#
1031# Supported Pluto2 Adapters
1032#
1033# CONFIG_DVB_PLUTO2 is not set
1034
1035#
1036# Supported SDMC DM1105 Adapters
1037#
1038# CONFIG_DVB_DM1105 is not set
1039
1040#
1041# Supported DVB Frontends
1042#
1043# CONFIG_DVB_FE_CUSTOMISE is not set
1044CONFIG_DAB=y
1045# CONFIG_USB_DABUSB is not set
1046 1011
1047# 1012#
1048# Graphics support 1013# Graphics support
@@ -1082,6 +1047,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1082# CONFIG_SND_VERBOSE_PRINTK is not set 1047# CONFIG_SND_VERBOSE_PRINTK is not set
1083# CONFIG_SND_DEBUG is not set 1048# CONFIG_SND_DEBUG is not set
1084CONFIG_SND_VMASTER=y 1049CONFIG_SND_VMASTER=y
1050# CONFIG_SND_RAWMIDI_SEQ is not set
1051# CONFIG_SND_OPL3_LIB_SEQ is not set
1052# CONFIG_SND_OPL4_LIB_SEQ is not set
1053# CONFIG_SND_SBAWE_SEQ is not set
1054# CONFIG_SND_EMU10K1_SEQ is not set
1085CONFIG_SND_AC97_CODEC=y 1055CONFIG_SND_AC97_CODEC=y
1086CONFIG_SND_DRIVERS=y 1056CONFIG_SND_DRIVERS=y
1087# CONFIG_SND_DUMMY is not set 1057# CONFIG_SND_DUMMY is not set
@@ -1108,6 +1078,7 @@ CONFIG_SND_PCI=y
1108# CONFIG_SND_CS4281 is not set 1078# CONFIG_SND_CS4281 is not set
1109# CONFIG_SND_CS46XX is not set 1079# CONFIG_SND_CS46XX is not set
1110# CONFIG_SND_CS5530 is not set 1080# CONFIG_SND_CS5530 is not set
1081# CONFIG_SND_CTXFI is not set
1111# CONFIG_SND_DARLA20 is not set 1082# CONFIG_SND_DARLA20 is not set
1112# CONFIG_SND_GINA20 is not set 1083# CONFIG_SND_GINA20 is not set
1113# CONFIG_SND_LAYLA20 is not set 1084# CONFIG_SND_LAYLA20 is not set
@@ -1138,6 +1109,7 @@ CONFIG_SND_PCI=y
1138CONFIG_SND_INTEL8X0=y 1109CONFIG_SND_INTEL8X0=y
1139# CONFIG_SND_INTEL8X0M is not set 1110# CONFIG_SND_INTEL8X0M is not set
1140# CONFIG_SND_KORG1212 is not set 1111# CONFIG_SND_KORG1212 is not set
1112# CONFIG_SND_LX6464ES is not set
1141# CONFIG_SND_MAESTRO3 is not set 1113# CONFIG_SND_MAESTRO3 is not set
1142# CONFIG_SND_MIXART is not set 1114# CONFIG_SND_MIXART is not set
1143# CONFIG_SND_NM256 is not set 1115# CONFIG_SND_NM256 is not set
@@ -1182,7 +1154,7 @@ CONFIG_HID_BELKIN=y
1182CONFIG_HID_CHERRY=y 1154CONFIG_HID_CHERRY=y
1183CONFIG_HID_CHICONY=y 1155CONFIG_HID_CHICONY=y
1184CONFIG_HID_CYPRESS=y 1156CONFIG_HID_CYPRESS=y
1185# CONFIG_DRAGONRISE_FF is not set 1157# CONFIG_HID_DRAGONRISE is not set
1186CONFIG_HID_EZKEY=y 1158CONFIG_HID_EZKEY=y
1187# CONFIG_HID_KYE is not set 1159# CONFIG_HID_KYE is not set
1188CONFIG_HID_GYRATION=y 1160CONFIG_HID_GYRATION=y
@@ -1199,10 +1171,11 @@ CONFIG_HID_PETALYNX=y
1199CONFIG_HID_SAMSUNG=y 1171CONFIG_HID_SAMSUNG=y
1200CONFIG_HID_SONY=y 1172CONFIG_HID_SONY=y
1201CONFIG_HID_SUNPLUS=y 1173CONFIG_HID_SUNPLUS=y
1202# CONFIG_GREENASIA_FF is not set 1174# CONFIG_HID_GREENASIA is not set
1175# CONFIG_HID_SMARTJOYPLUS is not set
1203# CONFIG_HID_TOPSEED is not set 1176# CONFIG_HID_TOPSEED is not set
1204CONFIG_THRUSTMASTER_FF=m 1177# CONFIG_HID_THRUSTMASTER is not set
1205CONFIG_ZEROPLUS_FF=m 1178# CONFIG_HID_ZEROPLUS is not set
1206CONFIG_USB_SUPPORT=y 1179CONFIG_USB_SUPPORT=y
1207CONFIG_USB_ARCH_HAS_HCD=y 1180CONFIG_USB_ARCH_HAS_HCD=y
1208CONFIG_USB_ARCH_HAS_OHCI=y 1181CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1228,6 +1201,7 @@ CONFIG_USB_MON=y
1228# USB Host Controller Drivers 1201# USB Host Controller Drivers
1229# 1202#
1230# CONFIG_USB_C67X00_HCD is not set 1203# CONFIG_USB_C67X00_HCD is not set
1204# CONFIG_USB_XHCI_HCD is not set
1231CONFIG_USB_EHCI_HCD=y 1205CONFIG_USB_EHCI_HCD=y
1232# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1206# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1233# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1207# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1237,9 +1211,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1237# CONFIG_USB_ISP116X_HCD is not set 1211# CONFIG_USB_ISP116X_HCD is not set
1238# CONFIG_USB_ISP1760_HCD is not set 1212# CONFIG_USB_ISP1760_HCD is not set
1239CONFIG_USB_OHCI_HCD=y 1213CONFIG_USB_OHCI_HCD=y
1240CONFIG_USB_OHCI_HCD_PPC_OF=y
1241CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1214CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1242CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1215CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1216CONFIG_USB_OHCI_HCD_PPC_OF=y
1243CONFIG_USB_OHCI_HCD_PCI=y 1217CONFIG_USB_OHCI_HCD_PCI=y
1244CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 1218CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1245CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 1219CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -1360,6 +1334,7 @@ CONFIG_RTC_INTF_DEV=y
1360# CONFIG_RTC_DRV_S35390A is not set 1334# CONFIG_RTC_DRV_S35390A is not set
1361# CONFIG_RTC_DRV_FM3130 is not set 1335# CONFIG_RTC_DRV_FM3130 is not set
1362# CONFIG_RTC_DRV_RX8581 is not set 1336# CONFIG_RTC_DRV_RX8581 is not set
1337# CONFIG_RTC_DRV_RX8025 is not set
1363 1338
1364# 1339#
1365# SPI RTC drivers 1340# SPI RTC drivers
@@ -1387,6 +1362,10 @@ CONFIG_RTC_DRV_CMOS=y
1387# CONFIG_DMADEVICES is not set 1362# CONFIG_DMADEVICES is not set
1388# CONFIG_AUXDISPLAY is not set 1363# CONFIG_AUXDISPLAY is not set
1389# CONFIG_UIO is not set 1364# CONFIG_UIO is not set
1365
1366#
1367# TI VLYNQ
1368#
1390# CONFIG_STAGING is not set 1369# CONFIG_STAGING is not set
1391 1370
1392# 1371#
@@ -1406,11 +1385,12 @@ CONFIG_FS_MBCACHE=y
1406# CONFIG_REISERFS_FS is not set 1385# CONFIG_REISERFS_FS is not set
1407# CONFIG_JFS_FS is not set 1386# CONFIG_JFS_FS is not set
1408# CONFIG_FS_POSIX_ACL is not set 1387# CONFIG_FS_POSIX_ACL is not set
1409CONFIG_FILE_LOCKING=y
1410# CONFIG_XFS_FS is not set 1388# CONFIG_XFS_FS is not set
1411# CONFIG_GFS2_FS is not set 1389# CONFIG_GFS2_FS is not set
1412# CONFIG_OCFS2_FS is not set 1390# CONFIG_OCFS2_FS is not set
1413# CONFIG_BTRFS_FS is not set 1391# CONFIG_BTRFS_FS is not set
1392CONFIG_FILE_LOCKING=y
1393CONFIG_FSNOTIFY=y
1414CONFIG_DNOTIFY=y 1394CONFIG_DNOTIFY=y
1415CONFIG_INOTIFY=y 1395CONFIG_INOTIFY=y
1416CONFIG_INOTIFY_USER=y 1396CONFIG_INOTIFY_USER=y
@@ -1485,6 +1465,7 @@ CONFIG_NFS_FS=y
1485CONFIG_NFS_V3=y 1465CONFIG_NFS_V3=y
1486# CONFIG_NFS_V3_ACL is not set 1466# CONFIG_NFS_V3_ACL is not set
1487CONFIG_NFS_V4=y 1467CONFIG_NFS_V4=y
1468# CONFIG_NFS_V4_1 is not set
1488CONFIG_ROOT_NFS=y 1469CONFIG_ROOT_NFS=y
1489CONFIG_NFSD=y 1470CONFIG_NFSD=y
1490# CONFIG_NFSD_V3 is not set 1471# CONFIG_NFSD_V3 is not set
@@ -1586,6 +1567,7 @@ CONFIG_HAS_IOPORT=y
1586CONFIG_HAS_DMA=y 1567CONFIG_HAS_DMA=y
1587CONFIG_HAVE_LMB=y 1568CONFIG_HAVE_LMB=y
1588CONFIG_NLATTR=y 1569CONFIG_NLATTR=y
1570CONFIG_GENERIC_ATOMIC64=y
1589 1571
1590# 1572#
1591# Kernel hacking 1573# Kernel hacking
@@ -1616,6 +1598,9 @@ CONFIG_SCHED_DEBUG=y
1616# CONFIG_RT_MUTEX_TESTER is not set 1598# CONFIG_RT_MUTEX_TESTER is not set
1617# CONFIG_DEBUG_SPINLOCK is not set 1599# CONFIG_DEBUG_SPINLOCK is not set
1618# CONFIG_DEBUG_MUTEXES is not set 1600# CONFIG_DEBUG_MUTEXES is not set
1601# CONFIG_DEBUG_LOCK_ALLOC is not set
1602# CONFIG_PROVE_LOCKING is not set
1603# CONFIG_LOCK_STAT is not set
1619# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1604# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1620# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1605# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1621# CONFIG_DEBUG_KOBJECT is not set 1606# CONFIG_DEBUG_KOBJECT is not set
@@ -1628,7 +1613,6 @@ CONFIG_DEBUG_INFO=y
1628# CONFIG_DEBUG_LIST is not set 1613# CONFIG_DEBUG_LIST is not set
1629# CONFIG_DEBUG_SG is not set 1614# CONFIG_DEBUG_SG is not set
1630# CONFIG_DEBUG_NOTIFIERS is not set 1615# CONFIG_DEBUG_NOTIFIERS is not set
1631# CONFIG_BOOT_PRINTK_DELAY is not set
1632# CONFIG_RCU_TORTURE_TEST is not set 1616# CONFIG_RCU_TORTURE_TEST is not set
1633# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1617# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1634# CONFIG_BACKTRACE_SELF_TEST is not set 1618# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1642,16 +1626,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1642CONFIG_HAVE_DYNAMIC_FTRACE=y 1626CONFIG_HAVE_DYNAMIC_FTRACE=y
1643CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1627CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1644CONFIG_TRACING_SUPPORT=y 1628CONFIG_TRACING_SUPPORT=y
1645 1629CONFIG_FTRACE=y
1646#
1647# Tracers
1648#
1649# CONFIG_FUNCTION_TRACER is not set 1630# CONFIG_FUNCTION_TRACER is not set
1631# CONFIG_IRQSOFF_TRACER is not set
1650# CONFIG_SCHED_TRACER is not set 1632# CONFIG_SCHED_TRACER is not set
1651# CONFIG_CONTEXT_SWITCH_TRACER is not set 1633# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1652# CONFIG_EVENT_TRACER is not set
1653# CONFIG_BOOT_TRACER is not set 1634# CONFIG_BOOT_TRACER is not set
1654# CONFIG_TRACE_BRANCH_PROFILING is not set 1635CONFIG_BRANCH_PROFILE_NONE=y
1636# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1637# CONFIG_PROFILE_ALL_BRANCHES is not set
1655# CONFIG_STACK_TRACER is not set 1638# CONFIG_STACK_TRACER is not set
1656# CONFIG_KMEMTRACE is not set 1639# CONFIG_KMEMTRACE is not set
1657# CONFIG_WORKQUEUE_TRACER is not set 1640# CONFIG_WORKQUEUE_TRACER is not set
@@ -1659,6 +1642,9 @@ CONFIG_TRACING_SUPPORT=y
1659# CONFIG_SAMPLES is not set 1642# CONFIG_SAMPLES is not set
1660CONFIG_HAVE_ARCH_KGDB=y 1643CONFIG_HAVE_ARCH_KGDB=y
1661# CONFIG_KGDB is not set 1644# CONFIG_KGDB is not set
1645# CONFIG_KMEMCHECK is not set
1646# CONFIG_PPC_DISABLE_WERROR is not set
1647CONFIG_PPC_WERROR=y
1662CONFIG_PRINT_STACK_DEPTH=64 1648CONFIG_PRINT_STACK_DEPTH=64
1663# CONFIG_DEBUG_STACKOVERFLOW is not set 1649# CONFIG_DEBUG_STACKOVERFLOW is not set
1664# CONFIG_DEBUG_STACK_USAGE is not set 1650# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig
index 42e64ebc279d..dbe8e869a827 100644
--- a/arch/powerpc/configs/mpc885_ads_defconfig
+++ b/arch/powerpc/configs/mpc885_ads_defconfig
@@ -1,14 +1,14 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:01 2009 4# Wed Jul 29 23:31:59 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13CONFIG_PPC_8xx=y 13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -27,15 +27,16 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
33CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
38CONFIG_GENERIC_CALIBRATE_DELAY=y
39CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
40# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
41CONFIG_PPC=y 42CONFIG_PPC=y
@@ -49,11 +50,13 @@ CONFIG_OF=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53# CONFIG_PPC_DCR_NATIVE is not set 55# CONFIG_PPC_DCR_NATIVE is not set
54# CONFIG_PPC_DCR_MMIO is not set 56# CONFIG_PPC_DCR_MMIO is not set
55CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 57CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
56CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 58CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
59CONFIG_CONSTRUCTORS=y
57 60
58# 61#
59# General setup 62# General setup
@@ -100,7 +103,6 @@ CONFIG_EMBEDDED=y
100CONFIG_KALLSYMS=y 103CONFIG_KALLSYMS=y
101# CONFIG_KALLSYMS_ALL is not set 104# CONFIG_KALLSYMS_ALL is not set
102# CONFIG_KALLSYMS_EXTRA_PASS is not set 105# CONFIG_KALLSYMS_EXTRA_PASS is not set
103# CONFIG_STRIP_ASM_SYMS is not set
104CONFIG_HOTPLUG=y 106CONFIG_HOTPLUG=y
105CONFIG_PRINTK=y 107CONFIG_PRINTK=y
106CONFIG_BUG=y 108CONFIG_BUG=y
@@ -113,8 +115,15 @@ CONFIG_TIMERFD=y
113CONFIG_EVENTFD=y 115CONFIG_EVENTFD=y
114CONFIG_SHMEM=y 116CONFIG_SHMEM=y
115CONFIG_AIO=y 117CONFIG_AIO=y
118CONFIG_HAVE_PERF_COUNTERS=y
119
120#
121# Performance Counters
122#
123# CONFIG_PERF_COUNTERS is not set
116# CONFIG_VM_EVENT_COUNTERS is not set 124# CONFIG_VM_EVENT_COUNTERS is not set
117CONFIG_SLUB_DEBUG=y 125CONFIG_SLUB_DEBUG=y
126# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_COMPAT_BRK=y 127CONFIG_COMPAT_BRK=y
119# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
120CONFIG_SLUB=y 129CONFIG_SLUB=y
@@ -128,13 +137,17 @@ CONFIG_HAVE_KPROBES=y
128CONFIG_HAVE_KRETPROBES=y 137CONFIG_HAVE_KRETPROBES=y
129CONFIG_HAVE_ARCH_TRACEHOOK=y 138CONFIG_HAVE_ARCH_TRACEHOOK=y
130CONFIG_HAVE_CLK=y 139CONFIG_HAVE_CLK=y
140
141#
142# GCOV-based kernel profiling
143#
131# CONFIG_SLOW_WORK is not set 144# CONFIG_SLOW_WORK is not set
132# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 145# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
133CONFIG_SLABINFO=y 146CONFIG_SLABINFO=y
134CONFIG_BASE_SMALL=1 147CONFIG_BASE_SMALL=1
135# CONFIG_MODULES is not set 148# CONFIG_MODULES is not set
136CONFIG_BLOCK=y 149CONFIG_BLOCK=y
137# CONFIG_LBD is not set 150CONFIG_LBDAF=y
138# CONFIG_BLK_DEV_BSG is not set 151# CONFIG_BLK_DEV_BSG is not set
139# CONFIG_BLK_DEV_INTEGRITY is not set 152# CONFIG_BLK_DEV_INTEGRITY is not set
140 153
@@ -227,6 +240,7 @@ CONFIG_BINFMT_ELF=y
227# CONFIG_MATH_EMULATION is not set 240# CONFIG_MATH_EMULATION is not set
228CONFIG_8XX_MINIMAL_FPEMU=y 241CONFIG_8XX_MINIMAL_FPEMU=y
229# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set
230CONFIG_PPC_NEED_DMA_SYNC_OPS=y 244CONFIG_PPC_NEED_DMA_SYNC_OPS=y
231CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
232CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -246,9 +260,9 @@ CONFIG_MIGRATION=y
246CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=1
247CONFIG_BOUNCE=y 261CONFIG_BOUNCE=y
248CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
249CONFIG_UNEVICTABLE_LRU=y
250CONFIG_HAVE_MLOCK=y 263CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_PPC_4K_PAGES=y 266CONFIG_PPC_4K_PAGES=y
253# CONFIG_PPC_16K_PAGES is not set 267# CONFIG_PPC_16K_PAGES is not set
254# CONFIG_PPC_64K_PAGES is not set 268# CONFIG_PPC_64K_PAGES is not set
@@ -287,6 +301,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
287CONFIG_KERNEL_START=0xc0000000 301CONFIG_KERNEL_START=0xc0000000
288CONFIG_PHYSICAL_START=0x00000000 302CONFIG_PHYSICAL_START=0x00000000
289CONFIG_TASK_SIZE=0x80000000 303CONFIG_TASK_SIZE=0x80000000
304CONFIG_CONSISTENT_SIZE=0x00200000
290CONFIG_NET=y 305CONFIG_NET=y
291 306
292# 307#
@@ -343,6 +358,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
343# CONFIG_ECONET is not set 358# CONFIG_ECONET is not set
344# CONFIG_WAN_ROUTER is not set 359# CONFIG_WAN_ROUTER is not set
345# CONFIG_PHONET is not set 360# CONFIG_PHONET is not set
361# CONFIG_IEEE802154 is not set
346# CONFIG_NET_SCHED is not set 362# CONFIG_NET_SCHED is not set
347# CONFIG_DCB is not set 363# CONFIG_DCB is not set
348 364
@@ -360,7 +376,11 @@ CONFIG_WIRELESS=y
360CONFIG_WIRELESS_OLD_REGULATORY=y 376CONFIG_WIRELESS_OLD_REGULATORY=y
361# CONFIG_WIRELESS_EXT is not set 377# CONFIG_WIRELESS_EXT is not set
362# CONFIG_LIB80211 is not set 378# CONFIG_LIB80211 is not set
363# CONFIG_MAC80211 is not set 379
380#
381# CFG80211 needs to be enabled for MAC80211
382#
383CONFIG_MAC80211_DEFAULT_PS_VALUE=0
364# CONFIG_WIMAX is not set 384# CONFIG_WIMAX is not set
365# CONFIG_RFKILL is not set 385# CONFIG_RFKILL is not set
366# CONFIG_NET_9P is not set 386# CONFIG_NET_9P is not set
@@ -463,6 +483,7 @@ CONFIG_MTD_PHYSMAP_OF=y
463# 483#
464# CONFIG_MTD_UBI is not set 484# CONFIG_MTD_UBI is not set
465CONFIG_OF_DEVICE=y 485CONFIG_OF_DEVICE=y
486CONFIG_OF_MDIO=y
466# CONFIG_PARPORT is not set 487# CONFIG_PARPORT is not set
467# CONFIG_BLK_DEV is not set 488# CONFIG_BLK_DEV is not set
468# CONFIG_MISC_DEVICES is not set 489# CONFIG_MISC_DEVICES is not set
@@ -480,7 +501,6 @@ CONFIG_HAVE_IDE=y
480# CONFIG_MD is not set 501# CONFIG_MD is not set
481# CONFIG_MACINTOSH_DRIVERS is not set 502# CONFIG_MACINTOSH_DRIVERS is not set
482CONFIG_NETDEVICES=y 503CONFIG_NETDEVICES=y
483CONFIG_COMPAT_NET_DEV_OPS=y
484# CONFIG_DUMMY is not set 504# CONFIG_DUMMY is not set
485# CONFIG_BONDING is not set 505# CONFIG_BONDING is not set
486# CONFIG_MACVLAN is not set 506# CONFIG_MACVLAN is not set
@@ -519,6 +539,7 @@ CONFIG_MII=y
519# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 539# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
520# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 540# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
521# CONFIG_B44 is not set 541# CONFIG_B44 is not set
542# CONFIG_KS8842 is not set
522CONFIG_FS_ENET=y 543CONFIG_FS_ENET=y
523# CONFIG_FS_ENET_HAS_SCC is not set 544# CONFIG_FS_ENET_HAS_SCC is not set
524CONFIG_FS_ENET_HAS_FEC=y 545CONFIG_FS_ENET_HAS_FEC=y
@@ -590,6 +611,11 @@ CONFIG_GEN_RTC=y
590# CONFIG_TCG_TPM is not set 611# CONFIG_TCG_TPM is not set
591# CONFIG_I2C is not set 612# CONFIG_I2C is not set
592# CONFIG_SPI is not set 613# CONFIG_SPI is not set
614
615#
616# PPS support
617#
618# CONFIG_PPS is not set
593CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 619CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
594# CONFIG_GPIOLIB is not set 620# CONFIG_GPIOLIB is not set
595# CONFIG_W1 is not set 621# CONFIG_W1 is not set
@@ -613,22 +639,7 @@ CONFIG_SSB_POSSIBLE=y
613# CONFIG_HTC_PASIC3 is not set 639# CONFIG_HTC_PASIC3 is not set
614# CONFIG_MFD_TMIO is not set 640# CONFIG_MFD_TMIO is not set
615# CONFIG_REGULATOR is not set 641# CONFIG_REGULATOR is not set
616 642# CONFIG_MEDIA_SUPPORT is not set
617#
618# Multimedia devices
619#
620
621#
622# Multimedia core support
623#
624# CONFIG_VIDEO_DEV is not set
625# CONFIG_DVB_CORE is not set
626# CONFIG_VIDEO_MEDIA is not set
627
628#
629# Multimedia drivers
630#
631CONFIG_DAB=y
632 643
633# 644#
634# Graphics support 645# Graphics support
@@ -653,6 +664,10 @@ CONFIG_DAB=y
653# CONFIG_DMADEVICES is not set 664# CONFIG_DMADEVICES is not set
654# CONFIG_AUXDISPLAY is not set 665# CONFIG_AUXDISPLAY is not set
655# CONFIG_UIO is not set 666# CONFIG_UIO is not set
667
668#
669# TI VLYNQ
670#
656# CONFIG_STAGING is not set 671# CONFIG_STAGING is not set
657 672
658# 673#
@@ -664,12 +679,15 @@ CONFIG_DAB=y
664# CONFIG_REISERFS_FS is not set 679# CONFIG_REISERFS_FS is not set
665# CONFIG_JFS_FS is not set 680# CONFIG_JFS_FS is not set
666# CONFIG_FS_POSIX_ACL is not set 681# CONFIG_FS_POSIX_ACL is not set
667CONFIG_FILE_LOCKING=y
668# CONFIG_XFS_FS is not set 682# CONFIG_XFS_FS is not set
683# CONFIG_GFS2_FS is not set
669# CONFIG_OCFS2_FS is not set 684# CONFIG_OCFS2_FS is not set
670# CONFIG_BTRFS_FS is not set 685# CONFIG_BTRFS_FS is not set
686CONFIG_FILE_LOCKING=y
687CONFIG_FSNOTIFY=y
671# CONFIG_DNOTIFY is not set 688# CONFIG_DNOTIFY is not set
672# CONFIG_INOTIFY is not set 689# CONFIG_INOTIFY is not set
690CONFIG_INOTIFY_USER=y
673# CONFIG_QUOTA is not set 691# CONFIG_QUOTA is not set
674# CONFIG_AUTOFS_FS is not set 692# CONFIG_AUTOFS_FS is not set
675# CONFIG_AUTOFS4_FS is not set 693# CONFIG_AUTOFS4_FS is not set
@@ -786,6 +804,7 @@ CONFIG_HAS_IOPORT=y
786CONFIG_HAS_DMA=y 804CONFIG_HAS_DMA=y
787CONFIG_HAVE_LMB=y 805CONFIG_HAVE_LMB=y
788CONFIG_NLATTR=y 806CONFIG_NLATTR=y
807CONFIG_GENERIC_ATOMIC64=y
789 808
790# 809#
791# Kernel hacking 810# Kernel hacking
@@ -814,6 +833,9 @@ CONFIG_SCHED_DEBUG=y
814# CONFIG_SLUB_STATS is not set 833# CONFIG_SLUB_STATS is not set
815# CONFIG_DEBUG_SPINLOCK is not set 834# CONFIG_DEBUG_SPINLOCK is not set
816# CONFIG_DEBUG_MUTEXES is not set 835# CONFIG_DEBUG_MUTEXES is not set
836# CONFIG_DEBUG_LOCK_ALLOC is not set
837# CONFIG_PROVE_LOCKING is not set
838# CONFIG_LOCK_STAT is not set
817# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 839# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
818# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 840# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
819# CONFIG_DEBUG_KOBJECT is not set 841# CONFIG_DEBUG_KOBJECT is not set
@@ -825,7 +847,6 @@ CONFIG_DEBUG_INFO=y
825# CONFIG_DEBUG_LIST is not set 847# CONFIG_DEBUG_LIST is not set
826# CONFIG_DEBUG_SG is not set 848# CONFIG_DEBUG_SG is not set
827# CONFIG_DEBUG_NOTIFIERS is not set 849# CONFIG_DEBUG_NOTIFIERS is not set
828# CONFIG_BOOT_PRINTK_DELAY is not set
829# CONFIG_RCU_TORTURE_TEST is not set 850# CONFIG_RCU_TORTURE_TEST is not set
830# CONFIG_RCU_CPU_STALL_DETECTOR is not set 851# CONFIG_RCU_CPU_STALL_DETECTOR is not set
831# CONFIG_BACKTRACE_SELF_TEST is not set 852# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -838,16 +859,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
838CONFIG_HAVE_DYNAMIC_FTRACE=y 859CONFIG_HAVE_DYNAMIC_FTRACE=y
839CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 860CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
840CONFIG_TRACING_SUPPORT=y 861CONFIG_TRACING_SUPPORT=y
841 862CONFIG_FTRACE=y
842#
843# Tracers
844#
845# CONFIG_FUNCTION_TRACER is not set 863# CONFIG_FUNCTION_TRACER is not set
864# CONFIG_IRQSOFF_TRACER is not set
846# CONFIG_SCHED_TRACER is not set 865# CONFIG_SCHED_TRACER is not set
847# CONFIG_CONTEXT_SWITCH_TRACER is not set 866# CONFIG_ENABLE_DEFAULT_TRACERS is not set
848# CONFIG_EVENT_TRACER is not set
849# CONFIG_BOOT_TRACER is not set 867# CONFIG_BOOT_TRACER is not set
850# CONFIG_TRACE_BRANCH_PROFILING is not set 868CONFIG_BRANCH_PROFILE_NONE=y
869# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
870# CONFIG_PROFILE_ALL_BRANCHES is not set
851# CONFIG_STACK_TRACER is not set 871# CONFIG_STACK_TRACER is not set
852# CONFIG_KMEMTRACE is not set 872# CONFIG_KMEMTRACE is not set
853# CONFIG_WORKQUEUE_TRACER is not set 873# CONFIG_WORKQUEUE_TRACER is not set
@@ -855,6 +875,9 @@ CONFIG_TRACING_SUPPORT=y
855# CONFIG_SAMPLES is not set 875# CONFIG_SAMPLES is not set
856CONFIG_HAVE_ARCH_KGDB=y 876CONFIG_HAVE_ARCH_KGDB=y
857# CONFIG_KGDB is not set 877# CONFIG_KGDB is not set
878# CONFIG_KMEMCHECK is not set
879# CONFIG_PPC_DISABLE_WERROR is not set
880CONFIG_PPC_WERROR=y
858CONFIG_PRINT_STACK_DEPTH=64 881CONFIG_PRINT_STACK_DEPTH=64
859# CONFIG_DEBUG_STACKOVERFLOW is not set 882# CONFIG_DEBUG_STACKOVERFLOW is not set
860# CONFIG_DEBUG_STACK_USAGE is not set 883# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/pq2fads_defconfig b/arch/powerpc/configs/pq2fads_defconfig
index 129d80860f2a..ff96bb43c32d 100644
--- a/arch/powerpc/configs/pq2fads_defconfig
+++ b/arch/powerpc/configs/pq2fads_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:02 2009 4# Wed Jul 29 23:32:00 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43CONFIG_GENERIC_GPIO=y 46CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 47# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
@@ -53,11 +56,13 @@ CONFIG_OF=y
53# CONFIG_GENERIC_TBSYNC is not set 56# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
59CONFIG_DTC=y
56CONFIG_DEFAULT_UIMAGE=y 60CONFIG_DEFAULT_UIMAGE=y
57# CONFIG_PPC_DCR_NATIVE is not set 61# CONFIG_PPC_DCR_NATIVE is not set
58# CONFIG_PPC_DCR_MMIO is not set 62# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
61 66
62# 67#
63# General setup 68# General setup
@@ -103,7 +108,6 @@ CONFIG_SYSCTL_SYSCALL=y
103CONFIG_KALLSYMS=y 108CONFIG_KALLSYMS=y
104CONFIG_KALLSYMS_ALL=y 109CONFIG_KALLSYMS_ALL=y
105# CONFIG_KALLSYMS_EXTRA_PASS is not set 110# CONFIG_KALLSYMS_EXTRA_PASS is not set
106# CONFIG_STRIP_ASM_SYMS is not set
107CONFIG_HOTPLUG=y 111CONFIG_HOTPLUG=y
108CONFIG_PRINTK=y 112CONFIG_PRINTK=y
109CONFIG_BUG=y 113CONFIG_BUG=y
@@ -116,9 +120,16 @@ CONFIG_TIMERFD=y
116CONFIG_EVENTFD=y 120CONFIG_EVENTFD=y
117CONFIG_SHMEM=y 121CONFIG_SHMEM=y
118CONFIG_AIO=y 122CONFIG_AIO=y
123CONFIG_HAVE_PERF_COUNTERS=y
124
125#
126# Performance Counters
127#
128# CONFIG_PERF_COUNTERS is not set
119CONFIG_VM_EVENT_COUNTERS=y 129CONFIG_VM_EVENT_COUNTERS=y
120CONFIG_PCI_QUIRKS=y 130CONFIG_PCI_QUIRKS=y
121CONFIG_SLUB_DEBUG=y 131CONFIG_SLUB_DEBUG=y
132# CONFIG_STRIP_ASM_SYMS is not set
122CONFIG_COMPAT_BRK=y 133CONFIG_COMPAT_BRK=y
123# CONFIG_SLAB is not set 134# CONFIG_SLAB is not set
124CONFIG_SLUB=y 135CONFIG_SLUB=y
@@ -132,6 +143,10 @@ CONFIG_HAVE_KPROBES=y
132CONFIG_HAVE_KRETPROBES=y 143CONFIG_HAVE_KRETPROBES=y
133CONFIG_HAVE_ARCH_TRACEHOOK=y 144CONFIG_HAVE_ARCH_TRACEHOOK=y
134CONFIG_HAVE_CLK=y 145CONFIG_HAVE_CLK=y
146
147#
148# GCOV-based kernel profiling
149#
135# CONFIG_SLOW_WORK is not set 150# CONFIG_SLOW_WORK is not set
136# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 151# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
137CONFIG_SLABINFO=y 152CONFIG_SLABINFO=y
@@ -139,7 +154,7 @@ CONFIG_RT_MUTEXES=y
139CONFIG_BASE_SMALL=0 154CONFIG_BASE_SMALL=0
140# CONFIG_MODULES is not set 155# CONFIG_MODULES is not set
141CONFIG_BLOCK=y 156CONFIG_BLOCK=y
142# CONFIG_LBD is not set 157CONFIG_LBDAF=y
143# CONFIG_BLK_DEV_INTEGRITY is not set 158# CONFIG_BLK_DEV_INTEGRITY is not set
144 159
145# 160#
@@ -219,6 +234,7 @@ CONFIG_BINFMT_ELF=y
219# CONFIG_HAVE_AOUT is not set 234# CONFIG_HAVE_AOUT is not set
220CONFIG_BINFMT_MISC=y 235CONFIG_BINFMT_MISC=y
221# CONFIG_IOMMU_HELPER is not set 236# CONFIG_IOMMU_HELPER is not set
237# CONFIG_SWIOTLB is not set
222CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
223CONFIG_ARCH_HAS_WALK_MEMORY=y 239CONFIG_ARCH_HAS_WALK_MEMORY=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -234,9 +250,9 @@ CONFIG_MIGRATION=y
234CONFIG_ZONE_DMA_FLAG=1 250CONFIG_ZONE_DMA_FLAG=1
235CONFIG_BOUNCE=y 251CONFIG_BOUNCE=y
236CONFIG_VIRT_TO_BUS=y 252CONFIG_VIRT_TO_BUS=y
237CONFIG_UNEVICTABLE_LRU=y
238CONFIG_HAVE_MLOCK=y 253CONFIG_HAVE_MLOCK=y
239CONFIG_HAVE_MLOCKED_PAGE_BIT=y 254CONFIG_HAVE_MLOCKED_PAGE_BIT=y
255CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
240CONFIG_PPC_4K_PAGES=y 256CONFIG_PPC_4K_PAGES=y
241# CONFIG_PPC_16K_PAGES is not set 257# CONFIG_PPC_16K_PAGES is not set
242# CONFIG_PPC_64K_PAGES is not set 258# CONFIG_PPC_64K_PAGES is not set
@@ -307,6 +323,7 @@ CONFIG_IP_PNP_BOOTP=y
307# CONFIG_NET_IPIP is not set 323# CONFIG_NET_IPIP is not set
308# CONFIG_NET_IPGRE is not set 324# CONFIG_NET_IPGRE is not set
309# CONFIG_IP_MROUTE is not set 325# CONFIG_IP_MROUTE is not set
326# CONFIG_ARPD is not set
310CONFIG_SYN_COOKIES=y 327CONFIG_SYN_COOKIES=y
311# CONFIG_INET_AH is not set 328# CONFIG_INET_AH is not set
312# CONFIG_INET_ESP is not set 329# CONFIG_INET_ESP is not set
@@ -387,7 +404,11 @@ CONFIG_WIRELESS=y
387CONFIG_WIRELESS_OLD_REGULATORY=y 404CONFIG_WIRELESS_OLD_REGULATORY=y
388# CONFIG_WIRELESS_EXT is not set 405# CONFIG_WIRELESS_EXT is not set
389# CONFIG_LIB80211 is not set 406# CONFIG_LIB80211 is not set
390# CONFIG_MAC80211 is not set 407
408#
409# CFG80211 needs to be enabled for MAC80211
410#
411CONFIG_MAC80211_DEFAULT_PS_VALUE=0
391# CONFIG_WIMAX is not set 412# CONFIG_WIMAX is not set
392# CONFIG_RFKILL is not set 413# CONFIG_RFKILL is not set
393 414
@@ -493,6 +514,7 @@ CONFIG_MTD_PHYSMAP_OF=y
493# CONFIG_MTD_UBI is not set 514# CONFIG_MTD_UBI is not set
494CONFIG_OF_DEVICE=y 515CONFIG_OF_DEVICE=y
495CONFIG_OF_GPIO=y 516CONFIG_OF_GPIO=y
517CONFIG_OF_MDIO=y
496# CONFIG_PARPORT is not set 518# CONFIG_PARPORT is not set
497CONFIG_BLK_DEV=y 519CONFIG_BLK_DEV=y
498# CONFIG_BLK_DEV_FD is not set 520# CONFIG_BLK_DEV_FD is not set
@@ -518,6 +540,7 @@ CONFIG_MISC_DEVICES=y
518# EEPROM support 540# EEPROM support
519# 541#
520# CONFIG_EEPROM_93CX6 is not set 542# CONFIG_EEPROM_93CX6 is not set
543# CONFIG_CB710_CORE is not set
521CONFIG_HAVE_IDE=y 544CONFIG_HAVE_IDE=y
522CONFIG_IDE=y 545CONFIG_IDE=y
523 546
@@ -583,13 +606,17 @@ CONFIG_IDE_PROC_FS=y
583# 606#
584 607
585# 608#
586# A new alternative FireWire stack is available with EXPERIMENTAL=y 609# You can enable one or both FireWire driver stacks.
610#
611
612#
613# See the help texts for more information.
587# 614#
615# CONFIG_FIREWIRE is not set
588# CONFIG_IEEE1394 is not set 616# CONFIG_IEEE1394 is not set
589# CONFIG_I2O is not set 617# CONFIG_I2O is not set
590# CONFIG_MACINTOSH_DRIVERS is not set 618# CONFIG_MACINTOSH_DRIVERS is not set
591CONFIG_NETDEVICES=y 619CONFIG_NETDEVICES=y
592CONFIG_COMPAT_NET_DEV_OPS=y
593# CONFIG_DUMMY is not set 620# CONFIG_DUMMY is not set
594# CONFIG_BONDING is not set 621# CONFIG_BONDING is not set
595# CONFIG_EQUALIZER is not set 622# CONFIG_EQUALIZER is not set
@@ -636,6 +663,7 @@ CONFIG_MII=y
636# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 663# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
637# CONFIG_NET_PCI is not set 664# CONFIG_NET_PCI is not set
638# CONFIG_B44 is not set 665# CONFIG_B44 is not set
666# CONFIG_KS8842 is not set
639# CONFIG_ATL2 is not set 667# CONFIG_ATL2 is not set
640CONFIG_FS_ENET=y 668CONFIG_FS_ENET=y
641# CONFIG_FS_ENET_HAS_SCC is not set 669# CONFIG_FS_ENET_HAS_SCC is not set
@@ -657,8 +685,10 @@ CONFIG_NETDEV_1000=y
657# CONFIG_VIA_VELOCITY is not set 685# CONFIG_VIA_VELOCITY is not set
658# CONFIG_TIGON3 is not set 686# CONFIG_TIGON3 is not set
659# CONFIG_BNX2 is not set 687# CONFIG_BNX2 is not set
688# CONFIG_CNIC is not set
660# CONFIG_FSL_PQ_MDIO is not set 689# CONFIG_FSL_PQ_MDIO is not set
661# CONFIG_GIANFAR is not set 690# CONFIG_GIANFAR is not set
691# CONFIG_MV643XX_ETH is not set
662# CONFIG_QLA3XXX is not set 692# CONFIG_QLA3XXX is not set
663# CONFIG_ATL1 is not set 693# CONFIG_ATL1 is not set
664# CONFIG_JME is not set 694# CONFIG_JME is not set
@@ -730,12 +760,13 @@ CONFIG_INPUT_EVDEV=y
730# 760#
731CONFIG_INPUT_KEYBOARD=y 761CONFIG_INPUT_KEYBOARD=y
732CONFIG_KEYBOARD_ATKBD=y 762CONFIG_KEYBOARD_ATKBD=y
733# CONFIG_KEYBOARD_SUNKBD is not set
734# CONFIG_KEYBOARD_LKKBD is not set 763# CONFIG_KEYBOARD_LKKBD is not set
735# CONFIG_KEYBOARD_XTKBD is not set 764# CONFIG_KEYBOARD_GPIO is not set
765# CONFIG_KEYBOARD_MATRIX is not set
736# CONFIG_KEYBOARD_NEWTON is not set 766# CONFIG_KEYBOARD_NEWTON is not set
737# CONFIG_KEYBOARD_STOWAWAY is not set 767# CONFIG_KEYBOARD_STOWAWAY is not set
738# CONFIG_KEYBOARD_GPIO is not set 768# CONFIG_KEYBOARD_SUNKBD is not set
769# CONFIG_KEYBOARD_XTKBD is not set
739CONFIG_INPUT_MOUSE=y 770CONFIG_INPUT_MOUSE=y
740CONFIG_MOUSE_PS2=y 771CONFIG_MOUSE_PS2=y
741CONFIG_MOUSE_PS2_ALPS=y 772CONFIG_MOUSE_PS2_ALPS=y
@@ -802,6 +833,10 @@ CONFIG_HW_RANDOM=y
802CONFIG_DEVPORT=y 833CONFIG_DEVPORT=y
803# CONFIG_I2C is not set 834# CONFIG_I2C is not set
804# CONFIG_SPI is not set 835# CONFIG_SPI is not set
836
837#
838# PPS support
839#
805CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 840CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
806CONFIG_ARCH_REQUIRE_GPIOLIB=y 841CONFIG_ARCH_REQUIRE_GPIOLIB=y
807CONFIG_GPIOLIB=y 842CONFIG_GPIOLIB=y
@@ -845,22 +880,7 @@ CONFIG_SSB_POSSIBLE=y
845# CONFIG_HTC_PASIC3 is not set 880# CONFIG_HTC_PASIC3 is not set
846# CONFIG_MFD_TMIO is not set 881# CONFIG_MFD_TMIO is not set
847# CONFIG_REGULATOR is not set 882# CONFIG_REGULATOR is not set
848 883# CONFIG_MEDIA_SUPPORT is not set
849#
850# Multimedia devices
851#
852
853#
854# Multimedia core support
855#
856# CONFIG_VIDEO_DEV is not set
857# CONFIG_DVB_CORE is not set
858# CONFIG_VIDEO_MEDIA is not set
859
860#
861# Multimedia drivers
862#
863CONFIG_DAB=y
864 884
865# 885#
866# Graphics support 886# Graphics support
@@ -903,8 +923,9 @@ CONFIG_USB_GADGET_SELECTED=y
903# CONFIG_USB_GADGET_OMAP is not set 923# CONFIG_USB_GADGET_OMAP is not set
904# CONFIG_USB_GADGET_PXA25X is not set 924# CONFIG_USB_GADGET_PXA25X is not set
905# CONFIG_USB_GADGET_PXA27X is not set 925# CONFIG_USB_GADGET_PXA27X is not set
906# CONFIG_USB_GADGET_S3C2410 is not set 926# CONFIG_USB_GADGET_S3C_HSOTG is not set
907# CONFIG_USB_GADGET_IMX is not set 927# CONFIG_USB_GADGET_IMX is not set
928# CONFIG_USB_GADGET_S3C2410 is not set
908CONFIG_USB_GADGET_M66592=y 929CONFIG_USB_GADGET_M66592=y
909CONFIG_USB_M66592=y 930CONFIG_USB_M66592=y
910# CONFIG_USB_GADGET_AMD5536UDC is not set 931# CONFIG_USB_GADGET_AMD5536UDC is not set
@@ -912,9 +933,11 @@ CONFIG_USB_M66592=y
912# CONFIG_USB_GADGET_CI13XXX is not set 933# CONFIG_USB_GADGET_CI13XXX is not set
913# CONFIG_USB_GADGET_NET2280 is not set 934# CONFIG_USB_GADGET_NET2280 is not set
914# CONFIG_USB_GADGET_GOKU is not set 935# CONFIG_USB_GADGET_GOKU is not set
936# CONFIG_USB_GADGET_LANGWELL is not set
915# CONFIG_USB_GADGET_DUMMY_HCD is not set 937# CONFIG_USB_GADGET_DUMMY_HCD is not set
916CONFIG_USB_GADGET_DUALSPEED=y 938CONFIG_USB_GADGET_DUALSPEED=y
917# CONFIG_USB_ZERO is not set 939# CONFIG_USB_ZERO is not set
940# CONFIG_USB_AUDIO is not set
918CONFIG_USB_ETH=y 941CONFIG_USB_ETH=y
919CONFIG_USB_ETH_RNDIS=y 942CONFIG_USB_ETH_RNDIS=y
920# CONFIG_USB_GADGETFS is not set 943# CONFIG_USB_GADGETFS is not set
@@ -939,6 +962,10 @@ CONFIG_USB_ETH_RNDIS=y
939# CONFIG_DMADEVICES is not set 962# CONFIG_DMADEVICES is not set
940# CONFIG_AUXDISPLAY is not set 963# CONFIG_AUXDISPLAY is not set
941# CONFIG_UIO is not set 964# CONFIG_UIO is not set
965
966#
967# TI VLYNQ
968#
942# CONFIG_STAGING is not set 969# CONFIG_STAGING is not set
943 970
944# 971#
@@ -958,9 +985,10 @@ CONFIG_FS_MBCACHE=y
958# CONFIG_REISERFS_FS is not set 985# CONFIG_REISERFS_FS is not set
959# CONFIG_JFS_FS is not set 986# CONFIG_JFS_FS is not set
960CONFIG_FS_POSIX_ACL=y 987CONFIG_FS_POSIX_ACL=y
961CONFIG_FILE_LOCKING=y
962# CONFIG_XFS_FS is not set 988# CONFIG_XFS_FS is not set
963# CONFIG_OCFS2_FS is not set 989# CONFIG_OCFS2_FS is not set
990CONFIG_FILE_LOCKING=y
991CONFIG_FSNOTIFY=y
964CONFIG_DNOTIFY=y 992CONFIG_DNOTIFY=y
965CONFIG_INOTIFY=y 993CONFIG_INOTIFY=y
966CONFIG_INOTIFY_USER=y 994CONFIG_INOTIFY_USER=y
@@ -1110,6 +1138,7 @@ CONFIG_HAS_IOPORT=y
1110CONFIG_HAS_DMA=y 1138CONFIG_HAS_DMA=y
1111CONFIG_HAVE_LMB=y 1139CONFIG_HAVE_LMB=y
1112CONFIG_NLATTR=y 1140CONFIG_NLATTR=y
1141CONFIG_GENERIC_ATOMIC64=y
1113 1142
1114# 1143#
1115# Kernel hacking 1144# Kernel hacking
@@ -1140,6 +1169,9 @@ CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1140# CONFIG_RT_MUTEX_TESTER is not set 1169# CONFIG_RT_MUTEX_TESTER is not set
1141# CONFIG_DEBUG_SPINLOCK is not set 1170# CONFIG_DEBUG_SPINLOCK is not set
1142# CONFIG_DEBUG_MUTEXES is not set 1171# CONFIG_DEBUG_MUTEXES is not set
1172# CONFIG_DEBUG_LOCK_ALLOC is not set
1173# CONFIG_PROVE_LOCKING is not set
1174# CONFIG_LOCK_STAT is not set
1143# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1175# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1144# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1176# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1145# CONFIG_DEBUG_KOBJECT is not set 1177# CONFIG_DEBUG_KOBJECT is not set
@@ -1151,7 +1183,6 @@ CONFIG_DEBUG_INFO=y
1151# CONFIG_DEBUG_LIST is not set 1183# CONFIG_DEBUG_LIST is not set
1152# CONFIG_DEBUG_SG is not set 1184# CONFIG_DEBUG_SG is not set
1153# CONFIG_DEBUG_NOTIFIERS is not set 1185# CONFIG_DEBUG_NOTIFIERS is not set
1154# CONFIG_BOOT_PRINTK_DELAY is not set
1155# CONFIG_RCU_TORTURE_TEST is not set 1186# CONFIG_RCU_TORTURE_TEST is not set
1156# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1187# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1157# CONFIG_BACKTRACE_SELF_TEST is not set 1188# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1165,22 +1196,23 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1165CONFIG_HAVE_DYNAMIC_FTRACE=y 1196CONFIG_HAVE_DYNAMIC_FTRACE=y
1166CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1197CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1167CONFIG_TRACING_SUPPORT=y 1198CONFIG_TRACING_SUPPORT=y
1168 1199CONFIG_FTRACE=y
1169#
1170# Tracers
1171#
1172# CONFIG_FUNCTION_TRACER is not set 1200# CONFIG_FUNCTION_TRACER is not set
1201# CONFIG_IRQSOFF_TRACER is not set
1173# CONFIG_SCHED_TRACER is not set 1202# CONFIG_SCHED_TRACER is not set
1174# CONFIG_CONTEXT_SWITCH_TRACER is not set 1203# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1175# CONFIG_EVENT_TRACER is not set
1176# CONFIG_BOOT_TRACER is not set 1204# CONFIG_BOOT_TRACER is not set
1177# CONFIG_TRACE_BRANCH_PROFILING is not set 1205CONFIG_BRANCH_PROFILE_NONE=y
1206# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1207# CONFIG_PROFILE_ALL_BRANCHES is not set
1178# CONFIG_STACK_TRACER is not set 1208# CONFIG_STACK_TRACER is not set
1179# CONFIG_KMEMTRACE is not set 1209# CONFIG_KMEMTRACE is not set
1180# CONFIG_WORKQUEUE_TRACER is not set 1210# CONFIG_WORKQUEUE_TRACER is not set
1181# CONFIG_BLK_DEV_IO_TRACE is not set 1211# CONFIG_BLK_DEV_IO_TRACE is not set
1182# CONFIG_SAMPLES is not set 1212# CONFIG_SAMPLES is not set
1183CONFIG_HAVE_ARCH_KGDB=y 1213CONFIG_HAVE_ARCH_KGDB=y
1214# CONFIG_PPC_DISABLE_WERROR is not set
1215CONFIG_PPC_WERROR=y
1184CONFIG_PRINT_STACK_DEPTH=64 1216CONFIG_PRINT_STACK_DEPTH=64
1185# CONFIG_DEBUG_STACKOVERFLOW is not set 1217# CONFIG_DEBUG_STACKOVERFLOW is not set
1186# CONFIG_DEBUG_STACK_USAGE is not set 1218# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/prpmc2800_defconfig b/arch/powerpc/configs/prpmc2800_defconfig
index e9f287f313fa..1293c465d7fa 100644
--- a/arch/powerpc/configs/prpmc2800_defconfig
+++ b/arch/powerpc/configs/prpmc2800_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:03 2009 4# Wed Jul 29 23:32:01 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19CONFIG_ALTIVEC=y 20CONFIG_ALTIVEC=y
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_NOT_COHERENT_CACHE=y 26CONFIG_NOT_COHERENT_CACHE=y
25CONFIG_CHECK_CACHE_COHERENCY=y 27CONFIG_CHECK_CACHE_COHERENCY=y
@@ -32,15 +34,16 @@ CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
36CONFIG_IRQ_PER_CPU=y 39CONFIG_IRQ_PER_CPU=y
37CONFIG_STACKTRACE_SUPPORT=y 40CONFIG_STACKTRACE_SUPPORT=y
38CONFIG_HAVE_LATENCYTOP_SUPPORT=y 41CONFIG_HAVE_LATENCYTOP_SUPPORT=y
42CONFIG_TRACE_IRQFLAGS_SUPPORT=y
39CONFIG_LOCKDEP_SUPPORT=y 43CONFIG_LOCKDEP_SUPPORT=y
40CONFIG_RWSEM_XCHGADD_ALGORITHM=y 44CONFIG_RWSEM_XCHGADD_ALGORITHM=y
41CONFIG_ARCH_HAS_ILOG2_U32=y 45CONFIG_ARCH_HAS_ILOG2_U32=y
42CONFIG_GENERIC_HWEIGHT=y 46CONFIG_GENERIC_HWEIGHT=y
43CONFIG_GENERIC_CALIBRATE_DELAY=y
44CONFIG_GENERIC_FIND_NEXT_BIT=y 47CONFIG_GENERIC_FIND_NEXT_BIT=y
45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 48# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
46CONFIG_PPC=y 49CONFIG_PPC=y
@@ -54,11 +57,13 @@ CONFIG_OF=y
54# CONFIG_GENERIC_TBSYNC is not set 57# CONFIG_GENERIC_TBSYNC is not set
55CONFIG_AUDIT_ARCH=y 58CONFIG_AUDIT_ARCH=y
56CONFIG_GENERIC_BUG=y 59CONFIG_GENERIC_BUG=y
60CONFIG_DTC=y
57# CONFIG_DEFAULT_UIMAGE is not set 61# CONFIG_DEFAULT_UIMAGE is not set
58# CONFIG_PPC_DCR_NATIVE is not set 62# CONFIG_PPC_DCR_NATIVE is not set
59# CONFIG_PPC_DCR_MMIO is not set 63# CONFIG_PPC_DCR_MMIO is not set
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 64CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 65CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
66CONFIG_CONSTRUCTORS=y
62 67
63# 68#
64# General setup 69# General setup
@@ -114,7 +119,6 @@ CONFIG_ANON_INODES=y
114CONFIG_SYSCTL_SYSCALL=y 119CONFIG_SYSCTL_SYSCALL=y
115CONFIG_KALLSYMS=y 120CONFIG_KALLSYMS=y
116# CONFIG_KALLSYMS_EXTRA_PASS is not set 121# CONFIG_KALLSYMS_EXTRA_PASS is not set
117# CONFIG_STRIP_ASM_SYMS is not set
118CONFIG_HOTPLUG=y 122CONFIG_HOTPLUG=y
119CONFIG_PRINTK=y 123CONFIG_PRINTK=y
120CONFIG_BUG=y 124CONFIG_BUG=y
@@ -127,9 +131,16 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 132CONFIG_SHMEM=y
129CONFIG_AIO=y 133CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y
135
136#
137# Performance Counters
138#
139# CONFIG_PERF_COUNTERS is not set
130CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
131CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
132CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
135CONFIG_SLUB=y 146CONFIG_SLUB=y
@@ -142,6 +153,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
142CONFIG_HAVE_KPROBES=y 153CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
156
157#
158# GCOV-based kernel profiling
159#
145# CONFIG_SLOW_WORK is not set 160# CONFIG_SLOW_WORK is not set
146# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
147CONFIG_SLABINFO=y 162CONFIG_SLABINFO=y
@@ -149,7 +164,7 @@ CONFIG_RT_MUTEXES=y
149CONFIG_BASE_SMALL=0 164CONFIG_BASE_SMALL=0
150# CONFIG_MODULES is not set 165# CONFIG_MODULES is not set
151CONFIG_BLOCK=y 166CONFIG_BLOCK=y
152CONFIG_LBD=y 167CONFIG_LBDAF=y
153# CONFIG_BLK_DEV_BSG is not set 168# CONFIG_BLK_DEV_BSG is not set
154# CONFIG_BLK_DEV_INTEGRITY is not set 169# CONFIG_BLK_DEV_INTEGRITY is not set
155 170
@@ -228,6 +243,7 @@ CONFIG_BINFMT_ELF=y
228# CONFIG_HAVE_AOUT is not set 243# CONFIG_HAVE_AOUT is not set
229CONFIG_BINFMT_MISC=y 244CONFIG_BINFMT_MISC=y
230# CONFIG_IOMMU_HELPER is not set 245# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set
231CONFIG_PPC_NEED_DMA_SYNC_OPS=y 247CONFIG_PPC_NEED_DMA_SYNC_OPS=y
232CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -249,9 +265,9 @@ CONFIG_MIGRATION=y
249CONFIG_ZONE_DMA_FLAG=1 265CONFIG_ZONE_DMA_FLAG=1
250CONFIG_BOUNCE=y 266CONFIG_BOUNCE=y
251CONFIG_VIRT_TO_BUS=y 267CONFIG_VIRT_TO_BUS=y
252CONFIG_UNEVICTABLE_LRU=y
253CONFIG_HAVE_MLOCK=y 268CONFIG_HAVE_MLOCK=y
254CONFIG_HAVE_MLOCKED_PAGE_BIT=y 269CONFIG_HAVE_MLOCKED_PAGE_BIT=y
270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
255CONFIG_PPC_4K_PAGES=y 271CONFIG_PPC_4K_PAGES=y
256# CONFIG_PPC_16K_PAGES is not set 272# CONFIG_PPC_16K_PAGES is not set
257# CONFIG_PPC_64K_PAGES is not set 273# CONFIG_PPC_64K_PAGES is not set
@@ -296,6 +312,7 @@ CONFIG_PAGE_OFFSET=0xc0000000
296CONFIG_KERNEL_START=0xc0000000 312CONFIG_KERNEL_START=0xc0000000
297CONFIG_PHYSICAL_START=0x00000000 313CONFIG_PHYSICAL_START=0x00000000
298CONFIG_TASK_SIZE=0xc0000000 314CONFIG_TASK_SIZE=0xc0000000
315CONFIG_CONSISTENT_SIZE=0x00200000
299CONFIG_NET=y 316CONFIG_NET=y
300 317
301# 318#
@@ -357,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_ECONET is not set 374# CONFIG_ECONET is not set
358# CONFIG_WAN_ROUTER is not set 375# CONFIG_WAN_ROUTER is not set
359# CONFIG_PHONET is not set 376# CONFIG_PHONET is not set
377# CONFIG_IEEE802154 is not set
360# CONFIG_NET_SCHED is not set 378# CONFIG_NET_SCHED is not set
361# CONFIG_DCB is not set 379# CONFIG_DCB is not set
362 380
@@ -374,7 +392,11 @@ CONFIG_WIRELESS=y
374CONFIG_WIRELESS_OLD_REGULATORY=y 392CONFIG_WIRELESS_OLD_REGULATORY=y
375# CONFIG_WIRELESS_EXT is not set 393# CONFIG_WIRELESS_EXT is not set
376# CONFIG_LIB80211 is not set 394# CONFIG_LIB80211 is not set
377# CONFIG_MAC80211 is not set 395
396#
397# CFG80211 needs to be enabled for MAC80211
398#
399CONFIG_MAC80211_DEFAULT_PS_VALUE=0
378# CONFIG_WIMAX is not set 400# CONFIG_WIMAX is not set
379# CONFIG_RFKILL is not set 401# CONFIG_RFKILL is not set
380# CONFIG_NET_9P is not set 402# CONFIG_NET_9P is not set
@@ -479,6 +501,7 @@ CONFIG_MTD_PHYSMAP_OF=y
479# CONFIG_MTD_UBI is not set 501# CONFIG_MTD_UBI is not set
480CONFIG_OF_DEVICE=y 502CONFIG_OF_DEVICE=y
481CONFIG_OF_I2C=y 503CONFIG_OF_I2C=y
504CONFIG_OF_MDIO=y
482# CONFIG_PARPORT is not set 505# CONFIG_PARPORT is not set
483CONFIG_BLK_DEV=y 506CONFIG_BLK_DEV=y
484# CONFIG_BLK_DEV_FD is not set 507# CONFIG_BLK_DEV_FD is not set
@@ -514,7 +537,9 @@ CONFIG_MISC_DEVICES=y
514# 537#
515# CONFIG_EEPROM_AT24 is not set 538# CONFIG_EEPROM_AT24 is not set
516# CONFIG_EEPROM_LEGACY is not set 539# CONFIG_EEPROM_LEGACY is not set
540# CONFIG_EEPROM_MAX6875 is not set
517# CONFIG_EEPROM_93CX6 is not set 541# CONFIG_EEPROM_93CX6 is not set
542# CONFIG_CB710_CORE is not set
518CONFIG_HAVE_IDE=y 543CONFIG_HAVE_IDE=y
519CONFIG_IDE=y 544CONFIG_IDE=y
520 545
@@ -591,10 +616,6 @@ CONFIG_BLK_DEV_SD=y
591# CONFIG_BLK_DEV_SR is not set 616# CONFIG_BLK_DEV_SR is not set
592# CONFIG_CHR_DEV_SG is not set 617# CONFIG_CHR_DEV_SG is not set
593# CONFIG_CHR_DEV_SCH is not set 618# CONFIG_CHR_DEV_SCH is not set
594
595#
596# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
597#
598# CONFIG_SCSI_MULTI_LUN is not set 619# CONFIG_SCSI_MULTI_LUN is not set
599# CONFIG_SCSI_CONSTANTS is not set 620# CONFIG_SCSI_CONSTANTS is not set
600# CONFIG_SCSI_LOGGING is not set 621# CONFIG_SCSI_LOGGING is not set
@@ -611,6 +632,7 @@ CONFIG_BLK_DEV_SD=y
611CONFIG_SCSI_LOWLEVEL=y 632CONFIG_SCSI_LOWLEVEL=y
612# CONFIG_ISCSI_TCP is not set 633# CONFIG_ISCSI_TCP is not set
613# CONFIG_SCSI_CXGB3_ISCSI is not set 634# CONFIG_SCSI_CXGB3_ISCSI is not set
635# CONFIG_SCSI_BNX2_ISCSI is not set
614# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 636# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
615# CONFIG_SCSI_3W_9XXX is not set 637# CONFIG_SCSI_3W_9XXX is not set
616# CONFIG_SCSI_ACARD is not set 638# CONFIG_SCSI_ACARD is not set
@@ -619,6 +641,7 @@ CONFIG_SCSI_LOWLEVEL=y
619# CONFIG_SCSI_AIC7XXX_OLD is not set 641# CONFIG_SCSI_AIC7XXX_OLD is not set
620# CONFIG_SCSI_AIC79XX is not set 642# CONFIG_SCSI_AIC79XX is not set
621# CONFIG_SCSI_AIC94XX is not set 643# CONFIG_SCSI_AIC94XX is not set
644# CONFIG_SCSI_MVSAS is not set
622# CONFIG_SCSI_DPT_I2O is not set 645# CONFIG_SCSI_DPT_I2O is not set
623# CONFIG_SCSI_ADVANSYS is not set 646# CONFIG_SCSI_ADVANSYS is not set
624# CONFIG_SCSI_ARCMSR is not set 647# CONFIG_SCSI_ARCMSR is not set
@@ -638,7 +661,6 @@ CONFIG_SCSI_LOWLEVEL=y
638# CONFIG_SCSI_IPS is not set 661# CONFIG_SCSI_IPS is not set
639# CONFIG_SCSI_INITIO is not set 662# CONFIG_SCSI_INITIO is not set
640# CONFIG_SCSI_INIA100 is not set 663# CONFIG_SCSI_INIA100 is not set
641# CONFIG_SCSI_MVSAS is not set
642# CONFIG_SCSI_STEX is not set 664# CONFIG_SCSI_STEX is not set
643# CONFIG_SCSI_SYM53C8XX_2 is not set 665# CONFIG_SCSI_SYM53C8XX_2 is not set
644# CONFIG_SCSI_IPR is not set 666# CONFIG_SCSI_IPR is not set
@@ -721,7 +743,11 @@ CONFIG_SATA_MV=y
721# 743#
722 744
723# 745#
724# Enable only one of the two stacks, unless you know what you are doing 746# You can enable one or both FireWire driver stacks.
747#
748
749#
750# See the help texts for more information.
725# 751#
726# CONFIG_FIREWIRE is not set 752# CONFIG_FIREWIRE is not set
727# CONFIG_IEEE1394 is not set 753# CONFIG_IEEE1394 is not set
@@ -730,7 +756,6 @@ CONFIG_MACINTOSH_DRIVERS=y
730# CONFIG_MAC_EMUMOUSEBTN is not set 756# CONFIG_MAC_EMUMOUSEBTN is not set
731# CONFIG_WINDFARM is not set 757# CONFIG_WINDFARM is not set
732CONFIG_NETDEVICES=y 758CONFIG_NETDEVICES=y
733CONFIG_COMPAT_NET_DEV_OPS=y
734# CONFIG_DUMMY is not set 759# CONFIG_DUMMY is not set
735# CONFIG_BONDING is not set 760# CONFIG_BONDING is not set
736# CONFIG_MACVLAN is not set 761# CONFIG_MACVLAN is not set
@@ -797,6 +822,7 @@ CONFIG_8139TOO=y
797# CONFIG_SMSC9420 is not set 822# CONFIG_SMSC9420 is not set
798# CONFIG_SUNDANCE is not set 823# CONFIG_SUNDANCE is not set
799# CONFIG_TLAN is not set 824# CONFIG_TLAN is not set
825# CONFIG_KS8842 is not set
800# CONFIG_VIA_RHINE is not set 826# CONFIG_VIA_RHINE is not set
801# CONFIG_SC92031 is not set 827# CONFIG_SC92031 is not set
802# CONFIG_ATL2 is not set 828# CONFIG_ATL2 is not set
@@ -818,6 +844,7 @@ CONFIG_E1000=y
818# CONFIG_VIA_VELOCITY is not set 844# CONFIG_VIA_VELOCITY is not set
819# CONFIG_TIGON3 is not set 845# CONFIG_TIGON3 is not set
820# CONFIG_BNX2 is not set 846# CONFIG_BNX2 is not set
847# CONFIG_CNIC is not set
821CONFIG_MV643XX_ETH=y 848CONFIG_MV643XX_ETH=y
822# CONFIG_QLA3XXX is not set 849# CONFIG_QLA3XXX is not set
823# CONFIG_ATL1 is not set 850# CONFIG_ATL1 is not set
@@ -1007,13 +1034,17 @@ CONFIG_I2C_MV64XXX=y
1007# CONFIG_SENSORS_PCF8574 is not set 1034# CONFIG_SENSORS_PCF8574 is not set
1008# CONFIG_PCF8575 is not set 1035# CONFIG_PCF8575 is not set
1009# CONFIG_SENSORS_PCA9539 is not set 1036# CONFIG_SENSORS_PCA9539 is not set
1010# CONFIG_SENSORS_MAX6875 is not set
1011# CONFIG_SENSORS_TSL2550 is not set 1037# CONFIG_SENSORS_TSL2550 is not set
1012# CONFIG_I2C_DEBUG_CORE is not set 1038# CONFIG_I2C_DEBUG_CORE is not set
1013# CONFIG_I2C_DEBUG_ALGO is not set 1039# CONFIG_I2C_DEBUG_ALGO is not set
1014# CONFIG_I2C_DEBUG_BUS is not set 1040# CONFIG_I2C_DEBUG_BUS is not set
1015# CONFIG_I2C_DEBUG_CHIP is not set 1041# CONFIG_I2C_DEBUG_CHIP is not set
1016# CONFIG_SPI is not set 1042# CONFIG_SPI is not set
1043
1044#
1045# PPS support
1046#
1047# CONFIG_PPS is not set
1017CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 1048CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1018# CONFIG_GPIOLIB is not set 1049# CONFIG_GPIOLIB is not set
1019# CONFIG_W1 is not set 1050# CONFIG_W1 is not set
@@ -1068,6 +1099,7 @@ CONFIG_HWMON=y
1068# CONFIG_SENSORS_SMSC47B397 is not set 1099# CONFIG_SENSORS_SMSC47B397 is not set
1069# CONFIG_SENSORS_ADS7828 is not set 1100# CONFIG_SENSORS_ADS7828 is not set
1070# CONFIG_SENSORS_THMC50 is not set 1101# CONFIG_SENSORS_THMC50 is not set
1102# CONFIG_SENSORS_TMP401 is not set
1071# CONFIG_SENSORS_VIA686A is not set 1103# CONFIG_SENSORS_VIA686A is not set
1072# CONFIG_SENSORS_VT1211 is not set 1104# CONFIG_SENSORS_VT1211 is not set
1073# CONFIG_SENSORS_VT8231 is not set 1105# CONFIG_SENSORS_VT8231 is not set
@@ -1102,23 +1134,9 @@ CONFIG_SSB_POSSIBLE=y
1102# CONFIG_MFD_WM8400 is not set 1134# CONFIG_MFD_WM8400 is not set
1103# CONFIG_MFD_WM8350_I2C is not set 1135# CONFIG_MFD_WM8350_I2C is not set
1104# CONFIG_MFD_PCF50633 is not set 1136# CONFIG_MFD_PCF50633 is not set
1137# CONFIG_AB3100_CORE is not set
1105# CONFIG_REGULATOR is not set 1138# CONFIG_REGULATOR is not set
1106 1139# CONFIG_MEDIA_SUPPORT is not set
1107#
1108# Multimedia devices
1109#
1110
1111#
1112# Multimedia core support
1113#
1114# CONFIG_VIDEO_DEV is not set
1115# CONFIG_DVB_CORE is not set
1116# CONFIG_VIDEO_MEDIA is not set
1117
1118#
1119# Multimedia drivers
1120#
1121# CONFIG_DAB is not set
1122 1140
1123# 1141#
1124# Graphics support 1142# Graphics support
@@ -1163,6 +1181,7 @@ CONFIG_HID_BELKIN=y
1163CONFIG_HID_CHERRY=y 1181CONFIG_HID_CHERRY=y
1164CONFIG_HID_CHICONY=y 1182CONFIG_HID_CHICONY=y
1165CONFIG_HID_CYPRESS=y 1183CONFIG_HID_CYPRESS=y
1184CONFIG_HID_DRAGONRISE=y
1166# CONFIG_DRAGONRISE_FF is not set 1185# CONFIG_DRAGONRISE_FF is not set
1167CONFIG_HID_EZKEY=y 1186CONFIG_HID_EZKEY=y
1168CONFIG_HID_KYE=y 1187CONFIG_HID_KYE=y
@@ -1180,9 +1199,14 @@ CONFIG_HID_PETALYNX=y
1180CONFIG_HID_SAMSUNG=y 1199CONFIG_HID_SAMSUNG=y
1181CONFIG_HID_SONY=y 1200CONFIG_HID_SONY=y
1182CONFIG_HID_SUNPLUS=y 1201CONFIG_HID_SUNPLUS=y
1202CONFIG_HID_GREENASIA=y
1183# CONFIG_GREENASIA_FF is not set 1203# CONFIG_GREENASIA_FF is not set
1204CONFIG_HID_SMARTJOYPLUS=y
1205# CONFIG_SMARTJOYPLUS_FF is not set
1184CONFIG_HID_TOPSEED=y 1206CONFIG_HID_TOPSEED=y
1207CONFIG_HID_THRUSTMASTER=y
1185CONFIG_THRUSTMASTER_FF=y 1208CONFIG_THRUSTMASTER_FF=y
1209CONFIG_HID_ZEROPLUS=y
1186CONFIG_ZEROPLUS_FF=y 1210CONFIG_ZEROPLUS_FF=y
1187CONFIG_USB_SUPPORT=y 1211CONFIG_USB_SUPPORT=y
1188CONFIG_USB_ARCH_HAS_HCD=y 1212CONFIG_USB_ARCH_HAS_HCD=y
@@ -1207,6 +1231,7 @@ CONFIG_USB_MON=y
1207# USB Host Controller Drivers 1231# USB Host Controller Drivers
1208# 1232#
1209# CONFIG_USB_C67X00_HCD is not set 1233# CONFIG_USB_C67X00_HCD is not set
1234# CONFIG_USB_XHCI_HCD is not set
1210CONFIG_USB_EHCI_HCD=y 1235CONFIG_USB_EHCI_HCD=y
1211# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1236# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1212# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1237# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -1215,6 +1240,8 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1215# CONFIG_USB_ISP116X_HCD is not set 1240# CONFIG_USB_ISP116X_HCD is not set
1216# CONFIG_USB_ISP1760_HCD is not set 1241# CONFIG_USB_ISP1760_HCD is not set
1217CONFIG_USB_OHCI_HCD=y 1242CONFIG_USB_OHCI_HCD=y
1243# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1244# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1218# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1245# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1219# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1246# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1220# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1247# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1322,6 +1349,7 @@ CONFIG_RTC_DRV_MAX6900=y
1322# CONFIG_RTC_DRV_S35390A is not set 1349# CONFIG_RTC_DRV_S35390A is not set
1323# CONFIG_RTC_DRV_FM3130 is not set 1350# CONFIG_RTC_DRV_FM3130 is not set
1324# CONFIG_RTC_DRV_RX8581 is not set 1351# CONFIG_RTC_DRV_RX8581 is not set
1352# CONFIG_RTC_DRV_RX8025 is not set
1325 1353
1326# 1354#
1327# SPI RTC drivers 1355# SPI RTC drivers
@@ -1349,6 +1377,10 @@ CONFIG_RTC_DRV_MAX6900=y
1349# CONFIG_DMADEVICES is not set 1377# CONFIG_DMADEVICES is not set
1350# CONFIG_AUXDISPLAY is not set 1378# CONFIG_AUXDISPLAY is not set
1351# CONFIG_UIO is not set 1379# CONFIG_UIO is not set
1380
1381#
1382# TI VLYNQ
1383#
1352# CONFIG_STAGING is not set 1384# CONFIG_STAGING is not set
1353 1385
1354# 1386#
@@ -1368,11 +1400,12 @@ CONFIG_FS_MBCACHE=y
1368# CONFIG_REISERFS_FS is not set 1400# CONFIG_REISERFS_FS is not set
1369# CONFIG_JFS_FS is not set 1401# CONFIG_JFS_FS is not set
1370# CONFIG_FS_POSIX_ACL is not set 1402# CONFIG_FS_POSIX_ACL is not set
1371CONFIG_FILE_LOCKING=y
1372# CONFIG_XFS_FS is not set 1403# CONFIG_XFS_FS is not set
1373# CONFIG_GFS2_FS is not set 1404# CONFIG_GFS2_FS is not set
1374# CONFIG_OCFS2_FS is not set 1405# CONFIG_OCFS2_FS is not set
1375# CONFIG_BTRFS_FS is not set 1406# CONFIG_BTRFS_FS is not set
1407CONFIG_FILE_LOCKING=y
1408CONFIG_FSNOTIFY=y
1376CONFIG_DNOTIFY=y 1409CONFIG_DNOTIFY=y
1377CONFIG_INOTIFY=y 1410CONFIG_INOTIFY=y
1378CONFIG_INOTIFY_USER=y 1411CONFIG_INOTIFY_USER=y
@@ -1469,7 +1502,46 @@ CONFIG_MSDOS_PARTITION=y
1469# CONFIG_KARMA_PARTITION is not set 1502# CONFIG_KARMA_PARTITION is not set
1470# CONFIG_EFI_PARTITION is not set 1503# CONFIG_EFI_PARTITION is not set
1471# CONFIG_SYSV68_PARTITION is not set 1504# CONFIG_SYSV68_PARTITION is not set
1472# CONFIG_NLS is not set 1505CONFIG_NLS=y
1506CONFIG_NLS_DEFAULT="iso8859-1"
1507# CONFIG_NLS_CODEPAGE_437 is not set
1508# CONFIG_NLS_CODEPAGE_737 is not set
1509# CONFIG_NLS_CODEPAGE_775 is not set
1510# CONFIG_NLS_CODEPAGE_850 is not set
1511# CONFIG_NLS_CODEPAGE_852 is not set
1512# CONFIG_NLS_CODEPAGE_855 is not set
1513# CONFIG_NLS_CODEPAGE_857 is not set
1514# CONFIG_NLS_CODEPAGE_860 is not set
1515# CONFIG_NLS_CODEPAGE_861 is not set
1516# CONFIG_NLS_CODEPAGE_862 is not set
1517# CONFIG_NLS_CODEPAGE_863 is not set
1518# CONFIG_NLS_CODEPAGE_864 is not set
1519# CONFIG_NLS_CODEPAGE_865 is not set
1520# CONFIG_NLS_CODEPAGE_866 is not set
1521# CONFIG_NLS_CODEPAGE_869 is not set
1522# CONFIG_NLS_CODEPAGE_936 is not set
1523# CONFIG_NLS_CODEPAGE_950 is not set
1524# CONFIG_NLS_CODEPAGE_932 is not set
1525# CONFIG_NLS_CODEPAGE_949 is not set
1526# CONFIG_NLS_CODEPAGE_874 is not set
1527# CONFIG_NLS_ISO8859_8 is not set
1528# CONFIG_NLS_CODEPAGE_1250 is not set
1529# CONFIG_NLS_CODEPAGE_1251 is not set
1530# CONFIG_NLS_ASCII is not set
1531# CONFIG_NLS_ISO8859_1 is not set
1532# CONFIG_NLS_ISO8859_2 is not set
1533# CONFIG_NLS_ISO8859_3 is not set
1534# CONFIG_NLS_ISO8859_4 is not set
1535# CONFIG_NLS_ISO8859_5 is not set
1536# CONFIG_NLS_ISO8859_6 is not set
1537# CONFIG_NLS_ISO8859_7 is not set
1538# CONFIG_NLS_ISO8859_9 is not set
1539# CONFIG_NLS_ISO8859_13 is not set
1540# CONFIG_NLS_ISO8859_14 is not set
1541# CONFIG_NLS_ISO8859_15 is not set
1542# CONFIG_NLS_KOI8_R is not set
1543# CONFIG_NLS_KOI8_U is not set
1544# CONFIG_NLS_UTF8 is not set
1473# CONFIG_DLM is not set 1545# CONFIG_DLM is not set
1474# CONFIG_BINARY_PRINTF is not set 1546# CONFIG_BINARY_PRINTF is not set
1475 1547
@@ -1494,6 +1566,7 @@ CONFIG_HAS_IOPORT=y
1494CONFIG_HAS_DMA=y 1566CONFIG_HAS_DMA=y
1495CONFIG_HAVE_LMB=y 1567CONFIG_HAVE_LMB=y
1496CONFIG_NLATTR=y 1568CONFIG_NLATTR=y
1569CONFIG_GENERIC_ATOMIC64=y
1497 1570
1498# 1571#
1499# Kernel hacking 1572# Kernel hacking
@@ -1519,22 +1592,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1519CONFIG_HAVE_DYNAMIC_FTRACE=y 1592CONFIG_HAVE_DYNAMIC_FTRACE=y
1520CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1593CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1521CONFIG_TRACING_SUPPORT=y 1594CONFIG_TRACING_SUPPORT=y
1522 1595# CONFIG_FTRACE is not set
1523#
1524# Tracers
1525#
1526# CONFIG_FUNCTION_TRACER is not set
1527# CONFIG_SCHED_TRACER is not set
1528# CONFIG_CONTEXT_SWITCH_TRACER is not set
1529# CONFIG_EVENT_TRACER is not set
1530# CONFIG_BOOT_TRACER is not set
1531# CONFIG_TRACE_BRANCH_PROFILING is not set
1532# CONFIG_STACK_TRACER is not set
1533# CONFIG_KMEMTRACE is not set
1534# CONFIG_WORKQUEUE_TRACER is not set
1535# CONFIG_BLK_DEV_IO_TRACE is not set
1536# CONFIG_SAMPLES is not set 1596# CONFIG_SAMPLES is not set
1537CONFIG_HAVE_ARCH_KGDB=y 1597CONFIG_HAVE_ARCH_KGDB=y
1598# CONFIG_PPC_DISABLE_WERROR is not set
1599CONFIG_PPC_WERROR=y
1538CONFIG_PRINT_STACK_DEPTH=64 1600CONFIG_PRINT_STACK_DEPTH=64
1539# CONFIG_IRQSTACKS is not set 1601# CONFIG_IRQSTACKS is not set
1540# CONFIG_BOOTX_TEXT is not set 1602# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig
index bd4a8d435c50..28384dc01003 100644
--- a/arch/powerpc/configs/storcenter_defconfig
+++ b/arch/powerpc/configs/storcenter_defconfig
@@ -1,25 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc3 3# Linux kernel version: 2.6.31-rc4
4# Wed May 13 17:22:04 2009 4# Wed Jul 29 23:32:01 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_6xx=y 11CONFIG_PPC_BOOK3S_32=y
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
15# CONFIG_44x is not set 15# CONFIG_44x is not set
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_PPC_BOOK3S=y 17CONFIG_PPC_BOOK3S=y
18CONFIG_6xx=y
18CONFIG_PPC_FPU=y 19CONFIG_PPC_FPU=y
19# CONFIG_ALTIVEC is not set 20# CONFIG_ALTIVEC is not set
20CONFIG_PPC_STD_MMU=y 21CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
22# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
23# CONFIG_SMP is not set 25# CONFIG_SMP is not set
24CONFIG_PPC32=y 26CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32 27CONFIG_WORD_SIZE=32
@@ -30,15 +32,16 @@ CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y 33CONFIG_GENERIC_CLOCKEVENTS=y
32CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
33# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
34CONFIG_IRQ_PER_CPU=y 37CONFIG_IRQ_PER_CPU=y
35CONFIG_STACKTRACE_SUPPORT=y 38CONFIG_STACKTRACE_SUPPORT=y
36CONFIG_HAVE_LATENCYTOP_SUPPORT=y 39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
37CONFIG_LOCKDEP_SUPPORT=y 41CONFIG_LOCKDEP_SUPPORT=y
38CONFIG_RWSEM_XCHGADD_ALGORITHM=y 42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
39CONFIG_ARCH_HAS_ILOG2_U32=y 43CONFIG_ARCH_HAS_ILOG2_U32=y
40CONFIG_GENERIC_HWEIGHT=y 44CONFIG_GENERIC_HWEIGHT=y
41CONFIG_GENERIC_CALIBRATE_DELAY=y
42CONFIG_GENERIC_FIND_NEXT_BIT=y 45CONFIG_GENERIC_FIND_NEXT_BIT=y
43# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
44CONFIG_PPC=y 47CONFIG_PPC=y
@@ -52,11 +55,13 @@ CONFIG_PPC_UDBG_16550=y
52# CONFIG_GENERIC_TBSYNC is not set 55# CONFIG_GENERIC_TBSYNC is not set
53CONFIG_AUDIT_ARCH=y 56CONFIG_AUDIT_ARCH=y
54CONFIG_GENERIC_BUG=y 57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
55# CONFIG_DEFAULT_UIMAGE is not set 59# CONFIG_DEFAULT_UIMAGE is not set
56# CONFIG_PPC_DCR_NATIVE is not set 60# CONFIG_PPC_DCR_NATIVE is not set
57# CONFIG_PPC_DCR_MMIO is not set 61# CONFIG_PPC_DCR_MMIO is not set
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
64CONFIG_CONSTRUCTORS=y
60 65
61# 66#
62# General setup 67# General setup
@@ -101,7 +106,6 @@ CONFIG_ANON_INODES=y
101CONFIG_EMBEDDED=y 106CONFIG_EMBEDDED=y
102CONFIG_SYSCTL_SYSCALL=y 107CONFIG_SYSCTL_SYSCALL=y
103# CONFIG_KALLSYMS is not set 108# CONFIG_KALLSYMS is not set
104# CONFIG_STRIP_ASM_SYMS is not set
105CONFIG_HOTPLUG=y 109CONFIG_HOTPLUG=y
106CONFIG_PRINTK=y 110CONFIG_PRINTK=y
107CONFIG_BUG=y 111CONFIG_BUG=y
@@ -114,9 +118,16 @@ CONFIG_TIMERFD=y
114CONFIG_EVENTFD=y 118CONFIG_EVENTFD=y
115CONFIG_SHMEM=y 119CONFIG_SHMEM=y
116CONFIG_AIO=y 120CONFIG_AIO=y
121CONFIG_HAVE_PERF_COUNTERS=y
122
123#
124# Performance Counters
125#
126# CONFIG_PERF_COUNTERS is not set
117CONFIG_VM_EVENT_COUNTERS=y 127CONFIG_VM_EVENT_COUNTERS=y
118CONFIG_PCI_QUIRKS=y 128CONFIG_PCI_QUIRKS=y
119CONFIG_SLUB_DEBUG=y 129CONFIG_SLUB_DEBUG=y
130# CONFIG_STRIP_ASM_SYMS is not set
120CONFIG_COMPAT_BRK=y 131CONFIG_COMPAT_BRK=y
121# CONFIG_SLAB is not set 132# CONFIG_SLAB is not set
122CONFIG_SLUB=y 133CONFIG_SLUB=y
@@ -129,6 +140,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
129CONFIG_HAVE_KPROBES=y 140CONFIG_HAVE_KPROBES=y
130CONFIG_HAVE_KRETPROBES=y 141CONFIG_HAVE_KRETPROBES=y
131CONFIG_HAVE_ARCH_TRACEHOOK=y 142CONFIG_HAVE_ARCH_TRACEHOOK=y
143
144#
145# GCOV-based kernel profiling
146#
132# CONFIG_SLOW_WORK is not set 147# CONFIG_SLOW_WORK is not set
133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 148# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
134CONFIG_SLABINFO=y 149CONFIG_SLABINFO=y
@@ -141,7 +156,7 @@ CONFIG_MODULE_UNLOAD=y
141# CONFIG_MODVERSIONS is not set 156# CONFIG_MODVERSIONS is not set
142# CONFIG_MODULE_SRCVERSION_ALL is not set 157# CONFIG_MODULE_SRCVERSION_ALL is not set
143CONFIG_BLOCK=y 158CONFIG_BLOCK=y
144CONFIG_LBD=y 159CONFIG_LBDAF=y
145# CONFIG_BLK_DEV_BSG is not set 160# CONFIG_BLK_DEV_BSG is not set
146# CONFIG_BLK_DEV_INTEGRITY is not set 161# CONFIG_BLK_DEV_INTEGRITY is not set
147 162
@@ -222,6 +237,7 @@ CONFIG_BINFMT_ELF=y
222# CONFIG_HAVE_AOUT is not set 237# CONFIG_HAVE_AOUT is not set
223CONFIG_BINFMT_MISC=y 238CONFIG_BINFMT_MISC=y
224# CONFIG_IOMMU_HELPER is not set 239# CONFIG_IOMMU_HELPER is not set
240# CONFIG_SWIOTLB is not set
225CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
226CONFIG_ARCH_HAS_WALK_MEMORY=y 242CONFIG_ARCH_HAS_WALK_MEMORY=y
227CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -242,9 +258,9 @@ CONFIG_MIGRATION=y
242CONFIG_ZONE_DMA_FLAG=1 258CONFIG_ZONE_DMA_FLAG=1
243CONFIG_BOUNCE=y 259CONFIG_BOUNCE=y
244CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
247CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
248CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
249# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
250# CONFIG_PPC_64K_PAGES is not set 266# CONFIG_PPC_64K_PAGES is not set
@@ -347,6 +363,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
347# CONFIG_ECONET is not set 363# CONFIG_ECONET is not set
348# CONFIG_WAN_ROUTER is not set 364# CONFIG_WAN_ROUTER is not set
349# CONFIG_PHONET is not set 365# CONFIG_PHONET is not set
366# CONFIG_IEEE802154 is not set
350# CONFIG_NET_SCHED is not set 367# CONFIG_NET_SCHED is not set
351# CONFIG_DCB is not set 368# CONFIG_DCB is not set
352 369
@@ -364,7 +381,11 @@ CONFIG_WIRELESS=y
364CONFIG_WIRELESS_OLD_REGULATORY=y 381CONFIG_WIRELESS_OLD_REGULATORY=y
365# CONFIG_WIRELESS_EXT is not set 382# CONFIG_WIRELESS_EXT is not set
366# CONFIG_LIB80211 is not set 383# CONFIG_LIB80211 is not set
367# CONFIG_MAC80211 is not set 384
385#
386# CFG80211 needs to be enabled for MAC80211
387#
388CONFIG_MAC80211_DEFAULT_PS_VALUE=0
368# CONFIG_WIMAX is not set 389# CONFIG_WIMAX is not set
369# CONFIG_RFKILL is not set 390# CONFIG_RFKILL is not set
370# CONFIG_NET_9P is not set 391# CONFIG_NET_9P is not set
@@ -501,7 +522,9 @@ CONFIG_MISC_DEVICES=y
501# 522#
502# CONFIG_EEPROM_AT24 is not set 523# CONFIG_EEPROM_AT24 is not set
503# CONFIG_EEPROM_LEGACY is not set 524# CONFIG_EEPROM_LEGACY is not set
525# CONFIG_EEPROM_MAX6875 is not set
504# CONFIG_EEPROM_93CX6 is not set 526# CONFIG_EEPROM_93CX6 is not set
527# CONFIG_CB710_CORE is not set
505CONFIG_HAVE_IDE=y 528CONFIG_HAVE_IDE=y
506CONFIG_IDE=y 529CONFIG_IDE=y
507 530
@@ -579,10 +602,6 @@ CONFIG_BLK_DEV_SR=y
579# CONFIG_BLK_DEV_SR_VENDOR is not set 602# CONFIG_BLK_DEV_SR_VENDOR is not set
580# CONFIG_CHR_DEV_SG is not set 603# CONFIG_CHR_DEV_SG is not set
581# CONFIG_CHR_DEV_SCH is not set 604# CONFIG_CHR_DEV_SCH is not set
582
583#
584# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
585#
586# CONFIG_SCSI_MULTI_LUN is not set 605# CONFIG_SCSI_MULTI_LUN is not set
587# CONFIG_SCSI_CONSTANTS is not set 606# CONFIG_SCSI_CONSTANTS is not set
588# CONFIG_SCSI_LOGGING is not set 607# CONFIG_SCSI_LOGGING is not set
@@ -599,6 +618,7 @@ CONFIG_SCSI_SPI_ATTRS=y
599# CONFIG_SCSI_SRP_ATTRS is not set 618# CONFIG_SCSI_SRP_ATTRS is not set
600CONFIG_SCSI_LOWLEVEL=y 619CONFIG_SCSI_LOWLEVEL=y
601# CONFIG_ISCSI_TCP is not set 620# CONFIG_ISCSI_TCP is not set
621# CONFIG_SCSI_BNX2_ISCSI is not set
602# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 622# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
603# CONFIG_SCSI_3W_9XXX is not set 623# CONFIG_SCSI_3W_9XXX is not set
604# CONFIG_SCSI_ACARD is not set 624# CONFIG_SCSI_ACARD is not set
@@ -607,6 +627,7 @@ CONFIG_SCSI_LOWLEVEL=y
607# CONFIG_SCSI_AIC7XXX_OLD is not set 627# CONFIG_SCSI_AIC7XXX_OLD is not set
608# CONFIG_SCSI_AIC79XX is not set 628# CONFIG_SCSI_AIC79XX is not set
609# CONFIG_SCSI_AIC94XX is not set 629# CONFIG_SCSI_AIC94XX is not set
630# CONFIG_SCSI_MVSAS is not set
610# CONFIG_SCSI_DPT_I2O is not set 631# CONFIG_SCSI_DPT_I2O is not set
611# CONFIG_SCSI_ADVANSYS is not set 632# CONFIG_SCSI_ADVANSYS is not set
612# CONFIG_SCSI_ARCMSR is not set 633# CONFIG_SCSI_ARCMSR is not set
@@ -626,7 +647,6 @@ CONFIG_SCSI_LOWLEVEL=y
626# CONFIG_SCSI_IPS is not set 647# CONFIG_SCSI_IPS is not set
627# CONFIG_SCSI_INITIO is not set 648# CONFIG_SCSI_INITIO is not set
628# CONFIG_SCSI_INIA100 is not set 649# CONFIG_SCSI_INIA100 is not set
629# CONFIG_SCSI_MVSAS is not set
630# CONFIG_SCSI_STEX is not set 650# CONFIG_SCSI_STEX is not set
631# CONFIG_SCSI_SYM53C8XX_2 is not set 651# CONFIG_SCSI_SYM53C8XX_2 is not set
632# CONFIG_SCSI_QLOGIC_1280 is not set 652# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -660,14 +680,17 @@ CONFIG_MD_RAID6_PQ=y
660# 680#
661 681
662# 682#
663# Enable only one of the two stacks, unless you know what you are doing 683# You can enable one or both FireWire driver stacks.
684#
685
686#
687# See the help texts for more information.
664# 688#
665# CONFIG_FIREWIRE is not set 689# CONFIG_FIREWIRE is not set
666# CONFIG_IEEE1394 is not set 690# CONFIG_IEEE1394 is not set
667# CONFIG_I2O is not set 691# CONFIG_I2O is not set
668# CONFIG_MACINTOSH_DRIVERS is not set 692# CONFIG_MACINTOSH_DRIVERS is not set
669CONFIG_NETDEVICES=y 693CONFIG_NETDEVICES=y
670CONFIG_COMPAT_NET_DEV_OPS=y
671CONFIG_DUMMY=m 694CONFIG_DUMMY=m
672# CONFIG_BONDING is not set 695# CONFIG_BONDING is not set
673# CONFIG_MACVLAN is not set 696# CONFIG_MACVLAN is not set
@@ -695,8 +718,10 @@ CONFIG_R8169=y
695# CONFIG_VIA_VELOCITY is not set 718# CONFIG_VIA_VELOCITY is not set
696# CONFIG_TIGON3 is not set 719# CONFIG_TIGON3 is not set
697# CONFIG_BNX2 is not set 720# CONFIG_BNX2 is not set
721# CONFIG_CNIC is not set
698# CONFIG_FSL_PQ_MDIO is not set 722# CONFIG_FSL_PQ_MDIO is not set
699# CONFIG_GIANFAR is not set 723# CONFIG_GIANFAR is not set
724# CONFIG_MV643XX_ETH is not set
700# CONFIG_QLA3XXX is not set 725# CONFIG_QLA3XXX is not set
701# CONFIG_ATL1 is not set 726# CONFIG_ATL1 is not set
702# CONFIG_ATL1E is not set 727# CONFIG_ATL1E is not set
@@ -845,13 +870,17 @@ CONFIG_I2C_MPC=y
845# CONFIG_SENSORS_PCF8574 is not set 870# CONFIG_SENSORS_PCF8574 is not set
846# CONFIG_PCF8575 is not set 871# CONFIG_PCF8575 is not set
847# CONFIG_SENSORS_PCA9539 is not set 872# CONFIG_SENSORS_PCA9539 is not set
848# CONFIG_SENSORS_MAX6875 is not set
849# CONFIG_SENSORS_TSL2550 is not set 873# CONFIG_SENSORS_TSL2550 is not set
850# CONFIG_I2C_DEBUG_CORE is not set 874# CONFIG_I2C_DEBUG_CORE is not set
851# CONFIG_I2C_DEBUG_ALGO is not set 875# CONFIG_I2C_DEBUG_ALGO is not set
852# CONFIG_I2C_DEBUG_BUS is not set 876# CONFIG_I2C_DEBUG_BUS is not set
853# CONFIG_I2C_DEBUG_CHIP is not set 877# CONFIG_I2C_DEBUG_CHIP is not set
854# CONFIG_SPI is not set 878# CONFIG_SPI is not set
879
880#
881# PPS support
882#
883# CONFIG_PPS is not set
855CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 884CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
856# CONFIG_GPIOLIB is not set 885# CONFIG_GPIOLIB is not set
857# CONFIG_W1 is not set 886# CONFIG_W1 is not set
@@ -879,23 +908,9 @@ CONFIG_SSB_POSSIBLE=y
879# CONFIG_MFD_WM8400 is not set 908# CONFIG_MFD_WM8400 is not set
880# CONFIG_MFD_WM8350_I2C is not set 909# CONFIG_MFD_WM8350_I2C is not set
881# CONFIG_MFD_PCF50633 is not set 910# CONFIG_MFD_PCF50633 is not set
911# CONFIG_AB3100_CORE is not set
882# CONFIG_REGULATOR is not set 912# CONFIG_REGULATOR is not set
883 913# CONFIG_MEDIA_SUPPORT is not set
884#
885# Multimedia devices
886#
887
888#
889# Multimedia core support
890#
891# CONFIG_VIDEO_DEV is not set
892# CONFIG_DVB_CORE is not set
893# CONFIG_VIDEO_MEDIA is not set
894
895#
896# Multimedia drivers
897#
898# CONFIG_DAB is not set
899 914
900# 915#
901# Graphics support 916# Graphics support
@@ -937,6 +952,7 @@ CONFIG_USB_DEVICE_CLASS=y
937# USB Host Controller Drivers 952# USB Host Controller Drivers
938# 953#
939# CONFIG_USB_C67X00_HCD is not set 954# CONFIG_USB_C67X00_HCD is not set
955# CONFIG_USB_XHCI_HCD is not set
940CONFIG_USB_EHCI_HCD=y 956CONFIG_USB_EHCI_HCD=y
941# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 957# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
942# CONFIG_USB_EHCI_TT_NEWSCHED is not set 958# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -946,6 +962,8 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
946# CONFIG_USB_ISP116X_HCD is not set 962# CONFIG_USB_ISP116X_HCD is not set
947# CONFIG_USB_ISP1760_HCD is not set 963# CONFIG_USB_ISP1760_HCD is not set
948CONFIG_USB_OHCI_HCD=y 964CONFIG_USB_OHCI_HCD=y
965# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
966# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
949# CONFIG_USB_OHCI_HCD_PPC_OF is not set 967# CONFIG_USB_OHCI_HCD_PPC_OF is not set
950# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 968# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
951# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 969# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1064,6 +1082,7 @@ CONFIG_RTC_DRV_DS1307=y
1064# CONFIG_RTC_DRV_S35390A is not set 1082# CONFIG_RTC_DRV_S35390A is not set
1065# CONFIG_RTC_DRV_FM3130 is not set 1083# CONFIG_RTC_DRV_FM3130 is not set
1066# CONFIG_RTC_DRV_RX8581 is not set 1084# CONFIG_RTC_DRV_RX8581 is not set
1085# CONFIG_RTC_DRV_RX8025 is not set
1067 1086
1068# 1087#
1069# SPI RTC drivers 1088# SPI RTC drivers
@@ -1091,6 +1110,10 @@ CONFIG_RTC_DRV_DS1307=y
1091# CONFIG_DMADEVICES is not set 1110# CONFIG_DMADEVICES is not set
1092# CONFIG_AUXDISPLAY is not set 1111# CONFIG_AUXDISPLAY is not set
1093# CONFIG_UIO is not set 1112# CONFIG_UIO is not set
1113
1114#
1115# TI VLYNQ
1116#
1094# CONFIG_STAGING is not set 1117# CONFIG_STAGING is not set
1095 1118
1096# 1119#
@@ -1110,7 +1133,6 @@ CONFIG_FS_MBCACHE=y
1110# CONFIG_REISERFS_FS is not set 1133# CONFIG_REISERFS_FS is not set
1111# CONFIG_JFS_FS is not set 1134# CONFIG_JFS_FS is not set
1112# CONFIG_FS_POSIX_ACL is not set 1135# CONFIG_FS_POSIX_ACL is not set
1113CONFIG_FILE_LOCKING=y
1114CONFIG_XFS_FS=m 1136CONFIG_XFS_FS=m
1115# CONFIG_XFS_QUOTA is not set 1137# CONFIG_XFS_QUOTA is not set
1116# CONFIG_XFS_POSIX_ACL is not set 1138# CONFIG_XFS_POSIX_ACL is not set
@@ -1119,6 +1141,8 @@ CONFIG_XFS_FS=m
1119# CONFIG_GFS2_FS is not set 1141# CONFIG_GFS2_FS is not set
1120# CONFIG_OCFS2_FS is not set 1142# CONFIG_OCFS2_FS is not set
1121# CONFIG_BTRFS_FS is not set 1143# CONFIG_BTRFS_FS is not set
1144CONFIG_FILE_LOCKING=y
1145CONFIG_FSNOTIFY=y
1122CONFIG_DNOTIFY=y 1146CONFIG_DNOTIFY=y
1123CONFIG_INOTIFY=y 1147CONFIG_INOTIFY=y
1124CONFIG_INOTIFY_USER=y 1148CONFIG_INOTIFY_USER=y
@@ -1273,6 +1297,7 @@ CONFIG_HAS_IOPORT=y
1273CONFIG_HAS_DMA=y 1297CONFIG_HAS_DMA=y
1274CONFIG_HAVE_LMB=y 1298CONFIG_HAVE_LMB=y
1275CONFIG_NLATTR=y 1299CONFIG_NLATTR=y
1300CONFIG_GENERIC_ATOMIC64=y
1276 1301
1277# 1302#
1278# Kernel hacking 1303# Kernel hacking
@@ -1298,22 +1323,11 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1298CONFIG_HAVE_DYNAMIC_FTRACE=y 1323CONFIG_HAVE_DYNAMIC_FTRACE=y
1299CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1324CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1300CONFIG_TRACING_SUPPORT=y 1325CONFIG_TRACING_SUPPORT=y
1301 1326# CONFIG_FTRACE is not set
1302#
1303# Tracers
1304#
1305# CONFIG_FUNCTION_TRACER is not set
1306# CONFIG_SCHED_TRACER is not set
1307# CONFIG_CONTEXT_SWITCH_TRACER is not set
1308# CONFIG_EVENT_TRACER is not set
1309# CONFIG_BOOT_TRACER is not set
1310# CONFIG_TRACE_BRANCH_PROFILING is not set
1311# CONFIG_STACK_TRACER is not set
1312# CONFIG_KMEMTRACE is not set
1313# CONFIG_WORKQUEUE_TRACER is not set
1314# CONFIG_BLK_DEV_IO_TRACE is not set
1315# CONFIG_SAMPLES is not set 1327# CONFIG_SAMPLES is not set
1316CONFIG_HAVE_ARCH_KGDB=y 1328CONFIG_HAVE_ARCH_KGDB=y
1329# CONFIG_PPC_DISABLE_WERROR is not set
1330CONFIG_PPC_WERROR=y
1317CONFIG_PRINT_STACK_DEPTH=64 1331CONFIG_PRINT_STACK_DEPTH=64
1318# CONFIG_IRQSTACKS is not set 1332# CONFIG_IRQSTACKS is not set
1319# CONFIG_BOOTX_TEXT is not set 1333# CONFIG_BOOTX_TEXT is not set
diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h
index 0815eb40acae..c9500d666a1d 100644
--- a/arch/powerpc/include/asm/pgalloc-32.h
+++ b/arch/powerpc/include/asm/pgalloc-32.h
@@ -16,7 +16,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
16 */ 16 */
17/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ 17/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */
18#define pmd_free(mm, x) do { } while (0) 18#define pmd_free(mm, x) do { } while (0)
19#define __pmd_free_tlb(tlb,x) do { } while (0) 19#define __pmd_free_tlb(tlb,x,a) do { } while (0)
20/* #define pgd_populate(mm, pmd, pte) BUG() */ 20/* #define pgd_populate(mm, pmd, pte) BUG() */
21 21
22#ifndef CONFIG_BOOKE 22#ifndef CONFIG_BOOKE
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
index afda2bdd860f..e6f069c4f713 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -118,11 +118,11 @@ static inline void pgtable_free(pgtable_free_t pgf)
118 kmem_cache_free(pgtable_cache[cachenum], p); 118 kmem_cache_free(pgtable_cache[cachenum], p);
119} 119}
120 120
121#define __pmd_free_tlb(tlb, pmd) \ 121#define __pmd_free_tlb(tlb, pmd,addr) \
122 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \ 122 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
123 PMD_CACHE_NUM, PMD_TABLE_SIZE-1)) 123 PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
124#ifndef CONFIG_PPC_64K_PAGES 124#ifndef CONFIG_PPC_64K_PAGES
125#define __pud_free_tlb(tlb, pud) \ 125#define __pud_free_tlb(tlb, pud, addr) \
126 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \ 126 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
127 PUD_CACHE_NUM, PUD_TABLE_SIZE-1)) 127 PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
128#endif /* CONFIG_PPC_64K_PAGES */ 128#endif /* CONFIG_PPC_64K_PAGES */
diff --git a/arch/powerpc/include/asm/pgalloc.h b/arch/powerpc/include/asm/pgalloc.h
index 5d8480265a77..1730e5e298d6 100644
--- a/arch/powerpc/include/asm/pgalloc.h
+++ b/arch/powerpc/include/asm/pgalloc.h
@@ -38,14 +38,14 @@ static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
38extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf); 38extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
39 39
40#ifdef CONFIG_SMP 40#ifdef CONFIG_SMP
41#define __pte_free_tlb(tlb,ptepage) \ 41#define __pte_free_tlb(tlb,ptepage,address) \
42do { \ 42do { \
43 pgtable_page_dtor(ptepage); \ 43 pgtable_page_dtor(ptepage); \
44 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \ 44 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
45 PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \ 45 PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \
46} while (0) 46} while (0)
47#else 47#else
48#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte)) 48#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, (pte))
49#endif 49#endif
50 50
51 51
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 9fa2c7dcd05a..ef149880c145 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -736,15 +736,16 @@ void user_disable_single_step(struct task_struct *task)
736{ 736{
737 struct pt_regs *regs = task->thread.regs; 737 struct pt_regs *regs = task->thread.regs;
738 738
739
740#if defined(CONFIG_BOOKE)
741 /* If DAC then do not single step, skip */
742 if (task->thread.dabr)
743 return;
744#endif
745
746 if (regs != NULL) { 739 if (regs != NULL) {
747#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 740#if defined(CONFIG_BOOKE)
741 /* If DAC don't clear DBCRO_IDM or MSR_DE */
742 if (task->thread.dabr)
743 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT);
744 else {
745 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
746 regs->msr &= ~MSR_DE;
747 }
748#elif defined(CONFIG_40x)
748 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); 749 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
749 regs->msr &= ~MSR_DE; 750 regs->msr &= ~MSR_DE;
750#else 751#else
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 297632cba047..8a6daf4129f6 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/ptrace.h> 25#include <linux/ptrace.h>
27#include <linux/regset.h> 26#include <linux/regset.h>
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index ef36cbbc5882..ea4d64644d02 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -80,10 +80,10 @@ _GLOBAL(load_up_altivec)
80 mtvscr vr0 80 mtvscr vr0
81 REST_32VRS(0,r4,r5) 81 REST_32VRS(0,r4,r5)
82#ifndef CONFIG_SMP 82#ifndef CONFIG_SMP
83 /* Update last_task_used_math to 'current' */ 83 /* Update last_task_used_altivec to 'current' */
84 subi r4,r5,THREAD /* Back to 'current' */ 84 subi r4,r5,THREAD /* Back to 'current' */
85 fromreal(r4) 85 fromreal(r4)
86 PPC_STL r4,ADDROFF(last_task_used_math)(r3) 86 PPC_STL r4,ADDROFF(last_task_used_altivec)(r3)
87#endif /* CONFIG_SMP */ 87#endif /* CONFIG_SMP */
88 /* restore registers and return */ 88 /* restore registers and return */
89 blr 89 blr
@@ -172,7 +172,7 @@ _GLOBAL(load_up_vsx)
172 oris r12,r12,MSR_VSX@h 172 oris r12,r12,MSR_VSX@h
173 std r12,_MSR(r1) 173 std r12,_MSR(r1)
174#ifndef CONFIG_SMP 174#ifndef CONFIG_SMP
175 /* Update last_task_used_math to 'current' */ 175 /* Update last_task_used_vsx to 'current' */
176 ld r4,PACACURRENT(r13) 176 ld r4,PACACURRENT(r13)
177 std r4,0(r3) 177 std r4,0(r3)
178#endif /* CONFIG_SMP */ 178#endif /* CONFIG_SMP */
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 9920d6a7cf29..c46ef2ffa3d9 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -305,7 +305,7 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
305 305
306 pmd = pmd_offset(pud, start); 306 pmd = pmd_offset(pud, start);
307 pud_clear(pud); 307 pud_clear(pud);
308 pmd_free_tlb(tlb, pmd); 308 pmd_free_tlb(tlb, pmd, start);
309} 309}
310 310
311static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, 311static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
@@ -348,7 +348,7 @@ static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
348 348
349 pud = pud_offset(pgd, start); 349 pud = pud_offset(pgd, start);
350 pgd_clear(pgd); 350 pgd_clear(pgd);
351 pud_free_tlb(tlb, pud); 351 pud_free_tlb(tlb, pud, start);
352} 352}
353 353
354/* 354/*
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 92a197117d5b..b1a727def15b 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -217,6 +217,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
217 id = steal_context_smp(id); 217 id = steal_context_smp(id);
218 if (id == MMU_NO_CONTEXT) 218 if (id == MMU_NO_CONTEXT)
219 goto again; 219 goto again;
220 goto stolen;
220 } 221 }
221#endif /* CONFIG_SMP */ 222#endif /* CONFIG_SMP */
222 id = steal_context_up(id); 223 id = steal_context_up(id);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 60ed9c067b1d..bfb32834ab0c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -233,6 +233,19 @@ static void __init mpc85xx_mds_setup_arch(void)
233 /* Turn UCC1 & UCC2 on */ 233 /* Turn UCC1 & UCC2 on */
234 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN); 234 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
235 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN); 235 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
236 } else if (machine_is(mpc8569_mds)) {
237#define BCSR7_UCC12_GETHnRST (0x1 << 2)
238#define BCSR8_UEM_MARVELL_RST (0x1 << 1)
239 /*
240 * U-Boot mangles interrupt polarity for Marvell PHYs,
241 * so reset built-in and UEM Marvell PHYs, this puts
242 * the PHYs into their normal state.
243 */
244 clrbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
245 setbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
246
247 setbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);
248 clrbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);
236 } 249 }
237 iounmap(bcsr_regs); 250 iounmap(bcsr_regs);
238 } 251 }
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index 3d8a96d39d9d..81150b053689 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -96,7 +96,8 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
96 * pte_free_tlb frees a pte table and clears the CRSTE for the 96 * pte_free_tlb frees a pte table and clears the CRSTE for the
97 * page table from the tlb. 97 * page table from the tlb.
98 */ 98 */
99static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte) 99static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
100 unsigned long address)
100{ 101{
101 if (!tlb->fullmm) { 102 if (!tlb->fullmm) {
102 tlb->array[tlb->nr_ptes++] = pte; 103 tlb->array[tlb->nr_ptes++] = pte;
@@ -113,7 +114,8 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte)
113 * as the pgd. pmd_free_tlb checks the asce_limit against 2GB 114 * as the pgd. pmd_free_tlb checks the asce_limit against 2GB
114 * to avoid the double free of the pmd in this case. 115 * to avoid the double free of the pmd in this case.
115 */ 116 */
116static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 117static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
118 unsigned long address)
117{ 119{
118#ifdef __s390x__ 120#ifdef __s390x__
119 if (tlb->mm->context.asce_limit <= (1UL << 31)) 121 if (tlb->mm->context.asce_limit <= (1UL << 31))
@@ -134,7 +136,8 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
134 * as the pgd. pud_free_tlb checks the asce_limit against 4TB 136 * as the pgd. pud_free_tlb checks the asce_limit against 4TB
135 * to avoid the double free of the pud in this case. 137 * to avoid the double free of the pud in this case.
136 */ 138 */
137static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) 139static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
140 unsigned long address)
138{ 141{
139#ifdef __s390x__ 142#ifdef __s390x__
140 if (tlb->mm->context.asce_limit <= (1UL << 42)) 143 if (tlb->mm->context.asce_limit <= (1UL << 42))
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index d2f270c995d9..db943a7ec513 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -15,7 +15,6 @@
15#include <linux/timer.h> 15#include <linux/timer.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/interrupt.h> 19#include <linux/interrupt.h>
21#include <linux/delay.h> 20#include <linux/delay.h>
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index f9b144049dc9..8d15314381e0 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -210,7 +210,7 @@ static noinline __init void detect_machine_type(void)
210 machine_flags |= MACHINE_FLAG_VM; 210 machine_flags |= MACHINE_FLAG_VM;
211} 211}
212 212
213static void early_pgm_check_handler(void) 213static __init void early_pgm_check_handler(void)
214{ 214{
215 unsigned long addr; 215 unsigned long addr;
216 const struct exception_table_entry *fixup; 216 const struct exception_table_entry *fixup;
@@ -222,7 +222,7 @@ static void early_pgm_check_handler(void)
222 S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE; 222 S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE;
223} 223}
224 224
225void setup_lowcore_early(void) 225static noinline __init void setup_lowcore_early(void)
226{ 226{
227 psw_t psw; 227 psw_t psw;
228 228
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 490b39934d65..43acd73105b7 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -26,7 +26,6 @@
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/smp.h> 28#include <linux/smp.h>
29#include <linux/smp_lock.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/ptrace.h> 30#include <linux/ptrace.h>
32#include <linux/user.h> 31#include <linux/user.h>
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 2270730f5354..be2cae083406 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -687,13 +687,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
687#ifndef CONFIG_64BIT 687#ifndef CONFIG_64BIT
688 if (MACHINE_HAS_IEEE) 688 if (MACHINE_HAS_IEEE)
689 lowcore->extended_save_area_addr = (u32) save_area; 689 lowcore->extended_save_area_addr = (u32) save_area;
690#else
691 if (vdso_alloc_per_cpu(smp_processor_id(), lowcore))
692 BUG();
693#endif 690#endif
694 set_prefix((u32)(unsigned long) lowcore); 691 set_prefix((u32)(unsigned long) lowcore);
695 local_mcck_enable(); 692 local_mcck_enable();
696 local_irq_enable(); 693 local_irq_enable();
694#ifdef CONFIG_64BIT
695 if (vdso_alloc_per_cpu(smp_processor_id(), &S390_lowcore))
696 BUG();
697#endif
697 for_each_possible_cpu(cpu) 698 for_each_possible_cpu(cpu)
698 if (cpu != smp_processor_id()) 699 if (cpu != smp_processor_id())
699 smp_create_idle(cpu); 700 smp_create_idle(cpu);
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S
index 79dbfee831ec..49106c6e6f88 100644
--- a/arch/s390/kernel/vdso64/clock_gettime.S
+++ b/arch/s390/kernel/vdso64/clock_gettime.S
@@ -88,10 +88,17 @@ __kernel_clock_gettime:
88 llilh %r4,0x0100 88 llilh %r4,0x0100
89 sar %a4,%r4 89 sar %a4,%r4
90 lghi %r4,0 90 lghi %r4,0
91 epsw %r5,0
91 sacf 512 /* Magic ectg instruction */ 92 sacf 512 /* Magic ectg instruction */
92 .insn ssf,0xc80100000000,__VDSO_ECTG_BASE(4),__VDSO_ECTG_USER(4),4 93 .insn ssf,0xc80100000000,__VDSO_ECTG_BASE(4),__VDSO_ECTG_USER(4),4
93 sacf 0 94 tml %r5,0x4000
94 sar %a4,%r2 95 jo 11f
96 tml %r5,0x8000
97 jno 10f
98 sacf 256
99 j 11f
10010: sacf 0
10111: sar %a4,%r2
95 algr %r1,%r0 /* r1 = cputime as TOD value */ 102 algr %r1,%r0 /* r1 = cputime as TOD value */
96 mghi %r1,1000 /* convert to nanoseconds */ 103 mghi %r1,1000 /* convert to nanoseconds */
97 srlg %r1,%r1,12 /* r1 = cputime in nanosec */ 104 srlg %r1,%r1,12 /* r1 = cputime in nanosec */
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 74eb26bf1970..e5e119fe03b2 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -22,7 +22,6 @@
22#include <linux/compat.h> 22#include <linux/compat.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/kdebug.h> 24#include <linux/kdebug.h>
25#include <linux/smp_lock.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/console.h> 26#include <linux/console.h>
28#include <linux/module.h> 27#include <linux/module.h>
diff --git a/arch/s390/power/swsusp.c b/arch/s390/power/swsusp.c
index e6a4fe9f5f24..bd1f5c6b0b8c 100644
--- a/arch/s390/power/swsusp.c
+++ b/arch/s390/power/swsusp.c
@@ -7,24 +7,36 @@
7 * 7 *
8 */ 8 */
9 9
10#include <asm/system.h>
10 11
11/*
12 * save CPU registers before creating a hibernation image and before
13 * restoring the memory state from it
14 */
15void save_processor_state(void) 12void save_processor_state(void)
16{ 13{
17 /* implentation contained in the 14 /* swsusp_arch_suspend() actually saves all cpu register contents.
18 * swsusp_arch_suspend function 15 * Machine checks must be disabled since swsusp_arch_suspend() stores
16 * register contents to their lowcore save areas. That's the same
17 * place where register contents on machine checks would be saved.
18 * To avoid register corruption disable machine checks.
19 * We must also disable machine checks in the new psw mask for
20 * program checks, since swsusp_arch_suspend() may generate program
21 * checks. Disabling machine checks for all other new psw masks is
22 * just paranoia.
19 */ 23 */
24 local_mcck_disable();
25 /* Disable lowcore protection */
26 __ctl_clear_bit(0,28);
27 S390_lowcore.external_new_psw.mask &= ~PSW_MASK_MCHECK;
28 S390_lowcore.svc_new_psw.mask &= ~PSW_MASK_MCHECK;
29 S390_lowcore.io_new_psw.mask &= ~PSW_MASK_MCHECK;
30 S390_lowcore.program_new_psw.mask &= ~PSW_MASK_MCHECK;
20} 31}
21 32
22/*
23 * restore the contents of CPU registers
24 */
25void restore_processor_state(void) 33void restore_processor_state(void)
26{ 34{
27 /* implentation contained in the 35 S390_lowcore.external_new_psw.mask |= PSW_MASK_MCHECK;
28 * swsusp_arch_resume function 36 S390_lowcore.svc_new_psw.mask |= PSW_MASK_MCHECK;
29 */ 37 S390_lowcore.io_new_psw.mask |= PSW_MASK_MCHECK;
38 S390_lowcore.program_new_psw.mask |= PSW_MASK_MCHECK;
39 /* Enable lowcore protection */
40 __ctl_set_bit(0,28);
41 local_mcck_enable();
30} 42}
diff --git a/arch/s390/power/swsusp_asm64.S b/arch/s390/power/swsusp_asm64.S
index 76d688da32fa..b26df5c5933e 100644
--- a/arch/s390/power/swsusp_asm64.S
+++ b/arch/s390/power/swsusp_asm64.S
@@ -32,19 +32,14 @@ swsusp_arch_suspend:
32 /* Deactivate DAT */ 32 /* Deactivate DAT */
33 stnsm __SF_EMPTY(%r15),0xfb 33 stnsm __SF_EMPTY(%r15),0xfb
34 34
35 /* Switch off lowcore protection */
36 stctg %c0,%c0,__SF_EMPTY(%r15)
37 ni __SF_EMPTY+4(%r15),0xef
38 lctlg %c0,%c0,__SF_EMPTY(%r15)
39
40 /* Store prefix register on stack */ 35 /* Store prefix register on stack */
41 stpx __SF_EMPTY(%r15) 36 stpx __SF_EMPTY(%r15)
42 37
43 /* Setup base register for lowcore (absolute 0) */ 38 /* Save prefix register contents for lowcore */
44 llgf %r1,__SF_EMPTY(%r15) 39 llgf %r4,__SF_EMPTY(%r15)
45 40
46 /* Get pointer to save area */ 41 /* Get pointer to save area */
47 aghi %r1,0x1000 42 lghi %r1,0x1000
48 43
49 /* Store registers */ 44 /* Store registers */
50 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ 45 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */
@@ -79,17 +74,15 @@ swsusp_arch_suspend:
79 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15) 74 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
80 spx __SF_EMPTY(%r15) 75 spx __SF_EMPTY(%r15)
81 76
82 /* Setup lowcore */ 77 lghi %r2,0
83 brasl %r14,setup_lowcore_early 78 lghi %r3,2*PAGE_SIZE
79 lghi %r5,2*PAGE_SIZE
801: mvcle %r2,%r4,0
81 jo 1b
84 82
85 /* Save image */ 83 /* Save image */
86 brasl %r14,swsusp_save 84 brasl %r14,swsusp_save
87 85
88 /* Switch on lowcore protection */
89 stctg %c0,%c0,__SF_EMPTY(%r15)
90 oi __SF_EMPTY+4(%r15),0x10
91 lctlg %c0,%c0,__SF_EMPTY(%r15)
92
93 /* Restore prefix register and return */ 86 /* Restore prefix register and return */
94 lghi %r1,0x1000 87 lghi %r1,0x1000
95 spx 0x318(%r1) 88 spx 0x318(%r1)
@@ -117,11 +110,6 @@ swsusp_arch_resume:
117 /* Deactivate DAT */ 110 /* Deactivate DAT */
118 stnsm __SF_EMPTY(%r15),0xfb 111 stnsm __SF_EMPTY(%r15),0xfb
119 112
120 /* Switch off lowcore protection */
121 stctg %c0,%c0,__SF_EMPTY(%r15)
122 ni __SF_EMPTY+4(%r15),0xef
123 lctlg %c0,%c0,__SF_EMPTY(%r15)
124
125 /* Set prefix page to zero */ 113 /* Set prefix page to zero */
126 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15) 114 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
127 spx __SF_EMPTY(%r15) 115 spx __SF_EMPTY(%r15)
@@ -175,7 +163,7 @@ swsusp_arch_resume:
175 /* Load old stack */ 163 /* Load old stack */
176 lg %r15,0x2f8(%r13) 164 lg %r15,0x2f8(%r13)
177 165
178 /* Pointer to save arae */ 166 /* Pointer to save area */
179 lghi %r13,0x1000 167 lghi %r13,0x1000
180 168
181#ifdef CONFIG_SMP 169#ifdef CONFIG_SMP
@@ -187,11 +175,6 @@ swsusp_arch_resume:
187 /* Restore prefix register */ 175 /* Restore prefix register */
188 spx 0x318(%r13) 176 spx 0x318(%r13)
189 177
190 /* Switch on lowcore protection */
191 stctg %c0,%c0,__SF_EMPTY(%r15)
192 oi __SF_EMPTY+4(%r15),0x10
193 lctlg %c0,%c0,__SF_EMPTY(%r15)
194
195 /* Activate DAT */ 178 /* Activate DAT */
196 stosm __SF_EMPTY(%r15),0x04 179 stosm __SF_EMPTY(%r15),0x04
197 180
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index 84dd2db7104c..63ca37bd9a95 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -73,20 +73,12 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
73 quicklist_free_page(QUICK_PT, NULL, pte); 73 quicklist_free_page(QUICK_PT, NULL, pte);
74} 74}
75 75
76#define __pte_free_tlb(tlb,pte) \ 76#define __pte_free_tlb(tlb,pte,addr) \
77do { \ 77do { \
78 pgtable_page_dtor(pte); \ 78 pgtable_page_dtor(pte); \
79 tlb_remove_page((tlb), (pte)); \ 79 tlb_remove_page((tlb), (pte)); \
80} while (0) 80} while (0)
81 81
82/*
83 * allocating and freeing a pmd is trivial: the 1-entry pmd is
84 * inside the pgd, so has no extra memory associated with it.
85 */
86
87#define pmd_free(mm, x) do { } while (0)
88#define __pmd_free_tlb(tlb,x) do { } while (0)
89
90static inline void check_pgt_cache(void) 82static inline void check_pgt_cache(void)
91{ 83{
92 quicklist_trim(QUICK_PGD, NULL, 25, 16); 84 quicklist_trim(QUICK_PGD, NULL, 25, 16);
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index 9c16f737074a..da8fe7ab8728 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -91,9 +91,9 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
91} 91}
92 92
93#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 93#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
94#define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep) 94#define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep)
95#define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp) 95#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)
96#define pud_free_tlb(tlb, pudp) pud_free((tlb)->mm, pudp) 96#define pud_free_tlb(tlb, pudp, addr) pud_free((tlb)->mm, pudp)
97 97
98#define tlb_migrate_finish(mm) do { } while (0) 98#define tlb_migrate_finish(mm) do { } while (0)
99 99
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 7fbfd5a11ffa..17cb7c3adf22 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -18,7 +18,6 @@
18#include <linux/mman.h> 18#include <linux/mman.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/interrupt.h> 21#include <linux/interrupt.h>
23 22
24#include <asm/system.h> 23#include <asm/system.h>
diff --git a/arch/sparc/include/asm/pgalloc_32.h b/arch/sparc/include/asm/pgalloc_32.h
index 681582d26969..ca2b34456c4b 100644
--- a/arch/sparc/include/asm/pgalloc_32.h
+++ b/arch/sparc/include/asm/pgalloc_32.h
@@ -44,8 +44,8 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long)
44BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) 44BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *)
45#define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) 45#define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd)
46 46
47#define pmd_free(mm, pmd) free_pmd_fast(pmd) 47#define pmd_free(mm, pmd) free_pmd_fast(pmd)
48#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd) 48#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd)
49 49
50BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) 50BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *)
51#define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) 51#define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE)
@@ -62,7 +62,7 @@ BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *)
62#define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte) 62#define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte)
63 63
64BTFIXUPDEF_CALL(void, pte_free, pgtable_t ) 64BTFIXUPDEF_CALL(void, pte_free, pgtable_t )
65#define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte) 65#define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte)
66#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 66#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte)
67 67
68#endif /* _SPARC_PGALLOC_H */ 68#endif /* _SPARC_PGALLOC_H */
diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_64.h
index ee38e731bfa6..dca406b9b6fc 100644
--- a/arch/sparc/include/asm/tlb_64.h
+++ b/arch/sparc/include/asm/tlb_64.h
@@ -100,9 +100,9 @@ static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page)
100} 100}
101 101
102#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) 102#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0)
103#define pte_free_tlb(mp, ptepage) pte_free((mp)->mm, ptepage) 103#define pte_free_tlb(mp, ptepage, addr) pte_free((mp)->mm, ptepage)
104#define pmd_free_tlb(mp, pmdp) pmd_free((mp)->mm, pmdp) 104#define pmd_free_tlb(mp, pmdp, addr) pmd_free((mp)->mm, pmdp)
105#define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) 105#define pud_free_tlb(tlb,pudp, addr) __pud_free_tlb(tlb,pudp,addr)
106 106
107#define tlb_migrate_finish(mm) do { } while (0) 107#define tlb_migrate_finish(mm) do { } while (0)
108#define tlb_start_vma(tlb, vma) do { } while (0) 108#define tlb_start_vma(tlb, vma) do { } while (0)
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
index 8ce6285a06d5..7e3dfd9bb97e 100644
--- a/arch/sparc/kernel/ptrace_32.c
+++ b/arch/sparc/kernel/ptrace_32.c
@@ -16,7 +16,6 @@
16#include <linux/ptrace.h> 16#include <linux/ptrace.h>
17#include <linux/user.h> 17#include <linux/user.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h>
20#include <linux/security.h> 19#include <linux/security.h>
21#include <linux/signal.h> 20#include <linux/signal.h>
22#include <linux/regset.h> 21#include <linux/regset.h>
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c
index a941c610e7ce..4ae91dc2feb9 100644
--- a/arch/sparc/kernel/ptrace_64.c
+++ b/arch/sparc/kernel/ptrace_64.c
@@ -17,7 +17,6 @@
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/user.h> 18#include <linux/user.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/security.h> 20#include <linux/security.h>
22#include <linux/seccomp.h> 21#include <linux/seccomp.h>
23#include <linux/audit.h> 22#include <linux/audit.h>
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 5c12e79b4bdf..da1218e8ee87 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -11,7 +11,6 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/smp_lock.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/param.h> 15#include <linux/param.h>
17#include <linux/string.h> 16#include <linux/string.h>
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 358283341b47..c0490c7bbde0 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/signal.h> 14#include <linux/signal.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/kdebug.h> 16#include <linux/kdebug.h>
18 17
19#include <asm/delay.h> 18#include <asm/delay.h>
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 753d128ed158..c28c71449a6c 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -224,7 +224,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
224 if (!strcmp(type, "domain-services-port")) 224 if (!strcmp(type, "domain-services-port"))
225 bus_id_name = "ds"; 225 bus_id_name = "ds";
226 226
227 if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) { 227 /*
228 * 20 char is the old driver-core name size limit, which is no more.
229 * This check can probably be removed after review and possible
230 * adaption of the vio users name length handling.
231 */
232 if (strlen(bus_id_name) >= 20 - 4) {
228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n", 233 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
229 bus_id_name); 234 bus_id_name);
230 return NULL; 235 return NULL;
diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h
index 718984359f8c..32c8ce4e1515 100644
--- a/arch/um/include/asm/pgalloc.h
+++ b/arch/um/include/asm/pgalloc.h
@@ -40,7 +40,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
40 __free_page(pte); 40 __free_page(pte);
41} 41}
42 42
43#define __pte_free_tlb(tlb,pte) \ 43#define __pte_free_tlb(tlb,pte, address) \
44do { \ 44do { \
45 pgtable_page_dtor(pte); \ 45 pgtable_page_dtor(pte); \
46 tlb_remove_page((tlb),(pte)); \ 46 tlb_remove_page((tlb),(pte)); \
@@ -53,7 +53,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
53 free_page((unsigned long)pmd); 53 free_page((unsigned long)pmd);
54} 54}
55 55
56#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 56#define __pmd_free_tlb(tlb,x, address) tlb_remove_page((tlb),virt_to_page(x))
57#endif 57#endif
58 58
59#define check_pgt_cache() do { } while (0) 59#define check_pgt_cache() do { } while (0)
diff --git a/arch/um/include/asm/tlb.h b/arch/um/include/asm/tlb.h
index 5240fa1c5e08..660caedac9eb 100644
--- a/arch/um/include/asm/tlb.h
+++ b/arch/um/include/asm/tlb.h
@@ -116,11 +116,11 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
116 __tlb_remove_tlb_entry(tlb, ptep, address); \ 116 __tlb_remove_tlb_entry(tlb, ptep, address); \
117 } while (0) 117 } while (0)
118 118
119#define pte_free_tlb(tlb, ptep) __pte_free_tlb(tlb, ptep) 119#define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr)
120 120
121#define pud_free_tlb(tlb, pudp) __pud_free_tlb(tlb, pudp) 121#define pud_free_tlb(tlb, pudp, addr) __pud_free_tlb(tlb, pudp, addr)
122 122
123#define pmd_free_tlb(tlb, pmdp) __pmd_free_tlb(tlb, pmdp) 123#define pmd_free_tlb(tlb, pmdp, addr) __pmd_free_tlb(tlb, pmdp, addr)
124 124
125#define tlb_migrate_finish(mm) do {} while (0) 125#define tlb_migrate_finish(mm) do {} while (0)
126 126
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index daf866ed0612..330ee807f89e 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -161,6 +161,7 @@ extern int io_apic_set_pci_routing(struct device *dev, int irq,
161 struct io_apic_irq_attr *irq_attr); 161 struct io_apic_irq_attr *irq_attr);
162extern int (*ioapic_renumber_irq)(int ioapic, int irq); 162extern int (*ioapic_renumber_irq)(int ioapic, int irq);
163extern void ioapic_init_mappings(void); 163extern void ioapic_init_mappings(void);
164extern void ioapic_insert_resources(void);
164 165
165extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); 166extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
166extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); 167extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
@@ -180,6 +181,7 @@ extern void ioapic_write_entry(int apic, int pin,
180#define io_apic_assign_pci_irqs 0 181#define io_apic_assign_pci_irqs 0
181static const int timer_through_8259 = 0; 182static const int timer_through_8259 = 0;
182static inline void ioapic_init_mappings(void) { } 183static inline void ioapic_init_mappings(void) { }
184static inline void ioapic_insert_resources(void) { }
183 185
184static inline void probe_nr_irqs_gsi(void) { } 186static inline void probe_nr_irqs_gsi(void) { }
185#endif 187#endif
diff --git a/arch/x86/include/asm/lguest.h b/arch/x86/include/asm/lguest.h
index 313389cd50d2..5136dad57cbb 100644
--- a/arch/x86/include/asm/lguest.h
+++ b/arch/x86/include/asm/lguest.h
@@ -17,8 +17,7 @@
17/* Pages for switcher itself, then two pages per cpu */ 17/* Pages for switcher itself, then two pages per cpu */
18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids) 18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids)
19 19
20/* We map at -4M (-2M when PAE is activated) for ease of mapping 20/* We map at -4M (-2M for PAE) for ease of mapping (one PTE page). */
21 * into the guest (one PTE page). */
22#ifdef CONFIG_X86_PAE 21#ifdef CONFIG_X86_PAE
23#define SWITCHER_ADDR 0xFFE00000 22#define SWITCHER_ADDR 0xFFE00000
24#else 23#else
diff --git a/arch/x86/include/asm/lguest_hcall.h b/arch/x86/include/asm/lguest_hcall.h
index d31c4a684078..ba0eed8aa1a6 100644
--- a/arch/x86/include/asm/lguest_hcall.h
+++ b/arch/x86/include/asm/lguest_hcall.h
@@ -30,27 +30,27 @@
30#include <asm/hw_irq.h> 30#include <asm/hw_irq.h>
31#include <asm/kvm_para.h> 31#include <asm/kvm_para.h>
32 32
33/*G:031 But first, how does our Guest contact the Host to ask for privileged 33/*G:030
34 * But first, how does our Guest contact the Host to ask for privileged
34 * operations? There are two ways: the direct way is to make a "hypercall", 35 * operations? There are two ways: the direct way is to make a "hypercall",
35 * to make requests of the Host Itself. 36 * to make requests of the Host Itself.
36 * 37 *
37 * We use the KVM hypercall mechanism. Seventeen hypercalls are 38 * We use the KVM hypercall mechanism, though completely different hypercall
38 * available: the hypercall number is put in the %eax register, and the 39 * numbers. Seventeen hypercalls are available: the hypercall number is put in
39 * arguments (when required) are placed in %ebx, %ecx, %edx and %esi. 40 * the %eax register, and the arguments (when required) are placed in %ebx,
40 * If a return value makes sense, it's returned in %eax. 41 * %ecx, %edx and %esi. If a return value makes sense, it's returned in %eax.
41 * 42 *
42 * Grossly invalid calls result in Sudden Death at the hands of the vengeful 43 * Grossly invalid calls result in Sudden Death at the hands of the vengeful
43 * Host, rather than returning failure. This reflects Winston Churchill's 44 * Host, rather than returning failure. This reflects Winston Churchill's
44 * definition of a gentleman: "someone who is only rude intentionally". */ 45 * definition of a gentleman: "someone who is only rude intentionally".
45/*:*/ 46:*/
46 47
47/* Can't use our min() macro here: needs to be a constant */ 48/* Can't use our min() macro here: needs to be a constant */
48#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32) 49#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
49 50
50#define LHCALL_RING_SIZE 64 51#define LHCALL_RING_SIZE 64
51struct hcall_args { 52struct hcall_args {
52 /* These map directly onto eax, ebx, ecx, edx and esi 53 /* These map directly onto eax/ebx/ecx/edx/esi in struct lguest_regs */
53 * in struct lguest_regs */
54 unsigned long arg0, arg1, arg2, arg3, arg4; 54 unsigned long arg0, arg1, arg2, arg3, arg4;
55}; 55};
56 56
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
index dd14c54ac718..0e8c2a0fd922 100644
--- a/arch/x86/include/asm/pgalloc.h
+++ b/arch/x86/include/asm/pgalloc.h
@@ -46,7 +46,13 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte)
46 __free_page(pte); 46 __free_page(pte);
47} 47}
48 48
49extern void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte); 49extern void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte);
50
51static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte,
52 unsigned long address)
53{
54 ___pte_free_tlb(tlb, pte);
55}
50 56
51static inline void pmd_populate_kernel(struct mm_struct *mm, 57static inline void pmd_populate_kernel(struct mm_struct *mm,
52 pmd_t *pmd, pte_t *pte) 58 pmd_t *pmd, pte_t *pte)
@@ -78,7 +84,13 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
78 free_page((unsigned long)pmd); 84 free_page((unsigned long)pmd);
79} 85}
80 86
81extern void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd); 87extern void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd);
88
89static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
90 unsigned long adddress)
91{
92 ___pmd_free_tlb(tlb, pmd);
93}
82 94
83#ifdef CONFIG_X86_PAE 95#ifdef CONFIG_X86_PAE
84extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); 96extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
@@ -108,7 +120,14 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud)
108 free_page((unsigned long)pud); 120 free_page((unsigned long)pud);
109} 121}
110 122
111extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud); 123extern void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud);
124
125static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
126 unsigned long address)
127{
128 ___pud_free_tlb(tlb, pud);
129}
130
112#endif /* PAGETABLE_LEVELS > 3 */ 131#endif /* PAGETABLE_LEVELS > 3 */
113#endif /* PAGETABLE_LEVELS > 2 */ 132#endif /* PAGETABLE_LEVELS > 2 */
114 133
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 20e6a795e160..d2c6c930b491 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -212,9 +212,9 @@ extern int __get_user_bad(void);
212 : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") 212 : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
213#else 213#else
214#define __put_user_asm_u64(x, ptr, retval, errret) \ 214#define __put_user_asm_u64(x, ptr, retval, errret) \
215 __put_user_asm(x, ptr, retval, "q", "", "Zr", errret) 215 __put_user_asm(x, ptr, retval, "q", "", "er", errret)
216#define __put_user_asm_ex_u64(x, addr) \ 216#define __put_user_asm_ex_u64(x, addr) \
217 __put_user_asm_ex(x, addr, "q", "", "Zr") 217 __put_user_asm_ex(x, addr, "q", "", "er")
218#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu) 218#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu)
219#endif 219#endif
220 220
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index 8cc687326eb8..db24b215fc50 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -88,11 +88,11 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
88 ret, "l", "k", "ir", 4); 88 ret, "l", "k", "ir", 4);
89 return ret; 89 return ret;
90 case 8:__put_user_asm(*(u64 *)src, (u64 __user *)dst, 90 case 8:__put_user_asm(*(u64 *)src, (u64 __user *)dst,
91 ret, "q", "", "ir", 8); 91 ret, "q", "", "er", 8);
92 return ret; 92 return ret;
93 case 10: 93 case 10:
94 __put_user_asm(*(u64 *)src, (u64 __user *)dst, 94 __put_user_asm(*(u64 *)src, (u64 __user *)dst,
95 ret, "q", "", "ir", 10); 95 ret, "q", "", "er", 10);
96 if (unlikely(ret)) 96 if (unlikely(ret))
97 return ret; 97 return ret;
98 asm("":::"memory"); 98 asm("":::"memory");
@@ -101,12 +101,12 @@ int __copy_to_user(void __user *dst, const void *src, unsigned size)
101 return ret; 101 return ret;
102 case 16: 102 case 16:
103 __put_user_asm(*(u64 *)src, (u64 __user *)dst, 103 __put_user_asm(*(u64 *)src, (u64 __user *)dst,
104 ret, "q", "", "ir", 16); 104 ret, "q", "", "er", 16);
105 if (unlikely(ret)) 105 if (unlikely(ret))
106 return ret; 106 return ret;
107 asm("":::"memory"); 107 asm("":::"memory");
108 __put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst, 108 __put_user_asm(1[(u64 *)src], 1 + (u64 __user *)dst,
109 ret, "q", "", "ir", 8); 109 ret, "q", "", "er", 8);
110 return ret; 110 return ret;
111 default: 111 default:
112 return copy_user_generic((__force void *)dst, src, size); 112 return copy_user_generic((__force void *)dst, src, size);
@@ -157,7 +157,7 @@ int __copy_in_user(void __user *dst, const void __user *src, unsigned size)
157 ret, "q", "", "=r", 8); 157 ret, "q", "", "=r", 8);
158 if (likely(!ret)) 158 if (likely(!ret))
159 __put_user_asm(tmp, (u64 __user *)dst, 159 __put_user_asm(tmp, (u64 __user *)dst,
160 ret, "q", "", "ir", 8); 160 ret, "q", "", "er", 8);
161 return ret; 161 return ret;
162 } 162 }
163 default: 163 default:
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index 69328ac8de9c..8952a5890281 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -652,7 +652,8 @@ static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
652 return ret && es7000_apic_is_cluster(); 652 return ret && es7000_apic_is_cluster();
653} 653}
654 654
655struct apic apic_es7000_cluster = { 655/* We've been warned by a false positive warning.Use __refdata to keep calm. */
656struct apic __refdata apic_es7000_cluster = {
656 657
657 .name = "es7000", 658 .name = "es7000",
658 .probe = probe_es7000, 659 .probe = probe_es7000,
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 90b5e6efa938..2284a4812b68 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -4181,28 +4181,20 @@ fake_ioapic_page:
4181 } 4181 }
4182} 4182}
4183 4183
4184static int __init ioapic_insert_resources(void) 4184void __init ioapic_insert_resources(void)
4185{ 4185{
4186 int i; 4186 int i;
4187 struct resource *r = ioapic_resources; 4187 struct resource *r = ioapic_resources;
4188 4188
4189 if (!r) { 4189 if (!r) {
4190 if (nr_ioapics > 0) { 4190 if (nr_ioapics > 0)
4191 printk(KERN_ERR 4191 printk(KERN_ERR
4192 "IO APIC resources couldn't be allocated.\n"); 4192 "IO APIC resources couldn't be allocated.\n");
4193 return -1; 4193 return;
4194 }
4195 return 0;
4196 } 4194 }
4197 4195
4198 for (i = 0; i < nr_ioapics; i++) { 4196 for (i = 0; i < nr_ioapics; i++) {
4199 insert_resource(&iomem_resource, r); 4197 insert_resource(&iomem_resource, r);
4200 r++; 4198 r++;
4201 } 4199 }
4202
4203 return 0;
4204} 4200}
4205
4206/* Insert the IO APIC resources after PCI initialization has occured to handle
4207 * IO APICS that are mapped in on a BAR in PCI space. */
4208late_initcall(ioapic_insert_resources);
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index 533e59c6fc82..ca96e68f0d23 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -493,7 +493,8 @@ static void numaq_setup_portio_remap(void)
493 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); 493 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
494} 494}
495 495
496struct apic apic_numaq = { 496/* Use __refdata to keep false positive warning calm. */
497struct apic __refdata apic_numaq = {
497 498
498 .name = "NUMAQ", 499 .name = "NUMAQ",
499 .probe = probe_numaq, 500 .probe = probe_numaq,
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 28e5f5956042..e2485b03f1cf 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -356,7 +356,7 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
356#endif 356#endif
357#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) 357#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
358 /* check CPU config space for extended APIC ID */ 358 /* check CPU config space for extended APIC ID */
359 if (c->x86 >= 0xf) { 359 if (cpu_has_apic && c->x86 >= 0xf) {
360 unsigned int val; 360 unsigned int val;
361 val = read_pci_config(0, 24, 0, 0x68); 361 val = read_pci_config(0, 24, 0, 0x68);
362 if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18))) 362 if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18)))
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 484c1e5f658e..1cfb623ce11c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1692,17 +1692,15 @@ static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
1692 const char *buf, size_t siz) 1692 const char *buf, size_t siz)
1693{ 1693{
1694 char *p; 1694 char *p;
1695 int len;
1696 1695
1697 strncpy(mce_helper, buf, sizeof(mce_helper)); 1696 strncpy(mce_helper, buf, sizeof(mce_helper));
1698 mce_helper[sizeof(mce_helper)-1] = 0; 1697 mce_helper[sizeof(mce_helper)-1] = 0;
1699 len = strlen(mce_helper);
1700 p = strchr(mce_helper, '\n'); 1698 p = strchr(mce_helper, '\n');
1701 1699
1702 if (*p) 1700 if (p)
1703 *p = 0; 1701 *p = 0;
1704 1702
1705 return len; 1703 return strlen(mce_helper) + !!p;
1706} 1704}
1707 1705
1708static ssize_t set_ignore_ce(struct sys_device *s, 1706static ssize_t set_ignore_ce(struct sys_device *s,
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 36c3dc7b8991..a7aa8f900954 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -66,6 +66,52 @@ static DEFINE_PER_CPU(struct cpu_hw_counters, cpu_hw_counters) = {
66}; 66};
67 67
68/* 68/*
69 * Not sure about some of these
70 */
71static const u64 p6_perfmon_event_map[] =
72{
73 [PERF_COUNT_HW_CPU_CYCLES] = 0x0079,
74 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
75 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0000,
76 [PERF_COUNT_HW_CACHE_MISSES] = 0x0000,
77 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
78 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
79 [PERF_COUNT_HW_BUS_CYCLES] = 0x0062,
80};
81
82static u64 p6_pmu_event_map(int event)
83{
84 return p6_perfmon_event_map[event];
85}
86
87/*
88 * Counter setting that is specified not to count anything.
89 * We use this to effectively disable a counter.
90 *
91 * L2_RQSTS with 0 MESI unit mask.
92 */
93#define P6_NOP_COUNTER 0x0000002EULL
94
95static u64 p6_pmu_raw_event(u64 event)
96{
97#define P6_EVNTSEL_EVENT_MASK 0x000000FFULL
98#define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL
99#define P6_EVNTSEL_EDGE_MASK 0x00040000ULL
100#define P6_EVNTSEL_INV_MASK 0x00800000ULL
101#define P6_EVNTSEL_COUNTER_MASK 0xFF000000ULL
102
103#define P6_EVNTSEL_MASK \
104 (P6_EVNTSEL_EVENT_MASK | \
105 P6_EVNTSEL_UNIT_MASK | \
106 P6_EVNTSEL_EDGE_MASK | \
107 P6_EVNTSEL_INV_MASK | \
108 P6_EVNTSEL_COUNTER_MASK)
109
110 return event & P6_EVNTSEL_MASK;
111}
112
113
114/*
69 * Intel PerfMon v3. Used on Core2 and later. 115 * Intel PerfMon v3. Used on Core2 and later.
70 */ 116 */
71static const u64 intel_perfmon_event_map[] = 117static const u64 intel_perfmon_event_map[] =
@@ -666,6 +712,7 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
666{ 712{
667 struct perf_counter_attr *attr = &counter->attr; 713 struct perf_counter_attr *attr = &counter->attr;
668 struct hw_perf_counter *hwc = &counter->hw; 714 struct hw_perf_counter *hwc = &counter->hw;
715 u64 config;
669 int err; 716 int err;
670 717
671 if (!x86_pmu_initialized()) 718 if (!x86_pmu_initialized())
@@ -718,14 +765,40 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
718 765
719 if (attr->config >= x86_pmu.max_events) 766 if (attr->config >= x86_pmu.max_events)
720 return -EINVAL; 767 return -EINVAL;
768
721 /* 769 /*
722 * The generic map: 770 * The generic map:
723 */ 771 */
724 hwc->config |= x86_pmu.event_map(attr->config); 772 config = x86_pmu.event_map(attr->config);
773
774 if (config == 0)
775 return -ENOENT;
776
777 if (config == -1LL)
778 return -EINVAL;
779
780 hwc->config |= config;
725 781
726 return 0; 782 return 0;
727} 783}
728 784
785static void p6_pmu_disable_all(void)
786{
787 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
788 u64 val;
789
790 if (!cpuc->enabled)
791 return;
792
793 cpuc->enabled = 0;
794 barrier();
795
796 /* p6 only has one enable register */
797 rdmsrl(MSR_P6_EVNTSEL0, val);
798 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
799 wrmsrl(MSR_P6_EVNTSEL0, val);
800}
801
729static void intel_pmu_disable_all(void) 802static void intel_pmu_disable_all(void)
730{ 803{
731 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); 804 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
@@ -767,6 +840,23 @@ void hw_perf_disable(void)
767 return x86_pmu.disable_all(); 840 return x86_pmu.disable_all();
768} 841}
769 842
843static void p6_pmu_enable_all(void)
844{
845 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
846 unsigned long val;
847
848 if (cpuc->enabled)
849 return;
850
851 cpuc->enabled = 1;
852 barrier();
853
854 /* p6 only has one enable register */
855 rdmsrl(MSR_P6_EVNTSEL0, val);
856 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
857 wrmsrl(MSR_P6_EVNTSEL0, val);
858}
859
770static void intel_pmu_enable_all(void) 860static void intel_pmu_enable_all(void)
771{ 861{
772 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl); 862 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
@@ -784,13 +874,13 @@ static void amd_pmu_enable_all(void)
784 barrier(); 874 barrier();
785 875
786 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 876 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
877 struct perf_counter *counter = cpuc->counters[idx];
787 u64 val; 878 u64 val;
788 879
789 if (!test_bit(idx, cpuc->active_mask)) 880 if (!test_bit(idx, cpuc->active_mask))
790 continue; 881 continue;
791 rdmsrl(MSR_K7_EVNTSEL0 + idx, val); 882
792 if (val & ARCH_PERFMON_EVENTSEL0_ENABLE) 883 val = counter->hw.config;
793 continue;
794 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 884 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
795 wrmsrl(MSR_K7_EVNTSEL0 + idx, val); 885 wrmsrl(MSR_K7_EVNTSEL0 + idx, val);
796 } 886 }
@@ -819,16 +909,13 @@ static inline void intel_pmu_ack_status(u64 ack)
819 909
820static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) 910static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
821{ 911{
822 int err; 912 (void)checking_wrmsrl(hwc->config_base + idx,
823 err = checking_wrmsrl(hwc->config_base + idx,
824 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE); 913 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE);
825} 914}
826 915
827static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx) 916static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
828{ 917{
829 int err; 918 (void)checking_wrmsrl(hwc->config_base + idx, hwc->config);
830 err = checking_wrmsrl(hwc->config_base + idx,
831 hwc->config);
832} 919}
833 920
834static inline void 921static inline void
@@ -836,13 +923,24 @@ intel_pmu_disable_fixed(struct hw_perf_counter *hwc, int __idx)
836{ 923{
837 int idx = __idx - X86_PMC_IDX_FIXED; 924 int idx = __idx - X86_PMC_IDX_FIXED;
838 u64 ctrl_val, mask; 925 u64 ctrl_val, mask;
839 int err;
840 926
841 mask = 0xfULL << (idx * 4); 927 mask = 0xfULL << (idx * 4);
842 928
843 rdmsrl(hwc->config_base, ctrl_val); 929 rdmsrl(hwc->config_base, ctrl_val);
844 ctrl_val &= ~mask; 930 ctrl_val &= ~mask;
845 err = checking_wrmsrl(hwc->config_base, ctrl_val); 931 (void)checking_wrmsrl(hwc->config_base, ctrl_val);
932}
933
934static inline void
935p6_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
936{
937 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
938 u64 val = P6_NOP_COUNTER;
939
940 if (cpuc->enabled)
941 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
942
943 (void)checking_wrmsrl(hwc->config_base + idx, val);
846} 944}
847 945
848static inline void 946static inline void
@@ -943,6 +1041,19 @@ intel_pmu_enable_fixed(struct hw_perf_counter *hwc, int __idx)
943 err = checking_wrmsrl(hwc->config_base, ctrl_val); 1041 err = checking_wrmsrl(hwc->config_base, ctrl_val);
944} 1042}
945 1043
1044static void p6_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
1045{
1046 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
1047 u64 val;
1048
1049 val = hwc->config;
1050 if (cpuc->enabled)
1051 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
1052
1053 (void)checking_wrmsrl(hwc->config_base + idx, val);
1054}
1055
1056
946static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) 1057static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
947{ 1058{
948 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) { 1059 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) {
@@ -959,8 +1070,6 @@ static void amd_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
959 1070
960 if (cpuc->enabled) 1071 if (cpuc->enabled)
961 x86_pmu_enable_counter(hwc, idx); 1072 x86_pmu_enable_counter(hwc, idx);
962 else
963 x86_pmu_disable_counter(hwc, idx);
964} 1073}
965 1074
966static int 1075static int
@@ -1176,6 +1285,49 @@ static void intel_pmu_reset(void)
1176 local_irq_restore(flags); 1285 local_irq_restore(flags);
1177} 1286}
1178 1287
1288static int p6_pmu_handle_irq(struct pt_regs *regs)
1289{
1290 struct perf_sample_data data;
1291 struct cpu_hw_counters *cpuc;
1292 struct perf_counter *counter;
1293 struct hw_perf_counter *hwc;
1294 int idx, handled = 0;
1295 u64 val;
1296
1297 data.regs = regs;
1298 data.addr = 0;
1299
1300 cpuc = &__get_cpu_var(cpu_hw_counters);
1301
1302 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1303 if (!test_bit(idx, cpuc->active_mask))
1304 continue;
1305
1306 counter = cpuc->counters[idx];
1307 hwc = &counter->hw;
1308
1309 val = x86_perf_counter_update(counter, hwc, idx);
1310 if (val & (1ULL << (x86_pmu.counter_bits - 1)))
1311 continue;
1312
1313 /*
1314 * counter overflow
1315 */
1316 handled = 1;
1317 data.period = counter->hw.last_period;
1318
1319 if (!x86_perf_counter_set_period(counter, hwc, idx))
1320 continue;
1321
1322 if (perf_counter_overflow(counter, 1, &data))
1323 p6_pmu_disable_counter(hwc, idx);
1324 }
1325
1326 if (handled)
1327 inc_irq_stat(apic_perf_irqs);
1328
1329 return handled;
1330}
1179 1331
1180/* 1332/*
1181 * This handler is triggered by the local APIC, so the APIC IRQ handling 1333 * This handler is triggered by the local APIC, so the APIC IRQ handling
@@ -1185,14 +1337,13 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
1185{ 1337{
1186 struct perf_sample_data data; 1338 struct perf_sample_data data;
1187 struct cpu_hw_counters *cpuc; 1339 struct cpu_hw_counters *cpuc;
1188 int bit, cpu, loops; 1340 int bit, loops;
1189 u64 ack, status; 1341 u64 ack, status;
1190 1342
1191 data.regs = regs; 1343 data.regs = regs;
1192 data.addr = 0; 1344 data.addr = 0;
1193 1345
1194 cpu = smp_processor_id(); 1346 cpuc = &__get_cpu_var(cpu_hw_counters);
1195 cpuc = &per_cpu(cpu_hw_counters, cpu);
1196 1347
1197 perf_disable(); 1348 perf_disable();
1198 status = intel_pmu_get_status(); 1349 status = intel_pmu_get_status();
@@ -1249,14 +1400,13 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)
1249 struct cpu_hw_counters *cpuc; 1400 struct cpu_hw_counters *cpuc;
1250 struct perf_counter *counter; 1401 struct perf_counter *counter;
1251 struct hw_perf_counter *hwc; 1402 struct hw_perf_counter *hwc;
1252 int cpu, idx, handled = 0; 1403 int idx, handled = 0;
1253 u64 val; 1404 u64 val;
1254 1405
1255 data.regs = regs; 1406 data.regs = regs;
1256 data.addr = 0; 1407 data.addr = 0;
1257 1408
1258 cpu = smp_processor_id(); 1409 cpuc = &__get_cpu_var(cpu_hw_counters);
1259 cpuc = &per_cpu(cpu_hw_counters, cpu);
1260 1410
1261 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 1411 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1262 if (!test_bit(idx, cpuc->active_mask)) 1412 if (!test_bit(idx, cpuc->active_mask))
@@ -1353,6 +1503,32 @@ static __read_mostly struct notifier_block perf_counter_nmi_notifier = {
1353 .priority = 1 1503 .priority = 1
1354}; 1504};
1355 1505
1506static struct x86_pmu p6_pmu = {
1507 .name = "p6",
1508 .handle_irq = p6_pmu_handle_irq,
1509 .disable_all = p6_pmu_disable_all,
1510 .enable_all = p6_pmu_enable_all,
1511 .enable = p6_pmu_enable_counter,
1512 .disable = p6_pmu_disable_counter,
1513 .eventsel = MSR_P6_EVNTSEL0,
1514 .perfctr = MSR_P6_PERFCTR0,
1515 .event_map = p6_pmu_event_map,
1516 .raw_event = p6_pmu_raw_event,
1517 .max_events = ARRAY_SIZE(p6_perfmon_event_map),
1518 .max_period = (1ULL << 31) - 1,
1519 .version = 0,
1520 .num_counters = 2,
1521 /*
1522 * Counters have 40 bits implemented. However they are designed such
1523 * that bits [32-39] are sign extensions of bit 31. As such the
1524 * effective width of a counter for P6-like PMU is 32 bits only.
1525 *
1526 * See IA-32 Intel Architecture Software developer manual Vol 3B
1527 */
1528 .counter_bits = 32,
1529 .counter_mask = (1ULL << 32) - 1,
1530};
1531
1356static struct x86_pmu intel_pmu = { 1532static struct x86_pmu intel_pmu = {
1357 .name = "Intel", 1533 .name = "Intel",
1358 .handle_irq = intel_pmu_handle_irq, 1534 .handle_irq = intel_pmu_handle_irq,
@@ -1392,6 +1568,37 @@ static struct x86_pmu amd_pmu = {
1392 .max_period = (1ULL << 47) - 1, 1568 .max_period = (1ULL << 47) - 1,
1393}; 1569};
1394 1570
1571static int p6_pmu_init(void)
1572{
1573 switch (boot_cpu_data.x86_model) {
1574 case 1:
1575 case 3: /* Pentium Pro */
1576 case 5:
1577 case 6: /* Pentium II */
1578 case 7:
1579 case 8:
1580 case 11: /* Pentium III */
1581 break;
1582 case 9:
1583 case 13:
1584 /* Pentium M */
1585 break;
1586 default:
1587 pr_cont("unsupported p6 CPU model %d ",
1588 boot_cpu_data.x86_model);
1589 return -ENODEV;
1590 }
1591
1592 if (!cpu_has_apic) {
1593 pr_info("no Local APIC, try rebooting with lapic");
1594 return -ENODEV;
1595 }
1596
1597 x86_pmu = p6_pmu;
1598
1599 return 0;
1600}
1601
1395static int intel_pmu_init(void) 1602static int intel_pmu_init(void)
1396{ 1603{
1397 union cpuid10_edx edx; 1604 union cpuid10_edx edx;
@@ -1400,8 +1607,14 @@ static int intel_pmu_init(void)
1400 unsigned int ebx; 1607 unsigned int ebx;
1401 int version; 1608 int version;
1402 1609
1403 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) 1610 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) {
1611 /* check for P6 processor family */
1612 if (boot_cpu_data.x86 == 6) {
1613 return p6_pmu_init();
1614 } else {
1404 return -ENODEV; 1615 return -ENODEV;
1616 }
1617 }
1405 1618
1406 /* 1619 /*
1407 * Check whether the Architectural PerfMon supports 1620 * Check whether the Architectural PerfMon supports
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 696f0e475c2d..92b7703d3d58 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -187,7 +187,7 @@ static void __init apic_intr_init(void)
187#ifdef CONFIG_X86_THERMAL_VECTOR 187#ifdef CONFIG_X86_THERMAL_VECTOR
188 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); 188 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
189#endif 189#endif
190#ifdef CONFIG_X86_THRESHOLD 190#ifdef CONFIG_X86_MCE_THRESHOLD
191 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); 191 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt);
192#endif 192#endif
193#if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC) 193#if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC)
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 846510b78a09..2a62d843f015 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -347,7 +347,7 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
347 347
348static struct irqaction mfgptirq = { 348static struct irqaction mfgptirq = {
349 .handler = mfgpt_tick, 349 .handler = mfgpt_tick,
350 .flags = IRQF_DISABLED | IRQF_NOBALANCING, 350 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER,
351 .name = "mfgpt-timer" 351 .name = "mfgpt-timer"
352}; 352};
353 353
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index 4f9c55f3a7c0..03801f2f761f 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -60,7 +60,7 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
60 "adc %5,%%edx ; " 60 "adc %5,%%edx ; "
61 : "=A" (product), "=r" (tmp1), "=r" (tmp2) 61 : "=A" (product), "=r" (tmp1), "=r" (tmp2)
62 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); 62 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
63#elif __x86_64__ 63#elif defined(__x86_64__)
64 __asm__ ( 64 __asm__ (
65 "mul %%rdx ; shrd $32,%%rdx,%%rax" 65 "mul %%rdx ; shrd $32,%%rdx,%%rax"
66 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) ); 66 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index d2d1ce8170f0..508e982dd072 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -249,6 +249,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
249 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"), 249 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"),
250 }, 250 },
251 }, 251 },
252 { /* Handle problems with rebooting on CompuLab SBC-FITPC2 */
253 .callback = set_bios_reboot,
254 .ident = "CompuLab SBC-FITPC2",
255 .matches = {
256 DMI_MATCH(DMI_SYS_VENDOR, "CompuLab"),
257 DMI_MATCH(DMI_PRODUCT_NAME, "SBC-FITPC2"),
258 },
259 },
252 { } 260 { }
253}; 261};
254 262
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index de2cab132844..63f32d220ef2 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -672,6 +672,19 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
672 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), 672 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
673 }, 673 },
674 }, 674 },
675 {
676 /*
677 * AMI BIOS with low memory corruption was found on Intel DG45ID board.
678 * It hase different DMI_BIOS_VENDOR = "Intel Corp.", for now we will
679 * match only DMI_BOARD_NAME and see if there is more bad products
680 * with this vendor.
681 */
682 .callback = dmi_low_memory_corruption,
683 .ident = "AMI BIOS",
684 .matches = {
685 DMI_MATCH(DMI_BOARD_NAME, "DG45ID"),
686 },
687 },
675#endif 688#endif
676 {} 689 {}
677}; 690};
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 367e87882041..59f31d2dd435 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -112,11 +112,6 @@ SECTIONS
112 _sdata = .; 112 _sdata = .;
113 DATA_DATA 113 DATA_DATA
114 CONSTRUCTORS 114 CONSTRUCTORS
115
116#ifdef CONFIG_X86_64
117 /* End of data section */
118 _edata = .;
119#endif
120 } :data 115 } :data
121 116
122#ifdef CONFIG_X86_32 117#ifdef CONFIG_X86_32
@@ -156,10 +151,8 @@ SECTIONS
156 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { 151 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
157 *(.data.read_mostly) 152 *(.data.read_mostly)
158 153
159#ifdef CONFIG_X86_32
160 /* End of data section */ 154 /* End of data section */
161 _edata = .; 155 _edata = .;
162#endif
163 } 156 }
164 157
165#ifdef CONFIG_X86_64 158#ifdef CONFIG_X86_64
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 7bc65f0f62c4..d677fa9ca650 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -22,7 +22,8 @@
22 * 22 *
23 * So how does the kernel know it's a Guest? We'll see that later, but let's 23 * So how does the kernel know it's a Guest? We'll see that later, but let's
24 * just say that we end up here where we replace the native functions various 24 * just say that we end up here where we replace the native functions various
25 * "paravirt" structures with our Guest versions, then boot like normal. :*/ 25 * "paravirt" structures with our Guest versions, then boot like normal.
26:*/
26 27
27/* 28/*
28 * Copyright (C) 2006, Rusty Russell <rusty@rustcorp.com.au> IBM Corporation. 29 * Copyright (C) 2006, Rusty Russell <rusty@rustcorp.com.au> IBM Corporation.
@@ -74,7 +75,8 @@
74 * 75 *
75 * The Guest in our tale is a simple creature: identical to the Host but 76 * The Guest in our tale is a simple creature: identical to the Host but
76 * behaving in simplified but equivalent ways. In particular, the Guest is the 77 * behaving in simplified but equivalent ways. In particular, the Guest is the
77 * same kernel as the Host (or at least, built from the same source code). :*/ 78 * same kernel as the Host (or at least, built from the same source code).
79:*/
78 80
79struct lguest_data lguest_data = { 81struct lguest_data lguest_data = {
80 .hcall_status = { [0 ... LHCALL_RING_SIZE-1] = 0xFF }, 82 .hcall_status = { [0 ... LHCALL_RING_SIZE-1] = 0xFF },
@@ -85,7 +87,8 @@ struct lguest_data lguest_data = {
85 .syscall_vec = SYSCALL_VECTOR, 87 .syscall_vec = SYSCALL_VECTOR,
86}; 88};
87 89
88/*G:037 async_hcall() is pretty simple: I'm quite proud of it really. We have a 90/*G:037
91 * async_hcall() is pretty simple: I'm quite proud of it really. We have a
89 * ring buffer of stored hypercalls which the Host will run though next time we 92 * ring buffer of stored hypercalls which the Host will run though next time we
90 * do a normal hypercall. Each entry in the ring has 5 slots for the hypercall 93 * do a normal hypercall. Each entry in the ring has 5 slots for the hypercall
91 * arguments, and a "hcall_status" word which is 0 if the call is ready to go, 94 * arguments, and a "hcall_status" word which is 0 if the call is ready to go,
@@ -94,7 +97,8 @@ struct lguest_data lguest_data = {
94 * If we come around to a slot which hasn't been finished, then the table is 97 * If we come around to a slot which hasn't been finished, then the table is
95 * full and we just make the hypercall directly. This has the nice side 98 * full and we just make the hypercall directly. This has the nice side
96 * effect of causing the Host to run all the stored calls in the ring buffer 99 * effect of causing the Host to run all the stored calls in the ring buffer
97 * which empties it for next time! */ 100 * which empties it for next time!
101 */
98static void async_hcall(unsigned long call, unsigned long arg1, 102static void async_hcall(unsigned long call, unsigned long arg1,
99 unsigned long arg2, unsigned long arg3, 103 unsigned long arg2, unsigned long arg3,
100 unsigned long arg4) 104 unsigned long arg4)
@@ -103,9 +107,11 @@ static void async_hcall(unsigned long call, unsigned long arg1,
103 static unsigned int next_call; 107 static unsigned int next_call;
104 unsigned long flags; 108 unsigned long flags;
105 109
106 /* Disable interrupts if not already disabled: we don't want an 110 /*
111 * Disable interrupts if not already disabled: we don't want an
107 * interrupt handler making a hypercall while we're already doing 112 * interrupt handler making a hypercall while we're already doing
108 * one! */ 113 * one!
114 */
109 local_irq_save(flags); 115 local_irq_save(flags);
110 if (lguest_data.hcall_status[next_call] != 0xFF) { 116 if (lguest_data.hcall_status[next_call] != 0xFF) {
111 /* Table full, so do normal hcall which will flush table. */ 117 /* Table full, so do normal hcall which will flush table. */
@@ -125,8 +131,9 @@ static void async_hcall(unsigned long call, unsigned long arg1,
125 local_irq_restore(flags); 131 local_irq_restore(flags);
126} 132}
127 133
128/*G:035 Notice the lazy_hcall() above, rather than hcall(). This is our first 134/*G:035
129 * real optimization trick! 135 * Notice the lazy_hcall() above, rather than hcall(). This is our first real
136 * optimization trick!
130 * 137 *
131 * When lazy_mode is set, it means we're allowed to defer all hypercalls and do 138 * When lazy_mode is set, it means we're allowed to defer all hypercalls and do
132 * them as a batch when lazy_mode is eventually turned off. Because hypercalls 139 * them as a batch when lazy_mode is eventually turned off. Because hypercalls
@@ -136,7 +143,8 @@ static void async_hcall(unsigned long call, unsigned long arg1,
136 * lguest_leave_lazy_mode(). 143 * lguest_leave_lazy_mode().
137 * 144 *
138 * So, when we're in lazy mode, we call async_hcall() to store the call for 145 * So, when we're in lazy mode, we call async_hcall() to store the call for
139 * future processing: */ 146 * future processing:
147 */
140static void lazy_hcall1(unsigned long call, 148static void lazy_hcall1(unsigned long call,
141 unsigned long arg1) 149 unsigned long arg1)
142{ 150{
@@ -146,6 +154,7 @@ static void lazy_hcall1(unsigned long call,
146 async_hcall(call, arg1, 0, 0, 0); 154 async_hcall(call, arg1, 0, 0, 0);
147} 155}
148 156
157/* You can imagine what lazy_hcall2, 3 and 4 look like. :*/
149static void lazy_hcall2(unsigned long call, 158static void lazy_hcall2(unsigned long call,
150 unsigned long arg1, 159 unsigned long arg1,
151 unsigned long arg2) 160 unsigned long arg2)
@@ -181,8 +190,10 @@ static void lazy_hcall4(unsigned long call,
181} 190}
182#endif 191#endif
183 192
184/* When lazy mode is turned off reset the per-cpu lazy mode variable and then 193/*G:036
185 * issue the do-nothing hypercall to flush any stored calls. */ 194 * When lazy mode is turned off reset the per-cpu lazy mode variable and then
195 * issue the do-nothing hypercall to flush any stored calls.
196:*/
186static void lguest_leave_lazy_mmu_mode(void) 197static void lguest_leave_lazy_mmu_mode(void)
187{ 198{
188 kvm_hypercall0(LHCALL_FLUSH_ASYNC); 199 kvm_hypercall0(LHCALL_FLUSH_ASYNC);
@@ -208,9 +219,11 @@ static void lguest_end_context_switch(struct task_struct *next)
208 * check there before it tries to deliver an interrupt. 219 * check there before it tries to deliver an interrupt.
209 */ 220 */
210 221
211/* save_flags() is expected to return the processor state (ie. "flags"). The 222/*
223 * save_flags() is expected to return the processor state (ie. "flags"). The
212 * flags word contains all kind of stuff, but in practice Linux only cares 224 * flags word contains all kind of stuff, but in practice Linux only cares
213 * about the interrupt flag. Our "save_flags()" just returns that. */ 225 * about the interrupt flag. Our "save_flags()" just returns that.
226 */
214static unsigned long save_fl(void) 227static unsigned long save_fl(void)
215{ 228{
216 return lguest_data.irq_enabled; 229 return lguest_data.irq_enabled;
@@ -222,13 +235,15 @@ static void irq_disable(void)
222 lguest_data.irq_enabled = 0; 235 lguest_data.irq_enabled = 0;
223} 236}
224 237
225/* Let's pause a moment. Remember how I said these are called so often? 238/*
239 * Let's pause a moment. Remember how I said these are called so often?
226 * Jeremy Fitzhardinge optimized them so hard early in 2009 that he had to 240 * Jeremy Fitzhardinge optimized them so hard early in 2009 that he had to
227 * break some rules. In particular, these functions are assumed to save their 241 * break some rules. In particular, these functions are assumed to save their
228 * own registers if they need to: normal C functions assume they can trash the 242 * own registers if they need to: normal C functions assume they can trash the
229 * eax register. To use normal C functions, we use 243 * eax register. To use normal C functions, we use
230 * PV_CALLEE_SAVE_REGS_THUNK(), which pushes %eax onto the stack, calls the 244 * PV_CALLEE_SAVE_REGS_THUNK(), which pushes %eax onto the stack, calls the
231 * C function, then restores it. */ 245 * C function, then restores it.
246 */
232PV_CALLEE_SAVE_REGS_THUNK(save_fl); 247PV_CALLEE_SAVE_REGS_THUNK(save_fl);
233PV_CALLEE_SAVE_REGS_THUNK(irq_disable); 248PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
234/*:*/ 249/*:*/
@@ -237,18 +252,18 @@ PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
237extern void lg_irq_enable(void); 252extern void lg_irq_enable(void);
238extern void lg_restore_fl(unsigned long flags); 253extern void lg_restore_fl(unsigned long flags);
239 254
240/*M:003 Note that we don't check for outstanding interrupts when we re-enable 255/*M:003
241 * them (or when we unmask an interrupt). This seems to work for the moment, 256 * We could be more efficient in our checking of outstanding interrupts, rather
242 * since interrupts are rare and we'll just get the interrupt on the next timer 257 * than using a branch. One way would be to put the "irq_enabled" field in a
243 * tick, but now we can run with CONFIG_NO_HZ, we should revisit this. One way 258 * page by itself, and have the Host write-protect it when an interrupt comes
244 * would be to put the "irq_enabled" field in a page by itself, and have the 259 * in when irqs are disabled. There will then be a page fault as soon as
245 * Host write-protect it when an interrupt comes in when irqs are disabled. 260 * interrupts are re-enabled.
246 * There will then be a page fault as soon as interrupts are re-enabled.
247 * 261 *
248 * A better method is to implement soft interrupt disable generally for x86: 262 * A better method is to implement soft interrupt disable generally for x86:
249 * instead of disabling interrupts, we set a flag. If an interrupt does come 263 * instead of disabling interrupts, we set a flag. If an interrupt does come
250 * in, we then disable them for real. This is uncommon, so we could simply use 264 * in, we then disable them for real. This is uncommon, so we could simply use
251 * a hypercall for interrupt control and not worry about efficiency. :*/ 265 * a hypercall for interrupt control and not worry about efficiency.
266:*/
252 267
253/*G:034 268/*G:034
254 * The Interrupt Descriptor Table (IDT). 269 * The Interrupt Descriptor Table (IDT).
@@ -261,10 +276,12 @@ extern void lg_restore_fl(unsigned long flags);
261static void lguest_write_idt_entry(gate_desc *dt, 276static void lguest_write_idt_entry(gate_desc *dt,
262 int entrynum, const gate_desc *g) 277 int entrynum, const gate_desc *g)
263{ 278{
264 /* The gate_desc structure is 8 bytes long: we hand it to the Host in 279 /*
280 * The gate_desc structure is 8 bytes long: we hand it to the Host in
265 * two 32-bit chunks. The whole 32-bit kernel used to hand descriptors 281 * two 32-bit chunks. The whole 32-bit kernel used to hand descriptors
266 * around like this; typesafety wasn't a big concern in Linux's early 282 * around like this; typesafety wasn't a big concern in Linux's early
267 * years. */ 283 * years.
284 */
268 u32 *desc = (u32 *)g; 285 u32 *desc = (u32 *)g;
269 /* Keep the local copy up to date. */ 286 /* Keep the local copy up to date. */
270 native_write_idt_entry(dt, entrynum, g); 287 native_write_idt_entry(dt, entrynum, g);
@@ -272,9 +289,11 @@ static void lguest_write_idt_entry(gate_desc *dt,
272 kvm_hypercall3(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]); 289 kvm_hypercall3(LHCALL_LOAD_IDT_ENTRY, entrynum, desc[0], desc[1]);
273} 290}
274 291
275/* Changing to a different IDT is very rare: we keep the IDT up-to-date every 292/*
293 * Changing to a different IDT is very rare: we keep the IDT up-to-date every
276 * time it is written, so we can simply loop through all entries and tell the 294 * time it is written, so we can simply loop through all entries and tell the
277 * Host about them. */ 295 * Host about them.
296 */
278static void lguest_load_idt(const struct desc_ptr *desc) 297static void lguest_load_idt(const struct desc_ptr *desc)
279{ 298{
280 unsigned int i; 299 unsigned int i;
@@ -305,9 +324,11 @@ static void lguest_load_gdt(const struct desc_ptr *desc)
305 kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b); 324 kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b);
306} 325}
307 326
308/* For a single GDT entry which changes, we do the lazy thing: alter our GDT, 327/*
328 * For a single GDT entry which changes, we do the lazy thing: alter our GDT,
309 * then tell the Host to reload the entire thing. This operation is so rare 329 * then tell the Host to reload the entire thing. This operation is so rare
310 * that this naive implementation is reasonable. */ 330 * that this naive implementation is reasonable.
331 */
311static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, 332static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum,
312 const void *desc, int type) 333 const void *desc, int type)
313{ 334{
@@ -317,29 +338,36 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum,
317 dt[entrynum].a, dt[entrynum].b); 338 dt[entrynum].a, dt[entrynum].b);
318} 339}
319 340
320/* OK, I lied. There are three "thread local storage" GDT entries which change 341/*
342 * OK, I lied. There are three "thread local storage" GDT entries which change
321 * on every context switch (these three entries are how glibc implements 343 * on every context switch (these three entries are how glibc implements
322 * __thread variables). So we have a hypercall specifically for this case. */ 344 * __thread variables). So we have a hypercall specifically for this case.
345 */
323static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) 346static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
324{ 347{
325 /* There's one problem which normal hardware doesn't have: the Host 348 /*
349 * There's one problem which normal hardware doesn't have: the Host
326 * can't handle us removing entries we're currently using. So we clear 350 * can't handle us removing entries we're currently using. So we clear
327 * the GS register here: if it's needed it'll be reloaded anyway. */ 351 * the GS register here: if it's needed it'll be reloaded anyway.
352 */
328 lazy_load_gs(0); 353 lazy_load_gs(0);
329 lazy_hcall2(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu); 354 lazy_hcall2(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu);
330} 355}
331 356
332/*G:038 That's enough excitement for now, back to ploughing through each of 357/*G:038
333 * the different pv_ops structures (we're about 1/3 of the way through). 358 * That's enough excitement for now, back to ploughing through each of the
359 * different pv_ops structures (we're about 1/3 of the way through).
334 * 360 *
335 * This is the Local Descriptor Table, another weird Intel thingy. Linux only 361 * This is the Local Descriptor Table, another weird Intel thingy. Linux only
336 * uses this for some strange applications like Wine. We don't do anything 362 * uses this for some strange applications like Wine. We don't do anything
337 * here, so they'll get an informative and friendly Segmentation Fault. */ 363 * here, so they'll get an informative and friendly Segmentation Fault.
364 */
338static void lguest_set_ldt(const void *addr, unsigned entries) 365static void lguest_set_ldt(const void *addr, unsigned entries)
339{ 366{
340} 367}
341 368
342/* This loads a GDT entry into the "Task Register": that entry points to a 369/*
370 * This loads a GDT entry into the "Task Register": that entry points to a
343 * structure called the Task State Segment. Some comments scattered though the 371 * structure called the Task State Segment. Some comments scattered though the
344 * kernel code indicate that this used for task switching in ages past, along 372 * kernel code indicate that this used for task switching in ages past, along
345 * with blood sacrifice and astrology. 373 * with blood sacrifice and astrology.
@@ -347,19 +375,21 @@ static void lguest_set_ldt(const void *addr, unsigned entries)
347 * Now there's nothing interesting in here that we don't get told elsewhere. 375 * Now there's nothing interesting in here that we don't get told elsewhere.
348 * But the native version uses the "ltr" instruction, which makes the Host 376 * But the native version uses the "ltr" instruction, which makes the Host
349 * complain to the Guest about a Segmentation Fault and it'll oops. So we 377 * complain to the Guest about a Segmentation Fault and it'll oops. So we
350 * override the native version with a do-nothing version. */ 378 * override the native version with a do-nothing version.
379 */
351static void lguest_load_tr_desc(void) 380static void lguest_load_tr_desc(void)
352{ 381{
353} 382}
354 383
355/* The "cpuid" instruction is a way of querying both the CPU identity 384/*
385 * The "cpuid" instruction is a way of querying both the CPU identity
356 * (manufacturer, model, etc) and its features. It was introduced before the 386 * (manufacturer, model, etc) and its features. It was introduced before the
357 * Pentium in 1993 and keeps getting extended by both Intel, AMD and others. 387 * Pentium in 1993 and keeps getting extended by both Intel, AMD and others.
358 * As you might imagine, after a decade and a half this treatment, it is now a 388 * As you might imagine, after a decade and a half this treatment, it is now a
359 * giant ball of hair. Its entry in the current Intel manual runs to 28 pages. 389 * giant ball of hair. Its entry in the current Intel manual runs to 28 pages.
360 * 390 *
361 * This instruction even it has its own Wikipedia entry. The Wikipedia entry 391 * This instruction even it has its own Wikipedia entry. The Wikipedia entry
362 * has been translated into 4 languages. I am not making this up! 392 * has been translated into 5 languages. I am not making this up!
363 * 393 *
364 * We could get funky here and identify ourselves as "GenuineLguest", but 394 * We could get funky here and identify ourselves as "GenuineLguest", but
365 * instead we just use the real "cpuid" instruction. Then I pretty much turned 395 * instead we just use the real "cpuid" instruction. Then I pretty much turned
@@ -371,7 +401,8 @@ static void lguest_load_tr_desc(void)
371 * Replacing the cpuid so we can turn features off is great for the kernel, but 401 * Replacing the cpuid so we can turn features off is great for the kernel, but
372 * anyone (including userspace) can just use the raw "cpuid" instruction and 402 * anyone (including userspace) can just use the raw "cpuid" instruction and
373 * the Host won't even notice since it isn't privileged. So we try not to get 403 * the Host won't even notice since it isn't privileged. So we try not to get
374 * too worked up about it. */ 404 * too worked up about it.
405 */
375static void lguest_cpuid(unsigned int *ax, unsigned int *bx, 406static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
376 unsigned int *cx, unsigned int *dx) 407 unsigned int *cx, unsigned int *dx)
377{ 408{
@@ -379,38 +410,63 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
379 410
380 native_cpuid(ax, bx, cx, dx); 411 native_cpuid(ax, bx, cx, dx);
381 switch (function) { 412 switch (function) {
382 case 1: /* Basic feature request. */ 413 /*
383 /* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */ 414 * CPUID 0 gives the highest legal CPUID number (and the ID string).
415 * We futureproof our code a little by sticking to known CPUID values.
416 */
417 case 0:
418 if (*ax > 5)
419 *ax = 5;
420 break;
421
422 /*
423 * CPUID 1 is a basic feature request.
424 *
425 * CX: we only allow kernel to see SSE3, CMPXCHG16B and SSSE3
426 * DX: SSE, SSE2, FXSR, MMX, CMOV, CMPXCHG8B, TSC, FPU and PAE.
427 */
428 case 1:
384 *cx &= 0x00002201; 429 *cx &= 0x00002201;
385 /* SSE, SSE2, FXSR, MMX, CMOV, CMPXCHG8B, TSC, FPU, PAE. */
386 *dx &= 0x07808151; 430 *dx &= 0x07808151;
387 /* The Host can do a nice optimization if it knows that the 431 /*
432 * The Host can do a nice optimization if it knows that the
388 * kernel mappings (addresses above 0xC0000000 or whatever 433 * kernel mappings (addresses above 0xC0000000 or whatever
389 * PAGE_OFFSET is set to) haven't changed. But Linux calls 434 * PAGE_OFFSET is set to) haven't changed. But Linux calls
390 * flush_tlb_user() for both user and kernel mappings unless 435 * flush_tlb_user() for both user and kernel mappings unless
391 * the Page Global Enable (PGE) feature bit is set. */ 436 * the Page Global Enable (PGE) feature bit is set.
437 */
392 *dx |= 0x00002000; 438 *dx |= 0x00002000;
393 /* We also lie, and say we're family id 5. 6 or greater 439 /*
440 * We also lie, and say we're family id 5. 6 or greater
394 * leads to a rdmsr in early_init_intel which we can't handle. 441 * leads to a rdmsr in early_init_intel which we can't handle.
395 * Family ID is returned as bits 8-12 in ax. */ 442 * Family ID is returned as bits 8-12 in ax.
443 */
396 *ax &= 0xFFFFF0FF; 444 *ax &= 0xFFFFF0FF;
397 *ax |= 0x00000500; 445 *ax |= 0x00000500;
398 break; 446 break;
447 /*
448 * 0x80000000 returns the highest Extended Function, so we futureproof
449 * like we do above by limiting it to known fields.
450 */
399 case 0x80000000: 451 case 0x80000000:
400 /* Futureproof this a little: if they ask how much extended
401 * processor information there is, limit it to known fields. */
402 if (*ax > 0x80000008) 452 if (*ax > 0x80000008)
403 *ax = 0x80000008; 453 *ax = 0x80000008;
404 break; 454 break;
455
456 /*
457 * PAE systems can mark pages as non-executable. Linux calls this the
458 * NX bit. Intel calls it XD (eXecute Disable), AMD EVP (Enhanced
459 * Virus Protection). We just switch turn if off here, since we don't
460 * support it.
461 */
405 case 0x80000001: 462 case 0x80000001:
406 /* Here we should fix nx cap depending on host. */
407 /* For this version of PAE, we just clear NX bit. */
408 *dx &= ~(1 << 20); 463 *dx &= ~(1 << 20);
409 break; 464 break;
410 } 465 }
411} 466}
412 467
413/* Intel has four control registers, imaginatively named cr0, cr2, cr3 and cr4. 468/*
469 * Intel has four control registers, imaginatively named cr0, cr2, cr3 and cr4.
414 * I assume there's a cr1, but it hasn't bothered us yet, so we'll not bother 470 * I assume there's a cr1, but it hasn't bothered us yet, so we'll not bother
415 * it. The Host needs to know when the Guest wants to change them, so we have 471 * it. The Host needs to know when the Guest wants to change them, so we have
416 * a whole series of functions like read_cr0() and write_cr0(). 472 * a whole series of functions like read_cr0() and write_cr0().
@@ -425,7 +481,8 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
425 * name like "FPUTRAP bit" be a little less cryptic? 481 * name like "FPUTRAP bit" be a little less cryptic?
426 * 482 *
427 * We store cr0 locally because the Host never changes it. The Guest sometimes 483 * We store cr0 locally because the Host never changes it. The Guest sometimes
428 * wants to read it and we'd prefer not to bother the Host unnecessarily. */ 484 * wants to read it and we'd prefer not to bother the Host unnecessarily.
485 */
429static unsigned long current_cr0; 486static unsigned long current_cr0;
430static void lguest_write_cr0(unsigned long val) 487static void lguest_write_cr0(unsigned long val)
431{ 488{
@@ -438,18 +495,22 @@ static unsigned long lguest_read_cr0(void)
438 return current_cr0; 495 return current_cr0;
439} 496}
440 497
441/* Intel provided a special instruction to clear the TS bit for people too cool 498/*
499 * Intel provided a special instruction to clear the TS bit for people too cool
442 * to use write_cr0() to do it. This "clts" instruction is faster, because all 500 * to use write_cr0() to do it. This "clts" instruction is faster, because all
443 * the vowels have been optimized out. */ 501 * the vowels have been optimized out.
502 */
444static void lguest_clts(void) 503static void lguest_clts(void)
445{ 504{
446 lazy_hcall1(LHCALL_TS, 0); 505 lazy_hcall1(LHCALL_TS, 0);
447 current_cr0 &= ~X86_CR0_TS; 506 current_cr0 &= ~X86_CR0_TS;
448} 507}
449 508
450/* cr2 is the virtual address of the last page fault, which the Guest only ever 509/*
510 * cr2 is the virtual address of the last page fault, which the Guest only ever
451 * reads. The Host kindly writes this into our "struct lguest_data", so we 511 * reads. The Host kindly writes this into our "struct lguest_data", so we
452 * just read it out of there. */ 512 * just read it out of there.
513 */
453static unsigned long lguest_read_cr2(void) 514static unsigned long lguest_read_cr2(void)
454{ 515{
455 return lguest_data.cr2; 516 return lguest_data.cr2;
@@ -458,10 +519,12 @@ static unsigned long lguest_read_cr2(void)
458/* See lguest_set_pte() below. */ 519/* See lguest_set_pte() below. */
459static bool cr3_changed = false; 520static bool cr3_changed = false;
460 521
461/* cr3 is the current toplevel pagetable page: the principle is the same as 522/*
523 * cr3 is the current toplevel pagetable page: the principle is the same as
462 * cr0. Keep a local copy, and tell the Host when it changes. The only 524 * cr0. Keep a local copy, and tell the Host when it changes. The only
463 * difference is that our local copy is in lguest_data because the Host needs 525 * difference is that our local copy is in lguest_data because the Host needs
464 * to set it upon our initial hypercall. */ 526 * to set it upon our initial hypercall.
527 */
465static void lguest_write_cr3(unsigned long cr3) 528static void lguest_write_cr3(unsigned long cr3)
466{ 529{
467 lguest_data.pgdir = cr3; 530 lguest_data.pgdir = cr3;
@@ -506,7 +569,7 @@ static void lguest_write_cr4(unsigned long val)
506 * cr3 ---> +---------+ 569 * cr3 ---> +---------+
507 * | --------->+---------+ 570 * | --------->+---------+
508 * | | | PADDR1 | 571 * | | | PADDR1 |
509 * Top-level | | PADDR2 | 572 * Mid-level | | PADDR2 |
510 * (PMD) page | | | 573 * (PMD) page | | |
511 * | | Lower-level | 574 * | | Lower-level |
512 * | | (PTE) page | 575 * | | (PTE) page |
@@ -526,21 +589,62 @@ static void lguest_write_cr4(unsigned long val)
526 * Index into top Index into second Offset within page 589 * Index into top Index into second Offset within page
527 * page directory page pagetable page 590 * page directory page pagetable page
528 * 591 *
529 * The kernel spends a lot of time changing both the top-level page directory 592 * Now, unfortunately, this isn't the whole story: Intel added Physical Address
530 * and lower-level pagetable pages. The Guest doesn't know physical addresses, 593 * Extension (PAE) to allow 32 bit systems to use 64GB of memory (ie. 36 bits).
531 * so while it maintains these page tables exactly like normal, it also needs 594 * These are held in 64-bit page table entries, so we can now only fit 512
532 * to keep the Host informed whenever it makes a change: the Host will create 595 * entries in a page, and the neat three-level tree breaks down.
533 * the real page tables based on the Guests'. 596 *
597 * The result is a four level page table:
598 *
599 * cr3 --> [ 4 Upper ]
600 * [ Level ]
601 * [ Entries ]
602 * [(PUD Page)]---> +---------+
603 * | --------->+---------+
604 * | | | PADDR1 |
605 * Mid-level | | PADDR2 |
606 * (PMD) page | | |
607 * | | Lower-level |
608 * | | (PTE) page |
609 * | | | |
610 * .... ....
611 *
612 *
613 * And the virtual address is decoded as:
614 *
615 * 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
616 * |<-2->|<--- 9 bits ---->|<---- 9 bits --->|<------ 12 bits ------>|
617 * Index into Index into mid Index into lower Offset within page
618 * top entries directory page pagetable page
619 *
620 * It's too hard to switch between these two formats at runtime, so Linux only
621 * supports one or the other depending on whether CONFIG_X86_PAE is set. Many
622 * distributions turn it on, and not just for people with silly amounts of
623 * memory: the larger PTE entries allow room for the NX bit, which lets the
624 * kernel disable execution of pages and increase security.
625 *
626 * This was a problem for lguest, which couldn't run on these distributions;
627 * then Matias Zabaljauregui figured it all out and implemented it, and only a
628 * handful of puppies were crushed in the process!
629 *
630 * Back to our point: the kernel spends a lot of time changing both the
631 * top-level page directory and lower-level pagetable pages. The Guest doesn't
632 * know physical addresses, so while it maintains these page tables exactly
633 * like normal, it also needs to keep the Host informed whenever it makes a
634 * change: the Host will create the real page tables based on the Guests'.
534 */ 635 */
535 636
536/* The Guest calls this to set a second-level entry (pte), ie. to map a page 637/*
537 * into a process' address space. We set the entry then tell the Host the 638 * The Guest calls this after it has set a second-level entry (pte), ie. to map
538 * toplevel and address this corresponds to. The Guest uses one pagetable per 639 * a page into a process' address space. Wetell the Host the toplevel and
539 * process, so we need to tell the Host which one we're changing (mm->pgd). */ 640 * address this corresponds to. The Guest uses one pagetable per process, so
641 * we need to tell the Host which one we're changing (mm->pgd).
642 */
540static void lguest_pte_update(struct mm_struct *mm, unsigned long addr, 643static void lguest_pte_update(struct mm_struct *mm, unsigned long addr,
541 pte_t *ptep) 644 pte_t *ptep)
542{ 645{
543#ifdef CONFIG_X86_PAE 646#ifdef CONFIG_X86_PAE
647 /* PAE needs to hand a 64 bit page table entry, so it uses two args. */
544 lazy_hcall4(LHCALL_SET_PTE, __pa(mm->pgd), addr, 648 lazy_hcall4(LHCALL_SET_PTE, __pa(mm->pgd), addr,
545 ptep->pte_low, ptep->pte_high); 649 ptep->pte_low, ptep->pte_high);
546#else 650#else
@@ -548,6 +652,7 @@ static void lguest_pte_update(struct mm_struct *mm, unsigned long addr,
548#endif 652#endif
549} 653}
550 654
655/* This is the "set and update" combo-meal-deal version. */
551static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr, 656static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
552 pte_t *ptep, pte_t pteval) 657 pte_t *ptep, pte_t pteval)
553{ 658{
@@ -555,10 +660,13 @@ static void lguest_set_pte_at(struct mm_struct *mm, unsigned long addr,
555 lguest_pte_update(mm, addr, ptep); 660 lguest_pte_update(mm, addr, ptep);
556} 661}
557 662
558/* The Guest calls lguest_set_pud to set a top-level entry and lguest_set_pmd 663/*
664 * The Guest calls lguest_set_pud to set a top-level entry and lguest_set_pmd
559 * to set a middle-level entry when PAE is activated. 665 * to set a middle-level entry when PAE is activated.
666 *
560 * Again, we set the entry then tell the Host which page we changed, 667 * Again, we set the entry then tell the Host which page we changed,
561 * and the index of the entry we changed. */ 668 * and the index of the entry we changed.
669 */
562#ifdef CONFIG_X86_PAE 670#ifdef CONFIG_X86_PAE
563static void lguest_set_pud(pud_t *pudp, pud_t pudval) 671static void lguest_set_pud(pud_t *pudp, pud_t pudval)
564{ 672{
@@ -577,8 +685,7 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
577} 685}
578#else 686#else
579 687
580/* The Guest calls lguest_set_pmd to set a top-level entry when PAE is not 688/* The Guest calls lguest_set_pmd to set a top-level entry when !PAE. */
581 * activated. */
582static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) 689static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
583{ 690{
584 native_set_pmd(pmdp, pmdval); 691 native_set_pmd(pmdp, pmdval);
@@ -587,7 +694,8 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
587} 694}
588#endif 695#endif
589 696
590/* There are a couple of legacy places where the kernel sets a PTE, but we 697/*
698 * There are a couple of legacy places where the kernel sets a PTE, but we
591 * don't know the top level any more. This is useless for us, since we don't 699 * don't know the top level any more. This is useless for us, since we don't
592 * know which pagetable is changing or what address, so we just tell the Host 700 * know which pagetable is changing or what address, so we just tell the Host
593 * to forget all of them. Fortunately, this is very rare. 701 * to forget all of them. Fortunately, this is very rare.
@@ -595,7 +703,8 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
595 * ... except in early boot when the kernel sets up the initial pagetables, 703 * ... except in early boot when the kernel sets up the initial pagetables,
596 * which makes booting astonishingly slow: 1.83 seconds! So we don't even tell 704 * which makes booting astonishingly slow: 1.83 seconds! So we don't even tell
597 * the Host anything changed until we've done the first page table switch, 705 * the Host anything changed until we've done the first page table switch,
598 * which brings boot back to 0.25 seconds. */ 706 * which brings boot back to 0.25 seconds.
707 */
599static void lguest_set_pte(pte_t *ptep, pte_t pteval) 708static void lguest_set_pte(pte_t *ptep, pte_t pteval)
600{ 709{
601 native_set_pte(ptep, pteval); 710 native_set_pte(ptep, pteval);
@@ -604,6 +713,11 @@ static void lguest_set_pte(pte_t *ptep, pte_t pteval)
604} 713}
605 714
606#ifdef CONFIG_X86_PAE 715#ifdef CONFIG_X86_PAE
716/*
717 * With 64-bit PTE values, we need to be careful setting them: if we set 32
718 * bits at a time, the hardware could see a weird half-set entry. These
719 * versions ensure we update all 64 bits at once.
720 */
607static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte) 721static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte)
608{ 722{
609 native_set_pte_atomic(ptep, pte); 723 native_set_pte_atomic(ptep, pte);
@@ -611,19 +725,21 @@ static void lguest_set_pte_atomic(pte_t *ptep, pte_t pte)
611 lazy_hcall1(LHCALL_FLUSH_TLB, 1); 725 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
612} 726}
613 727
614void lguest_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 728static void lguest_pte_clear(struct mm_struct *mm, unsigned long addr,
729 pte_t *ptep)
615{ 730{
616 native_pte_clear(mm, addr, ptep); 731 native_pte_clear(mm, addr, ptep);
617 lguest_pte_update(mm, addr, ptep); 732 lguest_pte_update(mm, addr, ptep);
618} 733}
619 734
620void lguest_pmd_clear(pmd_t *pmdp) 735static void lguest_pmd_clear(pmd_t *pmdp)
621{ 736{
622 lguest_set_pmd(pmdp, __pmd(0)); 737 lguest_set_pmd(pmdp, __pmd(0));
623} 738}
624#endif 739#endif
625 740
626/* Unfortunately for Lguest, the pv_mmu_ops for page tables were based on 741/*
742 * Unfortunately for Lguest, the pv_mmu_ops for page tables were based on
627 * native page table operations. On native hardware you can set a new page 743 * native page table operations. On native hardware you can set a new page
628 * table entry whenever you want, but if you want to remove one you have to do 744 * table entry whenever you want, but if you want to remove one you have to do
629 * a TLB flush (a TLB is a little cache of page table entries kept by the CPU). 745 * a TLB flush (a TLB is a little cache of page table entries kept by the CPU).
@@ -632,24 +748,29 @@ void lguest_pmd_clear(pmd_t *pmdp)
632 * called when a valid entry is written, not when it's removed (ie. marked not 748 * called when a valid entry is written, not when it's removed (ie. marked not
633 * present). Instead, this is where we come when the Guest wants to remove a 749 * present). Instead, this is where we come when the Guest wants to remove a
634 * page table entry: we tell the Host to set that entry to 0 (ie. the present 750 * page table entry: we tell the Host to set that entry to 0 (ie. the present
635 * bit is zero). */ 751 * bit is zero).
752 */
636static void lguest_flush_tlb_single(unsigned long addr) 753static void lguest_flush_tlb_single(unsigned long addr)
637{ 754{
638 /* Simply set it to zero: if it was not, it will fault back in. */ 755 /* Simply set it to zero: if it was not, it will fault back in. */
639 lazy_hcall3(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0); 756 lazy_hcall3(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0);
640} 757}
641 758
642/* This is what happens after the Guest has removed a large number of entries. 759/*
760 * This is what happens after the Guest has removed a large number of entries.
643 * This tells the Host that any of the page table entries for userspace might 761 * This tells the Host that any of the page table entries for userspace might
644 * have changed, ie. virtual addresses below PAGE_OFFSET. */ 762 * have changed, ie. virtual addresses below PAGE_OFFSET.
763 */
645static void lguest_flush_tlb_user(void) 764static void lguest_flush_tlb_user(void)
646{ 765{
647 lazy_hcall1(LHCALL_FLUSH_TLB, 0); 766 lazy_hcall1(LHCALL_FLUSH_TLB, 0);
648} 767}
649 768
650/* This is called when the kernel page tables have changed. That's not very 769/*
770 * This is called when the kernel page tables have changed. That's not very
651 * common (unless the Guest is using highmem, which makes the Guest extremely 771 * common (unless the Guest is using highmem, which makes the Guest extremely
652 * slow), so it's worth separating this from the user flushing above. */ 772 * slow), so it's worth separating this from the user flushing above.
773 */
653static void lguest_flush_tlb_kernel(void) 774static void lguest_flush_tlb_kernel(void)
654{ 775{
655 lazy_hcall1(LHCALL_FLUSH_TLB, 1); 776 lazy_hcall1(LHCALL_FLUSH_TLB, 1);
@@ -686,26 +807,38 @@ static struct irq_chip lguest_irq_controller = {
686 .unmask = enable_lguest_irq, 807 .unmask = enable_lguest_irq,
687}; 808};
688 809
689/* This sets up the Interrupt Descriptor Table (IDT) entry for each hardware 810/*
811 * This sets up the Interrupt Descriptor Table (IDT) entry for each hardware
690 * interrupt (except 128, which is used for system calls), and then tells the 812 * interrupt (except 128, which is used for system calls), and then tells the
691 * Linux infrastructure that each interrupt is controlled by our level-based 813 * Linux infrastructure that each interrupt is controlled by our level-based
692 * lguest interrupt controller. */ 814 * lguest interrupt controller.
815 */
693static void __init lguest_init_IRQ(void) 816static void __init lguest_init_IRQ(void)
694{ 817{
695 unsigned int i; 818 unsigned int i;
696 819
697 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) { 820 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
698 /* Some systems map "vectors" to interrupts weirdly. Lguest has 821 /* Some systems map "vectors" to interrupts weirdly. Not us! */
699 * a straightforward 1 to 1 mapping, so force that here. */
700 __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR; 822 __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;
701 if (i != SYSCALL_VECTOR) 823 if (i != SYSCALL_VECTOR)
702 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]); 824 set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
703 } 825 }
704 /* This call is required to set up for 4k stacks, where we have 826
705 * separate stacks for hard and soft interrupts. */ 827 /*
828 * This call is required to set up for 4k stacks, where we have
829 * separate stacks for hard and soft interrupts.
830 */
706 irq_ctx_init(smp_processor_id()); 831 irq_ctx_init(smp_processor_id());
707} 832}
708 833
834/*
835 * With CONFIG_SPARSE_IRQ, interrupt descriptors are allocated as-needed, so
836 * rather than set them in lguest_init_IRQ we are called here every time an
837 * lguest device needs an interrupt.
838 *
839 * FIXME: irq_to_desc_alloc_node() can fail due to lack of memory, we should
840 * pass that up!
841 */
709void lguest_setup_irq(unsigned int irq) 842void lguest_setup_irq(unsigned int irq)
710{ 843{
711 irq_to_desc_alloc_node(irq, 0); 844 irq_to_desc_alloc_node(irq, 0);
@@ -724,31 +857,39 @@ static unsigned long lguest_get_wallclock(void)
724 return lguest_data.time.tv_sec; 857 return lguest_data.time.tv_sec;
725} 858}
726 859
727/* The TSC is an Intel thing called the Time Stamp Counter. The Host tells us 860/*
861 * The TSC is an Intel thing called the Time Stamp Counter. The Host tells us
728 * what speed it runs at, or 0 if it's unusable as a reliable clock source. 862 * what speed it runs at, or 0 if it's unusable as a reliable clock source.
729 * This matches what we want here: if we return 0 from this function, the x86 863 * This matches what we want here: if we return 0 from this function, the x86
730 * TSC clock will give up and not register itself. */ 864 * TSC clock will give up and not register itself.
865 */
731static unsigned long lguest_tsc_khz(void) 866static unsigned long lguest_tsc_khz(void)
732{ 867{
733 return lguest_data.tsc_khz; 868 return lguest_data.tsc_khz;
734} 869}
735 870
736/* If we can't use the TSC, the kernel falls back to our lower-priority 871/*
737 * "lguest_clock", where we read the time value given to us by the Host. */ 872 * If we can't use the TSC, the kernel falls back to our lower-priority
873 * "lguest_clock", where we read the time value given to us by the Host.
874 */
738static cycle_t lguest_clock_read(struct clocksource *cs) 875static cycle_t lguest_clock_read(struct clocksource *cs)
739{ 876{
740 unsigned long sec, nsec; 877 unsigned long sec, nsec;
741 878
742 /* Since the time is in two parts (seconds and nanoseconds), we risk 879 /*
880 * Since the time is in two parts (seconds and nanoseconds), we risk
743 * reading it just as it's changing from 99 & 0.999999999 to 100 and 0, 881 * reading it just as it's changing from 99 & 0.999999999 to 100 and 0,
744 * and getting 99 and 0. As Linux tends to come apart under the stress 882 * and getting 99 and 0. As Linux tends to come apart under the stress
745 * of time travel, we must be careful: */ 883 * of time travel, we must be careful:
884 */
746 do { 885 do {
747 /* First we read the seconds part. */ 886 /* First we read the seconds part. */
748 sec = lguest_data.time.tv_sec; 887 sec = lguest_data.time.tv_sec;
749 /* This read memory barrier tells the compiler and the CPU that 888 /*
889 * This read memory barrier tells the compiler and the CPU that
750 * this can't be reordered: we have to complete the above 890 * this can't be reordered: we have to complete the above
751 * before going on. */ 891 * before going on.
892 */
752 rmb(); 893 rmb();
753 /* Now we read the nanoseconds part. */ 894 /* Now we read the nanoseconds part. */
754 nsec = lguest_data.time.tv_nsec; 895 nsec = lguest_data.time.tv_nsec;
@@ -772,9 +913,11 @@ static struct clocksource lguest_clock = {
772 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 913 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
773}; 914};
774 915
775/* We also need a "struct clock_event_device": Linux asks us to set it to go 916/*
917 * We also need a "struct clock_event_device": Linux asks us to set it to go
776 * off some time in the future. Actually, James Morris figured all this out, I 918 * off some time in the future. Actually, James Morris figured all this out, I
777 * just applied the patch. */ 919 * just applied the patch.
920 */
778static int lguest_clockevent_set_next_event(unsigned long delta, 921static int lguest_clockevent_set_next_event(unsigned long delta,
779 struct clock_event_device *evt) 922 struct clock_event_device *evt)
780{ 923{
@@ -824,8 +967,10 @@ static struct clock_event_device lguest_clockevent = {
824 .max_delta_ns = LG_CLOCK_MAX_DELTA, 967 .max_delta_ns = LG_CLOCK_MAX_DELTA,
825}; 968};
826 969
827/* This is the Guest timer interrupt handler (hardware interrupt 0). We just 970/*
828 * call the clockevent infrastructure and it does whatever needs doing. */ 971 * This is the Guest timer interrupt handler (hardware interrupt 0). We just
972 * call the clockevent infrastructure and it does whatever needs doing.
973 */
829static void lguest_time_irq(unsigned int irq, struct irq_desc *desc) 974static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
830{ 975{
831 unsigned long flags; 976 unsigned long flags;
@@ -836,10 +981,12 @@ static void lguest_time_irq(unsigned int irq, struct irq_desc *desc)
836 local_irq_restore(flags); 981 local_irq_restore(flags);
837} 982}
838 983
839/* At some point in the boot process, we get asked to set up our timing 984/*
985 * At some point in the boot process, we get asked to set up our timing
840 * infrastructure. The kernel doesn't expect timer interrupts before this, but 986 * infrastructure. The kernel doesn't expect timer interrupts before this, but
841 * we cleverly initialized the "blocked_interrupts" field of "struct 987 * we cleverly initialized the "blocked_interrupts" field of "struct
842 * lguest_data" so that timer interrupts were blocked until now. */ 988 * lguest_data" so that timer interrupts were blocked until now.
989 */
843static void lguest_time_init(void) 990static void lguest_time_init(void)
844{ 991{
845 /* Set up the timer interrupt (0) to go to our simple timer routine */ 992 /* Set up the timer interrupt (0) to go to our simple timer routine */
@@ -863,14 +1010,16 @@ static void lguest_time_init(void)
863 * to work. They're pretty simple. 1010 * to work. They're pretty simple.
864 */ 1011 */
865 1012
866/* The Guest needs to tell the Host what stack it expects traps to use. For 1013/*
1014 * The Guest needs to tell the Host what stack it expects traps to use. For
867 * native hardware, this is part of the Task State Segment mentioned above in 1015 * native hardware, this is part of the Task State Segment mentioned above in
868 * lguest_load_tr_desc(), but to help hypervisors there's this special call. 1016 * lguest_load_tr_desc(), but to help hypervisors there's this special call.
869 * 1017 *
870 * We tell the Host the segment we want to use (__KERNEL_DS is the kernel data 1018 * We tell the Host the segment we want to use (__KERNEL_DS is the kernel data
871 * segment), the privilege level (we're privilege level 1, the Host is 0 and 1019 * segment), the privilege level (we're privilege level 1, the Host is 0 and
872 * will not tolerate us trying to use that), the stack pointer, and the number 1020 * will not tolerate us trying to use that), the stack pointer, and the number
873 * of pages in the stack. */ 1021 * of pages in the stack.
1022 */
874static void lguest_load_sp0(struct tss_struct *tss, 1023static void lguest_load_sp0(struct tss_struct *tss,
875 struct thread_struct *thread) 1024 struct thread_struct *thread)
876{ 1025{
@@ -884,7 +1033,8 @@ static void lguest_set_debugreg(int regno, unsigned long value)
884 /* FIXME: Implement */ 1033 /* FIXME: Implement */
885} 1034}
886 1035
887/* There are times when the kernel wants to make sure that no memory writes are 1036/*
1037 * There are times when the kernel wants to make sure that no memory writes are
888 * caught in the cache (that they've all reached real hardware devices). This 1038 * caught in the cache (that they've all reached real hardware devices). This
889 * doesn't matter for the Guest which has virtual hardware. 1039 * doesn't matter for the Guest which has virtual hardware.
890 * 1040 *
@@ -898,11 +1048,13 @@ static void lguest_wbinvd(void)
898{ 1048{
899} 1049}
900 1050
901/* If the Guest expects to have an Advanced Programmable Interrupt Controller, 1051/*
1052 * If the Guest expects to have an Advanced Programmable Interrupt Controller,
902 * we play dumb by ignoring writes and returning 0 for reads. So it's no 1053 * we play dumb by ignoring writes and returning 0 for reads. So it's no
903 * longer Programmable nor Controlling anything, and I don't think 8 lines of 1054 * longer Programmable nor Controlling anything, and I don't think 8 lines of
904 * code qualifies for Advanced. It will also never interrupt anything. It 1055 * code qualifies for Advanced. It will also never interrupt anything. It
905 * does, however, allow us to get through the Linux boot code. */ 1056 * does, however, allow us to get through the Linux boot code.
1057 */
906#ifdef CONFIG_X86_LOCAL_APIC 1058#ifdef CONFIG_X86_LOCAL_APIC
907static void lguest_apic_write(u32 reg, u32 v) 1059static void lguest_apic_write(u32 reg, u32 v)
908{ 1060{
@@ -951,11 +1103,13 @@ static void lguest_safe_halt(void)
951 kvm_hypercall0(LHCALL_HALT); 1103 kvm_hypercall0(LHCALL_HALT);
952} 1104}
953 1105
954/* The SHUTDOWN hypercall takes a string to describe what's happening, and 1106/*
1107 * The SHUTDOWN hypercall takes a string to describe what's happening, and
955 * an argument which says whether this to restart (reboot) the Guest or not. 1108 * an argument which says whether this to restart (reboot) the Guest or not.
956 * 1109 *
957 * Note that the Host always prefers that the Guest speak in physical addresses 1110 * Note that the Host always prefers that the Guest speak in physical addresses
958 * rather than virtual addresses, so we use __pa() here. */ 1111 * rather than virtual addresses, so we use __pa() here.
1112 */
959static void lguest_power_off(void) 1113static void lguest_power_off(void)
960{ 1114{
961 kvm_hypercall2(LHCALL_SHUTDOWN, __pa("Power down"), 1115 kvm_hypercall2(LHCALL_SHUTDOWN, __pa("Power down"),
@@ -986,8 +1140,10 @@ static __init char *lguest_memory_setup(void)
986 * nice to move it back to lguest_init. Patch welcome... */ 1140 * nice to move it back to lguest_init. Patch welcome... */
987 atomic_notifier_chain_register(&panic_notifier_list, &paniced); 1141 atomic_notifier_chain_register(&panic_notifier_list, &paniced);
988 1142
989 /* The Linux bootloader header contains an "e820" memory map: the 1143 /*
990 * Launcher populated the first entry with our memory limit. */ 1144 *The Linux bootloader header contains an "e820" memory map: the
1145 * Launcher populated the first entry with our memory limit.
1146 */
991 e820_add_region(boot_params.e820_map[0].addr, 1147 e820_add_region(boot_params.e820_map[0].addr,
992 boot_params.e820_map[0].size, 1148 boot_params.e820_map[0].size,
993 boot_params.e820_map[0].type); 1149 boot_params.e820_map[0].type);
@@ -996,16 +1152,17 @@ static __init char *lguest_memory_setup(void)
996 return "LGUEST"; 1152 return "LGUEST";
997} 1153}
998 1154
999/* We will eventually use the virtio console device to produce console output, 1155/*
1156 * We will eventually use the virtio console device to produce console output,
1000 * but before that is set up we use LHCALL_NOTIFY on normal memory to produce 1157 * but before that is set up we use LHCALL_NOTIFY on normal memory to produce
1001 * console output. */ 1158 * console output.
1159 */
1002static __init int early_put_chars(u32 vtermno, const char *buf, int count) 1160static __init int early_put_chars(u32 vtermno, const char *buf, int count)
1003{ 1161{
1004 char scratch[17]; 1162 char scratch[17];
1005 unsigned int len = count; 1163 unsigned int len = count;
1006 1164
1007 /* We use a nul-terminated string, so we have to make a copy. Icky, 1165 /* We use a nul-terminated string, so we make a copy. Icky, huh? */
1008 * huh? */
1009 if (len > sizeof(scratch) - 1) 1166 if (len > sizeof(scratch) - 1)
1010 len = sizeof(scratch) - 1; 1167 len = sizeof(scratch) - 1;
1011 scratch[len] = '\0'; 1168 scratch[len] = '\0';
@@ -1016,8 +1173,10 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
1016 return len; 1173 return len;
1017} 1174}
1018 1175
1019/* Rebooting also tells the Host we're finished, but the RESTART flag tells the 1176/*
1020 * Launcher to reboot us. */ 1177 * Rebooting also tells the Host we're finished, but the RESTART flag tells the
1178 * Launcher to reboot us.
1179 */
1021static void lguest_restart(char *reason) 1180static void lguest_restart(char *reason)
1022{ 1181{
1023 kvm_hypercall2(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART); 1182 kvm_hypercall2(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART);
@@ -1044,7 +1203,8 @@ static void lguest_restart(char *reason)
1044 * fit comfortably. 1203 * fit comfortably.
1045 * 1204 *
1046 * First we need assembly templates of each of the patchable Guest operations, 1205 * First we need assembly templates of each of the patchable Guest operations,
1047 * and these are in i386_head.S. */ 1206 * and these are in i386_head.S.
1207 */
1048 1208
1049/*G:060 We construct a table from the assembler templates: */ 1209/*G:060 We construct a table from the assembler templates: */
1050static const struct lguest_insns 1210static const struct lguest_insns
@@ -1055,9 +1215,11 @@ static const struct lguest_insns
1055 [PARAVIRT_PATCH(pv_irq_ops.save_fl)] = { lgstart_pushf, lgend_pushf }, 1215 [PARAVIRT_PATCH(pv_irq_ops.save_fl)] = { lgstart_pushf, lgend_pushf },
1056}; 1216};
1057 1217
1058/* Now our patch routine is fairly simple (based on the native one in 1218/*
1219 * Now our patch routine is fairly simple (based on the native one in
1059 * paravirt.c). If we have a replacement, we copy it in and return how much of 1220 * paravirt.c). If we have a replacement, we copy it in and return how much of
1060 * the available space we used. */ 1221 * the available space we used.
1222 */
1061static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, 1223static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1062 unsigned long addr, unsigned len) 1224 unsigned long addr, unsigned len)
1063{ 1225{
@@ -1069,8 +1231,7 @@ static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1069 1231
1070 insn_len = lguest_insns[type].end - lguest_insns[type].start; 1232 insn_len = lguest_insns[type].end - lguest_insns[type].start;
1071 1233
1072 /* Similarly if we can't fit replacement (shouldn't happen, but let's 1234 /* Similarly if it can't fit (doesn't happen, but let's be thorough). */
1073 * be thorough). */
1074 if (len < insn_len) 1235 if (len < insn_len)
1075 return paravirt_patch_default(type, clobber, ibuf, addr, len); 1236 return paravirt_patch_default(type, clobber, ibuf, addr, len);
1076 1237
@@ -1079,22 +1240,28 @@ static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1079 return insn_len; 1240 return insn_len;
1080} 1241}
1081 1242
1082/*G:030 Once we get to lguest_init(), we know we're a Guest. The various 1243/*G:029
1244 * Once we get to lguest_init(), we know we're a Guest. The various
1083 * pv_ops structures in the kernel provide points for (almost) every routine we 1245 * pv_ops structures in the kernel provide points for (almost) every routine we
1084 * have to override to avoid privileged instructions. */ 1246 * have to override to avoid privileged instructions.
1247 */
1085__init void lguest_init(void) 1248__init void lguest_init(void)
1086{ 1249{
1087 /* We're under lguest, paravirt is enabled, and we're running at 1250 /* We're under lguest. */
1088 * privilege level 1, not 0 as normal. */
1089 pv_info.name = "lguest"; 1251 pv_info.name = "lguest";
1252 /* Paravirt is enabled. */
1090 pv_info.paravirt_enabled = 1; 1253 pv_info.paravirt_enabled = 1;
1254 /* We're running at privilege level 1, not 0 as normal. */
1091 pv_info.kernel_rpl = 1; 1255 pv_info.kernel_rpl = 1;
1256 /* Everyone except Xen runs with this set. */
1092 pv_info.shared_kernel_pmd = 1; 1257 pv_info.shared_kernel_pmd = 1;
1093 1258
1094 /* We set up all the lguest overrides for sensitive operations. These 1259 /*
1095 * are detailed with the operations themselves. */ 1260 * We set up all the lguest overrides for sensitive operations. These
1261 * are detailed with the operations themselves.
1262 */
1096 1263
1097 /* interrupt-related operations */ 1264 /* Interrupt-related operations */
1098 pv_irq_ops.init_IRQ = lguest_init_IRQ; 1265 pv_irq_ops.init_IRQ = lguest_init_IRQ;
1099 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl); 1266 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
1100 pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl); 1267 pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(lg_restore_fl);
@@ -1102,11 +1269,11 @@ __init void lguest_init(void)
1102 pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable); 1269 pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(lg_irq_enable);
1103 pv_irq_ops.safe_halt = lguest_safe_halt; 1270 pv_irq_ops.safe_halt = lguest_safe_halt;
1104 1271
1105 /* init-time operations */ 1272 /* Setup operations */
1106 pv_init_ops.memory_setup = lguest_memory_setup; 1273 pv_init_ops.memory_setup = lguest_memory_setup;
1107 pv_init_ops.patch = lguest_patch; 1274 pv_init_ops.patch = lguest_patch;
1108 1275
1109 /* Intercepts of various cpu instructions */ 1276 /* Intercepts of various CPU instructions */
1110 pv_cpu_ops.load_gdt = lguest_load_gdt; 1277 pv_cpu_ops.load_gdt = lguest_load_gdt;
1111 pv_cpu_ops.cpuid = lguest_cpuid; 1278 pv_cpu_ops.cpuid = lguest_cpuid;
1112 pv_cpu_ops.load_idt = lguest_load_idt; 1279 pv_cpu_ops.load_idt = lguest_load_idt;
@@ -1127,7 +1294,7 @@ __init void lguest_init(void)
1127 pv_cpu_ops.start_context_switch = paravirt_start_context_switch; 1294 pv_cpu_ops.start_context_switch = paravirt_start_context_switch;
1128 pv_cpu_ops.end_context_switch = lguest_end_context_switch; 1295 pv_cpu_ops.end_context_switch = lguest_end_context_switch;
1129 1296
1130 /* pagetable management */ 1297 /* Pagetable management */
1131 pv_mmu_ops.write_cr3 = lguest_write_cr3; 1298 pv_mmu_ops.write_cr3 = lguest_write_cr3;
1132 pv_mmu_ops.flush_tlb_user = lguest_flush_tlb_user; 1299 pv_mmu_ops.flush_tlb_user = lguest_flush_tlb_user;
1133 pv_mmu_ops.flush_tlb_single = lguest_flush_tlb_single; 1300 pv_mmu_ops.flush_tlb_single = lguest_flush_tlb_single;
@@ -1149,54 +1316,71 @@ __init void lguest_init(void)
1149 pv_mmu_ops.pte_update_defer = lguest_pte_update; 1316 pv_mmu_ops.pte_update_defer = lguest_pte_update;
1150 1317
1151#ifdef CONFIG_X86_LOCAL_APIC 1318#ifdef CONFIG_X86_LOCAL_APIC
1152 /* apic read/write intercepts */ 1319 /* APIC read/write intercepts */
1153 set_lguest_basic_apic_ops(); 1320 set_lguest_basic_apic_ops();
1154#endif 1321#endif
1155 1322
1156 /* time operations */ 1323 /* Time operations */
1157 pv_time_ops.get_wallclock = lguest_get_wallclock; 1324 pv_time_ops.get_wallclock = lguest_get_wallclock;
1158 pv_time_ops.time_init = lguest_time_init; 1325 pv_time_ops.time_init = lguest_time_init;
1159 pv_time_ops.get_tsc_khz = lguest_tsc_khz; 1326 pv_time_ops.get_tsc_khz = lguest_tsc_khz;
1160 1327
1161 /* Now is a good time to look at the implementations of these functions 1328 /*
1162 * before returning to the rest of lguest_init(). */ 1329 * Now is a good time to look at the implementations of these functions
1330 * before returning to the rest of lguest_init().
1331 */
1163 1332
1164 /*G:070 Now we've seen all the paravirt_ops, we return to 1333 /*G:070
1334 * Now we've seen all the paravirt_ops, we return to
1165 * lguest_init() where the rest of the fairly chaotic boot setup 1335 * lguest_init() where the rest of the fairly chaotic boot setup
1166 * occurs. */ 1336 * occurs.
1337 */
1167 1338
1168 /* The stack protector is a weird thing where gcc places a canary 1339 /*
1340 * The stack protector is a weird thing where gcc places a canary
1169 * value on the stack and then checks it on return. This file is 1341 * value on the stack and then checks it on return. This file is
1170 * compiled with -fno-stack-protector it, so we got this far without 1342 * compiled with -fno-stack-protector it, so we got this far without
1171 * problems. The value of the canary is kept at offset 20 from the 1343 * problems. The value of the canary is kept at offset 20 from the
1172 * %gs register, so we need to set that up before calling C functions 1344 * %gs register, so we need to set that up before calling C functions
1173 * in other files. */ 1345 * in other files.
1346 */
1174 setup_stack_canary_segment(0); 1347 setup_stack_canary_segment(0);
1175 /* We could just call load_stack_canary_segment(), but we might as 1348
1176 * call switch_to_new_gdt() which loads the whole table and sets up 1349 /*
1177 * the per-cpu segment descriptor register %fs as well. */ 1350 * We could just call load_stack_canary_segment(), but we might as well
1351 * call switch_to_new_gdt() which loads the whole table and sets up the
1352 * per-cpu segment descriptor register %fs as well.
1353 */
1178 switch_to_new_gdt(0); 1354 switch_to_new_gdt(0);
1179 1355
1180 /* As described in head_32.S, we map the first 128M of memory. */ 1356 /* We actually boot with all memory mapped, but let's say 128MB. */
1181 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT; 1357 max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT;
1182 1358
1183 /* The Host<->Guest Switcher lives at the top of our address space, and 1359 /*
1360 * The Host<->Guest Switcher lives at the top of our address space, and
1184 * the Host told us how big it is when we made LGUEST_INIT hypercall: 1361 * the Host told us how big it is when we made LGUEST_INIT hypercall:
1185 * it put the answer in lguest_data.reserve_mem */ 1362 * it put the answer in lguest_data.reserve_mem
1363 */
1186 reserve_top_address(lguest_data.reserve_mem); 1364 reserve_top_address(lguest_data.reserve_mem);
1187 1365
1188 /* If we don't initialize the lock dependency checker now, it crashes 1366 /*
1189 * paravirt_disable_iospace. */ 1367 * If we don't initialize the lock dependency checker now, it crashes
1368 * paravirt_disable_iospace.
1369 */
1190 lockdep_init(); 1370 lockdep_init();
1191 1371
1192 /* The IDE code spends about 3 seconds probing for disks: if we reserve 1372 /*
1373 * The IDE code spends about 3 seconds probing for disks: if we reserve
1193 * all the I/O ports up front it can't get them and so doesn't probe. 1374 * all the I/O ports up front it can't get them and so doesn't probe.
1194 * Other device drivers are similar (but less severe). This cuts the 1375 * Other device drivers are similar (but less severe). This cuts the
1195 * kernel boot time on my machine from 4.1 seconds to 0.45 seconds. */ 1376 * kernel boot time on my machine from 4.1 seconds to 0.45 seconds.
1377 */
1196 paravirt_disable_iospace(); 1378 paravirt_disable_iospace();
1197 1379
1198 /* This is messy CPU setup stuff which the native boot code does before 1380 /*
1199 * start_kernel, so we have to do, too: */ 1381 * This is messy CPU setup stuff which the native boot code does before
1382 * start_kernel, so we have to do, too:
1383 */
1200 cpu_detect(&new_cpu_data); 1384 cpu_detect(&new_cpu_data);
1201 /* head.S usually sets up the first capability word, so do it here. */ 1385 /* head.S usually sets up the first capability word, so do it here. */
1202 new_cpu_data.x86_capability[0] = cpuid_edx(1); 1386 new_cpu_data.x86_capability[0] = cpuid_edx(1);
@@ -1213,22 +1397,28 @@ __init void lguest_init(void)
1213 acpi_ht = 0; 1397 acpi_ht = 0;
1214#endif 1398#endif
1215 1399
1216 /* We set the preferred console to "hvc". This is the "hypervisor 1400 /*
1401 * We set the preferred console to "hvc". This is the "hypervisor
1217 * virtual console" driver written by the PowerPC people, which we also 1402 * virtual console" driver written by the PowerPC people, which we also
1218 * adapted for lguest's use. */ 1403 * adapted for lguest's use.
1404 */
1219 add_preferred_console("hvc", 0, NULL); 1405 add_preferred_console("hvc", 0, NULL);
1220 1406
1221 /* Register our very early console. */ 1407 /* Register our very early console. */
1222 virtio_cons_early_init(early_put_chars); 1408 virtio_cons_early_init(early_put_chars);
1223 1409
1224 /* Last of all, we set the power management poweroff hook to point to 1410 /*
1411 * Last of all, we set the power management poweroff hook to point to
1225 * the Guest routine to power off, and the reboot hook to our restart 1412 * the Guest routine to power off, and the reboot hook to our restart
1226 * routine. */ 1413 * routine.
1414 */
1227 pm_power_off = lguest_power_off; 1415 pm_power_off = lguest_power_off;
1228 machine_ops.restart = lguest_restart; 1416 machine_ops.restart = lguest_restart;
1229 1417
1230 /* Now we're set up, call i386_start_kernel() in head32.c and we proceed 1418 /*
1231 * to boot as normal. It never returns. */ 1419 * Now we're set up, call i386_start_kernel() in head32.c and we proceed
1420 * to boot as normal. It never returns.
1421 */
1232 i386_start_kernel(); 1422 i386_start_kernel();
1233} 1423}
1234/* 1424/*
diff --git a/arch/x86/lguest/i386_head.S b/arch/x86/lguest/i386_head.S
index a9c8cfe61cd4..27eac0faee48 100644
--- a/arch/x86/lguest/i386_head.S
+++ b/arch/x86/lguest/i386_head.S
@@ -5,7 +5,8 @@
5#include <asm/thread_info.h> 5#include <asm/thread_info.h>
6#include <asm/processor-flags.h> 6#include <asm/processor-flags.h>
7 7
8/*G:020 Our story starts with the kernel booting into startup_32 in 8/*G:020
9 * Our story starts with the kernel booting into startup_32 in
9 * arch/x86/kernel/head_32.S. It expects a boot header, which is created by 10 * arch/x86/kernel/head_32.S. It expects a boot header, which is created by
10 * the bootloader (the Launcher in our case). 11 * the bootloader (the Launcher in our case).
11 * 12 *
@@ -21,11 +22,14 @@
21 * data without remembering to subtract __PAGE_OFFSET! 22 * data without remembering to subtract __PAGE_OFFSET!
22 * 23 *
23 * The .section line puts this code in .init.text so it will be discarded after 24 * The .section line puts this code in .init.text so it will be discarded after
24 * boot. */ 25 * boot.
26 */
25.section .init.text, "ax", @progbits 27.section .init.text, "ax", @progbits
26ENTRY(lguest_entry) 28ENTRY(lguest_entry)
27 /* We make the "initialization" hypercall now to tell the Host about 29 /*
28 * us, and also find out where it put our page tables. */ 30 * We make the "initialization" hypercall now to tell the Host about
31 * us, and also find out where it put our page tables.
32 */
29 movl $LHCALL_LGUEST_INIT, %eax 33 movl $LHCALL_LGUEST_INIT, %eax
30 movl $lguest_data - __PAGE_OFFSET, %ebx 34 movl $lguest_data - __PAGE_OFFSET, %ebx
31 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */ 35 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */
@@ -33,13 +37,14 @@ ENTRY(lguest_entry)
33 /* Set up the initial stack so we can run C code. */ 37 /* Set up the initial stack so we can run C code. */
34 movl $(init_thread_union+THREAD_SIZE),%esp 38 movl $(init_thread_union+THREAD_SIZE),%esp
35 39
36 /* Jumps are relative, and we're running __PAGE_OFFSET too low at the 40 /* Jumps are relative: we're running __PAGE_OFFSET too low. */
37 * moment. */
38 jmp lguest_init+__PAGE_OFFSET 41 jmp lguest_init+__PAGE_OFFSET
39 42
40/*G:055 We create a macro which puts the assembler code between lgstart_ and 43/*G:055
41 * lgend_ markers. These templates are put in the .text section: they can't be 44 * We create a macro which puts the assembler code between lgstart_ and lgend_
42 * discarded after boot as we may need to patch modules, too. */ 45 * markers. These templates are put in the .text section: they can't be
46 * discarded after boot as we may need to patch modules, too.
47 */
43.text 48.text
44#define LGUEST_PATCH(name, insns...) \ 49#define LGUEST_PATCH(name, insns...) \
45 lgstart_##name: insns; lgend_##name:; \ 50 lgstart_##name: insns; lgend_##name:; \
@@ -48,83 +53,103 @@ ENTRY(lguest_entry)
48LGUEST_PATCH(cli, movl $0, lguest_data+LGUEST_DATA_irq_enabled) 53LGUEST_PATCH(cli, movl $0, lguest_data+LGUEST_DATA_irq_enabled)
49LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax) 54LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax)
50 55
51/*G:033 But using those wrappers is inefficient (we'll see why that doesn't 56/*G:033
52 * matter for save_fl and irq_disable later). If we write our routines 57 * But using those wrappers is inefficient (we'll see why that doesn't matter
53 * carefully in assembler, we can avoid clobbering any registers and avoid 58 * for save_fl and irq_disable later). If we write our routines carefully in
54 * jumping through the wrapper functions. 59 * assembler, we can avoid clobbering any registers and avoid jumping through
60 * the wrapper functions.
55 * 61 *
56 * I skipped over our first piece of assembler, but this one is worth studying 62 * I skipped over our first piece of assembler, but this one is worth studying
57 * in a bit more detail so I'll describe in easy stages. First, the routine 63 * in a bit more detail so I'll describe in easy stages. First, the routine to
58 * to enable interrupts: */ 64 * enable interrupts:
65 */
59ENTRY(lg_irq_enable) 66ENTRY(lg_irq_enable)
60 /* The reverse of irq_disable, this sets lguest_data.irq_enabled to 67 /*
61 * X86_EFLAGS_IF (ie. "Interrupts enabled"). */ 68 * The reverse of irq_disable, this sets lguest_data.irq_enabled to
69 * X86_EFLAGS_IF (ie. "Interrupts enabled").
70 */
62 movl $X86_EFLAGS_IF, lguest_data+LGUEST_DATA_irq_enabled 71 movl $X86_EFLAGS_IF, lguest_data+LGUEST_DATA_irq_enabled
63 /* But now we need to check if the Host wants to know: there might have 72 /*
73 * But now we need to check if the Host wants to know: there might have
64 * been interrupts waiting to be delivered, in which case it will have 74 * been interrupts waiting to be delivered, in which case it will have
65 * set lguest_data.irq_pending to X86_EFLAGS_IF. If it's not zero, we 75 * set lguest_data.irq_pending to X86_EFLAGS_IF. If it's not zero, we
66 * jump to send_interrupts, otherwise we're done. */ 76 * jump to send_interrupts, otherwise we're done.
77 */
67 testl $0, lguest_data+LGUEST_DATA_irq_pending 78 testl $0, lguest_data+LGUEST_DATA_irq_pending
68 jnz send_interrupts 79 jnz send_interrupts
69 /* One cool thing about x86 is that you can do many things without using 80 /*
81 * One cool thing about x86 is that you can do many things without using
70 * a register. In this case, the normal path hasn't needed to save or 82 * a register. In this case, the normal path hasn't needed to save or
71 * restore any registers at all! */ 83 * restore any registers at all!
84 */
72 ret 85 ret
73send_interrupts: 86send_interrupts:
74 /* OK, now we need a register: eax is used for the hypercall number, 87 /*
88 * OK, now we need a register: eax is used for the hypercall number,
75 * which is LHCALL_SEND_INTERRUPTS. 89 * which is LHCALL_SEND_INTERRUPTS.
76 * 90 *
77 * We used not to bother with this pending detection at all, which was 91 * We used not to bother with this pending detection at all, which was
78 * much simpler. Sooner or later the Host would realize it had to 92 * much simpler. Sooner or later the Host would realize it had to
79 * send us an interrupt. But that turns out to make performance 7 93 * send us an interrupt. But that turns out to make performance 7
80 * times worse on a simple tcp benchmark. So now we do this the hard 94 * times worse on a simple tcp benchmark. So now we do this the hard
81 * way. */ 95 * way.
96 */
82 pushl %eax 97 pushl %eax
83 movl $LHCALL_SEND_INTERRUPTS, %eax 98 movl $LHCALL_SEND_INTERRUPTS, %eax
84 /* This is a vmcall instruction (same thing that KVM uses). Older 99 /*
100 * This is a vmcall instruction (same thing that KVM uses). Older
85 * assembler versions might not know the "vmcall" instruction, so we 101 * assembler versions might not know the "vmcall" instruction, so we
86 * create one manually here. */ 102 * create one manually here.
103 */
87 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */ 104 .byte 0x0f,0x01,0xc1 /* KVM_HYPERCALL */
105 /* Put eax back the way we found it. */
88 popl %eax 106 popl %eax
89 ret 107 ret
90 108
91/* Finally, the "popf" or "restore flags" routine. The %eax register holds the 109/*
110 * Finally, the "popf" or "restore flags" routine. The %eax register holds the
92 * flags (in practice, either X86_EFLAGS_IF or 0): if it's X86_EFLAGS_IF we're 111 * flags (in practice, either X86_EFLAGS_IF or 0): if it's X86_EFLAGS_IF we're
93 * enabling interrupts again, if it's 0 we're leaving them off. */ 112 * enabling interrupts again, if it's 0 we're leaving them off.
113 */
94ENTRY(lg_restore_fl) 114ENTRY(lg_restore_fl)
95 /* This is just "lguest_data.irq_enabled = flags;" */ 115 /* This is just "lguest_data.irq_enabled = flags;" */
96 movl %eax, lguest_data+LGUEST_DATA_irq_enabled 116 movl %eax, lguest_data+LGUEST_DATA_irq_enabled
97 /* Now, if the %eax value has enabled interrupts and 117 /*
118 * Now, if the %eax value has enabled interrupts and
98 * lguest_data.irq_pending is set, we want to tell the Host so it can 119 * lguest_data.irq_pending is set, we want to tell the Host so it can
99 * deliver any outstanding interrupts. Fortunately, both values will 120 * deliver any outstanding interrupts. Fortunately, both values will
100 * be X86_EFLAGS_IF (ie. 512) in that case, and the "testl" 121 * be X86_EFLAGS_IF (ie. 512) in that case, and the "testl"
101 * instruction will AND them together for us. If both are set, we 122 * instruction will AND them together for us. If both are set, we
102 * jump to send_interrupts. */ 123 * jump to send_interrupts.
124 */
103 testl lguest_data+LGUEST_DATA_irq_pending, %eax 125 testl lguest_data+LGUEST_DATA_irq_pending, %eax
104 jnz send_interrupts 126 jnz send_interrupts
105 /* Again, the normal path has used no extra registers. Clever, huh? */ 127 /* Again, the normal path has used no extra registers. Clever, huh? */
106 ret 128 ret
129/*:*/
107 130
108/* These demark the EIP range where host should never deliver interrupts. */ 131/* These demark the EIP range where host should never deliver interrupts. */
109.global lguest_noirq_start 132.global lguest_noirq_start
110.global lguest_noirq_end 133.global lguest_noirq_end
111 134
112/*M:004 When the Host reflects a trap or injects an interrupt into the Guest, 135/*M:004
113 * it sets the eflags interrupt bit on the stack based on 136 * When the Host reflects a trap or injects an interrupt into the Guest, it
114 * lguest_data.irq_enabled, so the Guest iret logic does the right thing when 137 * sets the eflags interrupt bit on the stack based on lguest_data.irq_enabled,
115 * restoring it. However, when the Host sets the Guest up for direct traps, 138 * so the Guest iret logic does the right thing when restoring it. However,
116 * such as system calls, the processor is the one to push eflags onto the 139 * when the Host sets the Guest up for direct traps, such as system calls, the
117 * stack, and the interrupt bit will be 1 (in reality, interrupts are always 140 * processor is the one to push eflags onto the stack, and the interrupt bit
118 * enabled in the Guest). 141 * will be 1 (in reality, interrupts are always enabled in the Guest).
119 * 142 *
120 * This turns out to be harmless: the only trap which should happen under Linux 143 * This turns out to be harmless: the only trap which should happen under Linux
121 * with interrupts disabled is Page Fault (due to our lazy mapping of vmalloc 144 * with interrupts disabled is Page Fault (due to our lazy mapping of vmalloc
122 * regions), which has to be reflected through the Host anyway. If another 145 * regions), which has to be reflected through the Host anyway. If another
123 * trap *does* go off when interrupts are disabled, the Guest will panic, and 146 * trap *does* go off when interrupts are disabled, the Guest will panic, and
124 * we'll never get to this iret! :*/ 147 * we'll never get to this iret!
148:*/
125 149
126/*G:045 There is one final paravirt_op that the Guest implements, and glancing 150/*G:045
127 * at it you can see why I left it to last. It's *cool*! It's in *assembler*! 151 * There is one final paravirt_op that the Guest implements, and glancing at it
152 * you can see why I left it to last. It's *cool*! It's in *assembler*!
128 * 153 *
129 * The "iret" instruction is used to return from an interrupt or trap. The 154 * The "iret" instruction is used to return from an interrupt or trap. The
130 * stack looks like this: 155 * stack looks like this:
@@ -148,15 +173,18 @@ ENTRY(lg_restore_fl)
148 * return to userspace or wherever. Our solution to this is to surround the 173 * return to userspace or wherever. Our solution to this is to surround the
149 * code with lguest_noirq_start: and lguest_noirq_end: labels. We tell the 174 * code with lguest_noirq_start: and lguest_noirq_end: labels. We tell the
150 * Host that it is *never* to interrupt us there, even if interrupts seem to be 175 * Host that it is *never* to interrupt us there, even if interrupts seem to be
151 * enabled. */ 176 * enabled.
177 */
152ENTRY(lguest_iret) 178ENTRY(lguest_iret)
153 pushl %eax 179 pushl %eax
154 movl 12(%esp), %eax 180 movl 12(%esp), %eax
155lguest_noirq_start: 181lguest_noirq_start:
156 /* Note the %ss: segment prefix here. Normal data accesses use the 182 /*
183 * Note the %ss: segment prefix here. Normal data accesses use the
157 * "ds" segment, but that will have already been restored for whatever 184 * "ds" segment, but that will have already been restored for whatever
158 * we're returning to (such as userspace): we can't trust it. The %ss: 185 * we're returning to (such as userspace): we can't trust it. The %ss:
159 * prefix makes sure we use the stack segment, which is still valid. */ 186 * prefix makes sure we use the stack segment, which is still valid.
187 */
160 movl %eax,%ss:lguest_data+LGUEST_DATA_irq_enabled 188 movl %eax,%ss:lguest_data+LGUEST_DATA_irq_enabled
161 popl %eax 189 popl %eax
162 iret 190 iret
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 85307cc6e45f..bfae139182ff 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -697,7 +697,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
697 if (!printk_ratelimit()) 697 if (!printk_ratelimit())
698 return; 698 return;
699 699
700 printk(KERN_CONT "%s%s[%d]: segfault at %lx ip %p sp %p error %lx", 700 printk("%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
701 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, 701 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
702 tsk->comm, task_pid_nr(tsk), address, 702 tsk->comm, task_pid_nr(tsk), address,
703 (void *)regs->ip, (void *)regs->sp, error_code); 703 (void *)regs->ip, (void *)regs->sp, error_code);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 58f621e81919..2112ed55e7ea 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -103,6 +103,7 @@ EXPORT_SYMBOL(kmap);
103EXPORT_SYMBOL(kunmap); 103EXPORT_SYMBOL(kunmap);
104EXPORT_SYMBOL(kmap_atomic); 104EXPORT_SYMBOL(kmap_atomic);
105EXPORT_SYMBOL(kunmap_atomic); 105EXPORT_SYMBOL(kunmap_atomic);
106EXPORT_SYMBOL(kmap_atomic_prot);
106 107
107void __init set_highmem_pages_init(void) 108void __init set_highmem_pages_init(void)
108{ 109{
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 8e43bdd45456..af8f9650058c 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -25,7 +25,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
25 return pte; 25 return pte;
26} 26}
27 27
28void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte) 28void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
29{ 29{
30 pgtable_page_dtor(pte); 30 pgtable_page_dtor(pte);
31 paravirt_release_pte(page_to_pfn(pte)); 31 paravirt_release_pte(page_to_pfn(pte));
@@ -33,14 +33,14 @@ void __pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
33} 33}
34 34
35#if PAGETABLE_LEVELS > 2 35#if PAGETABLE_LEVELS > 2
36void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd) 36void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
37{ 37{
38 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT); 38 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
39 tlb_remove_page(tlb, virt_to_page(pmd)); 39 tlb_remove_page(tlb, virt_to_page(pmd));
40} 40}
41 41
42#if PAGETABLE_LEVELS > 3 42#if PAGETABLE_LEVELS > 3
43void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud) 43void ___pud_free_tlb(struct mmu_gather *tlb, pud_t *pud)
44{ 44{
45 paravirt_release_pud(__pa(pud) >> PAGE_SHIFT); 45 paravirt_release_pud(__pa(pud) >> PAGE_SHIFT);
46 tlb_remove_page(tlb, virt_to_page(pud)); 46 tlb_remove_page(tlb, virt_to_page(pud));
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 2dfcbf9df2ae..dbb5381f7b3b 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -79,8 +79,10 @@ static __init void bad_srat(void)
79 acpi_numa = -1; 79 acpi_numa = -1;
80 for (i = 0; i < MAX_LOCAL_APIC; i++) 80 for (i = 0; i < MAX_LOCAL_APIC; i++)
81 apicid_to_node[i] = NUMA_NO_NODE; 81 apicid_to_node[i] = NUMA_NO_NODE;
82 for (i = 0; i < MAX_NUMNODES; i++) 82 for (i = 0; i < MAX_NUMNODES; i++) {
83 nodes_add[i].start = nodes[i].end = 0; 83 nodes[i].start = nodes[i].end = 0;
84 nodes_add[i].start = nodes_add[i].end = 0;
85 }
84 remove_all_active_ranges(); 86 remove_all_active_ranges();
85} 87}
86 88
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 0fb56db16d18..52e62e57fedd 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -35,6 +35,7 @@
35#include <asm/pat.h> 35#include <asm/pat.h>
36#include <asm/e820.h> 36#include <asm/e820.h>
37#include <asm/pci_x86.h> 37#include <asm/pci_x86.h>
38#include <asm/io_apic.h>
38 39
39 40
40static int 41static int
@@ -227,6 +228,12 @@ void __init pcibios_resource_survey(void)
227 pcibios_allocate_resources(1); 228 pcibios_allocate_resources(1);
228 229
229 e820_reserve_resources_late(); 230 e820_reserve_resources_late();
231 /*
232 * Insert the IO APIC resources after PCI initialization has
233 * occured to handle IO APICS that are mapped in on a BAR in
234 * PCI space, but before trying to assign unassigned pci res.
235 */
236 ioapic_insert_resources();
230} 237}
231 238
232/** 239/**
diff --git a/arch/xtensa/include/asm/tlb.h b/arch/xtensa/include/asm/tlb.h
index 31c220faca02..0d766f9c1083 100644
--- a/arch/xtensa/include/asm/tlb.h
+++ b/arch/xtensa/include/asm/tlb.h
@@ -42,6 +42,6 @@
42 42
43#include <asm-generic/tlb.h> 43#include <asm-generic/tlb.h>
44 44
45#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte) 45#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
46 46
47#endif /* _XTENSA_TLB_H */ 47#endif /* _XTENSA_TLB_H */
diff --git a/block/blk-core.c b/block/blk-core.c
index 4b45435c6eaf..e3299a77a0d8 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -575,13 +575,6 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
575 return NULL; 575 return NULL;
576 } 576 }
577 577
578 /*
579 * if caller didn't supply a lock, they get per-queue locking with
580 * our embedded lock
581 */
582 if (!lock)
583 lock = &q->__queue_lock;
584
585 q->request_fn = rfn; 578 q->request_fn = rfn;
586 q->prep_rq_fn = NULL; 579 q->prep_rq_fn = NULL;
587 q->unplug_fn = generic_unplug_device; 580 q->unplug_fn = generic_unplug_device;
@@ -2143,7 +2136,7 @@ bool blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
2143{ 2136{
2144 return blk_end_bidi_request(rq, error, nr_bytes, 0); 2137 return blk_end_bidi_request(rq, error, nr_bytes, 0);
2145} 2138}
2146EXPORT_SYMBOL_GPL(blk_end_request); 2139EXPORT_SYMBOL(blk_end_request);
2147 2140
2148/** 2141/**
2149 * blk_end_request_all - Helper function for drives to finish the request. 2142 * blk_end_request_all - Helper function for drives to finish the request.
@@ -2164,7 +2157,7 @@ void blk_end_request_all(struct request *rq, int error)
2164 pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes); 2157 pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
2165 BUG_ON(pending); 2158 BUG_ON(pending);
2166} 2159}
2167EXPORT_SYMBOL_GPL(blk_end_request_all); 2160EXPORT_SYMBOL(blk_end_request_all);
2168 2161
2169/** 2162/**
2170 * blk_end_request_cur - Helper function to finish the current request chunk. 2163 * blk_end_request_cur - Helper function to finish the current request chunk.
@@ -2182,7 +2175,7 @@ bool blk_end_request_cur(struct request *rq, int error)
2182{ 2175{
2183 return blk_end_request(rq, error, blk_rq_cur_bytes(rq)); 2176 return blk_end_request(rq, error, blk_rq_cur_bytes(rq));
2184} 2177}
2185EXPORT_SYMBOL_GPL(blk_end_request_cur); 2178EXPORT_SYMBOL(blk_end_request_cur);
2186 2179
2187/** 2180/**
2188 * __blk_end_request - Helper function for drivers to complete the request. 2181 * __blk_end_request - Helper function for drivers to complete the request.
@@ -2201,7 +2194,7 @@ bool __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
2201{ 2194{
2202 return __blk_end_bidi_request(rq, error, nr_bytes, 0); 2195 return __blk_end_bidi_request(rq, error, nr_bytes, 0);
2203} 2196}
2204EXPORT_SYMBOL_GPL(__blk_end_request); 2197EXPORT_SYMBOL(__blk_end_request);
2205 2198
2206/** 2199/**
2207 * __blk_end_request_all - Helper function for drives to finish the request. 2200 * __blk_end_request_all - Helper function for drives to finish the request.
@@ -2222,7 +2215,7 @@ void __blk_end_request_all(struct request *rq, int error)
2222 pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes); 2215 pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
2223 BUG_ON(pending); 2216 BUG_ON(pending);
2224} 2217}
2225EXPORT_SYMBOL_GPL(__blk_end_request_all); 2218EXPORT_SYMBOL(__blk_end_request_all);
2226 2219
2227/** 2220/**
2228 * __blk_end_request_cur - Helper function to finish the current request chunk. 2221 * __blk_end_request_cur - Helper function to finish the current request chunk.
@@ -2241,7 +2234,7 @@ bool __blk_end_request_cur(struct request *rq, int error)
2241{ 2234{
2242 return __blk_end_request(rq, error, blk_rq_cur_bytes(rq)); 2235 return __blk_end_request(rq, error, blk_rq_cur_bytes(rq));
2243} 2236}
2244EXPORT_SYMBOL_GPL(__blk_end_request_cur); 2237EXPORT_SYMBOL(__blk_end_request_cur);
2245 2238
2246void blk_rq_bio_prep(struct request_queue *q, struct request *rq, 2239void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
2247 struct bio *bio) 2240 struct bio *bio)
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 73e28d355688..15c630813b1c 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -379,6 +379,7 @@ void blk_integrity_unregister(struct gendisk *disk)
379 379
380 kobject_uevent(&bi->kobj, KOBJ_REMOVE); 380 kobject_uevent(&bi->kobj, KOBJ_REMOVE);
381 kobject_del(&bi->kobj); 381 kobject_del(&bi->kobj);
382 kobject_put(&bi->kobj);
382 kmem_cache_free(integrity_cachep, bi); 383 kmem_cache_free(integrity_cachep, bi);
383 disk->integrity = NULL; 384 disk->integrity = NULL;
384} 385}
diff --git a/block/blk-settings.c b/block/blk-settings.c
index bd582a7f5310..8a3ea3bba10d 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -165,6 +165,13 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
165 blk_set_default_limits(&q->limits); 165 blk_set_default_limits(&q->limits);
166 166
167 /* 167 /*
168 * If the caller didn't supply a lock, fall back to our embedded
169 * per-queue locks
170 */
171 if (!q->queue_lock)
172 q->queue_lock = &q->__queue_lock;
173
174 /*
168 * by default assume old behaviour and bounce for any highmem page 175 * by default assume old behaviour and bounce for any highmem page
169 */ 176 */
170 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); 177 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index b1cd04087d6a..418d63619680 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -16,9 +16,9 @@ struct queue_sysfs_entry {
16}; 16};
17 17
18static ssize_t 18static ssize_t
19queue_var_show(unsigned int var, char *page) 19queue_var_show(unsigned long var, char *page)
20{ 20{
21 return sprintf(page, "%d\n", var); 21 return sprintf(page, "%lu\n", var);
22} 22}
23 23
24static ssize_t 24static ssize_t
@@ -77,7 +77,8 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
77 77
78static ssize_t queue_ra_show(struct request_queue *q, char *page) 78static ssize_t queue_ra_show(struct request_queue *q, char *page)
79{ 79{
80 int ra_kb = q->backing_dev_info.ra_pages << (PAGE_CACHE_SHIFT - 10); 80 unsigned long ra_kb = q->backing_dev_info.ra_pages <<
81 (PAGE_CACHE_SHIFT - 10);
81 82
82 return queue_var_show(ra_kb, (page)); 83 return queue_var_show(ra_kb, (page));
83} 84}
@@ -189,9 +190,9 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
189 190
190static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page) 191static ssize_t queue_rq_affinity_show(struct request_queue *q, char *page)
191{ 192{
192 unsigned int set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags); 193 bool set = test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags);
193 194
194 return queue_var_show(set != 0, page); 195 return queue_var_show(set, page);
195} 196}
196 197
197static ssize_t 198static ssize_t
diff --git a/block/elevator.c b/block/elevator.c
index 6f2375339a99..2d511f9105e1 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -101,11 +101,16 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio)
101 return 0; 101 return 0;
102 102
103 /* 103 /*
104 * Don't merge if failfast settings don't match 104 * Don't merge if failfast settings don't match.
105 *
106 * FIXME: The negation in front of each condition is necessary
107 * because bio and request flags use different bit positions
108 * and the accessors return those bits directly. This
109 * ugliness will soon go away.
105 */ 110 */
106 if (bio_failfast_dev(bio) != blk_failfast_dev(rq) || 111 if (!bio_failfast_dev(bio) != !blk_failfast_dev(rq) ||
107 bio_failfast_transport(bio) != blk_failfast_transport(rq) || 112 !bio_failfast_transport(bio) != !blk_failfast_transport(rq) ||
108 bio_failfast_driver(bio) != blk_failfast_driver(rq)) 113 !bio_failfast_driver(bio) != !blk_failfast_driver(rq))
109 return 0; 114 return 0;
110 115
111 if (!elv_iosched_allow_merge(rq, bio)) 116 if (!elv_iosched_allow_merge(rq, bio))
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 95fe2c8d6c51..90dd3f8bd283 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -300,7 +300,7 @@ EXPORT_SYMBOL_GPL(async_xor_zero_sum);
300 300
301static int __init async_xor_init(void) 301static int __init async_xor_init(void)
302{ 302{
303 #ifdef CONFIG_DMA_ENGINE 303 #ifdef CONFIG_ASYNC_TX_DMA
304 /* To conserve stack space the input src_list (array of page pointers) 304 /* To conserve stack space the input src_list (array of page pointers)
305 * is reused to hold the array of dma addresses passed to the driver. 305 * is reused to hold the array of dma addresses passed to the driver.
306 * This conversion is only possible when dma_addr_t is less than the 306 * This conversion is only possible when dma_addr_t is less than the
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 01574a066534..42159a28f433 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -397,6 +397,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
397 }, 397 },
398 }, 398 },
399 { 399 {
400 .callback = init_set_sci_en_on_resume,
401 .ident = "Hewlett-Packard HP G7000 Notebook PC",
402 .matches = {
403 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
404 DMI_MATCH(DMI_PRODUCT_NAME, "HP G7000 Notebook PC"),
405 },
406 },
407 {
400 .callback = init_old_suspend_ordering, 408 .callback = init_old_suspend_ordering,
401 .ident = "Panasonic CF51-2L", 409 .ident = "Panasonic CF51-2L",
402 .matches = { 410 .matches = {
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 15a23031833f..958c1fa41900 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -513,11 +513,16 @@ static const struct pci_device_id ahci_pci_tbl[] = {
513 { PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */ 513 { PCI_VDEVICE(INTEL, 0x502a), board_ahci }, /* Tolapai */
514 { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */ 514 { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */
515 { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */ 515 { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */
516 { PCI_VDEVICE(INTEL, 0x3a22), board_ahci }, /* ICH10 */
516 { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */ 517 { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */
518 { PCI_VDEVICE(INTEL, 0x3b22), board_ahci }, /* PCH AHCI */
519 { PCI_VDEVICE(INTEL, 0x3b23), board_ahci }, /* PCH AHCI */
517 { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */ 520 { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */
518 { PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */ 521 { PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */
522 { PCI_VDEVICE(INTEL, 0x3b29), board_ahci }, /* PCH AHCI */
519 { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */ 523 { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */
520 { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */ 524 { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */
525 { PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */
521 526
522 /* JMicron 360/1/3/5/6, match class to avoid IDE function */ 527 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
523 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 528 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d0a14cf2bd74..56b8a3ff1286 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -596,9 +596,12 @@ static const struct ich_laptop ich_laptop[] = {
596 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ 596 { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
597 { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */ 597 { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */
598 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ 598 { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
599 { 0x27DF, 0x1028, 0x02b0 }, /* ICH7 on unknown Dell */
599 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ 600 { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
600 { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */ 601 { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */
602 { 0x27DF, 0x103C, 0x361a }, /* ICH7 on unkown HP */
601 { 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */ 603 { 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */
604 { 0x27DF, 0x152D, 0x0778 }, /* ICH7 on unknown Intel */
602 { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ 605 { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */
603 { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */ 606 { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */
604 { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ 607 { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 045a486a09ea..8ac98ff16d7d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1515,6 +1515,7 @@ static int ata_hpa_resize(struct ata_device *dev)
1515 1515
1516 return rc; 1516 return rc;
1517 } 1517 }
1518 dev->n_native_sectors = native_sectors;
1518 1519
1519 /* nothing to do? */ 1520 /* nothing to do? */
1520 if (native_sectors <= sectors || !ata_ignore_hpa) { 1521 if (native_sectors <= sectors || !ata_ignore_hpa) {
@@ -3392,17 +3393,27 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
3392 3393
3393static int ata_dev_set_mode(struct ata_device *dev) 3394static int ata_dev_set_mode(struct ata_device *dev)
3394{ 3395{
3396 struct ata_port *ap = dev->link->ap;
3395 struct ata_eh_context *ehc = &dev->link->eh_context; 3397 struct ata_eh_context *ehc = &dev->link->eh_context;
3398 const bool nosetxfer = dev->horkage & ATA_HORKAGE_NOSETXFER;
3396 const char *dev_err_whine = ""; 3399 const char *dev_err_whine = "";
3397 int ign_dev_err = 0; 3400 int ign_dev_err = 0;
3398 unsigned int err_mask; 3401 unsigned int err_mask = 0;
3399 int rc; 3402 int rc;
3400 3403
3401 dev->flags &= ~ATA_DFLAG_PIO; 3404 dev->flags &= ~ATA_DFLAG_PIO;
3402 if (dev->xfer_shift == ATA_SHIFT_PIO) 3405 if (dev->xfer_shift == ATA_SHIFT_PIO)
3403 dev->flags |= ATA_DFLAG_PIO; 3406 dev->flags |= ATA_DFLAG_PIO;
3404 3407
3405 err_mask = ata_dev_set_xfermode(dev); 3408 if (nosetxfer && ap->flags & ATA_FLAG_SATA && ata_id_is_sata(dev->id))
3409 dev_err_whine = " (SET_XFERMODE skipped)";
3410 else {
3411 if (nosetxfer)
3412 ata_dev_printk(dev, KERN_WARNING,
3413 "NOSETXFER but PATA detected - can't "
3414 "skip SETXFER, might malfunction\n");
3415 err_mask = ata_dev_set_xfermode(dev);
3416 }
3406 3417
3407 if (err_mask & ~AC_ERR_DEV) 3418 if (err_mask & ~AC_ERR_DEV)
3408 goto fail; 3419 goto fail;
@@ -4089,6 +4100,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4089 unsigned int readid_flags) 4100 unsigned int readid_flags)
4090{ 4101{
4091 u64 n_sectors = dev->n_sectors; 4102 u64 n_sectors = dev->n_sectors;
4103 u64 n_native_sectors = dev->n_native_sectors;
4092 int rc; 4104 int rc;
4093 4105
4094 if (!ata_dev_enabled(dev)) 4106 if (!ata_dev_enabled(dev))
@@ -4118,16 +4130,30 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4118 /* verify n_sectors hasn't changed */ 4130 /* verify n_sectors hasn't changed */
4119 if (dev->class == ATA_DEV_ATA && n_sectors && 4131 if (dev->class == ATA_DEV_ATA && n_sectors &&
4120 dev->n_sectors != n_sectors) { 4132 dev->n_sectors != n_sectors) {
4121 ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " 4133 ata_dev_printk(dev, KERN_WARNING, "n_sectors mismatch "
4122 "%llu != %llu\n", 4134 "%llu != %llu\n",
4123 (unsigned long long)n_sectors, 4135 (unsigned long long)n_sectors,
4124 (unsigned long long)dev->n_sectors); 4136 (unsigned long long)dev->n_sectors);
4125 4137 /*
4126 /* restore original n_sectors */ 4138 * Something could have caused HPA to be unlocked
4127 dev->n_sectors = n_sectors; 4139 * involuntarily. If n_native_sectors hasn't changed
4128 4140 * and the new size matches it, keep the device.
4129 rc = -ENODEV; 4141 */
4130 goto fail; 4142 if (dev->n_native_sectors == n_native_sectors &&
4143 dev->n_sectors > n_sectors &&
4144 dev->n_sectors == n_native_sectors) {
4145 ata_dev_printk(dev, KERN_WARNING,
4146 "new n_sectors matches native, probably "
4147 "late HPA unlock, continuing\n");
4148 /* keep using the old n_sectors */
4149 dev->n_sectors = n_sectors;
4150 } else {
4151 /* restore original n_[native]_sectors and fail */
4152 dev->n_native_sectors = n_native_sectors;
4153 dev->n_sectors = n_sectors;
4154 rc = -ENODEV;
4155 goto fail;
4156 }
4131 } 4157 }
4132 4158
4133 return 0; 4159 return 0;
@@ -4297,6 +4323,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4297 /* Devices which aren't very happy with higher link speeds */ 4323 /* Devices which aren't very happy with higher link speeds */
4298 { "WD My Book", NULL, ATA_HORKAGE_1_5_GBPS, }, 4324 { "WD My Book", NULL, ATA_HORKAGE_1_5_GBPS, },
4299 4325
4326 /*
4327 * Devices which choke on SETXFER. Applies only if both the
4328 * device and controller are SATA.
4329 */
4330 { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER },
4331
4300 /* End Marker */ 4332 /* End Marker */
4301 { } 4333 { }
4302}; 4334};
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index fa22f94ca415..79711b64054b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2327,7 +2327,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
2327 struct ata_port *ap = link->ap; 2327 struct ata_port *ap = link->ap;
2328 struct ata_link *slave = ap->slave_link; 2328 struct ata_link *slave = ap->slave_link;
2329 struct ata_eh_context *ehc = &link->eh_context; 2329 struct ata_eh_context *ehc = &link->eh_context;
2330 struct ata_eh_context *sehc = &slave->eh_context; 2330 struct ata_eh_context *sehc = slave ? &slave->eh_context : NULL;
2331 unsigned int *classes = ehc->classes; 2331 unsigned int *classes = ehc->classes;
2332 unsigned int lflags = link->flags; 2332 unsigned int lflags = link->flags;
2333 int verbose = !(ehc->i.flags & ATA_EHI_QUIET); 2333 int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
@@ -2517,6 +2517,10 @@ int ata_eh_reset(struct ata_link *link, int classify,
2517 2517
2518 ata_eh_about_to_do(link, NULL, ATA_EH_RESET); 2518 ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
2519 rc = ata_do_reset(link, reset, classes, deadline, true); 2519 rc = ata_do_reset(link, reset, classes, deadline, true);
2520 if (rc) {
2521 failed_link = link;
2522 goto fail;
2523 }
2520 } 2524 }
2521 } else { 2525 } else {
2522 if (verbose) 2526 if (verbose)
diff --git a/drivers/ata/pata_at91.c b/drivers/ata/pata_at91.c
index 4b27617be26d..5702affcb325 100644
--- a/drivers/ata/pata_at91.c
+++ b/drivers/ata/pata_at91.c
@@ -26,9 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/ata_platform.h> 27#include <linux/ata_platform.h>
28 28
29#include <mach/at91sam9260_matrix.h>
30#include <mach/at91sam9_smc.h> 29#include <mach/at91sam9_smc.h>
31#include <mach/at91sam9260.h>
32#include <mach/board.h> 30#include <mach/board.h>
33#include <mach/gpio.h> 31#include <mach/gpio.h>
34 32
@@ -44,65 +42,62 @@ struct at91_ide_info {
44 unsigned long mode; 42 unsigned long mode;
45 unsigned int cs; 43 unsigned int cs;
46 44
45 struct clk *mck;
46
47 void __iomem *ide_addr; 47 void __iomem *ide_addr;
48 void __iomem *alt_addr; 48 void __iomem *alt_addr;
49}; 49};
50 50
51const struct ata_timing initial_timing = 51static const struct ata_timing initial_timing =
52 {XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0}; 52 {XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0};
53 53
54static unsigned int calc_mck_cycles(unsigned int ns, unsigned int mck_hz) 54static unsigned long calc_mck_cycles(unsigned long ns, unsigned long mck_hz)
55{ 55{
56 unsigned long mul; 56 unsigned long mul;
57 57
58 /* 58 /*
59 * cycles = x [nsec] * f [Hz] / 10^9 [ns in sec] = 59 * cycles = x [nsec] * f [Hz] / 10^9 [ns in sec] =
60 * x * (f / 1_000_000_000) = 60 * x * (f / 1_000_000_000) =
61 * x * ((f * 65536) / 1_000_000_000) / 65536 = 61 * x * ((f * 65536) / 1_000_000_000) / 65536 =
62 * x * (((f / 10_000) * 65536) / 100_000) / 65536 = 62 * x * (((f / 10_000) * 65536) / 100_000) / 65536 =
63 */ 63 */
64 64
65 mul = (mck_hz / 10000) << 16; 65 mul = (mck_hz / 10000) << 16;
66 mul /= 100000; 66 mul /= 100000;
67 67
68 return (ns * mul + 65536) >> 16; /* rounding */ 68 return (ns * mul + 65536) >> 16; /* rounding */
69} 69}
70 70
71static void set_smc_mode(struct at91_ide_info *info) 71static void set_smc_mode(struct at91_ide_info *info)
72{ 72{
73 at91_sys_write(AT91_SMC_MODE(info->cs), info->mode); 73 at91_sys_write(AT91_SMC_MODE(info->cs), info->mode);
74 return; 74 return;
75} 75}
76 76
77static void set_smc_timing(struct device *dev, 77static void set_smc_timing(struct device *dev,
78 struct at91_ide_info *info, const struct ata_timing *ata) 78 struct at91_ide_info *info, const struct ata_timing *ata)
79{ 79{
80 int read_cycle, write_cycle, active, recover; 80 unsigned long read_cycle, write_cycle, active, recover;
81 int nrd_setup, nrd_pulse, nrd_recover; 81 unsigned long nrd_setup, nrd_pulse, nrd_recover;
82 int nwe_setup, nwe_pulse; 82 unsigned long nwe_setup, nwe_pulse;
83 83
84 int ncs_write_setup, ncs_write_pulse; 84 unsigned long ncs_write_setup, ncs_write_pulse;
85 int ncs_read_setup, ncs_read_pulse; 85 unsigned long ncs_read_setup, ncs_read_pulse;
86 86
87 unsigned int mck_hz; 87 unsigned long mck_hz;
88 struct clk *mck;
89 88
90 read_cycle = ata->cyc8b; 89 read_cycle = ata->cyc8b;
91 nrd_setup = ata->setup; 90 nrd_setup = ata->setup;
92 nrd_pulse = ata->act8b; 91 nrd_pulse = ata->act8b;
93 nrd_recover = ata->rec8b; 92 nrd_recover = ata->rec8b;
94 93
95 mck = clk_get(NULL, "mck"); 94 mck_hz = clk_get_rate(info->mck);
96 BUG_ON(IS_ERR(mck));
97 mck_hz = clk_get_rate(mck);
98 95
99 read_cycle = calc_mck_cycles(read_cycle, mck_hz); 96 read_cycle = calc_mck_cycles(read_cycle, mck_hz);
100 nrd_setup = calc_mck_cycles(nrd_setup, mck_hz); 97 nrd_setup = calc_mck_cycles(nrd_setup, mck_hz);
101 nrd_pulse = calc_mck_cycles(nrd_pulse, mck_hz); 98 nrd_pulse = calc_mck_cycles(nrd_pulse, mck_hz);
102 nrd_recover = calc_mck_cycles(nrd_recover, mck_hz); 99 nrd_recover = calc_mck_cycles(nrd_recover, mck_hz);
103 100
104 clk_put(mck);
105
106 active = nrd_setup + nrd_pulse; 101 active = nrd_setup + nrd_pulse;
107 recover = read_cycle - active; 102 recover = read_cycle - active;
108 103
@@ -121,13 +116,13 @@ static void set_smc_timing(struct device *dev,
121 ncs_write_setup = ncs_read_setup; 116 ncs_write_setup = ncs_read_setup;
122 ncs_write_pulse = ncs_read_pulse; 117 ncs_write_pulse = ncs_read_pulse;
123 118
124 dev_dbg(dev, "ATA timings: nrd_setup = %d nrd_pulse = %d nrd_cycle = %d\n", 119 dev_dbg(dev, "ATA timings: nrd_setup = %lu nrd_pulse = %lu nrd_cycle = %lu\n",
125 nrd_setup, nrd_pulse, read_cycle); 120 nrd_setup, nrd_pulse, read_cycle);
126 dev_dbg(dev, "ATA timings: nwe_setup = %d nwe_pulse = %d nwe_cycle = %d\n", 121 dev_dbg(dev, "ATA timings: nwe_setup = %lu nwe_pulse = %lu nwe_cycle = %lu\n",
127 nwe_setup, nwe_pulse, write_cycle); 122 nwe_setup, nwe_pulse, write_cycle);
128 dev_dbg(dev, "ATA timings: ncs_read_setup = %d ncs_read_pulse = %d\n", 123 dev_dbg(dev, "ATA timings: ncs_read_setup = %lu ncs_read_pulse = %lu\n",
129 ncs_read_setup, ncs_read_pulse); 124 ncs_read_setup, ncs_read_pulse);
130 dev_dbg(dev, "ATA timings: ncs_write_setup = %d ncs_write_pulse = %d\n", 125 dev_dbg(dev, "ATA timings: ncs_write_setup = %lu ncs_write_pulse = %lu\n",
131 ncs_write_setup, ncs_write_pulse); 126 ncs_write_setup, ncs_write_pulse);
132 127
133 at91_sys_write(AT91_SMC_SETUP(info->cs), 128 at91_sys_write(AT91_SMC_SETUP(info->cs),
@@ -217,6 +212,7 @@ static int __devinit pata_at91_probe(struct platform_device *pdev)
217 struct resource *mem_res; 212 struct resource *mem_res;
218 struct ata_host *host; 213 struct ata_host *host;
219 struct ata_port *ap; 214 struct ata_port *ap;
215
220 int irq_flags = 0; 216 int irq_flags = 0;
221 int irq = 0; 217 int irq = 0;
222 int ret; 218 int ret;
@@ -261,6 +257,13 @@ static int __devinit pata_at91_probe(struct platform_device *pdev)
261 return -ENOMEM; 257 return -ENOMEM;
262 } 258 }
263 259
260 info->mck = clk_get(NULL, "mck");
261
262 if (IS_ERR(info->mck)) {
263 dev_err(dev, "failed to get access to mck clock\n");
264 return -ENODEV;
265 }
266
264 info->cs = board->chipselect; 267 info->cs = board->chipselect;
265 info->mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | 268 info->mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
266 AT91_SMC_EXNWMODE_READY | AT91_SMC_BAT_SELECT | 269 AT91_SMC_EXNWMODE_READY | AT91_SMC_BAT_SELECT |
@@ -304,6 +307,7 @@ err_alt_ioremap:
304 devm_iounmap(dev, info->ide_addr); 307 devm_iounmap(dev, info->ide_addr);
305 308
306err_ide_ioremap: 309err_ide_ioremap:
310 clk_put(info->mck);
307 kfree(info); 311 kfree(info);
308 312
309 return ret; 313 return ret;
@@ -312,11 +316,12 @@ err_ide_ioremap:
312static int __devexit pata_at91_remove(struct platform_device *pdev) 316static int __devexit pata_at91_remove(struct platform_device *pdev)
313{ 317{
314 struct ata_host *host = dev_get_drvdata(&pdev->dev); 318 struct ata_host *host = dev_get_drvdata(&pdev->dev);
315 struct at91_ide_info *info = host->private_data; 319 struct at91_ide_info *info;
316 struct device *dev = &pdev->dev; 320 struct device *dev = &pdev->dev;
317 321
318 if (!host) 322 if (!host)
319 return 0; 323 return 0;
324 info = host->private_data;
320 325
321 ata_host_detach(host); 326 ata_host_detach(host);
322 327
@@ -325,6 +330,7 @@ static int __devexit pata_at91_remove(struct platform_device *pdev)
325 330
326 devm_iounmap(dev, info->ide_addr); 331 devm_iounmap(dev, info->ide_addr);
327 devm_iounmap(dev, info->alt_addr); 332 devm_iounmap(dev, info->alt_addr);
333 clk_put(info->mck);
328 334
329 kfree(info); 335 kfree(info);
330 return 0; 336 return 0;
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 8d9343accf3c..abdd19fe990a 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -653,7 +653,8 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)
653 653
654 ap = host->ports[i]; 654 ap = host->ports[i];
655 ocd = ap->dev->platform_data; 655 ocd = ap->dev->platform_data;
656 if (!ap || (ap->flags & ATA_FLAG_DISABLED)) 656
657 if (ap->flags & ATA_FLAG_DISABLED)
657 continue; 658 continue;
658 659
659 ocd = ap->dev->platform_data; 660 ocd = ap->dev->platform_data;
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index f4d009ed50ac..dc99e26f8e5b 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -411,6 +411,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
411 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9), 411 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9),
412 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "CD-ROM", 0x78f308dc, 0x66536591), 412 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "CD-ROM", 0x78f308dc, 0x66536591),
413 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "PnPIDE", 0x78f308dc, 0x0c694728), 413 PCMCIA_DEVICE_PROD_ID12("ARGOSY", "PnPIDE", 0x78f308dc, 0x0c694728),
414 PCMCIA_DEVICE_PROD_ID12("CNF ", "CD-ROM", 0x46d7db81, 0x66536591),
414 PCMCIA_DEVICE_PROD_ID12("CNF CD-M", "CD-ROM", 0x7d93b852, 0x66536591), 415 PCMCIA_DEVICE_PROD_ID12("CNF CD-M", "CD-ROM", 0x7d93b852, 0x66536591),
415 PCMCIA_DEVICE_PROD_ID12("Creative Technology Ltd.", "PCMCIA CD-ROM Interface Card", 0xff8c8a45, 0xfe8020c4), 416 PCMCIA_DEVICE_PROD_ID12("Creative Technology Ltd.", "PCMCIA CD-ROM Interface Card", 0xff8c8a45, 0xfe8020c4),
416 PCMCIA_DEVICE_PROD_ID12("Digital Equipment Corporation.", "Digital Mobile Media CD-ROM", 0x17692a66, 0xef1dcbde), 417 PCMCIA_DEVICE_PROD_ID12("Digital Equipment Corporation.", "Digital Mobile Media CD-ROM", 0x17692a66, 0xef1dcbde),
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 23714aefb825..c19417e02208 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2514,7 +2514,7 @@ static void mv_unexpected_intr(struct ata_port *ap, int edma_was_enabled)
2514 char *when = "idle"; 2514 char *when = "idle";
2515 2515
2516 ata_ehi_clear_desc(ehi); 2516 ata_ehi_clear_desc(ehi);
2517 if (!ap || (ap->flags & ATA_FLAG_DISABLED)) { 2517 if (ap->flags & ATA_FLAG_DISABLED) {
2518 when = "disabled"; 2518 when = "disabled";
2519 } else if (edma_was_enabled) { 2519 } else if (edma_was_enabled) {
2520 when = "EDMA enabled"; 2520 when = "EDMA enabled";
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index 030ec079b184..35bd5cc7f285 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -532,7 +532,7 @@ static irqreturn_t sil_interrupt(int irq, void *dev_instance)
532 struct ata_port *ap = host->ports[i]; 532 struct ata_port *ap = host->ports[i];
533 u32 bmdma2 = readl(mmio_base + sil_port[ap->port_no].bmdma2); 533 u32 bmdma2 = readl(mmio_base + sil_port[ap->port_no].bmdma2);
534 534
535 if (unlikely(!ap || ap->flags & ATA_FLAG_DISABLED)) 535 if (unlikely(ap->flags & ATA_FLAG_DISABLED))
536 continue; 536 continue;
537 537
538 /* turn off SATA_IRQ if not supported */ 538 /* turn off SATA_IRQ if not supported */
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index e8beb8e5b626..05dd307e8f02 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -428,6 +428,9 @@ int devres_release_all(struct device *dev)
428{ 428{
429 unsigned long flags; 429 unsigned long flags;
430 430
431 /* Looks like an uninitialized device structure */
432 if (WARN_ON(dev->devres_head.next == NULL))
433 return -ENODEV;
431 spin_lock_irqsave(&dev->devres_lock, flags); 434 spin_lock_irqsave(&dev->devres_lock, flags);
432 return release_nodes(dev, dev->devres_head.next, &dev->devres_head, 435 return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
433 flags); 436 flags);
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index fc466531260e..7376367bcb80 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -180,7 +180,6 @@ static ssize_t firmware_loading_store(struct device *dev,
180 goto err; 180 goto err;
181 } 181 }
182 /* Pages will be freed by vfree() */ 182 /* Pages will be freed by vfree() */
183 fw_priv->pages = NULL;
184 fw_priv->page_array_size = 0; 183 fw_priv->page_array_size = 0;
185 fw_priv->nr_pages = 0; 184 fw_priv->nr_pages = 0;
186 complete(&fw_priv->completion); 185 complete(&fw_priv->completion);
@@ -217,8 +216,10 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr,
217 ret_count = -ENODEV; 216 ret_count = -ENODEV;
218 goto out; 217 goto out;
219 } 218 }
220 if (offset > fw->size) 219 if (offset > fw->size) {
221 return 0; 220 ret_count = 0;
221 goto out;
222 }
222 if (count > fw->size - offset) 223 if (count > fw->size - offset)
223 count = fw->size - offset; 224 count = fw->size - offset;
224 225
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 79a9ae5238ac..0d903909af7e 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -275,9 +275,9 @@ int sysdev_register(struct sys_device *sysdev)
275 drv->add(sysdev); 275 drv->add(sysdev);
276 } 276 }
277 mutex_unlock(&sysdev_drivers_lock); 277 mutex_unlock(&sysdev_drivers_lock);
278 kobject_uevent(&sysdev->kobj, KOBJ_ADD);
278 } 279 }
279 280
280 kobject_uevent(&sysdev->kobj, KOBJ_ADD);
281 return error; 281 return error;
282} 282}
283 283
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 668dc234b8e2..1e6b7c14f697 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -36,6 +36,7 @@
36#include <linux/ioport.h> 36#include <linux/ioport.h>
37#include <linux/mm.h> 37#include <linux/mm.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/smp_lock.h>
39#include <linux/proc_fs.h> 40#include <linux/proc_fs.h>
40#include <linux/reboot.h> 41#include <linux/reboot.h>
41#include <linux/spinlock.h> 42#include <linux/spinlock.h>
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index f5e7180d7f47..3ff02941b3dd 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1627,7 +1627,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
1627 drive, dtp->blocks, dtp->spt, dtp->stretch); 1627 drive, dtp->blocks, dtp->spt, dtp->stretch);
1628 1628
1629 /* sanity check */ 1629 /* sanity check */
1630 if (!dtp || setprm.track != dtp->blocks/dtp->spt/2 || 1630 if (setprm.track != dtp->blocks/dtp->spt/2 ||
1631 setprm.head != 2) { 1631 setprm.head != 2) {
1632 redo_fd_request(); 1632 redo_fd_request();
1633 return -EINVAL; 1633 return -EINVAL;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 65a0655e7fc8..a52cc7fe45ea 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -26,6 +26,7 @@
26#include <linux/pci.h> 26#include <linux/pci.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/delay.h> 30#include <linux/delay.h>
30#include <linux/major.h> 31#include <linux/major.h>
31#include <linux/fs.h> 32#include <linux/fs.h>
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 801f4ab83302..5757188cd1fb 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -61,7 +61,6 @@
61#include <linux/blkdev.h> 61#include <linux/blkdev.h>
62#include <linux/blkpg.h> 62#include <linux/blkpg.h>
63#include <linux/init.h> 63#include <linux/init.h>
64#include <linux/smp_lock.h>
65#include <linux/swap.h> 64#include <linux/swap.h>
66#include <linux/slab.h> 65#include <linux/slab.h>
67#include <linux/loop.h> 66#include <linux/loop.h>
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index f703f5478246..6d7fbaa92248 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -36,7 +36,6 @@
36 36
37/* Register offsets */ 37/* Register offsets */
38#define MG_BUFF_OFFSET 0x8000 38#define MG_BUFF_OFFSET 0x8000
39#define MG_STORAGE_BUFFER_SIZE 0x200
40#define MG_REG_OFFSET 0xC000 39#define MG_REG_OFFSET 0xC000
41#define MG_REG_FEATURE (MG_REG_OFFSET + 2) /* write case */ 40#define MG_REG_FEATURE (MG_REG_OFFSET + 2) /* write case */
42#define MG_REG_ERROR (MG_REG_OFFSET + 2) /* read case */ 41#define MG_REG_ERROR (MG_REG_OFFSET + 2) /* read case */
@@ -219,6 +218,16 @@ static unsigned int mg_wait(struct mg_host *host, u32 expect, u32 msec)
219 host->error = MG_ERR_NONE; 218 host->error = MG_ERR_NONE;
220 expire = jiffies + msecs_to_jiffies(msec); 219 expire = jiffies + msecs_to_jiffies(msec);
221 220
221 /* These 2 times dummy status read prevents reading invalid
222 * status. A very little time (3 times of mflash operating clk)
223 * is required for busy bit is set. Use dummy read instead of
224 * busy wait, because mflash's PLL is machine dependent.
225 */
226 if (prv_data->use_polling) {
227 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
228 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
229 }
230
222 status = inb((unsigned long)host->dev_base + MG_REG_STATUS); 231 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
223 232
224 do { 233 do {
@@ -245,8 +254,6 @@ static unsigned int mg_wait(struct mg_host *host, u32 expect, u32 msec)
245 mg_dump_status("not ready", status, host); 254 mg_dump_status("not ready", status, host);
246 return MG_ERR_INV_STAT; 255 return MG_ERR_INV_STAT;
247 } 256 }
248 if (prv_data->use_polling)
249 msleep(1);
250 257
251 status = inb((unsigned long)host->dev_base + MG_REG_STATUS); 258 status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
252 } while (time_before(cur_jiffies, expire)); 259 } while (time_before(cur_jiffies, expire));
@@ -469,9 +476,18 @@ static unsigned int mg_out(struct mg_host *host,
469 return MG_ERR_NONE; 476 return MG_ERR_NONE;
470} 477}
471 478
479static void mg_read_one(struct mg_host *host, struct request *req)
480{
481 u16 *buff = (u16 *)req->buffer;
482 u32 i;
483
484 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++)
485 *buff++ = inw((unsigned long)host->dev_base + MG_BUFF_OFFSET +
486 (i << 1));
487}
488
472static void mg_read(struct request *req) 489static void mg_read(struct request *req)
473{ 490{
474 u32 j;
475 struct mg_host *host = req->rq_disk->private_data; 491 struct mg_host *host = req->rq_disk->private_data;
476 492
477 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req), 493 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req),
@@ -482,49 +498,65 @@ static void mg_read(struct request *req)
482 blk_rq_sectors(req), blk_rq_pos(req), req->buffer); 498 blk_rq_sectors(req), blk_rq_pos(req), req->buffer);
483 499
484 do { 500 do {
485 u16 *buff = (u16 *)req->buffer;
486
487 if (mg_wait(host, ATA_DRQ, 501 if (mg_wait(host, ATA_DRQ,
488 MG_TMAX_WAIT_RD_DRQ) != MG_ERR_NONE) { 502 MG_TMAX_WAIT_RD_DRQ) != MG_ERR_NONE) {
489 mg_bad_rw_intr(host); 503 mg_bad_rw_intr(host);
490 return; 504 return;
491 } 505 }
492 for (j = 0; j < MG_SECTOR_SIZE >> 1; j++) 506
493 *buff++ = inw((unsigned long)host->dev_base + 507 mg_read_one(host, req);
494 MG_BUFF_OFFSET + (j << 1));
495 508
496 outb(MG_CMD_RD_CONF, (unsigned long)host->dev_base + 509 outb(MG_CMD_RD_CONF, (unsigned long)host->dev_base +
497 MG_REG_COMMAND); 510 MG_REG_COMMAND);
498 } while (mg_end_request(host, 0, MG_SECTOR_SIZE)); 511 } while (mg_end_request(host, 0, MG_SECTOR_SIZE));
499} 512}
500 513
514static void mg_write_one(struct mg_host *host, struct request *req)
515{
516 u16 *buff = (u16 *)req->buffer;
517 u32 i;
518
519 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++)
520 outw(*buff++, (unsigned long)host->dev_base + MG_BUFF_OFFSET +
521 (i << 1));
522}
523
501static void mg_write(struct request *req) 524static void mg_write(struct request *req)
502{ 525{
503 u32 j;
504 struct mg_host *host = req->rq_disk->private_data; 526 struct mg_host *host = req->rq_disk->private_data;
527 unsigned int rem = blk_rq_sectors(req);
505 528
506 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req), 529 if (mg_out(host, blk_rq_pos(req), rem,
507 MG_CMD_WR, NULL) != MG_ERR_NONE) { 530 MG_CMD_WR, NULL) != MG_ERR_NONE) {
508 mg_bad_rw_intr(host); 531 mg_bad_rw_intr(host);
509 return; 532 return;
510 } 533 }
511 534
512 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n", 535 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n",
513 blk_rq_sectors(req), blk_rq_pos(req), req->buffer); 536 rem, blk_rq_pos(req), req->buffer);
537
538 if (mg_wait(host, ATA_DRQ,
539 MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) {
540 mg_bad_rw_intr(host);
541 return;
542 }
514 543
515 do { 544 do {
516 u16 *buff = (u16 *)req->buffer; 545 mg_write_one(host, req);
517 546
518 if (mg_wait(host, ATA_DRQ, MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) { 547 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
548 MG_REG_COMMAND);
549
550 rem--;
551 if (rem > 1 && mg_wait(host, ATA_DRQ,
552 MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) {
553 mg_bad_rw_intr(host);
554 return;
555 } else if (mg_wait(host, MG_STAT_READY,
556 MG_TMAX_WAIT_WR_DRQ) != MG_ERR_NONE) {
519 mg_bad_rw_intr(host); 557 mg_bad_rw_intr(host);
520 return; 558 return;
521 } 559 }
522 for (j = 0; j < MG_SECTOR_SIZE >> 1; j++)
523 outw(*buff++, (unsigned long)host->dev_base +
524 MG_BUFF_OFFSET + (j << 1));
525
526 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
527 MG_REG_COMMAND);
528 } while (mg_end_request(host, 0, MG_SECTOR_SIZE)); 560 } while (mg_end_request(host, 0, MG_SECTOR_SIZE));
529} 561}
530 562
@@ -532,7 +564,6 @@ static void mg_read_intr(struct mg_host *host)
532{ 564{
533 struct request *req = host->req; 565 struct request *req = host->req;
534 u32 i; 566 u32 i;
535 u16 *buff;
536 567
537 /* check status */ 568 /* check status */
538 do { 569 do {
@@ -550,13 +581,7 @@ static void mg_read_intr(struct mg_host *host)
550 return; 581 return;
551 582
552ok_to_read: 583ok_to_read:
553 /* get current segment of request */ 584 mg_read_one(host, req);
554 buff = (u16 *)req->buffer;
555
556 /* read 1 sector */
557 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++)
558 *buff++ = inw((unsigned long)host->dev_base + MG_BUFF_OFFSET +
559 (i << 1));
560 585
561 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n", 586 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n",
562 blk_rq_pos(req), blk_rq_sectors(req) - 1, req->buffer); 587 blk_rq_pos(req), blk_rq_sectors(req) - 1, req->buffer);
@@ -575,8 +600,7 @@ ok_to_read:
575static void mg_write_intr(struct mg_host *host) 600static void mg_write_intr(struct mg_host *host)
576{ 601{
577 struct request *req = host->req; 602 struct request *req = host->req;
578 u32 i, j; 603 u32 i;
579 u16 *buff;
580 bool rem; 604 bool rem;
581 605
582 /* check status */ 606 /* check status */
@@ -597,12 +621,7 @@ static void mg_write_intr(struct mg_host *host)
597ok_to_write: 621ok_to_write:
598 if ((rem = mg_end_request(host, 0, MG_SECTOR_SIZE))) { 622 if ((rem = mg_end_request(host, 0, MG_SECTOR_SIZE))) {
599 /* write 1 sector and set handler if remains */ 623 /* write 1 sector and set handler if remains */
600 buff = (u16 *)req->buffer; 624 mg_write_one(host, req);
601 for (j = 0; j < MG_STORAGE_BUFFER_SIZE >> 1; j++) {
602 outw(*buff, (unsigned long)host->dev_base +
603 MG_BUFF_OFFSET + (j << 1));
604 buff++;
605 }
606 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n", 625 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n",
607 blk_rq_pos(req), blk_rq_sectors(req), req->buffer); 626 blk_rq_pos(req), blk_rq_sectors(req), req->buffer);
608 host->mg_do_intr = mg_write_intr; 627 host->mg_do_intr = mg_write_intr;
@@ -667,9 +686,6 @@ static unsigned int mg_issue_req(struct request *req,
667 unsigned int sect_num, 686 unsigned int sect_num,
668 unsigned int sect_cnt) 687 unsigned int sect_cnt)
669{ 688{
670 u16 *buff;
671 u32 i;
672
673 switch (rq_data_dir(req)) { 689 switch (rq_data_dir(req)) {
674 case READ: 690 case READ:
675 if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr) 691 if (mg_out(host, sect_num, sect_cnt, MG_CMD_RD, &mg_read_intr)
@@ -693,12 +709,7 @@ static unsigned int mg_issue_req(struct request *req,
693 mg_bad_rw_intr(host); 709 mg_bad_rw_intr(host);
694 return host->error; 710 return host->error;
695 } 711 }
696 buff = (u16 *)req->buffer; 712 mg_write_one(host, req);
697 for (i = 0; i < MG_SECTOR_SIZE >> 1; i++) {
698 outw(*buff, (unsigned long)host->dev_base +
699 MG_BUFF_OFFSET + (i << 1));
700 buff++;
701 }
702 mod_timer(&host->timer, jiffies + 3 * HZ); 713 mod_timer(&host->timer, jiffies + 3 * HZ);
703 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base + 714 outb(MG_CMD_WR_CONF, (unsigned long)host->dev_base +
704 MG_REG_COMMAND); 715 MG_REG_COMMAND);
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 43db3ea15b54..aa1a3d5a3e2b 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -213,7 +213,7 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode,
213 * Only allow the generic SCSI ioctls if the host can support it. 213 * Only allow the generic SCSI ioctls if the host can support it.
214 */ 214 */
215 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) 215 if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI))
216 return -ENOIOCTLCMD; 216 return -ENOTTY;
217 217
218 return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); 218 return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp);
219} 219}
@@ -360,6 +360,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
360 blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2); 360 blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2);
361 blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2); 361 blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2);
362 362
363 /* No need to bounce any requests */
364 blk_queue_bounce_limit(vblk->disk->queue, BLK_BOUNCE_ANY);
365
363 /* No real sector limit. */ 366 /* No real sector limit. */
364 blk_queue_max_sectors(vblk->disk->queue, -1U); 367 blk_queue_max_sectors(vblk->disk->queue, -1U);
365 368
@@ -424,7 +427,12 @@ static unsigned int features[] = {
424 VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY 427 VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY
425}; 428};
426 429
427static struct virtio_driver virtio_blk = { 430/*
431 * virtio_blk causes spurious section mismatch warning by
432 * simultaneously referring to a __devinit and a __devexit function.
433 * Use __refdata to avoid this warning.
434 */
435static struct virtio_driver __refdata virtio_blk = {
428 .feature_table = features, 436 .feature_table = features,
429 .feature_table_size = ARRAY_SIZE(features), 437 .feature_table_size = ARRAY_SIZE(features),
430 .driver.name = KBUILD_MODNAME, 438 .driver.name = KBUILD_MODNAME,
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 4575171e5beb..b2590409f25e 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -374,7 +374,7 @@ err:
374static void __exit z2_exit(void) 374static void __exit z2_exit(void)
375{ 375{
376 int i, j; 376 int i, j;
377 blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), 256); 377 blk_unregister_region(MKDEV(Z2RAM_MAJOR, 0), Z2MINOR_COUNT);
378 unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME); 378 unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
379 del_gendisk(z2ram_gendisk); 379 del_gendisk(z2ram_gendisk);
380 put_disk(z2ram_gendisk); 380 put_disk(z2ram_gendisk);
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 1df9dda2e377..d5cde6d86f89 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -28,7 +28,6 @@
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/errno.h> 32#include <linux/errno.h>
34#include <linux/sched.h> 33#include <linux/sched.h>
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 72429b6b2fa8..6c32fbf07164 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -81,6 +81,7 @@ static char *serial_version = "4.30";
81#include <linux/mm.h> 81#include <linux/mm.h>
82#include <linux/seq_file.h> 82#include <linux/seq_file.h>
83#include <linux/slab.h> 83#include <linux/slab.h>
84#include <linux/smp_lock.h>
84#include <linux/init.h> 85#include <linux/init.h>
85#include <linux/bitops.h> 86#include <linux/bitops.h>
86 87
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index f3366d3f06cf..2dafc2da0648 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -633,6 +633,7 @@
633#include <linux/tty.h> 633#include <linux/tty.h>
634#include <linux/tty_flip.h> 634#include <linux/tty_flip.h>
635#include <linux/serial.h> 635#include <linux/serial.h>
636#include <linux/smp_lock.h>
636#include <linux/major.h> 637#include <linux/major.h>
637#include <linux/string.h> 638#include <linux/string.h>
638#include <linux/fcntl.h> 639#include <linux/fcntl.h>
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index abef1f7d84fe..ff647ca1c489 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -36,6 +36,7 @@
36#include <linux/tty.h> 36#include <linux/tty.h>
37#include <linux/tty_flip.h> 37#include <linux/tty_flip.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/smp_lock.h>
39#include <linux/ioport.h> 40#include <linux/ioport.h>
40#include <linux/interrupt.h> 41#include <linux/interrupt.h>
41#include <linux/uaccess.h> 42#include <linux/uaccess.h>
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 94e7e3c8c05a..d97779ef72cb 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -552,7 +552,7 @@ static int hvc_chars_in_buffer(struct tty_struct *tty)
552 struct hvc_struct *hp = tty->driver_data; 552 struct hvc_struct *hp = tty->driver_data;
553 553
554 if (!hp) 554 if (!hp)
555 return -1; 555 return 0;
556 return hp->n_outbuf; 556 return hp->n_outbuf;
557} 557}
558 558
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 621d1184673c..4f1f4cd670da 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -122,6 +122,7 @@
122#include <linux/fs.h> 122#include <linux/fs.h>
123#include <linux/sched.h> 123#include <linux/sched.h>
124#include <linux/serial.h> 124#include <linux/serial.h>
125#include <linux/smp_lock.h>
125#include <linux/mm.h> 126#include <linux/mm.h>
126#include <linux/interrupt.h> 127#include <linux/interrupt.h>
127#include <linux/timer.h> 128#include <linux/timer.h>
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 0c999f5bb3db..ab2f3349c5c4 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/smp_lock.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <linux/tty.h> 25#include <linux/tty.h>
25#include <linux/tty_flip.h> 26#include <linux/tty_flip.h>
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 65b6ff2442c6..dd0083bbb64a 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -34,6 +34,7 @@
34#include <linux/tty.h> 34#include <linux/tty.h>
35#include <linux/tty_flip.h> 35#include <linux/tty_flip.h>
36#include <linux/major.h> 36#include <linux/major.h>
37#include <linux/smp_lock.h>
37#include <linux/string.h> 38#include <linux/string.h>
38#include <linux/fcntl.h> 39#include <linux/fcntl.h>
39#include <linux/ptrace.h> 40#include <linux/ptrace.h>
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 52d953eb30c3..dbf8d52f31d0 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -23,6 +23,7 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/signal.h> 24#include <linux/signal.h>
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/smp_lock.h>
26#include <linux/timer.h> 27#include <linux/timer.h>
27#include <linux/interrupt.h> 28#include <linux/interrupt.h>
28#include <linux/tty.h> 29#include <linux/tty.h>
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 1c43c8cdee25..c68118efad84 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -97,6 +97,7 @@
97#include <linux/slab.h> 97#include <linux/slab.h>
98#include <linux/tty.h> 98#include <linux/tty.h>
99#include <linux/errno.h> 99#include <linux/errno.h>
100#include <linux/smp_lock.h>
100#include <linux/string.h> /* used in new tty drivers */ 101#include <linux/string.h> /* used in new tty drivers */
101#include <linux/signal.h> /* used in new tty drivers */ 102#include <linux/signal.h> /* used in new tty drivers */
102#include <linux/if.h> 103#include <linux/if.h>
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 2e99158ebb8a..6934025a1ac1 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -58,6 +58,7 @@
58#include <linux/ioport.h> 58#include <linux/ioport.h>
59#include <linux/in.h> 59#include <linux/in.h>
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <linux/smp_lock.h>
61#include <linux/tty.h> 62#include <linux/tty.h>
62#include <linux/errno.h> 63#include <linux/errno.h>
63#include <linux/string.h> /* used in new tty drivers */ 64#include <linux/string.h> /* used in new tty drivers */
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 94a5d5020abc..973be2f44195 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1331,9 +1331,6 @@ handle_newline:
1331 1331
1332static void n_tty_write_wakeup(struct tty_struct *tty) 1332static void n_tty_write_wakeup(struct tty_struct *tty)
1333{ 1333{
1334 /* Write out any echoed characters that are still pending */
1335 process_echoes(tty);
1336
1337 if (tty->fasync && test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) 1334 if (tty->fasync && test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags))
1338 kill_fasync(&tty->fasync, SIGIO, POLL_OUT); 1335 kill_fasync(&tty->fasync, SIGIO, POLL_OUT);
1339} 1336}
@@ -1586,6 +1583,7 @@ static int n_tty_open(struct tty_struct *tty)
1586 1583
1587static inline int input_available_p(struct tty_struct *tty, int amt) 1584static inline int input_available_p(struct tty_struct *tty, int amt)
1588{ 1585{
1586 tty_flush_to_ldisc(tty);
1589 if (tty->icanon) { 1587 if (tty->icanon) {
1590 if (tty->canon_data) 1588 if (tty->canon_data)
1591 return 1; 1589 return 1;
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 574f1c79b6e6..ec58d8c387ff 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -828,7 +828,7 @@ static int receive_data(enum port_type index, struct nozomi *dc)
828 struct port *port = &dc->port[index]; 828 struct port *port = &dc->port[index];
829 void __iomem *addr = port->dl_addr[port->toggle_dl]; 829 void __iomem *addr = port->dl_addr[port->toggle_dl];
830 struct tty_struct *tty = tty_port_tty_get(&port->port); 830 struct tty_struct *tty = tty_port_tty_get(&port->port);
831 int i; 831 int i, ret;
832 832
833 if (unlikely(!tty)) { 833 if (unlikely(!tty)) {
834 DBG1("tty not open for port: %d?", index); 834 DBG1("tty not open for port: %d?", index);
@@ -844,12 +844,14 @@ static int receive_data(enum port_type index, struct nozomi *dc)
844 844
845 /* disable interrupt in downlink... */ 845 /* disable interrupt in downlink... */
846 disable_transmit_dl(index, dc); 846 disable_transmit_dl(index, dc);
847 return 0; 847 ret = 0;
848 goto put;
848 } 849 }
849 850
850 if (unlikely(size == 0)) { 851 if (unlikely(size == 0)) {
851 dev_err(&dc->pdev->dev, "size == 0?\n"); 852 dev_err(&dc->pdev->dev, "size == 0?\n");
852 return 1; 853 ret = 1;
854 goto put;
853 } 855 }
854 856
855 tty_buffer_request_room(tty, size); 857 tty_buffer_request_room(tty, size);
@@ -871,8 +873,10 @@ static int receive_data(enum port_type index, struct nozomi *dc)
871 } 873 }
872 874
873 set_bit(index, &dc->flip); 875 set_bit(index, &dc->flip);
876 ret = 1;
877put:
874 tty_kref_put(tty); 878 tty_kref_put(tty);
875 return 1; 879 return ret;
876} 880}
877 881
878/* Debug for interrupts */ 882/* Debug for interrupts */
@@ -1862,16 +1866,14 @@ static s32 ntty_chars_in_buffer(struct tty_struct *tty)
1862{ 1866{
1863 struct port *port = tty->driver_data; 1867 struct port *port = tty->driver_data;
1864 struct nozomi *dc = get_dc_by_tty(tty); 1868 struct nozomi *dc = get_dc_by_tty(tty);
1865 s32 rval; 1869 s32 rval = 0;
1866 1870
1867 if (unlikely(!dc || !port)) { 1871 if (unlikely(!dc || !port)) {
1868 rval = -ENODEV;
1869 goto exit_in_buffer; 1872 goto exit_in_buffer;
1870 } 1873 }
1871 1874
1872 if (unlikely(!port->port.count)) { 1875 if (unlikely(!port->port.count)) {
1873 dev_err(&dc->pdev->dev, "No tty open?\n"); 1876 dev_err(&dc->pdev->dev, "No tty open?\n");
1874 rval = -ENODEV;
1875 goto exit_in_buffer; 1877 goto exit_in_buffer;
1876 } 1878 }
1877 1879
diff --git a/drivers/char/pcmcia/ipwireless/tty.c b/drivers/char/pcmcia/ipwireless/tty.c
index 569f2f7743a7..674b3ab3587d 100644
--- a/drivers/char/pcmcia/ipwireless/tty.c
+++ b/drivers/char/pcmcia/ipwireless/tty.c
@@ -320,10 +320,10 @@ static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
320 struct ipw_tty *tty = linux_tty->driver_data; 320 struct ipw_tty *tty = linux_tty->driver_data;
321 321
322 if (!tty) 322 if (!tty)
323 return -ENODEV; 323 return 0;
324 324
325 if (!tty->open_count) 325 if (!tty->open_count)
326 return -EINVAL; 326 return 0;
327 327
328 return tty->tx_bytes_queued; 328 return tty->tx_bytes_queued;
329} 329}
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 9d1b4f548f67..6e6942c45f5b 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -22,6 +22,7 @@
22#include <linux/major.h> 22#include <linux/major.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/smp_lock.h>
25#include <linux/sysctl.h> 26#include <linux/sysctl.h>
26#include <linux/device.h> 27#include <linux/device.h>
27#include <linux/uaccess.h> 28#include <linux/uaccess.h>
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index ce81da5b2da9..d58c2eb07f07 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -44,6 +44,7 @@
44#include <linux/delay.h> 44#include <linux/delay.h>
45#include <linux/pci.h> 45#include <linux/pci.h>
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/smp_lock.h>
47#include <linux/miscdevice.h> 48#include <linux/miscdevice.h>
48#include <linux/init.h> 49#include <linux/init.h>
49 50
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 217660451237..171711acf5cd 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -47,6 +47,7 @@
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/delay.h> 48#include <linux/delay.h>
49#include <linux/tty_flip.h> 49#include <linux/tty_flip.h>
50#include <linux/smp_lock.h>
50#include <linux/spinlock.h> 51#include <linux/spinlock.h>
51#include <linux/device.h> 52#include <linux/device.h>
52 53
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 63d5b628477a..0e29a23ec4c5 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -73,6 +73,7 @@
73#include <linux/tty_driver.h> 73#include <linux/tty_driver.h>
74#include <linux/tty_flip.h> 74#include <linux/tty_flip.h>
75#include <linux/serial.h> 75#include <linux/serial.h>
76#include <linux/smp_lock.h>
76#include <linux/string.h> 77#include <linux/string.h>
77#include <linux/fcntl.h> 78#include <linux/fcntl.h>
78#include <linux/ptrace.h> 79#include <linux/ptrace.h>
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index f1f24f0ee26f..51e7a46787be 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -52,6 +52,7 @@
52#include <linux/interrupt.h> 52#include <linux/interrupt.h>
53#include <linux/serial.h> 53#include <linux/serial.h>
54#include <linux/serialP.h> 54#include <linux/serialP.h>
55#include <linux/smp_lock.h>
55#include <linux/string.h> 56#include <linux/string.h>
56#include <linux/fcntl.h> 57#include <linux/fcntl.h>
57#include <linux/ptrace.h> 58#include <linux/ptrace.h>
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index e72be4190a44..268e17f9ec3f 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -87,6 +87,7 @@
87#include <linux/tty_flip.h> 87#include <linux/tty_flip.h>
88#include <linux/mm.h> 88#include <linux/mm.h>
89#include <linux/serial.h> 89#include <linux/serial.h>
90#include <linux/smp_lock.h>
90#include <linux/fcntl.h> 91#include <linux/fcntl.h>
91#include <linux/major.h> 92#include <linux/major.h>
92#include <linux/delay.h> 93#include <linux/delay.h>
@@ -1808,10 +1809,10 @@ static int sx_tiocmset(struct tty_struct *tty, struct file *file,
1808 if (clear & TIOCM_DTR) 1809 if (clear & TIOCM_DTR)
1809 port->MSVR &= ~MSVR_DTR; 1810 port->MSVR &= ~MSVR_DTR;
1810 } 1811 }
1811 spin_lock_irqsave(&bp->lock, flags); 1812 spin_lock(&bp->lock);
1812 sx_out(bp, CD186x_CAR, port_No(port)); 1813 sx_out(bp, CD186x_CAR, port_No(port));
1813 sx_out(bp, CD186x_MSVR, port->MSVR); 1814 sx_out(bp, CD186x_MSVR, port->MSVR);
1814 spin_unlock_irqrestore(&bp->lock, flags); 1815 spin_unlock(&bp->lock);
1815 spin_unlock_irqrestore(&port->lock, flags); 1816 spin_unlock_irqrestore(&port->lock, flags);
1816 func_exit(); 1817 func_exit();
1817 return 0; 1818 return 0;
@@ -1832,11 +1833,11 @@ static int sx_send_break(struct tty_struct *tty, int length)
1832 port->break_length = SPECIALIX_TPS / HZ * length; 1833 port->break_length = SPECIALIX_TPS / HZ * length;
1833 port->COR2 |= COR2_ETC; 1834 port->COR2 |= COR2_ETC;
1834 port->IER |= IER_TXRDY; 1835 port->IER |= IER_TXRDY;
1835 spin_lock_irqsave(&bp->lock, flags); 1836 spin_lock(&bp->lock);
1836 sx_out(bp, CD186x_CAR, port_No(port)); 1837 sx_out(bp, CD186x_CAR, port_No(port));
1837 sx_out(bp, CD186x_COR2, port->COR2); 1838 sx_out(bp, CD186x_COR2, port->COR2);
1838 sx_out(bp, CD186x_IER, port->IER); 1839 sx_out(bp, CD186x_IER, port->IER);
1839 spin_unlock_irqrestore(&bp->lock, flags); 1840 spin_unlock(&bp->lock);
1840 spin_unlock_irqrestore(&port->lock, flags); 1841 spin_unlock_irqrestore(&port->lock, flags);
1841 sx_wait_CCR(bp); 1842 sx_wait_CCR(bp);
1842 spin_lock_irqsave(&bp->lock, flags); 1843 spin_lock_irqsave(&bp->lock, flags);
@@ -2022,9 +2023,9 @@ static void sx_unthrottle(struct tty_struct *tty)
2022 if (sx_crtscts(tty)) 2023 if (sx_crtscts(tty))
2023 port->MSVR |= MSVR_DTR; 2024 port->MSVR |= MSVR_DTR;
2024 /* Else clause: see remark in "sx_throttle"... */ 2025 /* Else clause: see remark in "sx_throttle"... */
2025 spin_lock_irqsave(&bp->lock, flags); 2026 spin_lock(&bp->lock);
2026 sx_out(bp, CD186x_CAR, port_No(port)); 2027 sx_out(bp, CD186x_CAR, port_No(port));
2027 spin_unlock_irqrestore(&bp->lock, flags); 2028 spin_unlock(&bp->lock);
2028 if (I_IXOFF(tty)) { 2029 if (I_IXOFF(tty)) {
2029 spin_unlock_irqrestore(&port->lock, flags); 2030 spin_unlock_irqrestore(&port->lock, flags);
2030 sx_wait_CCR(bp); 2031 sx_wait_CCR(bp);
@@ -2034,9 +2035,9 @@ static void sx_unthrottle(struct tty_struct *tty)
2034 sx_wait_CCR(bp); 2035 sx_wait_CCR(bp);
2035 spin_lock_irqsave(&port->lock, flags); 2036 spin_lock_irqsave(&port->lock, flags);
2036 } 2037 }
2037 spin_lock_irqsave(&bp->lock, flags); 2038 spin_lock(&bp->lock);
2038 sx_out(bp, CD186x_MSVR, port->MSVR); 2039 sx_out(bp, CD186x_MSVR, port->MSVR);
2039 spin_unlock_irqrestore(&bp->lock, flags); 2040 spin_unlock(&bp->lock);
2040 spin_unlock_irqrestore(&port->lock, flags); 2041 spin_unlock_irqrestore(&port->lock, flags);
2041 2042
2042 func_exit(); 2043 func_exit();
@@ -2060,10 +2061,10 @@ static void sx_stop(struct tty_struct *tty)
2060 2061
2061 spin_lock_irqsave(&port->lock, flags); 2062 spin_lock_irqsave(&port->lock, flags);
2062 port->IER &= ~IER_TXRDY; 2063 port->IER &= ~IER_TXRDY;
2063 spin_lock_irqsave(&bp->lock, flags); 2064 spin_lock(&bp->lock);
2064 sx_out(bp, CD186x_CAR, port_No(port)); 2065 sx_out(bp, CD186x_CAR, port_No(port));
2065 sx_out(bp, CD186x_IER, port->IER); 2066 sx_out(bp, CD186x_IER, port->IER);
2066 spin_unlock_irqrestore(&bp->lock, flags); 2067 spin_unlock(&bp->lock);
2067 spin_unlock_irqrestore(&port->lock, flags); 2068 spin_unlock_irqrestore(&port->lock, flags);
2068 2069
2069 func_exit(); 2070 func_exit();
@@ -2088,10 +2089,10 @@ static void sx_start(struct tty_struct *tty)
2088 spin_lock_irqsave(&port->lock, flags); 2089 spin_lock_irqsave(&port->lock, flags);
2089 if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) { 2090 if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) {
2090 port->IER |= IER_TXRDY; 2091 port->IER |= IER_TXRDY;
2091 spin_lock_irqsave(&bp->lock, flags); 2092 spin_lock(&bp->lock);
2092 sx_out(bp, CD186x_CAR, port_No(port)); 2093 sx_out(bp, CD186x_CAR, port_No(port));
2093 sx_out(bp, CD186x_IER, port->IER); 2094 sx_out(bp, CD186x_IER, port->IER);
2094 spin_unlock_irqrestore(&bp->lock, flags); 2095 spin_unlock(&bp->lock);
2095 } 2096 }
2096 spin_unlock_irqrestore(&port->lock, flags); 2097 spin_unlock_irqrestore(&port->lock, flags);
2097 2098
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 518f2a25d91e..a81ec4fcf6ff 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -216,6 +216,7 @@
216#include <linux/eisa.h> 216#include <linux/eisa.h>
217#include <linux/pci.h> 217#include <linux/pci.h>
218#include <linux/slab.h> 218#include <linux/slab.h>
219#include <linux/smp_lock.h>
219#include <linux/init.h> 220#include <linux/init.h>
220#include <linux/miscdevice.h> 221#include <linux/miscdevice.h>
221#include <linux/bitops.h> 222#include <linux/bitops.h>
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index afded3a2379c..813552f14884 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -81,6 +81,7 @@
81#include <linux/mm.h> 81#include <linux/mm.h>
82#include <linux/seq_file.h> 82#include <linux/seq_file.h>
83#include <linux/slab.h> 83#include <linux/slab.h>
84#include <linux/smp_lock.h>
84#include <linux/delay.h> 85#include <linux/delay.h>
85#include <linux/netdevice.h> 86#include <linux/netdevice.h>
86#include <linux/vmalloc.h> 87#include <linux/vmalloc.h>
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index a2e67e6df3a1..91f20a92fddf 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -62,6 +62,7 @@
62#include <linux/mm.h> 62#include <linux/mm.h>
63#include <linux/seq_file.h> 63#include <linux/seq_file.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/smp_lock.h>
65#include <linux/netdevice.h> 66#include <linux/netdevice.h>
66#include <linux/vmalloc.h> 67#include <linux/vmalloc.h>
67#include <linux/init.h> 68#include <linux/init.h>
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 6f727e3c53ad..8d4a2a8a0a70 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -52,6 +52,7 @@
52#include <linux/mm.h> 52#include <linux/mm.h>
53#include <linux/seq_file.h> 53#include <linux/seq_file.h>
54#include <linux/slab.h> 54#include <linux/slab.h>
55#include <linux/smp_lock.h>
55#include <linux/netdevice.h> 56#include <linux/netdevice.h>
56#include <linux/vmalloc.h> 57#include <linux/vmalloc.h>
57#include <linux/init.h> 58#include <linux/init.h>
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 0db35857e4d8..5d7a02f63e1c 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -35,7 +35,6 @@
35#include <linux/spinlock.h> 35#include <linux/spinlock.h>
36#include <linux/vt_kern.h> 36#include <linux/vt_kern.h>
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38#include <linux/kexec.h>
39#include <linux/hrtimer.h> 38#include <linux/hrtimer.h>
40#include <linux/oom.h> 39#include <linux/oom.h>
41 40
@@ -124,9 +123,12 @@ static struct sysrq_key_op sysrq_unraw_op = {
124static void sysrq_handle_crash(int key, struct tty_struct *tty) 123static void sysrq_handle_crash(int key, struct tty_struct *tty)
125{ 124{
126 char *killer = NULL; 125 char *killer = NULL;
126
127 panic_on_oops = 1; /* force panic */
128 wmb();
127 *killer = 1; 129 *killer = 1;
128} 130}
129static struct sysrq_key_op sysrq_crashdump_op = { 131static struct sysrq_key_op sysrq_crash_op = {
130 .handler = sysrq_handle_crash, 132 .handler = sysrq_handle_crash,
131 .help_msg = "Crash", 133 .help_msg = "Crash",
132 .action_msg = "Trigger a crash", 134 .action_msg = "Trigger a crash",
@@ -401,7 +403,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
401 */ 403 */
402 NULL, /* a */ 404 NULL, /* a */
403 &sysrq_reboot_op, /* b */ 405 &sysrq_reboot_op, /* b */
404 &sysrq_crashdump_op, /* c & ibm_emac driver debug */ 406 &sysrq_crash_op, /* c & ibm_emac driver debug */
405 &sysrq_showlocks_op, /* d */ 407 &sysrq_showlocks_op, /* d */
406 &sysrq_term_op, /* e */ 408 &sysrq_term_op, /* e */
407 &sysrq_moom_op, /* f */ 409 &sysrq_moom_op, /* f */
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index ccdd828adcef..b0603b2e5684 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -26,7 +26,6 @@
26#include <linux/poll.h> 26#include <linux/poll.h>
27#include <linux/mutex.h> 27#include <linux/mutex.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/smp_lock.h>
30 29
31#include "tpm.h" 30#include "tpm.h"
32 31
diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c
index 810ee25d66a4..3108991c5c8b 100644
--- a/drivers/char/tty_buffer.c
+++ b/drivers/char/tty_buffer.c
@@ -462,6 +462,19 @@ static void flush_to_ldisc(struct work_struct *work)
462} 462}
463 463
464/** 464/**
465 * tty_flush_to_ldisc
466 * @tty: tty to push
467 *
468 * Push the terminal flip buffers to the line discipline.
469 *
470 * Must not be called from IRQ context.
471 */
472void tty_flush_to_ldisc(struct tty_struct *tty)
473{
474 flush_to_ldisc(&tty->buf.work.work);
475}
476
477/**
465 * tty_flip_buffer_push - terminal 478 * tty_flip_buffer_push - terminal
466 * @tty: tty to push 479 * @tty: tty to push
467 * 480 *
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index b24f6c6a1ea3..ad6ba4ed2808 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -21,7 +21,6 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/smp_lock.h>
25 24
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index 913aa8d3f1c5..acd76b767d4c 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -21,7 +21,6 @@
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/smp_lock.h>
25#include <linux/device.h> 24#include <linux/device.h>
26#include <linux/wait.h> 25#include <linux/wait.h>
27#include <linux/bitops.h> 26#include <linux/bitops.h>
@@ -791,17 +790,20 @@ void tty_ldisc_hangup(struct tty_struct *tty)
791 * N_TTY. 790 * N_TTY.
792 */ 791 */
793 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { 792 if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
794 /* Avoid racing set_ldisc */ 793 /* Avoid racing set_ldisc or tty_ldisc_release */
795 mutex_lock(&tty->ldisc_mutex); 794 mutex_lock(&tty->ldisc_mutex);
796 /* Switch back to N_TTY */ 795 if (tty->ldisc) { /* Not yet closed */
797 tty_ldisc_halt(tty); 796 /* Switch back to N_TTY */
798 tty_ldisc_wait_idle(tty); 797 tty_ldisc_halt(tty);
799 tty_ldisc_reinit(tty); 798 tty_ldisc_wait_idle(tty);
800 /* At this point we have a closed ldisc and we want to 799 tty_ldisc_reinit(tty);
801 reopen it. We could defer this to the next open but 800 /* At this point we have a closed ldisc and we want to
802 it means auditing a lot of other paths so this is a FIXME */ 801 reopen it. We could defer this to the next open but
803 WARN_ON(tty_ldisc_open(tty, tty->ldisc)); 802 it means auditing a lot of other paths so this is
804 tty_ldisc_enable(tty); 803 a FIXME */
804 WARN_ON(tty_ldisc_open(tty, tty->ldisc));
805 tty_ldisc_enable(tty);
806 }
805 mutex_unlock(&tty->ldisc_mutex); 807 mutex_unlock(&tty->ldisc_mutex);
806 tty_reset_termios(tty); 808 tty_reset_termios(tty);
807 } 809 }
@@ -866,6 +868,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
866 868
867 tty_ldisc_wait_idle(tty); 869 tty_ldisc_wait_idle(tty);
868 870
871 mutex_lock(&tty->ldisc_mutex);
869 /* 872 /*
870 * Now kill off the ldisc 873 * Now kill off the ldisc
871 */ 874 */
@@ -876,6 +879,7 @@ void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
876 879
877 /* Ensure the next open requests the N_TTY ldisc */ 880 /* Ensure the next open requests the N_TTY ldisc */
878 tty_set_termios_ldisc(tty, N_TTY); 881 tty_set_termios_ldisc(tty, N_TTY);
882 mutex_unlock(&tty->ldisc_mutex);
879 883
880 /* This will need doing differently if we need to lock */ 884 /* This will need doing differently if we need to lock */
881 if (o_tty) 885 if (o_tty)
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index 4e862a75f7ff..9769b1149f76 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -267,7 +267,7 @@ int tty_port_block_til_ready(struct tty_port *port,
267 if (retval == 0) 267 if (retval == 0)
268 port->flags |= ASYNC_NORMAL_ACTIVE; 268 port->flags |= ASYNC_NORMAL_ACTIVE;
269 spin_unlock_irqrestore(&port->lock, flags); 269 spin_unlock_irqrestore(&port->lock, flags);
270 return 0; 270 return retval;
271 271
272} 272}
273EXPORT_SYMBOL(tty_port_block_til_ready); 273EXPORT_SYMBOL(tty_port_block_til_ready);
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index d94d25c12aa8..c1791a63d99d 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -495,11 +495,15 @@ void vcs_remove_sysfs(int index)
495 495
496int __init vcs_init(void) 496int __init vcs_init(void)
497{ 497{
498 unsigned int i;
499
498 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) 500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
499 panic("unable to get major %d for vcs device", VCS_MAJOR); 501 panic("unable to get major %d for vcs device", VCS_MAJOR);
500 vc_class = class_create(THIS_MODULE, "vc"); 502 vc_class = class_create(THIS_MODULE, "vc");
501 503
502 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); 504 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
503 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); 505 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
506 for (i = 0; i < MIN_NR_CONSOLES; i++)
507 vcs_make_sysfs(i);
504 return 0; 508 return 0;
505} 509}
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/drivers/char/vr41xx_giu.c
+++ /dev/null
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d9113b4c76e3..404f4c1ee431 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -89,6 +89,7 @@
89#include <linux/mutex.h> 89#include <linux/mutex.h>
90#include <linux/vt_kern.h> 90#include <linux/vt_kern.h>
91#include <linux/selection.h> 91#include <linux/selection.h>
92#include <linux/smp_lock.h>
92#include <linux/tiocl.h> 93#include <linux/tiocl.h>
93#include <linux/kbd_kern.h> 94#include <linux/kbd_kern.h>
94#include <linux/consolemap.h> 95#include <linux/consolemap.h>
@@ -769,14 +770,12 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
769 visual_init(vc, currcons, 1); 770 visual_init(vc, currcons, 1);
770 if (!*vc->vc_uni_pagedir_loc) 771 if (!*vc->vc_uni_pagedir_loc)
771 con_set_default_unimap(vc); 772 con_set_default_unimap(vc);
772 if (!vc->vc_kmalloced) 773 vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
773 vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
774 if (!vc->vc_screenbuf) { 774 if (!vc->vc_screenbuf) {
775 kfree(vc); 775 kfree(vc);
776 vc_cons[currcons].d = NULL; 776 vc_cons[currcons].d = NULL;
777 return -ENOMEM; 777 return -ENOMEM;
778 } 778 }
779 vc->vc_kmalloced = 1;
780 vc_init(vc, vc->vc_rows, vc->vc_cols, 1); 779 vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
781 vcs_make_sysfs(currcons); 780 vcs_make_sysfs(currcons);
782 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param); 781 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
@@ -912,10 +911,8 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
912 if (new_scr_end > new_origin) 911 if (new_scr_end > new_origin)
913 scr_memsetw((void *)new_origin, vc->vc_video_erase_char, 912 scr_memsetw((void *)new_origin, vc->vc_video_erase_char,
914 new_scr_end - new_origin); 913 new_scr_end - new_origin);
915 if (vc->vc_kmalloced) 914 kfree(vc->vc_screenbuf);
916 kfree(vc->vc_screenbuf);
917 vc->vc_screenbuf = newscreen; 915 vc->vc_screenbuf = newscreen;
918 vc->vc_kmalloced = 1;
919 vc->vc_screenbuf_size = new_screen_size; 916 vc->vc_screenbuf_size = new_screen_size;
920 set_origin(vc); 917 set_origin(vc);
921 918
@@ -994,8 +991,7 @@ void vc_deallocate(unsigned int currcons)
994 vc->vc_sw->con_deinit(vc); 991 vc->vc_sw->con_deinit(vc);
995 put_pid(vc->vt_pid); 992 put_pid(vc->vt_pid);
996 module_put(vc->vc_sw->owner); 993 module_put(vc->vc_sw->owner);
997 if (vc->vc_kmalloced) 994 kfree(vc->vc_screenbuf);
998 kfree(vc->vc_screenbuf);
999 if (currcons >= MIN_NR_CONSOLES) 995 if (currcons >= MIN_NR_CONSOLES)
1000 kfree(vc); 996 kfree(vc);
1001 vc_cons[currcons].d = NULL; 997 vc_cons[currcons].d = NULL;
@@ -2880,7 +2876,6 @@ static int __init con_init(void)
2880 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); 2876 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
2881 visual_init(vc, currcons, 1); 2877 visual_init(vc, currcons, 1);
2882 vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT); 2878 vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
2883 vc->vc_kmalloced = 0;
2884 vc_init(vc, vc->vc_rows, vc->vc_cols, 2879 vc_init(vc, vc->vc_rows, vc->vc_cols,
2885 currcons || !vc->vc_sw->con_save_screen); 2880 currcons || !vc->vc_sw->con_save_screen);
2886 } 2881 }
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 7539bed0f7e0..95189f288f8c 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -25,6 +25,7 @@
25#include <linux/console.h> 25#include <linux/console.h>
26#include <linux/consolemap.h> 26#include <linux/consolemap.h>
27#include <linux/signal.h> 27#include <linux/signal.h>
28#include <linux/smp_lock.h>
28#include <linux/timex.h> 29#include <linux/timex.h>
29 30
30#include <asm/io.h> 31#include <asm/io.h>
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index c769ef269fb5..408c2af25d50 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * cn_queue.c 2 * cn_queue.c
3 * 3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * 2004+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index fd336c5a9057..08b2500f21ec 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * connector.c 2 * connector.c
3 * 3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * 2004+ Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@
33#include <net/sock.h> 33#include <net/sock.h>
34 34
35MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");
36MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); 36MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
37MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); 37MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector.");
38 38
39static u32 cn_idx = CN_IDX_CONNECTOR; 39static u32 cn_idx = CN_IDX_CONNECTOR;
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 070357aaedbc..81e1020fb514 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -4,7 +4,7 @@
4 4
5menuconfig DMADEVICES 5menuconfig DMADEVICES
6 bool "DMA Engine support" 6 bool "DMA Engine support"
7 depends on !HIGHMEM64G && HAS_DMA 7 depends on HAS_DMA
8 help 8 help
9 DMA engines can do asynchronous data transfers without 9 DMA engines can do asynchronous data transfers without
10 involving the host CPU. Currently, this framework can be 10 involving the host CPU. Currently, this framework can be
@@ -46,6 +46,14 @@ config DW_DMAC
46 Support the Synopsys DesignWare AHB DMA controller. This 46 Support the Synopsys DesignWare AHB DMA controller. This
47 can be integrated in chips such as the Atmel AT32ap7000. 47 can be integrated in chips such as the Atmel AT32ap7000.
48 48
49config AT_HDMAC
50 tristate "Atmel AHB DMA support"
51 depends on ARCH_AT91SAM9RL
52 select DMA_ENGINE
53 help
54 Support the Atmel AHB DMA controller. This can be integrated in
55 chips such as the Atmel AT91SAM9RL.
56
49config FSL_DMA 57config FSL_DMA
50 tristate "Freescale Elo and Elo Plus DMA support" 58 tristate "Freescale Elo and Elo Plus DMA support"
51 depends on FSL_SOC 59 depends on FSL_SOC
@@ -108,7 +116,7 @@ config NET_DMA
108 116
109config ASYNC_TX_DMA 117config ASYNC_TX_DMA
110 bool "Async_tx: Offload support for the async_tx api" 118 bool "Async_tx: Offload support for the async_tx api"
111 depends on DMA_ENGINE 119 depends on DMA_ENGINE && !HIGHMEM64G
112 help 120 help
113 This allows the async_tx api to take advantage of offload engines for 121 This allows the async_tx api to take advantage of offload engines for
114 memcpy, memset, xor, and raid6 p+q operations. If your platform has 122 memcpy, memset, xor, and raid6 p+q operations. If your platform has
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index a0b6564800c4..40e1e0083571 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
7obj-$(CONFIG_FSL_DMA) += fsldma.o 7obj-$(CONFIG_FSL_DMA) += fsldma.o
8obj-$(CONFIG_MV_XOR) += mv_xor.o 8obj-$(CONFIG_MV_XOR) += mv_xor.o
9obj-$(CONFIG_DW_DMAC) += dw_dmac.o 9obj-$(CONFIG_DW_DMAC) += dw_dmac.o
10obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
10obj-$(CONFIG_MX3_IPU) += ipu/ 11obj-$(CONFIG_MX3_IPU) += ipu/
11obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o 12obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
new file mode 100644
index 000000000000..9a1e5fb412ed
--- /dev/null
+++ b/drivers/dma/at_hdmac.c
@@ -0,0 +1,1213 @@
1/*
2 * Driver for the Atmel AHB DMA Controller (aka HDMA or DMAC on AT91 systems)
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 *
12 * This supports the Atmel AHB DMA Controller,
13 *
14 * The driver has currently been tested with the Atmel AT91SAM9RL
15 * and AT91SAM9G45 series.
16 */
17
18#include <linux/clk.h>
19#include <linux/dmaengine.h>
20#include <linux/dma-mapping.h>
21#include <linux/dmapool.h>
22#include <linux/interrupt.h>
23#include <linux/module.h>
24#include <linux/platform_device.h>
25
26#include "at_hdmac_regs.h"
27
28/*
29 * Glossary
30 * --------
31 *
32 * at_hdmac : Name of the ATmel AHB DMA Controller
33 * at_dma_ / atdma : ATmel DMA controller entity related
34 * atc_ / atchan : ATmel DMA Channel entity related
35 */
36
37#define ATC_DEFAULT_CFG (ATC_FIFOCFG_HALFFIFO)
38#define ATC_DEFAULT_CTRLA (0)
39#define ATC_DEFAULT_CTRLB (ATC_SIF(0) \
40 |ATC_DIF(1))
41
42/*
43 * Initial number of descriptors to allocate for each channel. This could
44 * be increased during dma usage.
45 */
46static unsigned int init_nr_desc_per_channel = 64;
47module_param(init_nr_desc_per_channel, uint, 0644);
48MODULE_PARM_DESC(init_nr_desc_per_channel,
49 "initial descriptors per channel (default: 64)");
50
51
52/* prototypes */
53static dma_cookie_t atc_tx_submit(struct dma_async_tx_descriptor *tx);
54
55
56/*----------------------------------------------------------------------*/
57
58static struct at_desc *atc_first_active(struct at_dma_chan *atchan)
59{
60 return list_first_entry(&atchan->active_list,
61 struct at_desc, desc_node);
62}
63
64static struct at_desc *atc_first_queued(struct at_dma_chan *atchan)
65{
66 return list_first_entry(&atchan->queue,
67 struct at_desc, desc_node);
68}
69
70/**
71 * atc_alloc_descriptor - allocate and return an initilized descriptor
72 * @chan: the channel to allocate descriptors for
73 * @gfp_flags: GFP allocation flags
74 *
75 * Note: The ack-bit is positioned in the descriptor flag at creation time
76 * to make initial allocation more convenient. This bit will be cleared
77 * and control will be given to client at usage time (during
78 * preparation functions).
79 */
80static struct at_desc *atc_alloc_descriptor(struct dma_chan *chan,
81 gfp_t gfp_flags)
82{
83 struct at_desc *desc = NULL;
84 struct at_dma *atdma = to_at_dma(chan->device);
85 dma_addr_t phys;
86
87 desc = dma_pool_alloc(atdma->dma_desc_pool, gfp_flags, &phys);
88 if (desc) {
89 memset(desc, 0, sizeof(struct at_desc));
90 dma_async_tx_descriptor_init(&desc->txd, chan);
91 /* txd.flags will be overwritten in prep functions */
92 desc->txd.flags = DMA_CTRL_ACK;
93 desc->txd.tx_submit = atc_tx_submit;
94 desc->txd.phys = phys;
95 }
96
97 return desc;
98}
99
100/**
101 * atc_desc_get - get a unsused descriptor from free_list
102 * @atchan: channel we want a new descriptor for
103 */
104static struct at_desc *atc_desc_get(struct at_dma_chan *atchan)
105{
106 struct at_desc *desc, *_desc;
107 struct at_desc *ret = NULL;
108 unsigned int i = 0;
109 LIST_HEAD(tmp_list);
110
111 spin_lock_bh(&atchan->lock);
112 list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
113 i++;
114 if (async_tx_test_ack(&desc->txd)) {
115 list_del(&desc->desc_node);
116 ret = desc;
117 break;
118 }
119 dev_dbg(chan2dev(&atchan->chan_common),
120 "desc %p not ACKed\n", desc);
121 }
122 spin_unlock_bh(&atchan->lock);
123 dev_vdbg(chan2dev(&atchan->chan_common),
124 "scanned %u descriptors on freelist\n", i);
125
126 /* no more descriptor available in initial pool: create one more */
127 if (!ret) {
128 ret = atc_alloc_descriptor(&atchan->chan_common, GFP_ATOMIC);
129 if (ret) {
130 spin_lock_bh(&atchan->lock);
131 atchan->descs_allocated++;
132 spin_unlock_bh(&atchan->lock);
133 } else {
134 dev_err(chan2dev(&atchan->chan_common),
135 "not enough descriptors available\n");
136 }
137 }
138
139 return ret;
140}
141
142/**
143 * atc_desc_put - move a descriptor, including any children, to the free list
144 * @atchan: channel we work on
145 * @desc: descriptor, at the head of a chain, to move to free list
146 */
147static void atc_desc_put(struct at_dma_chan *atchan, struct at_desc *desc)
148{
149 if (desc) {
150 struct at_desc *child;
151
152 spin_lock_bh(&atchan->lock);
153 list_for_each_entry(child, &desc->txd.tx_list, desc_node)
154 dev_vdbg(chan2dev(&atchan->chan_common),
155 "moving child desc %p to freelist\n",
156 child);
157 list_splice_init(&desc->txd.tx_list, &atchan->free_list);
158 dev_vdbg(chan2dev(&atchan->chan_common),
159 "moving desc %p to freelist\n", desc);
160 list_add(&desc->desc_node, &atchan->free_list);
161 spin_unlock_bh(&atchan->lock);
162 }
163}
164
165/**
166 * atc_assign_cookie - compute and assign new cookie
167 * @atchan: channel we work on
168 * @desc: descriptor to asign cookie for
169 *
170 * Called with atchan->lock held and bh disabled
171 */
172static dma_cookie_t
173atc_assign_cookie(struct at_dma_chan *atchan, struct at_desc *desc)
174{
175 dma_cookie_t cookie = atchan->chan_common.cookie;
176
177 if (++cookie < 0)
178 cookie = 1;
179
180 atchan->chan_common.cookie = cookie;
181 desc->txd.cookie = cookie;
182
183 return cookie;
184}
185
186/**
187 * atc_dostart - starts the DMA engine for real
188 * @atchan: the channel we want to start
189 * @first: first descriptor in the list we want to begin with
190 *
191 * Called with atchan->lock held and bh disabled
192 */
193static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
194{
195 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
196
197 /* ASSERT: channel is idle */
198 if (atc_chan_is_enabled(atchan)) {
199 dev_err(chan2dev(&atchan->chan_common),
200 "BUG: Attempted to start non-idle channel\n");
201 dev_err(chan2dev(&atchan->chan_common),
202 " channel: s0x%x d0x%x ctrl0x%x:0x%x l0x%x\n",
203 channel_readl(atchan, SADDR),
204 channel_readl(atchan, DADDR),
205 channel_readl(atchan, CTRLA),
206 channel_readl(atchan, CTRLB),
207 channel_readl(atchan, DSCR));
208
209 /* The tasklet will hopefully advance the queue... */
210 return;
211 }
212
213 vdbg_dump_regs(atchan);
214
215 /* clear any pending interrupt */
216 while (dma_readl(atdma, EBCISR))
217 cpu_relax();
218
219 channel_writel(atchan, SADDR, 0);
220 channel_writel(atchan, DADDR, 0);
221 channel_writel(atchan, CTRLA, 0);
222 channel_writel(atchan, CTRLB, 0);
223 channel_writel(atchan, DSCR, first->txd.phys);
224 dma_writel(atdma, CHER, atchan->mask);
225
226 vdbg_dump_regs(atchan);
227}
228
229/**
230 * atc_chain_complete - finish work for one transaction chain
231 * @atchan: channel we work on
232 * @desc: descriptor at the head of the chain we want do complete
233 *
234 * Called with atchan->lock held and bh disabled */
235static void
236atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc)
237{
238 dma_async_tx_callback callback;
239 void *param;
240 struct dma_async_tx_descriptor *txd = &desc->txd;
241
242 dev_vdbg(chan2dev(&atchan->chan_common),
243 "descriptor %u complete\n", txd->cookie);
244
245 atchan->completed_cookie = txd->cookie;
246 callback = txd->callback;
247 param = txd->callback_param;
248
249 /* move children to free_list */
250 list_splice_init(&txd->tx_list, &atchan->free_list);
251 /* move myself to free_list */
252 list_move(&desc->desc_node, &atchan->free_list);
253
254 /* unmap dma addresses */
255 if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
256 if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE)
257 dma_unmap_single(chan2parent(&atchan->chan_common),
258 desc->lli.daddr,
259 desc->len, DMA_FROM_DEVICE);
260 else
261 dma_unmap_page(chan2parent(&atchan->chan_common),
262 desc->lli.daddr,
263 desc->len, DMA_FROM_DEVICE);
264 }
265 if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
266 if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE)
267 dma_unmap_single(chan2parent(&atchan->chan_common),
268 desc->lli.saddr,
269 desc->len, DMA_TO_DEVICE);
270 else
271 dma_unmap_page(chan2parent(&atchan->chan_common),
272 desc->lli.saddr,
273 desc->len, DMA_TO_DEVICE);
274 }
275
276 /*
277 * The API requires that no submissions are done from a
278 * callback, so we don't need to drop the lock here
279 */
280 if (callback)
281 callback(param);
282
283 dma_run_dependencies(txd);
284}
285
286/**
287 * atc_complete_all - finish work for all transactions
288 * @atchan: channel to complete transactions for
289 *
290 * Eventually submit queued descriptors if any
291 *
292 * Assume channel is idle while calling this function
293 * Called with atchan->lock held and bh disabled
294 */
295static void atc_complete_all(struct at_dma_chan *atchan)
296{
297 struct at_desc *desc, *_desc;
298 LIST_HEAD(list);
299
300 dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n");
301
302 BUG_ON(atc_chan_is_enabled(atchan));
303
304 /*
305 * Submit queued descriptors ASAP, i.e. before we go through
306 * the completed ones.
307 */
308 if (!list_empty(&atchan->queue))
309 atc_dostart(atchan, atc_first_queued(atchan));
310 /* empty active_list now it is completed */
311 list_splice_init(&atchan->active_list, &list);
312 /* empty queue list by moving descriptors (if any) to active_list */
313 list_splice_init(&atchan->queue, &atchan->active_list);
314
315 list_for_each_entry_safe(desc, _desc, &list, desc_node)
316 atc_chain_complete(atchan, desc);
317}
318
319/**
320 * atc_cleanup_descriptors - cleanup up finished descriptors in active_list
321 * @atchan: channel to be cleaned up
322 *
323 * Called with atchan->lock held and bh disabled
324 */
325static void atc_cleanup_descriptors(struct at_dma_chan *atchan)
326{
327 struct at_desc *desc, *_desc;
328 struct at_desc *child;
329
330 dev_vdbg(chan2dev(&atchan->chan_common), "cleanup descriptors\n");
331
332 list_for_each_entry_safe(desc, _desc, &atchan->active_list, desc_node) {
333 if (!(desc->lli.ctrla & ATC_DONE))
334 /* This one is currently in progress */
335 return;
336
337 list_for_each_entry(child, &desc->txd.tx_list, desc_node)
338 if (!(child->lli.ctrla & ATC_DONE))
339 /* Currently in progress */
340 return;
341
342 /*
343 * No descriptors so far seem to be in progress, i.e.
344 * this chain must be done.
345 */
346 atc_chain_complete(atchan, desc);
347 }
348}
349
350/**
351 * atc_advance_work - at the end of a transaction, move forward
352 * @atchan: channel where the transaction ended
353 *
354 * Called with atchan->lock held and bh disabled
355 */
356static void atc_advance_work(struct at_dma_chan *atchan)
357{
358 dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n");
359
360 if (list_empty(&atchan->active_list) ||
361 list_is_singular(&atchan->active_list)) {
362 atc_complete_all(atchan);
363 } else {
364 atc_chain_complete(atchan, atc_first_active(atchan));
365 /* advance work */
366 atc_dostart(atchan, atc_first_active(atchan));
367 }
368}
369
370
371/**
372 * atc_handle_error - handle errors reported by DMA controller
373 * @atchan: channel where error occurs
374 *
375 * Called with atchan->lock held and bh disabled
376 */
377static void atc_handle_error(struct at_dma_chan *atchan)
378{
379 struct at_desc *bad_desc;
380 struct at_desc *child;
381
382 /*
383 * The descriptor currently at the head of the active list is
384 * broked. Since we don't have any way to report errors, we'll
385 * just have to scream loudly and try to carry on.
386 */
387 bad_desc = atc_first_active(atchan);
388 list_del_init(&bad_desc->desc_node);
389
390 /* As we are stopped, take advantage to push queued descriptors
391 * in active_list */
392 list_splice_init(&atchan->queue, atchan->active_list.prev);
393
394 /* Try to restart the controller */
395 if (!list_empty(&atchan->active_list))
396 atc_dostart(atchan, atc_first_active(atchan));
397
398 /*
399 * KERN_CRITICAL may seem harsh, but since this only happens
400 * when someone submits a bad physical address in a
401 * descriptor, we should consider ourselves lucky that the
402 * controller flagged an error instead of scribbling over
403 * random memory locations.
404 */
405 dev_crit(chan2dev(&atchan->chan_common),
406 "Bad descriptor submitted for DMA!\n");
407 dev_crit(chan2dev(&atchan->chan_common),
408 " cookie: %d\n", bad_desc->txd.cookie);
409 atc_dump_lli(atchan, &bad_desc->lli);
410 list_for_each_entry(child, &bad_desc->txd.tx_list, desc_node)
411 atc_dump_lli(atchan, &child->lli);
412
413 /* Pretend the descriptor completed successfully */
414 atc_chain_complete(atchan, bad_desc);
415}
416
417
418/*-- IRQ & Tasklet ---------------------------------------------------*/
419
420static void atc_tasklet(unsigned long data)
421{
422 struct at_dma_chan *atchan = (struct at_dma_chan *)data;
423
424 /* Channel cannot be enabled here */
425 if (atc_chan_is_enabled(atchan)) {
426 dev_err(chan2dev(&atchan->chan_common),
427 "BUG: channel enabled in tasklet\n");
428 return;
429 }
430
431 spin_lock(&atchan->lock);
432 if (test_and_clear_bit(0, &atchan->error_status))
433 atc_handle_error(atchan);
434 else
435 atc_advance_work(atchan);
436
437 spin_unlock(&atchan->lock);
438}
439
440static irqreturn_t at_dma_interrupt(int irq, void *dev_id)
441{
442 struct at_dma *atdma = (struct at_dma *)dev_id;
443 struct at_dma_chan *atchan;
444 int i;
445 u32 status, pending, imr;
446 int ret = IRQ_NONE;
447
448 do {
449 imr = dma_readl(atdma, EBCIMR);
450 status = dma_readl(atdma, EBCISR);
451 pending = status & imr;
452
453 if (!pending)
454 break;
455
456 dev_vdbg(atdma->dma_common.dev,
457 "interrupt: status = 0x%08x, 0x%08x, 0x%08x\n",
458 status, imr, pending);
459
460 for (i = 0; i < atdma->dma_common.chancnt; i++) {
461 atchan = &atdma->chan[i];
462 if (pending & (AT_DMA_CBTC(i) | AT_DMA_ERR(i))) {
463 if (pending & AT_DMA_ERR(i)) {
464 /* Disable channel on AHB error */
465 dma_writel(atdma, CHDR, atchan->mask);
466 /* Give information to tasklet */
467 set_bit(0, &atchan->error_status);
468 }
469 tasklet_schedule(&atchan->tasklet);
470 ret = IRQ_HANDLED;
471 }
472 }
473
474 } while (pending);
475
476 return ret;
477}
478
479
480/*-- DMA Engine API --------------------------------------------------*/
481
482/**
483 * atc_tx_submit - set the prepared descriptor(s) to be executed by the engine
484 * @desc: descriptor at the head of the transaction chain
485 *
486 * Queue chain if DMA engine is working already
487 *
488 * Cookie increment and adding to active_list or queue must be atomic
489 */
490static dma_cookie_t atc_tx_submit(struct dma_async_tx_descriptor *tx)
491{
492 struct at_desc *desc = txd_to_at_desc(tx);
493 struct at_dma_chan *atchan = to_at_dma_chan(tx->chan);
494 dma_cookie_t cookie;
495
496 spin_lock_bh(&atchan->lock);
497 cookie = atc_assign_cookie(atchan, desc);
498
499 if (list_empty(&atchan->active_list)) {
500 dev_vdbg(chan2dev(tx->chan), "tx_submit: started %u\n",
501 desc->txd.cookie);
502 atc_dostart(atchan, desc);
503 list_add_tail(&desc->desc_node, &atchan->active_list);
504 } else {
505 dev_vdbg(chan2dev(tx->chan), "tx_submit: queued %u\n",
506 desc->txd.cookie);
507 list_add_tail(&desc->desc_node, &atchan->queue);
508 }
509
510 spin_unlock_bh(&atchan->lock);
511
512 return cookie;
513}
514
515/**
516 * atc_prep_dma_memcpy - prepare a memcpy operation
517 * @chan: the channel to prepare operation on
518 * @dest: operation virtual destination address
519 * @src: operation virtual source address
520 * @len: operation length
521 * @flags: tx descriptor status flags
522 */
523static struct dma_async_tx_descriptor *
524atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
525 size_t len, unsigned long flags)
526{
527 struct at_dma_chan *atchan = to_at_dma_chan(chan);
528 struct at_desc *desc = NULL;
529 struct at_desc *first = NULL;
530 struct at_desc *prev = NULL;
531 size_t xfer_count;
532 size_t offset;
533 unsigned int src_width;
534 unsigned int dst_width;
535 u32 ctrla;
536 u32 ctrlb;
537
538 dev_vdbg(chan2dev(chan), "prep_dma_memcpy: d0x%x s0x%x l0x%zx f0x%lx\n",
539 dest, src, len, flags);
540
541 if (unlikely(!len)) {
542 dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n");
543 return NULL;
544 }
545
546 ctrla = ATC_DEFAULT_CTRLA;
547 ctrlb = ATC_DEFAULT_CTRLB
548 | ATC_SRC_ADDR_MODE_INCR
549 | ATC_DST_ADDR_MODE_INCR
550 | ATC_FC_MEM2MEM;
551
552 /*
553 * We can be a lot more clever here, but this should take care
554 * of the most common optimization.
555 */
556 if (!((src | dest | len) & 3)) {
557 ctrla |= ATC_SRC_WIDTH_WORD | ATC_DST_WIDTH_WORD;
558 src_width = dst_width = 2;
559 } else if (!((src | dest | len) & 1)) {
560 ctrla |= ATC_SRC_WIDTH_HALFWORD | ATC_DST_WIDTH_HALFWORD;
561 src_width = dst_width = 1;
562 } else {
563 ctrla |= ATC_SRC_WIDTH_BYTE | ATC_DST_WIDTH_BYTE;
564 src_width = dst_width = 0;
565 }
566
567 for (offset = 0; offset < len; offset += xfer_count << src_width) {
568 xfer_count = min_t(size_t, (len - offset) >> src_width,
569 ATC_BTSIZE_MAX);
570
571 desc = atc_desc_get(atchan);
572 if (!desc)
573 goto err_desc_get;
574
575 desc->lli.saddr = src + offset;
576 desc->lli.daddr = dest + offset;
577 desc->lli.ctrla = ctrla | xfer_count;
578 desc->lli.ctrlb = ctrlb;
579
580 desc->txd.cookie = 0;
581 async_tx_ack(&desc->txd);
582
583 if (!first) {
584 first = desc;
585 } else {
586 /* inform the HW lli about chaining */
587 prev->lli.dscr = desc->txd.phys;
588 /* insert the link descriptor to the LD ring */
589 list_add_tail(&desc->desc_node,
590 &first->txd.tx_list);
591 }
592 prev = desc;
593 }
594
595 /* First descriptor of the chain embedds additional information */
596 first->txd.cookie = -EBUSY;
597 first->len = len;
598
599 /* set end-of-link to the last link descriptor of list*/
600 set_desc_eol(desc);
601
602 desc->txd.flags = flags; /* client is in control of this ack */
603
604 return &first->txd;
605
606err_desc_get:
607 atc_desc_put(atchan, first);
608 return NULL;
609}
610
611
612/**
613 * atc_prep_slave_sg - prepare descriptors for a DMA_SLAVE transaction
614 * @chan: DMA channel
615 * @sgl: scatterlist to transfer to/from
616 * @sg_len: number of entries in @scatterlist
617 * @direction: DMA direction
618 * @flags: tx descriptor status flags
619 */
620static struct dma_async_tx_descriptor *
621atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
622 unsigned int sg_len, enum dma_data_direction direction,
623 unsigned long flags)
624{
625 struct at_dma_chan *atchan = to_at_dma_chan(chan);
626 struct at_dma_slave *atslave = chan->private;
627 struct at_desc *first = NULL;
628 struct at_desc *prev = NULL;
629 u32 ctrla;
630 u32 ctrlb;
631 dma_addr_t reg;
632 unsigned int reg_width;
633 unsigned int mem_width;
634 unsigned int i;
635 struct scatterlist *sg;
636 size_t total_len = 0;
637
638 dev_vdbg(chan2dev(chan), "prep_slave_sg: %s f0x%lx\n",
639 direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
640 flags);
641
642 if (unlikely(!atslave || !sg_len)) {
643 dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n");
644 return NULL;
645 }
646
647 reg_width = atslave->reg_width;
648
649 sg_len = dma_map_sg(chan2parent(chan), sgl, sg_len, direction);
650
651 ctrla = ATC_DEFAULT_CTRLA | atslave->ctrla;
652 ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN;
653
654 switch (direction) {
655 case DMA_TO_DEVICE:
656 ctrla |= ATC_DST_WIDTH(reg_width);
657 ctrlb |= ATC_DST_ADDR_MODE_FIXED
658 | ATC_SRC_ADDR_MODE_INCR
659 | ATC_FC_MEM2PER;
660 reg = atslave->tx_reg;
661 for_each_sg(sgl, sg, sg_len, i) {
662 struct at_desc *desc;
663 u32 len;
664 u32 mem;
665
666 desc = atc_desc_get(atchan);
667 if (!desc)
668 goto err_desc_get;
669
670 mem = sg_phys(sg);
671 len = sg_dma_len(sg);
672 mem_width = 2;
673 if (unlikely(mem & 3 || len & 3))
674 mem_width = 0;
675
676 desc->lli.saddr = mem;
677 desc->lli.daddr = reg;
678 desc->lli.ctrla = ctrla
679 | ATC_SRC_WIDTH(mem_width)
680 | len >> mem_width;
681 desc->lli.ctrlb = ctrlb;
682
683 if (!first) {
684 first = desc;
685 } else {
686 /* inform the HW lli about chaining */
687 prev->lli.dscr = desc->txd.phys;
688 /* insert the link descriptor to the LD ring */
689 list_add_tail(&desc->desc_node,
690 &first->txd.tx_list);
691 }
692 prev = desc;
693 total_len += len;
694 }
695 break;
696 case DMA_FROM_DEVICE:
697 ctrla |= ATC_SRC_WIDTH(reg_width);
698 ctrlb |= ATC_DST_ADDR_MODE_INCR
699 | ATC_SRC_ADDR_MODE_FIXED
700 | ATC_FC_PER2MEM;
701
702 reg = atslave->rx_reg;
703 for_each_sg(sgl, sg, sg_len, i) {
704 struct at_desc *desc;
705 u32 len;
706 u32 mem;
707
708 desc = atc_desc_get(atchan);
709 if (!desc)
710 goto err_desc_get;
711
712 mem = sg_phys(sg);
713 len = sg_dma_len(sg);
714 mem_width = 2;
715 if (unlikely(mem & 3 || len & 3))
716 mem_width = 0;
717
718 desc->lli.saddr = reg;
719 desc->lli.daddr = mem;
720 desc->lli.ctrla = ctrla
721 | ATC_DST_WIDTH(mem_width)
722 | len >> mem_width;
723 desc->lli.ctrlb = ctrlb;
724
725 if (!first) {
726 first = desc;
727 } else {
728 /* inform the HW lli about chaining */
729 prev->lli.dscr = desc->txd.phys;
730 /* insert the link descriptor to the LD ring */
731 list_add_tail(&desc->desc_node,
732 &first->txd.tx_list);
733 }
734 prev = desc;
735 total_len += len;
736 }
737 break;
738 default:
739 return NULL;
740 }
741
742 /* set end-of-link to the last link descriptor of list*/
743 set_desc_eol(prev);
744
745 /* First descriptor of the chain embedds additional information */
746 first->txd.cookie = -EBUSY;
747 first->len = total_len;
748
749 /* last link descriptor of list is responsible of flags */
750 prev->txd.flags = flags; /* client is in control of this ack */
751
752 return &first->txd;
753
754err_desc_get:
755 dev_err(chan2dev(chan), "not enough descriptors available\n");
756 atc_desc_put(atchan, first);
757 return NULL;
758}
759
760static void atc_terminate_all(struct dma_chan *chan)
761{
762 struct at_dma_chan *atchan = to_at_dma_chan(chan);
763 struct at_dma *atdma = to_at_dma(chan->device);
764 struct at_desc *desc, *_desc;
765 LIST_HEAD(list);
766
767 /*
768 * This is only called when something went wrong elsewhere, so
769 * we don't really care about the data. Just disable the
770 * channel. We still have to poll the channel enable bit due
771 * to AHB/HSB limitations.
772 */
773 spin_lock_bh(&atchan->lock);
774
775 dma_writel(atdma, CHDR, atchan->mask);
776
777 /* confirm that this channel is disabled */
778 while (dma_readl(atdma, CHSR) & atchan->mask)
779 cpu_relax();
780
781 /* active_list entries will end up before queued entries */
782 list_splice_init(&atchan->queue, &list);
783 list_splice_init(&atchan->active_list, &list);
784
785 spin_unlock_bh(&atchan->lock);
786
787 /* Flush all pending and queued descriptors */
788 list_for_each_entry_safe(desc, _desc, &list, desc_node)
789 atc_chain_complete(atchan, desc);
790}
791
792/**
793 * atc_is_tx_complete - poll for transaction completion
794 * @chan: DMA channel
795 * @cookie: transaction identifier to check status of
796 * @done: if not %NULL, updated with last completed transaction
797 * @used: if not %NULL, updated with last used transaction
798 *
799 * If @done and @used are passed in, upon return they reflect the driver
800 * internal state and can be used with dma_async_is_complete() to check
801 * the status of multiple cookies without re-checking hardware state.
802 */
803static enum dma_status
804atc_is_tx_complete(struct dma_chan *chan,
805 dma_cookie_t cookie,
806 dma_cookie_t *done, dma_cookie_t *used)
807{
808 struct at_dma_chan *atchan = to_at_dma_chan(chan);
809 dma_cookie_t last_used;
810 dma_cookie_t last_complete;
811 enum dma_status ret;
812
813 dev_vdbg(chan2dev(chan), "is_tx_complete: %d (d%d, u%d)\n",
814 cookie, done ? *done : 0, used ? *used : 0);
815
816 spin_lock_bh(atchan->lock);
817
818 last_complete = atchan->completed_cookie;
819 last_used = chan->cookie;
820
821 ret = dma_async_is_complete(cookie, last_complete, last_used);
822 if (ret != DMA_SUCCESS) {
823 atc_cleanup_descriptors(atchan);
824
825 last_complete = atchan->completed_cookie;
826 last_used = chan->cookie;
827
828 ret = dma_async_is_complete(cookie, last_complete, last_used);
829 }
830
831 spin_unlock_bh(atchan->lock);
832
833 if (done)
834 *done = last_complete;
835 if (used)
836 *used = last_used;
837
838 return ret;
839}
840
841/**
842 * atc_issue_pending - try to finish work
843 * @chan: target DMA channel
844 */
845static void atc_issue_pending(struct dma_chan *chan)
846{
847 struct at_dma_chan *atchan = to_at_dma_chan(chan);
848
849 dev_vdbg(chan2dev(chan), "issue_pending\n");
850
851 if (!atc_chan_is_enabled(atchan)) {
852 spin_lock_bh(&atchan->lock);
853 atc_advance_work(atchan);
854 spin_unlock_bh(&atchan->lock);
855 }
856}
857
858/**
859 * atc_alloc_chan_resources - allocate resources for DMA channel
860 * @chan: allocate descriptor resources for this channel
861 * @client: current client requesting the channel be ready for requests
862 *
863 * return - the number of allocated descriptors
864 */
865static int atc_alloc_chan_resources(struct dma_chan *chan)
866{
867 struct at_dma_chan *atchan = to_at_dma_chan(chan);
868 struct at_dma *atdma = to_at_dma(chan->device);
869 struct at_desc *desc;
870 struct at_dma_slave *atslave;
871 int i;
872 u32 cfg;
873 LIST_HEAD(tmp_list);
874
875 dev_vdbg(chan2dev(chan), "alloc_chan_resources\n");
876
877 /* ASSERT: channel is idle */
878 if (atc_chan_is_enabled(atchan)) {
879 dev_dbg(chan2dev(chan), "DMA channel not idle ?\n");
880 return -EIO;
881 }
882
883 cfg = ATC_DEFAULT_CFG;
884
885 atslave = chan->private;
886 if (atslave) {
887 /*
888 * We need controller-specific data to set up slave
889 * transfers.
890 */
891 BUG_ON(!atslave->dma_dev || atslave->dma_dev != atdma->dma_common.dev);
892
893 /* if cfg configuration specified take it instad of default */
894 if (atslave->cfg)
895 cfg = atslave->cfg;
896 }
897
898 /* have we already been set up?
899 * reconfigure channel but no need to reallocate descriptors */
900 if (!list_empty(&atchan->free_list))
901 return atchan->descs_allocated;
902
903 /* Allocate initial pool of descriptors */
904 for (i = 0; i < init_nr_desc_per_channel; i++) {
905 desc = atc_alloc_descriptor(chan, GFP_KERNEL);
906 if (!desc) {
907 dev_err(atdma->dma_common.dev,
908 "Only %d initial descriptors\n", i);
909 break;
910 }
911 list_add_tail(&desc->desc_node, &tmp_list);
912 }
913
914 spin_lock_bh(&atchan->lock);
915 atchan->descs_allocated = i;
916 list_splice(&tmp_list, &atchan->free_list);
917 atchan->completed_cookie = chan->cookie = 1;
918 spin_unlock_bh(&atchan->lock);
919
920 /* channel parameters */
921 channel_writel(atchan, CFG, cfg);
922
923 dev_dbg(chan2dev(chan),
924 "alloc_chan_resources: allocated %d descriptors\n",
925 atchan->descs_allocated);
926
927 return atchan->descs_allocated;
928}
929
930/**
931 * atc_free_chan_resources - free all channel resources
932 * @chan: DMA channel
933 */
934static void atc_free_chan_resources(struct dma_chan *chan)
935{
936 struct at_dma_chan *atchan = to_at_dma_chan(chan);
937 struct at_dma *atdma = to_at_dma(chan->device);
938 struct at_desc *desc, *_desc;
939 LIST_HEAD(list);
940
941 dev_dbg(chan2dev(chan), "free_chan_resources: (descs allocated=%u)\n",
942 atchan->descs_allocated);
943
944 /* ASSERT: channel is idle */
945 BUG_ON(!list_empty(&atchan->active_list));
946 BUG_ON(!list_empty(&atchan->queue));
947 BUG_ON(atc_chan_is_enabled(atchan));
948
949 list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
950 dev_vdbg(chan2dev(chan), " freeing descriptor %p\n", desc);
951 list_del(&desc->desc_node);
952 /* free link descriptor */
953 dma_pool_free(atdma->dma_desc_pool, desc, desc->txd.phys);
954 }
955 list_splice_init(&atchan->free_list, &list);
956 atchan->descs_allocated = 0;
957
958 dev_vdbg(chan2dev(chan), "free_chan_resources: done\n");
959}
960
961
962/*-- Module Management -----------------------------------------------*/
963
964/**
965 * at_dma_off - disable DMA controller
966 * @atdma: the Atmel HDAMC device
967 */
968static void at_dma_off(struct at_dma *atdma)
969{
970 dma_writel(atdma, EN, 0);
971
972 /* disable all interrupts */
973 dma_writel(atdma, EBCIDR, -1L);
974
975 /* confirm that all channels are disabled */
976 while (dma_readl(atdma, CHSR) & atdma->all_chan_mask)
977 cpu_relax();
978}
979
980static int __init at_dma_probe(struct platform_device *pdev)
981{
982 struct at_dma_platform_data *pdata;
983 struct resource *io;
984 struct at_dma *atdma;
985 size_t size;
986 int irq;
987 int err;
988 int i;
989
990 /* get DMA Controller parameters from platform */
991 pdata = pdev->dev.platform_data;
992 if (!pdata || pdata->nr_channels > AT_DMA_MAX_NR_CHANNELS)
993 return -EINVAL;
994
995 io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
996 if (!io)
997 return -EINVAL;
998
999 irq = platform_get_irq(pdev, 0);
1000 if (irq < 0)
1001 return irq;
1002
1003 size = sizeof(struct at_dma);
1004 size += pdata->nr_channels * sizeof(struct at_dma_chan);
1005 atdma = kzalloc(size, GFP_KERNEL);
1006 if (!atdma)
1007 return -ENOMEM;
1008
1009 /* discover transaction capabilites from the platform data */
1010 atdma->dma_common.cap_mask = pdata->cap_mask;
1011 atdma->all_chan_mask = (1 << pdata->nr_channels) - 1;
1012
1013 size = io->end - io->start + 1;
1014 if (!request_mem_region(io->start, size, pdev->dev.driver->name)) {
1015 err = -EBUSY;
1016 goto err_kfree;
1017 }
1018
1019 atdma->regs = ioremap(io->start, size);
1020 if (!atdma->regs) {
1021 err = -ENOMEM;
1022 goto err_release_r;
1023 }
1024
1025 atdma->clk = clk_get(&pdev->dev, "dma_clk");
1026 if (IS_ERR(atdma->clk)) {
1027 err = PTR_ERR(atdma->clk);
1028 goto err_clk;
1029 }
1030 clk_enable(atdma->clk);
1031
1032 /* force dma off, just in case */
1033 at_dma_off(atdma);
1034
1035 err = request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma);
1036 if (err)
1037 goto err_irq;
1038
1039 platform_set_drvdata(pdev, atdma);
1040
1041 /* create a pool of consistent memory blocks for hardware descriptors */
1042 atdma->dma_desc_pool = dma_pool_create("at_hdmac_desc_pool",
1043 &pdev->dev, sizeof(struct at_desc),
1044 4 /* word alignment */, 0);
1045 if (!atdma->dma_desc_pool) {
1046 dev_err(&pdev->dev, "No memory for descriptors dma pool\n");
1047 err = -ENOMEM;
1048 goto err_pool_create;
1049 }
1050
1051 /* clear any pending interrupt */
1052 while (dma_readl(atdma, EBCISR))
1053 cpu_relax();
1054
1055 /* initialize channels related values */
1056 INIT_LIST_HEAD(&atdma->dma_common.channels);
1057 for (i = 0; i < pdata->nr_channels; i++, atdma->dma_common.chancnt++) {
1058 struct at_dma_chan *atchan = &atdma->chan[i];
1059
1060 atchan->chan_common.device = &atdma->dma_common;
1061 atchan->chan_common.cookie = atchan->completed_cookie = 1;
1062 atchan->chan_common.chan_id = i;
1063 list_add_tail(&atchan->chan_common.device_node,
1064 &atdma->dma_common.channels);
1065
1066 atchan->ch_regs = atdma->regs + ch_regs(i);
1067 spin_lock_init(&atchan->lock);
1068 atchan->mask = 1 << i;
1069
1070 INIT_LIST_HEAD(&atchan->active_list);
1071 INIT_LIST_HEAD(&atchan->queue);
1072 INIT_LIST_HEAD(&atchan->free_list);
1073
1074 tasklet_init(&atchan->tasklet, atc_tasklet,
1075 (unsigned long)atchan);
1076 atc_enable_irq(atchan);
1077 }
1078
1079 /* set base routines */
1080 atdma->dma_common.device_alloc_chan_resources = atc_alloc_chan_resources;
1081 atdma->dma_common.device_free_chan_resources = atc_free_chan_resources;
1082 atdma->dma_common.device_is_tx_complete = atc_is_tx_complete;
1083 atdma->dma_common.device_issue_pending = atc_issue_pending;
1084 atdma->dma_common.dev = &pdev->dev;
1085
1086 /* set prep routines based on capability */
1087 if (dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask))
1088 atdma->dma_common.device_prep_dma_memcpy = atc_prep_dma_memcpy;
1089
1090 if (dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)) {
1091 atdma->dma_common.device_prep_slave_sg = atc_prep_slave_sg;
1092 atdma->dma_common.device_terminate_all = atc_terminate_all;
1093 }
1094
1095 dma_writel(atdma, EN, AT_DMA_ENABLE);
1096
1097 dev_info(&pdev->dev, "Atmel AHB DMA Controller ( %s%s), %d channels\n",
1098 dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask) ? "cpy " : "",
1099 dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "",
1100 atdma->dma_common.chancnt);
1101
1102 dma_async_device_register(&atdma->dma_common);
1103
1104 return 0;
1105
1106err_pool_create:
1107 platform_set_drvdata(pdev, NULL);
1108 free_irq(platform_get_irq(pdev, 0), atdma);
1109err_irq:
1110 clk_disable(atdma->clk);
1111 clk_put(atdma->clk);
1112err_clk:
1113 iounmap(atdma->regs);
1114 atdma->regs = NULL;
1115err_release_r:
1116 release_mem_region(io->start, size);
1117err_kfree:
1118 kfree(atdma);
1119 return err;
1120}
1121
1122static int __exit at_dma_remove(struct platform_device *pdev)
1123{
1124 struct at_dma *atdma = platform_get_drvdata(pdev);
1125 struct dma_chan *chan, *_chan;
1126 struct resource *io;
1127
1128 at_dma_off(atdma);
1129 dma_async_device_unregister(&atdma->dma_common);
1130
1131 dma_pool_destroy(atdma->dma_desc_pool);
1132 platform_set_drvdata(pdev, NULL);
1133 free_irq(platform_get_irq(pdev, 0), atdma);
1134
1135 list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels,
1136 device_node) {
1137 struct at_dma_chan *atchan = to_at_dma_chan(chan);
1138
1139 /* Disable interrupts */
1140 atc_disable_irq(atchan);
1141 tasklet_disable(&atchan->tasklet);
1142
1143 tasklet_kill(&atchan->tasklet);
1144 list_del(&chan->device_node);
1145 }
1146
1147 clk_disable(atdma->clk);
1148 clk_put(atdma->clk);
1149
1150 iounmap(atdma->regs);
1151 atdma->regs = NULL;
1152
1153 io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1154 release_mem_region(io->start, io->end - io->start + 1);
1155
1156 kfree(atdma);
1157
1158 return 0;
1159}
1160
1161static void at_dma_shutdown(struct platform_device *pdev)
1162{
1163 struct at_dma *atdma = platform_get_drvdata(pdev);
1164
1165 at_dma_off(platform_get_drvdata(pdev));
1166 clk_disable(atdma->clk);
1167}
1168
1169static int at_dma_suspend_late(struct platform_device *pdev, pm_message_t mesg)
1170{
1171 struct at_dma *atdma = platform_get_drvdata(pdev);
1172
1173 at_dma_off(platform_get_drvdata(pdev));
1174 clk_disable(atdma->clk);
1175 return 0;
1176}
1177
1178static int at_dma_resume_early(struct platform_device *pdev)
1179{
1180 struct at_dma *atdma = platform_get_drvdata(pdev);
1181
1182 clk_enable(atdma->clk);
1183 dma_writel(atdma, EN, AT_DMA_ENABLE);
1184 return 0;
1185
1186}
1187
1188static struct platform_driver at_dma_driver = {
1189 .remove = __exit_p(at_dma_remove),
1190 .shutdown = at_dma_shutdown,
1191 .suspend_late = at_dma_suspend_late,
1192 .resume_early = at_dma_resume_early,
1193 .driver = {
1194 .name = "at_hdmac",
1195 },
1196};
1197
1198static int __init at_dma_init(void)
1199{
1200 return platform_driver_probe(&at_dma_driver, at_dma_probe);
1201}
1202module_init(at_dma_init);
1203
1204static void __exit at_dma_exit(void)
1205{
1206 platform_driver_unregister(&at_dma_driver);
1207}
1208module_exit(at_dma_exit);
1209
1210MODULE_DESCRIPTION("Atmel AHB DMA Controller driver");
1211MODULE_AUTHOR("Nicolas Ferre <nicolas.ferre@atmel.com>");
1212MODULE_LICENSE("GPL");
1213MODULE_ALIAS("platform:at_hdmac");
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
new file mode 100644
index 000000000000..4c972afc49ec
--- /dev/null
+++ b/drivers/dma/at_hdmac_regs.h
@@ -0,0 +1,353 @@
1/*
2 * Header file for the Atmel AHB DMA Controller driver
3 *
4 * Copyright (C) 2008 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#ifndef AT_HDMAC_REGS_H
12#define AT_HDMAC_REGS_H
13
14#include <mach/at_hdmac.h>
15
16#define AT_DMA_MAX_NR_CHANNELS 8
17
18
19#define AT_DMA_GCFG 0x00 /* Global Configuration Register */
20#define AT_DMA_IF_BIGEND(i) (0x1 << (i)) /* AHB-Lite Interface i in Big-endian mode */
21#define AT_DMA_ARB_CFG (0x1 << 4) /* Arbiter mode. */
22#define AT_DMA_ARB_CFG_FIXED (0x0 << 4)
23#define AT_DMA_ARB_CFG_ROUND_ROBIN (0x1 << 4)
24
25#define AT_DMA_EN 0x04 /* Controller Enable Register */
26#define AT_DMA_ENABLE (0x1 << 0)
27
28#define AT_DMA_SREQ 0x08 /* Software Single Request Register */
29#define AT_DMA_SSREQ(x) (0x1 << ((x) << 1)) /* Request a source single transfer on channel x */
30#define AT_DMA_DSREQ(x) (0x1 << (1 + ((x) << 1))) /* Request a destination single transfer on channel x */
31
32#define AT_DMA_CREQ 0x0C /* Software Chunk Transfer Request Register */
33#define AT_DMA_SCREQ(x) (0x1 << ((x) << 1)) /* Request a source chunk transfer on channel x */
34#define AT_DMA_DCREQ(x) (0x1 << (1 + ((x) << 1))) /* Request a destination chunk transfer on channel x */
35
36#define AT_DMA_LAST 0x10 /* Software Last Transfer Flag Register */
37#define AT_DMA_SLAST(x) (0x1 << ((x) << 1)) /* This src rq is last tx of buffer on channel x */
38#define AT_DMA_DLAST(x) (0x1 << (1 + ((x) << 1))) /* This dst rq is last tx of buffer on channel x */
39
40#define AT_DMA_SYNC 0x14 /* Request Synchronization Register */
41#define AT_DMA_SYR(h) (0x1 << (h)) /* Synchronize handshake line h */
42
43/* Error, Chained Buffer transfer completed and Buffer transfer completed Interrupt registers */
44#define AT_DMA_EBCIER 0x18 /* Enable register */
45#define AT_DMA_EBCIDR 0x1C /* Disable register */
46#define AT_DMA_EBCIMR 0x20 /* Mask Register */
47#define AT_DMA_EBCISR 0x24 /* Status Register */
48#define AT_DMA_CBTC_OFFSET 8
49#define AT_DMA_ERR_OFFSET 16
50#define AT_DMA_BTC(x) (0x1 << (x))
51#define AT_DMA_CBTC(x) (0x1 << (AT_DMA_CBTC_OFFSET + (x)))
52#define AT_DMA_ERR(x) (0x1 << (AT_DMA_ERR_OFFSET + (x)))
53
54#define AT_DMA_CHER 0x28 /* Channel Handler Enable Register */
55#define AT_DMA_ENA(x) (0x1 << (x))
56#define AT_DMA_SUSP(x) (0x1 << ( 8 + (x)))
57#define AT_DMA_KEEP(x) (0x1 << (24 + (x)))
58
59#define AT_DMA_CHDR 0x2C /* Channel Handler Disable Register */
60#define AT_DMA_DIS(x) (0x1 << (x))
61#define AT_DMA_RES(x) (0x1 << ( 8 + (x)))
62
63#define AT_DMA_CHSR 0x30 /* Channel Handler Status Register */
64#define AT_DMA_EMPT(x) (0x1 << (16 + (x)))
65#define AT_DMA_STAL(x) (0x1 << (24 + (x)))
66
67
68#define AT_DMA_CH_REGS_BASE 0x3C /* Channel registers base address */
69#define ch_regs(x) (AT_DMA_CH_REGS_BASE + (x) * 0x28) /* Channel x base addr */
70
71/* Hardware register offset for each channel */
72#define ATC_SADDR_OFFSET 0x00 /* Source Address Register */
73#define ATC_DADDR_OFFSET 0x04 /* Destination Address Register */
74#define ATC_DSCR_OFFSET 0x08 /* Descriptor Address Register */
75#define ATC_CTRLA_OFFSET 0x0C /* Control A Register */
76#define ATC_CTRLB_OFFSET 0x10 /* Control B Register */
77#define ATC_CFG_OFFSET 0x14 /* Configuration Register */
78#define ATC_SPIP_OFFSET 0x18 /* Src PIP Configuration Register */
79#define ATC_DPIP_OFFSET 0x1C /* Dst PIP Configuration Register */
80
81
82/* Bitfield definitions */
83
84/* Bitfields in DSCR */
85#define ATC_DSCR_IF(i) (0x3 & (i)) /* Dsc feched via AHB-Lite Interface i */
86
87/* Bitfields in CTRLA */
88#define ATC_BTSIZE_MAX 0xFFFFUL /* Maximum Buffer Transfer Size */
89#define ATC_BTSIZE(x) (ATC_BTSIZE_MAX & (x)) /* Buffer Transfer Size */
90/* Chunck Tranfer size definitions are in at_hdmac.h */
91#define ATC_SRC_WIDTH_MASK (0x3 << 24) /* Source Single Transfer Size */
92#define ATC_SRC_WIDTH(x) ((x) << 24)
93#define ATC_SRC_WIDTH_BYTE (0x0 << 24)
94#define ATC_SRC_WIDTH_HALFWORD (0x1 << 24)
95#define ATC_SRC_WIDTH_WORD (0x2 << 24)
96#define ATC_DST_WIDTH_MASK (0x3 << 28) /* Destination Single Transfer Size */
97#define ATC_DST_WIDTH(x) ((x) << 28)
98#define ATC_DST_WIDTH_BYTE (0x0 << 28)
99#define ATC_DST_WIDTH_HALFWORD (0x1 << 28)
100#define ATC_DST_WIDTH_WORD (0x2 << 28)
101#define ATC_DONE (0x1 << 31) /* Tx Done (only written back in descriptor) */
102
103/* Bitfields in CTRLB */
104#define ATC_SIF(i) (0x3 & (i)) /* Src tx done via AHB-Lite Interface i */
105#define ATC_DIF(i) ((0x3 & (i)) << 4) /* Dst tx done via AHB-Lite Interface i */
106#define ATC_SRC_PIP (0x1 << 8) /* Source Picture-in-Picture enabled */
107#define ATC_DST_PIP (0x1 << 12) /* Destination Picture-in-Picture enabled */
108#define ATC_SRC_DSCR_DIS (0x1 << 16) /* Src Descriptor fetch disable */
109#define ATC_DST_DSCR_DIS (0x1 << 20) /* Dst Descriptor fetch disable */
110#define ATC_FC_MASK (0x7 << 21) /* Choose Flow Controller */
111#define ATC_FC_MEM2MEM (0x0 << 21) /* Mem-to-Mem (DMA) */
112#define ATC_FC_MEM2PER (0x1 << 21) /* Mem-to-Periph (DMA) */
113#define ATC_FC_PER2MEM (0x2 << 21) /* Periph-to-Mem (DMA) */
114#define ATC_FC_PER2PER (0x3 << 21) /* Periph-to-Periph (DMA) */
115#define ATC_FC_PER2MEM_PER (0x4 << 21) /* Periph-to-Mem (Peripheral) */
116#define ATC_FC_MEM2PER_PER (0x5 << 21) /* Mem-to-Periph (Peripheral) */
117#define ATC_FC_PER2PER_SRCPER (0x6 << 21) /* Periph-to-Periph (Src Peripheral) */
118#define ATC_FC_PER2PER_DSTPER (0x7 << 21) /* Periph-to-Periph (Dst Peripheral) */
119#define ATC_SRC_ADDR_MODE_MASK (0x3 << 24)
120#define ATC_SRC_ADDR_MODE_INCR (0x0 << 24) /* Incrementing Mode */
121#define ATC_SRC_ADDR_MODE_DECR (0x1 << 24) /* Decrementing Mode */
122#define ATC_SRC_ADDR_MODE_FIXED (0x2 << 24) /* Fixed Mode */
123#define ATC_DST_ADDR_MODE_MASK (0x3 << 28)
124#define ATC_DST_ADDR_MODE_INCR (0x0 << 28) /* Incrementing Mode */
125#define ATC_DST_ADDR_MODE_DECR (0x1 << 28) /* Decrementing Mode */
126#define ATC_DST_ADDR_MODE_FIXED (0x2 << 28) /* Fixed Mode */
127#define ATC_IEN (0x1 << 30) /* BTC interrupt enable (active low) */
128#define ATC_AUTO (0x1 << 31) /* Auto multiple buffer tx enable */
129
130/* Bitfields in CFG */
131/* are in at_hdmac.h */
132
133/* Bitfields in SPIP */
134#define ATC_SPIP_HOLE(x) (0xFFFFU & (x))
135#define ATC_SPIP_BOUNDARY(x) ((0x3FF & (x)) << 16)
136
137/* Bitfields in DPIP */
138#define ATC_DPIP_HOLE(x) (0xFFFFU & (x))
139#define ATC_DPIP_BOUNDARY(x) ((0x3FF & (x)) << 16)
140
141
142/*-- descriptors -----------------------------------------------------*/
143
144/* LLI == Linked List Item; aka DMA buffer descriptor */
145struct at_lli {
146 /* values that are not changed by hardware */
147 dma_addr_t saddr;
148 dma_addr_t daddr;
149 /* value that may get written back: */
150 u32 ctrla;
151 /* more values that are not changed by hardware */
152 u32 ctrlb;
153 dma_addr_t dscr; /* chain to next lli */
154};
155
156/**
157 * struct at_desc - software descriptor
158 * @at_lli: hardware lli structure
159 * @txd: support for the async_tx api
160 * @desc_node: node on the channed descriptors list
161 * @len: total transaction bytecount
162 */
163struct at_desc {
164 /* FIRST values the hardware uses */
165 struct at_lli lli;
166
167 /* THEN values for driver housekeeping */
168 struct dma_async_tx_descriptor txd;
169 struct list_head desc_node;
170 size_t len;
171};
172
173static inline struct at_desc *
174txd_to_at_desc(struct dma_async_tx_descriptor *txd)
175{
176 return container_of(txd, struct at_desc, txd);
177}
178
179
180/*-- Channels --------------------------------------------------------*/
181
182/**
183 * struct at_dma_chan - internal representation of an Atmel HDMAC channel
184 * @chan_common: common dmaengine channel object members
185 * @device: parent device
186 * @ch_regs: memory mapped register base
187 * @mask: channel index in a mask
188 * @error_status: transmit error status information from irq handler
189 * to tasklet (use atomic operations)
190 * @tasklet: bottom half to finish transaction work
191 * @lock: serializes enqueue/dequeue operations to descriptors lists
192 * @completed_cookie: identifier for the most recently completed operation
193 * @active_list: list of descriptors dmaengine is being running on
194 * @queue: list of descriptors ready to be submitted to engine
195 * @free_list: list of descriptors usable by the channel
196 * @descs_allocated: records the actual size of the descriptor pool
197 */
198struct at_dma_chan {
199 struct dma_chan chan_common;
200 struct at_dma *device;
201 void __iomem *ch_regs;
202 u8 mask;
203 unsigned long error_status;
204 struct tasklet_struct tasklet;
205
206 spinlock_t lock;
207
208 /* these other elements are all protected by lock */
209 dma_cookie_t completed_cookie;
210 struct list_head active_list;
211 struct list_head queue;
212 struct list_head free_list;
213 unsigned int descs_allocated;
214};
215
216#define channel_readl(atchan, name) \
217 __raw_readl((atchan)->ch_regs + ATC_##name##_OFFSET)
218
219#define channel_writel(atchan, name, val) \
220 __raw_writel((val), (atchan)->ch_regs + ATC_##name##_OFFSET)
221
222static inline struct at_dma_chan *to_at_dma_chan(struct dma_chan *dchan)
223{
224 return container_of(dchan, struct at_dma_chan, chan_common);
225}
226
227
228/*-- Controller ------------------------------------------------------*/
229
230/**
231 * struct at_dma - internal representation of an Atmel HDMA Controller
232 * @chan_common: common dmaengine dma_device object members
233 * @ch_regs: memory mapped register base
234 * @clk: dma controller clock
235 * @all_chan_mask: all channels availlable in a mask
236 * @dma_desc_pool: base of DMA descriptor region (DMA address)
237 * @chan: channels table to store at_dma_chan structures
238 */
239struct at_dma {
240 struct dma_device dma_common;
241 void __iomem *regs;
242 struct clk *clk;
243
244 u8 all_chan_mask;
245
246 struct dma_pool *dma_desc_pool;
247 /* AT THE END channels table */
248 struct at_dma_chan chan[0];
249};
250
251#define dma_readl(atdma, name) \
252 __raw_readl((atdma)->regs + AT_DMA_##name)
253#define dma_writel(atdma, name, val) \
254 __raw_writel((val), (atdma)->regs + AT_DMA_##name)
255
256static inline struct at_dma *to_at_dma(struct dma_device *ddev)
257{
258 return container_of(ddev, struct at_dma, dma_common);
259}
260
261
262/*-- Helper functions ------------------------------------------------*/
263
264static struct device *chan2dev(struct dma_chan *chan)
265{
266 return &chan->dev->device;
267}
268static struct device *chan2parent(struct dma_chan *chan)
269{
270 return chan->dev->device.parent;
271}
272
273#if defined(VERBOSE_DEBUG)
274static void vdbg_dump_regs(struct at_dma_chan *atchan)
275{
276 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
277
278 dev_err(chan2dev(&atchan->chan_common),
279 " channel %d : imr = 0x%x, chsr = 0x%x\n",
280 atchan->chan_common.chan_id,
281 dma_readl(atdma, EBCIMR),
282 dma_readl(atdma, CHSR));
283
284 dev_err(chan2dev(&atchan->chan_common),
285 " channel: s0x%x d0x%x ctrl0x%x:0x%x cfg0x%x l0x%x\n",
286 channel_readl(atchan, SADDR),
287 channel_readl(atchan, DADDR),
288 channel_readl(atchan, CTRLA),
289 channel_readl(atchan, CTRLB),
290 channel_readl(atchan, CFG),
291 channel_readl(atchan, DSCR));
292}
293#else
294static void vdbg_dump_regs(struct at_dma_chan *atchan) {}
295#endif
296
297static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
298{
299 dev_printk(KERN_CRIT, chan2dev(&atchan->chan_common),
300 " desc: s0x%x d0x%x ctrl0x%x:0x%x l0x%x\n",
301 lli->saddr, lli->daddr,
302 lli->ctrla, lli->ctrlb, lli->dscr);
303}
304
305
306static void atc_setup_irq(struct at_dma_chan *atchan, int on)
307{
308 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
309 u32 ebci;
310
311 /* enable interrupts on buffer chain completion & error */
312 ebci = AT_DMA_CBTC(atchan->chan_common.chan_id)
313 | AT_DMA_ERR(atchan->chan_common.chan_id);
314 if (on)
315 dma_writel(atdma, EBCIER, ebci);
316 else
317 dma_writel(atdma, EBCIDR, ebci);
318}
319
320static inline void atc_enable_irq(struct at_dma_chan *atchan)
321{
322 atc_setup_irq(atchan, 1);
323}
324
325static inline void atc_disable_irq(struct at_dma_chan *atchan)
326{
327 atc_setup_irq(atchan, 0);
328}
329
330
331/**
332 * atc_chan_is_enabled - test if given channel is enabled
333 * @atchan: channel we want to test status
334 */
335static inline int atc_chan_is_enabled(struct at_dma_chan *atchan)
336{
337 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
338
339 return !!(dma_readl(atdma, CHSR) & atchan->mask);
340}
341
342
343/**
344 * set_desc_eol - set end-of-link to descriptor so it will end transfer
345 * @desc: descriptor, signle or at the end of a chain, to end chain on
346 */
347static void set_desc_eol(struct at_desc *desc)
348{
349 desc->lli.ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS;
350 desc->lli.dscr = 0;
351}
352
353#endif /* AT_HDMAC_REGS_H */
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index fb7da5141e96..d93017fc7872 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -38,6 +38,11 @@ module_param(max_channels, uint, S_IRUGO);
38MODULE_PARM_DESC(max_channels, 38MODULE_PARM_DESC(max_channels,
39 "Maximum number of channels to use (default: all)"); 39 "Maximum number of channels to use (default: all)");
40 40
41static unsigned int iterations;
42module_param(iterations, uint, S_IRUGO);
43MODULE_PARM_DESC(iterations,
44 "Iterations before stopping test (default: infinite)");
45
41static unsigned int xor_sources = 3; 46static unsigned int xor_sources = 3;
42module_param(xor_sources, uint, S_IRUGO); 47module_param(xor_sources, uint, S_IRUGO);
43MODULE_PARM_DESC(xor_sources, 48MODULE_PARM_DESC(xor_sources,
@@ -114,7 +119,7 @@ static void dmatest_init_srcs(u8 **bufs, unsigned int start, unsigned int len)
114 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK); 119 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
115 for ( ; i < start + len; i++) 120 for ( ; i < start + len; i++)
116 buf[i] = PATTERN_SRC | PATTERN_COPY 121 buf[i] = PATTERN_SRC | PATTERN_COPY
117 | (~i & PATTERN_COUNT_MASK);; 122 | (~i & PATTERN_COUNT_MASK);
118 for ( ; i < test_buf_size; i++) 123 for ( ; i < test_buf_size; i++)
119 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK); 124 buf[i] = PATTERN_SRC | (~i & PATTERN_COUNT_MASK);
120 buf++; 125 buf++;
@@ -270,7 +275,8 @@ static int dmatest_func(void *data)
270 275
271 flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT; 276 flags = DMA_CTRL_ACK | DMA_COMPL_SKIP_DEST_UNMAP | DMA_PREP_INTERRUPT;
272 277
273 while (!kthread_should_stop()) { 278 while (!kthread_should_stop()
279 && !(iterations && total_tests >= iterations)) {
274 struct dma_device *dev = chan->device; 280 struct dma_device *dev = chan->device;
275 struct dma_async_tx_descriptor *tx = NULL; 281 struct dma_async_tx_descriptor *tx = NULL;
276 dma_addr_t dma_srcs[src_cnt]; 282 dma_addr_t dma_srcs[src_cnt];
@@ -416,6 +422,13 @@ err_srcbuf:
416err_srcs: 422err_srcs:
417 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n", 423 pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
418 thread_name, total_tests, failed_tests, ret); 424 thread_name, total_tests, failed_tests, ret);
425
426 if (iterations > 0)
427 while (!kthread_should_stop()) {
428 DECLARE_WAIT_QUEUE_HEAD(wait_dmatest_exit);
429 interruptible_sleep_on(&wait_dmatest_exit);
430 }
431
419 return ret; 432 return ret;
420} 433}
421 434
@@ -495,11 +508,11 @@ static int dmatest_add_channel(struct dma_chan *chan)
495 508
496 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) { 509 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
497 cnt = dmatest_add_threads(dtc, DMA_MEMCPY); 510 cnt = dmatest_add_threads(dtc, DMA_MEMCPY);
498 thread_count += cnt > 0 ?: 0; 511 thread_count += cnt > 0 ? cnt : 0;
499 } 512 }
500 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) { 513 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
501 cnt = dmatest_add_threads(dtc, DMA_XOR); 514 cnt = dmatest_add_threads(dtc, DMA_XOR);
502 thread_count += cnt > 0 ?: 0; 515 thread_count += cnt > 0 ? cnt : 0;
503 } 516 }
504 517
505 pr_info("dmatest: Started %u threads using %s\n", 518 pr_info("dmatest: Started %u threads using %s\n",
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index f18d1bde0439..ef87a8984145 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -12,6 +12,11 @@
12 * also fit for MPC8560, MPC8555, MPC8548, MPC8641, and etc. 12 * also fit for MPC8560, MPC8555, MPC8548, MPC8641, and etc.
13 * The support for MPC8349 DMA contorller is also added. 13 * The support for MPC8349 DMA contorller is also added.
14 * 14 *
15 * This driver instructs the DMA controller to issue the PCI Read Multiple
16 * command for PCI read operations, instead of using the default PCI Read Line
17 * command. Please be aware that this setting may result in read pre-fetching
18 * on some platforms.
19 *
15 * This is free software; you can redistribute it and/or modify 20 * This is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by 21 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or 22 * the Free Software Foundation; either version 2 of the License, or
@@ -49,9 +54,10 @@ static void dma_init(struct fsl_dma_chan *fsl_chan)
49 case FSL_DMA_IP_83XX: 54 case FSL_DMA_IP_83XX:
50 /* Set the channel to below modes: 55 /* Set the channel to below modes:
51 * EOTIE - End-of-transfer interrupt enable 56 * EOTIE - End-of-transfer interrupt enable
57 * PRC_RM - PCI read multiple
52 */ 58 */
53 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, FSL_DMA_MR_EOTIE, 59 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, FSL_DMA_MR_EOTIE
54 32); 60 | FSL_DMA_MR_PRC_RM, 32);
55 break; 61 break;
56 } 62 }
57 63
@@ -136,15 +142,16 @@ static int dma_is_idle(struct fsl_dma_chan *fsl_chan)
136 142
137static void dma_start(struct fsl_dma_chan *fsl_chan) 143static void dma_start(struct fsl_dma_chan *fsl_chan)
138{ 144{
139 u32 mr_set = 0;; 145 u32 mr_set = 0;
140 146
141 if (fsl_chan->feature & FSL_DMA_CHAN_PAUSE_EXT) { 147 if (fsl_chan->feature & FSL_DMA_CHAN_PAUSE_EXT) {
142 DMA_OUT(fsl_chan, &fsl_chan->reg_base->bcr, 0, 32); 148 DMA_OUT(fsl_chan, &fsl_chan->reg_base->bcr, 0, 32);
143 mr_set |= FSL_DMA_MR_EMP_EN; 149 mr_set |= FSL_DMA_MR_EMP_EN;
144 } else 150 } else if ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) {
145 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, 151 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
146 DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) 152 DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32)
147 & ~FSL_DMA_MR_EMP_EN, 32); 153 & ~FSL_DMA_MR_EMP_EN, 32);
154 }
148 155
149 if (fsl_chan->feature & FSL_DMA_CHAN_START_EXT) 156 if (fsl_chan->feature & FSL_DMA_CHAN_START_EXT)
150 mr_set |= FSL_DMA_MR_EMS_EN; 157 mr_set |= FSL_DMA_MR_EMS_EN;
@@ -871,9 +878,9 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
871 878
872 switch (new_fsl_chan->feature & FSL_DMA_IP_MASK) { 879 switch (new_fsl_chan->feature & FSL_DMA_IP_MASK) {
873 case FSL_DMA_IP_85XX: 880 case FSL_DMA_IP_85XX:
874 new_fsl_chan->toggle_ext_start = fsl_chan_toggle_ext_start;
875 new_fsl_chan->toggle_ext_pause = fsl_chan_toggle_ext_pause; 881 new_fsl_chan->toggle_ext_pause = fsl_chan_toggle_ext_pause;
876 case FSL_DMA_IP_83XX: 882 case FSL_DMA_IP_83XX:
883 new_fsl_chan->toggle_ext_start = fsl_chan_toggle_ext_start;
877 new_fsl_chan->set_src_loop_size = fsl_chan_set_src_loop_size; 884 new_fsl_chan->set_src_loop_size = fsl_chan_set_src_loop_size;
878 new_fsl_chan->set_dest_loop_size = fsl_chan_set_dest_loop_size; 885 new_fsl_chan->set_dest_loop_size = fsl_chan_set_dest_loop_size;
879 } 886 }
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
index 4f21a512d848..dc7f26865797 100644
--- a/drivers/dma/fsldma.h
+++ b/drivers/dma/fsldma.h
@@ -38,6 +38,7 @@
38 38
39/* Special MR definition for MPC8349 */ 39/* Special MR definition for MPC8349 */
40#define FSL_DMA_MR_EOTIE 0x00000080 40#define FSL_DMA_MR_EOTIE 0x00000080
41#define FSL_DMA_MR_PRC_RM 0x00000800
41 42
42#define FSL_DMA_SR_CH 0x00000020 43#define FSL_DMA_SR_CH 0x00000020
43#define FSL_DMA_SR_PE 0x00000010 44#define FSL_DMA_SR_PE 0x00000010
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index ddab94f51224..3f23eabe09f2 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1176,7 +1176,7 @@ static int __devinit mv_xor_probe(struct platform_device *pdev)
1176 if (dma_has_cap(DMA_MEMSET, dma_dev->cap_mask)) 1176 if (dma_has_cap(DMA_MEMSET, dma_dev->cap_mask))
1177 dma_dev->device_prep_dma_memset = mv_xor_prep_dma_memset; 1177 dma_dev->device_prep_dma_memset = mv_xor_prep_dma_memset;
1178 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) { 1178 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
1179 dma_dev->max_xor = 8; ; 1179 dma_dev->max_xor = 8;
1180 dma_dev->device_prep_dma_xor = mv_xor_prep_dma_xor; 1180 dma_dev->device_prep_dma_xor = mv_xor_prep_dma_xor;
1181 } 1181 }
1182 1182
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 858fe6037223..24964c1d0af9 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -970,7 +970,7 @@ static void amd64_read_dct_base_mask(struct amd64_pvt *pvt)
970 } 970 }
971 971
972 for (cs = 0; cs < pvt->num_dcsm; cs++) { 972 for (cs = 0; cs < pvt->num_dcsm; cs++) {
973 reg = K8_DCSB0 + (cs * 4); 973 reg = K8_DCSM0 + (cs * 4);
974 err = pci_read_config_dword(pvt->dram_f2_ctl, reg, 974 err = pci_read_config_dword(pvt->dram_f2_ctl, reg,
975 &pvt->dcsm0[cs]); 975 &pvt->dcsm0[cs]);
976 if (unlikely(err)) 976 if (unlikely(err))
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
index 2406c2ce2844..d4ec60593176 100644
--- a/drivers/edac/x38_edac.c
+++ b/drivers/edac/x38_edac.c
@@ -30,7 +30,7 @@
30/* Intel X38 register addresses - device 0 function 0 - DRAM Controller */ 30/* Intel X38 register addresses - device 0 function 0 - DRAM Controller */
31 31
32#define X38_MCHBAR_LOW 0x48 /* MCH Memory Mapped Register BAR */ 32#define X38_MCHBAR_LOW 0x48 /* MCH Memory Mapped Register BAR */
33#define X38_MCHBAR_HIGH 0x4b 33#define X38_MCHBAR_HIGH 0x4c
34#define X38_MCHBAR_MASK 0xfffffc000ULL /* bits 35:14 */ 34#define X38_MCHBAR_MASK 0xfffffc000ULL /* bits 35:14 */
35#define X38_MMR_WINDOW_SIZE 16384 35#define X38_MMR_WINDOW_SIZE 16384
36 36
diff --git a/drivers/gpio/vr41xx_giu.c b/drivers/gpio/vr41xx_giu.c
index b70e06133e78..b16c9a8c03f5 100644
--- a/drivers/gpio/vr41xx_giu.c
+++ b/drivers/gpio/vr41xx_giu.c
@@ -29,7 +29,6 @@
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/smp_lock.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/types.h> 33#include <linux/types.h>
35 34
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 2960b6d73456..9903f270e440 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -101,6 +101,10 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count,
101 continue; 101 continue;
102 102
103 tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL); 103 tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
104 if (tmp == NULL) {
105 ret = -1;
106 goto fail;
107 }
104 ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, 108 ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO,
105 root, tmp, &drm_debugfs_fops); 109 root, tmp, &drm_debugfs_fops);
106 if (!ent) { 110 if (!ent) {
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 8104ecaea26f..ffe8f4394d50 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -134,26 +134,29 @@ drm_gem_object_alloc(struct drm_device *dev, size_t size)
134 BUG_ON((size & (PAGE_SIZE - 1)) != 0); 134 BUG_ON((size & (PAGE_SIZE - 1)) != 0);
135 135
136 obj = kzalloc(sizeof(*obj), GFP_KERNEL); 136 obj = kzalloc(sizeof(*obj), GFP_KERNEL);
137 if (!obj)
138 goto free;
137 139
138 obj->dev = dev; 140 obj->dev = dev;
139 obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE); 141 obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE);
140 if (IS_ERR(obj->filp)) { 142 if (IS_ERR(obj->filp))
141 kfree(obj); 143 goto free;
142 return NULL;
143 }
144 144
145 kref_init(&obj->refcount); 145 kref_init(&obj->refcount);
146 kref_init(&obj->handlecount); 146 kref_init(&obj->handlecount);
147 obj->size = size; 147 obj->size = size;
148 if (dev->driver->gem_init_object != NULL && 148 if (dev->driver->gem_init_object != NULL &&
149 dev->driver->gem_init_object(obj) != 0) { 149 dev->driver->gem_init_object(obj) != 0) {
150 fput(obj->filp); 150 goto fput;
151 kfree(obj);
152 return NULL;
153 } 151 }
154 atomic_inc(&dev->object_count); 152 atomic_inc(&dev->object_count);
155 atomic_add(obj->size, &dev->object_memory); 153 atomic_add(obj->size, &dev->object_memory);
156 return obj; 154 return obj;
155fput:
156 fput(obj->filp);
157free:
158 kfree(obj);
159 return NULL;
157} 160}
158EXPORT_SYMBOL(drm_gem_object_alloc); 161EXPORT_SYMBOL(drm_gem_object_alloc);
159 162
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 155a5bbce680..55bb8a82d612 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -489,7 +489,7 @@ int drm_put_minor(struct drm_minor **minor_p)
489 */ 489 */
490void drm_put_dev(struct drm_device *dev) 490void drm_put_dev(struct drm_device *dev)
491{ 491{
492 struct drm_driver *driver = dev->driver; 492 struct drm_driver *driver;
493 struct drm_map_list *r_list, *list_temp; 493 struct drm_map_list *r_list, *list_temp;
494 494
495 DRM_DEBUG("\n"); 495 DRM_DEBUG("\n");
@@ -498,6 +498,7 @@ void drm_put_dev(struct drm_device *dev)
498 DRM_ERROR("cleanup called no dev\n"); 498 DRM_ERROR("cleanup called no dev\n");
499 return; 499 return;
500 } 500 }
501 driver = dev->driver;
501 502
502 drm_vblank_cleanup(dev); 503 drm_vblank_cleanup(dev);
503 504
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile
index 5fae1e074b4b..013d38059943 100644
--- a/drivers/gpu/drm/radeon/Makefile
+++ b/drivers/gpu/drm/radeon/Makefile
@@ -13,7 +13,8 @@ radeon-$(CONFIG_DRM_RADEON_KMS) += radeon_device.o radeon_kms.o \
13 radeon_encoders.o radeon_display.o radeon_cursor.o radeon_i2c.o \ 13 radeon_encoders.o radeon_display.o radeon_cursor.o radeon_i2c.o \
14 radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \ 14 radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \
15 radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ 15 radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \
16 rs400.o rs600.o rs690.o rv515.o r520.o r600.o rs780.o rv770.o 16 rs400.o rs600.o rs690.o rv515.o r520.o r600.o rs780.o rv770.o \
17 radeon_test.o
17 18
18radeon-$(CONFIG_COMPAT) += radeon_ioc32.o 19radeon-$(CONFIG_COMPAT) += radeon_ioc32.o
19 20
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index c0080cc9bf8d..74d034f77c6b 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -31,6 +31,132 @@
31#include "atom.h" 31#include "atom.h"
32#include "atom-bits.h" 32#include "atom-bits.h"
33 33
34static void atombios_overscan_setup(struct drm_crtc *crtc,
35 struct drm_display_mode *mode,
36 struct drm_display_mode *adjusted_mode)
37{
38 struct drm_device *dev = crtc->dev;
39 struct radeon_device *rdev = dev->dev_private;
40 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
41 SET_CRTC_OVERSCAN_PS_ALLOCATION args;
42 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_OverScan);
43 int a1, a2;
44
45 memset(&args, 0, sizeof(args));
46
47 args.usOverscanRight = 0;
48 args.usOverscanLeft = 0;
49 args.usOverscanBottom = 0;
50 args.usOverscanTop = 0;
51 args.ucCRTC = radeon_crtc->crtc_id;
52
53 switch (radeon_crtc->rmx_type) {
54 case RMX_CENTER:
55 args.usOverscanTop = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
56 args.usOverscanBottom = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
57 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
58 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
59 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
60 break;
61 case RMX_ASPECT:
62 a1 = mode->crtc_vdisplay * adjusted_mode->crtc_hdisplay;
63 a2 = adjusted_mode->crtc_vdisplay * mode->crtc_hdisplay;
64
65 if (a1 > a2) {
66 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
67 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
68 } else if (a2 > a1) {
69 args.usOverscanLeft = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
70 args.usOverscanRight = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
71 }
72 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
73 break;
74 case RMX_FULL:
75 default:
76 args.usOverscanRight = 0;
77 args.usOverscanLeft = 0;
78 args.usOverscanBottom = 0;
79 args.usOverscanTop = 0;
80 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
81 break;
82 }
83}
84
85static void atombios_scaler_setup(struct drm_crtc *crtc)
86{
87 struct drm_device *dev = crtc->dev;
88 struct radeon_device *rdev = dev->dev_private;
89 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
90 ENABLE_SCALER_PS_ALLOCATION args;
91 int index = GetIndexIntoMasterTable(COMMAND, EnableScaler);
92 /* fixme - fill in enc_priv for atom dac */
93 enum radeon_tv_std tv_std = TV_STD_NTSC;
94
95 if (!ASIC_IS_AVIVO(rdev) && radeon_crtc->crtc_id)
96 return;
97
98 memset(&args, 0, sizeof(args));
99
100 args.ucScaler = radeon_crtc->crtc_id;
101
102 if (radeon_crtc->devices & (ATOM_DEVICE_TV_SUPPORT)) {
103 switch (tv_std) {
104 case TV_STD_NTSC:
105 default:
106 args.ucTVStandard = ATOM_TV_NTSC;
107 break;
108 case TV_STD_PAL:
109 args.ucTVStandard = ATOM_TV_PAL;
110 break;
111 case TV_STD_PAL_M:
112 args.ucTVStandard = ATOM_TV_PALM;
113 break;
114 case TV_STD_PAL_60:
115 args.ucTVStandard = ATOM_TV_PAL60;
116 break;
117 case TV_STD_NTSC_J:
118 args.ucTVStandard = ATOM_TV_NTSCJ;
119 break;
120 case TV_STD_SCART_PAL:
121 args.ucTVStandard = ATOM_TV_PAL; /* ??? */
122 break;
123 case TV_STD_SECAM:
124 args.ucTVStandard = ATOM_TV_SECAM;
125 break;
126 case TV_STD_PAL_CN:
127 args.ucTVStandard = ATOM_TV_PALCN;
128 break;
129 }
130 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
131 } else if (radeon_crtc->devices & (ATOM_DEVICE_CV_SUPPORT)) {
132 args.ucTVStandard = ATOM_TV_CV;
133 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
134 } else {
135 switch (radeon_crtc->rmx_type) {
136 case RMX_FULL:
137 args.ucEnable = ATOM_SCALER_EXPANSION;
138 break;
139 case RMX_CENTER:
140 args.ucEnable = ATOM_SCALER_CENTER;
141 break;
142 case RMX_ASPECT:
143 args.ucEnable = ATOM_SCALER_EXPANSION;
144 break;
145 default:
146 if (ASIC_IS_AVIVO(rdev))
147 args.ucEnable = ATOM_SCALER_DISABLE;
148 else
149 args.ucEnable = ATOM_SCALER_CENTER;
150 break;
151 }
152 }
153 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
154 if (radeon_crtc->devices & (ATOM_DEVICE_CV_SUPPORT | ATOM_DEVICE_TV_SUPPORT)
155 && rdev->family >= CHIP_RV515 && rdev->family <= CHIP_RV570) {
156 atom_rv515_force_tv_scaler(rdev);
157 }
158}
159
34static void atombios_lock_crtc(struct drm_crtc *crtc, int lock) 160static void atombios_lock_crtc(struct drm_crtc *crtc, int lock)
35{ 161{
36 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 162 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
@@ -203,6 +329,12 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
203 if (ASIC_IS_AVIVO(rdev)) { 329 if (ASIC_IS_AVIVO(rdev)) {
204 uint32_t ss_cntl; 330 uint32_t ss_cntl;
205 331
332 if ((rdev->family == CHIP_RS600) ||
333 (rdev->family == CHIP_RS690) ||
334 (rdev->family == CHIP_RS740))
335 pll_flags |= (RADEON_PLL_USE_FRAC_FB_DIV |
336 RADEON_PLL_PREFER_CLOSEST_LOWER);
337
206 if (ASIC_IS_DCE32(rdev) && mode->clock > 200000) /* range limits??? */ 338 if (ASIC_IS_DCE32(rdev) && mode->clock > 200000) /* range limits??? */
207 pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; 339 pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
208 else 340 else
@@ -321,7 +453,7 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
321 struct drm_gem_object *obj; 453 struct drm_gem_object *obj;
322 struct drm_radeon_gem_object *obj_priv; 454 struct drm_radeon_gem_object *obj_priv;
323 uint64_t fb_location; 455 uint64_t fb_location;
324 uint32_t fb_format, fb_pitch_pixels; 456 uint32_t fb_format, fb_pitch_pixels, tiling_flags;
325 457
326 if (!crtc->fb) 458 if (!crtc->fb)
327 return -EINVAL; 459 return -EINVAL;
@@ -358,7 +490,14 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
358 return -EINVAL; 490 return -EINVAL;
359 } 491 }
360 492
361 /* TODO tiling */ 493 radeon_object_get_tiling_flags(obj->driver_private,
494 &tiling_flags, NULL);
495 if (tiling_flags & RADEON_TILING_MACRO)
496 fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE;
497
498 if (tiling_flags & RADEON_TILING_MICRO)
499 fb_format |= AVIVO_D1GRPH_TILED;
500
362 if (radeon_crtc->crtc_id == 0) 501 if (radeon_crtc->crtc_id == 0)
363 WREG32(AVIVO_D1VGA_CONTROL, 0); 502 WREG32(AVIVO_D1VGA_CONTROL, 0);
364 else 503 else
@@ -509,6 +648,9 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc,
509 radeon_crtc_set_base(crtc, x, y, old_fb); 648 radeon_crtc_set_base(crtc, x, y, old_fb);
510 radeon_legacy_atom_set_surface(crtc); 649 radeon_legacy_atom_set_surface(crtc);
511 } 650 }
651 atombios_overscan_setup(crtc, mode, adjusted_mode);
652 atombios_scaler_setup(crtc);
653 radeon_bandwidth_update(rdev);
512 return 0; 654 return 0;
513} 655}
514 656
@@ -516,6 +658,8 @@ static bool atombios_crtc_mode_fixup(struct drm_crtc *crtc,
516 struct drm_display_mode *mode, 658 struct drm_display_mode *mode,
517 struct drm_display_mode *adjusted_mode) 659 struct drm_display_mode *adjusted_mode)
518{ 660{
661 if (!radeon_crtc_scaling_mode_fixup(crtc, mode, adjusted_mode))
662 return false;
519 return true; 663 return true;
520} 664}
521 665
@@ -548,148 +692,3 @@ void radeon_atombios_init_crtc(struct drm_device *dev,
548 AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL; 692 AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL;
549 drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs); 693 drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs);
550} 694}
551
552void radeon_init_disp_bw_avivo(struct drm_device *dev,
553 struct drm_display_mode *mode1,
554 uint32_t pixel_bytes1,
555 struct drm_display_mode *mode2,
556 uint32_t pixel_bytes2)
557{
558 struct radeon_device *rdev = dev->dev_private;
559 fixed20_12 min_mem_eff;
560 fixed20_12 peak_disp_bw, mem_bw, pix_clk, pix_clk2, temp_ff;
561 fixed20_12 sclk_ff, mclk_ff;
562 uint32_t dc_lb_memory_split, temp;
563
564 min_mem_eff.full = rfixed_const_8(0);
565 if (rdev->disp_priority == 2) {
566 uint32_t mc_init_misc_lat_timer = 0;
567 if (rdev->family == CHIP_RV515)
568 mc_init_misc_lat_timer =
569 RREG32_MC(RV515_MC_INIT_MISC_LAT_TIMER);
570 else if (rdev->family == CHIP_RS690)
571 mc_init_misc_lat_timer =
572 RREG32_MC(RS690_MC_INIT_MISC_LAT_TIMER);
573
574 mc_init_misc_lat_timer &=
575 ~(R300_MC_DISP1R_INIT_LAT_MASK <<
576 R300_MC_DISP1R_INIT_LAT_SHIFT);
577 mc_init_misc_lat_timer &=
578 ~(R300_MC_DISP0R_INIT_LAT_MASK <<
579 R300_MC_DISP0R_INIT_LAT_SHIFT);
580
581 if (mode2)
582 mc_init_misc_lat_timer |=
583 (1 << R300_MC_DISP1R_INIT_LAT_SHIFT);
584 if (mode1)
585 mc_init_misc_lat_timer |=
586 (1 << R300_MC_DISP0R_INIT_LAT_SHIFT);
587
588 if (rdev->family == CHIP_RV515)
589 WREG32_MC(RV515_MC_INIT_MISC_LAT_TIMER,
590 mc_init_misc_lat_timer);
591 else if (rdev->family == CHIP_RS690)
592 WREG32_MC(RS690_MC_INIT_MISC_LAT_TIMER,
593 mc_init_misc_lat_timer);
594 }
595
596 /*
597 * determine is there is enough bw for current mode
598 */
599 temp_ff.full = rfixed_const(100);
600 mclk_ff.full = rfixed_const(rdev->clock.default_mclk);
601 mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
602 sclk_ff.full = rfixed_const(rdev->clock.default_sclk);
603 sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
604
605 temp = (rdev->mc.vram_width / 8) * (rdev->mc.vram_is_ddr ? 2 : 1);
606 temp_ff.full = rfixed_const(temp);
607 mem_bw.full = rfixed_mul(mclk_ff, temp_ff);
608 mem_bw.full = rfixed_mul(mem_bw, min_mem_eff);
609
610 pix_clk.full = 0;
611 pix_clk2.full = 0;
612 peak_disp_bw.full = 0;
613 if (mode1) {
614 temp_ff.full = rfixed_const(1000);
615 pix_clk.full = rfixed_const(mode1->clock); /* convert to fixed point */
616 pix_clk.full = rfixed_div(pix_clk, temp_ff);
617 temp_ff.full = rfixed_const(pixel_bytes1);
618 peak_disp_bw.full += rfixed_mul(pix_clk, temp_ff);
619 }
620 if (mode2) {
621 temp_ff.full = rfixed_const(1000);
622 pix_clk2.full = rfixed_const(mode2->clock); /* convert to fixed point */
623 pix_clk2.full = rfixed_div(pix_clk2, temp_ff);
624 temp_ff.full = rfixed_const(pixel_bytes2);
625 peak_disp_bw.full += rfixed_mul(pix_clk2, temp_ff);
626 }
627
628 if (peak_disp_bw.full >= mem_bw.full) {
629 DRM_ERROR
630 ("You may not have enough display bandwidth for current mode\n"
631 "If you have flickering problem, try to lower resolution, refresh rate, or color depth\n");
632 printk("peak disp bw %d, mem_bw %d\n",
633 rfixed_trunc(peak_disp_bw), rfixed_trunc(mem_bw));
634 }
635
636 /*
637 * Line Buffer Setup
638 * There is a single line buffer shared by both display controllers.
639 * DC_LB_MEMORY_SPLIT controls how that line buffer is shared between the display
640 * controllers. The paritioning can either be done manually or via one of four
641 * preset allocations specified in bits 1:0:
642 * 0 - line buffer is divided in half and shared between each display controller
643 * 1 - D1 gets 3/4 of the line buffer, D2 gets 1/4
644 * 2 - D1 gets the whole buffer
645 * 3 - D1 gets 1/4 of the line buffer, D2 gets 3/4
646 * Setting bit 2 of DC_LB_MEMORY_SPLIT controls switches to manual allocation mode.
647 * In manual allocation mode, D1 always starts at 0, D1 end/2 is specified in bits
648 * 14:4; D2 allocation follows D1.
649 */
650
651 /* is auto or manual better ? */
652 dc_lb_memory_split =
653 RREG32(AVIVO_DC_LB_MEMORY_SPLIT) & ~AVIVO_DC_LB_MEMORY_SPLIT_MASK;
654 dc_lb_memory_split &= ~AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE;
655#if 1
656 /* auto */
657 if (mode1 && mode2) {
658 if (mode1->hdisplay > mode2->hdisplay) {
659 if (mode1->hdisplay > 2560)
660 dc_lb_memory_split |=
661 AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q;
662 else
663 dc_lb_memory_split |=
664 AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
665 } else if (mode2->hdisplay > mode1->hdisplay) {
666 if (mode2->hdisplay > 2560)
667 dc_lb_memory_split |=
668 AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
669 else
670 dc_lb_memory_split |=
671 AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
672 } else
673 dc_lb_memory_split |=
674 AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
675 } else if (mode1) {
676 dc_lb_memory_split |= AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY;
677 } else if (mode2) {
678 dc_lb_memory_split |= AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
679 }
680#else
681 /* manual */
682 dc_lb_memory_split |= AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE;
683 dc_lb_memory_split &=
684 ~(AVIVO_DC_LB_DISP1_END_ADR_MASK <<
685 AVIVO_DC_LB_DISP1_END_ADR_SHIFT);
686 if (mode1) {
687 dc_lb_memory_split |=
688 ((((mode1->hdisplay / 2) + 64) & AVIVO_DC_LB_DISP1_END_ADR_MASK)
689 << AVIVO_DC_LB_DISP1_END_ADR_SHIFT);
690 } else if (mode2) {
691 dc_lb_memory_split |= (0 << AVIVO_DC_LB_DISP1_END_ADR_SHIFT);
692 }
693#endif
694 WREG32(AVIVO_DC_LB_MEMORY_SPLIT, dc_lb_memory_split);
695}
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index c550932a108f..05a44896dffb 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -110,7 +110,7 @@ int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
110 if (i < 0 || i > rdev->gart.num_gpu_pages) { 110 if (i < 0 || i > rdev->gart.num_gpu_pages) {
111 return -EINVAL; 111 return -EINVAL;
112 } 112 }
113 rdev->gart.table.ram.ptr[i] = cpu_to_le32((uint32_t)addr); 113 rdev->gart.table.ram.ptr[i] = cpu_to_le32(lower_32_bits(addr));
114 return 0; 114 return 0;
115} 115}
116 116
@@ -173,8 +173,12 @@ void r100_mc_setup(struct radeon_device *rdev)
173 DRM_ERROR("Failed to register debugfs file for R100 MC !\n"); 173 DRM_ERROR("Failed to register debugfs file for R100 MC !\n");
174 } 174 }
175 /* Write VRAM size in case we are limiting it */ 175 /* Write VRAM size in case we are limiting it */
176 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 176 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
177 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 177 /* Novell bug 204882 for RN50/M6/M7 with 8/16/32MB VRAM,
178 * if the aperture is 64MB but we have 32MB VRAM
179 * we report only 32MB VRAM but we have to set MC_FB_LOCATION
180 * to 64MB, otherwise the gpu accidentially dies */
181 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
178 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16); 182 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16);
179 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16); 183 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16);
180 WREG32(RADEON_MC_FB_LOCATION, tmp); 184 WREG32(RADEON_MC_FB_LOCATION, tmp);
@@ -215,7 +219,6 @@ int r100_mc_init(struct radeon_device *rdev)
215 r100_pci_gart_disable(rdev); 219 r100_pci_gart_disable(rdev);
216 220
217 /* Setup GPU memory space */ 221 /* Setup GPU memory space */
218 rdev->mc.vram_location = 0xFFFFFFFFUL;
219 rdev->mc.gtt_location = 0xFFFFFFFFUL; 222 rdev->mc.gtt_location = 0xFFFFFFFFUL;
220 if (rdev->flags & RADEON_IS_AGP) { 223 if (rdev->flags & RADEON_IS_AGP) {
221 r = radeon_agp_init(rdev); 224 r = radeon_agp_init(rdev);
@@ -753,6 +756,102 @@ int r100_cs_packet_parse(struct radeon_cs_parser *p,
753} 756}
754 757
755/** 758/**
759 * r100_cs_packet_next_vline() - parse userspace VLINE packet
760 * @parser: parser structure holding parsing context.
761 *
762 * Userspace sends a special sequence for VLINE waits.
763 * PACKET0 - VLINE_START_END + value
764 * PACKET0 - WAIT_UNTIL +_value
765 * RELOC (P3) - crtc_id in reloc.
766 *
767 * This function parses this and relocates the VLINE START END
768 * and WAIT UNTIL packets to the correct crtc.
769 * It also detects a switched off crtc and nulls out the
770 * wait in that case.
771 */
772int r100_cs_packet_parse_vline(struct radeon_cs_parser *p)
773{
774 struct radeon_cs_chunk *ib_chunk;
775 struct drm_mode_object *obj;
776 struct drm_crtc *crtc;
777 struct radeon_crtc *radeon_crtc;
778 struct radeon_cs_packet p3reloc, waitreloc;
779 int crtc_id;
780 int r;
781 uint32_t header, h_idx, reg;
782
783 ib_chunk = &p->chunks[p->chunk_ib_idx];
784
785 /* parse the wait until */
786 r = r100_cs_packet_parse(p, &waitreloc, p->idx);
787 if (r)
788 return r;
789
790 /* check its a wait until and only 1 count */
791 if (waitreloc.reg != RADEON_WAIT_UNTIL ||
792 waitreloc.count != 0) {
793 DRM_ERROR("vline wait had illegal wait until segment\n");
794 r = -EINVAL;
795 return r;
796 }
797
798 if (ib_chunk->kdata[waitreloc.idx + 1] != RADEON_WAIT_CRTC_VLINE) {
799 DRM_ERROR("vline wait had illegal wait until\n");
800 r = -EINVAL;
801 return r;
802 }
803
804 /* jump over the NOP */
805 r = r100_cs_packet_parse(p, &p3reloc, p->idx);
806 if (r)
807 return r;
808
809 h_idx = p->idx - 2;
810 p->idx += waitreloc.count;
811 p->idx += p3reloc.count;
812
813 header = ib_chunk->kdata[h_idx];
814 crtc_id = ib_chunk->kdata[h_idx + 5];
815 reg = ib_chunk->kdata[h_idx] >> 2;
816 mutex_lock(&p->rdev->ddev->mode_config.mutex);
817 obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC);
818 if (!obj) {
819 DRM_ERROR("cannot find crtc %d\n", crtc_id);
820 r = -EINVAL;
821 goto out;
822 }
823 crtc = obj_to_crtc(obj);
824 radeon_crtc = to_radeon_crtc(crtc);
825 crtc_id = radeon_crtc->crtc_id;
826
827 if (!crtc->enabled) {
828 /* if the CRTC isn't enabled - we need to nop out the wait until */
829 ib_chunk->kdata[h_idx + 2] = PACKET2(0);
830 ib_chunk->kdata[h_idx + 3] = PACKET2(0);
831 } else if (crtc_id == 1) {
832 switch (reg) {
833 case AVIVO_D1MODE_VLINE_START_END:
834 header &= R300_CP_PACKET0_REG_MASK;
835 header |= AVIVO_D2MODE_VLINE_START_END >> 2;
836 break;
837 case RADEON_CRTC_GUI_TRIG_VLINE:
838 header &= R300_CP_PACKET0_REG_MASK;
839 header |= RADEON_CRTC2_GUI_TRIG_VLINE >> 2;
840 break;
841 default:
842 DRM_ERROR("unknown crtc reloc\n");
843 r = -EINVAL;
844 goto out;
845 }
846 ib_chunk->kdata[h_idx] = header;
847 ib_chunk->kdata[h_idx + 3] |= RADEON_ENG_DISPLAY_SELECT_CRTC1;
848 }
849out:
850 mutex_unlock(&p->rdev->ddev->mode_config.mutex);
851 return r;
852}
853
854/**
756 * r100_cs_packet_next_reloc() - parse next packet which should be reloc packet3 855 * r100_cs_packet_next_reloc() - parse next packet which should be reloc packet3
757 * @parser: parser structure holding parsing context. 856 * @parser: parser structure holding parsing context.
758 * @data: pointer to relocation data 857 * @data: pointer to relocation data
@@ -814,6 +913,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
814 unsigned idx; 913 unsigned idx;
815 bool onereg; 914 bool onereg;
816 int r; 915 int r;
916 u32 tile_flags = 0;
817 917
818 ib = p->ib->ptr; 918 ib = p->ib->ptr;
819 ib_chunk = &p->chunks[p->chunk_ib_idx]; 919 ib_chunk = &p->chunks[p->chunk_ib_idx];
@@ -825,6 +925,15 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
825 } 925 }
826 for (i = 0; i <= pkt->count; i++, idx++, reg += 4) { 926 for (i = 0; i <= pkt->count; i++, idx++, reg += 4) {
827 switch (reg) { 927 switch (reg) {
928 case RADEON_CRTC_GUI_TRIG_VLINE:
929 r = r100_cs_packet_parse_vline(p);
930 if (r) {
931 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
932 idx, reg);
933 r100_cs_dump_packet(p, pkt);
934 return r;
935 }
936 break;
828 /* FIXME: only allow PACKET3 blit? easier to check for out of 937 /* FIXME: only allow PACKET3 blit? easier to check for out of
829 * range access */ 938 * range access */
830 case RADEON_DST_PITCH_OFFSET: 939 case RADEON_DST_PITCH_OFFSET:
@@ -838,7 +947,20 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
838 } 947 }
839 tmp = ib_chunk->kdata[idx] & 0x003fffff; 948 tmp = ib_chunk->kdata[idx] & 0x003fffff;
840 tmp += (((u32)reloc->lobj.gpu_offset) >> 10); 949 tmp += (((u32)reloc->lobj.gpu_offset) >> 10);
841 ib[idx] = (ib_chunk->kdata[idx] & 0xffc00000) | tmp; 950
951 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
952 tile_flags |= RADEON_DST_TILE_MACRO;
953 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) {
954 if (reg == RADEON_SRC_PITCH_OFFSET) {
955 DRM_ERROR("Cannot src blit from microtiled surface\n");
956 r100_cs_dump_packet(p, pkt);
957 return -EINVAL;
958 }
959 tile_flags |= RADEON_DST_TILE_MICRO;
960 }
961
962 tmp |= tile_flags;
963 ib[idx] = (ib_chunk->kdata[idx] & 0x3fc00000) | tmp;
842 break; 964 break;
843 case RADEON_RB3D_DEPTHOFFSET: 965 case RADEON_RB3D_DEPTHOFFSET:
844 case RADEON_RB3D_COLOROFFSET: 966 case RADEON_RB3D_COLOROFFSET:
@@ -869,6 +991,11 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
869 case R300_TX_OFFSET_0+52: 991 case R300_TX_OFFSET_0+52:
870 case R300_TX_OFFSET_0+56: 992 case R300_TX_OFFSET_0+56:
871 case R300_TX_OFFSET_0+60: 993 case R300_TX_OFFSET_0+60:
994 /* rn50 has no 3D engine so fail on any 3d setup */
995 if (ASIC_IS_RN50(p->rdev)) {
996 DRM_ERROR("attempt to use RN50 3D engine failed\n");
997 return -EINVAL;
998 }
872 r = r100_cs_packet_next_reloc(p, &reloc); 999 r = r100_cs_packet_next_reloc(p, &reloc);
873 if (r) { 1000 if (r) {
874 DRM_ERROR("No reloc for ib[%d]=0x%04X\n", 1001 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
@@ -878,6 +1005,25 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
878 } 1005 }
879 ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset); 1006 ib[idx] = ib_chunk->kdata[idx] + ((u32)reloc->lobj.gpu_offset);
880 break; 1007 break;
1008 case R300_RB3D_COLORPITCH0:
1009 case RADEON_RB3D_COLORPITCH:
1010 r = r100_cs_packet_next_reloc(p, &reloc);
1011 if (r) {
1012 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1013 idx, reg);
1014 r100_cs_dump_packet(p, pkt);
1015 return r;
1016 }
1017
1018 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1019 tile_flags |= RADEON_COLOR_TILE_ENABLE;
1020 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
1021 tile_flags |= RADEON_COLOR_MICROTILE_ENABLE;
1022
1023 tmp = ib_chunk->kdata[idx] & ~(0x7 << 16);
1024 tmp |= tile_flags;
1025 ib[idx] = tmp;
1026 break;
881 default: 1027 default:
882 /* FIXME: we don't want to allow anyothers packet */ 1028 /* FIXME: we don't want to allow anyothers packet */
883 break; 1029 break;
@@ -1256,29 +1402,100 @@ static void r100_vram_get_type(struct radeon_device *rdev)
1256 } 1402 }
1257} 1403}
1258 1404
1259void r100_vram_info(struct radeon_device *rdev) 1405static u32 r100_get_accessible_vram(struct radeon_device *rdev)
1260{ 1406{
1261 r100_vram_get_type(rdev); 1407 u32 aper_size;
1408 u8 byte;
1409
1410 aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
1411
1412 /* Set HDP_APER_CNTL only on cards that are known not to be broken,
1413 * that is has the 2nd generation multifunction PCI interface
1414 */
1415 if (rdev->family == CHIP_RV280 ||
1416 rdev->family >= CHIP_RV350) {
1417 WREG32_P(RADEON_HOST_PATH_CNTL, RADEON_HDP_APER_CNTL,
1418 ~RADEON_HDP_APER_CNTL);
1419 DRM_INFO("Generation 2 PCI interface, using max accessible memory\n");
1420 return aper_size * 2;
1421 }
1422
1423 /* Older cards have all sorts of funny issues to deal with. First
1424 * check if it's a multifunction card by reading the PCI config
1425 * header type... Limit those to one aperture size
1426 */
1427 pci_read_config_byte(rdev->pdev, 0xe, &byte);
1428 if (byte & 0x80) {
1429 DRM_INFO("Generation 1 PCI interface in multifunction mode\n");
1430 DRM_INFO("Limiting VRAM to one aperture\n");
1431 return aper_size;
1432 }
1433
1434 /* Single function older card. We read HDP_APER_CNTL to see how the BIOS
1435 * have set it up. We don't write this as it's broken on some ASICs but
1436 * we expect the BIOS to have done the right thing (might be too optimistic...)
1437 */
1438 if (RREG32(RADEON_HOST_PATH_CNTL) & RADEON_HDP_APER_CNTL)
1439 return aper_size * 2;
1440 return aper_size;
1441}
1442
1443void r100_vram_init_sizes(struct radeon_device *rdev)
1444{
1445 u64 config_aper_size;
1446 u32 accessible;
1447
1448 config_aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
1262 1449
1263 if (rdev->flags & RADEON_IS_IGP) { 1450 if (rdev->flags & RADEON_IS_IGP) {
1264 uint32_t tom; 1451 uint32_t tom;
1265 /* read NB_TOM to get the amount of ram stolen for the GPU */ 1452 /* read NB_TOM to get the amount of ram stolen for the GPU */
1266 tom = RREG32(RADEON_NB_TOM); 1453 tom = RREG32(RADEON_NB_TOM);
1267 rdev->mc.vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16); 1454 rdev->mc.real_vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16);
1268 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 1455 /* for IGPs we need to keep VRAM where it was put by the BIOS */
1456 rdev->mc.vram_location = (tom & 0xffff) << 16;
1457 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
1458 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
1269 } else { 1459 } else {
1270 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE); 1460 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
1271 /* Some production boards of m6 will report 0 1461 /* Some production boards of m6 will report 0
1272 * if it's 8 MB 1462 * if it's 8 MB
1273 */ 1463 */
1274 if (rdev->mc.vram_size == 0) { 1464 if (rdev->mc.real_vram_size == 0) {
1275 rdev->mc.vram_size = 8192 * 1024; 1465 rdev->mc.real_vram_size = 8192 * 1024;
1276 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 1466 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
1277 } 1467 }
1468 /* let driver place VRAM */
1469 rdev->mc.vram_location = 0xFFFFFFFFUL;
1470 /* Fix for RN50, M6, M7 with 8/16/32(??) MBs of VRAM -
1471 * Novell bug 204882 + along with lots of ubuntu ones */
1472 if (config_aper_size > rdev->mc.real_vram_size)
1473 rdev->mc.mc_vram_size = config_aper_size;
1474 else
1475 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
1278 } 1476 }
1279 1477
1478 /* work out accessible VRAM */
1479 accessible = r100_get_accessible_vram(rdev);
1480
1280 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 1481 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
1281 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 1482 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
1483
1484 if (accessible > rdev->mc.aper_size)
1485 accessible = rdev->mc.aper_size;
1486
1487 if (rdev->mc.mc_vram_size > rdev->mc.aper_size)
1488 rdev->mc.mc_vram_size = rdev->mc.aper_size;
1489
1490 if (rdev->mc.real_vram_size > rdev->mc.aper_size)
1491 rdev->mc.real_vram_size = rdev->mc.aper_size;
1492}
1493
1494void r100_vram_info(struct radeon_device *rdev)
1495{
1496 r100_vram_get_type(rdev);
1497
1498 r100_vram_init_sizes(rdev);
1282} 1499}
1283 1500
1284 1501
@@ -1533,3 +1750,530 @@ int r100_debugfs_mc_info_init(struct radeon_device *rdev)
1533 return 0; 1750 return 0;
1534#endif 1751#endif
1535} 1752}
1753
1754int r100_set_surface_reg(struct radeon_device *rdev, int reg,
1755 uint32_t tiling_flags, uint32_t pitch,
1756 uint32_t offset, uint32_t obj_size)
1757{
1758 int surf_index = reg * 16;
1759 int flags = 0;
1760
1761 /* r100/r200 divide by 16 */
1762 if (rdev->family < CHIP_R300)
1763 flags = pitch / 16;
1764 else
1765 flags = pitch / 8;
1766
1767 if (rdev->family <= CHIP_RS200) {
1768 if ((tiling_flags & (RADEON_TILING_MACRO|RADEON_TILING_MICRO))
1769 == (RADEON_TILING_MACRO|RADEON_TILING_MICRO))
1770 flags |= RADEON_SURF_TILE_COLOR_BOTH;
1771 if (tiling_flags & RADEON_TILING_MACRO)
1772 flags |= RADEON_SURF_TILE_COLOR_MACRO;
1773 } else if (rdev->family <= CHIP_RV280) {
1774 if (tiling_flags & (RADEON_TILING_MACRO))
1775 flags |= R200_SURF_TILE_COLOR_MACRO;
1776 if (tiling_flags & RADEON_TILING_MICRO)
1777 flags |= R200_SURF_TILE_COLOR_MICRO;
1778 } else {
1779 if (tiling_flags & RADEON_TILING_MACRO)
1780 flags |= R300_SURF_TILE_MACRO;
1781 if (tiling_flags & RADEON_TILING_MICRO)
1782 flags |= R300_SURF_TILE_MICRO;
1783 }
1784
1785 DRM_DEBUG("writing surface %d %d %x %x\n", reg, flags, offset, offset+obj_size-1);
1786 WREG32(RADEON_SURFACE0_INFO + surf_index, flags);
1787 WREG32(RADEON_SURFACE0_LOWER_BOUND + surf_index, offset);
1788 WREG32(RADEON_SURFACE0_UPPER_BOUND + surf_index, offset + obj_size - 1);
1789 return 0;
1790}
1791
1792void r100_clear_surface_reg(struct radeon_device *rdev, int reg)
1793{
1794 int surf_index = reg * 16;
1795 WREG32(RADEON_SURFACE0_INFO + surf_index, 0);
1796}
1797
1798void r100_bandwidth_update(struct radeon_device *rdev)
1799{
1800 fixed20_12 trcd_ff, trp_ff, tras_ff, trbs_ff, tcas_ff;
1801 fixed20_12 sclk_ff, mclk_ff, sclk_eff_ff, sclk_delay_ff;
1802 fixed20_12 peak_disp_bw, mem_bw, pix_clk, pix_clk2, temp_ff, crit_point_ff;
1803 uint32_t temp, data, mem_trcd, mem_trp, mem_tras;
1804 fixed20_12 memtcas_ff[8] = {
1805 fixed_init(1),
1806 fixed_init(2),
1807 fixed_init(3),
1808 fixed_init(0),
1809 fixed_init_half(1),
1810 fixed_init_half(2),
1811 fixed_init(0),
1812 };
1813 fixed20_12 memtcas_rs480_ff[8] = {
1814 fixed_init(0),
1815 fixed_init(1),
1816 fixed_init(2),
1817 fixed_init(3),
1818 fixed_init(0),
1819 fixed_init_half(1),
1820 fixed_init_half(2),
1821 fixed_init_half(3),
1822 };
1823 fixed20_12 memtcas2_ff[8] = {
1824 fixed_init(0),
1825 fixed_init(1),
1826 fixed_init(2),
1827 fixed_init(3),
1828 fixed_init(4),
1829 fixed_init(5),
1830 fixed_init(6),
1831 fixed_init(7),
1832 };
1833 fixed20_12 memtrbs[8] = {
1834 fixed_init(1),
1835 fixed_init_half(1),
1836 fixed_init(2),
1837 fixed_init_half(2),
1838 fixed_init(3),
1839 fixed_init_half(3),
1840 fixed_init(4),
1841 fixed_init_half(4)
1842 };
1843 fixed20_12 memtrbs_r4xx[8] = {
1844 fixed_init(4),
1845 fixed_init(5),
1846 fixed_init(6),
1847 fixed_init(7),
1848 fixed_init(8),
1849 fixed_init(9),
1850 fixed_init(10),
1851 fixed_init(11)
1852 };
1853 fixed20_12 min_mem_eff;
1854 fixed20_12 mc_latency_sclk, mc_latency_mclk, k1;
1855 fixed20_12 cur_latency_mclk, cur_latency_sclk;
1856 fixed20_12 disp_latency, disp_latency_overhead, disp_drain_rate,
1857 disp_drain_rate2, read_return_rate;
1858 fixed20_12 time_disp1_drop_priority;
1859 int c;
1860 int cur_size = 16; /* in octawords */
1861 int critical_point = 0, critical_point2;
1862/* uint32_t read_return_rate, time_disp1_drop_priority; */
1863 int stop_req, max_stop_req;
1864 struct drm_display_mode *mode1 = NULL;
1865 struct drm_display_mode *mode2 = NULL;
1866 uint32_t pixel_bytes1 = 0;
1867 uint32_t pixel_bytes2 = 0;
1868
1869 if (rdev->mode_info.crtcs[0]->base.enabled) {
1870 mode1 = &rdev->mode_info.crtcs[0]->base.mode;
1871 pixel_bytes1 = rdev->mode_info.crtcs[0]->base.fb->bits_per_pixel / 8;
1872 }
1873 if (rdev->mode_info.crtcs[1]->base.enabled) {
1874 mode2 = &rdev->mode_info.crtcs[1]->base.mode;
1875 pixel_bytes2 = rdev->mode_info.crtcs[1]->base.fb->bits_per_pixel / 8;
1876 }
1877
1878 min_mem_eff.full = rfixed_const_8(0);
1879 /* get modes */
1880 if ((rdev->disp_priority == 2) && ASIC_IS_R300(rdev)) {
1881 uint32_t mc_init_misc_lat_timer = RREG32(R300_MC_INIT_MISC_LAT_TIMER);
1882 mc_init_misc_lat_timer &= ~(R300_MC_DISP1R_INIT_LAT_MASK << R300_MC_DISP1R_INIT_LAT_SHIFT);
1883 mc_init_misc_lat_timer &= ~(R300_MC_DISP0R_INIT_LAT_MASK << R300_MC_DISP0R_INIT_LAT_SHIFT);
1884 /* check crtc enables */
1885 if (mode2)
1886 mc_init_misc_lat_timer |= (1 << R300_MC_DISP1R_INIT_LAT_SHIFT);
1887 if (mode1)
1888 mc_init_misc_lat_timer |= (1 << R300_MC_DISP0R_INIT_LAT_SHIFT);
1889 WREG32(R300_MC_INIT_MISC_LAT_TIMER, mc_init_misc_lat_timer);
1890 }
1891
1892 /*
1893 * determine is there is enough bw for current mode
1894 */
1895 mclk_ff.full = rfixed_const(rdev->clock.default_mclk);
1896 temp_ff.full = rfixed_const(100);
1897 mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
1898 sclk_ff.full = rfixed_const(rdev->clock.default_sclk);
1899 sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
1900
1901 temp = (rdev->mc.vram_width / 8) * (rdev->mc.vram_is_ddr ? 2 : 1);
1902 temp_ff.full = rfixed_const(temp);
1903 mem_bw.full = rfixed_mul(mclk_ff, temp_ff);
1904
1905 pix_clk.full = 0;
1906 pix_clk2.full = 0;
1907 peak_disp_bw.full = 0;
1908 if (mode1) {
1909 temp_ff.full = rfixed_const(1000);
1910 pix_clk.full = rfixed_const(mode1->clock); /* convert to fixed point */
1911 pix_clk.full = rfixed_div(pix_clk, temp_ff);
1912 temp_ff.full = rfixed_const(pixel_bytes1);
1913 peak_disp_bw.full += rfixed_mul(pix_clk, temp_ff);
1914 }
1915 if (mode2) {
1916 temp_ff.full = rfixed_const(1000);
1917 pix_clk2.full = rfixed_const(mode2->clock); /* convert to fixed point */
1918 pix_clk2.full = rfixed_div(pix_clk2, temp_ff);
1919 temp_ff.full = rfixed_const(pixel_bytes2);
1920 peak_disp_bw.full += rfixed_mul(pix_clk2, temp_ff);
1921 }
1922
1923 mem_bw.full = rfixed_mul(mem_bw, min_mem_eff);
1924 if (peak_disp_bw.full >= mem_bw.full) {
1925 DRM_ERROR("You may not have enough display bandwidth for current mode\n"
1926 "If you have flickering problem, try to lower resolution, refresh rate, or color depth\n");
1927 }
1928
1929 /* Get values from the EXT_MEM_CNTL register...converting its contents. */
1930 temp = RREG32(RADEON_MEM_TIMING_CNTL);
1931 if ((rdev->family == CHIP_RV100) || (rdev->flags & RADEON_IS_IGP)) { /* RV100, M6, IGPs */
1932 mem_trcd = ((temp >> 2) & 0x3) + 1;
1933 mem_trp = ((temp & 0x3)) + 1;
1934 mem_tras = ((temp & 0x70) >> 4) + 1;
1935 } else if (rdev->family == CHIP_R300 ||
1936 rdev->family == CHIP_R350) { /* r300, r350 */
1937 mem_trcd = (temp & 0x7) + 1;
1938 mem_trp = ((temp >> 8) & 0x7) + 1;
1939 mem_tras = ((temp >> 11) & 0xf) + 4;
1940 } else if (rdev->family == CHIP_RV350 ||
1941 rdev->family <= CHIP_RV380) {
1942 /* rv3x0 */
1943 mem_trcd = (temp & 0x7) + 3;
1944 mem_trp = ((temp >> 8) & 0x7) + 3;
1945 mem_tras = ((temp >> 11) & 0xf) + 6;
1946 } else if (rdev->family == CHIP_R420 ||
1947 rdev->family == CHIP_R423 ||
1948 rdev->family == CHIP_RV410) {
1949 /* r4xx */
1950 mem_trcd = (temp & 0xf) + 3;
1951 if (mem_trcd > 15)
1952 mem_trcd = 15;
1953 mem_trp = ((temp >> 8) & 0xf) + 3;
1954 if (mem_trp > 15)
1955 mem_trp = 15;
1956 mem_tras = ((temp >> 12) & 0x1f) + 6;
1957 if (mem_tras > 31)
1958 mem_tras = 31;
1959 } else { /* RV200, R200 */
1960 mem_trcd = (temp & 0x7) + 1;
1961 mem_trp = ((temp >> 8) & 0x7) + 1;
1962 mem_tras = ((temp >> 12) & 0xf) + 4;
1963 }
1964 /* convert to FF */
1965 trcd_ff.full = rfixed_const(mem_trcd);
1966 trp_ff.full = rfixed_const(mem_trp);
1967 tras_ff.full = rfixed_const(mem_tras);
1968
1969 /* Get values from the MEM_SDRAM_MODE_REG register...converting its */
1970 temp = RREG32(RADEON_MEM_SDRAM_MODE_REG);
1971 data = (temp & (7 << 20)) >> 20;
1972 if ((rdev->family == CHIP_RV100) || rdev->flags & RADEON_IS_IGP) {
1973 if (rdev->family == CHIP_RS480) /* don't think rs400 */
1974 tcas_ff = memtcas_rs480_ff[data];
1975 else
1976 tcas_ff = memtcas_ff[data];
1977 } else
1978 tcas_ff = memtcas2_ff[data];
1979
1980 if (rdev->family == CHIP_RS400 ||
1981 rdev->family == CHIP_RS480) {
1982 /* extra cas latency stored in bits 23-25 0-4 clocks */
1983 data = (temp >> 23) & 0x7;
1984 if (data < 5)
1985 tcas_ff.full += rfixed_const(data);
1986 }
1987
1988 if (ASIC_IS_R300(rdev) && !(rdev->flags & RADEON_IS_IGP)) {
1989 /* on the R300, Tcas is included in Trbs.
1990 */
1991 temp = RREG32(RADEON_MEM_CNTL);
1992 data = (R300_MEM_NUM_CHANNELS_MASK & temp);
1993 if (data == 1) {
1994 if (R300_MEM_USE_CD_CH_ONLY & temp) {
1995 temp = RREG32(R300_MC_IND_INDEX);
1996 temp &= ~R300_MC_IND_ADDR_MASK;
1997 temp |= R300_MC_READ_CNTL_CD_mcind;
1998 WREG32(R300_MC_IND_INDEX, temp);
1999 temp = RREG32(R300_MC_IND_DATA);
2000 data = (R300_MEM_RBS_POSITION_C_MASK & temp);
2001 } else {
2002 temp = RREG32(R300_MC_READ_CNTL_AB);
2003 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
2004 }
2005 } else {
2006 temp = RREG32(R300_MC_READ_CNTL_AB);
2007 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
2008 }
2009 if (rdev->family == CHIP_RV410 ||
2010 rdev->family == CHIP_R420 ||
2011 rdev->family == CHIP_R423)
2012 trbs_ff = memtrbs_r4xx[data];
2013 else
2014 trbs_ff = memtrbs[data];
2015 tcas_ff.full += trbs_ff.full;
2016 }
2017
2018 sclk_eff_ff.full = sclk_ff.full;
2019
2020 if (rdev->flags & RADEON_IS_AGP) {
2021 fixed20_12 agpmode_ff;
2022 agpmode_ff.full = rfixed_const(radeon_agpmode);
2023 temp_ff.full = rfixed_const_666(16);
2024 sclk_eff_ff.full -= rfixed_mul(agpmode_ff, temp_ff);
2025 }
2026 /* TODO PCIE lanes may affect this - agpmode == 16?? */
2027
2028 if (ASIC_IS_R300(rdev)) {
2029 sclk_delay_ff.full = rfixed_const(250);
2030 } else {
2031 if ((rdev->family == CHIP_RV100) ||
2032 rdev->flags & RADEON_IS_IGP) {
2033 if (rdev->mc.vram_is_ddr)
2034 sclk_delay_ff.full = rfixed_const(41);
2035 else
2036 sclk_delay_ff.full = rfixed_const(33);
2037 } else {
2038 if (rdev->mc.vram_width == 128)
2039 sclk_delay_ff.full = rfixed_const(57);
2040 else
2041 sclk_delay_ff.full = rfixed_const(41);
2042 }
2043 }
2044
2045 mc_latency_sclk.full = rfixed_div(sclk_delay_ff, sclk_eff_ff);
2046
2047 if (rdev->mc.vram_is_ddr) {
2048 if (rdev->mc.vram_width == 32) {
2049 k1.full = rfixed_const(40);
2050 c = 3;
2051 } else {
2052 k1.full = rfixed_const(20);
2053 c = 1;
2054 }
2055 } else {
2056 k1.full = rfixed_const(40);
2057 c = 3;
2058 }
2059
2060 temp_ff.full = rfixed_const(2);
2061 mc_latency_mclk.full = rfixed_mul(trcd_ff, temp_ff);
2062 temp_ff.full = rfixed_const(c);
2063 mc_latency_mclk.full += rfixed_mul(tcas_ff, temp_ff);
2064 temp_ff.full = rfixed_const(4);
2065 mc_latency_mclk.full += rfixed_mul(tras_ff, temp_ff);
2066 mc_latency_mclk.full += rfixed_mul(trp_ff, temp_ff);
2067 mc_latency_mclk.full += k1.full;
2068
2069 mc_latency_mclk.full = rfixed_div(mc_latency_mclk, mclk_ff);
2070 mc_latency_mclk.full += rfixed_div(temp_ff, sclk_eff_ff);
2071
2072 /*
2073 HW cursor time assuming worst case of full size colour cursor.
2074 */
2075 temp_ff.full = rfixed_const((2 * (cur_size - (rdev->mc.vram_is_ddr + 1))));
2076 temp_ff.full += trcd_ff.full;
2077 if (temp_ff.full < tras_ff.full)
2078 temp_ff.full = tras_ff.full;
2079 cur_latency_mclk.full = rfixed_div(temp_ff, mclk_ff);
2080
2081 temp_ff.full = rfixed_const(cur_size);
2082 cur_latency_sclk.full = rfixed_div(temp_ff, sclk_eff_ff);
2083 /*
2084 Find the total latency for the display data.
2085 */
2086 disp_latency_overhead.full = rfixed_const(80);
2087 disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff);
2088 mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full;
2089 mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full;
2090
2091 if (mc_latency_mclk.full > mc_latency_sclk.full)
2092 disp_latency.full = mc_latency_mclk.full;
2093 else
2094 disp_latency.full = mc_latency_sclk.full;
2095
2096 /* setup Max GRPH_STOP_REQ default value */
2097 if (ASIC_IS_RV100(rdev))
2098 max_stop_req = 0x5c;
2099 else
2100 max_stop_req = 0x7c;
2101
2102 if (mode1) {
2103 /* CRTC1
2104 Set GRPH_BUFFER_CNTL register using h/w defined optimal values.
2105 GRPH_STOP_REQ <= MIN[ 0x7C, (CRTC_H_DISP + 1) * (bit depth) / 0x10 ]
2106 */
2107 stop_req = mode1->hdisplay * pixel_bytes1 / 16;
2108
2109 if (stop_req > max_stop_req)
2110 stop_req = max_stop_req;
2111
2112 /*
2113 Find the drain rate of the display buffer.
2114 */
2115 temp_ff.full = rfixed_const((16/pixel_bytes1));
2116 disp_drain_rate.full = rfixed_div(pix_clk, temp_ff);
2117
2118 /*
2119 Find the critical point of the display buffer.
2120 */
2121 crit_point_ff.full = rfixed_mul(disp_drain_rate, disp_latency);
2122 crit_point_ff.full += rfixed_const_half(0);
2123
2124 critical_point = rfixed_trunc(crit_point_ff);
2125
2126 if (rdev->disp_priority == 2) {
2127 critical_point = 0;
2128 }
2129
2130 /*
2131 The critical point should never be above max_stop_req-4. Setting
2132 GRPH_CRITICAL_CNTL = 0 will thus force high priority all the time.
2133 */
2134 if (max_stop_req - critical_point < 4)
2135 critical_point = 0;
2136
2137 if (critical_point == 0 && mode2 && rdev->family == CHIP_R300) {
2138 /* some R300 cards have problem with this set to 0, when CRTC2 is enabled.*/
2139 critical_point = 0x10;
2140 }
2141
2142 temp = RREG32(RADEON_GRPH_BUFFER_CNTL);
2143 temp &= ~(RADEON_GRPH_STOP_REQ_MASK);
2144 temp |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
2145 temp &= ~(RADEON_GRPH_START_REQ_MASK);
2146 if ((rdev->family == CHIP_R350) &&
2147 (stop_req > 0x15)) {
2148 stop_req -= 0x10;
2149 }
2150 temp |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
2151 temp |= RADEON_GRPH_BUFFER_SIZE;
2152 temp &= ~(RADEON_GRPH_CRITICAL_CNTL |
2153 RADEON_GRPH_CRITICAL_AT_SOF |
2154 RADEON_GRPH_STOP_CNTL);
2155 /*
2156 Write the result into the register.
2157 */
2158 WREG32(RADEON_GRPH_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
2159 (critical_point << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
2160
2161#if 0
2162 if ((rdev->family == CHIP_RS400) ||
2163 (rdev->family == CHIP_RS480)) {
2164 /* attempt to program RS400 disp regs correctly ??? */
2165 temp = RREG32(RS400_DISP1_REG_CNTL);
2166 temp &= ~(RS400_DISP1_START_REQ_LEVEL_MASK |
2167 RS400_DISP1_STOP_REQ_LEVEL_MASK);
2168 WREG32(RS400_DISP1_REQ_CNTL1, (temp |
2169 (critical_point << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
2170 (critical_point << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
2171 temp = RREG32(RS400_DMIF_MEM_CNTL1);
2172 temp &= ~(RS400_DISP1_CRITICAL_POINT_START_MASK |
2173 RS400_DISP1_CRITICAL_POINT_STOP_MASK);
2174 WREG32(RS400_DMIF_MEM_CNTL1, (temp |
2175 (critical_point << RS400_DISP1_CRITICAL_POINT_START_SHIFT) |
2176 (critical_point << RS400_DISP1_CRITICAL_POINT_STOP_SHIFT)));
2177 }
2178#endif
2179
2180 DRM_DEBUG("GRPH_BUFFER_CNTL from to %x\n",
2181 /* (unsigned int)info->SavedReg->grph_buffer_cntl, */
2182 (unsigned int)RREG32(RADEON_GRPH_BUFFER_CNTL));
2183 }
2184
2185 if (mode2) {
2186 u32 grph2_cntl;
2187 stop_req = mode2->hdisplay * pixel_bytes2 / 16;
2188
2189 if (stop_req > max_stop_req)
2190 stop_req = max_stop_req;
2191
2192 /*
2193 Find the drain rate of the display buffer.
2194 */
2195 temp_ff.full = rfixed_const((16/pixel_bytes2));
2196 disp_drain_rate2.full = rfixed_div(pix_clk2, temp_ff);
2197
2198 grph2_cntl = RREG32(RADEON_GRPH2_BUFFER_CNTL);
2199 grph2_cntl &= ~(RADEON_GRPH_STOP_REQ_MASK);
2200 grph2_cntl |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
2201 grph2_cntl &= ~(RADEON_GRPH_START_REQ_MASK);
2202 if ((rdev->family == CHIP_R350) &&
2203 (stop_req > 0x15)) {
2204 stop_req -= 0x10;
2205 }
2206 grph2_cntl |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
2207 grph2_cntl |= RADEON_GRPH_BUFFER_SIZE;
2208 grph2_cntl &= ~(RADEON_GRPH_CRITICAL_CNTL |
2209 RADEON_GRPH_CRITICAL_AT_SOF |
2210 RADEON_GRPH_STOP_CNTL);
2211
2212 if ((rdev->family == CHIP_RS100) ||
2213 (rdev->family == CHIP_RS200))
2214 critical_point2 = 0;
2215 else {
2216 temp = (rdev->mc.vram_width * rdev->mc.vram_is_ddr + 1)/128;
2217 temp_ff.full = rfixed_const(temp);
2218 temp_ff.full = rfixed_mul(mclk_ff, temp_ff);
2219 if (sclk_ff.full < temp_ff.full)
2220 temp_ff.full = sclk_ff.full;
2221
2222 read_return_rate.full = temp_ff.full;
2223
2224 if (mode1) {
2225 temp_ff.full = read_return_rate.full - disp_drain_rate.full;
2226 time_disp1_drop_priority.full = rfixed_div(crit_point_ff, temp_ff);
2227 } else {
2228 time_disp1_drop_priority.full = 0;
2229 }
2230 crit_point_ff.full = disp_latency.full + time_disp1_drop_priority.full + disp_latency.full;
2231 crit_point_ff.full = rfixed_mul(crit_point_ff, disp_drain_rate2);
2232 crit_point_ff.full += rfixed_const_half(0);
2233
2234 critical_point2 = rfixed_trunc(crit_point_ff);
2235
2236 if (rdev->disp_priority == 2) {
2237 critical_point2 = 0;
2238 }
2239
2240 if (max_stop_req - critical_point2 < 4)
2241 critical_point2 = 0;
2242
2243 }
2244
2245 if (critical_point2 == 0 && rdev->family == CHIP_R300) {
2246 /* some R300 cards have problem with this set to 0 */
2247 critical_point2 = 0x10;
2248 }
2249
2250 WREG32(RADEON_GRPH2_BUFFER_CNTL, ((grph2_cntl & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
2251 (critical_point2 << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
2252
2253 if ((rdev->family == CHIP_RS400) ||
2254 (rdev->family == CHIP_RS480)) {
2255#if 0
2256 /* attempt to program RS400 disp2 regs correctly ??? */
2257 temp = RREG32(RS400_DISP2_REQ_CNTL1);
2258 temp &= ~(RS400_DISP2_START_REQ_LEVEL_MASK |
2259 RS400_DISP2_STOP_REQ_LEVEL_MASK);
2260 WREG32(RS400_DISP2_REQ_CNTL1, (temp |
2261 (critical_point2 << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
2262 (critical_point2 << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
2263 temp = RREG32(RS400_DISP2_REQ_CNTL2);
2264 temp &= ~(RS400_DISP2_CRITICAL_POINT_START_MASK |
2265 RS400_DISP2_CRITICAL_POINT_STOP_MASK);
2266 WREG32(RS400_DISP2_REQ_CNTL2, (temp |
2267 (critical_point2 << RS400_DISP2_CRITICAL_POINT_START_SHIFT) |
2268 (critical_point2 << RS400_DISP2_CRITICAL_POINT_STOP_SHIFT)));
2269#endif
2270 WREG32(RS400_DISP2_REQ_CNTL1, 0x105DC1CC);
2271 WREG32(RS400_DISP2_REQ_CNTL2, 0x2749D000);
2272 WREG32(RS400_DMIF_MEM_CNTL1, 0x29CA71DC);
2273 WREG32(RS400_DISP1_REQ_CNTL1, 0x28FBC3AC);
2274 }
2275
2276 DRM_DEBUG("GRPH2_BUFFER_CNTL from to %x\n",
2277 (unsigned int)RREG32(RADEON_GRPH2_BUFFER_CNTL));
2278 }
2279}
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index e2ed5bc08170..9c8d41534a5d 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -30,6 +30,8 @@
30#include "drm.h" 30#include "drm.h"
31#include "radeon_reg.h" 31#include "radeon_reg.h"
32#include "radeon.h" 32#include "radeon.h"
33#include "radeon_drm.h"
34#include "radeon_share.h"
33 35
34/* r300,r350,rv350,rv370,rv380 depends on : */ 36/* r300,r350,rv350,rv370,rv380 depends on : */
35void r100_hdp_reset(struct radeon_device *rdev); 37void r100_hdp_reset(struct radeon_device *rdev);
@@ -44,6 +46,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev);
44int r100_cs_packet_parse(struct radeon_cs_parser *p, 46int r100_cs_packet_parse(struct radeon_cs_parser *p,
45 struct radeon_cs_packet *pkt, 47 struct radeon_cs_packet *pkt,
46 unsigned idx); 48 unsigned idx);
49int r100_cs_packet_parse_vline(struct radeon_cs_parser *p);
47int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, 50int r100_cs_packet_next_reloc(struct radeon_cs_parser *p,
48 struct radeon_cs_reloc **cs_reloc); 51 struct radeon_cs_reloc **cs_reloc);
49int r100_cs_parse_packet0(struct radeon_cs_parser *p, 52int r100_cs_parse_packet0(struct radeon_cs_parser *p,
@@ -150,8 +153,13 @@ int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
150 if (i < 0 || i > rdev->gart.num_gpu_pages) { 153 if (i < 0 || i > rdev->gart.num_gpu_pages) {
151 return -EINVAL; 154 return -EINVAL;
152 } 155 }
153 addr = (((u32)addr) >> 8) | ((upper_32_bits(addr) & 0xff) << 4) | 0xC; 156 addr = (lower_32_bits(addr) >> 8) |
154 writel(cpu_to_le32(addr), ((void __iomem *)ptr) + (i * 4)); 157 ((upper_32_bits(addr) & 0xff) << 24) |
158 0xc;
159 /* on x86 we want this to be CPU endian, on powerpc
160 * on powerpc without HW swappers, it'll get swapped on way
161 * into VRAM - so no need for cpu_to_le32 on VRAM tables */
162 writel(addr, ((void __iomem *)ptr) + (i * 4));
155 return 0; 163 return 0;
156} 164}
157 165
@@ -579,10 +587,8 @@ void r300_vram_info(struct radeon_device *rdev)
579 } else { 587 } else {
580 rdev->mc.vram_width = 64; 588 rdev->mc.vram_width = 64;
581 } 589 }
582 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
583 590
584 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 591 r100_vram_init_sizes(rdev);
585 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
586} 592}
587 593
588 594
@@ -970,7 +976,7 @@ static inline void r300_cs_track_clear(struct r300_cs_track *track)
970 976
971static const unsigned r300_reg_safe_bm[159] = { 977static const unsigned r300_reg_safe_bm[159] = {
972 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 978 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
973 0xFFFFFFBF, 0xFFFFFFFF, 0xFFFFFFBF, 0xFFFFFFFF, 979 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
974 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 980 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
975 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 981 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
976 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 982 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
@@ -1019,7 +1025,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1019 struct radeon_cs_reloc *reloc; 1025 struct radeon_cs_reloc *reloc;
1020 struct r300_cs_track *track; 1026 struct r300_cs_track *track;
1021 volatile uint32_t *ib; 1027 volatile uint32_t *ib;
1022 uint32_t tmp; 1028 uint32_t tmp, tile_flags = 0;
1023 unsigned i; 1029 unsigned i;
1024 int r; 1030 int r;
1025 1031
@@ -1027,6 +1033,16 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1027 ib_chunk = &p->chunks[p->chunk_ib_idx]; 1033 ib_chunk = &p->chunks[p->chunk_ib_idx];
1028 track = (struct r300_cs_track*)p->track; 1034 track = (struct r300_cs_track*)p->track;
1029 switch(reg) { 1035 switch(reg) {
1036 case AVIVO_D1MODE_VLINE_START_END:
1037 case RADEON_CRTC_GUI_TRIG_VLINE:
1038 r = r100_cs_packet_parse_vline(p);
1039 if (r) {
1040 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1041 idx, reg);
1042 r100_cs_dump_packet(p, pkt);
1043 return r;
1044 }
1045 break;
1030 case RADEON_DST_PITCH_OFFSET: 1046 case RADEON_DST_PITCH_OFFSET:
1031 case RADEON_SRC_PITCH_OFFSET: 1047 case RADEON_SRC_PITCH_OFFSET:
1032 r = r100_cs_packet_next_reloc(p, &reloc); 1048 r = r100_cs_packet_next_reloc(p, &reloc);
@@ -1038,7 +1054,19 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1038 } 1054 }
1039 tmp = ib_chunk->kdata[idx] & 0x003fffff; 1055 tmp = ib_chunk->kdata[idx] & 0x003fffff;
1040 tmp += (((u32)reloc->lobj.gpu_offset) >> 10); 1056 tmp += (((u32)reloc->lobj.gpu_offset) >> 10);
1041 ib[idx] = (ib_chunk->kdata[idx] & 0xffc00000) | tmp; 1057
1058 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1059 tile_flags |= RADEON_DST_TILE_MACRO;
1060 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) {
1061 if (reg == RADEON_SRC_PITCH_OFFSET) {
1062 DRM_ERROR("Cannot src blit from microtiled surface\n");
1063 r100_cs_dump_packet(p, pkt);
1064 return -EINVAL;
1065 }
1066 tile_flags |= RADEON_DST_TILE_MICRO;
1067 }
1068 tmp |= tile_flags;
1069 ib[idx] = (ib_chunk->kdata[idx] & 0x3fc00000) | tmp;
1042 break; 1070 break;
1043 case R300_RB3D_COLOROFFSET0: 1071 case R300_RB3D_COLOROFFSET0:
1044 case R300_RB3D_COLOROFFSET1: 1072 case R300_RB3D_COLOROFFSET1:
@@ -1127,6 +1155,23 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1127 /* RB3D_COLORPITCH1 */ 1155 /* RB3D_COLORPITCH1 */
1128 /* RB3D_COLORPITCH2 */ 1156 /* RB3D_COLORPITCH2 */
1129 /* RB3D_COLORPITCH3 */ 1157 /* RB3D_COLORPITCH3 */
1158 r = r100_cs_packet_next_reloc(p, &reloc);
1159 if (r) {
1160 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1161 idx, reg);
1162 r100_cs_dump_packet(p, pkt);
1163 return r;
1164 }
1165
1166 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1167 tile_flags |= R300_COLOR_TILE_ENABLE;
1168 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
1169 tile_flags |= R300_COLOR_MICROTILE_ENABLE;
1170
1171 tmp = ib_chunk->kdata[idx] & ~(0x7 << 16);
1172 tmp |= tile_flags;
1173 ib[idx] = tmp;
1174
1130 i = (reg - 0x4E38) >> 2; 1175 i = (reg - 0x4E38) >> 2;
1131 track->cb[i].pitch = ib_chunk->kdata[idx] & 0x3FFE; 1176 track->cb[i].pitch = ib_chunk->kdata[idx] & 0x3FFE;
1132 switch (((ib_chunk->kdata[idx] >> 21) & 0xF)) { 1177 switch (((ib_chunk->kdata[idx] >> 21) & 0xF)) {
@@ -1182,6 +1227,23 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
1182 break; 1227 break;
1183 case 0x4F24: 1228 case 0x4F24:
1184 /* ZB_DEPTHPITCH */ 1229 /* ZB_DEPTHPITCH */
1230 r = r100_cs_packet_next_reloc(p, &reloc);
1231 if (r) {
1232 DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
1233 idx, reg);
1234 r100_cs_dump_packet(p, pkt);
1235 return r;
1236 }
1237
1238 if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
1239 tile_flags |= R300_DEPTHMACROTILE_ENABLE;
1240 if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
1241 tile_flags |= R300_DEPTHMICROTILE_TILED;;
1242
1243 tmp = ib_chunk->kdata[idx] & ~(0x7 << 16);
1244 tmp |= tile_flags;
1245 ib[idx] = tmp;
1246
1185 track->zb.pitch = ib_chunk->kdata[idx] & 0x3FFC; 1247 track->zb.pitch = ib_chunk->kdata[idx] & 0x3FFC;
1186 break; 1248 break;
1187 case 0x4104: 1249 case 0x4104:
diff --git a/drivers/gpu/drm/radeon/r300_reg.h b/drivers/gpu/drm/radeon/r300_reg.h
index 70f48609515e..4b7afef35a65 100644
--- a/drivers/gpu/drm/radeon/r300_reg.h
+++ b/drivers/gpu/drm/radeon/r300_reg.h
@@ -27,7 +27,9 @@
27#ifndef _R300_REG_H_ 27#ifndef _R300_REG_H_
28#define _R300_REG_H_ 28#define _R300_REG_H_
29 29
30 30#define R300_SURF_TILE_MACRO (1<<16)
31#define R300_SURF_TILE_MICRO (2<<16)
32#define R300_SURF_TILE_BOTH (3<<16)
31 33
32 34
33#define R300_MC_INIT_MISC_LAT_TIMER 0x180 35#define R300_MC_INIT_MISC_LAT_TIMER 0x180
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h
index 9070a1c2ce23..036691b38cb7 100644
--- a/drivers/gpu/drm/radeon/r500_reg.h
+++ b/drivers/gpu/drm/radeon/r500_reg.h
@@ -445,6 +445,7 @@
445#define AVIVO_D1MODE_DATA_FORMAT 0x6528 445#define AVIVO_D1MODE_DATA_FORMAT 0x6528
446# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) 446# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0)
447#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C 447#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652C
448#define AVIVO_D1MODE_VLINE_START_END 0x6538
448#define AVIVO_D1MODE_VIEWPORT_START 0x6580 449#define AVIVO_D1MODE_VIEWPORT_START 0x6580
449#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 450#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584
450#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 451#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588
@@ -496,6 +497,7 @@
496#define AVIVO_D2CUR_SIZE 0x6c10 497#define AVIVO_D2CUR_SIZE 0x6c10
497#define AVIVO_D2CUR_POSITION 0x6c14 498#define AVIVO_D2CUR_POSITION 0x6c14
498 499
500#define AVIVO_D2MODE_VLINE_START_END 0x6d38
499#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 501#define AVIVO_D2MODE_VIEWPORT_START 0x6d80
500#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 502#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84
501#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 503#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index 570a244bd88b..09fb0b6ec7dd 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -28,6 +28,7 @@
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon_reg.h" 29#include "radeon_reg.h"
30#include "radeon.h" 30#include "radeon.h"
31#include "radeon_share.h"
31 32
32/* r520,rv530,rv560,rv570,r580 depends on : */ 33/* r520,rv530,rv560,rv570,r580 depends on : */
33void r100_hdp_reset(struct radeon_device *rdev); 34void r100_hdp_reset(struct radeon_device *rdev);
@@ -94,8 +95,8 @@ int r520_mc_init(struct radeon_device *rdev)
94 "programming pipes. Bad things might happen.\n"); 95 "programming pipes. Bad things might happen.\n");
95 } 96 }
96 /* Write VRAM size in case we are limiting it */ 97 /* Write VRAM size in case we are limiting it */
97 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 98 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
98 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 99 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
99 tmp = REG_SET(R520_MC_FB_TOP, tmp >> 16); 100 tmp = REG_SET(R520_MC_FB_TOP, tmp >> 16);
100 tmp |= REG_SET(R520_MC_FB_START, rdev->mc.vram_location >> 16); 101 tmp |= REG_SET(R520_MC_FB_START, rdev->mc.vram_location >> 16);
101 WREG32_MC(R520_MC_FB_LOCATION, tmp); 102 WREG32_MC(R520_MC_FB_LOCATION, tmp);
@@ -226,9 +227,20 @@ static void r520_vram_get_type(struct radeon_device *rdev)
226 227
227void r520_vram_info(struct radeon_device *rdev) 228void r520_vram_info(struct radeon_device *rdev)
228{ 229{
230 fixed20_12 a;
231
229 r520_vram_get_type(rdev); 232 r520_vram_get_type(rdev);
230 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
231 233
232 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 234 r100_vram_init_sizes(rdev);
233 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 235 /* FIXME: we should enforce default clock in case GPU is not in
236 * default setup
237 */
238 a.full = rfixed_const(100);
239 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
240 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
241}
242
243void r520_bandwidth_update(struct radeon_device *rdev)
244{
245 rv515_bandwidth_avivo_update(rdev);
234} 246}
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index c45559fc97fd..538cd907df69 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -67,7 +67,7 @@ int r600_mc_init(struct radeon_device *rdev)
67 "programming pipes. Bad things might happen.\n"); 67 "programming pipes. Bad things might happen.\n");
68 } 68 }
69 69
70 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 70 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
71 tmp = REG_SET(R600_MC_FB_TOP, tmp >> 24); 71 tmp = REG_SET(R600_MC_FB_TOP, tmp >> 24);
72 tmp |= REG_SET(R600_MC_FB_BASE, rdev->mc.vram_location >> 24); 72 tmp |= REG_SET(R600_MC_FB_BASE, rdev->mc.vram_location >> 24);
73 WREG32(R600_MC_VM_FB_LOCATION, tmp); 73 WREG32(R600_MC_VM_FB_LOCATION, tmp);
@@ -140,7 +140,8 @@ void r600_vram_get_type(struct radeon_device *rdev)
140void r600_vram_info(struct radeon_device *rdev) 140void r600_vram_info(struct radeon_device *rdev)
141{ 141{
142 r600_vram_get_type(rdev); 142 r600_vram_get_type(rdev);
143 rdev->mc.vram_size = RREG32(R600_CONFIG_MEMSIZE); 143 rdev->mc.real_vram_size = RREG32(R600_CONFIG_MEMSIZE);
144 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
144 145
145 /* Could aper size report 0 ? */ 146 /* Could aper size report 0 ? */
146 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 147 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index d61f2fc61df5..b1d945b8ed6c 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -64,6 +64,7 @@ extern int radeon_agpmode;
64extern int radeon_vram_limit; 64extern int radeon_vram_limit;
65extern int radeon_gart_size; 65extern int radeon_gart_size;
66extern int radeon_benchmarking; 66extern int radeon_benchmarking;
67extern int radeon_testing;
67extern int radeon_connector_table; 68extern int radeon_connector_table;
68 69
69/* 70/*
@@ -113,6 +114,7 @@ enum radeon_family {
113 CHIP_RV770, 114 CHIP_RV770,
114 CHIP_RV730, 115 CHIP_RV730,
115 CHIP_RV710, 116 CHIP_RV710,
117 CHIP_RS880,
116 CHIP_LAST, 118 CHIP_LAST,
117}; 119};
118 120
@@ -201,6 +203,14 @@ int radeon_fence_wait_last(struct radeon_device *rdev);
201struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence); 203struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence);
202void radeon_fence_unref(struct radeon_fence **fence); 204void radeon_fence_unref(struct radeon_fence **fence);
203 205
206/*
207 * Tiling registers
208 */
209struct radeon_surface_reg {
210 struct radeon_object *robj;
211};
212
213#define RADEON_GEM_MAX_SURFACES 8
204 214
205/* 215/*
206 * Radeon buffer. 216 * Radeon buffer.
@@ -213,6 +223,7 @@ struct radeon_object_list {
213 uint64_t gpu_offset; 223 uint64_t gpu_offset;
214 unsigned rdomain; 224 unsigned rdomain;
215 unsigned wdomain; 225 unsigned wdomain;
226 uint32_t tiling_flags;
216}; 227};
217 228
218int radeon_object_init(struct radeon_device *rdev); 229int radeon_object_init(struct radeon_device *rdev);
@@ -242,8 +253,15 @@ void radeon_object_list_clean(struct list_head *head);
242int radeon_object_fbdev_mmap(struct radeon_object *robj, 253int radeon_object_fbdev_mmap(struct radeon_object *robj,
243 struct vm_area_struct *vma); 254 struct vm_area_struct *vma);
244unsigned long radeon_object_size(struct radeon_object *robj); 255unsigned long radeon_object_size(struct radeon_object *robj);
245 256void radeon_object_clear_surface_reg(struct radeon_object *robj);
246 257int radeon_object_check_tiling(struct radeon_object *robj, bool has_moved,
258 bool force_drop);
259void radeon_object_set_tiling_flags(struct radeon_object *robj,
260 uint32_t tiling_flags, uint32_t pitch);
261void radeon_object_get_tiling_flags(struct radeon_object *robj, uint32_t *tiling_flags, uint32_t *pitch);
262void radeon_bo_move_notify(struct ttm_buffer_object *bo,
263 struct ttm_mem_reg *mem);
264void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo);
247/* 265/*
248 * GEM objects. 266 * GEM objects.
249 */ 267 */
@@ -315,8 +333,11 @@ struct radeon_mc {
315 unsigned gtt_location; 333 unsigned gtt_location;
316 unsigned gtt_size; 334 unsigned gtt_size;
317 unsigned vram_location; 335 unsigned vram_location;
318 unsigned vram_size; 336 /* for some chips with <= 32MB we need to lie
337 * about vram size near mc fb location */
338 unsigned mc_vram_size;
319 unsigned vram_width; 339 unsigned vram_width;
340 unsigned real_vram_size;
320 int vram_mtrr; 341 int vram_mtrr;
321 bool vram_is_ddr; 342 bool vram_is_ddr;
322}; 343};
@@ -474,6 +495,39 @@ struct radeon_wb {
474 uint64_t gpu_addr; 495 uint64_t gpu_addr;
475}; 496};
476 497
498/**
499 * struct radeon_pm - power management datas
500 * @max_bandwidth: maximum bandwidth the gpu has (MByte/s)
501 * @igp_sideport_mclk: sideport memory clock Mhz (rs690,rs740,rs780,rs880)
502 * @igp_system_mclk: system clock Mhz (rs690,rs740,rs780,rs880)
503 * @igp_ht_link_clk: ht link clock Mhz (rs690,rs740,rs780,rs880)
504 * @igp_ht_link_width: ht link width in bits (rs690,rs740,rs780,rs880)
505 * @k8_bandwidth: k8 bandwidth the gpu has (MByte/s) (IGP)
506 * @sideport_bandwidth: sideport bandwidth the gpu has (MByte/s) (IGP)
507 * @ht_bandwidth: ht bandwidth the gpu has (MByte/s) (IGP)
508 * @core_bandwidth: core GPU bandwidth the gpu has (MByte/s) (IGP)
509 * @sclk: GPU clock Mhz (core bandwith depends of this clock)
510 * @needed_bandwidth: current bandwidth needs
511 *
512 * It keeps track of various data needed to take powermanagement decision.
513 * Bandwith need is used to determine minimun clock of the GPU and memory.
514 * Equation between gpu/memory clock and available bandwidth is hw dependent
515 * (type of memory, bus size, efficiency, ...)
516 */
517struct radeon_pm {
518 fixed20_12 max_bandwidth;
519 fixed20_12 igp_sideport_mclk;
520 fixed20_12 igp_system_mclk;
521 fixed20_12 igp_ht_link_clk;
522 fixed20_12 igp_ht_link_width;
523 fixed20_12 k8_bandwidth;
524 fixed20_12 sideport_bandwidth;
525 fixed20_12 ht_bandwidth;
526 fixed20_12 core_bandwidth;
527 fixed20_12 sclk;
528 fixed20_12 needed_bandwidth;
529};
530
477 531
478/* 532/*
479 * Benchmarking 533 * Benchmarking
@@ -482,6 +536,12 @@ void radeon_benchmark(struct radeon_device *rdev);
482 536
483 537
484/* 538/*
539 * Testing
540 */
541void radeon_test_moves(struct radeon_device *rdev);
542
543
544/*
485 * Debugfs 545 * Debugfs
486 */ 546 */
487int radeon_debugfs_add_files(struct radeon_device *rdev, 547int radeon_debugfs_add_files(struct radeon_device *rdev,
@@ -535,6 +595,11 @@ struct radeon_asic {
535 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock); 595 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock);
536 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes); 596 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes);
537 void (*set_clock_gating)(struct radeon_device *rdev, int enable); 597 void (*set_clock_gating)(struct radeon_device *rdev, int enable);
598 int (*set_surface_reg)(struct radeon_device *rdev, int reg,
599 uint32_t tiling_flags, uint32_t pitch,
600 uint32_t offset, uint32_t obj_size);
601 int (*clear_surface_reg)(struct radeon_device *rdev, int reg);
602 void (*bandwidth_update)(struct radeon_device *rdev);
538}; 603};
539 604
540union radeon_asic_config { 605union radeon_asic_config {
@@ -566,6 +631,10 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
566int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, 631int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
567 struct drm_file *filp); 632 struct drm_file *filp);
568int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp); 633int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp);
634int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data,
635 struct drm_file *filp);
636int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
637 struct drm_file *filp);
569 638
570 639
571/* 640/*
@@ -594,8 +663,8 @@ struct radeon_device {
594 struct radeon_object *fbdev_robj; 663 struct radeon_object *fbdev_robj;
595 struct radeon_framebuffer *fbdev_rfb; 664 struct radeon_framebuffer *fbdev_rfb;
596 /* Register mmio */ 665 /* Register mmio */
597 unsigned long rmmio_base; 666 resource_size_t rmmio_base;
598 unsigned long rmmio_size; 667 resource_size_t rmmio_size;
599 void *rmmio; 668 void *rmmio;
600 radeon_rreg_t mm_rreg; 669 radeon_rreg_t mm_rreg;
601 radeon_wreg_t mm_wreg; 670 radeon_wreg_t mm_wreg;
@@ -619,11 +688,14 @@ struct radeon_device {
619 struct radeon_irq irq; 688 struct radeon_irq irq;
620 struct radeon_asic *asic; 689 struct radeon_asic *asic;
621 struct radeon_gem gem; 690 struct radeon_gem gem;
691 struct radeon_pm pm;
622 struct mutex cs_mutex; 692 struct mutex cs_mutex;
623 struct radeon_wb wb; 693 struct radeon_wb wb;
624 bool gpu_lockup; 694 bool gpu_lockup;
625 bool shutdown; 695 bool shutdown;
626 bool suspend; 696 bool suspend;
697 bool need_dma32;
698 struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES];
627}; 699};
628 700
629int radeon_device_init(struct radeon_device *rdev, 701int radeon_device_init(struct radeon_device *rdev,
@@ -670,6 +742,8 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
670/* 742/*
671 * ASICs helpers. 743 * ASICs helpers.
672 */ 744 */
745#define ASIC_IS_RN50(rdev) ((rdev->pdev->device == 0x515e) || \
746 (rdev->pdev->device == 0x5969))
673#define ASIC_IS_RV100(rdev) ((rdev->family == CHIP_RV100) || \ 747#define ASIC_IS_RV100(rdev) ((rdev->family == CHIP_RV100) || \
674 (rdev->family == CHIP_RV200) || \ 748 (rdev->family == CHIP_RV200) || \
675 (rdev->family == CHIP_RS100) || \ 749 (rdev->family == CHIP_RS100) || \
@@ -796,5 +870,8 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
796#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) 870#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
797#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l)) 871#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
798#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e)) 872#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))
873#define radeon_set_surface_reg(rdev, r, f, p, o, s) ((rdev)->asic->set_surface_reg((rdev), (r), (f), (p), (o), (s)))
874#define radeon_clear_surface_reg(rdev, r) ((rdev)->asic->clear_surface_reg((rdev), (r)))
875#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev))
799 876
800#endif 877#endif
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index e2e567395df8..9a75876e0c3b 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -71,6 +71,11 @@ int r100_copy_blit(struct radeon_device *rdev,
71 uint64_t dst_offset, 71 uint64_t dst_offset,
72 unsigned num_pages, 72 unsigned num_pages,
73 struct radeon_fence *fence); 73 struct radeon_fence *fence);
74int r100_set_surface_reg(struct radeon_device *rdev, int reg,
75 uint32_t tiling_flags, uint32_t pitch,
76 uint32_t offset, uint32_t obj_size);
77int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
78void r100_bandwidth_update(struct radeon_device *rdev);
74 79
75static struct radeon_asic r100_asic = { 80static struct radeon_asic r100_asic = {
76 .init = &r100_init, 81 .init = &r100_init,
@@ -100,6 +105,9 @@ static struct radeon_asic r100_asic = {
100 .set_memory_clock = NULL, 105 .set_memory_clock = NULL,
101 .set_pcie_lanes = NULL, 106 .set_pcie_lanes = NULL,
102 .set_clock_gating = &radeon_legacy_set_clock_gating, 107 .set_clock_gating = &radeon_legacy_set_clock_gating,
108 .set_surface_reg = r100_set_surface_reg,
109 .clear_surface_reg = r100_clear_surface_reg,
110 .bandwidth_update = &r100_bandwidth_update,
103}; 111};
104 112
105 113
@@ -128,6 +136,7 @@ int r300_copy_dma(struct radeon_device *rdev,
128 uint64_t dst_offset, 136 uint64_t dst_offset,
129 unsigned num_pages, 137 unsigned num_pages,
130 struct radeon_fence *fence); 138 struct radeon_fence *fence);
139
131static struct radeon_asic r300_asic = { 140static struct radeon_asic r300_asic = {
132 .init = &r300_init, 141 .init = &r300_init,
133 .errata = &r300_errata, 142 .errata = &r300_errata,
@@ -156,6 +165,9 @@ static struct radeon_asic r300_asic = {
156 .set_memory_clock = NULL, 165 .set_memory_clock = NULL,
157 .set_pcie_lanes = &rv370_set_pcie_lanes, 166 .set_pcie_lanes = &rv370_set_pcie_lanes,
158 .set_clock_gating = &radeon_legacy_set_clock_gating, 167 .set_clock_gating = &radeon_legacy_set_clock_gating,
168 .set_surface_reg = r100_set_surface_reg,
169 .clear_surface_reg = r100_clear_surface_reg,
170 .bandwidth_update = &r100_bandwidth_update,
159}; 171};
160 172
161/* 173/*
@@ -193,6 +205,9 @@ static struct radeon_asic r420_asic = {
193 .set_memory_clock = &radeon_atom_set_memory_clock, 205 .set_memory_clock = &radeon_atom_set_memory_clock,
194 .set_pcie_lanes = &rv370_set_pcie_lanes, 206 .set_pcie_lanes = &rv370_set_pcie_lanes,
195 .set_clock_gating = &radeon_atom_set_clock_gating, 207 .set_clock_gating = &radeon_atom_set_clock_gating,
208 .set_surface_reg = r100_set_surface_reg,
209 .clear_surface_reg = r100_clear_surface_reg,
210 .bandwidth_update = &r100_bandwidth_update,
196}; 211};
197 212
198 213
@@ -237,6 +252,9 @@ static struct radeon_asic rs400_asic = {
237 .set_memory_clock = NULL, 252 .set_memory_clock = NULL,
238 .set_pcie_lanes = NULL, 253 .set_pcie_lanes = NULL,
239 .set_clock_gating = &radeon_legacy_set_clock_gating, 254 .set_clock_gating = &radeon_legacy_set_clock_gating,
255 .set_surface_reg = r100_set_surface_reg,
256 .clear_surface_reg = r100_clear_surface_reg,
257 .bandwidth_update = &r100_bandwidth_update,
240}; 258};
241 259
242 260
@@ -254,6 +272,7 @@ void rs600_gart_tlb_flush(struct radeon_device *rdev);
254int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); 272int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
255uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg); 273uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg);
256void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 274void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
275void rs600_bandwidth_update(struct radeon_device *rdev);
257static struct radeon_asic rs600_asic = { 276static struct radeon_asic rs600_asic = {
258 .init = &r300_init, 277 .init = &r300_init,
259 .errata = &rs600_errata, 278 .errata = &rs600_errata,
@@ -282,6 +301,7 @@ static struct radeon_asic rs600_asic = {
282 .set_memory_clock = &radeon_atom_set_memory_clock, 301 .set_memory_clock = &radeon_atom_set_memory_clock,
283 .set_pcie_lanes = NULL, 302 .set_pcie_lanes = NULL,
284 .set_clock_gating = &radeon_atom_set_clock_gating, 303 .set_clock_gating = &radeon_atom_set_clock_gating,
304 .bandwidth_update = &rs600_bandwidth_update,
285}; 305};
286 306
287 307
@@ -294,6 +314,7 @@ int rs690_mc_init(struct radeon_device *rdev);
294void rs690_mc_fini(struct radeon_device *rdev); 314void rs690_mc_fini(struct radeon_device *rdev);
295uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg); 315uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg);
296void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 316void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
317void rs690_bandwidth_update(struct radeon_device *rdev);
297static struct radeon_asic rs690_asic = { 318static struct radeon_asic rs690_asic = {
298 .init = &r300_init, 319 .init = &r300_init,
299 .errata = &rs690_errata, 320 .errata = &rs690_errata,
@@ -322,6 +343,9 @@ static struct radeon_asic rs690_asic = {
322 .set_memory_clock = &radeon_atom_set_memory_clock, 343 .set_memory_clock = &radeon_atom_set_memory_clock,
323 .set_pcie_lanes = NULL, 344 .set_pcie_lanes = NULL,
324 .set_clock_gating = &radeon_atom_set_clock_gating, 345 .set_clock_gating = &radeon_atom_set_clock_gating,
346 .set_surface_reg = r100_set_surface_reg,
347 .clear_surface_reg = r100_clear_surface_reg,
348 .bandwidth_update = &rs690_bandwidth_update,
325}; 349};
326 350
327 351
@@ -339,6 +363,7 @@ void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
339void rv515_ring_start(struct radeon_device *rdev); 363void rv515_ring_start(struct radeon_device *rdev);
340uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg); 364uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg);
341void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 365void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
366void rv515_bandwidth_update(struct radeon_device *rdev);
342static struct radeon_asic rv515_asic = { 367static struct radeon_asic rv515_asic = {
343 .init = &rv515_init, 368 .init = &rv515_init,
344 .errata = &rv515_errata, 369 .errata = &rv515_errata,
@@ -367,6 +392,9 @@ static struct radeon_asic rv515_asic = {
367 .set_memory_clock = &radeon_atom_set_memory_clock, 392 .set_memory_clock = &radeon_atom_set_memory_clock,
368 .set_pcie_lanes = &rv370_set_pcie_lanes, 393 .set_pcie_lanes = &rv370_set_pcie_lanes,
369 .set_clock_gating = &radeon_atom_set_clock_gating, 394 .set_clock_gating = &radeon_atom_set_clock_gating,
395 .set_surface_reg = r100_set_surface_reg,
396 .clear_surface_reg = r100_clear_surface_reg,
397 .bandwidth_update = &rv515_bandwidth_update,
370}; 398};
371 399
372 400
@@ -377,6 +405,7 @@ void r520_errata(struct radeon_device *rdev);
377void r520_vram_info(struct radeon_device *rdev); 405void r520_vram_info(struct radeon_device *rdev);
378int r520_mc_init(struct radeon_device *rdev); 406int r520_mc_init(struct radeon_device *rdev);
379void r520_mc_fini(struct radeon_device *rdev); 407void r520_mc_fini(struct radeon_device *rdev);
408void r520_bandwidth_update(struct radeon_device *rdev);
380static struct radeon_asic r520_asic = { 409static struct radeon_asic r520_asic = {
381 .init = &rv515_init, 410 .init = &rv515_init,
382 .errata = &r520_errata, 411 .errata = &r520_errata,
@@ -405,6 +434,9 @@ static struct radeon_asic r520_asic = {
405 .set_memory_clock = &radeon_atom_set_memory_clock, 434 .set_memory_clock = &radeon_atom_set_memory_clock,
406 .set_pcie_lanes = &rv370_set_pcie_lanes, 435 .set_pcie_lanes = &rv370_set_pcie_lanes,
407 .set_clock_gating = &radeon_atom_set_clock_gating, 436 .set_clock_gating = &radeon_atom_set_clock_gating,
437 .set_surface_reg = r100_set_surface_reg,
438 .clear_surface_reg = r100_clear_surface_reg,
439 .bandwidth_update = &r520_bandwidth_update,
408}; 440};
409 441
410/* 442/*
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 1f5a1a490984..fcfe5c02d744 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -103,7 +103,8 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_gpio(struct drm_device
103static bool radeon_atom_apply_quirks(struct drm_device *dev, 103static bool radeon_atom_apply_quirks(struct drm_device *dev,
104 uint32_t supported_device, 104 uint32_t supported_device,
105 int *connector_type, 105 int *connector_type,
106 struct radeon_i2c_bus_rec *i2c_bus) 106 struct radeon_i2c_bus_rec *i2c_bus,
107 uint8_t *line_mux)
107{ 108{
108 109
109 /* Asus M2A-VM HDMI board lists the DVI port as HDMI */ 110 /* Asus M2A-VM HDMI board lists the DVI port as HDMI */
@@ -127,8 +128,10 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
127 if ((dev->pdev->device == 0x5653) && 128 if ((dev->pdev->device == 0x5653) &&
128 (dev->pdev->subsystem_vendor == 0x1462) && 129 (dev->pdev->subsystem_vendor == 0x1462) &&
129 (dev->pdev->subsystem_device == 0x0291)) { 130 (dev->pdev->subsystem_device == 0x0291)) {
130 if (*connector_type == DRM_MODE_CONNECTOR_LVDS) 131 if (*connector_type == DRM_MODE_CONNECTOR_LVDS) {
131 i2c_bus->valid = false; 132 i2c_bus->valid = false;
133 *line_mux = 53;
134 }
132 } 135 }
133 136
134 /* Funky macbooks */ 137 /* Funky macbooks */
@@ -526,7 +529,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
526 529
527 if (!radeon_atom_apply_quirks 530 if (!radeon_atom_apply_quirks
528 (dev, (1 << i), &bios_connectors[i].connector_type, 531 (dev, (1 << i), &bios_connectors[i].connector_type,
529 &bios_connectors[i].ddc_bus)) 532 &bios_connectors[i].ddc_bus, &bios_connectors[i].line_mux))
530 continue; 533 continue;
531 534
532 bios_connectors[i].valid = true; 535 bios_connectors[i].valid = true;
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c
index c44403a2ca76..2e938f7496fb 100644
--- a/drivers/gpu/drm/radeon/radeon_benchmark.c
+++ b/drivers/gpu/drm/radeon/radeon_benchmark.c
@@ -63,7 +63,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize,
63 if (r) { 63 if (r) {
64 goto out_cleanup; 64 goto out_cleanup;
65 } 65 }
66 r = radeon_copy_dma(rdev, saddr, daddr, size >> 14, fence); 66 r = radeon_copy_dma(rdev, saddr, daddr, size / 4096, fence);
67 if (r) { 67 if (r) {
68 goto out_cleanup; 68 goto out_cleanup;
69 } 69 }
@@ -88,7 +88,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize,
88 if (r) { 88 if (r) {
89 goto out_cleanup; 89 goto out_cleanup;
90 } 90 }
91 r = radeon_copy_blit(rdev, saddr, daddr, size >> 14, fence); 91 r = radeon_copy_blit(rdev, saddr, daddr, size / 4096, fence);
92 if (r) { 92 if (r) {
93 goto out_cleanup; 93 goto out_cleanup;
94 } 94 }
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index b843f9bdfb14..a169067efc4e 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -127,17 +127,23 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
127 sizeof(struct drm_radeon_cs_chunk))) { 127 sizeof(struct drm_radeon_cs_chunk))) {
128 return -EFAULT; 128 return -EFAULT;
129 } 129 }
130 p->chunks[i].length_dw = user_chunk.length_dw;
131 p->chunks[i].kdata = NULL;
130 p->chunks[i].chunk_id = user_chunk.chunk_id; 132 p->chunks[i].chunk_id = user_chunk.chunk_id;
133
131 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_RELOCS) { 134 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_RELOCS) {
132 p->chunk_relocs_idx = i; 135 p->chunk_relocs_idx = i;
133 } 136 }
134 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_IB) { 137 if (p->chunks[i].chunk_id == RADEON_CHUNK_ID_IB) {
135 p->chunk_ib_idx = i; 138 p->chunk_ib_idx = i;
139 /* zero length IB isn't useful */
140 if (p->chunks[i].length_dw == 0)
141 return -EINVAL;
136 } 142 }
143
137 p->chunks[i].length_dw = user_chunk.length_dw; 144 p->chunks[i].length_dw = user_chunk.length_dw;
138 cdata = (uint32_t *)(unsigned long)user_chunk.chunk_data; 145 cdata = (uint32_t *)(unsigned long)user_chunk.chunk_data;
139 146
140 p->chunks[i].kdata = NULL;
141 size = p->chunks[i].length_dw * sizeof(uint32_t); 147 size = p->chunks[i].length_dw * sizeof(uint32_t);
142 p->chunks[i].kdata = kzalloc(size, GFP_KERNEL); 148 p->chunks[i].kdata = kzalloc(size, GFP_KERNEL);
143 if (p->chunks[i].kdata == NULL) { 149 if (p->chunks[i].kdata == NULL) {
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
index 5232441f119b..b13c79e38bc0 100644
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
@@ -111,9 +111,11 @@ static void radeon_set_cursor(struct drm_crtc *crtc, struct drm_gem_object *obj,
111 111
112 if (ASIC_IS_AVIVO(rdev)) 112 if (ASIC_IS_AVIVO(rdev))
113 WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr); 113 WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr);
114 else 114 else {
115 radeon_crtc->legacy_cursor_offset = gpu_addr - radeon_crtc->legacy_display_base_addr;
115 /* offset is from DISP(2)_BASE_ADDRESS */ 116 /* offset is from DISP(2)_BASE_ADDRESS */
116 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, gpu_addr); 117 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset);
118 }
117} 119}
118 120
119int radeon_crtc_cursor_set(struct drm_crtc *crtc, 121int radeon_crtc_cursor_set(struct drm_crtc *crtc,
@@ -245,6 +247,9 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
245 (RADEON_CUR_LOCK 247 (RADEON_CUR_LOCK
246 | ((xorigin ? 0 : x) << 16) 248 | ((xorigin ? 0 : x) << 16)
247 | (yorigin ? 0 : y))); 249 | (yorigin ? 0 : y)));
250 /* offset is from DISP(2)_BASE_ADDRESS */
251 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, (radeon_crtc->legacy_cursor_offset +
252 (yorigin * 256)));
248 } 253 }
249 radeon_lock_cursor(crtc, false); 254 radeon_lock_cursor(crtc, false);
250 255
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index f97563db4e59..a162ade74b7f 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -48,6 +48,8 @@ static void radeon_surface_init(struct radeon_device *rdev)
48 i * (RADEON_SURFACE1_INFO - RADEON_SURFACE0_INFO), 48 i * (RADEON_SURFACE1_INFO - RADEON_SURFACE0_INFO),
49 0); 49 0);
50 } 50 }
51 /* enable surfaces */
52 WREG32(RADEON_SURFACE_CNTL, 0);
51 } 53 }
52} 54}
53 55
@@ -119,7 +121,7 @@ int radeon_mc_setup(struct radeon_device *rdev)
119 if (rdev->mc.vram_location != 0xFFFFFFFFUL) { 121 if (rdev->mc.vram_location != 0xFFFFFFFFUL) {
120 /* vram location was already setup try to put gtt after 122 /* vram location was already setup try to put gtt after
121 * if it fits */ 123 * if it fits */
122 tmp = rdev->mc.vram_location + rdev->mc.vram_size; 124 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size;
123 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1); 125 tmp = (tmp + rdev->mc.gtt_size - 1) & ~(rdev->mc.gtt_size - 1);
124 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) { 126 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) {
125 rdev->mc.gtt_location = tmp; 127 rdev->mc.gtt_location = tmp;
@@ -134,13 +136,13 @@ int radeon_mc_setup(struct radeon_device *rdev)
134 } else if (rdev->mc.gtt_location != 0xFFFFFFFFUL) { 136 } else if (rdev->mc.gtt_location != 0xFFFFFFFFUL) {
135 /* gtt location was already setup try to put vram before 137 /* gtt location was already setup try to put vram before
136 * if it fits */ 138 * if it fits */
137 if (rdev->mc.vram_size < rdev->mc.gtt_location) { 139 if (rdev->mc.mc_vram_size < rdev->mc.gtt_location) {
138 rdev->mc.vram_location = 0; 140 rdev->mc.vram_location = 0;
139 } else { 141 } else {
140 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size; 142 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size;
141 tmp += (rdev->mc.vram_size - 1); 143 tmp += (rdev->mc.mc_vram_size - 1);
142 tmp &= ~(rdev->mc.vram_size - 1); 144 tmp &= ~(rdev->mc.mc_vram_size - 1);
143 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.vram_size) { 145 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.mc_vram_size) {
144 rdev->mc.vram_location = tmp; 146 rdev->mc.vram_location = tmp;
145 } else { 147 } else {
146 printk(KERN_ERR "[drm] vram too big to fit " 148 printk(KERN_ERR "[drm] vram too big to fit "
@@ -150,12 +152,14 @@ int radeon_mc_setup(struct radeon_device *rdev)
150 } 152 }
151 } else { 153 } else {
152 rdev->mc.vram_location = 0; 154 rdev->mc.vram_location = 0;
153 rdev->mc.gtt_location = rdev->mc.vram_size; 155 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
154 } 156 }
155 DRM_INFO("radeon: VRAM %uM\n", rdev->mc.vram_size >> 20); 157 DRM_INFO("radeon: VRAM %uM\n", rdev->mc.real_vram_size >> 20);
156 DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n", 158 DRM_INFO("radeon: VRAM from 0x%08X to 0x%08X\n",
157 rdev->mc.vram_location, 159 rdev->mc.vram_location,
158 rdev->mc.vram_location + rdev->mc.vram_size - 1); 160 rdev->mc.vram_location + rdev->mc.mc_vram_size - 1);
161 if (rdev->mc.real_vram_size != rdev->mc.mc_vram_size)
162 DRM_INFO("radeon: VRAM less than aperture workaround enabled\n");
159 DRM_INFO("radeon: GTT %uM\n", rdev->mc.gtt_size >> 20); 163 DRM_INFO("radeon: GTT %uM\n", rdev->mc.gtt_size >> 20);
160 DRM_INFO("radeon: GTT from 0x%08X to 0x%08X\n", 164 DRM_INFO("radeon: GTT from 0x%08X to 0x%08X\n",
161 rdev->mc.gtt_location, 165 rdev->mc.gtt_location,
@@ -450,6 +454,7 @@ int radeon_device_init(struct radeon_device *rdev,
450 uint32_t flags) 454 uint32_t flags)
451{ 455{
452 int r, ret; 456 int r, ret;
457 int dma_bits;
453 458
454 DRM_INFO("radeon: Initializing kernel modesetting.\n"); 459 DRM_INFO("radeon: Initializing kernel modesetting.\n");
455 rdev->shutdown = false; 460 rdev->shutdown = false;
@@ -492,8 +497,20 @@ int radeon_device_init(struct radeon_device *rdev,
492 return r; 497 return r;
493 } 498 }
494 499
495 /* Report DMA addressing limitation */ 500 /* set DMA mask + need_dma32 flags.
496 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(32)); 501 * PCIE - can handle 40-bits.
502 * IGP - can handle 40-bits (in theory)
503 * AGP - generally dma32 is safest
504 * PCI - only dma32
505 */
506 rdev->need_dma32 = false;
507 if (rdev->flags & RADEON_IS_AGP)
508 rdev->need_dma32 = true;
509 if (rdev->flags & RADEON_IS_PCI)
510 rdev->need_dma32 = true;
511
512 dma_bits = rdev->need_dma32 ? 32 : 40;
513 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
497 if (r) { 514 if (r) {
498 printk(KERN_WARNING "radeon: No suitable DMA available.\n"); 515 printk(KERN_WARNING "radeon: No suitable DMA available.\n");
499 } 516 }
@@ -546,27 +563,22 @@ int radeon_device_init(struct radeon_device *rdev,
546 radeon_combios_asic_init(rdev->ddev); 563 radeon_combios_asic_init(rdev->ddev);
547 } 564 }
548 } 565 }
566 /* Initialize clocks */
567 r = radeon_clocks_init(rdev);
568 if (r) {
569 return r;
570 }
549 /* Get vram informations */ 571 /* Get vram informations */
550 radeon_vram_info(rdev); 572 radeon_vram_info(rdev);
551 /* Device is severly broken if aper size > vram size. 573
552 * for RN50/M6/M7 - Novell bug 204882 ?
553 */
554 if (rdev->mc.vram_size < rdev->mc.aper_size) {
555 rdev->mc.aper_size = rdev->mc.vram_size;
556 }
557 /* Add an MTRR for the VRAM */ 574 /* Add an MTRR for the VRAM */
558 rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size, 575 rdev->mc.vram_mtrr = mtrr_add(rdev->mc.aper_base, rdev->mc.aper_size,
559 MTRR_TYPE_WRCOMB, 1); 576 MTRR_TYPE_WRCOMB, 1);
560 DRM_INFO("Detected VRAM RAM=%uM, BAR=%uM\n", 577 DRM_INFO("Detected VRAM RAM=%uM, BAR=%uM\n",
561 rdev->mc.vram_size >> 20, 578 rdev->mc.real_vram_size >> 20,
562 (unsigned)rdev->mc.aper_size >> 20); 579 (unsigned)rdev->mc.aper_size >> 20);
563 DRM_INFO("RAM width %dbits %cDR\n", 580 DRM_INFO("RAM width %dbits %cDR\n",
564 rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S'); 581 rdev->mc.vram_width, rdev->mc.vram_is_ddr ? 'D' : 'S');
565 /* Initialize clocks */
566 r = radeon_clocks_init(rdev);
567 if (r) {
568 return r;
569 }
570 /* Initialize memory controller (also test AGP) */ 582 /* Initialize memory controller (also test AGP) */
571 r = radeon_mc_init(rdev); 583 r = radeon_mc_init(rdev);
572 if (r) { 584 if (r) {
@@ -626,6 +638,9 @@ int radeon_device_init(struct radeon_device *rdev,
626 if (!ret) { 638 if (!ret) {
627 DRM_INFO("radeon: kernel modesetting successfully initialized.\n"); 639 DRM_INFO("radeon: kernel modesetting successfully initialized.\n");
628 } 640 }
641 if (radeon_testing) {
642 radeon_test_moves(rdev);
643 }
629 if (radeon_benchmarking) { 644 if (radeon_benchmarking) {
630 radeon_benchmark(rdev); 645 radeon_benchmark(rdev);
631 } 646 }
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 3efcf1a526be..a8fa1bb84cf7 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -187,6 +187,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
187 187
188 drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256); 188 drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
189 radeon_crtc->crtc_id = index; 189 radeon_crtc->crtc_id = index;
190 rdev->mode_info.crtcs[index] = radeon_crtc;
190 191
191 radeon_crtc->mode_set.crtc = &radeon_crtc->base; 192 radeon_crtc->mode_set.crtc = &radeon_crtc->base;
192 radeon_crtc->mode_set.connectors = (struct drm_connector **)(radeon_crtc + 1); 193 radeon_crtc->mode_set.connectors = (struct drm_connector **)(radeon_crtc + 1);
@@ -491,7 +492,11 @@ void radeon_compute_pll(struct radeon_pll *pll,
491 tmp += (uint64_t)pll->reference_freq * 1000 * frac_feedback_div; 492 tmp += (uint64_t)pll->reference_freq * 1000 * frac_feedback_div;
492 current_freq = radeon_div(tmp, ref_div * post_div); 493 current_freq = radeon_div(tmp, ref_div * post_div);
493 494
494 error = abs(current_freq - freq); 495 if (flags & RADEON_PLL_PREFER_CLOSEST_LOWER) {
496 error = freq - current_freq;
497 error = error < 0 ? 0xffffffff : error;
498 } else
499 error = abs(current_freq - freq);
495 vco_diff = abs(vco - best_vco); 500 vco_diff = abs(vco - best_vco);
496 501
497 if ((best_vco == 0 && error < best_error) || 502 if ((best_vco == 0 && error < best_error) ||
@@ -657,36 +662,51 @@ void radeon_modeset_fini(struct radeon_device *rdev)
657 } 662 }
658} 663}
659 664
660void radeon_init_disp_bandwidth(struct drm_device *dev) 665bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
666 struct drm_display_mode *mode,
667 struct drm_display_mode *adjusted_mode)
661{ 668{
662 struct radeon_device *rdev = dev->dev_private; 669 struct drm_device *dev = crtc->dev;
663 struct drm_display_mode *modes[2]; 670 struct drm_encoder *encoder;
664 int pixel_bytes[2]; 671 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
665 struct drm_crtc *crtc; 672 struct radeon_encoder *radeon_encoder;
666 673 bool first = true;
667 pixel_bytes[0] = pixel_bytes[1] = 0;
668 modes[0] = modes[1] = NULL;
669
670 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
671 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
672 674
673 if (crtc->enabled && crtc->fb) { 675 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
674 modes[radeon_crtc->crtc_id] = &crtc->mode; 676 radeon_encoder = to_radeon_encoder(encoder);
675 pixel_bytes[radeon_crtc->crtc_id] = crtc->fb->bits_per_pixel / 8; 677 if (encoder->crtc != crtc)
678 continue;
679 if (first) {
680 radeon_crtc->rmx_type = radeon_encoder->rmx_type;
681 radeon_crtc->devices = radeon_encoder->devices;
682 memcpy(&radeon_crtc->native_mode,
683 &radeon_encoder->native_mode,
684 sizeof(struct radeon_native_mode));
685 first = false;
686 } else {
687 if (radeon_crtc->rmx_type != radeon_encoder->rmx_type) {
688 /* WARNING: Right now this can't happen but
689 * in the future we need to check that scaling
690 * are consistent accross different encoder
691 * (ie all encoder can work with the same
692 * scaling).
693 */
694 DRM_ERROR("Scaling not consistent accross encoder.\n");
695 return false;
696 }
676 } 697 }
677 } 698 }
678 699 if (radeon_crtc->rmx_type != RMX_OFF) {
679 if (ASIC_IS_AVIVO(rdev)) { 700 fixed20_12 a, b;
680 radeon_init_disp_bw_avivo(dev, 701 a.full = rfixed_const(crtc->mode.vdisplay);
681 modes[0], 702 b.full = rfixed_const(radeon_crtc->native_mode.panel_xres);
682 pixel_bytes[0], 703 radeon_crtc->vsc.full = rfixed_div(a, b);
683 modes[1], 704 a.full = rfixed_const(crtc->mode.hdisplay);
684 pixel_bytes[1]); 705 b.full = rfixed_const(radeon_crtc->native_mode.panel_yres);
706 radeon_crtc->hsc.full = rfixed_div(a, b);
685 } else { 707 } else {
686 radeon_init_disp_bw_legacy(dev, 708 radeon_crtc->vsc.full = rfixed_const(1);
687 modes[0], 709 radeon_crtc->hsc.full = rfixed_const(1);
688 pixel_bytes[0],
689 modes[1],
690 pixel_bytes[1]);
691 } 710 }
711 return true;
692} 712}
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 84ba69f48784..3cfcee17dc56 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -89,6 +89,7 @@ int radeon_agpmode = 0;
89int radeon_vram_limit = 0; 89int radeon_vram_limit = 0;
90int radeon_gart_size = 512; /* default gart size */ 90int radeon_gart_size = 512; /* default gart size */
91int radeon_benchmarking = 0; 91int radeon_benchmarking = 0;
92int radeon_testing = 0;
92int radeon_connector_table = 0; 93int radeon_connector_table = 0;
93#endif 94#endif
94 95
@@ -117,6 +118,9 @@ module_param_named(gartsize, radeon_gart_size, int, 0600);
117MODULE_PARM_DESC(benchmark, "Run benchmark"); 118MODULE_PARM_DESC(benchmark, "Run benchmark");
118module_param_named(benchmark, radeon_benchmarking, int, 0444); 119module_param_named(benchmark, radeon_benchmarking, int, 0444);
119 120
121MODULE_PARM_DESC(test, "Run tests");
122module_param_named(test, radeon_testing, int, 0444);
123
120MODULE_PARM_DESC(connector_table, "Force connector table"); 124MODULE_PARM_DESC(connector_table, "Force connector table");
121module_param_named(connector_table, radeon_connector_table, int, 0444); 125module_param_named(connector_table, radeon_connector_table, int, 0444);
122#endif 126#endif
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index c8ef0d14ffab..0a92706eac19 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -154,7 +154,6 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder,
154 154
155 if (mode->hdisplay < native_mode->panel_xres || 155 if (mode->hdisplay < native_mode->panel_xres ||
156 mode->vdisplay < native_mode->panel_yres) { 156 mode->vdisplay < native_mode->panel_yres) {
157 radeon_encoder->flags |= RADEON_USE_RMX;
158 if (ASIC_IS_AVIVO(rdev)) { 157 if (ASIC_IS_AVIVO(rdev)) {
159 adjusted_mode->hdisplay = native_mode->panel_xres; 158 adjusted_mode->hdisplay = native_mode->panel_xres;
160 adjusted_mode->vdisplay = native_mode->panel_yres; 159 adjusted_mode->vdisplay = native_mode->panel_yres;
@@ -197,15 +196,13 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder,
197 } 196 }
198} 197}
199 198
199
200static bool radeon_atom_mode_fixup(struct drm_encoder *encoder, 200static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
201 struct drm_display_mode *mode, 201 struct drm_display_mode *mode,
202 struct drm_display_mode *adjusted_mode) 202 struct drm_display_mode *adjusted_mode)
203{ 203{
204
205 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 204 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
206 205
207 radeon_encoder->flags &= ~RADEON_USE_RMX;
208
209 drm_mode_set_crtcinfo(adjusted_mode, 0); 206 drm_mode_set_crtcinfo(adjusted_mode, 0);
210 207
211 if (radeon_encoder->rmx_type != RMX_OFF) 208 if (radeon_encoder->rmx_type != RMX_OFF)
@@ -808,234 +805,6 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
808 805
809} 806}
810 807
811static void atom_rv515_force_tv_scaler(struct radeon_device *rdev)
812{
813
814 WREG32(0x659C, 0x0);
815 WREG32(0x6594, 0x705);
816 WREG32(0x65A4, 0x10001);
817 WREG32(0x65D8, 0x0);
818 WREG32(0x65B0, 0x0);
819 WREG32(0x65C0, 0x0);
820 WREG32(0x65D4, 0x0);
821 WREG32(0x6578, 0x0);
822 WREG32(0x657C, 0x841880A8);
823 WREG32(0x6578, 0x1);
824 WREG32(0x657C, 0x84208680);
825 WREG32(0x6578, 0x2);
826 WREG32(0x657C, 0xBFF880B0);
827 WREG32(0x6578, 0x100);
828 WREG32(0x657C, 0x83D88088);
829 WREG32(0x6578, 0x101);
830 WREG32(0x657C, 0x84608680);
831 WREG32(0x6578, 0x102);
832 WREG32(0x657C, 0xBFF080D0);
833 WREG32(0x6578, 0x200);
834 WREG32(0x657C, 0x83988068);
835 WREG32(0x6578, 0x201);
836 WREG32(0x657C, 0x84A08680);
837 WREG32(0x6578, 0x202);
838 WREG32(0x657C, 0xBFF080F8);
839 WREG32(0x6578, 0x300);
840 WREG32(0x657C, 0x83588058);
841 WREG32(0x6578, 0x301);
842 WREG32(0x657C, 0x84E08660);
843 WREG32(0x6578, 0x302);
844 WREG32(0x657C, 0xBFF88120);
845 WREG32(0x6578, 0x400);
846 WREG32(0x657C, 0x83188040);
847 WREG32(0x6578, 0x401);
848 WREG32(0x657C, 0x85008660);
849 WREG32(0x6578, 0x402);
850 WREG32(0x657C, 0xBFF88150);
851 WREG32(0x6578, 0x500);
852 WREG32(0x657C, 0x82D88030);
853 WREG32(0x6578, 0x501);
854 WREG32(0x657C, 0x85408640);
855 WREG32(0x6578, 0x502);
856 WREG32(0x657C, 0xBFF88180);
857 WREG32(0x6578, 0x600);
858 WREG32(0x657C, 0x82A08018);
859 WREG32(0x6578, 0x601);
860 WREG32(0x657C, 0x85808620);
861 WREG32(0x6578, 0x602);
862 WREG32(0x657C, 0xBFF081B8);
863 WREG32(0x6578, 0x700);
864 WREG32(0x657C, 0x82608010);
865 WREG32(0x6578, 0x701);
866 WREG32(0x657C, 0x85A08600);
867 WREG32(0x6578, 0x702);
868 WREG32(0x657C, 0x800081F0);
869 WREG32(0x6578, 0x800);
870 WREG32(0x657C, 0x8228BFF8);
871 WREG32(0x6578, 0x801);
872 WREG32(0x657C, 0x85E085E0);
873 WREG32(0x6578, 0x802);
874 WREG32(0x657C, 0xBFF88228);
875 WREG32(0x6578, 0x10000);
876 WREG32(0x657C, 0x82A8BF00);
877 WREG32(0x6578, 0x10001);
878 WREG32(0x657C, 0x82A08CC0);
879 WREG32(0x6578, 0x10002);
880 WREG32(0x657C, 0x8008BEF8);
881 WREG32(0x6578, 0x10100);
882 WREG32(0x657C, 0x81F0BF28);
883 WREG32(0x6578, 0x10101);
884 WREG32(0x657C, 0x83608CA0);
885 WREG32(0x6578, 0x10102);
886 WREG32(0x657C, 0x8018BED0);
887 WREG32(0x6578, 0x10200);
888 WREG32(0x657C, 0x8148BF38);
889 WREG32(0x6578, 0x10201);
890 WREG32(0x657C, 0x84408C80);
891 WREG32(0x6578, 0x10202);
892 WREG32(0x657C, 0x8008BEB8);
893 WREG32(0x6578, 0x10300);
894 WREG32(0x657C, 0x80B0BF78);
895 WREG32(0x6578, 0x10301);
896 WREG32(0x657C, 0x85008C20);
897 WREG32(0x6578, 0x10302);
898 WREG32(0x657C, 0x8020BEA0);
899 WREG32(0x6578, 0x10400);
900 WREG32(0x657C, 0x8028BF90);
901 WREG32(0x6578, 0x10401);
902 WREG32(0x657C, 0x85E08BC0);
903 WREG32(0x6578, 0x10402);
904 WREG32(0x657C, 0x8018BE90);
905 WREG32(0x6578, 0x10500);
906 WREG32(0x657C, 0xBFB8BFB0);
907 WREG32(0x6578, 0x10501);
908 WREG32(0x657C, 0x86C08B40);
909 WREG32(0x6578, 0x10502);
910 WREG32(0x657C, 0x8010BE90);
911 WREG32(0x6578, 0x10600);
912 WREG32(0x657C, 0xBF58BFC8);
913 WREG32(0x6578, 0x10601);
914 WREG32(0x657C, 0x87A08AA0);
915 WREG32(0x6578, 0x10602);
916 WREG32(0x657C, 0x8010BE98);
917 WREG32(0x6578, 0x10700);
918 WREG32(0x657C, 0xBF10BFF0);
919 WREG32(0x6578, 0x10701);
920 WREG32(0x657C, 0x886089E0);
921 WREG32(0x6578, 0x10702);
922 WREG32(0x657C, 0x8018BEB0);
923 WREG32(0x6578, 0x10800);
924 WREG32(0x657C, 0xBED8BFE8);
925 WREG32(0x6578, 0x10801);
926 WREG32(0x657C, 0x89408940);
927 WREG32(0x6578, 0x10802);
928 WREG32(0x657C, 0xBFE8BED8);
929 WREG32(0x6578, 0x20000);
930 WREG32(0x657C, 0x80008000);
931 WREG32(0x6578, 0x20001);
932 WREG32(0x657C, 0x90008000);
933 WREG32(0x6578, 0x20002);
934 WREG32(0x657C, 0x80008000);
935 WREG32(0x6578, 0x20003);
936 WREG32(0x657C, 0x80008000);
937 WREG32(0x6578, 0x20100);
938 WREG32(0x657C, 0x80108000);
939 WREG32(0x6578, 0x20101);
940 WREG32(0x657C, 0x8FE0BF70);
941 WREG32(0x6578, 0x20102);
942 WREG32(0x657C, 0xBFE880C0);
943 WREG32(0x6578, 0x20103);
944 WREG32(0x657C, 0x80008000);
945 WREG32(0x6578, 0x20200);
946 WREG32(0x657C, 0x8018BFF8);
947 WREG32(0x6578, 0x20201);
948 WREG32(0x657C, 0x8F80BF08);
949 WREG32(0x6578, 0x20202);
950 WREG32(0x657C, 0xBFD081A0);
951 WREG32(0x6578, 0x20203);
952 WREG32(0x657C, 0xBFF88000);
953 WREG32(0x6578, 0x20300);
954 WREG32(0x657C, 0x80188000);
955 WREG32(0x6578, 0x20301);
956 WREG32(0x657C, 0x8EE0BEC0);
957 WREG32(0x6578, 0x20302);
958 WREG32(0x657C, 0xBFB082A0);
959 WREG32(0x6578, 0x20303);
960 WREG32(0x657C, 0x80008000);
961 WREG32(0x6578, 0x20400);
962 WREG32(0x657C, 0x80188000);
963 WREG32(0x6578, 0x20401);
964 WREG32(0x657C, 0x8E00BEA0);
965 WREG32(0x6578, 0x20402);
966 WREG32(0x657C, 0xBF8883C0);
967 WREG32(0x6578, 0x20403);
968 WREG32(0x657C, 0x80008000);
969 WREG32(0x6578, 0x20500);
970 WREG32(0x657C, 0x80188000);
971 WREG32(0x6578, 0x20501);
972 WREG32(0x657C, 0x8D00BE90);
973 WREG32(0x6578, 0x20502);
974 WREG32(0x657C, 0xBF588500);
975 WREG32(0x6578, 0x20503);
976 WREG32(0x657C, 0x80008008);
977 WREG32(0x6578, 0x20600);
978 WREG32(0x657C, 0x80188000);
979 WREG32(0x6578, 0x20601);
980 WREG32(0x657C, 0x8BC0BE98);
981 WREG32(0x6578, 0x20602);
982 WREG32(0x657C, 0xBF308660);
983 WREG32(0x6578, 0x20603);
984 WREG32(0x657C, 0x80008008);
985 WREG32(0x6578, 0x20700);
986 WREG32(0x657C, 0x80108000);
987 WREG32(0x6578, 0x20701);
988 WREG32(0x657C, 0x8A80BEB0);
989 WREG32(0x6578, 0x20702);
990 WREG32(0x657C, 0xBF0087C0);
991 WREG32(0x6578, 0x20703);
992 WREG32(0x657C, 0x80008008);
993 WREG32(0x6578, 0x20800);
994 WREG32(0x657C, 0x80108000);
995 WREG32(0x6578, 0x20801);
996 WREG32(0x657C, 0x8920BED0);
997 WREG32(0x6578, 0x20802);
998 WREG32(0x657C, 0xBED08920);
999 WREG32(0x6578, 0x20803);
1000 WREG32(0x657C, 0x80008010);
1001 WREG32(0x6578, 0x30000);
1002 WREG32(0x657C, 0x90008000);
1003 WREG32(0x6578, 0x30001);
1004 WREG32(0x657C, 0x80008000);
1005 WREG32(0x6578, 0x30100);
1006 WREG32(0x657C, 0x8FE0BF90);
1007 WREG32(0x6578, 0x30101);
1008 WREG32(0x657C, 0xBFF880A0);
1009 WREG32(0x6578, 0x30200);
1010 WREG32(0x657C, 0x8F60BF40);
1011 WREG32(0x6578, 0x30201);
1012 WREG32(0x657C, 0xBFE88180);
1013 WREG32(0x6578, 0x30300);
1014 WREG32(0x657C, 0x8EC0BF00);
1015 WREG32(0x6578, 0x30301);
1016 WREG32(0x657C, 0xBFC88280);
1017 WREG32(0x6578, 0x30400);
1018 WREG32(0x657C, 0x8DE0BEE0);
1019 WREG32(0x6578, 0x30401);
1020 WREG32(0x657C, 0xBFA083A0);
1021 WREG32(0x6578, 0x30500);
1022 WREG32(0x657C, 0x8CE0BED0);
1023 WREG32(0x6578, 0x30501);
1024 WREG32(0x657C, 0xBF7884E0);
1025 WREG32(0x6578, 0x30600);
1026 WREG32(0x657C, 0x8BA0BED8);
1027 WREG32(0x6578, 0x30601);
1028 WREG32(0x657C, 0xBF508640);
1029 WREG32(0x6578, 0x30700);
1030 WREG32(0x657C, 0x8A60BEE8);
1031 WREG32(0x6578, 0x30701);
1032 WREG32(0x657C, 0xBF2087A0);
1033 WREG32(0x6578, 0x30800);
1034 WREG32(0x657C, 0x8900BF00);
1035 WREG32(0x6578, 0x30801);
1036 WREG32(0x657C, 0xBF008900);
1037}
1038
1039static void 808static void
1040atombios_yuv_setup(struct drm_encoder *encoder, bool enable) 809atombios_yuv_setup(struct drm_encoder *encoder, bool enable)
1041{ 810{
@@ -1074,129 +843,6 @@ atombios_yuv_setup(struct drm_encoder *encoder, bool enable)
1074} 843}
1075 844
1076static void 845static void
1077atombios_overscan_setup(struct drm_encoder *encoder,
1078 struct drm_display_mode *mode,
1079 struct drm_display_mode *adjusted_mode)
1080{
1081 struct drm_device *dev = encoder->dev;
1082 struct radeon_device *rdev = dev->dev_private;
1083 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
1084 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
1085 SET_CRTC_OVERSCAN_PS_ALLOCATION args;
1086 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_OverScan);
1087
1088 memset(&args, 0, sizeof(args));
1089
1090 args.usOverscanRight = 0;
1091 args.usOverscanLeft = 0;
1092 args.usOverscanBottom = 0;
1093 args.usOverscanTop = 0;
1094 args.ucCRTC = radeon_crtc->crtc_id;
1095
1096 if (radeon_encoder->flags & RADEON_USE_RMX) {
1097 if (radeon_encoder->rmx_type == RMX_FULL) {
1098 args.usOverscanRight = 0;
1099 args.usOverscanLeft = 0;
1100 args.usOverscanBottom = 0;
1101 args.usOverscanTop = 0;
1102 } else if (radeon_encoder->rmx_type == RMX_CENTER) {
1103 args.usOverscanTop = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
1104 args.usOverscanBottom = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2;
1105 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
1106 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2;
1107 } else if (radeon_encoder->rmx_type == RMX_ASPECT) {
1108 int a1 = mode->crtc_vdisplay * adjusted_mode->crtc_hdisplay;
1109 int a2 = adjusted_mode->crtc_vdisplay * mode->crtc_hdisplay;
1110
1111 if (a1 > a2) {
1112 args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
1113 args.usOverscanRight = (adjusted_mode->crtc_hdisplay - (a2 / mode->crtc_vdisplay)) / 2;
1114 } else if (a2 > a1) {
1115 args.usOverscanLeft = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
1116 args.usOverscanRight = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2;
1117 }
1118 }
1119 }
1120
1121 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1122
1123}
1124
1125static void
1126atombios_scaler_setup(struct drm_encoder *encoder)
1127{
1128 struct drm_device *dev = encoder->dev;
1129 struct radeon_device *rdev = dev->dev_private;
1130 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
1131 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
1132 ENABLE_SCALER_PS_ALLOCATION args;
1133 int index = GetIndexIntoMasterTable(COMMAND, EnableScaler);
1134 /* fixme - fill in enc_priv for atom dac */
1135 enum radeon_tv_std tv_std = TV_STD_NTSC;
1136
1137 if (!ASIC_IS_AVIVO(rdev) && radeon_crtc->crtc_id)
1138 return;
1139
1140 memset(&args, 0, sizeof(args));
1141
1142 args.ucScaler = radeon_crtc->crtc_id;
1143
1144 if (radeon_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) {
1145 switch (tv_std) {
1146 case TV_STD_NTSC:
1147 default:
1148 args.ucTVStandard = ATOM_TV_NTSC;
1149 break;
1150 case TV_STD_PAL:
1151 args.ucTVStandard = ATOM_TV_PAL;
1152 break;
1153 case TV_STD_PAL_M:
1154 args.ucTVStandard = ATOM_TV_PALM;
1155 break;
1156 case TV_STD_PAL_60:
1157 args.ucTVStandard = ATOM_TV_PAL60;
1158 break;
1159 case TV_STD_NTSC_J:
1160 args.ucTVStandard = ATOM_TV_NTSCJ;
1161 break;
1162 case TV_STD_SCART_PAL:
1163 args.ucTVStandard = ATOM_TV_PAL; /* ??? */
1164 break;
1165 case TV_STD_SECAM:
1166 args.ucTVStandard = ATOM_TV_SECAM;
1167 break;
1168 case TV_STD_PAL_CN:
1169 args.ucTVStandard = ATOM_TV_PALCN;
1170 break;
1171 }
1172 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
1173 } else if (radeon_encoder->devices & (ATOM_DEVICE_CV_SUPPORT)) {
1174 args.ucTVStandard = ATOM_TV_CV;
1175 args.ucEnable = SCALER_ENABLE_MULTITAP_MODE;
1176 } else if (radeon_encoder->flags & RADEON_USE_RMX) {
1177 if (radeon_encoder->rmx_type == RMX_FULL)
1178 args.ucEnable = ATOM_SCALER_EXPANSION;
1179 else if (radeon_encoder->rmx_type == RMX_CENTER)
1180 args.ucEnable = ATOM_SCALER_CENTER;
1181 else if (radeon_encoder->rmx_type == RMX_ASPECT)
1182 args.ucEnable = ATOM_SCALER_EXPANSION;
1183 } else {
1184 if (ASIC_IS_AVIVO(rdev))
1185 args.ucEnable = ATOM_SCALER_DISABLE;
1186 else
1187 args.ucEnable = ATOM_SCALER_CENTER;
1188 }
1189
1190 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1191
1192 if (radeon_encoder->devices & (ATOM_DEVICE_CV_SUPPORT | ATOM_DEVICE_TV_SUPPORT)
1193 && rdev->family >= CHIP_RV515 && rdev->family <= CHIP_RV570) {
1194 atom_rv515_force_tv_scaler(rdev);
1195 }
1196
1197}
1198
1199static void
1200radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) 846radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
1201{ 847{
1202 struct drm_device *dev = encoder->dev; 848 struct drm_device *dev = encoder->dev;
@@ -1448,8 +1094,6 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
1448 radeon_encoder->pixel_clock = adjusted_mode->clock; 1094 radeon_encoder->pixel_clock = adjusted_mode->clock;
1449 1095
1450 radeon_atombios_encoder_crtc_scratch_regs(encoder, radeon_crtc->crtc_id); 1096 radeon_atombios_encoder_crtc_scratch_regs(encoder, radeon_crtc->crtc_id);
1451 atombios_overscan_setup(encoder, mode, adjusted_mode);
1452 atombios_scaler_setup(encoder);
1453 atombios_set_encoder_crtc_source(encoder); 1097 atombios_set_encoder_crtc_source(encoder);
1454 1098
1455 if (ASIC_IS_AVIVO(rdev)) { 1099 if (ASIC_IS_AVIVO(rdev)) {
@@ -1667,6 +1311,7 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su
1667 1311
1668 radeon_encoder->encoder_id = encoder_id; 1312 radeon_encoder->encoder_id = encoder_id;
1669 radeon_encoder->devices = supported_device; 1313 radeon_encoder->devices = supported_device;
1314 radeon_encoder->rmx_type = RMX_OFF;
1670 1315
1671 switch (radeon_encoder->encoder_id) { 1316 switch (radeon_encoder->encoder_id) {
1672 case ENCODER_OBJECT_ID_INTERNAL_LVDS: 1317 case ENCODER_OBJECT_ID_INTERNAL_LVDS:
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 9e8f191eb64a..3206c0ad7b6c 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -101,9 +101,10 @@ static int radeonfb_setcolreg(unsigned regno,
101 break; 101 break;
102 case 24: 102 case 24:
103 case 32: 103 case 32:
104 fb->pseudo_palette[regno] = ((red & 0xff00) << 8) | 104 fb->pseudo_palette[regno] =
105 (green & 0xff00) | 105 (((red >> 8) & 0xff) << info->var.red.offset) |
106 ((blue & 0xff00) >> 8); 106 (((green >> 8) & 0xff) << info->var.green.offset) |
107 (((blue >> 8) & 0xff) << info->var.blue.offset);
107 break; 108 break;
108 } 109 }
109 } 110 }
@@ -154,6 +155,7 @@ static int radeonfb_check_var(struct fb_var_screeninfo *var,
154 var->transp.length = 0; 155 var->transp.length = 0;
155 var->transp.offset = 0; 156 var->transp.offset = 0;
156 break; 157 break;
158#ifdef __LITTLE_ENDIAN
157 case 15: 159 case 15:
158 var->red.offset = 10; 160 var->red.offset = 10;
159 var->green.offset = 5; 161 var->green.offset = 5;
@@ -194,6 +196,28 @@ static int radeonfb_check_var(struct fb_var_screeninfo *var,
194 var->transp.length = 8; 196 var->transp.length = 8;
195 var->transp.offset = 24; 197 var->transp.offset = 24;
196 break; 198 break;
199#else
200 case 24:
201 var->red.offset = 8;
202 var->green.offset = 16;
203 var->blue.offset = 24;
204 var->red.length = 8;
205 var->green.length = 8;
206 var->blue.length = 8;
207 var->transp.length = 0;
208 var->transp.offset = 0;
209 break;
210 case 32:
211 var->red.offset = 8;
212 var->green.offset = 16;
213 var->blue.offset = 24;
214 var->red.length = 8;
215 var->green.length = 8;
216 var->blue.length = 8;
217 var->transp.length = 8;
218 var->transp.offset = 0;
219 break;
220#endif
197 default: 221 default:
198 return -EINVAL; 222 return -EINVAL;
199 } 223 }
@@ -447,10 +471,10 @@ static struct notifier_block paniced = {
447 .notifier_call = radeonfb_panic, 471 .notifier_call = radeonfb_panic,
448}; 472};
449 473
450static int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp) 474static int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool tiled)
451{ 475{
452 int aligned = width; 476 int aligned = width;
453 int align_large = (ASIC_IS_AVIVO(rdev)); 477 int align_large = (ASIC_IS_AVIVO(rdev)) || tiled;
454 int pitch_mask = 0; 478 int pitch_mask = 0;
455 479
456 switch (bpp / 8) { 480 switch (bpp / 8) {
@@ -488,12 +512,13 @@ int radeonfb_create(struct radeon_device *rdev,
488 u64 fb_gpuaddr; 512 u64 fb_gpuaddr;
489 void *fbptr = NULL; 513 void *fbptr = NULL;
490 unsigned long tmp; 514 unsigned long tmp;
515 bool fb_tiled = false; /* useful for testing */
491 516
492 mode_cmd.width = surface_width; 517 mode_cmd.width = surface_width;
493 mode_cmd.height = surface_height; 518 mode_cmd.height = surface_height;
494 mode_cmd.bpp = 32; 519 mode_cmd.bpp = 32;
495 /* need to align pitch with crtc limits */ 520 /* need to align pitch with crtc limits */
496 mode_cmd.pitch = radeon_align_pitch(rdev, mode_cmd.width, mode_cmd.bpp) * ((mode_cmd.bpp + 1) / 8); 521 mode_cmd.pitch = radeon_align_pitch(rdev, mode_cmd.width, mode_cmd.bpp, fb_tiled) * ((mode_cmd.bpp + 1) / 8);
497 mode_cmd.depth = 24; 522 mode_cmd.depth = 24;
498 523
499 size = mode_cmd.pitch * mode_cmd.height; 524 size = mode_cmd.pitch * mode_cmd.height;
@@ -511,6 +536,8 @@ int radeonfb_create(struct radeon_device *rdev,
511 } 536 }
512 robj = gobj->driver_private; 537 robj = gobj->driver_private;
513 538
539 if (fb_tiled)
540 radeon_object_set_tiling_flags(robj, RADEON_TILING_MACRO|RADEON_TILING_SURFACE, mode_cmd.pitch);
514 mutex_lock(&rdev->ddev->struct_mutex); 541 mutex_lock(&rdev->ddev->struct_mutex);
515 fb = radeon_framebuffer_create(rdev->ddev, &mode_cmd, gobj); 542 fb = radeon_framebuffer_create(rdev->ddev, &mode_cmd, gobj);
516 if (fb == NULL) { 543 if (fb == NULL) {
@@ -539,6 +566,9 @@ int radeonfb_create(struct radeon_device *rdev,
539 } 566 }
540 rfbdev = info->par; 567 rfbdev = info->par;
541 568
569 if (fb_tiled)
570 radeon_object_check_tiling(robj, 0, 0);
571
542 ret = radeon_object_kmap(robj, &fbptr); 572 ret = radeon_object_kmap(robj, &fbptr);
543 if (ret) { 573 if (ret) {
544 goto out_unref; 574 goto out_unref;
@@ -572,6 +602,11 @@ int radeonfb_create(struct radeon_device *rdev,
572 info->var.width = -1; 602 info->var.width = -1;
573 info->var.xres = fb_width; 603 info->var.xres = fb_width;
574 info->var.yres = fb_height; 604 info->var.yres = fb_height;
605
606 /* setup aperture base/size for vesafb takeover */
607 info->aperture_base = rdev->ddev->mode_config.fb_base;
608 info->aperture_size = rdev->mc.real_vram_size;
609
575 info->fix.mmio_start = 0; 610 info->fix.mmio_start = 0;
576 info->fix.mmio_len = 0; 611 info->fix.mmio_len = 0;
577 info->pixmap.size = 64*1024; 612 info->pixmap.size = 64*1024;
@@ -600,6 +635,7 @@ int radeonfb_create(struct radeon_device *rdev,
600 info->var.transp.offset = 0; 635 info->var.transp.offset = 0;
601 info->var.transp.length = 0; 636 info->var.transp.length = 0;
602 break; 637 break;
638#ifdef __LITTLE_ENDIAN
603 case 15: 639 case 15:
604 info->var.red.offset = 10; 640 info->var.red.offset = 10;
605 info->var.green.offset = 5; 641 info->var.green.offset = 5;
@@ -639,7 +675,29 @@ int radeonfb_create(struct radeon_device *rdev,
639 info->var.transp.offset = 24; 675 info->var.transp.offset = 24;
640 info->var.transp.length = 8; 676 info->var.transp.length = 8;
641 break; 677 break;
678#else
679 case 24:
680 info->var.red.offset = 8;
681 info->var.green.offset = 16;
682 info->var.blue.offset = 24;
683 info->var.red.length = 8;
684 info->var.green.length = 8;
685 info->var.blue.length = 8;
686 info->var.transp.offset = 0;
687 info->var.transp.length = 0;
688 break;
689 case 32:
690 info->var.red.offset = 8;
691 info->var.green.offset = 16;
692 info->var.blue.offset = 24;
693 info->var.red.length = 8;
694 info->var.green.length = 8;
695 info->var.blue.length = 8;
696 info->var.transp.offset = 0;
697 info->var.transp.length = 8;
698 break;
642 default: 699 default:
700#endif
643 break; 701 break;
644 } 702 }
645 703
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 96afbf5ae2ad..b4e48dd2e859 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -195,7 +195,7 @@ retry:
195 r = wait_event_interruptible_timeout(rdev->fence_drv.queue, 195 r = wait_event_interruptible_timeout(rdev->fence_drv.queue,
196 radeon_fence_signaled(fence), timeout); 196 radeon_fence_signaled(fence), timeout);
197 if (unlikely(r == -ERESTARTSYS)) { 197 if (unlikely(r == -ERESTARTSYS)) {
198 return -ERESTART; 198 return -EBUSY;
199 } 199 }
200 } else { 200 } else {
201 r = wait_event_timeout(rdev->fence_drv.queue, 201 r = wait_event_timeout(rdev->fence_drv.queue,
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index d343a15316ec..2977539880fb 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -177,7 +177,7 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
177 return -ENOMEM; 177 return -ENOMEM;
178 } 178 }
179 rdev->gart.pages[p] = pagelist[i]; 179 rdev->gart.pages[p] = pagelist[i];
180 page_base = (uint32_t)rdev->gart.pages_addr[p]; 180 page_base = rdev->gart.pages_addr[p];
181 for (j = 0; j < (PAGE_SIZE / 4096); j++, t++) { 181 for (j = 0; j < (PAGE_SIZE / 4096); j++, t++) {
182 radeon_gart_set_page(rdev, t, page_base); 182 radeon_gart_set_page(rdev, t, page_base);
183 page_base += 4096; 183 page_base += 4096;
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index eb516034235d..cded5180c752 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -157,9 +157,9 @@ int radeon_gem_info_ioctl(struct drm_device *dev, void *data,
157 struct radeon_device *rdev = dev->dev_private; 157 struct radeon_device *rdev = dev->dev_private;
158 struct drm_radeon_gem_info *args = data; 158 struct drm_radeon_gem_info *args = data;
159 159
160 args->vram_size = rdev->mc.vram_size; 160 args->vram_size = rdev->mc.real_vram_size;
161 /* FIXME: report somethings that makes sense */ 161 /* FIXME: report somethings that makes sense */
162 args->vram_visible = rdev->mc.vram_size - (4 * 1024 * 1024); 162 args->vram_visible = rdev->mc.real_vram_size - (4 * 1024 * 1024);
163 args->gart_size = rdev->mc.gtt_size; 163 args->gart_size = rdev->mc.gtt_size;
164 return 0; 164 return 0;
165} 165}
@@ -285,3 +285,44 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
285 mutex_unlock(&dev->struct_mutex); 285 mutex_unlock(&dev->struct_mutex);
286 return r; 286 return r;
287} 287}
288
289int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data,
290 struct drm_file *filp)
291{
292 struct drm_radeon_gem_set_tiling *args = data;
293 struct drm_gem_object *gobj;
294 struct radeon_object *robj;
295 int r = 0;
296
297 DRM_DEBUG("%d \n", args->handle);
298 gobj = drm_gem_object_lookup(dev, filp, args->handle);
299 if (gobj == NULL)
300 return -EINVAL;
301 robj = gobj->driver_private;
302 radeon_object_set_tiling_flags(robj, args->tiling_flags, args->pitch);
303 mutex_lock(&dev->struct_mutex);
304 drm_gem_object_unreference(gobj);
305 mutex_unlock(&dev->struct_mutex);
306 return r;
307}
308
309int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data,
310 struct drm_file *filp)
311{
312 struct drm_radeon_gem_get_tiling *args = data;
313 struct drm_gem_object *gobj;
314 struct radeon_object *robj;
315 int r = 0;
316
317 DRM_DEBUG("\n");
318 gobj = drm_gem_object_lookup(dev, filp, args->handle);
319 if (gobj == NULL)
320 return -EINVAL;
321 robj = gobj->driver_private;
322 radeon_object_get_tiling_flags(robj, &args->tiling_flags,
323 &args->pitch);
324 mutex_lock(&dev->struct_mutex);
325 drm_gem_object_unreference(gobj);
326 mutex_unlock(&dev->struct_mutex);
327 return r;
328}
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 4612a7c146d1..937a2f1cdb46 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -291,5 +291,7 @@ struct drm_ioctl_desc radeon_ioctls_kms[] = {
291 DRM_IOCTL_DEF(DRM_RADEON_GEM_WAIT_IDLE, radeon_gem_wait_idle_ioctl, DRM_AUTH), 291 DRM_IOCTL_DEF(DRM_RADEON_GEM_WAIT_IDLE, radeon_gem_wait_idle_ioctl, DRM_AUTH),
292 DRM_IOCTL_DEF(DRM_RADEON_CS, radeon_cs_ioctl, DRM_AUTH), 292 DRM_IOCTL_DEF(DRM_RADEON_CS, radeon_cs_ioctl, DRM_AUTH),
293 DRM_IOCTL_DEF(DRM_RADEON_INFO, radeon_info_ioctl, DRM_AUTH), 293 DRM_IOCTL_DEF(DRM_RADEON_INFO, radeon_info_ioctl, DRM_AUTH),
294 DRM_IOCTL_DEF(DRM_RADEON_GEM_SET_TILING, radeon_gem_set_tiling_ioctl, DRM_AUTH),
295 DRM_IOCTL_DEF(DRM_RADEON_GEM_GET_TILING, radeon_gem_get_tiling_ioctl, DRM_AUTH),
294}; 296};
295int radeon_max_kms_ioctl = DRM_ARRAY_SIZE(radeon_ioctls_kms); 297int radeon_max_kms_ioctl = DRM_ARRAY_SIZE(radeon_ioctls_kms);
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 8086ecf7f03d..7d06dc98a42a 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -29,6 +29,171 @@
29#include "radeon_fixed.h" 29#include "radeon_fixed.h"
30#include "radeon.h" 30#include "radeon.h"
31 31
32static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
33 struct drm_display_mode *mode,
34 struct drm_display_mode *adjusted_mode)
35{
36 struct drm_device *dev = crtc->dev;
37 struct radeon_device *rdev = dev->dev_private;
38 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
39 int xres = mode->hdisplay;
40 int yres = mode->vdisplay;
41 bool hscale = true, vscale = true;
42 int hsync_wid;
43 int vsync_wid;
44 int hsync_start;
45 int blank_width;
46 u32 scale, inc, crtc_more_cntl;
47 u32 fp_horz_stretch, fp_vert_stretch, fp_horz_vert_active;
48 u32 fp_h_sync_strt_wid, fp_crtc_h_total_disp;
49 u32 fp_v_sync_strt_wid, fp_crtc_v_total_disp;
50 struct radeon_native_mode *native_mode = &radeon_crtc->native_mode;
51
52 fp_vert_stretch = RREG32(RADEON_FP_VERT_STRETCH) &
53 (RADEON_VERT_STRETCH_RESERVED |
54 RADEON_VERT_AUTO_RATIO_INC);
55 fp_horz_stretch = RREG32(RADEON_FP_HORZ_STRETCH) &
56 (RADEON_HORZ_FP_LOOP_STRETCH |
57 RADEON_HORZ_AUTO_RATIO_INC);
58
59 crtc_more_cntl = 0;
60 if ((rdev->family == CHIP_RS100) ||
61 (rdev->family == CHIP_RS200)) {
62 /* This is to workaround the asic bug for RMX, some versions
63 of BIOS dosen't have this register initialized correctly. */
64 crtc_more_cntl |= RADEON_CRTC_H_CUTOFF_ACTIVE_EN;
65 }
66
67
68 fp_crtc_h_total_disp = ((((mode->crtc_htotal / 8) - 1) & 0x3ff)
69 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
70
71 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
72 if (!hsync_wid)
73 hsync_wid = 1;
74 hsync_start = mode->crtc_hsync_start - 8;
75
76 fp_h_sync_strt_wid = ((hsync_start & 0x1fff)
77 | ((hsync_wid & 0x3f) << 16)
78 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
79 ? RADEON_CRTC_H_SYNC_POL
80 : 0));
81
82 fp_crtc_v_total_disp = (((mode->crtc_vtotal - 1) & 0xffff)
83 | ((mode->crtc_vdisplay - 1) << 16));
84
85 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
86 if (!vsync_wid)
87 vsync_wid = 1;
88
89 fp_v_sync_strt_wid = (((mode->crtc_vsync_start - 1) & 0xfff)
90 | ((vsync_wid & 0x1f) << 16)
91 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
92 ? RADEON_CRTC_V_SYNC_POL
93 : 0));
94
95 fp_horz_vert_active = 0;
96
97 if (native_mode->panel_xres == 0 ||
98 native_mode->panel_yres == 0) {
99 hscale = false;
100 vscale = false;
101 } else {
102 if (xres > native_mode->panel_xres)
103 xres = native_mode->panel_xres;
104 if (yres > native_mode->panel_yres)
105 yres = native_mode->panel_yres;
106
107 if (xres == native_mode->panel_xres)
108 hscale = false;
109 if (yres == native_mode->panel_yres)
110 vscale = false;
111 }
112
113 switch (radeon_crtc->rmx_type) {
114 case RMX_FULL:
115 case RMX_ASPECT:
116 if (!hscale)
117 fp_horz_stretch |= ((xres/8-1) << 16);
118 else {
119 inc = (fp_horz_stretch & RADEON_HORZ_AUTO_RATIO_INC) ? 1 : 0;
120 scale = ((xres + inc) * RADEON_HORZ_STRETCH_RATIO_MAX)
121 / native_mode->panel_xres + 1;
122 fp_horz_stretch |= (((scale) & RADEON_HORZ_STRETCH_RATIO_MASK) |
123 RADEON_HORZ_STRETCH_BLEND |
124 RADEON_HORZ_STRETCH_ENABLE |
125 ((native_mode->panel_xres/8-1) << 16));
126 }
127
128 if (!vscale)
129 fp_vert_stretch |= ((yres-1) << 12);
130 else {
131 inc = (fp_vert_stretch & RADEON_VERT_AUTO_RATIO_INC) ? 1 : 0;
132 scale = ((yres + inc) * RADEON_VERT_STRETCH_RATIO_MAX)
133 / native_mode->panel_yres + 1;
134 fp_vert_stretch |= (((scale) & RADEON_VERT_STRETCH_RATIO_MASK) |
135 RADEON_VERT_STRETCH_ENABLE |
136 RADEON_VERT_STRETCH_BLEND |
137 ((native_mode->panel_yres-1) << 12));
138 }
139 break;
140 case RMX_CENTER:
141 fp_horz_stretch |= ((xres/8-1) << 16);
142 fp_vert_stretch |= ((yres-1) << 12);
143
144 crtc_more_cntl |= (RADEON_CRTC_AUTO_HORZ_CENTER_EN |
145 RADEON_CRTC_AUTO_VERT_CENTER_EN);
146
147 blank_width = (mode->crtc_hblank_end - mode->crtc_hblank_start) / 8;
148 if (blank_width > 110)
149 blank_width = 110;
150
151 fp_crtc_h_total_disp = (((blank_width) & 0x3ff)
152 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
153
154 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
155 if (!hsync_wid)
156 hsync_wid = 1;
157
158 fp_h_sync_strt_wid = ((((mode->crtc_hsync_start - mode->crtc_hblank_start) / 8) & 0x1fff)
159 | ((hsync_wid & 0x3f) << 16)
160 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
161 ? RADEON_CRTC_H_SYNC_POL
162 : 0));
163
164 fp_crtc_v_total_disp = (((mode->crtc_vblank_end - mode->crtc_vblank_start) & 0xffff)
165 | ((mode->crtc_vdisplay - 1) << 16));
166
167 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
168 if (!vsync_wid)
169 vsync_wid = 1;
170
171 fp_v_sync_strt_wid = ((((mode->crtc_vsync_start - mode->crtc_vblank_start) & 0xfff)
172 | ((vsync_wid & 0x1f) << 16)
173 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
174 ? RADEON_CRTC_V_SYNC_POL
175 : 0)));
176
177 fp_horz_vert_active = (((native_mode->panel_yres) & 0xfff) |
178 (((native_mode->panel_xres / 8) & 0x1ff) << 16));
179 break;
180 case RMX_OFF:
181 default:
182 fp_horz_stretch |= ((xres/8-1) << 16);
183 fp_vert_stretch |= ((yres-1) << 12);
184 break;
185 }
186
187 WREG32(RADEON_FP_HORZ_STRETCH, fp_horz_stretch);
188 WREG32(RADEON_FP_VERT_STRETCH, fp_vert_stretch);
189 WREG32(RADEON_CRTC_MORE_CNTL, crtc_more_cntl);
190 WREG32(RADEON_FP_HORZ_VERT_ACTIVE, fp_horz_vert_active);
191 WREG32(RADEON_FP_H_SYNC_STRT_WID, fp_h_sync_strt_wid);
192 WREG32(RADEON_FP_V_SYNC_STRT_WID, fp_v_sync_strt_wid);
193 WREG32(RADEON_FP_CRTC_H_TOTAL_DISP, fp_crtc_h_total_disp);
194 WREG32(RADEON_FP_CRTC_V_TOTAL_DISP, fp_crtc_v_total_disp);
195}
196
32void radeon_restore_common_regs(struct drm_device *dev) 197void radeon_restore_common_regs(struct drm_device *dev)
33{ 198{
34 /* don't need this yet */ 199 /* don't need this yet */
@@ -235,6 +400,7 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
235 uint64_t base; 400 uint64_t base;
236 uint32_t crtc_offset, crtc_offset_cntl, crtc_tile_x0_y0 = 0; 401 uint32_t crtc_offset, crtc_offset_cntl, crtc_tile_x0_y0 = 0;
237 uint32_t crtc_pitch, pitch_pixels; 402 uint32_t crtc_pitch, pitch_pixels;
403 uint32_t tiling_flags;
238 404
239 DRM_DEBUG("\n"); 405 DRM_DEBUG("\n");
240 406
@@ -244,7 +410,12 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
244 if (radeon_gem_object_pin(obj, RADEON_GEM_DOMAIN_VRAM, &base)) { 410 if (radeon_gem_object_pin(obj, RADEON_GEM_DOMAIN_VRAM, &base)) {
245 return -EINVAL; 411 return -EINVAL;
246 } 412 }
247 crtc_offset = (u32)base; 413 /* if scanout was in GTT this really wouldn't work */
414 /* crtc offset is from display base addr not FB location */
415 radeon_crtc->legacy_display_base_addr = rdev->mc.vram_location;
416
417 base -= radeon_crtc->legacy_display_base_addr;
418
248 crtc_offset_cntl = 0; 419 crtc_offset_cntl = 0;
249 420
250 pitch_pixels = crtc->fb->pitch / (crtc->fb->bits_per_pixel / 8); 421 pitch_pixels = crtc->fb->pitch / (crtc->fb->bits_per_pixel / 8);
@@ -253,8 +424,12 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
253 (crtc->fb->bits_per_pixel * 8)); 424 (crtc->fb->bits_per_pixel * 8));
254 crtc_pitch |= crtc_pitch << 16; 425 crtc_pitch |= crtc_pitch << 16;
255 426
256 /* TODO tiling */ 427 radeon_object_get_tiling_flags(obj->driver_private,
257 if (0) { 428 &tiling_flags, NULL);
429 if (tiling_flags & RADEON_TILING_MICRO)
430 DRM_ERROR("trying to scanout microtiled buffer\n");
431
432 if (tiling_flags & RADEON_TILING_MACRO) {
258 if (ASIC_IS_R300(rdev)) 433 if (ASIC_IS_R300(rdev))
259 crtc_offset_cntl |= (R300_CRTC_X_Y_MODE_EN | 434 crtc_offset_cntl |= (R300_CRTC_X_Y_MODE_EN |
260 R300_CRTC_MICRO_TILE_BUFFER_DIS | 435 R300_CRTC_MICRO_TILE_BUFFER_DIS |
@@ -270,15 +445,13 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
270 crtc_offset_cntl &= ~RADEON_CRTC_TILE_EN; 445 crtc_offset_cntl &= ~RADEON_CRTC_TILE_EN;
271 } 446 }
272 447
273 448 if (tiling_flags & RADEON_TILING_MACRO) {
274 /* TODO more tiling */
275 if (0) {
276 if (ASIC_IS_R300(rdev)) { 449 if (ASIC_IS_R300(rdev)) {
277 crtc_tile_x0_y0 = x | (y << 16); 450 crtc_tile_x0_y0 = x | (y << 16);
278 base &= ~0x7ff; 451 base &= ~0x7ff;
279 } else { 452 } else {
280 int byteshift = crtc->fb->bits_per_pixel >> 4; 453 int byteshift = crtc->fb->bits_per_pixel >> 4;
281 int tile_addr = (((y >> 3) * crtc->fb->width + x) >> (8 - byteshift)) << 11; 454 int tile_addr = (((y >> 3) * pitch_pixels + x) >> (8 - byteshift)) << 11;
282 base += tile_addr + ((x << byteshift) % 256) + ((y % 8) << 8); 455 base += tile_addr + ((x << byteshift) % 256) + ((y % 8) << 8);
283 crtc_offset_cntl |= (y % 16); 456 crtc_offset_cntl |= (y % 16);
284 } 457 }
@@ -303,11 +476,9 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
303 476
304 base &= ~7; 477 base &= ~7;
305 478
306 /* update sarea TODO */
307
308 crtc_offset = (u32)base; 479 crtc_offset = (u32)base;
309 480
310 WREG32(RADEON_DISPLAY_BASE_ADDR + radeon_crtc->crtc_offset, rdev->mc.vram_location); 481 WREG32(RADEON_DISPLAY_BASE_ADDR + radeon_crtc->crtc_offset, radeon_crtc->legacy_display_base_addr);
311 482
312 if (ASIC_IS_R300(rdev)) { 483 if (ASIC_IS_R300(rdev)) {
313 if (radeon_crtc->crtc_id) 484 if (radeon_crtc->crtc_id)
@@ -751,6 +922,8 @@ static bool radeon_crtc_mode_fixup(struct drm_crtc *crtc,
751 struct drm_display_mode *mode, 922 struct drm_display_mode *mode,
752 struct drm_display_mode *adjusted_mode) 923 struct drm_display_mode *adjusted_mode)
753{ 924{
925 if (!radeon_crtc_scaling_mode_fixup(crtc, mode, adjusted_mode))
926 return false;
754 return true; 927 return true;
755} 928}
756 929
@@ -759,16 +932,25 @@ static int radeon_crtc_mode_set(struct drm_crtc *crtc,
759 struct drm_display_mode *adjusted_mode, 932 struct drm_display_mode *adjusted_mode,
760 int x, int y, struct drm_framebuffer *old_fb) 933 int x, int y, struct drm_framebuffer *old_fb)
761{ 934{
762 935 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
763 DRM_DEBUG("\n"); 936 struct drm_device *dev = crtc->dev;
937 struct radeon_device *rdev = dev->dev_private;
764 938
765 /* TODO TV */ 939 /* TODO TV */
766
767 radeon_crtc_set_base(crtc, x, y, old_fb); 940 radeon_crtc_set_base(crtc, x, y, old_fb);
768 radeon_set_crtc_timing(crtc, adjusted_mode); 941 radeon_set_crtc_timing(crtc, adjusted_mode);
769 radeon_set_pll(crtc, adjusted_mode); 942 radeon_set_pll(crtc, adjusted_mode);
770 radeon_init_disp_bandwidth(crtc->dev); 943 radeon_bandwidth_update(rdev);
771 944 if (radeon_crtc->crtc_id == 0) {
945 radeon_legacy_rmx_mode_set(crtc, mode, adjusted_mode);
946 } else {
947 if (radeon_crtc->rmx_type != RMX_OFF) {
948 /* FIXME: only first crtc has rmx what should we
949 * do ?
950 */
951 DRM_ERROR("Mode need scaling but only first crtc can do that.\n");
952 }
953 }
772 return 0; 954 return 0;
773} 955}
774 956
@@ -799,478 +981,3 @@ void radeon_legacy_init_crtc(struct drm_device *dev,
799 radeon_crtc->crtc_offset = RADEON_CRTC2_H_TOTAL_DISP - RADEON_CRTC_H_TOTAL_DISP; 981 radeon_crtc->crtc_offset = RADEON_CRTC2_H_TOTAL_DISP - RADEON_CRTC_H_TOTAL_DISP;
800 drm_crtc_helper_add(&radeon_crtc->base, &legacy_helper_funcs); 982 drm_crtc_helper_add(&radeon_crtc->base, &legacy_helper_funcs);
801} 983}
802
803void radeon_init_disp_bw_legacy(struct drm_device *dev,
804 struct drm_display_mode *mode1,
805 uint32_t pixel_bytes1,
806 struct drm_display_mode *mode2,
807 uint32_t pixel_bytes2)
808{
809 struct radeon_device *rdev = dev->dev_private;
810 fixed20_12 trcd_ff, trp_ff, tras_ff, trbs_ff, tcas_ff;
811 fixed20_12 sclk_ff, mclk_ff, sclk_eff_ff, sclk_delay_ff;
812 fixed20_12 peak_disp_bw, mem_bw, pix_clk, pix_clk2, temp_ff, crit_point_ff;
813 uint32_t temp, data, mem_trcd, mem_trp, mem_tras;
814 fixed20_12 memtcas_ff[8] = {
815 fixed_init(1),
816 fixed_init(2),
817 fixed_init(3),
818 fixed_init(0),
819 fixed_init_half(1),
820 fixed_init_half(2),
821 fixed_init(0),
822 };
823 fixed20_12 memtcas_rs480_ff[8] = {
824 fixed_init(0),
825 fixed_init(1),
826 fixed_init(2),
827 fixed_init(3),
828 fixed_init(0),
829 fixed_init_half(1),
830 fixed_init_half(2),
831 fixed_init_half(3),
832 };
833 fixed20_12 memtcas2_ff[8] = {
834 fixed_init(0),
835 fixed_init(1),
836 fixed_init(2),
837 fixed_init(3),
838 fixed_init(4),
839 fixed_init(5),
840 fixed_init(6),
841 fixed_init(7),
842 };
843 fixed20_12 memtrbs[8] = {
844 fixed_init(1),
845 fixed_init_half(1),
846 fixed_init(2),
847 fixed_init_half(2),
848 fixed_init(3),
849 fixed_init_half(3),
850 fixed_init(4),
851 fixed_init_half(4)
852 };
853 fixed20_12 memtrbs_r4xx[8] = {
854 fixed_init(4),
855 fixed_init(5),
856 fixed_init(6),
857 fixed_init(7),
858 fixed_init(8),
859 fixed_init(9),
860 fixed_init(10),
861 fixed_init(11)
862 };
863 fixed20_12 min_mem_eff;
864 fixed20_12 mc_latency_sclk, mc_latency_mclk, k1;
865 fixed20_12 cur_latency_mclk, cur_latency_sclk;
866 fixed20_12 disp_latency, disp_latency_overhead, disp_drain_rate,
867 disp_drain_rate2, read_return_rate;
868 fixed20_12 time_disp1_drop_priority;
869 int c;
870 int cur_size = 16; /* in octawords */
871 int critical_point = 0, critical_point2;
872/* uint32_t read_return_rate, time_disp1_drop_priority; */
873 int stop_req, max_stop_req;
874
875 min_mem_eff.full = rfixed_const_8(0);
876 /* get modes */
877 if ((rdev->disp_priority == 2) && ASIC_IS_R300(rdev)) {
878 uint32_t mc_init_misc_lat_timer = RREG32(R300_MC_INIT_MISC_LAT_TIMER);
879 mc_init_misc_lat_timer &= ~(R300_MC_DISP1R_INIT_LAT_MASK << R300_MC_DISP1R_INIT_LAT_SHIFT);
880 mc_init_misc_lat_timer &= ~(R300_MC_DISP0R_INIT_LAT_MASK << R300_MC_DISP0R_INIT_LAT_SHIFT);
881 /* check crtc enables */
882 if (mode2)
883 mc_init_misc_lat_timer |= (1 << R300_MC_DISP1R_INIT_LAT_SHIFT);
884 if (mode1)
885 mc_init_misc_lat_timer |= (1 << R300_MC_DISP0R_INIT_LAT_SHIFT);
886 WREG32(R300_MC_INIT_MISC_LAT_TIMER, mc_init_misc_lat_timer);
887 }
888
889 /*
890 * determine is there is enough bw for current mode
891 */
892 mclk_ff.full = rfixed_const(rdev->clock.default_mclk);
893 temp_ff.full = rfixed_const(100);
894 mclk_ff.full = rfixed_div(mclk_ff, temp_ff);
895 sclk_ff.full = rfixed_const(rdev->clock.default_sclk);
896 sclk_ff.full = rfixed_div(sclk_ff, temp_ff);
897
898 temp = (rdev->mc.vram_width / 8) * (rdev->mc.vram_is_ddr ? 2 : 1);
899 temp_ff.full = rfixed_const(temp);
900 mem_bw.full = rfixed_mul(mclk_ff, temp_ff);
901
902 pix_clk.full = 0;
903 pix_clk2.full = 0;
904 peak_disp_bw.full = 0;
905 if (mode1) {
906 temp_ff.full = rfixed_const(1000);
907 pix_clk.full = rfixed_const(mode1->clock); /* convert to fixed point */
908 pix_clk.full = rfixed_div(pix_clk, temp_ff);
909 temp_ff.full = rfixed_const(pixel_bytes1);
910 peak_disp_bw.full += rfixed_mul(pix_clk, temp_ff);
911 }
912 if (mode2) {
913 temp_ff.full = rfixed_const(1000);
914 pix_clk2.full = rfixed_const(mode2->clock); /* convert to fixed point */
915 pix_clk2.full = rfixed_div(pix_clk2, temp_ff);
916 temp_ff.full = rfixed_const(pixel_bytes2);
917 peak_disp_bw.full += rfixed_mul(pix_clk2, temp_ff);
918 }
919
920 mem_bw.full = rfixed_mul(mem_bw, min_mem_eff);
921 if (peak_disp_bw.full >= mem_bw.full) {
922 DRM_ERROR("You may not have enough display bandwidth for current mode\n"
923 "If you have flickering problem, try to lower resolution, refresh rate, or color depth\n");
924 }
925
926 /* Get values from the EXT_MEM_CNTL register...converting its contents. */
927 temp = RREG32(RADEON_MEM_TIMING_CNTL);
928 if ((rdev->family == CHIP_RV100) || (rdev->flags & RADEON_IS_IGP)) { /* RV100, M6, IGPs */
929 mem_trcd = ((temp >> 2) & 0x3) + 1;
930 mem_trp = ((temp & 0x3)) + 1;
931 mem_tras = ((temp & 0x70) >> 4) + 1;
932 } else if (rdev->family == CHIP_R300 ||
933 rdev->family == CHIP_R350) { /* r300, r350 */
934 mem_trcd = (temp & 0x7) + 1;
935 mem_trp = ((temp >> 8) & 0x7) + 1;
936 mem_tras = ((temp >> 11) & 0xf) + 4;
937 } else if (rdev->family == CHIP_RV350 ||
938 rdev->family <= CHIP_RV380) {
939 /* rv3x0 */
940 mem_trcd = (temp & 0x7) + 3;
941 mem_trp = ((temp >> 8) & 0x7) + 3;
942 mem_tras = ((temp >> 11) & 0xf) + 6;
943 } else if (rdev->family == CHIP_R420 ||
944 rdev->family == CHIP_R423 ||
945 rdev->family == CHIP_RV410) {
946 /* r4xx */
947 mem_trcd = (temp & 0xf) + 3;
948 if (mem_trcd > 15)
949 mem_trcd = 15;
950 mem_trp = ((temp >> 8) & 0xf) + 3;
951 if (mem_trp > 15)
952 mem_trp = 15;
953 mem_tras = ((temp >> 12) & 0x1f) + 6;
954 if (mem_tras > 31)
955 mem_tras = 31;
956 } else { /* RV200, R200 */
957 mem_trcd = (temp & 0x7) + 1;
958 mem_trp = ((temp >> 8) & 0x7) + 1;
959 mem_tras = ((temp >> 12) & 0xf) + 4;
960 }
961 /* convert to FF */
962 trcd_ff.full = rfixed_const(mem_trcd);
963 trp_ff.full = rfixed_const(mem_trp);
964 tras_ff.full = rfixed_const(mem_tras);
965
966 /* Get values from the MEM_SDRAM_MODE_REG register...converting its */
967 temp = RREG32(RADEON_MEM_SDRAM_MODE_REG);
968 data = (temp & (7 << 20)) >> 20;
969 if ((rdev->family == CHIP_RV100) || rdev->flags & RADEON_IS_IGP) {
970 if (rdev->family == CHIP_RS480) /* don't think rs400 */
971 tcas_ff = memtcas_rs480_ff[data];
972 else
973 tcas_ff = memtcas_ff[data];
974 } else
975 tcas_ff = memtcas2_ff[data];
976
977 if (rdev->family == CHIP_RS400 ||
978 rdev->family == CHIP_RS480) {
979 /* extra cas latency stored in bits 23-25 0-4 clocks */
980 data = (temp >> 23) & 0x7;
981 if (data < 5)
982 tcas_ff.full += rfixed_const(data);
983 }
984
985 if (ASIC_IS_R300(rdev) && !(rdev->flags & RADEON_IS_IGP)) {
986 /* on the R300, Tcas is included in Trbs.
987 */
988 temp = RREG32(RADEON_MEM_CNTL);
989 data = (R300_MEM_NUM_CHANNELS_MASK & temp);
990 if (data == 1) {
991 if (R300_MEM_USE_CD_CH_ONLY & temp) {
992 temp = RREG32(R300_MC_IND_INDEX);
993 temp &= ~R300_MC_IND_ADDR_MASK;
994 temp |= R300_MC_READ_CNTL_CD_mcind;
995 WREG32(R300_MC_IND_INDEX, temp);
996 temp = RREG32(R300_MC_IND_DATA);
997 data = (R300_MEM_RBS_POSITION_C_MASK & temp);
998 } else {
999 temp = RREG32(R300_MC_READ_CNTL_AB);
1000 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
1001 }
1002 } else {
1003 temp = RREG32(R300_MC_READ_CNTL_AB);
1004 data = (R300_MEM_RBS_POSITION_A_MASK & temp);
1005 }
1006 if (rdev->family == CHIP_RV410 ||
1007 rdev->family == CHIP_R420 ||
1008 rdev->family == CHIP_R423)
1009 trbs_ff = memtrbs_r4xx[data];
1010 else
1011 trbs_ff = memtrbs[data];
1012 tcas_ff.full += trbs_ff.full;
1013 }
1014
1015 sclk_eff_ff.full = sclk_ff.full;
1016
1017 if (rdev->flags & RADEON_IS_AGP) {
1018 fixed20_12 agpmode_ff;
1019 agpmode_ff.full = rfixed_const(radeon_agpmode);
1020 temp_ff.full = rfixed_const_666(16);
1021 sclk_eff_ff.full -= rfixed_mul(agpmode_ff, temp_ff);
1022 }
1023 /* TODO PCIE lanes may affect this - agpmode == 16?? */
1024
1025 if (ASIC_IS_R300(rdev)) {
1026 sclk_delay_ff.full = rfixed_const(250);
1027 } else {
1028 if ((rdev->family == CHIP_RV100) ||
1029 rdev->flags & RADEON_IS_IGP) {
1030 if (rdev->mc.vram_is_ddr)
1031 sclk_delay_ff.full = rfixed_const(41);
1032 else
1033 sclk_delay_ff.full = rfixed_const(33);
1034 } else {
1035 if (rdev->mc.vram_width == 128)
1036 sclk_delay_ff.full = rfixed_const(57);
1037 else
1038 sclk_delay_ff.full = rfixed_const(41);
1039 }
1040 }
1041
1042 mc_latency_sclk.full = rfixed_div(sclk_delay_ff, sclk_eff_ff);
1043
1044 if (rdev->mc.vram_is_ddr) {
1045 if (rdev->mc.vram_width == 32) {
1046 k1.full = rfixed_const(40);
1047 c = 3;
1048 } else {
1049 k1.full = rfixed_const(20);
1050 c = 1;
1051 }
1052 } else {
1053 k1.full = rfixed_const(40);
1054 c = 3;
1055 }
1056
1057 temp_ff.full = rfixed_const(2);
1058 mc_latency_mclk.full = rfixed_mul(trcd_ff, temp_ff);
1059 temp_ff.full = rfixed_const(c);
1060 mc_latency_mclk.full += rfixed_mul(tcas_ff, temp_ff);
1061 temp_ff.full = rfixed_const(4);
1062 mc_latency_mclk.full += rfixed_mul(tras_ff, temp_ff);
1063 mc_latency_mclk.full += rfixed_mul(trp_ff, temp_ff);
1064 mc_latency_mclk.full += k1.full;
1065
1066 mc_latency_mclk.full = rfixed_div(mc_latency_mclk, mclk_ff);
1067 mc_latency_mclk.full += rfixed_div(temp_ff, sclk_eff_ff);
1068
1069 /*
1070 HW cursor time assuming worst case of full size colour cursor.
1071 */
1072 temp_ff.full = rfixed_const((2 * (cur_size - (rdev->mc.vram_is_ddr + 1))));
1073 temp_ff.full += trcd_ff.full;
1074 if (temp_ff.full < tras_ff.full)
1075 temp_ff.full = tras_ff.full;
1076 cur_latency_mclk.full = rfixed_div(temp_ff, mclk_ff);
1077
1078 temp_ff.full = rfixed_const(cur_size);
1079 cur_latency_sclk.full = rfixed_div(temp_ff, sclk_eff_ff);
1080 /*
1081 Find the total latency for the display data.
1082 */
1083 disp_latency_overhead.full = rfixed_const(80);
1084 disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff);
1085 mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full;
1086 mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full;
1087
1088 if (mc_latency_mclk.full > mc_latency_sclk.full)
1089 disp_latency.full = mc_latency_mclk.full;
1090 else
1091 disp_latency.full = mc_latency_sclk.full;
1092
1093 /* setup Max GRPH_STOP_REQ default value */
1094 if (ASIC_IS_RV100(rdev))
1095 max_stop_req = 0x5c;
1096 else
1097 max_stop_req = 0x7c;
1098
1099 if (mode1) {
1100 /* CRTC1
1101 Set GRPH_BUFFER_CNTL register using h/w defined optimal values.
1102 GRPH_STOP_REQ <= MIN[ 0x7C, (CRTC_H_DISP + 1) * (bit depth) / 0x10 ]
1103 */
1104 stop_req = mode1->hdisplay * pixel_bytes1 / 16;
1105
1106 if (stop_req > max_stop_req)
1107 stop_req = max_stop_req;
1108
1109 /*
1110 Find the drain rate of the display buffer.
1111 */
1112 temp_ff.full = rfixed_const((16/pixel_bytes1));
1113 disp_drain_rate.full = rfixed_div(pix_clk, temp_ff);
1114
1115 /*
1116 Find the critical point of the display buffer.
1117 */
1118 crit_point_ff.full = rfixed_mul(disp_drain_rate, disp_latency);
1119 crit_point_ff.full += rfixed_const_half(0);
1120
1121 critical_point = rfixed_trunc(crit_point_ff);
1122
1123 if (rdev->disp_priority == 2) {
1124 critical_point = 0;
1125 }
1126
1127 /*
1128 The critical point should never be above max_stop_req-4. Setting
1129 GRPH_CRITICAL_CNTL = 0 will thus force high priority all the time.
1130 */
1131 if (max_stop_req - critical_point < 4)
1132 critical_point = 0;
1133
1134 if (critical_point == 0 && mode2 && rdev->family == CHIP_R300) {
1135 /* some R300 cards have problem with this set to 0, when CRTC2 is enabled.*/
1136 critical_point = 0x10;
1137 }
1138
1139 temp = RREG32(RADEON_GRPH_BUFFER_CNTL);
1140 temp &= ~(RADEON_GRPH_STOP_REQ_MASK);
1141 temp |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
1142 temp &= ~(RADEON_GRPH_START_REQ_MASK);
1143 if ((rdev->family == CHIP_R350) &&
1144 (stop_req > 0x15)) {
1145 stop_req -= 0x10;
1146 }
1147 temp |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
1148 temp |= RADEON_GRPH_BUFFER_SIZE;
1149 temp &= ~(RADEON_GRPH_CRITICAL_CNTL |
1150 RADEON_GRPH_CRITICAL_AT_SOF |
1151 RADEON_GRPH_STOP_CNTL);
1152 /*
1153 Write the result into the register.
1154 */
1155 WREG32(RADEON_GRPH_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
1156 (critical_point << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
1157
1158#if 0
1159 if ((rdev->family == CHIP_RS400) ||
1160 (rdev->family == CHIP_RS480)) {
1161 /* attempt to program RS400 disp regs correctly ??? */
1162 temp = RREG32(RS400_DISP1_REG_CNTL);
1163 temp &= ~(RS400_DISP1_START_REQ_LEVEL_MASK |
1164 RS400_DISP1_STOP_REQ_LEVEL_MASK);
1165 WREG32(RS400_DISP1_REQ_CNTL1, (temp |
1166 (critical_point << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
1167 (critical_point << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
1168 temp = RREG32(RS400_DMIF_MEM_CNTL1);
1169 temp &= ~(RS400_DISP1_CRITICAL_POINT_START_MASK |
1170 RS400_DISP1_CRITICAL_POINT_STOP_MASK);
1171 WREG32(RS400_DMIF_MEM_CNTL1, (temp |
1172 (critical_point << RS400_DISP1_CRITICAL_POINT_START_SHIFT) |
1173 (critical_point << RS400_DISP1_CRITICAL_POINT_STOP_SHIFT)));
1174 }
1175#endif
1176
1177 DRM_DEBUG("GRPH_BUFFER_CNTL from to %x\n",
1178 /* (unsigned int)info->SavedReg->grph_buffer_cntl, */
1179 (unsigned int)RREG32(RADEON_GRPH_BUFFER_CNTL));
1180 }
1181
1182 if (mode2) {
1183 u32 grph2_cntl;
1184 stop_req = mode2->hdisplay * pixel_bytes2 / 16;
1185
1186 if (stop_req > max_stop_req)
1187 stop_req = max_stop_req;
1188
1189 /*
1190 Find the drain rate of the display buffer.
1191 */
1192 temp_ff.full = rfixed_const((16/pixel_bytes2));
1193 disp_drain_rate2.full = rfixed_div(pix_clk2, temp_ff);
1194
1195 grph2_cntl = RREG32(RADEON_GRPH2_BUFFER_CNTL);
1196 grph2_cntl &= ~(RADEON_GRPH_STOP_REQ_MASK);
1197 grph2_cntl |= (stop_req << RADEON_GRPH_STOP_REQ_SHIFT);
1198 grph2_cntl &= ~(RADEON_GRPH_START_REQ_MASK);
1199 if ((rdev->family == CHIP_R350) &&
1200 (stop_req > 0x15)) {
1201 stop_req -= 0x10;
1202 }
1203 grph2_cntl |= (stop_req << RADEON_GRPH_START_REQ_SHIFT);
1204 grph2_cntl |= RADEON_GRPH_BUFFER_SIZE;
1205 grph2_cntl &= ~(RADEON_GRPH_CRITICAL_CNTL |
1206 RADEON_GRPH_CRITICAL_AT_SOF |
1207 RADEON_GRPH_STOP_CNTL);
1208
1209 if ((rdev->family == CHIP_RS100) ||
1210 (rdev->family == CHIP_RS200))
1211 critical_point2 = 0;
1212 else {
1213 temp = (rdev->mc.vram_width * rdev->mc.vram_is_ddr + 1)/128;
1214 temp_ff.full = rfixed_const(temp);
1215 temp_ff.full = rfixed_mul(mclk_ff, temp_ff);
1216 if (sclk_ff.full < temp_ff.full)
1217 temp_ff.full = sclk_ff.full;
1218
1219 read_return_rate.full = temp_ff.full;
1220
1221 if (mode1) {
1222 temp_ff.full = read_return_rate.full - disp_drain_rate.full;
1223 time_disp1_drop_priority.full = rfixed_div(crit_point_ff, temp_ff);
1224 } else {
1225 time_disp1_drop_priority.full = 0;
1226 }
1227 crit_point_ff.full = disp_latency.full + time_disp1_drop_priority.full + disp_latency.full;
1228 crit_point_ff.full = rfixed_mul(crit_point_ff, disp_drain_rate2);
1229 crit_point_ff.full += rfixed_const_half(0);
1230
1231 critical_point2 = rfixed_trunc(crit_point_ff);
1232
1233 if (rdev->disp_priority == 2) {
1234 critical_point2 = 0;
1235 }
1236
1237 if (max_stop_req - critical_point2 < 4)
1238 critical_point2 = 0;
1239
1240 }
1241
1242 if (critical_point2 == 0 && rdev->family == CHIP_R300) {
1243 /* some R300 cards have problem with this set to 0 */
1244 critical_point2 = 0x10;
1245 }
1246
1247 WREG32(RADEON_GRPH2_BUFFER_CNTL, ((grph2_cntl & ~RADEON_GRPH_CRITICAL_POINT_MASK) |
1248 (critical_point2 << RADEON_GRPH_CRITICAL_POINT_SHIFT)));
1249
1250 if ((rdev->family == CHIP_RS400) ||
1251 (rdev->family == CHIP_RS480)) {
1252#if 0
1253 /* attempt to program RS400 disp2 regs correctly ??? */
1254 temp = RREG32(RS400_DISP2_REQ_CNTL1);
1255 temp &= ~(RS400_DISP2_START_REQ_LEVEL_MASK |
1256 RS400_DISP2_STOP_REQ_LEVEL_MASK);
1257 WREG32(RS400_DISP2_REQ_CNTL1, (temp |
1258 (critical_point2 << RS400_DISP1_START_REQ_LEVEL_SHIFT) |
1259 (critical_point2 << RS400_DISP1_STOP_REQ_LEVEL_SHIFT)));
1260 temp = RREG32(RS400_DISP2_REQ_CNTL2);
1261 temp &= ~(RS400_DISP2_CRITICAL_POINT_START_MASK |
1262 RS400_DISP2_CRITICAL_POINT_STOP_MASK);
1263 WREG32(RS400_DISP2_REQ_CNTL2, (temp |
1264 (critical_point2 << RS400_DISP2_CRITICAL_POINT_START_SHIFT) |
1265 (critical_point2 << RS400_DISP2_CRITICAL_POINT_STOP_SHIFT)));
1266#endif
1267 WREG32(RS400_DISP2_REQ_CNTL1, 0x105DC1CC);
1268 WREG32(RS400_DISP2_REQ_CNTL2, 0x2749D000);
1269 WREG32(RS400_DMIF_MEM_CNTL1, 0x29CA71DC);
1270 WREG32(RS400_DISP1_REQ_CNTL1, 0x28FBC3AC);
1271 }
1272
1273 DRM_DEBUG("GRPH2_BUFFER_CNTL from to %x\n",
1274 (unsigned int)RREG32(RADEON_GRPH2_BUFFER_CNTL));
1275 }
1276}
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 2c2f42de1d4c..34d0f58eb944 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -30,170 +30,6 @@
30#include "atom.h" 30#include "atom.h"
31 31
32 32
33static void radeon_legacy_rmx_mode_set(struct drm_encoder *encoder,
34 struct drm_display_mode *mode,
35 struct drm_display_mode *adjusted_mode)
36{
37 struct drm_device *dev = encoder->dev;
38 struct radeon_device *rdev = dev->dev_private;
39 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
40 int xres = mode->hdisplay;
41 int yres = mode->vdisplay;
42 bool hscale = true, vscale = true;
43 int hsync_wid;
44 int vsync_wid;
45 int hsync_start;
46 uint32_t scale, inc;
47 uint32_t fp_horz_stretch, fp_vert_stretch, crtc_more_cntl, fp_horz_vert_active;
48 uint32_t fp_h_sync_strt_wid, fp_v_sync_strt_wid, fp_crtc_h_total_disp, fp_crtc_v_total_disp;
49 struct radeon_native_mode *native_mode = &radeon_encoder->native_mode;
50
51 DRM_DEBUG("\n");
52
53 fp_vert_stretch = RREG32(RADEON_FP_VERT_STRETCH) &
54 (RADEON_VERT_STRETCH_RESERVED |
55 RADEON_VERT_AUTO_RATIO_INC);
56 fp_horz_stretch = RREG32(RADEON_FP_HORZ_STRETCH) &
57 (RADEON_HORZ_FP_LOOP_STRETCH |
58 RADEON_HORZ_AUTO_RATIO_INC);
59
60 crtc_more_cntl = 0;
61 if ((rdev->family == CHIP_RS100) ||
62 (rdev->family == CHIP_RS200)) {
63 /* This is to workaround the asic bug for RMX, some versions
64 of BIOS dosen't have this register initialized correctly. */
65 crtc_more_cntl |= RADEON_CRTC_H_CUTOFF_ACTIVE_EN;
66 }
67
68
69 fp_crtc_h_total_disp = ((((mode->crtc_htotal / 8) - 1) & 0x3ff)
70 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
71
72 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
73 if (!hsync_wid)
74 hsync_wid = 1;
75 hsync_start = mode->crtc_hsync_start - 8;
76
77 fp_h_sync_strt_wid = ((hsync_start & 0x1fff)
78 | ((hsync_wid & 0x3f) << 16)
79 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
80 ? RADEON_CRTC_H_SYNC_POL
81 : 0));
82
83 fp_crtc_v_total_disp = (((mode->crtc_vtotal - 1) & 0xffff)
84 | ((mode->crtc_vdisplay - 1) << 16));
85
86 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
87 if (!vsync_wid)
88 vsync_wid = 1;
89
90 fp_v_sync_strt_wid = (((mode->crtc_vsync_start - 1) & 0xfff)
91 | ((vsync_wid & 0x1f) << 16)
92 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
93 ? RADEON_CRTC_V_SYNC_POL
94 : 0));
95
96 fp_horz_vert_active = 0;
97
98 if (native_mode->panel_xres == 0 ||
99 native_mode->panel_yres == 0) {
100 hscale = false;
101 vscale = false;
102 } else {
103 if (xres > native_mode->panel_xres)
104 xres = native_mode->panel_xres;
105 if (yres > native_mode->panel_yres)
106 yres = native_mode->panel_yres;
107
108 if (xres == native_mode->panel_xres)
109 hscale = false;
110 if (yres == native_mode->panel_yres)
111 vscale = false;
112 }
113
114 if (radeon_encoder->flags & RADEON_USE_RMX) {
115 if (radeon_encoder->rmx_type != RMX_CENTER) {
116 if (!hscale)
117 fp_horz_stretch |= ((xres/8-1) << 16);
118 else {
119 inc = (fp_horz_stretch & RADEON_HORZ_AUTO_RATIO_INC) ? 1 : 0;
120 scale = ((xres + inc) * RADEON_HORZ_STRETCH_RATIO_MAX)
121 / native_mode->panel_xres + 1;
122 fp_horz_stretch |= (((scale) & RADEON_HORZ_STRETCH_RATIO_MASK) |
123 RADEON_HORZ_STRETCH_BLEND |
124 RADEON_HORZ_STRETCH_ENABLE |
125 ((native_mode->panel_xres/8-1) << 16));
126 }
127
128 if (!vscale)
129 fp_vert_stretch |= ((yres-1) << 12);
130 else {
131 inc = (fp_vert_stretch & RADEON_VERT_AUTO_RATIO_INC) ? 1 : 0;
132 scale = ((yres + inc) * RADEON_VERT_STRETCH_RATIO_MAX)
133 / native_mode->panel_yres + 1;
134 fp_vert_stretch |= (((scale) & RADEON_VERT_STRETCH_RATIO_MASK) |
135 RADEON_VERT_STRETCH_ENABLE |
136 RADEON_VERT_STRETCH_BLEND |
137 ((native_mode->panel_yres-1) << 12));
138 }
139 } else if (radeon_encoder->rmx_type == RMX_CENTER) {
140 int blank_width;
141
142 fp_horz_stretch |= ((xres/8-1) << 16);
143 fp_vert_stretch |= ((yres-1) << 12);
144
145 crtc_more_cntl |= (RADEON_CRTC_AUTO_HORZ_CENTER_EN |
146 RADEON_CRTC_AUTO_VERT_CENTER_EN);
147
148 blank_width = (mode->crtc_hblank_end - mode->crtc_hblank_start) / 8;
149 if (blank_width > 110)
150 blank_width = 110;
151
152 fp_crtc_h_total_disp = (((blank_width) & 0x3ff)
153 | ((((mode->crtc_hdisplay / 8) - 1) & 0x1ff) << 16));
154
155 hsync_wid = (mode->crtc_hsync_end - mode->crtc_hsync_start) / 8;
156 if (!hsync_wid)
157 hsync_wid = 1;
158
159 fp_h_sync_strt_wid = ((((mode->crtc_hsync_start - mode->crtc_hblank_start) / 8) & 0x1fff)
160 | ((hsync_wid & 0x3f) << 16)
161 | ((mode->flags & DRM_MODE_FLAG_NHSYNC)
162 ? RADEON_CRTC_H_SYNC_POL
163 : 0));
164
165 fp_crtc_v_total_disp = (((mode->crtc_vblank_end - mode->crtc_vblank_start) & 0xffff)
166 | ((mode->crtc_vdisplay - 1) << 16));
167
168 vsync_wid = mode->crtc_vsync_end - mode->crtc_vsync_start;
169 if (!vsync_wid)
170 vsync_wid = 1;
171
172 fp_v_sync_strt_wid = ((((mode->crtc_vsync_start - mode->crtc_vblank_start) & 0xfff)
173 | ((vsync_wid & 0x1f) << 16)
174 | ((mode->flags & DRM_MODE_FLAG_NVSYNC)
175 ? RADEON_CRTC_V_SYNC_POL
176 : 0)));
177
178 fp_horz_vert_active = (((native_mode->panel_yres) & 0xfff) |
179 (((native_mode->panel_xres / 8) & 0x1ff) << 16));
180 }
181 } else {
182 fp_horz_stretch |= ((xres/8-1) << 16);
183 fp_vert_stretch |= ((yres-1) << 12);
184 }
185
186 WREG32(RADEON_FP_HORZ_STRETCH, fp_horz_stretch);
187 WREG32(RADEON_FP_VERT_STRETCH, fp_vert_stretch);
188 WREG32(RADEON_CRTC_MORE_CNTL, crtc_more_cntl);
189 WREG32(RADEON_FP_HORZ_VERT_ACTIVE, fp_horz_vert_active);
190 WREG32(RADEON_FP_H_SYNC_STRT_WID, fp_h_sync_strt_wid);
191 WREG32(RADEON_FP_V_SYNC_STRT_WID, fp_v_sync_strt_wid);
192 WREG32(RADEON_FP_CRTC_H_TOTAL_DISP, fp_crtc_h_total_disp);
193 WREG32(RADEON_FP_CRTC_V_TOTAL_DISP, fp_crtc_v_total_disp);
194
195}
196
197static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode) 33static void radeon_legacy_lvds_dpms(struct drm_encoder *encoder, int mode)
198{ 34{
199 struct drm_device *dev = encoder->dev; 35 struct drm_device *dev = encoder->dev;
@@ -287,9 +123,6 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
287 123
288 DRM_DEBUG("\n"); 124 DRM_DEBUG("\n");
289 125
290 if (radeon_crtc->crtc_id == 0)
291 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
292
293 lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL); 126 lvds_pll_cntl = RREG32(RADEON_LVDS_PLL_CNTL);
294 lvds_pll_cntl &= ~RADEON_LVDS_PLL_EN; 127 lvds_pll_cntl &= ~RADEON_LVDS_PLL_EN;
295 128
@@ -318,7 +151,7 @@ static void radeon_legacy_lvds_mode_set(struct drm_encoder *encoder,
318 151
319 if (radeon_crtc->crtc_id == 0) { 152 if (radeon_crtc->crtc_id == 0) {
320 if (ASIC_IS_R300(rdev)) { 153 if (ASIC_IS_R300(rdev)) {
321 if (radeon_encoder->flags & RADEON_USE_RMX) 154 if (radeon_encoder->rmx_type != RMX_OFF)
322 lvds_pll_cntl |= R300_LVDS_SRC_SEL_RMX; 155 lvds_pll_cntl |= R300_LVDS_SRC_SEL_RMX;
323 } else 156 } else
324 lvds_gen_cntl &= ~RADEON_LVDS_SEL_CRTC2; 157 lvds_gen_cntl &= ~RADEON_LVDS_SEL_CRTC2;
@@ -350,8 +183,6 @@ static bool radeon_legacy_lvds_mode_fixup(struct drm_encoder *encoder,
350 183
351 drm_mode_set_crtcinfo(adjusted_mode, 0); 184 drm_mode_set_crtcinfo(adjusted_mode, 0);
352 185
353 radeon_encoder->flags &= ~RADEON_USE_RMX;
354
355 if (radeon_encoder->rmx_type != RMX_OFF) 186 if (radeon_encoder->rmx_type != RMX_OFF)
356 radeon_rmx_mode_fixup(encoder, mode, adjusted_mode); 187 radeon_rmx_mode_fixup(encoder, mode, adjusted_mode);
357 188
@@ -455,9 +286,6 @@ static void radeon_legacy_primary_dac_mode_set(struct drm_encoder *encoder,
455 286
456 DRM_DEBUG("\n"); 287 DRM_DEBUG("\n");
457 288
458 if (radeon_crtc->crtc_id == 0)
459 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
460
461 if (radeon_crtc->crtc_id == 0) { 289 if (radeon_crtc->crtc_id == 0) {
462 if (rdev->family == CHIP_R200 || ASIC_IS_R300(rdev)) { 290 if (rdev->family == CHIP_R200 || ASIC_IS_R300(rdev)) {
463 disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL) & 291 disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL) &
@@ -653,9 +481,6 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
653 481
654 DRM_DEBUG("\n"); 482 DRM_DEBUG("\n");
655 483
656 if (radeon_crtc->crtc_id == 0)
657 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
658
659 tmp = tmds_pll_cntl = RREG32(RADEON_TMDS_PLL_CNTL); 484 tmp = tmds_pll_cntl = RREG32(RADEON_TMDS_PLL_CNTL);
660 tmp &= 0xfffff; 485 tmp &= 0xfffff;
661 if (rdev->family == CHIP_RV280) { 486 if (rdev->family == CHIP_RV280) {
@@ -711,7 +536,7 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
711 if (radeon_crtc->crtc_id == 0) { 536 if (radeon_crtc->crtc_id == 0) {
712 if (ASIC_IS_R300(rdev) || rdev->family == CHIP_R200) { 537 if (ASIC_IS_R300(rdev) || rdev->family == CHIP_R200) {
713 fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK; 538 fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK;
714 if (radeon_encoder->flags & RADEON_USE_RMX) 539 if (radeon_encoder->rmx_type != RMX_OFF)
715 fp_gen_cntl |= R200_FP_SOURCE_SEL_RMX; 540 fp_gen_cntl |= R200_FP_SOURCE_SEL_RMX;
716 else 541 else
717 fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1; 542 fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1;
@@ -820,9 +645,6 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
820 645
821 DRM_DEBUG("\n"); 646 DRM_DEBUG("\n");
822 647
823 if (radeon_crtc->crtc_id == 0)
824 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
825
826 if (rdev->is_atom_bios) { 648 if (rdev->is_atom_bios) {
827 radeon_encoder->pixel_clock = adjusted_mode->clock; 649 radeon_encoder->pixel_clock = adjusted_mode->clock;
828 atombios_external_tmds_setup(encoder, ATOM_ENABLE); 650 atombios_external_tmds_setup(encoder, ATOM_ENABLE);
@@ -856,7 +678,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
856 if (radeon_crtc->crtc_id == 0) { 678 if (radeon_crtc->crtc_id == 0) {
857 if ((rdev->family == CHIP_R200) || ASIC_IS_R300(rdev)) { 679 if ((rdev->family == CHIP_R200) || ASIC_IS_R300(rdev)) {
858 fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK; 680 fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK;
859 if (radeon_encoder->flags & RADEON_USE_RMX) 681 if (radeon_encoder->rmx_type != RMX_OFF)
860 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX; 682 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX;
861 else 683 else
862 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC1; 684 fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC1;
@@ -1014,9 +836,6 @@ static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder,
1014 836
1015 DRM_DEBUG("\n"); 837 DRM_DEBUG("\n");
1016 838
1017 if (radeon_crtc->crtc_id == 0)
1018 radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
1019
1020 if (rdev->family != CHIP_R200) { 839 if (rdev->family != CHIP_R200) {
1021 tv_dac_cntl = RREG32(RADEON_TV_DAC_CNTL); 840 tv_dac_cntl = RREG32(RADEON_TV_DAC_CNTL);
1022 if (rdev->family == CHIP_R420 || 841 if (rdev->family == CHIP_R420 ||
@@ -1243,6 +1062,7 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t
1243 1062
1244 radeon_encoder->encoder_id = encoder_id; 1063 radeon_encoder->encoder_id = encoder_id;
1245 radeon_encoder->devices = supported_device; 1064 radeon_encoder->devices = supported_device;
1065 radeon_encoder->rmx_type = RMX_OFF;
1246 1066
1247 switch (radeon_encoder->encoder_id) { 1067 switch (radeon_encoder->encoder_id) {
1248 case ENCODER_OBJECT_ID_INTERNAL_LVDS: 1068 case ENCODER_OBJECT_ID_INTERNAL_LVDS:
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index 9173b687462b..3b09a1f2d8f9 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -36,6 +36,9 @@
36#include <linux/i2c.h> 36#include <linux/i2c.h>
37#include <linux/i2c-id.h> 37#include <linux/i2c-id.h>
38#include <linux/i2c-algo-bit.h> 38#include <linux/i2c-algo-bit.h>
39#include "radeon_fixed.h"
40
41struct radeon_device;
39 42
40#define to_radeon_crtc(x) container_of(x, struct radeon_crtc, base) 43#define to_radeon_crtc(x) container_of(x, struct radeon_crtc, base)
41#define to_radeon_connector(x) container_of(x, struct radeon_connector, base) 44#define to_radeon_connector(x) container_of(x, struct radeon_connector, base)
@@ -124,6 +127,7 @@ struct radeon_tmds_pll {
124#define RADEON_PLL_PREFER_LOW_POST_DIV (1 << 8) 127#define RADEON_PLL_PREFER_LOW_POST_DIV (1 << 8)
125#define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9) 128#define RADEON_PLL_PREFER_HIGH_POST_DIV (1 << 9)
126#define RADEON_PLL_USE_FRAC_FB_DIV (1 << 10) 129#define RADEON_PLL_USE_FRAC_FB_DIV (1 << 10)
130#define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11)
127 131
128struct radeon_pll { 132struct radeon_pll {
129 uint16_t reference_freq; 133 uint16_t reference_freq;
@@ -170,6 +174,18 @@ struct radeon_mode_info {
170 struct atom_context *atom_context; 174 struct atom_context *atom_context;
171 enum radeon_connector_table connector_table; 175 enum radeon_connector_table connector_table;
172 bool mode_config_initialized; 176 bool mode_config_initialized;
177 struct radeon_crtc *crtcs[2];
178};
179
180struct radeon_native_mode {
181 /* preferred mode */
182 uint32_t panel_xres, panel_yres;
183 uint32_t hoverplus, hsync_width;
184 uint32_t hblank;
185 uint32_t voverplus, vsync_width;
186 uint32_t vblank;
187 uint32_t dotclock;
188 uint32_t flags;
173}; 189};
174 190
175struct radeon_crtc { 191struct radeon_crtc {
@@ -185,19 +201,13 @@ struct radeon_crtc {
185 uint64_t cursor_addr; 201 uint64_t cursor_addr;
186 int cursor_width; 202 int cursor_width;
187 int cursor_height; 203 int cursor_height;
188}; 204 uint32_t legacy_display_base_addr;
189 205 uint32_t legacy_cursor_offset;
190#define RADEON_USE_RMX 1 206 enum radeon_rmx_type rmx_type;
191 207 uint32_t devices;
192struct radeon_native_mode { 208 fixed20_12 vsc;
193 /* preferred mode */ 209 fixed20_12 hsc;
194 uint32_t panel_xres, panel_yres; 210 struct radeon_native_mode native_mode;
195 uint32_t hoverplus, hsync_width;
196 uint32_t hblank;
197 uint32_t voverplus, vsync_width;
198 uint32_t vblank;
199 uint32_t dotclock;
200 uint32_t flags;
201}; 211};
202 212
203struct radeon_encoder_primary_dac { 213struct radeon_encoder_primary_dac {
@@ -383,16 +393,9 @@ void radeon_enc_destroy(struct drm_encoder *encoder);
383void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj); 393void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
384void radeon_combios_asic_init(struct drm_device *dev); 394void radeon_combios_asic_init(struct drm_device *dev);
385extern int radeon_static_clocks_init(struct drm_device *dev); 395extern int radeon_static_clocks_init(struct drm_device *dev);
386void radeon_init_disp_bw_legacy(struct drm_device *dev, 396bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
387 struct drm_display_mode *mode1, 397 struct drm_display_mode *mode,
388 uint32_t pixel_bytes1, 398 struct drm_display_mode *adjusted_mode);
389 struct drm_display_mode *mode2, 399void atom_rv515_force_tv_scaler(struct radeon_device *rdev);
390 uint32_t pixel_bytes2);
391void radeon_init_disp_bw_avivo(struct drm_device *dev,
392 struct drm_display_mode *mode1,
393 uint32_t pixel_bytes1,
394 struct drm_display_mode *mode2,
395 uint32_t pixel_bytes2);
396void radeon_init_disp_bandwidth(struct drm_device *dev);
397 400
398#endif 401#endif
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index bac0d06c52ac..dd9ac2fed6d6 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -44,6 +44,9 @@ struct radeon_object {
44 uint64_t gpu_addr; 44 uint64_t gpu_addr;
45 void *kptr; 45 void *kptr;
46 bool is_iomem; 46 bool is_iomem;
47 uint32_t tiling_flags;
48 uint32_t pitch;
49 int surface_reg;
47}; 50};
48 51
49int radeon_ttm_init(struct radeon_device *rdev); 52int radeon_ttm_init(struct radeon_device *rdev);
@@ -70,6 +73,7 @@ static void radeon_ttm_object_object_destroy(struct ttm_buffer_object *tobj)
70 73
71 robj = container_of(tobj, struct radeon_object, tobj); 74 robj = container_of(tobj, struct radeon_object, tobj);
72 list_del_init(&robj->list); 75 list_del_init(&robj->list);
76 radeon_object_clear_surface_reg(robj);
73 kfree(robj); 77 kfree(robj);
74} 78}
75 79
@@ -99,16 +103,16 @@ static inline uint32_t radeon_object_flags_from_domain(uint32_t domain)
99{ 103{
100 uint32_t flags = 0; 104 uint32_t flags = 0;
101 if (domain & RADEON_GEM_DOMAIN_VRAM) { 105 if (domain & RADEON_GEM_DOMAIN_VRAM) {
102 flags |= TTM_PL_FLAG_VRAM; 106 flags |= TTM_PL_FLAG_VRAM | TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED;
103 } 107 }
104 if (domain & RADEON_GEM_DOMAIN_GTT) { 108 if (domain & RADEON_GEM_DOMAIN_GTT) {
105 flags |= TTM_PL_FLAG_TT; 109 flags |= TTM_PL_FLAG_TT | TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED;
106 } 110 }
107 if (domain & RADEON_GEM_DOMAIN_CPU) { 111 if (domain & RADEON_GEM_DOMAIN_CPU) {
108 flags |= TTM_PL_FLAG_SYSTEM; 112 flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING;
109 } 113 }
110 if (!flags) { 114 if (!flags) {
111 flags |= TTM_PL_FLAG_SYSTEM; 115 flags |= TTM_PL_FLAG_SYSTEM | TTM_PL_MASK_CACHING;
112 } 116 }
113 return flags; 117 return flags;
114} 118}
@@ -141,6 +145,7 @@ int radeon_object_create(struct radeon_device *rdev,
141 } 145 }
142 robj->rdev = rdev; 146 robj->rdev = rdev;
143 robj->gobj = gobj; 147 robj->gobj = gobj;
148 robj->surface_reg = -1;
144 INIT_LIST_HEAD(&robj->list); 149 INIT_LIST_HEAD(&robj->list);
145 150
146 flags = radeon_object_flags_from_domain(domain); 151 flags = radeon_object_flags_from_domain(domain);
@@ -304,7 +309,7 @@ int radeon_object_wait(struct radeon_object *robj)
304 } 309 }
305 spin_lock(&robj->tobj.lock); 310 spin_lock(&robj->tobj.lock);
306 if (robj->tobj.sync_obj) { 311 if (robj->tobj.sync_obj) {
307 r = ttm_bo_wait(&robj->tobj, true, false, false); 312 r = ttm_bo_wait(&robj->tobj, true, true, false);
308 } 313 }
309 spin_unlock(&robj->tobj.lock); 314 spin_unlock(&robj->tobj.lock);
310 radeon_object_unreserve(robj); 315 radeon_object_unreserve(robj);
@@ -403,7 +408,6 @@ int radeon_object_list_validate(struct list_head *head, void *fence)
403 struct radeon_object *robj; 408 struct radeon_object *robj;
404 struct radeon_fence *old_fence = NULL; 409 struct radeon_fence *old_fence = NULL;
405 struct list_head *i; 410 struct list_head *i;
406 uint32_t flags;
407 int r; 411 int r;
408 412
409 r = radeon_object_list_reserve(head); 413 r = radeon_object_list_reserve(head);
@@ -414,27 +418,25 @@ int radeon_object_list_validate(struct list_head *head, void *fence)
414 list_for_each(i, head) { 418 list_for_each(i, head) {
415 lobj = list_entry(i, struct radeon_object_list, list); 419 lobj = list_entry(i, struct radeon_object_list, list);
416 robj = lobj->robj; 420 robj = lobj->robj;
417 if (lobj->wdomain) {
418 flags = radeon_object_flags_from_domain(lobj->wdomain);
419 flags |= TTM_PL_FLAG_TT;
420 } else {
421 flags = radeon_object_flags_from_domain(lobj->rdomain);
422 flags |= TTM_PL_FLAG_TT;
423 flags |= TTM_PL_FLAG_VRAM;
424 }
425 if (!robj->pin_count) { 421 if (!robj->pin_count) {
426 robj->tobj.proposed_placement = flags | TTM_PL_MASK_CACHING; 422 if (lobj->wdomain) {
423 robj->tobj.proposed_placement =
424 radeon_object_flags_from_domain(lobj->wdomain);
425 } else {
426 robj->tobj.proposed_placement =
427 radeon_object_flags_from_domain(lobj->rdomain);
428 }
427 r = ttm_buffer_object_validate(&robj->tobj, 429 r = ttm_buffer_object_validate(&robj->tobj,
428 robj->tobj.proposed_placement, 430 robj->tobj.proposed_placement,
429 true, false); 431 true, false);
430 if (unlikely(r)) { 432 if (unlikely(r)) {
431 radeon_object_list_unreserve(head);
432 DRM_ERROR("radeon: failed to validate.\n"); 433 DRM_ERROR("radeon: failed to validate.\n");
433 return r; 434 return r;
434 } 435 }
435 radeon_object_gpu_addr(robj); 436 radeon_object_gpu_addr(robj);
436 } 437 }
437 lobj->gpu_offset = robj->gpu_addr; 438 lobj->gpu_offset = robj->gpu_addr;
439 lobj->tiling_flags = robj->tiling_flags;
438 if (fence) { 440 if (fence) {
439 old_fence = (struct radeon_fence *)robj->tobj.sync_obj; 441 old_fence = (struct radeon_fence *)robj->tobj.sync_obj;
440 robj->tobj.sync_obj = radeon_fence_ref(fence); 442 robj->tobj.sync_obj = radeon_fence_ref(fence);
@@ -479,3 +481,127 @@ unsigned long radeon_object_size(struct radeon_object *robj)
479{ 481{
480 return robj->tobj.num_pages << PAGE_SHIFT; 482 return robj->tobj.num_pages << PAGE_SHIFT;
481} 483}
484
485int radeon_object_get_surface_reg(struct radeon_object *robj)
486{
487 struct radeon_device *rdev = robj->rdev;
488 struct radeon_surface_reg *reg;
489 struct radeon_object *old_object;
490 int steal;
491 int i;
492
493 if (!robj->tiling_flags)
494 return 0;
495
496 if (robj->surface_reg >= 0) {
497 reg = &rdev->surface_regs[robj->surface_reg];
498 i = robj->surface_reg;
499 goto out;
500 }
501
502 steal = -1;
503 for (i = 0; i < RADEON_GEM_MAX_SURFACES; i++) {
504
505 reg = &rdev->surface_regs[i];
506 if (!reg->robj)
507 break;
508
509 old_object = reg->robj;
510 if (old_object->pin_count == 0)
511 steal = i;
512 }
513
514 /* if we are all out */
515 if (i == RADEON_GEM_MAX_SURFACES) {
516 if (steal == -1)
517 return -ENOMEM;
518 /* find someone with a surface reg and nuke their BO */
519 reg = &rdev->surface_regs[steal];
520 old_object = reg->robj;
521 /* blow away the mapping */
522 DRM_DEBUG("stealing surface reg %d from %p\n", steal, old_object);
523 ttm_bo_unmap_virtual(&old_object->tobj);
524 old_object->surface_reg = -1;
525 i = steal;
526 }
527
528 robj->surface_reg = i;
529 reg->robj = robj;
530
531out:
532 radeon_set_surface_reg(rdev, i, robj->tiling_flags, robj->pitch,
533 robj->tobj.mem.mm_node->start << PAGE_SHIFT,
534 robj->tobj.num_pages << PAGE_SHIFT);
535 return 0;
536}
537
538void radeon_object_clear_surface_reg(struct radeon_object *robj)
539{
540 struct radeon_device *rdev = robj->rdev;
541 struct radeon_surface_reg *reg;
542
543 if (robj->surface_reg == -1)
544 return;
545
546 reg = &rdev->surface_regs[robj->surface_reg];
547 radeon_clear_surface_reg(rdev, robj->surface_reg);
548
549 reg->robj = NULL;
550 robj->surface_reg = -1;
551}
552
553void radeon_object_set_tiling_flags(struct radeon_object *robj,
554 uint32_t tiling_flags, uint32_t pitch)
555{
556 robj->tiling_flags = tiling_flags;
557 robj->pitch = pitch;
558}
559
560void radeon_object_get_tiling_flags(struct radeon_object *robj,
561 uint32_t *tiling_flags,
562 uint32_t *pitch)
563{
564 if (tiling_flags)
565 *tiling_flags = robj->tiling_flags;
566 if (pitch)
567 *pitch = robj->pitch;
568}
569
570int radeon_object_check_tiling(struct radeon_object *robj, bool has_moved,
571 bool force_drop)
572{
573 if (!(robj->tiling_flags & RADEON_TILING_SURFACE))
574 return 0;
575
576 if (force_drop) {
577 radeon_object_clear_surface_reg(robj);
578 return 0;
579 }
580
581 if (robj->tobj.mem.mem_type != TTM_PL_VRAM) {
582 if (!has_moved)
583 return 0;
584
585 if (robj->surface_reg >= 0)
586 radeon_object_clear_surface_reg(robj);
587 return 0;
588 }
589
590 if ((robj->surface_reg >= 0) && !has_moved)
591 return 0;
592
593 return radeon_object_get_surface_reg(robj);
594}
595
596void radeon_bo_move_notify(struct ttm_buffer_object *bo,
597 struct ttm_mem_reg *mem)
598{
599 struct radeon_object *robj = container_of(bo, struct radeon_object, tobj);
600 radeon_object_check_tiling(robj, 0, 1);
601}
602
603void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
604{
605 struct radeon_object *robj = container_of(bo, struct radeon_object, tobj);
606 radeon_object_check_tiling(robj, 0, 0);
607}
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index a853261d1881..60d159308b88 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -126,32 +126,19 @@ static void radeon_ib_align(struct radeon_device *rdev, struct radeon_ib *ib)
126 } 126 }
127} 127}
128 128
129static void radeon_ib_cpu_flush(struct radeon_device *rdev,
130 struct radeon_ib *ib)
131{
132 unsigned long tmp;
133 unsigned i;
134
135 /* To force CPU cache flush ugly but seems reliable */
136 for (i = 0; i < ib->length_dw; i += (rdev->cp.align_mask + 1)) {
137 tmp = readl(&ib->ptr[i]);
138 }
139}
140
141int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib) 129int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)
142{ 130{
143 int r = 0; 131 int r = 0;
144 132
145 mutex_lock(&rdev->ib_pool.mutex); 133 mutex_lock(&rdev->ib_pool.mutex);
146 radeon_ib_align(rdev, ib); 134 radeon_ib_align(rdev, ib);
147 radeon_ib_cpu_flush(rdev, ib);
148 if (!ib->length_dw || !rdev->cp.ready) { 135 if (!ib->length_dw || !rdev->cp.ready) {
149 /* TODO: Nothings in the ib we should report. */ 136 /* TODO: Nothings in the ib we should report. */
150 mutex_unlock(&rdev->ib_pool.mutex); 137 mutex_unlock(&rdev->ib_pool.mutex);
151 DRM_ERROR("radeon: couldn't schedule IB(%lu).\n", ib->idx); 138 DRM_ERROR("radeon: couldn't schedule IB(%lu).\n", ib->idx);
152 return -EINVAL; 139 return -EINVAL;
153 } 140 }
154 /* 64 dwords should be enought for fence too */ 141 /* 64 dwords should be enough for fence too */
155 r = radeon_ring_lock(rdev, 64); 142 r = radeon_ring_lock(rdev, 64);
156 if (r) { 143 if (r) {
157 DRM_ERROR("radeon: scheduling IB failled (%d).\n", r); 144 DRM_ERROR("radeon: scheduling IB failled (%d).\n", r);
diff --git a/drivers/gpu/drm/radeon/radeon_share.h b/drivers/gpu/drm/radeon/radeon_share.h
new file mode 100644
index 000000000000..63a773578f17
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_share.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef __RADEON_SHARE_H__
29#define __RADEON_SHARE_H__
30
31void r100_vram_init_sizes(struct radeon_device *rdev);
32
33void rs690_line_buffer_adjust(struct radeon_device *rdev,
34 struct drm_display_mode *mode1,
35 struct drm_display_mode *mode2);
36
37void rv515_bandwidth_avivo_update(struct radeon_device *rdev);
38
39#endif
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c
new file mode 100644
index 000000000000..03c33cf4e14c
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_test.c
@@ -0,0 +1,209 @@
1/*
2 * Copyright 2009 VMware, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Michel Dänzer
23 */
24#include <drm/drmP.h>
25#include <drm/radeon_drm.h>
26#include "radeon_reg.h"
27#include "radeon.h"
28
29
30/* Test BO GTT->VRAM and VRAM->GTT GPU copies across the whole GTT aperture */
31void radeon_test_moves(struct radeon_device *rdev)
32{
33 struct radeon_object *vram_obj = NULL;
34 struct radeon_object **gtt_obj = NULL;
35 struct radeon_fence *fence = NULL;
36 uint64_t gtt_addr, vram_addr;
37 unsigned i, n, size;
38 int r;
39
40 size = 1024 * 1024;
41
42 /* Number of tests =
43 * (Total GTT - IB pool - writeback page - ring buffer) / test size
44 */
45 n = (rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - 4096 -
46 rdev->cp.ring_size) / size;
47
48 gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL);
49 if (!gtt_obj) {
50 DRM_ERROR("Failed to allocate %d pointers\n", n);
51 r = 1;
52 goto out_cleanup;
53 }
54
55 r = radeon_object_create(rdev, NULL, size, true, RADEON_GEM_DOMAIN_VRAM,
56 false, &vram_obj);
57 if (r) {
58 DRM_ERROR("Failed to create VRAM object\n");
59 goto out_cleanup;
60 }
61
62 r = radeon_object_pin(vram_obj, RADEON_GEM_DOMAIN_VRAM, &vram_addr);
63 if (r) {
64 DRM_ERROR("Failed to pin VRAM object\n");
65 goto out_cleanup;
66 }
67
68 for (i = 0; i < n; i++) {
69 void *gtt_map, *vram_map;
70 void **gtt_start, **gtt_end;
71 void **vram_start, **vram_end;
72
73 r = radeon_object_create(rdev, NULL, size, true,
74 RADEON_GEM_DOMAIN_GTT, false, gtt_obj + i);
75 if (r) {
76 DRM_ERROR("Failed to create GTT object %d\n", i);
77 goto out_cleanup;
78 }
79
80 r = radeon_object_pin(gtt_obj[i], RADEON_GEM_DOMAIN_GTT, &gtt_addr);
81 if (r) {
82 DRM_ERROR("Failed to pin GTT object %d\n", i);
83 goto out_cleanup;
84 }
85
86 r = radeon_object_kmap(gtt_obj[i], &gtt_map);
87 if (r) {
88 DRM_ERROR("Failed to map GTT object %d\n", i);
89 goto out_cleanup;
90 }
91
92 for (gtt_start = gtt_map, gtt_end = gtt_map + size;
93 gtt_start < gtt_end;
94 gtt_start++)
95 *gtt_start = gtt_start;
96
97 radeon_object_kunmap(gtt_obj[i]);
98
99 r = radeon_fence_create(rdev, &fence);
100 if (r) {
101 DRM_ERROR("Failed to create GTT->VRAM fence %d\n", i);
102 goto out_cleanup;
103 }
104
105 r = radeon_copy(rdev, gtt_addr, vram_addr, size / 4096, fence);
106 if (r) {
107 DRM_ERROR("Failed GTT->VRAM copy %d\n", i);
108 goto out_cleanup;
109 }
110
111 r = radeon_fence_wait(fence, false);
112 if (r) {
113 DRM_ERROR("Failed to wait for GTT->VRAM fence %d\n", i);
114 goto out_cleanup;
115 }
116
117 radeon_fence_unref(&fence);
118
119 r = radeon_object_kmap(vram_obj, &vram_map);
120 if (r) {
121 DRM_ERROR("Failed to map VRAM object after copy %d\n", i);
122 goto out_cleanup;
123 }
124
125 for (gtt_start = gtt_map, gtt_end = gtt_map + size,
126 vram_start = vram_map, vram_end = vram_map + size;
127 vram_start < vram_end;
128 gtt_start++, vram_start++) {
129 if (*vram_start != gtt_start) {
130 DRM_ERROR("Incorrect GTT->VRAM copy %d: Got 0x%p, "
131 "expected 0x%p (GTT map 0x%p-0x%p)\n",
132 i, *vram_start, gtt_start, gtt_map,
133 gtt_end);
134 radeon_object_kunmap(vram_obj);
135 goto out_cleanup;
136 }
137 *vram_start = vram_start;
138 }
139
140 radeon_object_kunmap(vram_obj);
141
142 r = radeon_fence_create(rdev, &fence);
143 if (r) {
144 DRM_ERROR("Failed to create VRAM->GTT fence %d\n", i);
145 goto out_cleanup;
146 }
147
148 r = radeon_copy(rdev, vram_addr, gtt_addr, size / 4096, fence);
149 if (r) {
150 DRM_ERROR("Failed VRAM->GTT copy %d\n", i);
151 goto out_cleanup;
152 }
153
154 r = radeon_fence_wait(fence, false);
155 if (r) {
156 DRM_ERROR("Failed to wait for VRAM->GTT fence %d\n", i);
157 goto out_cleanup;
158 }
159
160 radeon_fence_unref(&fence);
161
162 r = radeon_object_kmap(gtt_obj[i], &gtt_map);
163 if (r) {
164 DRM_ERROR("Failed to map GTT object after copy %d\n", i);
165 goto out_cleanup;
166 }
167
168 for (gtt_start = gtt_map, gtt_end = gtt_map + size,
169 vram_start = vram_map, vram_end = vram_map + size;
170 gtt_start < gtt_end;
171 gtt_start++, vram_start++) {
172 if (*gtt_start != vram_start) {
173 DRM_ERROR("Incorrect VRAM->GTT copy %d: Got 0x%p, "
174 "expected 0x%p (VRAM map 0x%p-0x%p)\n",
175 i, *gtt_start, vram_start, vram_map,
176 vram_end);
177 radeon_object_kunmap(gtt_obj[i]);
178 goto out_cleanup;
179 }
180 }
181
182 radeon_object_kunmap(gtt_obj[i]);
183
184 DRM_INFO("Tested GTT->VRAM and VRAM->GTT copy for GTT offset 0x%llx\n",
185 gtt_addr - rdev->mc.gtt_location);
186 }
187
188out_cleanup:
189 if (vram_obj) {
190 radeon_object_unpin(vram_obj);
191 radeon_object_unref(&vram_obj);
192 }
193 if (gtt_obj) {
194 for (i = 0; i < n; i++) {
195 if (gtt_obj[i]) {
196 radeon_object_unpin(gtt_obj[i]);
197 radeon_object_unref(&gtt_obj[i]);
198 }
199 }
200 kfree(gtt_obj);
201 }
202 if (fence) {
203 radeon_fence_unref(&fence);
204 }
205 if (r) {
206 printk(KERN_WARNING "Error while testing BO move.\n");
207 }
208}
209
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 1227a97f5169..15c3531377ed 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -355,23 +355,26 @@ static int radeon_bo_move(struct ttm_buffer_object *bo,
355 if (!rdev->cp.ready) { 355 if (!rdev->cp.ready) {
356 /* use memcpy */ 356 /* use memcpy */
357 DRM_ERROR("CP is not ready use memcpy.\n"); 357 DRM_ERROR("CP is not ready use memcpy.\n");
358 return ttm_bo_move_memcpy(bo, evict, no_wait, new_mem); 358 goto memcpy;
359 } 359 }
360 360
361 if (old_mem->mem_type == TTM_PL_VRAM && 361 if (old_mem->mem_type == TTM_PL_VRAM &&
362 new_mem->mem_type == TTM_PL_SYSTEM) { 362 new_mem->mem_type == TTM_PL_SYSTEM) {
363 return radeon_move_vram_ram(bo, evict, interruptible, 363 r = radeon_move_vram_ram(bo, evict, interruptible,
364 no_wait, new_mem); 364 no_wait, new_mem);
365 } else if (old_mem->mem_type == TTM_PL_SYSTEM && 365 } else if (old_mem->mem_type == TTM_PL_SYSTEM &&
366 new_mem->mem_type == TTM_PL_VRAM) { 366 new_mem->mem_type == TTM_PL_VRAM) {
367 return radeon_move_ram_vram(bo, evict, interruptible, 367 r = radeon_move_ram_vram(bo, evict, interruptible,
368 no_wait, new_mem); 368 no_wait, new_mem);
369 } else { 369 } else {
370 r = radeon_move_blit(bo, evict, no_wait, new_mem, old_mem); 370 r = radeon_move_blit(bo, evict, no_wait, new_mem, old_mem);
371 if (unlikely(r)) {
372 return r;
373 }
374 } 371 }
372
373 if (r) {
374memcpy:
375 r = ttm_bo_move_memcpy(bo, evict, no_wait, new_mem);
376 }
377
375 return r; 378 return r;
376} 379}
377 380
@@ -429,6 +432,8 @@ static struct ttm_bo_driver radeon_bo_driver = {
429 .sync_obj_flush = &radeon_sync_obj_flush, 432 .sync_obj_flush = &radeon_sync_obj_flush,
430 .sync_obj_unref = &radeon_sync_obj_unref, 433 .sync_obj_unref = &radeon_sync_obj_unref,
431 .sync_obj_ref = &radeon_sync_obj_ref, 434 .sync_obj_ref = &radeon_sync_obj_ref,
435 .move_notify = &radeon_bo_move_notify,
436 .fault_reserve_notify = &radeon_bo_fault_reserve_notify,
432}; 437};
433 438
434int radeon_ttm_init(struct radeon_device *rdev) 439int radeon_ttm_init(struct radeon_device *rdev)
@@ -442,13 +447,14 @@ int radeon_ttm_init(struct radeon_device *rdev)
442 /* No others user of address space so set it to 0 */ 447 /* No others user of address space so set it to 0 */
443 r = ttm_bo_device_init(&rdev->mman.bdev, 448 r = ttm_bo_device_init(&rdev->mman.bdev,
444 rdev->mman.mem_global_ref.object, 449 rdev->mman.mem_global_ref.object,
445 &radeon_bo_driver, DRM_FILE_PAGE_OFFSET); 450 &radeon_bo_driver, DRM_FILE_PAGE_OFFSET,
451 rdev->need_dma32);
446 if (r) { 452 if (r) {
447 DRM_ERROR("failed initializing buffer object driver(%d).\n", r); 453 DRM_ERROR("failed initializing buffer object driver(%d).\n", r);
448 return r; 454 return r;
449 } 455 }
450 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM, 0, 456 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM, 0,
451 ((rdev->mc.aper_size) >> PAGE_SHIFT)); 457 ((rdev->mc.real_vram_size) >> PAGE_SHIFT));
452 if (r) { 458 if (r) {
453 DRM_ERROR("Failed initializing VRAM heap.\n"); 459 DRM_ERROR("Failed initializing VRAM heap.\n");
454 return r; 460 return r;
@@ -465,7 +471,7 @@ int radeon_ttm_init(struct radeon_device *rdev)
465 return r; 471 return r;
466 } 472 }
467 DRM_INFO("radeon: %uM of VRAM memory ready\n", 473 DRM_INFO("radeon: %uM of VRAM memory ready\n",
468 rdev->mc.vram_size / (1024 * 1024)); 474 rdev->mc.real_vram_size / (1024 * 1024));
469 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT, 0, 475 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT, 0,
470 ((rdev->mc.gtt_size) >> PAGE_SHIFT)); 476 ((rdev->mc.gtt_size) >> PAGE_SHIFT));
471 if (r) { 477 if (r) {
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index cc074b5a8f74..b29affd9c5d8 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -29,6 +29,7 @@
29#include <drm/drmP.h> 29#include <drm/drmP.h>
30#include "radeon_reg.h" 30#include "radeon_reg.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
32 33
33/* rs400,rs480 depends on : */ 34/* rs400,rs480 depends on : */
34void r100_hdp_reset(struct radeon_device *rdev); 35void r100_hdp_reset(struct radeon_device *rdev);
@@ -164,7 +165,9 @@ int rs400_gart_enable(struct radeon_device *rdev)
164 WREG32(RADEON_BUS_CNTL, tmp); 165 WREG32(RADEON_BUS_CNTL, tmp);
165 } 166 }
166 /* Table should be in 32bits address space so ignore bits above. */ 167 /* Table should be in 32bits address space so ignore bits above. */
167 tmp = rdev->gart.table_addr & 0xfffff000; 168 tmp = (u32)rdev->gart.table_addr & 0xfffff000;
169 tmp |= (upper_32_bits(rdev->gart.table_addr) & 0xff) << 4;
170
168 WREG32_MC(RS480_GART_BASE, tmp); 171 WREG32_MC(RS480_GART_BASE, tmp);
169 /* TODO: more tweaking here */ 172 /* TODO: more tweaking here */
170 WREG32_MC(RS480_GART_FEATURE_ID, 173 WREG32_MC(RS480_GART_FEATURE_ID,
@@ -201,10 +204,17 @@ void rs400_gart_disable(struct radeon_device *rdev)
201 204
202int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) 205int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
203{ 206{
207 uint32_t entry;
208
204 if (i < 0 || i > rdev->gart.num_gpu_pages) { 209 if (i < 0 || i > rdev->gart.num_gpu_pages) {
205 return -EINVAL; 210 return -EINVAL;
206 } 211 }
207 rdev->gart.table.ram.ptr[i] = cpu_to_le32(((uint32_t)addr) | 0xC); 212
213 entry = (lower_32_bits(addr) & PAGE_MASK) |
214 ((upper_32_bits(addr) & 0xff) << 4) |
215 0xc;
216 entry = cpu_to_le32(entry);
217 rdev->gart.table.ram.ptr[i] = entry;
208 return 0; 218 return 0;
209} 219}
210 220
@@ -223,10 +233,9 @@ int rs400_mc_init(struct radeon_device *rdev)
223 233
224 rs400_gpu_init(rdev); 234 rs400_gpu_init(rdev);
225 rs400_gart_disable(rdev); 235 rs400_gart_disable(rdev);
226 rdev->mc.gtt_location = rdev->mc.vram_size; 236 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
227 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1); 237 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1);
228 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1); 238 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1);
229 rdev->mc.vram_location = 0xFFFFFFFFUL;
230 r = radeon_mc_setup(rdev); 239 r = radeon_mc_setup(rdev);
231 if (r) { 240 if (r) {
232 return r; 241 return r;
@@ -238,7 +247,7 @@ int rs400_mc_init(struct radeon_device *rdev)
238 "programming pipes. Bad things might happen.\n"); 247 "programming pipes. Bad things might happen.\n");
239 } 248 }
240 249
241 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 250 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
242 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16); 251 tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16);
243 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16); 252 tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16);
244 WREG32(RADEON_MC_FB_LOCATION, tmp); 253 WREG32(RADEON_MC_FB_LOCATION, tmp);
@@ -284,21 +293,12 @@ void rs400_gpu_init(struct radeon_device *rdev)
284 */ 293 */
285void rs400_vram_info(struct radeon_device *rdev) 294void rs400_vram_info(struct radeon_device *rdev)
286{ 295{
287 uint32_t tom;
288
289 rs400_gart_adjust_size(rdev); 296 rs400_gart_adjust_size(rdev);
290 /* DDR for all card after R300 & IGP */ 297 /* DDR for all card after R300 & IGP */
291 rdev->mc.vram_is_ddr = true; 298 rdev->mc.vram_is_ddr = true;
292 rdev->mc.vram_width = 128; 299 rdev->mc.vram_width = 128;
293 300
294 /* read NB_TOM to get the amount of ram stolen for the GPU */ 301 r100_vram_init_sizes(rdev);
295 tom = RREG32(RADEON_NB_TOM);
296 rdev->mc.vram_size = (((tom >> 16) - (tom & 0xffff) + 1) << 16);
297 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size);
298
299 /* Could aper size report 0 ? */
300 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
301 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
302} 302}
303 303
304 304
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index ab0c967553e6..bbea6dee4a94 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -223,7 +223,7 @@ int rs600_mc_init(struct radeon_device *rdev)
223 printk(KERN_WARNING "Failed to wait MC idle while " 223 printk(KERN_WARNING "Failed to wait MC idle while "
224 "programming pipes. Bad things might happen.\n"); 224 "programming pipes. Bad things might happen.\n");
225 } 225 }
226 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 226 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
227 tmp = REG_SET(RS600_MC_FB_TOP, tmp >> 16); 227 tmp = REG_SET(RS600_MC_FB_TOP, tmp >> 16);
228 tmp |= REG_SET(RS600_MC_FB_START, rdev->mc.vram_location >> 16); 228 tmp |= REG_SET(RS600_MC_FB_START, rdev->mc.vram_location >> 16);
229 WREG32_MC(RS600_MC_FB_LOCATION, tmp); 229 WREG32_MC(RS600_MC_FB_LOCATION, tmp);
@@ -301,6 +301,11 @@ void rs600_vram_info(struct radeon_device *rdev)
301 rdev->mc.vram_width = 128; 301 rdev->mc.vram_width = 128;
302} 302}
303 303
304void rs600_bandwidth_update(struct radeon_device *rdev)
305{
306 /* FIXME: implement, should this be like rs690 ? */
307}
308
304 309
305/* 310/*
306 * Indirect registers accessor 311 * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 79ba85042b5f..839595b00728 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -28,6 +28,9 @@
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon_reg.h" 29#include "radeon_reg.h"
30#include "radeon.h" 30#include "radeon.h"
31#include "rs690r.h"
32#include "atom.h"
33#include "atom-bits.h"
31 34
32/* rs690,rs740 depends on : */ 35/* rs690,rs740 depends on : */
33void r100_hdp_reset(struct radeon_device *rdev); 36void r100_hdp_reset(struct radeon_device *rdev);
@@ -64,7 +67,7 @@ int rs690_mc_init(struct radeon_device *rdev)
64 rs400_gart_disable(rdev); 67 rs400_gart_disable(rdev);
65 68
66 /* Setup GPU memory space */ 69 /* Setup GPU memory space */
67 rdev->mc.gtt_location = rdev->mc.vram_size; 70 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
68 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1); 71 rdev->mc.gtt_location += (rdev->mc.gtt_size - 1);
69 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1); 72 rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1);
70 rdev->mc.vram_location = 0xFFFFFFFFUL; 73 rdev->mc.vram_location = 0xFFFFFFFFUL;
@@ -79,7 +82,7 @@ int rs690_mc_init(struct radeon_device *rdev)
79 printk(KERN_WARNING "Failed to wait MC idle while " 82 printk(KERN_WARNING "Failed to wait MC idle while "
80 "programming pipes. Bad things might happen.\n"); 83 "programming pipes. Bad things might happen.\n");
81 } 84 }
82 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 85 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
83 tmp = REG_SET(RS690_MC_FB_TOP, tmp >> 16); 86 tmp = REG_SET(RS690_MC_FB_TOP, tmp >> 16);
84 tmp |= REG_SET(RS690_MC_FB_START, rdev->mc.vram_location >> 16); 87 tmp |= REG_SET(RS690_MC_FB_START, rdev->mc.vram_location >> 16);
85 WREG32_MC(RS690_MCCFG_FB_LOCATION, tmp); 88 WREG32_MC(RS690_MCCFG_FB_LOCATION, tmp);
@@ -138,9 +141,82 @@ void rs690_gpu_init(struct radeon_device *rdev)
138/* 141/*
139 * VRAM info. 142 * VRAM info.
140 */ 143 */
144void rs690_pm_info(struct radeon_device *rdev)
145{
146 int index = GetIndexIntoMasterTable(DATA, IntegratedSystemInfo);
147 struct _ATOM_INTEGRATED_SYSTEM_INFO *info;
148 struct _ATOM_INTEGRATED_SYSTEM_INFO_V2 *info_v2;
149 void *ptr;
150 uint16_t data_offset;
151 uint8_t frev, crev;
152 fixed20_12 tmp;
153
154 atom_parse_data_header(rdev->mode_info.atom_context, index, NULL,
155 &frev, &crev, &data_offset);
156 ptr = rdev->mode_info.atom_context->bios + data_offset;
157 info = (struct _ATOM_INTEGRATED_SYSTEM_INFO *)ptr;
158 info_v2 = (struct _ATOM_INTEGRATED_SYSTEM_INFO_V2 *)ptr;
159 /* Get various system informations from bios */
160 switch (crev) {
161 case 1:
162 tmp.full = rfixed_const(100);
163 rdev->pm.igp_sideport_mclk.full = rfixed_const(info->ulBootUpMemoryClock);
164 rdev->pm.igp_sideport_mclk.full = rfixed_div(rdev->pm.igp_sideport_mclk, tmp);
165 rdev->pm.igp_system_mclk.full = rfixed_const(le16_to_cpu(info->usK8MemoryClock));
166 rdev->pm.igp_ht_link_clk.full = rfixed_const(le16_to_cpu(info->usFSBClock));
167 rdev->pm.igp_ht_link_width.full = rfixed_const(info->ucHTLinkWidth);
168 break;
169 case 2:
170 tmp.full = rfixed_const(100);
171 rdev->pm.igp_sideport_mclk.full = rfixed_const(info_v2->ulBootUpSidePortClock);
172 rdev->pm.igp_sideport_mclk.full = rfixed_div(rdev->pm.igp_sideport_mclk, tmp);
173 rdev->pm.igp_system_mclk.full = rfixed_const(info_v2->ulBootUpUMAClock);
174 rdev->pm.igp_system_mclk.full = rfixed_div(rdev->pm.igp_system_mclk, tmp);
175 rdev->pm.igp_ht_link_clk.full = rfixed_const(info_v2->ulHTLinkFreq);
176 rdev->pm.igp_ht_link_clk.full = rfixed_div(rdev->pm.igp_ht_link_clk, tmp);
177 rdev->pm.igp_ht_link_width.full = rfixed_const(le16_to_cpu(info_v2->usMinHTLinkWidth));
178 break;
179 default:
180 tmp.full = rfixed_const(100);
181 /* We assume the slower possible clock ie worst case */
182 /* DDR 333Mhz */
183 rdev->pm.igp_sideport_mclk.full = rfixed_const(333);
184 /* FIXME: system clock ? */
185 rdev->pm.igp_system_mclk.full = rfixed_const(100);
186 rdev->pm.igp_system_mclk.full = rfixed_div(rdev->pm.igp_system_mclk, tmp);
187 rdev->pm.igp_ht_link_clk.full = rfixed_const(200);
188 rdev->pm.igp_ht_link_width.full = rfixed_const(8);
189 DRM_ERROR("No integrated system info for your GPU, using safe default\n");
190 break;
191 }
192 /* Compute various bandwidth */
193 /* k8_bandwidth = (memory_clk / 2) * 2 * 8 * 0.5 = memory_clk * 4 */
194 tmp.full = rfixed_const(4);
195 rdev->pm.k8_bandwidth.full = rfixed_mul(rdev->pm.igp_system_mclk, tmp);
196 /* ht_bandwidth = ht_clk * 2 * ht_width / 8 * 0.8
197 * = ht_clk * ht_width / 5
198 */
199 tmp.full = rfixed_const(5);
200 rdev->pm.ht_bandwidth.full = rfixed_mul(rdev->pm.igp_ht_link_clk,
201 rdev->pm.igp_ht_link_width);
202 rdev->pm.ht_bandwidth.full = rfixed_div(rdev->pm.ht_bandwidth, tmp);
203 if (tmp.full < rdev->pm.max_bandwidth.full) {
204 /* HT link is a limiting factor */
205 rdev->pm.max_bandwidth.full = tmp.full;
206 }
207 /* sideport_bandwidth = (sideport_clk / 2) * 2 * 2 * 0.7
208 * = (sideport_clk * 14) / 10
209 */
210 tmp.full = rfixed_const(14);
211 rdev->pm.sideport_bandwidth.full = rfixed_mul(rdev->pm.igp_sideport_mclk, tmp);
212 tmp.full = rfixed_const(10);
213 rdev->pm.sideport_bandwidth.full = rfixed_div(rdev->pm.sideport_bandwidth, tmp);
214}
215
141void rs690_vram_info(struct radeon_device *rdev) 216void rs690_vram_info(struct radeon_device *rdev)
142{ 217{
143 uint32_t tmp; 218 uint32_t tmp;
219 fixed20_12 a;
144 220
145 rs400_gart_adjust_size(rdev); 221 rs400_gart_adjust_size(rdev);
146 /* DDR for all card after R300 & IGP */ 222 /* DDR for all card after R300 & IGP */
@@ -152,12 +228,409 @@ void rs690_vram_info(struct radeon_device *rdev)
152 } else { 228 } else {
153 rdev->mc.vram_width = 64; 229 rdev->mc.vram_width = 64;
154 } 230 }
155 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE); 231 rdev->mc.real_vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
232 rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
156 233
157 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 234 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
158 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 235 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
236 rs690_pm_info(rdev);
237 /* FIXME: we should enforce default clock in case GPU is not in
238 * default setup
239 */
240 a.full = rfixed_const(100);
241 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
242 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
243 a.full = rfixed_const(16);
244 /* core_bandwidth = sclk(Mhz) * 16 */
245 rdev->pm.core_bandwidth.full = rfixed_div(rdev->pm.sclk, a);
246}
247
248void rs690_line_buffer_adjust(struct radeon_device *rdev,
249 struct drm_display_mode *mode1,
250 struct drm_display_mode *mode2)
251{
252 u32 tmp;
253
254 /*
255 * Line Buffer Setup
256 * There is a single line buffer shared by both display controllers.
257 * DC_LB_MEMORY_SPLIT controls how that line buffer is shared between
258 * the display controllers. The paritioning can either be done
259 * manually or via one of four preset allocations specified in bits 1:0:
260 * 0 - line buffer is divided in half and shared between crtc
261 * 1 - D1 gets 3/4 of the line buffer, D2 gets 1/4
262 * 2 - D1 gets the whole buffer
263 * 3 - D1 gets 1/4 of the line buffer, D2 gets 3/4
264 * Setting bit 2 of DC_LB_MEMORY_SPLIT controls switches to manual
265 * allocation mode. In manual allocation mode, D1 always starts at 0,
266 * D1 end/2 is specified in bits 14:4; D2 allocation follows D1.
267 */
268 tmp = RREG32(DC_LB_MEMORY_SPLIT) & ~DC_LB_MEMORY_SPLIT_MASK;
269 tmp &= ~DC_LB_MEMORY_SPLIT_SHIFT_MODE;
270 /* auto */
271 if (mode1 && mode2) {
272 if (mode1->hdisplay > mode2->hdisplay) {
273 if (mode1->hdisplay > 2560)
274 tmp |= DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q;
275 else
276 tmp |= DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
277 } else if (mode2->hdisplay > mode1->hdisplay) {
278 if (mode2->hdisplay > 2560)
279 tmp |= DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
280 else
281 tmp |= DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
282 } else
283 tmp |= AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF;
284 } else if (mode1) {
285 tmp |= DC_LB_MEMORY_SPLIT_D1_ONLY;
286 } else if (mode2) {
287 tmp |= DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q;
288 }
289 WREG32(DC_LB_MEMORY_SPLIT, tmp);
159} 290}
160 291
292struct rs690_watermark {
293 u32 lb_request_fifo_depth;
294 fixed20_12 num_line_pair;
295 fixed20_12 estimated_width;
296 fixed20_12 worst_case_latency;
297 fixed20_12 consumption_rate;
298 fixed20_12 active_time;
299 fixed20_12 dbpp;
300 fixed20_12 priority_mark_max;
301 fixed20_12 priority_mark;
302 fixed20_12 sclk;
303};
304
305void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,
306 struct radeon_crtc *crtc,
307 struct rs690_watermark *wm)
308{
309 struct drm_display_mode *mode = &crtc->base.mode;
310 fixed20_12 a, b, c;
311 fixed20_12 pclk, request_fifo_depth, tolerable_latency, estimated_width;
312 fixed20_12 consumption_time, line_time, chunk_time, read_delay_latency;
313 /* FIXME: detect IGP with sideport memory, i don't think there is any
314 * such product available
315 */
316 bool sideport = false;
317
318 if (!crtc->base.enabled) {
319 /* FIXME: wouldn't it better to set priority mark to maximum */
320 wm->lb_request_fifo_depth = 4;
321 return;
322 }
323
324 if (crtc->vsc.full > rfixed_const(2))
325 wm->num_line_pair.full = rfixed_const(2);
326 else
327 wm->num_line_pair.full = rfixed_const(1);
328
329 b.full = rfixed_const(mode->crtc_hdisplay);
330 c.full = rfixed_const(256);
331 a.full = rfixed_mul(wm->num_line_pair, b);
332 request_fifo_depth.full = rfixed_div(a, c);
333 if (a.full < rfixed_const(4)) {
334 wm->lb_request_fifo_depth = 4;
335 } else {
336 wm->lb_request_fifo_depth = rfixed_trunc(request_fifo_depth);
337 }
338
339 /* Determine consumption rate
340 * pclk = pixel clock period(ns) = 1000 / (mode.clock / 1000)
341 * vtaps = number of vertical taps,
342 * vsc = vertical scaling ratio, defined as source/destination
343 * hsc = horizontal scaling ration, defined as source/destination
344 */
345 a.full = rfixed_const(mode->clock);
346 b.full = rfixed_const(1000);
347 a.full = rfixed_div(a, b);
348 pclk.full = rfixed_div(b, a);
349 if (crtc->rmx_type != RMX_OFF) {
350 b.full = rfixed_const(2);
351 if (crtc->vsc.full > b.full)
352 b.full = crtc->vsc.full;
353 b.full = rfixed_mul(b, crtc->hsc);
354 c.full = rfixed_const(2);
355 b.full = rfixed_div(b, c);
356 consumption_time.full = rfixed_div(pclk, b);
357 } else {
358 consumption_time.full = pclk.full;
359 }
360 a.full = rfixed_const(1);
361 wm->consumption_rate.full = rfixed_div(a, consumption_time);
362
363
364 /* Determine line time
365 * LineTime = total time for one line of displayhtotal
366 * LineTime = total number of horizontal pixels
367 * pclk = pixel clock period(ns)
368 */
369 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
370 line_time.full = rfixed_mul(a, pclk);
371
372 /* Determine active time
373 * ActiveTime = time of active region of display within one line,
374 * hactive = total number of horizontal active pixels
375 * htotal = total number of horizontal pixels
376 */
377 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
378 b.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
379 wm->active_time.full = rfixed_mul(line_time, b);
380 wm->active_time.full = rfixed_div(wm->active_time, a);
381
382 /* Maximun bandwidth is the minimun bandwidth of all component */
383 rdev->pm.max_bandwidth = rdev->pm.core_bandwidth;
384 if (sideport) {
385 if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full &&
386 rdev->pm.sideport_bandwidth.full)
387 rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth;
388 read_delay_latency.full = rfixed_const(370 * 800 * 1000);
389 read_delay_latency.full = rfixed_div(read_delay_latency,
390 rdev->pm.igp_sideport_mclk);
391 } else {
392 if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full &&
393 rdev->pm.k8_bandwidth.full)
394 rdev->pm.max_bandwidth = rdev->pm.k8_bandwidth;
395 if (rdev->pm.max_bandwidth.full > rdev->pm.ht_bandwidth.full &&
396 rdev->pm.ht_bandwidth.full)
397 rdev->pm.max_bandwidth = rdev->pm.ht_bandwidth;
398 read_delay_latency.full = rfixed_const(5000);
399 }
400
401 /* sclk = system clocks(ns) = 1000 / max_bandwidth / 16 */
402 a.full = rfixed_const(16);
403 rdev->pm.sclk.full = rfixed_mul(rdev->pm.max_bandwidth, a);
404 a.full = rfixed_const(1000);
405 rdev->pm.sclk.full = rfixed_div(a, rdev->pm.sclk);
406 /* Determine chunk time
407 * ChunkTime = the time it takes the DCP to send one chunk of data
408 * to the LB which consists of pipeline delay and inter chunk gap
409 * sclk = system clock(ns)
410 */
411 a.full = rfixed_const(256 * 13);
412 chunk_time.full = rfixed_mul(rdev->pm.sclk, a);
413 a.full = rfixed_const(10);
414 chunk_time.full = rfixed_div(chunk_time, a);
415
416 /* Determine the worst case latency
417 * NumLinePair = Number of line pairs to request(1=2 lines, 2=4 lines)
418 * WorstCaseLatency = worst case time from urgent to when the MC starts
419 * to return data
420 * READ_DELAY_IDLE_MAX = constant of 1us
421 * ChunkTime = time it takes the DCP to send one chunk of data to the LB
422 * which consists of pipeline delay and inter chunk gap
423 */
424 if (rfixed_trunc(wm->num_line_pair) > 1) {
425 a.full = rfixed_const(3);
426 wm->worst_case_latency.full = rfixed_mul(a, chunk_time);
427 wm->worst_case_latency.full += read_delay_latency.full;
428 } else {
429 a.full = rfixed_const(2);
430 wm->worst_case_latency.full = rfixed_mul(a, chunk_time);
431 wm->worst_case_latency.full += read_delay_latency.full;
432 }
433
434 /* Determine the tolerable latency
435 * TolerableLatency = Any given request has only 1 line time
436 * for the data to be returned
437 * LBRequestFifoDepth = Number of chunk requests the LB can
438 * put into the request FIFO for a display
439 * LineTime = total time for one line of display
440 * ChunkTime = the time it takes the DCP to send one chunk
441 * of data to the LB which consists of
442 * pipeline delay and inter chunk gap
443 */
444 if ((2+wm->lb_request_fifo_depth) >= rfixed_trunc(request_fifo_depth)) {
445 tolerable_latency.full = line_time.full;
446 } else {
447 tolerable_latency.full = rfixed_const(wm->lb_request_fifo_depth - 2);
448 tolerable_latency.full = request_fifo_depth.full - tolerable_latency.full;
449 tolerable_latency.full = rfixed_mul(tolerable_latency, chunk_time);
450 tolerable_latency.full = line_time.full - tolerable_latency.full;
451 }
452 /* We assume worst case 32bits (4 bytes) */
453 wm->dbpp.full = rfixed_const(4 * 8);
454
455 /* Determine the maximum priority mark
456 * width = viewport width in pixels
457 */
458 a.full = rfixed_const(16);
459 wm->priority_mark_max.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
460 wm->priority_mark_max.full = rfixed_div(wm->priority_mark_max, a);
461
462 /* Determine estimated width */
463 estimated_width.full = tolerable_latency.full - wm->worst_case_latency.full;
464 estimated_width.full = rfixed_div(estimated_width, consumption_time);
465 if (rfixed_trunc(estimated_width) > crtc->base.mode.crtc_hdisplay) {
466 wm->priority_mark.full = rfixed_const(10);
467 } else {
468 a.full = rfixed_const(16);
469 wm->priority_mark.full = rfixed_div(estimated_width, a);
470 wm->priority_mark.full = wm->priority_mark_max.full - wm->priority_mark.full;
471 }
472}
473
474void rs690_bandwidth_update(struct radeon_device *rdev)
475{
476 struct drm_display_mode *mode0 = NULL;
477 struct drm_display_mode *mode1 = NULL;
478 struct rs690_watermark wm0;
479 struct rs690_watermark wm1;
480 u32 tmp;
481 fixed20_12 priority_mark02, priority_mark12, fill_rate;
482 fixed20_12 a, b;
483
484 if (rdev->mode_info.crtcs[0]->base.enabled)
485 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
486 if (rdev->mode_info.crtcs[1]->base.enabled)
487 mode1 = &rdev->mode_info.crtcs[1]->base.mode;
488 /*
489 * Set display0/1 priority up in the memory controller for
490 * modes if the user specifies HIGH for displaypriority
491 * option.
492 */
493 if (rdev->disp_priority == 2) {
494 tmp = RREG32_MC(MC_INIT_MISC_LAT_TIMER);
495 tmp &= ~MC_DISP1R_INIT_LAT_MASK;
496 tmp &= ~MC_DISP0R_INIT_LAT_MASK;
497 if (mode1)
498 tmp |= (1 << MC_DISP1R_INIT_LAT_SHIFT);
499 if (mode0)
500 tmp |= (1 << MC_DISP0R_INIT_LAT_SHIFT);
501 WREG32_MC(MC_INIT_MISC_LAT_TIMER, tmp);
502 }
503 rs690_line_buffer_adjust(rdev, mode0, mode1);
504
505 if ((rdev->family == CHIP_RS690) || (rdev->family == CHIP_RS740))
506 WREG32(DCP_CONTROL, 0);
507 if ((rdev->family == CHIP_RS780) || (rdev->family == CHIP_RS880))
508 WREG32(DCP_CONTROL, 2);
509
510 rs690_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[0], &wm0);
511 rs690_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[1], &wm1);
512
513 tmp = (wm0.lb_request_fifo_depth - 1);
514 tmp |= (wm1.lb_request_fifo_depth - 1) << 16;
515 WREG32(LB_MAX_REQ_OUTSTANDING, tmp);
516
517 if (mode0 && mode1) {
518 if (rfixed_trunc(wm0.dbpp) > 64)
519 a.full = rfixed_mul(wm0.dbpp, wm0.num_line_pair);
520 else
521 a.full = wm0.num_line_pair.full;
522 if (rfixed_trunc(wm1.dbpp) > 64)
523 b.full = rfixed_mul(wm1.dbpp, wm1.num_line_pair);
524 else
525 b.full = wm1.num_line_pair.full;
526 a.full += b.full;
527 fill_rate.full = rfixed_div(wm0.sclk, a);
528 if (wm0.consumption_rate.full > fill_rate.full) {
529 b.full = wm0.consumption_rate.full - fill_rate.full;
530 b.full = rfixed_mul(b, wm0.active_time);
531 a.full = rfixed_mul(wm0.worst_case_latency,
532 wm0.consumption_rate);
533 a.full = a.full + b.full;
534 b.full = rfixed_const(16 * 1000);
535 priority_mark02.full = rfixed_div(a, b);
536 } else {
537 a.full = rfixed_mul(wm0.worst_case_latency,
538 wm0.consumption_rate);
539 b.full = rfixed_const(16 * 1000);
540 priority_mark02.full = rfixed_div(a, b);
541 }
542 if (wm1.consumption_rate.full > fill_rate.full) {
543 b.full = wm1.consumption_rate.full - fill_rate.full;
544 b.full = rfixed_mul(b, wm1.active_time);
545 a.full = rfixed_mul(wm1.worst_case_latency,
546 wm1.consumption_rate);
547 a.full = a.full + b.full;
548 b.full = rfixed_const(16 * 1000);
549 priority_mark12.full = rfixed_div(a, b);
550 } else {
551 a.full = rfixed_mul(wm1.worst_case_latency,
552 wm1.consumption_rate);
553 b.full = rfixed_const(16 * 1000);
554 priority_mark12.full = rfixed_div(a, b);
555 }
556 if (wm0.priority_mark.full > priority_mark02.full)
557 priority_mark02.full = wm0.priority_mark.full;
558 if (rfixed_trunc(priority_mark02) < 0)
559 priority_mark02.full = 0;
560 if (wm0.priority_mark_max.full > priority_mark02.full)
561 priority_mark02.full = wm0.priority_mark_max.full;
562 if (wm1.priority_mark.full > priority_mark12.full)
563 priority_mark12.full = wm1.priority_mark.full;
564 if (rfixed_trunc(priority_mark12) < 0)
565 priority_mark12.full = 0;
566 if (wm1.priority_mark_max.full > priority_mark12.full)
567 priority_mark12.full = wm1.priority_mark_max.full;
568 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
569 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
570 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
571 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
572 } else if (mode0) {
573 if (rfixed_trunc(wm0.dbpp) > 64)
574 a.full = rfixed_mul(wm0.dbpp, wm0.num_line_pair);
575 else
576 a.full = wm0.num_line_pair.full;
577 fill_rate.full = rfixed_div(wm0.sclk, a);
578 if (wm0.consumption_rate.full > fill_rate.full) {
579 b.full = wm0.consumption_rate.full - fill_rate.full;
580 b.full = rfixed_mul(b, wm0.active_time);
581 a.full = rfixed_mul(wm0.worst_case_latency,
582 wm0.consumption_rate);
583 a.full = a.full + b.full;
584 b.full = rfixed_const(16 * 1000);
585 priority_mark02.full = rfixed_div(a, b);
586 } else {
587 a.full = rfixed_mul(wm0.worst_case_latency,
588 wm0.consumption_rate);
589 b.full = rfixed_const(16 * 1000);
590 priority_mark02.full = rfixed_div(a, b);
591 }
592 if (wm0.priority_mark.full > priority_mark02.full)
593 priority_mark02.full = wm0.priority_mark.full;
594 if (rfixed_trunc(priority_mark02) < 0)
595 priority_mark02.full = 0;
596 if (wm0.priority_mark_max.full > priority_mark02.full)
597 priority_mark02.full = wm0.priority_mark_max.full;
598 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
599 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
600 WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
601 WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
602 } else {
603 if (rfixed_trunc(wm1.dbpp) > 64)
604 a.full = rfixed_mul(wm1.dbpp, wm1.num_line_pair);
605 else
606 a.full = wm1.num_line_pair.full;
607 fill_rate.full = rfixed_div(wm1.sclk, a);
608 if (wm1.consumption_rate.full > fill_rate.full) {
609 b.full = wm1.consumption_rate.full - fill_rate.full;
610 b.full = rfixed_mul(b, wm1.active_time);
611 a.full = rfixed_mul(wm1.worst_case_latency,
612 wm1.consumption_rate);
613 a.full = a.full + b.full;
614 b.full = rfixed_const(16 * 1000);
615 priority_mark12.full = rfixed_div(a, b);
616 } else {
617 a.full = rfixed_mul(wm1.worst_case_latency,
618 wm1.consumption_rate);
619 b.full = rfixed_const(16 * 1000);
620 priority_mark12.full = rfixed_div(a, b);
621 }
622 if (wm1.priority_mark.full > priority_mark12.full)
623 priority_mark12.full = wm1.priority_mark.full;
624 if (rfixed_trunc(priority_mark12) < 0)
625 priority_mark12.full = 0;
626 if (wm1.priority_mark_max.full > priority_mark12.full)
627 priority_mark12.full = wm1.priority_mark_max.full;
628 WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
629 WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
630 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
631 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
632 }
633}
161 634
162/* 635/*
163 * Indirect registers accessor 636 * Indirect registers accessor
diff --git a/drivers/gpu/drm/radeon/rs690r.h b/drivers/gpu/drm/radeon/rs690r.h
new file mode 100644
index 000000000000..c0d9faa2175b
--- /dev/null
+++ b/drivers/gpu/drm/radeon/rs690r.h
@@ -0,0 +1,99 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef RS690R_H
29#define RS690R_H
30
31/* RS690/RS740 registers */
32#define MC_INDEX 0x0078
33# define MC_INDEX_MASK 0x1FF
34# define MC_INDEX_WR_EN (1 << 9)
35# define MC_INDEX_WR_ACK 0x7F
36#define MC_DATA 0x007C
37#define HDP_FB_LOCATION 0x0134
38#define DC_LB_MEMORY_SPLIT 0x6520
39#define DC_LB_MEMORY_SPLIT_MASK 0x00000003
40#define DC_LB_MEMORY_SPLIT_SHIFT 0
41#define DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0
42#define DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1
43#define DC_LB_MEMORY_SPLIT_D1_ONLY 2
44#define DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3
45#define DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2)
46#define DC_LB_DISP1_END_ADR_SHIFT 4
47#define DC_LB_DISP1_END_ADR_MASK 0x00007FF0
48#define D1MODE_PRIORITY_A_CNT 0x6548
49#define MODE_PRIORITY_MARK_MASK 0x00007FFF
50#define MODE_PRIORITY_OFF (1 << 16)
51#define MODE_PRIORITY_ALWAYS_ON (1 << 20)
52#define MODE_PRIORITY_FORCE_MASK (1 << 24)
53#define D1MODE_PRIORITY_B_CNT 0x654C
54#define LB_MAX_REQ_OUTSTANDING 0x6D58
55#define LB_D1_MAX_REQ_OUTSTANDING_MASK 0x0000000F
56#define LB_D1_MAX_REQ_OUTSTANDING_SHIFT 0
57#define LB_D2_MAX_REQ_OUTSTANDING_MASK 0x000F0000
58#define LB_D2_MAX_REQ_OUTSTANDING_SHIFT 16
59#define DCP_CONTROL 0x6C9C
60#define D2MODE_PRIORITY_A_CNT 0x6D48
61#define D2MODE_PRIORITY_B_CNT 0x6D4C
62
63/* MC indirect registers */
64#define MC_STATUS_IDLE (1 << 0)
65#define MC_MISC_CNTL 0x18
66#define DISABLE_GTW (1 << 1)
67#define GART_INDEX_REG_EN (1 << 12)
68#define BLOCK_GFX_D3_EN (1 << 14)
69#define GART_FEATURE_ID 0x2B
70#define HANG_EN (1 << 11)
71#define TLB_ENABLE (1 << 18)
72#define P2P_ENABLE (1 << 19)
73#define GTW_LAC_EN (1 << 25)
74#define LEVEL2_GART (0 << 30)
75#define LEVEL1_GART (1 << 30)
76#define PDC_EN (1 << 31)
77#define GART_BASE 0x2C
78#define GART_CACHE_CNTRL 0x2E
79# define GART_CACHE_INVALIDATE (1 << 0)
80#define MC_STATUS 0x90
81#define MCCFG_FB_LOCATION 0x100
82#define MC_FB_START_MASK 0x0000FFFF
83#define MC_FB_START_SHIFT 0
84#define MC_FB_TOP_MASK 0xFFFF0000
85#define MC_FB_TOP_SHIFT 16
86#define MCCFG_AGP_LOCATION 0x101
87#define MC_AGP_START_MASK 0x0000FFFF
88#define MC_AGP_START_SHIFT 0
89#define MC_AGP_TOP_MASK 0xFFFF0000
90#define MC_AGP_TOP_SHIFT 16
91#define MCCFG_AGP_BASE 0x102
92#define MCCFG_AGP_BASE_2 0x103
93#define MC_INIT_MISC_LAT_TIMER 0x104
94#define MC_DISP0R_INIT_LAT_SHIFT 8
95#define MC_DISP0R_INIT_LAT_MASK 0x00000F00
96#define MC_DISP1R_INIT_LAT_SHIFT 12
97#define MC_DISP1R_INIT_LAT_MASK 0x0000F000
98
99#endif
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index ffea37b1b3e2..551e608702e4 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -27,8 +27,9 @@
27 */ 27 */
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include "drmP.h" 29#include "drmP.h"
30#include "radeon_reg.h" 30#include "rv515r.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
32 33
33/* rv515 depends on : */ 34/* rv515 depends on : */
34void r100_hdp_reset(struct radeon_device *rdev); 35void r100_hdp_reset(struct radeon_device *rdev);
@@ -99,26 +100,26 @@ int rv515_mc_init(struct radeon_device *rdev)
99 "programming pipes. Bad things might happen.\n"); 100 "programming pipes. Bad things might happen.\n");
100 } 101 }
101 /* Write VRAM size in case we are limiting it */ 102 /* Write VRAM size in case we are limiting it */
102 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size); 103 WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size);
103 tmp = REG_SET(RV515_MC_FB_START, rdev->mc.vram_location >> 16); 104 tmp = REG_SET(MC_FB_START, rdev->mc.vram_location >> 16);
104 WREG32(0x134, tmp); 105 WREG32(0x134, tmp);
105 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 106 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
106 tmp = REG_SET(RV515_MC_FB_TOP, tmp >> 16); 107 tmp = REG_SET(MC_FB_TOP, tmp >> 16);
107 tmp |= REG_SET(RV515_MC_FB_START, rdev->mc.vram_location >> 16); 108 tmp |= REG_SET(MC_FB_START, rdev->mc.vram_location >> 16);
108 WREG32_MC(RV515_MC_FB_LOCATION, tmp); 109 WREG32_MC(MC_FB_LOCATION, tmp);
109 WREG32(RS690_HDP_FB_LOCATION, rdev->mc.vram_location >> 16); 110 WREG32(HDP_FB_LOCATION, rdev->mc.vram_location >> 16);
110 WREG32(0x310, rdev->mc.vram_location); 111 WREG32(0x310, rdev->mc.vram_location);
111 if (rdev->flags & RADEON_IS_AGP) { 112 if (rdev->flags & RADEON_IS_AGP) {
112 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1; 113 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1;
113 tmp = REG_SET(RV515_MC_AGP_TOP, tmp >> 16); 114 tmp = REG_SET(MC_AGP_TOP, tmp >> 16);
114 tmp |= REG_SET(RV515_MC_AGP_START, rdev->mc.gtt_location >> 16); 115 tmp |= REG_SET(MC_AGP_START, rdev->mc.gtt_location >> 16);
115 WREG32_MC(RV515_MC_AGP_LOCATION, tmp); 116 WREG32_MC(MC_AGP_LOCATION, tmp);
116 WREG32_MC(RV515_MC_AGP_BASE, rdev->mc.agp_base); 117 WREG32_MC(MC_AGP_BASE, rdev->mc.agp_base);
117 WREG32_MC(RV515_MC_AGP_BASE_2, 0); 118 WREG32_MC(MC_AGP_BASE_2, 0);
118 } else { 119 } else {
119 WREG32_MC(RV515_MC_AGP_LOCATION, 0x0FFFFFFF); 120 WREG32_MC(MC_AGP_LOCATION, 0x0FFFFFFF);
120 WREG32_MC(RV515_MC_AGP_BASE, 0); 121 WREG32_MC(MC_AGP_BASE, 0);
121 WREG32_MC(RV515_MC_AGP_BASE_2, 0); 122 WREG32_MC(MC_AGP_BASE_2, 0);
122 } 123 }
123 return 0; 124 return 0;
124} 125}
@@ -136,95 +137,67 @@ void rv515_mc_fini(struct radeon_device *rdev)
136 */ 137 */
137void rv515_ring_start(struct radeon_device *rdev) 138void rv515_ring_start(struct radeon_device *rdev)
138{ 139{
139 unsigned gb_tile_config;
140 int r; 140 int r;
141 141
142 /* Sub pixel 1/12 so we can have 4K rendering according to doc */
143 gb_tile_config = R300_ENABLE_TILING | R300_TILE_SIZE_16;
144 switch (rdev->num_gb_pipes) {
145 case 2:
146 gb_tile_config |= R300_PIPE_COUNT_R300;
147 break;
148 case 3:
149 gb_tile_config |= R300_PIPE_COUNT_R420_3P;
150 break;
151 case 4:
152 gb_tile_config |= R300_PIPE_COUNT_R420;
153 break;
154 case 1:
155 default:
156 gb_tile_config |= R300_PIPE_COUNT_RV350;
157 break;
158 }
159
160 r = radeon_ring_lock(rdev, 64); 142 r = radeon_ring_lock(rdev, 64);
161 if (r) { 143 if (r) {
162 return; 144 return;
163 } 145 }
164 radeon_ring_write(rdev, PACKET0(RADEON_ISYNC_CNTL, 0)); 146 radeon_ring_write(rdev, PACKET0(ISYNC_CNTL, 0));
165 radeon_ring_write(rdev,
166 RADEON_ISYNC_ANY2D_IDLE3D |
167 RADEON_ISYNC_ANY3D_IDLE2D |
168 RADEON_ISYNC_WAIT_IDLEGUI |
169 RADEON_ISYNC_CPSCRATCH_IDLEGUI);
170 radeon_ring_write(rdev, PACKET0(R300_GB_TILE_CONFIG, 0));
171 radeon_ring_write(rdev, gb_tile_config);
172 radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0));
173 radeon_ring_write(rdev, 147 radeon_ring_write(rdev,
174 RADEON_WAIT_2D_IDLECLEAN | 148 ISYNC_ANY2D_IDLE3D |
175 RADEON_WAIT_3D_IDLECLEAN); 149 ISYNC_ANY3D_IDLE2D |
150 ISYNC_WAIT_IDLEGUI |
151 ISYNC_CPSCRATCH_IDLEGUI);
152 radeon_ring_write(rdev, PACKET0(WAIT_UNTIL, 0));
153 radeon_ring_write(rdev, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN);
176 radeon_ring_write(rdev, PACKET0(0x170C, 0)); 154 radeon_ring_write(rdev, PACKET0(0x170C, 0));
177 radeon_ring_write(rdev, 1 << 31); 155 radeon_ring_write(rdev, 1 << 31);
178 radeon_ring_write(rdev, PACKET0(R300_GB_SELECT, 0)); 156 radeon_ring_write(rdev, PACKET0(GB_SELECT, 0));
179 radeon_ring_write(rdev, 0); 157 radeon_ring_write(rdev, 0);
180 radeon_ring_write(rdev, PACKET0(R300_GB_ENABLE, 0)); 158 radeon_ring_write(rdev, PACKET0(GB_ENABLE, 0));
181 radeon_ring_write(rdev, 0); 159 radeon_ring_write(rdev, 0);
182 radeon_ring_write(rdev, PACKET0(0x42C8, 0)); 160 radeon_ring_write(rdev, PACKET0(0x42C8, 0));
183 radeon_ring_write(rdev, (1 << rdev->num_gb_pipes) - 1); 161 radeon_ring_write(rdev, (1 << rdev->num_gb_pipes) - 1);
184 radeon_ring_write(rdev, PACKET0(R500_VAP_INDEX_OFFSET, 0)); 162 radeon_ring_write(rdev, PACKET0(VAP_INDEX_OFFSET, 0));
185 radeon_ring_write(rdev, 0); 163 radeon_ring_write(rdev, 0);
186 radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 164 radeon_ring_write(rdev, PACKET0(RB3D_DSTCACHE_CTLSTAT, 0));
187 radeon_ring_write(rdev, R300_RB3D_DC_FLUSH | R300_RB3D_DC_FREE); 165 radeon_ring_write(rdev, RB3D_DC_FLUSH | RB3D_DC_FREE);
188 radeon_ring_write(rdev, PACKET0(R300_RB3D_ZCACHE_CTLSTAT, 0)); 166 radeon_ring_write(rdev, PACKET0(ZB_ZCACHE_CTLSTAT, 0));
189 radeon_ring_write(rdev, R300_ZC_FLUSH | R300_ZC_FREE); 167 radeon_ring_write(rdev, ZC_FLUSH | ZC_FREE);
190 radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0)); 168 radeon_ring_write(rdev, PACKET0(WAIT_UNTIL, 0));
191 radeon_ring_write(rdev, 169 radeon_ring_write(rdev, WAIT_2D_IDLECLEAN | WAIT_3D_IDLECLEAN);
192 RADEON_WAIT_2D_IDLECLEAN | 170 radeon_ring_write(rdev, PACKET0(GB_AA_CONFIG, 0));
193 RADEON_WAIT_3D_IDLECLEAN);
194 radeon_ring_write(rdev, PACKET0(R300_GB_AA_CONFIG, 0));
195 radeon_ring_write(rdev, 0); 171 radeon_ring_write(rdev, 0);
196 radeon_ring_write(rdev, PACKET0(R300_RB3D_DSTCACHE_CTLSTAT, 0)); 172 radeon_ring_write(rdev, PACKET0(RB3D_DSTCACHE_CTLSTAT, 0));
197 radeon_ring_write(rdev, R300_RB3D_DC_FLUSH | R300_RB3D_DC_FREE); 173 radeon_ring_write(rdev, RB3D_DC_FLUSH | RB3D_DC_FREE);
198 radeon_ring_write(rdev, PACKET0(R300_RB3D_ZCACHE_CTLSTAT, 0)); 174 radeon_ring_write(rdev, PACKET0(ZB_ZCACHE_CTLSTAT, 0));
199 radeon_ring_write(rdev, R300_ZC_FLUSH | R300_ZC_FREE); 175 radeon_ring_write(rdev, ZC_FLUSH | ZC_FREE);
200 radeon_ring_write(rdev, PACKET0(R300_GB_MSPOS0, 0)); 176 radeon_ring_write(rdev, PACKET0(GB_MSPOS0, 0));
201 radeon_ring_write(rdev,
202 ((6 << R300_MS_X0_SHIFT) |
203 (6 << R300_MS_Y0_SHIFT) |
204 (6 << R300_MS_X1_SHIFT) |
205 (6 << R300_MS_Y1_SHIFT) |
206 (6 << R300_MS_X2_SHIFT) |
207 (6 << R300_MS_Y2_SHIFT) |
208 (6 << R300_MSBD0_Y_SHIFT) |
209 (6 << R300_MSBD0_X_SHIFT)));
210 radeon_ring_write(rdev, PACKET0(R300_GB_MSPOS1, 0));
211 radeon_ring_write(rdev, 177 radeon_ring_write(rdev,
212 ((6 << R300_MS_X3_SHIFT) | 178 ((6 << MS_X0_SHIFT) |
213 (6 << R300_MS_Y3_SHIFT) | 179 (6 << MS_Y0_SHIFT) |
214 (6 << R300_MS_X4_SHIFT) | 180 (6 << MS_X1_SHIFT) |
215 (6 << R300_MS_Y4_SHIFT) | 181 (6 << MS_Y1_SHIFT) |
216 (6 << R300_MS_X5_SHIFT) | 182 (6 << MS_X2_SHIFT) |
217 (6 << R300_MS_Y5_SHIFT) | 183 (6 << MS_Y2_SHIFT) |
218 (6 << R300_MSBD1_SHIFT))); 184 (6 << MSBD0_Y_SHIFT) |
219 radeon_ring_write(rdev, PACKET0(R300_GA_ENHANCE, 0)); 185 (6 << MSBD0_X_SHIFT)));
220 radeon_ring_write(rdev, R300_GA_DEADLOCK_CNTL | R300_GA_FASTSYNC_CNTL); 186 radeon_ring_write(rdev, PACKET0(GB_MSPOS1, 0));
221 radeon_ring_write(rdev, PACKET0(R300_GA_POLY_MODE, 0));
222 radeon_ring_write(rdev, 187 radeon_ring_write(rdev,
223 R300_FRONT_PTYPE_TRIANGE | R300_BACK_PTYPE_TRIANGE); 188 ((6 << MS_X3_SHIFT) |
224 radeon_ring_write(rdev, PACKET0(R300_GA_ROUND_MODE, 0)); 189 (6 << MS_Y3_SHIFT) |
225 radeon_ring_write(rdev, 190 (6 << MS_X4_SHIFT) |
226 R300_GEOMETRY_ROUND_NEAREST | 191 (6 << MS_Y4_SHIFT) |
227 R300_COLOR_ROUND_NEAREST); 192 (6 << MS_X5_SHIFT) |
193 (6 << MS_Y5_SHIFT) |
194 (6 << MSBD1_SHIFT)));
195 radeon_ring_write(rdev, PACKET0(GA_ENHANCE, 0));
196 radeon_ring_write(rdev, GA_DEADLOCK_CNTL | GA_FASTSYNC_CNTL);
197 radeon_ring_write(rdev, PACKET0(GA_POLY_MODE, 0));
198 radeon_ring_write(rdev, FRONT_PTYPE_TRIANGE | BACK_PTYPE_TRIANGE);
199 radeon_ring_write(rdev, PACKET0(GA_ROUND_MODE, 0));
200 radeon_ring_write(rdev, GEOMETRY_ROUND_NEAREST | COLOR_ROUND_NEAREST);
228 radeon_ring_write(rdev, PACKET0(0x20C8, 0)); 201 radeon_ring_write(rdev, PACKET0(0x20C8, 0));
229 radeon_ring_write(rdev, 0); 202 radeon_ring_write(rdev, 0);
230 radeon_ring_unlock_commit(rdev); 203 radeon_ring_unlock_commit(rdev);
@@ -242,8 +215,8 @@ int rv515_mc_wait_for_idle(struct radeon_device *rdev)
242 215
243 for (i = 0; i < rdev->usec_timeout; i++) { 216 for (i = 0; i < rdev->usec_timeout; i++) {
244 /* read MC_STATUS */ 217 /* read MC_STATUS */
245 tmp = RREG32_MC(RV515_MC_STATUS); 218 tmp = RREG32_MC(MC_STATUS);
246 if (tmp & RV515_MC_STATUS_IDLE) { 219 if (tmp & MC_STATUS_IDLE) {
247 return 0; 220 return 0;
248 } 221 }
249 DRM_UDELAY(1); 222 DRM_UDELAY(1);
@@ -291,33 +264,33 @@ int rv515_ga_reset(struct radeon_device *rdev)
291 reinit_cp = rdev->cp.ready; 264 reinit_cp = rdev->cp.ready;
292 rdev->cp.ready = false; 265 rdev->cp.ready = false;
293 for (i = 0; i < rdev->usec_timeout; i++) { 266 for (i = 0; i < rdev->usec_timeout; i++) {
294 WREG32(RADEON_CP_CSQ_MODE, 0); 267 WREG32(CP_CSQ_MODE, 0);
295 WREG32(RADEON_CP_CSQ_CNTL, 0); 268 WREG32(CP_CSQ_CNTL, 0);
296 WREG32(RADEON_RBBM_SOFT_RESET, 0x32005); 269 WREG32(RBBM_SOFT_RESET, 0x32005);
297 (void)RREG32(RADEON_RBBM_SOFT_RESET); 270 (void)RREG32(RBBM_SOFT_RESET);
298 udelay(200); 271 udelay(200);
299 WREG32(RADEON_RBBM_SOFT_RESET, 0); 272 WREG32(RBBM_SOFT_RESET, 0);
300 /* Wait to prevent race in RBBM_STATUS */ 273 /* Wait to prevent race in RBBM_STATUS */
301 mdelay(1); 274 mdelay(1);
302 tmp = RREG32(RADEON_RBBM_STATUS); 275 tmp = RREG32(RBBM_STATUS);
303 if (tmp & ((1 << 20) | (1 << 26))) { 276 if (tmp & ((1 << 20) | (1 << 26))) {
304 DRM_ERROR("VAP & CP still busy (RBBM_STATUS=0x%08X)\n", tmp); 277 DRM_ERROR("VAP & CP still busy (RBBM_STATUS=0x%08X)\n", tmp);
305 /* GA still busy soft reset it */ 278 /* GA still busy soft reset it */
306 WREG32(0x429C, 0x200); 279 WREG32(0x429C, 0x200);
307 WREG32(R300_VAP_PVS_STATE_FLUSH_REG, 0); 280 WREG32(VAP_PVS_STATE_FLUSH_REG, 0);
308 WREG32(0x43E0, 0); 281 WREG32(0x43E0, 0);
309 WREG32(0x43E4, 0); 282 WREG32(0x43E4, 0);
310 WREG32(0x24AC, 0); 283 WREG32(0x24AC, 0);
311 } 284 }
312 /* Wait to prevent race in RBBM_STATUS */ 285 /* Wait to prevent race in RBBM_STATUS */
313 mdelay(1); 286 mdelay(1);
314 tmp = RREG32(RADEON_RBBM_STATUS); 287 tmp = RREG32(RBBM_STATUS);
315 if (!(tmp & ((1 << 20) | (1 << 26)))) { 288 if (!(tmp & ((1 << 20) | (1 << 26)))) {
316 break; 289 break;
317 } 290 }
318 } 291 }
319 for (i = 0; i < rdev->usec_timeout; i++) { 292 for (i = 0; i < rdev->usec_timeout; i++) {
320 tmp = RREG32(RADEON_RBBM_STATUS); 293 tmp = RREG32(RBBM_STATUS);
321 if (!(tmp & ((1 << 20) | (1 << 26)))) { 294 if (!(tmp & ((1 << 20) | (1 << 26)))) {
322 DRM_INFO("GA reset succeed (RBBM_STATUS=0x%08X)\n", 295 DRM_INFO("GA reset succeed (RBBM_STATUS=0x%08X)\n",
323 tmp); 296 tmp);
@@ -331,7 +304,7 @@ int rv515_ga_reset(struct radeon_device *rdev)
331 } 304 }
332 DRM_UDELAY(1); 305 DRM_UDELAY(1);
333 } 306 }
334 tmp = RREG32(RADEON_RBBM_STATUS); 307 tmp = RREG32(RBBM_STATUS);
335 DRM_ERROR("Failed to reset GA ! (RBBM_STATUS=0x%08X)\n", tmp); 308 DRM_ERROR("Failed to reset GA ! (RBBM_STATUS=0x%08X)\n", tmp);
336 return -1; 309 return -1;
337} 310}
@@ -341,7 +314,7 @@ int rv515_gpu_reset(struct radeon_device *rdev)
341 uint32_t status; 314 uint32_t status;
342 315
343 /* reset order likely matter */ 316 /* reset order likely matter */
344 status = RREG32(RADEON_RBBM_STATUS); 317 status = RREG32(RBBM_STATUS);
345 /* reset HDP */ 318 /* reset HDP */
346 r100_hdp_reset(rdev); 319 r100_hdp_reset(rdev);
347 /* reset rb2d */ 320 /* reset rb2d */
@@ -353,12 +326,12 @@ int rv515_gpu_reset(struct radeon_device *rdev)
353 rv515_ga_reset(rdev); 326 rv515_ga_reset(rdev);
354 } 327 }
355 /* reset CP */ 328 /* reset CP */
356 status = RREG32(RADEON_RBBM_STATUS); 329 status = RREG32(RBBM_STATUS);
357 if (status & (1 << 16)) { 330 if (status & (1 << 16)) {
358 r100_cp_reset(rdev); 331 r100_cp_reset(rdev);
359 } 332 }
360 /* Check if GPU is idle */ 333 /* Check if GPU is idle */
361 status = RREG32(RADEON_RBBM_STATUS); 334 status = RREG32(RBBM_STATUS);
362 if (status & (1 << 31)) { 335 if (status & (1 << 31)) {
363 DRM_ERROR("Failed to reset GPU (RBBM_STATUS=0x%08X)\n", status); 336 DRM_ERROR("Failed to reset GPU (RBBM_STATUS=0x%08X)\n", status);
364 return -1; 337 return -1;
@@ -377,8 +350,7 @@ static void rv515_vram_get_type(struct radeon_device *rdev)
377 350
378 rdev->mc.vram_width = 128; 351 rdev->mc.vram_width = 128;
379 rdev->mc.vram_is_ddr = true; 352 rdev->mc.vram_is_ddr = true;
380 tmp = RREG32_MC(RV515_MC_CNTL); 353 tmp = RREG32_MC(RV515_MC_CNTL) & MEM_NUM_CHANNELS_MASK;
381 tmp &= RV515_MEM_NUM_CHANNELS_MASK;
382 switch (tmp) { 354 switch (tmp) {
383 case 0: 355 case 0:
384 rdev->mc.vram_width = 64; 356 rdev->mc.vram_width = 64;
@@ -394,11 +366,16 @@ static void rv515_vram_get_type(struct radeon_device *rdev)
394 366
395void rv515_vram_info(struct radeon_device *rdev) 367void rv515_vram_info(struct radeon_device *rdev)
396{ 368{
369 fixed20_12 a;
370
397 rv515_vram_get_type(rdev); 371 rv515_vram_get_type(rdev);
398 rdev->mc.vram_size = RREG32(RADEON_CONFIG_MEMSIZE);
399 372
400 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 373 /* FIXME: we should enforce default clock in case GPU is not in
401 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 374 * default setup
375 */
376 a.full = rfixed_const(100);
377 rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk);
378 rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a);
402} 379}
403 380
404 381
@@ -409,35 +386,35 @@ uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg)
409{ 386{
410 uint32_t r; 387 uint32_t r;
411 388
412 WREG32(R520_MC_IND_INDEX, 0x7f0000 | (reg & 0xffff)); 389 WREG32(MC_IND_INDEX, 0x7f0000 | (reg & 0xffff));
413 r = RREG32(R520_MC_IND_DATA); 390 r = RREG32(MC_IND_DATA);
414 WREG32(R520_MC_IND_INDEX, 0); 391 WREG32(MC_IND_INDEX, 0);
415 return r; 392 return r;
416} 393}
417 394
418void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) 395void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
419{ 396{
420 WREG32(R520_MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff)); 397 WREG32(MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff));
421 WREG32(R520_MC_IND_DATA, (v)); 398 WREG32(MC_IND_DATA, (v));
422 WREG32(R520_MC_IND_INDEX, 0); 399 WREG32(MC_IND_INDEX, 0);
423} 400}
424 401
425uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg) 402uint32_t rv515_pcie_rreg(struct radeon_device *rdev, uint32_t reg)
426{ 403{
427 uint32_t r; 404 uint32_t r;
428 405
429 WREG32(RADEON_PCIE_INDEX, ((reg) & 0x7ff)); 406 WREG32(PCIE_INDEX, ((reg) & 0x7ff));
430 (void)RREG32(RADEON_PCIE_INDEX); 407 (void)RREG32(PCIE_INDEX);
431 r = RREG32(RADEON_PCIE_DATA); 408 r = RREG32(PCIE_DATA);
432 return r; 409 return r;
433} 410}
434 411
435void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) 412void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
436{ 413{
437 WREG32(RADEON_PCIE_INDEX, ((reg) & 0x7ff)); 414 WREG32(PCIE_INDEX, ((reg) & 0x7ff));
438 (void)RREG32(RADEON_PCIE_INDEX); 415 (void)RREG32(PCIE_INDEX);
439 WREG32(RADEON_PCIE_DATA, (v)); 416 WREG32(PCIE_DATA, (v));
440 (void)RREG32(RADEON_PCIE_DATA); 417 (void)RREG32(PCIE_DATA);
441} 418}
442 419
443 420
@@ -452,13 +429,13 @@ static int rv515_debugfs_pipes_info(struct seq_file *m, void *data)
452 struct radeon_device *rdev = dev->dev_private; 429 struct radeon_device *rdev = dev->dev_private;
453 uint32_t tmp; 430 uint32_t tmp;
454 431
455 tmp = RREG32(R400_GB_PIPE_SELECT); 432 tmp = RREG32(GB_PIPE_SELECT);
456 seq_printf(m, "GB_PIPE_SELECT 0x%08x\n", tmp); 433 seq_printf(m, "GB_PIPE_SELECT 0x%08x\n", tmp);
457 tmp = RREG32(R500_SU_REG_DEST); 434 tmp = RREG32(SU_REG_DEST);
458 seq_printf(m, "SU_REG_DEST 0x%08x\n", tmp); 435 seq_printf(m, "SU_REG_DEST 0x%08x\n", tmp);
459 tmp = RREG32(R300_GB_TILE_CONFIG); 436 tmp = RREG32(GB_TILE_CONFIG);
460 seq_printf(m, "GB_TILE_CONFIG 0x%08x\n", tmp); 437 seq_printf(m, "GB_TILE_CONFIG 0x%08x\n", tmp);
461 tmp = RREG32(R300_DST_PIPE_CONFIG); 438 tmp = RREG32(DST_PIPE_CONFIG);
462 seq_printf(m, "DST_PIPE_CONFIG 0x%08x\n", tmp); 439 seq_printf(m, "DST_PIPE_CONFIG 0x%08x\n", tmp);
463 return 0; 440 return 0;
464} 441}
@@ -509,9 +486,9 @@ int rv515_debugfs_ga_info_init(struct radeon_device *rdev)
509/* 486/*
510 * Asic initialization 487 * Asic initialization
511 */ 488 */
512static const unsigned r500_reg_safe_bm[159] = { 489static const unsigned r500_reg_safe_bm[219] = {
490 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
513 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 491 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
514 0xFFFFFFBF, 0xFFFFFFFF, 0xFFFFFFBF, 0xFFFFFFFF,
515 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 492 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
516 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 493 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
517 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 494 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
@@ -549,14 +526,575 @@ static const unsigned r500_reg_safe_bm[159] = {
549 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 526 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
550 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF80FFFF, 527 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF80FFFF,
551 0x00000000, 0x00000000, 0x00000000, 0x00000000, 528 0x00000000, 0x00000000, 0x00000000, 0x00000000,
552 0x0003FC01, 0x3FFFFCF8, 0xFE800B19, 529 0x0003FC01, 0x3FFFFCF8, 0xFE800B19, 0xFFFFFFFF,
530 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
531 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
532 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
533 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
534 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
535 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
536 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
537 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
538 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
539 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
540 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
541 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
542 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
543 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
544 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
553}; 545};
554 546
555
556
557int rv515_init(struct radeon_device *rdev) 547int rv515_init(struct radeon_device *rdev)
558{ 548{
559 rdev->config.r300.reg_safe_bm = r500_reg_safe_bm; 549 rdev->config.r300.reg_safe_bm = r500_reg_safe_bm;
560 rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(r500_reg_safe_bm); 550 rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(r500_reg_safe_bm);
561 return 0; 551 return 0;
562} 552}
553
554void atom_rv515_force_tv_scaler(struct radeon_device *rdev)
555{
556
557 WREG32(0x659C, 0x0);
558 WREG32(0x6594, 0x705);
559 WREG32(0x65A4, 0x10001);
560 WREG32(0x65D8, 0x0);
561 WREG32(0x65B0, 0x0);
562 WREG32(0x65C0, 0x0);
563 WREG32(0x65D4, 0x0);
564 WREG32(0x6578, 0x0);
565 WREG32(0x657C, 0x841880A8);
566 WREG32(0x6578, 0x1);
567 WREG32(0x657C, 0x84208680);
568 WREG32(0x6578, 0x2);
569 WREG32(0x657C, 0xBFF880B0);
570 WREG32(0x6578, 0x100);
571 WREG32(0x657C, 0x83D88088);
572 WREG32(0x6578, 0x101);
573 WREG32(0x657C, 0x84608680);
574 WREG32(0x6578, 0x102);
575 WREG32(0x657C, 0xBFF080D0);
576 WREG32(0x6578, 0x200);
577 WREG32(0x657C, 0x83988068);
578 WREG32(0x6578, 0x201);
579 WREG32(0x657C, 0x84A08680);
580 WREG32(0x6578, 0x202);
581 WREG32(0x657C, 0xBFF080F8);
582 WREG32(0x6578, 0x300);
583 WREG32(0x657C, 0x83588058);
584 WREG32(0x6578, 0x301);
585 WREG32(0x657C, 0x84E08660);
586 WREG32(0x6578, 0x302);
587 WREG32(0x657C, 0xBFF88120);
588 WREG32(0x6578, 0x400);
589 WREG32(0x657C, 0x83188040);
590 WREG32(0x6578, 0x401);
591 WREG32(0x657C, 0x85008660);
592 WREG32(0x6578, 0x402);
593 WREG32(0x657C, 0xBFF88150);
594 WREG32(0x6578, 0x500);
595 WREG32(0x657C, 0x82D88030);
596 WREG32(0x6578, 0x501);
597 WREG32(0x657C, 0x85408640);
598 WREG32(0x6578, 0x502);
599 WREG32(0x657C, 0xBFF88180);
600 WREG32(0x6578, 0x600);
601 WREG32(0x657C, 0x82A08018);
602 WREG32(0x6578, 0x601);
603 WREG32(0x657C, 0x85808620);
604 WREG32(0x6578, 0x602);
605 WREG32(0x657C, 0xBFF081B8);
606 WREG32(0x6578, 0x700);
607 WREG32(0x657C, 0x82608010);
608 WREG32(0x6578, 0x701);
609 WREG32(0x657C, 0x85A08600);
610 WREG32(0x6578, 0x702);
611 WREG32(0x657C, 0x800081F0);
612 WREG32(0x6578, 0x800);
613 WREG32(0x657C, 0x8228BFF8);
614 WREG32(0x6578, 0x801);
615 WREG32(0x657C, 0x85E085E0);
616 WREG32(0x6578, 0x802);
617 WREG32(0x657C, 0xBFF88228);
618 WREG32(0x6578, 0x10000);
619 WREG32(0x657C, 0x82A8BF00);
620 WREG32(0x6578, 0x10001);
621 WREG32(0x657C, 0x82A08CC0);
622 WREG32(0x6578, 0x10002);
623 WREG32(0x657C, 0x8008BEF8);
624 WREG32(0x6578, 0x10100);
625 WREG32(0x657C, 0x81F0BF28);
626 WREG32(0x6578, 0x10101);
627 WREG32(0x657C, 0x83608CA0);
628 WREG32(0x6578, 0x10102);
629 WREG32(0x657C, 0x8018BED0);
630 WREG32(0x6578, 0x10200);
631 WREG32(0x657C, 0x8148BF38);
632 WREG32(0x6578, 0x10201);
633 WREG32(0x657C, 0x84408C80);
634 WREG32(0x6578, 0x10202);
635 WREG32(0x657C, 0x8008BEB8);
636 WREG32(0x6578, 0x10300);
637 WREG32(0x657C, 0x80B0BF78);
638 WREG32(0x6578, 0x10301);
639 WREG32(0x657C, 0x85008C20);
640 WREG32(0x6578, 0x10302);
641 WREG32(0x657C, 0x8020BEA0);
642 WREG32(0x6578, 0x10400);
643 WREG32(0x657C, 0x8028BF90);
644 WREG32(0x6578, 0x10401);
645 WREG32(0x657C, 0x85E08BC0);
646 WREG32(0x6578, 0x10402);
647 WREG32(0x657C, 0x8018BE90);
648 WREG32(0x6578, 0x10500);
649 WREG32(0x657C, 0xBFB8BFB0);
650 WREG32(0x6578, 0x10501);
651 WREG32(0x657C, 0x86C08B40);
652 WREG32(0x6578, 0x10502);
653 WREG32(0x657C, 0x8010BE90);
654 WREG32(0x6578, 0x10600);
655 WREG32(0x657C, 0xBF58BFC8);
656 WREG32(0x6578, 0x10601);
657 WREG32(0x657C, 0x87A08AA0);
658 WREG32(0x6578, 0x10602);
659 WREG32(0x657C, 0x8010BE98);
660 WREG32(0x6578, 0x10700);
661 WREG32(0x657C, 0xBF10BFF0);
662 WREG32(0x6578, 0x10701);
663 WREG32(0x657C, 0x886089E0);
664 WREG32(0x6578, 0x10702);
665 WREG32(0x657C, 0x8018BEB0);
666 WREG32(0x6578, 0x10800);
667 WREG32(0x657C, 0xBED8BFE8);
668 WREG32(0x6578, 0x10801);
669 WREG32(0x657C, 0x89408940);
670 WREG32(0x6578, 0x10802);
671 WREG32(0x657C, 0xBFE8BED8);
672 WREG32(0x6578, 0x20000);
673 WREG32(0x657C, 0x80008000);
674 WREG32(0x6578, 0x20001);
675 WREG32(0x657C, 0x90008000);
676 WREG32(0x6578, 0x20002);
677 WREG32(0x657C, 0x80008000);
678 WREG32(0x6578, 0x20003);
679 WREG32(0x657C, 0x80008000);
680 WREG32(0x6578, 0x20100);
681 WREG32(0x657C, 0x80108000);
682 WREG32(0x6578, 0x20101);
683 WREG32(0x657C, 0x8FE0BF70);
684 WREG32(0x6578, 0x20102);
685 WREG32(0x657C, 0xBFE880C0);
686 WREG32(0x6578, 0x20103);
687 WREG32(0x657C, 0x80008000);
688 WREG32(0x6578, 0x20200);
689 WREG32(0x657C, 0x8018BFF8);
690 WREG32(0x6578, 0x20201);
691 WREG32(0x657C, 0x8F80BF08);
692 WREG32(0x6578, 0x20202);
693 WREG32(0x657C, 0xBFD081A0);
694 WREG32(0x6578, 0x20203);
695 WREG32(0x657C, 0xBFF88000);
696 WREG32(0x6578, 0x20300);
697 WREG32(0x657C, 0x80188000);
698 WREG32(0x6578, 0x20301);
699 WREG32(0x657C, 0x8EE0BEC0);
700 WREG32(0x6578, 0x20302);
701 WREG32(0x657C, 0xBFB082A0);
702 WREG32(0x6578, 0x20303);
703 WREG32(0x657C, 0x80008000);
704 WREG32(0x6578, 0x20400);
705 WREG32(0x657C, 0x80188000);
706 WREG32(0x6578, 0x20401);
707 WREG32(0x657C, 0x8E00BEA0);
708 WREG32(0x6578, 0x20402);
709 WREG32(0x657C, 0xBF8883C0);
710 WREG32(0x6578, 0x20403);
711 WREG32(0x657C, 0x80008000);
712 WREG32(0x6578, 0x20500);
713 WREG32(0x657C, 0x80188000);
714 WREG32(0x6578, 0x20501);
715 WREG32(0x657C, 0x8D00BE90);
716 WREG32(0x6578, 0x20502);
717 WREG32(0x657C, 0xBF588500);
718 WREG32(0x6578, 0x20503);
719 WREG32(0x657C, 0x80008008);
720 WREG32(0x6578, 0x20600);
721 WREG32(0x657C, 0x80188000);
722 WREG32(0x6578, 0x20601);
723 WREG32(0x657C, 0x8BC0BE98);
724 WREG32(0x6578, 0x20602);
725 WREG32(0x657C, 0xBF308660);
726 WREG32(0x6578, 0x20603);
727 WREG32(0x657C, 0x80008008);
728 WREG32(0x6578, 0x20700);
729 WREG32(0x657C, 0x80108000);
730 WREG32(0x6578, 0x20701);
731 WREG32(0x657C, 0x8A80BEB0);
732 WREG32(0x6578, 0x20702);
733 WREG32(0x657C, 0xBF0087C0);
734 WREG32(0x6578, 0x20703);
735 WREG32(0x657C, 0x80008008);
736 WREG32(0x6578, 0x20800);
737 WREG32(0x657C, 0x80108000);
738 WREG32(0x6578, 0x20801);
739 WREG32(0x657C, 0x8920BED0);
740 WREG32(0x6578, 0x20802);
741 WREG32(0x657C, 0xBED08920);
742 WREG32(0x6578, 0x20803);
743 WREG32(0x657C, 0x80008010);
744 WREG32(0x6578, 0x30000);
745 WREG32(0x657C, 0x90008000);
746 WREG32(0x6578, 0x30001);
747 WREG32(0x657C, 0x80008000);
748 WREG32(0x6578, 0x30100);
749 WREG32(0x657C, 0x8FE0BF90);
750 WREG32(0x6578, 0x30101);
751 WREG32(0x657C, 0xBFF880A0);
752 WREG32(0x6578, 0x30200);
753 WREG32(0x657C, 0x8F60BF40);
754 WREG32(0x6578, 0x30201);
755 WREG32(0x657C, 0xBFE88180);
756 WREG32(0x6578, 0x30300);
757 WREG32(0x657C, 0x8EC0BF00);
758 WREG32(0x6578, 0x30301);
759 WREG32(0x657C, 0xBFC88280);
760 WREG32(0x6578, 0x30400);
761 WREG32(0x657C, 0x8DE0BEE0);
762 WREG32(0x6578, 0x30401);
763 WREG32(0x657C, 0xBFA083A0);
764 WREG32(0x6578, 0x30500);
765 WREG32(0x657C, 0x8CE0BED0);
766 WREG32(0x6578, 0x30501);
767 WREG32(0x657C, 0xBF7884E0);
768 WREG32(0x6578, 0x30600);
769 WREG32(0x657C, 0x8BA0BED8);
770 WREG32(0x6578, 0x30601);
771 WREG32(0x657C, 0xBF508640);
772 WREG32(0x6578, 0x30700);
773 WREG32(0x657C, 0x8A60BEE8);
774 WREG32(0x6578, 0x30701);
775 WREG32(0x657C, 0xBF2087A0);
776 WREG32(0x6578, 0x30800);
777 WREG32(0x657C, 0x8900BF00);
778 WREG32(0x6578, 0x30801);
779 WREG32(0x657C, 0xBF008900);
780}
781
782struct rv515_watermark {
783 u32 lb_request_fifo_depth;
784 fixed20_12 num_line_pair;
785 fixed20_12 estimated_width;
786 fixed20_12 worst_case_latency;
787 fixed20_12 consumption_rate;
788 fixed20_12 active_time;
789 fixed20_12 dbpp;
790 fixed20_12 priority_mark_max;
791 fixed20_12 priority_mark;
792 fixed20_12 sclk;
793};
794
795void rv515_crtc_bandwidth_compute(struct radeon_device *rdev,
796 struct radeon_crtc *crtc,
797 struct rv515_watermark *wm)
798{
799 struct drm_display_mode *mode = &crtc->base.mode;
800 fixed20_12 a, b, c;
801 fixed20_12 pclk, request_fifo_depth, tolerable_latency, estimated_width;
802 fixed20_12 consumption_time, line_time, chunk_time, read_delay_latency;
803
804 if (!crtc->base.enabled) {
805 /* FIXME: wouldn't it better to set priority mark to maximum */
806 wm->lb_request_fifo_depth = 4;
807 return;
808 }
809
810 if (crtc->vsc.full > rfixed_const(2))
811 wm->num_line_pair.full = rfixed_const(2);
812 else
813 wm->num_line_pair.full = rfixed_const(1);
814
815 b.full = rfixed_const(mode->crtc_hdisplay);
816 c.full = rfixed_const(256);
817 a.full = rfixed_mul(wm->num_line_pair, b);
818 request_fifo_depth.full = rfixed_div(a, c);
819 if (a.full < rfixed_const(4)) {
820 wm->lb_request_fifo_depth = 4;
821 } else {
822 wm->lb_request_fifo_depth = rfixed_trunc(request_fifo_depth);
823 }
824
825 /* Determine consumption rate
826 * pclk = pixel clock period(ns) = 1000 / (mode.clock / 1000)
827 * vtaps = number of vertical taps,
828 * vsc = vertical scaling ratio, defined as source/destination
829 * hsc = horizontal scaling ration, defined as source/destination
830 */
831 a.full = rfixed_const(mode->clock);
832 b.full = rfixed_const(1000);
833 a.full = rfixed_div(a, b);
834 pclk.full = rfixed_div(b, a);
835 if (crtc->rmx_type != RMX_OFF) {
836 b.full = rfixed_const(2);
837 if (crtc->vsc.full > b.full)
838 b.full = crtc->vsc.full;
839 b.full = rfixed_mul(b, crtc->hsc);
840 c.full = rfixed_const(2);
841 b.full = rfixed_div(b, c);
842 consumption_time.full = rfixed_div(pclk, b);
843 } else {
844 consumption_time.full = pclk.full;
845 }
846 a.full = rfixed_const(1);
847 wm->consumption_rate.full = rfixed_div(a, consumption_time);
848
849
850 /* Determine line time
851 * LineTime = total time for one line of displayhtotal
852 * LineTime = total number of horizontal pixels
853 * pclk = pixel clock period(ns)
854 */
855 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
856 line_time.full = rfixed_mul(a, pclk);
857
858 /* Determine active time
859 * ActiveTime = time of active region of display within one line,
860 * hactive = total number of horizontal active pixels
861 * htotal = total number of horizontal pixels
862 */
863 a.full = rfixed_const(crtc->base.mode.crtc_htotal);
864 b.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
865 wm->active_time.full = rfixed_mul(line_time, b);
866 wm->active_time.full = rfixed_div(wm->active_time, a);
867
868 /* Determine chunk time
869 * ChunkTime = the time it takes the DCP to send one chunk of data
870 * to the LB which consists of pipeline delay and inter chunk gap
871 * sclk = system clock(Mhz)
872 */
873 a.full = rfixed_const(600 * 1000);
874 chunk_time.full = rfixed_div(a, rdev->pm.sclk);
875 read_delay_latency.full = rfixed_const(1000);
876
877 /* Determine the worst case latency
878 * NumLinePair = Number of line pairs to request(1=2 lines, 2=4 lines)
879 * WorstCaseLatency = worst case time from urgent to when the MC starts
880 * to return data
881 * READ_DELAY_IDLE_MAX = constant of 1us
882 * ChunkTime = time it takes the DCP to send one chunk of data to the LB
883 * which consists of pipeline delay and inter chunk gap
884 */
885 if (rfixed_trunc(wm->num_line_pair) > 1) {
886 a.full = rfixed_const(3);
887 wm->worst_case_latency.full = rfixed_mul(a, chunk_time);
888 wm->worst_case_latency.full += read_delay_latency.full;
889 } else {
890 wm->worst_case_latency.full = chunk_time.full + read_delay_latency.full;
891 }
892
893 /* Determine the tolerable latency
894 * TolerableLatency = Any given request has only 1 line time
895 * for the data to be returned
896 * LBRequestFifoDepth = Number of chunk requests the LB can
897 * put into the request FIFO for a display
898 * LineTime = total time for one line of display
899 * ChunkTime = the time it takes the DCP to send one chunk
900 * of data to the LB which consists of
901 * pipeline delay and inter chunk gap
902 */
903 if ((2+wm->lb_request_fifo_depth) >= rfixed_trunc(request_fifo_depth)) {
904 tolerable_latency.full = line_time.full;
905 } else {
906 tolerable_latency.full = rfixed_const(wm->lb_request_fifo_depth - 2);
907 tolerable_latency.full = request_fifo_depth.full - tolerable_latency.full;
908 tolerable_latency.full = rfixed_mul(tolerable_latency, chunk_time);
909 tolerable_latency.full = line_time.full - tolerable_latency.full;
910 }
911 /* We assume worst case 32bits (4 bytes) */
912 wm->dbpp.full = rfixed_const(2 * 16);
913
914 /* Determine the maximum priority mark
915 * width = viewport width in pixels
916 */
917 a.full = rfixed_const(16);
918 wm->priority_mark_max.full = rfixed_const(crtc->base.mode.crtc_hdisplay);
919 wm->priority_mark_max.full = rfixed_div(wm->priority_mark_max, a);
920
921 /* Determine estimated width */
922 estimated_width.full = tolerable_latency.full - wm->worst_case_latency.full;
923 estimated_width.full = rfixed_div(estimated_width, consumption_time);
924 if (rfixed_trunc(estimated_width) > crtc->base.mode.crtc_hdisplay) {
925 wm->priority_mark.full = rfixed_const(10);
926 } else {
927 a.full = rfixed_const(16);
928 wm->priority_mark.full = rfixed_div(estimated_width, a);
929 wm->priority_mark.full = wm->priority_mark_max.full - wm->priority_mark.full;
930 }
931}
932
933void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
934{
935 struct drm_display_mode *mode0 = NULL;
936 struct drm_display_mode *mode1 = NULL;
937 struct rv515_watermark wm0;
938 struct rv515_watermark wm1;
939 u32 tmp;
940 fixed20_12 priority_mark02, priority_mark12, fill_rate;
941 fixed20_12 a, b;
942
943 if (rdev->mode_info.crtcs[0]->base.enabled)
944 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
945 if (rdev->mode_info.crtcs[1]->base.enabled)
946 mode1 = &rdev->mode_info.crtcs[1]->base.mode;
947 rs690_line_buffer_adjust(rdev, mode0, mode1);
948
949 rv515_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[0], &wm0);
950 rv515_crtc_bandwidth_compute(rdev, rdev->mode_info.crtcs[1], &wm1);
951
952 tmp = wm0.lb_request_fifo_depth;
953 tmp |= wm1.lb_request_fifo_depth << 16;
954 WREG32(LB_MAX_REQ_OUTSTANDING, tmp);
955
956 if (mode0 && mode1) {
957 if (rfixed_trunc(wm0.dbpp) > 64)
958 a.full = rfixed_div(wm0.dbpp, wm0.num_line_pair);
959 else
960 a.full = wm0.num_line_pair.full;
961 if (rfixed_trunc(wm1.dbpp) > 64)
962 b.full = rfixed_div(wm1.dbpp, wm1.num_line_pair);
963 else
964 b.full = wm1.num_line_pair.full;
965 a.full += b.full;
966 fill_rate.full = rfixed_div(wm0.sclk, a);
967 if (wm0.consumption_rate.full > fill_rate.full) {
968 b.full = wm0.consumption_rate.full - fill_rate.full;
969 b.full = rfixed_mul(b, wm0.active_time);
970 a.full = rfixed_const(16);
971 b.full = rfixed_div(b, a);
972 a.full = rfixed_mul(wm0.worst_case_latency,
973 wm0.consumption_rate);
974 priority_mark02.full = a.full + b.full;
975 } else {
976 a.full = rfixed_mul(wm0.worst_case_latency,
977 wm0.consumption_rate);
978 b.full = rfixed_const(16 * 1000);
979 priority_mark02.full = rfixed_div(a, b);
980 }
981 if (wm1.consumption_rate.full > fill_rate.full) {
982 b.full = wm1.consumption_rate.full - fill_rate.full;
983 b.full = rfixed_mul(b, wm1.active_time);
984 a.full = rfixed_const(16);
985 b.full = rfixed_div(b, a);
986 a.full = rfixed_mul(wm1.worst_case_latency,
987 wm1.consumption_rate);
988 priority_mark12.full = a.full + b.full;
989 } else {
990 a.full = rfixed_mul(wm1.worst_case_latency,
991 wm1.consumption_rate);
992 b.full = rfixed_const(16 * 1000);
993 priority_mark12.full = rfixed_div(a, b);
994 }
995 if (wm0.priority_mark.full > priority_mark02.full)
996 priority_mark02.full = wm0.priority_mark.full;
997 if (rfixed_trunc(priority_mark02) < 0)
998 priority_mark02.full = 0;
999 if (wm0.priority_mark_max.full > priority_mark02.full)
1000 priority_mark02.full = wm0.priority_mark_max.full;
1001 if (wm1.priority_mark.full > priority_mark12.full)
1002 priority_mark12.full = wm1.priority_mark.full;
1003 if (rfixed_trunc(priority_mark12) < 0)
1004 priority_mark12.full = 0;
1005 if (wm1.priority_mark_max.full > priority_mark12.full)
1006 priority_mark12.full = wm1.priority_mark_max.full;
1007 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
1008 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
1009 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
1010 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
1011 } else if (mode0) {
1012 if (rfixed_trunc(wm0.dbpp) > 64)
1013 a.full = rfixed_div(wm0.dbpp, wm0.num_line_pair);
1014 else
1015 a.full = wm0.num_line_pair.full;
1016 fill_rate.full = rfixed_div(wm0.sclk, a);
1017 if (wm0.consumption_rate.full > fill_rate.full) {
1018 b.full = wm0.consumption_rate.full - fill_rate.full;
1019 b.full = rfixed_mul(b, wm0.active_time);
1020 a.full = rfixed_const(16);
1021 b.full = rfixed_div(b, a);
1022 a.full = rfixed_mul(wm0.worst_case_latency,
1023 wm0.consumption_rate);
1024 priority_mark02.full = a.full + b.full;
1025 } else {
1026 a.full = rfixed_mul(wm0.worst_case_latency,
1027 wm0.consumption_rate);
1028 b.full = rfixed_const(16);
1029 priority_mark02.full = rfixed_div(a, b);
1030 }
1031 if (wm0.priority_mark.full > priority_mark02.full)
1032 priority_mark02.full = wm0.priority_mark.full;
1033 if (rfixed_trunc(priority_mark02) < 0)
1034 priority_mark02.full = 0;
1035 if (wm0.priority_mark_max.full > priority_mark02.full)
1036 priority_mark02.full = wm0.priority_mark_max.full;
1037 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02));
1038 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02));
1039 WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
1040 WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
1041 } else {
1042 if (rfixed_trunc(wm1.dbpp) > 64)
1043 a.full = rfixed_div(wm1.dbpp, wm1.num_line_pair);
1044 else
1045 a.full = wm1.num_line_pair.full;
1046 fill_rate.full = rfixed_div(wm1.sclk, a);
1047 if (wm1.consumption_rate.full > fill_rate.full) {
1048 b.full = wm1.consumption_rate.full - fill_rate.full;
1049 b.full = rfixed_mul(b, wm1.active_time);
1050 a.full = rfixed_const(16);
1051 b.full = rfixed_div(b, a);
1052 a.full = rfixed_mul(wm1.worst_case_latency,
1053 wm1.consumption_rate);
1054 priority_mark12.full = a.full + b.full;
1055 } else {
1056 a.full = rfixed_mul(wm1.worst_case_latency,
1057 wm1.consumption_rate);
1058 b.full = rfixed_const(16 * 1000);
1059 priority_mark12.full = rfixed_div(a, b);
1060 }
1061 if (wm1.priority_mark.full > priority_mark12.full)
1062 priority_mark12.full = wm1.priority_mark.full;
1063 if (rfixed_trunc(priority_mark12) < 0)
1064 priority_mark12.full = 0;
1065 if (wm1.priority_mark_max.full > priority_mark12.full)
1066 priority_mark12.full = wm1.priority_mark_max.full;
1067 WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
1068 WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
1069 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12));
1070 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12));
1071 }
1072}
1073
1074void rv515_bandwidth_update(struct radeon_device *rdev)
1075{
1076 uint32_t tmp;
1077 struct drm_display_mode *mode0 = NULL;
1078 struct drm_display_mode *mode1 = NULL;
1079
1080 if (rdev->mode_info.crtcs[0]->base.enabled)
1081 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
1082 if (rdev->mode_info.crtcs[1]->base.enabled)
1083 mode1 = &rdev->mode_info.crtcs[1]->base.mode;
1084 /*
1085 * Set display0/1 priority up in the memory controller for
1086 * modes if the user specifies HIGH for displaypriority
1087 * option.
1088 */
1089 if (rdev->disp_priority == 2) {
1090 tmp = RREG32_MC(MC_MISC_LAT_TIMER);
1091 tmp &= ~MC_DISP1R_INIT_LAT_MASK;
1092 tmp &= ~MC_DISP0R_INIT_LAT_MASK;
1093 if (mode1)
1094 tmp |= (1 << MC_DISP1R_INIT_LAT_SHIFT);
1095 if (mode0)
1096 tmp |= (1 << MC_DISP0R_INIT_LAT_SHIFT);
1097 WREG32_MC(MC_MISC_LAT_TIMER, tmp);
1098 }
1099 rv515_bandwidth_avivo_update(rdev);
1100}
diff --git a/drivers/gpu/drm/radeon/rv515r.h b/drivers/gpu/drm/radeon/rv515r.h
new file mode 100644
index 000000000000..f3cf84039906
--- /dev/null
+++ b/drivers/gpu/drm/radeon/rv515r.h
@@ -0,0 +1,170 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef RV515R_H
29#define RV515R_H
30
31/* RV515 registers */
32#define PCIE_INDEX 0x0030
33#define PCIE_DATA 0x0034
34#define MC_IND_INDEX 0x0070
35#define MC_IND_WR_EN (1 << 24)
36#define MC_IND_DATA 0x0074
37#define RBBM_SOFT_RESET 0x00F0
38#define CONFIG_MEMSIZE 0x00F8
39#define HDP_FB_LOCATION 0x0134
40#define CP_CSQ_CNTL 0x0740
41#define CP_CSQ_MODE 0x0744
42#define CP_CSQ_ADDR 0x07F0
43#define CP_CSQ_DATA 0x07F4
44#define CP_CSQ_STAT 0x07F8
45#define CP_CSQ2_STAT 0x07FC
46#define RBBM_STATUS 0x0E40
47#define DST_PIPE_CONFIG 0x170C
48#define WAIT_UNTIL 0x1720
49#define WAIT_2D_IDLE (1 << 14)
50#define WAIT_3D_IDLE (1 << 15)
51#define WAIT_2D_IDLECLEAN (1 << 16)
52#define WAIT_3D_IDLECLEAN (1 << 17)
53#define ISYNC_CNTL 0x1724
54#define ISYNC_ANY2D_IDLE3D (1 << 0)
55#define ISYNC_ANY3D_IDLE2D (1 << 1)
56#define ISYNC_TRIG2D_IDLE3D (1 << 2)
57#define ISYNC_TRIG3D_IDLE2D (1 << 3)
58#define ISYNC_WAIT_IDLEGUI (1 << 4)
59#define ISYNC_CPSCRATCH_IDLEGUI (1 << 5)
60#define VAP_INDEX_OFFSET 0x208C
61#define VAP_PVS_STATE_FLUSH_REG 0x2284
62#define GB_ENABLE 0x4008
63#define GB_MSPOS0 0x4010
64#define MS_X0_SHIFT 0
65#define MS_Y0_SHIFT 4
66#define MS_X1_SHIFT 8
67#define MS_Y1_SHIFT 12
68#define MS_X2_SHIFT 16
69#define MS_Y2_SHIFT 20
70#define MSBD0_Y_SHIFT 24
71#define MSBD0_X_SHIFT 28
72#define GB_MSPOS1 0x4014
73#define MS_X3_SHIFT 0
74#define MS_Y3_SHIFT 4
75#define MS_X4_SHIFT 8
76#define MS_Y4_SHIFT 12
77#define MS_X5_SHIFT 16
78#define MS_Y5_SHIFT 20
79#define MSBD1_SHIFT 24
80#define GB_TILE_CONFIG 0x4018
81#define ENABLE_TILING (1 << 0)
82#define PIPE_COUNT_MASK 0x0000000E
83#define PIPE_COUNT_SHIFT 1
84#define TILE_SIZE_8 (0 << 4)
85#define TILE_SIZE_16 (1 << 4)
86#define TILE_SIZE_32 (2 << 4)
87#define SUBPIXEL_1_12 (0 << 16)
88#define SUBPIXEL_1_16 (1 << 16)
89#define GB_SELECT 0x401C
90#define GB_AA_CONFIG 0x4020
91#define GB_PIPE_SELECT 0x402C
92#define GA_ENHANCE 0x4274
93#define GA_DEADLOCK_CNTL (1 << 0)
94#define GA_FASTSYNC_CNTL (1 << 1)
95#define GA_POLY_MODE 0x4288
96#define FRONT_PTYPE_POINT (0 << 4)
97#define FRONT_PTYPE_LINE (1 << 4)
98#define FRONT_PTYPE_TRIANGE (2 << 4)
99#define BACK_PTYPE_POINT (0 << 7)
100#define BACK_PTYPE_LINE (1 << 7)
101#define BACK_PTYPE_TRIANGE (2 << 7)
102#define GA_ROUND_MODE 0x428C
103#define GEOMETRY_ROUND_TRUNC (0 << 0)
104#define GEOMETRY_ROUND_NEAREST (1 << 0)
105#define COLOR_ROUND_TRUNC (0 << 2)
106#define COLOR_ROUND_NEAREST (1 << 2)
107#define SU_REG_DEST 0x42C8
108#define RB3D_DSTCACHE_CTLSTAT 0x4E4C
109#define RB3D_DC_FLUSH (2 << 0)
110#define RB3D_DC_FREE (2 << 2)
111#define RB3D_DC_FINISH (1 << 4)
112#define ZB_ZCACHE_CTLSTAT 0x4F18
113#define ZC_FLUSH (1 << 0)
114#define ZC_FREE (1 << 1)
115#define DC_LB_MEMORY_SPLIT 0x6520
116#define DC_LB_MEMORY_SPLIT_MASK 0x00000003
117#define DC_LB_MEMORY_SPLIT_SHIFT 0
118#define DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0
119#define DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1
120#define DC_LB_MEMORY_SPLIT_D1_ONLY 2
121#define DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3
122#define DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2)
123#define DC_LB_DISP1_END_ADR_SHIFT 4
124#define DC_LB_DISP1_END_ADR_MASK 0x00007FF0
125#define D1MODE_PRIORITY_A_CNT 0x6548
126#define MODE_PRIORITY_MARK_MASK 0x00007FFF
127#define MODE_PRIORITY_OFF (1 << 16)
128#define MODE_PRIORITY_ALWAYS_ON (1 << 20)
129#define MODE_PRIORITY_FORCE_MASK (1 << 24)
130#define D1MODE_PRIORITY_B_CNT 0x654C
131#define LB_MAX_REQ_OUTSTANDING 0x6D58
132#define LB_D1_MAX_REQ_OUTSTANDING_MASK 0x0000000F
133#define LB_D1_MAX_REQ_OUTSTANDING_SHIFT 0
134#define LB_D2_MAX_REQ_OUTSTANDING_MASK 0x000F0000
135#define LB_D2_MAX_REQ_OUTSTANDING_SHIFT 16
136#define D2MODE_PRIORITY_A_CNT 0x6D48
137#define D2MODE_PRIORITY_B_CNT 0x6D4C
138
139/* ix[MC] registers */
140#define MC_FB_LOCATION 0x01
141#define MC_FB_START_MASK 0x0000FFFF
142#define MC_FB_START_SHIFT 0
143#define MC_FB_TOP_MASK 0xFFFF0000
144#define MC_FB_TOP_SHIFT 16
145#define MC_AGP_LOCATION 0x02
146#define MC_AGP_START_MASK 0x0000FFFF
147#define MC_AGP_START_SHIFT 0
148#define MC_AGP_TOP_MASK 0xFFFF0000
149#define MC_AGP_TOP_SHIFT 16
150#define MC_AGP_BASE 0x03
151#define MC_AGP_BASE_2 0x04
152#define MC_CNTL 0x5
153#define MEM_NUM_CHANNELS_MASK 0x00000003
154#define MC_STATUS 0x08
155#define MC_STATUS_IDLE (1 << 4)
156#define MC_MISC_LAT_TIMER 0x09
157#define MC_CPR_INIT_LAT_MASK 0x0000000F
158#define MC_VF_INIT_LAT_MASK 0x000000F0
159#define MC_DISP0R_INIT_LAT_MASK 0x00000F00
160#define MC_DISP0R_INIT_LAT_SHIFT 8
161#define MC_DISP1R_INIT_LAT_MASK 0x0000F000
162#define MC_DISP1R_INIT_LAT_SHIFT 12
163#define MC_FIXED_INIT_LAT_MASK 0x000F0000
164#define MC_E2R_INIT_LAT_MASK 0x00F00000
165#define SAME_PAGE_PRIO_MASK 0x0F000000
166#define MC_GLOBW_INIT_LAT_MASK 0xF0000000
167
168
169#endif
170
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index da50cc51ede3..21d8ffd57308 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -67,7 +67,7 @@ int rv770_mc_init(struct radeon_device *rdev)
67 "programming pipes. Bad things might happen.\n"); 67 "programming pipes. Bad things might happen.\n");
68 } 68 }
69 69
70 tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1; 70 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
71 tmp = REG_SET(R700_MC_FB_TOP, tmp >> 24); 71 tmp = REG_SET(R700_MC_FB_TOP, tmp >> 24);
72 tmp |= REG_SET(R700_MC_FB_BASE, rdev->mc.vram_location >> 24); 72 tmp |= REG_SET(R700_MC_FB_BASE, rdev->mc.vram_location >> 24);
73 WREG32(R700_MC_VM_FB_LOCATION, tmp); 73 WREG32(R700_MC_VM_FB_LOCATION, tmp);
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index c1c407f7cca3..6538d4236989 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -43,7 +43,6 @@
43#define TTM_BO_HASH_ORDER 13 43#define TTM_BO_HASH_ORDER 13
44 44
45static int ttm_bo_setup_vm(struct ttm_buffer_object *bo); 45static int ttm_bo_setup_vm(struct ttm_buffer_object *bo);
46static void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo);
47static int ttm_bo_swapout(struct ttm_mem_shrink *shrink); 46static int ttm_bo_swapout(struct ttm_mem_shrink *shrink);
48 47
49static inline uint32_t ttm_bo_type_flags(unsigned type) 48static inline uint32_t ttm_bo_type_flags(unsigned type)
@@ -224,6 +223,9 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
224 TTM_ASSERT_LOCKED(&bo->mutex); 223 TTM_ASSERT_LOCKED(&bo->mutex);
225 bo->ttm = NULL; 224 bo->ttm = NULL;
226 225
226 if (bdev->need_dma32)
227 page_flags |= TTM_PAGE_FLAG_DMA32;
228
227 switch (bo->type) { 229 switch (bo->type) {
228 case ttm_bo_type_device: 230 case ttm_bo_type_device:
229 if (zero_alloc) 231 if (zero_alloc)
@@ -304,6 +306,9 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
304 306
305 } 307 }
306 308
309 if (bdev->driver->move_notify)
310 bdev->driver->move_notify(bo, mem);
311
307 if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && 312 if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) &&
308 !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) 313 !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED))
309 ret = ttm_bo_move_ttm(bo, evict, no_wait, mem); 314 ret = ttm_bo_move_ttm(bo, evict, no_wait, mem);
@@ -655,31 +660,52 @@ retry_pre_get:
655 return 0; 660 return 0;
656} 661}
657 662
663static uint32_t ttm_bo_select_caching(struct ttm_mem_type_manager *man,
664 uint32_t cur_placement,
665 uint32_t proposed_placement)
666{
667 uint32_t caching = proposed_placement & TTM_PL_MASK_CACHING;
668 uint32_t result = proposed_placement & ~TTM_PL_MASK_CACHING;
669
670 /**
671 * Keep current caching if possible.
672 */
673
674 if ((cur_placement & caching) != 0)
675 result |= (cur_placement & caching);
676 else if ((man->default_caching & caching) != 0)
677 result |= man->default_caching;
678 else if ((TTM_PL_FLAG_CACHED & caching) != 0)
679 result |= TTM_PL_FLAG_CACHED;
680 else if ((TTM_PL_FLAG_WC & caching) != 0)
681 result |= TTM_PL_FLAG_WC;
682 else if ((TTM_PL_FLAG_UNCACHED & caching) != 0)
683 result |= TTM_PL_FLAG_UNCACHED;
684
685 return result;
686}
687
688
658static bool ttm_bo_mt_compatible(struct ttm_mem_type_manager *man, 689static bool ttm_bo_mt_compatible(struct ttm_mem_type_manager *man,
659 bool disallow_fixed, 690 bool disallow_fixed,
660 uint32_t mem_type, 691 uint32_t mem_type,
661 uint32_t mask, uint32_t *res_mask) 692 uint32_t proposed_placement,
693 uint32_t *masked_placement)
662{ 694{
663 uint32_t cur_flags = ttm_bo_type_flags(mem_type); 695 uint32_t cur_flags = ttm_bo_type_flags(mem_type);
664 696
665 if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) && disallow_fixed) 697 if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) && disallow_fixed)
666 return false; 698 return false;
667 699
668 if ((cur_flags & mask & TTM_PL_MASK_MEM) == 0) 700 if ((cur_flags & proposed_placement & TTM_PL_MASK_MEM) == 0)
669 return false; 701 return false;
670 702
671 if ((mask & man->available_caching) == 0) 703 if ((proposed_placement & man->available_caching) == 0)
672 return false; 704 return false;
673 if (mask & man->default_caching)
674 cur_flags |= man->default_caching;
675 else if (mask & TTM_PL_FLAG_CACHED)
676 cur_flags |= TTM_PL_FLAG_CACHED;
677 else if (mask & TTM_PL_FLAG_WC)
678 cur_flags |= TTM_PL_FLAG_WC;
679 else
680 cur_flags |= TTM_PL_FLAG_UNCACHED;
681 705
682 *res_mask = cur_flags; 706 cur_flags |= (proposed_placement & man->available_caching);
707
708 *masked_placement = cur_flags;
683 return true; 709 return true;
684} 710}
685 711
@@ -723,6 +749,9 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
723 if (!type_ok) 749 if (!type_ok)
724 continue; 750 continue;
725 751
752 cur_flags = ttm_bo_select_caching(man, bo->mem.placement,
753 cur_flags);
754
726 if (mem_type == TTM_PL_SYSTEM) 755 if (mem_type == TTM_PL_SYSTEM)
727 break; 756 break;
728 757
@@ -779,6 +808,9 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
779 proposed_placement, &cur_flags)) 808 proposed_placement, &cur_flags))
780 continue; 809 continue;
781 810
811 cur_flags = ttm_bo_select_caching(man, bo->mem.placement,
812 cur_flags);
813
782 ret = ttm_bo_mem_force_space(bdev, mem, mem_type, 814 ret = ttm_bo_mem_force_space(bdev, mem, mem_type,
783 interruptible, no_wait); 815 interruptible, no_wait);
784 816
@@ -1305,7 +1337,8 @@ EXPORT_SYMBOL(ttm_bo_device_release);
1305 1337
1306int ttm_bo_device_init(struct ttm_bo_device *bdev, 1338int ttm_bo_device_init(struct ttm_bo_device *bdev,
1307 struct ttm_mem_global *mem_glob, 1339 struct ttm_mem_global *mem_glob,
1308 struct ttm_bo_driver *driver, uint64_t file_page_offset) 1340 struct ttm_bo_driver *driver, uint64_t file_page_offset,
1341 bool need_dma32)
1309{ 1342{
1310 int ret = -EINVAL; 1343 int ret = -EINVAL;
1311 1344
@@ -1342,6 +1375,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,
1342 INIT_LIST_HEAD(&bdev->ddestroy); 1375 INIT_LIST_HEAD(&bdev->ddestroy);
1343 INIT_LIST_HEAD(&bdev->swap_lru); 1376 INIT_LIST_HEAD(&bdev->swap_lru);
1344 bdev->dev_mapping = NULL; 1377 bdev->dev_mapping = NULL;
1378 bdev->need_dma32 = need_dma32;
1345 ttm_mem_init_shrink(&bdev->shrink, ttm_bo_swapout); 1379 ttm_mem_init_shrink(&bdev->shrink, ttm_bo_swapout);
1346 ret = ttm_mem_register_shrink(mem_glob, &bdev->shrink); 1380 ret = ttm_mem_register_shrink(mem_glob, &bdev->shrink);
1347 if (unlikely(ret != 0)) { 1381 if (unlikely(ret != 0)) {
@@ -1419,6 +1453,7 @@ void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo)
1419 1453
1420 unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1); 1454 unmap_mapping_range(bdev->dev_mapping, offset, holelen, 1);
1421} 1455}
1456EXPORT_SYMBOL(ttm_bo_unmap_virtual);
1422 1457
1423static void ttm_bo_vm_insert_rb(struct ttm_buffer_object *bo) 1458static void ttm_bo_vm_insert_rb(struct ttm_buffer_object *bo)
1424{ 1459{
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index bdec583901eb..ce2e6f38ea01 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -136,7 +136,8 @@ static int ttm_copy_io_page(void *dst, void *src, unsigned long page)
136} 136}
137 137
138static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src, 138static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
139 unsigned long page) 139 unsigned long page,
140 pgprot_t prot)
140{ 141{
141 struct page *d = ttm_tt_get_page(ttm, page); 142 struct page *d = ttm_tt_get_page(ttm, page);
142 void *dst; 143 void *dst;
@@ -145,17 +146,35 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src,
145 return -ENOMEM; 146 return -ENOMEM;
146 147
147 src = (void *)((unsigned long)src + (page << PAGE_SHIFT)); 148 src = (void *)((unsigned long)src + (page << PAGE_SHIFT));
148 dst = kmap(d); 149
150#ifdef CONFIG_X86
151 dst = kmap_atomic_prot(d, KM_USER0, prot);
152#else
153 if (prot != PAGE_KERNEL)
154 dst = vmap(&d, 1, 0, prot);
155 else
156 dst = kmap(d);
157#endif
149 if (!dst) 158 if (!dst)
150 return -ENOMEM; 159 return -ENOMEM;
151 160
152 memcpy_fromio(dst, src, PAGE_SIZE); 161 memcpy_fromio(dst, src, PAGE_SIZE);
153 kunmap(d); 162
163#ifdef CONFIG_X86
164 kunmap_atomic(dst, KM_USER0);
165#else
166 if (prot != PAGE_KERNEL)
167 vunmap(dst);
168 else
169 kunmap(d);
170#endif
171
154 return 0; 172 return 0;
155} 173}
156 174
157static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, 175static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
158 unsigned long page) 176 unsigned long page,
177 pgprot_t prot)
159{ 178{
160 struct page *s = ttm_tt_get_page(ttm, page); 179 struct page *s = ttm_tt_get_page(ttm, page);
161 void *src; 180 void *src;
@@ -164,12 +183,28 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst,
164 return -ENOMEM; 183 return -ENOMEM;
165 184
166 dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT)); 185 dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT));
167 src = kmap(s); 186#ifdef CONFIG_X86
187 src = kmap_atomic_prot(s, KM_USER0, prot);
188#else
189 if (prot != PAGE_KERNEL)
190 src = vmap(&s, 1, 0, prot);
191 else
192 src = kmap(s);
193#endif
168 if (!src) 194 if (!src)
169 return -ENOMEM; 195 return -ENOMEM;
170 196
171 memcpy_toio(dst, src, PAGE_SIZE); 197 memcpy_toio(dst, src, PAGE_SIZE);
172 kunmap(s); 198
199#ifdef CONFIG_X86
200 kunmap_atomic(src, KM_USER0);
201#else
202 if (prot != PAGE_KERNEL)
203 vunmap(src);
204 else
205 kunmap(s);
206#endif
207
173 return 0; 208 return 0;
174} 209}
175 210
@@ -214,11 +249,17 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
214 249
215 for (i = 0; i < new_mem->num_pages; ++i) { 250 for (i = 0; i < new_mem->num_pages; ++i) {
216 page = i * dir + add; 251 page = i * dir + add;
217 if (old_iomap == NULL) 252 if (old_iomap == NULL) {
218 ret = ttm_copy_ttm_io_page(ttm, new_iomap, page); 253 pgprot_t prot = ttm_io_prot(old_mem->placement,
219 else if (new_iomap == NULL) 254 PAGE_KERNEL);
220 ret = ttm_copy_io_ttm_page(ttm, old_iomap, page); 255 ret = ttm_copy_ttm_io_page(ttm, new_iomap, page,
221 else 256 prot);
257 } else if (new_iomap == NULL) {
258 pgprot_t prot = ttm_io_prot(new_mem->placement,
259 PAGE_KERNEL);
260 ret = ttm_copy_io_ttm_page(ttm, old_iomap, page,
261 prot);
262 } else
222 ret = ttm_copy_io_page(new_iomap, old_iomap, page); 263 ret = ttm_copy_io_page(new_iomap, old_iomap, page);
223 if (ret) 264 if (ret)
224 goto out1; 265 goto out1;
@@ -509,8 +550,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
509 if (evict) { 550 if (evict) {
510 ret = ttm_bo_wait(bo, false, false, false); 551 ret = ttm_bo_wait(bo, false, false, false);
511 spin_unlock(&bo->lock); 552 spin_unlock(&bo->lock);
512 driver->sync_obj_unref(&bo->sync_obj); 553 if (tmp_obj)
513 554 driver->sync_obj_unref(&tmp_obj);
514 if (ret) 555 if (ret)
515 return ret; 556 return ret;
516 557
@@ -532,6 +573,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
532 573
533 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); 574 set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
534 spin_unlock(&bo->lock); 575 spin_unlock(&bo->lock);
576 if (tmp_obj)
577 driver->sync_obj_unref(&tmp_obj);
535 578
536 ret = ttm_buffer_object_transfer(bo, &ghost_obj); 579 ret = ttm_buffer_object_transfer(bo, &ghost_obj);
537 if (ret) 580 if (ret)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index 40b75032ea47..33de7637c0c6 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -101,6 +101,9 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
101 return VM_FAULT_NOPAGE; 101 return VM_FAULT_NOPAGE;
102 } 102 }
103 103
104 if (bdev->driver->fault_reserve_notify)
105 bdev->driver->fault_reserve_notify(bo);
106
104 /* 107 /*
105 * Wait for buffer data in transit, due to a pipelined 108 * Wait for buffer data in transit, due to a pipelined
106 * move. 109 * move.
@@ -327,7 +330,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
327 goto out_unref; 330 goto out_unref;
328 331
329 kmap_offset = dev_offset - bo->vm_node->start; 332 kmap_offset = dev_offset - bo->vm_node->start;
330 if (unlikely(kmap_offset) >= bo->num_pages) { 333 if (unlikely(kmap_offset >= bo->num_pages)) {
331 ret = -EFBIG; 334 ret = -EFBIG;
332 goto out_unref; 335 goto out_unref;
333 } 336 }
@@ -401,7 +404,7 @@ ssize_t ttm_bo_fbdev_io(struct ttm_buffer_object *bo, const char __user *wbuf,
401 bool dummy; 404 bool dummy;
402 405
403 kmap_offset = (*f_pos >> PAGE_SHIFT); 406 kmap_offset = (*f_pos >> PAGE_SHIFT);
404 if (unlikely(kmap_offset) >= bo->num_pages) 407 if (unlikely(kmap_offset >= bo->num_pages))
405 return -EFBIG; 408 return -EFBIG;
406 409
407 page_offset = *f_pos & ~PAGE_MASK; 410 page_offset = *f_pos & ~PAGE_MASK;
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 75dc8bd24592..b8b6c4a5f983 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -86,10 +86,16 @@ void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages)
86 unsigned long i; 86 unsigned long i;
87 87
88 for (i = 0; i < num_pages; ++i) { 88 for (i = 0; i < num_pages; ++i) {
89 if (pages[i]) { 89 struct page *page = pages[i];
90 unsigned long start = (unsigned long)page_address(pages[i]); 90 void *page_virtual;
91 flush_dcache_range(start, start + PAGE_SIZE); 91
92 } 92 if (unlikely(page == NULL))
93 continue;
94
95 page_virtual = kmap_atomic(page, KM_USER0);
96 flush_dcache_range((unsigned long) page_virtual,
97 (unsigned long) page_virtual + PAGE_SIZE);
98 kunmap_atomic(page_virtual, KM_USER0);
93 } 99 }
94#else 100#else
95 if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0) 101 if (on_each_cpu(ttm_tt_ipi_handler, NULL, 1) != 0)
@@ -131,10 +137,17 @@ static void ttm_tt_free_page_directory(struct ttm_tt *ttm)
131 137
132static struct page *ttm_tt_alloc_page(unsigned page_flags) 138static struct page *ttm_tt_alloc_page(unsigned page_flags)
133{ 139{
140 gfp_t gfp_flags = GFP_USER;
141
134 if (page_flags & TTM_PAGE_FLAG_ZERO_ALLOC) 142 if (page_flags & TTM_PAGE_FLAG_ZERO_ALLOC)
135 return alloc_page(GFP_HIGHUSER | __GFP_ZERO); 143 gfp_flags |= __GFP_ZERO;
144
145 if (page_flags & TTM_PAGE_FLAG_DMA32)
146 gfp_flags |= __GFP_DMA32;
147 else
148 gfp_flags |= __GFP_HIGHMEM;
136 149
137 return alloc_page(GFP_HIGHUSER); 150 return alloc_page(gfp_flags);
138} 151}
139 152
140static void ttm_tt_free_user_pages(struct ttm_tt *ttm) 153static void ttm_tt_free_user_pages(struct ttm_tt *ttm)
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index c248c1d37268..5935b8842e86 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -183,7 +183,7 @@ int via_enable_vblank(struct drm_device *dev, int crtc)
183 } 183 }
184 184
185 status = VIA_READ(VIA_REG_INTERRUPT); 185 status = VIA_READ(VIA_REG_INTERRUPT);
186 VIA_WRITE(VIA_REG_INTERRUPT, status & VIA_IRQ_VBLANK_ENABLE); 186 VIA_WRITE(VIA_REG_INTERRUPT, status | VIA_IRQ_VBLANK_ENABLE);
187 187
188 VIA_WRITE8(0x83d4, 0x11); 188 VIA_WRITE8(0x83d4, 0x11);
189 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) | 0x30); 189 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) | 0x30);
@@ -194,6 +194,10 @@ int via_enable_vblank(struct drm_device *dev, int crtc)
194void via_disable_vblank(struct drm_device *dev, int crtc) 194void via_disable_vblank(struct drm_device *dev, int crtc)
195{ 195{
196 drm_via_private_t *dev_priv = dev->dev_private; 196 drm_via_private_t *dev_priv = dev->dev_private;
197 u32 status;
198
199 status = VIA_READ(VIA_REG_INTERRUPT);
200 VIA_WRITE(VIA_REG_INTERRUPT, status & ~VIA_IRQ_VBLANK_ENABLE);
197 201
198 VIA_WRITE8(0x83d4, 0x11); 202 VIA_WRITE8(0x83d4, 0x11);
199 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) & ~0x30); 203 VIA_WRITE8(0x83d5, VIA_READ8(0x83d5) & ~0x30);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index f2c21d5d24e8..5eb10c2ce665 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1075,14 +1075,16 @@ EXPORT_SYMBOL_GPL(hid_report_raw_event);
1075 */ 1075 */
1076int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt) 1076int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt)
1077{ 1077{
1078 struct hid_report_enum *report_enum = hid->report_enum + type; 1078 struct hid_report_enum *report_enum;
1079 struct hid_driver *hdrv = hid->driver; 1079 struct hid_driver *hdrv;
1080 struct hid_report *report; 1080 struct hid_report *report;
1081 unsigned int i; 1081 unsigned int i;
1082 int ret; 1082 int ret;
1083 1083
1084 if (!hid || !hid->driver) 1084 if (!hid || !hid->driver)
1085 return -ENODEV; 1085 return -ENODEV;
1086 report_enum = hid->report_enum + type;
1087 hdrv = hid->driver;
1086 1088
1087 if (!size) { 1089 if (!size) {
1088 dbg_hid("empty report\n"); 1090 dbg_hid("empty report\n");
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 76c4bbe9dccb..3c1fcb7640ab 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -22,7 +22,6 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/mutex.h> 24#include <linux/mutex.h>
25#include <linux/smp_lock.h>
26#include <linux/spinlock.h> 25#include <linux/spinlock.h>
27#include <asm/unaligned.h> 26#include <asm/unaligned.h>
28#include <asm/byteorder.h> 27#include <asm/byteorder.h>
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 9e9421525fb9..215b2addddbb 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -527,8 +527,10 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
527 goto goodreturn; 527 goto goodreturn;
528 528
529 case HIDIOCGCOLLECTIONINDEX: 529 case HIDIOCGCOLLECTIONINDEX:
530 i = field->usage[uref->usage_index].collection_index;
531 unlock_kernel();
530 kfree(uref_multi); 532 kfree(uref_multi);
531 return field->usage[uref->usage_index].collection_index; 533 return i;
532 case HIDIOCGUSAGES: 534 case HIDIOCGUSAGES:
533 for (i = 0; i < uref_multi->num_values; i++) 535 for (i = 0; i < uref_multi->num_values; i++)
534 uref_multi->values[i] = 536 uref_multi->values[i] =
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 2d5016691d40..2e25b7a827d3 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -702,6 +702,23 @@ config SENSORS_SHT15
702 This driver can also be built as a module. If so, the module 702 This driver can also be built as a module. If so, the module
703 will be called sht15. 703 will be called sht15.
704 704
705config SENSORS_S3C
706 tristate "S3C24XX/S3C64XX Inbuilt ADC"
707 depends on ARCH_S3C2410 || ARCH_S3C64XX
708 help
709 If you say yes here you get support for the on-board ADCs of
710 the Samsung S3C24XX or S3C64XX series of SoC
711
712 This driver can also be built as a module. If so, the module
713 will be called s3c-hwmo.
714
715config SENSORS_S3C_RAW
716 bool "Include raw channel attributes in sysfs"
717 depends on SENSORS_S3C
718 help
719 Say Y here if you want to include raw copies of all the ADC
720 channels in sysfs.
721
705config SENSORS_SIS5595 722config SENSORS_SIS5595
706 tristate "Silicon Integrated Systems Corp. SiS5595" 723 tristate "Silicon Integrated Systems Corp. SiS5595"
707 depends on PCI 724 depends on PCI
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index b793dce6bed5..7f239a247c33 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -76,6 +76,7 @@ obj-$(CONFIG_SENSORS_MAX6650) += max6650.o
76obj-$(CONFIG_SENSORS_PC87360) += pc87360.o 76obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
77obj-$(CONFIG_SENSORS_PC87427) += pc87427.o 77obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
78obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o 78obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
79obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o
79obj-$(CONFIG_SENSORS_SHT15) += sht15.o 80obj-$(CONFIG_SENSORS_SHT15) += sht15.o
80obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o 81obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
81obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o 82obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index ad2b3431b725..7d3f15d32fdf 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -357,7 +357,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
357 { "AUX5 Fan", 39, 2, 60, 1, 0 }, 357 { "AUX5 Fan", 39, 2, 60, 1, 0 },
358 { NULL, 0, 0, 0, 0, 0 } } 358 { NULL, 0, 0, 0, 0, 0 } }
359 }, 359 },
360 { 0x0014, NULL /* Abit AB9 Pro, need DMI string */, { 360 { 0x0014, "AB9", /* + AB9 Pro */ {
361 { "CPU Core", 0, 0, 10, 1, 0 }, 361 { "CPU Core", 0, 0, 10, 1, 0 },
362 { "DDR", 1, 0, 10, 1, 0 }, 362 { "DDR", 1, 0, 10, 1, 0 },
363 { "DDR VTT", 2, 0, 10, 1, 0 }, 363 { "DDR VTT", 2, 0, 10, 1, 0 },
@@ -455,7 +455,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
455 { "AUX3 FAN", 37, 2, 60, 1, 0 }, 455 { "AUX3 FAN", 37, 2, 60, 1, 0 },
456 { NULL, 0, 0, 0, 0, 0 } } 456 { NULL, 0, 0, 0, 0, 0 } }
457 }, 457 },
458 { 0x0018, NULL /* Unknown, need DMI string */, { 458 { 0x0018, "AB9 QuadGT", {
459 { "CPU Core", 0, 0, 10, 1, 0 }, 459 { "CPU Core", 0, 0, 10, 1, 0 },
460 { "DDR2", 1, 0, 20, 1, 0 }, 460 { "DDR2", 1, 0, 20, 1, 0 },
461 { "DDR2 VTT", 2, 0, 10, 1, 0 }, 461 { "DDR2 VTT", 2, 0, 10, 1, 0 },
@@ -564,7 +564,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
564 { "AUX3 Fan", 36, 2, 60, 1, 0 }, 564 { "AUX3 Fan", 36, 2, 60, 1, 0 },
565 { NULL, 0, 0, 0, 0, 0 } } 565 { NULL, 0, 0, 0, 0, 0 } }
566 }, 566 },
567 { 0x001C, NULL /* Unknown, need DMI string */, { 567 { 0x001C, "IX38 QuadGT", {
568 { "CPU Core", 0, 0, 10, 1, 0 }, 568 { "CPU Core", 0, 0, 10, 1, 0 },
569 { "DDR2", 1, 0, 20, 1, 0 }, 569 { "DDR2", 1, 0, 20, 1, 0 },
570 { "DDR2 VTT", 2, 0, 10, 1, 0 }, 570 { "DDR2 VTT", 2, 0, 10, 1, 0 },
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index bff0103610c1..fe4fa29c9219 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -593,7 +593,11 @@ static int atk_add_sensor(struct atk_data *data, union acpi_object *obj)
593 sensor->data = data; 593 sensor->data = data;
594 sensor->id = flags->integer.value; 594 sensor->id = flags->integer.value;
595 sensor->limit1 = limit1->integer.value; 595 sensor->limit1 = limit1->integer.value;
596 sensor->limit2 = limit2->integer.value; 596 if (data->old_interface)
597 sensor->limit2 = limit2->integer.value;
598 else
599 /* The upper limit is expressed as delta from lower limit */
600 sensor->limit2 = sensor->limit1 + limit2->integer.value;
597 601
598 snprintf(sensor->input_attr_name, ATTR_NAME_SIZE, 602 snprintf(sensor->input_attr_name, ATTR_NAME_SIZE,
599 "%s%d_input", base_name, start + *num); 603 "%s%d_input", base_name, start + *num);
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index 86142a858238..58f66be61b1f 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -418,6 +418,7 @@ static ssize_t set_div(struct device *dev, struct device_attribute *devattr,
418 data->count = 3; 418 data->count = 3;
419 break; 419 break;
420 default: 420 default:
421 mutex_unlock(&data->update_lock);
421 dev_err(&client->dev, 422 dev_err(&client->dev,
422 "illegal value for fan divider (%d)\n", div); 423 "illegal value for fan divider (%d)\n", div);
423 return -EINVAL; 424 return -EINVAL;
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
new file mode 100644
index 000000000000..3a524f2fe493
--- /dev/null
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -0,0 +1,405 @@
1/* linux/drivers/hwmon/s3c-hwmon.c
2 *
3 * Copyright (C) 2005, 2008, 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX/S3C64XX ADC hwmon support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
23#include <linux/module.h>
24#include <linux/slab.h>
25#include <linux/delay.h>
26#include <linux/io.h>
27#include <linux/init.h>
28#include <linux/err.h>
29#include <linux/clk.h>
30#include <linux/interrupt.h>
31#include <linux/platform_device.h>
32
33#include <linux/hwmon.h>
34#include <linux/hwmon-sysfs.h>
35
36#include <plat/adc.h>
37#include <plat/hwmon.h>
38
39struct s3c_hwmon_attr {
40 struct sensor_device_attribute in;
41 struct sensor_device_attribute label;
42 char in_name[12];
43 char label_name[12];
44};
45
46/**
47 * struct s3c_hwmon - ADC hwmon client information
48 * @lock: Access lock to serialise the conversions.
49 * @client: The client we registered with the S3C ADC core.
50 * @hwmon_dev: The hwmon device we created.
51 * @attr: The holders for the channel attributes.
52*/
53struct s3c_hwmon {
54 struct semaphore lock;
55 struct s3c_adc_client *client;
56 struct device *hwmon_dev;
57
58 struct s3c_hwmon_attr attrs[8];
59};
60
61/**
62 * s3c_hwmon_read_ch - read a value from a given adc channel.
63 * @dev: The device.
64 * @hwmon: Our state.
65 * @channel: The channel we're reading from.
66 *
67 * Read a value from the @channel with the proper locking and sleep until
68 * either the read completes or we timeout awaiting the ADC core to get
69 * back to us.
70 */
71static int s3c_hwmon_read_ch(struct device *dev,
72 struct s3c_hwmon *hwmon, int channel)
73{
74 int ret;
75
76 ret = down_interruptible(&hwmon->lock);
77 if (ret < 0)
78 return ret;
79
80 dev_dbg(dev, "reading channel %d\n", channel);
81
82 ret = s3c_adc_read(hwmon->client, channel);
83 up(&hwmon->lock);
84
85 return ret;
86}
87
88#ifdef CONFIG_SENSORS_S3C_RAW
89/**
90 * s3c_hwmon_show_raw - show a conversion from the raw channel number.
91 * @dev: The device that the attribute belongs to.
92 * @attr: The attribute being read.
93 * @buf: The result buffer.
94 *
95 * This show deals with the raw attribute, registered for each possible
96 * ADC channel. This does a conversion and returns the raw (un-scaled)
97 * value returned from the hardware.
98 */
99static ssize_t s3c_hwmon_show_raw(struct device *dev,
100 struct device_attribute *attr, char *buf)
101{
102 struct s3c_hwmon *adc = platform_get_drvdata(to_platform_device(dev));
103 struct sensor_device_attribute *sa = to_sensor_dev_attr(attr);
104 int ret;
105
106 ret = s3c_hwmon_read_ch(dev, adc, sa->index);
107
108 return (ret < 0) ? ret : snprintf(buf, PAGE_SIZE, "%d\n", ret);
109}
110
111#define DEF_ADC_ATTR(x) \
112 static SENSOR_DEVICE_ATTR(adc##x##_raw, S_IRUGO, s3c_hwmon_show_raw, NULL, x)
113
114DEF_ADC_ATTR(0);
115DEF_ADC_ATTR(1);
116DEF_ADC_ATTR(2);
117DEF_ADC_ATTR(3);
118DEF_ADC_ATTR(4);
119DEF_ADC_ATTR(5);
120DEF_ADC_ATTR(6);
121DEF_ADC_ATTR(7);
122
123static struct attribute *s3c_hwmon_attrs[9] = {
124 &sensor_dev_attr_adc0_raw.dev_attr.attr,
125 &sensor_dev_attr_adc1_raw.dev_attr.attr,
126 &sensor_dev_attr_adc2_raw.dev_attr.attr,
127 &sensor_dev_attr_adc3_raw.dev_attr.attr,
128 &sensor_dev_attr_adc4_raw.dev_attr.attr,
129 &sensor_dev_attr_adc5_raw.dev_attr.attr,
130 &sensor_dev_attr_adc6_raw.dev_attr.attr,
131 &sensor_dev_attr_adc7_raw.dev_attr.attr,
132 NULL,
133};
134
135static struct attribute_group s3c_hwmon_attrgroup = {
136 .attrs = s3c_hwmon_attrs,
137};
138
139static inline int s3c_hwmon_add_raw(struct device *dev)
140{
141 return sysfs_create_group(&dev->kobj, &s3c_hwmon_attrgroup);
142}
143
144static inline void s3c_hwmon_remove_raw(struct device *dev)
145{
146 sysfs_remove_group(&dev->kobj, &s3c_hwmon_attrgroup);
147}
148
149#else
150
151static inline int s3c_hwmon_add_raw(struct device *dev) { return 0; }
152static inline void s3c_hwmon_remove_raw(struct device *dev) { }
153
154#endif /* CONFIG_SENSORS_S3C_RAW */
155
156/**
157 * s3c_hwmon_ch_show - show value of a given channel
158 * @dev: The device that the attribute belongs to.
159 * @attr: The attribute being read.
160 * @buf: The result buffer.
161 *
162 * Read a value from the ADC and scale it before returning it to the
163 * caller. The scale factor is gained from the channel configuration
164 * passed via the platform data when the device was registered.
165 */
166static ssize_t s3c_hwmon_ch_show(struct device *dev,
167 struct device_attribute *attr,
168 char *buf)
169{
170 struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr);
171 struct s3c_hwmon *hwmon = platform_get_drvdata(to_platform_device(dev));
172 struct s3c_hwmon_pdata *pdata = dev->platform_data;
173 struct s3c_hwmon_chcfg *cfg;
174 int ret;
175
176 cfg = pdata->in[sen_attr->index];
177
178 ret = s3c_hwmon_read_ch(dev, hwmon, sen_attr->index);
179 if (ret < 0)
180 return ret;
181
182 ret *= cfg->mult;
183 ret = DIV_ROUND_CLOSEST(ret, cfg->div);
184
185 return snprintf(buf, PAGE_SIZE, "%d\n", ret);
186}
187
188/**
189 * s3c_hwmon_label_show - show label name of the given channel.
190 * @dev: The device that the attribute belongs to.
191 * @attr: The attribute being read.
192 * @buf: The result buffer.
193 *
194 * Return the label name of a given channel
195 */
196static ssize_t s3c_hwmon_label_show(struct device *dev,
197 struct device_attribute *attr,
198 char *buf)
199{
200 struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr);
201 struct s3c_hwmon_pdata *pdata = dev->platform_data;
202 struct s3c_hwmon_chcfg *cfg;
203
204 cfg = pdata->in[sen_attr->index];
205
206 return snprintf(buf, PAGE_SIZE, "%s\n", cfg->name);
207}
208
209/**
210 * s3c_hwmon_create_attr - create hwmon attribute for given channel.
211 * @dev: The device to create the attribute on.
212 * @cfg: The channel configuration passed from the platform data.
213 * @channel: The ADC channel number to process.
214 *
215 * Create the scaled attribute for use with hwmon from the specified
216 * platform data in @pdata. The sysfs entry is handled by the routine
217 * s3c_hwmon_ch_show().
218 *
219 * The attribute name is taken from the configuration data if present
220 * otherwise the name is taken by concatenating in_ with the channel
221 * number.
222 */
223static int s3c_hwmon_create_attr(struct device *dev,
224 struct s3c_hwmon_chcfg *cfg,
225 struct s3c_hwmon_attr *attrs,
226 int channel)
227{
228 struct sensor_device_attribute *attr;
229 int ret;
230
231 snprintf(attrs->in_name, sizeof(attrs->in_name), "in%d_input", channel);
232
233 attr = &attrs->in;
234 attr->index = channel;
235 attr->dev_attr.attr.name = attrs->in_name;
236 attr->dev_attr.attr.mode = S_IRUGO;
237 attr->dev_attr.attr.owner = THIS_MODULE;
238 attr->dev_attr.show = s3c_hwmon_ch_show;
239
240 ret = device_create_file(dev, &attr->dev_attr);
241 if (ret < 0) {
242 dev_err(dev, "failed to create input attribute\n");
243 return ret;
244 }
245
246 /* if this has a name, add a label */
247 if (cfg->name) {
248 snprintf(attrs->label_name, sizeof(attrs->label_name),
249 "in%d_label", channel);
250
251 attr = &attrs->label;
252 attr->index = channel;
253 attr->dev_attr.attr.name = attrs->label_name;
254 attr->dev_attr.attr.mode = S_IRUGO;
255 attr->dev_attr.attr.owner = THIS_MODULE;
256 attr->dev_attr.show = s3c_hwmon_label_show;
257
258 ret = device_create_file(dev, &attr->dev_attr);
259 if (ret < 0) {
260 device_remove_file(dev, &attrs->in.dev_attr);
261 dev_err(dev, "failed to create label attribute\n");
262 }
263 }
264
265 return ret;
266}
267
268static void s3c_hwmon_remove_attr(struct device *dev,
269 struct s3c_hwmon_attr *attrs)
270{
271 device_remove_file(dev, &attrs->in.dev_attr);
272 device_remove_file(dev, &attrs->label.dev_attr);
273}
274
275/**
276 * s3c_hwmon_probe - device probe entry.
277 * @dev: The device being probed.
278*/
279static int __devinit s3c_hwmon_probe(struct platform_device *dev)
280{
281 struct s3c_hwmon_pdata *pdata = dev->dev.platform_data;
282 struct s3c_hwmon *hwmon;
283 int ret = 0;
284 int i;
285
286 if (!pdata) {
287 dev_err(&dev->dev, "no platform data supplied\n");
288 return -EINVAL;
289 }
290
291 hwmon = kzalloc(sizeof(struct s3c_hwmon), GFP_KERNEL);
292 if (hwmon == NULL) {
293 dev_err(&dev->dev, "no memory\n");
294 return -ENOMEM;
295 }
296
297 platform_set_drvdata(dev, hwmon);
298
299 init_MUTEX(&hwmon->lock);
300
301 /* Register with the core ADC driver. */
302
303 hwmon->client = s3c_adc_register(dev, NULL, NULL, 0);
304 if (IS_ERR(hwmon->client)) {
305 dev_err(&dev->dev, "cannot register adc\n");
306 ret = PTR_ERR(hwmon->client);
307 goto err_mem;
308 }
309
310 /* add attributes for our adc devices. */
311
312 ret = s3c_hwmon_add_raw(&dev->dev);
313 if (ret)
314 goto err_registered;
315
316 /* register with the hwmon core */
317
318 hwmon->hwmon_dev = hwmon_device_register(&dev->dev);
319 if (IS_ERR(hwmon->hwmon_dev)) {
320 dev_err(&dev->dev, "error registering with hwmon\n");
321 ret = PTR_ERR(hwmon->hwmon_dev);
322 goto err_raw_attribute;
323 }
324
325 for (i = 0; i < ARRAY_SIZE(pdata->in); i++) {
326 if (!pdata->in[i])
327 continue;
328
329 if (pdata->in[i]->mult >= 0x10000)
330 dev_warn(&dev->dev,
331 "channel %d multiplier too large\n",
332 i);
333
334 ret = s3c_hwmon_create_attr(&dev->dev, pdata->in[i],
335 &hwmon->attrs[i], i);
336 if (ret) {
337 dev_err(&dev->dev,
338 "error creating channel %d\n", i);
339
340 for (i--; i >= 0; i--)
341 s3c_hwmon_remove_attr(&dev->dev,
342 &hwmon->attrs[i]);
343
344 goto err_hwmon_register;
345 }
346 }
347
348 return 0;
349
350 err_hwmon_register:
351 hwmon_device_unregister(hwmon->hwmon_dev);
352
353 err_raw_attribute:
354 s3c_hwmon_remove_raw(&dev->dev);
355
356 err_registered:
357 s3c_adc_release(hwmon->client);
358
359 err_mem:
360 kfree(hwmon);
361 return ret;
362}
363
364static int __devexit s3c_hwmon_remove(struct platform_device *dev)
365{
366 struct s3c_hwmon *hwmon = platform_get_drvdata(dev);
367 int i;
368
369 s3c_hwmon_remove_raw(&dev->dev);
370
371 for (i = 0; i < ARRAY_SIZE(hwmon->attrs); i++)
372 s3c_hwmon_remove_attr(&dev->dev, &hwmon->attrs[i]);
373
374 hwmon_device_unregister(hwmon->hwmon_dev);
375 s3c_adc_release(hwmon->client);
376
377 return 0;
378}
379
380static struct platform_driver s3c_hwmon_driver = {
381 .driver = {
382 .name = "s3c-hwmon",
383 .owner = THIS_MODULE,
384 },
385 .probe = s3c_hwmon_probe,
386 .remove = __devexit_p(s3c_hwmon_remove),
387};
388
389static int __init s3c_hwmon_init(void)
390{
391 return platform_driver_register(&s3c_hwmon_driver);
392}
393
394static void __exit s3c_hwmon_exit(void)
395{
396 platform_driver_unregister(&s3c_hwmon_driver);
397}
398
399module_init(s3c_hwmon_init);
400module_exit(s3c_hwmon_exit);
401
402MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
403MODULE_DESCRIPTION("S3C ADC HWMon driver");
404MODULE_LICENSE("GPL v2");
405MODULE_ALIAS("platform:s3c-hwmon");
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 56cd6004da36..6290a259456e 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -257,7 +257,7 @@ static inline int sht15_update_single_val(struct sht15_data *data,
257 (data->flag == SHT15_READING_NOTHING), 257 (data->flag == SHT15_READING_NOTHING),
258 msecs_to_jiffies(timeout_msecs)); 258 msecs_to_jiffies(timeout_msecs));
259 if (ret == 0) {/* timeout occurred */ 259 if (ret == 0) {/* timeout occurred */
260 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));; 260 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));
261 sht15_connection_reset(data); 261 sht15_connection_reset(data);
262 return -ETIME; 262 return -ETIME;
263 } 263 }
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index a92dbb97ee99..ba75bfcf14ce 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -86,6 +86,7 @@ superio_exit(void)
86#define SUPERIO_REG_ACT 0x30 86#define SUPERIO_REG_ACT 0x30
87#define SUPERIO_REG_BASE 0x60 87#define SUPERIO_REG_BASE 0x60
88#define SUPERIO_REG_DEVID 0x20 88#define SUPERIO_REG_DEVID 0x20
89#define SUPERIO_REG_DEVREV 0x21
89 90
90/* Logical device registers */ 91/* Logical device registers */
91 92
@@ -429,6 +430,9 @@ static int __init smsc47m1_find(unsigned short *addr,
429 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it 430 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it
430 * supports a 3rd fan, and the pin configuration registers are 431 * supports a 3rd fan, and the pin configuration registers are
431 * unfortunately different. 432 * unfortunately different.
433 * The LPC47M233 has the same device id (0x6B) but is not compatible.
434 * We check the high bit of the device revision register to
435 * differentiate them.
432 */ 436 */
433 switch (val) { 437 switch (val) {
434 case 0x51: 438 case 0x51:
@@ -448,6 +452,13 @@ static int __init smsc47m1_find(unsigned short *addr,
448 sio_data->type = smsc47m1; 452 sio_data->type = smsc47m1;
449 break; 453 break;
450 case 0x6B: 454 case 0x6B:
455 if (superio_inb(SUPERIO_REG_DEVREV) & 0x80) {
456 pr_debug(DRVNAME ": "
457 "Found SMSC LPC47M233, unsupported\n");
458 superio_exit();
459 return -ENODEV;
460 }
461
451 pr_info(DRVNAME ": Found SMSC LPC47M292\n"); 462 pr_info(DRVNAME ": Found SMSC LPC47M292\n");
452 sio_data->type = smsc47m2; 463 sio_data->type = smsc47m2;
453 break; 464 break;
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 3fae3a91ce5b..c89687a10835 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -187,6 +187,11 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev)
187 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh); 187 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh);
188 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl); 188 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl);
189 189
190 /* Respond at reserved "SMBus Host" slave address" (and zero);
191 * we seem to have no option to not respond...
192 */
193 davinci_i2c_write_reg(dev, DAVINCI_I2C_OAR_REG, 0x08);
194
190 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk); 195 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk);
191 dev_dbg(dev->dev, "PSC = %d\n", 196 dev_dbg(dev->dev, "PSC = %d\n",
192 davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG)); 197 davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG));
@@ -387,7 +392,7 @@ static void terminate_write(struct davinci_i2c_dev *dev)
387 davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w); 392 davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
388 393
389 if (!dev->terminate) 394 if (!dev->terminate)
390 dev_err(dev->dev, "TDR IRQ while no data to send\n"); 395 dev_dbg(dev->dev, "TDR IRQ while no data to send\n");
391} 396}
392 397
393/* 398/*
@@ -473,9 +478,14 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
473 break; 478 break;
474 479
475 case DAVINCI_I2C_IVR_AAS: 480 case DAVINCI_I2C_IVR_AAS:
476 dev_warn(dev->dev, "Address as slave interrupt\n"); 481 dev_dbg(dev->dev, "Address as slave interrupt\n");
477 }/* switch */ 482 break;
478 }/* while */ 483
484 default:
485 dev_warn(dev->dev, "Unrecognized irq stat %d\n", stat);
486 break;
487 }
488 }
479 489
480 return count ? IRQ_HANDLED : IRQ_NONE; 490 return count ? IRQ_HANDLED : IRQ_NONE;
481} 491}
@@ -505,7 +515,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
505 return -ENODEV; 515 return -ENODEV;
506 } 516 }
507 517
508 ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, 518 ioarea = request_mem_region(mem->start, resource_size(mem),
509 pdev->name); 519 pdev->name);
510 if (!ioarea) { 520 if (!ioarea) {
511 dev_err(&pdev->dev, "I2C region already claimed\n"); 521 dev_err(&pdev->dev, "I2C region already claimed\n");
@@ -523,7 +533,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
523 dev->irq = irq->start; 533 dev->irq = irq->start;
524 platform_set_drvdata(pdev, dev); 534 platform_set_drvdata(pdev, dev);
525 535
526 dev->clk = clk_get(&pdev->dev, "I2CCLK"); 536 dev->clk = clk_get(&pdev->dev, NULL);
527 if (IS_ERR(dev->clk)) { 537 if (IS_ERR(dev->clk)) {
528 r = -ENODEV; 538 r = -ENODEV;
529 goto err_free_mem; 539 goto err_free_mem;
@@ -568,7 +578,7 @@ err_free_mem:
568 put_device(&pdev->dev); 578 put_device(&pdev->dev);
569 kfree(dev); 579 kfree(dev);
570err_release_region: 580err_release_region:
571 release_mem_region(mem->start, (mem->end - mem->start) + 1); 581 release_mem_region(mem->start, resource_size(mem));
572 582
573 return r; 583 return r;
574} 584}
@@ -591,7 +601,7 @@ static int davinci_i2c_remove(struct platform_device *pdev)
591 kfree(dev); 601 kfree(dev);
592 602
593 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 603 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
594 release_mem_region(mem->start, (mem->end - mem->start) + 1); 604 release_mem_region(mem->start, resource_size(mem));
595 return 0; 605 return 0;
596} 606}
597 607
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index ad8d2010c921..d258b02aef44 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -672,9 +672,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
672 break; 672 break;
673 } 673 }
674 674
675 err = 0;
676complete:
675 omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat); 677 omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat);
676 678
677 err = 0;
678 if (stat & OMAP_I2C_STAT_NACK) { 679 if (stat & OMAP_I2C_STAT_NACK) {
679 err |= OMAP_I2C_STAT_NACK; 680 err |= OMAP_I2C_STAT_NACK;
680 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 681 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
@@ -685,16 +686,19 @@ omap_i2c_isr(int this_irq, void *dev_id)
685 err |= OMAP_I2C_STAT_AL; 686 err |= OMAP_I2C_STAT_AL;
686 } 687 }
687 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | 688 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
688 OMAP_I2C_STAT_AL)) 689 OMAP_I2C_STAT_AL)) {
689 omap_i2c_complete_cmd(dev, err); 690 omap_i2c_complete_cmd(dev, err);
691 return IRQ_HANDLED;
692 }
690 if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) { 693 if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) {
691 u8 num_bytes = 1; 694 u8 num_bytes = 1;
692 if (dev->fifo_size) { 695 if (dev->fifo_size) {
693 if (stat & OMAP_I2C_STAT_RRDY) 696 if (stat & OMAP_I2C_STAT_RRDY)
694 num_bytes = dev->fifo_size; 697 num_bytes = dev->fifo_size;
695 else 698 else /* read RXSTAT on RDR interrupt */
696 num_bytes = omap_i2c_read_reg(dev, 699 num_bytes = (omap_i2c_read_reg(dev,
697 OMAP_I2C_BUFSTAT_REG); 700 OMAP_I2C_BUFSTAT_REG)
701 >> 8) & 0x3F;
698 } 702 }
699 while (num_bytes) { 703 while (num_bytes) {
700 num_bytes--; 704 num_bytes--;
@@ -731,9 +735,10 @@ omap_i2c_isr(int this_irq, void *dev_id)
731 if (dev->fifo_size) { 735 if (dev->fifo_size) {
732 if (stat & OMAP_I2C_STAT_XRDY) 736 if (stat & OMAP_I2C_STAT_XRDY)
733 num_bytes = dev->fifo_size; 737 num_bytes = dev->fifo_size;
734 else 738 else /* read TXSTAT on XDR interrupt */
735 num_bytes = omap_i2c_read_reg(dev, 739 num_bytes = omap_i2c_read_reg(dev,
736 OMAP_I2C_BUFSTAT_REG); 740 OMAP_I2C_BUFSTAT_REG)
741 & 0x3F;
737 } 742 }
738 while (num_bytes) { 743 while (num_bytes) {
739 num_bytes--; 744 num_bytes--;
@@ -760,6 +765,27 @@ omap_i2c_isr(int this_irq, void *dev_id)
760 "data to send\n"); 765 "data to send\n");
761 break; 766 break;
762 } 767 }
768
769 /*
770 * OMAP3430 Errata 1.153: When an XRDY/XDR
771 * is hit, wait for XUDF before writing data
772 * to DATA_REG. Otherwise some data bytes can
773 * be lost while transferring them from the
774 * memory to the I2C interface.
775 */
776
777 if (cpu_is_omap34xx()) {
778 while (!(stat & OMAP_I2C_STAT_XUDF)) {
779 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {
780 omap_i2c_ack_stat(dev, stat & (OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
781 err |= OMAP_I2C_STAT_XUDF;
782 goto complete;
783 }
784 cpu_relax();
785 stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
786 }
787 }
788
763 omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w); 789 omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w);
764 } 790 }
765 omap_i2c_ack_stat(dev, 791 omap_i2c_ack_stat(dev,
@@ -806,7 +832,7 @@ omap_i2c_probe(struct platform_device *pdev)
806 return -ENODEV; 832 return -ENODEV;
807 } 833 }
808 834
809 ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, 835 ioarea = request_mem_region(mem->start, resource_size(mem),
810 pdev->name); 836 pdev->name);
811 if (!ioarea) { 837 if (!ioarea) {
812 dev_err(&pdev->dev, "I2C region already claimed\n"); 838 dev_err(&pdev->dev, "I2C region already claimed\n");
@@ -879,7 +905,7 @@ omap_i2c_probe(struct platform_device *pdev)
879 i2c_set_adapdata(adap, dev); 905 i2c_set_adapdata(adap, dev);
880 adap->owner = THIS_MODULE; 906 adap->owner = THIS_MODULE;
881 adap->class = I2C_CLASS_HWMON; 907 adap->class = I2C_CLASS_HWMON;
882 strncpy(adap->name, "OMAP I2C adapter", sizeof(adap->name)); 908 strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
883 adap->algo = &omap_i2c_algo; 909 adap->algo = &omap_i2c_algo;
884 adap->dev.parent = &pdev->dev; 910 adap->dev.parent = &pdev->dev;
885 911
@@ -905,7 +931,7 @@ err_free_mem:
905 platform_set_drvdata(pdev, NULL); 931 platform_set_drvdata(pdev, NULL);
906 kfree(dev); 932 kfree(dev);
907err_release_region: 933err_release_region:
908 release_mem_region(mem->start, (mem->end - mem->start) + 1); 934 release_mem_region(mem->start, resource_size(mem));
909 935
910 return r; 936 return r;
911} 937}
@@ -925,7 +951,7 @@ omap_i2c_remove(struct platform_device *pdev)
925 iounmap(dev->base); 951 iounmap(dev->base);
926 kfree(dev); 952 kfree(dev);
927 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 953 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
928 release_mem_region(mem->start, (mem->end - mem->start) + 1); 954 release_mem_region(mem->start, resource_size(mem));
929 return 0; 955 return 0;
930} 956}
931 957
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 8f42a4536cdf..20bb0ceb027b 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -763,11 +763,6 @@ static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c)
763 dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq); 763 dev_info(i2c->dev, "bus frequency set to %d KHz\n", freq);
764 dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon); 764 dev_dbg(i2c->dev, "S3C2410_IICCON=0x%02lx\n", iicon);
765 765
766 /* check for s3c2440 i2c controller */
767
768 if (s3c24xx_i2c_is2440(i2c))
769 writel(0x0, i2c->regs + S3C2440_IICLC);
770
771 return 0; 766 return 0;
772} 767}
773 768
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 1c01083b01b5..820487d0d5c7 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -563,7 +563,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
563 goto err_irq; 563 goto err_irq;
564 } 564 }
565 565
566 size = (res->end - res->start) + 1; 566 size = resource_size(res);
567 567
568 pd->reg = ioremap(res->start, size); 568 pd->reg = ioremap(res->start, size);
569 if (pd->reg == NULL) { 569 if (pd->reg == NULL) {
@@ -637,7 +637,7 @@ static void __exit sh_mobile_i2c_adap_exit(void)
637 platform_driver_unregister(&sh_mobile_i2c_driver); 637 platform_driver_unregister(&sh_mobile_i2c_driver);
638} 638}
639 639
640module_init(sh_mobile_i2c_adap_init); 640subsys_initcall(sh_mobile_i2c_adap_init);
641module_exit(sh_mobile_i2c_adap_exit); 641module_exit(sh_mobile_i2c_adap_exit);
642 642
643MODULE_DESCRIPTION("SuperH Mobile I2C Bus Controller driver"); 643MODULE_DESCRIPTION("SuperH Mobile I2C Bus Controller driver");
diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c
index 042fda295f3a..6407f47bda82 100644
--- a/drivers/i2c/busses/i2c-simtec.c
+++ b/drivers/i2c/busses/i2c-simtec.c
@@ -92,7 +92,7 @@ static int simtec_i2c_probe(struct platform_device *dev)
92 goto err; 92 goto err;
93 } 93 }
94 94
95 size = (res->end-res->start)+1; 95 size = resource_size(res);
96 96
97 pd->ioarea = request_mem_region(res->start, size, dev->name); 97 pd->ioarea = request_mem_region(res->start, size, dev->name);
98 if (pd->ioarea == NULL) { 98 if (pd->ioarea == NULL) {
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index 1a9cc135219f..b96f3025e588 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -27,7 +27,7 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28 28
29#define TSL2550_DRV_NAME "tsl2550" 29#define TSL2550_DRV_NAME "tsl2550"
30#define DRIVER_VERSION "1.1.1" 30#define DRIVER_VERSION "1.1.2"
31 31
32/* 32/*
33 * Defines 33 * Defines
@@ -189,13 +189,16 @@ static int tsl2550_calculate_lux(u8 ch0, u8 ch1)
189 u8 r = 128; 189 u8 r = 128;
190 190
191 /* Avoid division by 0 and count 1 cannot be greater than count 0 */ 191 /* Avoid division by 0 and count 1 cannot be greater than count 0 */
192 if (c0 && (c1 <= c0)) 192 if (c1 <= c0)
193 r = c1 * 128 / c0; 193 if (c0) {
194 r = c1 * 128 / c0;
195
196 /* Calculate LUX */
197 lux = ((c0 - c1) * ratio_lut[r]) / 256;
198 } else
199 lux = 0;
194 else 200 else
195 return -1; 201 return -EAGAIN;
196
197 /* Calculate LUX */
198 lux = ((c0 - c1) * ratio_lut[r]) / 256;
199 202
200 /* LUX range check */ 203 /* LUX range check */
201 return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux; 204 return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux;
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 695181120cdb..7f878017b736 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -455,6 +455,7 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
455 455
456 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 456 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
457 rq->special = cmd; 457 rq->special = cmd;
458 cmd->rq = rq;
458} 459}
459 460
460ide_devset_get(multcount, mult_count); 461ide_devset_get(multcount, mult_count);
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 013dc595fab6..bc5fb12b913c 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1064,6 +1064,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd,
1064 tape->best_dsc_rw_freq = config.dsc_rw_frequency; 1064 tape->best_dsc_rw_freq = config.dsc_rw_frequency;
1065 break; 1065 break;
1066 case 0x0350: 1066 case 0x0350:
1067 memset(&config, 0, sizeof(config));
1067 config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq; 1068 config.dsc_rw_frequency = (int) tape->best_dsc_rw_freq;
1068 config.nr_stages = 1; 1069 config.nr_stages = 1;
1069 if (copy_to_user(argp, &config, sizeof(config))) 1070 if (copy_to_user(argp, &config, sizeof(config)))
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 114efd8dc8f5..1148140d08a1 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -608,8 +608,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
608 p, compat_mode); 608 p, compat_mode);
609 609
610 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) 610 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0)))
611 return str_to_user(dev_name(&evdev->dev), 611 return str_to_user(dev->name, _IOC_SIZE(cmd), p);
612 _IOC_SIZE(cmd), p);
613 612
614 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0))) 613 if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0)))
615 return str_to_user(dev->phys, _IOC_SIZE(cmd), p); 614 return str_to_user(dev->phys, _IOC_SIZE(cmd), p);
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 0e12f89276a3..4cfd084fa897 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -536,7 +536,7 @@ static int joydev_ioctl_common(struct joydev *joydev,
536 default: 536 default:
537 if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) { 537 if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) {
538 int len; 538 int len;
539 const char *name = dev_name(&dev->dev); 539 const char *name = dev->name;
540 540
541 if (!name) 541 if (!name)
542 return 0; 542 return 0;
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index b868b8d5fbb3..f155ad8cdae7 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -470,20 +470,20 @@ static void xpad_irq_out(struct urb *urb)
470 status = urb->status; 470 status = urb->status;
471 471
472 switch (status) { 472 switch (status) {
473 case 0: 473 case 0:
474 /* success */ 474 /* success */
475 break; 475 return;
476 case -ECONNRESET: 476
477 case -ENOENT: 477 case -ECONNRESET:
478 case -ESHUTDOWN: 478 case -ENOENT:
479 /* this urb is terminated, clean up */ 479 case -ESHUTDOWN:
480 dbg("%s - urb shutting down with status: %d", 480 /* this urb is terminated, clean up */
481 __func__, status); 481 dbg("%s - urb shutting down with status: %d", __func__, status);
482 return; 482 return;
483 default: 483
484 dbg("%s - nonzero urb status received: %d", 484 default:
485 __func__, status); 485 dbg("%s - nonzero urb status received: %d", __func__, status);
486 goto exit; 486 goto exit;
487 } 487 }
488 488
489exit: 489exit:
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index df3f8aa68115..95fe0452dae4 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -895,6 +895,13 @@ static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = {
895}; 895};
896 896
897/* 897/*
898 * Amilo Pi 3525 key release for Fn+Volume keys not working
899 */
900static unsigned int atkbd_amilo_pi3525_forced_release_keys[] = {
901 0x20, 0xa0, 0x2e, 0xae, 0x30, 0xb0, -1U
902};
903
904/*
898 * Amilo Xi 3650 key release for light touch bar not working 905 * Amilo Xi 3650 key release for light touch bar not working
899 */ 906 */
900static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = { 907static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = {
@@ -902,6 +909,13 @@ static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = {
902}; 909};
903 910
904/* 911/*
912 * Soltech TA12 system with broken key release on volume keys and mute key
913 */
914static unsigned int atkdb_soltech_ta12_forced_release_keys[] = {
915 0xa0, 0xae, 0xb0, -1U
916};
917
918/*
905 * atkbd_set_keycode_table() initializes keyboard's keycode table 919 * atkbd_set_keycode_table() initializes keyboard's keycode table
906 * according to the selected scancode set 920 * according to the selected scancode set
907 */ 921 */
@@ -1568,6 +1582,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1568 .driver_data = atkbd_amilo_pa1510_forced_release_keys, 1582 .driver_data = atkbd_amilo_pa1510_forced_release_keys,
1569 }, 1583 },
1570 { 1584 {
1585 .ident = "Fujitsu Amilo Pi 3525",
1586 .matches = {
1587 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1588 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 3525"),
1589 },
1590 .callback = atkbd_setup_forced_release,
1591 .driver_data = atkbd_amilo_pi3525_forced_release_keys,
1592 },
1593 {
1571 .ident = "Fujitsu Amilo Xi 3650", 1594 .ident = "Fujitsu Amilo Xi 3650",
1572 .matches = { 1595 .matches = {
1573 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 1596 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
@@ -1576,6 +1599,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1576 .callback = atkbd_setup_forced_release, 1599 .callback = atkbd_setup_forced_release,
1577 .driver_data = atkbd_amilo_xi3650_forced_release_keys, 1600 .driver_data = atkbd_amilo_xi3650_forced_release_keys,
1578 }, 1601 },
1602 {
1603 .ident = "Soltech Corporation TA12",
1604 .matches = {
1605 DMI_MATCH(DMI_SYS_VENDOR, "Soltech Corporation"),
1606 DMI_MATCH(DMI_PRODUCT_NAME, "TA12"),
1607 },
1608 .callback = atkbd_setup_forced_release,
1609 .driver_data = atkdb_soltech_ta12_forced_release_keys,
1610 },
1579 { } 1611 { }
1580}; 1612};
1581 1613
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 6d67af5387ad..21cb755a54fb 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -114,7 +114,7 @@ static int __devexit pcspkr_remove(struct platform_device *dev)
114 return 0; 114 return 0;
115} 115}
116 116
117static int pcspkr_suspend(struct platform_device *dev, pm_message_t state) 117static int pcspkr_suspend(struct device *dev)
118{ 118{
119 pcspkr_event(NULL, EV_SND, SND_BELL, 0); 119 pcspkr_event(NULL, EV_SND, SND_BELL, 0);
120 120
@@ -127,14 +127,18 @@ static void pcspkr_shutdown(struct platform_device *dev)
127 pcspkr_event(NULL, EV_SND, SND_BELL, 0); 127 pcspkr_event(NULL, EV_SND, SND_BELL, 0);
128} 128}
129 129
130static struct dev_pm_ops pcspkr_pm_ops = {
131 .suspend = pcspkr_suspend,
132};
133
130static struct platform_driver pcspkr_platform_driver = { 134static struct platform_driver pcspkr_platform_driver = {
131 .driver = { 135 .driver = {
132 .name = "pcspkr", 136 .name = "pcspkr",
133 .owner = THIS_MODULE, 137 .owner = THIS_MODULE,
138 .pm = &pcspkr_pm_ops,
134 }, 139 },
135 .probe = pcspkr_probe, 140 .probe = pcspkr_probe,
136 .remove = __devexit_p(pcspkr_remove), 141 .remove = __devexit_p(pcspkr_remove),
137 .suspend = pcspkr_suspend,
138 .shutdown = pcspkr_shutdown, 142 .shutdown = pcspkr_shutdown,
139}; 143};
140 144
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 7c8957dd22c0..26e17a9a22eb 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -646,6 +646,15 @@ static struct dmi_system_id dmi_ids[] __initdata = {
646 }, 646 },
647 { 647 {
648 .callback = dmi_matched, 648 .callback = dmi_matched,
649 .ident = "Maxdata Pro 7000 DX",
650 .matches = {
651 DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"),
652 DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"),
653 },
654 .driver_data = keymap_fs_amilo_pro_v2000
655 },
656 {
657 .callback = dmi_matched,
649 .ident = "Fujitsu N3510", 658 .ident = "Fujitsu N3510",
650 .matches = { 659 .matches = {
651 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 660 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 1ebfcab74662..8ff7e35c7069 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -408,6 +408,8 @@ static int if_write_room(struct tty_struct *tty)
408 return retval; 408 return retval;
409} 409}
410 410
411/* FIXME: This function does not have error returns */
412
411static int if_chars_in_buffer(struct tty_struct *tty) 413static int if_chars_in_buffer(struct tty_struct *tty)
412{ 414{
413 struct cardstate *cs; 415 struct cardstate *cs;
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 8df889b0c1a9..9de54202c90c 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -37,7 +37,6 @@
37#include <linux/kernel_stat.h> 37#include <linux/kernel_stat.h>
38#include <linux/usb.h> 38#include <linux/usb.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/smp_lock.h>
41#include <linux/sched.h> 40#include <linux/sched.h>
42#include <linux/moduleparam.h> 41#include <linux/moduleparam.h>
43#include "hisax.h" 42#include "hisax.h"
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index b4d4522e5071..2881a66c1aa9 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/isdn.h> 14#include <linux/isdn.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/smp_lock.h>
16#include "isdn_common.h" 17#include "isdn_common.h"
17#include "isdn_tty.h" 18#include "isdn_tty.h"
18#ifdef CONFIG_ISDN_AUDIO 19#ifdef CONFIG_ISDN_AUDIO
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index 990e6a7e6674..c3b661a666cb 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -731,10 +731,10 @@ l1oip_socket_thread(void *data)
731 while (!signal_pending(current)) { 731 while (!signal_pending(current)) {
732 struct kvec iov = { 732 struct kvec iov = {
733 .iov_base = recvbuf, 733 .iov_base = recvbuf,
734 .iov_len = sizeof(recvbuf), 734 .iov_len = recvbuf_size,
735 }; 735 };
736 recvlen = kernel_recvmsg(socket, &msg, &iov, 1, 736 recvlen = kernel_recvmsg(socket, &msg, &iov, 1,
737 sizeof(recvbuf), 0); 737 recvbuf_size, 0);
738 if (recvlen > 0) { 738 if (recvlen > 0) {
739 l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen); 739 l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen);
740 } else { 740 } else {
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index e2f45019ebf0..3e1532a180ff 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/mISDNif.h> 18#include <linux/mISDNif.h>
19#include <linux/kthread.h> 19#include <linux/kthread.h>
20#include <linux/smp_lock.h>
20#include "core.h" 21#include "core.h"
21 22
22static u_int *debug; 23static u_int *debug;
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index a6974e9b8ebf..1e2cb846b3c9 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -1,6 +1,8 @@
1/*P:400 This contains run_guest() which actually calls into the Host<->Guest 1/*P:400
2 * This contains run_guest() which actually calls into the Host<->Guest
2 * Switcher and analyzes the return, such as determining if the Guest wants the 3 * Switcher and analyzes the return, such as determining if the Guest wants the
3 * Host to do something. This file also contains useful helper routines. :*/ 4 * Host to do something. This file also contains useful helper routines.
5:*/
4#include <linux/module.h> 6#include <linux/module.h>
5#include <linux/stringify.h> 7#include <linux/stringify.h>
6#include <linux/stddef.h> 8#include <linux/stddef.h>
@@ -24,7 +26,8 @@ static struct page **switcher_page;
24/* This One Big lock protects all inter-guest data structures. */ 26/* This One Big lock protects all inter-guest data structures. */
25DEFINE_MUTEX(lguest_lock); 27DEFINE_MUTEX(lguest_lock);
26 28
27/*H:010 We need to set up the Switcher at a high virtual address. Remember the 29/*H:010
30 * We need to set up the Switcher at a high virtual address. Remember the
28 * Switcher is a few hundred bytes of assembler code which actually changes the 31 * Switcher is a few hundred bytes of assembler code which actually changes the
29 * CPU to run the Guest, and then changes back to the Host when a trap or 32 * CPU to run the Guest, and then changes back to the Host when a trap or
30 * interrupt happens. 33 * interrupt happens.
@@ -33,7 +36,8 @@ DEFINE_MUTEX(lguest_lock);
33 * Host since it will be running as the switchover occurs. 36 * Host since it will be running as the switchover occurs.
34 * 37 *
35 * Trying to map memory at a particular address is an unusual thing to do, so 38 * Trying to map memory at a particular address is an unusual thing to do, so
36 * it's not a simple one-liner. */ 39 * it's not a simple one-liner.
40 */
37static __init int map_switcher(void) 41static __init int map_switcher(void)
38{ 42{
39 int i, err; 43 int i, err;
@@ -47,8 +51,10 @@ static __init int map_switcher(void)
47 * easy. 51 * easy.
48 */ 52 */
49 53
50 /* We allocate an array of struct page pointers. map_vm_area() wants 54 /*
51 * this, rather than just an array of pages. */ 55 * We allocate an array of struct page pointers. map_vm_area() wants
56 * this, rather than just an array of pages.
57 */
52 switcher_page = kmalloc(sizeof(switcher_page[0])*TOTAL_SWITCHER_PAGES, 58 switcher_page = kmalloc(sizeof(switcher_page[0])*TOTAL_SWITCHER_PAGES,
53 GFP_KERNEL); 59 GFP_KERNEL);
54 if (!switcher_page) { 60 if (!switcher_page) {
@@ -56,8 +62,10 @@ static __init int map_switcher(void)
56 goto out; 62 goto out;
57 } 63 }
58 64
59 /* Now we actually allocate the pages. The Guest will see these pages, 65 /*
60 * so we make sure they're zeroed. */ 66 * Now we actually allocate the pages. The Guest will see these pages,
67 * so we make sure they're zeroed.
68 */
61 for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) { 69 for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) {
62 unsigned long addr = get_zeroed_page(GFP_KERNEL); 70 unsigned long addr = get_zeroed_page(GFP_KERNEL);
63 if (!addr) { 71 if (!addr) {
@@ -67,19 +75,23 @@ static __init int map_switcher(void)
67 switcher_page[i] = virt_to_page(addr); 75 switcher_page[i] = virt_to_page(addr);
68 } 76 }
69 77
70 /* First we check that the Switcher won't overlap the fixmap area at 78 /*
79 * First we check that the Switcher won't overlap the fixmap area at
71 * the top of memory. It's currently nowhere near, but it could have 80 * the top of memory. It's currently nowhere near, but it could have
72 * very strange effects if it ever happened. */ 81 * very strange effects if it ever happened.
82 */
73 if (SWITCHER_ADDR + (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE > FIXADDR_START){ 83 if (SWITCHER_ADDR + (TOTAL_SWITCHER_PAGES+1)*PAGE_SIZE > FIXADDR_START){
74 err = -ENOMEM; 84 err = -ENOMEM;
75 printk("lguest: mapping switcher would thwack fixmap\n"); 85 printk("lguest: mapping switcher would thwack fixmap\n");
76 goto free_pages; 86 goto free_pages;
77 } 87 }
78 88
79 /* Now we reserve the "virtual memory area" we want: 0xFFC00000 89 /*
90 * Now we reserve the "virtual memory area" we want: 0xFFC00000
80 * (SWITCHER_ADDR). We might not get it in theory, but in practice 91 * (SWITCHER_ADDR). We might not get it in theory, but in practice
81 * it's worked so far. The end address needs +1 because __get_vm_area 92 * it's worked so far. The end address needs +1 because __get_vm_area
82 * allocates an extra guard page, so we need space for that. */ 93 * allocates an extra guard page, so we need space for that.
94 */
83 switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE, 95 switcher_vma = __get_vm_area(TOTAL_SWITCHER_PAGES * PAGE_SIZE,
84 VM_ALLOC, SWITCHER_ADDR, SWITCHER_ADDR 96 VM_ALLOC, SWITCHER_ADDR, SWITCHER_ADDR
85 + (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE); 97 + (TOTAL_SWITCHER_PAGES+1) * PAGE_SIZE);
@@ -89,11 +101,13 @@ static __init int map_switcher(void)
89 goto free_pages; 101 goto free_pages;
90 } 102 }
91 103
92 /* This code actually sets up the pages we've allocated to appear at 104 /*
105 * This code actually sets up the pages we've allocated to appear at
93 * SWITCHER_ADDR. map_vm_area() takes the vma we allocated above, the 106 * SWITCHER_ADDR. map_vm_area() takes the vma we allocated above, the
94 * kind of pages we're mapping (kernel pages), and a pointer to our 107 * kind of pages we're mapping (kernel pages), and a pointer to our
95 * array of struct pages. It increments that pointer, but we don't 108 * array of struct pages. It increments that pointer, but we don't
96 * care. */ 109 * care.
110 */
97 pagep = switcher_page; 111 pagep = switcher_page;
98 err = map_vm_area(switcher_vma, PAGE_KERNEL_EXEC, &pagep); 112 err = map_vm_area(switcher_vma, PAGE_KERNEL_EXEC, &pagep);
99 if (err) { 113 if (err) {
@@ -101,8 +115,10 @@ static __init int map_switcher(void)
101 goto free_vma; 115 goto free_vma;
102 } 116 }
103 117
104 /* Now the Switcher is mapped at the right address, we can't fail! 118 /*
105 * Copy in the compiled-in Switcher code (from <arch>_switcher.S). */ 119 * Now the Switcher is mapped at the right address, we can't fail!
120 * Copy in the compiled-in Switcher code (from <arch>_switcher.S).
121 */
106 memcpy(switcher_vma->addr, start_switcher_text, 122 memcpy(switcher_vma->addr, start_switcher_text,
107 end_switcher_text - start_switcher_text); 123 end_switcher_text - start_switcher_text);
108 124
@@ -124,8 +140,7 @@ out:
124} 140}
125/*:*/ 141/*:*/
126 142
127/* Cleaning up the mapping when the module is unloaded is almost... 143/* Cleaning up the mapping when the module is unloaded is almost... too easy. */
128 * too easy. */
129static void unmap_switcher(void) 144static void unmap_switcher(void)
130{ 145{
131 unsigned int i; 146 unsigned int i;
@@ -151,16 +166,19 @@ static void unmap_switcher(void)
151 * But we can't trust the Guest: it might be trying to access the Launcher 166 * But we can't trust the Guest: it might be trying to access the Launcher
152 * code. We have to check that the range is below the pfn_limit the Launcher 167 * code. We have to check that the range is below the pfn_limit the Launcher
153 * gave us. We have to make sure that addr + len doesn't give us a false 168 * gave us. We have to make sure that addr + len doesn't give us a false
154 * positive by overflowing, too. */ 169 * positive by overflowing, too.
170 */
155bool lguest_address_ok(const struct lguest *lg, 171bool lguest_address_ok(const struct lguest *lg,
156 unsigned long addr, unsigned long len) 172 unsigned long addr, unsigned long len)
157{ 173{
158 return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr); 174 return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr);
159} 175}
160 176
161/* This routine copies memory from the Guest. Here we can see how useful the 177/*
178 * This routine copies memory from the Guest. Here we can see how useful the
162 * kill_lguest() routine we met in the Launcher can be: we return a random 179 * kill_lguest() routine we met in the Launcher can be: we return a random
163 * value (all zeroes) instead of needing to return an error. */ 180 * value (all zeroes) instead of needing to return an error.
181 */
164void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes) 182void __lgread(struct lg_cpu *cpu, void *b, unsigned long addr, unsigned bytes)
165{ 183{
166 if (!lguest_address_ok(cpu->lg, addr, bytes) 184 if (!lguest_address_ok(cpu->lg, addr, bytes)
@@ -181,9 +199,11 @@ void __lgwrite(struct lg_cpu *cpu, unsigned long addr, const void *b,
181} 199}
182/*:*/ 200/*:*/
183 201
184/*H:030 Let's jump straight to the the main loop which runs the Guest. 202/*H:030
203 * Let's jump straight to the the main loop which runs the Guest.
185 * Remember, this is called by the Launcher reading /dev/lguest, and we keep 204 * Remember, this is called by the Launcher reading /dev/lguest, and we keep
186 * going around and around until something interesting happens. */ 205 * going around and around until something interesting happens.
206 */
187int run_guest(struct lg_cpu *cpu, unsigned long __user *user) 207int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
188{ 208{
189 /* We stop running once the Guest is dead. */ 209 /* We stop running once the Guest is dead. */
@@ -195,10 +215,17 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
195 if (cpu->hcall) 215 if (cpu->hcall)
196 do_hypercalls(cpu); 216 do_hypercalls(cpu);
197 217
198 /* It's possible the Guest did a NOTIFY hypercall to the 218 /*
199 * Launcher, in which case we return from the read() now. */ 219 * It's possible the Guest did a NOTIFY hypercall to the
220 * Launcher.
221 */
200 if (cpu->pending_notify) { 222 if (cpu->pending_notify) {
223 /*
224 * Does it just needs to write to a registered
225 * eventfd (ie. the appropriate virtqueue thread)?
226 */
201 if (!send_notify_to_eventfd(cpu)) { 227 if (!send_notify_to_eventfd(cpu)) {
228 /* OK, we tell the main Laucher. */
202 if (put_user(cpu->pending_notify, user)) 229 if (put_user(cpu->pending_notify, user))
203 return -EFAULT; 230 return -EFAULT;
204 return sizeof(cpu->pending_notify); 231 return sizeof(cpu->pending_notify);
@@ -209,29 +236,39 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
209 if (signal_pending(current)) 236 if (signal_pending(current))
210 return -ERESTARTSYS; 237 return -ERESTARTSYS;
211 238
212 /* Check if there are any interrupts which can be delivered now: 239 /*
240 * Check if there are any interrupts which can be delivered now:
213 * if so, this sets up the hander to be executed when we next 241 * if so, this sets up the hander to be executed when we next
214 * run the Guest. */ 242 * run the Guest.
243 */
215 irq = interrupt_pending(cpu, &more); 244 irq = interrupt_pending(cpu, &more);
216 if (irq < LGUEST_IRQS) 245 if (irq < LGUEST_IRQS)
217 try_deliver_interrupt(cpu, irq, more); 246 try_deliver_interrupt(cpu, irq, more);
218 247
219 /* All long-lived kernel loops need to check with this horrible 248 /*
249 * All long-lived kernel loops need to check with this horrible
220 * thing called the freezer. If the Host is trying to suspend, 250 * thing called the freezer. If the Host is trying to suspend,
221 * it stops us. */ 251 * it stops us.
252 */
222 try_to_freeze(); 253 try_to_freeze();
223 254
224 /* Just make absolutely sure the Guest is still alive. One of 255 /*
225 * those hypercalls could have been fatal, for example. */ 256 * Just make absolutely sure the Guest is still alive. One of
257 * those hypercalls could have been fatal, for example.
258 */
226 if (cpu->lg->dead) 259 if (cpu->lg->dead)
227 break; 260 break;
228 261
229 /* If the Guest asked to be stopped, we sleep. The Guest's 262 /*
230 * clock timer will wake us. */ 263 * If the Guest asked to be stopped, we sleep. The Guest's
264 * clock timer will wake us.
265 */
231 if (cpu->halted) { 266 if (cpu->halted) {
232 set_current_state(TASK_INTERRUPTIBLE); 267 set_current_state(TASK_INTERRUPTIBLE);
233 /* Just before we sleep, make sure no interrupt snuck in 268 /*
234 * which we should be doing. */ 269 * Just before we sleep, make sure no interrupt snuck in
270 * which we should be doing.
271 */
235 if (interrupt_pending(cpu, &more) < LGUEST_IRQS) 272 if (interrupt_pending(cpu, &more) < LGUEST_IRQS)
236 set_current_state(TASK_RUNNING); 273 set_current_state(TASK_RUNNING);
237 else 274 else
@@ -239,8 +276,10 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
239 continue; 276 continue;
240 } 277 }
241 278
242 /* OK, now we're ready to jump into the Guest. First we put up 279 /*
243 * the "Do Not Disturb" sign: */ 280 * OK, now we're ready to jump into the Guest. First we put up
281 * the "Do Not Disturb" sign:
282 */
244 local_irq_disable(); 283 local_irq_disable();
245 284
246 /* Actually run the Guest until something happens. */ 285 /* Actually run the Guest until something happens. */
@@ -327,8 +366,10 @@ static void __exit fini(void)
327} 366}
328/*:*/ 367/*:*/
329 368
330/* The Host side of lguest can be a module. This is a nice way for people to 369/*
331 * play with it. */ 370 * The Host side of lguest can be a module. This is a nice way for people to
371 * play with it.
372 */
332module_init(init); 373module_init(init);
333module_exit(fini); 374module_exit(fini);
334MODULE_LICENSE("GPL"); 375MODULE_LICENSE("GPL");
diff --git a/drivers/lguest/hypercalls.c b/drivers/lguest/hypercalls.c
index c29ffa19cb74..83511eb0923d 100644
--- a/drivers/lguest/hypercalls.c
+++ b/drivers/lguest/hypercalls.c
@@ -1,8 +1,10 @@
1/*P:500 Just as userspace programs request kernel operations through a system 1/*P:500
2 * Just as userspace programs request kernel operations through a system
2 * call, the Guest requests Host operations through a "hypercall". You might 3 * call, the Guest requests Host operations through a "hypercall". You might
3 * notice this nomenclature doesn't really follow any logic, but the name has 4 * notice this nomenclature doesn't really follow any logic, but the name has
4 * been around for long enough that we're stuck with it. As you'd expect, this 5 * been around for long enough that we're stuck with it. As you'd expect, this
5 * code is basically a one big switch statement. :*/ 6 * code is basically a one big switch statement.
7:*/
6 8
7/* Copyright (C) 2006 Rusty Russell IBM Corporation 9/* Copyright (C) 2006 Rusty Russell IBM Corporation
8 10
@@ -28,30 +30,41 @@
28#include <asm/pgtable.h> 30#include <asm/pgtable.h>
29#include "lg.h" 31#include "lg.h"
30 32
31/*H:120 This is the core hypercall routine: where the Guest gets what it wants. 33/*H:120
32 * Or gets killed. Or, in the case of LHCALL_SHUTDOWN, both. */ 34 * This is the core hypercall routine: where the Guest gets what it wants.
35 * Or gets killed. Or, in the case of LHCALL_SHUTDOWN, both.
36 */
33static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args) 37static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
34{ 38{
35 switch (args->arg0) { 39 switch (args->arg0) {
36 case LHCALL_FLUSH_ASYNC: 40 case LHCALL_FLUSH_ASYNC:
37 /* This call does nothing, except by breaking out of the Guest 41 /*
38 * it makes us process all the asynchronous hypercalls. */ 42 * This call does nothing, except by breaking out of the Guest
43 * it makes us process all the asynchronous hypercalls.
44 */
39 break; 45 break;
40 case LHCALL_SEND_INTERRUPTS: 46 case LHCALL_SEND_INTERRUPTS:
41 /* This call does nothing too, but by breaking out of the Guest 47 /*
42 * it makes us process any pending interrupts. */ 48 * This call does nothing too, but by breaking out of the Guest
49 * it makes us process any pending interrupts.
50 */
43 break; 51 break;
44 case LHCALL_LGUEST_INIT: 52 case LHCALL_LGUEST_INIT:
45 /* You can't get here unless you're already initialized. Don't 53 /*
46 * do that. */ 54 * You can't get here unless you're already initialized. Don't
55 * do that.
56 */
47 kill_guest(cpu, "already have lguest_data"); 57 kill_guest(cpu, "already have lguest_data");
48 break; 58 break;
49 case LHCALL_SHUTDOWN: { 59 case LHCALL_SHUTDOWN: {
50 /* Shutdown is such a trivial hypercall that we do it in four
51 * lines right here. */
52 char msg[128]; 60 char msg[128];
53 /* If the lgread fails, it will call kill_guest() itself; the 61 /*
54 * kill_guest() with the message will be ignored. */ 62 * Shutdown is such a trivial hypercall that we do it in five
63 * lines right here.
64 *
65 * If the lgread fails, it will call kill_guest() itself; the
66 * kill_guest() with the message will be ignored.
67 */
55 __lgread(cpu, msg, args->arg1, sizeof(msg)); 68 __lgread(cpu, msg, args->arg1, sizeof(msg));
56 msg[sizeof(msg)-1] = '\0'; 69 msg[sizeof(msg)-1] = '\0';
57 kill_guest(cpu, "CRASH: %s", msg); 70 kill_guest(cpu, "CRASH: %s", msg);
@@ -60,16 +73,17 @@ static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
60 break; 73 break;
61 } 74 }
62 case LHCALL_FLUSH_TLB: 75 case LHCALL_FLUSH_TLB:
63 /* FLUSH_TLB comes in two flavors, depending on the 76 /* FLUSH_TLB comes in two flavors, depending on the argument: */
64 * argument: */
65 if (args->arg1) 77 if (args->arg1)
66 guest_pagetable_clear_all(cpu); 78 guest_pagetable_clear_all(cpu);
67 else 79 else
68 guest_pagetable_flush_user(cpu); 80 guest_pagetable_flush_user(cpu);
69 break; 81 break;
70 82
71 /* All these calls simply pass the arguments through to the right 83 /*
72 * routines. */ 84 * All these calls simply pass the arguments through to the right
85 * routines.
86 */
73 case LHCALL_NEW_PGTABLE: 87 case LHCALL_NEW_PGTABLE:
74 guest_new_pagetable(cpu, args->arg1); 88 guest_new_pagetable(cpu, args->arg1);
75 break; 89 break;
@@ -112,15 +126,16 @@ static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
112 kill_guest(cpu, "Bad hypercall %li\n", args->arg0); 126 kill_guest(cpu, "Bad hypercall %li\n", args->arg0);
113 } 127 }
114} 128}
115/*:*/
116 129
117/*H:124 Asynchronous hypercalls are easy: we just look in the array in the 130/*H:124
131 * Asynchronous hypercalls are easy: we just look in the array in the
118 * Guest's "struct lguest_data" to see if any new ones are marked "ready". 132 * Guest's "struct lguest_data" to see if any new ones are marked "ready".
119 * 133 *
120 * We are careful to do these in order: obviously we respect the order the 134 * We are careful to do these in order: obviously we respect the order the
121 * Guest put them in the ring, but we also promise the Guest that they will 135 * Guest put them in the ring, but we also promise the Guest that they will
122 * happen before any normal hypercall (which is why we check this before 136 * happen before any normal hypercall (which is why we check this before
123 * checking for a normal hcall). */ 137 * checking for a normal hcall).
138 */
124static void do_async_hcalls(struct lg_cpu *cpu) 139static void do_async_hcalls(struct lg_cpu *cpu)
125{ 140{
126 unsigned int i; 141 unsigned int i;
@@ -133,22 +148,28 @@ static void do_async_hcalls(struct lg_cpu *cpu)
133 /* We process "struct lguest_data"s hcalls[] ring once. */ 148 /* We process "struct lguest_data"s hcalls[] ring once. */
134 for (i = 0; i < ARRAY_SIZE(st); i++) { 149 for (i = 0; i < ARRAY_SIZE(st); i++) {
135 struct hcall_args args; 150 struct hcall_args args;
136 /* We remember where we were up to from last time. This makes 151 /*
152 * We remember where we were up to from last time. This makes
137 * sure that the hypercalls are done in the order the Guest 153 * sure that the hypercalls are done in the order the Guest
138 * places them in the ring. */ 154 * places them in the ring.
155 */
139 unsigned int n = cpu->next_hcall; 156 unsigned int n = cpu->next_hcall;
140 157
141 /* 0xFF means there's no call here (yet). */ 158 /* 0xFF means there's no call here (yet). */
142 if (st[n] == 0xFF) 159 if (st[n] == 0xFF)
143 break; 160 break;
144 161
145 /* OK, we have hypercall. Increment the "next_hcall" cursor, 162 /*
146 * and wrap back to 0 if we reach the end. */ 163 * OK, we have hypercall. Increment the "next_hcall" cursor,
164 * and wrap back to 0 if we reach the end.
165 */
147 if (++cpu->next_hcall == LHCALL_RING_SIZE) 166 if (++cpu->next_hcall == LHCALL_RING_SIZE)
148 cpu->next_hcall = 0; 167 cpu->next_hcall = 0;
149 168
150 /* Copy the hypercall arguments into a local copy of 169 /*
151 * the hcall_args struct. */ 170 * Copy the hypercall arguments into a local copy of the
171 * hcall_args struct.
172 */
152 if (copy_from_user(&args, &cpu->lg->lguest_data->hcalls[n], 173 if (copy_from_user(&args, &cpu->lg->lguest_data->hcalls[n],
153 sizeof(struct hcall_args))) { 174 sizeof(struct hcall_args))) {
154 kill_guest(cpu, "Fetching async hypercalls"); 175 kill_guest(cpu, "Fetching async hypercalls");
@@ -164,19 +185,25 @@ static void do_async_hcalls(struct lg_cpu *cpu)
164 break; 185 break;
165 } 186 }
166 187
167 /* Stop doing hypercalls if they want to notify the Launcher: 188 /*
168 * it needs to service this first. */ 189 * Stop doing hypercalls if they want to notify the Launcher:
190 * it needs to service this first.
191 */
169 if (cpu->pending_notify) 192 if (cpu->pending_notify)
170 break; 193 break;
171 } 194 }
172} 195}
173 196
174/* Last of all, we look at what happens first of all. The very first time the 197/*
175 * Guest makes a hypercall, we end up here to set things up: */ 198 * Last of all, we look at what happens first of all. The very first time the
199 * Guest makes a hypercall, we end up here to set things up:
200 */
176static void initialize(struct lg_cpu *cpu) 201static void initialize(struct lg_cpu *cpu)
177{ 202{
178 /* You can't do anything until you're initialized. The Guest knows the 203 /*
179 * rules, so we're unforgiving here. */ 204 * You can't do anything until you're initialized. The Guest knows the
205 * rules, so we're unforgiving here.
206 */
180 if (cpu->hcall->arg0 != LHCALL_LGUEST_INIT) { 207 if (cpu->hcall->arg0 != LHCALL_LGUEST_INIT) {
181 kill_guest(cpu, "hypercall %li before INIT", cpu->hcall->arg0); 208 kill_guest(cpu, "hypercall %li before INIT", cpu->hcall->arg0);
182 return; 209 return;
@@ -185,32 +212,44 @@ static void initialize(struct lg_cpu *cpu)
185 if (lguest_arch_init_hypercalls(cpu)) 212 if (lguest_arch_init_hypercalls(cpu))
186 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data); 213 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data);
187 214
188 /* The Guest tells us where we're not to deliver interrupts by putting 215 /*
189 * the range of addresses into "struct lguest_data". */ 216 * The Guest tells us where we're not to deliver interrupts by putting
217 * the range of addresses into "struct lguest_data".
218 */
190 if (get_user(cpu->lg->noirq_start, &cpu->lg->lguest_data->noirq_start) 219 if (get_user(cpu->lg->noirq_start, &cpu->lg->lguest_data->noirq_start)
191 || get_user(cpu->lg->noirq_end, &cpu->lg->lguest_data->noirq_end)) 220 || get_user(cpu->lg->noirq_end, &cpu->lg->lguest_data->noirq_end))
192 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data); 221 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data);
193 222
194 /* We write the current time into the Guest's data page once so it can 223 /*
195 * set its clock. */ 224 * We write the current time into the Guest's data page once so it can
225 * set its clock.
226 */
196 write_timestamp(cpu); 227 write_timestamp(cpu);
197 228
198 /* page_tables.c will also do some setup. */ 229 /* page_tables.c will also do some setup. */
199 page_table_guest_data_init(cpu); 230 page_table_guest_data_init(cpu);
200 231
201 /* This is the one case where the above accesses might have been the 232 /*
233 * This is the one case where the above accesses might have been the
202 * first write to a Guest page. This may have caused a copy-on-write 234 * first write to a Guest page. This may have caused a copy-on-write
203 * fault, but the old page might be (read-only) in the Guest 235 * fault, but the old page might be (read-only) in the Guest
204 * pagetable. */ 236 * pagetable.
237 */
205 guest_pagetable_clear_all(cpu); 238 guest_pagetable_clear_all(cpu);
206} 239}
207/*:*/ 240/*:*/
208 241
209/*M:013 If a Guest reads from a page (so creates a mapping) that it has never 242/*M:013
243 * If a Guest reads from a page (so creates a mapping) that it has never
210 * written to, and then the Launcher writes to it (ie. the output of a virtual 244 * written to, and then the Launcher writes to it (ie. the output of a virtual
211 * device), the Guest will still see the old page. In practice, this never 245 * device), the Guest will still see the old page. In practice, this never
212 * happens: why would the Guest read a page which it has never written to? But 246 * happens: why would the Guest read a page which it has never written to? But
213 * a similar scenario might one day bite us, so it's worth mentioning. :*/ 247 * a similar scenario might one day bite us, so it's worth mentioning.
248 *
249 * Note that if we used a shared anonymous mapping in the Launcher instead of
250 * mapping /dev/zero private, we wouldn't worry about cop-on-write. And we
251 * need that to switch the Launcher to processes (away from threads) anyway.
252:*/
214 253
215/*H:100 254/*H:100
216 * Hypercalls 255 * Hypercalls
@@ -229,17 +268,22 @@ void do_hypercalls(struct lg_cpu *cpu)
229 return; 268 return;
230 } 269 }
231 270
232 /* The Guest has initialized. 271 /*
272 * The Guest has initialized.
233 * 273 *
234 * Look in the hypercall ring for the async hypercalls: */ 274 * Look in the hypercall ring for the async hypercalls:
275 */
235 do_async_hcalls(cpu); 276 do_async_hcalls(cpu);
236 277
237 /* If we stopped reading the hypercall ring because the Guest did a 278 /*
279 * If we stopped reading the hypercall ring because the Guest did a
238 * NOTIFY to the Launcher, we want to return now. Otherwise we do 280 * NOTIFY to the Launcher, we want to return now. Otherwise we do
239 * the hypercall. */ 281 * the hypercall.
282 */
240 if (!cpu->pending_notify) { 283 if (!cpu->pending_notify) {
241 do_hcall(cpu, cpu->hcall); 284 do_hcall(cpu, cpu->hcall);
242 /* Tricky point: we reset the hcall pointer to mark the 285 /*
286 * Tricky point: we reset the hcall pointer to mark the
243 * hypercall as "done". We use the hcall pointer rather than 287 * hypercall as "done". We use the hcall pointer rather than
244 * the trap number to indicate a hypercall is pending. 288 * the trap number to indicate a hypercall is pending.
245 * Normally it doesn't matter: the Guest will run again and 289 * Normally it doesn't matter: the Guest will run again and
@@ -248,13 +292,16 @@ void do_hypercalls(struct lg_cpu *cpu)
248 * However, if we are signalled or the Guest sends I/O to the 292 * However, if we are signalled or the Guest sends I/O to the
249 * Launcher, the run_guest() loop will exit without running the 293 * Launcher, the run_guest() loop will exit without running the
250 * Guest. When it comes back it would try to re-run the 294 * Guest. When it comes back it would try to re-run the
251 * hypercall. Finding that bug sucked. */ 295 * hypercall. Finding that bug sucked.
296 */
252 cpu->hcall = NULL; 297 cpu->hcall = NULL;
253 } 298 }
254} 299}
255 300
256/* This routine supplies the Guest with time: it's used for wallclock time at 301/*
257 * initial boot and as a rough time source if the TSC isn't available. */ 302 * This routine supplies the Guest with time: it's used for wallclock time at
303 * initial boot and as a rough time source if the TSC isn't available.
304 */
258void write_timestamp(struct lg_cpu *cpu) 305void write_timestamp(struct lg_cpu *cpu)
259{ 306{
260 struct timespec now; 307 struct timespec now;
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index 0e9067b0d507..18648180db02 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -1,4 +1,5 @@
1/*P:800 Interrupts (traps) are complicated enough to earn their own file. 1/*P:800
2 * Interrupts (traps) are complicated enough to earn their own file.
2 * There are three classes of interrupts: 3 * There are three classes of interrupts:
3 * 4 *
4 * 1) Real hardware interrupts which occur while we're running the Guest, 5 * 1) Real hardware interrupts which occur while we're running the Guest,
@@ -10,7 +11,8 @@
10 * just like real hardware would deliver them. Traps from the Guest can be set 11 * just like real hardware would deliver them. Traps from the Guest can be set
11 * up to go directly back into the Guest, but sometimes the Host wants to see 12 * up to go directly back into the Guest, but sometimes the Host wants to see
12 * them first, so we also have a way of "reflecting" them into the Guest as if 13 * them first, so we also have a way of "reflecting" them into the Guest as if
13 * they had been delivered to it directly. :*/ 14 * they had been delivered to it directly.
15:*/
14#include <linux/uaccess.h> 16#include <linux/uaccess.h>
15#include <linux/interrupt.h> 17#include <linux/interrupt.h>
16#include <linux/module.h> 18#include <linux/module.h>
@@ -26,8 +28,10 @@ static unsigned long idt_address(u32 lo, u32 hi)
26 return (lo & 0x0000FFFF) | (hi & 0xFFFF0000); 28 return (lo & 0x0000FFFF) | (hi & 0xFFFF0000);
27} 29}
28 30
29/* The "type" of the interrupt handler is a 4 bit field: we only support a 31/*
30 * couple of types. */ 32 * The "type" of the interrupt handler is a 4 bit field: we only support a
33 * couple of types.
34 */
31static int idt_type(u32 lo, u32 hi) 35static int idt_type(u32 lo, u32 hi)
32{ 36{
33 return (hi >> 8) & 0xF; 37 return (hi >> 8) & 0xF;
@@ -39,8 +43,10 @@ static bool idt_present(u32 lo, u32 hi)
39 return (hi & 0x8000); 43 return (hi & 0x8000);
40} 44}
41 45
42/* We need a helper to "push" a value onto the Guest's stack, since that's a 46/*
43 * big part of what delivering an interrupt does. */ 47 * We need a helper to "push" a value onto the Guest's stack, since that's a
48 * big part of what delivering an interrupt does.
49 */
44static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val) 50static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val)
45{ 51{
46 /* Stack grows upwards: move stack then write value. */ 52 /* Stack grows upwards: move stack then write value. */
@@ -48,7 +54,8 @@ static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val)
48 lgwrite(cpu, *gstack, u32, val); 54 lgwrite(cpu, *gstack, u32, val);
49} 55}
50 56
51/*H:210 The set_guest_interrupt() routine actually delivers the interrupt or 57/*H:210
58 * The set_guest_interrupt() routine actually delivers the interrupt or
52 * trap. The mechanics of delivering traps and interrupts to the Guest are the 59 * trap. The mechanics of delivering traps and interrupts to the Guest are the
53 * same, except some traps have an "error code" which gets pushed onto the 60 * same, except some traps have an "error code" which gets pushed onto the
54 * stack as well: the caller tells us if this is one. 61 * stack as well: the caller tells us if this is one.
@@ -59,7 +66,8 @@ static void push_guest_stack(struct lg_cpu *cpu, unsigned long *gstack, u32 val)
59 * 66 *
60 * We set up the stack just like the CPU does for a real interrupt, so it's 67 * We set up the stack just like the CPU does for a real interrupt, so it's
61 * identical for the Guest (and the standard "iret" instruction will undo 68 * identical for the Guest (and the standard "iret" instruction will undo
62 * it). */ 69 * it).
70 */
63static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi, 71static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
64 bool has_err) 72 bool has_err)
65{ 73{
@@ -67,20 +75,26 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
67 u32 eflags, ss, irq_enable; 75 u32 eflags, ss, irq_enable;
68 unsigned long virtstack; 76 unsigned long virtstack;
69 77
70 /* There are two cases for interrupts: one where the Guest is already 78 /*
79 * There are two cases for interrupts: one where the Guest is already
71 * in the kernel, and a more complex one where the Guest is in 80 * in the kernel, and a more complex one where the Guest is in
72 * userspace. We check the privilege level to find out. */ 81 * userspace. We check the privilege level to find out.
82 */
73 if ((cpu->regs->ss&0x3) != GUEST_PL) { 83 if ((cpu->regs->ss&0x3) != GUEST_PL) {
74 /* The Guest told us their kernel stack with the SET_STACK 84 /*
75 * hypercall: both the virtual address and the segment */ 85 * The Guest told us their kernel stack with the SET_STACK
86 * hypercall: both the virtual address and the segment.
87 */
76 virtstack = cpu->esp1; 88 virtstack = cpu->esp1;
77 ss = cpu->ss1; 89 ss = cpu->ss1;
78 90
79 origstack = gstack = guest_pa(cpu, virtstack); 91 origstack = gstack = guest_pa(cpu, virtstack);
80 /* We push the old stack segment and pointer onto the new 92 /*
93 * We push the old stack segment and pointer onto the new
81 * stack: when the Guest does an "iret" back from the interrupt 94 * stack: when the Guest does an "iret" back from the interrupt
82 * handler the CPU will notice they're dropping privilege 95 * handler the CPU will notice they're dropping privilege
83 * levels and expect these here. */ 96 * levels and expect these here.
97 */
84 push_guest_stack(cpu, &gstack, cpu->regs->ss); 98 push_guest_stack(cpu, &gstack, cpu->regs->ss);
85 push_guest_stack(cpu, &gstack, cpu->regs->esp); 99 push_guest_stack(cpu, &gstack, cpu->regs->esp);
86 } else { 100 } else {
@@ -91,18 +105,22 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
91 origstack = gstack = guest_pa(cpu, virtstack); 105 origstack = gstack = guest_pa(cpu, virtstack);
92 } 106 }
93 107
94 /* Remember that we never let the Guest actually disable interrupts, so 108 /*
109 * Remember that we never let the Guest actually disable interrupts, so
95 * the "Interrupt Flag" bit is always set. We copy that bit from the 110 * the "Interrupt Flag" bit is always set. We copy that bit from the
96 * Guest's "irq_enabled" field into the eflags word: we saw the Guest 111 * Guest's "irq_enabled" field into the eflags word: we saw the Guest
97 * copy it back in "lguest_iret". */ 112 * copy it back in "lguest_iret".
113 */
98 eflags = cpu->regs->eflags; 114 eflags = cpu->regs->eflags;
99 if (get_user(irq_enable, &cpu->lg->lguest_data->irq_enabled) == 0 115 if (get_user(irq_enable, &cpu->lg->lguest_data->irq_enabled) == 0
100 && !(irq_enable & X86_EFLAGS_IF)) 116 && !(irq_enable & X86_EFLAGS_IF))
101 eflags &= ~X86_EFLAGS_IF; 117 eflags &= ~X86_EFLAGS_IF;
102 118
103 /* An interrupt is expected to push three things on the stack: the old 119 /*
120 * An interrupt is expected to push three things on the stack: the old
104 * "eflags" word, the old code segment, and the old instruction 121 * "eflags" word, the old code segment, and the old instruction
105 * pointer. */ 122 * pointer.
123 */
106 push_guest_stack(cpu, &gstack, eflags); 124 push_guest_stack(cpu, &gstack, eflags);
107 push_guest_stack(cpu, &gstack, cpu->regs->cs); 125 push_guest_stack(cpu, &gstack, cpu->regs->cs);
108 push_guest_stack(cpu, &gstack, cpu->regs->eip); 126 push_guest_stack(cpu, &gstack, cpu->regs->eip);
@@ -111,15 +129,19 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
111 if (has_err) 129 if (has_err)
112 push_guest_stack(cpu, &gstack, cpu->regs->errcode); 130 push_guest_stack(cpu, &gstack, cpu->regs->errcode);
113 131
114 /* Now we've pushed all the old state, we change the stack, the code 132 /*
115 * segment and the address to execute. */ 133 * Now we've pushed all the old state, we change the stack, the code
134 * segment and the address to execute.
135 */
116 cpu->regs->ss = ss; 136 cpu->regs->ss = ss;
117 cpu->regs->esp = virtstack + (gstack - origstack); 137 cpu->regs->esp = virtstack + (gstack - origstack);
118 cpu->regs->cs = (__KERNEL_CS|GUEST_PL); 138 cpu->regs->cs = (__KERNEL_CS|GUEST_PL);
119 cpu->regs->eip = idt_address(lo, hi); 139 cpu->regs->eip = idt_address(lo, hi);
120 140
121 /* There are two kinds of interrupt handlers: 0xE is an "interrupt 141 /*
122 * gate" which expects interrupts to be disabled on entry. */ 142 * There are two kinds of interrupt handlers: 0xE is an "interrupt
143 * gate" which expects interrupts to be disabled on entry.
144 */
123 if (idt_type(lo, hi) == 0xE) 145 if (idt_type(lo, hi) == 0xE)
124 if (put_user(0, &cpu->lg->lguest_data->irq_enabled)) 146 if (put_user(0, &cpu->lg->lguest_data->irq_enabled))
125 kill_guest(cpu, "Disabling interrupts"); 147 kill_guest(cpu, "Disabling interrupts");
@@ -130,7 +152,8 @@ static void set_guest_interrupt(struct lg_cpu *cpu, u32 lo, u32 hi,
130 * 152 *
131 * interrupt_pending() returns the first pending interrupt which isn't blocked 153 * interrupt_pending() returns the first pending interrupt which isn't blocked
132 * by the Guest. It is called before every entry to the Guest, and just before 154 * by the Guest. It is called before every entry to the Guest, and just before
133 * we go to sleep when the Guest has halted itself. */ 155 * we go to sleep when the Guest has halted itself.
156 */
134unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more) 157unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more)
135{ 158{
136 unsigned int irq; 159 unsigned int irq;
@@ -140,8 +163,10 @@ unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more)
140 if (!cpu->lg->lguest_data) 163 if (!cpu->lg->lguest_data)
141 return LGUEST_IRQS; 164 return LGUEST_IRQS;
142 165
143 /* Take our "irqs_pending" array and remove any interrupts the Guest 166 /*
144 * wants blocked: the result ends up in "blk". */ 167 * Take our "irqs_pending" array and remove any interrupts the Guest
168 * wants blocked: the result ends up in "blk".
169 */
145 if (copy_from_user(&blk, cpu->lg->lguest_data->blocked_interrupts, 170 if (copy_from_user(&blk, cpu->lg->lguest_data->blocked_interrupts,
146 sizeof(blk))) 171 sizeof(blk)))
147 return LGUEST_IRQS; 172 return LGUEST_IRQS;
@@ -154,16 +179,20 @@ unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more)
154 return irq; 179 return irq;
155} 180}
156 181
157/* This actually diverts the Guest to running an interrupt handler, once an 182/*
158 * interrupt has been identified by interrupt_pending(). */ 183 * This actually diverts the Guest to running an interrupt handler, once an
184 * interrupt has been identified by interrupt_pending().
185 */
159void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more) 186void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
160{ 187{
161 struct desc_struct *idt; 188 struct desc_struct *idt;
162 189
163 BUG_ON(irq >= LGUEST_IRQS); 190 BUG_ON(irq >= LGUEST_IRQS);
164 191
165 /* They may be in the middle of an iret, where they asked us never to 192 /*
166 * deliver interrupts. */ 193 * They may be in the middle of an iret, where they asked us never to
194 * deliver interrupts.
195 */
167 if (cpu->regs->eip >= cpu->lg->noirq_start && 196 if (cpu->regs->eip >= cpu->lg->noirq_start &&
168 (cpu->regs->eip < cpu->lg->noirq_end)) 197 (cpu->regs->eip < cpu->lg->noirq_end))
169 return; 198 return;
@@ -187,29 +216,37 @@ void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
187 } 216 }
188 } 217 }
189 218
190 /* Look at the IDT entry the Guest gave us for this interrupt. The 219 /*
220 * Look at the IDT entry the Guest gave us for this interrupt. The
191 * first 32 (FIRST_EXTERNAL_VECTOR) entries are for traps, so we skip 221 * first 32 (FIRST_EXTERNAL_VECTOR) entries are for traps, so we skip
192 * over them. */ 222 * over them.
223 */
193 idt = &cpu->arch.idt[FIRST_EXTERNAL_VECTOR+irq]; 224 idt = &cpu->arch.idt[FIRST_EXTERNAL_VECTOR+irq];
194 /* If they don't have a handler (yet?), we just ignore it */ 225 /* If they don't have a handler (yet?), we just ignore it */
195 if (idt_present(idt->a, idt->b)) { 226 if (idt_present(idt->a, idt->b)) {
196 /* OK, mark it no longer pending and deliver it. */ 227 /* OK, mark it no longer pending and deliver it. */
197 clear_bit(irq, cpu->irqs_pending); 228 clear_bit(irq, cpu->irqs_pending);
198 /* set_guest_interrupt() takes the interrupt descriptor and a 229 /*
230 * set_guest_interrupt() takes the interrupt descriptor and a
199 * flag to say whether this interrupt pushes an error code onto 231 * flag to say whether this interrupt pushes an error code onto
200 * the stack as well: virtual interrupts never do. */ 232 * the stack as well: virtual interrupts never do.
233 */
201 set_guest_interrupt(cpu, idt->a, idt->b, false); 234 set_guest_interrupt(cpu, idt->a, idt->b, false);
202 } 235 }
203 236
204 /* Every time we deliver an interrupt, we update the timestamp in the 237 /*
238 * Every time we deliver an interrupt, we update the timestamp in the
205 * Guest's lguest_data struct. It would be better for the Guest if we 239 * Guest's lguest_data struct. It would be better for the Guest if we
206 * did this more often, but it can actually be quite slow: doing it 240 * did this more often, but it can actually be quite slow: doing it
207 * here is a compromise which means at least it gets updated every 241 * here is a compromise which means at least it gets updated every
208 * timer interrupt. */ 242 * timer interrupt.
243 */
209 write_timestamp(cpu); 244 write_timestamp(cpu);
210 245
211 /* If there are no other interrupts we want to deliver, clear 246 /*
212 * the pending flag. */ 247 * If there are no other interrupts we want to deliver, clear
248 * the pending flag.
249 */
213 if (!more) 250 if (!more)
214 put_user(0, &cpu->lg->lguest_data->irq_pending); 251 put_user(0, &cpu->lg->lguest_data->irq_pending);
215} 252}
@@ -217,24 +254,29 @@ void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more)
217/* And this is the routine when we want to set an interrupt for the Guest. */ 254/* And this is the routine when we want to set an interrupt for the Guest. */
218void set_interrupt(struct lg_cpu *cpu, unsigned int irq) 255void set_interrupt(struct lg_cpu *cpu, unsigned int irq)
219{ 256{
220 /* Next time the Guest runs, the core code will see if it can deliver 257 /*
221 * this interrupt. */ 258 * Next time the Guest runs, the core code will see if it can deliver
259 * this interrupt.
260 */
222 set_bit(irq, cpu->irqs_pending); 261 set_bit(irq, cpu->irqs_pending);
223 262
224 /* Make sure it sees it; it might be asleep (eg. halted), or 263 /*
225 * running the Guest right now, in which case kick_process() 264 * Make sure it sees it; it might be asleep (eg. halted), or running
226 * will knock it out. */ 265 * the Guest right now, in which case kick_process() will knock it out.
266 */
227 if (!wake_up_process(cpu->tsk)) 267 if (!wake_up_process(cpu->tsk))
228 kick_process(cpu->tsk); 268 kick_process(cpu->tsk);
229} 269}
230/*:*/ 270/*:*/
231 271
232/* Linux uses trap 128 for system calls. Plan9 uses 64, and Ron Minnich sent 272/*
273 * Linux uses trap 128 for system calls. Plan9 uses 64, and Ron Minnich sent
233 * me a patch, so we support that too. It'd be a big step for lguest if half 274 * me a patch, so we support that too. It'd be a big step for lguest if half
234 * the Plan 9 user base were to start using it. 275 * the Plan 9 user base were to start using it.
235 * 276 *
236 * Actually now I think of it, it's possible that Ron *is* half the Plan 9 277 * Actually now I think of it, it's possible that Ron *is* half the Plan 9
237 * userbase. Oh well. */ 278 * userbase. Oh well.
279 */
238static bool could_be_syscall(unsigned int num) 280static bool could_be_syscall(unsigned int num)
239{ 281{
240 /* Normal Linux SYSCALL_VECTOR or reserved vector? */ 282 /* Normal Linux SYSCALL_VECTOR or reserved vector? */
@@ -274,9 +316,11 @@ void free_interrupts(void)
274 clear_bit(syscall_vector, used_vectors); 316 clear_bit(syscall_vector, used_vectors);
275} 317}
276 318
277/*H:220 Now we've got the routines to deliver interrupts, delivering traps like 319/*H:220
320 * Now we've got the routines to deliver interrupts, delivering traps like
278 * page fault is easy. The only trick is that Intel decided that some traps 321 * page fault is easy. The only trick is that Intel decided that some traps
279 * should have error codes: */ 322 * should have error codes:
323 */
280static bool has_err(unsigned int trap) 324static bool has_err(unsigned int trap)
281{ 325{
282 return (trap == 8 || (trap >= 10 && trap <= 14) || trap == 17); 326 return (trap == 8 || (trap >= 10 && trap <= 14) || trap == 17);
@@ -285,13 +329,17 @@ static bool has_err(unsigned int trap)
285/* deliver_trap() returns true if it could deliver the trap. */ 329/* deliver_trap() returns true if it could deliver the trap. */
286bool deliver_trap(struct lg_cpu *cpu, unsigned int num) 330bool deliver_trap(struct lg_cpu *cpu, unsigned int num)
287{ 331{
288 /* Trap numbers are always 8 bit, but we set an impossible trap number 332 /*
289 * for traps inside the Switcher, so check that here. */ 333 * Trap numbers are always 8 bit, but we set an impossible trap number
334 * for traps inside the Switcher, so check that here.
335 */
290 if (num >= ARRAY_SIZE(cpu->arch.idt)) 336 if (num >= ARRAY_SIZE(cpu->arch.idt))
291 return false; 337 return false;
292 338
293 /* Early on the Guest hasn't set the IDT entries (or maybe it put a 339 /*
294 * bogus one in): if we fail here, the Guest will be killed. */ 340 * Early on the Guest hasn't set the IDT entries (or maybe it put a
341 * bogus one in): if we fail here, the Guest will be killed.
342 */
295 if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b)) 343 if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b))
296 return false; 344 return false;
297 set_guest_interrupt(cpu, cpu->arch.idt[num].a, 345 set_guest_interrupt(cpu, cpu->arch.idt[num].a,
@@ -299,7 +347,8 @@ bool deliver_trap(struct lg_cpu *cpu, unsigned int num)
299 return true; 347 return true;
300} 348}
301 349
302/*H:250 Here's the hard part: returning to the Host every time a trap happens 350/*H:250
351 * Here's the hard part: returning to the Host every time a trap happens
303 * and then calling deliver_trap() and re-entering the Guest is slow. 352 * and then calling deliver_trap() and re-entering the Guest is slow.
304 * Particularly because Guest userspace system calls are traps (usually trap 353 * Particularly because Guest userspace system calls are traps (usually trap
305 * 128). 354 * 128).
@@ -311,69 +360,87 @@ bool deliver_trap(struct lg_cpu *cpu, unsigned int num)
311 * the other hypervisors would beat it up at lunchtime. 360 * the other hypervisors would beat it up at lunchtime.
312 * 361 *
313 * This routine indicates if a particular trap number could be delivered 362 * This routine indicates if a particular trap number could be delivered
314 * directly. */ 363 * directly.
364 */
315static bool direct_trap(unsigned int num) 365static bool direct_trap(unsigned int num)
316{ 366{
317 /* Hardware interrupts don't go to the Guest at all (except system 367 /*
318 * call). */ 368 * Hardware interrupts don't go to the Guest at all (except system
369 * call).
370 */
319 if (num >= FIRST_EXTERNAL_VECTOR && !could_be_syscall(num)) 371 if (num >= FIRST_EXTERNAL_VECTOR && !could_be_syscall(num))
320 return false; 372 return false;
321 373
322 /* The Host needs to see page faults (for shadow paging and to save the 374 /*
375 * The Host needs to see page faults (for shadow paging and to save the
323 * fault address), general protection faults (in/out emulation) and 376 * fault address), general protection faults (in/out emulation) and
324 * device not available (TS handling), invalid opcode fault (kvm hcall), 377 * device not available (TS handling), invalid opcode fault (kvm hcall),
325 * and of course, the hypercall trap. */ 378 * and of course, the hypercall trap.
379 */
326 return num != 14 && num != 13 && num != 7 && 380 return num != 14 && num != 13 && num != 7 &&
327 num != 6 && num != LGUEST_TRAP_ENTRY; 381 num != 6 && num != LGUEST_TRAP_ENTRY;
328} 382}
329/*:*/ 383/*:*/
330 384
331/*M:005 The Guest has the ability to turn its interrupt gates into trap gates, 385/*M:005
386 * The Guest has the ability to turn its interrupt gates into trap gates,
332 * if it is careful. The Host will let trap gates can go directly to the 387 * if it is careful. The Host will let trap gates can go directly to the
333 * Guest, but the Guest needs the interrupts atomically disabled for an 388 * Guest, but the Guest needs the interrupts atomically disabled for an
334 * interrupt gate. It can do this by pointing the trap gate at instructions 389 * interrupt gate. It can do this by pointing the trap gate at instructions
335 * within noirq_start and noirq_end, where it can safely disable interrupts. */ 390 * within noirq_start and noirq_end, where it can safely disable interrupts.
391 */
336 392
337/*M:006 The Guests do not use the sysenter (fast system call) instruction, 393/*M:006
394 * The Guests do not use the sysenter (fast system call) instruction,
338 * because it's hardcoded to enter privilege level 0 and so can't go direct. 395 * because it's hardcoded to enter privilege level 0 and so can't go direct.
339 * It's about twice as fast as the older "int 0x80" system call, so it might 396 * It's about twice as fast as the older "int 0x80" system call, so it might
340 * still be worthwhile to handle it in the Switcher and lcall down to the 397 * still be worthwhile to handle it in the Switcher and lcall down to the
341 * Guest. The sysenter semantics are hairy tho: search for that keyword in 398 * Guest. The sysenter semantics are hairy tho: search for that keyword in
342 * entry.S :*/ 399 * entry.S
400:*/
343 401
344/*H:260 When we make traps go directly into the Guest, we need to make sure 402/*H:260
403 * When we make traps go directly into the Guest, we need to make sure
345 * the kernel stack is valid (ie. mapped in the page tables). Otherwise, the 404 * the kernel stack is valid (ie. mapped in the page tables). Otherwise, the
346 * CPU trying to deliver the trap will fault while trying to push the interrupt 405 * CPU trying to deliver the trap will fault while trying to push the interrupt
347 * words on the stack: this is called a double fault, and it forces us to kill 406 * words on the stack: this is called a double fault, and it forces us to kill
348 * the Guest. 407 * the Guest.
349 * 408 *
350 * Which is deeply unfair, because (literally!) it wasn't the Guests' fault. */ 409 * Which is deeply unfair, because (literally!) it wasn't the Guests' fault.
410 */
351void pin_stack_pages(struct lg_cpu *cpu) 411void pin_stack_pages(struct lg_cpu *cpu)
352{ 412{
353 unsigned int i; 413 unsigned int i;
354 414
355 /* Depending on the CONFIG_4KSTACKS option, the Guest can have one or 415 /*
356 * two pages of stack space. */ 416 * Depending on the CONFIG_4KSTACKS option, the Guest can have one or
417 * two pages of stack space.
418 */
357 for (i = 0; i < cpu->lg->stack_pages; i++) 419 for (i = 0; i < cpu->lg->stack_pages; i++)
358 /* The stack grows *upwards*, so the address we're given is the 420 /*
421 * The stack grows *upwards*, so the address we're given is the
359 * start of the page after the kernel stack. Subtract one to 422 * start of the page after the kernel stack. Subtract one to
360 * get back onto the first stack page, and keep subtracting to 423 * get back onto the first stack page, and keep subtracting to
361 * get to the rest of the stack pages. */ 424 * get to the rest of the stack pages.
425 */
362 pin_page(cpu, cpu->esp1 - 1 - i * PAGE_SIZE); 426 pin_page(cpu, cpu->esp1 - 1 - i * PAGE_SIZE);
363} 427}
364 428
365/* Direct traps also mean that we need to know whenever the Guest wants to use 429/*
430 * Direct traps also mean that we need to know whenever the Guest wants to use
366 * a different kernel stack, so we can change the IDT entries to use that 431 * a different kernel stack, so we can change the IDT entries to use that
367 * stack. The IDT entries expect a virtual address, so unlike most addresses 432 * stack. The IDT entries expect a virtual address, so unlike most addresses
368 * the Guest gives us, the "esp" (stack pointer) value here is virtual, not 433 * the Guest gives us, the "esp" (stack pointer) value here is virtual, not
369 * physical. 434 * physical.
370 * 435 *
371 * In Linux each process has its own kernel stack, so this happens a lot: we 436 * In Linux each process has its own kernel stack, so this happens a lot: we
372 * change stacks on each context switch. */ 437 * change stacks on each context switch.
438 */
373void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages) 439void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages)
374{ 440{
375 /* You are not allowed have a stack segment with privilege level 0: bad 441 /*
376 * Guest! */ 442 * You're not allowed a stack segment with privilege level 0: bad Guest!
443 */
377 if ((seg & 0x3) != GUEST_PL) 444 if ((seg & 0x3) != GUEST_PL)
378 kill_guest(cpu, "bad stack segment %i", seg); 445 kill_guest(cpu, "bad stack segment %i", seg);
379 /* We only expect one or two stack pages. */ 446 /* We only expect one or two stack pages. */
@@ -387,11 +454,15 @@ void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages)
387 pin_stack_pages(cpu); 454 pin_stack_pages(cpu);
388} 455}
389 456
390/* All this reference to mapping stacks leads us neatly into the other complex 457/*
391 * part of the Host: page table handling. */ 458 * All this reference to mapping stacks leads us neatly into the other complex
459 * part of the Host: page table handling.
460 */
392 461
393/*H:235 This is the routine which actually checks the Guest's IDT entry and 462/*H:235
394 * transfers it into the entry in "struct lguest": */ 463 * This is the routine which actually checks the Guest's IDT entry and
464 * transfers it into the entry in "struct lguest":
465 */
395static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap, 466static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap,
396 unsigned int num, u32 lo, u32 hi) 467 unsigned int num, u32 lo, u32 hi)
397{ 468{
@@ -407,30 +478,38 @@ static void set_trap(struct lg_cpu *cpu, struct desc_struct *trap,
407 if (type != 0xE && type != 0xF) 478 if (type != 0xE && type != 0xF)
408 kill_guest(cpu, "bad IDT type %i", type); 479 kill_guest(cpu, "bad IDT type %i", type);
409 480
410 /* We only copy the handler address, present bit, privilege level and 481 /*
482 * We only copy the handler address, present bit, privilege level and
411 * type. The privilege level controls where the trap can be triggered 483 * type. The privilege level controls where the trap can be triggered
412 * manually with an "int" instruction. This is usually GUEST_PL, 484 * manually with an "int" instruction. This is usually GUEST_PL,
413 * except for system calls which userspace can use. */ 485 * except for system calls which userspace can use.
486 */
414 trap->a = ((__KERNEL_CS|GUEST_PL)<<16) | (lo&0x0000FFFF); 487 trap->a = ((__KERNEL_CS|GUEST_PL)<<16) | (lo&0x0000FFFF);
415 trap->b = (hi&0xFFFFEF00); 488 trap->b = (hi&0xFFFFEF00);
416} 489}
417 490
418/*H:230 While we're here, dealing with delivering traps and interrupts to the 491/*H:230
492 * While we're here, dealing with delivering traps and interrupts to the
419 * Guest, we might as well complete the picture: how the Guest tells us where 493 * Guest, we might as well complete the picture: how the Guest tells us where
420 * it wants them to go. This would be simple, except making traps fast 494 * it wants them to go. This would be simple, except making traps fast
421 * requires some tricks. 495 * requires some tricks.
422 * 496 *
423 * We saw the Guest setting Interrupt Descriptor Table (IDT) entries with the 497 * We saw the Guest setting Interrupt Descriptor Table (IDT) entries with the
424 * LHCALL_LOAD_IDT_ENTRY hypercall before: that comes here. */ 498 * LHCALL_LOAD_IDT_ENTRY hypercall before: that comes here.
499 */
425void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi) 500void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi)
426{ 501{
427 /* Guest never handles: NMI, doublefault, spurious interrupt or 502 /*
428 * hypercall. We ignore when it tries to set them. */ 503 * Guest never handles: NMI, doublefault, spurious interrupt or
504 * hypercall. We ignore when it tries to set them.
505 */
429 if (num == 2 || num == 8 || num == 15 || num == LGUEST_TRAP_ENTRY) 506 if (num == 2 || num == 8 || num == 15 || num == LGUEST_TRAP_ENTRY)
430 return; 507 return;
431 508
432 /* Mark the IDT as changed: next time the Guest runs we'll know we have 509 /*
433 * to copy this again. */ 510 * Mark the IDT as changed: next time the Guest runs we'll know we have
511 * to copy this again.
512 */
434 cpu->changed |= CHANGED_IDT; 513 cpu->changed |= CHANGED_IDT;
435 514
436 /* Check that the Guest doesn't try to step outside the bounds. */ 515 /* Check that the Guest doesn't try to step outside the bounds. */
@@ -440,9 +519,11 @@ void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int num, u32 lo, u32 hi)
440 set_trap(cpu, &cpu->arch.idt[num], num, lo, hi); 519 set_trap(cpu, &cpu->arch.idt[num], num, lo, hi);
441} 520}
442 521
443/* The default entry for each interrupt points into the Switcher routines which 522/*
523 * The default entry for each interrupt points into the Switcher routines which
444 * simply return to the Host. The run_guest() loop will then call 524 * simply return to the Host. The run_guest() loop will then call
445 * deliver_trap() to bounce it back into the Guest. */ 525 * deliver_trap() to bounce it back into the Guest.
526 */
446static void default_idt_entry(struct desc_struct *idt, 527static void default_idt_entry(struct desc_struct *idt,
447 int trap, 528 int trap,
448 const unsigned long handler, 529 const unsigned long handler,
@@ -451,13 +532,17 @@ static void default_idt_entry(struct desc_struct *idt,
451 /* A present interrupt gate. */ 532 /* A present interrupt gate. */
452 u32 flags = 0x8e00; 533 u32 flags = 0x8e00;
453 534
454 /* Set the privilege level on the entry for the hypercall: this allows 535 /*
455 * the Guest to use the "int" instruction to trigger it. */ 536 * Set the privilege level on the entry for the hypercall: this allows
537 * the Guest to use the "int" instruction to trigger it.
538 */
456 if (trap == LGUEST_TRAP_ENTRY) 539 if (trap == LGUEST_TRAP_ENTRY)
457 flags |= (GUEST_PL << 13); 540 flags |= (GUEST_PL << 13);
458 else if (base) 541 else if (base)
459 /* Copy priv. level from what Guest asked for. This allows 542 /*
460 * debug (int 3) traps from Guest userspace, for example. */ 543 * Copy privilege level from what Guest asked for. This allows
544 * debug (int 3) traps from Guest userspace, for example.
545 */
461 flags |= (base->b & 0x6000); 546 flags |= (base->b & 0x6000);
462 547
463 /* Now pack it into the IDT entry in its weird format. */ 548 /* Now pack it into the IDT entry in its weird format. */
@@ -475,16 +560,20 @@ void setup_default_idt_entries(struct lguest_ro_state *state,
475 default_idt_entry(&state->guest_idt[i], i, def[i], NULL); 560 default_idt_entry(&state->guest_idt[i], i, def[i], NULL);
476} 561}
477 562
478/*H:240 We don't use the IDT entries in the "struct lguest" directly, instead 563/*H:240
564 * We don't use the IDT entries in the "struct lguest" directly, instead
479 * we copy them into the IDT which we've set up for Guests on this CPU, just 565 * we copy them into the IDT which we've set up for Guests on this CPU, just
480 * before we run the Guest. This routine does that copy. */ 566 * before we run the Guest. This routine does that copy.
567 */
481void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, 568void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
482 const unsigned long *def) 569 const unsigned long *def)
483{ 570{
484 unsigned int i; 571 unsigned int i;
485 572
486 /* We can simply copy the direct traps, otherwise we use the default 573 /*
487 * ones in the Switcher: they will return to the Host. */ 574 * We can simply copy the direct traps, otherwise we use the default
575 * ones in the Switcher: they will return to the Host.
576 */
488 for (i = 0; i < ARRAY_SIZE(cpu->arch.idt); i++) { 577 for (i = 0; i < ARRAY_SIZE(cpu->arch.idt); i++) {
489 const struct desc_struct *gidt = &cpu->arch.idt[i]; 578 const struct desc_struct *gidt = &cpu->arch.idt[i];
490 579
@@ -492,14 +581,16 @@ void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
492 if (!direct_trap(i)) 581 if (!direct_trap(i))
493 continue; 582 continue;
494 583
495 /* Only trap gates (type 15) can go direct to the Guest. 584 /*
585 * Only trap gates (type 15) can go direct to the Guest.
496 * Interrupt gates (type 14) disable interrupts as they are 586 * Interrupt gates (type 14) disable interrupts as they are
497 * entered, which we never let the Guest do. Not present 587 * entered, which we never let the Guest do. Not present
498 * entries (type 0x0) also can't go direct, of course. 588 * entries (type 0x0) also can't go direct, of course.
499 * 589 *
500 * If it can't go direct, we still need to copy the priv. level: 590 * If it can't go direct, we still need to copy the priv. level:
501 * they might want to give userspace access to a software 591 * they might want to give userspace access to a software
502 * interrupt. */ 592 * interrupt.
593 */
503 if (idt_type(gidt->a, gidt->b) == 0xF) 594 if (idt_type(gidt->a, gidt->b) == 0xF)
504 idt[i] = *gidt; 595 idt[i] = *gidt;
505 else 596 else
@@ -518,7 +609,8 @@ void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt,
518 * the next timer interrupt (in nanoseconds). We use the high-resolution timer 609 * the next timer interrupt (in nanoseconds). We use the high-resolution timer
519 * infrastructure to set a callback at that time. 610 * infrastructure to set a callback at that time.
520 * 611 *
521 * 0 means "turn off the clock". */ 612 * 0 means "turn off the clock".
613 */
522void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta) 614void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta)
523{ 615{
524 ktime_t expires; 616 ktime_t expires;
@@ -529,9 +621,11 @@ void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta)
529 return; 621 return;
530 } 622 }
531 623
532 /* We use wallclock time here, so the Guest might not be running for 624 /*
625 * We use wallclock time here, so the Guest might not be running for
533 * all the time between now and the timer interrupt it asked for. This 626 * all the time between now and the timer interrupt it asked for. This
534 * is almost always the right thing to do. */ 627 * is almost always the right thing to do.
628 */
535 expires = ktime_add_ns(ktime_get_real(), delta); 629 expires = ktime_add_ns(ktime_get_real(), delta);
536 hrtimer_start(&cpu->hrt, expires, HRTIMER_MODE_ABS); 630 hrtimer_start(&cpu->hrt, expires, HRTIMER_MODE_ABS);
537} 631}
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
index 9c3138265f8e..bc28745d05af 100644
--- a/drivers/lguest/lg.h
+++ b/drivers/lguest/lg.h
@@ -16,15 +16,13 @@
16void free_pagetables(void); 16void free_pagetables(void);
17int init_pagetables(struct page **switcher_page, unsigned int pages); 17int init_pagetables(struct page **switcher_page, unsigned int pages);
18 18
19struct pgdir 19struct pgdir {
20{
21 unsigned long gpgdir; 20 unsigned long gpgdir;
22 pgd_t *pgdir; 21 pgd_t *pgdir;
23}; 22};
24 23
25/* We have two pages shared with guests, per cpu. */ 24/* We have two pages shared with guests, per cpu. */
26struct lguest_pages 25struct lguest_pages {
27{
28 /* This is the stack page mapped rw in guest */ 26 /* This is the stack page mapped rw in guest */
29 char spare[PAGE_SIZE - sizeof(struct lguest_regs)]; 27 char spare[PAGE_SIZE - sizeof(struct lguest_regs)];
30 struct lguest_regs regs; 28 struct lguest_regs regs;
@@ -38,8 +36,6 @@ struct lguest_pages
38#define CHANGED_GDT_TLS 4 /* Actually a subset of CHANGED_GDT */ 36#define CHANGED_GDT_TLS 4 /* Actually a subset of CHANGED_GDT */
39#define CHANGED_ALL 3 37#define CHANGED_ALL 3
40 38
41struct lguest;
42
43struct lg_cpu { 39struct lg_cpu {
44 unsigned int id; 40 unsigned int id;
45 struct lguest *lg; 41 struct lguest *lg;
@@ -56,13 +52,13 @@ struct lg_cpu {
56 52
57 unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */ 53 unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */
58 54
59 /* At end of a page shared mapped over lguest_pages in guest. */ 55 /* At end of a page shared mapped over lguest_pages in guest. */
60 unsigned long regs_page; 56 unsigned long regs_page;
61 struct lguest_regs *regs; 57 struct lguest_regs *regs;
62 58
63 struct lguest_pages *last_pages; 59 struct lguest_pages *last_pages;
64 60
65 int cpu_pgd; /* which pgd this cpu is currently using */ 61 int cpu_pgd; /* Which pgd this cpu is currently using */
66 62
67 /* If a hypercall was asked for, this points to the arguments. */ 63 /* If a hypercall was asked for, this points to the arguments. */
68 struct hcall_args *hcall; 64 struct hcall_args *hcall;
@@ -91,15 +87,17 @@ struct lg_eventfd_map {
91}; 87};
92 88
93/* The private info the thread maintains about the guest. */ 89/* The private info the thread maintains about the guest. */
94struct lguest 90struct lguest {
95{
96 struct lguest_data __user *lguest_data; 91 struct lguest_data __user *lguest_data;
97 struct lg_cpu cpus[NR_CPUS]; 92 struct lg_cpu cpus[NR_CPUS];
98 unsigned int nr_cpus; 93 unsigned int nr_cpus;
99 94
100 u32 pfn_limit; 95 u32 pfn_limit;
101 /* This provides the offset to the base of guest-physical 96
102 * memory in the Launcher. */ 97 /*
98 * This provides the offset to the base of guest-physical memory in the
99 * Launcher.
100 */
103 void __user *mem_base; 101 void __user *mem_base;
104 unsigned long kernel_address; 102 unsigned long kernel_address;
105 103
@@ -124,11 +122,13 @@ bool lguest_address_ok(const struct lguest *lg,
124void __lgread(struct lg_cpu *, void *, unsigned long, unsigned); 122void __lgread(struct lg_cpu *, void *, unsigned long, unsigned);
125void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned); 123void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned);
126 124
127/*H:035 Using memory-copy operations like that is usually inconvient, so we 125/*H:035
126 * Using memory-copy operations like that is usually inconvient, so we
128 * have the following helper macros which read and write a specific type (often 127 * have the following helper macros which read and write a specific type (often
129 * an unsigned long). 128 * an unsigned long).
130 * 129 *
131 * This reads into a variable of the given type then returns that. */ 130 * This reads into a variable of the given type then returns that.
131 */
132#define lgread(cpu, addr, type) \ 132#define lgread(cpu, addr, type) \
133 ({ type _v; __lgread((cpu), &_v, (addr), sizeof(_v)); _v; }) 133 ({ type _v; __lgread((cpu), &_v, (addr), sizeof(_v)); _v; })
134 134
@@ -142,9 +142,11 @@ void __lgwrite(struct lg_cpu *, unsigned long, const void *, unsigned);
142 142
143int run_guest(struct lg_cpu *cpu, unsigned long __user *user); 143int run_guest(struct lg_cpu *cpu, unsigned long __user *user);
144 144
145/* Helper macros to obtain the first 12 or the last 20 bits, this is only the 145/*
146 * Helper macros to obtain the first 12 or the last 20 bits, this is only the
146 * first step in the migration to the kernel types. pte_pfn is already defined 147 * first step in the migration to the kernel types. pte_pfn is already defined
147 * in the kernel. */ 148 * in the kernel.
149 */
148#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) 150#define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK)
149#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) 151#define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT)
150#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) 152#define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK)
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c
index e082cdac88b4..b6200bc39b58 100644
--- a/drivers/lguest/lguest_device.c
+++ b/drivers/lguest/lguest_device.c
@@ -1,10 +1,12 @@
1/*P:050 Lguest guests use a very simple method to describe devices. It's a 1/*P:050
2 * Lguest guests use a very simple method to describe devices. It's a
2 * series of device descriptors contained just above the top of normal Guest 3 * series of device descriptors contained just above the top of normal Guest
3 * memory. 4 * memory.
4 * 5 *
5 * We use the standard "virtio" device infrastructure, which provides us with a 6 * We use the standard "virtio" device infrastructure, which provides us with a
6 * console, a network and a block driver. Each one expects some configuration 7 * console, a network and a block driver. Each one expects some configuration
7 * information and a "virtqueue" or two to send and receive data. :*/ 8 * information and a "virtqueue" or two to send and receive data.
9:*/
8#include <linux/init.h> 10#include <linux/init.h>
9#include <linux/bootmem.h> 11#include <linux/bootmem.h>
10#include <linux/lguest_launcher.h> 12#include <linux/lguest_launcher.h>
@@ -20,8 +22,10 @@
20/* The pointer to our (page) of device descriptions. */ 22/* The pointer to our (page) of device descriptions. */
21static void *lguest_devices; 23static void *lguest_devices;
22 24
23/* For Guests, device memory can be used as normal memory, so we cast away the 25/*
24 * __iomem to quieten sparse. */ 26 * For Guests, device memory can be used as normal memory, so we cast away the
27 * __iomem to quieten sparse.
28 */
25static inline void *lguest_map(unsigned long phys_addr, unsigned long pages) 29static inline void *lguest_map(unsigned long phys_addr, unsigned long pages)
26{ 30{
27 return (__force void *)ioremap_cache(phys_addr, PAGE_SIZE*pages); 31 return (__force void *)ioremap_cache(phys_addr, PAGE_SIZE*pages);
@@ -32,8 +36,10 @@ static inline void lguest_unmap(void *addr)
32 iounmap((__force void __iomem *)addr); 36 iounmap((__force void __iomem *)addr);
33} 37}
34 38
35/*D:100 Each lguest device is just a virtio device plus a pointer to its entry 39/*D:100
36 * in the lguest_devices page. */ 40 * Each lguest device is just a virtio device plus a pointer to its entry
41 * in the lguest_devices page.
42 */
37struct lguest_device { 43struct lguest_device {
38 struct virtio_device vdev; 44 struct virtio_device vdev;
39 45
@@ -41,9 +47,11 @@ struct lguest_device {
41 struct lguest_device_desc *desc; 47 struct lguest_device_desc *desc;
42}; 48};
43 49
44/* Since the virtio infrastructure hands us a pointer to the virtio_device all 50/*
51 * Since the virtio infrastructure hands us a pointer to the virtio_device all
45 * the time, it helps to have a curt macro to get a pointer to the struct 52 * the time, it helps to have a curt macro to get a pointer to the struct
46 * lguest_device it's enclosed in. */ 53 * lguest_device it's enclosed in.
54 */
47#define to_lgdev(vd) container_of(vd, struct lguest_device, vdev) 55#define to_lgdev(vd) container_of(vd, struct lguest_device, vdev)
48 56
49/*D:130 57/*D:130
@@ -55,7 +63,8 @@ struct lguest_device {
55 * the driver will look at them during setup. 63 * the driver will look at them during setup.
56 * 64 *
57 * A convenient routine to return the device's virtqueue config array: 65 * A convenient routine to return the device's virtqueue config array:
58 * immediately after the descriptor. */ 66 * immediately after the descriptor.
67 */
59static struct lguest_vqconfig *lg_vq(const struct lguest_device_desc *desc) 68static struct lguest_vqconfig *lg_vq(const struct lguest_device_desc *desc)
60{ 69{
61 return (void *)(desc + 1); 70 return (void *)(desc + 1);
@@ -98,10 +107,12 @@ static u32 lg_get_features(struct virtio_device *vdev)
98 return features; 107 return features;
99} 108}
100 109
101/* The virtio core takes the features the Host offers, and copies the 110/*
102 * ones supported by the driver into the vdev->features array. Once 111 * The virtio core takes the features the Host offers, and copies the ones
103 * that's all sorted out, this routine is called so we can tell the 112 * supported by the driver into the vdev->features array. Once that's all
104 * Host which features we understand and accept. */ 113 * sorted out, this routine is called so we can tell the Host which features we
114 * understand and accept.
115 */
105static void lg_finalize_features(struct virtio_device *vdev) 116static void lg_finalize_features(struct virtio_device *vdev)
106{ 117{
107 unsigned int i, bits; 118 unsigned int i, bits;
@@ -112,10 +123,11 @@ static void lg_finalize_features(struct virtio_device *vdev)
112 /* Give virtio_ring a chance to accept features. */ 123 /* Give virtio_ring a chance to accept features. */
113 vring_transport_features(vdev); 124 vring_transport_features(vdev);
114 125
115 /* The vdev->feature array is a Linux bitmask: this isn't the 126 /*
116 * same as a the simple array of bits used by lguest devices 127 * The vdev->feature array is a Linux bitmask: this isn't the same as a
117 * for features. So we do this slow, manual conversion which is 128 * the simple array of bits used by lguest devices for features. So we
118 * completely general. */ 129 * do this slow, manual conversion which is completely general.
130 */
119 memset(out_features, 0, desc->feature_len); 131 memset(out_features, 0, desc->feature_len);
120 bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8; 132 bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8;
121 for (i = 0; i < bits; i++) { 133 for (i = 0; i < bits; i++) {
@@ -146,15 +158,19 @@ static void lg_set(struct virtio_device *vdev, unsigned int offset,
146 memcpy(lg_config(desc) + offset, buf, len); 158 memcpy(lg_config(desc) + offset, buf, len);
147} 159}
148 160
149/* The operations to get and set the status word just access the status field 161/*
150 * of the device descriptor. */ 162 * The operations to get and set the status word just access the status field
163 * of the device descriptor.
164 */
151static u8 lg_get_status(struct virtio_device *vdev) 165static u8 lg_get_status(struct virtio_device *vdev)
152{ 166{
153 return to_lgdev(vdev)->desc->status; 167 return to_lgdev(vdev)->desc->status;
154} 168}
155 169
156/* To notify on status updates, we (ab)use the NOTIFY hypercall, with the 170/*
157 * descriptor address of the device. A zero status means "reset". */ 171 * To notify on status updates, we (ab)use the NOTIFY hypercall, with the
172 * descriptor address of the device. A zero status means "reset".
173 */
158static void set_status(struct virtio_device *vdev, u8 status) 174static void set_status(struct virtio_device *vdev, u8 status)
159{ 175{
160 unsigned long offset = (void *)to_lgdev(vdev)->desc - lguest_devices; 176 unsigned long offset = (void *)to_lgdev(vdev)->desc - lguest_devices;
@@ -191,8 +207,7 @@ static void lg_reset(struct virtio_device *vdev)
191 */ 207 */
192 208
193/*D:140 This is the information we remember about each virtqueue. */ 209/*D:140 This is the information we remember about each virtqueue. */
194struct lguest_vq_info 210struct lguest_vq_info {
195{
196 /* A copy of the information contained in the device config. */ 211 /* A copy of the information contained in the device config. */
197 struct lguest_vqconfig config; 212 struct lguest_vqconfig config;
198 213
@@ -200,13 +215,17 @@ struct lguest_vq_info
200 void *pages; 215 void *pages;
201}; 216};
202 217
203/* When the virtio_ring code wants to prod the Host, it calls us here and we 218/*
219 * When the virtio_ring code wants to prod the Host, it calls us here and we
204 * make a hypercall. We hand the physical address of the virtqueue so the Host 220 * make a hypercall. We hand the physical address of the virtqueue so the Host
205 * knows which virtqueue we're talking about. */ 221 * knows which virtqueue we're talking about.
222 */
206static void lg_notify(struct virtqueue *vq) 223static void lg_notify(struct virtqueue *vq)
207{ 224{
208 /* We store our virtqueue information in the "priv" pointer of the 225 /*
209 * virtqueue structure. */ 226 * We store our virtqueue information in the "priv" pointer of the
227 * virtqueue structure.
228 */
210 struct lguest_vq_info *lvq = vq->priv; 229 struct lguest_vq_info *lvq = vq->priv;
211 230
212 kvm_hypercall1(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT); 231 kvm_hypercall1(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT);
@@ -215,7 +234,8 @@ static void lg_notify(struct virtqueue *vq)
215/* An extern declaration inside a C file is bad form. Don't do it. */ 234/* An extern declaration inside a C file is bad form. Don't do it. */
216extern void lguest_setup_irq(unsigned int irq); 235extern void lguest_setup_irq(unsigned int irq);
217 236
218/* This routine finds the first virtqueue described in the configuration of 237/*
238 * This routine finds the Nth virtqueue described in the configuration of
219 * this device and sets it up. 239 * this device and sets it up.
220 * 240 *
221 * This is kind of an ugly duckling. It'd be nicer to have a standard 241 * This is kind of an ugly duckling. It'd be nicer to have a standard
@@ -223,9 +243,7 @@ extern void lguest_setup_irq(unsigned int irq);
223 * everyone wants to do it differently. The KVM coders want the Guest to 243 * everyone wants to do it differently. The KVM coders want the Guest to
224 * allocate its own pages and tell the Host where they are, but for lguest it's 244 * allocate its own pages and tell the Host where they are, but for lguest it's
225 * simpler for the Host to simply tell us where the pages are. 245 * simpler for the Host to simply tell us where the pages are.
226 * 246 */
227 * So we provide drivers with a "find the Nth virtqueue and set it up"
228 * function. */
229static struct virtqueue *lg_find_vq(struct virtio_device *vdev, 247static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
230 unsigned index, 248 unsigned index,
231 void (*callback)(struct virtqueue *vq), 249 void (*callback)(struct virtqueue *vq),
@@ -244,9 +262,11 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
244 if (!lvq) 262 if (!lvq)
245 return ERR_PTR(-ENOMEM); 263 return ERR_PTR(-ENOMEM);
246 264
247 /* Make a copy of the "struct lguest_vqconfig" entry, which sits after 265 /*
266 * Make a copy of the "struct lguest_vqconfig" entry, which sits after
248 * the descriptor. We need a copy because the config space might not 267 * the descriptor. We need a copy because the config space might not
249 * be aligned correctly. */ 268 * be aligned correctly.
269 */
250 memcpy(&lvq->config, lg_vq(ldev->desc)+index, sizeof(lvq->config)); 270 memcpy(&lvq->config, lg_vq(ldev->desc)+index, sizeof(lvq->config));
251 271
252 printk("Mapping virtqueue %i addr %lx\n", index, 272 printk("Mapping virtqueue %i addr %lx\n", index,
@@ -261,8 +281,10 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
261 goto free_lvq; 281 goto free_lvq;
262 } 282 }
263 283
264 /* OK, tell virtio_ring.c to set up a virtqueue now we know its size 284 /*
265 * and we've got a pointer to its pages. */ 285 * OK, tell virtio_ring.c to set up a virtqueue now we know its size
286 * and we've got a pointer to its pages.
287 */
266 vq = vring_new_virtqueue(lvq->config.num, LGUEST_VRING_ALIGN, 288 vq = vring_new_virtqueue(lvq->config.num, LGUEST_VRING_ALIGN,
267 vdev, lvq->pages, lg_notify, callback, name); 289 vdev, lvq->pages, lg_notify, callback, name);
268 if (!vq) { 290 if (!vq) {
@@ -273,18 +295,23 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
273 /* Make sure the interrupt is allocated. */ 295 /* Make sure the interrupt is allocated. */
274 lguest_setup_irq(lvq->config.irq); 296 lguest_setup_irq(lvq->config.irq);
275 297
276 /* Tell the interrupt for this virtqueue to go to the virtio_ring 298 /*
277 * interrupt handler. */ 299 * Tell the interrupt for this virtqueue to go to the virtio_ring
278 /* FIXME: We used to have a flag for the Host to tell us we could use 300 * interrupt handler.
301 *
302 * FIXME: We used to have a flag for the Host to tell us we could use
279 * the interrupt as a source of randomness: it'd be nice to have that 303 * the interrupt as a source of randomness: it'd be nice to have that
280 * back.. */ 304 * back.
305 */
281 err = request_irq(lvq->config.irq, vring_interrupt, IRQF_SHARED, 306 err = request_irq(lvq->config.irq, vring_interrupt, IRQF_SHARED,
282 dev_name(&vdev->dev), vq); 307 dev_name(&vdev->dev), vq);
283 if (err) 308 if (err)
284 goto destroy_vring; 309 goto destroy_vring;
285 310
286 /* Last of all we hook up our 'struct lguest_vq_info" to the 311 /*
287 * virtqueue's priv pointer. */ 312 * Last of all we hook up our 'struct lguest_vq_info" to the
313 * virtqueue's priv pointer.
314 */
288 vq->priv = lvq; 315 vq->priv = lvq;
289 return vq; 316 return vq;
290 317
@@ -358,11 +385,14 @@ static struct virtio_config_ops lguest_config_ops = {
358 .del_vqs = lg_del_vqs, 385 .del_vqs = lg_del_vqs,
359}; 386};
360 387
361/* The root device for the lguest virtio devices. This makes them appear as 388/*
362 * /sys/devices/lguest/0,1,2 not /sys/devices/0,1,2. */ 389 * The root device for the lguest virtio devices. This makes them appear as
390 * /sys/devices/lguest/0,1,2 not /sys/devices/0,1,2.
391 */
363static struct device *lguest_root; 392static struct device *lguest_root;
364 393
365/*D:120 This is the core of the lguest bus: actually adding a new device. 394/*D:120
395 * This is the core of the lguest bus: actually adding a new device.
366 * It's a separate function because it's neater that way, and because an 396 * It's a separate function because it's neater that way, and because an
367 * earlier version of the code supported hotplug and unplug. They were removed 397 * earlier version of the code supported hotplug and unplug. They were removed
368 * early on because they were never used. 398 * early on because they were never used.
@@ -371,14 +401,14 @@ static struct device *lguest_root;
371 * 401 *
372 * It's worth reading this carefully: we start with a pointer to the new device 402 * It's worth reading this carefully: we start with a pointer to the new device
373 * descriptor in the "lguest_devices" page, and the offset into the device 403 * descriptor in the "lguest_devices" page, and the offset into the device
374 * descriptor page so we can uniquely identify it if things go badly wrong. */ 404 * descriptor page so we can uniquely identify it if things go badly wrong.
405 */
375static void add_lguest_device(struct lguest_device_desc *d, 406static void add_lguest_device(struct lguest_device_desc *d,
376 unsigned int offset) 407 unsigned int offset)
377{ 408{
378 struct lguest_device *ldev; 409 struct lguest_device *ldev;
379 410
380 /* Start with zeroed memory; Linux's device layer seems to count on 411 /* Start with zeroed memory; Linux's device layer counts on it. */
381 * it. */
382 ldev = kzalloc(sizeof(*ldev), GFP_KERNEL); 412 ldev = kzalloc(sizeof(*ldev), GFP_KERNEL);
383 if (!ldev) { 413 if (!ldev) {
384 printk(KERN_EMERG "Cannot allocate lguest dev %u type %u\n", 414 printk(KERN_EMERG "Cannot allocate lguest dev %u type %u\n",
@@ -388,17 +418,25 @@ static void add_lguest_device(struct lguest_device_desc *d,
388 418
389 /* This devices' parent is the lguest/ dir. */ 419 /* This devices' parent is the lguest/ dir. */
390 ldev->vdev.dev.parent = lguest_root; 420 ldev->vdev.dev.parent = lguest_root;
391 /* We have a unique device index thanks to the dev_index counter. */ 421 /*
422 * The device type comes straight from the descriptor. There's also a
423 * device vendor field in the virtio_device struct, which we leave as
424 * 0.
425 */
392 ldev->vdev.id.device = d->type; 426 ldev->vdev.id.device = d->type;
393 /* We have a simple set of routines for querying the device's 427 /*
394 * configuration information and setting its status. */ 428 * We have a simple set of routines for querying the device's
429 * configuration information and setting its status.
430 */
395 ldev->vdev.config = &lguest_config_ops; 431 ldev->vdev.config = &lguest_config_ops;
396 /* And we remember the device's descriptor for lguest_config_ops. */ 432 /* And we remember the device's descriptor for lguest_config_ops. */
397 ldev->desc = d; 433 ldev->desc = d;
398 434
399 /* register_virtio_device() sets up the generic fields for the struct 435 /*
436 * register_virtio_device() sets up the generic fields for the struct
400 * virtio_device and calls device_register(). This makes the bus 437 * virtio_device and calls device_register(). This makes the bus
401 * infrastructure look for a matching driver. */ 438 * infrastructure look for a matching driver.
439 */
402 if (register_virtio_device(&ldev->vdev) != 0) { 440 if (register_virtio_device(&ldev->vdev) != 0) {
403 printk(KERN_ERR "Failed to register lguest dev %u type %u\n", 441 printk(KERN_ERR "Failed to register lguest dev %u type %u\n",
404 offset, d->type); 442 offset, d->type);
@@ -406,8 +444,10 @@ static void add_lguest_device(struct lguest_device_desc *d,
406 } 444 }
407} 445}
408 446
409/*D:110 scan_devices() simply iterates through the device page. The type 0 is 447/*D:110
410 * reserved to mean "end of devices". */ 448 * scan_devices() simply iterates through the device page. The type 0 is
449 * reserved to mean "end of devices".
450 */
411static void scan_devices(void) 451static void scan_devices(void)
412{ 452{
413 unsigned int i; 453 unsigned int i;
@@ -426,7 +466,8 @@ static void scan_devices(void)
426 } 466 }
427} 467}
428 468
429/*D:105 Fairly early in boot, lguest_devices_init() is called to set up the 469/*D:105
470 * Fairly early in boot, lguest_devices_init() is called to set up the
430 * lguest device infrastructure. We check that we are a Guest by checking 471 * lguest device infrastructure. We check that we are a Guest by checking
431 * pv_info.name: there are other ways of checking, but this seems most 472 * pv_info.name: there are other ways of checking, but this seems most
432 * obvious to me. 473 * obvious to me.
@@ -437,7 +478,8 @@ static void scan_devices(void)
437 * correct sysfs incantation). 478 * correct sysfs incantation).
438 * 479 *
439 * Finally we call scan_devices() which adds all the devices found in the 480 * Finally we call scan_devices() which adds all the devices found in the
440 * lguest_devices page. */ 481 * lguest_devices page.
482 */
441static int __init lguest_devices_init(void) 483static int __init lguest_devices_init(void)
442{ 484{
443 if (strcmp(pv_info.name, "lguest") != 0) 485 if (strcmp(pv_info.name, "lguest") != 0)
@@ -456,11 +498,13 @@ static int __init lguest_devices_init(void)
456/* We do this after core stuff, but before the drivers. */ 498/* We do this after core stuff, but before the drivers. */
457postcore_initcall(lguest_devices_init); 499postcore_initcall(lguest_devices_init);
458 500
459/*D:150 At this point in the journey we used to now wade through the lguest 501/*D:150
502 * At this point in the journey we used to now wade through the lguest
460 * devices themselves: net, block and console. Since they're all now virtio 503 * devices themselves: net, block and console. Since they're all now virtio
461 * devices rather than lguest-specific, I've decided to ignore them. Mostly, 504 * devices rather than lguest-specific, I've decided to ignore them. Mostly,
462 * they're kind of boring. But this does mean you'll never experience the 505 * they're kind of boring. But this does mean you'll never experience the
463 * thrill of reading the forbidden love scene buried deep in the block driver. 506 * thrill of reading the forbidden love scene buried deep in the block driver.
464 * 507 *
465 * "make Launcher" beckons, where we answer questions like "Where do Guests 508 * "make Launcher" beckons, where we answer questions like "Where do Guests
466 * come from?", and "What do you do when someone asks for optimization?". */ 509 * come from?", and "What do you do when someone asks for optimization?".
510 */
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 9f9a2953b383..b4d3f7ca554f 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -1,8 +1,9 @@
1/*P:200 This contains all the /dev/lguest code, whereby the userspace launcher 1/*P:200 This contains all the /dev/lguest code, whereby the userspace launcher
2 * controls and communicates with the Guest. For example, the first write will 2 * controls and communicates with the Guest. For example, the first write will
3 * tell us the Guest's memory layout, pagetable, entry point and kernel address 3 * tell us the Guest's memory layout and entry point. A read will run the
4 * offset. A read will run the Guest until something happens, such as a signal 4 * Guest until something happens, such as a signal or the Guest doing a NOTIFY
5 * or the Guest doing a NOTIFY out to the Launcher. :*/ 5 * out to the Launcher.
6:*/
6#include <linux/uaccess.h> 7#include <linux/uaccess.h>
7#include <linux/miscdevice.h> 8#include <linux/miscdevice.h>
8#include <linux/fs.h> 9#include <linux/fs.h>
@@ -11,14 +12,41 @@
11#include <linux/file.h> 12#include <linux/file.h>
12#include "lg.h" 13#include "lg.h"
13 14
15/*L:056
16 * Before we move on, let's jump ahead and look at what the kernel does when
17 * it needs to look up the eventfds. That will complete our picture of how we
18 * use RCU.
19 *
20 * The notification value is in cpu->pending_notify: we return true if it went
21 * to an eventfd.
22 */
14bool send_notify_to_eventfd(struct lg_cpu *cpu) 23bool send_notify_to_eventfd(struct lg_cpu *cpu)
15{ 24{
16 unsigned int i; 25 unsigned int i;
17 struct lg_eventfd_map *map; 26 struct lg_eventfd_map *map;
18 27
19 /* lg->eventfds is RCU-protected */ 28 /*
29 * This "rcu_read_lock()" helps track when someone is still looking at
30 * the (RCU-using) eventfds array. It's not actually a lock at all;
31 * indeed it's a noop in many configurations. (You didn't expect me to
32 * explain all the RCU secrets here, did you?)
33 */
20 rcu_read_lock(); 34 rcu_read_lock();
35 /*
36 * rcu_dereference is the counter-side of rcu_assign_pointer(); it
37 * makes sure we don't access the memory pointed to by
38 * cpu->lg->eventfds before cpu->lg->eventfds is set. Sounds crazy,
39 * but Alpha allows this! Paul McKenney points out that a really
40 * aggressive compiler could have the same effect:
41 * http://lists.ozlabs.org/pipermail/lguest/2009-July/001560.html
42 *
43 * So play safe, use rcu_dereference to get the rcu-protected pointer:
44 */
21 map = rcu_dereference(cpu->lg->eventfds); 45 map = rcu_dereference(cpu->lg->eventfds);
46 /*
47 * Simple array search: even if they add an eventfd while we do this,
48 * we'll continue to use the old array and just won't see the new one.
49 */
22 for (i = 0; i < map->num; i++) { 50 for (i = 0; i < map->num; i++) {
23 if (map->map[i].addr == cpu->pending_notify) { 51 if (map->map[i].addr == cpu->pending_notify) {
24 eventfd_signal(map->map[i].event, 1); 52 eventfd_signal(map->map[i].event, 1);
@@ -26,19 +54,50 @@ bool send_notify_to_eventfd(struct lg_cpu *cpu)
26 break; 54 break;
27 } 55 }
28 } 56 }
57 /* We're done with the rcu-protected variable cpu->lg->eventfds. */
29 rcu_read_unlock(); 58 rcu_read_unlock();
59
60 /* If we cleared the notification, it's because we found a match. */
30 return cpu->pending_notify == 0; 61 return cpu->pending_notify == 0;
31} 62}
32 63
64/*L:055
65 * One of the more tricksy tricks in the Linux Kernel is a technique called
66 * Read Copy Update. Since one point of lguest is to teach lguest journeyers
67 * about kernel coding, I use it here. (In case you're curious, other purposes
68 * include learning about virtualization and instilling a deep appreciation for
69 * simplicity and puppies).
70 *
71 * We keep a simple array which maps LHCALL_NOTIFY values to eventfds, but we
72 * add new eventfds without ever blocking readers from accessing the array.
73 * The current Launcher only does this during boot, so that never happens. But
74 * Read Copy Update is cool, and adding a lock risks damaging even more puppies
75 * than this code does.
76 *
77 * We allocate a brand new one-larger array, copy the old one and add our new
78 * element. Then we make the lg eventfd pointer point to the new array.
79 * That's the easy part: now we need to free the old one, but we need to make
80 * sure no slow CPU somewhere is still looking at it. That's what
81 * synchronize_rcu does for us: waits until every CPU has indicated that it has
82 * moved on to know it's no longer using the old one.
83 *
84 * If that's unclear, see http://en.wikipedia.org/wiki/Read-copy-update.
85 */
33static int add_eventfd(struct lguest *lg, unsigned long addr, int fd) 86static int add_eventfd(struct lguest *lg, unsigned long addr, int fd)
34{ 87{
35 struct lg_eventfd_map *new, *old = lg->eventfds; 88 struct lg_eventfd_map *new, *old = lg->eventfds;
36 89
90 /*
91 * We don't allow notifications on value 0 anyway (pending_notify of
92 * 0 means "nothing pending").
93 */
37 if (!addr) 94 if (!addr)
38 return -EINVAL; 95 return -EINVAL;
39 96
40 /* Replace the old array with the new one, carefully: others can 97 /*
41 * be accessing it at the same time */ 98 * Replace the old array with the new one, carefully: others can
99 * be accessing it at the same time.
100 */
42 new = kmalloc(sizeof(*new) + sizeof(new->map[0]) * (old->num + 1), 101 new = kmalloc(sizeof(*new) + sizeof(new->map[0]) * (old->num + 1),
43 GFP_KERNEL); 102 GFP_KERNEL);
44 if (!new) 103 if (!new)
@@ -52,22 +111,41 @@ static int add_eventfd(struct lguest *lg, unsigned long addr, int fd)
52 new->map[new->num].addr = addr; 111 new->map[new->num].addr = addr;
53 new->map[new->num].event = eventfd_ctx_fdget(fd); 112 new->map[new->num].event = eventfd_ctx_fdget(fd);
54 if (IS_ERR(new->map[new->num].event)) { 113 if (IS_ERR(new->map[new->num].event)) {
114 int err = PTR_ERR(new->map[new->num].event);
55 kfree(new); 115 kfree(new);
56 return PTR_ERR(new->map[new->num].event); 116 return err;
57 } 117 }
58 new->num++; 118 new->num++;
59 119
60 /* Now put new one in place. */ 120 /*
121 * Now put new one in place: rcu_assign_pointer() is a fancy way of
122 * doing "lg->eventfds = new", but it uses memory barriers to make
123 * absolutely sure that the contents of "new" written above is nailed
124 * down before we actually do the assignment.
125 *
126 * We have to think about these kinds of things when we're operating on
127 * live data without locks.
128 */
61 rcu_assign_pointer(lg->eventfds, new); 129 rcu_assign_pointer(lg->eventfds, new);
62 130
63 /* We're not in a big hurry. Wait until noone's looking at old 131 /*
64 * version, then delete it. */ 132 * We're not in a big hurry. Wait until noone's looking at old
133 * version, then free it.
134 */
65 synchronize_rcu(); 135 synchronize_rcu();
66 kfree(old); 136 kfree(old);
67 137
68 return 0; 138 return 0;
69} 139}
70 140
141/*L:052
142 * Receiving notifications from the Guest is usually done by attaching a
143 * particular LHCALL_NOTIFY value to an event filedescriptor. The eventfd will
144 * become readable when the Guest does an LHCALL_NOTIFY with that value.
145 *
146 * This is really convenient for processing each virtqueue in a separate
147 * thread.
148 */
71static int attach_eventfd(struct lguest *lg, const unsigned long __user *input) 149static int attach_eventfd(struct lguest *lg, const unsigned long __user *input)
72{ 150{
73 unsigned long addr, fd; 151 unsigned long addr, fd;
@@ -79,15 +157,22 @@ static int attach_eventfd(struct lguest *lg, const unsigned long __user *input)
79 if (get_user(fd, input) != 0) 157 if (get_user(fd, input) != 0)
80 return -EFAULT; 158 return -EFAULT;
81 159
160 /*
161 * Just make sure two callers don't add eventfds at once. We really
162 * only need to lock against callers adding to the same Guest, so using
163 * the Big Lguest Lock is overkill. But this is setup, not a fast path.
164 */
82 mutex_lock(&lguest_lock); 165 mutex_lock(&lguest_lock);
83 err = add_eventfd(lg, addr, fd); 166 err = add_eventfd(lg, addr, fd);
84 mutex_unlock(&lguest_lock); 167 mutex_unlock(&lguest_lock);
85 168
86 return 0; 169 return err;
87} 170}
88 171
89/*L:050 Sending an interrupt is done by writing LHREQ_IRQ and an interrupt 172/*L:050
90 * number to /dev/lguest. */ 173 * Sending an interrupt is done by writing LHREQ_IRQ and an interrupt
174 * number to /dev/lguest.
175 */
91static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input) 176static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input)
92{ 177{
93 unsigned long irq; 178 unsigned long irq;
@@ -97,12 +182,18 @@ static int user_send_irq(struct lg_cpu *cpu, const unsigned long __user *input)
97 if (irq >= LGUEST_IRQS) 182 if (irq >= LGUEST_IRQS)
98 return -EINVAL; 183 return -EINVAL;
99 184
185 /*
186 * Next time the Guest runs, the core code will see if it can deliver
187 * this interrupt.
188 */
100 set_interrupt(cpu, irq); 189 set_interrupt(cpu, irq);
101 return 0; 190 return 0;
102} 191}
103 192
104/*L:040 Once our Guest is initialized, the Launcher makes it run by reading 193/*L:040
105 * from /dev/lguest. */ 194 * Once our Guest is initialized, the Launcher makes it run by reading
195 * from /dev/lguest.
196 */
106static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o) 197static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
107{ 198{
108 struct lguest *lg = file->private_data; 199 struct lguest *lg = file->private_data;
@@ -138,8 +229,10 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
138 return len; 229 return len;
139 } 230 }
140 231
141 /* If we returned from read() last time because the Guest sent I/O, 232 /*
142 * clear the flag. */ 233 * If we returned from read() last time because the Guest sent I/O,
234 * clear the flag.
235 */
143 if (cpu->pending_notify) 236 if (cpu->pending_notify)
144 cpu->pending_notify = 0; 237 cpu->pending_notify = 0;
145 238
@@ -147,8 +240,10 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)
147 return run_guest(cpu, (unsigned long __user *)user); 240 return run_guest(cpu, (unsigned long __user *)user);
148} 241}
149 242
150/*L:025 This actually initializes a CPU. For the moment, a Guest is only 243/*L:025
151 * uniprocessor, so "id" is always 0. */ 244 * This actually initializes a CPU. For the moment, a Guest is only
245 * uniprocessor, so "id" is always 0.
246 */
152static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip) 247static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
153{ 248{
154 /* We have a limited number the number of CPUs in the lguest struct. */ 249 /* We have a limited number the number of CPUs in the lguest struct. */
@@ -163,8 +258,10 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
163 /* Each CPU has a timer it can set. */ 258 /* Each CPU has a timer it can set. */
164 init_clockdev(cpu); 259 init_clockdev(cpu);
165 260
166 /* We need a complete page for the Guest registers: they are accessible 261 /*
167 * to the Guest and we can only grant it access to whole pages. */ 262 * We need a complete page for the Guest registers: they are accessible
263 * to the Guest and we can only grant it access to whole pages.
264 */
168 cpu->regs_page = get_zeroed_page(GFP_KERNEL); 265 cpu->regs_page = get_zeroed_page(GFP_KERNEL);
169 if (!cpu->regs_page) 266 if (!cpu->regs_page)
170 return -ENOMEM; 267 return -ENOMEM;
@@ -172,29 +269,38 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
172 /* We actually put the registers at the bottom of the page. */ 269 /* We actually put the registers at the bottom of the page. */
173 cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs); 270 cpu->regs = (void *)cpu->regs_page + PAGE_SIZE - sizeof(*cpu->regs);
174 271
175 /* Now we initialize the Guest's registers, handing it the start 272 /*
176 * address. */ 273 * Now we initialize the Guest's registers, handing it the start
274 * address.
275 */
177 lguest_arch_setup_regs(cpu, start_ip); 276 lguest_arch_setup_regs(cpu, start_ip);
178 277
179 /* We keep a pointer to the Launcher task (ie. current task) for when 278 /*
180 * other Guests want to wake this one (eg. console input). */ 279 * We keep a pointer to the Launcher task (ie. current task) for when
280 * other Guests want to wake this one (eg. console input).
281 */
181 cpu->tsk = current; 282 cpu->tsk = current;
182 283
183 /* We need to keep a pointer to the Launcher's memory map, because if 284 /*
285 * We need to keep a pointer to the Launcher's memory map, because if
184 * the Launcher dies we need to clean it up. If we don't keep a 286 * the Launcher dies we need to clean it up. If we don't keep a
185 * reference, it is destroyed before close() is called. */ 287 * reference, it is destroyed before close() is called.
288 */
186 cpu->mm = get_task_mm(cpu->tsk); 289 cpu->mm = get_task_mm(cpu->tsk);
187 290
188 /* We remember which CPU's pages this Guest used last, for optimization 291 /*
189 * when the same Guest runs on the same CPU twice. */ 292 * We remember which CPU's pages this Guest used last, for optimization
293 * when the same Guest runs on the same CPU twice.
294 */
190 cpu->last_pages = NULL; 295 cpu->last_pages = NULL;
191 296
192 /* No error == success. */ 297 /* No error == success. */
193 return 0; 298 return 0;
194} 299}
195 300
196/*L:020 The initialization write supplies 3 pointer sized (32 or 64 bit) 301/*L:020
197 * values (in addition to the LHREQ_INITIALIZE value). These are: 302 * The initialization write supplies 3 pointer sized (32 or 64 bit) values (in
303 * addition to the LHREQ_INITIALIZE value). These are:
198 * 304 *
199 * base: The start of the Guest-physical memory inside the Launcher memory. 305 * base: The start of the Guest-physical memory inside the Launcher memory.
200 * 306 *
@@ -206,14 +312,15 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
206 */ 312 */
207static int initialize(struct file *file, const unsigned long __user *input) 313static int initialize(struct file *file, const unsigned long __user *input)
208{ 314{
209 /* "struct lguest" contains everything we (the Host) know about a 315 /* "struct lguest" contains all we (the Host) know about a Guest. */
210 * Guest. */
211 struct lguest *lg; 316 struct lguest *lg;
212 int err; 317 int err;
213 unsigned long args[3]; 318 unsigned long args[3];
214 319
215 /* We grab the Big Lguest lock, which protects against multiple 320 /*
216 * simultaneous initializations. */ 321 * We grab the Big Lguest lock, which protects against multiple
322 * simultaneous initializations.
323 */
217 mutex_lock(&lguest_lock); 324 mutex_lock(&lguest_lock);
218 /* You can't initialize twice! Close the device and start again... */ 325 /* You can't initialize twice! Close the device and start again... */
219 if (file->private_data) { 326 if (file->private_data) {
@@ -248,8 +355,10 @@ static int initialize(struct file *file, const unsigned long __user *input)
248 if (err) 355 if (err)
249 goto free_eventfds; 356 goto free_eventfds;
250 357
251 /* Initialize the Guest's shadow page tables, using the toplevel 358 /*
252 * address the Launcher gave us. This allocates memory, so can fail. */ 359 * Initialize the Guest's shadow page tables, using the toplevel
360 * address the Launcher gave us. This allocates memory, so can fail.
361 */
253 err = init_guest_pagetable(lg); 362 err = init_guest_pagetable(lg);
254 if (err) 363 if (err)
255 goto free_regs; 364 goto free_regs;
@@ -274,20 +383,24 @@ unlock:
274 return err; 383 return err;
275} 384}
276 385
277/*L:010 The first operation the Launcher does must be a write. All writes 386/*L:010
387 * The first operation the Launcher does must be a write. All writes
278 * start with an unsigned long number: for the first write this must be 388 * start with an unsigned long number: for the first write this must be
279 * LHREQ_INITIALIZE to set up the Guest. After that the Launcher can use 389 * LHREQ_INITIALIZE to set up the Guest. After that the Launcher can use
280 * writes of other values to send interrupts. 390 * writes of other values to send interrupts or set up receipt of notifications.
281 * 391 *
282 * Note that we overload the "offset" in the /dev/lguest file to indicate what 392 * Note that we overload the "offset" in the /dev/lguest file to indicate what
283 * CPU number we're dealing with. Currently this is always 0, since we only 393 * CPU number we're dealing with. Currently this is always 0 since we only
284 * support uniprocessor Guests, but you can see the beginnings of SMP support 394 * support uniprocessor Guests, but you can see the beginnings of SMP support
285 * here. */ 395 * here.
396 */
286static ssize_t write(struct file *file, const char __user *in, 397static ssize_t write(struct file *file, const char __user *in,
287 size_t size, loff_t *off) 398 size_t size, loff_t *off)
288{ 399{
289 /* Once the Guest is initialized, we hold the "struct lguest" in the 400 /*
290 * file private data. */ 401 * Once the Guest is initialized, we hold the "struct lguest" in the
402 * file private data.
403 */
291 struct lguest *lg = file->private_data; 404 struct lguest *lg = file->private_data;
292 const unsigned long __user *input = (const unsigned long __user *)in; 405 const unsigned long __user *input = (const unsigned long __user *)in;
293 unsigned long req; 406 unsigned long req;
@@ -322,13 +435,15 @@ static ssize_t write(struct file *file, const char __user *in,
322 } 435 }
323} 436}
324 437
325/*L:060 The final piece of interface code is the close() routine. It reverses 438/*L:060
439 * The final piece of interface code is the close() routine. It reverses
326 * everything done in initialize(). This is usually called because the 440 * everything done in initialize(). This is usually called because the
327 * Launcher exited. 441 * Launcher exited.
328 * 442 *
329 * Note that the close routine returns 0 or a negative error number: it can't 443 * Note that the close routine returns 0 or a negative error number: it can't
330 * really fail, but it can whine. I blame Sun for this wart, and K&R C for 444 * really fail, but it can whine. I blame Sun for this wart, and K&R C for
331 * letting them do it. :*/ 445 * letting them do it.
446:*/
332static int close(struct inode *inode, struct file *file) 447static int close(struct inode *inode, struct file *file)
333{ 448{
334 struct lguest *lg = file->private_data; 449 struct lguest *lg = file->private_data;
@@ -338,8 +453,10 @@ static int close(struct inode *inode, struct file *file)
338 if (!lg) 453 if (!lg)
339 return 0; 454 return 0;
340 455
341 /* We need the big lock, to protect from inter-guest I/O and other 456 /*
342 * Launchers initializing guests. */ 457 * We need the big lock, to protect from inter-guest I/O and other
458 * Launchers initializing guests.
459 */
343 mutex_lock(&lguest_lock); 460 mutex_lock(&lguest_lock);
344 461
345 /* Free up the shadow page tables for the Guest. */ 462 /* Free up the shadow page tables for the Guest. */
@@ -350,8 +467,10 @@ static int close(struct inode *inode, struct file *file)
350 hrtimer_cancel(&lg->cpus[i].hrt); 467 hrtimer_cancel(&lg->cpus[i].hrt);
351 /* We can free up the register page we allocated. */ 468 /* We can free up the register page we allocated. */
352 free_page(lg->cpus[i].regs_page); 469 free_page(lg->cpus[i].regs_page);
353 /* Now all the memory cleanups are done, it's safe to release 470 /*
354 * the Launcher's memory management structure. */ 471 * Now all the memory cleanups are done, it's safe to release
472 * the Launcher's memory management structure.
473 */
355 mmput(lg->cpus[i].mm); 474 mmput(lg->cpus[i].mm);
356 } 475 }
357 476
@@ -360,8 +479,10 @@ static int close(struct inode *inode, struct file *file)
360 eventfd_ctx_put(lg->eventfds->map[i].event); 479 eventfd_ctx_put(lg->eventfds->map[i].event);
361 kfree(lg->eventfds); 480 kfree(lg->eventfds);
362 481
363 /* If lg->dead doesn't contain an error code it will be NULL or a 482 /*
364 * kmalloc()ed string, either of which is ok to hand to kfree(). */ 483 * If lg->dead doesn't contain an error code it will be NULL or a
484 * kmalloc()ed string, either of which is ok to hand to kfree().
485 */
365 if (!IS_ERR(lg->dead)) 486 if (!IS_ERR(lg->dead))
366 kfree(lg->dead); 487 kfree(lg->dead);
367 /* Free the memory allocated to the lguest_struct */ 488 /* Free the memory allocated to the lguest_struct */
@@ -385,7 +506,8 @@ static int close(struct inode *inode, struct file *file)
385 * 506 *
386 * We begin our understanding with the Host kernel interface which the Launcher 507 * We begin our understanding with the Host kernel interface which the Launcher
387 * uses: reading and writing a character device called /dev/lguest. All the 508 * uses: reading and writing a character device called /dev/lguest. All the
388 * work happens in the read(), write() and close() routines: */ 509 * work happens in the read(), write() and close() routines:
510 */
389static struct file_operations lguest_fops = { 511static struct file_operations lguest_fops = {
390 .owner = THIS_MODULE, 512 .owner = THIS_MODULE,
391 .release = close, 513 .release = close,
@@ -393,8 +515,10 @@ static struct file_operations lguest_fops = {
393 .read = read, 515 .read = read,
394}; 516};
395 517
396/* This is a textbook example of a "misc" character device. Populate a "struct 518/*
397 * miscdevice" and register it with misc_register(). */ 519 * This is a textbook example of a "misc" character device. Populate a "struct
520 * miscdevice" and register it with misc_register().
521 */
398static struct miscdevice lguest_dev = { 522static struct miscdevice lguest_dev = {
399 .minor = MISC_DYNAMIC_MINOR, 523 .minor = MISC_DYNAMIC_MINOR,
400 .name = "lguest", 524 .name = "lguest",
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index a6fe1abda240..a8d0aee3bc0e 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -1,9 +1,11 @@
1/*P:700 The pagetable code, on the other hand, still shows the scars of 1/*P:700
2 * The pagetable code, on the other hand, still shows the scars of
2 * previous encounters. It's functional, and as neat as it can be in the 3 * previous encounters. It's functional, and as neat as it can be in the
3 * circumstances, but be wary, for these things are subtle and break easily. 4 * circumstances, but be wary, for these things are subtle and break easily.
4 * The Guest provides a virtual to physical mapping, but we can neither trust 5 * The Guest provides a virtual to physical mapping, but we can neither trust
5 * it nor use it: we verify and convert it here then point the CPU to the 6 * it nor use it: we verify and convert it here then point the CPU to the
6 * converted Guest pages when running the Guest. :*/ 7 * converted Guest pages when running the Guest.
8:*/
7 9
8/* Copyright (C) Rusty Russell IBM Corporation 2006. 10/* Copyright (C) Rusty Russell IBM Corporation 2006.
9 * GPL v2 and any later version */ 11 * GPL v2 and any later version */
@@ -17,18 +19,20 @@
17#include <asm/bootparam.h> 19#include <asm/bootparam.h>
18#include "lg.h" 20#include "lg.h"
19 21
20/*M:008 We hold reference to pages, which prevents them from being swapped. 22/*M:008
23 * We hold reference to pages, which prevents them from being swapped.
21 * It'd be nice to have a callback in the "struct mm_struct" when Linux wants 24 * It'd be nice to have a callback in the "struct mm_struct" when Linux wants
22 * to swap out. If we had this, and a shrinker callback to trim PTE pages, we 25 * to swap out. If we had this, and a shrinker callback to trim PTE pages, we
23 * could probably consider launching Guests as non-root. :*/ 26 * could probably consider launching Guests as non-root.
27:*/
24 28
25/*H:300 29/*H:300
26 * The Page Table Code 30 * The Page Table Code
27 * 31 *
28 * We use two-level page tables for the Guest. If you're not entirely 32 * We use two-level page tables for the Guest, or three-level with PAE. If
29 * comfortable with virtual addresses, physical addresses and page tables then 33 * you're not entirely comfortable with virtual addresses, physical addresses
30 * I recommend you review arch/x86/lguest/boot.c's "Page Table Handling" (with 34 * and page tables then I recommend you review arch/x86/lguest/boot.c's "Page
31 * diagrams!). 35 * Table Handling" (with diagrams!).
32 * 36 *
33 * The Guest keeps page tables, but we maintain the actual ones here: these are 37 * The Guest keeps page tables, but we maintain the actual ones here: these are
34 * called "shadow" page tables. Which is a very Guest-centric name: these are 38 * called "shadow" page tables. Which is a very Guest-centric name: these are
@@ -45,16 +49,18 @@
45 * (v) Flushing (throwing away) page tables, 49 * (v) Flushing (throwing away) page tables,
46 * (vi) Mapping the Switcher when the Guest is about to run, 50 * (vi) Mapping the Switcher when the Guest is about to run,
47 * (vii) Setting up the page tables initially. 51 * (vii) Setting up the page tables initially.
48 :*/ 52:*/
49 53
50 54/*
51/* 1024 entries in a page table page maps 1024 pages: 4MB. The Switcher is 55 * The Switcher uses the complete top PTE page. That's 1024 PTE entries (4MB)
52 * conveniently placed at the top 4MB, so it uses a separate, complete PTE 56 * or 512 PTE entries with PAE (2MB).
53 * page. */ 57 */
54#define SWITCHER_PGD_INDEX (PTRS_PER_PGD - 1) 58#define SWITCHER_PGD_INDEX (PTRS_PER_PGD - 1)
55 59
56/* For PAE we need the PMD index as well. We use the last 2MB, so we 60/*
57 * will need the last pmd entry of the last pmd page. */ 61 * For PAE we need the PMD index as well. We use the last 2MB, so we
62 * will need the last pmd entry of the last pmd page.
63 */
58#ifdef CONFIG_X86_PAE 64#ifdef CONFIG_X86_PAE
59#define SWITCHER_PMD_INDEX (PTRS_PER_PMD - 1) 65#define SWITCHER_PMD_INDEX (PTRS_PER_PMD - 1)
60#define RESERVE_MEM 2U 66#define RESERVE_MEM 2U
@@ -64,14 +70,18 @@
64#define CHECK_GPGD_MASK _PAGE_TABLE 70#define CHECK_GPGD_MASK _PAGE_TABLE
65#endif 71#endif
66 72
67/* We actually need a separate PTE page for each CPU. Remember that after the 73/*
74 * We actually need a separate PTE page for each CPU. Remember that after the
68 * Switcher code itself comes two pages for each CPU, and we don't want this 75 * Switcher code itself comes two pages for each CPU, and we don't want this
69 * CPU's guest to see the pages of any other CPU. */ 76 * CPU's guest to see the pages of any other CPU.
77 */
70static DEFINE_PER_CPU(pte_t *, switcher_pte_pages); 78static DEFINE_PER_CPU(pte_t *, switcher_pte_pages);
71#define switcher_pte_page(cpu) per_cpu(switcher_pte_pages, cpu) 79#define switcher_pte_page(cpu) per_cpu(switcher_pte_pages, cpu)
72 80
73/*H:320 The page table code is curly enough to need helper functions to keep it 81/*H:320
74 * clear and clean. 82 * The page table code is curly enough to need helper functions to keep it
83 * clear and clean. The kernel itself provides many of them; one advantage
84 * of insisting that the Guest and Host use the same CONFIG_PAE setting.
75 * 85 *
76 * There are two functions which return pointers to the shadow (aka "real") 86 * There are two functions which return pointers to the shadow (aka "real")
77 * page tables. 87 * page tables.
@@ -79,7 +89,8 @@ static DEFINE_PER_CPU(pte_t *, switcher_pte_pages);
79 * spgd_addr() takes the virtual address and returns a pointer to the top-level 89 * spgd_addr() takes the virtual address and returns a pointer to the top-level
80 * page directory entry (PGD) for that address. Since we keep track of several 90 * page directory entry (PGD) for that address. Since we keep track of several
81 * page tables, the "i" argument tells us which one we're interested in (it's 91 * page tables, the "i" argument tells us which one we're interested in (it's
82 * usually the current one). */ 92 * usually the current one).
93 */
83static pgd_t *spgd_addr(struct lg_cpu *cpu, u32 i, unsigned long vaddr) 94static pgd_t *spgd_addr(struct lg_cpu *cpu, u32 i, unsigned long vaddr)
84{ 95{
85 unsigned int index = pgd_index(vaddr); 96 unsigned int index = pgd_index(vaddr);
@@ -96,9 +107,11 @@ static pgd_t *spgd_addr(struct lg_cpu *cpu, u32 i, unsigned long vaddr)
96} 107}
97 108
98#ifdef CONFIG_X86_PAE 109#ifdef CONFIG_X86_PAE
99/* This routine then takes the PGD entry given above, which contains the 110/*
111 * This routine then takes the PGD entry given above, which contains the
100 * address of the PMD page. It then returns a pointer to the PMD entry for the 112 * address of the PMD page. It then returns a pointer to the PMD entry for the
101 * given address. */ 113 * given address.
114 */
102static pmd_t *spmd_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr) 115static pmd_t *spmd_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
103{ 116{
104 unsigned int index = pmd_index(vaddr); 117 unsigned int index = pmd_index(vaddr);
@@ -119,9 +132,11 @@ static pmd_t *spmd_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
119} 132}
120#endif 133#endif
121 134
122/* This routine then takes the page directory entry returned above, which 135/*
136 * This routine then takes the page directory entry returned above, which
123 * contains the address of the page table entry (PTE) page. It then returns a 137 * contains the address of the page table entry (PTE) page. It then returns a
124 * pointer to the PTE entry for the given address. */ 138 * pointer to the PTE entry for the given address.
139 */
125static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr) 140static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
126{ 141{
127#ifdef CONFIG_X86_PAE 142#ifdef CONFIG_X86_PAE
@@ -139,8 +154,10 @@ static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
139 return &page[pte_index(vaddr)]; 154 return &page[pte_index(vaddr)];
140} 155}
141 156
142/* These two functions just like the above two, except they access the Guest 157/*
143 * page tables. Hence they return a Guest address. */ 158 * These functions are just like the above two, except they access the Guest
159 * page tables. Hence they return a Guest address.
160 */
144static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr) 161static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr)
145{ 162{
146 unsigned int index = vaddr >> (PGDIR_SHIFT); 163 unsigned int index = vaddr >> (PGDIR_SHIFT);
@@ -148,6 +165,7 @@ static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr)
148} 165}
149 166
150#ifdef CONFIG_X86_PAE 167#ifdef CONFIG_X86_PAE
168/* Follow the PGD to the PMD. */
151static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr) 169static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr)
152{ 170{
153 unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; 171 unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT;
@@ -155,6 +173,7 @@ static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr)
155 return gpage + pmd_index(vaddr) * sizeof(pmd_t); 173 return gpage + pmd_index(vaddr) * sizeof(pmd_t);
156} 174}
157 175
176/* Follow the PMD to the PTE. */
158static unsigned long gpte_addr(struct lg_cpu *cpu, 177static unsigned long gpte_addr(struct lg_cpu *cpu,
159 pmd_t gpmd, unsigned long vaddr) 178 pmd_t gpmd, unsigned long vaddr)
160{ 179{
@@ -164,6 +183,7 @@ static unsigned long gpte_addr(struct lg_cpu *cpu,
164 return gpage + pte_index(vaddr) * sizeof(pte_t); 183 return gpage + pte_index(vaddr) * sizeof(pte_t);
165} 184}
166#else 185#else
186/* Follow the PGD to the PTE (no mid-level for !PAE). */
167static unsigned long gpte_addr(struct lg_cpu *cpu, 187static unsigned long gpte_addr(struct lg_cpu *cpu,
168 pgd_t gpgd, unsigned long vaddr) 188 pgd_t gpgd, unsigned long vaddr)
169{ 189{
@@ -175,17 +195,21 @@ static unsigned long gpte_addr(struct lg_cpu *cpu,
175#endif 195#endif
176/*:*/ 196/*:*/
177 197
178/*M:014 get_pfn is slow: we could probably try to grab batches of pages here as 198/*M:014
179 * an optimization (ie. pre-faulting). :*/ 199 * get_pfn is slow: we could probably try to grab batches of pages here as
200 * an optimization (ie. pre-faulting).
201:*/
180 202
181/*H:350 This routine takes a page number given by the Guest and converts it to 203/*H:350
204 * This routine takes a page number given by the Guest and converts it to
182 * an actual, physical page number. It can fail for several reasons: the 205 * an actual, physical page number. It can fail for several reasons: the
183 * virtual address might not be mapped by the Launcher, the write flag is set 206 * virtual address might not be mapped by the Launcher, the write flag is set
184 * and the page is read-only, or the write flag was set and the page was 207 * and the page is read-only, or the write flag was set and the page was
185 * shared so had to be copied, but we ran out of memory. 208 * shared so had to be copied, but we ran out of memory.
186 * 209 *
187 * This holds a reference to the page, so release_pte() is careful to put that 210 * This holds a reference to the page, so release_pte() is careful to put that
188 * back. */ 211 * back.
212 */
189static unsigned long get_pfn(unsigned long virtpfn, int write) 213static unsigned long get_pfn(unsigned long virtpfn, int write)
190{ 214{
191 struct page *page; 215 struct page *page;
@@ -198,33 +222,41 @@ static unsigned long get_pfn(unsigned long virtpfn, int write)
198 return -1UL; 222 return -1UL;
199} 223}
200 224
201/*H:340 Converting a Guest page table entry to a shadow (ie. real) page table 225/*H:340
226 * Converting a Guest page table entry to a shadow (ie. real) page table
202 * entry can be a little tricky. The flags are (almost) the same, but the 227 * entry can be a little tricky. The flags are (almost) the same, but the
203 * Guest PTE contains a virtual page number: the CPU needs the real page 228 * Guest PTE contains a virtual page number: the CPU needs the real page
204 * number. */ 229 * number.
230 */
205static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write) 231static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write)
206{ 232{
207 unsigned long pfn, base, flags; 233 unsigned long pfn, base, flags;
208 234
209 /* The Guest sets the global flag, because it thinks that it is using 235 /*
236 * The Guest sets the global flag, because it thinks that it is using
210 * PGE. We only told it to use PGE so it would tell us whether it was 237 * PGE. We only told it to use PGE so it would tell us whether it was
211 * flushing a kernel mapping or a userspace mapping. We don't actually 238 * flushing a kernel mapping or a userspace mapping. We don't actually
212 * use the global bit, so throw it away. */ 239 * use the global bit, so throw it away.
240 */
213 flags = (pte_flags(gpte) & ~_PAGE_GLOBAL); 241 flags = (pte_flags(gpte) & ~_PAGE_GLOBAL);
214 242
215 /* The Guest's pages are offset inside the Launcher. */ 243 /* The Guest's pages are offset inside the Launcher. */
216 base = (unsigned long)cpu->lg->mem_base / PAGE_SIZE; 244 base = (unsigned long)cpu->lg->mem_base / PAGE_SIZE;
217 245
218 /* We need a temporary "unsigned long" variable to hold the answer from 246 /*
247 * We need a temporary "unsigned long" variable to hold the answer from
219 * get_pfn(), because it returns 0xFFFFFFFF on failure, which wouldn't 248 * get_pfn(), because it returns 0xFFFFFFFF on failure, which wouldn't
220 * fit in spte.pfn. get_pfn() finds the real physical number of the 249 * fit in spte.pfn. get_pfn() finds the real physical number of the
221 * page, given the virtual number. */ 250 * page, given the virtual number.
251 */
222 pfn = get_pfn(base + pte_pfn(gpte), write); 252 pfn = get_pfn(base + pte_pfn(gpte), write);
223 if (pfn == -1UL) { 253 if (pfn == -1UL) {
224 kill_guest(cpu, "failed to get page %lu", pte_pfn(gpte)); 254 kill_guest(cpu, "failed to get page %lu", pte_pfn(gpte));
225 /* When we destroy the Guest, we'll go through the shadow page 255 /*
256 * When we destroy the Guest, we'll go through the shadow page
226 * tables and release_pte() them. Make sure we don't think 257 * tables and release_pte() them. Make sure we don't think
227 * this one is valid! */ 258 * this one is valid!
259 */
228 flags = 0; 260 flags = 0;
229 } 261 }
230 /* Now we assemble our shadow PTE from the page number and flags. */ 262 /* Now we assemble our shadow PTE from the page number and flags. */
@@ -234,8 +266,10 @@ static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write)
234/*H:460 And to complete the chain, release_pte() looks like this: */ 266/*H:460 And to complete the chain, release_pte() looks like this: */
235static void release_pte(pte_t pte) 267static void release_pte(pte_t pte)
236{ 268{
237 /* Remember that get_user_pages_fast() took a reference to the page, in 269 /*
238 * get_pfn()? We have to put it back now. */ 270 * Remember that get_user_pages_fast() took a reference to the page, in
271 * get_pfn()? We have to put it back now.
272 */
239 if (pte_flags(pte) & _PAGE_PRESENT) 273 if (pte_flags(pte) & _PAGE_PRESENT)
240 put_page(pte_page(pte)); 274 put_page(pte_page(pte));
241} 275}
@@ -273,7 +307,8 @@ static void check_gpmd(struct lg_cpu *cpu, pmd_t gpmd)
273 * and return to the Guest without it knowing. 307 * and return to the Guest without it knowing.
274 * 308 *
275 * If we fixed up the fault (ie. we mapped the address), this routine returns 309 * If we fixed up the fault (ie. we mapped the address), this routine returns
276 * true. Otherwise, it was a real fault and we need to tell the Guest. */ 310 * true. Otherwise, it was a real fault and we need to tell the Guest.
311 */
277bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) 312bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
278{ 313{
279 pgd_t gpgd; 314 pgd_t gpgd;
@@ -282,6 +317,7 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
282 pte_t gpte; 317 pte_t gpte;
283 pte_t *spte; 318 pte_t *spte;
284 319
320 /* Mid level for PAE. */
285#ifdef CONFIG_X86_PAE 321#ifdef CONFIG_X86_PAE
286 pmd_t *spmd; 322 pmd_t *spmd;
287 pmd_t gpmd; 323 pmd_t gpmd;
@@ -298,22 +334,26 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
298 if (!(pgd_flags(*spgd) & _PAGE_PRESENT)) { 334 if (!(pgd_flags(*spgd) & _PAGE_PRESENT)) {
299 /* No shadow entry: allocate a new shadow PTE page. */ 335 /* No shadow entry: allocate a new shadow PTE page. */
300 unsigned long ptepage = get_zeroed_page(GFP_KERNEL); 336 unsigned long ptepage = get_zeroed_page(GFP_KERNEL);
301 /* This is not really the Guest's fault, but killing it is 337 /*
302 * simple for this corner case. */ 338 * This is not really the Guest's fault, but killing it is
339 * simple for this corner case.
340 */
303 if (!ptepage) { 341 if (!ptepage) {
304 kill_guest(cpu, "out of memory allocating pte page"); 342 kill_guest(cpu, "out of memory allocating pte page");
305 return false; 343 return false;
306 } 344 }
307 /* We check that the Guest pgd is OK. */ 345 /* We check that the Guest pgd is OK. */
308 check_gpgd(cpu, gpgd); 346 check_gpgd(cpu, gpgd);
309 /* And we copy the flags to the shadow PGD entry. The page 347 /*
310 * number in the shadow PGD is the page we just allocated. */ 348 * And we copy the flags to the shadow PGD entry. The page
349 * number in the shadow PGD is the page we just allocated.
350 */
311 set_pgd(spgd, __pgd(__pa(ptepage) | pgd_flags(gpgd))); 351 set_pgd(spgd, __pgd(__pa(ptepage) | pgd_flags(gpgd)));
312 } 352 }
313 353
314#ifdef CONFIG_X86_PAE 354#ifdef CONFIG_X86_PAE
315 gpmd = lgread(cpu, gpmd_addr(gpgd, vaddr), pmd_t); 355 gpmd = lgread(cpu, gpmd_addr(gpgd, vaddr), pmd_t);
316 /* middle level not present? We can't map it in. */ 356 /* Middle level not present? We can't map it in. */
317 if (!(pmd_flags(gpmd) & _PAGE_PRESENT)) 357 if (!(pmd_flags(gpmd) & _PAGE_PRESENT))
318 return false; 358 return false;
319 359
@@ -324,8 +364,10 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
324 /* No shadow entry: allocate a new shadow PTE page. */ 364 /* No shadow entry: allocate a new shadow PTE page. */
325 unsigned long ptepage = get_zeroed_page(GFP_KERNEL); 365 unsigned long ptepage = get_zeroed_page(GFP_KERNEL);
326 366
327 /* This is not really the Guest's fault, but killing it is 367 /*
328 * simple for this corner case. */ 368 * This is not really the Guest's fault, but killing it is
369 * simple for this corner case.
370 */
329 if (!ptepage) { 371 if (!ptepage) {
330 kill_guest(cpu, "out of memory allocating pte page"); 372 kill_guest(cpu, "out of memory allocating pte page");
331 return false; 373 return false;
@@ -334,27 +376,37 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
334 /* We check that the Guest pmd is OK. */ 376 /* We check that the Guest pmd is OK. */
335 check_gpmd(cpu, gpmd); 377 check_gpmd(cpu, gpmd);
336 378
337 /* And we copy the flags to the shadow PMD entry. The page 379 /*
338 * number in the shadow PMD is the page we just allocated. */ 380 * And we copy the flags to the shadow PMD entry. The page
381 * number in the shadow PMD is the page we just allocated.
382 */
339 native_set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); 383 native_set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd)));
340 } 384 }
341 385
342 /* OK, now we look at the lower level in the Guest page table: keep its 386 /*
343 * address, because we might update it later. */ 387 * OK, now we look at the lower level in the Guest page table: keep its
388 * address, because we might update it later.
389 */
344 gpte_ptr = gpte_addr(cpu, gpmd, vaddr); 390 gpte_ptr = gpte_addr(cpu, gpmd, vaddr);
345#else 391#else
346 /* OK, now we look at the lower level in the Guest page table: keep its 392 /*
347 * address, because we might update it later. */ 393 * OK, now we look at the lower level in the Guest page table: keep its
394 * address, because we might update it later.
395 */
348 gpte_ptr = gpte_addr(cpu, gpgd, vaddr); 396 gpte_ptr = gpte_addr(cpu, gpgd, vaddr);
349#endif 397#endif
398
399 /* Read the actual PTE value. */
350 gpte = lgread(cpu, gpte_ptr, pte_t); 400 gpte = lgread(cpu, gpte_ptr, pte_t);
351 401
352 /* If this page isn't in the Guest page tables, we can't page it in. */ 402 /* If this page isn't in the Guest page tables, we can't page it in. */
353 if (!(pte_flags(gpte) & _PAGE_PRESENT)) 403 if (!(pte_flags(gpte) & _PAGE_PRESENT))
354 return false; 404 return false;
355 405
356 /* Check they're not trying to write to a page the Guest wants 406 /*
357 * read-only (bit 2 of errcode == write). */ 407 * Check they're not trying to write to a page the Guest wants
408 * read-only (bit 2 of errcode == write).
409 */
358 if ((errcode & 2) && !(pte_flags(gpte) & _PAGE_RW)) 410 if ((errcode & 2) && !(pte_flags(gpte) & _PAGE_RW))
359 return false; 411 return false;
360 412
@@ -362,8 +414,10 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
362 if ((errcode & 4) && !(pte_flags(gpte) & _PAGE_USER)) 414 if ((errcode & 4) && !(pte_flags(gpte) & _PAGE_USER))
363 return false; 415 return false;
364 416
365 /* Check that the Guest PTE flags are OK, and the page number is below 417 /*
366 * the pfn_limit (ie. not mapping the Launcher binary). */ 418 * Check that the Guest PTE flags are OK, and the page number is below
419 * the pfn_limit (ie. not mapping the Launcher binary).
420 */
367 check_gpte(cpu, gpte); 421 check_gpte(cpu, gpte);
368 422
369 /* Add the _PAGE_ACCESSED and (for a write) _PAGE_DIRTY flag */ 423 /* Add the _PAGE_ACCESSED and (for a write) _PAGE_DIRTY flag */
@@ -373,29 +427,40 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
373 427
374 /* Get the pointer to the shadow PTE entry we're going to set. */ 428 /* Get the pointer to the shadow PTE entry we're going to set. */
375 spte = spte_addr(cpu, *spgd, vaddr); 429 spte = spte_addr(cpu, *spgd, vaddr);
376 /* If there was a valid shadow PTE entry here before, we release it. 430
377 * This can happen with a write to a previously read-only entry. */ 431 /*
432 * If there was a valid shadow PTE entry here before, we release it.
433 * This can happen with a write to a previously read-only entry.
434 */
378 release_pte(*spte); 435 release_pte(*spte);
379 436
380 /* If this is a write, we insist that the Guest page is writable (the 437 /*
381 * final arg to gpte_to_spte()). */ 438 * If this is a write, we insist that the Guest page is writable (the
439 * final arg to gpte_to_spte()).
440 */
382 if (pte_dirty(gpte)) 441 if (pte_dirty(gpte))
383 *spte = gpte_to_spte(cpu, gpte, 1); 442 *spte = gpte_to_spte(cpu, gpte, 1);
384 else 443 else
385 /* If this is a read, don't set the "writable" bit in the page 444 /*
445 * If this is a read, don't set the "writable" bit in the page
386 * table entry, even if the Guest says it's writable. That way 446 * table entry, even if the Guest says it's writable. That way
387 * we will come back here when a write does actually occur, so 447 * we will come back here when a write does actually occur, so
388 * we can update the Guest's _PAGE_DIRTY flag. */ 448 * we can update the Guest's _PAGE_DIRTY flag.
449 */
389 native_set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0)); 450 native_set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0));
390 451
391 /* Finally, we write the Guest PTE entry back: we've set the 452 /*
392 * _PAGE_ACCESSED and maybe the _PAGE_DIRTY flags. */ 453 * Finally, we write the Guest PTE entry back: we've set the
454 * _PAGE_ACCESSED and maybe the _PAGE_DIRTY flags.
455 */
393 lgwrite(cpu, gpte_ptr, pte_t, gpte); 456 lgwrite(cpu, gpte_ptr, pte_t, gpte);
394 457
395 /* The fault is fixed, the page table is populated, the mapping 458 /*
459 * The fault is fixed, the page table is populated, the mapping
396 * manipulated, the result returned and the code complete. A small 460 * manipulated, the result returned and the code complete. A small
397 * delay and a trace of alliteration are the only indications the Guest 461 * delay and a trace of alliteration are the only indications the Guest
398 * has that a page fault occurred at all. */ 462 * has that a page fault occurred at all.
463 */
399 return true; 464 return true;
400} 465}
401 466
@@ -408,7 +473,8 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
408 * mapped, so it's overkill. 473 * mapped, so it's overkill.
409 * 474 *
410 * This is a quick version which answers the question: is this virtual address 475 * This is a quick version which answers the question: is this virtual address
411 * mapped by the shadow page tables, and is it writable? */ 476 * mapped by the shadow page tables, and is it writable?
477 */
412static bool page_writable(struct lg_cpu *cpu, unsigned long vaddr) 478static bool page_writable(struct lg_cpu *cpu, unsigned long vaddr)
413{ 479{
414 pgd_t *spgd; 480 pgd_t *spgd;
@@ -428,21 +494,26 @@ static bool page_writable(struct lg_cpu *cpu, unsigned long vaddr)
428 return false; 494 return false;
429#endif 495#endif
430 496
431 /* Check the flags on the pte entry itself: it must be present and 497 /*
432 * writable. */ 498 * Check the flags on the pte entry itself: it must be present and
499 * writable.
500 */
433 flags = pte_flags(*(spte_addr(cpu, *spgd, vaddr))); 501 flags = pte_flags(*(spte_addr(cpu, *spgd, vaddr)));
434 502
435 return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW); 503 return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW);
436} 504}
437 505
438/* So, when pin_stack_pages() asks us to pin a page, we check if it's already 506/*
507 * So, when pin_stack_pages() asks us to pin a page, we check if it's already
439 * in the page tables, and if not, we call demand_page() with error code 2 508 * in the page tables, and if not, we call demand_page() with error code 2
440 * (meaning "write"). */ 509 * (meaning "write").
510 */
441void pin_page(struct lg_cpu *cpu, unsigned long vaddr) 511void pin_page(struct lg_cpu *cpu, unsigned long vaddr)
442{ 512{
443 if (!page_writable(cpu, vaddr) && !demand_page(cpu, vaddr, 2)) 513 if (!page_writable(cpu, vaddr) && !demand_page(cpu, vaddr, 2))
444 kill_guest(cpu, "bad stack page %#lx", vaddr); 514 kill_guest(cpu, "bad stack page %#lx", vaddr);
445} 515}
516/*:*/
446 517
447#ifdef CONFIG_X86_PAE 518#ifdef CONFIG_X86_PAE
448static void release_pmd(pmd_t *spmd) 519static void release_pmd(pmd_t *spmd)
@@ -479,15 +550,21 @@ static void release_pgd(pgd_t *spgd)
479} 550}
480 551
481#else /* !CONFIG_X86_PAE */ 552#else /* !CONFIG_X86_PAE */
482/*H:450 If we chase down the release_pgd() code, it looks like this: */ 553/*H:450
554 * If we chase down the release_pgd() code, the non-PAE version looks like
555 * this. The PAE version is almost identical, but instead of calling
556 * release_pte it calls release_pmd(), which looks much like this.
557 */
483static void release_pgd(pgd_t *spgd) 558static void release_pgd(pgd_t *spgd)
484{ 559{
485 /* If the entry's not present, there's nothing to release. */ 560 /* If the entry's not present, there's nothing to release. */
486 if (pgd_flags(*spgd) & _PAGE_PRESENT) { 561 if (pgd_flags(*spgd) & _PAGE_PRESENT) {
487 unsigned int i; 562 unsigned int i;
488 /* Converting the pfn to find the actual PTE page is easy: turn 563 /*
564 * Converting the pfn to find the actual PTE page is easy: turn
489 * the page number into a physical address, then convert to a 565 * the page number into a physical address, then convert to a
490 * virtual address (easy for kernel pages like this one). */ 566 * virtual address (easy for kernel pages like this one).
567 */
491 pte_t *ptepage = __va(pgd_pfn(*spgd) << PAGE_SHIFT); 568 pte_t *ptepage = __va(pgd_pfn(*spgd) << PAGE_SHIFT);
492 /* For each entry in the page, we might need to release it. */ 569 /* For each entry in the page, we might need to release it. */
493 for (i = 0; i < PTRS_PER_PTE; i++) 570 for (i = 0; i < PTRS_PER_PTE; i++)
@@ -499,9 +576,12 @@ static void release_pgd(pgd_t *spgd)
499 } 576 }
500} 577}
501#endif 578#endif
502/*H:445 We saw flush_user_mappings() twice: once from the flush_user_mappings() 579
580/*H:445
581 * We saw flush_user_mappings() twice: once from the flush_user_mappings()
503 * hypercall and once in new_pgdir() when we re-used a top-level pgdir page. 582 * hypercall and once in new_pgdir() when we re-used a top-level pgdir page.
504 * It simply releases every PTE page from 0 up to the Guest's kernel address. */ 583 * It simply releases every PTE page from 0 up to the Guest's kernel address.
584 */
505static void flush_user_mappings(struct lguest *lg, int idx) 585static void flush_user_mappings(struct lguest *lg, int idx)
506{ 586{
507 unsigned int i; 587 unsigned int i;
@@ -510,10 +590,12 @@ static void flush_user_mappings(struct lguest *lg, int idx)
510 release_pgd(lg->pgdirs[idx].pgdir + i); 590 release_pgd(lg->pgdirs[idx].pgdir + i);
511} 591}
512 592
513/*H:440 (v) Flushing (throwing away) page tables, 593/*H:440
594 * (v) Flushing (throwing away) page tables,
514 * 595 *
515 * The Guest has a hypercall to throw away the page tables: it's used when a 596 * The Guest has a hypercall to throw away the page tables: it's used when a
516 * large number of mappings have been changed. */ 597 * large number of mappings have been changed.
598 */
517void guest_pagetable_flush_user(struct lg_cpu *cpu) 599void guest_pagetable_flush_user(struct lg_cpu *cpu)
518{ 600{
519 /* Drop the userspace part of the current page table. */ 601 /* Drop the userspace part of the current page table. */
@@ -551,9 +633,11 @@ unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr)
551 return pte_pfn(gpte) * PAGE_SIZE | (vaddr & ~PAGE_MASK); 633 return pte_pfn(gpte) * PAGE_SIZE | (vaddr & ~PAGE_MASK);
552} 634}
553 635
554/* We keep several page tables. This is a simple routine to find the page 636/*
637 * We keep several page tables. This is a simple routine to find the page
555 * table (if any) corresponding to this top-level address the Guest has given 638 * table (if any) corresponding to this top-level address the Guest has given
556 * us. */ 639 * us.
640 */
557static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable) 641static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable)
558{ 642{
559 unsigned int i; 643 unsigned int i;
@@ -563,9 +647,11 @@ static unsigned int find_pgdir(struct lguest *lg, unsigned long pgtable)
563 return i; 647 return i;
564} 648}
565 649
566/*H:435 And this is us, creating the new page directory. If we really do 650/*H:435
651 * And this is us, creating the new page directory. If we really do
567 * allocate a new one (and so the kernel parts are not there), we set 652 * allocate a new one (and so the kernel parts are not there), we set
568 * blank_pgdir. */ 653 * blank_pgdir.
654 */
569static unsigned int new_pgdir(struct lg_cpu *cpu, 655static unsigned int new_pgdir(struct lg_cpu *cpu,
570 unsigned long gpgdir, 656 unsigned long gpgdir,
571 int *blank_pgdir) 657 int *blank_pgdir)
@@ -575,8 +661,10 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
575 pmd_t *pmd_table; 661 pmd_t *pmd_table;
576#endif 662#endif
577 663
578 /* We pick one entry at random to throw out. Choosing the Least 664 /*
579 * Recently Used might be better, but this is easy. */ 665 * We pick one entry at random to throw out. Choosing the Least
666 * Recently Used might be better, but this is easy.
667 */
580 next = random32() % ARRAY_SIZE(cpu->lg->pgdirs); 668 next = random32() % ARRAY_SIZE(cpu->lg->pgdirs);
581 /* If it's never been allocated at all before, try now. */ 669 /* If it's never been allocated at all before, try now. */
582 if (!cpu->lg->pgdirs[next].pgdir) { 670 if (!cpu->lg->pgdirs[next].pgdir) {
@@ -587,8 +675,10 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
587 next = cpu->cpu_pgd; 675 next = cpu->cpu_pgd;
588 else { 676 else {
589#ifdef CONFIG_X86_PAE 677#ifdef CONFIG_X86_PAE
590 /* In PAE mode, allocate a pmd page and populate the 678 /*
591 * last pgd entry. */ 679 * In PAE mode, allocate a pmd page and populate the
680 * last pgd entry.
681 */
592 pmd_table = (pmd_t *)get_zeroed_page(GFP_KERNEL); 682 pmd_table = (pmd_t *)get_zeroed_page(GFP_KERNEL);
593 if (!pmd_table) { 683 if (!pmd_table) {
594 free_page((long)cpu->lg->pgdirs[next].pgdir); 684 free_page((long)cpu->lg->pgdirs[next].pgdir);
@@ -598,8 +688,10 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
598 set_pgd(cpu->lg->pgdirs[next].pgdir + 688 set_pgd(cpu->lg->pgdirs[next].pgdir +
599 SWITCHER_PGD_INDEX, 689 SWITCHER_PGD_INDEX,
600 __pgd(__pa(pmd_table) | _PAGE_PRESENT)); 690 __pgd(__pa(pmd_table) | _PAGE_PRESENT));
601 /* This is a blank page, so there are no kernel 691 /*
602 * mappings: caller must map the stack! */ 692 * This is a blank page, so there are no kernel
693 * mappings: caller must map the stack!
694 */
603 *blank_pgdir = 1; 695 *blank_pgdir = 1;
604 } 696 }
605#else 697#else
@@ -615,19 +707,23 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
615 return next; 707 return next;
616} 708}
617 709
618/*H:430 (iv) Switching page tables 710/*H:430
711 * (iv) Switching page tables
619 * 712 *
620 * Now we've seen all the page table setting and manipulation, let's see 713 * Now we've seen all the page table setting and manipulation, let's see
621 * what happens when the Guest changes page tables (ie. changes the top-level 714 * what happens when the Guest changes page tables (ie. changes the top-level
622 * pgdir). This occurs on almost every context switch. */ 715 * pgdir). This occurs on almost every context switch.
716 */
623void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable) 717void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable)
624{ 718{
625 int newpgdir, repin = 0; 719 int newpgdir, repin = 0;
626 720
627 /* Look to see if we have this one already. */ 721 /* Look to see if we have this one already. */
628 newpgdir = find_pgdir(cpu->lg, pgtable); 722 newpgdir = find_pgdir(cpu->lg, pgtable);
629 /* If not, we allocate or mug an existing one: if it's a fresh one, 723 /*
630 * repin gets set to 1. */ 724 * If not, we allocate or mug an existing one: if it's a fresh one,
725 * repin gets set to 1.
726 */
631 if (newpgdir == ARRAY_SIZE(cpu->lg->pgdirs)) 727 if (newpgdir == ARRAY_SIZE(cpu->lg->pgdirs))
632 newpgdir = new_pgdir(cpu, pgtable, &repin); 728 newpgdir = new_pgdir(cpu, pgtable, &repin);
633 /* Change the current pgd index to the new one. */ 729 /* Change the current pgd index to the new one. */
@@ -637,9 +733,11 @@ void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable)
637 pin_stack_pages(cpu); 733 pin_stack_pages(cpu);
638} 734}
639 735
640/*H:470 Finally, a routine which throws away everything: all PGD entries in all 736/*H:470
737 * Finally, a routine which throws away everything: all PGD entries in all
641 * the shadow page tables, including the Guest's kernel mappings. This is used 738 * the shadow page tables, including the Guest's kernel mappings. This is used
642 * when we destroy the Guest. */ 739 * when we destroy the Guest.
740 */
643static void release_all_pagetables(struct lguest *lg) 741static void release_all_pagetables(struct lguest *lg)
644{ 742{
645 unsigned int i, j; 743 unsigned int i, j;
@@ -656,8 +754,10 @@ static void release_all_pagetables(struct lguest *lg)
656 spgd = lg->pgdirs[i].pgdir + SWITCHER_PGD_INDEX; 754 spgd = lg->pgdirs[i].pgdir + SWITCHER_PGD_INDEX;
657 pmdpage = __va(pgd_pfn(*spgd) << PAGE_SHIFT); 755 pmdpage = __va(pgd_pfn(*spgd) << PAGE_SHIFT);
658 756
659 /* And release the pmd entries of that pmd page, 757 /*
660 * except for the switcher pmd. */ 758 * And release the pmd entries of that pmd page,
759 * except for the switcher pmd.
760 */
661 for (k = 0; k < SWITCHER_PMD_INDEX; k++) 761 for (k = 0; k < SWITCHER_PMD_INDEX; k++)
662 release_pmd(&pmdpage[k]); 762 release_pmd(&pmdpage[k]);
663#endif 763#endif
@@ -667,10 +767,12 @@ static void release_all_pagetables(struct lguest *lg)
667 } 767 }
668} 768}
669 769
670/* We also throw away everything when a Guest tells us it's changed a kernel 770/*
771 * We also throw away everything when a Guest tells us it's changed a kernel
671 * mapping. Since kernel mappings are in every page table, it's easiest to 772 * mapping. Since kernel mappings are in every page table, it's easiest to
672 * throw them all away. This traps the Guest in amber for a while as 773 * throw them all away. This traps the Guest in amber for a while as
673 * everything faults back in, but it's rare. */ 774 * everything faults back in, but it's rare.
775 */
674void guest_pagetable_clear_all(struct lg_cpu *cpu) 776void guest_pagetable_clear_all(struct lg_cpu *cpu)
675{ 777{
676 release_all_pagetables(cpu->lg); 778 release_all_pagetables(cpu->lg);
@@ -678,15 +780,19 @@ void guest_pagetable_clear_all(struct lg_cpu *cpu)
678 pin_stack_pages(cpu); 780 pin_stack_pages(cpu);
679} 781}
680/*:*/ 782/*:*/
681/*M:009 Since we throw away all mappings when a kernel mapping changes, our 783
784/*M:009
785 * Since we throw away all mappings when a kernel mapping changes, our
682 * performance sucks for guests using highmem. In fact, a guest with 786 * performance sucks for guests using highmem. In fact, a guest with
683 * PAGE_OFFSET 0xc0000000 (the default) and more than about 700MB of RAM is 787 * PAGE_OFFSET 0xc0000000 (the default) and more than about 700MB of RAM is
684 * usually slower than a Guest with less memory. 788 * usually slower than a Guest with less memory.
685 * 789 *
686 * This, of course, cannot be fixed. It would take some kind of... well, I 790 * This, of course, cannot be fixed. It would take some kind of... well, I
687 * don't know, but the term "puissant code-fu" comes to mind. :*/ 791 * don't know, but the term "puissant code-fu" comes to mind.
792:*/
688 793
689/*H:420 This is the routine which actually sets the page table entry for then 794/*H:420
795 * This is the routine which actually sets the page table entry for then
690 * "idx"'th shadow page table. 796 * "idx"'th shadow page table.
691 * 797 *
692 * Normally, we can just throw out the old entry and replace it with 0: if they 798 * Normally, we can just throw out the old entry and replace it with 0: if they
@@ -715,31 +821,36 @@ static void do_set_pte(struct lg_cpu *cpu, int idx,
715 spmd = spmd_addr(cpu, *spgd, vaddr); 821 spmd = spmd_addr(cpu, *spgd, vaddr);
716 if (pmd_flags(*spmd) & _PAGE_PRESENT) { 822 if (pmd_flags(*spmd) & _PAGE_PRESENT) {
717#endif 823#endif
718 /* Otherwise, we start by releasing 824 /* Otherwise, start by releasing the existing entry. */
719 * the existing entry. */
720 pte_t *spte = spte_addr(cpu, *spgd, vaddr); 825 pte_t *spte = spte_addr(cpu, *spgd, vaddr);
721 release_pte(*spte); 826 release_pte(*spte);
722 827
723 /* If they're setting this entry as dirty or accessed, 828 /*
724 * we might as well put that entry they've given us 829 * If they're setting this entry as dirty or accessed,
725 * in now. This shaves 10% off a 830 * we might as well put that entry they've given us in
726 * copy-on-write micro-benchmark. */ 831 * now. This shaves 10% off a copy-on-write
832 * micro-benchmark.
833 */
727 if (pte_flags(gpte) & (_PAGE_DIRTY | _PAGE_ACCESSED)) { 834 if (pte_flags(gpte) & (_PAGE_DIRTY | _PAGE_ACCESSED)) {
728 check_gpte(cpu, gpte); 835 check_gpte(cpu, gpte);
729 native_set_pte(spte, 836 native_set_pte(spte,
730 gpte_to_spte(cpu, gpte, 837 gpte_to_spte(cpu, gpte,
731 pte_flags(gpte) & _PAGE_DIRTY)); 838 pte_flags(gpte) & _PAGE_DIRTY));
732 } else 839 } else {
733 /* Otherwise kill it and we can demand_page() 840 /*
734 * it in later. */ 841 * Otherwise kill it and we can demand_page()
842 * it in later.
843 */
735 native_set_pte(spte, __pte(0)); 844 native_set_pte(spte, __pte(0));
845 }
736#ifdef CONFIG_X86_PAE 846#ifdef CONFIG_X86_PAE
737 } 847 }
738#endif 848#endif
739 } 849 }
740} 850}
741 851
742/*H:410 Updating a PTE entry is a little trickier. 852/*H:410
853 * Updating a PTE entry is a little trickier.
743 * 854 *
744 * We keep track of several different page tables (the Guest uses one for each 855 * We keep track of several different page tables (the Guest uses one for each
745 * process, so it makes sense to cache at least a few). Each of these have 856 * process, so it makes sense to cache at least a few). Each of these have
@@ -748,12 +859,15 @@ static void do_set_pte(struct lg_cpu *cpu, int idx,
748 * all the page tables, not just the current one. This is rare. 859 * all the page tables, not just the current one. This is rare.
749 * 860 *
750 * The benefit is that when we have to track a new page table, we can keep all 861 * The benefit is that when we have to track a new page table, we can keep all
751 * the kernel mappings. This speeds up context switch immensely. */ 862 * the kernel mappings. This speeds up context switch immensely.
863 */
752void guest_set_pte(struct lg_cpu *cpu, 864void guest_set_pte(struct lg_cpu *cpu,
753 unsigned long gpgdir, unsigned long vaddr, pte_t gpte) 865 unsigned long gpgdir, unsigned long vaddr, pte_t gpte)
754{ 866{
755 /* Kernel mappings must be changed on all top levels. Slow, but doesn't 867 /*
756 * happen often. */ 868 * Kernel mappings must be changed on all top levels. Slow, but doesn't
869 * happen often.
870 */
757 if (vaddr >= cpu->lg->kernel_address) { 871 if (vaddr >= cpu->lg->kernel_address) {
758 unsigned int i; 872 unsigned int i;
759 for (i = 0; i < ARRAY_SIZE(cpu->lg->pgdirs); i++) 873 for (i = 0; i < ARRAY_SIZE(cpu->lg->pgdirs); i++)
@@ -795,19 +909,25 @@ void guest_set_pgd(struct lguest *lg, unsigned long gpgdir, u32 idx)
795 /* ... throw it away. */ 909 /* ... throw it away. */
796 release_pgd(lg->pgdirs[pgdir].pgdir + idx); 910 release_pgd(lg->pgdirs[pgdir].pgdir + idx);
797} 911}
912
798#ifdef CONFIG_X86_PAE 913#ifdef CONFIG_X86_PAE
914/* For setting a mid-level, we just throw everything away. It's easy. */
799void guest_set_pmd(struct lguest *lg, unsigned long pmdp, u32 idx) 915void guest_set_pmd(struct lguest *lg, unsigned long pmdp, u32 idx)
800{ 916{
801 guest_pagetable_clear_all(&lg->cpus[0]); 917 guest_pagetable_clear_all(&lg->cpus[0]);
802} 918}
803#endif 919#endif
804 920
805/* Once we know how much memory we have we can construct simple identity 921/*H:505
806 * (which set virtual == physical) and linear mappings 922 * To get through boot, we construct simple identity page mappings (which
807 * which will get the Guest far enough into the boot to create its own. 923 * set virtual == physical) and linear mappings which will get the Guest far
924 * enough into the boot to create its own. The linear mapping means we
925 * simplify the Guest boot, but it makes assumptions about their PAGE_OFFSET,
926 * as you'll see.
808 * 927 *
809 * We lay them out of the way, just below the initrd (which is why we need to 928 * We lay them out of the way, just below the initrd (which is why we need to
810 * know its size here). */ 929 * know its size here).
930 */
811static unsigned long setup_pagetables(struct lguest *lg, 931static unsigned long setup_pagetables(struct lguest *lg,
812 unsigned long mem, 932 unsigned long mem,
813 unsigned long initrd_size) 933 unsigned long initrd_size)
@@ -825,8 +945,10 @@ static unsigned long setup_pagetables(struct lguest *lg,
825 unsigned int phys_linear; 945 unsigned int phys_linear;
826#endif 946#endif
827 947
828 /* We have mapped_pages frames to map, so we need 948 /*
829 * linear_pages page tables to map them. */ 949 * We have mapped_pages frames to map, so we need linear_pages page
950 * tables to map them.
951 */
830 mapped_pages = mem / PAGE_SIZE; 952 mapped_pages = mem / PAGE_SIZE;
831 linear_pages = (mapped_pages + PTRS_PER_PTE - 1) / PTRS_PER_PTE; 953 linear_pages = (mapped_pages + PTRS_PER_PTE - 1) / PTRS_PER_PTE;
832 954
@@ -837,10 +959,16 @@ static unsigned long setup_pagetables(struct lguest *lg,
837 linear = (void *)pgdir - linear_pages * PAGE_SIZE; 959 linear = (void *)pgdir - linear_pages * PAGE_SIZE;
838 960
839#ifdef CONFIG_X86_PAE 961#ifdef CONFIG_X86_PAE
962 /*
963 * And the single mid page goes below that. We only use one, but
964 * that's enough to map 1G, which definitely gets us through boot.
965 */
840 pmds = (void *)linear - PAGE_SIZE; 966 pmds = (void *)linear - PAGE_SIZE;
841#endif 967#endif
842 /* Linear mapping is easy: put every page's address into the 968 /*
843 * mapping in order. */ 969 * Linear mapping is easy: put every page's address into the
970 * mapping in order.
971 */
844 for (i = 0; i < mapped_pages; i++) { 972 for (i = 0; i < mapped_pages; i++) {
845 pte_t pte; 973 pte_t pte;
846 pte = pfn_pte(i, __pgprot(_PAGE_PRESENT|_PAGE_RW|_PAGE_USER)); 974 pte = pfn_pte(i, __pgprot(_PAGE_PRESENT|_PAGE_RW|_PAGE_USER));
@@ -848,11 +976,14 @@ static unsigned long setup_pagetables(struct lguest *lg,
848 return -EFAULT; 976 return -EFAULT;
849 } 977 }
850 978
851 /* The top level points to the linear page table pages above.
852 * We setup the identity and linear mappings here. */
853#ifdef CONFIG_X86_PAE 979#ifdef CONFIG_X86_PAE
980 /*
981 * Make the Guest PMD entries point to the corresponding place in the
982 * linear mapping (up to one page worth of PMD).
983 */
854 for (i = j = 0; i < mapped_pages && j < PTRS_PER_PMD; 984 for (i = j = 0; i < mapped_pages && j < PTRS_PER_PMD;
855 i += PTRS_PER_PTE, j++) { 985 i += PTRS_PER_PTE, j++) {
986 /* FIXME: native_set_pmd is overkill here. */
856 native_set_pmd(&pmd, __pmd(((unsigned long)(linear + i) 987 native_set_pmd(&pmd, __pmd(((unsigned long)(linear + i)
857 - mem_base) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER)); 988 - mem_base) | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
858 989
@@ -860,18 +991,36 @@ static unsigned long setup_pagetables(struct lguest *lg,
860 return -EFAULT; 991 return -EFAULT;
861 } 992 }
862 993
994 /* One PGD entry, pointing to that PMD page. */
863 set_pgd(&pgd, __pgd(((u32)pmds - mem_base) | _PAGE_PRESENT)); 995 set_pgd(&pgd, __pgd(((u32)pmds - mem_base) | _PAGE_PRESENT));
996 /* Copy it in as the first PGD entry (ie. addresses 0-1G). */
864 if (copy_to_user(&pgdir[0], &pgd, sizeof(pgd)) != 0) 997 if (copy_to_user(&pgdir[0], &pgd, sizeof(pgd)) != 0)
865 return -EFAULT; 998 return -EFAULT;
999 /*
1000 * And the third PGD entry (ie. addresses 3G-4G).
1001 *
1002 * FIXME: This assumes that PAGE_OFFSET for the Guest is 0xC0000000.
1003 */
866 if (copy_to_user(&pgdir[3], &pgd, sizeof(pgd)) != 0) 1004 if (copy_to_user(&pgdir[3], &pgd, sizeof(pgd)) != 0)
867 return -EFAULT; 1005 return -EFAULT;
868#else 1006#else
1007 /*
1008 * The top level points to the linear page table pages above.
1009 * We setup the identity and linear mappings here.
1010 */
869 phys_linear = (unsigned long)linear - mem_base; 1011 phys_linear = (unsigned long)linear - mem_base;
870 for (i = 0; i < mapped_pages; i += PTRS_PER_PTE) { 1012 for (i = 0; i < mapped_pages; i += PTRS_PER_PTE) {
871 pgd_t pgd; 1013 pgd_t pgd;
1014 /*
1015 * Create a PGD entry which points to the right part of the
1016 * linear PTE pages.
1017 */
872 pgd = __pgd((phys_linear + i * sizeof(pte_t)) | 1018 pgd = __pgd((phys_linear + i * sizeof(pte_t)) |
873 (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER)); 1019 (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER));
874 1020
1021 /*
1022 * Copy it into the PGD page at 0 and PAGE_OFFSET.
1023 */
875 if (copy_to_user(&pgdir[i / PTRS_PER_PTE], &pgd, sizeof(pgd)) 1024 if (copy_to_user(&pgdir[i / PTRS_PER_PTE], &pgd, sizeof(pgd))
876 || copy_to_user(&pgdir[pgd_index(PAGE_OFFSET) 1025 || copy_to_user(&pgdir[pgd_index(PAGE_OFFSET)
877 + i / PTRS_PER_PTE], 1026 + i / PTRS_PER_PTE],
@@ -880,15 +1029,19 @@ static unsigned long setup_pagetables(struct lguest *lg,
880 } 1029 }
881#endif 1030#endif
882 1031
883 /* We return the top level (guest-physical) address: remember where 1032 /*
884 * this is. */ 1033 * We return the top level (guest-physical) address: we remember where
1034 * this is to write it into lguest_data when the Guest initializes.
1035 */
885 return (unsigned long)pgdir - mem_base; 1036 return (unsigned long)pgdir - mem_base;
886} 1037}
887 1038
888/*H:500 (vii) Setting up the page tables initially. 1039/*H:500
1040 * (vii) Setting up the page tables initially.
889 * 1041 *
890 * When a Guest is first created, the Launcher tells us where the toplevel of 1042 * When a Guest is first created, the Launcher tells us where the toplevel of
891 * its first page table is. We set some things up here: */ 1043 * its first page table is. We set some things up here:
1044 */
892int init_guest_pagetable(struct lguest *lg) 1045int init_guest_pagetable(struct lguest *lg)
893{ 1046{
894 u64 mem; 1047 u64 mem;
@@ -898,21 +1051,27 @@ int init_guest_pagetable(struct lguest *lg)
898 pgd_t *pgd; 1051 pgd_t *pgd;
899 pmd_t *pmd_table; 1052 pmd_t *pmd_table;
900#endif 1053#endif
901 /* Get the Guest memory size and the ramdisk size from the boot header 1054 /*
902 * located at lg->mem_base (Guest address 0). */ 1055 * Get the Guest memory size and the ramdisk size from the boot header
1056 * located at lg->mem_base (Guest address 0).
1057 */
903 if (copy_from_user(&mem, &boot->e820_map[0].size, sizeof(mem)) 1058 if (copy_from_user(&mem, &boot->e820_map[0].size, sizeof(mem))
904 || get_user(initrd_size, &boot->hdr.ramdisk_size)) 1059 || get_user(initrd_size, &boot->hdr.ramdisk_size))
905 return -EFAULT; 1060 return -EFAULT;
906 1061
907 /* We start on the first shadow page table, and give it a blank PGD 1062 /*
908 * page. */ 1063 * We start on the first shadow page table, and give it a blank PGD
1064 * page.
1065 */
909 lg->pgdirs[0].gpgdir = setup_pagetables(lg, mem, initrd_size); 1066 lg->pgdirs[0].gpgdir = setup_pagetables(lg, mem, initrd_size);
910 if (IS_ERR_VALUE(lg->pgdirs[0].gpgdir)) 1067 if (IS_ERR_VALUE(lg->pgdirs[0].gpgdir))
911 return lg->pgdirs[0].gpgdir; 1068 return lg->pgdirs[0].gpgdir;
912 lg->pgdirs[0].pgdir = (pgd_t *)get_zeroed_page(GFP_KERNEL); 1069 lg->pgdirs[0].pgdir = (pgd_t *)get_zeroed_page(GFP_KERNEL);
913 if (!lg->pgdirs[0].pgdir) 1070 if (!lg->pgdirs[0].pgdir)
914 return -ENOMEM; 1071 return -ENOMEM;
1072
915#ifdef CONFIG_X86_PAE 1073#ifdef CONFIG_X86_PAE
1074 /* For PAE, we also create the initial mid-level. */
916 pgd = lg->pgdirs[0].pgdir; 1075 pgd = lg->pgdirs[0].pgdir;
917 pmd_table = (pmd_t *) get_zeroed_page(GFP_KERNEL); 1076 pmd_table = (pmd_t *) get_zeroed_page(GFP_KERNEL);
918 if (!pmd_table) 1077 if (!pmd_table)
@@ -921,27 +1080,33 @@ int init_guest_pagetable(struct lguest *lg)
921 set_pgd(pgd + SWITCHER_PGD_INDEX, 1080 set_pgd(pgd + SWITCHER_PGD_INDEX,
922 __pgd(__pa(pmd_table) | _PAGE_PRESENT)); 1081 __pgd(__pa(pmd_table) | _PAGE_PRESENT));
923#endif 1082#endif
1083
1084 /* This is the current page table. */
924 lg->cpus[0].cpu_pgd = 0; 1085 lg->cpus[0].cpu_pgd = 0;
925 return 0; 1086 return 0;
926} 1087}
927 1088
928/* When the Guest calls LHCALL_LGUEST_INIT we do more setup. */ 1089/*H:508 When the Guest calls LHCALL_LGUEST_INIT we do more setup. */
929void page_table_guest_data_init(struct lg_cpu *cpu) 1090void page_table_guest_data_init(struct lg_cpu *cpu)
930{ 1091{
931 /* We get the kernel address: above this is all kernel memory. */ 1092 /* We get the kernel address: above this is all kernel memory. */
932 if (get_user(cpu->lg->kernel_address, 1093 if (get_user(cpu->lg->kernel_address,
933 &cpu->lg->lguest_data->kernel_address) 1094 &cpu->lg->lguest_data->kernel_address)
934 /* We tell the Guest that it can't use the top 2 or 4 MB 1095 /*
935 * of virtual addresses used by the Switcher. */ 1096 * We tell the Guest that it can't use the top 2 or 4 MB
1097 * of virtual addresses used by the Switcher.
1098 */
936 || put_user(RESERVE_MEM * 1024 * 1024, 1099 || put_user(RESERVE_MEM * 1024 * 1024,
937 &cpu->lg->lguest_data->reserve_mem) 1100 &cpu->lg->lguest_data->reserve_mem)
938 || put_user(cpu->lg->pgdirs[0].gpgdir, 1101 || put_user(cpu->lg->pgdirs[0].gpgdir,
939 &cpu->lg->lguest_data->pgdir)) 1102 &cpu->lg->lguest_data->pgdir))
940 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data); 1103 kill_guest(cpu, "bad guest page %p", cpu->lg->lguest_data);
941 1104
942 /* In flush_user_mappings() we loop from 0 to 1105 /*
1106 * In flush_user_mappings() we loop from 0 to
943 * "pgd_index(lg->kernel_address)". This assumes it won't hit the 1107 * "pgd_index(lg->kernel_address)". This assumes it won't hit the
944 * Switcher mappings, so check that now. */ 1108 * Switcher mappings, so check that now.
1109 */
945#ifdef CONFIG_X86_PAE 1110#ifdef CONFIG_X86_PAE
946 if (pgd_index(cpu->lg->kernel_address) == SWITCHER_PGD_INDEX && 1111 if (pgd_index(cpu->lg->kernel_address) == SWITCHER_PGD_INDEX &&
947 pmd_index(cpu->lg->kernel_address) == SWITCHER_PMD_INDEX) 1112 pmd_index(cpu->lg->kernel_address) == SWITCHER_PMD_INDEX)
@@ -964,12 +1129,14 @@ void free_guest_pagetable(struct lguest *lg)
964 free_page((long)lg->pgdirs[i].pgdir); 1129 free_page((long)lg->pgdirs[i].pgdir);
965} 1130}
966 1131
967/*H:480 (vi) Mapping the Switcher when the Guest is about to run. 1132/*H:480
1133 * (vi) Mapping the Switcher when the Guest is about to run.
968 * 1134 *
969 * The Switcher and the two pages for this CPU need to be visible in the 1135 * The Switcher and the two pages for this CPU need to be visible in the
970 * Guest (and not the pages for other CPUs). We have the appropriate PTE pages 1136 * Guest (and not the pages for other CPUs). We have the appropriate PTE pages
971 * for each CPU already set up, we just need to hook them in now we know which 1137 * for each CPU already set up, we just need to hook them in now we know which
972 * Guest is about to run on this CPU. */ 1138 * Guest is about to run on this CPU.
1139 */
973void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages) 1140void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages)
974{ 1141{
975 pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages); 1142 pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages);
@@ -980,30 +1147,38 @@ void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages)
980 pmd_t switcher_pmd; 1147 pmd_t switcher_pmd;
981 pmd_t *pmd_table; 1148 pmd_t *pmd_table;
982 1149
1150 /* FIXME: native_set_pmd is overkill here. */
983 native_set_pmd(&switcher_pmd, pfn_pmd(__pa(switcher_pte_page) >> 1151 native_set_pmd(&switcher_pmd, pfn_pmd(__pa(switcher_pte_page) >>
984 PAGE_SHIFT, PAGE_KERNEL_EXEC)); 1152 PAGE_SHIFT, PAGE_KERNEL_EXEC));
985 1153
1154 /* Figure out where the pmd page is, by reading the PGD, and converting
1155 * it to a virtual address. */
986 pmd_table = __va(pgd_pfn(cpu->lg-> 1156 pmd_table = __va(pgd_pfn(cpu->lg->
987 pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX]) 1157 pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX])
988 << PAGE_SHIFT); 1158 << PAGE_SHIFT);
1159 /* Now write it into the shadow page table. */
989 native_set_pmd(&pmd_table[SWITCHER_PMD_INDEX], switcher_pmd); 1160 native_set_pmd(&pmd_table[SWITCHER_PMD_INDEX], switcher_pmd);
990#else 1161#else
991 pgd_t switcher_pgd; 1162 pgd_t switcher_pgd;
992 1163
993 /* Make the last PGD entry for this Guest point to the Switcher's PTE 1164 /*
994 * page for this CPU (with appropriate flags). */ 1165 * Make the last PGD entry for this Guest point to the Switcher's PTE
1166 * page for this CPU (with appropriate flags).
1167 */
995 switcher_pgd = __pgd(__pa(switcher_pte_page) | __PAGE_KERNEL_EXEC); 1168 switcher_pgd = __pgd(__pa(switcher_pte_page) | __PAGE_KERNEL_EXEC);
996 1169
997 cpu->lg->pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX] = switcher_pgd; 1170 cpu->lg->pgdirs[cpu->cpu_pgd].pgdir[SWITCHER_PGD_INDEX] = switcher_pgd;
998 1171
999#endif 1172#endif
1000 /* We also change the Switcher PTE page. When we're running the Guest, 1173 /*
1174 * We also change the Switcher PTE page. When we're running the Guest,
1001 * we want the Guest's "regs" page to appear where the first Switcher 1175 * we want the Guest's "regs" page to appear where the first Switcher
1002 * page for this CPU is. This is an optimization: when the Switcher 1176 * page for this CPU is. This is an optimization: when the Switcher
1003 * saves the Guest registers, it saves them into the first page of this 1177 * saves the Guest registers, it saves them into the first page of this
1004 * CPU's "struct lguest_pages": if we make sure the Guest's register 1178 * CPU's "struct lguest_pages": if we make sure the Guest's register
1005 * page is already mapped there, we don't have to copy them out 1179 * page is already mapped there, we don't have to copy them out
1006 * again. */ 1180 * again.
1181 */
1007 pfn = __pa(cpu->regs_page) >> PAGE_SHIFT; 1182 pfn = __pa(cpu->regs_page) >> PAGE_SHIFT;
1008 native_set_pte(&regs_pte, pfn_pte(pfn, PAGE_KERNEL)); 1183 native_set_pte(&regs_pte, pfn_pte(pfn, PAGE_KERNEL));
1009 native_set_pte(&switcher_pte_page[pte_index((unsigned long)pages)], 1184 native_set_pte(&switcher_pte_page[pte_index((unsigned long)pages)],
@@ -1019,10 +1194,12 @@ static void free_switcher_pte_pages(void)
1019 free_page((long)switcher_pte_page(i)); 1194 free_page((long)switcher_pte_page(i));
1020} 1195}
1021 1196
1022/*H:520 Setting up the Switcher PTE page for given CPU is fairly easy, given 1197/*H:520
1198 * Setting up the Switcher PTE page for given CPU is fairly easy, given
1023 * the CPU number and the "struct page"s for the Switcher code itself. 1199 * the CPU number and the "struct page"s for the Switcher code itself.
1024 * 1200 *
1025 * Currently the Switcher is less than a page long, so "pages" is always 1. */ 1201 * Currently the Switcher is less than a page long, so "pages" is always 1.
1202 */
1026static __init void populate_switcher_pte_page(unsigned int cpu, 1203static __init void populate_switcher_pte_page(unsigned int cpu,
1027 struct page *switcher_page[], 1204 struct page *switcher_page[],
1028 unsigned int pages) 1205 unsigned int pages)
@@ -1043,13 +1220,16 @@ static __init void populate_switcher_pte_page(unsigned int cpu,
1043 native_set_pte(&pte[i], pfn_pte(page_to_pfn(switcher_page[i]), 1220 native_set_pte(&pte[i], pfn_pte(page_to_pfn(switcher_page[i]),
1044 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED|_PAGE_RW))); 1221 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED|_PAGE_RW)));
1045 1222
1046 /* The second page contains the "struct lguest_ro_state", and is 1223 /*
1047 * read-only. */ 1224 * The second page contains the "struct lguest_ro_state", and is
1225 * read-only.
1226 */
1048 native_set_pte(&pte[i+1], pfn_pte(page_to_pfn(switcher_page[i+1]), 1227 native_set_pte(&pte[i+1], pfn_pte(page_to_pfn(switcher_page[i+1]),
1049 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED))); 1228 __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED)));
1050} 1229}
1051 1230
1052/* We've made it through the page table code. Perhaps our tired brains are 1231/*
1232 * We've made it through the page table code. Perhaps our tired brains are
1053 * still processing the details, or perhaps we're simply glad it's over. 1233 * still processing the details, or perhaps we're simply glad it's over.
1054 * 1234 *
1055 * If nothing else, note that all this complexity in juggling shadow page tables 1235 * If nothing else, note that all this complexity in juggling shadow page tables
@@ -1058,10 +1238,13 @@ static __init void populate_switcher_pte_page(unsigned int cpu,
1058 * uses exotic direct Guest pagetable manipulation, and why both Intel and AMD 1238 * uses exotic direct Guest pagetable manipulation, and why both Intel and AMD
1059 * have implemented shadow page table support directly into hardware. 1239 * have implemented shadow page table support directly into hardware.
1060 * 1240 *
1061 * There is just one file remaining in the Host. */ 1241 * There is just one file remaining in the Host.
1242 */
1062 1243
1063/*H:510 At boot or module load time, init_pagetables() allocates and populates 1244/*H:510
1064 * the Switcher PTE page for each CPU. */ 1245 * At boot or module load time, init_pagetables() allocates and populates
1246 * the Switcher PTE page for each CPU.
1247 */
1065__init int init_pagetables(struct page **switcher_page, unsigned int pages) 1248__init int init_pagetables(struct page **switcher_page, unsigned int pages)
1066{ 1249{
1067 unsigned int i; 1250 unsigned int i;
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c
index 482ed5a18750..951c57b0a7e0 100644
--- a/drivers/lguest/segments.c
+++ b/drivers/lguest/segments.c
@@ -1,4 +1,5 @@
1/*P:600 The x86 architecture has segments, which involve a table of descriptors 1/*P:600
2 * The x86 architecture has segments, which involve a table of descriptors
2 * which can be used to do funky things with virtual address interpretation. 3 * which can be used to do funky things with virtual address interpretation.
3 * We originally used to use segments so the Guest couldn't alter the 4 * We originally used to use segments so the Guest couldn't alter the
4 * Guest<->Host Switcher, and then we had to trim Guest segments, and restore 5 * Guest<->Host Switcher, and then we had to trim Guest segments, and restore
@@ -8,7 +9,8 @@
8 * 9 *
9 * In these modern times, the segment handling code consists of simple sanity 10 * In these modern times, the segment handling code consists of simple sanity
10 * checks, and the worst you'll experience reading this code is butterfly-rash 11 * checks, and the worst you'll experience reading this code is butterfly-rash
11 * from frolicking through its parklike serenity. :*/ 12 * from frolicking through its parklike serenity.
13:*/
12#include "lg.h" 14#include "lg.h"
13 15
14/*H:600 16/*H:600
@@ -41,10 +43,12 @@
41 * begin. 43 * begin.
42 */ 44 */
43 45
44/* There are several entries we don't let the Guest set. The TSS entry is the 46/*
47 * There are several entries we don't let the Guest set. The TSS entry is the
45 * "Task State Segment" which controls all kinds of delicate things. The 48 * "Task State Segment" which controls all kinds of delicate things. The
46 * LGUEST_CS and LGUEST_DS entries are reserved for the Switcher, and the 49 * LGUEST_CS and LGUEST_DS entries are reserved for the Switcher, and the
47 * the Guest can't be trusted to deal with double faults. */ 50 * the Guest can't be trusted to deal with double faults.
51 */
48static bool ignored_gdt(unsigned int num) 52static bool ignored_gdt(unsigned int num)
49{ 53{
50 return (num == GDT_ENTRY_TSS 54 return (num == GDT_ENTRY_TSS
@@ -53,42 +57,52 @@ static bool ignored_gdt(unsigned int num)
53 || num == GDT_ENTRY_DOUBLEFAULT_TSS); 57 || num == GDT_ENTRY_DOUBLEFAULT_TSS);
54} 58}
55 59
56/*H:630 Once the Guest gave us new GDT entries, we fix them up a little. We 60/*H:630
61 * Once the Guest gave us new GDT entries, we fix them up a little. We
57 * don't care if they're invalid: the worst that can happen is a General 62 * don't care if they're invalid: the worst that can happen is a General
58 * Protection Fault in the Switcher when it restores a Guest segment register 63 * Protection Fault in the Switcher when it restores a Guest segment register
59 * which tries to use that entry. Then we kill the Guest for causing such a 64 * which tries to use that entry. Then we kill the Guest for causing such a
60 * mess: the message will be "unhandled trap 256". */ 65 * mess: the message will be "unhandled trap 256".
66 */
61static void fixup_gdt_table(struct lg_cpu *cpu, unsigned start, unsigned end) 67static void fixup_gdt_table(struct lg_cpu *cpu, unsigned start, unsigned end)
62{ 68{
63 unsigned int i; 69 unsigned int i;
64 70
65 for (i = start; i < end; i++) { 71 for (i = start; i < end; i++) {
66 /* We never copy these ones to real GDT, so we don't care what 72 /*
67 * they say */ 73 * We never copy these ones to real GDT, so we don't care what
74 * they say
75 */
68 if (ignored_gdt(i)) 76 if (ignored_gdt(i))
69 continue; 77 continue;
70 78
71 /* Segment descriptors contain a privilege level: the Guest is 79 /*
80 * Segment descriptors contain a privilege level: the Guest is
72 * sometimes careless and leaves this as 0, even though it's 81 * sometimes careless and leaves this as 0, even though it's
73 * running at privilege level 1. If so, we fix it here. */ 82 * running at privilege level 1. If so, we fix it here.
83 */
74 if ((cpu->arch.gdt[i].b & 0x00006000) == 0) 84 if ((cpu->arch.gdt[i].b & 0x00006000) == 0)
75 cpu->arch.gdt[i].b |= (GUEST_PL << 13); 85 cpu->arch.gdt[i].b |= (GUEST_PL << 13);
76 86
77 /* Each descriptor has an "accessed" bit. If we don't set it 87 /*
88 * Each descriptor has an "accessed" bit. If we don't set it
78 * now, the CPU will try to set it when the Guest first loads 89 * now, the CPU will try to set it when the Guest first loads
79 * that entry into a segment register. But the GDT isn't 90 * that entry into a segment register. But the GDT isn't
80 * writable by the Guest, so bad things can happen. */ 91 * writable by the Guest, so bad things can happen.
92 */
81 cpu->arch.gdt[i].b |= 0x00000100; 93 cpu->arch.gdt[i].b |= 0x00000100;
82 } 94 }
83} 95}
84 96
85/*H:610 Like the IDT, we never simply use the GDT the Guest gives us. We keep 97/*H:610
98 * Like the IDT, we never simply use the GDT the Guest gives us. We keep
86 * a GDT for each CPU, and copy across the Guest's entries each time we want to 99 * a GDT for each CPU, and copy across the Guest's entries each time we want to
87 * run the Guest on that CPU. 100 * run the Guest on that CPU.
88 * 101 *
89 * This routine is called at boot or modprobe time for each CPU to set up the 102 * This routine is called at boot or modprobe time for each CPU to set up the
90 * constant GDT entries: the ones which are the same no matter what Guest we're 103 * constant GDT entries: the ones which are the same no matter what Guest we're
91 * running. */ 104 * running.
105 */
92void setup_default_gdt_entries(struct lguest_ro_state *state) 106void setup_default_gdt_entries(struct lguest_ro_state *state)
93{ 107{
94 struct desc_struct *gdt = state->guest_gdt; 108 struct desc_struct *gdt = state->guest_gdt;
@@ -98,30 +112,37 @@ void setup_default_gdt_entries(struct lguest_ro_state *state)
98 gdt[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT; 112 gdt[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT;
99 gdt[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT; 113 gdt[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT;
100 114
101 /* The TSS segment refers to the TSS entry for this particular CPU. 115 /*
116 * The TSS segment refers to the TSS entry for this particular CPU.
102 * Forgive the magic flags: the 0x8900 means the entry is Present, it's 117 * Forgive the magic flags: the 0x8900 means the entry is Present, it's
103 * privilege level 0 Available 386 TSS system segment, and the 0x67 118 * privilege level 0 Available 386 TSS system segment, and the 0x67
104 * means Saturn is eclipsed by Mercury in the twelfth house. */ 119 * means Saturn is eclipsed by Mercury in the twelfth house.
120 */
105 gdt[GDT_ENTRY_TSS].a = 0x00000067 | (tss << 16); 121 gdt[GDT_ENTRY_TSS].a = 0x00000067 | (tss << 16);
106 gdt[GDT_ENTRY_TSS].b = 0x00008900 | (tss & 0xFF000000) 122 gdt[GDT_ENTRY_TSS].b = 0x00008900 | (tss & 0xFF000000)
107 | ((tss >> 16) & 0x000000FF); 123 | ((tss >> 16) & 0x000000FF);
108} 124}
109 125
110/* This routine sets up the initial Guest GDT for booting. All entries start 126/*
111 * as 0 (unusable). */ 127 * This routine sets up the initial Guest GDT for booting. All entries start
128 * as 0 (unusable).
129 */
112void setup_guest_gdt(struct lg_cpu *cpu) 130void setup_guest_gdt(struct lg_cpu *cpu)
113{ 131{
114 /* Start with full 0-4G segments... */ 132 /*
133 * Start with full 0-4G segments...except the Guest is allowed to use
134 * them, so set the privilege level appropriately in the flags.
135 */
115 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS] = FULL_EXEC_SEGMENT; 136 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS] = FULL_EXEC_SEGMENT;
116 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS] = FULL_SEGMENT; 137 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS] = FULL_SEGMENT;
117 /* ...except the Guest is allowed to use them, so set the privilege
118 * level appropriately in the flags. */
119 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS].b |= (GUEST_PL << 13); 138 cpu->arch.gdt[GDT_ENTRY_KERNEL_CS].b |= (GUEST_PL << 13);
120 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS].b |= (GUEST_PL << 13); 139 cpu->arch.gdt[GDT_ENTRY_KERNEL_DS].b |= (GUEST_PL << 13);
121} 140}
122 141
123/*H:650 An optimization of copy_gdt(), for just the three "thead-local storage" 142/*H:650
124 * entries. */ 143 * An optimization of copy_gdt(), for just the three "thead-local storage"
144 * entries.
145 */
125void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt) 146void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt)
126{ 147{
127 unsigned int i; 148 unsigned int i;
@@ -130,26 +151,34 @@ void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt)
130 gdt[i] = cpu->arch.gdt[i]; 151 gdt[i] = cpu->arch.gdt[i];
131} 152}
132 153
133/*H:640 When the Guest is run on a different CPU, or the GDT entries have 154/*H:640
134 * changed, copy_gdt() is called to copy the Guest's GDT entries across to this 155 * When the Guest is run on a different CPU, or the GDT entries have changed,
135 * CPU's GDT. */ 156 * copy_gdt() is called to copy the Guest's GDT entries across to this CPU's
157 * GDT.
158 */
136void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt) 159void copy_gdt(const struct lg_cpu *cpu, struct desc_struct *gdt)
137{ 160{
138 unsigned int i; 161 unsigned int i;
139 162
140 /* The default entries from setup_default_gdt_entries() are not 163 /*
141 * replaced. See ignored_gdt() above. */ 164 * The default entries from setup_default_gdt_entries() are not
165 * replaced. See ignored_gdt() above.
166 */
142 for (i = 0; i < GDT_ENTRIES; i++) 167 for (i = 0; i < GDT_ENTRIES; i++)
143 if (!ignored_gdt(i)) 168 if (!ignored_gdt(i))
144 gdt[i] = cpu->arch.gdt[i]; 169 gdt[i] = cpu->arch.gdt[i];
145} 170}
146 171
147/*H:620 This is where the Guest asks us to load a new GDT entry 172/*H:620
148 * (LHCALL_LOAD_GDT_ENTRY). We tweak the entry and copy it in. */ 173 * This is where the Guest asks us to load a new GDT entry
174 * (LHCALL_LOAD_GDT_ENTRY). We tweak the entry and copy it in.
175 */
149void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi) 176void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi)
150{ 177{
151 /* We assume the Guest has the same number of GDT entries as the 178 /*
152 * Host, otherwise we'd have to dynamically allocate the Guest GDT. */ 179 * We assume the Guest has the same number of GDT entries as the
180 * Host, otherwise we'd have to dynamically allocate the Guest GDT.
181 */
153 if (num >= ARRAY_SIZE(cpu->arch.gdt)) 182 if (num >= ARRAY_SIZE(cpu->arch.gdt))
154 kill_guest(cpu, "too many gdt entries %i", num); 183 kill_guest(cpu, "too many gdt entries %i", num);
155 184
@@ -157,15 +186,19 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi)
157 cpu->arch.gdt[num].a = lo; 186 cpu->arch.gdt[num].a = lo;
158 cpu->arch.gdt[num].b = hi; 187 cpu->arch.gdt[num].b = hi;
159 fixup_gdt_table(cpu, num, num+1); 188 fixup_gdt_table(cpu, num, num+1);
160 /* Mark that the GDT changed so the core knows it has to copy it again, 189 /*
161 * even if the Guest is run on the same CPU. */ 190 * Mark that the GDT changed so the core knows it has to copy it again,
191 * even if the Guest is run on the same CPU.
192 */
162 cpu->changed |= CHANGED_GDT; 193 cpu->changed |= CHANGED_GDT;
163} 194}
164 195
165/* This is the fast-track version for just changing the three TLS entries. 196/*
197 * This is the fast-track version for just changing the three TLS entries.
166 * Remember that this happens on every context switch, so it's worth 198 * Remember that this happens on every context switch, so it's worth
167 * optimizing. But wouldn't it be neater to have a single hypercall to cover 199 * optimizing. But wouldn't it be neater to have a single hypercall to cover
168 * both cases? */ 200 * both cases?
201 */
169void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls) 202void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls)
170{ 203{
171 struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN]; 204 struct desc_struct *tls = &cpu->arch.gdt[GDT_ENTRY_TLS_MIN];
@@ -175,7 +208,6 @@ void guest_load_tls(struct lg_cpu *cpu, unsigned long gtls)
175 /* Note that just the TLS entries have changed. */ 208 /* Note that just the TLS entries have changed. */
176 cpu->changed |= CHANGED_GDT_TLS; 209 cpu->changed |= CHANGED_GDT_TLS;
177} 210}
178/*:*/
179 211
180/*H:660 212/*H:660
181 * With this, we have finished the Host. 213 * With this, we have finished the Host.
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index eaf722fe309a..6ae388849a3b 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -17,13 +17,15 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20/*P:450 This file contains the x86-specific lguest code. It used to be all 20/*P:450
21 * This file contains the x86-specific lguest code. It used to be all
21 * mixed in with drivers/lguest/core.c but several foolhardy code slashers 22 * mixed in with drivers/lguest/core.c but several foolhardy code slashers
22 * wrestled most of the dependencies out to here in preparation for porting 23 * wrestled most of the dependencies out to here in preparation for porting
23 * lguest to other architectures (see what I mean by foolhardy?). 24 * lguest to other architectures (see what I mean by foolhardy?).
24 * 25 *
25 * This also contains a couple of non-obvious setup and teardown pieces which 26 * This also contains a couple of non-obvious setup and teardown pieces which
26 * were implemented after days of debugging pain. :*/ 27 * were implemented after days of debugging pain.
28:*/
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/start_kernel.h> 30#include <linux/start_kernel.h>
29#include <linux/string.h> 31#include <linux/string.h>
@@ -82,25 +84,33 @@ static DEFINE_PER_CPU(struct lg_cpu *, last_cpu);
82 */ 84 */
83static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages) 85static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
84{ 86{
85 /* Copying all this data can be quite expensive. We usually run the 87 /*
88 * Copying all this data can be quite expensive. We usually run the
86 * same Guest we ran last time (and that Guest hasn't run anywhere else 89 * same Guest we ran last time (and that Guest hasn't run anywhere else
87 * meanwhile). If that's not the case, we pretend everything in the 90 * meanwhile). If that's not the case, we pretend everything in the
88 * Guest has changed. */ 91 * Guest has changed.
92 */
89 if (__get_cpu_var(last_cpu) != cpu || cpu->last_pages != pages) { 93 if (__get_cpu_var(last_cpu) != cpu || cpu->last_pages != pages) {
90 __get_cpu_var(last_cpu) = cpu; 94 __get_cpu_var(last_cpu) = cpu;
91 cpu->last_pages = pages; 95 cpu->last_pages = pages;
92 cpu->changed = CHANGED_ALL; 96 cpu->changed = CHANGED_ALL;
93 } 97 }
94 98
95 /* These copies are pretty cheap, so we do them unconditionally: */ 99 /*
96 /* Save the current Host top-level page directory. */ 100 * These copies are pretty cheap, so we do them unconditionally: */
101 /* Save the current Host top-level page directory.
102 */
97 pages->state.host_cr3 = __pa(current->mm->pgd); 103 pages->state.host_cr3 = __pa(current->mm->pgd);
98 /* Set up the Guest's page tables to see this CPU's pages (and no 104 /*
99 * other CPU's pages). */ 105 * Set up the Guest's page tables to see this CPU's pages (and no
106 * other CPU's pages).
107 */
100 map_switcher_in_guest(cpu, pages); 108 map_switcher_in_guest(cpu, pages);
101 /* Set up the two "TSS" members which tell the CPU what stack to use 109 /*
110 * Set up the two "TSS" members which tell the CPU what stack to use
102 * for traps which do directly into the Guest (ie. traps at privilege 111 * for traps which do directly into the Guest (ie. traps at privilege
103 * level 1). */ 112 * level 1).
113 */
104 pages->state.guest_tss.sp1 = cpu->esp1; 114 pages->state.guest_tss.sp1 = cpu->esp1;
105 pages->state.guest_tss.ss1 = cpu->ss1; 115 pages->state.guest_tss.ss1 = cpu->ss1;
106 116
@@ -125,97 +135,126 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages)
125 /* This is a dummy value we need for GCC's sake. */ 135 /* This is a dummy value we need for GCC's sake. */
126 unsigned int clobber; 136 unsigned int clobber;
127 137
128 /* Copy the guest-specific information into this CPU's "struct 138 /*
129 * lguest_pages". */ 139 * Copy the guest-specific information into this CPU's "struct
140 * lguest_pages".
141 */
130 copy_in_guest_info(cpu, pages); 142 copy_in_guest_info(cpu, pages);
131 143
132 /* Set the trap number to 256 (impossible value). If we fault while 144 /*
145 * Set the trap number to 256 (impossible value). If we fault while
133 * switching to the Guest (bad segment registers or bug), this will 146 * switching to the Guest (bad segment registers or bug), this will
134 * cause us to abort the Guest. */ 147 * cause us to abort the Guest.
148 */
135 cpu->regs->trapnum = 256; 149 cpu->regs->trapnum = 256;
136 150
137 /* Now: we push the "eflags" register on the stack, then do an "lcall". 151 /*
152 * Now: we push the "eflags" register on the stack, then do an "lcall".
138 * This is how we change from using the kernel code segment to using 153 * This is how we change from using the kernel code segment to using
139 * the dedicated lguest code segment, as well as jumping into the 154 * the dedicated lguest code segment, as well as jumping into the
140 * Switcher. 155 * Switcher.
141 * 156 *
142 * The lcall also pushes the old code segment (KERNEL_CS) onto the 157 * The lcall also pushes the old code segment (KERNEL_CS) onto the
143 * stack, then the address of this call. This stack layout happens to 158 * stack, then the address of this call. This stack layout happens to
144 * exactly match the stack layout created by an interrupt... */ 159 * exactly match the stack layout created by an interrupt...
160 */
145 asm volatile("pushf; lcall *lguest_entry" 161 asm volatile("pushf; lcall *lguest_entry"
146 /* This is how we tell GCC that %eax ("a") and %ebx ("b") 162 /*
147 * are changed by this routine. The "=" means output. */ 163 * This is how we tell GCC that %eax ("a") and %ebx ("b")
164 * are changed by this routine. The "=" means output.
165 */
148 : "=a"(clobber), "=b"(clobber) 166 : "=a"(clobber), "=b"(clobber)
149 /* %eax contains the pages pointer. ("0" refers to the 167 /*
168 * %eax contains the pages pointer. ("0" refers to the
150 * 0-th argument above, ie "a"). %ebx contains the 169 * 0-th argument above, ie "a"). %ebx contains the
151 * physical address of the Guest's top-level page 170 * physical address of the Guest's top-level page
152 * directory. */ 171 * directory.
172 */
153 : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)) 173 : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir))
154 /* We tell gcc that all these registers could change, 174 /*
175 * We tell gcc that all these registers could change,
155 * which means we don't have to save and restore them in 176 * which means we don't have to save and restore them in
156 * the Switcher. */ 177 * the Switcher.
178 */
157 : "memory", "%edx", "%ecx", "%edi", "%esi"); 179 : "memory", "%edx", "%ecx", "%edi", "%esi");
158} 180}
159/*:*/ 181/*:*/
160 182
161/*M:002 There are hooks in the scheduler which we can register to tell when we 183/*M:002
184 * There are hooks in the scheduler which we can register to tell when we
162 * get kicked off the CPU (preempt_notifier_register()). This would allow us 185 * get kicked off the CPU (preempt_notifier_register()). This would allow us
163 * to lazily disable SYSENTER which would regain some performance, and should 186 * to lazily disable SYSENTER which would regain some performance, and should
164 * also simplify copy_in_guest_info(). Note that we'd still need to restore 187 * also simplify copy_in_guest_info(). Note that we'd still need to restore
165 * things when we exit to Launcher userspace, but that's fairly easy. 188 * things when we exit to Launcher userspace, but that's fairly easy.
166 * 189 *
167 * We could also try using this hooks for PGE, but that might be too expensive. 190 * We could also try using these hooks for PGE, but that might be too expensive.
168 * 191 *
169 * The hooks were designed for KVM, but we can also put them to good use. :*/ 192 * The hooks were designed for KVM, but we can also put them to good use.
193:*/
170 194
171/*H:040 This is the i386-specific code to setup and run the Guest. Interrupts 195/*H:040
172 * are disabled: we own the CPU. */ 196 * This is the i386-specific code to setup and run the Guest. Interrupts
197 * are disabled: we own the CPU.
198 */
173void lguest_arch_run_guest(struct lg_cpu *cpu) 199void lguest_arch_run_guest(struct lg_cpu *cpu)
174{ 200{
175 /* Remember the awfully-named TS bit? If the Guest has asked to set it 201 /*
202 * Remember the awfully-named TS bit? If the Guest has asked to set it
176 * we set it now, so we can trap and pass that trap to the Guest if it 203 * we set it now, so we can trap and pass that trap to the Guest if it
177 * uses the FPU. */ 204 * uses the FPU.
205 */
178 if (cpu->ts) 206 if (cpu->ts)
179 unlazy_fpu(current); 207 unlazy_fpu(current);
180 208
181 /* SYSENTER is an optimized way of doing system calls. We can't allow 209 /*
210 * SYSENTER is an optimized way of doing system calls. We can't allow
182 * it because it always jumps to privilege level 0. A normal Guest 211 * it because it always jumps to privilege level 0. A normal Guest
183 * won't try it because we don't advertise it in CPUID, but a malicious 212 * won't try it because we don't advertise it in CPUID, but a malicious
184 * Guest (or malicious Guest userspace program) could, so we tell the 213 * Guest (or malicious Guest userspace program) could, so we tell the
185 * CPU to disable it before running the Guest. */ 214 * CPU to disable it before running the Guest.
215 */
186 if (boot_cpu_has(X86_FEATURE_SEP)) 216 if (boot_cpu_has(X86_FEATURE_SEP))
187 wrmsr(MSR_IA32_SYSENTER_CS, 0, 0); 217 wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
188 218
189 /* Now we actually run the Guest. It will return when something 219 /*
220 * Now we actually run the Guest. It will return when something
190 * interesting happens, and we can examine its registers to see what it 221 * interesting happens, and we can examine its registers to see what it
191 * was doing. */ 222 * was doing.
223 */
192 run_guest_once(cpu, lguest_pages(raw_smp_processor_id())); 224 run_guest_once(cpu, lguest_pages(raw_smp_processor_id()));
193 225
194 /* Note that the "regs" structure contains two extra entries which are 226 /*
227 * Note that the "regs" structure contains two extra entries which are
195 * not really registers: a trap number which says what interrupt or 228 * not really registers: a trap number which says what interrupt or
196 * trap made the switcher code come back, and an error code which some 229 * trap made the switcher code come back, and an error code which some
197 * traps set. */ 230 * traps set.
231 */
198 232
199 /* Restore SYSENTER if it's supposed to be on. */ 233 /* Restore SYSENTER if it's supposed to be on. */
200 if (boot_cpu_has(X86_FEATURE_SEP)) 234 if (boot_cpu_has(X86_FEATURE_SEP))
201 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); 235 wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
202 236
203 /* If the Guest page faulted, then the cr2 register will tell us the 237 /*
238 * If the Guest page faulted, then the cr2 register will tell us the
204 * bad virtual address. We have to grab this now, because once we 239 * bad virtual address. We have to grab this now, because once we
205 * re-enable interrupts an interrupt could fault and thus overwrite 240 * re-enable interrupts an interrupt could fault and thus overwrite
206 * cr2, or we could even move off to a different CPU. */ 241 * cr2, or we could even move off to a different CPU.
242 */
207 if (cpu->regs->trapnum == 14) 243 if (cpu->regs->trapnum == 14)
208 cpu->arch.last_pagefault = read_cr2(); 244 cpu->arch.last_pagefault = read_cr2();
209 /* Similarly, if we took a trap because the Guest used the FPU, 245 /*
246 * Similarly, if we took a trap because the Guest used the FPU,
210 * we have to restore the FPU it expects to see. 247 * we have to restore the FPU it expects to see.
211 * math_state_restore() may sleep and we may even move off to 248 * math_state_restore() may sleep and we may even move off to
212 * a different CPU. So all the critical stuff should be done 249 * a different CPU. So all the critical stuff should be done
213 * before this. */ 250 * before this.
251 */
214 else if (cpu->regs->trapnum == 7) 252 else if (cpu->regs->trapnum == 7)
215 math_state_restore(); 253 math_state_restore();
216} 254}
217 255
218/*H:130 Now we've examined the hypercall code; our Guest can make requests. 256/*H:130
257 * Now we've examined the hypercall code; our Guest can make requests.
219 * Our Guest is usually so well behaved; it never tries to do things it isn't 258 * Our Guest is usually so well behaved; it never tries to do things it isn't
220 * allowed to, and uses hypercalls instead. Unfortunately, Linux's paravirtual 259 * allowed to, and uses hypercalls instead. Unfortunately, Linux's paravirtual
221 * infrastructure isn't quite complete, because it doesn't contain replacements 260 * infrastructure isn't quite complete, because it doesn't contain replacements
@@ -225,26 +264,33 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
225 * 264 *
226 * When the Guest uses one of these instructions, we get a trap (General 265 * When the Guest uses one of these instructions, we get a trap (General
227 * Protection Fault) and come here. We see if it's one of those troublesome 266 * Protection Fault) and come here. We see if it's one of those troublesome
228 * instructions and skip over it. We return true if we did. */ 267 * instructions and skip over it. We return true if we did.
268 */
229static int emulate_insn(struct lg_cpu *cpu) 269static int emulate_insn(struct lg_cpu *cpu)
230{ 270{
231 u8 insn; 271 u8 insn;
232 unsigned int insnlen = 0, in = 0, shift = 0; 272 unsigned int insnlen = 0, in = 0, shift = 0;
233 /* The eip contains the *virtual* address of the Guest's instruction: 273 /*
234 * guest_pa just subtracts the Guest's page_offset. */ 274 * The eip contains the *virtual* address of the Guest's instruction:
275 * guest_pa just subtracts the Guest's page_offset.
276 */
235 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip); 277 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip);
236 278
237 /* This must be the Guest kernel trying to do something, not userspace! 279 /*
280 * This must be the Guest kernel trying to do something, not userspace!
238 * The bottom two bits of the CS segment register are the privilege 281 * The bottom two bits of the CS segment register are the privilege
239 * level. */ 282 * level.
283 */
240 if ((cpu->regs->cs & 3) != GUEST_PL) 284 if ((cpu->regs->cs & 3) != GUEST_PL)
241 return 0; 285 return 0;
242 286
243 /* Decoding x86 instructions is icky. */ 287 /* Decoding x86 instructions is icky. */
244 insn = lgread(cpu, physaddr, u8); 288 insn = lgread(cpu, physaddr, u8);
245 289
246 /* 0x66 is an "operand prefix". It means it's using the upper 16 bits 290 /*
247 of the eax register. */ 291 * 0x66 is an "operand prefix". It means it's using the upper 16 bits
292 * of the eax register.
293 */
248 if (insn == 0x66) { 294 if (insn == 0x66) {
249 shift = 16; 295 shift = 16;
250 /* The instruction is 1 byte so far, read the next byte. */ 296 /* The instruction is 1 byte so far, read the next byte. */
@@ -252,8 +298,10 @@ static int emulate_insn(struct lg_cpu *cpu)
252 insn = lgread(cpu, physaddr + insnlen, u8); 298 insn = lgread(cpu, physaddr + insnlen, u8);
253 } 299 }
254 300
255 /* We can ignore the lower bit for the moment and decode the 4 opcodes 301 /*
256 * we need to emulate. */ 302 * We can ignore the lower bit for the moment and decode the 4 opcodes
303 * we need to emulate.
304 */
257 switch (insn & 0xFE) { 305 switch (insn & 0xFE) {
258 case 0xE4: /* in <next byte>,%al */ 306 case 0xE4: /* in <next byte>,%al */
259 insnlen += 2; 307 insnlen += 2;
@@ -274,9 +322,11 @@ static int emulate_insn(struct lg_cpu *cpu)
274 return 0; 322 return 0;
275 } 323 }
276 324
277 /* If it was an "IN" instruction, they expect the result to be read 325 /*
326 * If it was an "IN" instruction, they expect the result to be read
278 * into %eax, so we change %eax. We always return all-ones, which 327 * into %eax, so we change %eax. We always return all-ones, which
279 * traditionally means "there's nothing there". */ 328 * traditionally means "there's nothing there".
329 */
280 if (in) { 330 if (in) {
281 /* Lower bit tells is whether it's a 16 or 32 bit access */ 331 /* Lower bit tells is whether it's a 16 or 32 bit access */
282 if (insn & 0x1) 332 if (insn & 0x1)
@@ -290,7 +340,8 @@ static int emulate_insn(struct lg_cpu *cpu)
290 return 1; 340 return 1;
291} 341}
292 342
293/* Our hypercalls mechanism used to be based on direct software interrupts. 343/*
344 * Our hypercalls mechanism used to be based on direct software interrupts.
294 * After Anthony's "Refactor hypercall infrastructure" kvm patch, we decided to 345 * After Anthony's "Refactor hypercall infrastructure" kvm patch, we decided to
295 * change over to using kvm hypercalls. 346 * change over to using kvm hypercalls.
296 * 347 *
@@ -318,16 +369,20 @@ static int emulate_insn(struct lg_cpu *cpu)
318 */ 369 */
319static void rewrite_hypercall(struct lg_cpu *cpu) 370static void rewrite_hypercall(struct lg_cpu *cpu)
320{ 371{
321 /* This are the opcodes we use to patch the Guest. The opcode for "int 372 /*
373 * This are the opcodes we use to patch the Guest. The opcode for "int
322 * $0x1f" is "0xcd 0x1f" but vmcall instruction is 3 bytes long, so we 374 * $0x1f" is "0xcd 0x1f" but vmcall instruction is 3 bytes long, so we
323 * complete the sequence with a NOP (0x90). */ 375 * complete the sequence with a NOP (0x90).
376 */
324 u8 insn[3] = {0xcd, 0x1f, 0x90}; 377 u8 insn[3] = {0xcd, 0x1f, 0x90};
325 378
326 __lgwrite(cpu, guest_pa(cpu, cpu->regs->eip), insn, sizeof(insn)); 379 __lgwrite(cpu, guest_pa(cpu, cpu->regs->eip), insn, sizeof(insn));
327 /* The above write might have caused a copy of that page to be made 380 /*
381 * The above write might have caused a copy of that page to be made
328 * (if it was read-only). We need to make sure the Guest has 382 * (if it was read-only). We need to make sure the Guest has
329 * up-to-date pagetables. As this doesn't happen often, we can just 383 * up-to-date pagetables. As this doesn't happen often, we can just
330 * drop them all. */ 384 * drop them all.
385 */
331 guest_pagetable_clear_all(cpu); 386 guest_pagetable_clear_all(cpu);
332} 387}
333 388
@@ -335,9 +390,11 @@ static bool is_hypercall(struct lg_cpu *cpu)
335{ 390{
336 u8 insn[3]; 391 u8 insn[3];
337 392
338 /* This must be the Guest kernel trying to do something. 393 /*
394 * This must be the Guest kernel trying to do something.
339 * The bottom two bits of the CS segment register are the privilege 395 * The bottom two bits of the CS segment register are the privilege
340 * level. */ 396 * level.
397 */
341 if ((cpu->regs->cs & 3) != GUEST_PL) 398 if ((cpu->regs->cs & 3) != GUEST_PL)
342 return false; 399 return false;
343 400
@@ -351,86 +408,105 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
351{ 408{
352 switch (cpu->regs->trapnum) { 409 switch (cpu->regs->trapnum) {
353 case 13: /* We've intercepted a General Protection Fault. */ 410 case 13: /* We've intercepted a General Protection Fault. */
354 /* Check if this was one of those annoying IN or OUT 411 /*
412 * Check if this was one of those annoying IN or OUT
355 * instructions which we need to emulate. If so, we just go 413 * instructions which we need to emulate. If so, we just go
356 * back into the Guest after we've done it. */ 414 * back into the Guest after we've done it.
415 */
357 if (cpu->regs->errcode == 0) { 416 if (cpu->regs->errcode == 0) {
358 if (emulate_insn(cpu)) 417 if (emulate_insn(cpu))
359 return; 418 return;
360 } 419 }
361 /* If KVM is active, the vmcall instruction triggers a 420 /*
362 * General Protection Fault. Normally it triggers an 421 * If KVM is active, the vmcall instruction triggers a General
363 * invalid opcode fault (6): */ 422 * Protection Fault. Normally it triggers an invalid opcode
423 * fault (6):
424 */
364 case 6: 425 case 6:
365 /* We need to check if ring == GUEST_PL and 426 /*
366 * faulting instruction == vmcall. */ 427 * We need to check if ring == GUEST_PL and faulting
428 * instruction == vmcall.
429 */
367 if (is_hypercall(cpu)) { 430 if (is_hypercall(cpu)) {
368 rewrite_hypercall(cpu); 431 rewrite_hypercall(cpu);
369 return; 432 return;
370 } 433 }
371 break; 434 break;
372 case 14: /* We've intercepted a Page Fault. */ 435 case 14: /* We've intercepted a Page Fault. */
373 /* The Guest accessed a virtual address that wasn't mapped. 436 /*
437 * The Guest accessed a virtual address that wasn't mapped.
374 * This happens a lot: we don't actually set up most of the page 438 * This happens a lot: we don't actually set up most of the page
375 * tables for the Guest at all when we start: as it runs it asks 439 * tables for the Guest at all when we start: as it runs it asks
376 * for more and more, and we set them up as required. In this 440 * for more and more, and we set them up as required. In this
377 * case, we don't even tell the Guest that the fault happened. 441 * case, we don't even tell the Guest that the fault happened.
378 * 442 *
379 * The errcode tells whether this was a read or a write, and 443 * The errcode tells whether this was a read or a write, and
380 * whether kernel or userspace code. */ 444 * whether kernel or userspace code.
445 */
381 if (demand_page(cpu, cpu->arch.last_pagefault, 446 if (demand_page(cpu, cpu->arch.last_pagefault,
382 cpu->regs->errcode)) 447 cpu->regs->errcode))
383 return; 448 return;
384 449
385 /* OK, it's really not there (or not OK): the Guest needs to 450 /*
451 * OK, it's really not there (or not OK): the Guest needs to
386 * know. We write out the cr2 value so it knows where the 452 * know. We write out the cr2 value so it knows where the
387 * fault occurred. 453 * fault occurred.
388 * 454 *
389 * Note that if the Guest were really messed up, this could 455 * Note that if the Guest were really messed up, this could
390 * happen before it's done the LHCALL_LGUEST_INIT hypercall, so 456 * happen before it's done the LHCALL_LGUEST_INIT hypercall, so
391 * lg->lguest_data could be NULL */ 457 * lg->lguest_data could be NULL
458 */
392 if (cpu->lg->lguest_data && 459 if (cpu->lg->lguest_data &&
393 put_user(cpu->arch.last_pagefault, 460 put_user(cpu->arch.last_pagefault,
394 &cpu->lg->lguest_data->cr2)) 461 &cpu->lg->lguest_data->cr2))
395 kill_guest(cpu, "Writing cr2"); 462 kill_guest(cpu, "Writing cr2");
396 break; 463 break;
397 case 7: /* We've intercepted a Device Not Available fault. */ 464 case 7: /* We've intercepted a Device Not Available fault. */
398 /* If the Guest doesn't want to know, we already restored the 465 /*
399 * Floating Point Unit, so we just continue without telling 466 * If the Guest doesn't want to know, we already restored the
400 * it. */ 467 * Floating Point Unit, so we just continue without telling it.
468 */
401 if (!cpu->ts) 469 if (!cpu->ts)
402 return; 470 return;
403 break; 471 break;
404 case 32 ... 255: 472 case 32 ... 255:
405 /* These values mean a real interrupt occurred, in which case 473 /*
474 * These values mean a real interrupt occurred, in which case
406 * the Host handler has already been run. We just do a 475 * the Host handler has already been run. We just do a
407 * friendly check if another process should now be run, then 476 * friendly check if another process should now be run, then
408 * return to run the Guest again */ 477 * return to run the Guest again
478 */
409 cond_resched(); 479 cond_resched();
410 return; 480 return;
411 case LGUEST_TRAP_ENTRY: 481 case LGUEST_TRAP_ENTRY:
412 /* Our 'struct hcall_args' maps directly over our regs: we set 482 /*
413 * up the pointer now to indicate a hypercall is pending. */ 483 * Our 'struct hcall_args' maps directly over our regs: we set
484 * up the pointer now to indicate a hypercall is pending.
485 */
414 cpu->hcall = (struct hcall_args *)cpu->regs; 486 cpu->hcall = (struct hcall_args *)cpu->regs;
415 return; 487 return;
416 } 488 }
417 489
418 /* We didn't handle the trap, so it needs to go to the Guest. */ 490 /* We didn't handle the trap, so it needs to go to the Guest. */
419 if (!deliver_trap(cpu, cpu->regs->trapnum)) 491 if (!deliver_trap(cpu, cpu->regs->trapnum))
420 /* If the Guest doesn't have a handler (either it hasn't 492 /*
493 * If the Guest doesn't have a handler (either it hasn't
421 * registered any yet, or it's one of the faults we don't let 494 * registered any yet, or it's one of the faults we don't let
422 * it handle), it dies with this cryptic error message. */ 495 * it handle), it dies with this cryptic error message.
496 */
423 kill_guest(cpu, "unhandled trap %li at %#lx (%#lx)", 497 kill_guest(cpu, "unhandled trap %li at %#lx (%#lx)",
424 cpu->regs->trapnum, cpu->regs->eip, 498 cpu->regs->trapnum, cpu->regs->eip,
425 cpu->regs->trapnum == 14 ? cpu->arch.last_pagefault 499 cpu->regs->trapnum == 14 ? cpu->arch.last_pagefault
426 : cpu->regs->errcode); 500 : cpu->regs->errcode);
427} 501}
428 502
429/* Now we can look at each of the routines this calls, in increasing order of 503/*
504 * Now we can look at each of the routines this calls, in increasing order of
430 * complexity: do_hypercalls(), emulate_insn(), maybe_do_interrupt(), 505 * complexity: do_hypercalls(), emulate_insn(), maybe_do_interrupt(),
431 * deliver_trap() and demand_page(). After all those, we'll be ready to 506 * deliver_trap() and demand_page(). After all those, we'll be ready to
432 * examine the Switcher, and our philosophical understanding of the Host/Guest 507 * examine the Switcher, and our philosophical understanding of the Host/Guest
433 * duality will be complete. :*/ 508 * duality will be complete.
509:*/
434static void adjust_pge(void *on) 510static void adjust_pge(void *on)
435{ 511{
436 if (on) 512 if (on)
@@ -439,13 +515,16 @@ static void adjust_pge(void *on)
439 write_cr4(read_cr4() & ~X86_CR4_PGE); 515 write_cr4(read_cr4() & ~X86_CR4_PGE);
440} 516}
441 517
442/*H:020 Now the Switcher is mapped and every thing else is ready, we need to do 518/*H:020
443 * some more i386-specific initialization. */ 519 * Now the Switcher is mapped and every thing else is ready, we need to do
520 * some more i386-specific initialization.
521 */
444void __init lguest_arch_host_init(void) 522void __init lguest_arch_host_init(void)
445{ 523{
446 int i; 524 int i;
447 525
448 /* Most of the i386/switcher.S doesn't care that it's been moved; on 526 /*
527 * Most of the i386/switcher.S doesn't care that it's been moved; on
449 * Intel, jumps are relative, and it doesn't access any references to 528 * Intel, jumps are relative, and it doesn't access any references to
450 * external code or data. 529 * external code or data.
451 * 530 *
@@ -453,7 +532,8 @@ void __init lguest_arch_host_init(void)
453 * addresses are placed in a table (default_idt_entries), so we need to 532 * addresses are placed in a table (default_idt_entries), so we need to
454 * update the table with the new addresses. switcher_offset() is a 533 * update the table with the new addresses. switcher_offset() is a
455 * convenience function which returns the distance between the 534 * convenience function which returns the distance between the
456 * compiled-in switcher code and the high-mapped copy we just made. */ 535 * compiled-in switcher code and the high-mapped copy we just made.
536 */
457 for (i = 0; i < IDT_ENTRIES; i++) 537 for (i = 0; i < IDT_ENTRIES; i++)
458 default_idt_entries[i] += switcher_offset(); 538 default_idt_entries[i] += switcher_offset();
459 539
@@ -468,63 +548,81 @@ void __init lguest_arch_host_init(void)
468 for_each_possible_cpu(i) { 548 for_each_possible_cpu(i) {
469 /* lguest_pages() returns this CPU's two pages. */ 549 /* lguest_pages() returns this CPU's two pages. */
470 struct lguest_pages *pages = lguest_pages(i); 550 struct lguest_pages *pages = lguest_pages(i);
471 /* This is a convenience pointer to make the code fit one 551 /* This is a convenience pointer to make the code neater. */
472 * statement to a line. */
473 struct lguest_ro_state *state = &pages->state; 552 struct lguest_ro_state *state = &pages->state;
474 553
475 /* The Global Descriptor Table: the Host has a different one 554 /*
555 * The Global Descriptor Table: the Host has a different one
476 * for each CPU. We keep a descriptor for the GDT which says 556 * for each CPU. We keep a descriptor for the GDT which says
477 * where it is and how big it is (the size is actually the last 557 * where it is and how big it is (the size is actually the last
478 * byte, not the size, hence the "-1"). */ 558 * byte, not the size, hence the "-1").
559 */
479 state->host_gdt_desc.size = GDT_SIZE-1; 560 state->host_gdt_desc.size = GDT_SIZE-1;
480 state->host_gdt_desc.address = (long)get_cpu_gdt_table(i); 561 state->host_gdt_desc.address = (long)get_cpu_gdt_table(i);
481 562
482 /* All CPUs on the Host use the same Interrupt Descriptor 563 /*
564 * All CPUs on the Host use the same Interrupt Descriptor
483 * Table, so we just use store_idt(), which gets this CPU's IDT 565 * Table, so we just use store_idt(), which gets this CPU's IDT
484 * descriptor. */ 566 * descriptor.
567 */
485 store_idt(&state->host_idt_desc); 568 store_idt(&state->host_idt_desc);
486 569
487 /* The descriptors for the Guest's GDT and IDT can be filled 570 /*
571 * The descriptors for the Guest's GDT and IDT can be filled
488 * out now, too. We copy the GDT & IDT into ->guest_gdt and 572 * out now, too. We copy the GDT & IDT into ->guest_gdt and
489 * ->guest_idt before actually running the Guest. */ 573 * ->guest_idt before actually running the Guest.
574 */
490 state->guest_idt_desc.size = sizeof(state->guest_idt)-1; 575 state->guest_idt_desc.size = sizeof(state->guest_idt)-1;
491 state->guest_idt_desc.address = (long)&state->guest_idt; 576 state->guest_idt_desc.address = (long)&state->guest_idt;
492 state->guest_gdt_desc.size = sizeof(state->guest_gdt)-1; 577 state->guest_gdt_desc.size = sizeof(state->guest_gdt)-1;
493 state->guest_gdt_desc.address = (long)&state->guest_gdt; 578 state->guest_gdt_desc.address = (long)&state->guest_gdt;
494 579
495 /* We know where we want the stack to be when the Guest enters 580 /*
581 * We know where we want the stack to be when the Guest enters
496 * the Switcher: in pages->regs. The stack grows upwards, so 582 * the Switcher: in pages->regs. The stack grows upwards, so
497 * we start it at the end of that structure. */ 583 * we start it at the end of that structure.
584 */
498 state->guest_tss.sp0 = (long)(&pages->regs + 1); 585 state->guest_tss.sp0 = (long)(&pages->regs + 1);
499 /* And this is the GDT entry to use for the stack: we keep a 586 /*
500 * couple of special LGUEST entries. */ 587 * And this is the GDT entry to use for the stack: we keep a
588 * couple of special LGUEST entries.
589 */
501 state->guest_tss.ss0 = LGUEST_DS; 590 state->guest_tss.ss0 = LGUEST_DS;
502 591
503 /* x86 can have a finegrained bitmap which indicates what I/O 592 /*
593 * x86 can have a finegrained bitmap which indicates what I/O
504 * ports the process can use. We set it to the end of our 594 * ports the process can use. We set it to the end of our
505 * structure, meaning "none". */ 595 * structure, meaning "none".
596 */
506 state->guest_tss.io_bitmap_base = sizeof(state->guest_tss); 597 state->guest_tss.io_bitmap_base = sizeof(state->guest_tss);
507 598
508 /* Some GDT entries are the same across all Guests, so we can 599 /*
509 * set them up now. */ 600 * Some GDT entries are the same across all Guests, so we can
601 * set them up now.
602 */
510 setup_default_gdt_entries(state); 603 setup_default_gdt_entries(state);
511 /* Most IDT entries are the same for all Guests, too.*/ 604 /* Most IDT entries are the same for all Guests, too.*/
512 setup_default_idt_entries(state, default_idt_entries); 605 setup_default_idt_entries(state, default_idt_entries);
513 606
514 /* The Host needs to be able to use the LGUEST segments on this 607 /*
515 * CPU, too, so put them in the Host GDT. */ 608 * The Host needs to be able to use the LGUEST segments on this
609 * CPU, too, so put them in the Host GDT.
610 */
516 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT; 611 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_CS] = FULL_EXEC_SEGMENT;
517 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT; 612 get_cpu_gdt_table(i)[GDT_ENTRY_LGUEST_DS] = FULL_SEGMENT;
518 } 613 }
519 614
520 /* In the Switcher, we want the %cs segment register to use the 615 /*
616 * In the Switcher, we want the %cs segment register to use the
521 * LGUEST_CS GDT entry: we've put that in the Host and Guest GDTs, so 617 * LGUEST_CS GDT entry: we've put that in the Host and Guest GDTs, so
522 * it will be undisturbed when we switch. To change %cs and jump we 618 * it will be undisturbed when we switch. To change %cs and jump we
523 * need this structure to feed to Intel's "lcall" instruction. */ 619 * need this structure to feed to Intel's "lcall" instruction.
620 */
524 lguest_entry.offset = (long)switch_to_guest + switcher_offset(); 621 lguest_entry.offset = (long)switch_to_guest + switcher_offset();
525 lguest_entry.segment = LGUEST_CS; 622 lguest_entry.segment = LGUEST_CS;
526 623
527 /* Finally, we need to turn off "Page Global Enable". PGE is an 624 /*
625 * Finally, we need to turn off "Page Global Enable". PGE is an
528 * optimization where page table entries are specially marked to show 626 * optimization where page table entries are specially marked to show
529 * they never change. The Host kernel marks all the kernel pages this 627 * they never change. The Host kernel marks all the kernel pages this
530 * way because it's always present, even when userspace is running. 628 * way because it's always present, even when userspace is running.
@@ -534,16 +632,21 @@ void __init lguest_arch_host_init(void)
534 * you'll get really weird bugs that you'll chase for two days. 632 * you'll get really weird bugs that you'll chase for two days.
535 * 633 *
536 * I used to turn PGE off every time we switched to the Guest and back 634 * I used to turn PGE off every time we switched to the Guest and back
537 * on when we return, but that slowed the Switcher down noticibly. */ 635 * on when we return, but that slowed the Switcher down noticibly.
636 */
538 637
539 /* We don't need the complexity of CPUs coming and going while we're 638 /*
540 * doing this. */ 639 * We don't need the complexity of CPUs coming and going while we're
640 * doing this.
641 */
541 get_online_cpus(); 642 get_online_cpus();
542 if (cpu_has_pge) { /* We have a broader idea of "global". */ 643 if (cpu_has_pge) { /* We have a broader idea of "global". */
543 /* Remember that this was originally set (for cleanup). */ 644 /* Remember that this was originally set (for cleanup). */
544 cpu_had_pge = 1; 645 cpu_had_pge = 1;
545 /* adjust_pge is a helper function which sets or unsets the PGE 646 /*
546 * bit on its CPU, depending on the argument (0 == unset). */ 647 * adjust_pge is a helper function which sets or unsets the PGE
648 * bit on its CPU, depending on the argument (0 == unset).
649 */
547 on_each_cpu(adjust_pge, (void *)0, 1); 650 on_each_cpu(adjust_pge, (void *)0, 1);
548 /* Turn off the feature in the global feature set. */ 651 /* Turn off the feature in the global feature set. */
549 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PGE); 652 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PGE);
@@ -590,26 +693,32 @@ int lguest_arch_init_hypercalls(struct lg_cpu *cpu)
590{ 693{
591 u32 tsc_speed; 694 u32 tsc_speed;
592 695
593 /* The pointer to the Guest's "struct lguest_data" is the only argument. 696 /*
594 * We check that address now. */ 697 * The pointer to the Guest's "struct lguest_data" is the only argument.
698 * We check that address now.
699 */
595 if (!lguest_address_ok(cpu->lg, cpu->hcall->arg1, 700 if (!lguest_address_ok(cpu->lg, cpu->hcall->arg1,
596 sizeof(*cpu->lg->lguest_data))) 701 sizeof(*cpu->lg->lguest_data)))
597 return -EFAULT; 702 return -EFAULT;
598 703
599 /* Having checked it, we simply set lg->lguest_data to point straight 704 /*
705 * Having checked it, we simply set lg->lguest_data to point straight
600 * into the Launcher's memory at the right place and then use 706 * into the Launcher's memory at the right place and then use
601 * copy_to_user/from_user from now on, instead of lgread/write. I put 707 * copy_to_user/from_user from now on, instead of lgread/write. I put
602 * this in to show that I'm not immune to writing stupid 708 * this in to show that I'm not immune to writing stupid
603 * optimizations. */ 709 * optimizations.
710 */
604 cpu->lg->lguest_data = cpu->lg->mem_base + cpu->hcall->arg1; 711 cpu->lg->lguest_data = cpu->lg->mem_base + cpu->hcall->arg1;
605 712
606 /* We insist that the Time Stamp Counter exist and doesn't change with 713 /*
714 * We insist that the Time Stamp Counter exist and doesn't change with
607 * cpu frequency. Some devious chip manufacturers decided that TSC 715 * cpu frequency. Some devious chip manufacturers decided that TSC
608 * changes could be handled in software. I decided that time going 716 * changes could be handled in software. I decided that time going
609 * backwards might be good for benchmarks, but it's bad for users. 717 * backwards might be good for benchmarks, but it's bad for users.
610 * 718 *
611 * We also insist that the TSC be stable: the kernel detects unreliable 719 * We also insist that the TSC be stable: the kernel detects unreliable
612 * TSCs for its own purposes, and we use that here. */ 720 * TSCs for its own purposes, and we use that here.
721 */
613 if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) && !check_tsc_unstable()) 722 if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) && !check_tsc_unstable())
614 tsc_speed = tsc_khz; 723 tsc_speed = tsc_khz;
615 else 724 else
@@ -625,38 +734,47 @@ int lguest_arch_init_hypercalls(struct lg_cpu *cpu)
625} 734}
626/*:*/ 735/*:*/
627 736
628/*L:030 lguest_arch_setup_regs() 737/*L:030
738 * lguest_arch_setup_regs()
629 * 739 *
630 * Most of the Guest's registers are left alone: we used get_zeroed_page() to 740 * Most of the Guest's registers are left alone: we used get_zeroed_page() to
631 * allocate the structure, so they will be 0. */ 741 * allocate the structure, so they will be 0.
742 */
632void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start) 743void lguest_arch_setup_regs(struct lg_cpu *cpu, unsigned long start)
633{ 744{
634 struct lguest_regs *regs = cpu->regs; 745 struct lguest_regs *regs = cpu->regs;
635 746
636 /* There are four "segment" registers which the Guest needs to boot: 747 /*
748 * There are four "segment" registers which the Guest needs to boot:
637 * The "code segment" register (cs) refers to the kernel code segment 749 * The "code segment" register (cs) refers to the kernel code segment
638 * __KERNEL_CS, and the "data", "extra" and "stack" segment registers 750 * __KERNEL_CS, and the "data", "extra" and "stack" segment registers
639 * refer to the kernel data segment __KERNEL_DS. 751 * refer to the kernel data segment __KERNEL_DS.
640 * 752 *
641 * The privilege level is packed into the lower bits. The Guest runs 753 * The privilege level is packed into the lower bits. The Guest runs
642 * at privilege level 1 (GUEST_PL).*/ 754 * at privilege level 1 (GUEST_PL).
755 */
643 regs->ds = regs->es = regs->ss = __KERNEL_DS|GUEST_PL; 756 regs->ds = regs->es = regs->ss = __KERNEL_DS|GUEST_PL;
644 regs->cs = __KERNEL_CS|GUEST_PL; 757 regs->cs = __KERNEL_CS|GUEST_PL;
645 758
646 /* The "eflags" register contains miscellaneous flags. Bit 1 (0x002) 759 /*
760 * The "eflags" register contains miscellaneous flags. Bit 1 (0x002)
647 * is supposed to always be "1". Bit 9 (0x200) controls whether 761 * is supposed to always be "1". Bit 9 (0x200) controls whether
648 * interrupts are enabled. We always leave interrupts enabled while 762 * interrupts are enabled. We always leave interrupts enabled while
649 * running the Guest. */ 763 * running the Guest.
764 */
650 regs->eflags = X86_EFLAGS_IF | 0x2; 765 regs->eflags = X86_EFLAGS_IF | 0x2;
651 766
652 /* The "Extended Instruction Pointer" register says where the Guest is 767 /*
653 * running. */ 768 * The "Extended Instruction Pointer" register says where the Guest is
769 * running.
770 */
654 regs->eip = start; 771 regs->eip = start;
655 772
656 /* %esi points to our boot information, at physical address 0, so don't 773 /*
657 * touch it. */ 774 * %esi points to our boot information, at physical address 0, so don't
775 * touch it.
776 */
658 777
659 /* There are a couple of GDT entries the Guest expects when first 778 /* There are a couple of GDT entries the Guest expects at boot. */
660 * booting. */
661 setup_guest_gdt(cpu); 779 setup_guest_gdt(cpu);
662} 780}
diff --git a/drivers/lguest/x86/switcher_32.S b/drivers/lguest/x86/switcher_32.S
index 3fc15318a80f..40634b0db9f7 100644
--- a/drivers/lguest/x86/switcher_32.S
+++ b/drivers/lguest/x86/switcher_32.S
@@ -1,12 +1,15 @@
1/*P:900 This is the Switcher: code which sits at 0xFFC00000 astride both the 1/*P:900
2 * Host and Guest to do the low-level Guest<->Host switch. It is as simple as 2 * This is the Switcher: code which sits at 0xFFC00000 (or 0xFFE00000) astride
3 * it can be made, but it's naturally very specific to x86. 3 * both the Host and Guest to do the low-level Guest<->Host switch. It is as
4 * simple as it can be made, but it's naturally very specific to x86.
4 * 5 *
5 * You have now completed Preparation. If this has whet your appetite; if you 6 * You have now completed Preparation. If this has whet your appetite; if you
6 * are feeling invigorated and refreshed then the next, more challenging stage 7 * are feeling invigorated and refreshed then the next, more challenging stage
7 * can be found in "make Guest". :*/ 8 * can be found in "make Guest".
9 :*/
8 10
9/*M:012 Lguest is meant to be simple: my rule of thumb is that 1% more LOC must 11/*M:012
12 * Lguest is meant to be simple: my rule of thumb is that 1% more LOC must
10 * gain at least 1% more performance. Since neither LOC nor performance can be 13 * gain at least 1% more performance. Since neither LOC nor performance can be
11 * measured beforehand, it generally means implementing a feature then deciding 14 * measured beforehand, it generally means implementing a feature then deciding
12 * if it's worth it. And once it's implemented, who can say no? 15 * if it's worth it. And once it's implemented, who can say no?
@@ -31,11 +34,14 @@
31 * Host (which is actually really easy). 34 * Host (which is actually really easy).
32 * 35 *
33 * Two questions remain. Would the performance gain outweigh the complexity? 36 * Two questions remain. Would the performance gain outweigh the complexity?
34 * And who would write the verse documenting it? :*/ 37 * And who would write the verse documenting it?
38:*/
35 39
36/*M:011 Lguest64 handles NMI. This gave me NMI envy (until I looked at their 40/*M:011
41 * Lguest64 handles NMI. This gave me NMI envy (until I looked at their
37 * code). It's worth doing though, since it would let us use oprofile in the 42 * code). It's worth doing though, since it would let us use oprofile in the
38 * Host when a Guest is running. :*/ 43 * Host when a Guest is running.
44:*/
39 45
40/*S:100 46/*S:100
41 * Welcome to the Switcher itself! 47 * Welcome to the Switcher itself!
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 529e2ba505c3..ed1038164019 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1318,7 +1318,7 @@ static int crypt_iterate_devices(struct dm_target *ti,
1318{ 1318{
1319 struct crypt_config *cc = ti->private; 1319 struct crypt_config *cc = ti->private;
1320 1320
1321 return fn(ti, cc->dev, cc->start, data); 1321 return fn(ti, cc->dev, cc->start, ti->len, data);
1322} 1322}
1323 1323
1324static struct target_type crypt_target = { 1324static struct target_type crypt_target = {
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index 4e5b843cd4d7..ebe7381f47c8 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -324,12 +324,12 @@ static int delay_iterate_devices(struct dm_target *ti,
324 struct delay_c *dc = ti->private; 324 struct delay_c *dc = ti->private;
325 int ret = 0; 325 int ret = 0;
326 326
327 ret = fn(ti, dc->dev_read, dc->start_read, data); 327 ret = fn(ti, dc->dev_read, dc->start_read, ti->len, data);
328 if (ret) 328 if (ret)
329 goto out; 329 goto out;
330 330
331 if (dc->dev_write) 331 if (dc->dev_write)
332 ret = fn(ti, dc->dev_write, dc->start_write, data); 332 ret = fn(ti, dc->dev_write, dc->start_write, ti->len, data);
333 333
334out: 334out:
335 return ret; 335 return ret;
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 9184b6deb868..82f7d6e6b1ea 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -139,7 +139,7 @@ static int linear_iterate_devices(struct dm_target *ti,
139{ 139{
140 struct linear_c *lc = ti->private; 140 struct linear_c *lc = ti->private;
141 141
142 return fn(ti, lc->dev, lc->start, data); 142 return fn(ti, lc->dev, lc->start, ti->len, data);
143} 143}
144 144
145static struct target_type linear_target = { 145static struct target_type linear_target = {
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index c70604a20897..6f0d90d4a541 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1453,7 +1453,7 @@ static int multipath_iterate_devices(struct dm_target *ti,
1453 1453
1454 list_for_each_entry(pg, &m->priority_groups, list) { 1454 list_for_each_entry(pg, &m->priority_groups, list) {
1455 list_for_each_entry(p, &pg->pgpaths, list) { 1455 list_for_each_entry(p, &pg->pgpaths, list) {
1456 ret = fn(ti, p->path.dev, ti->begin, data); 1456 ret = fn(ti, p->path.dev, ti->begin, ti->len, data);
1457 if (ret) 1457 if (ret)
1458 goto out; 1458 goto out;
1459 } 1459 }
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index ce8868c768cc..9726577cde49 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -638,6 +638,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes)
638 spin_lock_irq(&ms->lock); 638 spin_lock_irq(&ms->lock);
639 bio_list_merge(&ms->writes, &requeue); 639 bio_list_merge(&ms->writes, &requeue);
640 spin_unlock_irq(&ms->lock); 640 spin_unlock_irq(&ms->lock);
641 delayed_wake(ms);
641 } 642 }
642 643
643 /* 644 /*
@@ -1292,7 +1293,7 @@ static int mirror_iterate_devices(struct dm_target *ti,
1292 1293
1293 for (i = 0; !ret && i < ms->nr_mirrors; i++) 1294 for (i = 0; !ret && i < ms->nr_mirrors; i++)
1294 ret = fn(ti, ms->mirror[i].dev, 1295 ret = fn(ti, ms->mirror[i].dev,
1295 ms->mirror[i].offset, data); 1296 ms->mirror[i].offset, ti->len, data);
1296 1297
1297 return ret; 1298 return ret;
1298} 1299}
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index b240e85ae39a..4e0e5937e42a 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -320,10 +320,11 @@ static int stripe_iterate_devices(struct dm_target *ti,
320 int ret = 0; 320 int ret = 0;
321 unsigned i = 0; 321 unsigned i = 0;
322 322
323 do 323 do {
324 ret = fn(ti, sc->stripe[i].dev, 324 ret = fn(ti, sc->stripe[i].dev,
325 sc->stripe[i].physical_start, data); 325 sc->stripe[i].physical_start,
326 while (!ret && ++i < sc->stripes); 326 sc->stripe_width, data);
327 } while (!ret && ++i < sc->stripes);
327 328
328 return ret; 329 return ret;
329} 330}
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 2cba557d9e61..d952b3441913 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -346,7 +346,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
346 * If possible, this checks an area of a destination device is valid. 346 * If possible, this checks an area of a destination device is valid.
347 */ 347 */
348static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev, 348static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
349 sector_t start, void *data) 349 sector_t start, sector_t len, void *data)
350{ 350{
351 struct queue_limits *limits = data; 351 struct queue_limits *limits = data;
352 struct block_device *bdev = dev->bdev; 352 struct block_device *bdev = dev->bdev;
@@ -359,7 +359,7 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
359 if (!dev_size) 359 if (!dev_size)
360 return 1; 360 return 1;
361 361
362 if ((start >= dev_size) || (start + ti->len > dev_size)) { 362 if ((start >= dev_size) || (start + len > dev_size)) {
363 DMWARN("%s: %s too small for target", 363 DMWARN("%s: %s too small for target",
364 dm_device_name(ti->table->md), bdevname(bdev, b)); 364 dm_device_name(ti->table->md), bdevname(bdev, b));
365 return 0; 365 return 0;
@@ -377,11 +377,11 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
377 return 0; 377 return 0;
378 } 378 }
379 379
380 if (ti->len & (logical_block_size_sectors - 1)) { 380 if (len & (logical_block_size_sectors - 1)) {
381 DMWARN("%s: len=%llu not aligned to h/w " 381 DMWARN("%s: len=%llu not aligned to h/w "
382 "logical block size %hu of %s", 382 "logical block size %hu of %s",
383 dm_device_name(ti->table->md), 383 dm_device_name(ti->table->md),
384 (unsigned long long)ti->len, 384 (unsigned long long)len,
385 limits->logical_block_size, bdevname(bdev, b)); 385 limits->logical_block_size, bdevname(bdev, b));
386 return 0; 386 return 0;
387 } 387 }
@@ -482,7 +482,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
482#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r)) 482#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
483 483
484int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, 484int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
485 sector_t start, void *data) 485 sector_t start, sector_t len, void *data)
486{ 486{
487 struct queue_limits *limits = data; 487 struct queue_limits *limits = data;
488 struct block_device *bdev = dev->bdev; 488 struct block_device *bdev = dev->bdev;
@@ -830,11 +830,6 @@ unsigned dm_table_get_type(struct dm_table *t)
830 return t->type; 830 return t->type;
831} 831}
832 832
833bool dm_table_bio_based(struct dm_table *t)
834{
835 return dm_table_get_type(t) == DM_TYPE_BIO_BASED;
836}
837
838bool dm_table_request_based(struct dm_table *t) 833bool dm_table_request_based(struct dm_table *t)
839{ 834{
840 return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED; 835 return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 9acd54a5cffb..8a311ea0d441 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2203,16 +2203,6 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table)
2203 goto out; 2203 goto out;
2204 } 2204 }
2205 2205
2206 /*
2207 * It is enought that blk_queue_ordered() is called only once when
2208 * the first bio-based table is bound.
2209 *
2210 * This setting should be moved to alloc_dev() when request-based dm
2211 * supports barrier.
2212 */
2213 if (!md->map && dm_table_bio_based(table))
2214 blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN, NULL);
2215
2216 __unbind(md); 2206 __unbind(md);
2217 r = __bind(md, table, &limits); 2207 r = __bind(md, table, &limits);
2218 2208
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 23278ae80f08..a7663eba17e2 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -61,7 +61,6 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits);
61int dm_table_any_busy_target(struct dm_table *t); 61int dm_table_any_busy_target(struct dm_table *t);
62int dm_table_set_type(struct dm_table *t); 62int dm_table_set_type(struct dm_table *t);
63unsigned dm_table_get_type(struct dm_table *t); 63unsigned dm_table_get_type(struct dm_table *t);
64bool dm_table_bio_based(struct dm_table *t);
65bool dm_table_request_based(struct dm_table *t); 64bool dm_table_request_based(struct dm_table *t);
66int dm_table_alloc_md_mempools(struct dm_table *t); 65int dm_table_alloc_md_mempools(struct dm_table *t);
67void dm_table_free_md_mempools(struct dm_table *t); 66void dm_table_free_md_mempools(struct dm_table *t);
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index efb4a6c2b57a..9a6307a347b2 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -20,8 +20,14 @@
20#include "tuner-simple.h" 20#include "tuner-simple.h"
21#include "stv0297.h" 21#include "stv0297.h"
22 22
23
24/* Can we use the specified front-end? Remember that if we are compiled
25 * into the kernel we can't call code that's in modules. */
26#define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
27 (defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE)))
28
23/* lnb control */ 29/* lnb control */
24#if defined(CONFIG_DVB_MT312_MODULE) || defined(CONFIG_DVB_STV0299_MODULE) 30#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
25static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) 31static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
26{ 32{
27 struct flexcop_device *fc = fe->dvb->priv; 33 struct flexcop_device *fc = fe->dvb->priv;
@@ -49,8 +55,7 @@ static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage
49} 55}
50#endif 56#endif
51 57
52#if defined(CONFIG_DVB_S5H1420_MODULE) || defined(CONFIG_DVB_STV0299_MODULE) \ 58#if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312)
53 || defined(CONFIG_DVB_MT312_MODULE)
54static int flexcop_sleep(struct dvb_frontend* fe) 59static int flexcop_sleep(struct dvb_frontend* fe)
55{ 60{
56 struct flexcop_device *fc = fe->dvb->priv; 61 struct flexcop_device *fc = fe->dvb->priv;
@@ -61,7 +66,7 @@ static int flexcop_sleep(struct dvb_frontend* fe)
61#endif 66#endif
62 67
63/* SkyStar2 DVB-S rev 2.3 */ 68/* SkyStar2 DVB-S rev 2.3 */
64#if defined(CONFIG_DVB_MT312_MODULE) 69#if FE_SUPPORTED(MT312)
65static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) 70static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
66{ 71{
67/* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */ 72/* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */
@@ -193,10 +198,12 @@ static int skystar2_rev23_attach(struct flexcop_device *fc,
193 } 198 }
194 return 0; 199 return 0;
195} 200}
201#else
202#define skystar2_rev23_attach NULL
196#endif 203#endif
197 204
198/* SkyStar2 DVB-S rev 2.6 */ 205/* SkyStar2 DVB-S rev 2.6 */
199#if defined(CONFIG_DVB_STV0299_MODULE) 206#if FE_SUPPORTED(STV0299)
200static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe, 207static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe,
201 u32 srate, u32 ratio) 208 u32 srate, u32 ratio)
202{ 209{
@@ -321,10 +328,12 @@ static int skystar2_rev26_attach(struct flexcop_device *fc,
321 } 328 }
322 return 0; 329 return 0;
323} 330}
331#else
332#define skystar2_rev26_attach NULL
324#endif 333#endif
325 334
326/* SkyStar2 DVB-S rev 2.7 */ 335/* SkyStar2 DVB-S rev 2.7 */
327#if defined(CONFIG_DVB_S5H1420_MODULE) 336#if FE_SUPPORTED(S5H1420) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_ITD1000)
328static struct s5h1420_config skystar2_rev2_7_s5h1420_config = { 337static struct s5h1420_config skystar2_rev2_7_s5h1420_config = {
329 .demod_address = 0x53, 338 .demod_address = 0x53,
330 .invert = 1, 339 .invert = 1,
@@ -385,10 +394,12 @@ fail:
385 fc->fc_i2c_adap[0].no_base_addr = 0; 394 fc->fc_i2c_adap[0].no_base_addr = 0;
386 return 0; 395 return 0;
387} 396}
397#else
398#define skystar2_rev27_attach NULL
388#endif 399#endif
389 400
390/* SkyStar2 rev 2.8 */ 401/* SkyStar2 rev 2.8 */
391#if defined(CONFIG_DVB_CX24123_MODULE) 402#if FE_SUPPORTED(CX24123) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_CX24113)
392static struct cx24123_config skystar2_rev2_8_cx24123_config = { 403static struct cx24123_config skystar2_rev2_8_cx24123_config = {
393 .demod_address = 0x55, 404 .demod_address = 0x55,
394 .dont_use_pll = 1, 405 .dont_use_pll = 1,
@@ -433,10 +444,12 @@ static int skystar2_rev28_attach(struct flexcop_device *fc,
433 * IR-receiver (PIC16F818) - but the card has no input for that ??? */ 444 * IR-receiver (PIC16F818) - but the card has no input for that ??? */
434 return 1; 445 return 1;
435} 446}
447#else
448#define skystar2_rev28_attach NULL
436#endif 449#endif
437 450
438/* AirStar DVB-T */ 451/* AirStar DVB-T */
439#if defined(CONFIG_DVB_MT352_MODULE) 452#if FE_SUPPORTED(MT352)
440static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe) 453static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe)
441{ 454{
442 static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d }; 455 static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d };
@@ -495,10 +508,12 @@ static int airstar_dvbt_attach(struct flexcop_device *fc,
495 } 508 }
496 return 0; 509 return 0;
497} 510}
511#else
512#define airstar_dvbt_attach NULL
498#endif 513#endif
499 514
500/* AirStar ATSC 1st generation */ 515/* AirStar ATSC 1st generation */
501#if defined(CONFIG_DVB_BCM3510_MODULE) 516#if FE_SUPPORTED(BCM3510)
502static int flexcop_fe_request_firmware(struct dvb_frontend *fe, 517static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
503 const struct firmware **fw, char* name) 518 const struct firmware **fw, char* name)
504{ 519{
@@ -517,10 +532,12 @@ static int airstar_atsc1_attach(struct flexcop_device *fc,
517 fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, i2c); 532 fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, i2c);
518 return fc->fe != NULL; 533 return fc->fe != NULL;
519} 534}
535#else
536#define airstar_atsc1_attach NULL
520#endif 537#endif
521 538
522/* AirStar ATSC 2nd generation */ 539/* AirStar ATSC 2nd generation */
523#if defined(CONFIG_DVB_NXT200X_MODULE) 540#if FE_SUPPORTED(NXT200X) && FE_SUPPORTED(PLL)
524static struct nxt200x_config samsung_tbmv_config = { 541static struct nxt200x_config samsung_tbmv_config = {
525 .demod_address = 0x0a, 542 .demod_address = 0x0a,
526}; 543};
@@ -535,10 +552,12 @@ static int airstar_atsc2_attach(struct flexcop_device *fc,
535 return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, 552 return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL,
536 DVB_PLL_SAMSUNG_TBMV); 553 DVB_PLL_SAMSUNG_TBMV);
537} 554}
555#else
556#define airstar_atsc2_attach NULL
538#endif 557#endif
539 558
540/* AirStar ATSC 3rd generation */ 559/* AirStar ATSC 3rd generation */
541#if defined(CONFIG_DVB_LGDT330X_MODULE) 560#if FE_SUPPORTED(LGDT330X)
542static struct lgdt330x_config air2pc_atsc_hd5000_config = { 561static struct lgdt330x_config air2pc_atsc_hd5000_config = {
543 .demod_address = 0x59, 562 .demod_address = 0x59,
544 .demod_chip = LGDT3303, 563 .demod_chip = LGDT3303,
@@ -556,10 +575,12 @@ static int airstar_atsc3_attach(struct flexcop_device *fc,
556 return !!dvb_attach(simple_tuner_attach, fc->fe, i2c, 0x61, 575 return !!dvb_attach(simple_tuner_attach, fc->fe, i2c, 0x61,
557 TUNER_LG_TDVS_H06XF); 576 TUNER_LG_TDVS_H06XF);
558} 577}
578#else
579#define airstar_atsc3_attach NULL
559#endif 580#endif
560 581
561/* CableStar2 DVB-C */ 582/* CableStar2 DVB-C */
562#if defined(CONFIG_DVB_STV0297_MODULE) 583#if FE_SUPPORTED(STV0297)
563static int alps_tdee4_stv0297_tuner_set_params(struct dvb_frontend* fe, 584static int alps_tdee4_stv0297_tuner_set_params(struct dvb_frontend* fe,
564 struct dvb_frontend_parameters *fep) 585 struct dvb_frontend_parameters *fep)
565{ 586{
@@ -698,39 +719,23 @@ static int cablestar2_attach(struct flexcop_device *fc,
698 fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params; 719 fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params;
699 return 1; 720 return 1;
700} 721}
722#else
723#define cablestar2_attach NULL
701#endif 724#endif
702 725
703static struct { 726static struct {
704 flexcop_device_type_t type; 727 flexcop_device_type_t type;
705 int (*attach)(struct flexcop_device *, struct i2c_adapter *); 728 int (*attach)(struct flexcop_device *, struct i2c_adapter *);
706} flexcop_frontends[] = { 729} flexcop_frontends[] = {
707#if defined(CONFIG_DVB_S5H1420_MODULE)
708 { FC_SKY_REV27, skystar2_rev27_attach }, 730 { FC_SKY_REV27, skystar2_rev27_attach },
709#endif
710#if defined(CONFIG_DVB_CX24123_MODULE)
711 { FC_SKY_REV28, skystar2_rev28_attach }, 731 { FC_SKY_REV28, skystar2_rev28_attach },
712#endif
713#if defined(CONFIG_DVB_STV0299_MODULE)
714 { FC_SKY_REV26, skystar2_rev26_attach }, 732 { FC_SKY_REV26, skystar2_rev26_attach },
715#endif
716#if defined(CONFIG_DVB_MT352_MODULE)
717 { FC_AIR_DVBT, airstar_dvbt_attach }, 733 { FC_AIR_DVBT, airstar_dvbt_attach },
718#endif
719#if defined(CONFIG_DVB_NXT200X_MODULE)
720 { FC_AIR_ATSC2, airstar_atsc2_attach }, 734 { FC_AIR_ATSC2, airstar_atsc2_attach },
721#endif
722#if defined(CONFIG_DVB_LGDT330X_MODULE)
723 { FC_AIR_ATSC3, airstar_atsc3_attach }, 735 { FC_AIR_ATSC3, airstar_atsc3_attach },
724#endif
725#if defined(CONFIG_DVB_BCM3510_MODULE)
726 { FC_AIR_ATSC1, airstar_atsc1_attach }, 736 { FC_AIR_ATSC1, airstar_atsc1_attach },
727#endif
728#if defined(CONFIG_DVB_STV0297_MODULE)
729 { FC_CABLE, cablestar2_attach }, 737 { FC_CABLE, cablestar2_attach },
730#endif
731#if defined(CONFIG_DVB_MT312_MODULE)
732 { FC_SKY_REV23, skystar2_rev23_attach }, 738 { FC_SKY_REV23, skystar2_rev23_attach },
733#endif
734}; 739};
735 740
736/* try to figure out the frontend */ 741/* try to figure out the frontend */
@@ -738,6 +743,8 @@ int flexcop_frontend_init(struct flexcop_device *fc)
738{ 743{
739 int i; 744 int i;
740 for (i = 0; i < ARRAY_SIZE(flexcop_frontends); i++) { 745 for (i = 0; i < ARRAY_SIZE(flexcop_frontends); i++) {
746 if (!flexcop_frontends[i].attach)
747 continue;
741 /* type needs to be set before, because of some workarounds 748 /* type needs to be set before, because of some workarounds
742 * done based on the probed card type */ 749 * done based on the probed card type */
743 fc->dev_type = flexcop_frontends[i].type; 750 fc->dev_type = flexcop_frontends[i].type;
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index 4601b059b2b2..0e246eaad05a 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -21,6 +21,7 @@
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/smp_lock.h>
24#include <linux/string.h> 25#include <linux/string.h>
25#include <linux/dvb/ca.h> 26#include <linux/dvb/ca.h>
26#include "dvbdev.h" 27#include "dvbdev.h"
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index 79927305e84d..487919bea7ae 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -27,7 +27,6 @@
27#include <linux/poll.h> 27#include <linux/poll.h>
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/smp_lock.h>
31 30
32#define DVB_MAJOR 212 31#define DVB_MAJOR 212
33 32
diff --git a/drivers/media/dvb/frontends/af9013.c b/drivers/media/dvb/frontends/af9013.c
index 136c5863d81b..12e018b4107d 100644
--- a/drivers/media/dvb/frontends/af9013.c
+++ b/drivers/media/dvb/frontends/af9013.c
@@ -527,6 +527,10 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
527 u8 i, buf[3] = {0, 0, 0}; 527 u8 i, buf[3] = {0, 0, 0};
528 *auto_mode = 0; /* set if parameters are requested to auto set */ 528 *auto_mode = 0; /* set if parameters are requested to auto set */
529 529
530 /* Try auto-detect transmission parameters in case of AUTO requested or
531 garbage parameters given by application for compatibility.
532 MPlayer seems to provide garbage parameters currently. */
533
530 switch (params->transmission_mode) { 534 switch (params->transmission_mode) {
531 case TRANSMISSION_MODE_AUTO: 535 case TRANSMISSION_MODE_AUTO:
532 *auto_mode = 1; 536 *auto_mode = 1;
@@ -536,7 +540,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
536 buf[0] |= (1 << 0); 540 buf[0] |= (1 << 0);
537 break; 541 break;
538 default: 542 default:
539 return -EINVAL; 543 deb_info("%s: invalid transmission_mode\n", __func__);
544 *auto_mode = 1;
540 } 545 }
541 546
542 switch (params->guard_interval) { 547 switch (params->guard_interval) {
@@ -554,7 +559,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
554 buf[0] |= (3 << 2); 559 buf[0] |= (3 << 2);
555 break; 560 break;
556 default: 561 default:
557 return -EINVAL; 562 deb_info("%s: invalid guard_interval\n", __func__);
563 *auto_mode = 1;
558 } 564 }
559 565
560 switch (params->hierarchy_information) { 566 switch (params->hierarchy_information) {
@@ -572,7 +578,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
572 buf[0] |= (3 << 4); 578 buf[0] |= (3 << 4);
573 break; 579 break;
574 default: 580 default:
575 return -EINVAL; 581 deb_info("%s: invalid hierarchy_information\n", __func__);
582 *auto_mode = 1;
576 }; 583 };
577 584
578 switch (params->constellation) { 585 switch (params->constellation) {
@@ -587,7 +594,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
587 buf[1] |= (2 << 6); 594 buf[1] |= (2 << 6);
588 break; 595 break;
589 default: 596 default:
590 return -EINVAL; 597 deb_info("%s: invalid constellation\n", __func__);
598 *auto_mode = 1;
591 } 599 }
592 600
593 /* Use HP. How and which case we can switch to LP? */ 601 /* Use HP. How and which case we can switch to LP? */
@@ -611,7 +619,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
611 buf[2] |= (4 << 0); 619 buf[2] |= (4 << 0);
612 break; 620 break;
613 default: 621 default:
614 return -EINVAL; 622 deb_info("%s: invalid code_rate_HP\n", __func__);
623 *auto_mode = 1;
615 } 624 }
616 625
617 switch (params->code_rate_LP) { 626 switch (params->code_rate_LP) {
@@ -638,7 +647,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
638 if (params->hierarchy_information == HIERARCHY_AUTO) 647 if (params->hierarchy_information == HIERARCHY_AUTO)
639 break; 648 break;
640 default: 649 default:
641 return -EINVAL; 650 deb_info("%s: invalid code_rate_LP\n", __func__);
651 *auto_mode = 1;
642 } 652 }
643 653
644 switch (params->bandwidth) { 654 switch (params->bandwidth) {
@@ -651,7 +661,8 @@ static int af9013_set_ofdm_params(struct af9013_state *state,
651 buf[1] |= (2 << 2); 661 buf[1] |= (2 << 2);
652 break; 662 break;
653 default: 663 default:
654 return -EINVAL; 664 deb_info("%s: invalid bandwidth\n", __func__);
665 buf[1] |= (2 << 2); /* cannot auto-detect BW, try 8 MHz */
655 } 666 }
656 667
657 /* program */ 668 /* program */
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index d1d959ed37b7..8d65c652ba50 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -36,7 +36,6 @@
36#include <linux/fs.h> 36#include <linux/fs.h>
37#include <linux/timer.h> 37#include <linux/timer.h>
38#include <linux/poll.h> 38#include <linux/poll.h>
39#include <linux/smp_lock.h>
40 39
41#include <linux/kernel.h> 40#include <linux/kernel.h>
42#include <linux/sched.h> 41#include <linux/sched.h>
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 837467f93805..575bf9d89419 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -58,6 +58,7 @@
58#include <linux/module.h> 58#include <linux/module.h>
59#include <linux/init.h> 59#include <linux/init.h>
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <linux/smp_lock.h>
61#include <linux/input.h> 62#include <linux/input.h>
62#include <linux/videodev2.h> 63#include <linux/videodev2.h>
63#include <media/v4l2-device.h> 64#include <media/v4l2-device.h>
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 46d216329611..e85f318b4d2b 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -127,6 +127,7 @@
127#include <linux/module.h> 127#include <linux/module.h>
128#include <linux/init.h> 128#include <linux/init.h>
129#include <linux/slab.h> 129#include <linux/slab.h>
130#include <linux/smp_lock.h>
130#include <linux/input.h> 131#include <linux/input.h>
131#include <linux/usb.h> 132#include <linux/usb.h>
132#include <linux/hid.h> 133#include <linux/hid.h>
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index fdb4adff3d28..ca6558c394be 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3324,8 +3324,6 @@ void __devinit bttv_init_card1(struct bttv *btv)
3324/* initialization part two -- after registering i2c bus */ 3324/* initialization part two -- after registering i2c bus */
3325void __devinit bttv_init_card2(struct bttv *btv) 3325void __devinit bttv_init_card2(struct bttv *btv)
3326{ 3326{
3327 int addr=ADDR_UNSET;
3328
3329 btv->tuner_type = UNSET; 3327 btv->tuner_type = UNSET;
3330 3328
3331 if (BTTV_BOARD_UNKNOWN == btv->c.type) { 3329 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
@@ -3470,9 +3468,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
3470 btv->pll.pll_current = -1; 3468 btv->pll.pll_current = -1;
3471 3469
3472 /* tuner configuration (from card list / autodetect / insmod option) */ 3470 /* tuner configuration (from card list / autodetect / insmod option) */
3473 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3474 addr = bttv_tvcards[btv->c.type].tuner_addr;
3475
3476 if (UNSET != bttv_tvcards[btv->c.type].tuner_type) 3471 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3477 if (UNSET == btv->tuner_type) 3472 if (UNSET == btv->tuner_type)
3478 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; 3473 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
@@ -3496,40 +3491,6 @@ void __devinit bttv_init_card2(struct bttv *btv)
3496 if (UNSET == btv->tuner_type) 3491 if (UNSET == btv->tuner_type)
3497 btv->tuner_type = TUNER_ABSENT; 3492 btv->tuner_type = TUNER_ABSENT;
3498 3493
3499 if (btv->tuner_type != TUNER_ABSENT) {
3500 struct tuner_setup tun_setup;
3501
3502 /* Load tuner module before issuing tuner config call! */
3503 if (bttv_tvcards[btv->c.type].has_radio)
3504 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3505 &btv->c.i2c_adap, "tuner", "tuner",
3506 v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3507 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3508 &btv->c.i2c_adap, "tuner", "tuner",
3509 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3510 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3511 &btv->c.i2c_adap, "tuner", "tuner",
3512 v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3513
3514 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3515 tun_setup.type = btv->tuner_type;
3516 tun_setup.addr = addr;
3517
3518 if (bttv_tvcards[btv->c.type].has_radio)
3519 tun_setup.mode_mask |= T_RADIO;
3520
3521 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3522 }
3523
3524 if (btv->tda9887_conf) {
3525 struct v4l2_priv_tun_config tda9887_cfg;
3526
3527 tda9887_cfg.tuner = TUNER_TDA9887;
3528 tda9887_cfg.priv = &btv->tda9887_conf;
3529
3530 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3531 }
3532
3533 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ? 3494 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3534 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET; 3495 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3535 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ? 3496 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
@@ -3540,15 +3501,15 @@ void __devinit bttv_init_card2(struct bttv *btv)
3540 btv->has_remote = remote[btv->c.nr]; 3501 btv->has_remote = remote[btv->c.nr];
3541 3502
3542 if (bttv_tvcards[btv->c.type].has_radio) 3503 if (bttv_tvcards[btv->c.type].has_radio)
3543 btv->has_radio=1; 3504 btv->has_radio = 1;
3544 if (bttv_tvcards[btv->c.type].has_remote) 3505 if (bttv_tvcards[btv->c.type].has_remote)
3545 btv->has_remote=1; 3506 btv->has_remote = 1;
3546 if (!bttv_tvcards[btv->c.type].no_gpioirq) 3507 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3547 btv->gpioirq=1; 3508 btv->gpioirq = 1;
3548 if (bttv_tvcards[btv->c.type].volume_gpio) 3509 if (bttv_tvcards[btv->c.type].volume_gpio)
3549 btv->volume_gpio=bttv_tvcards[btv->c.type].volume_gpio; 3510 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
3550 if (bttv_tvcards[btv->c.type].audio_mode_gpio) 3511 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3551 btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio; 3512 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
3552 3513
3553 if (btv->tuner_type == TUNER_ABSENT) 3514 if (btv->tuner_type == TUNER_ABSENT)
3554 return; /* no tuner or related drivers to load */ 3515 return; /* no tuner or related drivers to load */
@@ -3666,6 +3627,49 @@ no_audio:
3666} 3627}
3667 3628
3668 3629
3630/* initialize the tuner */
3631void __devinit bttv_init_tuner(struct bttv *btv)
3632{
3633 int addr = ADDR_UNSET;
3634
3635 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3636 addr = bttv_tvcards[btv->c.type].tuner_addr;
3637
3638 if (btv->tuner_type != TUNER_ABSENT) {
3639 struct tuner_setup tun_setup;
3640
3641 /* Load tuner module before issuing tuner config call! */
3642 if (bttv_tvcards[btv->c.type].has_radio)
3643 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3644 &btv->c.i2c_adap, "tuner", "tuner",
3645 v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3646 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3647 &btv->c.i2c_adap, "tuner", "tuner",
3648 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3649 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3650 &btv->c.i2c_adap, "tuner", "tuner",
3651 v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3652
3653 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3654 tun_setup.type = btv->tuner_type;
3655 tun_setup.addr = addr;
3656
3657 if (bttv_tvcards[btv->c.type].has_radio)
3658 tun_setup.mode_mask |= T_RADIO;
3659
3660 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3661 }
3662
3663 if (btv->tda9887_conf) {
3664 struct v4l2_priv_tun_config tda9887_cfg;
3665
3666 tda9887_cfg.tuner = TUNER_TDA9887;
3667 tda9887_cfg.priv = &btv->tda9887_conf;
3668
3669 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3670 }
3671}
3672
3669/* ----------------------------------------------------------------------- */ 3673/* ----------------------------------------------------------------------- */
3670 3674
3671static void modtec_eeprom(struct bttv *btv) 3675static void modtec_eeprom(struct bttv *btv)
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 5eb1464af670..8cc6dd28d6a7 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -41,6 +41,7 @@
41#include <linux/fs.h> 41#include <linux/fs.h>
42#include <linux/kernel.h> 42#include <linux/kernel.h>
43#include <linux/sched.h> 43#include <linux/sched.h>
44#include <linux/smp_lock.h>
44#include <linux/interrupt.h> 45#include <linux/interrupt.h>
45#include <linux/kdev_t.h> 46#include <linux/kdev_t.h>
46#include "bttvp.h" 47#include "bttvp.h"
@@ -4418,6 +4419,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4418 4419
4419 /* some card-specific stuff (needs working i2c) */ 4420 /* some card-specific stuff (needs working i2c) */
4420 bttv_init_card2(btv); 4421 bttv_init_card2(btv);
4422 bttv_init_tuner(btv);
4421 init_irqreg(btv); 4423 init_irqreg(btv);
4422 4424
4423 /* register video4linux + input */ 4425 /* register video4linux + input */
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index 3d36daf206f3..3ec2402c6b4a 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -283,6 +283,7 @@ extern struct tvcard bttv_tvcards[];
283extern void bttv_idcard(struct bttv *btv); 283extern void bttv_idcard(struct bttv *btv);
284extern void bttv_init_card1(struct bttv *btv); 284extern void bttv_init_card1(struct bttv *btv);
285extern void bttv_init_card2(struct bttv *btv); 285extern void bttv_init_card2(struct bttv *btv);
286extern void bttv_init_tuner(struct bttv *btv);
286 287
287/* card-specific funtions */ 288/* card-specific funtions */
288extern void tea5757_set_freq(struct bttv *btv, unsigned short freq); 289extern void tea5757_set_freq(struct bttv *btv, unsigned short freq);
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index 2943bfd32a94..e0cf21e0b1bf 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -31,6 +31,7 @@
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/device.h> 32#include <linux/device.h>
33#include <linux/firmware.h> 33#include <linux/firmware.h>
34#include <linux/smp_lock.h>
34#include <media/v4l2-common.h> 35#include <media/v4l2-common.h>
35#include <media/v4l2-ioctl.h> 36#include <media/v4l2-ioctl.h>
36#include <media/cx2341x.h> 37#include <media/cx2341x.h>
@@ -57,7 +58,8 @@ MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages");
57 58
58#define dprintk(level, fmt, arg...)\ 59#define dprintk(level, fmt, arg...)\
59 do { if (v4l_debug >= level) \ 60 do { if (v4l_debug >= level) \
60 printk(KERN_DEBUG "%s: " fmt, dev->name , ## arg);\ 61 printk(KERN_DEBUG "%s: " fmt, \
62 (dev) ? dev->name : "cx23885[?]", ## arg); \
61 } while (0) 63 } while (0)
62 64
63static struct cx23885_tvnorm cx23885_tvnorms[] = { 65static struct cx23885_tvnorm cx23885_tvnorms[] = {
@@ -1676,6 +1678,7 @@ static struct v4l2_file_operations mpeg_fops = {
1676 .read = mpeg_read, 1678 .read = mpeg_read,
1677 .poll = mpeg_poll, 1679 .poll = mpeg_poll,
1678 .mmap = mpeg_mmap, 1680 .mmap = mpeg_mmap,
1681 .ioctl = video_ioctl2,
1679}; 1682};
1680 1683
1681static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { 1684static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 70836af3ab48..5d6093336300 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -26,6 +26,7 @@
26#include <linux/kmod.h> 26#include <linux/kmod.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
30#include <linux/delay.h> 31#include <linux/delay.h>
31#include <linux/kthread.h> 32#include <linux/kthread.h>
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 44eacfb0d0d6..356d6896da3f 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -32,6 +32,7 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/device.h> 33#include <linux/device.h>
34#include <linux/firmware.h> 34#include <linux/firmware.h>
35#include <linux/smp_lock.h>
35#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
36#include <media/v4l2-ioctl.h> 37#include <media/v4l2-ioctl.h>
37#include <media/cx2341x.h> 38#include <media/cx2341x.h>
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index b12770848c00..2bb54c3ef5cd 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -31,6 +31,7 @@
31#include <linux/kmod.h> 31#include <linux/kmod.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/smp_lock.h>
34#include <linux/interrupt.h> 35#include <linux/interrupt.h>
35#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
36#include <linux/delay.h> 37#include <linux/delay.h>
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
index ec2f45dde164..0664d111085f 100644
--- a/drivers/media/video/dabusb.c
+++ b/drivers/media/video/dabusb.c
@@ -32,6 +32,7 @@
32#include <linux/list.h> 32#include <linux/list.h>
33#include <linux/vmalloc.h> 33#include <linux/vmalloc.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/smp_lock.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <asm/uaccess.h> 37#include <asm/uaccess.h>
37#include <asm/atomic.h> 38#include <asm/atomic.h>
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index ebd24a25fb85..320f1f60276e 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -58,8 +58,6 @@ static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET };
58module_param_array(card, int, NULL, 0444); 58module_param_array(card, int, NULL, 0444);
59MODULE_PARM_DESC(card, "card type"); 59MODULE_PARM_DESC(card, "card type");
60 60
61#define MT9V011_VERSION 0x8243
62
63/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */ 61/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */
64static unsigned long em28xx_devused; 62static unsigned long em28xx_devused;
65 63
@@ -159,6 +157,20 @@ static struct em28xx_reg_seq evga_indtube_digital[] = {
159 { -1, -1, -1, -1}, 157 { -1, -1, -1, -1},
160}; 158};
161 159
160/* Pinnacle Hybrid Pro eb1a:2881 */
161static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
162 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
163 { -1, -1, -1, -1},
164};
165
166static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
167 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
168 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
169 {EM2880_R04_GPO, 0x0c, 0xff, 1},
170 { -1, -1, -1, -1},
171};
172
173
162/* Callback for the most boards */ 174/* Callback for the most boards */
163static struct em28xx_reg_seq default_tuner_gpio[] = { 175static struct em28xx_reg_seq default_tuner_gpio[] = {
164 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, 176 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
@@ -205,13 +217,15 @@ static struct em28xx_reg_seq silvercrest_reg_seq[] = {
205 */ 217 */
206struct em28xx_board em28xx_boards[] = { 218struct em28xx_board em28xx_boards[] = {
207 [EM2750_BOARD_UNKNOWN] = { 219 [EM2750_BOARD_UNKNOWN] = {
208 .name = "Unknown EM2750/EM2751 webcam grabber", 220 .name = "EM2710/EM2750/EM2751 webcam grabber",
209 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, 221 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
210 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 222 .tuner_type = TUNER_ABSENT,
223 .is_webcam = 1,
211 .input = { { 224 .input = { {
212 .type = EM28XX_VMUX_COMPOSITE1, 225 .type = EM28XX_VMUX_COMPOSITE1,
213 .vmux = 0, 226 .vmux = 0,
214 .amux = EM28XX_AMUX_VIDEO, 227 .amux = EM28XX_AMUX_VIDEO,
228 .gpio = silvercrest_reg_seq,
215 } }, 229 } },
216 }, 230 },
217 [EM2800_BOARD_UNKNOWN] = { 231 [EM2800_BOARD_UNKNOWN] = {
@@ -233,13 +247,15 @@ struct em28xx_board em28xx_boards[] = {
233 [EM2820_BOARD_UNKNOWN] = { 247 [EM2820_BOARD_UNKNOWN] = {
234 .name = "Unknown EM2750/28xx video grabber", 248 .name = "Unknown EM2750/28xx video grabber",
235 .tuner_type = TUNER_ABSENT, 249 .tuner_type = TUNER_ABSENT,
250 .is_webcam = 1, /* To enable sensor probe */
236 }, 251 },
237 [EM2750_BOARD_DLCW_130] = { 252 [EM2750_BOARD_DLCW_130] = {
238 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 253 /* Beijing Huaqi Information Digital Technology Co., Ltd */
239 .name = "Huaqi DLCW-130", 254 .name = "Huaqi DLCW-130",
240 .valid = EM28XX_BOARD_NOT_VALIDATED, 255 .valid = EM28XX_BOARD_NOT_VALIDATED,
241 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ, 256 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
242 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 257 .tuner_type = TUNER_ABSENT,
258 .is_webcam = 1,
243 .input = { { 259 .input = { {
244 .type = EM28XX_VMUX_COMPOSITE1, 260 .type = EM28XX_VMUX_COMPOSITE1,
245 .vmux = 0, 261 .vmux = 0,
@@ -440,7 +456,8 @@ struct em28xx_board em28xx_boards[] = {
440 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { 456 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
441 .name = "Videology 20K14XUSB USB2.0", 457 .name = "Videology 20K14XUSB USB2.0",
442 .valid = EM28XX_BOARD_NOT_VALIDATED, 458 .valid = EM28XX_BOARD_NOT_VALIDATED,
443 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 459 .tuner_type = TUNER_ABSENT,
460 .is_webcam = 1,
444 .input = { { 461 .input = { {
445 .type = EM28XX_VMUX_COMPOSITE1, 462 .type = EM28XX_VMUX_COMPOSITE1,
446 .vmux = 0, 463 .vmux = 0,
@@ -450,8 +467,7 @@ struct em28xx_board em28xx_boards[] = {
450 [EM2820_BOARD_SILVERCREST_WEBCAM] = { 467 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
451 .name = "Silvercrest Webcam 1.3mpix", 468 .name = "Silvercrest Webcam 1.3mpix",
452 .tuner_type = TUNER_ABSENT, 469 .tuner_type = TUNER_ABSENT,
453 .is_27xx = 1, 470 .is_webcam = 1,
454 .decoder = EM28XX_MT9V011,
455 .input = { { 471 .input = { {
456 .type = EM28XX_VMUX_COMPOSITE1, 472 .type = EM28XX_VMUX_COMPOSITE1,
457 .vmux = 0, 473 .vmux = 0,
@@ -500,7 +516,8 @@ struct em28xx_board em28xx_boards[] = {
500 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 516 /* Beijing Huaqi Information Digital Technology Co., Ltd */
501 .name = "NetGMBH Cam", 517 .name = "NetGMBH Cam",
502 .valid = EM28XX_BOARD_NOT_VALIDATED, 518 .valid = EM28XX_BOARD_NOT_VALIDATED,
503 .tuner_type = TUNER_ABSENT, /* This is a webcam */ 519 .tuner_type = TUNER_ABSENT,
520 .is_webcam = 1,
504 .input = { { 521 .input = { {
505 .type = EM28XX_VMUX_COMPOSITE1, 522 .type = EM28XX_VMUX_COMPOSITE1,
506 .vmux = 0, 523 .vmux = 0,
@@ -1250,25 +1267,26 @@ struct em28xx_board em28xx_boards[] = {
1250 }, 1267 },
1251 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = { 1268 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1252 .name = "Pinnacle Hybrid Pro", 1269 .name = "Pinnacle Hybrid Pro",
1253 .valid = EM28XX_BOARD_NOT_VALIDATED,
1254 .tuner_type = TUNER_XC2028, 1270 .tuner_type = TUNER_XC2028,
1255 .tuner_gpio = default_tuner_gpio, 1271 .tuner_gpio = default_tuner_gpio,
1256 .decoder = EM28XX_TVP5150, 1272 .decoder = EM28XX_TVP5150,
1273 .has_dvb = 1,
1274 .dvb_gpio = pinnacle_hybrid_pro_digital,
1257 .input = { { 1275 .input = { {
1258 .type = EM28XX_VMUX_TELEVISION, 1276 .type = EM28XX_VMUX_TELEVISION,
1259 .vmux = TVP5150_COMPOSITE0, 1277 .vmux = TVP5150_COMPOSITE0,
1260 .amux = EM28XX_AMUX_VIDEO, 1278 .amux = EM28XX_AMUX_VIDEO,
1261 .gpio = default_analog, 1279 .gpio = pinnacle_hybrid_pro_analog,
1262 }, { 1280 }, {
1263 .type = EM28XX_VMUX_COMPOSITE1, 1281 .type = EM28XX_VMUX_COMPOSITE1,
1264 .vmux = TVP5150_COMPOSITE1, 1282 .vmux = TVP5150_COMPOSITE1,
1265 .amux = EM28XX_AMUX_LINE_IN, 1283 .amux = EM28XX_AMUX_LINE_IN,
1266 .gpio = default_analog, 1284 .gpio = pinnacle_hybrid_pro_analog,
1267 }, { 1285 }, {
1268 .type = EM28XX_VMUX_SVIDEO, 1286 .type = EM28XX_VMUX_SVIDEO,
1269 .vmux = TVP5150_SVIDEO, 1287 .vmux = TVP5150_SVIDEO,
1270 .amux = EM28XX_AMUX_LINE_IN, 1288 .amux = EM28XX_AMUX_LINE_IN,
1271 .gpio = default_analog, 1289 .gpio = pinnacle_hybrid_pro_analog,
1272 } }, 1290 } },
1273 }, 1291 },
1274 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = { 1292 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
@@ -1638,6 +1656,7 @@ static struct em28xx_hash_table em28xx_eeprom_hash[] = {
1638 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028}, 1656 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
1639 {0x9567eb1a, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028}, 1657 {0x9567eb1a, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
1640 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028}, 1658 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
1659 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
1641}; 1660};
1642 1661
1643/* I2C devicelist hash table for devices with generic USB IDs */ 1662/* I2C devicelist hash table for devices with generic USB IDs */
@@ -1704,6 +1723,32 @@ static inline void em28xx_set_model(struct em28xx *dev)
1704 EM28XX_I2C_FREQ_100_KHZ; 1723 EM28XX_I2C_FREQ_100_KHZ;
1705} 1724}
1706 1725
1726/* FIXME: Should be replaced by a proper mt9m001 driver */
1727static int em28xx_initialize_mt9m001(struct em28xx *dev)
1728{
1729 int i;
1730 unsigned char regs[][3] = {
1731 { 0x0d, 0x00, 0x01, },
1732 { 0x0d, 0x00, 0x00, },
1733 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
1734 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
1735 { 0x20, 0x11, 0x00, },
1736 { 0x06, 0x00, 0x10, },
1737 { 0x2b, 0x00, 0x24, },
1738 { 0x2e, 0x00, 0x24, },
1739 { 0x35, 0x00, 0x24, },
1740 { 0x2d, 0x00, 0x20, },
1741 { 0x2c, 0x00, 0x20, },
1742 { 0x09, 0x0a, 0xd4, },
1743 { 0x35, 0x00, 0x57, },
1744 };
1745
1746 for (i = 0; i < ARRAY_SIZE(regs); i++)
1747 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
1748
1749 return 0;
1750}
1751
1707/* HINT method: webcam I2C chips 1752/* HINT method: webcam I2C chips
1708 * 1753 *
1709 * This method work for webcams with Micron sensors 1754 * This method work for webcams with Micron sensors
@@ -1716,9 +1761,6 @@ static int em28xx_hint_sensor(struct em28xx *dev)
1716 __be16 version_be; 1761 __be16 version_be;
1717 u16 version; 1762 u16 version;
1718 1763
1719 if (dev->model != EM2820_BOARD_UNKNOWN)
1720 return 0;
1721
1722 dev->i2c_client.addr = 0xba >> 1; 1764 dev->i2c_client.addr = 0xba >> 1;
1723 cmd = 0; 1765 cmd = 0;
1724 i2c_master_send(&dev->i2c_client, &cmd, 1); 1766 i2c_master_send(&dev->i2c_client, &cmd, 1);
@@ -1729,16 +1771,38 @@ static int em28xx_hint_sensor(struct em28xx *dev)
1729 version = be16_to_cpu(version_be); 1771 version = be16_to_cpu(version_be);
1730 1772
1731 switch (version) { 1773 switch (version) {
1732 case MT9V011_VERSION: 1774 case 0x8243: /* mt9v011 640x480 1.3 Mpix sensor */
1733 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM; 1775 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
1734 sensor_name = "mt9v011"; 1776 sensor_name = "mt9v011";
1777 dev->em28xx_sensor = EM28XX_MT9V011;
1778 dev->sensor_xres = 640;
1779 dev->sensor_yres = 480;
1780 dev->sensor_xtal = 6300000;
1781
1782 /* probably means GRGB 16 bit bayer */
1783 dev->vinmode = 0x0d;
1784 dev->vinctl = 0x00;
1785
1786 break;
1787 case 0x8431:
1788 dev->model = EM2750_BOARD_UNKNOWN;
1789 sensor_name = "mt9m001";
1790 dev->em28xx_sensor = EM28XX_MT9M001;
1791 em28xx_initialize_mt9m001(dev);
1792 dev->sensor_xres = 1280;
1793 dev->sensor_yres = 1024;
1794
1795 /* probably means BGGR 16 bit bayer */
1796 dev->vinmode = 0x0c;
1797 dev->vinctl = 0x00;
1798
1735 break; 1799 break;
1736 default: 1800 default:
1737 printk("Unknown Sensor 0x%04x\n", be16_to_cpu(version)); 1801 printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
1738 return -EINVAL; 1802 return -EINVAL;
1739 } 1803 }
1740 1804
1741 em28xx_errdev("Sensor is %s, assuming that webcam is %s\n", 1805 em28xx_errdev("Sensor is %s, using model %s entry.\n",
1742 sensor_name, em28xx_boards[dev->model].name); 1806 sensor_name, em28xx_boards[dev->model].name);
1743 1807
1744 return 0; 1808 return 0;
@@ -1772,10 +1836,7 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1772 em28xx_info("chip ID is em2750\n"); 1836 em28xx_info("chip ID is em2750\n");
1773 break; 1837 break;
1774 case CHIP_ID_EM2820: 1838 case CHIP_ID_EM2820:
1775 if (dev->board.is_27xx) 1839 em28xx_info("chip ID is em2710 or em2820\n");
1776 em28xx_info("chip is em2710\n");
1777 else
1778 em28xx_info("chip ID is em2820\n");
1779 break; 1840 break;
1780 case CHIP_ID_EM2840: 1841 case CHIP_ID_EM2840:
1781 em28xx_info("chip ID is em2840\n"); 1842 em28xx_info("chip ID is em2840\n");
@@ -1929,6 +1990,7 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
1929 ctl->demod = XC3028_FE_ZARLINK456; 1990 ctl->demod = XC3028_FE_ZARLINK456;
1930 break; 1991 break;
1931 case EM2880_BOARD_TERRATEC_HYBRID_XS: 1992 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1993 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
1932 ctl->demod = XC3028_FE_ZARLINK456; 1994 ctl->demod = XC3028_FE_ZARLINK456;
1933 break; 1995 break;
1934 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: 1996 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
@@ -2225,6 +2287,7 @@ void em28xx_card_setup(struct em28xx *dev)
2225 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, 2287 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2226 so make the call now so the analog GPIOs are set properly 2288 so make the call now so the analog GPIOs are set properly
2227 before probing the i2c bus. */ 2289 before probing the i2c bus. */
2290 em28xx_gpio_set(dev, dev->board.tuner_gpio);
2228 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 2291 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2229 break; 2292 break;
2230 case EM2820_BOARD_SILVERCREST_WEBCAM: 2293 case EM2820_BOARD_SILVERCREST_WEBCAM:
@@ -2262,9 +2325,14 @@ void em28xx_card_setup(struct em28xx *dev)
2262 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2325 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2263 "tvp5150", "tvp5150", tvp5150_addrs); 2326 "tvp5150", "tvp5150", tvp5150_addrs);
2264 2327
2265 if (dev->board.decoder == EM28XX_MT9V011) 2328 if (dev->em28xx_sensor == EM28XX_MT9V011) {
2266 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2329 struct v4l2_subdev *sd;
2267 "mt9v011", "mt9v011", mt9v011_addrs); 2330
2331 sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2332 &dev->i2c_adap, "mt9v011", "mt9v011", mt9v011_addrs);
2333 v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
2334 }
2335
2268 2336
2269 if (dev->board.adecoder == EM28XX_TVAUDIO) 2337 if (dev->board.adecoder == EM28XX_TVAUDIO)
2270 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2338 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
@@ -2410,7 +2478,19 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
2410 return errCode; 2478 return errCode;
2411 } 2479 }
2412 2480
2413 em28xx_hint_sensor(dev); 2481 /*
2482 * Default format, used for tvp5150 or saa711x output formats
2483 */
2484 dev->vinmode = 0x10;
2485 dev->vinctl = 0x11;
2486
2487 /*
2488 * If the device can be a webcam, seek for a sensor.
2489 * If sensor is not found, then it isn't a webcam.
2490 */
2491 if (dev->board.is_webcam)
2492 if (em28xx_hint_sensor(dev) < 0)
2493 dev->board.is_webcam = 0;
2414 2494
2415 /* Do board specific init and eeprom reading */ 2495 /* Do board specific init and eeprom reading */
2416 em28xx_card_setup(dev); 2496 em28xx_card_setup(dev);
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index 079ab4d563a6..5b78e199abd1 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -648,28 +648,17 @@ int em28xx_capture_start(struct em28xx *dev, int start)
648int em28xx_set_outfmt(struct em28xx *dev) 648int em28xx_set_outfmt(struct em28xx *dev)
649{ 649{
650 int ret; 650 int ret;
651 int vinmode, vinctl, outfmt;
652
653 outfmt = dev->format->reg;
654
655 if (dev->board.is_27xx) {
656 vinmode = 0x0d;
657 vinctl = 0x00;
658 } else {
659 vinmode = 0x10;
660 vinctl = 0x11;
661 }
662 651
663 ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT, 652 ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT,
664 outfmt | 0x20, 0xff); 653 dev->format->reg | 0x20, 0xff);
665 if (ret < 0) 654 if (ret < 0)
666 return ret; 655 return ret;
667 656
668 ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, vinmode); 657 ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode);
669 if (ret < 0) 658 if (ret < 0)
670 return ret; 659 return ret;
671 660
672 return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, vinctl); 661 return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, dev->vinctl);
673} 662}
674 663
675static int em28xx_accumulator_set(struct em28xx *dev, u8 xmin, u8 xmax, 664static int em28xx_accumulator_set(struct em28xx *dev, u8 xmin, u8 xmax,
@@ -707,10 +696,7 @@ static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v)
707 u8 mode; 696 u8 mode;
708 /* the em2800 scaler only supports scaling down to 50% */ 697 /* the em2800 scaler only supports scaling down to 50% */
709 698
710 if (dev->board.is_27xx) { 699 if (dev->board.is_em2800) {
711 /* FIXME: Don't use the scaler yet */
712 mode = 0;
713 } else if (dev->board.is_em2800) {
714 mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00); 700 mode = (v ? 0x20 : 0x00) | (h ? 0x10 : 0x00);
715 } else { 701 } else {
716 u8 buf[2]; 702 u8 buf[2];
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 3da97c32b8fa..cf0ac7f2a30d 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -31,6 +31,8 @@
31#include "lgdt330x.h" 31#include "lgdt330x.h"
32#include "zl10353.h" 32#include "zl10353.h"
33#include "s5h1409.h" 33#include "s5h1409.h"
34#include "mt352.h"
35#include "mt352_priv.h" /* FIXME */
34 36
35MODULE_DESCRIPTION("driver for em28xx based DVB cards"); 37MODULE_DESCRIPTION("driver for em28xx based DVB cards");
36MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); 38MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
@@ -243,7 +245,7 @@ static struct s5h1409_config em28xx_s5h1409_with_xc3028 = {
243 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 245 .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
244}; 246};
245 247
246static struct zl10353_config em28xx_terratec_xs_zl10353_xc3028 = { 248static struct zl10353_config em28xx_zl10353_xc3028_no_i2c_gate = {
247 .demod_address = (0x1e >> 1), 249 .demod_address = (0x1e >> 1),
248 .no_tuner = 1, 250 .no_tuner = 1,
249 .disable_i2c_gate_ctrl = 1, 251 .disable_i2c_gate_ctrl = 1,
@@ -258,6 +260,41 @@ static struct drx397xD_config em28xx_drx397xD_with_xc3028 = {
258}; 260};
259#endif 261#endif
260 262
263static int mt352_terratec_xs_init(struct dvb_frontend *fe)
264{
265 /* Values extracted from a USB trace of the Terratec Windows driver */
266 static u8 clock_config[] = { CLOCK_CTL, 0x38, 0x2c };
267 static u8 reset[] = { RESET, 0x80 };
268 static u8 adc_ctl_1_cfg[] = { ADC_CTL_1, 0x40 };
269 static u8 agc_cfg[] = { AGC_TARGET, 0x28, 0xa0 };
270 static u8 input_freq_cfg[] = { INPUT_FREQ_1, 0x31, 0xb8 };
271 static u8 rs_err_cfg[] = { RS_ERR_PER_1, 0x00, 0x4d };
272 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
273 static u8 trl_nom_cfg[] = { TRL_NOMINAL_RATE_1, 0x64, 0x00 };
274 static u8 tps_given_cfg[] = { TPS_GIVEN_1, 0x40, 0x80, 0x50 };
275 static u8 tuner_go[] = { TUNER_GO, 0x01};
276
277 mt352_write(fe, clock_config, sizeof(clock_config));
278 udelay(200);
279 mt352_write(fe, reset, sizeof(reset));
280 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
281 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
282 mt352_write(fe, input_freq_cfg, sizeof(input_freq_cfg));
283 mt352_write(fe, rs_err_cfg, sizeof(rs_err_cfg));
284 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
285 mt352_write(fe, trl_nom_cfg, sizeof(trl_nom_cfg));
286 mt352_write(fe, tps_given_cfg, sizeof(tps_given_cfg));
287 mt352_write(fe, tuner_go, sizeof(tuner_go));
288 return 0;
289}
290
291static struct mt352_config terratec_xs_mt352_cfg = {
292 .demod_address = (0x1e >> 1),
293 .no_tuner = 1,
294 .if2 = 45600,
295 .demod_init = mt352_terratec_xs_init,
296};
297
261/* ------------------------------------------------------------------ */ 298/* ------------------------------------------------------------------ */
262 299
263static int attach_xc3028(u8 addr, struct em28xx *dev) 300static int attach_xc3028(u8 addr, struct em28xx *dev)
@@ -440,7 +477,6 @@ static int dvb_init(struct em28xx *dev)
440 goto out_free; 477 goto out_free;
441 } 478 }
442 break; 479 break;
443 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
444 case EM2880_BOARD_KWORLD_DVB_310U: 480 case EM2880_BOARD_KWORLD_DVB_310U:
445 case EM2880_BOARD_EMPIRE_DUAL_TV: 481 case EM2880_BOARD_EMPIRE_DUAL_TV:
446 dvb->frontend = dvb_attach(zl10353_attach, 482 dvb->frontend = dvb_attach(zl10353_attach,
@@ -451,20 +487,28 @@ static int dvb_init(struct em28xx *dev)
451 goto out_free; 487 goto out_free;
452 } 488 }
453 break; 489 break;
490 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
491 dvb->frontend = dvb_attach(zl10353_attach,
492 &em28xx_zl10353_xc3028_no_i2c_gate,
493 &dev->i2c_adap);
494 if (attach_xc3028(0x61, dev) < 0) {
495 result = -EINVAL;
496 goto out_free;
497 }
498 break;
454 case EM2880_BOARD_TERRATEC_HYBRID_XS: 499 case EM2880_BOARD_TERRATEC_HYBRID_XS:
500 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
455 dvb->frontend = dvb_attach(zl10353_attach, 501 dvb->frontend = dvb_attach(zl10353_attach,
456 &em28xx_terratec_xs_zl10353_xc3028, 502 &em28xx_zl10353_xc3028_no_i2c_gate,
457 &dev->i2c_adap); 503 &dev->i2c_adap);
458 if (dvb->frontend == NULL) { 504 if (dvb->frontend == NULL) {
459 /* This board could have either a zl10353 or a mt352. 505 /* This board could have either a zl10353 or a mt352.
460 If the chip id isn't for zl10353, try mt352 */ 506 If the chip id isn't for zl10353, try mt352 */
461 507 dvb->frontend = dvb_attach(mt352_attach,
462 /* FIXME: make support for mt352 work */ 508 &terratec_xs_mt352_cfg,
463 printk(KERN_ERR "version of this board with mt352 not " 509 &dev->i2c_adap);
464 "currently supported\n");
465 result = -EINVAL;
466 goto out_free;
467 } 510 }
511
468 if (attach_xc3028(0x61, dev) < 0) { 512 if (attach_xc3028(0x61, dev) < 0) {
469 result = -EINVAL; 513 result = -EINVAL;
470 goto out_free; 514 goto out_free;
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 14316c912179..ff37b4c15f44 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -657,8 +657,8 @@ static void get_scale(struct em28xx *dev,
657 unsigned int width, unsigned int height, 657 unsigned int width, unsigned int height,
658 unsigned int *hscale, unsigned int *vscale) 658 unsigned int *hscale, unsigned int *vscale)
659{ 659{
660 unsigned int maxw = norm_maxw(dev); 660 unsigned int maxw = norm_maxw(dev);
661 unsigned int maxh = norm_maxh(dev); 661 unsigned int maxh = norm_maxh(dev);
662 662
663 *hscale = (((unsigned long)maxw) << 12) / width - 4096L; 663 *hscale = (((unsigned long)maxw) << 12) / width - 4096L;
664 if (*hscale >= 0x4000) 664 if (*hscale >= 0x4000)
@@ -726,11 +726,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
726 return -EINVAL; 726 return -EINVAL;
727 } 727 }
728 728
729 if (dev->board.is_27xx) { 729 if (dev->board.is_em2800) {
730 /* FIXME: This is the only supported fmt */
731 width = 640;
732 height = 480;
733 } else if (dev->board.is_em2800) {
734 /* the em2800 can only scale down to 50% */ 730 /* the em2800 can only scale down to 50% */
735 height = height > (3 * maxh / 4) ? maxh : maxh / 2; 731 height = height > (3 * maxh / 4) ? maxh : maxh / 2;
736 width = width > (3 * maxw / 4) ? maxw : maxw / 2; 732 width = width > (3 * maxw / 4) ? maxw : maxw / 2;
@@ -767,12 +763,6 @@ static int em28xx_set_video_format(struct em28xx *dev, unsigned int fourcc,
767{ 763{
768 struct em28xx_fmt *fmt; 764 struct em28xx_fmt *fmt;
769 765
770 /* FIXME: This is the only supported fmt */
771 if (dev->board.is_27xx) {
772 width = 640;
773 height = 480;
774 }
775
776 fmt = format_by_fourcc(fourcc); 766 fmt = format_by_fourcc(fourcc);
777 if (!fmt) 767 if (!fmt)
778 return -EINVAL; 768 return -EINVAL;
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index d90fef463764..45bd513f62dc 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -358,10 +358,15 @@ struct em28xx_input {
358#define INPUT(nr) (&em28xx_boards[dev->model].input[nr]) 358#define INPUT(nr) (&em28xx_boards[dev->model].input[nr])
359 359
360enum em28xx_decoder { 360enum em28xx_decoder {
361 EM28XX_NODECODER, 361 EM28XX_NODECODER = 0,
362 EM28XX_TVP5150, 362 EM28XX_TVP5150,
363 EM28XX_SAA711X, 363 EM28XX_SAA711X,
364};
365
366enum em28xx_sensor {
367 EM28XX_NOSENSOR = 0,
364 EM28XX_MT9V011, 368 EM28XX_MT9V011,
369 EM28XX_MT9M001,
365}; 370};
366 371
367enum em28xx_adecoder { 372enum em28xx_adecoder {
@@ -390,7 +395,7 @@ struct em28xx_board {
390 unsigned int max_range_640_480:1; 395 unsigned int max_range_640_480:1;
391 unsigned int has_dvb:1; 396 unsigned int has_dvb:1;
392 unsigned int has_snapshot_button:1; 397 unsigned int has_snapshot_button:1;
393 unsigned int is_27xx:1; 398 unsigned int is_webcam:1;
394 unsigned int valid:1; 399 unsigned int valid:1;
395 400
396 unsigned char xclk, i2c_speed; 401 unsigned char xclk, i2c_speed;
@@ -474,6 +479,14 @@ struct em28xx {
474 struct v4l2_device v4l2_dev; 479 struct v4l2_device v4l2_dev;
475 struct em28xx_board board; 480 struct em28xx_board board;
476 481
482 /* Webcam specific fields */
483 enum em28xx_sensor em28xx_sensor;
484 int sensor_xres, sensor_yres;
485 int sensor_xtal;
486
487 /* Vinmode/Vinctl used at the driver */
488 int vinmode, vinctl;
489
477 unsigned int stream_on:1; /* Locks streams */ 490 unsigned int stream_on:1; /* Locks streams */
478 unsigned int has_audio_class:1; 491 unsigned int has_audio_class:1;
479 unsigned int has_alsa_audio:1; 492 unsigned int has_alsa_audio:1;
@@ -754,17 +767,23 @@ static inline int em28xx_gamma_set(struct em28xx *dev, s32 val)
754/*FIXME: maxw should be dependent of alt mode */ 767/*FIXME: maxw should be dependent of alt mode */
755static inline unsigned int norm_maxw(struct em28xx *dev) 768static inline unsigned int norm_maxw(struct em28xx *dev)
756{ 769{
770 if (dev->board.is_webcam)
771 return dev->sensor_xres;
772
757 if (dev->board.max_range_640_480) 773 if (dev->board.max_range_640_480)
758 return 640; 774 return 640;
759 else 775
760 return 720; 776 return 720;
761} 777}
762 778
763static inline unsigned int norm_maxh(struct em28xx *dev) 779static inline unsigned int norm_maxh(struct em28xx *dev)
764{ 780{
781 if (dev->board.is_webcam)
782 return dev->sensor_yres;
783
765 if (dev->board.max_range_640_480) 784 if (dev->board.max_range_640_480)
766 return 480; 785 return 480;
767 else 786
768 return (dev->norm & V4L2_STD_625_50) ? 576 : 480; 787 return (dev->norm & V4L2_STD_625_50) ? 576 : 480;
769} 788}
770#endif 789#endif
diff --git a/drivers/media/video/gspca/Kconfig b/drivers/media/video/gspca/Kconfig
index 578dc4ffc965..34f46f2bc040 100644
--- a/drivers/media/video/gspca/Kconfig
+++ b/drivers/media/video/gspca/Kconfig
@@ -102,6 +102,22 @@ config USB_GSPCA_PAC7311
102 To compile this driver as a module, choose M here: the 102 To compile this driver as a module, choose M here: the
103 module will be called gspca_pac7311. 103 module will be called gspca_pac7311.
104 104
105config USB_GSPCA_SN9C20X
106 tristate "SN9C20X USB Camera Driver"
107 depends on VIDEO_V4L2 && USB_GSPCA
108 help
109 Say Y here if you want support for cameras based on the
110 sn9c20x chips (SN9C201 and SN9C202).
111
112 To compile this driver as a module, choose M here: the
113 module will be called gspca_sn9c20x.
114
115config USB_GSPCA_SN9C20X_EVDEV
116 bool "Enable evdev support"
117 depends on USB_GSPCA_SN9C20X
118 ---help---
119 Say Y here in order to enable evdev support for sn9c20x webcam button.
120
105config USB_GSPCA_SONIXB 121config USB_GSPCA_SONIXB
106 tristate "SONIX Bayer USB Camera Driver" 122 tristate "SONIX Bayer USB Camera Driver"
107 depends on VIDEO_V4L2 && USB_GSPCA 123 depends on VIDEO_V4L2 && USB_GSPCA
diff --git a/drivers/media/video/gspca/Makefile b/drivers/media/video/gspca/Makefile
index 8a6643e8eb96..f6d3b86e9ad5 100644
--- a/drivers/media/video/gspca/Makefile
+++ b/drivers/media/video/gspca/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_USB_GSPCA_OV519) += gspca_ov519.o
8obj-$(CONFIG_USB_GSPCA_OV534) += gspca_ov534.o 8obj-$(CONFIG_USB_GSPCA_OV534) += gspca_ov534.o
9obj-$(CONFIG_USB_GSPCA_PAC207) += gspca_pac207.o 9obj-$(CONFIG_USB_GSPCA_PAC207) += gspca_pac207.o
10obj-$(CONFIG_USB_GSPCA_PAC7311) += gspca_pac7311.o 10obj-$(CONFIG_USB_GSPCA_PAC7311) += gspca_pac7311.o
11obj-$(CONFIG_USB_GSPCA_SN9C20X) += gspca_sn9c20x.o
11obj-$(CONFIG_USB_GSPCA_SONIXB) += gspca_sonixb.o 12obj-$(CONFIG_USB_GSPCA_SONIXB) += gspca_sonixb.o
12obj-$(CONFIG_USB_GSPCA_SONIXJ) += gspca_sonixj.o 13obj-$(CONFIG_USB_GSPCA_SONIXJ) += gspca_sonixj.o
13obj-$(CONFIG_USB_GSPCA_SPCA500) += gspca_spca500.o 14obj-$(CONFIG_USB_GSPCA_SPCA500) += gspca_spca500.o
@@ -35,6 +36,7 @@ gspca_ov519-objs := ov519.o
35gspca_ov534-objs := ov534.o 36gspca_ov534-objs := ov534.o
36gspca_pac207-objs := pac207.o 37gspca_pac207-objs := pac207.o
37gspca_pac7311-objs := pac7311.o 38gspca_pac7311-objs := pac7311.o
39gspca_sn9c20x-objs := sn9c20x.o
38gspca_sonixb-objs := sonixb.o 40gspca_sonixb-objs := sonixb.o
39gspca_sonixj-objs := sonixj.o 41gspca_sonixj-objs := sonixj.o
40gspca_spca500-objs := spca500.o 42gspca_spca500-objs := spca500.o
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c
index 219cfa6fb877..8d48ea1742c2 100644
--- a/drivers/media/video/gspca/conex.c
+++ b/drivers/media/video/gspca/conex.c
@@ -846,6 +846,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
846 846
847 /* create the JPEG header */ 847 /* create the JPEG header */
848 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 848 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
849 if (!sd->jpeg_hdr)
850 return -ENOMEM;
849 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 851 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
850 0x22); /* JPEG 411 */ 852 0x22); /* JPEG 411 */
851 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 853 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 1e89600986c8..b8561dfb6c8c 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -727,6 +727,74 @@ static int gspca_get_mode(struct gspca_dev *gspca_dev,
727 return -EINVAL; 727 return -EINVAL;
728} 728}
729 729
730#ifdef CONFIG_VIDEO_ADV_DEBUG
731static int vidioc_g_register(struct file *file, void *priv,
732 struct v4l2_dbg_register *reg)
733{
734 int ret;
735 struct gspca_dev *gspca_dev = priv;
736
737 if (!gspca_dev->sd_desc->get_chip_ident)
738 return -EINVAL;
739
740 if (!gspca_dev->sd_desc->get_register)
741 return -EINVAL;
742
743 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
744 return -ERESTARTSYS;
745 if (gspca_dev->present)
746 ret = gspca_dev->sd_desc->get_register(gspca_dev, reg);
747 else
748 ret = -ENODEV;
749 mutex_unlock(&gspca_dev->usb_lock);
750
751 return ret;
752}
753
754static int vidioc_s_register(struct file *file, void *priv,
755 struct v4l2_dbg_register *reg)
756{
757 int ret;
758 struct gspca_dev *gspca_dev = priv;
759
760 if (!gspca_dev->sd_desc->get_chip_ident)
761 return -EINVAL;
762
763 if (!gspca_dev->sd_desc->set_register)
764 return -EINVAL;
765
766 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
767 return -ERESTARTSYS;
768 if (gspca_dev->present)
769 ret = gspca_dev->sd_desc->set_register(gspca_dev, reg);
770 else
771 ret = -ENODEV;
772 mutex_unlock(&gspca_dev->usb_lock);
773
774 return ret;
775}
776#endif
777
778static int vidioc_g_chip_ident(struct file *file, void *priv,
779 struct v4l2_dbg_chip_ident *chip)
780{
781 int ret;
782 struct gspca_dev *gspca_dev = priv;
783
784 if (!gspca_dev->sd_desc->get_chip_ident)
785 return -EINVAL;
786
787 if (mutex_lock_interruptible(&gspca_dev->usb_lock))
788 return -ERESTARTSYS;
789 if (gspca_dev->present)
790 ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
791 else
792 ret = -ENODEV;
793 mutex_unlock(&gspca_dev->usb_lock);
794
795 return ret;
796}
797
730static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, 798static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
731 struct v4l2_fmtdesc *fmtdesc) 799 struct v4l2_fmtdesc *fmtdesc)
732{ 800{
@@ -1883,6 +1951,11 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
1883 .vidioc_s_parm = vidioc_s_parm, 1951 .vidioc_s_parm = vidioc_s_parm,
1884 .vidioc_s_std = vidioc_s_std, 1952 .vidioc_s_std = vidioc_s_std,
1885 .vidioc_enum_framesizes = vidioc_enum_framesizes, 1953 .vidioc_enum_framesizes = vidioc_enum_framesizes,
1954#ifdef CONFIG_VIDEO_ADV_DEBUG
1955 .vidioc_g_register = vidioc_g_register,
1956 .vidioc_s_register = vidioc_s_register,
1957#endif
1958 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1886#ifdef CONFIG_VIDEO_V4L1_COMPAT 1959#ifdef CONFIG_VIDEO_V4L1_COMPAT
1887 .vidiocgmbuf = vidiocgmbuf, 1960 .vidiocgmbuf = vidiocgmbuf,
1888#endif 1961#endif
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h
index bd1faff88644..46c4effdfcd5 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -69,6 +69,10 @@ typedef void (*cam_v_op) (struct gspca_dev *);
69typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *); 69typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *);
70typedef int (*cam_jpg_op) (struct gspca_dev *, 70typedef int (*cam_jpg_op) (struct gspca_dev *,
71 struct v4l2_jpegcompression *); 71 struct v4l2_jpegcompression *);
72typedef int (*cam_reg_op) (struct gspca_dev *,
73 struct v4l2_dbg_register *);
74typedef int (*cam_ident_op) (struct gspca_dev *,
75 struct v4l2_dbg_chip_ident *);
72typedef int (*cam_streamparm_op) (struct gspca_dev *, 76typedef int (*cam_streamparm_op) (struct gspca_dev *,
73 struct v4l2_streamparm *); 77 struct v4l2_streamparm *);
74typedef int (*cam_qmnu_op) (struct gspca_dev *, 78typedef int (*cam_qmnu_op) (struct gspca_dev *,
@@ -105,6 +109,11 @@ struct sd_desc {
105 cam_qmnu_op querymenu; 109 cam_qmnu_op querymenu;
106 cam_streamparm_op get_streamparm; 110 cam_streamparm_op get_streamparm;
107 cam_streamparm_op set_streamparm; 111 cam_streamparm_op set_streamparm;
112#ifdef CONFIG_VIDEO_ADV_DEBUG
113 cam_reg_op set_register;
114 cam_reg_op get_register;
115#endif
116 cam_ident_op get_chip_ident;
108}; 117};
109 118
110/* packet types when moving from iso buf to frame buf */ 119/* packet types when moving from iso buf to frame buf */
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 191bcd718979..0163903d1c0f 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -476,9 +476,6 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
476 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1); 476 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1);
477 if (err < 0) 477 if (err < 0)
478 return err; 478 return err;
479 err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1);
480 if (err < 0)
481 return err;
482 479
483 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1); 480 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1);
484 if (err < 0) 481 if (err < 0)
@@ -524,9 +521,6 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
524 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1); 521 err = m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &data, 1);
525 if (err < 0) 522 if (err < 0)
526 return err; 523 return err;
527 err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1);
528 if (err < 0)
529 return err;
530 524
531 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1); 525 err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1);
532 if (err < 0) 526 if (err < 0)
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c
index 75e8d14e4ac7..de769caf013d 100644
--- a/drivers/media/video/gspca/mars.c
+++ b/drivers/media/video/gspca/mars.c
@@ -201,6 +201,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
201 201
202 /* create the JPEG header */ 202 /* create the JPEG header */
203 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 203 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
204 if (!sd->jpeg_hdr)
205 return -ENOMEM;
204 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 206 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
205 0x21); /* JPEG 422 */ 207 0x21); /* JPEG 422 */
206 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 208 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
new file mode 100644
index 000000000000..fcfbbd329b4c
--- /dev/null
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -0,0 +1,2434 @@
1/*
2 * Sonix sn9c201 sn9c202 library
3 * Copyright (C) 2008-2009 microdia project <microdia@googlegroups.com>
4 * Copyright (C) 2009 Brian Johnson <brijohn@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
22#include <linux/kthread.h>
23#include <linux/freezer.h>
24#include <linux/usb/input.h>
25#include <linux/input.h>
26#endif
27
28#include "gspca.h"
29#include "jpeg.h"
30
31#include <media/v4l2-chip-ident.h>
32
33MODULE_AUTHOR("Brian Johnson <brijohn@gmail.com>, "
34 "microdia project <microdia@googlegroups.com>");
35MODULE_DESCRIPTION("GSPCA/SN9C20X USB Camera Driver");
36MODULE_LICENSE("GPL");
37
38#define MODULE_NAME "sn9c20x"
39
40#define MODE_RAW 0x10
41#define MODE_JPEG 0x20
42#define MODE_SXGA 0x80
43
44#define SENSOR_OV9650 0
45#define SENSOR_OV9655 1
46#define SENSOR_SOI968 2
47#define SENSOR_OV7660 3
48#define SENSOR_OV7670 4
49#define SENSOR_MT9V011 5
50#define SENSOR_MT9V111 6
51#define SENSOR_MT9V112 7
52#define SENSOR_MT9M001 8
53#define SENSOR_MT9M111 9
54#define SENSOR_HV7131R 10
55#define SENSOR_MT9VPRB 20
56
57/* specific webcam descriptor */
58struct sd {
59 struct gspca_dev gspca_dev;
60
61#define MIN_AVG_LUM 80
62#define MAX_AVG_LUM 130
63 atomic_t avg_lum;
64 u8 old_step;
65 u8 older_step;
66 u8 exposure_step;
67
68 u8 brightness;
69 u8 contrast;
70 u8 saturation;
71 s16 hue;
72 u8 gamma;
73 u8 red;
74 u8 blue;
75
76 u8 hflip;
77 u8 vflip;
78 u8 gain;
79 u16 exposure;
80 u8 auto_exposure;
81
82 u8 i2c_addr;
83 u8 sensor;
84 u8 hstart;
85 u8 vstart;
86
87 u8 *jpeg_hdr;
88 u8 quality;
89
90#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
91 struct input_dev *input_dev;
92 u8 input_gpio;
93 struct task_struct *input_task;
94#endif
95};
96
97static int sd_setbrightness(struct gspca_dev *gspca_dev, s32 val);
98static int sd_getbrightness(struct gspca_dev *gspca_dev, s32 *val);
99static int sd_setcontrast(struct gspca_dev *gspca_dev, s32 val);
100static int sd_getcontrast(struct gspca_dev *gspca_dev, s32 *val);
101static int sd_setsaturation(struct gspca_dev *gspca_dev, s32 val);
102static int sd_getsaturation(struct gspca_dev *gspca_dev, s32 *val);
103static int sd_sethue(struct gspca_dev *gspca_dev, s32 val);
104static int sd_gethue(struct gspca_dev *gspca_dev, s32 *val);
105static int sd_setgamma(struct gspca_dev *gspca_dev, s32 val);
106static int sd_getgamma(struct gspca_dev *gspca_dev, s32 *val);
107static int sd_setredbalance(struct gspca_dev *gspca_dev, s32 val);
108static int sd_getredbalance(struct gspca_dev *gspca_dev, s32 *val);
109static int sd_setbluebalance(struct gspca_dev *gspca_dev, s32 val);
110static int sd_getbluebalance(struct gspca_dev *gspca_dev, s32 *val);
111static int sd_setvflip(struct gspca_dev *gspca_dev, s32 val);
112static int sd_getvflip(struct gspca_dev *gspca_dev, s32 *val);
113static int sd_sethflip(struct gspca_dev *gspca_dev, s32 val);
114static int sd_gethflip(struct gspca_dev *gspca_dev, s32 *val);
115static int sd_setgain(struct gspca_dev *gspca_dev, s32 val);
116static int sd_getgain(struct gspca_dev *gspca_dev, s32 *val);
117static int sd_setexposure(struct gspca_dev *gspca_dev, s32 val);
118static int sd_getexposure(struct gspca_dev *gspca_dev, s32 *val);
119static int sd_setautoexposure(struct gspca_dev *gspca_dev, s32 val);
120static int sd_getautoexposure(struct gspca_dev *gspca_dev, s32 *val);
121
122static struct ctrl sd_ctrls[] = {
123 {
124#define BRIGHTNESS_IDX 0
125 {
126 .id = V4L2_CID_BRIGHTNESS,
127 .type = V4L2_CTRL_TYPE_INTEGER,
128 .name = "Brightness",
129 .minimum = 0,
130 .maximum = 0xff,
131 .step = 1,
132#define BRIGHTNESS_DEFAULT 0x7f
133 .default_value = BRIGHTNESS_DEFAULT,
134 },
135 .set = sd_setbrightness,
136 .get = sd_getbrightness,
137 },
138 {
139#define CONTRAST_IDX 1
140 {
141 .id = V4L2_CID_CONTRAST,
142 .type = V4L2_CTRL_TYPE_INTEGER,
143 .name = "Contrast",
144 .minimum = 0,
145 .maximum = 0xff,
146 .step = 1,
147#define CONTRAST_DEFAULT 0x7f
148 .default_value = CONTRAST_DEFAULT,
149 },
150 .set = sd_setcontrast,
151 .get = sd_getcontrast,
152 },
153 {
154#define SATURATION_IDX 2
155 {
156 .id = V4L2_CID_SATURATION,
157 .type = V4L2_CTRL_TYPE_INTEGER,
158 .name = "Saturation",
159 .minimum = 0,
160 .maximum = 0xff,
161 .step = 1,
162#define SATURATION_DEFAULT 0x7f
163 .default_value = SATURATION_DEFAULT,
164 },
165 .set = sd_setsaturation,
166 .get = sd_getsaturation,
167 },
168 {
169#define HUE_IDX 3
170 {
171 .id = V4L2_CID_HUE,
172 .type = V4L2_CTRL_TYPE_INTEGER,
173 .name = "Hue",
174 .minimum = -180,
175 .maximum = 180,
176 .step = 1,
177#define HUE_DEFAULT 0
178 .default_value = HUE_DEFAULT,
179 },
180 .set = sd_sethue,
181 .get = sd_gethue,
182 },
183 {
184#define GAMMA_IDX 4
185 {
186 .id = V4L2_CID_GAMMA,
187 .type = V4L2_CTRL_TYPE_INTEGER,
188 .name = "Gamma",
189 .minimum = 0,
190 .maximum = 0xff,
191 .step = 1,
192#define GAMMA_DEFAULT 0x10
193 .default_value = GAMMA_DEFAULT,
194 },
195 .set = sd_setgamma,
196 .get = sd_getgamma,
197 },
198 {
199#define BLUE_IDX 5
200 {
201 .id = V4L2_CID_BLUE_BALANCE,
202 .type = V4L2_CTRL_TYPE_INTEGER,
203 .name = "Blue Balance",
204 .minimum = 0,
205 .maximum = 0x7f,
206 .step = 1,
207#define BLUE_DEFAULT 0x28
208 .default_value = BLUE_DEFAULT,
209 },
210 .set = sd_setbluebalance,
211 .get = sd_getbluebalance,
212 },
213 {
214#define RED_IDX 6
215 {
216 .id = V4L2_CID_RED_BALANCE,
217 .type = V4L2_CTRL_TYPE_INTEGER,
218 .name = "Red Balance",
219 .minimum = 0,
220 .maximum = 0x7f,
221 .step = 1,
222#define RED_DEFAULT 0x28
223 .default_value = RED_DEFAULT,
224 },
225 .set = sd_setredbalance,
226 .get = sd_getredbalance,
227 },
228 {
229#define HFLIP_IDX 7
230 {
231 .id = V4L2_CID_HFLIP,
232 .type = V4L2_CTRL_TYPE_BOOLEAN,
233 .name = "Horizontal Flip",
234 .minimum = 0,
235 .maximum = 1,
236 .step = 1,
237#define HFLIP_DEFAULT 0
238 .default_value = HFLIP_DEFAULT,
239 },
240 .set = sd_sethflip,
241 .get = sd_gethflip,
242 },
243 {
244#define VFLIP_IDX 8
245 {
246 .id = V4L2_CID_VFLIP,
247 .type = V4L2_CTRL_TYPE_BOOLEAN,
248 .name = "Vertical Flip",
249 .minimum = 0,
250 .maximum = 1,
251 .step = 1,
252#define VFLIP_DEFAULT 0
253 .default_value = VFLIP_DEFAULT,
254 },
255 .set = sd_setvflip,
256 .get = sd_getvflip,
257 },
258 {
259#define EXPOSURE_IDX 9
260 {
261 .id = V4L2_CID_EXPOSURE,
262 .type = V4L2_CTRL_TYPE_INTEGER,
263 .name = "Exposure",
264 .minimum = 0,
265 .maximum = 0x1780,
266 .step = 1,
267#define EXPOSURE_DEFAULT 0x33
268 .default_value = EXPOSURE_DEFAULT,
269 },
270 .set = sd_setexposure,
271 .get = sd_getexposure,
272 },
273 {
274#define GAIN_IDX 10
275 {
276 .id = V4L2_CID_GAIN,
277 .type = V4L2_CTRL_TYPE_INTEGER,
278 .name = "Gain",
279 .minimum = 0,
280 .maximum = 28,
281 .step = 1,
282#define GAIN_DEFAULT 0x00
283 .default_value = GAIN_DEFAULT,
284 },
285 .set = sd_setgain,
286 .get = sd_getgain,
287 },
288 {
289#define AUTOGAIN_IDX 11
290 {
291 .id = V4L2_CID_AUTOGAIN,
292 .type = V4L2_CTRL_TYPE_BOOLEAN,
293 .name = "Auto Exposure",
294 .minimum = 0,
295 .maximum = 1,
296 .step = 1,
297#define AUTO_EXPOSURE_DEFAULT 1
298 .default_value = AUTO_EXPOSURE_DEFAULT,
299 },
300 .set = sd_setautoexposure,
301 .get = sd_getautoexposure,
302 },
303};
304
305static const struct v4l2_pix_format vga_mode[] = {
306 {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
307 .bytesperline = 240,
308 .sizeimage = 240 * 120,
309 .colorspace = V4L2_COLORSPACE_JPEG,
310 .priv = 0 | MODE_JPEG},
311 {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
312 .bytesperline = 160,
313 .sizeimage = 160 * 120,
314 .colorspace = V4L2_COLORSPACE_SRGB,
315 .priv = 0 | MODE_RAW},
316 {160, 120, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
317 .bytesperline = 240,
318 .sizeimage = 240 * 120,
319 .colorspace = V4L2_COLORSPACE_SRGB,
320 .priv = 0},
321 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
322 .bytesperline = 480,
323 .sizeimage = 480 * 240 ,
324 .colorspace = V4L2_COLORSPACE_JPEG,
325 .priv = 1 | MODE_JPEG},
326 {320, 240, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
327 .bytesperline = 320,
328 .sizeimage = 320 * 240 ,
329 .colorspace = V4L2_COLORSPACE_SRGB,
330 .priv = 1 | MODE_RAW},
331 {320, 240, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
332 .bytesperline = 480,
333 .sizeimage = 480 * 240 ,
334 .colorspace = V4L2_COLORSPACE_SRGB,
335 .priv = 1},
336 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
337 .bytesperline = 960,
338 .sizeimage = 960 * 480,
339 .colorspace = V4L2_COLORSPACE_JPEG,
340 .priv = 2 | MODE_JPEG},
341 {640, 480, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
342 .bytesperline = 640,
343 .sizeimage = 640 * 480,
344 .colorspace = V4L2_COLORSPACE_SRGB,
345 .priv = 2 | MODE_RAW},
346 {640, 480, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
347 .bytesperline = 960,
348 .sizeimage = 960 * 480,
349 .colorspace = V4L2_COLORSPACE_SRGB,
350 .priv = 2},
351};
352
353static const struct v4l2_pix_format sxga_mode[] = {
354 {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
355 .bytesperline = 240,
356 .sizeimage = 240 * 120,
357 .colorspace = V4L2_COLORSPACE_JPEG,
358 .priv = 0 | MODE_JPEG},
359 {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
360 .bytesperline = 160,
361 .sizeimage = 160 * 120,
362 .colorspace = V4L2_COLORSPACE_SRGB,
363 .priv = 0 | MODE_RAW},
364 {160, 120, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
365 .bytesperline = 240,
366 .sizeimage = 240 * 120,
367 .colorspace = V4L2_COLORSPACE_SRGB,
368 .priv = 0},
369 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
370 .bytesperline = 480,
371 .sizeimage = 480 * 240 ,
372 .colorspace = V4L2_COLORSPACE_JPEG,
373 .priv = 1 | MODE_JPEG},
374 {320, 240, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
375 .bytesperline = 320,
376 .sizeimage = 320 * 240 ,
377 .colorspace = V4L2_COLORSPACE_SRGB,
378 .priv = 1 | MODE_RAW},
379 {320, 240, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
380 .bytesperline = 480,
381 .sizeimage = 480 * 240 ,
382 .colorspace = V4L2_COLORSPACE_SRGB,
383 .priv = 1},
384 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
385 .bytesperline = 960,
386 .sizeimage = 960 * 480,
387 .colorspace = V4L2_COLORSPACE_JPEG,
388 .priv = 2 | MODE_JPEG},
389 {640, 480, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
390 .bytesperline = 640,
391 .sizeimage = 640 * 480,
392 .colorspace = V4L2_COLORSPACE_SRGB,
393 .priv = 2 | MODE_RAW},
394 {640, 480, V4L2_PIX_FMT_SN9C20X_I420, V4L2_FIELD_NONE,
395 .bytesperline = 960,
396 .sizeimage = 960 * 480,
397 .colorspace = V4L2_COLORSPACE_SRGB,
398 .priv = 2},
399 {1280, 1024, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
400 .bytesperline = 1280,
401 .sizeimage = (1280 * 1024) + 64,
402 .colorspace = V4L2_COLORSPACE_SRGB,
403 .priv = 3 | MODE_RAW | MODE_SXGA},
404};
405
406static const int hsv_red_x[] = {
407 41, 44, 46, 48, 50, 52, 54, 56,
408 58, 60, 62, 64, 66, 68, 70, 72,
409 74, 76, 78, 80, 81, 83, 85, 87,
410 88, 90, 92, 93, 95, 97, 98, 100,
411 101, 102, 104, 105, 107, 108, 109, 110,
412 112, 113, 114, 115, 116, 117, 118, 119,
413 120, 121, 122, 123, 123, 124, 125, 125,
414 126, 127, 127, 128, 128, 129, 129, 129,
415 130, 130, 130, 130, 131, 131, 131, 131,
416 131, 131, 131, 131, 130, 130, 130, 130,
417 129, 129, 129, 128, 128, 127, 127, 126,
418 125, 125, 124, 123, 122, 122, 121, 120,
419 119, 118, 117, 116, 115, 114, 112, 111,
420 110, 109, 107, 106, 105, 103, 102, 101,
421 99, 98, 96, 94, 93, 91, 90, 88,
422 86, 84, 83, 81, 79, 77, 75, 74,
423 72, 70, 68, 66, 64, 62, 60, 58,
424 56, 54, 52, 49, 47, 45, 43, 41,
425 39, 36, 34, 32, 30, 28, 25, 23,
426 21, 19, 16, 14, 12, 9, 7, 5,
427 3, 0, -1, -3, -6, -8, -10, -12,
428 -15, -17, -19, -22, -24, -26, -28, -30,
429 -33, -35, -37, -39, -41, -44, -46, -48,
430 -50, -52, -54, -56, -58, -60, -62, -64,
431 -66, -68, -70, -72, -74, -76, -78, -80,
432 -81, -83, -85, -87, -88, -90, -92, -93,
433 -95, -97, -98, -100, -101, -102, -104, -105,
434 -107, -108, -109, -110, -112, -113, -114, -115,
435 -116, -117, -118, -119, -120, -121, -122, -123,
436 -123, -124, -125, -125, -126, -127, -127, -128,
437 -128, -128, -128, -128, -128, -128, -128, -128,
438 -128, -128, -128, -128, -128, -128, -128, -128,
439 -128, -128, -128, -128, -128, -128, -128, -128,
440 -128, -127, -127, -126, -125, -125, -124, -123,
441 -122, -122, -121, -120, -119, -118, -117, -116,
442 -115, -114, -112, -111, -110, -109, -107, -106,
443 -105, -103, -102, -101, -99, -98, -96, -94,
444 -93, -91, -90, -88, -86, -84, -83, -81,
445 -79, -77, -75, -74, -72, -70, -68, -66,
446 -64, -62, -60, -58, -56, -54, -52, -49,
447 -47, -45, -43, -41, -39, -36, -34, -32,
448 -30, -28, -25, -23, -21, -19, -16, -14,
449 -12, -9, -7, -5, -3, 0, 1, 3,
450 6, 8, 10, 12, 15, 17, 19, 22,
451 24, 26, 28, 30, 33, 35, 37, 39, 41
452};
453
454static const int hsv_red_y[] = {
455 82, 80, 78, 76, 74, 73, 71, 69,
456 67, 65, 63, 61, 58, 56, 54, 52,
457 50, 48, 46, 44, 41, 39, 37, 35,
458 32, 30, 28, 26, 23, 21, 19, 16,
459 14, 12, 10, 7, 5, 3, 0, -1,
460 -3, -6, -8, -10, -13, -15, -17, -19,
461 -22, -24, -26, -29, -31, -33, -35, -38,
462 -40, -42, -44, -46, -48, -51, -53, -55,
463 -57, -59, -61, -63, -65, -67, -69, -71,
464 -73, -75, -77, -79, -81, -82, -84, -86,
465 -88, -89, -91, -93, -94, -96, -98, -99,
466 -101, -102, -104, -105, -106, -108, -109, -110,
467 -112, -113, -114, -115, -116, -117, -119, -120,
468 -120, -121, -122, -123, -124, -125, -126, -126,
469 -127, -128, -128, -128, -128, -128, -128, -128,
470 -128, -128, -128, -128, -128, -128, -128, -128,
471 -128, -128, -128, -128, -128, -128, -128, -128,
472 -128, -128, -128, -128, -128, -128, -128, -128,
473 -127, -127, -126, -125, -125, -124, -123, -122,
474 -121, -120, -119, -118, -117, -116, -115, -114,
475 -113, -111, -110, -109, -107, -106, -105, -103,
476 -102, -100, -99, -97, -96, -94, -92, -91,
477 -89, -87, -85, -84, -82, -80, -78, -76,
478 -74, -73, -71, -69, -67, -65, -63, -61,
479 -58, -56, -54, -52, -50, -48, -46, -44,
480 -41, -39, -37, -35, -32, -30, -28, -26,
481 -23, -21, -19, -16, -14, -12, -10, -7,
482 -5, -3, 0, 1, 3, 6, 8, 10,
483 13, 15, 17, 19, 22, 24, 26, 29,
484 31, 33, 35, 38, 40, 42, 44, 46,
485 48, 51, 53, 55, 57, 59, 61, 63,
486 65, 67, 69, 71, 73, 75, 77, 79,
487 81, 82, 84, 86, 88, 89, 91, 93,
488 94, 96, 98, 99, 101, 102, 104, 105,
489 106, 108, 109, 110, 112, 113, 114, 115,
490 116, 117, 119, 120, 120, 121, 122, 123,
491 124, 125, 126, 126, 127, 128, 128, 129,
492 129, 130, 130, 131, 131, 131, 131, 132,
493 132, 132, 132, 132, 132, 132, 132, 132,
494 132, 132, 132, 131, 131, 131, 130, 130,
495 130, 129, 129, 128, 127, 127, 126, 125,
496 125, 124, 123, 122, 121, 120, 119, 118,
497 117, 116, 115, 114, 113, 111, 110, 109,
498 107, 106, 105, 103, 102, 100, 99, 97,
499 96, 94, 92, 91, 89, 87, 85, 84, 82
500};
501
502static const int hsv_green_x[] = {
503 -124, -124, -125, -125, -125, -125, -125, -125,
504 -125, -126, -126, -125, -125, -125, -125, -125,
505 -125, -124, -124, -124, -123, -123, -122, -122,
506 -121, -121, -120, -120, -119, -118, -117, -117,
507 -116, -115, -114, -113, -112, -111, -110, -109,
508 -108, -107, -105, -104, -103, -102, -100, -99,
509 -98, -96, -95, -93, -92, -91, -89, -87,
510 -86, -84, -83, -81, -79, -77, -76, -74,
511 -72, -70, -69, -67, -65, -63, -61, -59,
512 -57, -55, -53, -51, -49, -47, -45, -43,
513 -41, -39, -37, -35, -33, -30, -28, -26,
514 -24, -22, -20, -18, -15, -13, -11, -9,
515 -7, -4, -2, 0, 1, 3, 6, 8,
516 10, 12, 14, 17, 19, 21, 23, 25,
517 27, 29, 32, 34, 36, 38, 40, 42,
518 44, 46, 48, 50, 52, 54, 56, 58,
519 60, 62, 64, 66, 68, 70, 71, 73,
520 75, 77, 78, 80, 82, 83, 85, 87,
521 88, 90, 91, 93, 94, 96, 97, 98,
522 100, 101, 102, 104, 105, 106, 107, 108,
523 109, 111, 112, 113, 113, 114, 115, 116,
524 117, 118, 118, 119, 120, 120, 121, 122,
525 122, 123, 123, 124, 124, 124, 125, 125,
526 125, 125, 125, 125, 125, 126, 126, 125,
527 125, 125, 125, 125, 125, 124, 124, 124,
528 123, 123, 122, 122, 121, 121, 120, 120,
529 119, 118, 117, 117, 116, 115, 114, 113,
530 112, 111, 110, 109, 108, 107, 105, 104,
531 103, 102, 100, 99, 98, 96, 95, 93,
532 92, 91, 89, 87, 86, 84, 83, 81,
533 79, 77, 76, 74, 72, 70, 69, 67,
534 65, 63, 61, 59, 57, 55, 53, 51,
535 49, 47, 45, 43, 41, 39, 37, 35,
536 33, 30, 28, 26, 24, 22, 20, 18,
537 15, 13, 11, 9, 7, 4, 2, 0,
538 -1, -3, -6, -8, -10, -12, -14, -17,
539 -19, -21, -23, -25, -27, -29, -32, -34,
540 -36, -38, -40, -42, -44, -46, -48, -50,
541 -52, -54, -56, -58, -60, -62, -64, -66,
542 -68, -70, -71, -73, -75, -77, -78, -80,
543 -82, -83, -85, -87, -88, -90, -91, -93,
544 -94, -96, -97, -98, -100, -101, -102, -104,
545 -105, -106, -107, -108, -109, -111, -112, -113,
546 -113, -114, -115, -116, -117, -118, -118, -119,
547 -120, -120, -121, -122, -122, -123, -123, -124, -124
548};
549
550static const int hsv_green_y[] = {
551 -100, -99, -98, -97, -95, -94, -93, -91,
552 -90, -89, -87, -86, -84, -83, -81, -80,
553 -78, -76, -75, -73, -71, -70, -68, -66,
554 -64, -63, -61, -59, -57, -55, -53, -51,
555 -49, -48, -46, -44, -42, -40, -38, -36,
556 -34, -32, -30, -27, -25, -23, -21, -19,
557 -17, -15, -13, -11, -9, -7, -4, -2,
558 0, 1, 3, 5, 7, 9, 11, 14,
559 16, 18, 20, 22, 24, 26, 28, 30,
560 32, 34, 36, 38, 40, 42, 44, 46,
561 48, 50, 52, 54, 56, 58, 59, 61,
562 63, 65, 67, 68, 70, 72, 74, 75,
563 77, 78, 80, 82, 83, 85, 86, 88,
564 89, 90, 92, 93, 95, 96, 97, 98,
565 100, 101, 102, 103, 104, 105, 106, 107,
566 108, 109, 110, 111, 112, 112, 113, 114,
567 115, 115, 116, 116, 117, 117, 118, 118,
568 119, 119, 119, 120, 120, 120, 120, 120,
569 121, 121, 121, 121, 121, 121, 120, 120,
570 120, 120, 120, 119, 119, 119, 118, 118,
571 117, 117, 116, 116, 115, 114, 114, 113,
572 112, 111, 111, 110, 109, 108, 107, 106,
573 105, 104, 103, 102, 100, 99, 98, 97,
574 95, 94, 93, 91, 90, 89, 87, 86,
575 84, 83, 81, 80, 78, 76, 75, 73,
576 71, 70, 68, 66, 64, 63, 61, 59,
577 57, 55, 53, 51, 49, 48, 46, 44,
578 42, 40, 38, 36, 34, 32, 30, 27,
579 25, 23, 21, 19, 17, 15, 13, 11,
580 9, 7, 4, 2, 0, -1, -3, -5,
581 -7, -9, -11, -14, -16, -18, -20, -22,
582 -24, -26, -28, -30, -32, -34, -36, -38,
583 -40, -42, -44, -46, -48, -50, -52, -54,
584 -56, -58, -59, -61, -63, -65, -67, -68,
585 -70, -72, -74, -75, -77, -78, -80, -82,
586 -83, -85, -86, -88, -89, -90, -92, -93,
587 -95, -96, -97, -98, -100, -101, -102, -103,
588 -104, -105, -106, -107, -108, -109, -110, -111,
589 -112, -112, -113, -114, -115, -115, -116, -116,
590 -117, -117, -118, -118, -119, -119, -119, -120,
591 -120, -120, -120, -120, -121, -121, -121, -121,
592 -121, -121, -120, -120, -120, -120, -120, -119,
593 -119, -119, -118, -118, -117, -117, -116, -116,
594 -115, -114, -114, -113, -112, -111, -111, -110,
595 -109, -108, -107, -106, -105, -104, -103, -102, -100
596};
597
598static const int hsv_blue_x[] = {
599 112, 113, 114, 114, 115, 116, 117, 117,
600 118, 118, 119, 119, 120, 120, 120, 121,
601 121, 121, 122, 122, 122, 122, 122, 122,
602 122, 122, 122, 122, 122, 122, 121, 121,
603 121, 120, 120, 120, 119, 119, 118, 118,
604 117, 116, 116, 115, 114, 113, 113, 112,
605 111, 110, 109, 108, 107, 106, 105, 104,
606 103, 102, 100, 99, 98, 97, 95, 94,
607 93, 91, 90, 88, 87, 85, 84, 82,
608 80, 79, 77, 76, 74, 72, 70, 69,
609 67, 65, 63, 61, 60, 58, 56, 54,
610 52, 50, 48, 46, 44, 42, 40, 38,
611 36, 34, 32, 30, 28, 26, 24, 22,
612 19, 17, 15, 13, 11, 9, 7, 5,
613 2, 0, -1, -3, -5, -7, -9, -12,
614 -14, -16, -18, -20, -22, -24, -26, -28,
615 -31, -33, -35, -37, -39, -41, -43, -45,
616 -47, -49, -51, -53, -54, -56, -58, -60,
617 -62, -64, -66, -67, -69, -71, -73, -74,
618 -76, -78, -79, -81, -83, -84, -86, -87,
619 -89, -90, -92, -93, -94, -96, -97, -98,
620 -99, -101, -102, -103, -104, -105, -106, -107,
621 -108, -109, -110, -111, -112, -113, -114, -114,
622 -115, -116, -117, -117, -118, -118, -119, -119,
623 -120, -120, -120, -121, -121, -121, -122, -122,
624 -122, -122, -122, -122, -122, -122, -122, -122,
625 -122, -122, -121, -121, -121, -120, -120, -120,
626 -119, -119, -118, -118, -117, -116, -116, -115,
627 -114, -113, -113, -112, -111, -110, -109, -108,
628 -107, -106, -105, -104, -103, -102, -100, -99,
629 -98, -97, -95, -94, -93, -91, -90, -88,
630 -87, -85, -84, -82, -80, -79, -77, -76,
631 -74, -72, -70, -69, -67, -65, -63, -61,
632 -60, -58, -56, -54, -52, -50, -48, -46,
633 -44, -42, -40, -38, -36, -34, -32, -30,
634 -28, -26, -24, -22, -19, -17, -15, -13,
635 -11, -9, -7, -5, -2, 0, 1, 3,
636 5, 7, 9, 12, 14, 16, 18, 20,
637 22, 24, 26, 28, 31, 33, 35, 37,
638 39, 41, 43, 45, 47, 49, 51, 53,
639 54, 56, 58, 60, 62, 64, 66, 67,
640 69, 71, 73, 74, 76, 78, 79, 81,
641 83, 84, 86, 87, 89, 90, 92, 93,
642 94, 96, 97, 98, 99, 101, 102, 103,
643 104, 105, 106, 107, 108, 109, 110, 111, 112
644};
645
646static const int hsv_blue_y[] = {
647 -11, -13, -15, -17, -19, -21, -23, -25,
648 -27, -29, -31, -33, -35, -37, -39, -41,
649 -43, -45, -46, -48, -50, -52, -54, -55,
650 -57, -59, -61, -62, -64, -66, -67, -69,
651 -71, -72, -74, -75, -77, -78, -80, -81,
652 -83, -84, -86, -87, -88, -90, -91, -92,
653 -93, -95, -96, -97, -98, -99, -100, -101,
654 -102, -103, -104, -105, -106, -106, -107, -108,
655 -109, -109, -110, -111, -111, -112, -112, -113,
656 -113, -114, -114, -114, -115, -115, -115, -115,
657 -116, -116, -116, -116, -116, -116, -116, -116,
658 -116, -115, -115, -115, -115, -114, -114, -114,
659 -113, -113, -112, -112, -111, -111, -110, -110,
660 -109, -108, -108, -107, -106, -105, -104, -103,
661 -102, -101, -100, -99, -98, -97, -96, -95,
662 -94, -93, -91, -90, -89, -88, -86, -85,
663 -84, -82, -81, -79, -78, -76, -75, -73,
664 -71, -70, -68, -67, -65, -63, -62, -60,
665 -58, -56, -55, -53, -51, -49, -47, -45,
666 -44, -42, -40, -38, -36, -34, -32, -30,
667 -28, -26, -24, -22, -20, -18, -16, -14,
668 -12, -10, -8, -6, -4, -2, 0, 1,
669 3, 5, 7, 9, 11, 13, 15, 17,
670 19, 21, 23, 25, 27, 29, 31, 33,
671 35, 37, 39, 41, 43, 45, 46, 48,
672 50, 52, 54, 55, 57, 59, 61, 62,
673 64, 66, 67, 69, 71, 72, 74, 75,
674 77, 78, 80, 81, 83, 84, 86, 87,
675 88, 90, 91, 92, 93, 95, 96, 97,
676 98, 99, 100, 101, 102, 103, 104, 105,
677 106, 106, 107, 108, 109, 109, 110, 111,
678 111, 112, 112, 113, 113, 114, 114, 114,
679 115, 115, 115, 115, 116, 116, 116, 116,
680 116, 116, 116, 116, 116, 115, 115, 115,
681 115, 114, 114, 114, 113, 113, 112, 112,
682 111, 111, 110, 110, 109, 108, 108, 107,
683 106, 105, 104, 103, 102, 101, 100, 99,
684 98, 97, 96, 95, 94, 93, 91, 90,
685 89, 88, 86, 85, 84, 82, 81, 79,
686 78, 76, 75, 73, 71, 70, 68, 67,
687 65, 63, 62, 60, 58, 56, 55, 53,
688 51, 49, 47, 45, 44, 42, 40, 38,
689 36, 34, 32, 30, 28, 26, 24, 22,
690 20, 18, 16, 14, 12, 10, 8, 6,
691 4, 2, 0, -1, -3, -5, -7, -9, -11
692};
693
694static u16 i2c_ident[] = {
695 V4L2_IDENT_OV9650,
696 V4L2_IDENT_OV9655,
697 V4L2_IDENT_SOI968,
698 V4L2_IDENT_OV7660,
699 V4L2_IDENT_OV7670,
700 V4L2_IDENT_MT9V011,
701 V4L2_IDENT_MT9V111,
702 V4L2_IDENT_MT9V112,
703 V4L2_IDENT_MT9M001C12ST,
704 V4L2_IDENT_MT9M111,
705 V4L2_IDENT_HV7131R,
706};
707
708static u16 bridge_init[][2] = {
709 {0x1000, 0x78}, {0x1001, 0x40}, {0x1002, 0x1c},
710 {0x1020, 0x80}, {0x1061, 0x01}, {0x1067, 0x40},
711 {0x1068, 0x30}, {0x1069, 0x20}, {0x106a, 0x10},
712 {0x106b, 0x08}, {0x1188, 0x87}, {0x11a1, 0x00},
713 {0x11a2, 0x00}, {0x11a3, 0x6a}, {0x11a4, 0x50},
714 {0x11ab, 0x00}, {0x11ac, 0x00}, {0x11ad, 0x50},
715 {0x11ae, 0x3c}, {0x118a, 0x04}, {0x0395, 0x04},
716 {0x11b8, 0x3a}, {0x118b, 0x0e}, {0x10f7, 0x05},
717 {0x10f8, 0x14}, {0x10fa, 0xff}, {0x10f9, 0x00},
718 {0x11ba, 0x0a}, {0x11a5, 0x2d}, {0x11a6, 0x2d},
719 {0x11a7, 0x3a}, {0x11a8, 0x05}, {0x11a9, 0x04},
720 {0x11aa, 0x3f}, {0x11af, 0x28}, {0x11b0, 0xd8},
721 {0x11b1, 0x14}, {0x11b2, 0xec}, {0x11b3, 0x32},
722 {0x11b4, 0xdd}, {0x11b5, 0x32}, {0x11b6, 0xdd},
723 {0x10e0, 0x2c}, {0x11bc, 0x40}, {0x11bd, 0x01},
724 {0x11be, 0xf0}, {0x11bf, 0x00}, {0x118c, 0x1f},
725 {0x118d, 0x1f}, {0x118e, 0x1f}, {0x118f, 0x1f},
726 {0x1180, 0x01}, {0x1181, 0x00}, {0x1182, 0x01},
727 {0x1183, 0x00}, {0x1184, 0x50}, {0x1185, 0x80}
728};
729
730/* Gain = (bit[3:0] / 16 + 1) * (bit[4] + 1) * (bit[5] + 1) * (bit[6] + 1) */
731static u8 ov_gain[] = {
732 0x00 /* 1x */, 0x04 /* 1.25x */, 0x08 /* 1.5x */, 0x0c /* 1.75x */,
733 0x10 /* 2x */, 0x12 /* 2.25x */, 0x14 /* 2.5x */, 0x16 /* 2.75x */,
734 0x18 /* 3x */, 0x1a /* 3.25x */, 0x1c /* 3.5x */, 0x1e /* 3.75x */,
735 0x30 /* 4x */, 0x31 /* 4.25x */, 0x32 /* 4.5x */, 0x33 /* 4.75x */,
736 0x34 /* 5x */, 0x35 /* 5.25x */, 0x36 /* 5.5x */, 0x37 /* 5.75x */,
737 0x38 /* 6x */, 0x39 /* 6.25x */, 0x3a /* 6.5x */, 0x3b /* 6.75x */,
738 0x3c /* 7x */, 0x3d /* 7.25x */, 0x3e /* 7.5x */, 0x3f /* 7.75x */,
739 0x70 /* 8x */
740};
741
742/* Gain = (bit[8] + 1) * (bit[7] + 1) * (bit[6:0] * 0.03125) */
743static u16 micron1_gain[] = {
744 /* 1x 1.25x 1.5x 1.75x */
745 0x0020, 0x0028, 0x0030, 0x0038,
746 /* 2x 2.25x 2.5x 2.75x */
747 0x00a0, 0x00a4, 0x00a8, 0x00ac,
748 /* 3x 3.25x 3.5x 3.75x */
749 0x00b0, 0x00b4, 0x00b8, 0x00bc,
750 /* 4x 4.25x 4.5x 4.75x */
751 0x00c0, 0x00c4, 0x00c8, 0x00cc,
752 /* 5x 5.25x 5.5x 5.75x */
753 0x00d0, 0x00d4, 0x00d8, 0x00dc,
754 /* 6x 6.25x 6.5x 6.75x */
755 0x00e0, 0x00e4, 0x00e8, 0x00ec,
756 /* 7x 7.25x 7.5x 7.75x */
757 0x00f0, 0x00f4, 0x00f8, 0x00fc,
758 /* 8x */
759 0x01c0
760};
761
762/* mt9m001 sensor uses a different gain formula then other micron sensors */
763/* Gain = (bit[6] + 1) * (bit[5-0] * 0.125) */
764static u16 micron2_gain[] = {
765 /* 1x 1.25x 1.5x 1.75x */
766 0x0008, 0x000a, 0x000c, 0x000e,
767 /* 2x 2.25x 2.5x 2.75x */
768 0x0010, 0x0012, 0x0014, 0x0016,
769 /* 3x 3.25x 3.5x 3.75x */
770 0x0018, 0x001a, 0x001c, 0x001e,
771 /* 4x 4.25x 4.5x 4.75x */
772 0x0020, 0x0051, 0x0052, 0x0053,
773 /* 5x 5.25x 5.5x 5.75x */
774 0x0054, 0x0055, 0x0056, 0x0057,
775 /* 6x 6.25x 6.5x 6.75x */
776 0x0058, 0x0059, 0x005a, 0x005b,
777 /* 7x 7.25x 7.5x 7.75x */
778 0x005c, 0x005d, 0x005e, 0x005f,
779 /* 8x */
780 0x0060
781};
782
783/* Gain = .5 + bit[7:0] / 16 */
784static u8 hv7131r_gain[] = {
785 0x08 /* 1x */, 0x0c /* 1.25x */, 0x10 /* 1.5x */, 0x14 /* 1.75x */,
786 0x18 /* 2x */, 0x1c /* 2.25x */, 0x20 /* 2.5x */, 0x24 /* 2.75x */,
787 0x28 /* 3x */, 0x2c /* 3.25x */, 0x30 /* 3.5x */, 0x34 /* 3.75x */,
788 0x38 /* 4x */, 0x3c /* 4.25x */, 0x40 /* 4.5x */, 0x44 /* 4.75x */,
789 0x48 /* 5x */, 0x4c /* 5.25x */, 0x50 /* 5.5x */, 0x54 /* 5.75x */,
790 0x58 /* 6x */, 0x5c /* 6.25x */, 0x60 /* 6.5x */, 0x64 /* 6.75x */,
791 0x68 /* 7x */, 0x6c /* 7.25x */, 0x70 /* 7.5x */, 0x74 /* 7.75x */,
792 0x78 /* 8x */
793};
794
795static u8 soi968_init[][2] = {
796 {0x12, 0x80}, {0x0c, 0x00}, {0x0f, 0x1f},
797 {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00},
798 {0x33, 0x08}, {0x35, 0x8c}, {0x36, 0x0c},
799 {0x37, 0x04}, {0x45, 0x04}, {0x47, 0xff},
800 {0x3e, 0x00}, {0x3f, 0x00}, {0x3b, 0x20},
801 {0x3a, 0x96}, {0x3d, 0x0a}, {0x14, 0x8e},
802 {0x13, 0x8a}, {0x12, 0x40}, {0x17, 0x13},
803 {0x18, 0x63}, {0x19, 0x01}, {0x1a, 0x79},
804 {0x32, 0x24}, {0x03, 0x00}, {0x11, 0x40},
805 {0x2a, 0x10}, {0x2b, 0xe0}, {0x10, 0x32},
806 {0x00, 0x00}, {0x01, 0x80}, {0x02, 0x80},
807};
808
809static u8 ov7660_init[][2] = {
810 {0x0e, 0x80}, {0x0d, 0x08}, {0x0f, 0xc3},
811 {0x04, 0xc3}, {0x10, 0x40}, {0x11, 0x40},
812 {0x12, 0x05}, {0x13, 0xba}, {0x14, 0x2a},
813 {0x37, 0x0f}, {0x38, 0x02}, {0x39, 0x43},
814 {0x3a, 0x00}, {0x69, 0x90}, {0x2d, 0xf6},
815 {0x2e, 0x0b}, {0x01, 0x78}, {0x02, 0x50},
816};
817
818static u8 ov7670_init[][2] = {
819 {0x12, 0x80}, {0x11, 0x80}, {0x3a, 0x04}, {0x12, 0x01},
820 {0x32, 0xb6}, {0x03, 0x0a}, {0x0c, 0x00}, {0x3e, 0x00},
821 {0x70, 0x3a}, {0x71, 0x35}, {0x72, 0x11}, {0x73, 0xf0},
822 {0xa2, 0x02}, {0x13, 0xe0}, {0x00, 0x00}, {0x10, 0x00},
823 {0x0d, 0x40}, {0x14, 0x28}, {0xa5, 0x05}, {0xab, 0x07},
824 {0x24, 0x95}, {0x25, 0x33}, {0x26, 0xe3}, {0x9f, 0x75},
825 {0xa0, 0x65}, {0xa1, 0x0b}, {0xa6, 0xd8}, {0xa7, 0xd8},
826 {0xa8, 0xf0}, {0xa9, 0x90}, {0xaa, 0x94}, {0x13, 0xe5},
827 {0x0e, 0x61}, {0x0f, 0x4b}, {0x16, 0x02}, {0x1e, 0x27},
828 {0x21, 0x02}, {0x22, 0x91}, {0x29, 0x07}, {0x33, 0x0b},
829 {0x35, 0x0b}, {0x37, 0x1d}, {0x38, 0x71}, {0x39, 0x2a},
830 {0x3c, 0x78}, {0x4d, 0x40}, {0x4e, 0x20}, {0x69, 0x00},
831 {0x74, 0x19}, {0x8d, 0x4f}, {0x8e, 0x00}, {0x8f, 0x00},
832 {0x90, 0x00}, {0x91, 0x00}, {0x96, 0x00}, {0x9a, 0x80},
833 {0xb0, 0x84}, {0xb1, 0x0c}, {0xb2, 0x0e}, {0xb3, 0x82},
834 {0xb8, 0x0a}, {0x43, 0x0a}, {0x44, 0xf0}, {0x45, 0x20},
835 {0x46, 0x7d}, {0x47, 0x29}, {0x48, 0x4a}, {0x59, 0x8c},
836 {0x5a, 0xa5}, {0x5b, 0xde}, {0x5c, 0x96}, {0x5d, 0x66},
837 {0x5e, 0x10}, {0x6c, 0x0a}, {0x6d, 0x55}, {0x6e, 0x11},
838 {0x6f, 0x9e}, {0x6a, 0x40}, {0x01, 0x40}, {0x02, 0x40},
839 {0x13, 0xe7}, {0x4f, 0x6e}, {0x50, 0x70}, {0x51, 0x02},
840 {0x52, 0x1d}, {0x53, 0x56}, {0x54, 0x73}, {0x55, 0x0a},
841 {0x56, 0x55}, {0x57, 0x80}, {0x58, 0x9e}, {0x41, 0x08},
842 {0x3f, 0x02}, {0x75, 0x03}, {0x76, 0x63}, {0x4c, 0x04},
843 {0x77, 0x06}, {0x3d, 0x02}, {0x4b, 0x09}, {0xc9, 0x30},
844 {0x41, 0x08}, {0x56, 0x48}, {0x34, 0x11}, {0xa4, 0x88},
845 {0x96, 0x00}, {0x97, 0x30}, {0x98, 0x20}, {0x99, 0x30},
846 {0x9a, 0x84}, {0x9b, 0x29}, {0x9c, 0x03}, {0x9d, 0x99},
847 {0x9e, 0x7f}, {0x78, 0x04}, {0x79, 0x01}, {0xc8, 0xf0},
848 {0x79, 0x0f}, {0xc8, 0x00}, {0x79, 0x10}, {0xc8, 0x7e},
849 {0x79, 0x0a}, {0xc8, 0x80}, {0x79, 0x0b}, {0xc8, 0x01},
850 {0x79, 0x0c}, {0xc8, 0x0f}, {0x79, 0x0d}, {0xc8, 0x20},
851 {0x79, 0x09}, {0xc8, 0x80}, {0x79, 0x02}, {0xc8, 0xc0},
852 {0x79, 0x03}, {0xc8, 0x40}, {0x79, 0x05}, {0xc8, 0x30},
853 {0x79, 0x26}, {0x62, 0x20}, {0x63, 0x00}, {0x64, 0x06},
854 {0x65, 0x00}, {0x66, 0x05}, {0x94, 0x05}, {0x95, 0x0a},
855 {0x17, 0x13}, {0x18, 0x01}, {0x19, 0x02}, {0x1a, 0x7a},
856 {0x46, 0x59}, {0x47, 0x30}, {0x58, 0x9a}, {0x59, 0x84},
857 {0x5a, 0x91}, {0x5b, 0x57}, {0x5c, 0x75}, {0x5d, 0x6d},
858 {0x5e, 0x13}, {0x64, 0x07}, {0x94, 0x07}, {0x95, 0x0d},
859 {0xa6, 0xdf}, {0xa7, 0xdf}, {0x48, 0x4d}, {0x51, 0x00},
860 {0x6b, 0x0a}, {0x11, 0x80}, {0x2a, 0x00}, {0x2b, 0x00},
861 {0x92, 0x00}, {0x93, 0x00}, {0x55, 0x0a}, {0x56, 0x60},
862 {0x4f, 0x6e}, {0x50, 0x70}, {0x51, 0x00}, {0x52, 0x1d},
863 {0x53, 0x56}, {0x54, 0x73}, {0x58, 0x9a}, {0x4f, 0x6e},
864 {0x50, 0x70}, {0x51, 0x00}, {0x52, 0x1d}, {0x53, 0x56},
865 {0x54, 0x73}, {0x58, 0x9a}, {0x3f, 0x01}, {0x7b, 0x03},
866 {0x7c, 0x09}, {0x7d, 0x16}, {0x7e, 0x38}, {0x7f, 0x47},
867 {0x80, 0x53}, {0x81, 0x5e}, {0x82, 0x6a}, {0x83, 0x74},
868 {0x84, 0x80}, {0x85, 0x8c}, {0x86, 0x9b}, {0x87, 0xb2},
869 {0x88, 0xcc}, {0x89, 0xe5}, {0x7a, 0x24}, {0x3b, 0x00},
870 {0x9f, 0x76}, {0xa0, 0x65}, {0x13, 0xe2}, {0x6b, 0x0a},
871 {0x11, 0x80}, {0x2a, 0x00}, {0x2b, 0x00}, {0x92, 0x00},
872 {0x93, 0x00},
873};
874
875static u8 ov9650_init[][2] = {
876 {0x12, 0x80}, {0x00, 0x00}, {0x01, 0x78},
877 {0x02, 0x78}, {0x03, 0x36}, {0x04, 0x03},
878 {0x05, 0x00}, {0x06, 0x00}, {0x08, 0x00},
879 {0x09, 0x01}, {0x0c, 0x00}, {0x0d, 0x00},
880 {0x0e, 0xa0}, {0x0f, 0x52}, {0x10, 0x7c},
881 {0x11, 0x80}, {0x12, 0x45}, {0x13, 0xc2},
882 {0x14, 0x2e}, {0x15, 0x00}, {0x16, 0x07},
883 {0x17, 0x24}, {0x18, 0xc5}, {0x19, 0x00},
884 {0x1a, 0x3c}, {0x1b, 0x00}, {0x1e, 0x04},
885 {0x1f, 0x00}, {0x24, 0x78}, {0x25, 0x68},
886 {0x26, 0xd4}, {0x27, 0x80}, {0x28, 0x80},
887 {0x29, 0x30}, {0x2a, 0x00}, {0x2b, 0x00},
888 {0x2c, 0x80}, {0x2d, 0x00}, {0x2e, 0x00},
889 {0x2f, 0x00}, {0x30, 0x08}, {0x31, 0x30},
890 {0x32, 0x84}, {0x33, 0xe2}, {0x34, 0xbf},
891 {0x35, 0x81}, {0x36, 0xf9}, {0x37, 0x00},
892 {0x38, 0x93}, {0x39, 0x50}, {0x3a, 0x01},
893 {0x3b, 0x01}, {0x3c, 0x73}, {0x3d, 0x19},
894 {0x3e, 0x0b}, {0x3f, 0x80}, {0x40, 0xc1},
895 {0x41, 0x00}, {0x42, 0x08}, {0x67, 0x80},
896 {0x68, 0x80}, {0x69, 0x40}, {0x6a, 0x00},
897 {0x6b, 0x0a}, {0x8b, 0x06}, {0x8c, 0x20},
898 {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0xdf},
899 {0x92, 0x00}, {0x93, 0x00}, {0x94, 0x88},
900 {0x95, 0x88}, {0x96, 0x04}, {0xa1, 0x00},
901 {0xa5, 0x80}, {0xa8, 0x80}, {0xa9, 0xb8},
902 {0xaa, 0x92}, {0xab, 0x0a},
903};
904
905static u8 ov9655_init[][2] = {
906 {0x12, 0x80}, {0x12, 0x01}, {0x0d, 0x00}, {0x0e, 0x61},
907 {0x11, 0x80}, {0x13, 0xba}, {0x14, 0x2e}, {0x16, 0x24},
908 {0x1e, 0x04}, {0x1e, 0x04}, {0x1e, 0x04}, {0x27, 0x08},
909 {0x28, 0x08}, {0x29, 0x15}, {0x2c, 0x08}, {0x32, 0xbf},
910 {0x34, 0x3d}, {0x35, 0x00}, {0x36, 0xf8}, {0x38, 0x12},
911 {0x39, 0x57}, {0x3a, 0x00}, {0x3b, 0xcc}, {0x3c, 0x0c},
912 {0x3d, 0x19}, {0x3e, 0x0c}, {0x3f, 0x01}, {0x41, 0x40},
913 {0x42, 0x80}, {0x45, 0x46}, {0x46, 0x62}, {0x47, 0x2a},
914 {0x48, 0x3c}, {0x4a, 0xf0}, {0x4b, 0xdc}, {0x4c, 0xdc},
915 {0x4d, 0xdc}, {0x4e, 0xdc}, {0x69, 0x02}, {0x6c, 0x04},
916 {0x6f, 0x9e}, {0x70, 0x05}, {0x71, 0x78}, {0x77, 0x02},
917 {0x8a, 0x23}, {0x8c, 0x0d}, {0x90, 0x7e}, {0x91, 0x7c},
918 {0x9f, 0x6e}, {0xa0, 0x6e}, {0xa5, 0x68}, {0xa6, 0x60},
919 {0xa8, 0xc1}, {0xa9, 0xfa}, {0xaa, 0x92}, {0xab, 0x04},
920 {0xac, 0x80}, {0xad, 0x80}, {0xae, 0x80}, {0xaf, 0x80},
921 {0xb2, 0xf2}, {0xb3, 0x20}, {0xb5, 0x00}, {0xb6, 0xaf},
922 {0xbb, 0xae}, {0xbc, 0x44}, {0xbd, 0x44}, {0xbe, 0x3b},
923 {0xbf, 0x3a}, {0xc0, 0xe2}, {0xc1, 0xc8}, {0xc2, 0x01},
924 {0xc4, 0x00}, {0xc6, 0x85}, {0xc7, 0x81}, {0xc9, 0xe0},
925 {0xca, 0xe8}, {0xcc, 0xd8}, {0xcd, 0x93}, {0x12, 0x61},
926 {0x36, 0xfa}, {0x8c, 0x8d}, {0xc0, 0xaa}, {0x69, 0x0a},
927 {0x03, 0x12}, {0x17, 0x14}, {0x18, 0x00}, {0x19, 0x01},
928 {0x1a, 0x3d}, {0x32, 0xbf}, {0x11, 0x80}, {0x2a, 0x10},
929 {0x2b, 0x0a}, {0x92, 0x00}, {0x93, 0x00}, {0x1e, 0x04},
930 {0x1e, 0x04}, {0x10, 0x7c}, {0x04, 0x03}, {0xa1, 0x00},
931 {0x2d, 0x00}, {0x2e, 0x00}, {0x00, 0x00}, {0x01, 0x80},
932 {0x02, 0x80}, {0x12, 0x61}, {0x36, 0xfa}, {0x8c, 0x8d},
933 {0xc0, 0xaa}, {0x69, 0x0a}, {0x03, 0x12}, {0x17, 0x14},
934 {0x18, 0x00}, {0x19, 0x01}, {0x1a, 0x3d}, {0x32, 0xbf},
935 {0x11, 0x80}, {0x2a, 0x10}, {0x2b, 0x0a}, {0x92, 0x00},
936 {0x93, 0x00}, {0x04, 0x01}, {0x10, 0x1f}, {0xa1, 0x00},
937 {0x00, 0x0a}, {0xa1, 0x00}, {0x10, 0x5d}, {0x04, 0x03},
938 {0x00, 0x01}, {0xa1, 0x00}, {0x10, 0x7c}, {0x04, 0x03},
939 {0x00, 0x03}, {0x00, 0x0a}, {0x00, 0x10}, {0x00, 0x13},
940};
941
942static u16 mt9v112_init[][2] = {
943 {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0020},
944 {0x34, 0xc019}, {0x0a, 0x0011}, {0x0b, 0x000b},
945 {0x20, 0x0703}, {0x35, 0x2022}, {0xf0, 0x0001},
946 {0x05, 0x0000}, {0x06, 0x340c}, {0x3b, 0x042a},
947 {0x3c, 0x0400}, {0xf0, 0x0002}, {0x2e, 0x0c58},
948 {0x5b, 0x0001}, {0xc8, 0x9f0b}, {0xf0, 0x0001},
949 {0x9b, 0x5300}, {0xf0, 0x0000}, {0x2b, 0x0020},
950 {0x2c, 0x002a}, {0x2d, 0x0032}, {0x2e, 0x0020},
951 {0x09, 0x01dc}, {0x01, 0x000c}, {0x02, 0x0020},
952 {0x03, 0x01e0}, {0x04, 0x0280}, {0x06, 0x000c},
953 {0x05, 0x0098}, {0x20, 0x0703}, {0x09, 0x01f2},
954 {0x2b, 0x00a0}, {0x2c, 0x00a0}, {0x2d, 0x00a0},
955 {0x2e, 0x00a0}, {0x01, 0x000c}, {0x02, 0x0020},
956 {0x03, 0x01e0}, {0x04, 0x0280}, {0x06, 0x000c},
957 {0x05, 0x0098}, {0x09, 0x01c1}, {0x2b, 0x00ae},
958 {0x2c, 0x00ae}, {0x2d, 0x00ae}, {0x2e, 0x00ae},
959};
960
961static u16 mt9v111_init[][2] = {
962 {0x01, 0x0004}, {0x0d, 0x0001}, {0x0d, 0x0000},
963 {0x01, 0x0001}, {0x02, 0x0016}, {0x03, 0x01e1},
964 {0x04, 0x0281}, {0x05, 0x0004}, {0x07, 0x3002},
965 {0x21, 0x0000}, {0x25, 0x4024}, {0x26, 0xff03},
966 {0x27, 0xff10}, {0x2b, 0x7828}, {0x2c, 0xb43c},
967 {0x2d, 0xf0a0}, {0x2e, 0x0c64}, {0x2f, 0x0064},
968 {0x67, 0x4010}, {0x06, 0x301e}, {0x08, 0x0480},
969 {0x01, 0x0004}, {0x02, 0x0016}, {0x03, 0x01e6},
970 {0x04, 0x0286}, {0x05, 0x0004}, {0x06, 0x0000},
971 {0x07, 0x3002}, {0x08, 0x0008}, {0x0c, 0x0000},
972 {0x0d, 0x0000}, {0x0e, 0x0000}, {0x0f, 0x0000},
973 {0x10, 0x0000}, {0x11, 0x0000}, {0x12, 0x00b0},
974 {0x13, 0x007c}, {0x14, 0x0000}, {0x15, 0x0000},
975 {0x16, 0x0000}, {0x17, 0x0000}, {0x18, 0x0000},
976 {0x19, 0x0000}, {0x1a, 0x0000}, {0x1b, 0x0000},
977 {0x1c, 0x0000}, {0x1d, 0x0000}, {0x30, 0x0000},
978 {0x30, 0x0005}, {0x31, 0x0000}, {0x02, 0x0016},
979 {0x03, 0x01e1}, {0x04, 0x0281}, {0x05, 0x0004},
980 {0x06, 0x0000}, {0x07, 0x3002}, {0x06, 0x002d},
981 {0x05, 0x0004}, {0x09, 0x0064}, {0x2b, 0x00a0},
982 {0x2c, 0x00a0}, {0x2d, 0x00a0}, {0x2e, 0x00a0},
983 {0x02, 0x0016}, {0x03, 0x01e1}, {0x04, 0x0281},
984 {0x05, 0x0004}, {0x06, 0x002d}, {0x07, 0x3002},
985 {0x0e, 0x0008}, {0x06, 0x002d}, {0x05, 0x0004},
986};
987
988static u16 mt9v011_init[][2] = {
989 {0x07, 0x0002}, {0x0d, 0x0001}, {0x0d, 0x0000},
990 {0x01, 0x0008}, {0x02, 0x0016}, {0x03, 0x01e1},
991 {0x04, 0x0281}, {0x05, 0x0083}, {0x06, 0x0006},
992 {0x0d, 0x0002}, {0x0a, 0x0000}, {0x0b, 0x0000},
993 {0x0c, 0x0000}, {0x0d, 0x0000}, {0x0e, 0x0000},
994 {0x0f, 0x0000}, {0x10, 0x0000}, {0x11, 0x0000},
995 {0x12, 0x0000}, {0x13, 0x0000}, {0x14, 0x0000},
996 {0x15, 0x0000}, {0x16, 0x0000}, {0x17, 0x0000},
997 {0x18, 0x0000}, {0x19, 0x0000}, {0x1a, 0x0000},
998 {0x1b, 0x0000}, {0x1c, 0x0000}, {0x1d, 0x0000},
999 {0x32, 0x0000}, {0x20, 0x1101}, {0x21, 0x0000},
1000 {0x22, 0x0000}, {0x23, 0x0000}, {0x24, 0x0000},
1001 {0x25, 0x0000}, {0x26, 0x0000}, {0x27, 0x0024},
1002 {0x2f, 0xf7b0}, {0x30, 0x0005}, {0x31, 0x0000},
1003 {0x32, 0x0000}, {0x33, 0x0000}, {0x34, 0x0100},
1004 {0x3d, 0x068f}, {0x40, 0x01e0}, {0x41, 0x00d1},
1005 {0x44, 0x0082}, {0x5a, 0x0000}, {0x5b, 0x0000},
1006 {0x5c, 0x0000}, {0x5d, 0x0000}, {0x5e, 0x0000},
1007 {0x5f, 0xa31d}, {0x62, 0x0611}, {0x0a, 0x0000},
1008 {0x06, 0x0029}, {0x05, 0x0009}, {0x20, 0x1101},
1009 {0x20, 0x1101}, {0x09, 0x0064}, {0x07, 0x0003},
1010 {0x2b, 0x0033}, {0x2c, 0x00a0}, {0x2d, 0x00a0},
1011 {0x2e, 0x0033}, {0x07, 0x0002}, {0x06, 0x0000},
1012 {0x06, 0x0029}, {0x05, 0x0009},
1013};
1014
1015static u16 mt9m001_init[][2] = {
1016 {0x0d, 0x0001}, {0x0d, 0x0000}, {0x01, 0x000e},
1017 {0x02, 0x0014}, {0x03, 0x03c1}, {0x04, 0x0501},
1018 {0x05, 0x0083}, {0x06, 0x0006}, {0x0d, 0x0002},
1019 {0x0a, 0x0000}, {0x0c, 0x0000}, {0x11, 0x0000},
1020 {0x1e, 0x8000}, {0x5f, 0x8904}, {0x60, 0x0000},
1021 {0x61, 0x0000}, {0x62, 0x0498}, {0x63, 0x0000},
1022 {0x64, 0x0000}, {0x20, 0x111d}, {0x06, 0x00f2},
1023 {0x05, 0x0013}, {0x09, 0x10f2}, {0x07, 0x0003},
1024 {0x2b, 0x002a}, {0x2d, 0x002a}, {0x2c, 0x002a},
1025 {0x2e, 0x0029}, {0x07, 0x0002},
1026};
1027
1028static u16 mt9m111_init[][2] = {
1029 {0xf0, 0x0000}, {0x0d, 0x0008}, {0x0d, 0x0009},
1030 {0x0d, 0x0008}, {0xf0, 0x0001}, {0x3a, 0x4300},
1031 {0x9b, 0x4300}, {0xa1, 0x0280}, {0xa4, 0x0200},
1032 {0x06, 0x308e}, {0xf0, 0x0000},
1033};
1034
1035static u8 hv7131r_init[][2] = {
1036 {0x02, 0x08}, {0x02, 0x00}, {0x01, 0x08},
1037 {0x02, 0x00}, {0x20, 0x00}, {0x21, 0xd0},
1038 {0x22, 0x00}, {0x23, 0x09}, {0x01, 0x08},
1039 {0x01, 0x08}, {0x01, 0x08}, {0x25, 0x07},
1040 {0x26, 0xc3}, {0x27, 0x50}, {0x30, 0x62},
1041 {0x31, 0x10}, {0x32, 0x06}, {0x33, 0x10},
1042 {0x20, 0x00}, {0x21, 0xd0}, {0x22, 0x00},
1043 {0x23, 0x09}, {0x01, 0x08},
1044};
1045
1046int reg_r(struct gspca_dev *gspca_dev, u16 reg, u16 length)
1047{
1048 struct usb_device *dev = gspca_dev->dev;
1049 int result;
1050 result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
1051 0x00,
1052 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
1053 reg,
1054 0x00,
1055 gspca_dev->usb_buf,
1056 length,
1057 500);
1058 if (unlikely(result < 0 || result != length)) {
1059 err("Read register failed 0x%02X", reg);
1060 return -EIO;
1061 }
1062 return 0;
1063}
1064
1065int reg_w(struct gspca_dev *gspca_dev, u16 reg, const u8 *buffer, int length)
1066{
1067 struct usb_device *dev = gspca_dev->dev;
1068 int result;
1069 memcpy(gspca_dev->usb_buf, buffer, length);
1070 result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1071 0x08,
1072 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
1073 reg,
1074 0x00,
1075 gspca_dev->usb_buf,
1076 length,
1077 500);
1078 if (unlikely(result < 0 || result != length)) {
1079 err("Write register failed index 0x%02X", reg);
1080 return -EIO;
1081 }
1082 return 0;
1083}
1084
1085int reg_w1(struct gspca_dev *gspca_dev, u16 reg, const u8 value)
1086{
1087 u8 data[1] = {value};
1088 return reg_w(gspca_dev, reg, data, 1);
1089}
1090
1091int i2c_w(struct gspca_dev *gspca_dev, const u8 *buffer)
1092{
1093 int i;
1094 reg_w(gspca_dev, 0x10c0, buffer, 8);
1095 for (i = 0; i < 5; i++) {
1096 reg_r(gspca_dev, 0x10c0, 1);
1097 if (gspca_dev->usb_buf[0] & 0x04) {
1098 if (gspca_dev->usb_buf[0] & 0x08)
1099 return -1;
1100 return 0;
1101 }
1102 msleep(1);
1103 }
1104 return -1;
1105}
1106
1107int i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val)
1108{
1109 struct sd *sd = (struct sd *) gspca_dev;
1110
1111 u8 row[8];
1112
1113 /*
1114 * from the point of view of the bridge, the length
1115 * includes the address
1116 */
1117 row[0] = 0x81 | (2 << 4);
1118 row[1] = sd->i2c_addr;
1119 row[2] = reg;
1120 row[3] = val;
1121 row[4] = 0x00;
1122 row[5] = 0x00;
1123 row[6] = 0x00;
1124 row[7] = 0x10;
1125
1126 return i2c_w(gspca_dev, row);
1127}
1128
1129int i2c_w2(struct gspca_dev *gspca_dev, u8 reg, u16 val)
1130{
1131 struct sd *sd = (struct sd *) gspca_dev;
1132 u8 row[8];
1133
1134 /*
1135 * from the point of view of the bridge, the length
1136 * includes the address
1137 */
1138 row[0] = 0x81 | (3 << 4);
1139 row[1] = sd->i2c_addr;
1140 row[2] = reg;
1141 row[3] = (val >> 8) & 0xff;
1142 row[4] = val & 0xff;
1143 row[5] = 0x00;
1144 row[6] = 0x00;
1145 row[7] = 0x10;
1146
1147 return i2c_w(gspca_dev, row);
1148}
1149
1150int i2c_r1(struct gspca_dev *gspca_dev, u8 reg, u8 *val)
1151{
1152 struct sd *sd = (struct sd *) gspca_dev;
1153 u8 row[8];
1154
1155 row[0] = 0x81 | 0x10;
1156 row[1] = sd->i2c_addr;
1157 row[2] = reg;
1158 row[3] = 0;
1159 row[4] = 0;
1160 row[5] = 0;
1161 row[6] = 0;
1162 row[7] = 0x10;
1163 reg_w(gspca_dev, 0x10c0, row, 8);
1164 msleep(1);
1165 row[0] = 0x81 | (2 << 4) | 0x02;
1166 row[2] = 0;
1167 reg_w(gspca_dev, 0x10c0, row, 8);
1168 msleep(1);
1169 reg_r(gspca_dev, 0x10c2, 5);
1170 *val = gspca_dev->usb_buf[3];
1171 return 0;
1172}
1173
1174int i2c_r2(struct gspca_dev *gspca_dev, u8 reg, u16 *val)
1175{
1176 struct sd *sd = (struct sd *) gspca_dev;
1177 u8 row[8];
1178
1179 row[0] = 0x81 | 0x10;
1180 row[1] = sd->i2c_addr;
1181 row[2] = reg;
1182 row[3] = 0;
1183 row[4] = 0;
1184 row[5] = 0;
1185 row[6] = 0;
1186 row[7] = 0x10;
1187 reg_w(gspca_dev, 0x10c0, row, 8);
1188 msleep(1);
1189 row[0] = 0x81 | (3 << 4) | 0x02;
1190 row[2] = 0;
1191 reg_w(gspca_dev, 0x10c0, row, 8);
1192 msleep(1);
1193 reg_r(gspca_dev, 0x10c2, 5);
1194 *val = (gspca_dev->usb_buf[2] << 8) | gspca_dev->usb_buf[3];
1195 return 0;
1196}
1197
1198static int ov9650_init_sensor(struct gspca_dev *gspca_dev)
1199{
1200 int i;
1201 struct sd *sd = (struct sd *) gspca_dev;
1202
1203 for (i = 0; i < ARRAY_SIZE(ov9650_init); i++) {
1204 if (i2c_w1(gspca_dev, ov9650_init[i][0],
1205 ov9650_init[i][1]) < 0) {
1206 err("OV9650 sensor initialization failed");
1207 return -ENODEV;
1208 }
1209 }
1210 sd->hstart = 1;
1211 sd->vstart = 7;
1212 return 0;
1213}
1214
1215static int ov9655_init_sensor(struct gspca_dev *gspca_dev)
1216{
1217 int i;
1218 struct sd *sd = (struct sd *) gspca_dev;
1219
1220 for (i = 0; i < ARRAY_SIZE(ov9655_init); i++) {
1221 if (i2c_w1(gspca_dev, ov9655_init[i][0],
1222 ov9655_init[i][1]) < 0) {
1223 err("OV9655 sensor initialization failed");
1224 return -ENODEV;
1225 }
1226 }
1227 /* disable hflip and vflip */
1228 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1229 sd->hstart = 0;
1230 sd->vstart = 7;
1231 return 0;
1232}
1233
1234static int soi968_init_sensor(struct gspca_dev *gspca_dev)
1235{
1236 int i;
1237 struct sd *sd = (struct sd *) gspca_dev;
1238
1239 for (i = 0; i < ARRAY_SIZE(soi968_init); i++) {
1240 if (i2c_w1(gspca_dev, soi968_init[i][0],
1241 soi968_init[i][1]) < 0) {
1242 err("SOI968 sensor initialization failed");
1243 return -ENODEV;
1244 }
1245 }
1246 /* disable hflip and vflip */
1247 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1248 sd->hstart = 60;
1249 sd->vstart = 11;
1250 return 0;
1251}
1252
1253static int ov7660_init_sensor(struct gspca_dev *gspca_dev)
1254{
1255 int i;
1256 struct sd *sd = (struct sd *) gspca_dev;
1257
1258 for (i = 0; i < ARRAY_SIZE(ov7660_init); i++) {
1259 if (i2c_w1(gspca_dev, ov7660_init[i][0],
1260 ov7660_init[i][1]) < 0) {
1261 err("OV7660 sensor initialization failed");
1262 return -ENODEV;
1263 }
1264 }
1265 /* disable hflip and vflip */
1266 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1267 sd->hstart = 1;
1268 sd->vstart = 1;
1269 return 0;
1270}
1271
1272static int ov7670_init_sensor(struct gspca_dev *gspca_dev)
1273{
1274 int i;
1275 struct sd *sd = (struct sd *) gspca_dev;
1276
1277 for (i = 0; i < ARRAY_SIZE(ov7670_init); i++) {
1278 if (i2c_w1(gspca_dev, ov7670_init[i][0],
1279 ov7670_init[i][1]) < 0) {
1280 err("OV7670 sensor initialization failed");
1281 return -ENODEV;
1282 }
1283 }
1284 /* disable hflip and vflip */
1285 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1286 sd->hstart = 0;
1287 sd->vstart = 1;
1288 return 0;
1289}
1290
1291static int mt9v_init_sensor(struct gspca_dev *gspca_dev)
1292{
1293 struct sd *sd = (struct sd *) gspca_dev;
1294 int i;
1295 u16 value;
1296 int ret;
1297
1298 sd->i2c_addr = 0x5d;
1299 ret = i2c_r2(gspca_dev, 0xff, &value);
1300 if ((ret == 0) && (value == 0x8243)) {
1301 for (i = 0; i < ARRAY_SIZE(mt9v011_init); i++) {
1302 if (i2c_w2(gspca_dev, mt9v011_init[i][0],
1303 mt9v011_init[i][1]) < 0) {
1304 err("MT9V011 sensor initialization failed");
1305 return -ENODEV;
1306 }
1307 }
1308 sd->hstart = 2;
1309 sd->vstart = 2;
1310 sd->sensor = SENSOR_MT9V011;
1311 info("MT9V011 sensor detected");
1312 return 0;
1313 }
1314
1315 sd->i2c_addr = 0x5c;
1316 i2c_w2(gspca_dev, 0x01, 0x0004);
1317 ret = i2c_r2(gspca_dev, 0xff, &value);
1318 if ((ret == 0) && (value == 0x823a)) {
1319 for (i = 0; i < ARRAY_SIZE(mt9v111_init); i++) {
1320 if (i2c_w2(gspca_dev, mt9v111_init[i][0],
1321 mt9v111_init[i][1]) < 0) {
1322 err("MT9V111 sensor initialization failed");
1323 return -ENODEV;
1324 }
1325 }
1326 sd->hstart = 2;
1327 sd->vstart = 2;
1328 sd->sensor = SENSOR_MT9V111;
1329 info("MT9V111 sensor detected");
1330 return 0;
1331 }
1332
1333 sd->i2c_addr = 0x5d;
1334 ret = i2c_w2(gspca_dev, 0xf0, 0x0000);
1335 if (ret < 0) {
1336 sd->i2c_addr = 0x48;
1337 i2c_w2(gspca_dev, 0xf0, 0x0000);
1338 }
1339 ret = i2c_r2(gspca_dev, 0x00, &value);
1340 if ((ret == 0) && (value == 0x1229)) {
1341 for (i = 0; i < ARRAY_SIZE(mt9v112_init); i++) {
1342 if (i2c_w2(gspca_dev, mt9v112_init[i][0],
1343 mt9v112_init[i][1]) < 0) {
1344 err("MT9V112 sensor initialization failed");
1345 return -ENODEV;
1346 }
1347 }
1348 sd->hstart = 6;
1349 sd->vstart = 2;
1350 sd->sensor = SENSOR_MT9V112;
1351 info("MT9V112 sensor detected");
1352 return 0;
1353 }
1354
1355 return -ENODEV;
1356}
1357
1358static int mt9m111_init_sensor(struct gspca_dev *gspca_dev)
1359{
1360 struct sd *sd = (struct sd *) gspca_dev;
1361 int i;
1362 for (i = 0; i < ARRAY_SIZE(mt9m111_init); i++) {
1363 if (i2c_w2(gspca_dev, mt9m111_init[i][0],
1364 mt9m111_init[i][1]) < 0) {
1365 err("MT9M111 sensor initialization failed");
1366 return -ENODEV;
1367 }
1368 }
1369 sd->hstart = 0;
1370 sd->vstart = 2;
1371 return 0;
1372}
1373
1374static int mt9m001_init_sensor(struct gspca_dev *gspca_dev)
1375{
1376 struct sd *sd = (struct sd *) gspca_dev;
1377 int i;
1378 for (i = 0; i < ARRAY_SIZE(mt9m001_init); i++) {
1379 if (i2c_w2(gspca_dev, mt9m001_init[i][0],
1380 mt9m001_init[i][1]) < 0) {
1381 err("MT9M001 sensor initialization failed");
1382 return -ENODEV;
1383 }
1384 }
1385 /* disable hflip and vflip */
1386 gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX);
1387 sd->hstart = 2;
1388 sd->vstart = 2;
1389 return 0;
1390}
1391
1392static int hv7131r_init_sensor(struct gspca_dev *gspca_dev)
1393{
1394 int i;
1395 struct sd *sd = (struct sd *) gspca_dev;
1396
1397 for (i = 0; i < ARRAY_SIZE(hv7131r_init); i++) {
1398 if (i2c_w1(gspca_dev, hv7131r_init[i][0],
1399 hv7131r_init[i][1]) < 0) {
1400 err("HV7131R Sensor initialization failed");
1401 return -ENODEV;
1402 }
1403 }
1404 sd->hstart = 0;
1405 sd->vstart = 1;
1406 return 0;
1407}
1408
1409#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
1410static int input_kthread(void *data)
1411{
1412 struct gspca_dev *gspca_dev = (struct gspca_dev *)data;
1413 struct sd *sd = (struct sd *) gspca_dev;
1414
1415 DECLARE_WAIT_QUEUE_HEAD(wait);
1416 set_freezable();
1417 for (;;) {
1418 if (kthread_should_stop())
1419 break;
1420
1421 if (reg_r(gspca_dev, 0x1005, 1) < 0)
1422 continue;
1423
1424 input_report_key(sd->input_dev,
1425 KEY_CAMERA,
1426 gspca_dev->usb_buf[0] & sd->input_gpio);
1427 input_sync(sd->input_dev);
1428
1429 wait_event_freezable_timeout(wait,
1430 kthread_should_stop(),
1431 msecs_to_jiffies(100));
1432 }
1433 return 0;
1434}
1435
1436
1437static int sn9c20x_input_init(struct gspca_dev *gspca_dev)
1438{
1439 struct sd *sd = (struct sd *) gspca_dev;
1440 if (sd->input_gpio == 0)
1441 return 0;
1442
1443 sd->input_dev = input_allocate_device();
1444 if (!sd->input_dev)
1445 return -ENOMEM;
1446
1447 sd->input_dev->name = "SN9C20X Webcam";
1448
1449 sd->input_dev->phys = kasprintf(GFP_KERNEL, "usb-%s-%s",
1450 gspca_dev->dev->bus->bus_name,
1451 gspca_dev->dev->devpath);
1452
1453 if (!sd->input_dev->phys)
1454 return -ENOMEM;
1455
1456 usb_to_input_id(gspca_dev->dev, &sd->input_dev->id);
1457 sd->input_dev->dev.parent = &gspca_dev->dev->dev;
1458
1459 set_bit(EV_KEY, sd->input_dev->evbit);
1460 set_bit(KEY_CAMERA, sd->input_dev->keybit);
1461
1462 if (input_register_device(sd->input_dev))
1463 return -EINVAL;
1464
1465 sd->input_task = kthread_run(input_kthread, gspca_dev, "sn9c20x/%d",
1466 gspca_dev->vdev.minor);
1467
1468 if (IS_ERR(sd->input_task))
1469 return -EINVAL;
1470
1471 return 0;
1472}
1473
1474static void sn9c20x_input_cleanup(struct gspca_dev *gspca_dev)
1475{
1476 struct sd *sd = (struct sd *) gspca_dev;
1477 if (sd->input_task != NULL && !IS_ERR(sd->input_task))
1478 kthread_stop(sd->input_task);
1479
1480 if (sd->input_dev != NULL) {
1481 input_unregister_device(sd->input_dev);
1482 kfree(sd->input_dev->phys);
1483 input_free_device(sd->input_dev);
1484 sd->input_dev = NULL;
1485 }
1486}
1487#endif
1488
1489static int set_cmatrix(struct gspca_dev *gspca_dev)
1490{
1491 struct sd *sd = (struct sd *) gspca_dev;
1492 s32 hue_coord, hue_index = 180 + sd->hue;
1493 u8 cmatrix[21];
1494 memset(cmatrix, 0, 21);
1495
1496 cmatrix[2] = (sd->contrast * 0x25 / 0x100) + 0x26;
1497 cmatrix[0] = 0x13 + (cmatrix[2] - 0x26) * 0x13 / 0x25;
1498 cmatrix[4] = 0x07 + (cmatrix[2] - 0x26) * 0x07 / 0x25;
1499 cmatrix[18] = sd->brightness - 0x80;
1500
1501 hue_coord = (hsv_red_x[hue_index] * sd->saturation) >> 8;
1502 cmatrix[6] = (unsigned char)(hue_coord & 0xff);
1503 cmatrix[7] = (unsigned char)((hue_coord >> 8) & 0x0f);
1504
1505 hue_coord = (hsv_red_y[hue_index] * sd->saturation) >> 8;
1506 cmatrix[8] = (unsigned char)(hue_coord & 0xff);
1507 cmatrix[9] = (unsigned char)((hue_coord >> 8) & 0x0f);
1508
1509 hue_coord = (hsv_green_x[hue_index] * sd->saturation) >> 8;
1510 cmatrix[10] = (unsigned char)(hue_coord & 0xff);
1511 cmatrix[11] = (unsigned char)((hue_coord >> 8) & 0x0f);
1512
1513 hue_coord = (hsv_green_y[hue_index] * sd->saturation) >> 8;
1514 cmatrix[12] = (unsigned char)(hue_coord & 0xff);
1515 cmatrix[13] = (unsigned char)((hue_coord >> 8) & 0x0f);
1516
1517 hue_coord = (hsv_blue_x[hue_index] * sd->saturation) >> 8;
1518 cmatrix[14] = (unsigned char)(hue_coord & 0xff);
1519 cmatrix[15] = (unsigned char)((hue_coord >> 8) & 0x0f);
1520
1521 hue_coord = (hsv_blue_y[hue_index] * sd->saturation) >> 8;
1522 cmatrix[16] = (unsigned char)(hue_coord & 0xff);
1523 cmatrix[17] = (unsigned char)((hue_coord >> 8) & 0x0f);
1524
1525 return reg_w(gspca_dev, 0x10e1, cmatrix, 21);
1526}
1527
1528static int set_gamma(struct gspca_dev *gspca_dev)
1529{
1530 struct sd *sd = (struct sd *) gspca_dev;
1531 u8 gamma[17];
1532 u8 gval = sd->gamma * 0xb8 / 0x100;
1533
1534
1535 gamma[0] = 0x0a;
1536 gamma[1] = 0x13 + (gval * (0xcb - 0x13) / 0xb8);
1537 gamma[2] = 0x25 + (gval * (0xee - 0x25) / 0xb8);
1538 gamma[3] = 0x37 + (gval * (0xfa - 0x37) / 0xb8);
1539 gamma[4] = 0x45 + (gval * (0xfc - 0x45) / 0xb8);
1540 gamma[5] = 0x55 + (gval * (0xfb - 0x55) / 0xb8);
1541 gamma[6] = 0x65 + (gval * (0xfc - 0x65) / 0xb8);
1542 gamma[7] = 0x74 + (gval * (0xfd - 0x74) / 0xb8);
1543 gamma[8] = 0x83 + (gval * (0xfe - 0x83) / 0xb8);
1544 gamma[9] = 0x92 + (gval * (0xfc - 0x92) / 0xb8);
1545 gamma[10] = 0xa1 + (gval * (0xfc - 0xa1) / 0xb8);
1546 gamma[11] = 0xb0 + (gval * (0xfc - 0xb0) / 0xb8);
1547 gamma[12] = 0xbf + (gval * (0xfb - 0xbf) / 0xb8);
1548 gamma[13] = 0xce + (gval * (0xfb - 0xce) / 0xb8);
1549 gamma[14] = 0xdf + (gval * (0xfd - 0xdf) / 0xb8);
1550 gamma[15] = 0xea + (gval * (0xf9 - 0xea) / 0xb8);
1551 gamma[16] = 0xf5;
1552
1553 return reg_w(gspca_dev, 0x1190, gamma, 17);
1554}
1555
1556static int set_redblue(struct gspca_dev *gspca_dev)
1557{
1558 struct sd *sd = (struct sd *) gspca_dev;
1559 reg_w1(gspca_dev, 0x118c, sd->red);
1560 reg_w1(gspca_dev, 0x118f, sd->blue);
1561 return 0;
1562}
1563
1564static int set_hvflip(struct gspca_dev *gspca_dev)
1565{
1566 u8 value, tslb;
1567 u16 value2;
1568 struct sd *sd = (struct sd *) gspca_dev;
1569 switch (sd->sensor) {
1570 case SENSOR_OV9650:
1571 i2c_r1(gspca_dev, 0x1e, &value);
1572 value &= ~0x30;
1573 tslb = 0x01;
1574 if (sd->hflip)
1575 value |= 0x20;
1576 if (sd->vflip) {
1577 value |= 0x10;
1578 tslb = 0x49;
1579 }
1580 i2c_w1(gspca_dev, 0x1e, value);
1581 i2c_w1(gspca_dev, 0x3a, tslb);
1582 break;
1583 case SENSOR_MT9V111:
1584 case SENSOR_MT9V011:
1585 i2c_r2(gspca_dev, 0x20, &value2);
1586 value2 &= ~0xc0a0;
1587 if (sd->hflip)
1588 value2 |= 0x8080;
1589 if (sd->vflip)
1590 value2 |= 0x4020;
1591 i2c_w2(gspca_dev, 0x20, value2);
1592 break;
1593 case SENSOR_MT9M111:
1594 case SENSOR_MT9V112:
1595 i2c_r2(gspca_dev, 0x20, &value2);
1596 value2 &= ~0x0003;
1597 if (sd->hflip)
1598 value2 |= 0x0002;
1599 if (sd->vflip)
1600 value2 |= 0x0001;
1601 i2c_w2(gspca_dev, 0x20, value2);
1602 break;
1603 case SENSOR_HV7131R:
1604 i2c_r1(gspca_dev, 0x01, &value);
1605 value &= ~0x03;
1606 if (sd->vflip)
1607 value |= 0x01;
1608 if (sd->hflip)
1609 value |= 0x02;
1610 i2c_w1(gspca_dev, 0x01, value);
1611 break;
1612 }
1613 return 0;
1614}
1615
1616static int set_exposure(struct gspca_dev *gspca_dev)
1617{
1618 struct sd *sd = (struct sd *) gspca_dev;
1619 u8 exp[8] = {0x81, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e};
1620 switch (sd->sensor) {
1621 case SENSOR_OV7660:
1622 case SENSOR_OV7670:
1623 case SENSOR_SOI968:
1624 case SENSOR_OV9655:
1625 case SENSOR_OV9650:
1626 exp[0] |= (3 << 4);
1627 exp[2] = 0x2d;
1628 exp[3] = sd->exposure & 0xff;
1629 exp[4] = sd->exposure >> 8;
1630 break;
1631 case SENSOR_MT9M001:
1632 case SENSOR_MT9M111:
1633 case SENSOR_MT9V112:
1634 case SENSOR_MT9V111:
1635 case SENSOR_MT9V011:
1636 exp[0] |= (3 << 4);
1637 exp[2] = 0x09;
1638 exp[3] = sd->exposure >> 8;
1639 exp[4] = sd->exposure & 0xff;
1640 break;
1641 case SENSOR_HV7131R:
1642 exp[0] |= (4 << 4);
1643 exp[2] = 0x25;
1644 exp[3] = ((sd->exposure * 0xffffff) / 0xffff) >> 16;
1645 exp[4] = ((sd->exposure * 0xffffff) / 0xffff) >> 8;
1646 exp[5] = ((sd->exposure * 0xffffff) / 0xffff) & 0xff;
1647 break;
1648 }
1649 i2c_w(gspca_dev, exp);
1650 return 0;
1651}
1652
1653static int set_gain(struct gspca_dev *gspca_dev)
1654{
1655 struct sd *sd = (struct sd *) gspca_dev;
1656 u8 gain[8] = {0x81, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d};
1657 switch (sd->sensor) {
1658 case SENSOR_OV7660:
1659 case SENSOR_OV7670:
1660 case SENSOR_SOI968:
1661 case SENSOR_OV9655:
1662 case SENSOR_OV9650:
1663 gain[0] |= (2 << 4);
1664 gain[3] = ov_gain[sd->gain];
1665 break;
1666 case SENSOR_MT9V011:
1667 case SENSOR_MT9V111:
1668 gain[0] |= (3 << 4);
1669 gain[2] = 0x35;
1670 gain[3] = micron1_gain[sd->gain] >> 8;
1671 gain[4] = micron1_gain[sd->gain] & 0xff;
1672 break;
1673 case SENSOR_MT9V112:
1674 case SENSOR_MT9M111:
1675 gain[0] |= (3 << 4);
1676 gain[2] = 0x2f;
1677 gain[3] = micron1_gain[sd->gain] >> 8;
1678 gain[4] = micron1_gain[sd->gain] & 0xff;
1679 break;
1680 case SENSOR_MT9M001:
1681 gain[0] |= (3 << 4);
1682 gain[2] = 0x2f;
1683 gain[3] = micron2_gain[sd->gain] >> 8;
1684 gain[4] = micron2_gain[sd->gain] & 0xff;
1685 break;
1686 case SENSOR_HV7131R:
1687 gain[0] |= (2 << 4);
1688 gain[2] = 0x30;
1689 gain[3] = hv7131r_gain[sd->gain];
1690 break;
1691 }
1692 i2c_w(gspca_dev, gain);
1693 return 0;
1694}
1695
1696static int sd_setbrightness(struct gspca_dev *gspca_dev, s32 val)
1697{
1698 struct sd *sd = (struct sd *) gspca_dev;
1699
1700 sd->brightness = val;
1701 if (gspca_dev->streaming)
1702 return set_cmatrix(gspca_dev);
1703 return 0;
1704}
1705
1706static int sd_getbrightness(struct gspca_dev *gspca_dev, s32 *val)
1707{
1708 struct sd *sd = (struct sd *) gspca_dev;
1709 *val = sd->brightness;
1710 return 0;
1711}
1712
1713
1714static int sd_setcontrast(struct gspca_dev *gspca_dev, s32 val)
1715{
1716 struct sd *sd = (struct sd *) gspca_dev;
1717
1718 sd->contrast = val;
1719 if (gspca_dev->streaming)
1720 return set_cmatrix(gspca_dev);
1721 return 0;
1722}
1723
1724static int sd_getcontrast(struct gspca_dev *gspca_dev, s32 *val)
1725{
1726 struct sd *sd = (struct sd *) gspca_dev;
1727 *val = sd->contrast;
1728 return 0;
1729}
1730
1731static int sd_setsaturation(struct gspca_dev *gspca_dev, s32 val)
1732{
1733 struct sd *sd = (struct sd *) gspca_dev;
1734
1735 sd->saturation = val;
1736 if (gspca_dev->streaming)
1737 return set_cmatrix(gspca_dev);
1738 return 0;
1739}
1740
1741static int sd_getsaturation(struct gspca_dev *gspca_dev, s32 *val)
1742{
1743 struct sd *sd = (struct sd *) gspca_dev;
1744 *val = sd->saturation;
1745 return 0;
1746}
1747
1748static int sd_sethue(struct gspca_dev *gspca_dev, s32 val)
1749{
1750 struct sd *sd = (struct sd *) gspca_dev;
1751
1752 sd->hue = val;
1753 if (gspca_dev->streaming)
1754 return set_cmatrix(gspca_dev);
1755 return 0;
1756}
1757
1758static int sd_gethue(struct gspca_dev *gspca_dev, s32 *val)
1759{
1760 struct sd *sd = (struct sd *) gspca_dev;
1761 *val = sd->hue;
1762 return 0;
1763}
1764
1765static int sd_setgamma(struct gspca_dev *gspca_dev, s32 val)
1766{
1767 struct sd *sd = (struct sd *) gspca_dev;
1768
1769 sd->gamma = val;
1770 if (gspca_dev->streaming)
1771 return set_gamma(gspca_dev);
1772 return 0;
1773}
1774
1775static int sd_getgamma(struct gspca_dev *gspca_dev, s32 *val)
1776{
1777 struct sd *sd = (struct sd *) gspca_dev;
1778 *val = sd->gamma;
1779 return 0;
1780}
1781
1782static int sd_setredbalance(struct gspca_dev *gspca_dev, s32 val)
1783{
1784 struct sd *sd = (struct sd *) gspca_dev;
1785
1786 sd->red = val;
1787 if (gspca_dev->streaming)
1788 return set_redblue(gspca_dev);
1789 return 0;
1790}
1791
1792static int sd_getredbalance(struct gspca_dev *gspca_dev, s32 *val)
1793{
1794 struct sd *sd = (struct sd *) gspca_dev;
1795 *val = sd->red;
1796 return 0;
1797}
1798
1799static int sd_setbluebalance(struct gspca_dev *gspca_dev, s32 val)
1800{
1801 struct sd *sd = (struct sd *) gspca_dev;
1802
1803 sd->blue = val;
1804 if (gspca_dev->streaming)
1805 return set_redblue(gspca_dev);
1806 return 0;
1807}
1808
1809static int sd_getbluebalance(struct gspca_dev *gspca_dev, s32 *val)
1810{
1811 struct sd *sd = (struct sd *) gspca_dev;
1812 *val = sd->blue;
1813 return 0;
1814}
1815
1816static int sd_sethflip(struct gspca_dev *gspca_dev, s32 val)
1817{
1818 struct sd *sd = (struct sd *) gspca_dev;
1819
1820 sd->hflip = val;
1821 if (gspca_dev->streaming)
1822 return set_hvflip(gspca_dev);
1823 return 0;
1824}
1825
1826static int sd_gethflip(struct gspca_dev *gspca_dev, s32 *val)
1827{
1828 struct sd *sd = (struct sd *) gspca_dev;
1829 *val = sd->hflip;
1830 return 0;
1831}
1832
1833static int sd_setvflip(struct gspca_dev *gspca_dev, s32 val)
1834{
1835 struct sd *sd = (struct sd *) gspca_dev;
1836
1837 sd->vflip = val;
1838 if (gspca_dev->streaming)
1839 return set_hvflip(gspca_dev);
1840 return 0;
1841}
1842
1843static int sd_getvflip(struct gspca_dev *gspca_dev, s32 *val)
1844{
1845 struct sd *sd = (struct sd *) gspca_dev;
1846 *val = sd->vflip;
1847 return 0;
1848}
1849
1850static int sd_setexposure(struct gspca_dev *gspca_dev, s32 val)
1851{
1852 struct sd *sd = (struct sd *) gspca_dev;
1853
1854 sd->exposure = val;
1855 if (gspca_dev->streaming)
1856 return set_exposure(gspca_dev);
1857 return 0;
1858}
1859
1860static int sd_getexposure(struct gspca_dev *gspca_dev, s32 *val)
1861{
1862 struct sd *sd = (struct sd *) gspca_dev;
1863 *val = sd->exposure;
1864 return 0;
1865}
1866
1867static int sd_setgain(struct gspca_dev *gspca_dev, s32 val)
1868{
1869 struct sd *sd = (struct sd *) gspca_dev;
1870
1871 sd->gain = val;
1872 if (gspca_dev->streaming)
1873 return set_gain(gspca_dev);
1874 return 0;
1875}
1876
1877static int sd_getgain(struct gspca_dev *gspca_dev, s32 *val)
1878{
1879 struct sd *sd = (struct sd *) gspca_dev;
1880 *val = sd->gain;
1881 return 0;
1882}
1883
1884static int sd_setautoexposure(struct gspca_dev *gspca_dev, s32 val)
1885{
1886 struct sd *sd = (struct sd *) gspca_dev;
1887 sd->auto_exposure = val;
1888 return 0;
1889}
1890
1891static int sd_getautoexposure(struct gspca_dev *gspca_dev, s32 *val)
1892{
1893 struct sd *sd = (struct sd *) gspca_dev;
1894 *val = sd->auto_exposure;
1895 return 0;
1896}
1897
1898#ifdef CONFIG_VIDEO_ADV_DEBUG
1899static int sd_dbg_g_register(struct gspca_dev *gspca_dev,
1900 struct v4l2_dbg_register *reg)
1901{
1902 struct sd *sd = (struct sd *) gspca_dev;
1903 switch (reg->match.type) {
1904 case V4L2_CHIP_MATCH_HOST:
1905 if (reg->match.addr != 0)
1906 return -EINVAL;
1907 if (reg->reg < 0x1000 || reg->reg > 0x11ff)
1908 return -EINVAL;
1909 if (reg_r(gspca_dev, reg->reg, 1) < 0)
1910 return -EINVAL;
1911 reg->val = gspca_dev->usb_buf[0];
1912 return 0;
1913 case V4L2_CHIP_MATCH_I2C_ADDR:
1914 if (reg->match.addr != sd->i2c_addr)
1915 return -EINVAL;
1916 if (sd->sensor >= SENSOR_MT9V011 &&
1917 sd->sensor <= SENSOR_MT9M111) {
1918 if (i2c_r2(gspca_dev, reg->reg, (u16 *)&reg->val) < 0)
1919 return -EINVAL;
1920 } else {
1921 if (i2c_r1(gspca_dev, reg->reg, (u8 *)&reg->val) < 0)
1922 return -EINVAL;
1923 }
1924 return 0;
1925 }
1926 return -EINVAL;
1927}
1928
1929static int sd_dbg_s_register(struct gspca_dev *gspca_dev,
1930 struct v4l2_dbg_register *reg)
1931{
1932 struct sd *sd = (struct sd *) gspca_dev;
1933 switch (reg->match.type) {
1934 case V4L2_CHIP_MATCH_HOST:
1935 if (reg->match.addr != 0)
1936 return -EINVAL;
1937 if (reg->reg < 0x1000 || reg->reg > 0x11ff)
1938 return -EINVAL;
1939 if (reg_w1(gspca_dev, reg->reg, reg->val) < 0)
1940 return -EINVAL;
1941 return 0;
1942 case V4L2_CHIP_MATCH_I2C_ADDR:
1943 if (reg->match.addr != sd->i2c_addr)
1944 return -EINVAL;
1945 if (sd->sensor >= SENSOR_MT9V011 &&
1946 sd->sensor <= SENSOR_MT9M111) {
1947 if (i2c_w2(gspca_dev, reg->reg, reg->val) < 0)
1948 return -EINVAL;
1949 } else {
1950 if (i2c_w1(gspca_dev, reg->reg, reg->val) < 0)
1951 return -EINVAL;
1952 }
1953 return 0;
1954 }
1955 return -EINVAL;
1956}
1957#endif
1958
1959static int sd_chip_ident(struct gspca_dev *gspca_dev,
1960 struct v4l2_dbg_chip_ident *chip)
1961{
1962 struct sd *sd = (struct sd *) gspca_dev;
1963
1964 switch (chip->match.type) {
1965 case V4L2_CHIP_MATCH_HOST:
1966 if (chip->match.addr != 0)
1967 return -EINVAL;
1968 chip->revision = 0;
1969 chip->ident = V4L2_IDENT_SN9C20X;
1970 return 0;
1971 case V4L2_CHIP_MATCH_I2C_ADDR:
1972 if (chip->match.addr != sd->i2c_addr)
1973 return -EINVAL;
1974 chip->revision = 0;
1975 chip->ident = i2c_ident[sd->sensor];
1976 return 0;
1977 }
1978 return -EINVAL;
1979}
1980
1981static int sd_config(struct gspca_dev *gspca_dev,
1982 const struct usb_device_id *id)
1983{
1984 struct sd *sd = (struct sd *) gspca_dev;
1985 struct cam *cam;
1986
1987 cam = &gspca_dev->cam;
1988
1989 sd->sensor = (id->driver_info >> 8) & 0xff;
1990 sd->i2c_addr = id->driver_info & 0xff;
1991
1992 switch (sd->sensor) {
1993 case SENSOR_OV9650:
1994 cam->cam_mode = sxga_mode;
1995 cam->nmodes = ARRAY_SIZE(sxga_mode);
1996 break;
1997 default:
1998 cam->cam_mode = vga_mode;
1999 cam->nmodes = ARRAY_SIZE(vga_mode);
2000 }
2001
2002 sd->old_step = 0;
2003 sd->older_step = 0;
2004 sd->exposure_step = 16;
2005
2006 sd->brightness = BRIGHTNESS_DEFAULT;
2007 sd->contrast = CONTRAST_DEFAULT;
2008 sd->saturation = SATURATION_DEFAULT;
2009 sd->hue = HUE_DEFAULT;
2010 sd->gamma = GAMMA_DEFAULT;
2011 sd->red = RED_DEFAULT;
2012 sd->blue = BLUE_DEFAULT;
2013
2014 sd->hflip = HFLIP_DEFAULT;
2015 sd->vflip = VFLIP_DEFAULT;
2016 sd->exposure = EXPOSURE_DEFAULT;
2017 sd->gain = GAIN_DEFAULT;
2018 sd->auto_exposure = AUTO_EXPOSURE_DEFAULT;
2019
2020 sd->quality = 95;
2021
2022#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
2023 sd->input_gpio = (id->driver_info >> 16) & 0xff;
2024 if (sn9c20x_input_init(gspca_dev) < 0)
2025 return -ENODEV;
2026#endif
2027 return 0;
2028}
2029
2030static int sd_init(struct gspca_dev *gspca_dev)
2031{
2032 struct sd *sd = (struct sd *) gspca_dev;
2033 int i;
2034 u8 value;
2035 u8 i2c_init[9] =
2036 {0x80, sd->i2c_addr, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
2037
2038 for (i = 0; i < ARRAY_SIZE(bridge_init); i++) {
2039 value = bridge_init[i][1];
2040 if (reg_w(gspca_dev, bridge_init[i][0], &value, 1) < 0) {
2041 err("Device initialization failed");
2042 return -ENODEV;
2043 }
2044 }
2045
2046 if (reg_w(gspca_dev, 0x10c0, i2c_init, 9) < 0) {
2047 err("Device initialization failed");
2048 return -ENODEV;
2049 }
2050
2051 switch (sd->sensor) {
2052 case SENSOR_OV9650:
2053 if (ov9650_init_sensor(gspca_dev) < 0)
2054 return -ENODEV;
2055 info("OV9650 sensor detected");
2056 break;
2057 case SENSOR_OV9655:
2058 if (ov9655_init_sensor(gspca_dev) < 0)
2059 return -ENODEV;
2060 info("OV9655 sensor detected");
2061 break;
2062 case SENSOR_SOI968:
2063 if (soi968_init_sensor(gspca_dev) < 0)
2064 return -ENODEV;
2065 info("SOI968 sensor detected");
2066 break;
2067 case SENSOR_OV7660:
2068 if (ov7660_init_sensor(gspca_dev) < 0)
2069 return -ENODEV;
2070 info("OV7660 sensor detected");
2071 break;
2072 case SENSOR_OV7670:
2073 if (ov7670_init_sensor(gspca_dev) < 0)
2074 return -ENODEV;
2075 info("OV7670 sensor detected");
2076 break;
2077 case SENSOR_MT9VPRB:
2078 if (mt9v_init_sensor(gspca_dev) < 0)
2079 return -ENODEV;
2080 break;
2081 case SENSOR_MT9M111:
2082 if (mt9m111_init_sensor(gspca_dev) < 0)
2083 return -ENODEV;
2084 info("MT9M111 sensor detected");
2085 break;
2086 case SENSOR_MT9M001:
2087 if (mt9m001_init_sensor(gspca_dev) < 0)
2088 return -ENODEV;
2089 info("MT9M001 sensor detected");
2090 break;
2091 case SENSOR_HV7131R:
2092 if (hv7131r_init_sensor(gspca_dev) < 0)
2093 return -ENODEV;
2094 info("HV7131R sensor detected");
2095 break;
2096 default:
2097 info("Unsupported Sensor");
2098 return -ENODEV;
2099 }
2100
2101 return 0;
2102}
2103
2104static void configure_sensor_output(struct gspca_dev *gspca_dev, int mode)
2105{
2106 struct sd *sd = (struct sd *) gspca_dev;
2107 u8 value;
2108 switch (sd->sensor) {
2109 case SENSOR_OV9650:
2110 if (mode & MODE_SXGA) {
2111 i2c_w1(gspca_dev, 0x17, 0x1b);
2112 i2c_w1(gspca_dev, 0x18, 0xbc);
2113 i2c_w1(gspca_dev, 0x19, 0x01);
2114 i2c_w1(gspca_dev, 0x1a, 0x82);
2115 i2c_r1(gspca_dev, 0x12, &value);
2116 i2c_w1(gspca_dev, 0x12, value & 0x07);
2117 } else {
2118 i2c_w1(gspca_dev, 0x17, 0x24);
2119 i2c_w1(gspca_dev, 0x18, 0xc5);
2120 i2c_w1(gspca_dev, 0x19, 0x00);
2121 i2c_w1(gspca_dev, 0x1a, 0x3c);
2122 i2c_r1(gspca_dev, 0x12, &value);
2123 i2c_w1(gspca_dev, 0x12, (value & 0x7) | 0x40);
2124 }
2125 break;
2126 }
2127}
2128
2129#define HW_WIN(mode, hstart, vstart) \
2130((const u8 []){hstart & 0xff, hstart >> 8, \
2131vstart & 0xff, vstart >> 8, \
2132(mode & MODE_SXGA ? 1280 >> 4 : 640 >> 4), \
2133(mode & MODE_SXGA ? 1024 >> 3 : 480 >> 3)})
2134
2135#define CLR_WIN(width, height) \
2136((const u8 [])\
2137{0, width >> 2, 0, height >> 1,\
2138((width >> 10) & 0x01) | ((height >> 8) & 0x6)})
2139
2140static int sd_start(struct gspca_dev *gspca_dev)
2141{
2142 struct sd *sd = (struct sd *) gspca_dev;
2143 int mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
2144 int width = gspca_dev->width;
2145 int height = gspca_dev->height;
2146 u8 fmt, scale = 0;
2147
2148 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
2149 if (sd->jpeg_hdr == NULL)
2150 return -ENOMEM;
2151
2152 jpeg_define(sd->jpeg_hdr, height, width,
2153 0x21);
2154 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
2155
2156 if (mode & MODE_RAW)
2157 fmt = 0x2d;
2158 else if (mode & MODE_JPEG)
2159 fmt = 0x2c;
2160 else
2161 fmt = 0x2f;
2162
2163 switch (mode & 0x0f) {
2164 case 3:
2165 scale = 0xc0;
2166 info("Set 1280x1024");
2167 break;
2168 case 2:
2169 scale = 0x80;
2170 info("Set 640x480");
2171 break;
2172 case 1:
2173 scale = 0x90;
2174 info("Set 320x240");
2175 break;
2176 case 0:
2177 scale = 0xa0;
2178 info("Set 160x120");
2179 break;
2180 }
2181
2182 configure_sensor_output(gspca_dev, mode);
2183 reg_w(gspca_dev, 0x1100, sd->jpeg_hdr + JPEG_QT0_OFFSET, 64);
2184 reg_w(gspca_dev, 0x1140, sd->jpeg_hdr + JPEG_QT1_OFFSET, 64);
2185 reg_w(gspca_dev, 0x10fb, CLR_WIN(width, height), 5);
2186 reg_w(gspca_dev, 0x1180, HW_WIN(mode, sd->hstart, sd->vstart), 6);
2187 reg_w1(gspca_dev, 0x1189, scale);
2188 reg_w1(gspca_dev, 0x10e0, fmt);
2189
2190 set_cmatrix(gspca_dev);
2191 set_gamma(gspca_dev);
2192 set_redblue(gspca_dev);
2193 set_gain(gspca_dev);
2194 set_exposure(gspca_dev);
2195 set_hvflip(gspca_dev);
2196
2197 reg_r(gspca_dev, 0x1061, 1);
2198 reg_w1(gspca_dev, 0x1061, gspca_dev->usb_buf[0] | 0x02);
2199 return 0;
2200}
2201
2202static void sd_stopN(struct gspca_dev *gspca_dev)
2203{
2204 reg_r(gspca_dev, 0x1061, 1);
2205 reg_w1(gspca_dev, 0x1061, gspca_dev->usb_buf[0] & ~0x02);
2206}
2207
2208static void sd_stop0(struct gspca_dev *gspca_dev)
2209{
2210 struct sd *sd = (struct sd *) gspca_dev;
2211 kfree(sd->jpeg_hdr);
2212}
2213
2214static void do_autoexposure(struct gspca_dev *gspca_dev)
2215{
2216 struct sd *sd = (struct sd *) gspca_dev;
2217 int avg_lum, new_exp;
2218
2219 if (!sd->auto_exposure)
2220 return;
2221
2222 avg_lum = atomic_read(&sd->avg_lum);
2223
2224 /*
2225 * some hardcoded values are present
2226 * like those for maximal/minimal exposure
2227 * and exposure steps
2228 */
2229 if (avg_lum < MIN_AVG_LUM) {
2230 if (sd->exposure > 0x1770)
2231 return;
2232
2233 new_exp = sd->exposure + sd->exposure_step;
2234 if (new_exp > 0x1770)
2235 new_exp = 0x1770;
2236 if (new_exp < 0x10)
2237 new_exp = 0x10;
2238 sd->exposure = new_exp;
2239 set_exposure(gspca_dev);
2240
2241 sd->older_step = sd->old_step;
2242 sd->old_step = 1;
2243
2244 if (sd->old_step ^ sd->older_step)
2245 sd->exposure_step /= 2;
2246 else
2247 sd->exposure_step += 2;
2248 }
2249 if (avg_lum > MAX_AVG_LUM) {
2250 if (sd->exposure < 0x10)
2251 return;
2252 new_exp = sd->exposure - sd->exposure_step;
2253 if (new_exp > 0x1700)
2254 new_exp = 0x1770;
2255 if (new_exp < 0x10)
2256 new_exp = 0x10;
2257 sd->exposure = new_exp;
2258 set_exposure(gspca_dev);
2259 sd->older_step = sd->old_step;
2260 sd->old_step = 0;
2261
2262 if (sd->old_step ^ sd->older_step)
2263 sd->exposure_step /= 2;
2264 else
2265 sd->exposure_step += 2;
2266 }
2267}
2268
2269static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2270 struct gspca_frame *frame, /* target */
2271 u8 *data, /* isoc packet */
2272 int len) /* iso packet length */
2273{
2274 struct sd *sd = (struct sd *) gspca_dev;
2275 int avg_lum;
2276 static unsigned char frame_header[] =
2277 {0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96};
2278 if (len == 64 && memcmp(data, frame_header, 6) == 0) {
2279 avg_lum = ((data[35] >> 2) & 3) |
2280 (data[20] << 2) |
2281 (data[19] << 10);
2282 avg_lum += ((data[35] >> 4) & 3) |
2283 (data[22] << 2) |
2284 (data[21] << 10);
2285 avg_lum += ((data[35] >> 6) & 3) |
2286 (data[24] << 2) |
2287 (data[23] << 10);
2288 avg_lum += (data[36] & 3) |
2289 (data[26] << 2) |
2290 (data[25] << 10);
2291 avg_lum += ((data[36] >> 2) & 3) |
2292 (data[28] << 2) |
2293 (data[27] << 10);
2294 avg_lum += ((data[36] >> 4) & 3) |
2295 (data[30] << 2) |
2296 (data[29] << 10);
2297 avg_lum += ((data[36] >> 6) & 3) |
2298 (data[32] << 2) |
2299 (data[31] << 10);
2300 avg_lum += ((data[44] >> 4) & 3) |
2301 (data[34] << 2) |
2302 (data[33] << 10);
2303 avg_lum >>= 9;
2304 atomic_set(&sd->avg_lum, avg_lum);
2305 gspca_frame_add(gspca_dev, LAST_PACKET,
2306 frame, data, len);
2307 return;
2308 }
2309 if (gspca_dev->last_packet_type == LAST_PACKET) {
2310 if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv
2311 & MODE_JPEG) {
2312 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2313 sd->jpeg_hdr, JPEG_HDR_SZ);
2314 gspca_frame_add(gspca_dev, INTER_PACKET, frame,
2315 data, len);
2316 } else {
2317 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2318 data, len);
2319 }
2320 } else {
2321 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
2322 }
2323}
2324
2325/* sub-driver description */
2326static const struct sd_desc sd_desc = {
2327 .name = MODULE_NAME,
2328 .ctrls = sd_ctrls,
2329 .nctrls = ARRAY_SIZE(sd_ctrls),
2330 .config = sd_config,
2331 .init = sd_init,
2332 .start = sd_start,
2333 .stopN = sd_stopN,
2334 .stop0 = sd_stop0,
2335 .pkt_scan = sd_pkt_scan,
2336 .dq_callback = do_autoexposure,
2337#ifdef CONFIG_VIDEO_ADV_DEBUG
2338 .set_register = sd_dbg_s_register,
2339 .get_register = sd_dbg_g_register,
2340#endif
2341 .get_chip_ident = sd_chip_ident,
2342};
2343
2344#define SN9C20X(sensor, i2c_addr, button_mask) \
2345 .driver_info = (button_mask << 16) \
2346 | (SENSOR_ ## sensor << 8) \
2347 | (i2c_addr)
2348
2349static const __devinitdata struct usb_device_id device_table[] = {
2350 {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)},
2351 {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)},
2352 {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)},
2353 {USB_DEVICE(0x0c45, 0x624e), SN9C20X(SOI968, 0x30, 0x10)},
2354 {USB_DEVICE(0x0c45, 0x624f), SN9C20X(OV9650, 0x30, 0)},
2355 {USB_DEVICE(0x0c45, 0x6251), SN9C20X(OV9650, 0x30, 0)},
2356 {USB_DEVICE(0x0c45, 0x6253), SN9C20X(OV9650, 0x30, 0)},
2357 {USB_DEVICE(0x0c45, 0x6260), SN9C20X(OV7670, 0x21, 0)},
2358 {USB_DEVICE(0x0c45, 0x6270), SN9C20X(MT9VPRB, 0x00, 0)},
2359 {USB_DEVICE(0x0c45, 0x627b), SN9C20X(OV7660, 0x21, 0)},
2360 {USB_DEVICE(0x0c45, 0x627c), SN9C20X(HV7131R, 0x11, 0)},
2361 {USB_DEVICE(0x0c45, 0x627f), SN9C20X(OV9650, 0x30, 0)},
2362 {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)},
2363 {USB_DEVICE(0x0c45, 0x6282), SN9C20X(MT9M111, 0x5d, 0)},
2364 {USB_DEVICE(0x0c45, 0x6288), SN9C20X(OV9655, 0x30, 0)},
2365 {USB_DEVICE(0x0c45, 0x628e), SN9C20X(SOI968, 0x30, 0)},
2366 {USB_DEVICE(0x0c45, 0x628f), SN9C20X(OV9650, 0x30, 0)},
2367 {USB_DEVICE(0x0c45, 0x62a0), SN9C20X(OV7670, 0x21, 0)},
2368 {USB_DEVICE(0x0c45, 0x62b0), SN9C20X(MT9VPRB, 0x00, 0)},
2369 {USB_DEVICE(0x0c45, 0x62b3), SN9C20X(OV9655, 0x30, 0)},
2370 {USB_DEVICE(0x0c45, 0x62bb), SN9C20X(OV7660, 0x21, 0)},
2371 {USB_DEVICE(0x0c45, 0x62bc), SN9C20X(HV7131R, 0x11, 0)},
2372 {USB_DEVICE(0x045e, 0x00f4), SN9C20X(OV9650, 0x30, 0)},
2373 {USB_DEVICE(0x145f, 0x013d), SN9C20X(OV7660, 0x21, 0)},
2374 {USB_DEVICE(0x0458, 0x7029), SN9C20X(HV7131R, 0x11, 0)},
2375 {USB_DEVICE(0xa168, 0x0610), SN9C20X(HV7131R, 0x11, 0)},
2376 {USB_DEVICE(0xa168, 0x0611), SN9C20X(HV7131R, 0x11, 0)},
2377 {USB_DEVICE(0xa168, 0x0613), SN9C20X(HV7131R, 0x11, 0)},
2378 {USB_DEVICE(0xa168, 0x0618), SN9C20X(HV7131R, 0x11, 0)},
2379 {USB_DEVICE(0xa168, 0x0614), SN9C20X(MT9M111, 0x5d, 0)},
2380 {USB_DEVICE(0xa168, 0x0615), SN9C20X(MT9M111, 0x5d, 0)},
2381 {USB_DEVICE(0xa168, 0x0617), SN9C20X(MT9M111, 0x5d, 0)},
2382 {}
2383};
2384MODULE_DEVICE_TABLE(usb, device_table);
2385
2386/* -- device connect -- */
2387static int sd_probe(struct usb_interface *intf,
2388 const struct usb_device_id *id)
2389{
2390 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2391 THIS_MODULE);
2392}
2393
2394static void sd_disconnect(struct usb_interface *intf)
2395{
2396#ifdef CONFIG_USB_GSPCA_SN9C20X_EVDEV
2397 struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
2398
2399 sn9c20x_input_cleanup(gspca_dev);
2400#endif
2401
2402 gspca_disconnect(intf);
2403}
2404
2405static struct usb_driver sd_driver = {
2406 .name = MODULE_NAME,
2407 .id_table = device_table,
2408 .probe = sd_probe,
2409 .disconnect = sd_disconnect,
2410#ifdef CONFIG_PM
2411 .suspend = gspca_suspend,
2412 .resume = gspca_resume,
2413 .reset_resume = gspca_resume,
2414#endif
2415};
2416
2417/* -- module insert / remove -- */
2418static int __init sd_mod_init(void)
2419{
2420 int ret;
2421 ret = usb_register(&sd_driver);
2422 if (ret < 0)
2423 return ret;
2424 info("registered");
2425 return 0;
2426}
2427static void __exit sd_mod_exit(void)
2428{
2429 usb_deregister(&sd_driver);
2430 info("deregistered");
2431}
2432
2433module_init(sd_mod_init);
2434module_exit(sd_mod_exit);
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 0d02f41fa7d0..d6332ab80669 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -1634,6 +1634,8 @@ static void setfreq(struct gspca_dev *gspca_dev)
1634{ 1634{
1635 struct sd *sd = (struct sd *) gspca_dev; 1635 struct sd *sd = (struct sd *) gspca_dev;
1636 1636
1637 if (gspca_dev->ctrl_dis & (1 << FREQ_IDX))
1638 return;
1637 if (sd->sensor == SENSOR_OV7660) { 1639 if (sd->sensor == SENSOR_OV7660) {
1638 switch (sd->freq) { 1640 switch (sd->freq) {
1639 case 0: /* Banding filter disabled */ 1641 case 0: /* Banding filter disabled */
@@ -1735,6 +1737,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
1735 1737
1736 /* create the JPEG header */ 1738 /* create the JPEG header */
1737 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 1739 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
1740 if (!sd->jpeg_hdr)
1741 return -ENOMEM;
1738 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 1742 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
1739 0x21); /* JPEG 422 */ 1743 0x21); /* JPEG 422 */
1740 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 1744 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c
index 8806b2ff82be..fab7ef85a6c1 100644
--- a/drivers/media/video/gspca/spca500.c
+++ b/drivers/media/video/gspca/spca500.c
@@ -670,6 +670,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
670 670
671 /* create the JPEG header */ 671 /* create the JPEG header */
672 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 672 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
673 if (!sd->jpeg_hdr)
674 return -ENOMEM;
673 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 675 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
674 0x22); /* JPEG 411 */ 676 0x22); /* JPEG 411 */
675 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 677 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c
index f25be20cf1a6..47628964801e 100644
--- a/drivers/media/video/gspca/stk014.c
+++ b/drivers/media/video/gspca/stk014.c
@@ -333,6 +333,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
333 333
334 /* create the JPEG header */ 334 /* create the JPEG header */
335 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 335 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
336 if (!sd->jpeg_hdr)
337 return -ENOMEM;
336 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 338 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
337 0x22); /* JPEG 411 */ 339 0x22); /* JPEG 411 */
338 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 340 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
index 3039ec208f3a..e5024c8496ef 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
@@ -64,7 +64,7 @@ static struct v4l2_pix_format hdcs1x00_mode[] = {
64 { 64 {
65 HDCS_1X00_DEF_WIDTH, 65 HDCS_1X00_DEF_WIDTH,
66 HDCS_1X00_DEF_HEIGHT, 66 HDCS_1X00_DEF_HEIGHT,
67 V4L2_PIX_FMT_SBGGR8, 67 V4L2_PIX_FMT_SGRBG8,
68 V4L2_FIELD_NONE, 68 V4L2_FIELD_NONE,
69 .sizeimage = 69 .sizeimage =
70 HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT, 70 HDCS_1X00_DEF_WIDTH * HDCS_1X00_DEF_HEIGHT,
@@ -80,7 +80,7 @@ static struct v4l2_pix_format hdcs1020_mode[] = {
80 { 80 {
81 HDCS_1020_DEF_WIDTH, 81 HDCS_1020_DEF_WIDTH,
82 HDCS_1020_DEF_HEIGHT, 82 HDCS_1020_DEF_HEIGHT,
83 V4L2_PIX_FMT_SBGGR8, 83 V4L2_PIX_FMT_SGRBG8,
84 V4L2_FIELD_NONE, 84 V4L2_FIELD_NONE,
85 .sizeimage = 85 .sizeimage =
86 HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT, 86 HDCS_1020_DEF_WIDTH * HDCS_1020_DEF_HEIGHT,
@@ -131,9 +131,11 @@ static int hdcs_reg_write_seq(struct sd *sd, u8 reg, u8 *vals, u8 len)
131 (reg + len > 0xff))) 131 (reg + len > 0xff)))
132 return -EINVAL; 132 return -EINVAL;
133 133
134 for (i = 0; i < len; i++, reg++) { 134 for (i = 0; i < len; i++) {
135 regs[2*i] = reg; 135 regs[2 * i] = reg;
136 regs[2*i+1] = vals[i]; 136 regs[2 * i + 1] = vals[i];
137 /* All addresses are shifted left one bit as bit 0 toggles r/w */
138 reg += 2;
137 } 139 }
138 140
139 return stv06xx_write_sensor_bytes(sd, regs, len); 141 return stv06xx_write_sensor_bytes(sd, regs, len);
@@ -174,7 +176,9 @@ static int hdcs_set_state(struct sd *sd, enum hdcs_power_state state)
174 } 176 }
175 177
176 ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), val); 178 ret = stv06xx_write_sensor(sd, HDCS_REG_CONTROL(sd), val);
177 if (ret < 0) 179
180 /* Update the state if the write succeeded */
181 if (!ret)
178 hdcs->state = state; 182 hdcs->state = state;
179 183
180 return ret; 184 return ret;
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c
index 9623f294bdac..5127bbf9dd26 100644
--- a/drivers/media/video/gspca/sunplus.c
+++ b/drivers/media/video/gspca/sunplus.c
@@ -973,6 +973,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
973 973
974 /* create the JPEG header */ 974 /* create the JPEG header */
975 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 975 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
976 if (!sd->jpeg_hdr)
977 return -ENOMEM;
976 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 978 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
977 0x22); /* JPEG 411 */ 979 0x22); /* JPEG 411 */
978 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 980 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 08422d315e68..3d2756f7874a 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -7243,6 +7243,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
7243 7243
7244 /* create the JPEG header */ 7244 /* create the JPEG header */
7245 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); 7245 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
7246 if (!sd->jpeg_hdr)
7247 return -ENOMEM;
7246 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 7248 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
7247 0x21); /* JPEG 422 */ 7249 0x21); /* JPEG 422 */
7248 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 7250 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
diff --git a/drivers/media/video/mt9v011.c b/drivers/media/video/mt9v011.c
index 1fe8fc9183a7..b2260de645f0 100644
--- a/drivers/media/video/mt9v011.c
+++ b/drivers/media/video/mt9v011.c
@@ -8,6 +8,7 @@
8#include <linux/i2c.h> 8#include <linux/i2c.h>
9#include <linux/videodev2.h> 9#include <linux/videodev2.h>
10#include <linux/delay.h> 10#include <linux/delay.h>
11#include <asm/div64.h>
11#include <media/v4l2-device.h> 12#include <media/v4l2-device.h>
12#include "mt9v011.h" 13#include "mt9v011.h"
13#include <media/v4l2-i2c-drv.h> 14#include <media/v4l2-i2c-drv.h>
@@ -57,6 +58,7 @@ static struct v4l2_queryctrl mt9v011_qctrl[] = {
57struct mt9v011 { 58struct mt9v011 {
58 struct v4l2_subdev sd; 59 struct v4l2_subdev sd;
59 unsigned width, height; 60 unsigned width, height;
61 unsigned xtal;
60 62
61 u16 global_gain, red_bal, blue_bal; 63 u16 global_gain, red_bal, blue_bal;
62}; 64};
@@ -131,7 +133,7 @@ static const struct i2c_reg_value mt9v011_init_default[] = {
131 { R1E_MT9V011_DIGITAL_ZOOM, 0x0000 }, 133 { R1E_MT9V011_DIGITAL_ZOOM, 0x0000 },
132 { R20_MT9V011_READ_MODE, 0x1000 }, 134 { R20_MT9V011_READ_MODE, 0x1000 },
133 135
134 { R07_MT9V011_OUT_CTRL, 0x000a }, /* chip enable */ 136 { R07_MT9V011_OUT_CTRL, 0x0002 }, /* chip enable */
135}; 137};
136 138
137static void set_balance(struct v4l2_subdev *sd) 139static void set_balance(struct v4l2_subdev *sd)
@@ -154,6 +156,31 @@ static void set_balance(struct v4l2_subdev *sd)
154 mt9v011_write(sd, R2D_MT9V011_RED_GAIN, red_gain); 156 mt9v011_write(sd, R2D_MT9V011_RED_GAIN, red_gain);
155} 157}
156 158
159static void calc_fps(struct v4l2_subdev *sd)
160{
161 struct mt9v011 *core = to_mt9v011(sd);
162 unsigned height, width, hblank, vblank, speed;
163 unsigned row_time, t_time;
164 u64 frames_per_ms;
165 unsigned tmp;
166
167 height = mt9v011_read(sd, R03_MT9V011_HEIGHT);
168 width = mt9v011_read(sd, R04_MT9V011_WIDTH);
169 hblank = mt9v011_read(sd, R05_MT9V011_HBLANK);
170 vblank = mt9v011_read(sd, R06_MT9V011_VBLANK);
171 speed = mt9v011_read(sd, R0A_MT9V011_CLK_SPEED);
172
173 row_time = (width + 113 + hblank) * (speed + 2);
174 t_time = row_time * (height + vblank + 1);
175
176 frames_per_ms = core->xtal * 1000l;
177 do_div(frames_per_ms, t_time);
178 tmp = frames_per_ms;
179
180 v4l2_dbg(1, debug, sd, "Programmed to %u.%03u fps (%d pixel clcks)\n",
181 tmp / 1000, tmp % 1000, t_time);
182}
183
157static void set_res(struct v4l2_subdev *sd) 184static void set_res(struct v4l2_subdev *sd)
158{ 185{
159 struct mt9v011 *core = to_mt9v011(sd); 186 struct mt9v011 *core = to_mt9v011(sd);
@@ -175,10 +202,12 @@ static void set_res(struct v4l2_subdev *sd)
175 mt9v011_write(sd, R04_MT9V011_WIDTH, core->width); 202 mt9v011_write(sd, R04_MT9V011_WIDTH, core->width);
176 mt9v011_write(sd, R05_MT9V011_HBLANK, 771 - core->width); 203 mt9v011_write(sd, R05_MT9V011_HBLANK, 771 - core->width);
177 204
178 vstart = 8 + (640 - core->height) / 2; 205 vstart = 8 + (480 - core->height) / 2;
179 mt9v011_write(sd, R01_MT9V011_ROWSTART, vstart); 206 mt9v011_write(sd, R01_MT9V011_ROWSTART, vstart);
180 mt9v011_write(sd, R03_MT9V011_HEIGHT, core->height); 207 mt9v011_write(sd, R03_MT9V011_HEIGHT, core->height);
181 mt9v011_write(sd, R06_MT9V011_VBLANK, 508 - core->height); 208 mt9v011_write(sd, R06_MT9V011_VBLANK, 508 - core->height);
209
210 calc_fps(sd);
182}; 211};
183 212
184static int mt9v011_reset(struct v4l2_subdev *sd, u32 val) 213static int mt9v011_reset(struct v4l2_subdev *sd, u32 val)
@@ -215,6 +244,23 @@ static int mt9v011_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
215 return -EINVAL; 244 return -EINVAL;
216} 245}
217 246
247static int mt9v011_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
248{
249 int i;
250
251 v4l2_dbg(1, debug, sd, "queryctrl called\n");
252
253 for (i = 0; i < ARRAY_SIZE(mt9v011_qctrl); i++)
254 if (qc->id && qc->id == mt9v011_qctrl[i].id) {
255 memcpy(qc, &(mt9v011_qctrl[i]),
256 sizeof(*qc));
257 return 0;
258 }
259
260 return -EINVAL;
261}
262
263
218static int mt9v011_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 264static int mt9v011_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
219{ 265{
220 struct mt9v011 *core = to_mt9v011(sd); 266 struct mt9v011 *core = to_mt9v011(sd);
@@ -294,6 +340,22 @@ static int mt9v011_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
294 return 0; 340 return 0;
295} 341}
296 342
343static int mt9v011_s_config(struct v4l2_subdev *sd, int dumb, void *data)
344{
345 struct mt9v011 *core = to_mt9v011(sd);
346 unsigned *xtal = data;
347
348 v4l2_dbg(1, debug, sd, "s_config called\n");
349
350 if (xtal) {
351 core->xtal = *xtal;
352 v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n",
353 *xtal / 1000000, (*xtal / 1000) % 1000);
354 }
355
356 return 0;
357}
358
297 359
298#ifdef CONFIG_VIDEO_ADV_DEBUG 360#ifdef CONFIG_VIDEO_ADV_DEBUG
299static int mt9v011_g_register(struct v4l2_subdev *sd, 361static int mt9v011_g_register(struct v4l2_subdev *sd,
@@ -338,9 +400,11 @@ static int mt9v011_g_chip_ident(struct v4l2_subdev *sd,
338} 400}
339 401
340static const struct v4l2_subdev_core_ops mt9v011_core_ops = { 402static const struct v4l2_subdev_core_ops mt9v011_core_ops = {
403 .queryctrl = mt9v011_queryctrl,
341 .g_ctrl = mt9v011_g_ctrl, 404 .g_ctrl = mt9v011_g_ctrl,
342 .s_ctrl = mt9v011_s_ctrl, 405 .s_ctrl = mt9v011_s_ctrl,
343 .reset = mt9v011_reset, 406 .reset = mt9v011_reset,
407 .s_config = mt9v011_s_config,
344 .g_chip_ident = mt9v011_g_chip_ident, 408 .g_chip_ident = mt9v011_g_chip_ident,
345#ifdef CONFIG_VIDEO_ADV_DEBUG 409#ifdef CONFIG_VIDEO_ADV_DEBUG
346 .g_register = mt9v011_g_register, 410 .g_register = mt9v011_g_register,
@@ -395,6 +459,7 @@ static int mt9v011_probe(struct i2c_client *c,
395 core->global_gain = 0x0024; 459 core->global_gain = 0x0024;
396 core->width = 640; 460 core->width = 640;
397 core->height = 480; 461 core->height = 480;
462 core->xtal = 27000000; /* Hz */
398 463
399 v4l_info(c, "chip found @ 0x%02x (%s)\n", 464 v4l_info(c, "chip found @ 0x%02x (%s)\n",
400 c->addr << 1, c->adapter->name); 465 c->addr << 1, c->adapter->name);
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index db25c3034c11..8d17cf613306 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -62,6 +62,7 @@
62#include <linux/module.h> 62#include <linux/module.h>
63#include <linux/poll.h> 63#include <linux/poll.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/smp_lock.h>
65#ifdef CONFIG_USB_PWC_INPUT_EVDEV 66#ifdef CONFIG_USB_PWC_INPUT_EVDEV
66#include <linux/usb/input.h> 67#include <linux/usb/input.h>
67#endif 68#endif
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index 0be6f814f539..0b658dee05a4 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -29,7 +29,6 @@
29#include <linux/usb.h> 29#include <linux/usb.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/wait.h> 31#include <linux/wait.h>
32#include <linux/smp_lock.h>
33#include <linux/version.h> 32#include <linux/version.h>
34#include <linux/mutex.h> 33#include <linux/mutex.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 6be845ccc7d7..9e3262c0ba37 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -48,6 +48,7 @@
48#include <linux/videodev2.h> 48#include <linux/videodev2.h>
49#include <linux/version.h> 49#include <linux/version.h>
50#include <linux/mm.h> 50#include <linux/mm.h>
51#include <linux/smp_lock.h>
51#include <media/videobuf-vmalloc.h> 52#include <media/videobuf-vmalloc.h>
52#include <media/v4l2-common.h> 53#include <media/v4l2-common.h>
53#include <media/v4l2-ioctl.h> 54#include <media/v4l2-ioctl.h>
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 155804b061e9..b624a4c01fdc 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -43,7 +43,6 @@
43#include <linux/mm.h> 43#include <linux/mm.h>
44#include <linux/init.h> 44#include <linux/init.h>
45#include <linux/i2c.h> 45#include <linux/i2c.h>
46#include <linux/smp_lock.h>
47#include <linux/mutex.h> 46#include <linux/mutex.h>
48#include <linux/videotext.h> 47#include <linux/videotext.h>
49#include <linux/videodev2.h> 48#include <linux/videodev2.h>
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 271d6e931b75..12835fb82c95 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -46,7 +46,6 @@
46#include <linux/mm.h> 46#include <linux/mm.h>
47#include <linux/init.h> 47#include <linux/init.h>
48#include <linux/i2c.h> 48#include <linux/i2c.h>
49#include <linux/smp_lock.h>
50#include <linux/mutex.h> 49#include <linux/mutex.h>
51#include <linux/delay.h> 50#include <linux/delay.h>
52#include <linux/videotext.h> 51#include <linux/videotext.h>
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index add1757f8930..296788c3bf0e 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/smp_lock.h>
25#include <linux/delay.h> 26#include <linux/delay.h>
26 27
27#include "saa7134-reg.h" 28#include "saa7134-reg.h"
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index c8f05297d0f0..85ffc2cba039 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -31,6 +31,7 @@ static const char version[] = "0.24";
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/smp_lock.h>
34#include <linux/pagemap.h> 35#include <linux/pagemap.h>
35#include <linux/usb.h> 36#include <linux/usb.h>
36#include "se401.h" 37#include "se401.h"
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 2e5937047278..4d6785e63455 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -27,6 +27,7 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/smp_lock.h>
30 31
31#include <linux/usb.h> 32#include <linux/usb.h>
32#include <linux/mm.h> 33#include <linux/mm.h>
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 0eb313082c97..eaada39c76fd 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -26,6 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/major.h> 27#include <linux/major.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/mm.h> 30#include <linux/mm.h>
30#include <linux/init.h> 31#include <linux/init.h>
31#include <linux/poll.h> 32#include <linux/poll.h>
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 75f286f7a2e9..8b4e7dafce7b 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -62,6 +62,7 @@
62#include <linux/init.h> 62#include <linux/init.h>
63#include <linux/vmalloc.h> 63#include <linux/vmalloc.h>
64#include <linux/slab.h> 64#include <linux/slab.h>
65#include <linux/smp_lock.h>
65#include <linux/pagemap.h> 66#include <linux/pagemap.h>
66#include <linux/errno.h> 67#include <linux/errno.h>
67#include <linux/videodev.h> 68#include <linux/videodev.h>
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 8d73979596f9..45fce39ec9ad 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -43,6 +43,7 @@
43#include <linux/vmalloc.h> 43#include <linux/vmalloc.h>
44#include <linux/mm.h> 44#include <linux/mm.h>
45#include <linux/slab.h> 45#include <linux/slab.h>
46#include <linux/smp_lock.h>
46#include <linux/mutex.h> 47#include <linux/mutex.h>
47#include <linux/firmware.h> 48#include <linux/firmware.h>
48#include <linux/ihex.h> 49#include <linux/ihex.h>
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 90b58914f984..90d9b5c0e9a7 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -50,6 +50,7 @@
50#include <linux/list.h> 50#include <linux/list.h>
51#include <linux/timer.h> 51#include <linux/timer.h>
52#include <linux/slab.h> 52#include <linux/slab.h>
53#include <linux/smp_lock.h>
53#include <linux/mm.h> 54#include <linux/mm.h>
54#include <linux/utsname.h> 55#include <linux/utsname.h>
55#include <linux/highmem.h> 56#include <linux/highmem.h>
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 31eac66411d7..a7f1b69a7dab 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -25,7 +25,6 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/kmod.h> 26#include <linux/kmod.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/smp_lock.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/system.h> 29#include <asm/system.h>
31 30
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index 3d7df32a3d87..bcdefb1bcb3d 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -49,6 +49,7 @@
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/delay.h> 50#include <linux/delay.h>
51#include <linux/slab.h> 51#include <linux/slab.h>
52#include <linux/smp_lock.h>
52#include <linux/pci.h> 53#include <linux/pci.h>
53#include <linux/vmalloc.h> 54#include <linux/vmalloc.h>
54#include <linux/wait.h> 55#include <linux/wait.h>
diff --git a/drivers/misc/cb710/sgbuf2.c b/drivers/misc/cb710/sgbuf2.c
index d38a7acdb6ec..d019746551f3 100644
--- a/drivers/misc/cb710/sgbuf2.c
+++ b/drivers/misc/cb710/sgbuf2.c
@@ -114,7 +114,6 @@ static void sg_dwiter_write_slow(struct sg_mapping_iter *miter, uint32_t data)
114 if (!left) 114 if (!left)
115 return; 115 return;
116 addr += len; 116 addr += len;
117 flush_kernel_dcache_page(miter->page);
118 } while (sg_dwiter_next(miter)); 117 } while (sg_dwiter_next(miter));
119} 118}
120 119
@@ -142,9 +141,6 @@ void cb710_sg_dwiter_write_next_block(struct sg_mapping_iter *miter, uint32_t da
142 return; 141 return;
143 } else 142 } else
144 sg_dwiter_write_slow(miter, data); 143 sg_dwiter_write_slow(miter, data);
145
146 if (miter->length == miter->consumed)
147 flush_kernel_dcache_page(miter->page);
148} 144}
149EXPORT_SYMBOL_GPL(cb710_sg_dwiter_write_next_block); 145EXPORT_SYMBOL_GPL(cb710_sg_dwiter_write_next_block);
150 146
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index b34cb5f79eea..2e535a0ccd5e 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -173,6 +173,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
173 unsigned segment; 173 unsigned segment;
174 unsigned offset = (unsigned) off; 174 unsigned offset = (unsigned) off;
175 u8 *cp = bounce + 1; 175 u8 *cp = bounce + 1;
176 int sr;
176 177
177 *cp = AT25_WREN; 178 *cp = AT25_WREN;
178 status = spi_write(at25->spi, cp, 1); 179 status = spi_write(at25->spi, cp, 1);
@@ -214,7 +215,6 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
214 timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT); 215 timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT);
215 retries = 0; 216 retries = 0;
216 do { 217 do {
217 int sr;
218 218
219 sr = spi_w8r8(at25->spi, AT25_RDSR); 219 sr = spi_w8r8(at25->spi, AT25_RDSR);
220 if (sr < 0 || (sr & AT25_SR_nRDY)) { 220 if (sr < 0 || (sr & AT25_SR_nRDY)) {
@@ -228,7 +228,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
228 break; 228 break;
229 } while (retries++ < 3 || time_before_eq(jiffies, timeout)); 229 } while (retries++ < 3 || time_before_eq(jiffies, timeout));
230 230
231 if (time_after(jiffies, timeout)) { 231 if ((sr < 0) || (sr & AT25_SR_nRDY)) {
232 dev_err(&at25->spi->dev, 232 dev_err(&at25->spi->dev,
233 "write %d bytes offset %d, " 233 "write %d bytes offset %d, "
234 "timeout after %u msecs\n", 234 "timeout after %u msecs\n",
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index fa2d93a9fb8d..aed609832bc2 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -29,7 +29,6 @@
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/smp_lock.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/device.h> 33#include <linux/device.h>
35#include <linux/miscdevice.h> 34#include <linux/miscdevice.h>
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c
index eedbf9c32760..79689b10f937 100644
--- a/drivers/misc/sgi-gru/grukservices.c
+++ b/drivers/misc/sgi-gru/grukservices.c
@@ -24,7 +24,6 @@
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/smp_lock.h>
28#include <linux/spinlock.h> 27#include <linux/spinlock.h>
29#include <linux/device.h> 28#include <linux/device.h>
30#include <linux/miscdevice.h> 29#include <linux/miscdevice.h>
diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 11efefb1af51..4e72964a7b43 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -278,7 +278,7 @@ static int cb710_mmc_receive(struct cb710_slot *slot, struct mmc_data *data)
278 if (unlikely(data->blksz & 15 && (data->blocks != 1 || data->blksz != 8))) 278 if (unlikely(data->blksz & 15 && (data->blocks != 1 || data->blksz != 8)))
279 return -EINVAL; 279 return -EINVAL;
280 280
281 sg_miter_start(&miter, data->sg, data->sg_len, 0); 281 sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_TO_SG);
282 282
283 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, 283 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT,
284 15, CB710_MMC_C2_READ_PIO_SIZE_MASK); 284 15, CB710_MMC_C2_READ_PIO_SIZE_MASK);
@@ -307,7 +307,7 @@ static int cb710_mmc_receive(struct cb710_slot *slot, struct mmc_data *data)
307 goto out; 307 goto out;
308 } 308 }
309out: 309out:
310 cb710_sg_miter_stop_writing(&miter); 310 sg_miter_stop(&miter);
311 return err; 311 return err;
312} 312}
313 313
@@ -322,7 +322,7 @@ static int cb710_mmc_send(struct cb710_slot *slot, struct mmc_data *data)
322 if (unlikely(data->blocks > 1 && data->blksz & 15)) 322 if (unlikely(data->blocks > 1 && data->blksz & 15))
323 return -EINVAL; 323 return -EINVAL;
324 324
325 sg_miter_start(&miter, data->sg, data->sg_len, 0); 325 sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_FROM_SG);
326 326
327 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, 327 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT,
328 0, CB710_MMC_C2_READ_PIO_SIZE_MASK); 328 0, CB710_MMC_C2_READ_PIO_SIZE_MASK);
diff --git a/drivers/mmc/host/imxmmc.c b/drivers/mmc/host/imxmmc.c
index e0be21a4a696..bf98d7cc928a 100644
--- a/drivers/mmc/host/imxmmc.c
+++ b/drivers/mmc/host/imxmmc.c
@@ -652,7 +652,7 @@ static irqreturn_t imxmci_irq(int irq, void *devid)
652 set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events); 652 set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events);
653 tasklet_schedule(&host->tasklet); 653 tasklet_schedule(&host->tasklet);
654 654
655 return IRQ_RETVAL(handled);; 655 return IRQ_RETVAL(handled);
656} 656}
657 657
658static void imxmci_tasklet_fnc(unsigned long data) 658static void imxmci_tasklet_fnc(unsigned long data)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index a923ee27c09e..8741d0f5146a 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -431,7 +431,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
431 clk = 255; 431 clk = 255;
432 host->cclk = host->mclk / (2 * (clk + 1)); 432 host->cclk = host->mclk / (2 * (clk + 1));
433 } 433 }
434 if (host->hw_designer == 0x80) 434 if (host->hw_designer == AMBA_VENDOR_ST)
435 clk |= MCI_FCEN; /* Bug fix in ST IP block */ 435 clk |= MCI_FCEN; /* Bug fix in ST IP block */
436 clk |= MCI_CLK_ENABLE; 436 clk |= MCI_CLK_ENABLE;
437 } 437 }
@@ -444,7 +444,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
444 break; 444 break;
445 case MMC_POWER_UP: 445 case MMC_POWER_UP:
446 /* The ST version does not have this, fall through to POWER_ON */ 446 /* The ST version does not have this, fall through to POWER_ON */
447 if (host->hw_designer != 0x80) { 447 if (host->hw_designer != AMBA_VENDOR_ST) {
448 pwr |= MCI_PWR_UP; 448 pwr |= MCI_PWR_UP;
449 break; 449 break;
450 } 450 }
@@ -454,7 +454,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
454 } 454 }
455 455
456 if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { 456 if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) {
457 if (host->hw_designer != 0x80) 457 if (host->hw_designer != AMBA_VENDOR_ST)
458 pwr |= MCI_ROD; 458 pwr |= MCI_ROD;
459 else { 459 else {
460 /* 460 /*
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index b56d72ff06e9..34e23489811a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -384,7 +384,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
384 u16 val[2] = {0, 0}; 384 u16 val[2] = {0, 0};
385 val[0] = mvsd_read(MVSD_FIFO); 385 val[0] = mvsd_read(MVSD_FIFO);
386 val[1] = mvsd_read(MVSD_FIFO); 386 val[1] = mvsd_read(MVSD_FIFO);
387 memcpy(p, &val, s); 387 memcpy(p, ((void *)&val) + 4 - s, s);
388 s = 0; 388 s = 0;
389 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS); 389 intr_status = mvsd_read(MVSD_NOR_INTR_STATUS);
390 } 390 }
@@ -423,7 +423,7 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
423 if (s < 4) { 423 if (s < 4) {
424 if (s && (intr_status & MVSD_NOR_TX_AVAIL)) { 424 if (s && (intr_status & MVSD_NOR_TX_AVAIL)) {
425 u16 val[2] = {0, 0}; 425 u16 val[2] = {0, 0};
426 memcpy(&val, p, s); 426 memcpy(((void *)&val) + 4 - s, p, s);
427 mvsd_write(MVSD_FIFO, val[0]); 427 mvsd_write(MVSD_FIFO, val[0]);
428 mvsd_write(MVSD_FIFO, val[1]); 428 mvsd_write(MVSD_FIFO, val[1]);
429 s = 0; 429 s = 0;
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index d7d7109ef47e..e55ac792d68c 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -168,12 +168,12 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
168 168
169 if (data->flags & MMC_DATA_READ) { 169 if (data->flags & MMC_DATA_READ) {
170 host->dma_dir = DMA_FROM_DEVICE; 170 host->dma_dir = DMA_FROM_DEVICE;
171 dcmd = DCMD_INCTRGADDR | DCMD_FLOWTRG; 171 dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC;
172 DRCMR(host->dma_drcmrtx) = 0; 172 DRCMR(host->dma_drcmrtx) = 0;
173 DRCMR(host->dma_drcmrrx) = host->dma | DRCMR_MAPVLD; 173 DRCMR(host->dma_drcmrrx) = host->dma | DRCMR_MAPVLD;
174 } else { 174 } else {
175 host->dma_dir = DMA_TO_DEVICE; 175 host->dma_dir = DMA_TO_DEVICE;
176 dcmd = DCMD_INCSRCADDR | DCMD_FLOWSRC; 176 dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG;
177 DRCMR(host->dma_drcmrrx) = 0; 177 DRCMR(host->dma_drcmrrx) = 0;
178 DRCMR(host->dma_drcmrtx) = host->dma | DRCMR_MAPVLD; 178 DRCMR(host->dma_drcmrtx) = host->dma | DRCMR_MAPVLD;
179 } 179 }
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index d79fa55c3b89..908844327db0 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -158,6 +158,13 @@ static unsigned int esdhc_get_max_clock(struct sdhci_host *host)
158 return of_host->clock; 158 return of_host->clock;
159} 159}
160 160
161static unsigned int esdhc_get_min_clock(struct sdhci_host *host)
162{
163 struct sdhci_of_host *of_host = sdhci_priv(host);
164
165 return of_host->clock / 256 / 16;
166}
167
161static unsigned int esdhc_get_timeout_clock(struct sdhci_host *host) 168static unsigned int esdhc_get_timeout_clock(struct sdhci_host *host)
162{ 169{
163 struct sdhci_of_host *of_host = sdhci_priv(host); 170 struct sdhci_of_host *of_host = sdhci_priv(host);
@@ -184,6 +191,7 @@ static struct sdhci_of_data sdhci_esdhc = {
184 .set_clock = esdhc_set_clock, 191 .set_clock = esdhc_set_clock,
185 .enable_dma = esdhc_enable_dma, 192 .enable_dma = esdhc_enable_dma,
186 .get_max_clock = esdhc_get_max_clock, 193 .get_max_clock = esdhc_get_max_clock,
194 .get_min_clock = esdhc_get_min_clock,
187 .get_timeout_clock = esdhc_get_timeout_clock, 195 .get_timeout_clock = esdhc_get_timeout_clock,
188 }, 196 },
189}; 197};
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 6779b4ecab18..fc96f8cb9c0b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -773,8 +773,14 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
773 } 773 }
774 774
775 if (!(host->flags & SDHCI_REQ_USE_DMA)) { 775 if (!(host->flags & SDHCI_REQ_USE_DMA)) {
776 sg_miter_start(&host->sg_miter, 776 int flags;
777 data->sg, data->sg_len, SG_MITER_ATOMIC); 777
778 flags = SG_MITER_ATOMIC;
779 if (host->data->flags & MMC_DATA_READ)
780 flags |= SG_MITER_TO_SG;
781 else
782 flags |= SG_MITER_FROM_SG;
783 sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags);
778 host->blocks = data->blocks; 784 host->blocks = data->blocks;
779 } 785 }
780 786
@@ -1766,7 +1772,10 @@ int sdhci_add_host(struct sdhci_host *host)
1766 * Set host parameters. 1772 * Set host parameters.
1767 */ 1773 */
1768 mmc->ops = &sdhci_ops; 1774 mmc->ops = &sdhci_ops;
1769 mmc->f_min = host->max_clk / 256; 1775 if (host->ops->get_min_clock)
1776 mmc->f_min = host->ops->get_min_clock(host);
1777 else
1778 mmc->f_min = host->max_clk / 256;
1770 mmc->f_max = host->max_clk; 1779 mmc->f_max = host->max_clk;
1771 mmc->caps = MMC_CAP_SDIO_IRQ; 1780 mmc->caps = MMC_CAP_SDIO_IRQ;
1772 1781
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 831ddf7dcb49..c77e9ff30223 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -302,6 +302,7 @@ struct sdhci_ops {
302 302
303 int (*enable_dma)(struct sdhci_host *host); 303 int (*enable_dma)(struct sdhci_host *host);
304 unsigned int (*get_max_clock)(struct sdhci_host *host); 304 unsigned int (*get_max_clock)(struct sdhci_host *host);
305 unsigned int (*get_min_clock)(struct sdhci_host *host);
305 unsigned int (*get_timeout_clock)(struct sdhci_host *host); 306 unsigned int (*get_timeout_clock)(struct sdhci_host *host);
306}; 307};
307 308
diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c
index 95aaac03f938..b5e478fa2661 100644
--- a/drivers/mtd/ubi/gluebi.c
+++ b/drivers/mtd/ubi/gluebi.c
@@ -332,6 +332,7 @@ static int gluebi_create(struct ubi_device_info *di,
332 } 332 }
333 333
334 gluebi->vol_id = vi->vol_id; 334 gluebi->vol_id = vi->vol_id;
335 gluebi->ubi_num = vi->ubi_num;
335 mtd->type = MTD_UBIVOLUME; 336 mtd->type = MTD_UBIVOLUME;
336 if (!di->ro_mode) 337 if (!di->ro_mode)
337 mtd->flags = MTD_WRITEABLE; 338 mtd->flags = MTD_WRITEABLE;
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index f60895ee0aeb..a423131b6171 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -781,7 +781,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
781 return -EINVAL; 781 return -EINVAL;
782 } 782 }
783 783
784 image_seq = be32_to_cpu(ech->ec); 784 image_seq = be32_to_cpu(ech->image_seq);
785 if (!si->image_seq_set) { 785 if (!si->image_seq_set) {
786 ubi->image_seq = image_seq; 786 ubi->image_seq = image_seq;
787 si->image_seq_set = 1; 787 si->image_seq_set = 1;
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 8ae72ec14456..0e2ba21d4441 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -908,6 +908,7 @@ static const struct net_device_ops rtl8139_netdev_ops = {
908 .ndo_open = rtl8139_open, 908 .ndo_open = rtl8139_open,
909 .ndo_stop = rtl8139_close, 909 .ndo_stop = rtl8139_close,
910 .ndo_get_stats = rtl8139_get_stats, 910 .ndo_get_stats = rtl8139_get_stats,
911 .ndo_change_mtu = eth_change_mtu,
911 .ndo_validate_addr = eth_validate_addr, 912 .ndo_validate_addr = eth_validate_addr,
912 .ndo_set_mac_address = rtl8139_set_mac_address, 913 .ndo_set_mac_address = rtl8139_set_mac_address,
913 .ndo_start_xmit = rtl8139_start_xmit, 914 .ndo_start_xmit = rtl8139_start_xmit,
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index f053ba5c37ba..3ed49f1337c7 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1729,6 +1729,13 @@ config KS8842
1729 help 1729 help
1730 This platform driver is for Micrel KSZ8842 chip. 1730 This platform driver is for Micrel KSZ8842 chip.
1731 1731
1732config KS8851
1733 tristate "Micrel KS8851 SPI"
1734 depends on SPI
1735 select MII
1736 help
1737 SPI driver for Micrel KS8851 SPI attached network chip.
1738
1732config VIA_RHINE 1739config VIA_RHINE
1733 tristate "VIA Rhine support" 1740 tristate "VIA Rhine support"
1734 depends on NET_PCI && PCI 1741 depends on NET_PCI && PCI
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 4b58a59f211b..ead8cab3cfe1 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -88,6 +88,7 @@ obj-$(CONFIG_SKGE) += skge.o
88obj-$(CONFIG_SKY2) += sky2.o 88obj-$(CONFIG_SKY2) += sky2.o
89obj-$(CONFIG_SKFP) += skfp/ 89obj-$(CONFIG_SKFP) += skfp/
90obj-$(CONFIG_KS8842) += ks8842.o 90obj-$(CONFIG_KS8842) += ks8842.o
91obj-$(CONFIG_KS8851) += ks8851.o
91obj-$(CONFIG_VIA_RHINE) += via-rhine.o 92obj-$(CONFIG_VIA_RHINE) += via-rhine.o
92obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o 93obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
93obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o 94obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
diff --git a/drivers/net/arm/Kconfig b/drivers/net/arm/Kconfig
index 2895db13bfa4..c37ee9e6b67b 100644
--- a/drivers/net/arm/Kconfig
+++ b/drivers/net/arm/Kconfig
@@ -63,3 +63,11 @@ config IXP4XX_ETH
63 help 63 help
64 Say Y here if you want to use built-in Ethernet ports 64 Say Y here if you want to use built-in Ethernet ports
65 on IXP4xx processor. 65 on IXP4xx processor.
66
67config W90P910_ETH
68 tristate "Nuvoton w90p910 Ethernet support"
69 depends on ARM && ARCH_W90X900
70 select PHYLIB
71 help
72 Say Y here if you want to use built-in Ethernet ports
73 on w90p910 processor.
diff --git a/drivers/net/arm/Makefile b/drivers/net/arm/Makefile
index 811a3ccd14c1..303171f589e6 100644
--- a/drivers/net/arm/Makefile
+++ b/drivers/net/arm/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o
11obj-$(CONFIG_ARM_KS8695_ETHER) += ks8695net.o 11obj-$(CONFIG_ARM_KS8695_ETHER) += ks8695net.o
12obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o 12obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o
13obj-$(CONFIG_IXP4XX_ETH) += ixp4xx_eth.o 13obj-$(CONFIG_IXP4XX_ETH) += ixp4xx_eth.o
14obj-$(CONFIG_W90P910_ETH) += w90p910_ether.o
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 2e7419a61191..5041d10bae9d 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
1228#endif 1228#endif
1229 1229
1230static struct platform_driver at91ether_driver = { 1230static struct platform_driver at91ether_driver = {
1231 .probe = at91ether_probe,
1232 .remove = __devexit_p(at91ether_remove), 1231 .remove = __devexit_p(at91ether_remove),
1233 .suspend = at91ether_suspend, 1232 .suspend = at91ether_suspend,
1234 .resume = at91ether_resume, 1233 .resume = at91ether_resume,
@@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
1240 1239
1241static int __init at91ether_init(void) 1240static int __init at91ether_init(void)
1242{ 1241{
1243 return platform_driver_register(&at91ether_driver); 1242 return platform_driver_probe(&at91ether_driver, at91ether_probe);
1244} 1243}
1245 1244
1246static void __exit at91ether_exit(void) 1245static void __exit at91ether_exit(void)
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c
index 6f42ad728915..3fe09876e76d 100644
--- a/drivers/net/arm/ixp4xx_eth.c
+++ b/drivers/net/arm/ixp4xx_eth.c
@@ -1142,7 +1142,9 @@ static const struct net_device_ops ixp4xx_netdev_ops = {
1142 .ndo_start_xmit = eth_xmit, 1142 .ndo_start_xmit = eth_xmit,
1143 .ndo_set_multicast_list = eth_set_mcast_list, 1143 .ndo_set_multicast_list = eth_set_mcast_list,
1144 .ndo_do_ioctl = eth_ioctl, 1144 .ndo_do_ioctl = eth_ioctl,
1145 1145 .ndo_change_mtu = eth_change_mtu,
1146 .ndo_set_mac_address = eth_mac_addr,
1147 .ndo_validate_addr = eth_validate_addr,
1146}; 1148};
1147 1149
1148static int __devinit eth_init_one(struct platform_device *pdev) 1150static int __devinit eth_init_one(struct platform_device *pdev)
diff --git a/drivers/net/arm/w90p910_ether.c b/drivers/net/arm/w90p910_ether.c
new file mode 100644
index 000000000000..616fb7985a34
--- /dev/null
+++ b/drivers/net/arm/w90p910_ether.c
@@ -0,0 +1,1105 @@
1/*
2 * Copyright (c) 2008-2009 Nuvoton technology corporation.
3 *
4 * Wan ZongShun <mcuos.com@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation;version 2 of the License.
9 *
10 */
11
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/mii.h>
15#include <linux/netdevice.h>
16#include <linux/etherdevice.h>
17#include <linux/skbuff.h>
18#include <linux/ethtool.h>
19#include <linux/platform_device.h>
20#include <linux/clk.h>
21
22#define DRV_MODULE_NAME "w90p910-emc"
23#define DRV_MODULE_VERSION "0.1"
24
25/* Ethernet MAC Registers */
26#define REG_CAMCMR 0x00
27#define REG_CAMEN 0x04
28#define REG_CAMM_BASE 0x08
29#define REG_CAML_BASE 0x0c
30#define REG_TXDLSA 0x88
31#define REG_RXDLSA 0x8C
32#define REG_MCMDR 0x90
33#define REG_MIID 0x94
34#define REG_MIIDA 0x98
35#define REG_FFTCR 0x9C
36#define REG_TSDR 0xa0
37#define REG_RSDR 0xa4
38#define REG_DMARFC 0xa8
39#define REG_MIEN 0xac
40#define REG_MISTA 0xb0
41#define REG_CTXDSA 0xcc
42#define REG_CTXBSA 0xd0
43#define REG_CRXDSA 0xd4
44#define REG_CRXBSA 0xd8
45
46/* mac controller bit */
47#define MCMDR_RXON 0x01
48#define MCMDR_ACP (0x01 << 3)
49#define MCMDR_SPCRC (0x01 << 5)
50#define MCMDR_TXON (0x01 << 8)
51#define MCMDR_FDUP (0x01 << 18)
52#define MCMDR_ENMDC (0x01 << 19)
53#define MCMDR_OPMOD (0x01 << 20)
54#define SWR (0x01 << 24)
55
56/* cam command regiser */
57#define CAMCMR_AUP 0x01
58#define CAMCMR_AMP (0x01 << 1)
59#define CAMCMR_ABP (0x01 << 2)
60#define CAMCMR_CCAM (0x01 << 3)
61#define CAMCMR_ECMP (0x01 << 4)
62#define CAM0EN 0x01
63
64/* mac mii controller bit */
65#define MDCCR (0x0a << 20)
66#define PHYAD (0x01 << 8)
67#define PHYWR (0x01 << 16)
68#define PHYBUSY (0x01 << 17)
69#define PHYPRESP (0x01 << 18)
70#define CAM_ENTRY_SIZE 0x08
71
72/* rx and tx status */
73#define TXDS_TXCP (0x01 << 19)
74#define RXDS_CRCE (0x01 << 17)
75#define RXDS_PTLE (0x01 << 19)
76#define RXDS_RXGD (0x01 << 20)
77#define RXDS_ALIE (0x01 << 21)
78#define RXDS_RP (0x01 << 22)
79
80/* mac interrupt status*/
81#define MISTA_EXDEF (0x01 << 19)
82#define MISTA_TXBERR (0x01 << 24)
83#define MISTA_TDU (0x01 << 23)
84#define MISTA_RDU (0x01 << 10)
85#define MISTA_RXBERR (0x01 << 11)
86
87#define ENSTART 0x01
88#define ENRXINTR 0x01
89#define ENRXGD (0x01 << 4)
90#define ENRXBERR (0x01 << 11)
91#define ENTXINTR (0x01 << 16)
92#define ENTXCP (0x01 << 18)
93#define ENTXABT (0x01 << 21)
94#define ENTXBERR (0x01 << 24)
95#define ENMDC (0x01 << 19)
96#define PHYBUSY (0x01 << 17)
97#define MDCCR_VAL 0xa00000
98
99/* rx and tx owner bit */
100#define RX_OWEN_DMA (0x01 << 31)
101#define RX_OWEN_CPU (~(0x03 << 30))
102#define TX_OWEN_DMA (0x01 << 31)
103#define TX_OWEN_CPU (~(0x01 << 31))
104
105/* tx frame desc controller bit */
106#define MACTXINTEN 0x04
107#define CRCMODE 0x02
108#define PADDINGMODE 0x01
109
110/* fftcr controller bit */
111#define TXTHD (0x03 << 8)
112#define BLENGTH (0x01 << 20)
113
114/* global setting for driver */
115#define RX_DESC_SIZE 50
116#define TX_DESC_SIZE 10
117#define MAX_RBUFF_SZ 0x600
118#define MAX_TBUFF_SZ 0x600
119#define TX_TIMEOUT 50
120#define DELAY 1000
121#define CAM0 0x0
122
123static int w90p910_mdio_read(struct net_device *dev, int phy_id, int reg);
124
125struct w90p910_rxbd {
126 unsigned int sl;
127 unsigned int buffer;
128 unsigned int reserved;
129 unsigned int next;
130};
131
132struct w90p910_txbd {
133 unsigned int mode;
134 unsigned int buffer;
135 unsigned int sl;
136 unsigned int next;
137};
138
139struct recv_pdesc {
140 struct w90p910_rxbd desclist[RX_DESC_SIZE];
141 char recv_buf[RX_DESC_SIZE][MAX_RBUFF_SZ];
142};
143
144struct tran_pdesc {
145 struct w90p910_txbd desclist[TX_DESC_SIZE];
146 char tran_buf[RX_DESC_SIZE][MAX_TBUFF_SZ];
147};
148
149struct w90p910_ether {
150 struct recv_pdesc *rdesc;
151 struct recv_pdesc *rdesc_phys;
152 struct tran_pdesc *tdesc;
153 struct tran_pdesc *tdesc_phys;
154 struct net_device_stats stats;
155 struct platform_device *pdev;
156 struct sk_buff *skb;
157 struct clk *clk;
158 struct clk *rmiiclk;
159 struct mii_if_info mii;
160 struct timer_list check_timer;
161 void __iomem *reg;
162 unsigned int rxirq;
163 unsigned int txirq;
164 unsigned int cur_tx;
165 unsigned int cur_rx;
166 unsigned int finish_tx;
167 unsigned int rx_packets;
168 unsigned int rx_bytes;
169 unsigned int start_tx_ptr;
170 unsigned int start_rx_ptr;
171 unsigned int linkflag;
172 spinlock_t lock;
173};
174
175static void update_linkspeed_register(struct net_device *dev,
176 unsigned int speed, unsigned int duplex)
177{
178 struct w90p910_ether *ether = netdev_priv(dev);
179 unsigned int val;
180
181 val = __raw_readl(ether->reg + REG_MCMDR);
182
183 if (speed == SPEED_100) {
184 /* 100 full/half duplex */
185 if (duplex == DUPLEX_FULL) {
186 val |= (MCMDR_OPMOD | MCMDR_FDUP);
187 } else {
188 val |= MCMDR_OPMOD;
189 val &= ~MCMDR_FDUP;
190 }
191 } else {
192 /* 10 full/half duplex */
193 if (duplex == DUPLEX_FULL) {
194 val |= MCMDR_FDUP;
195 val &= ~MCMDR_OPMOD;
196 } else {
197 val &= ~(MCMDR_FDUP | MCMDR_OPMOD);
198 }
199 }
200
201 __raw_writel(val, ether->reg + REG_MCMDR);
202}
203
204static void update_linkspeed(struct net_device *dev)
205{
206 struct w90p910_ether *ether = netdev_priv(dev);
207 struct platform_device *pdev;
208 unsigned int bmsr, bmcr, lpa, speed, duplex;
209
210 pdev = ether->pdev;
211
212 if (!mii_link_ok(&ether->mii)) {
213 ether->linkflag = 0x0;
214 netif_carrier_off(dev);
215 dev_warn(&pdev->dev, "%s: Link down.\n", dev->name);
216 return;
217 }
218
219 if (ether->linkflag == 1)
220 return;
221
222 bmsr = w90p910_mdio_read(dev, ether->mii.phy_id, MII_BMSR);
223 bmcr = w90p910_mdio_read(dev, ether->mii.phy_id, MII_BMCR);
224
225 if (bmcr & BMCR_ANENABLE) {
226 if (!(bmsr & BMSR_ANEGCOMPLETE))
227 return;
228
229 lpa = w90p910_mdio_read(dev, ether->mii.phy_id, MII_LPA);
230
231 if ((lpa & LPA_100FULL) || (lpa & LPA_100HALF))
232 speed = SPEED_100;
233 else
234 speed = SPEED_10;
235
236 if ((lpa & LPA_100FULL) || (lpa & LPA_10FULL))
237 duplex = DUPLEX_FULL;
238 else
239 duplex = DUPLEX_HALF;
240
241 } else {
242 speed = (bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10;
243 duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
244 }
245
246 update_linkspeed_register(dev, speed, duplex);
247
248 dev_info(&pdev->dev, "%s: Link now %i-%s\n", dev->name, speed,
249 (duplex == DUPLEX_FULL) ? "FullDuplex" : "HalfDuplex");
250 ether->linkflag = 0x01;
251
252 netif_carrier_on(dev);
253}
254
255static void w90p910_check_link(unsigned long dev_id)
256{
257 struct net_device *dev = (struct net_device *) dev_id;
258 struct w90p910_ether *ether = netdev_priv(dev);
259
260 update_linkspeed(dev);
261 mod_timer(&ether->check_timer, jiffies + msecs_to_jiffies(1000));
262}
263
264static void w90p910_write_cam(struct net_device *dev,
265 unsigned int x, unsigned char *pval)
266{
267 struct w90p910_ether *ether = netdev_priv(dev);
268 unsigned int msw, lsw;
269
270 msw = (pval[0] << 24) | (pval[1] << 16) | (pval[2] << 8) | pval[3];
271
272 lsw = (pval[4] << 24) | (pval[5] << 16);
273
274 __raw_writel(lsw, ether->reg + REG_CAML_BASE + x * CAM_ENTRY_SIZE);
275 __raw_writel(msw, ether->reg + REG_CAMM_BASE + x * CAM_ENTRY_SIZE);
276}
277
278static void w90p910_init_desc(struct net_device *dev)
279{
280 struct w90p910_ether *ether;
281 struct w90p910_txbd *tdesc, *tdesc_phys;
282 struct w90p910_rxbd *rdesc, *rdesc_phys;
283 unsigned int i, j;
284
285 ether = netdev_priv(dev);
286
287 ether->tdesc = (struct tran_pdesc *)
288 dma_alloc_coherent(NULL, sizeof(struct tran_pdesc),
289 (dma_addr_t *) &ether->tdesc_phys, GFP_KERNEL);
290
291 ether->rdesc = (struct recv_pdesc *)
292 dma_alloc_coherent(NULL, sizeof(struct recv_pdesc),
293 (dma_addr_t *) &ether->rdesc_phys, GFP_KERNEL);
294
295 for (i = 0; i < TX_DESC_SIZE; i++) {
296 tdesc = &(ether->tdesc->desclist[i]);
297
298 j = ((i + 1) / TX_DESC_SIZE);
299
300 if (j != 0) {
301 tdesc_phys = &(ether->tdesc_phys->desclist[0]);
302 ether->start_tx_ptr = (unsigned int)tdesc_phys;
303 tdesc->next = (unsigned int)ether->start_tx_ptr;
304 } else {
305 tdesc_phys = &(ether->tdesc_phys->desclist[i+1]);
306 tdesc->next = (unsigned int)tdesc_phys;
307 }
308
309 tdesc->buffer = (unsigned int)ether->tdesc_phys->tran_buf[i];
310 tdesc->sl = 0;
311 tdesc->mode = 0;
312 }
313
314 for (i = 0; i < RX_DESC_SIZE; i++) {
315 rdesc = &(ether->rdesc->desclist[i]);
316
317 j = ((i + 1) / RX_DESC_SIZE);
318
319 if (j != 0) {
320 rdesc_phys = &(ether->rdesc_phys->desclist[0]);
321 ether->start_rx_ptr = (unsigned int)rdesc_phys;
322 rdesc->next = (unsigned int)ether->start_rx_ptr;
323 } else {
324 rdesc_phys = &(ether->rdesc_phys->desclist[i+1]);
325 rdesc->next = (unsigned int)rdesc_phys;
326 }
327
328 rdesc->sl = RX_OWEN_DMA;
329 rdesc->buffer = (unsigned int)ether->rdesc_phys->recv_buf[i];
330 }
331}
332
333static void w90p910_set_fifo_threshold(struct net_device *dev)
334{
335 struct w90p910_ether *ether = netdev_priv(dev);
336 unsigned int val;
337
338 val = TXTHD | BLENGTH;
339 __raw_writel(val, ether->reg + REG_FFTCR);
340}
341
342static void w90p910_return_default_idle(struct net_device *dev)
343{
344 struct w90p910_ether *ether = netdev_priv(dev);
345 unsigned int val;
346
347 val = __raw_readl(ether->reg + REG_MCMDR);
348 val |= SWR;
349 __raw_writel(val, ether->reg + REG_MCMDR);
350}
351
352static void w90p910_trigger_rx(struct net_device *dev)
353{
354 struct w90p910_ether *ether = netdev_priv(dev);
355
356 __raw_writel(ENSTART, ether->reg + REG_RSDR);
357}
358
359static void w90p910_trigger_tx(struct net_device *dev)
360{
361 struct w90p910_ether *ether = netdev_priv(dev);
362
363 __raw_writel(ENSTART, ether->reg + REG_TSDR);
364}
365
366static void w90p910_enable_mac_interrupt(struct net_device *dev)
367{
368 struct w90p910_ether *ether = netdev_priv(dev);
369 unsigned int val;
370
371 val = ENTXINTR | ENRXINTR | ENRXGD | ENTXCP;
372 val |= ENTXBERR | ENRXBERR | ENTXABT;
373
374 __raw_writel(val, ether->reg + REG_MIEN);
375}
376
377static void w90p910_get_and_clear_int(struct net_device *dev,
378 unsigned int *val)
379{
380 struct w90p910_ether *ether = netdev_priv(dev);
381
382 *val = __raw_readl(ether->reg + REG_MISTA);
383 __raw_writel(*val, ether->reg + REG_MISTA);
384}
385
386static void w90p910_set_global_maccmd(struct net_device *dev)
387{
388 struct w90p910_ether *ether = netdev_priv(dev);
389 unsigned int val;
390
391 val = __raw_readl(ether->reg + REG_MCMDR);
392 val |= MCMDR_SPCRC | MCMDR_ENMDC | MCMDR_ACP | ENMDC;
393 __raw_writel(val, ether->reg + REG_MCMDR);
394}
395
396static void w90p910_enable_cam(struct net_device *dev)
397{
398 struct w90p910_ether *ether = netdev_priv(dev);
399 unsigned int val;
400
401 w90p910_write_cam(dev, CAM0, dev->dev_addr);
402
403 val = __raw_readl(ether->reg + REG_CAMEN);
404 val |= CAM0EN;
405 __raw_writel(val, ether->reg + REG_CAMEN);
406}
407
408static void w90p910_enable_cam_command(struct net_device *dev)
409{
410 struct w90p910_ether *ether = netdev_priv(dev);
411 unsigned int val;
412
413 val = CAMCMR_ECMP | CAMCMR_ABP | CAMCMR_AMP;
414 __raw_writel(val, ether->reg + REG_CAMCMR);
415}
416
417static void w90p910_enable_tx(struct net_device *dev, unsigned int enable)
418{
419 struct w90p910_ether *ether = netdev_priv(dev);
420 unsigned int val;
421
422 val = __raw_readl(ether->reg + REG_MCMDR);
423
424 if (enable)
425 val |= MCMDR_TXON;
426 else
427 val &= ~MCMDR_TXON;
428
429 __raw_writel(val, ether->reg + REG_MCMDR);
430}
431
432static void w90p910_enable_rx(struct net_device *dev, unsigned int enable)
433{
434 struct w90p910_ether *ether = netdev_priv(dev);
435 unsigned int val;
436
437 val = __raw_readl(ether->reg + REG_MCMDR);
438
439 if (enable)
440 val |= MCMDR_RXON;
441 else
442 val &= ~MCMDR_RXON;
443
444 __raw_writel(val, ether->reg + REG_MCMDR);
445}
446
447static void w90p910_set_curdest(struct net_device *dev)
448{
449 struct w90p910_ether *ether = netdev_priv(dev);
450
451 __raw_writel(ether->start_rx_ptr, ether->reg + REG_RXDLSA);
452 __raw_writel(ether->start_tx_ptr, ether->reg + REG_TXDLSA);
453}
454
455static void w90p910_reset_mac(struct net_device *dev)
456{
457 struct w90p910_ether *ether = netdev_priv(dev);
458
459 spin_lock(&ether->lock);
460
461 w90p910_enable_tx(dev, 0);
462 w90p910_enable_rx(dev, 0);
463 w90p910_set_fifo_threshold(dev);
464 w90p910_return_default_idle(dev);
465
466 if (!netif_queue_stopped(dev))
467 netif_stop_queue(dev);
468
469 w90p910_init_desc(dev);
470
471 dev->trans_start = jiffies;
472 ether->cur_tx = 0x0;
473 ether->finish_tx = 0x0;
474 ether->cur_rx = 0x0;
475
476 w90p910_set_curdest(dev);
477 w90p910_enable_cam(dev);
478 w90p910_enable_cam_command(dev);
479 w90p910_enable_mac_interrupt(dev);
480 w90p910_enable_tx(dev, 1);
481 w90p910_enable_rx(dev, 1);
482 w90p910_trigger_tx(dev);
483 w90p910_trigger_rx(dev);
484
485 dev->trans_start = jiffies;
486
487 if (netif_queue_stopped(dev))
488 netif_wake_queue(dev);
489
490 spin_unlock(&ether->lock);
491}
492
493static void w90p910_mdio_write(struct net_device *dev,
494 int phy_id, int reg, int data)
495{
496 struct w90p910_ether *ether = netdev_priv(dev);
497 struct platform_device *pdev;
498 unsigned int val, i;
499
500 pdev = ether->pdev;
501
502 __raw_writel(data, ether->reg + REG_MIID);
503
504 val = (phy_id << 0x08) | reg;
505 val |= PHYBUSY | PHYWR | MDCCR_VAL;
506 __raw_writel(val, ether->reg + REG_MIIDA);
507
508 for (i = 0; i < DELAY; i++) {
509 if ((__raw_readl(ether->reg + REG_MIIDA) & PHYBUSY) == 0)
510 break;
511 }
512
513 if (i == DELAY)
514 dev_warn(&pdev->dev, "mdio write timed out\n");
515}
516
517static int w90p910_mdio_read(struct net_device *dev, int phy_id, int reg)
518{
519 struct w90p910_ether *ether = netdev_priv(dev);
520 struct platform_device *pdev;
521 unsigned int val, i, data;
522
523 pdev = ether->pdev;
524
525 val = (phy_id << 0x08) | reg;
526 val |= PHYBUSY | MDCCR_VAL;
527 __raw_writel(val, ether->reg + REG_MIIDA);
528
529 for (i = 0; i < DELAY; i++) {
530 if ((__raw_readl(ether->reg + REG_MIIDA) & PHYBUSY) == 0)
531 break;
532 }
533
534 if (i == DELAY) {
535 dev_warn(&pdev->dev, "mdio read timed out\n");
536 data = 0xffff;
537 } else {
538 data = __raw_readl(ether->reg + REG_MIID);
539 }
540
541 return data;
542}
543
544static int set_mac_address(struct net_device *dev, void *addr)
545{
546 struct sockaddr *address = addr;
547
548 if (!is_valid_ether_addr(address->sa_data))
549 return -EADDRNOTAVAIL;
550
551 memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
552 w90p910_write_cam(dev, CAM0, dev->dev_addr);
553
554 return 0;
555}
556
557static int w90p910_ether_close(struct net_device *dev)
558{
559 struct w90p910_ether *ether = netdev_priv(dev);
560
561 dma_free_writecombine(NULL, sizeof(struct w90p910_rxbd),
562 ether->rdesc, (dma_addr_t)ether->rdesc_phys);
563 dma_free_writecombine(NULL, sizeof(struct w90p910_txbd),
564 ether->tdesc, (dma_addr_t)ether->tdesc_phys);
565
566 netif_stop_queue(dev);
567
568 del_timer_sync(&ether->check_timer);
569 clk_disable(ether->rmiiclk);
570 clk_disable(ether->clk);
571
572 free_irq(ether->txirq, dev);
573 free_irq(ether->rxirq, dev);
574
575 return 0;
576}
577
578static struct net_device_stats *w90p910_ether_stats(struct net_device *dev)
579{
580 struct w90p910_ether *ether;
581
582 ether = netdev_priv(dev);
583
584 return &ether->stats;
585}
586
587static int w90p910_send_frame(struct net_device *dev,
588 unsigned char *data, int length)
589{
590 struct w90p910_ether *ether;
591 struct w90p910_txbd *txbd;
592 struct platform_device *pdev;
593 unsigned char *buffer;
594
595 ether = netdev_priv(dev);
596 pdev = ether->pdev;
597
598 txbd = &ether->tdesc->desclist[ether->cur_tx];
599 buffer = ether->tdesc->tran_buf[ether->cur_tx];
600 if (length > 1514) {
601 dev_err(&pdev->dev, "send data %d bytes, check it\n", length);
602 length = 1514;
603 }
604
605 txbd->sl = length & 0xFFFF;
606
607 memcpy(buffer, data, length);
608
609 txbd->mode = TX_OWEN_DMA | PADDINGMODE | CRCMODE | MACTXINTEN;
610
611 w90p910_enable_tx(dev, 1);
612
613 w90p910_trigger_tx(dev);
614
615 ether->cur_tx = (ether->cur_tx+1) % TX_DESC_SIZE;
616 txbd = &ether->tdesc->desclist[ether->cur_tx];
617
618 dev->trans_start = jiffies;
619
620 if (txbd->mode & TX_OWEN_DMA)
621 netif_stop_queue(dev);
622
623 return 0;
624}
625
626static int w90p910_ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
627{
628 struct w90p910_ether *ether = netdev_priv(dev);
629
630 if (!(w90p910_send_frame(dev, skb->data, skb->len))) {
631 ether->skb = skb;
632 dev_kfree_skb_irq(skb);
633 return 0;
634 }
635 return -1;
636}
637
638static irqreturn_t w90p910_tx_interrupt(int irq, void *dev_id)
639{
640 struct w90p910_ether *ether;
641 struct w90p910_txbd *txbd;
642 struct platform_device *pdev;
643 struct tran_pdesc *tran_pdesc;
644 struct net_device *dev;
645 unsigned int cur_entry, entry, status;
646
647 dev = (struct net_device *)dev_id;
648 ether = netdev_priv(dev);
649 pdev = ether->pdev;
650
651 spin_lock(&ether->lock);
652
653 w90p910_get_and_clear_int(dev, &status);
654
655 cur_entry = __raw_readl(ether->reg + REG_CTXDSA);
656
657 tran_pdesc = ether->tdesc_phys;
658 entry = (unsigned int)(&tran_pdesc->desclist[ether->finish_tx]);
659
660 while (entry != cur_entry) {
661 txbd = &ether->tdesc->desclist[ether->finish_tx];
662
663 ether->finish_tx = (ether->finish_tx + 1) % TX_DESC_SIZE;
664
665 if (txbd->sl & TXDS_TXCP) {
666 ether->stats.tx_packets++;
667 ether->stats.tx_bytes += txbd->sl & 0xFFFF;
668 } else {
669 ether->stats.tx_errors++;
670 }
671
672 txbd->sl = 0x0;
673 txbd->mode = 0x0;
674
675 if (netif_queue_stopped(dev))
676 netif_wake_queue(dev);
677
678 entry = (unsigned int)(&tran_pdesc->desclist[ether->finish_tx]);
679 }
680
681 if (status & MISTA_EXDEF) {
682 dev_err(&pdev->dev, "emc defer exceed interrupt\n");
683 } else if (status & MISTA_TXBERR) {
684 dev_err(&pdev->dev, "emc bus error interrupt\n");
685 w90p910_reset_mac(dev);
686 } else if (status & MISTA_TDU) {
687 if (netif_queue_stopped(dev))
688 netif_wake_queue(dev);
689 }
690
691 spin_unlock(&ether->lock);
692
693 return IRQ_HANDLED;
694}
695
696static void netdev_rx(struct net_device *dev)
697{
698 struct w90p910_ether *ether;
699 struct w90p910_rxbd *rxbd;
700 struct platform_device *pdev;
701 struct recv_pdesc *rdesc_phys;
702 struct sk_buff *skb;
703 unsigned char *data;
704 unsigned int length, status, val, entry;
705
706 ether = netdev_priv(dev);
707 pdev = ether->pdev;
708 rdesc_phys = ether->rdesc_phys;
709
710 rxbd = &ether->rdesc->desclist[ether->cur_rx];
711
712 do {
713 val = __raw_readl(ether->reg + REG_CRXDSA);
714 entry = (unsigned int)&rdesc_phys->desclist[ether->cur_rx];
715
716 if (val == entry)
717 break;
718
719 status = rxbd->sl;
720 length = status & 0xFFFF;
721
722 if (status & RXDS_RXGD) {
723 data = ether->rdesc->recv_buf[ether->cur_rx];
724 skb = dev_alloc_skb(length+2);
725 if (!skb) {
726 dev_err(&pdev->dev, "get skb buffer error\n");
727 ether->stats.rx_dropped++;
728 return;
729 }
730
731 skb->dev = dev;
732 skb_reserve(skb, 2);
733 skb_put(skb, length);
734 skb_copy_to_linear_data(skb, data, length);
735 skb->protocol = eth_type_trans(skb, dev);
736 ether->stats.rx_packets++;
737 ether->stats.rx_bytes += length;
738 netif_rx(skb);
739 } else {
740 ether->stats.rx_errors++;
741
742 if (status & RXDS_RP) {
743 dev_err(&pdev->dev, "rx runt err\n");
744 ether->stats.rx_length_errors++;
745 } else if (status & RXDS_CRCE) {
746 dev_err(&pdev->dev, "rx crc err\n");
747 ether->stats.rx_crc_errors++;
748 }
749
750 if (status & RXDS_ALIE) {
751 dev_err(&pdev->dev, "rx aligment err\n");
752 ether->stats.rx_frame_errors++;
753 } else if (status & RXDS_PTLE) {
754 dev_err(&pdev->dev, "rx longer err\n");
755 ether->stats.rx_over_errors++;
756 }
757 }
758
759 rxbd->sl = RX_OWEN_DMA;
760 rxbd->reserved = 0x0;
761 ether->cur_rx = (ether->cur_rx+1) % RX_DESC_SIZE;
762 rxbd = &ether->rdesc->desclist[ether->cur_rx];
763
764 dev->last_rx = jiffies;
765 } while (1);
766}
767
768static irqreturn_t w90p910_rx_interrupt(int irq, void *dev_id)
769{
770 struct net_device *dev;
771 struct w90p910_ether *ether;
772 struct platform_device *pdev;
773 unsigned int status;
774
775 dev = (struct net_device *)dev_id;
776 ether = netdev_priv(dev);
777 pdev = ether->pdev;
778
779 spin_lock(&ether->lock);
780
781 w90p910_get_and_clear_int(dev, &status);
782
783 if (status & MISTA_RDU) {
784 netdev_rx(dev);
785
786 w90p910_trigger_rx(dev);
787
788 spin_unlock(&ether->lock);
789 return IRQ_HANDLED;
790 } else if (status & MISTA_RXBERR) {
791 dev_err(&pdev->dev, "emc rx bus error\n");
792 w90p910_reset_mac(dev);
793 }
794
795 netdev_rx(dev);
796 spin_unlock(&ether->lock);
797 return IRQ_HANDLED;
798}
799
800static int w90p910_ether_open(struct net_device *dev)
801{
802 struct w90p910_ether *ether;
803 struct platform_device *pdev;
804
805 ether = netdev_priv(dev);
806 pdev = ether->pdev;
807
808 w90p910_reset_mac(dev);
809 w90p910_set_fifo_threshold(dev);
810 w90p910_set_curdest(dev);
811 w90p910_enable_cam(dev);
812 w90p910_enable_cam_command(dev);
813 w90p910_enable_mac_interrupt(dev);
814 w90p910_set_global_maccmd(dev);
815 w90p910_enable_rx(dev, 1);
816
817 ether->rx_packets = 0x0;
818 ether->rx_bytes = 0x0;
819
820 if (request_irq(ether->txirq, w90p910_tx_interrupt,
821 0x0, pdev->name, dev)) {
822 dev_err(&pdev->dev, "register irq tx failed\n");
823 return -EAGAIN;
824 }
825
826 if (request_irq(ether->rxirq, w90p910_rx_interrupt,
827 0x0, pdev->name, dev)) {
828 dev_err(&pdev->dev, "register irq rx failed\n");
829 return -EAGAIN;
830 }
831
832 mod_timer(&ether->check_timer, jiffies + msecs_to_jiffies(1000));
833 netif_start_queue(dev);
834 w90p910_trigger_rx(dev);
835
836 dev_info(&pdev->dev, "%s is OPENED\n", dev->name);
837
838 return 0;
839}
840
841static void w90p910_ether_set_multicast_list(struct net_device *dev)
842{
843 struct w90p910_ether *ether;
844 unsigned int rx_mode;
845
846 ether = netdev_priv(dev);
847
848 if (dev->flags & IFF_PROMISC)
849 rx_mode = CAMCMR_AUP | CAMCMR_AMP | CAMCMR_ABP | CAMCMR_ECMP;
850 else if ((dev->flags & IFF_ALLMULTI) || dev->mc_list)
851 rx_mode = CAMCMR_AMP | CAMCMR_ABP | CAMCMR_ECMP;
852 else
853 rx_mode = CAMCMR_ECMP | CAMCMR_ABP;
854 __raw_writel(rx_mode, ether->reg + REG_CAMCMR);
855}
856
857static int w90p910_ether_ioctl(struct net_device *dev,
858 struct ifreq *ifr, int cmd)
859{
860 struct w90p910_ether *ether = netdev_priv(dev);
861 struct mii_ioctl_data *data = if_mii(ifr);
862
863 return generic_mii_ioctl(&ether->mii, data, cmd, NULL);
864}
865
866static void w90p910_get_drvinfo(struct net_device *dev,
867 struct ethtool_drvinfo *info)
868{
869 strcpy(info->driver, DRV_MODULE_NAME);
870 strcpy(info->version, DRV_MODULE_VERSION);
871}
872
873static int w90p910_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
874{
875 struct w90p910_ether *ether = netdev_priv(dev);
876 return mii_ethtool_gset(&ether->mii, cmd);
877}
878
879static int w90p910_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
880{
881 struct w90p910_ether *ether = netdev_priv(dev);
882 return mii_ethtool_sset(&ether->mii, cmd);
883}
884
885static int w90p910_nway_reset(struct net_device *dev)
886{
887 struct w90p910_ether *ether = netdev_priv(dev);
888 return mii_nway_restart(&ether->mii);
889}
890
891static u32 w90p910_get_link(struct net_device *dev)
892{
893 struct w90p910_ether *ether = netdev_priv(dev);
894 return mii_link_ok(&ether->mii);
895}
896
897static const struct ethtool_ops w90p910_ether_ethtool_ops = {
898 .get_settings = w90p910_get_settings,
899 .set_settings = w90p910_set_settings,
900 .get_drvinfo = w90p910_get_drvinfo,
901 .nway_reset = w90p910_nway_reset,
902 .get_link = w90p910_get_link,
903};
904
905static const struct net_device_ops w90p910_ether_netdev_ops = {
906 .ndo_open = w90p910_ether_open,
907 .ndo_stop = w90p910_ether_close,
908 .ndo_start_xmit = w90p910_ether_start_xmit,
909 .ndo_get_stats = w90p910_ether_stats,
910 .ndo_set_multicast_list = w90p910_ether_set_multicast_list,
911 .ndo_set_mac_address = set_mac_address,
912 .ndo_do_ioctl = w90p910_ether_ioctl,
913 .ndo_validate_addr = eth_validate_addr,
914 .ndo_change_mtu = eth_change_mtu,
915};
916
917static void __init get_mac_address(struct net_device *dev)
918{
919 struct w90p910_ether *ether = netdev_priv(dev);
920 struct platform_device *pdev;
921 char addr[6];
922
923 pdev = ether->pdev;
924
925 addr[0] = 0x00;
926 addr[1] = 0x02;
927 addr[2] = 0xac;
928 addr[3] = 0x55;
929 addr[4] = 0x88;
930 addr[5] = 0xa8;
931
932 if (is_valid_ether_addr(addr))
933 memcpy(dev->dev_addr, &addr, 0x06);
934 else
935 dev_err(&pdev->dev, "invalid mac address\n");
936}
937
938static int w90p910_ether_setup(struct net_device *dev)
939{
940 struct w90p910_ether *ether = netdev_priv(dev);
941
942 ether_setup(dev);
943 dev->netdev_ops = &w90p910_ether_netdev_ops;
944 dev->ethtool_ops = &w90p910_ether_ethtool_ops;
945
946 dev->tx_queue_len = 16;
947 dev->dma = 0x0;
948 dev->watchdog_timeo = TX_TIMEOUT;
949
950 get_mac_address(dev);
951
952 spin_lock_init(&ether->lock);
953
954 ether->cur_tx = 0x0;
955 ether->cur_rx = 0x0;
956 ether->finish_tx = 0x0;
957 ether->linkflag = 0x0;
958 ether->mii.phy_id = 0x01;
959 ether->mii.phy_id_mask = 0x1f;
960 ether->mii.reg_num_mask = 0x1f;
961 ether->mii.dev = dev;
962 ether->mii.mdio_read = w90p910_mdio_read;
963 ether->mii.mdio_write = w90p910_mdio_write;
964
965 setup_timer(&ether->check_timer, w90p910_check_link,
966 (unsigned long)dev);
967
968 return 0;
969}
970
971static int __devinit w90p910_ether_probe(struct platform_device *pdev)
972{
973 struct w90p910_ether *ether;
974 struct net_device *dev;
975 struct resource *res;
976 int error;
977
978 dev = alloc_etherdev(sizeof(struct w90p910_ether));
979 if (!dev)
980 return -ENOMEM;
981
982 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
983 if (res == NULL) {
984 dev_err(&pdev->dev, "failed to get I/O memory\n");
985 error = -ENXIO;
986 goto failed_free;
987 }
988
989 res = request_mem_region(res->start, resource_size(res), pdev->name);
990 if (res == NULL) {
991 dev_err(&pdev->dev, "failed to request I/O memory\n");
992 error = -EBUSY;
993 goto failed_free;
994 }
995
996 ether = netdev_priv(dev);
997
998 ether->reg = ioremap(res->start, resource_size(res));
999 if (ether->reg == NULL) {
1000 dev_err(&pdev->dev, "failed to remap I/O memory\n");
1001 error = -ENXIO;
1002 goto failed_free_mem;
1003 }
1004
1005 ether->txirq = platform_get_irq(pdev, 0);
1006 if (ether->txirq < 0) {
1007 dev_err(&pdev->dev, "failed to get ether tx irq\n");
1008 error = -ENXIO;
1009 goto failed_free_io;
1010 }
1011
1012 ether->rxirq = platform_get_irq(pdev, 1);
1013 if (ether->rxirq < 0) {
1014 dev_err(&pdev->dev, "failed to get ether rx irq\n");
1015 error = -ENXIO;
1016 goto failed_free_txirq;
1017 }
1018
1019 platform_set_drvdata(pdev, dev);
1020
1021 ether->clk = clk_get(&pdev->dev, NULL);
1022 if (IS_ERR(ether->clk)) {
1023 dev_err(&pdev->dev, "failed to get ether clock\n");
1024 error = PTR_ERR(ether->clk);
1025 goto failed_free_rxirq;
1026 }
1027
1028 ether->rmiiclk = clk_get(&pdev->dev, "RMII");
1029 if (IS_ERR(ether->rmiiclk)) {
1030 dev_err(&pdev->dev, "failed to get ether clock\n");
1031 error = PTR_ERR(ether->rmiiclk);
1032 goto failed_put_clk;
1033 }
1034
1035 ether->pdev = pdev;
1036
1037 w90p910_ether_setup(dev);
1038
1039 error = register_netdev(dev);
1040 if (error != 0) {
1041 dev_err(&pdev->dev, "Regiter EMC w90p910 FAILED\n");
1042 error = -ENODEV;
1043 goto failed_put_rmiiclk;
1044 }
1045
1046 return 0;
1047failed_put_rmiiclk:
1048 clk_put(ether->rmiiclk);
1049failed_put_clk:
1050 clk_put(ether->clk);
1051failed_free_rxirq:
1052 free_irq(ether->rxirq, pdev);
1053 platform_set_drvdata(pdev, NULL);
1054failed_free_txirq:
1055 free_irq(ether->txirq, pdev);
1056failed_free_io:
1057 iounmap(ether->reg);
1058failed_free_mem:
1059 release_mem_region(res->start, resource_size(res));
1060failed_free:
1061 free_netdev(dev);
1062 return error;
1063}
1064
1065static int __devexit w90p910_ether_remove(struct platform_device *pdev)
1066{
1067 struct net_device *dev = platform_get_drvdata(pdev);
1068 struct w90p910_ether *ether = netdev_priv(dev);
1069
1070 unregister_netdev(dev);
1071 clk_put(ether->rmiiclk);
1072 clk_put(ether->clk);
1073 del_timer_sync(&ether->check_timer);
1074 platform_set_drvdata(pdev, NULL);
1075 free_netdev(dev);
1076 return 0;
1077}
1078
1079static struct platform_driver w90p910_ether_driver = {
1080 .probe = w90p910_ether_probe,
1081 .remove = __devexit_p(w90p910_ether_remove),
1082 .driver = {
1083 .name = "w90p910-emc",
1084 .owner = THIS_MODULE,
1085 },
1086};
1087
1088static int __init w90p910_ether_init(void)
1089{
1090 return platform_driver_register(&w90p910_ether_driver);
1091}
1092
1093static void __exit w90p910_ether_exit(void)
1094{
1095 platform_driver_unregister(&w90p910_ether_driver);
1096}
1097
1098module_init(w90p910_ether_init);
1099module_exit(w90p910_ether_exit);
1100
1101MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
1102MODULE_DESCRIPTION("w90p910 MAC driver!");
1103MODULE_LICENSE("GPL");
1104MODULE_ALIAS("platform:w90p910-emc");
1105
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 18b566ad4fd1..cf30e278f182 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -318,7 +318,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
318 pos3 = mca_read_stored_pos( slot, 3 ); 318 pos3 = mca_read_stored_pos( slot, 3 );
319 pos4 = mca_read_stored_pos( slot, 4 ); 319 pos4 = mca_read_stored_pos( slot, 4 );
320 320
321 for (l_i = 0; l_i < 0x09; l_i++) 321 for (l_i = 0; l_i < 8; l_i++)
322 if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i]) 322 if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
323 break; 323 break;
324 ioaddr = at1700_mca_probe_list[l_i]; 324 ioaddr = at1700_mca_probe_list[l_i];
diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
index e1658ef3fcdf..2a1120ad2e74 100644
--- a/drivers/net/atl1c/atl1c.h
+++ b/drivers/net/atl1c/atl1c.h
@@ -188,14 +188,14 @@ struct atl1c_tpd_ext_desc {
188#define RRS_HDS_TYPE_DATA 2 188#define RRS_HDS_TYPE_DATA 2
189 189
190#define RRS_IS_NO_HDS_TYPE(flag) \ 190#define RRS_IS_NO_HDS_TYPE(flag) \
191 (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == 0) 191 ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == 0)
192 192
193#define RRS_IS_HDS_HEAD(flag) \ 193#define RRS_IS_HDS_HEAD(flag) \
194 (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \ 194 ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \
195 RRS_HDS_TYPE_HEAD) 195 RRS_HDS_TYPE_HEAD)
196 196
197#define RRS_IS_HDS_DATA(flag) \ 197#define RRS_IS_HDS_DATA(flag) \
198 (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \ 198 ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \
199 RRS_HDS_TYPE_DATA) 199 RRS_HDS_TYPE_DATA)
200 200
201/* rrs word 3 bit 0:31 */ 201/* rrs word 3 bit 0:31 */
@@ -245,7 +245,7 @@ struct atl1c_tpd_ext_desc {
245#define RRS_PACKET_TYPE_802_3 1 245#define RRS_PACKET_TYPE_802_3 1
246#define RRS_PACKET_TYPE_ETH 0 246#define RRS_PACKET_TYPE_ETH 0
247#define RRS_PACKET_IS_ETH(word) \ 247#define RRS_PACKET_IS_ETH(word) \
248 (((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK == \ 248 ((((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK) == \
249 RRS_PACKET_TYPE_ETH) 249 RRS_PACKET_TYPE_ETH)
250#define RRS_RXD_IS_VALID(word) \ 250#define RRS_RXD_IS_VALID(word) \
251 ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1) 251 ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1)
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index cd547a205fb9..a383122679de 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -1689,7 +1689,7 @@ static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
1689 if (likely(RRS_RXD_IS_VALID(rrs->word3))) { 1689 if (likely(RRS_RXD_IS_VALID(rrs->word3))) {
1690 rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) & 1690 rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) &
1691 RRS_RX_RFD_CNT_MASK; 1691 RRS_RX_RFD_CNT_MASK;
1692 if (unlikely(rfd_num) != 1) 1692 if (unlikely(rfd_num != 1))
1693 /* TODO support mul rfd*/ 1693 /* TODO support mul rfd*/
1694 if (netif_msg_rx_err(adapter)) 1694 if (netif_msg_rx_err(adapter))
1695 dev_warn(&pdev->dev, 1695 dev_warn(&pdev->dev,
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index c734b1983ec1..204db961029e 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -2071,7 +2071,7 @@ static int atl2_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2071 if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) 2071 if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
2072 return -EOPNOTSUPP; 2072 return -EOPNOTSUPP;
2073 2073
2074 if (wol->wolopts & (WAKE_MCAST|WAKE_BCAST|WAKE_MCAST)) 2074 if (wol->wolopts & (WAKE_UCAST | WAKE_BCAST | WAKE_MCAST))
2075 return -EOPNOTSUPP; 2075 return -EOPNOTSUPP;
2076 2076
2077 /* these settings will always override what we currently have */ 2077 /* these settings will always override what we currently have */
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index c43f6a119295..dea3155688bb 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -667,7 +667,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
667 struct be_queue_info *rxq = &adapter->rx_obj.q; 667 struct be_queue_info *rxq = &adapter->rx_obj.q;
668 struct be_rx_page_info *page_info; 668 struct be_rx_page_info *page_info;
669 u16 rxq_idx, i, num_rcvd, j; 669 u16 rxq_idx, i, num_rcvd, j;
670 u32 pktsize, hdr_len, curr_frag_len; 670 u32 pktsize, hdr_len, curr_frag_len, size;
671 u8 *start; 671 u8 *start;
672 672
673 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 673 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
@@ -708,12 +708,13 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
708 } 708 }
709 709
710 /* More frags present for this completion */ 710 /* More frags present for this completion */
711 pktsize -= curr_frag_len; /* account for above copied frag */ 711 size = pktsize;
712 for (i = 1, j = 0; i < num_rcvd; i++) { 712 for (i = 1, j = 0; i < num_rcvd; i++) {
713 size -= curr_frag_len;
713 index_inc(&rxq_idx, rxq->len); 714 index_inc(&rxq_idx, rxq->len);
714 page_info = get_rx_page_info(adapter, rxq_idx); 715 page_info = get_rx_page_info(adapter, rxq_idx);
715 716
716 curr_frag_len = min(pktsize, rx_frag_size); 717 curr_frag_len = min(size, rx_frag_size);
717 718
718 /* Coalesce all frags from the same physical page in one slot */ 719 /* Coalesce all frags from the same physical page in one slot */
719 if (page_info->page_offset == 0) { 720 if (page_info->page_offset == 0) {
@@ -731,7 +732,6 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
731 skb_shinfo(skb)->frags[j].size += curr_frag_len; 732 skb_shinfo(skb)->frags[j].size += curr_frag_len;
732 skb->len += curr_frag_len; 733 skb->len += curr_frag_len;
733 skb->data_len += curr_frag_len; 734 skb->data_len += curr_frag_len;
734 pktsize -= curr_frag_len;
735 735
736 memset(page_info, 0, sizeof(*page_info)); 736 memset(page_info, 0, sizeof(*page_info));
737 } 737 }
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c
index ed648acef7cf..2ee581a2cdec 100644
--- a/drivers/net/bnx2x_link.c
+++ b/drivers/net/bnx2x_link.c
@@ -4212,13 +4212,14 @@ static void bnx2x_turn_off_sf(struct bnx2x *bp, u8 port)
4212u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded, 4212u8 bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded,
4213 u8 *version, u16 len) 4213 u8 *version, u16 len)
4214{ 4214{
4215 struct bnx2x *bp = params->bp; 4215 struct bnx2x *bp;
4216 u32 ext_phy_type = 0; 4216 u32 ext_phy_type = 0;
4217 u32 spirom_ver = 0; 4217 u32 spirom_ver = 0;
4218 u8 status = 0 ; 4218 u8 status = 0 ;
4219 4219
4220 if (version == NULL || params == NULL) 4220 if (version == NULL || params == NULL)
4221 return -EINVAL; 4221 return -EINVAL;
4222 bp = params->bp;
4222 4223
4223 spirom_ver = REG_RD(bp, params->shmem_base + 4224 spirom_ver = REG_RD(bp, params->shmem_base +
4224 offsetof(struct shmem_region, 4225 offsetof(struct shmem_region,
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d927f71af8a3..aa1be1feceed 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1459,8 +1459,16 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1459 * ether type (eg ARPHRD_ETHER and ARPHRD_INFINIBAND) share the same bond 1459 * ether type (eg ARPHRD_ETHER and ARPHRD_INFINIBAND) share the same bond
1460 */ 1460 */
1461 if (bond->slave_cnt == 0) { 1461 if (bond->slave_cnt == 0) {
1462 if (slave_dev->type != ARPHRD_ETHER) 1462 if (bond_dev->type != slave_dev->type) {
1463 bond_setup_by_slave(bond_dev, slave_dev); 1463 dev_close(bond_dev);
1464 pr_debug("%s: change device type from %d to %d\n",
1465 bond_dev->name, bond_dev->type, slave_dev->type);
1466 if (slave_dev->type != ARPHRD_ETHER)
1467 bond_setup_by_slave(bond_dev, slave_dev);
1468 else
1469 ether_setup(bond_dev);
1470 dev_open(bond_dev);
1471 }
1464 } else if (bond_dev->type != slave_dev->type) { 1472 } else if (bond_dev->type != slave_dev->type) {
1465 pr_err(DRV_NAME ": %s ether type (%d) is different " 1473 pr_err(DRV_NAME ": %s ether type (%d) is different "
1466 "from other slaves (%d), can not enslave it.\n", 1474 "from other slaves (%d), can not enslave it.\n",
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 574daddc21bf..9e4283aff828 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -346,7 +346,7 @@ void can_restart(unsigned long data)
346 skb = dev_alloc_skb(sizeof(struct can_frame)); 346 skb = dev_alloc_skb(sizeof(struct can_frame));
347 if (skb == NULL) { 347 if (skb == NULL) {
348 err = -ENOMEM; 348 err = -ENOMEM;
349 goto out; 349 goto restart;
350 } 350 }
351 skb->dev = dev; 351 skb->dev = dev;
352 skb->protocol = htons(ETH_P_CAN); 352 skb->protocol = htons(ETH_P_CAN);
@@ -361,13 +361,13 @@ void can_restart(unsigned long data)
361 stats->rx_packets++; 361 stats->rx_packets++;
362 stats->rx_bytes += cf->can_dlc; 362 stats->rx_bytes += cf->can_dlc;
363 363
364restart:
364 dev_dbg(dev->dev.parent, "restarted\n"); 365 dev_dbg(dev->dev.parent, "restarted\n");
365 priv->can_stats.restarts++; 366 priv->can_stats.restarts++;
366 367
367 /* Now restart the device */ 368 /* Now restart the device */
368 err = priv->do_set_mode(dev, CAN_MODE_START); 369 err = priv->do_set_mode(dev, CAN_MODE_START);
369 370
370out:
371 netif_carrier_on(dev); 371 netif_carrier_on(dev);
372 if (err) 372 if (err)
373 dev_err(dev->dev.parent, "Error %d during restart", err); 373 dev_err(dev->dev.parent, "Error %d during restart", err);
@@ -473,6 +473,10 @@ int open_candev(struct net_device *dev)
473 return -EINVAL; 473 return -EINVAL;
474 } 474 }
475 475
476 /* Switch carrier on if device was stopped while in bus-off state */
477 if (!netif_carrier_ok(dev))
478 netif_carrier_on(dev);
479
476 setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev); 480 setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
477 481
478 return 0; 482 return 0;
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 571f133a8fec..08ebee79d8a6 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -63,7 +63,6 @@
63#include <linux/can.h> 63#include <linux/can.h>
64#include <linux/can/dev.h> 64#include <linux/can/dev.h>
65#include <linux/can/error.h> 65#include <linux/can/error.h>
66#include <linux/can/dev.h>
67 66
68#include "sja1000.h" 67#include "sja1000.h"
69 68
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 4d1515f45ba2..4869d77cbe91 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -227,7 +227,7 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type,
227 } 227 }
228 228
229 rcu_read_lock(); 229 rcu_read_lock();
230 ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]); 230 ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]);
231 if (ulp_ops) 231 if (ulp_ops)
232 ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); 232 ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len);
233 rcu_read_unlock(); 233 rcu_read_unlock();
@@ -319,6 +319,20 @@ static int cnic_abort_prep(struct cnic_sock *csk)
319 return 0; 319 return 0;
320} 320}
321 321
322static void cnic_uio_stop(void)
323{
324 struct cnic_dev *dev;
325
326 read_lock(&cnic_dev_lock);
327 list_for_each_entry(dev, &cnic_dev_list, list) {
328 struct cnic_local *cp = dev->cnic_priv;
329
330 if (cp->cnic_uinfo)
331 cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
332 }
333 read_unlock(&cnic_dev_lock);
334}
335
322int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) 336int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops)
323{ 337{
324 struct cnic_dev *dev; 338 struct cnic_dev *dev;
@@ -390,6 +404,9 @@ int cnic_unregister_driver(int ulp_type)
390 } 404 }
391 read_unlock(&cnic_dev_lock); 405 read_unlock(&cnic_dev_lock);
392 406
407 if (ulp_type == CNIC_ULP_ISCSI)
408 cnic_uio_stop();
409
393 rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); 410 rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL);
394 411
395 mutex_unlock(&cnic_lock); 412 mutex_unlock(&cnic_lock);
@@ -632,7 +649,6 @@ static void cnic_free_resc(struct cnic_dev *dev)
632 int i = 0; 649 int i = 0;
633 650
634 if (cp->cnic_uinfo) { 651 if (cp->cnic_uinfo) {
635 cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
636 while (cp->uio_dev != -1 && i < 15) { 652 while (cp->uio_dev != -1 && i < 15) {
637 msleep(100); 653 msleep(100);
638 i++; 654 i++;
@@ -1057,6 +1073,9 @@ static void cnic_ulp_stop(struct cnic_dev *dev)
1057 struct cnic_local *cp = dev->cnic_priv; 1073 struct cnic_local *cp = dev->cnic_priv;
1058 int if_type; 1074 int if_type;
1059 1075
1076 if (cp->cnic_uinfo)
1077 cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
1078
1060 rcu_read_lock(); 1079 rcu_read_lock();
1061 for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { 1080 for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) {
1062 struct cnic_ulp_ops *ulp_ops; 1081 struct cnic_ulp_ops *ulp_ops;
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 3eee666a9cd2..55445f980f9c 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -1524,6 +1524,7 @@ static void net_timeout(struct net_device *dev)
1524static int net_send_packet(struct sk_buff *skb, struct net_device *dev) 1524static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
1525{ 1525{
1526 struct net_local *lp = netdev_priv(dev); 1526 struct net_local *lp = netdev_priv(dev);
1527 unsigned long flags;
1527 1528
1528 if (net_debug > 3) { 1529 if (net_debug > 3) {
1529 printk("%s: sent %d byte packet of type %x\n", 1530 printk("%s: sent %d byte packet of type %x\n",
@@ -1535,7 +1536,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
1535 ask the chip to start transmitting before the 1536 ask the chip to start transmitting before the
1536 whole packet has been completely uploaded. */ 1537 whole packet has been completely uploaded. */
1537 1538
1538 spin_lock_irq(&lp->lock); 1539 spin_lock_irqsave(&lp->lock, flags);
1539 netif_stop_queue(dev); 1540 netif_stop_queue(dev);
1540 1541
1541 /* initiate a transmit sequence */ 1542 /* initiate a transmit sequence */
@@ -1549,13 +1550,13 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
1549 * we're waiting for TxOk, so return 1 and requeue this packet. 1550 * we're waiting for TxOk, so return 1 and requeue this packet.
1550 */ 1551 */
1551 1552
1552 spin_unlock_irq(&lp->lock); 1553 spin_unlock_irqrestore(&lp->lock, flags);
1553 if (net_debug) printk("cs89x0: Tx buffer not free!\n"); 1554 if (net_debug) printk("cs89x0: Tx buffer not free!\n");
1554 return NETDEV_TX_BUSY; 1555 return NETDEV_TX_BUSY;
1555 } 1556 }
1556 /* Write the contents of the packet */ 1557 /* Write the contents of the packet */
1557 writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1); 1558 writewords(dev->base_addr, TX_FRAME_PORT,skb->data,(skb->len+1) >>1);
1558 spin_unlock_irq(&lp->lock); 1559 spin_unlock_irqrestore(&lp->lock, flags);
1559 lp->stats.tx_bytes += skb->len; 1560 lp->stats.tx_bytes += skb->len;
1560 dev->trans_start = jiffies; 1561 dev->trans_start = jiffies;
1561 dev_kfree_skb (skb); 1562 dev_kfree_skb (skb);
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index efa680f4b8dd..41b648a67fec 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1897,6 +1897,9 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
1897 1897
1898 if (ioread8(&nic->csr->scb.status) & rus_no_res) 1898 if (ioread8(&nic->csr->scb.status) & rus_no_res)
1899 nic->ru_running = RU_SUSPENDED; 1899 nic->ru_running = RU_SUSPENDED;
1900 pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr,
1901 sizeof(struct rfd),
1902 PCI_DMA_BIDIRECTIONAL);
1900 return -ENODATA; 1903 return -ENODATA;
1901 } 1904 }
1902 1905
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index cc2ab6412c73..4f7003485348 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -1784,7 +1784,7 @@ int __init init_module(void)
1784 printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); 1784 printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n");
1785 } 1785 }
1786 1786
1787 for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { 1787 for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) {
1788 dev = alloc_etherdev(sizeof(struct eepro_local)); 1788 dev = alloc_etherdev(sizeof(struct eepro_local));
1789 if (!dev) 1789 if (!dev)
1790 break; 1790 break;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 147c4b088fb3..e8d46cc1bec2 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -3080,7 +3080,9 @@ static const struct net_device_ops ehea_netdev_ops = {
3080 .ndo_poll_controller = ehea_netpoll, 3080 .ndo_poll_controller = ehea_netpoll,
3081#endif 3081#endif
3082 .ndo_get_stats = ehea_get_stats, 3082 .ndo_get_stats = ehea_get_stats,
3083 .ndo_change_mtu = eth_change_mtu,
3083 .ndo_set_mac_address = ehea_set_mac_addr, 3084 .ndo_set_mac_address = ehea_set_mac_addr,
3085 .ndo_validate_addr = eth_validate_addr,
3084 .ndo_set_multicast_list = ehea_set_multicast_list, 3086 .ndo_set_multicast_list = ehea_set_multicast_list,
3085 .ndo_change_mtu = ehea_change_mtu, 3087 .ndo_change_mtu = ehea_change_mtu,
3086 .ndo_vlan_rx_register = ehea_vlan_rx_register, 3088 .ndo_vlan_rx_register = ehea_vlan_rx_register,
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 48385c42ab57..160655d24581 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -584,7 +584,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
584 if (np->flags == HAS_MII_XCVR) { 584 if (np->flags == HAS_MII_XCVR) {
585 int phy, phy_idx = 0; 585 int phy, phy_idx = 0;
586 586
587 for (phy = 1; phy < 32 && phy_idx < 4; phy++) { 587 for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys);
588 phy++) {
588 int mii_status = mdio_read(dev, phy, 1); 589 int mii_status = mdio_read(dev, phy, 1);
589 590
590 if (mii_status != 0xffff && mii_status != 0x0000) { 591 if (mii_status != 0xffff && mii_status != 0x0000) {
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 0f19b743749b..d4b98074b1b7 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1642,6 +1642,7 @@ static const struct net_device_ops fec_netdev_ops = {
1642 .ndo_stop = fec_enet_close, 1642 .ndo_stop = fec_enet_close,
1643 .ndo_start_xmit = fec_enet_start_xmit, 1643 .ndo_start_xmit = fec_enet_start_xmit,
1644 .ndo_set_multicast_list = set_multicast_list, 1644 .ndo_set_multicast_list = set_multicast_list,
1645 .ndo_change_mtu = eth_change_mtu,
1645 .ndo_validate_addr = eth_validate_addr, 1646 .ndo_validate_addr = eth_validate_addr,
1646 .ndo_tx_timeout = fec_timeout, 1647 .ndo_tx_timeout = fec_timeout,
1647 .ndo_set_mac_address = fec_set_mac_address, 1648 .ndo_set_mac_address = fec_set_mac_address,
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index b892c3ad9a74..2bc2d2b20644 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -754,17 +754,16 @@ static int fs_init_phy(struct net_device *dev)
754 fep->oldlink = 0; 754 fep->oldlink = 0;
755 fep->oldspeed = 0; 755 fep->oldspeed = 0;
756 fep->oldduplex = -1; 756 fep->oldduplex = -1;
757 if(fep->fpi->phy_node) 757
758 phydev = of_phy_connect(dev, fep->fpi->phy_node, 758 phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0,
759 &fs_adjust_link, 0, 759 PHY_INTERFACE_MODE_MII);
760 PHY_INTERFACE_MODE_MII); 760 if (!phydev) {
761 else { 761 phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link,
762 printk("No phy bus ID specified in BSP code\n"); 762 PHY_INTERFACE_MODE_MII);
763 return -EINVAL;
764 } 763 }
765 if (IS_ERR(phydev)) { 764 if (!phydev) {
766 printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); 765 dev_err(&dev->dev, "Could not attach to PHY\n");
767 return PTR_ERR(phydev); 766 return -ENODEV;
768 } 767 }
769 768
770 fep->phydev = phydev; 769 fep->phydev = phydev;
@@ -1005,6 +1004,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
1005 goto out_free_fpi; 1004 goto out_free_fpi;
1006 } 1005 }
1007 1006
1007 SET_NETDEV_DEV(ndev, &ofdev->dev);
1008 dev_set_drvdata(&ofdev->dev, ndev); 1008 dev_set_drvdata(&ofdev->dev, ndev);
1009 1009
1010 fep = netdev_priv(ndev); 1010 fep = netdev_priv(ndev);
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 4ae1d259fced..f8ffcbf0bc39 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -156,6 +156,8 @@ static const struct net_device_ops gfar_netdev_ops = {
156 .ndo_tx_timeout = gfar_timeout, 156 .ndo_tx_timeout = gfar_timeout,
157 .ndo_do_ioctl = gfar_ioctl, 157 .ndo_do_ioctl = gfar_ioctl,
158 .ndo_vlan_rx_register = gfar_vlan_rx_register, 158 .ndo_vlan_rx_register = gfar_vlan_rx_register,
159 .ndo_set_mac_address = eth_mac_addr,
160 .ndo_validate_addr = eth_validate_addr,
159#ifdef CONFIG_NET_POLL_CONTROLLER 161#ifdef CONFIG_NET_POLL_CONTROLLER
160 .ndo_poll_controller = gfar_netpoll, 162 .ndo_poll_controller = gfar_netpoll,
161#endif 163#endif
@@ -262,15 +264,6 @@ static int gfar_of_init(struct net_device *dev)
262 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET; 264 priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
263 265
264 priv->phy_node = of_parse_phandle(np, "phy-handle", 0); 266 priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
265 if (!priv->phy_node) {
266 u32 *fixed_link;
267
268 fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
269 if (!fixed_link) {
270 err = -ENODEV;
271 goto err_out;
272 }
273 }
274 267
275 /* Find the TBI PHY. If it's not there, we don't support SGMII */ 268 /* Find the TBI PHY. If it's not there, we don't support SGMII */
276 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 269 priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -657,13 +650,14 @@ static int init_phy(struct net_device *dev)
657 650
658 interface = gfar_get_interface(dev); 651 interface = gfar_get_interface(dev);
659 652
660 if (priv->phy_node) { 653 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
661 priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 654 interface);
662 0, interface); 655 if (!priv->phydev)
663 if (!priv->phydev) { 656 priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
664 dev_err(&dev->dev, "error: Could not attach to PHY\n"); 657 interface);
665 return -ENODEV; 658 if (!priv->phydev) {
666 } 659 dev_err(&dev->dev, "could not attach to PHY\n");
660 return -ENODEV;
667 } 661 }
668 662
669 if (interface == PHY_INTERFACE_MODE_SGMII) 663 if (interface == PHY_INTERFACE_MODE_SGMII)
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 155160052c8b..981ab530e9ac 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -3,7 +3,7 @@
3 * devices like TTY. It interfaces between a raw TTY and the 3 * devices like TTY. It interfaces between a raw TTY and the
4 * kernel's AX.25 protocol layers. 4 * kernel's AX.25 protocol layers.
5 * 5 *
6 * Authors: Andreas Könsgen <ajk@iehk.rwth-aachen.de> 6 * Authors: Andreas Könsgen <ajk@comnets.uni-bremen.de>
7 * Ralf Baechle DL5RB <ralf@linux-mips.org> 7 * Ralf Baechle DL5RB <ralf@linux-mips.org>
8 * 8 *
9 * Quite a lot of stuff "stolen" by Joerg Reuter from slip.c, written by 9 * Quite a lot of stuff "stolen" by Joerg Reuter from slip.c, written by
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c
index 1d5379de6900..8d76cb89dbd6 100644
--- a/drivers/net/ibm_newemac/rgmii.c
+++ b/drivers/net/ibm_newemac/rgmii.c
@@ -188,11 +188,12 @@ void rgmii_put_mdio(struct of_device *ofdev, int input)
188void rgmii_detach(struct of_device *ofdev, int input) 188void rgmii_detach(struct of_device *ofdev, int input)
189{ 189{
190 struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev); 190 struct rgmii_instance *dev = dev_get_drvdata(&ofdev->dev);
191 struct rgmii_regs __iomem *p = dev->base; 191 struct rgmii_regs __iomem *p;
192
193 mutex_lock(&dev->lock);
194 192
195 BUG_ON(!dev || dev->users == 0); 193 BUG_ON(!dev || dev->users == 0);
194 p = dev->base;
195
196 mutex_lock(&dev->lock);
196 197
197 RGMII_DBG(dev, "detach(%d)" NL, input); 198 RGMII_DBG(dev, "detach(%d)" NL, input);
198 199
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index be480292aba1..adb09d32625d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -127,14 +127,48 @@ static void igb_restore_vlan(struct igb_adapter *);
127static void igb_ping_all_vfs(struct igb_adapter *); 127static void igb_ping_all_vfs(struct igb_adapter *);
128static void igb_msg_task(struct igb_adapter *); 128static void igb_msg_task(struct igb_adapter *);
129static int igb_rcv_msg_from_vf(struct igb_adapter *, u32); 129static int igb_rcv_msg_from_vf(struct igb_adapter *, u32);
130static inline void igb_set_rah_pool(struct e1000_hw *, int , int);
131static void igb_set_mc_list_pools(struct igb_adapter *, int, u16); 130static void igb_set_mc_list_pools(struct igb_adapter *, int, u16);
132static void igb_vmm_control(struct igb_adapter *); 131static void igb_vmm_control(struct igb_adapter *);
133static inline void igb_set_vmolr(struct e1000_hw *, int);
134static inline int igb_set_vf_rlpml(struct igb_adapter *, int, int);
135static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *); 132static int igb_set_vf_mac(struct igb_adapter *adapter, int, unsigned char *);
136static void igb_restore_vf_multicasts(struct igb_adapter *adapter); 133static void igb_restore_vf_multicasts(struct igb_adapter *adapter);
137 134
135static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
136{
137 u32 reg_data;
138
139 reg_data = rd32(E1000_VMOLR(vfn));
140 reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
141 E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
142 E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
143 E1000_VMOLR_AUPE | /* Accept untagged packets */
144 E1000_VMOLR_STRVLAN; /* Strip vlan tags */
145 wr32(E1000_VMOLR(vfn), reg_data);
146}
147
148static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
149 int vfn)
150{
151 struct e1000_hw *hw = &adapter->hw;
152 u32 vmolr;
153
154 vmolr = rd32(E1000_VMOLR(vfn));
155 vmolr &= ~E1000_VMOLR_RLPML_MASK;
156 vmolr |= size | E1000_VMOLR_LPE;
157 wr32(E1000_VMOLR(vfn), vmolr);
158
159 return 0;
160}
161
162static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
163{
164 u32 reg_data;
165
166 reg_data = rd32(E1000_RAH(entry));
167 reg_data &= ~E1000_RAH_POOL_MASK;
168 reg_data |= E1000_RAH_POOL_1 << pool;;
169 wr32(E1000_RAH(entry), reg_data);
170}
171
138#ifdef CONFIG_PM 172#ifdef CONFIG_PM
139static int igb_suspend(struct pci_dev *, pm_message_t); 173static int igb_suspend(struct pci_dev *, pm_message_t);
140static int igb_resume(struct pci_dev *); 174static int igb_resume(struct pci_dev *);
@@ -5418,43 +5452,6 @@ static void igb_io_resume(struct pci_dev *pdev)
5418 igb_get_hw_control(adapter); 5452 igb_get_hw_control(adapter);
5419} 5453}
5420 5454
5421static inline void igb_set_vmolr(struct e1000_hw *hw, int vfn)
5422{
5423 u32 reg_data;
5424
5425 reg_data = rd32(E1000_VMOLR(vfn));
5426 reg_data |= E1000_VMOLR_BAM | /* Accept broadcast */
5427 E1000_VMOLR_ROPE | /* Accept packets matched in UTA */
5428 E1000_VMOLR_ROMPE | /* Accept packets matched in MTA */
5429 E1000_VMOLR_AUPE | /* Accept untagged packets */
5430 E1000_VMOLR_STRVLAN; /* Strip vlan tags */
5431 wr32(E1000_VMOLR(vfn), reg_data);
5432}
5433
5434static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
5435 int vfn)
5436{
5437 struct e1000_hw *hw = &adapter->hw;
5438 u32 vmolr;
5439
5440 vmolr = rd32(E1000_VMOLR(vfn));
5441 vmolr &= ~E1000_VMOLR_RLPML_MASK;
5442 vmolr |= size | E1000_VMOLR_LPE;
5443 wr32(E1000_VMOLR(vfn), vmolr);
5444
5445 return 0;
5446}
5447
5448static inline void igb_set_rah_pool(struct e1000_hw *hw, int pool, int entry)
5449{
5450 u32 reg_data;
5451
5452 reg_data = rd32(E1000_RAH(entry));
5453 reg_data &= ~E1000_RAH_POOL_MASK;
5454 reg_data |= E1000_RAH_POOL_1 << pool;;
5455 wr32(E1000_RAH(entry), reg_data);
5456}
5457
5458static void igb_set_mc_list_pools(struct igb_adapter *adapter, 5455static void igb_set_mc_list_pools(struct igb_adapter *adapter,
5459 int entry_count, u16 total_rar_filters) 5456 int entry_count, u16 total_rar_filters)
5460{ 5457{
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index d53aa9582137..20f9bc626688 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -31,7 +31,6 @@
31#include <linux/tty.h> 31#include <linux/tty.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <linux/smp_lock.h>
35#include <linux/delay.h> 34#include <linux/delay.h>
36#include <linux/mutex.h> 35#include <linux/mutex.h>
37 36
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c
index 73585fd8f29f..d12377b84358 100644
--- a/drivers/net/isa-skeleton.c
+++ b/drivers/net/isa-skeleton.c
@@ -430,7 +430,8 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
430 * hardware interrupt handler. Queue flow control is 430 * hardware interrupt handler. Queue flow control is
431 * thus managed under this lock as well. 431 * thus managed under this lock as well.
432 */ 432 */
433 spin_lock_irq(&np->lock); 433 unsigned long flags;
434 spin_lock_irqsave(&np->lock, flags);
434 435
435 add_to_tx_ring(np, skb, length); 436 add_to_tx_ring(np, skb, length);
436 dev->trans_start = jiffies; 437 dev->trans_start = jiffies;
@@ -446,7 +447,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
446 * is when the transmit statistics are updated. 447 * is when the transmit statistics are updated.
447 */ 448 */
448 449
449 spin_unlock_irq(&np->lock); 450 spin_unlock_irqrestore(&np->lock, flags);
450#else 451#else
451 /* This is the case for older hardware which takes 452 /* This is the case for older hardware which takes
452 * a single transmit buffer at a time, and it is 453 * a single transmit buffer at a time, and it is
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index cd22323cfd22..1b12c7ba275f 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -327,6 +327,7 @@ struct ixgbe_adapter {
327#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) 327#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25)
328#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) 328#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26)
329#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) 329#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27)
330#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28)
330#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) 331#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29)
331 332
332 u32 flags2; 333 u32 flags2;
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 7c5978ad929a..1c7265732900 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -106,8 +106,6 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev)
106{ 106{
107 struct ixgbe_adapter *adapter = netdev_priv(netdev); 107 struct ixgbe_adapter *adapter = netdev_priv(netdev);
108 108
109 DPRINTK(DRV, INFO, "Get DCB Admin Mode.\n");
110
111 return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED); 109 return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED);
112} 110}
113 111
@@ -116,8 +114,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
116 u8 err = 0; 114 u8 err = 0;
117 struct ixgbe_adapter *adapter = netdev_priv(netdev); 115 struct ixgbe_adapter *adapter = netdev_priv(netdev);
118 116
119 DPRINTK(DRV, INFO, "Set DCB Admin Mode.\n");
120
121 if (state > 0) { 117 if (state > 0) {
122 /* Turn on DCB */ 118 /* Turn on DCB */
123 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) 119 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)
@@ -143,6 +139,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
143 adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; 139 adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
144 } 140 }
145 adapter->flags |= IXGBE_FLAG_DCB_ENABLED; 141 adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
142#ifdef IXGBE_FCOE
143 /* Turn on FCoE offload */
144 if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) &&
145 (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) {
146 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
147 adapter->ring_feature[RING_F_FCOE].indices =
148 IXGBE_FCRETA_SIZE;
149 netdev->features |= NETIF_F_FCOE_CRC;
150 netdev->features |= NETIF_F_FSO;
151 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
152 }
153#endif /* IXGBE_FCOE */
146 ixgbe_init_interrupt_scheme(adapter); 154 ixgbe_init_interrupt_scheme(adapter);
147 if (netif_running(netdev)) 155 if (netif_running(netdev))
148 netdev->netdev_ops->ndo_open(netdev); 156 netdev->netdev_ops->ndo_open(netdev);
@@ -160,6 +168,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
160 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 168 adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
161 if (adapter->hw.mac.type == ixgbe_mac_82599EB) 169 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
162 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 170 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
171
172#ifdef IXGBE_FCOE
173 /* Turn off FCoE offload */
174 if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE |
175 IXGBE_FLAG_FCOE_ENABLED)) {
176 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
177 adapter->ring_feature[RING_F_FCOE].indices = 0;
178 netdev->features &= ~NETIF_F_FCOE_CRC;
179 netdev->features &= ~NETIF_F_FSO;
180 netdev->fcoe_ddp_xid = 0;
181 }
182#endif /* IXGBE_FCOE */
163 ixgbe_init_interrupt_scheme(adapter); 183 ixgbe_init_interrupt_scheme(adapter);
164 if (netif_running(netdev)) 184 if (netif_running(netdev))
165 netdev->netdev_ops->ndo_open(netdev); 185 netdev->netdev_ops->ndo_open(netdev);
@@ -175,6 +195,8 @@ static void ixgbe_dcbnl_get_perm_hw_addr(struct net_device *netdev,
175 struct ixgbe_adapter *adapter = netdev_priv(netdev); 195 struct ixgbe_adapter *adapter = netdev_priv(netdev);
176 int i, j; 196 int i, j;
177 197
198 memset(perm_addr, 0xff, MAX_ADDR_LEN);
199
178 for (i = 0; i < netdev->addr_len; i++) 200 for (i = 0; i < netdev->addr_len; i++)
179 perm_addr[i] = adapter->hw.mac.perm_addr[i]; 201 perm_addr[i] = adapter->hw.mac.perm_addr[i];
180 202
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index e3442f47f932..200454f30f6a 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -34,6 +34,7 @@
34#include <linux/in.h> 34#include <linux/in.h>
35#include <linux/ip.h> 35#include <linux/ip.h>
36#include <linux/tcp.h> 36#include <linux/tcp.h>
37#include <linux/pkt_sched.h>
37#include <linux/ipv6.h> 38#include <linux/ipv6.h>
38#include <net/checksum.h> 39#include <net/checksum.h>
39#include <net/ip6_checksum.h> 40#include <net/ip6_checksum.h>
@@ -510,8 +511,11 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector,
510 * @skb: skb currently being received and modified 511 * @skb: skb currently being received and modified
511 **/ 512 **/
512static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, 513static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
513 u32 status_err, struct sk_buff *skb) 514 union ixgbe_adv_rx_desc *rx_desc,
515 struct sk_buff *skb)
514{ 516{
517 u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error);
518
515 skb->ip_summed = CHECKSUM_NONE; 519 skb->ip_summed = CHECKSUM_NONE;
516 520
517 /* Rx csum disabled */ 521 /* Rx csum disabled */
@@ -529,6 +533,16 @@ static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
529 return; 533 return;
530 534
531 if (status_err & IXGBE_RXDADV_ERR_TCPE) { 535 if (status_err & IXGBE_RXDADV_ERR_TCPE) {
536 u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
537
538 /*
539 * 82599 errata, UDP frames with a 0 checksum can be marked as
540 * checksum errors.
541 */
542 if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) &&
543 (adapter->hw.mac.type == ixgbe_mac_82599EB))
544 return;
545
532 adapter->hw_csum_rx_error++; 546 adapter->hw_csum_rx_error++;
533 return; 547 return;
534 } 548 }
@@ -802,7 +816,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
802 goto next_desc; 816 goto next_desc;
803 } 817 }
804 818
805 ixgbe_rx_checksum(adapter, staterr, skb); 819 ixgbe_rx_checksum(adapter, rx_desc, skb);
806 820
807 /* probably a little skewed due to removing CRC */ 821 /* probably a little skewed due to removing CRC */
808 total_rx_bytes += skb->len; 822 total_rx_bytes += skb->len;
@@ -3806,8 +3820,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
3806 adapter->atr_sample_rate = 20; 3820 adapter->atr_sample_rate = 20;
3807 adapter->fdir_pballoc = 0; 3821 adapter->fdir_pballoc = 0;
3808#ifdef IXGBE_FCOE 3822#ifdef IXGBE_FCOE
3809 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 3823 adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE;
3810 adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; 3824 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
3825 adapter->ring_feature[RING_F_FCOE].indices = 0;
3811#endif /* IXGBE_FCOE */ 3826#endif /* IXGBE_FCOE */
3812 } 3827 }
3813 3828
@@ -5125,9 +5140,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5125 int count = 0; 5140 int count = 0;
5126 unsigned int f; 5141 unsigned int f;
5127 5142
5128 r_idx = skb->queue_mapping;
5129 tx_ring = &adapter->tx_ring[r_idx];
5130
5131 if (adapter->vlgrp && vlan_tx_tag_present(skb)) { 5143 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
5132 tx_flags |= vlan_tx_tag_get(skb); 5144 tx_flags |= vlan_tx_tag_get(skb);
5133 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5145 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
@@ -5137,11 +5149,19 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5137 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5149 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5138 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5150 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5139 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5151 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
5140 tx_flags |= (skb->queue_mapping << 13); 5152 if (skb->priority != TC_PRIO_CONTROL) {
5141 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5153 tx_flags |= (skb->queue_mapping << 13);
5142 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5154 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5155 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5156 } else {
5157 skb->queue_mapping =
5158 adapter->ring_feature[RING_F_DCB].indices-1;
5159 }
5143 } 5160 }
5144 5161
5162 r_idx = skb->queue_mapping;
5163 tx_ring = &adapter->tx_ring[r_idx];
5164
5145 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 5165 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
5146 (skb->protocol == htons(ETH_P_FCOE))) 5166 (skb->protocol == htons(ETH_P_FCOE)))
5147 tx_flags |= IXGBE_TX_FLAGS_FCOE; 5167 tx_flags |= IXGBE_TX_FLAGS_FCOE;
@@ -5580,16 +5600,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5580#endif 5600#endif
5581 5601
5582#ifdef IXGBE_FCOE 5602#ifdef IXGBE_FCOE
5583 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 5603 if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) {
5584 if (hw->mac.ops.get_device_caps) { 5604 if (hw->mac.ops.get_device_caps) {
5585 hw->mac.ops.get_device_caps(hw, &device_caps); 5605 hw->mac.ops.get_device_caps(hw, &device_caps);
5586 if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) { 5606 if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)
5587 netdev->features |= NETIF_F_FCOE_CRC; 5607 adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE;
5588 netdev->features |= NETIF_F_FSO;
5589 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
5590 } else {
5591 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
5592 }
5593 } 5608 }
5594 } 5609 }
5595#endif /* IXGBE_FCOE */ 5610#endif /* IXGBE_FCOE */
@@ -5638,7 +5653,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5638 adapter->wol = 0; 5653 adapter->wol = 0;
5639 break; 5654 break;
5640 } 5655 }
5641 device_init_wakeup(&adapter->pdev->dev, true);
5642 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 5656 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
5643 5657
5644 /* pick up the PCI bus settings for reporting later */ 5658 /* pick up the PCI bus settings for reporting later */
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index d12106b47bf2..2f286091394d 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -229,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
229 lp = netdev_priv(dev); 229 lp = netdev_priv(dev);
230 lp->device = &pdev->dev; 230 lp->device = &pdev->dev;
231 SET_NETDEV_DEV(dev, &pdev->dev); 231 SET_NETDEV_DEV(dev, &pdev->dev);
232 platform_set_drvdata(pdev, dev);
232 233
233 netdev_boot_setup_check(dev); 234 netdev_boot_setup_check(dev);
234 235
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
new file mode 100644
index 000000000000..9a1dea60c1c4
--- /dev/null
+++ b/drivers/net/ks8851.c
@@ -0,0 +1,1322 @@
1/* drivers/net/ks8651.c
2 *
3 * Copyright 2009 Simtec Electronics
4 * http://www.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#define DEBUG
13
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/netdevice.h>
17#include <linux/etherdevice.h>
18#include <linux/ethtool.h>
19#include <linux/cache.h>
20#include <linux/crc32.h>
21#include <linux/mii.h>
22
23#include <linux/spi/spi.h>
24
25#include "ks8851.h"
26
27/**
28 * struct ks8851_rxctrl - KS8851 driver rx control
29 * @mchash: Multicast hash-table data.
30 * @rxcr1: KS_RXCR1 register setting
31 * @rxcr2: KS_RXCR2 register setting
32 *
33 * Representation of the settings needs to control the receive filtering
34 * such as the multicast hash-filter and the receive register settings. This
35 * is used to make the job of working out if the receive settings change and
36 * then issuing the new settings to the worker that will send the necessary
37 * commands.
38 */
39struct ks8851_rxctrl {
40 u16 mchash[4];
41 u16 rxcr1;
42 u16 rxcr2;
43};
44
45/**
46 * union ks8851_tx_hdr - tx header data
47 * @txb: The header as bytes
48 * @txw: The header as 16bit, little-endian words
49 *
50 * A dual representation of the tx header data to allow
51 * access to individual bytes, and to allow 16bit accesses
52 * with 16bit alignment.
53 */
54union ks8851_tx_hdr {
55 u8 txb[6];
56 __le16 txw[3];
57};
58
59/**
60 * struct ks8851_net - KS8851 driver private data
61 * @netdev: The network device we're bound to
62 * @spidev: The spi device we're bound to.
63 * @lock: Lock to ensure that the device is not accessed when busy.
64 * @statelock: Lock on this structure for tx list.
65 * @mii: The MII state information for the mii calls.
66 * @rxctrl: RX settings for @rxctrl_work.
67 * @tx_work: Work queue for tx packets
68 * @irq_work: Work queue for servicing interrupts
69 * @rxctrl_work: Work queue for updating RX mode and multicast lists
70 * @txq: Queue of packets for transmission.
71 * @spi_msg1: pre-setup SPI transfer with one message, @spi_xfer1.
72 * @spi_msg2: pre-setup SPI transfer with two messages, @spi_xfer2.
73 * @txh: Space for generating packet TX header in DMA-able data
74 * @rxd: Space for receiving SPI data, in DMA-able space.
75 * @txd: Space for transmitting SPI data, in DMA-able space.
76 * @msg_enable: The message flags controlling driver output (see ethtool).
77 * @fid: Incrementing frame id tag.
78 * @rc_ier: Cached copy of KS_IER.
79 * @rc_rxqcr: Cached copy of KS_RXQCR.
80 *
81 * The @lock ensures that the chip is protected when certain operations are
82 * in progress. When the read or write packet transfer is in progress, most
83 * of the chip registers are not ccessible until the transfer is finished and
84 * the DMA has been de-asserted.
85 *
86 * The @statelock is used to protect information in the structure which may
87 * need to be accessed via several sources, such as the network driver layer
88 * or one of the work queues.
89 *
90 * We align the buffers we may use for rx/tx to ensure that if the SPI driver
91 * wants to DMA map them, it will not have any problems with data the driver
92 * modifies.
93 */
94struct ks8851_net {
95 struct net_device *netdev;
96 struct spi_device *spidev;
97 struct mutex lock;
98 spinlock_t statelock;
99
100 union ks8851_tx_hdr txh ____cacheline_aligned;
101 u8 rxd[8];
102 u8 txd[8];
103
104 u32 msg_enable ____cacheline_aligned;
105 u16 tx_space;
106 u8 fid;
107
108 u16 rc_ier;
109 u16 rc_rxqcr;
110
111 struct mii_if_info mii;
112 struct ks8851_rxctrl rxctrl;
113
114 struct work_struct tx_work;
115 struct work_struct irq_work;
116 struct work_struct rxctrl_work;
117
118 struct sk_buff_head txq;
119
120 struct spi_message spi_msg1;
121 struct spi_message spi_msg2;
122 struct spi_transfer spi_xfer1;
123 struct spi_transfer spi_xfer2[2];
124};
125
126static int msg_enable;
127
128#define ks_info(_ks, _msg...) dev_info(&(_ks)->spidev->dev, _msg)
129#define ks_warn(_ks, _msg...) dev_warn(&(_ks)->spidev->dev, _msg)
130#define ks_dbg(_ks, _msg...) dev_dbg(&(_ks)->spidev->dev, _msg)
131#define ks_err(_ks, _msg...) dev_err(&(_ks)->spidev->dev, _msg)
132
133/* shift for byte-enable data */
134#define BYTE_EN(_x) ((_x) << 2)
135
136/* turn register number and byte-enable mask into data for start of packet */
137#define MK_OP(_byteen, _reg) (BYTE_EN(_byteen) | (_reg) << (8+2) | (_reg) >> 6)
138
139/* SPI register read/write calls.
140 *
141 * All these calls issue SPI transactions to access the chip's registers. They
142 * all require that the necessary lock is held to prevent accesses when the
143 * chip is busy transfering packet data (RX/TX FIFO accesses).
144 */
145
146/**
147 * ks8851_wrreg16 - write 16bit register value to chip
148 * @ks: The chip state
149 * @reg: The register address
150 * @val: The value to write
151 *
152 * Issue a write to put the value @val into the register specified in @reg.
153 */
154static void ks8851_wrreg16(struct ks8851_net *ks, unsigned reg, unsigned val)
155{
156 struct spi_transfer *xfer = &ks->spi_xfer1;
157 struct spi_message *msg = &ks->spi_msg1;
158 __le16 txb[2];
159 int ret;
160
161 txb[0] = cpu_to_le16(MK_OP(reg & 2 ? 0xC : 0x03, reg) | KS_SPIOP_WR);
162 txb[1] = cpu_to_le16(val);
163
164 xfer->tx_buf = txb;
165 xfer->rx_buf = NULL;
166 xfer->len = 4;
167
168 ret = spi_sync(ks->spidev, msg);
169 if (ret < 0)
170 ks_err(ks, "spi_sync() failed\n");
171}
172
173/**
174 * ks8851_rx_1msg - select whether to use one or two messages for spi read
175 * @ks: The device structure
176 *
177 * Return whether to generate a single message with a tx and rx buffer
178 * supplied to spi_sync(), or alternatively send the tx and rx buffers
179 * as separate messages.
180 *
181 * Depending on the hardware in use, a single message may be more efficient
182 * on interrupts or work done by the driver.
183 *
184 * This currently always returns true until we add some per-device data passed
185 * from the platform code to specify which mode is better.
186 */
187static inline bool ks8851_rx_1msg(struct ks8851_net *ks)
188{
189 return true;
190}
191
192/**
193 * ks8851_rdreg - issue read register command and return the data
194 * @ks: The device state
195 * @op: The register address and byte enables in message format.
196 * @rxb: The RX buffer to return the result into
197 * @rxl: The length of data expected.
198 *
199 * This is the low level read call that issues the necessary spi message(s)
200 * to read data from the register specified in @op.
201 */
202static void ks8851_rdreg(struct ks8851_net *ks, unsigned op,
203 u8 *rxb, unsigned rxl)
204{
205 struct spi_transfer *xfer;
206 struct spi_message *msg;
207 __le16 *txb = (__le16 *)ks->txd;
208 u8 *trx = ks->rxd;
209 int ret;
210
211 txb[0] = cpu_to_le16(op | KS_SPIOP_RD);
212
213 if (ks8851_rx_1msg(ks)) {
214 msg = &ks->spi_msg1;
215 xfer = &ks->spi_xfer1;
216
217 xfer->tx_buf = txb;
218 xfer->rx_buf = trx;
219 xfer->len = rxl + 2;
220 } else {
221 msg = &ks->spi_msg2;
222 xfer = ks->spi_xfer2;
223
224 xfer->tx_buf = txb;
225 xfer->rx_buf = NULL;
226 xfer->len = 2;
227
228 xfer++;
229 xfer->tx_buf = NULL;
230 xfer->rx_buf = trx;
231 xfer->len = rxl;
232 }
233
234 ret = spi_sync(ks->spidev, msg);
235 if (ret < 0)
236 ks_err(ks, "read: spi_sync() failed\n");
237 else if (ks8851_rx_1msg(ks))
238 memcpy(rxb, trx + 2, rxl);
239 else
240 memcpy(rxb, trx, rxl);
241}
242
243/**
244 * ks8851_rdreg8 - read 8 bit register from device
245 * @ks: The chip information
246 * @reg: The register address
247 *
248 * Read a 8bit register from the chip, returning the result
249*/
250static unsigned ks8851_rdreg8(struct ks8851_net *ks, unsigned reg)
251{
252 u8 rxb[1];
253
254 ks8851_rdreg(ks, MK_OP(1 << (reg & 3), reg), rxb, 1);
255 return rxb[0];
256}
257
258/**
259 * ks8851_rdreg16 - read 16 bit register from device
260 * @ks: The chip information
261 * @reg: The register address
262 *
263 * Read a 16bit register from the chip, returning the result
264*/
265static unsigned ks8851_rdreg16(struct ks8851_net *ks, unsigned reg)
266{
267 __le16 rx = 0;
268
269 ks8851_rdreg(ks, MK_OP(reg & 2 ? 0xC : 0x3, reg), (u8 *)&rx, 2);
270 return le16_to_cpu(rx);
271}
272
273/**
274 * ks8851_rdreg32 - read 32 bit register from device
275 * @ks: The chip information
276 * @reg: The register address
277 *
278 * Read a 32bit register from the chip.
279 *
280 * Note, this read requires the address be aligned to 4 bytes.
281*/
282static unsigned ks8851_rdreg32(struct ks8851_net *ks, unsigned reg)
283{
284 __le32 rx = 0;
285
286 WARN_ON(reg & 3);
287
288 ks8851_rdreg(ks, MK_OP(0xf, reg), (u8 *)&rx, 4);
289 return le32_to_cpu(rx);
290}
291
292/**
293 * ks8851_soft_reset - issue one of the soft reset to the device
294 * @ks: The device state.
295 * @op: The bit(s) to set in the GRR
296 *
297 * Issue the relevant soft-reset command to the device's GRR register
298 * specified by @op.
299 *
300 * Note, the delays are in there as a caution to ensure that the reset
301 * has time to take effect and then complete. Since the datasheet does
302 * not currently specify the exact sequence, we have chosen something
303 * that seems to work with our device.
304 */
305static void ks8851_soft_reset(struct ks8851_net *ks, unsigned op)
306{
307 ks8851_wrreg16(ks, KS_GRR, op);
308 mdelay(1); /* wait a short time to effect reset */
309 ks8851_wrreg16(ks, KS_GRR, 0);
310 mdelay(1); /* wait for condition to clear */
311}
312
313/**
314 * ks8851_write_mac_addr - write mac address to device registers
315 * @dev: The network device
316 *
317 * Update the KS8851 MAC address registers from the address in @dev.
318 *
319 * This call assumes that the chip is not running, so there is no need to
320 * shutdown the RXQ process whilst setting this.
321*/
322static int ks8851_write_mac_addr(struct net_device *dev)
323{
324 struct ks8851_net *ks = netdev_priv(dev);
325 u16 *mcp = (u16 *)dev->dev_addr;
326
327 mutex_lock(&ks->lock);
328
329 ks8851_wrreg16(ks, KS_MARL, mcp[0]);
330 ks8851_wrreg16(ks, KS_MARM, mcp[1]);
331 ks8851_wrreg16(ks, KS_MARH, mcp[2]);
332
333 mutex_unlock(&ks->lock);
334
335 return 0;
336}
337
338/**
339 * ks8851_init_mac - initialise the mac address
340 * @ks: The device structure
341 *
342 * Get or create the initial mac address for the device and then set that
343 * into the station address register. Currently we assume that the device
344 * does not have a valid mac address in it, and so we use random_ether_addr()
345 * to create a new one.
346 *
347 * In future, the driver should check to see if the device has an EEPROM
348 * attached and whether that has a valid ethernet address in it.
349 */
350static void ks8851_init_mac(struct ks8851_net *ks)
351{
352 struct net_device *dev = ks->netdev;
353
354 random_ether_addr(dev->dev_addr);
355 ks8851_write_mac_addr(dev);
356}
357
358/**
359 * ks8851_irq - device interrupt handler
360 * @irq: Interrupt number passed from the IRQ hnalder.
361 * @pw: The private word passed to register_irq(), our struct ks8851_net.
362 *
363 * Disable the interrupt from happening again until we've processed the
364 * current status by scheduling ks8851_irq_work().
365 */
366static irqreturn_t ks8851_irq(int irq, void *pw)
367{
368 struct ks8851_net *ks = pw;
369
370 disable_irq_nosync(irq);
371 schedule_work(&ks->irq_work);
372 return IRQ_HANDLED;
373}
374
375/**
376 * ks8851_rdfifo - read data from the receive fifo
377 * @ks: The device state.
378 * @buff: The buffer address
379 * @len: The length of the data to read
380 *
381 * Issue an RXQ FIFO read command and read the @len ammount of data from
382 * the FIFO into the buffer specified by @buff.
383 */
384static void ks8851_rdfifo(struct ks8851_net *ks, u8 *buff, unsigned len)
385{
386 struct spi_transfer *xfer = ks->spi_xfer2;
387 struct spi_message *msg = &ks->spi_msg2;
388 u8 txb[1];
389 int ret;
390
391 if (netif_msg_rx_status(ks))
392 ks_dbg(ks, "%s: %d@%p\n", __func__, len, buff);
393
394 /* set the operation we're issuing */
395 txb[0] = KS_SPIOP_RXFIFO;
396
397 xfer->tx_buf = txb;
398 xfer->rx_buf = NULL;
399 xfer->len = 1;
400
401 xfer++;
402 xfer->rx_buf = buff;
403 xfer->tx_buf = NULL;
404 xfer->len = len;
405
406 ret = spi_sync(ks->spidev, msg);
407 if (ret < 0)
408 ks_err(ks, "%s: spi_sync() failed\n", __func__);
409}
410
411/**
412 * ks8851_dbg_dumpkkt - dump initial packet contents to debug
413 * @ks: The device state
414 * @rxpkt: The data for the received packet
415 *
416 * Dump the initial data from the packet to dev_dbg().
417*/
418static void ks8851_dbg_dumpkkt(struct ks8851_net *ks, u8 *rxpkt)
419{
420 ks_dbg(ks, "pkt %02x%02x%02x%02x %02x%02x%02x%02x %02x%02x%02x%02x\n",
421 rxpkt[4], rxpkt[5], rxpkt[6], rxpkt[7],
422 rxpkt[8], rxpkt[9], rxpkt[10], rxpkt[11],
423 rxpkt[12], rxpkt[13], rxpkt[14], rxpkt[15]);
424}
425
426/**
427 * ks8851_rx_pkts - receive packets from the host
428 * @ks: The device information.
429 *
430 * This is called from the IRQ work queue when the system detects that there
431 * are packets in the receive queue. Find out how many packets there are and
432 * read them from the FIFO.
433 */
434static void ks8851_rx_pkts(struct ks8851_net *ks)
435{
436 struct sk_buff *skb;
437 unsigned rxfc;
438 unsigned rxlen;
439 unsigned rxstat;
440 u32 rxh;
441 u8 *rxpkt;
442
443 rxfc = ks8851_rdreg8(ks, KS_RXFC);
444
445 if (netif_msg_rx_status(ks))
446 ks_dbg(ks, "%s: %d packets\n", __func__, rxfc);
447
448 /* Currently we're issuing a read per packet, but we could possibly
449 * improve the code by issuing a single read, getting the receive
450 * header, allocating the packet and then reading the packet data
451 * out in one go.
452 *
453 * This form of operation would require us to hold the SPI bus'
454 * chipselect low during the entie transaction to avoid any
455 * reset to the data stream comming from the chip.
456 */
457
458 for (; rxfc != 0; rxfc--) {
459 rxh = ks8851_rdreg32(ks, KS_RXFHSR);
460 rxstat = rxh & 0xffff;
461 rxlen = rxh >> 16;
462
463 if (netif_msg_rx_status(ks))
464 ks_dbg(ks, "rx: stat 0x%04x, len 0x%04x\n",
465 rxstat, rxlen);
466
467 /* the length of the packet includes the 32bit CRC */
468
469 /* set dma read address */
470 ks8851_wrreg16(ks, KS_RXFDPR, RXFDPR_RXFPAI | 0x00);
471
472 /* start the packet dma process, and set auto-dequeue rx */
473 ks8851_wrreg16(ks, KS_RXQCR,
474 ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE);
475
476 if (rxlen > 0) {
477 skb = netdev_alloc_skb(ks->netdev, rxlen + 2 + 8);
478 if (!skb) {
479 /* todo - dump frame and move on */
480 }
481
482 /* two bytes to ensure ip is aligned, and four bytes
483 * for the status header and 4 bytes of garbage */
484 skb_reserve(skb, 2 + 4 + 4);
485
486 rxpkt = skb_put(skb, rxlen - 4) - 8;
487
488 /* align the packet length to 4 bytes, and add 4 bytes
489 * as we're getting the rx status header as well */
490 ks8851_rdfifo(ks, rxpkt, ALIGN(rxlen, 4) + 8);
491
492 if (netif_msg_pktdata(ks))
493 ks8851_dbg_dumpkkt(ks, rxpkt);
494
495 skb->protocol = eth_type_trans(skb, ks->netdev);
496 netif_rx(skb);
497
498 ks->netdev->stats.rx_packets++;
499 ks->netdev->stats.rx_bytes += rxlen - 4;
500 }
501
502 ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
503 }
504}
505
506/**
507 * ks8851_irq_work - work queue handler for dealing with interrupt requests
508 * @work: The work structure that was scheduled by schedule_work()
509 *
510 * This is the handler invoked when the ks8851_irq() is called to find out
511 * what happened, as we cannot allow ourselves to sleep whilst waiting for
512 * anything other process has the chip's lock.
513 *
514 * Read the interrupt status, work out what needs to be done and then clear
515 * any of the interrupts that are not needed.
516 */
517static void ks8851_irq_work(struct work_struct *work)
518{
519 struct ks8851_net *ks = container_of(work, struct ks8851_net, irq_work);
520 unsigned status;
521 unsigned handled = 0;
522
523 mutex_lock(&ks->lock);
524
525 status = ks8851_rdreg16(ks, KS_ISR);
526
527 if (netif_msg_intr(ks))
528 dev_dbg(&ks->spidev->dev, "%s: status 0x%04x\n",
529 __func__, status);
530
531 if (status & IRQ_LCI) {
532 /* should do something about checking link status */
533 handled |= IRQ_LCI;
534 }
535
536 if (status & IRQ_LDI) {
537 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR);
538 pmecr &= ~PMECR_WKEVT_MASK;
539 ks8851_wrreg16(ks, KS_PMECR, pmecr | PMECR_WKEVT_LINK);
540
541 handled |= IRQ_LDI;
542 }
543
544 if (status & IRQ_RXPSI)
545 handled |= IRQ_RXPSI;
546
547 if (status & IRQ_TXI) {
548 handled |= IRQ_TXI;
549
550 /* no lock here, tx queue should have been stopped */
551
552 /* update our idea of how much tx space is available to the
553 * system */
554 ks->tx_space = ks8851_rdreg16(ks, KS_TXMIR);
555
556 if (netif_msg_intr(ks))
557 ks_dbg(ks, "%s: txspace %d\n", __func__, ks->tx_space);
558 }
559
560 if (status & IRQ_RXI)
561 handled |= IRQ_RXI;
562
563 if (status & IRQ_SPIBEI) {
564 dev_err(&ks->spidev->dev, "%s: spi bus error\n", __func__);
565 handled |= IRQ_SPIBEI;
566 }
567
568 ks8851_wrreg16(ks, KS_ISR, handled);
569
570 if (status & IRQ_RXI) {
571 /* the datasheet says to disable the rx interrupt during
572 * packet read-out, however we're masking the interrupt
573 * from the device so do not bother masking just the RX
574 * from the device. */
575
576 ks8851_rx_pkts(ks);
577 }
578
579 /* if something stopped the rx process, probably due to wanting
580 * to change the rx settings, then do something about restarting
581 * it. */
582 if (status & IRQ_RXPSI) {
583 struct ks8851_rxctrl *rxc = &ks->rxctrl;
584
585 /* update the multicast hash table */
586 ks8851_wrreg16(ks, KS_MAHTR0, rxc->mchash[0]);
587 ks8851_wrreg16(ks, KS_MAHTR1, rxc->mchash[1]);
588 ks8851_wrreg16(ks, KS_MAHTR2, rxc->mchash[2]);
589 ks8851_wrreg16(ks, KS_MAHTR3, rxc->mchash[3]);
590
591 ks8851_wrreg16(ks, KS_RXCR2, rxc->rxcr2);
592 ks8851_wrreg16(ks, KS_RXCR1, rxc->rxcr1);
593 }
594
595 mutex_unlock(&ks->lock);
596
597 if (status & IRQ_TXI)
598 netif_wake_queue(ks->netdev);
599
600 enable_irq(ks->netdev->irq);
601}
602
603/**
604 * calc_txlen - calculate size of message to send packet
605 * @len: Lenght of data
606 *
607 * Returns the size of the TXFIFO message needed to send
608 * this packet.
609 */
610static inline unsigned calc_txlen(unsigned len)
611{
612 return ALIGN(len + 4, 4);
613}
614
615/**
616 * ks8851_wrpkt - write packet to TX FIFO
617 * @ks: The device state.
618 * @txp: The sk_buff to transmit.
619 * @irq: IRQ on completion of the packet.
620 *
621 * Send the @txp to the chip. This means creating the relevant packet header
622 * specifying the length of the packet and the other information the chip
623 * needs, such as IRQ on completion. Send the header and the packet data to
624 * the device.
625 */
626static void ks8851_wrpkt(struct ks8851_net *ks, struct sk_buff *txp, bool irq)
627{
628 struct spi_transfer *xfer = ks->spi_xfer2;
629 struct spi_message *msg = &ks->spi_msg2;
630 unsigned fid = 0;
631 int ret;
632
633 if (netif_msg_tx_queued(ks))
634 dev_dbg(&ks->spidev->dev, "%s: skb %p, %d@%p, irq %d\n",
635 __func__, txp, txp->len, txp->data, irq);
636
637 fid = ks->fid++;
638 fid &= TXFR_TXFID_MASK;
639
640 if (irq)
641 fid |= TXFR_TXIC; /* irq on completion */
642
643 /* start header at txb[1] to align txw entries */
644 ks->txh.txb[1] = KS_SPIOP_TXFIFO;
645 ks->txh.txw[1] = cpu_to_le16(fid);
646 ks->txh.txw[2] = cpu_to_le16(txp->len);
647
648 xfer->tx_buf = &ks->txh.txb[1];
649 xfer->rx_buf = NULL;
650 xfer->len = 5;
651
652 xfer++;
653 xfer->tx_buf = txp->data;
654 xfer->rx_buf = NULL;
655 xfer->len = ALIGN(txp->len, 4);
656
657 ret = spi_sync(ks->spidev, msg);
658 if (ret < 0)
659 ks_err(ks, "%s: spi_sync() failed\n", __func__);
660}
661
662/**
663 * ks8851_done_tx - update and then free skbuff after transmitting
664 * @ks: The device state
665 * @txb: The buffer transmitted
666 */
667static void ks8851_done_tx(struct ks8851_net *ks, struct sk_buff *txb)
668{
669 struct net_device *dev = ks->netdev;
670
671 dev->stats.tx_bytes += txb->len;
672 dev->stats.tx_packets++;
673
674 dev_kfree_skb(txb);
675}
676
677/**
678 * ks8851_tx_work - process tx packet(s)
679 * @work: The work strucutre what was scheduled.
680 *
681 * This is called when a number of packets have been scheduled for
682 * transmission and need to be sent to the device.
683 */
684static void ks8851_tx_work(struct work_struct *work)
685{
686 struct ks8851_net *ks = container_of(work, struct ks8851_net, tx_work);
687 struct sk_buff *txb;
688 bool last = false;
689
690 mutex_lock(&ks->lock);
691
692 while (!last) {
693 txb = skb_dequeue(&ks->txq);
694 last = skb_queue_empty(&ks->txq);
695
696 ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA);
697 ks8851_wrpkt(ks, txb, last);
698 ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
699 ks8851_wrreg16(ks, KS_TXQCR, TXQCR_METFE);
700
701 ks8851_done_tx(ks, txb);
702 }
703
704 mutex_unlock(&ks->lock);
705}
706
707/**
708 * ks8851_set_powermode - set power mode of the device
709 * @ks: The device state
710 * @pwrmode: The power mode value to write to KS_PMECR.
711 *
712 * Change the power mode of the chip.
713 */
714static void ks8851_set_powermode(struct ks8851_net *ks, unsigned pwrmode)
715{
716 unsigned pmecr;
717
718 if (netif_msg_hw(ks))
719 ks_dbg(ks, "setting power mode %d\n", pwrmode);
720
721 pmecr = ks8851_rdreg16(ks, KS_PMECR);
722 pmecr &= ~PMECR_PM_MASK;
723 pmecr |= pwrmode;
724
725 ks8851_wrreg16(ks, KS_PMECR, pmecr);
726}
727
728/**
729 * ks8851_net_open - open network device
730 * @dev: The network device being opened.
731 *
732 * Called when the network device is marked active, such as a user executing
733 * 'ifconfig up' on the device.
734 */
735static int ks8851_net_open(struct net_device *dev)
736{
737 struct ks8851_net *ks = netdev_priv(dev);
738
739 /* lock the card, even if we may not actually be doing anything
740 * else at the moment */
741 mutex_lock(&ks->lock);
742
743 if (netif_msg_ifup(ks))
744 ks_dbg(ks, "opening %s\n", dev->name);
745
746 /* bring chip out of any power saving mode it was in */
747 ks8851_set_powermode(ks, PMECR_PM_NORMAL);
748
749 /* issue a soft reset to the RX/TX QMU to put it into a known
750 * state. */
751 ks8851_soft_reset(ks, GRR_QMU);
752
753 /* setup transmission parameters */
754
755 ks8851_wrreg16(ks, KS_TXCR, (TXCR_TXE | /* enable transmit process */
756 TXCR_TXPE | /* pad to min length */
757 TXCR_TXCRC | /* add CRC */
758 TXCR_TXFCE)); /* enable flow control */
759
760 /* auto-increment tx data, reset tx pointer */
761 ks8851_wrreg16(ks, KS_TXFDPR, TXFDPR_TXFPAI);
762
763 /* setup receiver control */
764
765 ks8851_wrreg16(ks, KS_RXCR1, (RXCR1_RXPAFMA | /* from mac filter */
766 RXCR1_RXFCE | /* enable flow control */
767 RXCR1_RXBE | /* broadcast enable */
768 RXCR1_RXUE | /* unicast enable */
769 RXCR1_RXE)); /* enable rx block */
770
771 /* transfer entire frames out in one go */
772 ks8851_wrreg16(ks, KS_RXCR2, RXCR2_SRDBL_FRAME);
773
774 /* set receive counter timeouts */
775 ks8851_wrreg16(ks, KS_RXDTTR, 1000); /* 1ms after first frame to IRQ */
776 ks8851_wrreg16(ks, KS_RXDBCTR, 4096); /* >4Kbytes in buffer to IRQ */
777 ks8851_wrreg16(ks, KS_RXFCTR, 10); /* 10 frames to IRQ */
778
779 ks->rc_rxqcr = (RXQCR_RXFCTE | /* IRQ on frame count exceeded */
780 RXQCR_RXDBCTE | /* IRQ on byte count exceeded */
781 RXQCR_RXDTTE); /* IRQ on time exceeded */
782
783 ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
784
785 /* clear then enable interrupts */
786
787#define STD_IRQ (IRQ_LCI | /* Link Change */ \
788 IRQ_TXI | /* TX done */ \
789 IRQ_RXI | /* RX done */ \
790 IRQ_SPIBEI | /* SPI bus error */ \
791 IRQ_TXPSI | /* TX process stop */ \
792 IRQ_RXPSI) /* RX process stop */
793
794 ks->rc_ier = STD_IRQ;
795 ks8851_wrreg16(ks, KS_ISR, STD_IRQ);
796 ks8851_wrreg16(ks, KS_IER, STD_IRQ);
797
798 netif_start_queue(ks->netdev);
799
800 if (netif_msg_ifup(ks))
801 ks_dbg(ks, "network device %s up\n", dev->name);
802
803 mutex_unlock(&ks->lock);
804 return 0;
805}
806
807/**
808 * ks8851_net_stop - close network device
809 * @dev: The device being closed.
810 *
811 * Called to close down a network device which has been active. Cancell any
812 * work, shutdown the RX and TX process and then place the chip into a low
813 * power state whilst it is not being used.
814 */
815static int ks8851_net_stop(struct net_device *dev)
816{
817 struct ks8851_net *ks = netdev_priv(dev);
818
819 if (netif_msg_ifdown(ks))
820 ks_info(ks, "%s: shutting down\n", dev->name);
821
822 netif_stop_queue(dev);
823
824 mutex_lock(&ks->lock);
825
826 /* stop any outstanding work */
827 flush_work(&ks->irq_work);
828 flush_work(&ks->tx_work);
829 flush_work(&ks->rxctrl_work);
830
831 /* turn off the IRQs and ack any outstanding */
832 ks8851_wrreg16(ks, KS_IER, 0x0000);
833 ks8851_wrreg16(ks, KS_ISR, 0xffff);
834
835 /* shutdown RX process */
836 ks8851_wrreg16(ks, KS_RXCR1, 0x0000);
837
838 /* shutdown TX process */
839 ks8851_wrreg16(ks, KS_TXCR, 0x0000);
840
841 /* set powermode to soft power down to save power */
842 ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN);
843
844 /* ensure any queued tx buffers are dumped */
845 while (!skb_queue_empty(&ks->txq)) {
846 struct sk_buff *txb = skb_dequeue(&ks->txq);
847
848 if (netif_msg_ifdown(ks))
849 ks_dbg(ks, "%s: freeing txb %p\n", __func__, txb);
850
851 dev_kfree_skb(txb);
852 }
853
854 mutex_unlock(&ks->lock);
855 return 0;
856}
857
858/**
859 * ks8851_start_xmit - transmit packet
860 * @skb: The buffer to transmit
861 * @dev: The device used to transmit the packet.
862 *
863 * Called by the network layer to transmit the @skb. Queue the packet for
864 * the device and schedule the necessary work to transmit the packet when
865 * it is free.
866 *
867 * We do this to firstly avoid sleeping with the network device locked,
868 * and secondly so we can round up more than one packet to transmit which
869 * means we can try and avoid generating too many transmit done interrupts.
870 */
871static int ks8851_start_xmit(struct sk_buff *skb, struct net_device *dev)
872{
873 struct ks8851_net *ks = netdev_priv(dev);
874 unsigned needed = calc_txlen(skb->len);
875 int ret = NETDEV_TX_OK;
876
877 if (netif_msg_tx_queued(ks))
878 ks_dbg(ks, "%s: skb %p, %d@%p\n", __func__,
879 skb, skb->len, skb->data);
880
881 spin_lock(&ks->statelock);
882
883 if (needed > ks->tx_space) {
884 netif_stop_queue(dev);
885 ret = NETDEV_TX_BUSY;
886 } else {
887 ks->tx_space -= needed;
888 skb_queue_tail(&ks->txq, skb);
889 }
890
891 spin_unlock(&ks->statelock);
892 schedule_work(&ks->tx_work);
893
894 return ret;
895}
896
897/**
898 * ks8851_rxctrl_work - work handler to change rx mode
899 * @work: The work structure this belongs to.
900 *
901 * Lock the device and issue the necessary changes to the receive mode from
902 * the network device layer. This is done so that we can do this without
903 * having to sleep whilst holding the network device lock.
904 *
905 * Since the recommendation from Micrel is that the RXQ is shutdown whilst the
906 * receive parameters are programmed, we issue a write to disable the RXQ and
907 * then wait for the interrupt handler to be triggered once the RXQ shutdown is
908 * complete. The interrupt handler then writes the new values into the chip.
909 */
910static void ks8851_rxctrl_work(struct work_struct *work)
911{
912 struct ks8851_net *ks = container_of(work, struct ks8851_net, rxctrl_work);
913
914 mutex_lock(&ks->lock);
915
916 /* need to shutdown RXQ before modifying filter parameters */
917 ks8851_wrreg16(ks, KS_RXCR1, 0x00);
918
919 mutex_unlock(&ks->lock);
920}
921
922static void ks8851_set_rx_mode(struct net_device *dev)
923{
924 struct ks8851_net *ks = netdev_priv(dev);
925 struct ks8851_rxctrl rxctrl;
926
927 memset(&rxctrl, 0, sizeof(rxctrl));
928
929 if (dev->flags & IFF_PROMISC) {
930 /* interface to receive everything */
931
932 rxctrl.rxcr1 = RXCR1_RXAE | RXCR1_RXINVF;
933 } else if (dev->flags & IFF_ALLMULTI) {
934 /* accept all multicast packets */
935
936 rxctrl.rxcr1 = (RXCR1_RXME | RXCR1_RXAE |
937 RXCR1_RXPAFMA | RXCR1_RXMAFMA);
938 } else if (dev->flags & IFF_MULTICAST && dev->mc_count > 0) {
939 struct dev_mc_list *mcptr = dev->mc_list;
940 u32 crc;
941 int i;
942
943 /* accept some multicast */
944
945 for (i = dev->mc_count; i > 0; i--) {
946 crc = ether_crc(ETH_ALEN, mcptr->dmi_addr);
947 crc >>= (32 - 6); /* get top six bits */
948
949 rxctrl.mchash[crc >> 4] |= (1 << (crc & 0xf));
950 mcptr = mcptr->next;
951 }
952
953 rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXAE | RXCR1_RXPAFMA;
954 } else {
955 /* just accept broadcast / unicast */
956 rxctrl.rxcr1 = RXCR1_RXPAFMA;
957 }
958
959 rxctrl.rxcr1 |= (RXCR1_RXUE | /* unicast enable */
960 RXCR1_RXBE | /* broadcast enable */
961 RXCR1_RXE | /* RX process enable */
962 RXCR1_RXFCE); /* enable flow control */
963
964 rxctrl.rxcr2 |= RXCR2_SRDBL_FRAME;
965
966 /* schedule work to do the actual set of the data if needed */
967
968 spin_lock(&ks->statelock);
969
970 if (memcmp(&rxctrl, &ks->rxctrl, sizeof(rxctrl)) != 0) {
971 memcpy(&ks->rxctrl, &rxctrl, sizeof(ks->rxctrl));
972 schedule_work(&ks->rxctrl_work);
973 }
974
975 spin_unlock(&ks->statelock);
976}
977
978static int ks8851_set_mac_address(struct net_device *dev, void *addr)
979{
980 struct sockaddr *sa = addr;
981
982 if (netif_running(dev))
983 return -EBUSY;
984
985 if (!is_valid_ether_addr(sa->sa_data))
986 return -EADDRNOTAVAIL;
987
988 memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
989 return ks8851_write_mac_addr(dev);
990}
991
992static int ks8851_net_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
993{
994 struct ks8851_net *ks = netdev_priv(dev);
995
996 if (!netif_running(dev))
997 return -EINVAL;
998
999 return generic_mii_ioctl(&ks->mii, if_mii(req), cmd, NULL);
1000}
1001
1002static const struct net_device_ops ks8851_netdev_ops = {
1003 .ndo_open = ks8851_net_open,
1004 .ndo_stop = ks8851_net_stop,
1005 .ndo_do_ioctl = ks8851_net_ioctl,
1006 .ndo_start_xmit = ks8851_start_xmit,
1007 .ndo_set_mac_address = ks8851_set_mac_address,
1008 .ndo_set_rx_mode = ks8851_set_rx_mode,
1009 .ndo_change_mtu = eth_change_mtu,
1010 .ndo_validate_addr = eth_validate_addr,
1011};
1012
1013/* ethtool support */
1014
1015static void ks8851_get_drvinfo(struct net_device *dev,
1016 struct ethtool_drvinfo *di)
1017{
1018 strlcpy(di->driver, "KS8851", sizeof(di->driver));
1019 strlcpy(di->version, "1.00", sizeof(di->version));
1020 strlcpy(di->bus_info, dev_name(dev->dev.parent), sizeof(di->bus_info));
1021}
1022
1023static u32 ks8851_get_msglevel(struct net_device *dev)
1024{
1025 struct ks8851_net *ks = netdev_priv(dev);
1026 return ks->msg_enable;
1027}
1028
1029static void ks8851_set_msglevel(struct net_device *dev, u32 to)
1030{
1031 struct ks8851_net *ks = netdev_priv(dev);
1032 ks->msg_enable = to;
1033}
1034
1035static int ks8851_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1036{
1037 struct ks8851_net *ks = netdev_priv(dev);
1038 return mii_ethtool_gset(&ks->mii, cmd);
1039}
1040
1041static int ks8851_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1042{
1043 struct ks8851_net *ks = netdev_priv(dev);
1044 return mii_ethtool_sset(&ks->mii, cmd);
1045}
1046
1047static u32 ks8851_get_link(struct net_device *dev)
1048{
1049 struct ks8851_net *ks = netdev_priv(dev);
1050 return mii_link_ok(&ks->mii);
1051}
1052
1053static int ks8851_nway_reset(struct net_device *dev)
1054{
1055 struct ks8851_net *ks = netdev_priv(dev);
1056 return mii_nway_restart(&ks->mii);
1057}
1058
1059static const struct ethtool_ops ks8851_ethtool_ops = {
1060 .get_drvinfo = ks8851_get_drvinfo,
1061 .get_msglevel = ks8851_get_msglevel,
1062 .set_msglevel = ks8851_set_msglevel,
1063 .get_settings = ks8851_get_settings,
1064 .set_settings = ks8851_set_settings,
1065 .get_link = ks8851_get_link,
1066 .nway_reset = ks8851_nway_reset,
1067};
1068
1069/* MII interface controls */
1070
1071/**
1072 * ks8851_phy_reg - convert MII register into a KS8851 register
1073 * @reg: MII register number.
1074 *
1075 * Return the KS8851 register number for the corresponding MII PHY register
1076 * if possible. Return zero if the MII register has no direct mapping to the
1077 * KS8851 register set.
1078 */
1079static int ks8851_phy_reg(int reg)
1080{
1081 switch (reg) {
1082 case MII_BMCR:
1083 return KS_P1MBCR;
1084 case MII_BMSR:
1085 return KS_P1MBSR;
1086 case MII_PHYSID1:
1087 return KS_PHY1ILR;
1088 case MII_PHYSID2:
1089 return KS_PHY1IHR;
1090 case MII_ADVERTISE:
1091 return KS_P1ANAR;
1092 case MII_LPA:
1093 return KS_P1ANLPR;
1094 }
1095
1096 return 0x0;
1097}
1098
1099/**
1100 * ks8851_phy_read - MII interface PHY register read.
1101 * @dev: The network device the PHY is on.
1102 * @phy_addr: Address of PHY (ignored as we only have one)
1103 * @reg: The register to read.
1104 *
1105 * This call reads data from the PHY register specified in @reg. Since the
1106 * device does not support all the MII registers, the non-existant values
1107 * are always returned as zero.
1108 *
1109 * We return zero for unsupported registers as the MII code does not check
1110 * the value returned for any error status, and simply returns it to the
1111 * caller. The mii-tool that the driver was tested with takes any -ve error
1112 * as real PHY capabilities, thus displaying incorrect data to the user.
1113 */
1114static int ks8851_phy_read(struct net_device *dev, int phy_addr, int reg)
1115{
1116 struct ks8851_net *ks = netdev_priv(dev);
1117 int ksreg;
1118 int result;
1119
1120 ksreg = ks8851_phy_reg(reg);
1121 if (!ksreg)
1122 return 0x0; /* no error return allowed, so use zero */
1123
1124 mutex_lock(&ks->lock);
1125 result = ks8851_rdreg16(ks, ksreg);
1126 mutex_unlock(&ks->lock);
1127
1128 return result;
1129}
1130
1131static void ks8851_phy_write(struct net_device *dev,
1132 int phy, int reg, int value)
1133{
1134 struct ks8851_net *ks = netdev_priv(dev);
1135 int ksreg;
1136
1137 ksreg = ks8851_phy_reg(reg);
1138 if (ksreg) {
1139 mutex_lock(&ks->lock);
1140 ks8851_wrreg16(ks, ksreg, value);
1141 mutex_unlock(&ks->lock);
1142 }
1143}
1144
1145/**
1146 * ks8851_read_selftest - read the selftest memory info.
1147 * @ks: The device state
1148 *
1149 * Read and check the TX/RX memory selftest information.
1150 */
1151static int ks8851_read_selftest(struct ks8851_net *ks)
1152{
1153 unsigned both_done = MBIR_TXMBF | MBIR_RXMBF;
1154 int ret = 0;
1155 unsigned rd;
1156
1157 rd = ks8851_rdreg16(ks, KS_MBIR);
1158
1159 if ((rd & both_done) != both_done) {
1160 ks_warn(ks, "Memory selftest not finished\n");
1161 return 0;
1162 }
1163
1164 if (rd & MBIR_TXMBFA) {
1165 ks_err(ks, "TX memory selftest fail\n");
1166 ret |= 1;
1167 }
1168
1169 if (rd & MBIR_RXMBFA) {
1170 ks_err(ks, "RX memory selftest fail\n");
1171 ret |= 2;
1172 }
1173
1174 return 0;
1175}
1176
1177/* driver bus management functions */
1178
1179static int __devinit ks8851_probe(struct spi_device *spi)
1180{
1181 struct net_device *ndev;
1182 struct ks8851_net *ks;
1183 int ret;
1184
1185 ndev = alloc_etherdev(sizeof(struct ks8851_net));
1186 if (!ndev) {
1187 dev_err(&spi->dev, "failed to alloc ethernet device\n");
1188 return -ENOMEM;
1189 }
1190
1191 spi->bits_per_word = 8;
1192
1193 ks = netdev_priv(ndev);
1194
1195 ks->netdev = ndev;
1196 ks->spidev = spi;
1197 ks->tx_space = 6144;
1198
1199 mutex_init(&ks->lock);
1200 spin_lock_init(&ks->statelock);
1201
1202 INIT_WORK(&ks->tx_work, ks8851_tx_work);
1203 INIT_WORK(&ks->irq_work, ks8851_irq_work);
1204 INIT_WORK(&ks->rxctrl_work, ks8851_rxctrl_work);
1205
1206 /* initialise pre-made spi transfer messages */
1207
1208 spi_message_init(&ks->spi_msg1);
1209 spi_message_add_tail(&ks->spi_xfer1, &ks->spi_msg1);
1210
1211 spi_message_init(&ks->spi_msg2);
1212 spi_message_add_tail(&ks->spi_xfer2[0], &ks->spi_msg2);
1213 spi_message_add_tail(&ks->spi_xfer2[1], &ks->spi_msg2);
1214
1215 /* setup mii state */
1216 ks->mii.dev = ndev;
1217 ks->mii.phy_id = 1,
1218 ks->mii.phy_id_mask = 1;
1219 ks->mii.reg_num_mask = 0xf;
1220 ks->mii.mdio_read = ks8851_phy_read;
1221 ks->mii.mdio_write = ks8851_phy_write;
1222
1223 dev_info(&spi->dev, "message enable is %d\n", msg_enable);
1224
1225 /* set the default message enable */
1226 ks->msg_enable = netif_msg_init(msg_enable, (NETIF_MSG_DRV |
1227 NETIF_MSG_PROBE |
1228 NETIF_MSG_LINK));
1229
1230 skb_queue_head_init(&ks->txq);
1231
1232 SET_ETHTOOL_OPS(ndev, &ks8851_ethtool_ops);
1233 SET_NETDEV_DEV(ndev, &spi->dev);
1234
1235 dev_set_drvdata(&spi->dev, ks);
1236
1237 ndev->if_port = IF_PORT_100BASET;
1238 ndev->netdev_ops = &ks8851_netdev_ops;
1239 ndev->irq = spi->irq;
1240
1241 /* simple check for a valid chip being connected to the bus */
1242
1243 if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) {
1244 dev_err(&spi->dev, "failed to read device ID\n");
1245 ret = -ENODEV;
1246 goto err_id;
1247 }
1248
1249 ks8851_read_selftest(ks);
1250 ks8851_init_mac(ks);
1251
1252 ret = request_irq(spi->irq, ks8851_irq, IRQF_TRIGGER_LOW,
1253 ndev->name, ks);
1254 if (ret < 0) {
1255 dev_err(&spi->dev, "failed to get irq\n");
1256 goto err_irq;
1257 }
1258
1259 ret = register_netdev(ndev);
1260 if (ret) {
1261 dev_err(&spi->dev, "failed to register network device\n");
1262 goto err_netdev;
1263 }
1264
1265 dev_info(&spi->dev, "revision %d, MAC %pM, IRQ %d\n",
1266 CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)),
1267 ndev->dev_addr, ndev->irq);
1268
1269 return 0;
1270
1271
1272err_netdev:
1273 free_irq(ndev->irq, ndev);
1274
1275err_id:
1276err_irq:
1277 free_netdev(ndev);
1278 return ret;
1279}
1280
1281static int __devexit ks8851_remove(struct spi_device *spi)
1282{
1283 struct ks8851_net *priv = dev_get_drvdata(&spi->dev);
1284
1285 if (netif_msg_drv(priv))
1286 dev_info(&spi->dev, "remove");
1287
1288 unregister_netdev(priv->netdev);
1289 free_irq(spi->irq, priv);
1290 free_netdev(priv->netdev);
1291
1292 return 0;
1293}
1294
1295static struct spi_driver ks8851_driver = {
1296 .driver = {
1297 .name = "ks8851",
1298 .owner = THIS_MODULE,
1299 },
1300 .probe = ks8851_probe,
1301 .remove = __devexit_p(ks8851_remove),
1302};
1303
1304static int __init ks8851_init(void)
1305{
1306 return spi_register_driver(&ks8851_driver);
1307}
1308
1309static void __exit ks8851_exit(void)
1310{
1311 spi_unregister_driver(&ks8851_driver);
1312}
1313
1314module_init(ks8851_init);
1315module_exit(ks8851_exit);
1316
1317MODULE_DESCRIPTION("KS8851 Network driver");
1318MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
1319MODULE_LICENSE("GPL");
1320
1321module_param_named(message, msg_enable, int, 0);
1322MODULE_PARM_DESC(message, "Message verbosity level (0=none, 31=all)");
diff --git a/drivers/net/ks8851.h b/drivers/net/ks8851.h
new file mode 100644
index 000000000000..85abe147afbf
--- /dev/null
+++ b/drivers/net/ks8851.h
@@ -0,0 +1,296 @@
1/* drivers/net/ks8851.h
2 *
3 * Copyright 2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * KS8851 register definitions
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#define KS_CCR 0x08
14#define CCR_EEPROM (1 << 9)
15#define CCR_SPI (1 << 8)
16#define CCR_32PIN (1 << 0)
17
18/* MAC address registers */
19#define KS_MARL 0x10
20#define KS_MARM 0x12
21#define KS_MARH 0x14
22
23#define KS_OBCR 0x20
24#define OBCR_ODS_16mA (1 << 6)
25
26#define KS_EEPCR 0x22
27#define EEPCR_EESA (1 << 4)
28#define EEPCR_EESB (1 << 3)
29#define EEPCR_EEDO (1 << 2)
30#define EEPCR_EESCK (1 << 1)
31#define EEPCR_EECS (1 << 0)
32
33#define KS_MBIR 0x24
34#define MBIR_TXMBF (1 << 12)
35#define MBIR_TXMBFA (1 << 11)
36#define MBIR_RXMBF (1 << 4)
37#define MBIR_RXMBFA (1 << 3)
38
39#define KS_GRR 0x26
40#define GRR_QMU (1 << 1)
41#define GRR_GSR (1 << 0)
42
43#define KS_WFCR 0x2A
44#define WFCR_MPRXE (1 << 7)
45#define WFCR_WF3E (1 << 3)
46#define WFCR_WF2E (1 << 2)
47#define WFCR_WF1E (1 << 1)
48#define WFCR_WF0E (1 << 0)
49
50#define KS_WF0CRC0 0x30
51#define KS_WF0CRC1 0x32
52#define KS_WF0BM0 0x34
53#define KS_WF0BM1 0x36
54#define KS_WF0BM2 0x38
55#define KS_WF0BM3 0x3A
56
57#define KS_WF1CRC0 0x40
58#define KS_WF1CRC1 0x42
59#define KS_WF1BM0 0x44
60#define KS_WF1BM1 0x46
61#define KS_WF1BM2 0x48
62#define KS_WF1BM3 0x4A
63
64#define KS_WF2CRC0 0x50
65#define KS_WF2CRC1 0x52
66#define KS_WF2BM0 0x54
67#define KS_WF2BM1 0x56
68#define KS_WF2BM2 0x58
69#define KS_WF2BM3 0x5A
70
71#define KS_WF3CRC0 0x60
72#define KS_WF3CRC1 0x62
73#define KS_WF3BM0 0x64
74#define KS_WF3BM1 0x66
75#define KS_WF3BM2 0x68
76#define KS_WF3BM3 0x6A
77
78#define KS_TXCR 0x70
79#define TXCR_TCGICMP (1 << 8)
80#define TXCR_TCGUDP (1 << 7)
81#define TXCR_TCGTCP (1 << 6)
82#define TXCR_TCGIP (1 << 5)
83#define TXCR_FTXQ (1 << 4)
84#define TXCR_TXFCE (1 << 3)
85#define TXCR_TXPE (1 << 2)
86#define TXCR_TXCRC (1 << 1)
87#define TXCR_TXE (1 << 0)
88
89#define KS_TXSR 0x72
90#define TXSR_TXLC (1 << 13)
91#define TXSR_TXMC (1 << 12)
92#define TXSR_TXFID_MASK (0x3f << 0)
93#define TXSR_TXFID_SHIFT (0)
94#define TXSR_TXFID_GET(_v) (((_v) >> 0) & 0x3f)
95
96#define KS_RXCR1 0x74
97#define RXCR1_FRXQ (1 << 15)
98#define RXCR1_RXUDPFCC (1 << 14)
99#define RXCR1_RXTCPFCC (1 << 13)
100#define RXCR1_RXIPFCC (1 << 12)
101#define RXCR1_RXPAFMA (1 << 11)
102#define RXCR1_RXFCE (1 << 10)
103#define RXCR1_RXEFE (1 << 9)
104#define RXCR1_RXMAFMA (1 << 8)
105#define RXCR1_RXBE (1 << 7)
106#define RXCR1_RXME (1 << 6)
107#define RXCR1_RXUE (1 << 5)
108#define RXCR1_RXAE (1 << 4)
109#define RXCR1_RXINVF (1 << 1)
110#define RXCR1_RXE (1 << 0)
111
112#define KS_RXCR2 0x76
113#define RXCR2_SRDBL_MASK (0x7 << 5)
114#define RXCR2_SRDBL_SHIFT (5)
115#define RXCR2_SRDBL_4B (0x0 << 5)
116#define RXCR2_SRDBL_8B (0x1 << 5)
117#define RXCR2_SRDBL_16B (0x2 << 5)
118#define RXCR2_SRDBL_32B (0x3 << 5)
119#define RXCR2_SRDBL_FRAME (0x4 << 5)
120#define RXCR2_IUFFP (1 << 4)
121#define RXCR2_RXIUFCEZ (1 << 3)
122#define RXCR2_UDPLFE (1 << 2)
123#define RXCR2_RXICMPFCC (1 << 1)
124#define RXCR2_RXSAF (1 << 0)
125
126#define KS_TXMIR 0x78
127
128#define KS_RXFHSR 0x7C
129#define RXFSHR_RXFV (1 << 15)
130#define RXFSHR_RXICMPFCS (1 << 13)
131#define RXFSHR_RXIPFCS (1 << 12)
132#define RXFSHR_RXTCPFCS (1 << 11)
133#define RXFSHR_RXUDPFCS (1 << 10)
134#define RXFSHR_RXBF (1 << 7)
135#define RXFSHR_RXMF (1 << 6)
136#define RXFSHR_RXUF (1 << 5)
137#define RXFSHR_RXMR (1 << 4)
138#define RXFSHR_RXFT (1 << 3)
139#define RXFSHR_RXFTL (1 << 2)
140#define RXFSHR_RXRF (1 << 1)
141#define RXFSHR_RXCE (1 << 0)
142
143#define KS_RXFHBCR 0x7E
144#define KS_TXQCR 0x80
145#define TXQCR_AETFE (1 << 2)
146#define TXQCR_TXQMAM (1 << 1)
147#define TXQCR_METFE (1 << 0)
148
149#define KS_RXQCR 0x82
150#define RXQCR_RXDTTS (1 << 12)
151#define RXQCR_RXDBCTS (1 << 11)
152#define RXQCR_RXFCTS (1 << 10)
153#define RXQCR_RXIPHTOE (1 << 9)
154#define RXQCR_RXDTTE (1 << 7)
155#define RXQCR_RXDBCTE (1 << 6)
156#define RXQCR_RXFCTE (1 << 5)
157#define RXQCR_ADRFE (1 << 4)
158#define RXQCR_SDA (1 << 3)
159#define RXQCR_RRXEF (1 << 0)
160
161#define KS_TXFDPR 0x84
162#define TXFDPR_TXFPAI (1 << 14)
163#define TXFDPR_TXFP_MASK (0x7ff << 0)
164#define TXFDPR_TXFP_SHIFT (0)
165
166#define KS_RXFDPR 0x86
167#define RXFDPR_RXFPAI (1 << 14)
168
169#define KS_RXDTTR 0x8C
170#define KS_RXDBCTR 0x8E
171
172#define KS_IER 0x90
173#define KS_ISR 0x92
174#define IRQ_LCI (1 << 15)
175#define IRQ_TXI (1 << 14)
176#define IRQ_RXI (1 << 13)
177#define IRQ_RXOI (1 << 11)
178#define IRQ_TXPSI (1 << 9)
179#define IRQ_RXPSI (1 << 8)
180#define IRQ_TXSAI (1 << 6)
181#define IRQ_RXWFDI (1 << 5)
182#define IRQ_RXMPDI (1 << 4)
183#define IRQ_LDI (1 << 3)
184#define IRQ_EDI (1 << 2)
185#define IRQ_SPIBEI (1 << 1)
186#define IRQ_DEDI (1 << 0)
187
188#define KS_RXFCTR 0x9C
189#define KS_RXFC 0x9D
190#define RXFCTR_RXFC_MASK (0xff << 8)
191#define RXFCTR_RXFC_SHIFT (8)
192#define RXFCTR_RXFC_GET(_v) (((_v) >> 8) & 0xff)
193#define RXFCTR_RXFCT_MASK (0xff << 0)
194#define RXFCTR_RXFCT_SHIFT (0)
195
196#define KS_TXNTFSR 0x9E
197
198#define KS_MAHTR0 0xA0
199#define KS_MAHTR1 0xA2
200#define KS_MAHTR2 0xA4
201#define KS_MAHTR3 0xA6
202
203#define KS_FCLWR 0xB0
204#define KS_FCHWR 0xB2
205#define KS_FCOWR 0xB4
206
207#define KS_CIDER 0xC0
208#define CIDER_ID 0x8870
209#define CIDER_REV_MASK (0x7 << 1)
210#define CIDER_REV_SHIFT (1)
211#define CIDER_REV_GET(_v) (((_v) >> 1) & 0x7)
212
213#define KS_CGCR 0xC6
214
215#define KS_IACR 0xC8
216#define IACR_RDEN (1 << 12)
217#define IACR_TSEL_MASK (0x3 << 10)
218#define IACR_TSEL_SHIFT (10)
219#define IACR_TSEL_MIB (0x3 << 10)
220#define IACR_ADDR_MASK (0x1f << 0)
221#define IACR_ADDR_SHIFT (0)
222
223#define KS_IADLR 0xD0
224#define KS_IAHDR 0xD2
225
226#define KS_PMECR 0xD4
227#define PMECR_PME_DELAY (1 << 14)
228#define PMECR_PME_POL (1 << 12)
229#define PMECR_WOL_WAKEUP (1 << 11)
230#define PMECR_WOL_MAGICPKT (1 << 10)
231#define PMECR_WOL_LINKUP (1 << 9)
232#define PMECR_WOL_ENERGY (1 << 8)
233#define PMECR_AUTO_WAKE_EN (1 << 7)
234#define PMECR_WAKEUP_NORMAL (1 << 6)
235#define PMECR_WKEVT_MASK (0xf << 2)
236#define PMECR_WKEVT_SHIFT (2)
237#define PMECR_WKEVT_GET(_v) (((_v) >> 2) & 0xf)
238#define PMECR_WKEVT_ENERGY (0x1 << 2)
239#define PMECR_WKEVT_LINK (0x2 << 2)
240#define PMECR_WKEVT_MAGICPKT (0x4 << 2)
241#define PMECR_WKEVT_FRAME (0x8 << 2)
242#define PMECR_PM_MASK (0x3 << 0)
243#define PMECR_PM_SHIFT (0)
244#define PMECR_PM_NORMAL (0x0 << 0)
245#define PMECR_PM_ENERGY (0x1 << 0)
246#define PMECR_PM_SOFTDOWN (0x2 << 0)
247#define PMECR_PM_POWERSAVE (0x3 << 0)
248
249/* Standard MII PHY data */
250#define KS_P1MBCR 0xE4
251#define KS_P1MBSR 0xE6
252#define KS_PHY1ILR 0xE8
253#define KS_PHY1IHR 0xEA
254#define KS_P1ANAR 0xEC
255#define KS_P1ANLPR 0xEE
256
257#define KS_P1SCLMD 0xF4
258#define P1SCLMD_LEDOFF (1 << 15)
259#define P1SCLMD_TXIDS (1 << 14)
260#define P1SCLMD_RESTARTAN (1 << 13)
261#define P1SCLMD_DISAUTOMDIX (1 << 10)
262#define P1SCLMD_FORCEMDIX (1 << 9)
263#define P1SCLMD_AUTONEGEN (1 << 7)
264#define P1SCLMD_FORCE100 (1 << 6)
265#define P1SCLMD_FORCEFDX (1 << 5)
266#define P1SCLMD_ADV_FLOW (1 << 4)
267#define P1SCLMD_ADV_100BT_FDX (1 << 3)
268#define P1SCLMD_ADV_100BT_HDX (1 << 2)
269#define P1SCLMD_ADV_10BT_FDX (1 << 1)
270#define P1SCLMD_ADV_10BT_HDX (1 << 0)
271
272#define KS_P1CR 0xF6
273#define P1CR_HP_MDIX (1 << 15)
274#define P1CR_REV_POL (1 << 13)
275#define P1CR_OP_100M (1 << 10)
276#define P1CR_OP_FDX (1 << 9)
277#define P1CR_OP_MDI (1 << 7)
278#define P1CR_AN_DONE (1 << 6)
279#define P1CR_LINK_GOOD (1 << 5)
280#define P1CR_PNTR_FLOW (1 << 4)
281#define P1CR_PNTR_100BT_FDX (1 << 3)
282#define P1CR_PNTR_100BT_HDX (1 << 2)
283#define P1CR_PNTR_10BT_FDX (1 << 1)
284#define P1CR_PNTR_10BT_HDX (1 << 0)
285
286/* TX Frame control */
287
288#define TXFR_TXIC (1 << 15)
289#define TXFR_TXFID_MASK (0x3f << 0)
290#define TXFR_TXFID_SHIFT (0)
291
292/* SPI frame opcodes */
293#define KS_SPIOP_RD (0x00)
294#define KS_SPIOP_WR (0x40)
295#define KS_SPIOP_RXFIFO (0x80)
296#define KS_SPIOP_TXFIFO (0xC0)
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index acd143da161d..61eabcac734c 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -179,7 +179,7 @@ static const struct net_device_ops macsonic_netdev_ops = {
179 .ndo_set_mac_address = eth_mac_addr, 179 .ndo_set_mac_address = eth_mac_addr,
180}; 180};
181 181
182static int __init macsonic_init(struct net_device *dev) 182static int __devinit macsonic_init(struct net_device *dev)
183{ 183{
184 struct sonic_local* lp = netdev_priv(dev); 184 struct sonic_local* lp = netdev_priv(dev);
185 185
@@ -223,7 +223,7 @@ static int __init macsonic_init(struct net_device *dev)
223 return 0; 223 return 0;
224} 224}
225 225
226static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev) 226static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
227{ 227{
228 struct sonic_local *lp = netdev_priv(dev); 228 struct sonic_local *lp = netdev_priv(dev);
229 const int prom_addr = ONBOARD_SONIC_PROM_BASE; 229 const int prom_addr = ONBOARD_SONIC_PROM_BASE;
@@ -288,7 +288,7 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
288 } else return 0; 288 } else return 0;
289} 289}
290 290
291static int __init mac_onboard_sonic_probe(struct net_device *dev) 291static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
292{ 292{
293 /* Bwahahaha */ 293 /* Bwahahaha */
294 static int once_is_more_than_enough; 294 static int once_is_more_than_enough;
@@ -409,7 +409,7 @@ static int __init mac_onboard_sonic_probe(struct net_device *dev)
409 return macsonic_init(dev); 409 return macsonic_init(dev);
410} 410}
411 411
412static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev, 412static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev,
413 unsigned long prom_addr, 413 unsigned long prom_addr,
414 int id) 414 int id)
415{ 415{
@@ -424,7 +424,7 @@ static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
424 return 0; 424 return 0;
425} 425}
426 426
427static int __init macsonic_ident(struct nubus_dev *ndev) 427static int __devinit macsonic_ident(struct nubus_dev *ndev)
428{ 428{
429 if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC && 429 if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
430 ndev->dr_sw == NUBUS_DRSW_SONIC_LC) 430 ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
@@ -449,7 +449,7 @@ static int __init macsonic_ident(struct nubus_dev *ndev)
449 return -1; 449 return -1;
450} 450}
451 451
452static int __init mac_nubus_sonic_probe(struct net_device *dev) 452static int __devinit mac_nubus_sonic_probe(struct net_device *dev)
453{ 453{
454 static int slots; 454 static int slots;
455 struct nubus_dev* ndev = NULL; 455 struct nubus_dev* ndev = NULL;
@@ -562,7 +562,7 @@ static int __init mac_nubus_sonic_probe(struct net_device *dev)
562 return macsonic_init(dev); 562 return macsonic_init(dev);
563} 563}
564 564
565static int __init mac_sonic_probe(struct platform_device *pdev) 565static int __devinit mac_sonic_probe(struct platform_device *pdev)
566{ 566{
567 struct net_device *dev; 567 struct net_device *dev;
568 struct sonic_local *lp; 568 struct sonic_local *lp;
@@ -575,6 +575,7 @@ static int __init mac_sonic_probe(struct platform_device *pdev)
575 lp = netdev_priv(dev); 575 lp = netdev_priv(dev);
576 lp->device = &pdev->dev; 576 lp->device = &pdev->dev;
577 SET_NETDEV_DEV(dev, &pdev->dev); 577 SET_NETDEV_DEV(dev, &pdev->dev);
578 platform_set_drvdata(pdev, dev);
578 579
579 /* This will catch fatal stuff like -ENOMEM as well as success */ 580 /* This will catch fatal stuff like -ENOMEM as well as success */
580 err = mac_onboard_sonic_probe(dev); 581 err = mac_onboard_sonic_probe(dev);
diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c
index 2845a0560b84..65ec77dc31f5 100644
--- a/drivers/net/mlx4/cmd.c
+++ b/drivers/net/mlx4/cmd.c
@@ -80,7 +80,9 @@ enum {
80 /* Bad management packet (silently discarded): */ 80 /* Bad management packet (silently discarded): */
81 CMD_STAT_BAD_PKT = 0x30, 81 CMD_STAT_BAD_PKT = 0x30,
82 /* More outstanding CQEs in CQ than new CQ size: */ 82 /* More outstanding CQEs in CQ than new CQ size: */
83 CMD_STAT_BAD_SIZE = 0x40 83 CMD_STAT_BAD_SIZE = 0x40,
84 /* Multi Function device support required: */
85 CMD_STAT_MULTI_FUNC_REQ = 0x50,
84}; 86};
85 87
86enum { 88enum {
@@ -128,6 +130,7 @@ static int mlx4_status_to_errno(u8 status)
128 [CMD_STAT_LAM_NOT_PRE] = -EAGAIN, 130 [CMD_STAT_LAM_NOT_PRE] = -EAGAIN,
129 [CMD_STAT_BAD_PKT] = -EINVAL, 131 [CMD_STAT_BAD_PKT] = -EINVAL,
130 [CMD_STAT_BAD_SIZE] = -ENOMEM, 132 [CMD_STAT_BAD_SIZE] = -ENOMEM,
133 [CMD_STAT_MULTI_FUNC_REQ] = -EACCES,
131 }; 134 };
132 135
133 if (status >= ARRAY_SIZE(trans_table) || 136 if (status >= ARRAY_SIZE(trans_table) ||
diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c
index 091f99052c91..86467b444ac6 100644
--- a/drivers/net/mlx4/en_ethtool.c
+++ b/drivers/net/mlx4/en_ethtool.c
@@ -220,7 +220,7 @@ static int mlx4_en_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
220{ 220{
221 cmd->autoneg = AUTONEG_DISABLE; 221 cmd->autoneg = AUTONEG_DISABLE;
222 cmd->supported = SUPPORTED_10000baseT_Full; 222 cmd->supported = SUPPORTED_10000baseT_Full;
223 cmd->advertising = SUPPORTED_10000baseT_Full; 223 cmd->advertising = ADVERTISED_1000baseT_Full;
224 if (netif_carrier_ok(dev)) { 224 if (netif_carrier_ok(dev)) {
225 cmd->speed = SPEED_10000; 225 cmd->speed = SPEED_10000;
226 cmd->duplex = DUPLEX_FULL; 226 cmd->duplex = DUPLEX_FULL;
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 018348c01193..dac621b1e9fc 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -729,7 +729,10 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
729 729
730 err = mlx4_QUERY_FW(dev); 730 err = mlx4_QUERY_FW(dev);
731 if (err) { 731 if (err) {
732 mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); 732 if (err == -EACCES)
733 mlx4_info(dev, "non-primary physical function, skipping.\n");
734 else
735 mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
733 return err; 736 return err;
734 } 737 }
735 738
@@ -1285,6 +1288,7 @@ static struct pci_device_id mlx4_pci_table[] = {
1285 { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ 1288 { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */
1286 { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ 1289 { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */
1287 { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ 1290 { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
1291 { PCI_VDEVICE(MELLANOX, 0x6764) }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/
1288 { 0, } 1292 { 0, }
1289}; 1293};
1290 1294
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index e1cdba752e09..f86e05047d19 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -210,6 +210,7 @@
210#define NETXEN_CTX_SIGNATURE 0xdee0 210#define NETXEN_CTX_SIGNATURE 0xdee0
211#define NETXEN_CTX_SIGNATURE_V2 0x0002dee0 211#define NETXEN_CTX_SIGNATURE_V2 0x0002dee0
212#define NETXEN_CTX_RESET 0xbad0 212#define NETXEN_CTX_RESET 0xbad0
213#define NETXEN_CTX_D3_RESET 0xacc0
213#define NETXEN_RCV_PRODUCER(ringid) (ringid) 214#define NETXEN_RCV_PRODUCER(ringid) (ringid)
214 215
215#define PHAN_PEG_RCV_INITIALIZED 0xff01 216#define PHAN_PEG_RCV_INITIALIZED 0xff01
@@ -773,6 +774,8 @@ struct nx_host_tx_ring {
773 u32 crb_cmd_consumer; 774 u32 crb_cmd_consumer;
774 u32 num_desc; 775 u32 num_desc;
775 776
777 struct netdev_queue *txq;
778
776 struct netxen_cmd_buffer *cmd_buf_arr; 779 struct netxen_cmd_buffer *cmd_buf_arr;
777 struct cmd_desc_type0 *desc_head; 780 struct cmd_desc_type0 *desc_head;
778 dma_addr_t phys_addr; 781 dma_addr_t phys_addr;
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index 4754f5cffad0..9f8ae4719e2f 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -684,10 +684,8 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
684 goto err_out_free; 684 goto err_out_free;
685 } else { 685 } else {
686 err = netxen_init_old_ctx(adapter); 686 err = netxen_init_old_ctx(adapter);
687 if (err) { 687 if (err)
688 netxen_free_hw_resources(adapter); 688 goto err_out_free;
689 return err;
690 }
691 } 689 }
692 690
693 return 0; 691 return 0;
@@ -708,15 +706,18 @@ void netxen_free_hw_resources(struct netxen_adapter *adapter)
708 int port = adapter->portnum; 706 int port = adapter->portnum;
709 707
710 if (adapter->fw_major >= 4) { 708 if (adapter->fw_major >= 4) {
711 nx_fw_cmd_destroy_tx_ctx(adapter);
712 nx_fw_cmd_destroy_rx_ctx(adapter); 709 nx_fw_cmd_destroy_rx_ctx(adapter);
710 nx_fw_cmd_destroy_tx_ctx(adapter);
713 } else { 711 } else {
714 netxen_api_lock(adapter); 712 netxen_api_lock(adapter);
715 NXWR32(adapter, CRB_CTX_SIGNATURE_REG(port), 713 NXWR32(adapter, CRB_CTX_SIGNATURE_REG(port),
716 NETXEN_CTX_RESET | port); 714 NETXEN_CTX_D3_RESET | port);
717 netxen_api_unlock(adapter); 715 netxen_api_unlock(adapter);
718 } 716 }
719 717
718 /* Allow dma queues to drain after context reset */
719 msleep(20);
720
720 recv_ctx = &adapter->recv_ctx; 721 recv_ctx = &adapter->recv_ctx;
721 722
722 if (recv_ctx->hwctx != NULL) { 723 if (recv_ctx->hwctx != NULL) {
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index ce3b89d2cbb6..b9123d445c96 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -461,13 +461,14 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
461 i = 0; 461 i = 0;
462 462
463 tx_ring = adapter->tx_ring; 463 tx_ring = adapter->tx_ring;
464 netif_tx_lock_bh(adapter->netdev); 464 __netif_tx_lock_bh(tx_ring->txq);
465 465
466 producer = tx_ring->producer; 466 producer = tx_ring->producer;
467 consumer = tx_ring->sw_consumer; 467 consumer = tx_ring->sw_consumer;
468 468
469 if (nr_desc >= find_diff_among(producer, consumer, tx_ring->num_desc)) { 469 if (nr_desc >= netxen_tx_avail(tx_ring)) {
470 netif_tx_unlock_bh(adapter->netdev); 470 netif_tx_stop_queue(tx_ring->txq);
471 __netif_tx_unlock_bh(tx_ring->txq);
471 return -EBUSY; 472 return -EBUSY;
472 } 473 }
473 474
@@ -490,7 +491,7 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
490 491
491 netxen_nic_update_cmd_producer(adapter, tx_ring); 492 netxen_nic_update_cmd_producer(adapter, tx_ring);
492 493
493 netif_tx_unlock_bh(adapter->netdev); 494 __netif_tx_unlock_bh(tx_ring->txq);
494 495
495 return 0; 496 return 0;
496} 497}
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index b899bd51fcd8..7acf204e38c9 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -184,6 +184,13 @@ void netxen_free_sw_resources(struct netxen_adapter *adapter)
184 kfree(recv_ctx->rds_rings); 184 kfree(recv_ctx->rds_rings);
185 185
186skip_rds: 186skip_rds:
187 if (recv_ctx->sds_rings == NULL)
188 goto skip_sds;
189
190 for(ring = 0; ring < adapter->max_sds_rings; ring++)
191 recv_ctx->sds_rings[ring].consumer = 0;
192
193skip_sds:
187 if (adapter->tx_ring == NULL) 194 if (adapter->tx_ring == NULL)
188 return; 195 return;
189 196
@@ -214,6 +221,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
214 adapter->tx_ring = tx_ring; 221 adapter->tx_ring = tx_ring;
215 222
216 tx_ring->num_desc = adapter->num_txd; 223 tx_ring->num_desc = adapter->num_txd;
224 tx_ring->txq = netdev_get_tx_queue(netdev, 0);
217 225
218 cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring)); 226 cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
219 if (cmd_buf_arr == NULL) { 227 if (cmd_buf_arr == NULL) {
@@ -1400,10 +1408,10 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter)
1400 smp_mb(); 1408 smp_mb();
1401 1409
1402 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) { 1410 if (netif_queue_stopped(netdev) && netif_carrier_ok(netdev)) {
1403 netif_tx_lock(netdev); 1411 __netif_tx_lock(tx_ring->txq, smp_processor_id());
1404 if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH) 1412 if (netxen_tx_avail(tx_ring) > TX_STOP_THRESH)
1405 netif_wake_queue(netdev); 1413 netif_wake_queue(netdev);
1406 netif_tx_unlock(netdev); 1414 __netif_tx_unlock(tx_ring->txq);
1407 } 1415 }
1408 } 1416 }
1409 /* 1417 /*
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 27539ddf94c4..637ac8b89bac 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -215,9 +215,9 @@ netxen_napi_disable(struct netxen_adapter *adapter)
215 215
216 for (ring = 0; ring < adapter->max_sds_rings; ring++) { 216 for (ring = 0; ring < adapter->max_sds_rings; ring++) {
217 sds_ring = &recv_ctx->sds_rings[ring]; 217 sds_ring = &recv_ctx->sds_rings[ring];
218 napi_disable(&sds_ring->napi);
219 netxen_nic_disable_int(sds_ring); 218 netxen_nic_disable_int(sds_ring);
220 synchronize_irq(sds_ring->irq); 219 napi_synchronize(&sds_ring->napi);
220 napi_disable(&sds_ring->napi);
221 } 221 }
222} 222}
223 223
@@ -833,11 +833,11 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
833 833
834 adapter->ahw.linkup = 0; 834 adapter->ahw.linkup = 0;
835 835
836 netxen_napi_enable(adapter);
837
838 if (adapter->max_sds_rings > 1) 836 if (adapter->max_sds_rings > 1)
839 netxen_config_rss(adapter, 1); 837 netxen_config_rss(adapter, 1);
840 838
839 netxen_napi_enable(adapter);
840
841 if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION) 841 if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION)
842 netxen_linkevent_request(adapter, 1); 842 netxen_linkevent_request(adapter, 1);
843 else 843 else
@@ -851,8 +851,9 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
851static void 851static void
852netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev) 852netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
853{ 853{
854 spin_lock(&adapter->tx_clean_lock);
854 netif_carrier_off(netdev); 855 netif_carrier_off(netdev);
855 netif_stop_queue(netdev); 856 netif_tx_disable(netdev);
856 857
857 if (adapter->stop_port) 858 if (adapter->stop_port)
858 adapter->stop_port(adapter); 859 adapter->stop_port(adapter);
@@ -863,9 +864,10 @@ netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
863 netxen_napi_disable(adapter); 864 netxen_napi_disable(adapter);
864 865
865 netxen_release_tx_buffers(adapter); 866 netxen_release_tx_buffers(adapter);
867 spin_unlock(&adapter->tx_clean_lock);
866 868
867 FLUSH_SCHEDULED_WORK();
868 del_timer_sync(&adapter->watchdog_timer); 869 del_timer_sync(&adapter->watchdog_timer);
870 FLUSH_SCHEDULED_WORK();
869} 871}
870 872
871 873
@@ -943,8 +945,8 @@ err_out_free_sw:
943static void 945static void
944netxen_nic_detach(struct netxen_adapter *adapter) 946netxen_nic_detach(struct netxen_adapter *adapter)
945{ 947{
946 netxen_release_rx_buffers(adapter);
947 netxen_free_hw_resources(adapter); 948 netxen_free_hw_resources(adapter);
949 netxen_release_rx_buffers(adapter);
948 netxen_nic_free_irq(adapter); 950 netxen_nic_free_irq(adapter);
949 netxen_free_sw_resources(adapter); 951 netxen_free_sw_resources(adapter);
950 952
@@ -1533,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
1533 printk(KERN_ALERT 1535 printk(KERN_ALERT
1534 "%s: Device temperature %d degrees C exceeds" 1536 "%s: Device temperature %d degrees C exceeds"
1535 " maximum allowed. Hardware has been shut down.\n", 1537 " maximum allowed. Hardware has been shut down.\n",
1536 netxen_nic_driver_name, temp_val); 1538 netdev->name, temp_val);
1539
1540 netif_device_detach(netdev);
1541 netxen_nic_down(adapter, netdev);
1542 netxen_nic_detach(adapter);
1537 1543
1538 netif_carrier_off(netdev);
1539 netif_stop_queue(netdev);
1540 rv = 1; 1544 rv = 1;
1541 } else if (temp_state == NX_TEMP_WARN) { 1545 } else if (temp_state == NX_TEMP_WARN) {
1542 if (adapter->temp == NX_TEMP_NORMAL) { 1546 if (adapter->temp == NX_TEMP_NORMAL) {
@@ -1544,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
1544 "%s: Device temperature %d degrees C " 1548 "%s: Device temperature %d degrees C "
1545 "exceeds operating range." 1549 "exceeds operating range."
1546 " Immediate action needed.\n", 1550 " Immediate action needed.\n",
1547 netxen_nic_driver_name, temp_val); 1551 netdev->name, temp_val);
1548 } 1552 }
1549 } else { 1553 } else {
1550 if (adapter->temp == NX_TEMP_WARN) { 1554 if (adapter->temp == NX_TEMP_WARN) {
1551 printk(KERN_INFO 1555 printk(KERN_INFO
1552 "%s: Device temperature is now %d degrees C" 1556 "%s: Device temperature is now %d degrees C"
1553 " in normal range.\n", netxen_nic_driver_name, 1557 " in normal range.\n", netdev->name,
1554 temp_val); 1558 temp_val);
1555 } 1559 }
1556 } 1560 }
@@ -1623,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work)
1623 struct netxen_adapter *adapter = 1627 struct netxen_adapter *adapter =
1624 container_of(work, struct netxen_adapter, watchdog_task); 1628 container_of(work, struct netxen_adapter, watchdog_task);
1625 1629
1626 if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) 1630 if (netxen_nic_check_temp(adapter))
1627 return; 1631 return;
1628 1632
1629 if (!adapter->has_link_events) 1633 if (!adapter->has_link_events)
@@ -1645,6 +1649,9 @@ static void netxen_tx_timeout_task(struct work_struct *work)
1645 struct netxen_adapter *adapter = 1649 struct netxen_adapter *adapter =
1646 container_of(work, struct netxen_adapter, tx_timeout_task); 1650 container_of(work, struct netxen_adapter, tx_timeout_task);
1647 1651
1652 if (!netif_running(adapter->netdev))
1653 return;
1654
1648 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", 1655 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
1649 netxen_nic_driver_name, adapter->netdev->name); 1656 netxen_nic_driver_name, adapter->netdev->name);
1650 1657
@@ -1757,7 +1764,8 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
1757 1764
1758 if ((work_done < budget) && tx_complete) { 1765 if ((work_done < budget) && tx_complete) {
1759 napi_complete(&sds_ring->napi); 1766 napi_complete(&sds_ring->napi);
1760 netxen_nic_enable_int(sds_ring); 1767 if (netif_running(adapter->netdev))
1768 netxen_nic_enable_int(sds_ring);
1761 } 1769 }
1762 1770
1763 return work_done; 1771 return work_done;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index ec7cf5ac4f05..690b9c76d34e 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -156,6 +156,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev);
156static int el3_rx(struct net_device *dev); 156static int el3_rx(struct net_device *dev);
157static int el3_close(struct net_device *dev); 157static int el3_close(struct net_device *dev);
158static void el3_tx_timeout(struct net_device *dev); 158static void el3_tx_timeout(struct net_device *dev);
159static void set_rx_mode(struct net_device *dev);
159static void set_multicast_list(struct net_device *dev); 160static void set_multicast_list(struct net_device *dev);
160static const struct ethtool_ops netdev_ethtool_ops; 161static const struct ethtool_ops netdev_ethtool_ops;
161 162
@@ -488,8 +489,7 @@ static void tc589_reset(struct net_device *dev)
488 /* Switch to register set 1 for normal use. */ 489 /* Switch to register set 1 for normal use. */
489 EL3WINDOW(1); 490 EL3WINDOW(1);
490 491
491 /* Accept b-cast and phys addr only. */ 492 set_rx_mode(dev);
492 outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD);
493 outw(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */ 493 outw(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */
494 outw(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */ 494 outw(RxEnable, ioaddr + EL3_CMD); /* Enable the receiver. */
495 outw(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */ 495 outw(TxEnable, ioaddr + EL3_CMD); /* Enable transmitter. */
@@ -700,7 +700,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
700 if (fifo_diag & 0x2000) { 700 if (fifo_diag & 0x2000) {
701 /* Rx underrun */ 701 /* Rx underrun */
702 tc589_wait_for_completion(dev, RxReset); 702 tc589_wait_for_completion(dev, RxReset);
703 set_multicast_list(dev); 703 set_rx_mode(dev);
704 outw(RxEnable, ioaddr + EL3_CMD); 704 outw(RxEnable, ioaddr + EL3_CMD);
705 } 705 }
706 outw(AckIntr | AdapterFailure, ioaddr + EL3_CMD); 706 outw(AckIntr | AdapterFailure, ioaddr + EL3_CMD);
@@ -905,14 +905,11 @@ static int el3_rx(struct net_device *dev)
905 return 0; 905 return 0;
906} 906}
907 907
908static void set_multicast_list(struct net_device *dev) 908static void set_rx_mode(struct net_device *dev)
909{ 909{
910 struct el3_private *lp = netdev_priv(dev);
911 struct pcmcia_device *link = lp->p_dev;
912 unsigned int ioaddr = dev->base_addr; 910 unsigned int ioaddr = dev->base_addr;
913 u16 opts = SetRxFilter | RxStation | RxBroadcast; 911 u16 opts = SetRxFilter | RxStation | RxBroadcast;
914 912
915 if (!pcmcia_dev_present(link)) return;
916 if (dev->flags & IFF_PROMISC) 913 if (dev->flags & IFF_PROMISC)
917 opts |= RxMulticast | RxProm; 914 opts |= RxMulticast | RxProm;
918 else if (dev->mc_count || (dev->flags & IFF_ALLMULTI)) 915 else if (dev->mc_count || (dev->flags & IFF_ALLMULTI))
@@ -920,6 +917,16 @@ static void set_multicast_list(struct net_device *dev)
920 outw(opts, ioaddr + EL3_CMD); 917 outw(opts, ioaddr + EL3_CMD);
921} 918}
922 919
920static void set_multicast_list(struct net_device *dev)
921{
922 struct el3_private *priv = netdev_priv(dev);
923 unsigned long flags;
924
925 spin_lock_irqsave(&priv->lock, flags);
926 set_rx_mode(dev);
927 spin_unlock_irqrestore(&priv->lock, flags);
928}
929
923static int el3_close(struct net_device *dev) 930static int el3_close(struct net_device *dev)
924{ 931{
925 struct el3_private *lp = netdev_priv(dev); 932 struct el3_private *lp = netdev_priv(dev);
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 33984b737233..22cdd451fb82 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -30,6 +30,7 @@
30 30
31#ifdef CONFIG_OF_GPIO 31#ifdef CONFIG_OF_GPIO
32#include <linux/of_gpio.h> 32#include <linux/of_gpio.h>
33#include <linux/of_mdio.h>
33#include <linux/of_platform.h> 34#include <linux/of_platform.h>
34#endif 35#endif
35 36
@@ -81,13 +82,12 @@ static struct mdiobb_ops mdio_gpio_ops = {
81 .get_mdio_data = mdio_get, 82 .get_mdio_data = mdio_get,
82}; 83};
83 84
84static int __devinit mdio_gpio_bus_init(struct device *dev, 85static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev,
85 struct mdio_gpio_platform_data *pdata, 86 struct mdio_gpio_platform_data *pdata,
86 int bus_id) 87 int bus_id)
87{ 88{
88 struct mii_bus *new_bus; 89 struct mii_bus *new_bus;
89 struct mdio_gpio_info *bitbang; 90 struct mdio_gpio_info *bitbang;
90 int ret = -ENOMEM;
91 int i; 91 int i;
92 92
93 bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL); 93 bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL);
@@ -104,8 +104,6 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
104 104
105 new_bus->name = "GPIO Bitbanged MDIO", 105 new_bus->name = "GPIO Bitbanged MDIO",
106 106
107 ret = -ENODEV;
108
109 new_bus->phy_mask = pdata->phy_mask; 107 new_bus->phy_mask = pdata->phy_mask;
110 new_bus->irq = pdata->irqs; 108 new_bus->irq = pdata->irqs;
111 new_bus->parent = dev; 109 new_bus->parent = dev;
@@ -129,15 +127,8 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
129 127
130 dev_set_drvdata(dev, new_bus); 128 dev_set_drvdata(dev, new_bus);
131 129
132 ret = mdiobus_register(new_bus); 130 return new_bus;
133 if (ret)
134 goto out_free_all;
135
136 return 0;
137 131
138out_free_all:
139 dev_set_drvdata(dev, NULL);
140 gpio_free(bitbang->mdio);
141out_free_mdc: 132out_free_mdc:
142 gpio_free(bitbang->mdc); 133 gpio_free(bitbang->mdc);
143out_free_bus: 134out_free_bus:
@@ -145,30 +136,47 @@ out_free_bus:
145out_free_bitbang: 136out_free_bitbang:
146 kfree(bitbang); 137 kfree(bitbang);
147out: 138out:
148 return ret; 139 return NULL;
149} 140}
150 141
151static void __devexit mdio_gpio_bus_destroy(struct device *dev) 142static void __devinit mdio_gpio_bus_deinit(struct device *dev)
152{ 143{
153 struct mii_bus *bus = dev_get_drvdata(dev); 144 struct mii_bus *bus = dev_get_drvdata(dev);
154 struct mdio_gpio_info *bitbang = bus->priv; 145 struct mdio_gpio_info *bitbang = bus->priv;
155 146
156 mdiobus_unregister(bus);
157 free_mdio_bitbang(bus);
158 dev_set_drvdata(dev, NULL); 147 dev_set_drvdata(dev, NULL);
159 gpio_free(bitbang->mdc);
160 gpio_free(bitbang->mdio); 148 gpio_free(bitbang->mdio);
149 gpio_free(bitbang->mdc);
150 free_mdio_bitbang(bus);
161 kfree(bitbang); 151 kfree(bitbang);
162} 152}
163 153
154static void __devexit mdio_gpio_bus_destroy(struct device *dev)
155{
156 struct mii_bus *bus = dev_get_drvdata(dev);
157
158 mdiobus_unregister(bus);
159 mdio_gpio_bus_deinit(dev);
160}
161
164static int __devinit mdio_gpio_probe(struct platform_device *pdev) 162static int __devinit mdio_gpio_probe(struct platform_device *pdev)
165{ 163{
166 struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data; 164 struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data;
165 struct mii_bus *new_bus;
166 int ret;
167 167
168 if (!pdata) 168 if (!pdata)
169 return -ENODEV; 169 return -ENODEV;
170 170
171 return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id); 171 new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
172 if (!new_bus)
173 return -ENODEV;
174
175 ret = mdiobus_register(new_bus);
176 if (ret)
177 mdio_gpio_bus_deinit(&pdev->dev);
178
179 return ret;
172} 180}
173 181
174static int __devexit mdio_gpio_remove(struct platform_device *pdev) 182static int __devexit mdio_gpio_remove(struct platform_device *pdev)
@@ -179,29 +187,12 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev)
179} 187}
180 188
181#ifdef CONFIG_OF_GPIO 189#ifdef CONFIG_OF_GPIO
182static void __devinit add_phy(struct mdio_gpio_platform_data *pdata,
183 struct device_node *np)
184{
185 const u32 *data;
186 int len, id, irq;
187
188 data = of_get_property(np, "reg", &len);
189 if (!data || len != 4)
190 return;
191
192 id = *data;
193 pdata->phy_mask &= ~(1 << id);
194
195 irq = of_irq_to_resource(np, 0, NULL);
196 if (irq)
197 pdata->irqs[id] = irq;
198}
199 190
200static int __devinit mdio_ofgpio_probe(struct of_device *ofdev, 191static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
201 const struct of_device_id *match) 192 const struct of_device_id *match)
202{ 193{
203 struct device_node *np = NULL;
204 struct mdio_gpio_platform_data *pdata; 194 struct mdio_gpio_platform_data *pdata;
195 struct mii_bus *new_bus;
205 int ret; 196 int ret;
206 197
207 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); 198 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
@@ -215,14 +206,18 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
215 206
216 ret = of_get_gpio(ofdev->node, 1); 207 ret = of_get_gpio(ofdev->node, 1);
217 if (ret < 0) 208 if (ret < 0)
218 goto out_free; 209 goto out_free;
219 pdata->mdio = ret; 210 pdata->mdio = ret;
220 211
221 while ((np = of_get_next_child(ofdev->node, np))) 212 new_bus = mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
222 if (!strcmp(np->type, "ethernet-phy")) 213 if (!new_bus)
223 add_phy(pdata, np); 214 return -ENODEV;
224 215
225 return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc); 216 ret = of_mdiobus_register(new_bus, ofdev->node);
217 if (ret)
218 mdio_gpio_bus_deinit(&ofdev->dev);
219
220 return ret;
226 221
227out_free: 222out_free:
228 kfree(pdata); 223 kfree(pdata);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index eba937c46376..b10fedd82143 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -134,8 +134,10 @@ int phy_scan_fixups(struct phy_device *phydev)
134 134
135 err = fixup->run(phydev); 135 err = fixup->run(phydev);
136 136
137 if (err < 0) 137 if (err < 0) {
138 mutex_unlock(&phy_fixup_lock);
138 return err; 139 return err;
140 }
139 } 141 }
140 } 142 }
141 mutex_unlock(&phy_fixup_lock); 143 mutex_unlock(&phy_fixup_lock);
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index 7a62f781fef2..2ca8b0d84ee2 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -270,6 +270,9 @@ static const struct net_device_ops plip_netdev_ops = {
270 .ndo_stop = plip_close, 270 .ndo_stop = plip_close,
271 .ndo_start_xmit = plip_tx_packet, 271 .ndo_start_xmit = plip_tx_packet,
272 .ndo_do_ioctl = plip_ioctl, 272 .ndo_do_ioctl = plip_ioctl,
273 .ndo_change_mtu = eth_change_mtu,
274 .ndo_set_mac_address = eth_mac_addr,
275 .ndo_validate_addr = eth_validate_addr,
273}; 276};
274 277
275/* Entry point of PLIP driver. 278/* Entry point of PLIP driver.
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 17c116bb332c..6de8399d6dd9 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -356,6 +356,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
356 if (!skb_queue_empty(&ap->rqueue)) 356 if (!skb_queue_empty(&ap->rqueue))
357 tasklet_schedule(&ap->tsk); 357 tasklet_schedule(&ap->tsk);
358 ap_put(ap); 358 ap_put(ap);
359 tty_unthrottle(tty);
359} 360}
360 361
361static void 362static void
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index aa3d39f38e22..d2fa2db13586 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -397,6 +397,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
397 if (!skb_queue_empty(&ap->rqueue)) 397 if (!skb_queue_empty(&ap->rqueue))
398 tasklet_schedule(&ap->tsk); 398 tasklet_schedule(&ap->tsk);
399 sp_put(ap); 399 sp_put(ap);
400 tty_unthrottle(tty);
400} 401}
401 402
402static void 403static void
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index d1a5fb4d6acb..a3932c9f3406 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -1411,6 +1411,7 @@ static const struct net_device_ops gelic_netdevice_ops = {
1411 .ndo_set_multicast_list = gelic_net_set_multi, 1411 .ndo_set_multicast_list = gelic_net_set_multi,
1412 .ndo_change_mtu = gelic_net_change_mtu, 1412 .ndo_change_mtu = gelic_net_change_mtu,
1413 .ndo_tx_timeout = gelic_net_tx_timeout, 1413 .ndo_tx_timeout = gelic_net_tx_timeout,
1414 .ndo_set_mac_address = eth_mac_addr,
1414 .ndo_validate_addr = eth_validate_addr, 1415 .ndo_validate_addr = eth_validate_addr,
1415#ifdef CONFIG_NET_POLL_CONTROLLER 1416#ifdef CONFIG_NET_POLL_CONTROLLER
1416 .ndo_poll_controller = gelic_net_poll_controller, 1417 .ndo_poll_controller = gelic_net_poll_controller,
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index b6b3ca9bdb21..6932b08d746b 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2707,6 +2707,7 @@ static const struct net_device_ops gelic_wl_netdevice_ops = {
2707 .ndo_set_multicast_list = gelic_net_set_multi, 2707 .ndo_set_multicast_list = gelic_net_set_multi,
2708 .ndo_change_mtu = gelic_net_change_mtu, 2708 .ndo_change_mtu = gelic_net_change_mtu,
2709 .ndo_tx_timeout = gelic_net_tx_timeout, 2709 .ndo_tx_timeout = gelic_net_tx_timeout,
2710 .ndo_set_mac_address = eth_mac_addr,
2710 .ndo_validate_addr = eth_validate_addr, 2711 .ndo_validate_addr = eth_validate_addr,
2711#ifdef CONFIG_NET_POLL_CONTROLLER 2712#ifdef CONFIG_NET_POLL_CONTROLLER
2712 .ndo_poll_controller = gelic_net_poll_controller, 2713 .ndo_poll_controller = gelic_net_poll_controller,
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4b53b58d75fc..b82780d805f5 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2060,8 +2060,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2060 } 2060 }
2061 } 2061 }
2062 2062
2063 pci_set_master(pdev);
2064
2065 /* ioremap MMIO region */ 2063 /* ioremap MMIO region */
2066 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); 2064 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE);
2067 if (!ioaddr) { 2065 if (!ioaddr) {
@@ -2089,6 +2087,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2089 2087
2090 RTL_W16(IntrStatus, 0xffff); 2088 RTL_W16(IntrStatus, 0xffff);
2091 2089
2090 pci_set_master(pdev);
2091
2092 /* Identify chip attached to board */ 2092 /* Identify chip attached to board */
2093 rtl8169_get_mac_version(tp, ioaddr); 2093 rtl8169_get_mac_version(tp, ioaddr);
2094 2094
@@ -3874,6 +3874,15 @@ static void rtl_shutdown(struct pci_dev *pdev)
3874 spin_unlock_irq(&tp->lock); 3874 spin_unlock_irq(&tp->lock);
3875 3875
3876 if (system_state == SYSTEM_POWER_OFF) { 3876 if (system_state == SYSTEM_POWER_OFF) {
3877 /* WoL fails with some 8168 when the receiver is disabled. */
3878 if (tp->features & RTL_FEATURE_WOL) {
3879 pci_clear_master(pdev);
3880
3881 RTL_W8(ChipCmd, CmdRxEnb);
3882 /* PCI commit */
3883 RTL_R8(ChipCmd);
3884 }
3885
3877 pci_wake_from_d3(pdev, true); 3886 pci_wake_from_d3(pdev, true);
3878 pci_set_power_state(pdev, PCI_D3hot); 3887 pci_set_power_state(pdev, PCI_D3hot);
3879 } 3888 }
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 18821f217e19..e3156c97bb58 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1593,6 +1593,7 @@ out:
1593static struct pci_device_id sc92031_pci_device_id_table[] __devinitdata = { 1593static struct pci_device_id sc92031_pci_device_id_table[] __devinitdata = {
1594 { PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x2031) }, 1594 { PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x2031) },
1595 { PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x8139) }, 1595 { PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x8139) },
1596 { PCI_DEVICE(0x1088, 0x2031) },
1596 { 0, } 1597 { 0, }
1597}; 1598};
1598MODULE_DEVICE_TABLE(pci, sc92031_pci_device_id_table); 1599MODULE_DEVICE_TABLE(pci, sc92031_pci_device_id_table);
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 60d502eef4fc..543af2044f40 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -3854,8 +3854,10 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
3854 skge->speed = -1; 3854 skge->speed = -1;
3855 skge->advertising = skge_supported_modes(hw); 3855 skge->advertising = skge_supported_modes(hw);
3856 3856
3857 if (device_may_wakeup(&hw->pdev->dev)) 3857 if (device_can_wakeup(&hw->pdev->dev)) {
3858 skge->wol = wol_supported(hw) & WAKE_MAGIC; 3858 skge->wol = wol_supported(hw) & WAKE_MAGIC;
3859 device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
3860 }
3859 3861
3860 hw->dev[port] = dev; 3862 hw->dev[port] = dev;
3861 3863
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index daf961ab68bc..3550c5dcd93c 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1151,14 +1151,7 @@ stopped:
1151 1151
1152 /* reset the Rx prefetch unit */ 1152 /* reset the Rx prefetch unit */
1153 sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); 1153 sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
1154 1154 mmiowb();
1155 /* Reset the RAM Buffer receive queue */
1156 sky2_write8(hw, RB_ADDR(rxq, RB_CTRL), RB_RST_SET);
1157
1158 /* Reset Rx MAC FIFO */
1159 sky2_write8(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), GMF_RST_SET);
1160
1161 sky2_read8(hw, B0_CTST);
1162} 1155}
1163 1156
1164/* Clean out receive buffer area, assumes receiver hardware stopped */ 1157/* Clean out receive buffer area, assumes receiver hardware stopped */
@@ -1825,12 +1818,6 @@ static int sky2_down(struct net_device *dev)
1825 if (netif_msg_ifdown(sky2)) 1818 if (netif_msg_ifdown(sky2))
1826 printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); 1819 printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
1827 1820
1828 /* Disable port IRQ */
1829 imask = sky2_read32(hw, B0_IMSK);
1830 imask &= ~portirq_msk[port];
1831 sky2_write32(hw, B0_IMSK, imask);
1832 sky2_read32(hw, B0_IMSK);
1833
1834 /* Force flow control off */ 1821 /* Force flow control off */
1835 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); 1822 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
1836 1823
@@ -1870,8 +1857,6 @@ static int sky2_down(struct net_device *dev)
1870 1857
1871 sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET); 1858 sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET);
1872 1859
1873 sky2_rx_stop(sky2);
1874
1875 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); 1860 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
1876 sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); 1861 sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
1877 1862
@@ -1881,6 +1866,14 @@ static int sky2_down(struct net_device *dev)
1881 sky2_write32(hw, STAT_ISR_TIMER_CNT, 0); 1866 sky2_write32(hw, STAT_ISR_TIMER_CNT, 0);
1882 sky2_read8(hw, STAT_ISR_TIMER_CTRL); 1867 sky2_read8(hw, STAT_ISR_TIMER_CTRL);
1883 1868
1869 sky2_rx_stop(sky2);
1870
1871 /* Disable port IRQ */
1872 imask = sky2_read32(hw, B0_IMSK);
1873 imask &= ~portirq_msk[port];
1874 sky2_write32(hw, B0_IMSK, imask);
1875 sky2_read32(hw, B0_IMSK);
1876
1884 synchronize_irq(hw->pdev->irq); 1877 synchronize_irq(hw->pdev->irq);
1885 napi_synchronize(&hw->napi); 1878 napi_synchronize(&hw->napi);
1886 1879
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index fdcbaf8dfa73..1c70e999cc50 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1774,6 +1774,7 @@ static const struct net_device_ops smc_netdev_ops = {
1774 .ndo_start_xmit = smc_hard_start_xmit, 1774 .ndo_start_xmit = smc_hard_start_xmit,
1775 .ndo_tx_timeout = smc_timeout, 1775 .ndo_tx_timeout = smc_timeout,
1776 .ndo_set_multicast_list = smc_set_multicast_list, 1776 .ndo_set_multicast_list = smc_set_multicast_list,
1777 .ndo_change_mtu = eth_change_mtu,
1777 .ndo_validate_addr = eth_validate_addr, 1778 .ndo_validate_addr = eth_validate_addr,
1778 .ndo_set_mac_address = eth_mac_addr, 1779 .ndo_set_mac_address = eth_mac_addr,
1779#ifdef CONFIG_NET_POLL_CONTROLLER 1780#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f1f773b17fe1..57a159fac99f 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -186,7 +186,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
186#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) 186#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l))
187#define SMC_IRQ_FLAGS (-1) /* from resource */ 187#define SMC_IRQ_FLAGS (-1) /* from resource */
188 188
189#elif defined(CONFIG_MACH_LOGICPD_PXA270) 189#elif defined(CONFIG_MACH_LOGICPD_PXA270) \
190 || defined(CONFIG_MACH_NOMADIK_8815NHK)
190 191
191#define SMC_CAN_USE_8BIT 0 192#define SMC_CAN_USE_8BIT 0
192#define SMC_CAN_USE_16BIT 1 193#define SMC_CAN_USE_16BIT 1
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 66067f9d91c0..94b6d2658ddc 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1779,6 +1779,7 @@ static const struct net_device_ops smsc911x_netdev_ops = {
1779 .ndo_get_stats = smsc911x_get_stats, 1779 .ndo_get_stats = smsc911x_get_stats,
1780 .ndo_set_multicast_list = smsc911x_set_multicast_list, 1780 .ndo_set_multicast_list = smsc911x_set_multicast_list,
1781 .ndo_do_ioctl = smsc911x_do_ioctl, 1781 .ndo_do_ioctl = smsc911x_do_ioctl,
1782 .ndo_change_mtu = eth_change_mtu,
1782 .ndo_validate_addr = eth_validate_addr, 1783 .ndo_validate_addr = eth_validate_addr,
1783 .ndo_set_mac_address = smsc911x_set_mac_address, 1784 .ndo_set_mac_address = smsc911x_set_mac_address,
1784#ifdef CONFIG_NET_POLL_CONTROLLER 1785#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index a82fb2aca4cb..f1e5e4542c2a 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -1016,7 +1016,9 @@ static const struct net_device_ops vnet_ops = {
1016 .ndo_open = vnet_open, 1016 .ndo_open = vnet_open,
1017 .ndo_stop = vnet_close, 1017 .ndo_stop = vnet_close,
1018 .ndo_set_multicast_list = vnet_set_rx_mode, 1018 .ndo_set_multicast_list = vnet_set_rx_mode,
1019 .ndo_change_mtu = eth_change_mtu,
1019 .ndo_set_mac_address = vnet_set_mac_addr, 1020 .ndo_set_mac_address = vnet_set_mac_addr,
1021 .ndo_validate_addr = eth_validate_addr,
1020 .ndo_tx_timeout = vnet_tx_timeout, 1022 .ndo_tx_timeout = vnet_tx_timeout,
1021 .ndo_change_mtu = vnet_change_mtu, 1023 .ndo_change_mtu = vnet_change_mtu,
1022 .ndo_start_xmit = vnet_start_xmit, 1024 .ndo_start_xmit = vnet_start_xmit,
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 9d896116cf76..08a6c41c1599 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -1912,7 +1912,7 @@ static int __init ibmtr_init(void)
1912 1912
1913 find_turbo_adapters(io); 1913 find_turbo_adapters(io);
1914 1914
1915 for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) { 1915 for (i = 0; i < IBMTR_MAX_ADAPTERS && io[i]; i++) {
1916 struct net_device *dev; 1916 struct net_device *dev;
1917 irq[i] = 0; 1917 irq[i] = 0;
1918 mem[i] = 0; 1918 mem[i] = 0;
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 40c6eba775ce..3b957e6412ee 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1590,13 +1590,13 @@ static int init_phy(struct net_device *dev)
1590 priv->oldspeed = 0; 1590 priv->oldspeed = 0;
1591 priv->oldduplex = -1; 1591 priv->oldduplex = -1;
1592 1592
1593 if (!ug_info->phy_node)
1594 return 0;
1595
1596 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0, 1593 phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
1597 priv->phy_interface); 1594 priv->phy_interface);
1595 if (!phydev)
1596 phydev = of_phy_connect_fixed_link(dev, &adjust_link,
1597 priv->phy_interface);
1598 if (!phydev) { 1598 if (!phydev) {
1599 printk("%s: Could not attach to PHY\n", dev->name); 1599 dev_err(&dev->dev, "Could not attach to PHY\n");
1600 return -ENODEV; 1600 return -ENODEV;
1601 } 1601 }
1602 1602
@@ -3608,9 +3608,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3608 struct ucc_geth_private *ugeth = NULL; 3608 struct ucc_geth_private *ugeth = NULL;
3609 struct ucc_geth_info *ug_info; 3609 struct ucc_geth_info *ug_info;
3610 struct resource res; 3610 struct resource res;
3611 struct device_node *phy;
3612 int err, ucc_num, max_speed = 0; 3611 int err, ucc_num, max_speed = 0;
3613 const u32 *fixed_link;
3614 const unsigned int *prop; 3612 const unsigned int *prop;
3615 const char *sprop; 3613 const char *sprop;
3616 const void *mac_addr; 3614 const void *mac_addr;
@@ -3708,15 +3706,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3708 3706
3709 ug_info->uf_info.regs = res.start; 3707 ug_info->uf_info.regs = res.start;
3710 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3708 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3711 fixed_link = of_get_property(np, "fixed-link", NULL); 3709
3712 if (fixed_link) { 3710 ug_info->phy_node = of_parse_phandle(np, "phy-handle", 0);
3713 phy = NULL;
3714 } else {
3715 phy = of_parse_phandle(np, "phy-handle", 0);
3716 if (phy == NULL)
3717 return -ENODEV;
3718 }
3719 ug_info->phy_node = phy;
3720 3711
3721 /* Find the TBI PHY node. If it's not there, we don't support SGMII */ 3712 /* Find the TBI PHY node. If it's not there, we don't support SGMII */
3722 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0); 3713 ug_info->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
@@ -3725,7 +3716,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3725 prop = of_get_property(np, "phy-connection-type", NULL); 3716 prop = of_get_property(np, "phy-connection-type", NULL);
3726 if (!prop) { 3717 if (!prop) {
3727 /* handle interface property present in old trees */ 3718 /* handle interface property present in old trees */
3728 prop = of_get_property(phy, "interface", NULL); 3719 prop = of_get_property(ug_info->phy_node, "interface", NULL);
3729 if (prop != NULL) { 3720 if (prop != NULL) {
3730 phy_interface = enet_to_phy_interface[*prop]; 3721 phy_interface = enet_to_phy_interface[*prop];
3731 max_speed = enet_to_speed[*prop]; 3722 max_speed = enet_to_speed[*prop];
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index a906d3998131..c47237c2d638 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -369,4 +369,12 @@ config USB_NET_INT51X1
369 (Powerline Communications) solution with an Intellon 369 (Powerline Communications) solution with an Intellon
370 INT51x1/INT5200 chip, like the "devolo dLan duo". 370 INT51x1/INT5200 chip, like the "devolo dLan duo".
371 371
372config USB_CDC_PHONET
373 tristate "CDC Phonet support"
374 depends on PHONET
375 help
376 Choose this option to support the Phonet interface to a Nokia
377 cellular modem, as found on most Nokia handsets with the
378 "PC suite" USB profile.
379
372endmenu 380endmenu
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
index b870b0b1cbe0..e17afb78f372 100644
--- a/drivers/net/usb/Makefile
+++ b/drivers/net/usb/Makefile
@@ -21,4 +21,5 @@ obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o
21obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o 21obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o
22obj-$(CONFIG_USB_USBNET) += usbnet.o 22obj-$(CONFIG_USB_USBNET) += usbnet.o
23obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o 23obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o
24obj-$(CONFIG_USB_CDC_PHONET) += cdc-phonet.o
24 25
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
new file mode 100644
index 000000000000..792af72da8ac
--- /dev/null
+++ b/drivers/net/usb/cdc-phonet.c
@@ -0,0 +1,461 @@
1/*
2 * phonet.c -- USB CDC Phonet host driver
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation. All rights reserved.
5 *
6 * Author: Rémi Denis-Courmont
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#include <linux/kernel.h>
24#include <linux/module.h>
25#include <linux/usb.h>
26#include <linux/usb/cdc.h>
27#include <linux/netdevice.h>
28#include <linux/if_arp.h>
29#include <linux/if_phonet.h>
30
31#define PN_MEDIA_USB 0x1B
32
33static const unsigned rxq_size = 17;
34
35struct usbpn_dev {
36 struct net_device *dev;
37
38 struct usb_interface *intf, *data_intf;
39 struct usb_device *usb;
40 unsigned int tx_pipe, rx_pipe;
41 u8 active_setting;
42 u8 disconnected;
43
44 unsigned tx_queue;
45 spinlock_t tx_lock;
46
47 spinlock_t rx_lock;
48 struct sk_buff *rx_skb;
49 struct urb *urbs[0];
50};
51
52static void tx_complete(struct urb *req);
53static void rx_complete(struct urb *req);
54
55/*
56 * Network device callbacks
57 */
58static int usbpn_xmit(struct sk_buff *skb, struct net_device *dev)
59{
60 struct usbpn_dev *pnd = netdev_priv(dev);
61 struct urb *req = NULL;
62 unsigned long flags;
63 int err;
64
65 if (skb->protocol != htons(ETH_P_PHONET))
66 goto drop;
67
68 req = usb_alloc_urb(0, GFP_ATOMIC);
69 if (!req)
70 goto drop;
71 usb_fill_bulk_urb(req, pnd->usb, pnd->tx_pipe, skb->data, skb->len,
72 tx_complete, skb);
73 req->transfer_flags = URB_ZERO_PACKET;
74 err = usb_submit_urb(req, GFP_ATOMIC);
75 if (err) {
76 usb_free_urb(req);
77 goto drop;
78 }
79
80 spin_lock_irqsave(&pnd->tx_lock, flags);
81 pnd->tx_queue++;
82 if (pnd->tx_queue >= dev->tx_queue_len)
83 netif_stop_queue(dev);
84 spin_unlock_irqrestore(&pnd->tx_lock, flags);
85 return 0;
86
87drop:
88 dev_kfree_skb(skb);
89 dev->stats.tx_dropped++;
90 return 0;
91}
92
93static void tx_complete(struct urb *req)
94{
95 struct sk_buff *skb = req->context;
96 struct net_device *dev = skb->dev;
97 struct usbpn_dev *pnd = netdev_priv(dev);
98
99 switch (req->status) {
100 case 0:
101 dev->stats.tx_bytes += skb->len;
102 break;
103
104 case -ENOENT:
105 case -ECONNRESET:
106 case -ESHUTDOWN:
107 dev->stats.tx_aborted_errors++;
108 default:
109 dev->stats.tx_errors++;
110 dev_dbg(&dev->dev, "TX error (%d)\n", req->status);
111 }
112 dev->stats.tx_packets++;
113
114 spin_lock(&pnd->tx_lock);
115 pnd->tx_queue--;
116 netif_wake_queue(dev);
117 spin_unlock(&pnd->tx_lock);
118
119 dev_kfree_skb_any(skb);
120 usb_free_urb(req);
121}
122
123static int rx_submit(struct usbpn_dev *pnd, struct urb *req, gfp_t gfp_flags)
124{
125 struct net_device *dev = pnd->dev;
126 struct page *page;
127 int err;
128
129 page = __netdev_alloc_page(dev, gfp_flags);
130 if (!page)
131 return -ENOMEM;
132
133 usb_fill_bulk_urb(req, pnd->usb, pnd->rx_pipe, page_address(page),
134 PAGE_SIZE, rx_complete, dev);
135 req->transfer_flags = 0;
136 err = usb_submit_urb(req, gfp_flags);
137 if (unlikely(err)) {
138 dev_dbg(&dev->dev, "RX submit error (%d)\n", err);
139 netdev_free_page(dev, page);
140 }
141 return err;
142}
143
144static void rx_complete(struct urb *req)
145{
146 struct net_device *dev = req->context;
147 struct usbpn_dev *pnd = netdev_priv(dev);
148 struct page *page = virt_to_page(req->transfer_buffer);
149 struct sk_buff *skb;
150 unsigned long flags;
151
152 switch (req->status) {
153 case 0:
154 spin_lock_irqsave(&pnd->rx_lock, flags);
155 skb = pnd->rx_skb;
156 if (!skb) {
157 skb = pnd->rx_skb = netdev_alloc_skb(dev, 12);
158 if (likely(skb)) {
159 /* Can't use pskb_pull() on page in IRQ */
160 memcpy(skb_put(skb, 1), page_address(page), 1);
161 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
162 page, 1, req->actual_length);
163 page = NULL;
164 }
165 } else {
166 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
167 page, 0, req->actual_length);
168 page = NULL;
169 }
170 if (req->actual_length < PAGE_SIZE)
171 pnd->rx_skb = NULL; /* Last fragment */
172 else
173 skb = NULL;
174 spin_unlock_irqrestore(&pnd->rx_lock, flags);
175 if (skb) {
176 skb->protocol = htons(ETH_P_PHONET);
177 skb_reset_mac_header(skb);
178 __skb_pull(skb, 1);
179 skb->dev = dev;
180 dev->stats.rx_packets++;
181 dev->stats.rx_bytes += skb->len;
182
183 netif_rx(skb);
184 }
185 goto resubmit;
186
187 case -ENOENT:
188 case -ECONNRESET:
189 case -ESHUTDOWN:
190 req = NULL;
191 break;
192
193 case -EOVERFLOW:
194 dev->stats.rx_over_errors++;
195 dev_dbg(&dev->dev, "RX overflow\n");
196 break;
197
198 case -EILSEQ:
199 dev->stats.rx_crc_errors++;
200 break;
201 }
202
203 dev->stats.rx_errors++;
204resubmit:
205 if (page)
206 netdev_free_page(dev, page);
207 if (req)
208 rx_submit(pnd, req, GFP_ATOMIC);
209}
210
211static int usbpn_close(struct net_device *dev);
212
213static int usbpn_open(struct net_device *dev)
214{
215 struct usbpn_dev *pnd = netdev_priv(dev);
216 int err;
217 unsigned i;
218 unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber;
219
220 err = usb_set_interface(pnd->usb, num, pnd->active_setting);
221 if (err)
222 return err;
223
224 for (i = 0; i < rxq_size; i++) {
225 struct urb *req = usb_alloc_urb(0, GFP_KERNEL);
226
227 if (!req || rx_submit(pnd, req, GFP_KERNEL)) {
228 usbpn_close(dev);
229 return -ENOMEM;
230 }
231 pnd->urbs[i] = req;
232 }
233
234 netif_wake_queue(dev);
235 return 0;
236}
237
238static int usbpn_close(struct net_device *dev)
239{
240 struct usbpn_dev *pnd = netdev_priv(dev);
241 unsigned i;
242 unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber;
243
244 netif_stop_queue(dev);
245
246 for (i = 0; i < rxq_size; i++) {
247 struct urb *req = pnd->urbs[i];
248
249 if (!req)
250 continue;
251 usb_kill_urb(req);
252 usb_free_urb(req);
253 pnd->urbs[i] = NULL;
254 }
255
256 return usb_set_interface(pnd->usb, num, !pnd->active_setting);
257}
258
259static int usbpn_set_mtu(struct net_device *dev, int new_mtu)
260{
261 if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
262 return -EINVAL;
263
264 dev->mtu = new_mtu;
265 return 0;
266}
267
268static const struct net_device_ops usbpn_ops = {
269 .ndo_open = usbpn_open,
270 .ndo_stop = usbpn_close,
271 .ndo_start_xmit = usbpn_xmit,
272 .ndo_change_mtu = usbpn_set_mtu,
273};
274
275static void usbpn_setup(struct net_device *dev)
276{
277 dev->features = 0;
278 dev->netdev_ops = &usbpn_ops,
279 dev->header_ops = &phonet_header_ops;
280 dev->type = ARPHRD_PHONET;
281 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
282 dev->mtu = PHONET_MAX_MTU;
283 dev->hard_header_len = 1;
284 dev->dev_addr[0] = PN_MEDIA_USB;
285 dev->addr_len = 1;
286 dev->tx_queue_len = 3;
287
288 dev->destructor = free_netdev;
289}
290
291/*
292 * USB driver callbacks
293 */
294static struct usb_device_id usbpn_ids[] = {
295 {
296 .match_flags = USB_DEVICE_ID_MATCH_VENDOR
297 | USB_DEVICE_ID_MATCH_INT_CLASS
298 | USB_DEVICE_ID_MATCH_INT_SUBCLASS,
299 .idVendor = 0x0421, /* Nokia */
300 .bInterfaceClass = USB_CLASS_COMM,
301 .bInterfaceSubClass = 0xFE,
302 },
303 { },
304};
305
306MODULE_DEVICE_TABLE(usb, usbpn_ids);
307
308static struct usb_driver usbpn_driver;
309
310int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
311{
312 static const char ifname[] = "usbpn%d";
313 const struct usb_cdc_union_desc *union_header = NULL;
314 const struct usb_cdc_header_desc *phonet_header = NULL;
315 const struct usb_host_interface *data_desc;
316 struct usb_interface *data_intf;
317 struct usb_device *usbdev = interface_to_usbdev(intf);
318 struct net_device *dev;
319 struct usbpn_dev *pnd;
320 u8 *data;
321 int len, err;
322
323 data = intf->altsetting->extra;
324 len = intf->altsetting->extralen;
325 while (len >= 3) {
326 u8 dlen = data[0];
327 if (dlen < 3)
328 return -EINVAL;
329
330 /* bDescriptorType */
331 if (data[1] == USB_DT_CS_INTERFACE) {
332 /* bDescriptorSubType */
333 switch (data[2]) {
334 case USB_CDC_UNION_TYPE:
335 if (union_header || dlen < 5)
336 break;
337 union_header =
338 (struct usb_cdc_union_desc *)data;
339 break;
340 case 0xAB:
341 if (phonet_header || dlen < 5)
342 break;
343 phonet_header =
344 (struct usb_cdc_header_desc *)data;
345 break;
346 }
347 }
348 data += dlen;
349 len -= dlen;
350 }
351
352 if (!union_header || !phonet_header)
353 return -EINVAL;
354
355 data_intf = usb_ifnum_to_if(usbdev, union_header->bSlaveInterface0);
356 if (data_intf == NULL)
357 return -ENODEV;
358 /* Data interface has one inactive and one active setting */
359 if (data_intf->num_altsetting != 2)
360 return -EINVAL;
361 if (data_intf->altsetting[0].desc.bNumEndpoints == 0
362 && data_intf->altsetting[1].desc.bNumEndpoints == 2)
363 data_desc = data_intf->altsetting + 1;
364 else
365 if (data_intf->altsetting[0].desc.bNumEndpoints == 2
366 && data_intf->altsetting[1].desc.bNumEndpoints == 0)
367 data_desc = data_intf->altsetting;
368 else
369 return -EINVAL;
370
371 dev = alloc_netdev(sizeof(*pnd) + sizeof(pnd->urbs[0]) * rxq_size,
372 ifname, usbpn_setup);
373 if (!dev)
374 return -ENOMEM;
375
376 pnd = netdev_priv(dev);
377 SET_NETDEV_DEV(dev, &intf->dev);
378 netif_stop_queue(dev);
379
380 pnd->dev = dev;
381 pnd->usb = usb_get_dev(usbdev);
382 pnd->intf = intf;
383 pnd->data_intf = data_intf;
384 spin_lock_init(&pnd->tx_lock);
385 spin_lock_init(&pnd->rx_lock);
386 /* Endpoints */
387 if (usb_pipein(data_desc->endpoint[0].desc.bEndpointAddress)) {
388 pnd->rx_pipe = usb_rcvbulkpipe(usbdev,
389 data_desc->endpoint[0].desc.bEndpointAddress);
390 pnd->tx_pipe = usb_sndbulkpipe(usbdev,
391 data_desc->endpoint[1].desc.bEndpointAddress);
392 } else {
393 pnd->rx_pipe = usb_rcvbulkpipe(usbdev,
394 data_desc->endpoint[1].desc.bEndpointAddress);
395 pnd->tx_pipe = usb_sndbulkpipe(usbdev,
396 data_desc->endpoint[0].desc.bEndpointAddress);
397 }
398 pnd->active_setting = data_desc - data_intf->altsetting;
399
400 err = usb_driver_claim_interface(&usbpn_driver, data_intf, pnd);
401 if (err)
402 goto out;
403
404 /* Force inactive mode until the network device is brought UP */
405 usb_set_interface(usbdev, union_header->bSlaveInterface0,
406 !pnd->active_setting);
407 usb_set_intfdata(intf, pnd);
408
409 err = register_netdev(dev);
410 if (err) {
411 usb_driver_release_interface(&usbpn_driver, data_intf);
412 goto out;
413 }
414
415 dev_dbg(&dev->dev, "USB CDC Phonet device found\n");
416 return 0;
417
418out:
419 usb_set_intfdata(intf, NULL);
420 free_netdev(dev);
421 return err;
422}
423
424static void usbpn_disconnect(struct usb_interface *intf)
425{
426 struct usbpn_dev *pnd = usb_get_intfdata(intf);
427 struct usb_device *usb = pnd->usb;
428
429 if (pnd->disconnected)
430 return;
431
432 pnd->disconnected = 1;
433 usb_driver_release_interface(&usbpn_driver,
434 (pnd->intf == intf) ? pnd->data_intf : pnd->intf);
435 unregister_netdev(pnd->dev);
436 usb_put_dev(usb);
437}
438
439static struct usb_driver usbpn_driver = {
440 .name = "cdc_phonet",
441 .probe = usbpn_probe,
442 .disconnect = usbpn_disconnect,
443 .id_table = usbpn_ids,
444};
445
446static int __init usbpn_init(void)
447{
448 return usb_register(&usbpn_driver);
449}
450
451static void __exit usbpn_exit(void)
452{
453 usb_deregister(&usbpn_driver);
454}
455
456module_init(usbpn_init);
457module_exit(usbpn_exit);
458
459MODULE_AUTHOR("Remi Denis-Courmont");
460MODULE_DESCRIPTION("USB CDC Phonet host interface");
461MODULE_LICENSE("GPL");
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index cd35d50e46d4..45cebfb302cf 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -311,7 +311,7 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
311 * bmCRC = 0 : CRC = 0xDEADBEEF 311 * bmCRC = 0 : CRC = 0xDEADBEEF
312 */ 312 */
313 if (header & BIT(14)) 313 if (header & BIT(14))
314 crc2 = ~crc32_le(~0, skb2->data, len); 314 crc2 = ~crc32_le(~0, skb2->data, skb2->len);
315 else 315 else
316 crc2 = 0xdeadbeef; 316 crc2 = 0xdeadbeef;
317 317
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index e01314789718..1f9ec29fce50 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -999,6 +999,9 @@ static const struct net_device_ops kaweth_netdev_ops = {
999 .ndo_tx_timeout = kaweth_tx_timeout, 999 .ndo_tx_timeout = kaweth_tx_timeout,
1000 .ndo_set_multicast_list = kaweth_set_rx_mode, 1000 .ndo_set_multicast_list = kaweth_set_rx_mode,
1001 .ndo_get_stats = kaweth_netdev_stats, 1001 .ndo_get_stats = kaweth_netdev_stats,
1002 .ndo_change_mtu = eth_change_mtu,
1003 .ndo_set_mac_address = eth_mac_addr,
1004 .ndo_validate_addr = eth_validate_addr,
1002}; 1005};
1003 1006
1004static int kaweth_probe( 1007static int kaweth_probe(
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 73acbd244aa1..631d269ac980 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -1493,6 +1493,9 @@ static const struct net_device_ops pegasus_netdev_ops = {
1493 .ndo_set_multicast_list = pegasus_set_multicast, 1493 .ndo_set_multicast_list = pegasus_set_multicast,
1494 .ndo_get_stats = pegasus_netdev_stats, 1494 .ndo_get_stats = pegasus_netdev_stats,
1495 .ndo_tx_timeout = pegasus_tx_timeout, 1495 .ndo_tx_timeout = pegasus_tx_timeout,
1496 .ndo_change_mtu = eth_change_mtu,
1497 .ndo_set_mac_address = eth_mac_addr,
1498 .ndo_validate_addr = eth_validate_addr,
1496}; 1499};
1497 1500
1498static struct usb_driver pegasus_driver = { 1501static struct usb_driver pegasus_driver = {
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index d3489a3c4c03..88c30a58b4bd 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -621,6 +621,7 @@ static const struct net_device_ops rhine_netdev_ops = {
621 .ndo_start_xmit = rhine_start_tx, 621 .ndo_start_xmit = rhine_start_tx,
622 .ndo_get_stats = rhine_get_stats, 622 .ndo_get_stats = rhine_get_stats,
623 .ndo_set_multicast_list = rhine_set_rx_mode, 623 .ndo_set_multicast_list = rhine_set_rx_mode,
624 .ndo_change_mtu = eth_change_mtu,
624 .ndo_validate_addr = eth_validate_addr, 625 .ndo_validate_addr = eth_validate_addr,
625 .ndo_set_mac_address = eth_mac_addr, 626 .ndo_set_mac_address = eth_mac_addr,
626 .ndo_do_ioctl = netdev_ioctl, 627 .ndo_do_ioctl = netdev_ioctl,
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index ea045151f953..029c1bc7468f 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2970,6 +2970,9 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2970 if (modparam_nohwcrypt) 2970 if (modparam_nohwcrypt)
2971 return -EOPNOTSUPP; 2971 return -EOPNOTSUPP;
2972 2972
2973 if (sc->opmode == NL80211_IFTYPE_AP)
2974 return -EOPNOTSUPP;
2975
2973 switch (key->alg) { 2976 switch (key->alg) {
2974 case ALG_WEP: 2977 case ALG_WEP:
2975 case ALG_TKIP: 2978 case ALG_TKIP:
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 1aeafb511ddd..aad259b4c197 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -478,6 +478,18 @@ void ath9k_ani_reset(struct ath_hw *ah)
478 "Reset ANI state opmode %u\n", ah->opmode); 478 "Reset ANI state opmode %u\n", ah->opmode);
479 ah->stats.ast_ani_reset++; 479 ah->stats.ast_ani_reset++;
480 480
481 if (ah->opmode == NL80211_IFTYPE_AP) {
482 /*
483 * ath9k_hw_ani_control() will only process items set on
484 * ah->ani_function
485 */
486 if (IS_CHAN_2GHZ(chan))
487 ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
488 ATH9K_ANI_FIRSTEP_LEVEL);
489 else
490 ah->ani_function = 0;
491 }
492
481 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0); 493 ath9k_hw_ani_control(ah, ATH9K_ANI_NOISE_IMMUNITY_LEVEL, 0);
482 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0); 494 ath9k_hw_ani_control(ah, ATH9K_ANI_SPUR_IMMUNITY_LEVEL, 0);
483 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0); 495 ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, 0);
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index eef370bd1211..bf3d25ba7be1 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -474,6 +474,21 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
474 return 0; 474 return 0;
475} 475}
476 476
477/*
478 * Some users have reported their EEPROM programmed with
479 * 0x8000 set, this is not a supported regulatory domain
480 * but since we have more than one user with it we need
481 * a solution for them. We default to 0x64, which is the
482 * default Atheros world regulatory domain.
483 */
484static void ath_regd_sanitize(struct ath_regulatory *reg)
485{
486 if (reg->current_rd != COUNTRY_ERD_FLAG)
487 return;
488 printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n");
489 reg->current_rd = 0x64;
490}
491
477int 492int
478ath_regd_init(struct ath_regulatory *reg, 493ath_regd_init(struct ath_regulatory *reg,
479 struct wiphy *wiphy, 494 struct wiphy *wiphy,
@@ -486,6 +501,8 @@ ath_regd_init(struct ath_regulatory *reg,
486 if (!reg) 501 if (!reg)
487 return -EINVAL; 502 return -EINVAL;
488 503
504 ath_regd_sanitize(reg);
505
489 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd); 506 printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
490 507
491 if (!ath_regd_is_eeprom_valid(reg)) { 508 if (!ath_regd_is_eeprom_valid(reg)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6d1519e1f011..355f50ea7fef 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2675,12 +2675,10 @@ static ssize_t show_power_level(struct device *d,
2675 struct device_attribute *attr, char *buf) 2675 struct device_attribute *attr, char *buf)
2676{ 2676{
2677 struct iwl_priv *priv = dev_get_drvdata(d); 2677 struct iwl_priv *priv = dev_get_drvdata(d);
2678 int mode = priv->power_data.user_power_setting;
2679 int level = priv->power_data.power_mode; 2678 int level = priv->power_data.power_mode;
2680 char *p = buf; 2679 char *p = buf;
2681 2680
2682 p += sprintf(p, "INDEX:%d\t", level); 2681 p += sprintf(p, "%d\n", level);
2683 p += sprintf(p, "USER:%d\n", mode);
2684 return p - buf + 1; 2682 return p - buf + 1;
2685} 2683}
2686 2684
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 85ae7a62109c..9bbeec9427f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -872,7 +872,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); 872 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len);
873 873
874 /* Set up entry for this TFD in Tx byte-count array */ 874 /* Set up entry for this TFD in Tx byte-count array */
875 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq, 875 if (info->flags & IEEE80211_TX_CTL_AMPDU)
876 priv->cfg->ops->lib->txq_update_byte_cnt_tbl(priv, txq,
876 le16_to_cpu(tx_cmd->len)); 877 le16_to_cpu(tx_cmd->len));
877 878
878 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys, 879 pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys,
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cb9bd4c8f25e..956798f2c80c 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3643,12 +3643,10 @@ static ssize_t show_power_level(struct device *d,
3643 struct device_attribute *attr, char *buf) 3643 struct device_attribute *attr, char *buf)
3644{ 3644{
3645 struct iwl_priv *priv = dev_get_drvdata(d); 3645 struct iwl_priv *priv = dev_get_drvdata(d);
3646 int mode = priv->power_data.user_power_setting;
3647 int level = priv->power_data.power_mode; 3646 int level = priv->power_data.power_mode;
3648 char *p = buf; 3647 char *p = buf;
3649 3648
3650 p += sprintf(p, "INDEX:%d\t", level); 3649 p += sprintf(p, "%d\n", level);
3651 p += sprintf(p, "USER:%d\n", mode);
3652 return p - buf + 1; 3650 return p - buf + 1;
3653} 3651}
3654 3652
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index aaa20c6885c8..aea5ccf24ccf 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -151,8 +151,8 @@ void iwm_if_free(struct iwm_priv *iwm)
151 return; 151 return;
152 152
153 free_netdev(iwm_to_ndev(iwm)); 153 free_netdev(iwm_to_ndev(iwm));
154 iwm_wdev_free(iwm);
155 iwm_priv_deinit(iwm); 154 iwm_priv_deinit(iwm);
155 iwm_wdev_free(iwm);
156} 156}
157 157
158int iwm_if_add(struct iwm_priv *iwm) 158int iwm_if_add(struct iwm_priv *iwm)
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 01db705a38ec..685098148e10 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -135,8 +135,14 @@ int lbs_update_hw_spec(struct lbs_private *priv)
135 /* Clamp region code to 8-bit since FW spec indicates that it should 135 /* Clamp region code to 8-bit since FW spec indicates that it should
136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware 136 * only ever be 8-bit, even though the field size is 16-bit. Some firmware
137 * returns non-zero high 8 bits here. 137 * returns non-zero high 8 bits here.
138 *
139 * Firmware version 4.0.102 used in CF8381 has region code shifted. We
140 * need to check for this problem and handle it properly.
138 */ 141 */
139 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; 142 if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V4)
143 priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF;
144 else
145 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF;
140 146
141 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { 147 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
142 /* use the region code to search for the index */ 148 /* use the region code to search for the index */
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index 48da157d6cda..72f3479a4d70 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -234,6 +234,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
234/** Mesh enable bit in FW capability */ 234/** Mesh enable bit in FW capability */
235#define MESH_CAPINFO_ENABLE_MASK (1<<16) 235#define MESH_CAPINFO_ENABLE_MASK (1<<16)
236 236
237/** FW definition from Marvell v4 */
238#define MRVL_FW_V4 (0x04)
237/** FW definition from Marvell v5 */ 239/** FW definition from Marvell v5 */
238#define MRVL_FW_V5 (0x05) 240#define MRVL_FW_V5 (0x05)
239/** FW definition from Marvell v10 */ 241/** FW definition from Marvell v10 */
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a111bda392e2..7916ca3f84c8 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -709,7 +709,7 @@ static const struct ieee80211_ops mac80211_hwsim_ops =
709static void mac80211_hwsim_free(void) 709static void mac80211_hwsim_free(void)
710{ 710{
711 struct list_head tmplist, *i, *tmp; 711 struct list_head tmplist, *i, *tmp;
712 struct mac80211_hwsim_data *data; 712 struct mac80211_hwsim_data *data, *tmpdata;
713 713
714 INIT_LIST_HEAD(&tmplist); 714 INIT_LIST_HEAD(&tmplist);
715 715
@@ -718,7 +718,7 @@ static void mac80211_hwsim_free(void)
718 list_move(i, &tmplist); 718 list_move(i, &tmplist);
719 spin_unlock_bh(&hwsim_radio_lock); 719 spin_unlock_bh(&hwsim_radio_lock);
720 720
721 list_for_each_entry(data, &tmplist, list) { 721 list_for_each_entry_safe(data, tmpdata, &tmplist, list) {
722 debugfs_remove(data->debugfs_group); 722 debugfs_remove(data->debugfs_group);
723 debugfs_remove(data->debugfs_ps); 723 debugfs_remove(data->debugfs_ps);
724 debugfs_remove(data->debugfs); 724 debugfs_remove(data->debugfs);
@@ -1167,8 +1167,8 @@ static void __exit exit_mac80211_hwsim(void)
1167{ 1167{
1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n"); 1168 printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n");
1169 1169
1170 unregister_netdev(hwsim_mon);
1171 mac80211_hwsim_free(); 1170 mac80211_hwsim_free();
1171 unregister_netdev(hwsim_mon);
1172} 1172}
1173 1173
1174 1174
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 345593c4accb..a370e510f19f 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -2521,6 +2521,8 @@ static const struct net_device_ops orinoco_netdev_ops = {
2521 .ndo_start_xmit = orinoco_xmit, 2521 .ndo_start_xmit = orinoco_xmit,
2522 .ndo_set_multicast_list = orinoco_set_multicast_list, 2522 .ndo_set_multicast_list = orinoco_set_multicast_list,
2523 .ndo_change_mtu = orinoco_change_mtu, 2523 .ndo_change_mtu = orinoco_change_mtu,
2524 .ndo_set_mac_address = eth_mac_addr,
2525 .ndo_validate_addr = eth_validate_addr,
2524 .ndo_tx_timeout = orinoco_tx_timeout, 2526 .ndo_tx_timeout = orinoco_tx_timeout,
2525 .ndo_get_stats = orinoco_get_stats, 2527 .ndo_get_stats = orinoco_get_stats,
2526}; 2528};
@@ -2555,7 +2557,6 @@ struct net_device
2555 priv->wireless_data.spy_data = &priv->spy_data; 2557 priv->wireless_data.spy_data = &priv->spy_data;
2556 dev->wireless_data = &priv->wireless_data; 2558 dev->wireless_data = &priv->wireless_data;
2557#endif 2559#endif
2558 /* we use the default eth_mac_addr for setting the MAC addr */
2559 2560
2560 /* Reserve space in skb for the SNAP header */ 2561 /* Reserve space in skb for the SNAP header */
2561 dev->hard_header_len += ENCAPS_OVERHEAD; 2562 dev->hard_header_len += ENCAPS_OVERHEAD;
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 83116baeb110..72c7dbd39d0a 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -635,7 +635,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
635 635
636 hw = p54_init_common(sizeof(*priv)); 636 hw = p54_init_common(sizeof(*priv));
637 if (!hw) { 637 if (!hw) {
638 dev_err(&priv->spi->dev, "could not alloc ieee80211_hw"); 638 dev_err(&spi->dev, "could not alloc ieee80211_hw");
639 return -ENOMEM; 639 return -ENOMEM;
640 } 640 }
641 641
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 66daf68ff0ee..ce75426764a1 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1550,7 +1550,9 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1550 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg); 1551 rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
1552 1552
1553 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0)) { 1553 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) ||
1554 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
1555
1554 ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); 1556 ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
1555 return -ENODEV; 1557 return -ENODEV;
1556 } 1558 }
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c
index b44253592243..cf9f899fe0e6 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_leds.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c
@@ -208,11 +208,12 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
208{ 208{
209 struct rtl8187_priv *priv = dev->priv; 209 struct rtl8187_priv *priv = dev->priv;
210 210
211 rtl8187_unregister_led(&priv->led_tx);
212 /* turn the LED off before exiting */ 211 /* turn the LED off before exiting */
213 queue_delayed_work(dev->workqueue, &priv->led_off, 0); 212 queue_delayed_work(dev->workqueue, &priv->led_off, 0);
214 cancel_delayed_work_sync(&priv->led_off); 213 cancel_delayed_work_sync(&priv->led_off);
214 cancel_delayed_work_sync(&priv->led_on);
215 rtl8187_unregister_led(&priv->led_rx); 215 rtl8187_unregister_led(&priv->led_rx);
216 rtl8187_unregister_led(&priv->led_tx);
216} 217}
217#endif /* def CONFIG_RTL8187_LED */ 218#endif /* def CONFIG_RTL8187_LED */
218 219
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index aee967d7f760..bacaa536fd51 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -9,6 +9,10 @@
9 * out of the OpenFirmware device tree and using it to populate an mii_bus. 9 * out of the OpenFirmware device tree and using it to populate an mii_bus.
10 */ 10 */
11 11
12#include <linux/kernel.h>
13#include <linux/device.h>
14#include <linux/netdevice.h>
15#include <linux/err.h>
12#include <linux/phy.h> 16#include <linux/phy.h>
13#include <linux/of.h> 17#include <linux/of.h>
14#include <linux/of_mdio.h> 18#include <linux/of_mdio.h>
@@ -137,3 +141,41 @@ struct phy_device *of_phy_connect(struct net_device *dev,
137 return phy_connect_direct(dev, phy, hndlr, flags, iface) ? NULL : phy; 141 return phy_connect_direct(dev, phy, hndlr, flags, iface) ? NULL : phy;
138} 142}
139EXPORT_SYMBOL(of_phy_connect); 143EXPORT_SYMBOL(of_phy_connect);
144
145/**
146 * of_phy_connect_fixed_link - Parse fixed-link property and return a dummy phy
147 * @dev: pointer to net_device claiming the phy
148 * @hndlr: Link state callback for the network device
149 * @iface: PHY data interface type
150 *
151 * This function is a temporary stop-gap and will be removed soon. It is
152 * only to support the fs_enet, ucc_geth and gianfar Ethernet drivers. Do
153 * not call this function from new drivers.
154 */
155struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
156 void (*hndlr)(struct net_device *),
157 phy_interface_t iface)
158{
159 struct device_node *net_np;
160 char bus_id[MII_BUS_ID_SIZE + 3];
161 struct phy_device *phy;
162 const u32 *phy_id;
163 int sz;
164
165 if (!dev->dev.parent)
166 return NULL;
167
168 net_np = dev_archdata_get_node(&dev->dev.parent->archdata);
169 if (!net_np)
170 return NULL;
171
172 phy_id = of_get_property(net_np, "fixed-link", &sz);
173 if (!phy_id || sz < sizeof(*phy_id))
174 return NULL;
175
176 sprintf(bus_id, PHY_ID_FMT, "0", phy_id[0]);
177
178 phy = phy_connect(dev, bus_id, hndlr, 0, iface);
179 return IS_ERR(phy) ? NULL : phy;
180}
181EXPORT_SYMBOL(of_phy_connect_fixed_link);
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index a5b9f6ae507b..d703e73fffa7 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -32,7 +32,6 @@
32#include <linux/pci_hotplug.h> 32#include <linux/pci_hotplug.h>
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/smp_lock.h>
36#include <asm/atomic.h> 35#include <asm/atomic.h>
37#include <linux/delay.h> 36#include <linux/delay.h>
38#include <linux/kthread.h> 37#include <linux/kthread.h>
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index 2fa47af992a8..0ff689afa757 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -34,7 +34,6 @@
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/wait.h> 36#include <linux/wait.h>
37#include <linux/smp_lock.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
39#include <linux/pci_hotplug.h> 38#include <linux/pci_hotplug.h>
40#include <linux/kthread.h> 39#include <linux/kthread.h>
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index 8450f4a6568a..e6089bdb6e5b 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -33,6 +33,7 @@
33#include <linux/workqueue.h> 33#include <linux/workqueue.h>
34#include <linux/pci.h> 34#include <linux/pci.h>
35#include <linux/pci_hotplug.h> 35#include <linux/pci_hotplug.h>
36#include <linux/smp_lock.h>
36#include <linux/debugfs.h> 37#include <linux/debugfs.h>
37#include "cpqphp.h" 38#include "cpqphp.h"
38 39
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index ff4034502d24..8aab8edf123e 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -30,7 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/smp_lock.h>
34#include <linux/pci.h> 33#include <linux/pci.h>
35#include <linux/workqueue.h> 34#include <linux/workqueue.h>
36#include "../pci.h" 35#include "../pci.h"
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index ec22284eed30..e1c1ec540893 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -9,7 +9,6 @@
9 9
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/smp_lock.h>
13#include <linux/syscalls.h> 12#include <linux/syscalls.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
15#include "pci.h" 14#include "pci.h"
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index be2fd6f91639..fb45f5ee8df1 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -973,7 +973,7 @@ static int acer_rfkill_set(void *data, bool blocked)
973{ 973{
974 acpi_status status; 974 acpi_status status;
975 u32 cap = (unsigned long)data; 975 u32 cap = (unsigned long)data;
976 status = set_u32(!!blocked, cap); 976 status = set_u32(!blocked, cap);
977 if (ACPI_FAILURE(status)) 977 if (ACPI_FAILURE(status))
978 return -ENODEV; 978 return -ENODEV;
979 return 0; 979 return 0;
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 7eda34838bfe..bdbc4f73fcdc 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -43,6 +43,13 @@ config BATTERY_DS2760
43 help 43 help
44 Say Y here to enable support for batteries with ds2760 chip. 44 Say Y here to enable support for batteries with ds2760 chip.
45 45
46config BATTERY_DS2782
47 tristate "DS2782 standalone gas-gauge"
48 depends on I2C
49 help
50 Say Y here to enable support for the DS2782 standalone battery
51 gas-gauge.
52
46config BATTERY_PMU 53config BATTERY_PMU
47 tristate "Apple PMU battery" 54 tristate "Apple PMU battery"
48 depends on PPC32 && ADB_PMU 55 depends on PPC32 && ADB_PMU
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index daf3179689aa..380d17c9ae29 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_APM_POWER) += apm_power.o
19obj-$(CONFIG_WM8350_POWER) += wm8350_power.o 19obj-$(CONFIG_WM8350_POWER) += wm8350_power.o
20 20
21obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o 21obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
22obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o
22obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o 23obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
23obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o 24obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
24obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o 25obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
new file mode 100644
index 000000000000..da14f374cb60
--- /dev/null
+++ b/drivers/power/ds2782_battery.c
@@ -0,0 +1,330 @@
1/*
2 * I2C client/driver for the Maxim/Dallas DS2782 Stand-Alone Fuel Gauge IC
3 *
4 * Copyright (C) 2009 Bluewater Systems Ltd
5 *
6 * Author: Ryan Mallon <ryan@bluewatersys.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/types.h>
17#include <linux/errno.h>
18#include <linux/swab.h>
19#include <linux/i2c.h>
20#include <linux/idr.h>
21#include <linux/power_supply.h>
22
23#define DS2782_REG_RARC 0x06 /* Remaining active relative capacity */
24
25#define DS2782_REG_VOLT_MSB 0x0c
26#define DS2782_REG_TEMP_MSB 0x0a
27#define DS2782_REG_CURRENT_MSB 0x0e
28
29/* EEPROM Block */
30#define DS2782_REG_RSNSP 0x69 /* Sense resistor value */
31
32/* Current unit measurement in uA for a 1 milli-ohm sense resistor */
33#define DS2782_CURRENT_UNITS 1563
34
35#define to_ds2782_info(x) container_of(x, struct ds2782_info, battery)
36
37struct ds2782_info {
38 struct i2c_client *client;
39 struct power_supply battery;
40 int id;
41};
42
43static DEFINE_IDR(battery_id);
44static DEFINE_MUTEX(battery_lock);
45
46static inline int ds2782_read_reg(struct ds2782_info *info, int reg, u8 *val)
47{
48 int ret;
49
50 ret = i2c_smbus_read_byte_data(info->client, reg);
51 if (ret < 0) {
52 dev_err(&info->client->dev, "register read failed\n");
53 return ret;
54 }
55
56 *val = ret;
57 return 0;
58}
59
60static inline int ds2782_read_reg16(struct ds2782_info *info, int reg_msb,
61 s16 *val)
62{
63 int ret;
64
65 ret = swab16(i2c_smbus_read_word_data(info->client, reg_msb));
66 if (ret < 0) {
67 dev_err(&info->client->dev, "register read failed\n");
68 return ret;
69 }
70
71 *val = ret;
72 return 0;
73}
74
75static int ds2782_get_temp(struct ds2782_info *info, int *temp)
76{
77 s16 raw;
78 int err;
79
80 /*
81 * Temperature is measured in units of 0.125 degrees celcius, the
82 * power_supply class measures temperature in tenths of degrees
83 * celsius. The temperature value is stored as a 10 bit number, plus
84 * sign in the upper bits of a 16 bit register.
85 */
86 err = ds2782_read_reg16(info, DS2782_REG_TEMP_MSB, &raw);
87 if (err)
88 return err;
89 *temp = ((raw / 32) * 125) / 100;
90 return 0;
91}
92
93static int ds2782_get_current(struct ds2782_info *info, int *current_uA)
94{
95 int sense_res;
96 int err;
97 u8 sense_res_raw;
98 s16 raw;
99
100 /*
101 * The units of measurement for current are dependent on the value of
102 * the sense resistor.
103 */
104 err = ds2782_read_reg(info, DS2782_REG_RSNSP, &sense_res_raw);
105 if (err)
106 return err;
107 if (sense_res_raw == 0) {
108 dev_err(&info->client->dev, "sense resistor value is 0\n");
109 return -ENXIO;
110 }
111 sense_res = 1000 / sense_res_raw;
112
113 dev_dbg(&info->client->dev, "sense resistor = %d milli-ohms\n",
114 sense_res);
115 err = ds2782_read_reg16(info, DS2782_REG_CURRENT_MSB, &raw);
116 if (err)
117 return err;
118 *current_uA = raw * (DS2782_CURRENT_UNITS / sense_res);
119 return 0;
120}
121
122static int ds2782_get_voltage(struct ds2782_info *info, int *voltage_uA)
123{
124 s16 raw;
125 int err;
126
127 /*
128 * Voltage is measured in units of 4.88mV. The voltage is stored as
129 * a 10-bit number plus sign, in the upper bits of a 16-bit register
130 */
131 err = ds2782_read_reg16(info, DS2782_REG_VOLT_MSB, &raw);
132 if (err)
133 return err;
134 *voltage_uA = (raw / 32) * 4800;
135 return 0;
136}
137
138static int ds2782_get_capacity(struct ds2782_info *info, int *capacity)
139{
140 int err;
141 u8 raw;
142
143 err = ds2782_read_reg(info, DS2782_REG_RARC, &raw);
144 if (err)
145 return err;
146 *capacity = raw;
147 return raw;
148}
149
150static int ds2782_get_status(struct ds2782_info *info, int *status)
151{
152 int err;
153 int current_uA;
154 int capacity;
155
156 err = ds2782_get_current(info, &current_uA);
157 if (err)
158 return err;
159
160 err = ds2782_get_capacity(info, &capacity);
161 if (err)
162 return err;
163
164 if (capacity == 100)
165 *status = POWER_SUPPLY_STATUS_FULL;
166 else if (current_uA == 0)
167 *status = POWER_SUPPLY_STATUS_NOT_CHARGING;
168 else if (current_uA < 0)
169 *status = POWER_SUPPLY_STATUS_DISCHARGING;
170 else
171 *status = POWER_SUPPLY_STATUS_CHARGING;
172
173 return 0;
174}
175
176static int ds2782_battery_get_property(struct power_supply *psy,
177 enum power_supply_property prop,
178 union power_supply_propval *val)
179{
180 struct ds2782_info *info = to_ds2782_info(psy);
181 int ret;
182
183 switch (prop) {
184 case POWER_SUPPLY_PROP_STATUS:
185 ret = ds2782_get_status(info, &val->intval);
186 break;
187
188 case POWER_SUPPLY_PROP_CAPACITY:
189 ret = ds2782_get_capacity(info, &val->intval);
190 break;
191
192 case POWER_SUPPLY_PROP_VOLTAGE_NOW:
193 ret = ds2782_get_voltage(info, &val->intval);
194 break;
195
196 case POWER_SUPPLY_PROP_CURRENT_NOW:
197 ret = ds2782_get_current(info, &val->intval);
198 break;
199
200 case POWER_SUPPLY_PROP_TEMP:
201 ret = ds2782_get_temp(info, &val->intval);
202 break;
203
204 default:
205 ret = -EINVAL;
206 }
207
208 return ret;
209}
210
211static enum power_supply_property ds2782_battery_props[] = {
212 POWER_SUPPLY_PROP_STATUS,
213 POWER_SUPPLY_PROP_CAPACITY,
214 POWER_SUPPLY_PROP_VOLTAGE_NOW,
215 POWER_SUPPLY_PROP_CURRENT_NOW,
216 POWER_SUPPLY_PROP_TEMP,
217};
218
219static void ds2782_power_supply_init(struct power_supply *battery)
220{
221 battery->type = POWER_SUPPLY_TYPE_BATTERY;
222 battery->properties = ds2782_battery_props;
223 battery->num_properties = ARRAY_SIZE(ds2782_battery_props);
224 battery->get_property = ds2782_battery_get_property;
225 battery->external_power_changed = NULL;
226}
227
228static int ds2782_battery_remove(struct i2c_client *client)
229{
230 struct ds2782_info *info = i2c_get_clientdata(client);
231
232 power_supply_unregister(&info->battery);
233 kfree(info->battery.name);
234
235 mutex_lock(&battery_lock);
236 idr_remove(&battery_id, info->id);
237 mutex_unlock(&battery_lock);
238
239 i2c_set_clientdata(client, info);
240
241 kfree(info);
242 return 0;
243}
244
245static int ds2782_battery_probe(struct i2c_client *client,
246 const struct i2c_device_id *id)
247{
248 struct ds2782_info *info;
249 int ret;
250 int num;
251
252 /* Get an ID for this battery */
253 ret = idr_pre_get(&battery_id, GFP_KERNEL);
254 if (ret == 0) {
255 ret = -ENOMEM;
256 goto fail_id;
257 }
258
259 mutex_lock(&battery_lock);
260 ret = idr_get_new(&battery_id, client, &num);
261 mutex_unlock(&battery_lock);
262 if (ret < 0)
263 goto fail_id;
264
265 info = kzalloc(sizeof(*info), GFP_KERNEL);
266 if (!info) {
267 ret = -ENOMEM;
268 goto fail_info;
269 }
270
271 info->battery.name = kasprintf(GFP_KERNEL, "ds2782-%d", num);
272 if (!info->battery.name) {
273 ret = -ENOMEM;
274 goto fail_name;
275 }
276
277 i2c_set_clientdata(client, info);
278 info->client = client;
279 ds2782_power_supply_init(&info->battery);
280
281 ret = power_supply_register(&client->dev, &info->battery);
282 if (ret) {
283 dev_err(&client->dev, "failed to register battery\n");
284 goto fail_register;
285 }
286
287 return 0;
288
289fail_register:
290 kfree(info->battery.name);
291fail_name:
292 i2c_set_clientdata(client, info);
293 kfree(info);
294fail_info:
295 mutex_lock(&battery_lock);
296 idr_remove(&battery_id, num);
297 mutex_unlock(&battery_lock);
298fail_id:
299 return ret;
300}
301
302static const struct i2c_device_id ds2782_id[] = {
303 {"ds2782", 0},
304 {},
305};
306
307static struct i2c_driver ds2782_battery_driver = {
308 .driver = {
309 .name = "ds2782-battery",
310 },
311 .probe = ds2782_battery_probe,
312 .remove = ds2782_battery_remove,
313 .id_table = ds2782_id,
314};
315
316static int __init ds2782_init(void)
317{
318 return i2c_add_driver(&ds2782_battery_driver);
319}
320module_init(ds2782_init);
321
322static void __exit ds2782_exit(void)
323{
324 i2c_del_driver(&ds2782_battery_driver);
325}
326module_exit(ds2782_exit);
327
328MODULE_AUTHOR("Ryan Mallon <ryan@bluewatersys.com>");
329MODULE_DESCRIPTION("Maxim/Dallas DS2782 Stand-Alone Fuel Gauage IC driver");
330MODULE_LICENSE("GPL");
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
index 5fbca2681baa..58e419299cd6 100644
--- a/drivers/power/olpc_battery.c
+++ b/drivers/power/olpc_battery.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/kernel.h>
11#include <linux/module.h> 12#include <linux/module.h>
12#include <linux/err.h> 13#include <linux/err.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
@@ -35,6 +36,7 @@
35#define BAT_STAT_AC 0x10 36#define BAT_STAT_AC 0x10
36#define BAT_STAT_CHARGING 0x20 37#define BAT_STAT_CHARGING 0x20
37#define BAT_STAT_DISCHARGING 0x40 38#define BAT_STAT_DISCHARGING 0x40
39#define BAT_STAT_TRICKLE 0x80
38 40
39#define BAT_ERR_INFOFAIL 0x02 41#define BAT_ERR_INFOFAIL 0x02
40#define BAT_ERR_OVERVOLTAGE 0x04 42#define BAT_ERR_OVERVOLTAGE 0x04
@@ -89,7 +91,7 @@ static char bat_serial[17]; /* Ick */
89static int olpc_bat_get_status(union power_supply_propval *val, uint8_t ec_byte) 91static int olpc_bat_get_status(union power_supply_propval *val, uint8_t ec_byte)
90{ 92{
91 if (olpc_platform_info.ecver > 0x44) { 93 if (olpc_platform_info.ecver > 0x44) {
92 if (ec_byte & BAT_STAT_CHARGING) 94 if (ec_byte & (BAT_STAT_CHARGING | BAT_STAT_TRICKLE))
93 val->intval = POWER_SUPPLY_STATUS_CHARGING; 95 val->intval = POWER_SUPPLY_STATUS_CHARGING;
94 else if (ec_byte & BAT_STAT_DISCHARGING) 96 else if (ec_byte & BAT_STAT_DISCHARGING)
95 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; 97 val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
@@ -219,7 +221,8 @@ static int olpc_bat_get_property(struct power_supply *psy,
219 It doesn't matter though -- the EC will return the last-known 221 It doesn't matter though -- the EC will return the last-known
220 information, and it's as if we just ran that _little_ bit faster 222 information, and it's as if we just ran that _little_ bit faster
221 and managed to read it out before the battery went away. */ 223 and managed to read it out before the battery went away. */
222 if (!(ec_byte & BAT_STAT_PRESENT) && psp != POWER_SUPPLY_PROP_PRESENT) 224 if (!(ec_byte & (BAT_STAT_PRESENT | BAT_STAT_TRICKLE)) &&
225 psp != POWER_SUPPLY_PROP_PRESENT)
223 return -ENODEV; 226 return -ENODEV;
224 227
225 switch (psp) { 228 switch (psp) {
@@ -229,7 +232,8 @@ static int olpc_bat_get_property(struct power_supply *psy,
229 return ret; 232 return ret;
230 break; 233 break;
231 case POWER_SUPPLY_PROP_PRESENT: 234 case POWER_SUPPLY_PROP_PRESENT:
232 val->intval = !!(ec_byte & BAT_STAT_PRESENT); 235 val->intval = !!(ec_byte & (BAT_STAT_PRESENT |
236 BAT_STAT_TRICKLE));
233 break; 237 break;
234 238
235 case POWER_SUPPLY_PROP_HEALTH: 239 case POWER_SUPPLY_PROP_HEALTH:
@@ -334,21 +338,21 @@ static ssize_t olpc_bat_eeprom_read(struct kobject *kobj,
334 struct bin_attribute *attr, char *buf, loff_t off, size_t count) 338 struct bin_attribute *attr, char *buf, loff_t off, size_t count)
335{ 339{
336 uint8_t ec_byte; 340 uint8_t ec_byte;
337 int ret, end; 341 int ret;
342 int i;
338 343
339 if (off >= EEPROM_SIZE) 344 if (off >= EEPROM_SIZE)
340 return 0; 345 return 0;
341 if (off + count > EEPROM_SIZE) 346 if (off + count > EEPROM_SIZE)
342 count = EEPROM_SIZE - off; 347 count = EEPROM_SIZE - off;
343 348
344 end = EEPROM_START + off + count; 349 for (i = 0; i < count; i++) {
345 for (ec_byte = EEPROM_START + off; ec_byte < end; ec_byte++) { 350 ec_byte = EEPROM_START + off + i;
346 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, 351 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &buf[i], 1);
347 &buf[ec_byte - EEPROM_START], 1);
348 if (ret) { 352 if (ret) {
349 printk(KERN_ERR "olpc-battery: EC command " 353 pr_err("olpc-battery: "
350 "EC_BAT_EEPROM @ 0x%x failed -" 354 "EC_BAT_EEPROM cmd @ 0x%x failed - %d!\n",
351 " %d!\n", ec_byte, ret); 355 ec_byte, ret);
352 return -EIO; 356 return -EIO;
353 } 357 }
354 } 358 }
diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c
index 8bde92126d34..b787335a8419 100644
--- a/drivers/power/wm97xx_battery.c
+++ b/drivers/power/wm97xx_battery.c
@@ -33,14 +33,14 @@ static enum power_supply_property *prop;
33 33
34static unsigned long wm97xx_read_bat(struct power_supply *bat_ps) 34static unsigned long wm97xx_read_bat(struct power_supply *bat_ps)
35{ 35{
36 return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data, 36 return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
37 pdata->batt_aux) * pdata->batt_mult / 37 pdata->batt_aux) * pdata->batt_mult /
38 pdata->batt_div; 38 pdata->batt_div;
39} 39}
40 40
41static unsigned long wm97xx_read_temp(struct power_supply *bat_ps) 41static unsigned long wm97xx_read_temp(struct power_supply *bat_ps)
42{ 42{
43 return wm97xx_read_aux_adc(bat_ps->dev->parent->driver_data, 43 return wm97xx_read_aux_adc(dev_get_drvdata(bat_ps->dev->parent),
44 pdata->temp_aux) * pdata->temp_mult / 44 pdata->temp_aux) * pdata->temp_mult /
45 pdata->temp_div; 45 pdata->temp_div;
46} 46}
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 23e10b6263d6..f7a4701bf863 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1174,23 +1174,34 @@ static struct platform_driver cmos_platform_driver = {
1174 } 1174 }
1175}; 1175};
1176 1176
1177#ifdef CONFIG_PNP
1178static bool pnp_driver_registered;
1179#endif
1180static bool platform_driver_registered;
1181
1177static int __init cmos_init(void) 1182static int __init cmos_init(void)
1178{ 1183{
1179 int retval = 0; 1184 int retval = 0;
1180 1185
1181#ifdef CONFIG_PNP 1186#ifdef CONFIG_PNP
1182 pnp_register_driver(&cmos_pnp_driver); 1187 retval = pnp_register_driver(&cmos_pnp_driver);
1188 if (retval == 0)
1189 pnp_driver_registered = true;
1183#endif 1190#endif
1184 1191
1185 if (!cmos_rtc.dev) 1192 if (!cmos_rtc.dev) {
1186 retval = platform_driver_probe(&cmos_platform_driver, 1193 retval = platform_driver_probe(&cmos_platform_driver,
1187 cmos_platform_probe); 1194 cmos_platform_probe);
1195 if (retval == 0)
1196 platform_driver_registered = true;
1197 }
1188 1198
1189 if (retval == 0) 1199 if (retval == 0)
1190 return 0; 1200 return 0;
1191 1201
1192#ifdef CONFIG_PNP 1202#ifdef CONFIG_PNP
1193 pnp_unregister_driver(&cmos_pnp_driver); 1203 if (pnp_driver_registered)
1204 pnp_unregister_driver(&cmos_pnp_driver);
1194#endif 1205#endif
1195 return retval; 1206 return retval;
1196} 1207}
@@ -1199,9 +1210,11 @@ module_init(cmos_init);
1199static void __exit cmos_exit(void) 1210static void __exit cmos_exit(void)
1200{ 1211{
1201#ifdef CONFIG_PNP 1212#ifdef CONFIG_PNP
1202 pnp_unregister_driver(&cmos_pnp_driver); 1213 if (pnp_driver_registered)
1214 pnp_unregister_driver(&cmos_pnp_driver);
1203#endif 1215#endif
1204 platform_driver_unregister(&cmos_platform_driver); 1216 if (platform_driver_registered)
1217 platform_driver_unregister(&cmos_platform_driver);
1205} 1218}
1206module_exit(cmos_exit); 1219module_exit(cmos_exit);
1207 1220
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 4ce3f72ee1c1..df918ef27965 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -16,6 +16,7 @@
16#include <linux/major.h> 16#include <linux/major.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/blkpg.h> 18#include <linux/blkpg.h>
19#include <linux/smp_lock.h>
19 20
20#include <asm/ccwdev.h> 21#include <asm/ccwdev.h>
21#include <asm/cmb.h> 22#include <asm/cmb.h>
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 727a809636d8..ed3dcdea7fe1 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1145,12 +1145,17 @@ ap_config_timeout(unsigned long ptr)
1145 */ 1145 */
1146static inline void ap_schedule_poll_timer(void) 1146static inline void ap_schedule_poll_timer(void)
1147{ 1147{
1148 ktime_t hr_time;
1148 if (ap_using_interrupts() || ap_suspend_flag) 1149 if (ap_using_interrupts() || ap_suspend_flag)
1149 return; 1150 return;
1150 if (hrtimer_is_queued(&ap_poll_timer)) 1151 if (hrtimer_is_queued(&ap_poll_timer))
1151 return; 1152 return;
1152 hrtimer_start(&ap_poll_timer, ktime_set(0, poll_timeout), 1153 if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) {
1153 HRTIMER_MODE_ABS); 1154 hr_time = ktime_set(0, poll_timeout);
1155 hrtimer_forward_now(&ap_poll_timer, hr_time);
1156 hrtimer_restart(&ap_poll_timer);
1157 }
1158 return;
1154} 1159}
1155 1160
1156/** 1161/**
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 650bcef08f2a..cd78c501803a 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -9,7 +9,6 @@
9 9
10#include <linux/moduleparam.h> 10#include <linux/moduleparam.h>
11#include <linux/vmalloc.h> 11#include <linux/vmalloc.h>
12#include <linux/smp_lock.h>
13#include <linux/list.h> 12#include <linux/list.h>
14 13
15#include <scsi/scsi_tcq.h> 14#include <scsi/scsi_tcq.h>
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 037c1e0b7c4c..cdd552d33a78 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -459,7 +459,7 @@ config SERIAL_SAMSUNG_UARTS
459 int 459 int
460 depends on ARM && PLAT_S3C 460 depends on ARM && PLAT_S3C
461 default 2 if ARCH_S3C2400 461 default 2 if ARCH_S3C2400
462 default 4 if ARCH_S3C64XX || CPU_S3C2443 462 default 4 if ARCH_S5PC1XX || ARCH_S3C64XX || CPU_S3C2443
463 default 3 463 default 3
464 help 464 help
465 Select the number of available UART ports for the Samsung S3C 465 Select the number of available UART ports for the Samsung S3C
@@ -533,6 +533,13 @@ config SERIAL_S3C6400
533 Serial port support for the Samsung S3C6400 and S3C6410 533 Serial port support for the Samsung S3C6400 and S3C6410
534 SoCs 534 SoCs
535 535
536config SERIAL_S5PC100
537 tristate "Samsung S5PC100 Serial port support"
538 depends on SERIAL_SAMSUNG && CPU_S5PC100
539 default y
540 help
541 Serial port support for the Samsung S5PC100 SoCs
542
536config SERIAL_MAX3100 543config SERIAL_MAX3100
537 tristate "MAX3100 support" 544 tristate "MAX3100 support"
538 depends on SPI 545 depends on SPI
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index d5a29981c6c4..97f6fcc8b432 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o
43obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o 43obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
44obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o 44obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
45obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o 45obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
46obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o
46obj-$(CONFIG_SERIAL_MAX3100) += max3100.o 47obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
47obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o 48obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
48obj-$(CONFIG_SERIAL_MUX) += mux.o 49obj-$(CONFIG_SERIAL_MUX) += mux.o
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 338b15c0a548..607d43a31048 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -1551,6 +1551,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
1551 if (ret) 1551 if (ret)
1552 goto err_add_port; 1552 goto err_add_port;
1553 1553
1554#ifdef CONFIG_SERIAL_ATMEL_CONSOLE
1554 if (atmel_is_console_port(&port->uart) 1555 if (atmel_is_console_port(&port->uart)
1555 && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) { 1556 && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) {
1556 /* 1557 /*
@@ -1559,6 +1560,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
1559 */ 1560 */
1560 clk_disable(port->clk); 1561 clk_disable(port->clk);
1561 } 1562 }
1563#endif
1562 1564
1563 device_init_wakeup(&pdev->dev, 1); 1565 device_init_wakeup(&pdev->dev, 1);
1564 platform_set_drvdata(pdev, port); 1566 platform_set_drvdata(pdev, port);
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 34b4ae0fe760..c108b1a0ce98 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -236,7 +236,6 @@ static int sport_startup(struct uart_port *port)
236 int retval; 236 int retval;
237 237
238 pr_debug("%s enter\n", __func__); 238 pr_debug("%s enter\n", __func__);
239 memset(buffer, 20, '\0');
240 snprintf(buffer, 20, "%s rx", up->name); 239 snprintf(buffer, 20, "%s rx", up->name);
241 retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up); 240 retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up);
242 if (retval) { 241 if (retval) {
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 141c0a3333ad..a9802e76b5fa 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -132,7 +132,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
132 memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + 132 memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
133 L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); 133 L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
134 if (is_con) { 134 if (is_con) {
135 mem_addr = alloc_bootmem(memsz); 135 mem_addr = kzalloc(memsz, GFP_NOWAIT);
136 dma_addr = virt_to_bus(mem_addr); 136 dma_addr = virt_to_bus(mem_addr);
137 } 137 }
138 else 138 else
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 5d7b58f1fe42..7485afd0df4c 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -67,21 +67,8 @@
67#define UBIR 0xa4 /* BRM Incremental Register */ 67#define UBIR 0xa4 /* BRM Incremental Register */
68#define UBMR 0xa8 /* BRM Modulator Register */ 68#define UBMR 0xa8 /* BRM Modulator Register */
69#define UBRC 0xac /* Baud Rate Count Register */ 69#define UBRC 0xac /* Baud Rate Count Register */
70#if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2 70#define MX2_ONEMS 0xb0 /* One Millisecond register */
71#define ONEMS 0xb0 /* One Millisecond register */ 71#define UTS (cpu_is_mx1() ? 0xd0 : 0xb4) /* UART Test Register */
72#define UTS 0xb4 /* UART Test Register */
73#endif
74#ifdef CONFIG_ARCH_MX1
75#define BIPR1 0xb0 /* Incremental Preset Register 1 */
76#define BIPR2 0xb4 /* Incremental Preset Register 2 */
77#define BIPR3 0xb8 /* Incremental Preset Register 3 */
78#define BIPR4 0xbc /* Incremental Preset Register 4 */
79#define BMPR1 0xc0 /* BRM Modulator Register 1 */
80#define BMPR2 0xc4 /* BRM Modulator Register 2 */
81#define BMPR3 0xc8 /* BRM Modulator Register 3 */
82#define BMPR4 0xcc /* BRM Modulator Register 4 */
83#define UTS 0xd0 /* UART Test Register */
84#endif
85 72
86/* UART Control Register Bit Fields.*/ 73/* UART Control Register Bit Fields.*/
87#define URXD_CHARRDY (1<<15) 74#define URXD_CHARRDY (1<<15)
@@ -101,12 +88,7 @@
101#define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */ 88#define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */
102#define UCR1_SNDBRK (1<<4) /* Send break */ 89#define UCR1_SNDBRK (1<<4) /* Send break */
103#define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */ 90#define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */
104#ifdef CONFIG_ARCH_MX1 91#define MX1_UCR1_UARTCLKEN (1<<2) /* UART clock enabled, mx1 only */
105#define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */
106#endif
107#if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2
108#define UCR1_UARTCLKEN (0) /* not present on mx2/mx3 */
109#endif
110#define UCR1_DOZE (1<<1) /* Doze */ 92#define UCR1_DOZE (1<<1) /* Doze */
111#define UCR1_UARTEN (1<<0) /* UART enabled */ 93#define UCR1_UARTEN (1<<0) /* UART enabled */
112#define UCR2_ESCI (1<<15) /* Escape seq interrupt enable */ 94#define UCR2_ESCI (1<<15) /* Escape seq interrupt enable */
@@ -132,13 +114,9 @@
132#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ 114#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */
133#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ 115#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */
134#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ 116#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
135#ifdef CONFIG_ARCH_MX1 117#define MX1_UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */
136#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */ 118#define MX1_UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */
137#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */ 119#define MX2_UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */
138#endif
139#if defined CONFIG_ARCH_MX2 || defined CONFIG_ARCH_MX3
140#define UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */
141#endif
142#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */ 120#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
143#define UCR3_BPEN (1<<0) /* Preset registers enable */ 121#define UCR3_BPEN (1<<0) /* Preset registers enable */
144#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */ 122#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
@@ -186,12 +164,10 @@
186#define UTS_SOFTRST (1<<0) /* Software reset */ 164#define UTS_SOFTRST (1<<0) /* Software reset */
187 165
188/* We've been assigned a range on the "Low-density serial ports" major */ 166/* We've been assigned a range on the "Low-density serial ports" major */
189#ifdef CONFIG_ARCH_MXC
190#define SERIAL_IMX_MAJOR 207 167#define SERIAL_IMX_MAJOR 207
191#define MINOR_START 16 168#define MINOR_START 16
192#define DEV_NAME "ttymxc" 169#define DEV_NAME "ttymxc"
193#define MAX_INTERNAL_IRQ MXC_INTERNAL_IRQS 170#define MAX_INTERNAL_IRQ MXC_INTERNAL_IRQS
194#endif
195 171
196/* 172/*
197 * This determines how often we check the modem status signals 173 * This determines how often we check the modem status signals
@@ -706,11 +682,11 @@ static int imx_startup(struct uart_port *port)
706 } 682 }
707 } 683 }
708 684
709#if defined CONFIG_ARCH_MX2 || defined CONFIG_ARCH_MX3 685 if (!cpu_is_mx1()) {
710 temp = readl(sport->port.membase + UCR3); 686 temp = readl(sport->port.membase + UCR3);
711 temp |= UCR3_RXDMUXSEL; 687 temp |= MX2_UCR3_RXDMUXSEL;
712 writel(temp, sport->port.membase + UCR3); 688 writel(temp, sport->port.membase + UCR3);
713#endif 689 }
714 690
715 if (USE_IRDA(sport)) { 691 if (USE_IRDA(sport)) {
716 temp = readl(sport->port.membase + UCR4); 692 temp = readl(sport->port.membase + UCR4);
@@ -942,9 +918,9 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
942 writel(num, sport->port.membase + UBIR); 918 writel(num, sport->port.membase + UBIR);
943 writel(denom, sport->port.membase + UBMR); 919 writel(denom, sport->port.membase + UBMR);
944 920
945#ifdef ONEMS 921 if (!cpu_is_mx1())
946 writel(sport->port.uartclk / div / 1000, sport->port.membase + ONEMS); 922 writel(sport->port.uartclk / div / 1000,
947#endif 923 sport->port.membase + MX2_ONEMS);
948 924
949 writel(old_ucr1, sport->port.membase + UCR1); 925 writel(old_ucr1, sport->port.membase + UCR1);
950 926
@@ -1074,17 +1050,20 @@ static void
1074imx_console_write(struct console *co, const char *s, unsigned int count) 1050imx_console_write(struct console *co, const char *s, unsigned int count)
1075{ 1051{
1076 struct imx_port *sport = imx_ports[co->index]; 1052 struct imx_port *sport = imx_ports[co->index];
1077 unsigned int old_ucr1, old_ucr2; 1053 unsigned int old_ucr1, old_ucr2, ucr1;
1078 1054
1079 /* 1055 /*
1080 * First, save UCR1/2 and then disable interrupts 1056 * First, save UCR1/2 and then disable interrupts
1081 */ 1057 */
1082 old_ucr1 = readl(sport->port.membase + UCR1); 1058 ucr1 = old_ucr1 = readl(sport->port.membase + UCR1);
1083 old_ucr2 = readl(sport->port.membase + UCR2); 1059 old_ucr2 = readl(sport->port.membase + UCR2);
1084 1060
1085 writel((old_ucr1 | UCR1_UARTCLKEN | UCR1_UARTEN) & 1061 if (cpu_is_mx1())
1086 ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN), 1062 ucr1 |= MX1_UCR1_UARTCLKEN;
1087 sport->port.membase + UCR1); 1063 ucr1 |= UCR1_UARTEN;
1064 ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN);
1065
1066 writel(ucr1, sport->port.membase + UCR1);
1088 1067
1089 writel(old_ucr2 | UCR2_TXEN, sport->port.membase + UCR2); 1068 writel(old_ucr2 | UCR2_TXEN, sport->port.membase + UCR2);
1090 1069
diff --git a/drivers/serial/msm_serial.c b/drivers/serial/msm_serial.c
index 698048f64f5e..f7c24baa1416 100644
--- a/drivers/serial/msm_serial.c
+++ b/drivers/serial/msm_serial.c
@@ -730,7 +730,6 @@ static int __devexit msm_serial_remove(struct platform_device *pdev)
730} 730}
731 731
732static struct platform_driver msm_platform_driver = { 732static struct platform_driver msm_platform_driver = {
733 .probe = msm_serial_probe,
734 .remove = msm_serial_remove, 733 .remove = msm_serial_remove,
735 .driver = { 734 .driver = {
736 .name = "msm_serial", 735 .name = "msm_serial",
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index eee4b6e0af2c..9b80ad36dbba 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -59,6 +59,8 @@
59 59
60/* per-register bitmasks: */ 60/* per-register bitmasks: */
61 61
62#define OMAP2_MCSPI_SYSCONFIG_SMARTIDLE (2 << 3)
63#define OMAP2_MCSPI_SYSCONFIG_ENAWAKEUP (1 << 2)
62#define OMAP2_MCSPI_SYSCONFIG_AUTOIDLE (1 << 0) 64#define OMAP2_MCSPI_SYSCONFIG_AUTOIDLE (1 << 0)
63#define OMAP2_MCSPI_SYSCONFIG_SOFTRESET (1 << 1) 65#define OMAP2_MCSPI_SYSCONFIG_SOFTRESET (1 << 1)
64 66
@@ -90,6 +92,7 @@
90 92
91#define OMAP2_MCSPI_CHCTRL_EN (1 << 0) 93#define OMAP2_MCSPI_CHCTRL_EN (1 << 0)
92 94
95#define OMAP2_MCSPI_WAKEUPENABLE_WKEN (1 << 0)
93 96
94/* We have 2 DMA channels per CS, one for RX and one for TX */ 97/* We have 2 DMA channels per CS, one for RX and one for TX */
95struct omap2_mcspi_dma { 98struct omap2_mcspi_dma {
@@ -269,7 +272,7 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
269 272
270 if (rx != NULL) { 273 if (rx != NULL) {
271 omap_set_dma_transfer_params(mcspi_dma->dma_rx_channel, 274 omap_set_dma_transfer_params(mcspi_dma->dma_rx_channel,
272 data_type, element_count, 1, 275 data_type, element_count - 1, 1,
273 OMAP_DMA_SYNC_ELEMENT, 276 OMAP_DMA_SYNC_ELEMENT,
274 mcspi_dma->dma_rx_sync_dev, 1); 277 mcspi_dma->dma_rx_sync_dev, 1);
275 278
@@ -300,6 +303,25 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
300 if (rx != NULL) { 303 if (rx != NULL) {
301 wait_for_completion(&mcspi_dma->dma_rx_completion); 304 wait_for_completion(&mcspi_dma->dma_rx_completion);
302 dma_unmap_single(NULL, xfer->rx_dma, count, DMA_FROM_DEVICE); 305 dma_unmap_single(NULL, xfer->rx_dma, count, DMA_FROM_DEVICE);
306 omap2_mcspi_set_enable(spi, 0);
307 if (likely(mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHSTAT0)
308 & OMAP2_MCSPI_CHSTAT_RXS)) {
309 u32 w;
310
311 w = mcspi_read_cs_reg(spi, OMAP2_MCSPI_RX0);
312 if (word_len <= 8)
313 ((u8 *)xfer->rx_buf)[element_count - 1] = w;
314 else if (word_len <= 16)
315 ((u16 *)xfer->rx_buf)[element_count - 1] = w;
316 else /* word_len <= 32 */
317 ((u32 *)xfer->rx_buf)[element_count - 1] = w;
318 } else {
319 dev_err(&spi->dev, "DMA RX last word empty");
320 count -= (word_len <= 8) ? 1 :
321 (word_len <= 16) ? 2 :
322 /* word_len <= 32 */ 4;
323 }
324 omap2_mcspi_set_enable(spi, 1);
303 } 325 }
304 return count; 326 return count;
305} 327}
@@ -873,8 +895,12 @@ static int __init omap2_mcspi_reset(struct omap2_mcspi *mcspi)
873 } while (!(tmp & OMAP2_MCSPI_SYSSTATUS_RESETDONE)); 895 } while (!(tmp & OMAP2_MCSPI_SYSSTATUS_RESETDONE));
874 896
875 mcspi_write_reg(master, OMAP2_MCSPI_SYSCONFIG, 897 mcspi_write_reg(master, OMAP2_MCSPI_SYSCONFIG,
876 /* (3 << 8) | (2 << 3) | */ 898 OMAP2_MCSPI_SYSCONFIG_AUTOIDLE |
877 OMAP2_MCSPI_SYSCONFIG_AUTOIDLE); 899 OMAP2_MCSPI_SYSCONFIG_ENAWAKEUP |
900 OMAP2_MCSPI_SYSCONFIG_SMARTIDLE);
901
902 mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE,
903 OMAP2_MCSPI_WAKEUPENABLE_WKEN);
878 904
879 omap2_mcspi_set_master_mode(master); 905 omap2_mcspi_set_master_mode(master);
880 906
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 348bf61a8fec..975ecddbce30 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -103,8 +103,6 @@ source "drivers/staging/pohmelfs/Kconfig"
103 103
104source "drivers/staging/stlc45xx/Kconfig" 104source "drivers/staging/stlc45xx/Kconfig"
105 105
106source "drivers/staging/uc2322/Kconfig"
107
108source "drivers/staging/b3dfg/Kconfig" 106source "drivers/staging/b3dfg/Kconfig"
109 107
110source "drivers/staging/phison/Kconfig" 108source "drivers/staging/phison/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 8d61d7b4debf..2241ae1b21ee 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_ANDROID) += android/
34obj-$(CONFIG_DST) += dst/ 34obj-$(CONFIG_DST) += dst/
35obj-$(CONFIG_POHMELFS) += pohmelfs/ 35obj-$(CONFIG_POHMELFS) += pohmelfs/
36obj-$(CONFIG_STLC45XX) += stlc45xx/ 36obj-$(CONFIG_STLC45XX) += stlc45xx/
37obj-$(CONFIG_USB_SERIAL_ATEN2011) += uc2322/
38obj-$(CONFIG_B3DFG) += b3dfg/ 37obj-$(CONFIG_B3DFG) += b3dfg/
39obj-$(CONFIG_IDE_PHISON) += phison/ 38obj-$(CONFIG_IDE_PHISON) += phison/
40obj-$(CONFIG_PLAN9AUTH) += p9auth/ 39obj-$(CONFIG_PLAN9AUTH) += p9auth/
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index fe72240f5a9e..f934393f3959 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -96,19 +96,21 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
96 96
97 read_lock(&tasklist_lock); 97 read_lock(&tasklist_lock);
98 for_each_process(p) { 98 for_each_process(p) {
99 struct mm_struct *mm;
99 int oom_adj; 100 int oom_adj;
100 101
101 task_lock(p); 102 task_lock(p);
102 if (!p->mm) { 103 mm = p->mm;
104 if (!mm) {
103 task_unlock(p); 105 task_unlock(p);
104 continue; 106 continue;
105 } 107 }
106 oom_adj = p->oomkilladj; 108 oom_adj = mm->oom_adj;
107 if (oom_adj < min_adj) { 109 if (oom_adj < min_adj) {
108 task_unlock(p); 110 task_unlock(p);
109 continue; 111 continue;
110 } 112 }
111 tasksize = get_mm_rss(p->mm); 113 tasksize = get_mm_rss(mm);
112 task_unlock(p); 114 task_unlock(p);
113 if (tasksize <= 0) 115 if (tasksize <= 0)
114 continue; 116 continue;
diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
index baf83c6a9412..e3c3adc282e2 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -45,6 +45,8 @@ Devices: [JR3] PCI force sensor board (jr3_pci)
45#include <linux/delay.h> 45#include <linux/delay.h>
46#include <linux/ctype.h> 46#include <linux/ctype.h>
47#include <linux/firmware.h> 47#include <linux/firmware.h>
48#include <linux/jiffies.h>
49#include <linux/timer.h>
48#include "comedi_pci.h" 50#include "comedi_pci.h"
49#include "jr3_pci.h" 51#include "jr3_pci.h"
50 52
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 92121cf8c45c..5d9bab352c1d 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -111,9 +111,13 @@ static const struct s626_board s626_boards[] = {
111#define PCI_VENDOR_ID_S626 0x1131 111#define PCI_VENDOR_ID_S626 0x1131
112#define PCI_DEVICE_ID_S626 0x7146 112#define PCI_DEVICE_ID_S626 0x7146
113 113
114/*
115 * For devices with vendor:device id == 0x1131:0x7146 you must specify
116 * also subvendor:subdevice ids, because otherwise it will conflict with
117 * Philips SAA7146 media/dvb based cards.
118 */
114static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = { 119static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = {
115 {PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 120 {PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, 0x6000, 0x0272, 0, 0, 0},
116 0},
117 {0} 121 {0}
118}; 122};
119 123
@@ -499,25 +503,26 @@ static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
499 resource_size_t resourceStart; 503 resource_size_t resourceStart;
500 dma_addr_t appdma; 504 dma_addr_t appdma;
501 struct comedi_subdevice *s; 505 struct comedi_subdevice *s;
502 struct pci_dev *pdev; 506 const struct pci_device_id *ids;
507 struct pci_dev *pdev = NULL;
503 508
504 if (alloc_private(dev, sizeof(struct s626_private)) < 0) 509 if (alloc_private(dev, sizeof(struct s626_private)) < 0)
505 return -ENOMEM; 510 return -ENOMEM;
506 511
507 for (pdev = pci_get_device(PCI_VENDOR_ID_S626, PCI_DEVICE_ID_S626, 512 for (i = 0; i < (ARRAY_SIZE(s626_pci_table) - 1) && !pdev; i++) {
508 NULL); pdev != NULL; 513 ids = &s626_pci_table[i];
509 pdev = pci_get_device(PCI_VENDOR_ID_S626, 514 do {
510 PCI_DEVICE_ID_S626, pdev)) { 515 pdev = pci_get_subsys(ids->vendor, ids->device, ids->subvendor,
511 if (it->options[0] || it->options[1]) { 516 ids->subdevice, pdev);
512 if (pdev->bus->number == it->options[0] && 517
513 PCI_SLOT(pdev->devfn) == it->options[1]) { 518 if ((it->options[0] || it->options[1]) && pdev) {
514 /* matches requested bus/slot */ 519 /* matches requested bus/slot */
520 if (pdev->bus->number == it->options[0] &&
521 PCI_SLOT(pdev->devfn) == it->options[1])
522 break;
523 } else
515 break; 524 break;
516 } 525 } while (1);
517 } else {
518 /* no bus/slot specified */
519 break;
520 }
521 } 526 }
522 devpriv->pdev = pdev; 527 devpriv->pdev = pdev;
523 528
diff --git a/drivers/staging/go7007/s2250-loader.c b/drivers/staging/go7007/s2250-loader.c
index a5e4acab089e..bb22347af60e 100644
--- a/drivers/staging/go7007/s2250-loader.c
+++ b/drivers/staging/go7007/s2250-loader.c
@@ -17,6 +17,7 @@
17 17
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/smp_lock.h>
20#include <linux/usb.h> 21#include <linux/usb.h>
21#include <dvb-usb.h> 22#include <dvb-usb.h>
22 23
diff --git a/drivers/staging/meilhaus/TODO b/drivers/staging/meilhaus/TODO
index 6ec25203089c..d6ce39823de6 100644
--- a/drivers/staging/meilhaus/TODO
+++ b/drivers/staging/meilhaus/TODO
@@ -7,4 +7,4 @@ TODO:
7 - possible comedi merge 7 - possible comedi merge
8 8
9Please send cleanup patches to Greg Kroah-Hartman <greg@kroah.com> 9Please send cleanup patches to Greg Kroah-Hartman <greg@kroah.com>
10and CC: David Kiliani <mail@davidkiliani.de> 10and CC: David Kiliani <mail@davidkiliani.de> and Meilhaus Support <support@meilhaus.de>
diff --git a/drivers/staging/rspiusb/rspiusb.c b/drivers/staging/rspiusb/rspiusb.c
index 1cdfe69585ea..2f8155c1968b 100644
--- a/drivers/staging/rspiusb/rspiusb.c
+++ b/drivers/staging/rspiusb/rspiusb.c
@@ -444,8 +444,7 @@ static void piusb_write_bulk_callback(struct urb *urb)
444 __func__, status); 444 __func__, status);
445 445
446 pdx->pendingWrite = 0; 446 pdx->pendingWrite = 0;
447 usb_buffer_free(urb->dev, urb->transfer_buffer_length, 447 kfree(urb->transfer_buffer);
448 urb->transfer_buffer, urb->transfer_dma);
449} 448}
450 449
451int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len, 450int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len,
@@ -457,9 +456,7 @@ int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len,
457 456
458 urb = usb_alloc_urb(0, GFP_KERNEL); 457 urb = usb_alloc_urb(0, GFP_KERNEL);
459 if (urb != NULL) { 458 if (urb != NULL) {
460 kbuf = 459 kbuf = kmalloc(len, GFP_KERNEL);
461 usb_buffer_alloc(pdx->udev, len, GFP_KERNEL,
462 &urb->transfer_dma);
463 if (!kbuf) { 460 if (!kbuf) {
464 dev_err(&pdx->udev->dev, "buffer_alloc failed\n"); 461 dev_err(&pdx->udev->dev, "buffer_alloc failed\n");
465 return -ENOMEM; 462 return -ENOMEM;
@@ -470,7 +467,6 @@ int piusb_output(struct ioctl_struct *io, unsigned char *uBuf, int len,
470 } 467 }
471 usb_fill_bulk_urb(urb, pdx->udev, pdx->hEP[io->endpoint], kbuf, 468 usb_fill_bulk_urb(urb, pdx->udev, pdx->hEP[io->endpoint], kbuf,
472 len, piusb_write_bulk_callback, pdx); 469 len, piusb_write_bulk_callback, pdx);
473 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
474 err = usb_submit_urb(urb, GFP_KERNEL); 470 err = usb_submit_urb(urb, GFP_KERNEL);
475 if (err) { 471 if (err) {
476 dev_err(&pdx->udev->dev, 472 dev_err(&pdx->udev->dev,
@@ -641,7 +637,7 @@ static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
641 numPagesRequired = 637 numPagesRequired =
642 ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT; 638 ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT;
643 dbg("Number of pages needed = %d", numPagesRequired); 639 dbg("Number of pages needed = %d", numPagesRequired);
644 maplist_p = vmalloc(numPagesRequired * sizeof(struct page)); 640 maplist_p = vmalloc(numPagesRequired * sizeof(struct page *));
645 if (!maplist_p) { 641 if (!maplist_p) {
646 dbg("Can't Allocate Memory for maplist_p"); 642 dbg("Can't Allocate Memory for maplist_p");
647 return -ENOMEM; 643 return -ENOMEM;
@@ -712,9 +708,7 @@ static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
712 usb_fill_bulk_urb(pdx->PixelUrb[frameInfo][i], 708 usb_fill_bulk_urb(pdx->PixelUrb[frameInfo][i],
713 pdx->udev, 709 pdx->udev,
714 epAddr, 710 epAddr,
715 (dma_addr_t *) sg_dma_address(&pdx-> 711 NULL, // non-DMA HC? buy a better hardware
716 sgl[frameInfo]
717 [i]),
718 sg_dma_len(&pdx->sgl[frameInfo][i]), 712 sg_dma_len(&pdx->sgl[frameInfo][i]),
719 piusb_readPIXEL_callback, (void *)pdx); 713 piusb_readPIXEL_callback, (void *)pdx);
720 pdx->PixelUrb[frameInfo][i]->transfer_dma = 714 pdx->PixelUrb[frameInfo][i]->transfer_dma =
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
index 5e5b3f2b7eb1..29e3b53e52a1 100644
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -89,6 +89,7 @@
89 {USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */ \ 89 {USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */ \
90 {USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */ \ 90 {USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */ \
91 {USB_DEVICE(0x0DF6,0x0039)}, /* Sitecom */ \ 91 {USB_DEVICE(0x0DF6,0x0039)}, /* Sitecom */ \
92 {USB_DEVICE(0x0DF6,0x003F)}, /* Sitecom WL-608 */ \
92 {USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */ \ 93 {USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */ \
93 {USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */ \ 94 {USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */ \
94 {USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */ \ 95 {USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */ \
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 93af37e2d31a..54b4b718f84a 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -461,19 +461,19 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
461 struct iw_request_info *info, 461 struct iw_request_info *info,
462 union iwreq_data *wrqu, char *extra) 462 union iwreq_data *wrqu, char *extra)
463{ 463{
464 strcpy(wrqu->name, "802.11"); 464 strlcpy(wrqu->name, "802.11", IFNAMSIZ);
465 if(ieee->modulation & IEEE80211_CCK_MODULATION){ 465 if(ieee->modulation & IEEE80211_CCK_MODULATION){
466 strcat(wrqu->name, "b"); 466 strlcat(wrqu->name, "b", IFNAMSIZ);
467 if(ieee->modulation & IEEE80211_OFDM_MODULATION) 467 if(ieee->modulation & IEEE80211_OFDM_MODULATION)
468 strcat(wrqu->name, "/g"); 468 strlcat(wrqu->name, "/g", IFNAMSIZ);
469 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION) 469 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION)
470 strcat(wrqu->name, "g"); 470 strlcat(wrqu->name, "g", IFNAMSIZ);
471 471
472 if((ieee->state == IEEE80211_LINKED) || 472 if((ieee->state == IEEE80211_LINKED) ||
473 (ieee->state == IEEE80211_LINKED_SCANNING)) 473 (ieee->state == IEEE80211_LINKED_SCANNING))
474 strcat(wrqu->name," linked"); 474 strlcat(wrqu->name," link", IFNAMSIZ);
475 else if(ieee->state != IEEE80211_NOLINK) 475 else if(ieee->state != IEEE80211_NOLINK)
476 strcat(wrqu->name," link.."); 476 strlcat(wrqu->name," .....", IFNAMSIZ);
477 477
478 478
479 return 0; 479 return 0;
diff --git a/drivers/staging/rtl8192su/Kconfig b/drivers/staging/rtl8192su/Kconfig
index 4b5552c5926e..770f41280f21 100644
--- a/drivers/staging/rtl8192su/Kconfig
+++ b/drivers/staging/rtl8192su/Kconfig
@@ -1,6 +1,6 @@
1config RTL8192SU 1config RTL8192SU
2 tristate "RealTek RTL8192SU Wireless LAN NIC driver" 2 tristate "RealTek RTL8192SU Wireless LAN NIC driver"
3 depends on PCI 3 depends on PCI
4 depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS 4 depends on WIRELESS_EXT
5 default N 5 default N
6 ---help--- 6 ---help---
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
index f408b4583b82..759032db4a34 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
@@ -118,7 +118,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
118#else 118#else
119 ieee = (struct ieee80211_device *)dev->priv; 119 ieee = (struct ieee80211_device *)dev->priv;
120#endif 120#endif
121 dev->hard_start_xmit = ieee80211_xmit;
122 121
123 memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv); 122 memset(ieee, 0, sizeof(struct ieee80211_device)+sizeof_priv);
124 ieee->dev = dev; 123 ieee->dev = dev;
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
index 1f50c46dcb90..191dc3fbbe32 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
@@ -548,21 +548,21 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
548 struct iw_request_info *info, 548 struct iw_request_info *info,
549 union iwreq_data *wrqu, char *extra) 549 union iwreq_data *wrqu, char *extra)
550{ 550{
551 strcpy(wrqu->name, "802.11"); 551 strlcpy(wrqu->name, "802.11", IFNAMSIZ);
552 if(ieee->modulation & IEEE80211_CCK_MODULATION){ 552 if(ieee->modulation & IEEE80211_CCK_MODULATION){
553 strcat(wrqu->name, "b"); 553 strlcat(wrqu->name, "b", IFNAMSIZ);
554 if(ieee->modulation & IEEE80211_OFDM_MODULATION) 554 if(ieee->modulation & IEEE80211_OFDM_MODULATION)
555 strcat(wrqu->name, "/g"); 555 strlcat(wrqu->name, "/g", IFNAMSIZ);
556 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION) 556 }else if(ieee->modulation & IEEE80211_OFDM_MODULATION)
557 strcat(wrqu->name, "g"); 557 strlcat(wrqu->name, "g", IFNAMSIZ);
558 if (ieee->mode & (IEEE_N_24G | IEEE_N_5G)) 558 if (ieee->mode & (IEEE_N_24G | IEEE_N_5G))
559 strcat(wrqu->name, "/n"); 559 strlcat(wrqu->name, "/n", IFNAMSIZ);
560 560
561 if((ieee->state == IEEE80211_LINKED) || 561 if((ieee->state == IEEE80211_LINKED) ||
562 (ieee->state == IEEE80211_LINKED_SCANNING)) 562 (ieee->state == IEEE80211_LINKED_SCANNING))
563 strcat(wrqu->name," linked"); 563 strlcat(wrqu->name, " link", IFNAMSIZ);
564 else if(ieee->state != IEEE80211_NOLINK) 564 else if(ieee->state != IEEE80211_NOLINK)
565 strcat(wrqu->name," link.."); 565 strlcat(wrqu->name, " .....", IFNAMSIZ);
566 566
567 567
568 return 0; 568 return 0;
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c
index f1423d714496..4ab250743e81 100644
--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -12132,6 +12132,19 @@ static void HalUsbSetQueuePipeMapping8192SUsb(struct usb_interface *intf, struct
12132} 12132}
12133#endif 12133#endif
12134 12134
12135static const struct net_device_ops rtl8192_netdev_ops = {
12136 .ndo_open = rtl8192_open,
12137 .ndo_stop = rtl8192_close,
12138 .ndo_get_stats = rtl8192_stats,
12139 .ndo_tx_timeout = tx_timeout,
12140 .ndo_do_ioctl = rtl8192_ioctl,
12141 .ndo_set_multicast_list = r8192_set_multicast,
12142 .ndo_set_mac_address = r8192_set_mac_adr,
12143 .ndo_validate_addr = eth_validate_addr,
12144 .ndo_change_mtu = eth_change_mtu,
12145 .ndo_start_xmit = ieee80211_xmit,
12146};
12147
12135#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 12148#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
12136static int __devinit rtl8192_usb_probe(struct usb_interface *intf, 12149static int __devinit rtl8192_usb_probe(struct usb_interface *intf,
12137 const struct usb_device_id *id) 12150 const struct usb_device_id *id)
@@ -12186,15 +12199,7 @@ static void * __devinit rtl8192_usb_probe(struct usb_device *udev,
12186 priv->ops = &rtl8192u_ops; 12199 priv->ops = &rtl8192u_ops;
12187#endif 12200#endif
12188 12201
12189 dev->open = rtl8192_open; 12202 dev->netdev_ops = &rtl8192_netdev_ops;
12190 dev->stop = rtl8192_close;
12191 //dev->hard_start_xmit = rtl8192_8023_hard_start_xmit;
12192 dev->tx_timeout = tx_timeout;
12193 //dev->wireless_handlers = &r8192_wx_handlers_def;
12194 dev->do_ioctl = rtl8192_ioctl;
12195 dev->set_multicast_list = r8192_set_multicast;
12196 dev->set_mac_address = r8192_set_mac_adr;
12197 dev->get_stats = rtl8192_stats;
12198 12203
12199 //DMESG("Oops: i'm coming\n"); 12204 //DMESG("Oops: i'm coming\n");
12200#if WIRELESS_EXT >= 12 12205#if WIRELESS_EXT >= 12
diff --git a/drivers/staging/rtl8192su/r8192U_pm.c b/drivers/staging/rtl8192su/r8192U_pm.c
index 92c95aa36638..b1531a8d0cde 100644
--- a/drivers/staging/rtl8192su/r8192U_pm.c
+++ b/drivers/staging/rtl8192su/r8192U_pm.c
@@ -35,7 +35,9 @@ int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state)
35 return 0; 35 return 0;
36 } 36 }
37 37
38 dev->stop(dev); 38 if (dev->netdev_ops->ndo_stop)
39 dev->netdev_ops->ndo_stop(dev);
40
39 mdelay(10); 41 mdelay(10);
40 42
41 netif_device_detach(dev); 43 netif_device_detach(dev);
@@ -61,7 +63,9 @@ int rtl8192U_resume (struct usb_interface *intf)
61 } 63 }
62 64
63 netif_device_attach(dev); 65 netif_device_attach(dev);
64 dev->open(dev); 66
67 if (dev->netdev_ops->ndo_open)
68 dev->netdev_ops->ndo_open(dev);
65 } 69 }
66 70
67 return 0; 71 return 0;
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index 90b29b564631..0fdf8c6dc648 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -360,18 +360,18 @@ static void qt_read_bulk_callback(struct urb *urb)
360 if (port_paranoia_check(port, __func__) != 0) { 360 if (port_paranoia_check(port, __func__) != 0) {
361 dbg("%s - port_paranoia_check, exiting\n", __func__); 361 dbg("%s - port_paranoia_check, exiting\n", __func__);
362 qt_port->ReadBulkStopped = 1; 362 qt_port->ReadBulkStopped = 1;
363 return; 363 goto exit;
364 } 364 }
365 365
366 if (!serial) { 366 if (!serial) {
367 dbg("%s - bad serial pointer, exiting\n", __func__); 367 dbg("%s - bad serial pointer, exiting\n", __func__);
368 return; 368 goto exit;
369 } 369 }
370 if (qt_port->closePending == 1) { 370 if (qt_port->closePending == 1) {
371 /* Were closing , stop reading */ 371 /* Were closing , stop reading */
372 dbg("%s - (qt_port->closepending == 1\n", __func__); 372 dbg("%s - (qt_port->closepending == 1\n", __func__);
373 qt_port->ReadBulkStopped = 1; 373 qt_port->ReadBulkStopped = 1;
374 return; 374 goto exit;
375 } 375 }
376 376
377 /* 377 /*
@@ -381,7 +381,7 @@ static void qt_read_bulk_callback(struct urb *urb)
381 */ 381 */
382 if (qt_port->RxHolding == 1) { 382 if (qt_port->RxHolding == 1) {
383 qt_port->ReadBulkStopped = 1; 383 qt_port->ReadBulkStopped = 1;
384 return; 384 goto exit;
385 } 385 }
386 386
387 if (urb->status) { 387 if (urb->status) {
@@ -389,7 +389,7 @@ static void qt_read_bulk_callback(struct urb *urb)
389 389
390 dbg("%s - nonzero read bulk status received: %d\n", 390 dbg("%s - nonzero read bulk status received: %d\n",
391 __func__, urb->status); 391 __func__, urb->status);
392 return; 392 goto exit;
393 } 393 }
394 394
395 if (tty && RxCount) { 395 if (tty && RxCount) {
@@ -463,6 +463,8 @@ static void qt_read_bulk_callback(struct urb *urb)
463 } 463 }
464 464
465 schedule_work(&port->work); 465 schedule_work(&port->work);
466exit:
467 tty_kref_put(tty);
466} 468}
467 469
468/* 470/*
@@ -736,6 +738,11 @@ static int qt_startup(struct usb_serial *serial)
736 if (!qt_port) { 738 if (!qt_port) {
737 dbg("%s: kmalloc for quatech_port (%d) failed!.", 739 dbg("%s: kmalloc for quatech_port (%d) failed!.",
738 __func__, i); 740 __func__, i);
741 for(--i; i >= 0; i--) {
742 port = serial->port[i];
743 kfree(usb_get_serial_port_data(port));
744 usb_set_serial_port_data(port, NULL);
745 }
739 return -ENOMEM; 746 return -ENOMEM;
740 } 747 }
741 spin_lock_init(&qt_port->lock); 748 spin_lock_init(&qt_port->lock);
@@ -866,7 +873,7 @@ static void qt_release(struct usb_serial *serial)
866 873
867} 874}
868 875
869int qt_open(struct tty_struct *tty, 876static int qt_open(struct tty_struct *tty,
870 struct usb_serial_port *port, struct file *filp) 877 struct usb_serial_port *port, struct file *filp)
871{ 878{
872 struct usb_serial *serial; 879 struct usb_serial *serial;
@@ -1041,17 +1048,19 @@ static void qt_block_until_empty(struct tty_struct *tty,
1041 } 1048 }
1042} 1049}
1043 1050
1044static void qt_close(struct tty_struct *tty, struct usb_serial_port *port, 1051static void qt_close(struct usb_serial_port *port)
1045 struct file *filp)
1046{ 1052{
1047 struct usb_serial *serial = port->serial; 1053 struct usb_serial *serial = port->serial;
1048 struct quatech_port *qt_port; 1054 struct quatech_port *qt_port;
1049 struct quatech_port *port0; 1055 struct quatech_port *port0;
1056 struct tty_struct *tty;
1050 int status; 1057 int status;
1051 unsigned int index; 1058 unsigned int index;
1052 status = 0; 1059 status = 0;
1053 1060
1054 dbg("%s - port %d\n", __func__, port->number); 1061 dbg("%s - port %d\n", __func__, port->number);
1062
1063 tty = tty_port_tty_get(&port->port);
1055 index = tty->index - serial->minor; 1064 index = tty->index - serial->minor;
1056 1065
1057 qt_port = qt_get_port_private(port); 1066 qt_port = qt_get_port_private(port);
@@ -1066,6 +1075,7 @@ static void qt_close(struct tty_struct *tty, struct usb_serial_port *port,
1066 /* wait up to for transmitter to empty */ 1075 /* wait up to for transmitter to empty */
1067 if (serial->dev) 1076 if (serial->dev)
1068 qt_block_until_empty(tty, qt_port); 1077 qt_block_until_empty(tty, qt_port);
1078 tty_kref_put(tty);
1069 1079
1070 /* Close uart channel */ 1080 /* Close uart channel */
1071 status = qt_close_channel(serial, index); 1081 status = qt_close_channel(serial, index);
diff --git a/drivers/staging/stlc45xx/stlc45xx.c b/drivers/staging/stlc45xx/stlc45xx.c
index cfdaac9b747e..a137c78fac09 100644
--- a/drivers/staging/stlc45xx/stlc45xx.c
+++ b/drivers/staging/stlc45xx/stlc45xx.c
@@ -2235,24 +2235,6 @@ static void stlc45xx_op_remove_interface(struct ieee80211_hw *hw,
2235 stlc45xx_debug(DEBUG_FUNC, "%s", __func__); 2235 stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
2236} 2236}
2237 2237
2238static int stlc45xx_op_config_interface(struct ieee80211_hw *hw,
2239 struct ieee80211_vif *vif,
2240 struct ieee80211_if_conf *conf)
2241{
2242 struct stlc45xx *stlc = hw->priv;
2243
2244 stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
2245
2246 mutex_lock(&stlc->mutex);
2247
2248 memcpy(stlc->bssid, conf->bssid, ETH_ALEN);
2249 stlc45xx_tx_setup(stlc);
2250
2251 mutex_unlock(&stlc->mutex);
2252
2253 return 0;
2254}
2255
2256static int stlc45xx_op_config(struct ieee80211_hw *hw, u32 changed) 2238static int stlc45xx_op_config(struct ieee80211_hw *hw, u32 changed)
2257{ 2239{
2258 struct stlc45xx *stlc = hw->priv; 2240 struct stlc45xx *stlc = hw->priv;
@@ -2295,6 +2277,14 @@ static void stlc45xx_op_bss_info_changed(struct ieee80211_hw *hw,
2295{ 2277{
2296 struct stlc45xx *stlc = hw->priv; 2278 struct stlc45xx *stlc = hw->priv;
2297 2279
2280 stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
2281 mutex_lock(&stlc->mutex);
2282
2283 memcpy(stlc->bssid, info->bssid, ETH_ALEN);
2284 stlc45xx_tx_setup(stlc);
2285
2286 mutex_unlock(&stlc->mutex);
2287
2298 if (changed & BSS_CHANGED_ASSOC) { 2288 if (changed & BSS_CHANGED_ASSOC) {
2299 stlc->associated = info->assoc; 2289 stlc->associated = info->assoc;
2300 if (info->assoc) 2290 if (info->assoc)
@@ -2357,7 +2347,6 @@ static const struct ieee80211_ops stlc45xx_ops = {
2357 .add_interface = stlc45xx_op_add_interface, 2347 .add_interface = stlc45xx_op_add_interface,
2358 .remove_interface = stlc45xx_op_remove_interface, 2348 .remove_interface = stlc45xx_op_remove_interface,
2359 .config = stlc45xx_op_config, 2349 .config = stlc45xx_op_config,
2360 .config_interface = stlc45xx_op_config_interface,
2361 .configure_filter = stlc45xx_op_configure_filter, 2350 .configure_filter = stlc45xx_op_configure_filter,
2362 .tx = stlc45xx_op_tx, 2351 .tx = stlc45xx_op_tx,
2363 .bss_info_changed = stlc45xx_op_bss_info_changed, 2352 .bss_info_changed = stlc45xx_op_bss_info_changed,
diff --git a/drivers/staging/uc2322/Kconfig b/drivers/staging/uc2322/Kconfig
deleted file mode 100644
index 2e0c6e79df2b..000000000000
--- a/drivers/staging/uc2322/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
1config USB_SERIAL_ATEN2011
2 tristate "ATEN 2011 USB to serial device support"
3 depends on USB_SERIAL
4 default N
5 ---help---
6 Say Y here if you want to use a ATEN 2011 dual port USB to serial
7 adapter.
8
9 To compile this driver as a module, choose M here: the module will be
10 called aten2011.
diff --git a/drivers/staging/uc2322/Makefile b/drivers/staging/uc2322/Makefile
deleted file mode 100644
index 49c18d6e579f..000000000000
--- a/drivers/staging/uc2322/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-$(CONFIG_USB_SERIAL_ATEN2011) += aten2011.o
diff --git a/drivers/staging/uc2322/TODO b/drivers/staging/uc2322/TODO
deleted file mode 100644
index c189a64c4185..000000000000
--- a/drivers/staging/uc2322/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
1TODO:
2 - checkpatch.pl cleanups
3 - remove dead and useless code (auditing the tty ioctls to
4 verify that they really are correct and needed.)
5
6Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and
7Russell Lang <gsview@ghostgum.com.au>.
diff --git a/drivers/staging/uc2322/aten2011.c b/drivers/staging/uc2322/aten2011.c
deleted file mode 100644
index 39d0926d1a90..000000000000
--- a/drivers/staging/uc2322/aten2011.c
+++ /dev/null
@@ -1,2430 +0,0 @@
1/*
2 * Aten 2011 USB serial driver for 4 port devices
3 *
4 * Copyright (C) 2000 Inside Out Networks
5 * Copyright (C) 2001-2002, 2009 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2009 Novell Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/init.h>
18#include <linux/slab.h>
19#include <linux/tty.h>
20#include <linux/tty_driver.h>
21#include <linux/tty_flip.h>
22#include <linux/module.h>
23#include <linux/serial.h>
24#include <linux/uaccess.h>
25#include <linux/usb.h>
26#include <linux/usb/serial.h>
27
28
29#define ZLP_REG1 0x3A /* Zero_Flag_Reg1 58 */
30#define ZLP_REG2 0x3B /* Zero_Flag_Reg2 59 */
31#define ZLP_REG3 0x3C /* Zero_Flag_Reg3 60 */
32#define ZLP_REG4 0x3D /* Zero_Flag_Reg4 61 */
33#define ZLP_REG5 0x3E /* Zero_Flag_Reg5 62 */
34
35/* Interrupt Rotinue Defines */
36#define SERIAL_IIR_RLS 0x06
37#define SERIAL_IIR_RDA 0x04
38#define SERIAL_IIR_CTI 0x0c
39#define SERIAL_IIR_THR 0x02
40#define SERIAL_IIR_MS 0x00
41
42/* Emulation of the bit mask on the LINE STATUS REGISTER. */
43#define SERIAL_LSR_DR 0x0001
44#define SERIAL_LSR_OE 0x0002
45#define SERIAL_LSR_PE 0x0004
46#define SERIAL_LSR_FE 0x0008
47#define SERIAL_LSR_BI 0x0010
48#define SERIAL_LSR_THRE 0x0020
49#define SERIAL_LSR_TEMT 0x0040
50#define SERIAL_LSR_FIFOERR 0x0080
51
52/* MSR bit defines(place holders) */
53#define ATEN_MSR_DELTA_CTS 0x10
54#define ATEN_MSR_DELTA_DSR 0x20
55#define ATEN_MSR_DELTA_RI 0x40
56#define ATEN_MSR_DELTA_CD 0x80
57
58/* Serial Port register Address */
59#define RECEIVE_BUFFER_REGISTER ((__u16)(0x00))
60#define TRANSMIT_HOLDING_REGISTER ((__u16)(0x00))
61#define INTERRUPT_ENABLE_REGISTER ((__u16)(0x01))
62#define INTERRUPT_IDENT_REGISTER ((__u16)(0x02))
63#define FIFO_CONTROL_REGISTER ((__u16)(0x02))
64#define LINE_CONTROL_REGISTER ((__u16)(0x03))
65#define MODEM_CONTROL_REGISTER ((__u16)(0x04))
66#define LINE_STATUS_REGISTER ((__u16)(0x05))
67#define MODEM_STATUS_REGISTER ((__u16)(0x06))
68#define SCRATCH_PAD_REGISTER ((__u16)(0x07))
69#define DIVISOR_LATCH_LSB ((__u16)(0x00))
70#define DIVISOR_LATCH_MSB ((__u16)(0x01))
71
72#define SP1_REGISTER ((__u16)(0x00))
73#define CONTROL1_REGISTER ((__u16)(0x01))
74#define CLK_MULTI_REGISTER ((__u16)(0x02))
75#define CLK_START_VALUE_REGISTER ((__u16)(0x03))
76#define DCR1_REGISTER ((__u16)(0x04))
77#define GPIO_REGISTER ((__u16)(0x07))
78
79#define SERIAL_LCR_DLAB ((__u16)(0x0080))
80
81/*
82 * URB POOL related defines
83 */
84#define NUM_URBS 16 /* URB Count */
85#define URB_TRANSFER_BUFFER_SIZE 32 /* URB Size */
86
87#define USB_VENDOR_ID_ATENINTL 0x0557
88#define ATENINTL_DEVICE_ID_2011 0x2011
89#define ATENINTL_DEVICE_ID_7820 0x7820
90
91static struct usb_device_id id_table[] = {
92 { USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_2011) },
93 { USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_7820) },
94 { } /* terminating entry */
95};
96MODULE_DEVICE_TABLE(usb, id_table);
97
98/* This structure holds all of the local port information */
99struct ATENINTL_port {
100 int port_num; /*Actual port number in the device(1,2,etc)*/
101 __u8 bulk_out_endpoint; /* the bulk out endpoint handle */
102 unsigned char *bulk_out_buffer; /* buffer used for the bulk out endpoint */
103 struct urb *write_urb; /* write URB for this port */
104 __u8 bulk_in_endpoint; /* the bulk in endpoint handle */
105 unsigned char *bulk_in_buffer; /* the buffer we use for the bulk in endpoint */
106 struct urb *read_urb; /* read URB for this port */
107 __u8 shadowLCR; /* last LCR value received */
108 __u8 shadowMCR; /* last MCR value received */
109 char open;
110 char chaseResponsePending;
111 wait_queue_head_t wait_chase; /* for handling sleeping while waiting for chase to finish */
112 wait_queue_head_t wait_command; /* for handling sleeping while waiting for command to finish */
113 struct async_icount icount;
114 struct usb_serial_port *port; /* loop back to the owner of this object */
115 /*Offsets*/
116 __u8 SpRegOffset;
117 __u8 ControlRegOffset;
118 __u8 DcrRegOffset;
119 /* for processing control URBS in interrupt context */
120 struct urb *control_urb;
121 char *ctrl_buf;
122 int MsrLsr;
123
124 struct urb *write_urb_pool[NUM_URBS];
125 /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */
126 struct ktermios tmp_termios; /* stores the old termios settings */
127 spinlock_t lock; /* private lock */
128};
129
130/* This structure holds all of the individual serial device information */
131struct ATENINTL_serial {
132 __u8 interrupt_in_endpoint; /* the interrupt endpoint handle */
133 unsigned char *interrupt_in_buffer; /* the buffer we use for the interrupt endpoint */
134 struct urb *interrupt_read_urb; /* our interrupt urb */
135 __u8 bulk_in_endpoint; /* the bulk in endpoint handle */
136 unsigned char *bulk_in_buffer; /* the buffer we use for the bulk in endpoint */
137 struct urb *read_urb; /* our bulk read urb */
138 __u8 bulk_out_endpoint; /* the bulk out endpoint handle */
139 struct usb_serial *serial; /* loop back to the owner of this object */
140 int ATEN2011_spectrum_2or4ports; /* this says the number of ports in the device */
141 /* Indicates about the no.of opened ports of an individual USB-serial adapater. */
142 unsigned int NoOfOpenPorts;
143 /* a flag for Status endpoint polling */
144 unsigned char status_polling_started;
145};
146
147static void ATEN2011_set_termios(struct tty_struct *tty,
148 struct usb_serial_port *port,
149 struct ktermios *old_termios);
150static void ATEN2011_change_port_settings(struct tty_struct *tty,
151 struct ATENINTL_port *ATEN2011_port,
152 struct ktermios *old_termios);
153
154/*************************************
155 * Bit definitions for each register *
156 *************************************/
157#define LCR_BITS_5 0x00 /* 5 bits/char */
158#define LCR_BITS_6 0x01 /* 6 bits/char */
159#define LCR_BITS_7 0x02 /* 7 bits/char */
160#define LCR_BITS_8 0x03 /* 8 bits/char */
161#define LCR_BITS_MASK 0x03 /* Mask for bits/char field */
162
163#define LCR_STOP_1 0x00 /* 1 stop bit */
164#define LCR_STOP_1_5 0x04 /* 1.5 stop bits (if 5 bits/char) */
165#define LCR_STOP_2 0x04 /* 2 stop bits (if 6-8 bits/char) */
166#define LCR_STOP_MASK 0x04 /* Mask for stop bits field */
167
168#define LCR_PAR_NONE 0x00 /* No parity */
169#define LCR_PAR_ODD 0x08 /* Odd parity */
170#define LCR_PAR_EVEN 0x18 /* Even parity */
171#define LCR_PAR_MARK 0x28 /* Force parity bit to 1 */
172#define LCR_PAR_SPACE 0x38 /* Force parity bit to 0 */
173#define LCR_PAR_MASK 0x38 /* Mask for parity field */
174
175#define LCR_SET_BREAK 0x40 /* Set Break condition */
176#define LCR_DL_ENABLE 0x80 /* Enable access to divisor latch */
177
178#define MCR_DTR 0x01 /* Assert DTR */
179#define MCR_RTS 0x02 /* Assert RTS */
180#define MCR_OUT1 0x04 /* Loopback only: Sets state of RI */
181#define MCR_MASTER_IE 0x08 /* Enable interrupt outputs */
182#define MCR_LOOPBACK 0x10 /* Set internal (digital) loopback mode */
183#define MCR_XON_ANY 0x20 /* Enable any char to exit XOFF mode */
184
185#define ATEN2011_MSR_CTS 0x10 /* Current state of CTS */
186#define ATEN2011_MSR_DSR 0x20 /* Current state of DSR */
187#define ATEN2011_MSR_RI 0x40 /* Current state of RI */
188#define ATEN2011_MSR_CD 0x80 /* Current state of CD */
189
190
191static int debug;
192
193/*
194 * Version Information
195 */
196#define DRIVER_VERSION "2.0"
197#define DRIVER_DESC "ATENINTL 2011 USB Serial Adapter"
198
199/*
200 * Defines used for sending commands to port
201 */
202
203#define ATEN_WDR_TIMEOUT (50) /* default urb timeout */
204
205/* Requests */
206#define ATEN_RD_RTYPE 0xC0
207#define ATEN_WR_RTYPE 0x40
208#define ATEN_RDREQ 0x0D
209#define ATEN_WRREQ 0x0E
210#define ATEN_CTRL_TIMEOUT 500
211#define VENDOR_READ_LENGTH (0x01)
212
213/* set to 1 for RS485 mode and 0 for RS232 mode */
214/* FIXME make this somehow dynamic and not build time specific */
215static int RS485mode;
216
217static int set_reg_sync(struct usb_serial_port *port, __u16 reg, __u16 val)
218{
219 struct usb_device *dev = port->serial->dev;
220 val = val & 0x00ff;
221
222 dbg("%s: is %x, value %x", __func__, reg, val);
223
224 return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ATEN_WRREQ,
225 ATEN_WR_RTYPE, val, reg, NULL, 0,
226 ATEN_WDR_TIMEOUT);
227}
228
229static int get_reg_sync(struct usb_serial_port *port, __u16 reg, __u16 *val)
230{
231 struct usb_device *dev = port->serial->dev;
232 int ret;
233
234 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ATEN_RDREQ,
235 ATEN_RD_RTYPE, 0, reg, val, VENDOR_READ_LENGTH,
236 ATEN_WDR_TIMEOUT);
237 dbg("%s: offset is %x, return val %x", __func__, reg, *val);
238 *val = (*val) & 0x00ff;
239 return ret;
240}
241
242static int set_uart_reg(struct usb_serial_port *port, __u16 reg, __u16 val)
243{
244 struct usb_device *dev = port->serial->dev;
245 struct ATENINTL_serial *a_serial;
246 __u16 minor;
247
248 a_serial = usb_get_serial_data(port->serial);
249 minor = port->serial->minor;
250 if (minor == SERIAL_TTY_NO_MINOR)
251 minor = 0;
252 val = val & 0x00ff;
253
254 /*
255 * For the UART control registers,
256 * the application number need to be Or'ed
257 */
258 if (a_serial->ATEN2011_spectrum_2or4ports == 4)
259 val |= (((__u16)port->number - minor) + 1) << 8;
260 else {
261 if (((__u16) port->number - minor) == 0)
262 val |= (((__u16)port->number - minor) + 1) << 8;
263 else
264 val |= (((__u16)port->number - minor) + 2) << 8;
265 }
266 dbg("%s: application number is %x", __func__, val);
267
268 return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ATEN_WRREQ,
269 ATEN_WR_RTYPE, val, reg, NULL, 0,
270 ATEN_WDR_TIMEOUT);
271}
272
273static int get_uart_reg(struct usb_serial_port *port, __u16 reg, __u16 *val)
274{
275 struct usb_device *dev = port->serial->dev;
276 int ret = 0;
277 __u16 wval;
278 struct ATENINTL_serial *a_serial;
279 __u16 minor = port->serial->minor;
280
281 a_serial = usb_get_serial_data(port->serial);
282 if (minor == SERIAL_TTY_NO_MINOR)
283 minor = 0;
284
285 /* wval is same as application number */
286 if (a_serial->ATEN2011_spectrum_2or4ports == 4)
287 wval = (((__u16)port->number - minor) + 1) << 8;
288 else {
289 if (((__u16) port->number - minor) == 0)
290 wval = (((__u16) port->number - minor) + 1) << 8;
291 else
292 wval = (((__u16) port->number - minor) + 2) << 8;
293 }
294 dbg("%s: application number is %x", __func__, wval);
295 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ATEN_RDREQ,
296 ATEN_RD_RTYPE, wval, reg, val, VENDOR_READ_LENGTH,
297 ATEN_WDR_TIMEOUT);
298 *val = (*val) & 0x00ff;
299 return ret;
300}
301
302static int handle_newMsr(struct ATENINTL_port *port, __u8 newMsr)
303{
304 struct ATENINTL_port *ATEN2011_port;
305 struct async_icount *icount;
306 ATEN2011_port = port;
307 icount = &ATEN2011_port->icount;
308 if (newMsr &
309 (ATEN_MSR_DELTA_CTS | ATEN_MSR_DELTA_DSR | ATEN_MSR_DELTA_RI |
310 ATEN_MSR_DELTA_CD)) {
311 icount = &ATEN2011_port->icount;
312
313 /* update input line counters */
314 if (newMsr & ATEN_MSR_DELTA_CTS)
315 icount->cts++;
316 if (newMsr & ATEN_MSR_DELTA_DSR)
317 icount->dsr++;
318 if (newMsr & ATEN_MSR_DELTA_CD)
319 icount->dcd++;
320 if (newMsr & ATEN_MSR_DELTA_RI)
321 icount->rng++;
322 }
323
324 return 0;
325}
326
327static int handle_newLsr(struct ATENINTL_port *port, __u8 newLsr)
328{
329 struct async_icount *icount;
330
331 dbg("%s - %02x", __func__, newLsr);
332
333 if (newLsr & SERIAL_LSR_BI) {
334 /*
335 * Parity and Framing errors only count if they occur exclusive
336 * of a break being received.
337 */
338 newLsr &= (__u8) (SERIAL_LSR_OE | SERIAL_LSR_BI);
339 }
340
341 /* update input line counters */
342 icount = &port->icount;
343 if (newLsr & SERIAL_LSR_BI)
344 icount->brk++;
345 if (newLsr & SERIAL_LSR_OE)
346 icount->overrun++;
347 if (newLsr & SERIAL_LSR_PE)
348 icount->parity++;
349 if (newLsr & SERIAL_LSR_FE)
350 icount->frame++;
351
352 return 0;
353}
354
355static void ATEN2011_control_callback(struct urb *urb)
356{
357 unsigned char *data;
358 struct ATENINTL_port *ATEN2011_port;
359 __u8 regval = 0x0;
360
361 switch (urb->status) {
362 case 0:
363 /* success */
364 break;
365 case -ECONNRESET:
366 case -ENOENT:
367 case -ESHUTDOWN:
368 /* this urb is terminated, clean up */
369 dbg("%s - urb shutting down with status: %d", __func__,
370 urb->status);
371 return;
372 default:
373 dbg("%s - nonzero urb status received: %d", __func__,
374 urb->status);
375 goto exit;
376 }
377
378 ATEN2011_port = (struct ATENINTL_port *)urb->context;
379
380 dbg("%s urb buffer size is %d", __func__, urb->actual_length);
381 dbg("%s ATEN2011_port->MsrLsr is %d port %d", __func__,
382 ATEN2011_port->MsrLsr, ATEN2011_port->port_num);
383 data = urb->transfer_buffer;
384 regval = (__u8) data[0];
385 dbg("%s data is %x", __func__, regval);
386 if (ATEN2011_port->MsrLsr == 0)
387 handle_newMsr(ATEN2011_port, regval);
388 else if (ATEN2011_port->MsrLsr == 1)
389 handle_newLsr(ATEN2011_port, regval);
390
391exit:
392 return;
393}
394
395static int ATEN2011_get_reg(struct ATENINTL_port *ATEN, __u16 Wval, __u16 reg,
396 __u16 *val)
397{
398 struct usb_device *dev = ATEN->port->serial->dev;
399 struct usb_ctrlrequest *dr = NULL;
400 unsigned char *buffer = NULL;
401 int ret = 0;
402 buffer = (__u8 *) ATEN->ctrl_buf;
403
404 dr = (void *)(buffer + 2);
405 dr->bRequestType = ATEN_RD_RTYPE;
406 dr->bRequest = ATEN_RDREQ;
407 dr->wValue = cpu_to_le16(Wval);
408 dr->wIndex = cpu_to_le16(reg);
409 dr->wLength = cpu_to_le16(2);
410
411 usb_fill_control_urb(ATEN->control_urb, dev, usb_rcvctrlpipe(dev, 0),
412 (unsigned char *)dr, buffer, 2,
413 ATEN2011_control_callback, ATEN);
414 ATEN->control_urb->transfer_buffer_length = 2;
415 ret = usb_submit_urb(ATEN->control_urb, GFP_ATOMIC);
416 return ret;
417}
418
419static void ATEN2011_interrupt_callback(struct urb *urb)
420{
421 int result;
422 int length;
423 struct ATENINTL_port *ATEN2011_port;
424 struct ATENINTL_serial *ATEN2011_serial;
425 struct usb_serial *serial;
426 __u16 Data;
427 unsigned char *data;
428 __u8 sp[5], st;
429 int i;
430 __u16 wval;
431 int minor;
432
433 dbg("%s", " : Entering");
434
435 ATEN2011_serial = (struct ATENINTL_serial *)urb->context;
436
437 switch (urb->status) {
438 case 0:
439 /* success */
440 break;
441 case -ECONNRESET:
442 case -ENOENT:
443 case -ESHUTDOWN:
444 /* this urb is terminated, clean up */
445 dbg("%s - urb shutting down with status: %d", __func__,
446 urb->status);
447 return;
448 default:
449 dbg("%s - nonzero urb status received: %d", __func__,
450 urb->status);
451 goto exit;
452 }
453 length = urb->actual_length;
454 data = urb->transfer_buffer;
455
456 serial = ATEN2011_serial->serial;
457
458 /* ATENINTL get 5 bytes
459 * Byte 1 IIR Port 1 (port.number is 0)
460 * Byte 2 IIR Port 2 (port.number is 1)
461 * Byte 3 IIR Port 3 (port.number is 2)
462 * Byte 4 IIR Port 4 (port.number is 3)
463 * Byte 5 FIFO status for both */
464
465 if (length && length > 5) {
466 dbg("%s", "Wrong data !!!");
467 return;
468 }
469
470 /* MATRIX */
471 if (ATEN2011_serial->ATEN2011_spectrum_2or4ports == 4) {
472 sp[0] = (__u8) data[0];
473 sp[1] = (__u8) data[1];
474 sp[2] = (__u8) data[2];
475 sp[3] = (__u8) data[3];
476 st = (__u8) data[4];
477 } else {
478 sp[0] = (__u8) data[0];
479 sp[1] = (__u8) data[2];
480 /* sp[2]=(__u8)data[2]; */
481 /* sp[3]=(__u8)data[3]; */
482 st = (__u8) data[4];
483
484 }
485 for (i = 0; i < serial->num_ports; i++) {
486 ATEN2011_port = usb_get_serial_port_data(serial->port[i]);
487 minor = serial->minor;
488 if (minor == SERIAL_TTY_NO_MINOR)
489 minor = 0;
490 if ((ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)
491 && (i != 0))
492 wval =
493 (((__u16) serial->port[i]->number -
494 (__u16) (minor)) + 2) << 8;
495 else
496 wval =
497 (((__u16) serial->port[i]->number -
498 (__u16) (minor)) + 1) << 8;
499 if (ATEN2011_port->open != 0) {
500 if (sp[i] & 0x01) {
501 dbg("SP%d No Interrupt !!!", i);
502 } else {
503 switch (sp[i] & 0x0f) {
504 case SERIAL_IIR_RLS:
505 dbg("Serial Port %d: Receiver status error or address bit detected in 9-bit mode", i);
506 ATEN2011_port->MsrLsr = 1;
507 ATEN2011_get_reg(ATEN2011_port, wval,
508 LINE_STATUS_REGISTER,
509 &Data);
510 break;
511 case SERIAL_IIR_MS:
512 dbg("Serial Port %d: Modem status change", i);
513 ATEN2011_port->MsrLsr = 0;
514 ATEN2011_get_reg(ATEN2011_port, wval,
515 MODEM_STATUS_REGISTER,
516 &Data);
517 break;
518 }
519 }
520 }
521
522 }
523exit:
524 if (ATEN2011_serial->status_polling_started == 0)
525 return;
526
527 result = usb_submit_urb(urb, GFP_ATOMIC);
528 if (result) {
529 dev_err(&urb->dev->dev,
530 "%s - Error %d submitting interrupt urb\n",
531 __func__, result);
532 }
533
534 return;
535}
536
537static void ATEN2011_bulk_in_callback(struct urb *urb)
538{
539 int status;
540 unsigned char *data;
541 struct usb_serial *serial;
542 struct usb_serial_port *port;
543 struct ATENINTL_serial *ATEN2011_serial;
544 struct ATENINTL_port *ATEN2011_port;
545 struct tty_struct *tty;
546
547 if (urb->status) {
548 dbg("nonzero read bulk status received: %d", urb->status);
549 return;
550 }
551
552 ATEN2011_port = (struct ATENINTL_port *)urb->context;
553
554 port = (struct usb_serial_port *)ATEN2011_port->port;
555 serial = port->serial;
556
557 dbg("%s", "Entering...");
558
559 data = urb->transfer_buffer;
560 ATEN2011_serial = usb_get_serial_data(serial);
561
562 if (urb->actual_length) {
563 tty = tty_port_tty_get(&ATEN2011_port->port->port);
564 if (tty) {
565 tty_buffer_request_room(tty, urb->actual_length);
566 tty_insert_flip_string(tty, data, urb->actual_length);
567 tty_flip_buffer_push(tty);
568 tty_kref_put(tty);
569 }
570
571 ATEN2011_port->icount.rx += urb->actual_length;
572 dbg("ATEN2011_port->icount.rx is %d:",
573 ATEN2011_port->icount.rx);
574 }
575
576 if (!ATEN2011_port->read_urb) {
577 dbg("%s", "URB KILLED !!!");
578 return;
579 }
580
581 if (ATEN2011_port->read_urb->status != -EINPROGRESS) {
582 ATEN2011_port->read_urb->dev = serial->dev;
583
584 status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC);
585 if (status)
586 dbg("usb_submit_urb(read bulk) failed, status = %d", status);
587 }
588}
589
590static void ATEN2011_bulk_out_data_callback(struct urb *urb)
591{
592 struct ATENINTL_port *ATEN2011_port;
593 struct tty_struct *tty;
594
595 if (urb->status) {
596 dbg("nonzero write bulk status received:%d", urb->status);
597 return;
598 }
599
600 ATEN2011_port = (struct ATENINTL_port *)urb->context;
601
602 dbg("%s", "Entering .........");
603
604 tty = tty_port_tty_get(&ATEN2011_port->port->port);
605
606 if (tty && ATEN2011_port->open)
607 /* tell the tty driver that something has changed */
608 tty_wakeup(tty);
609
610 /* schedule_work(&ATEN2011_port->port->work); */
611 tty_kref_put(tty);
612
613}
614
615#ifdef ATENSerialProbe
616static int ATEN2011_serial_probe(struct usb_serial *serial,
617 const struct usb_device_id *id)
618{
619
620 /*need to implement the mode_reg reading and updating\
621 structures usb_serial_ device_type\
622 (i.e num_ports, num_bulkin,bulkout etc) */
623 /* Also we can update the changes attach */
624 return 1;
625}
626#endif
627
628static int ATEN2011_open(struct tty_struct *tty, struct usb_serial_port *port,
629 struct file *filp)
630{
631 int response;
632 int j;
633 struct usb_serial *serial;
634 struct urb *urb;
635 __u16 Data;
636 int status;
637 struct ATENINTL_serial *ATEN2011_serial;
638 struct ATENINTL_port *ATEN2011_port;
639 struct ktermios tmp_termios;
640 int minor;
641
642 serial = port->serial;
643
644 ATEN2011_port = usb_get_serial_port_data(port);
645
646 if (ATEN2011_port == NULL)
647 return -ENODEV;
648
649 ATEN2011_serial = usb_get_serial_data(serial);
650 if (ATEN2011_serial == NULL)
651 return -ENODEV;
652
653 /* increment the number of opened ports counter here */
654 ATEN2011_serial->NoOfOpenPorts++;
655
656 usb_clear_halt(serial->dev, port->write_urb->pipe);
657 usb_clear_halt(serial->dev, port->read_urb->pipe);
658
659 /* Initialising the write urb pool */
660 for (j = 0; j < NUM_URBS; ++j) {
661 urb = usb_alloc_urb(0, GFP_ATOMIC);
662 ATEN2011_port->write_urb_pool[j] = urb;
663
664 if (urb == NULL) {
665 err("No more urbs???");
666 continue;
667 }
668
669 urb->transfer_buffer = NULL;
670 urb->transfer_buffer =
671 kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
672 if (!urb->transfer_buffer) {
673 err("%s-out of memory for urb buffers.", __func__);
674 continue;
675 }
676 }
677
678/*****************************************************************************
679 * Initialize ATEN2011 -- Write Init values to corresponding Registers
680 *
681 * Register Index
682 * 1 : IER
683 * 2 : FCR
684 * 3 : LCR
685 * 4 : MCR
686 *
687 * 0x08 : SP1/2 Control Reg
688 *****************************************************************************/
689
690/* NEED to check the fallowing Block */
691
692 Data = 0x0;
693 status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data);
694 if (status < 0) {
695 dbg("Reading Spreg failed");
696 return -1;
697 }
698 Data |= 0x80;
699 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
700 if (status < 0) {
701 dbg("writing Spreg failed");
702 return -1;
703 }
704
705 Data &= ~0x80;
706 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
707 if (status < 0) {
708 dbg("writing Spreg failed");
709 return -1;
710 }
711
712/* End of block to be checked */
713/**************************CHECK***************************/
714
715 if (RS485mode == 0)
716 Data = 0xC0;
717 else
718 Data = 0x00;
719 status = set_uart_reg(port, SCRATCH_PAD_REGISTER, Data);
720 if (status < 0) {
721 dbg("Writing SCRATCH_PAD_REGISTER failed status-0x%x", status);
722 return -1;
723 } else
724 dbg("SCRATCH_PAD_REGISTER Writing success status%d", status);
725
726/**************************CHECK***************************/
727
728 Data = 0x0;
729 status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data);
730 if (status < 0) {
731 dbg("Reading Controlreg failed");
732 return -1;
733 }
734 Data |= 0x08; /* Driver done bit */
735 Data |= 0x20; /* rx_disable */
736 status = 0;
737 status =
738 set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data);
739 if (status < 0) {
740 dbg("writing Controlreg failed");
741 return -1;
742 }
743 /*
744 * do register settings here
745 * Set all regs to the device default values.
746 * First Disable all interrupts.
747 */
748
749 Data = 0x00;
750 status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
751 if (status < 0) {
752 dbg("disableing interrupts failed");
753 return -1;
754 }
755 /* Set FIFO_CONTROL_REGISTER to the default value */
756 Data = 0x00;
757 status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
758 if (status < 0) {
759 dbg("Writing FIFO_CONTROL_REGISTER failed");
760 return -1;
761 }
762
763 Data = 0xcf; /* chk */
764 status = set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
765 if (status < 0) {
766 dbg("Writing FIFO_CONTROL_REGISTER failed");
767 return -1;
768 }
769
770 Data = 0x03; /* LCR_BITS_8 */
771 status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
772 ATEN2011_port->shadowLCR = Data;
773
774 Data = 0x0b; /* MCR_DTR|MCR_RTS|MCR_MASTER_IE */
775 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
776 ATEN2011_port->shadowMCR = Data;
777
778#ifdef Check
779 Data = 0x00;
780 status = get_uart_reg(port, LINE_CONTROL_REGISTER, &Data);
781 ATEN2011_port->shadowLCR = Data;
782
783 Data |= SERIAL_LCR_DLAB; /* data latch enable in LCR 0x80 */
784 status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
785
786 Data = 0x0c;
787 status = set_uart_reg(port, DIVISOR_LATCH_LSB, Data);
788
789 Data = 0x0;
790 status = set_uart_reg(port, DIVISOR_LATCH_MSB, Data);
791
792 Data = 0x00;
793 status = get_uart_reg(port, LINE_CONTROL_REGISTER, &Data);
794
795/* Data = ATEN2011_port->shadowLCR; */ /* data latch disable */
796 Data = Data & ~SERIAL_LCR_DLAB;
797 status = set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
798 ATEN2011_port->shadowLCR = Data;
799#endif
800 /* clearing Bulkin and Bulkout Fifo */
801 Data = 0x0;
802 status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data);
803
804 Data = Data | 0x0c;
805 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
806
807 Data = Data & ~0x0c;
808 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
809 /* Finally enable all interrupts */
810 Data = 0x0;
811 Data = 0x0c;
812 status = set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
813
814 /* clearing rx_disable */
815 Data = 0x0;
816 status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data);
817 Data = Data & ~0x20;
818 status = set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data);
819
820 /* rx_negate */
821 Data = 0x0;
822 status = get_reg_sync(port, ATEN2011_port->ControlRegOffset, &Data);
823 Data = Data | 0x10;
824 status = 0;
825 status = set_reg_sync(port, ATEN2011_port->ControlRegOffset, Data);
826
827 /*
828 * Check to see if we've set up our endpoint info yet
829 * (can't set it up in ATEN2011_startup as the structures
830 * were not set up at that time.)
831 */
832 if (ATEN2011_serial->NoOfOpenPorts == 1) {
833 /* start the status polling here */
834 ATEN2011_serial->status_polling_started = 1;
835 /* If not yet set, Set here */
836 ATEN2011_serial->interrupt_in_buffer =
837 serial->port[0]->interrupt_in_buffer;
838 ATEN2011_serial->interrupt_in_endpoint =
839 serial->port[0]->interrupt_in_endpointAddress;
840 ATEN2011_serial->interrupt_read_urb =
841 serial->port[0]->interrupt_in_urb;
842
843 /* set up interrupt urb */
844 usb_fill_int_urb(ATEN2011_serial->interrupt_read_urb,
845 serial->dev,
846 usb_rcvintpipe(serial->dev,
847 ATEN2011_serial->
848 interrupt_in_endpoint),
849 ATEN2011_serial->interrupt_in_buffer,
850 ATEN2011_serial->interrupt_read_urb->
851 transfer_buffer_length,
852 ATEN2011_interrupt_callback, ATEN2011_serial,
853 ATEN2011_serial->interrupt_read_urb->interval);
854
855 /* start interrupt read for ATEN2011 *
856 * will continue as long as ATEN2011 is connected */
857
858 response =
859 usb_submit_urb(ATEN2011_serial->interrupt_read_urb,
860 GFP_KERNEL);
861 if (response) {
862 dbg("%s - Error %d submitting interrupt urb",
863 __func__, response);
864 }
865
866 }
867
868 /*
869 * See if we've set up our endpoint info yet
870 * (can't set it up in ATEN2011_startup as the
871 * structures were not set up at that time.)
872 */
873
874 dbg("port number is %d", port->number);
875 dbg("serial number is %d", port->serial->minor);
876 dbg("Bulkin endpoint is %d", port->bulk_in_endpointAddress);
877 dbg("BulkOut endpoint is %d", port->bulk_out_endpointAddress);
878 dbg("Interrupt endpoint is %d",
879 port->interrupt_in_endpointAddress);
880 dbg("port's number in the device is %d", ATEN2011_port->port_num);
881 ATEN2011_port->bulk_in_buffer = port->bulk_in_buffer;
882 ATEN2011_port->bulk_in_endpoint = port->bulk_in_endpointAddress;
883 ATEN2011_port->read_urb = port->read_urb;
884 ATEN2011_port->bulk_out_endpoint = port->bulk_out_endpointAddress;
885
886 minor = port->serial->minor;
887 if (minor == SERIAL_TTY_NO_MINOR)
888 minor = 0;
889
890 /* set up our bulk in urb */
891 if ((ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)
892 && (((__u16) port->number - (__u16) (minor)) != 0)) {
893 usb_fill_bulk_urb(ATEN2011_port->read_urb, serial->dev,
894 usb_rcvbulkpipe(serial->dev,
895 (port->
896 bulk_in_endpointAddress +
897 2)), port->bulk_in_buffer,
898 ATEN2011_port->read_urb->
899 transfer_buffer_length,
900 ATEN2011_bulk_in_callback, ATEN2011_port);
901 } else
902 usb_fill_bulk_urb(ATEN2011_port->read_urb,
903 serial->dev,
904 usb_rcvbulkpipe(serial->dev,
905 port->
906 bulk_in_endpointAddress),
907 port->bulk_in_buffer,
908 ATEN2011_port->read_urb->
909 transfer_buffer_length,
910 ATEN2011_bulk_in_callback, ATEN2011_port);
911
912 dbg("ATEN2011_open: bulkin endpoint is %d",
913 port->bulk_in_endpointAddress);
914 response = usb_submit_urb(ATEN2011_port->read_urb, GFP_KERNEL);
915 if (response) {
916 err("%s - Error %d submitting control urb", __func__,
917 response);
918 }
919
920 /* initialize our wait queues */
921 init_waitqueue_head(&ATEN2011_port->wait_chase);
922 init_waitqueue_head(&ATEN2011_port->wait_command);
923
924 /* initialize our icount structure */
925 memset(&(ATEN2011_port->icount), 0x00, sizeof(ATEN2011_port->icount));
926
927 /* initialize our port settings */
928 ATEN2011_port->shadowMCR = MCR_MASTER_IE; /* Must set to enable ints! */
929 ATEN2011_port->chaseResponsePending = 0;
930 /* send a open port command */
931 ATEN2011_port->open = 1;
932 /* ATEN2011_change_port_settings(ATEN2011_port,old_termios); */
933 /* Setup termios */
934 ATEN2011_set_termios(tty, port, &tmp_termios);
935 ATEN2011_port->icount.tx = 0;
936 ATEN2011_port->icount.rx = 0;
937
938 dbg("usb_serial serial:%x ATEN2011_port:%x\nATEN2011_serial:%x usb_serial_port port:%x",
939 (unsigned int)serial, (unsigned int)ATEN2011_port,
940 (unsigned int)ATEN2011_serial, (unsigned int)port);
941
942 return 0;
943
944}
945
946static int ATEN2011_chars_in_buffer(struct tty_struct *tty)
947{
948 struct usb_serial_port *port = tty->driver_data;
949 int i;
950 int chars = 0;
951 struct ATENINTL_port *ATEN2011_port;
952
953 /* dbg("%s"," ATEN2011_chars_in_buffer:entering ..........."); */
954
955 ATEN2011_port = usb_get_serial_port_data(port);
956 if (ATEN2011_port == NULL) {
957 dbg("%s", "ATEN2011_break:leaving ...........");
958 return -1;
959 }
960
961 for (i = 0; i < NUM_URBS; ++i)
962 if (ATEN2011_port->write_urb_pool[i]->status == -EINPROGRESS)
963 chars += URB_TRANSFER_BUFFER_SIZE;
964
965 dbg("%s - returns %d", __func__, chars);
966 return chars;
967
968}
969
970static void ATEN2011_block_until_tx_empty(struct tty_struct *tty,
971 struct ATENINTL_port *ATEN2011_port)
972{
973 int timeout = HZ / 10;
974 int wait = 30;
975 int count;
976
977 while (1) {
978 count = ATEN2011_chars_in_buffer(tty);
979
980 /* Check for Buffer status */
981 if (count <= 0)
982 return;
983
984 /* Block the thread for a while */
985 interruptible_sleep_on_timeout(&ATEN2011_port->wait_chase,
986 timeout);
987
988 /* No activity.. count down section */
989 wait--;
990 if (wait == 0) {
991 dbg("%s - TIMEOUT", __func__);
992 return;
993 } else {
994 /* Reset timout value back to seconds */
995 wait = 30;
996 }
997 }
998}
999
1000static void ATEN2011_close(struct tty_struct *tty, struct usb_serial_port *port,
1001 struct file *filp)
1002{
1003 struct usb_serial *serial;
1004 struct ATENINTL_serial *ATEN2011_serial;
1005 struct ATENINTL_port *ATEN2011_port;
1006 int no_urbs;
1007 __u16 Data;
1008
1009 dbg("%s", "ATEN2011_close:entering...");
1010 serial = port->serial;
1011
1012 /* take the Adpater and port's private data */
1013 ATEN2011_serial = usb_get_serial_data(serial);
1014 ATEN2011_port = usb_get_serial_port_data(port);
1015 if ((ATEN2011_serial == NULL) || (ATEN2011_port == NULL))
1016 return;
1017
1018 if (serial->dev) {
1019 /* flush and block(wait) until tx is empty */
1020 ATEN2011_block_until_tx_empty(tty, ATEN2011_port);
1021 }
1022 /* kill the ports URB's */
1023 for (no_urbs = 0; no_urbs < NUM_URBS; no_urbs++)
1024 usb_kill_urb(ATEN2011_port->write_urb_pool[no_urbs]);
1025 /* Freeing Write URBs */
1026 for (no_urbs = 0; no_urbs < NUM_URBS; ++no_urbs) {
1027 kfree(ATEN2011_port->write_urb_pool[no_urbs]->transfer_buffer);
1028 usb_free_urb(ATEN2011_port->write_urb_pool[no_urbs]);
1029 }
1030 /* While closing port, shutdown all bulk read, write *
1031 * and interrupt read if they exists */
1032 if (serial->dev) {
1033 if (ATEN2011_port->write_urb) {
1034 dbg("%s", "Shutdown bulk write");
1035 usb_kill_urb(ATEN2011_port->write_urb);
1036 }
1037 if (ATEN2011_port->read_urb) {
1038 dbg("%s", "Shutdown bulk read");
1039 usb_kill_urb(ATEN2011_port->read_urb);
1040 }
1041 if ((&ATEN2011_port->control_urb)) {
1042 dbg("%s", "Shutdown control read");
1043 /* usb_kill_urb (ATEN2011_port->control_urb); */
1044
1045 }
1046 }
1047 /* if(ATEN2011_port->ctrl_buf != NULL) */
1048 /* kfree(ATEN2011_port->ctrl_buf); */
1049 /* decrement the no.of open ports counter of an individual USB-serial adapter. */
1050 ATEN2011_serial->NoOfOpenPorts--;
1051 dbg("NoOfOpenPorts in close%d:in port%d",
1052 ATEN2011_serial->NoOfOpenPorts, port->number);
1053 if (ATEN2011_serial->NoOfOpenPorts == 0) {
1054 /* stop the stus polling here */
1055 ATEN2011_serial->status_polling_started = 0;
1056 if (ATEN2011_serial->interrupt_read_urb) {
1057 dbg("%s", "Shutdown interrupt_read_urb");
1058 /* ATEN2011_serial->interrupt_in_buffer=NULL; */
1059 /* usb_kill_urb (ATEN2011_serial->interrupt_read_urb); */
1060 }
1061 }
1062 if (ATEN2011_port->write_urb) {
1063 /* if this urb had a transfer buffer already (old tx) free it */
1064 kfree(ATEN2011_port->write_urb->transfer_buffer);
1065 usb_free_urb(ATEN2011_port->write_urb);
1066 }
1067
1068 /* clear the MCR & IER */
1069 Data = 0x00;
1070 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1071 Data = 0x00;
1072 set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
1073
1074 ATEN2011_port->open = 0;
1075 dbg("%s", "Leaving ............");
1076
1077}
1078
1079static void ATEN2011_block_until_chase_response(struct tty_struct *tty,
1080 struct ATENINTL_port
1081 *ATEN2011_port)
1082{
1083 int timeout = 1 * HZ;
1084 int wait = 10;
1085 int count;
1086
1087 while (1) {
1088 count = ATEN2011_chars_in_buffer(tty);
1089
1090 /* Check for Buffer status */
1091 if (count <= 0) {
1092 ATEN2011_port->chaseResponsePending = 0;
1093 return;
1094 }
1095
1096 /* Block the thread for a while */
1097 interruptible_sleep_on_timeout(&ATEN2011_port->wait_chase,
1098 timeout);
1099 /* No activity.. count down section */
1100 wait--;
1101 if (wait == 0) {
1102 dbg("%s - TIMEOUT", __func__);
1103 return;
1104 } else {
1105 /* Reset timout value back to seconds */
1106 wait = 10;
1107 }
1108 }
1109
1110}
1111
1112static void ATEN2011_break(struct tty_struct *tty, int break_state)
1113{
1114 struct usb_serial_port *port = tty->driver_data;
1115 unsigned char data;
1116 struct usb_serial *serial;
1117 struct ATENINTL_serial *ATEN2011_serial;
1118 struct ATENINTL_port *ATEN2011_port;
1119
1120 dbg("%s", "Entering ...........");
1121 dbg("ATEN2011_break: Start");
1122
1123 serial = port->serial;
1124
1125 ATEN2011_serial = usb_get_serial_data(serial);
1126 ATEN2011_port = usb_get_serial_port_data(port);
1127
1128 if ((ATEN2011_serial == NULL) || (ATEN2011_port == NULL))
1129 return;
1130
1131 /* flush and chase */
1132 ATEN2011_port->chaseResponsePending = 1;
1133
1134 if (serial->dev) {
1135 /* flush and block until tx is empty */
1136 ATEN2011_block_until_chase_response(tty, ATEN2011_port);
1137 }
1138
1139 if (break_state == -1)
1140 data = ATEN2011_port->shadowLCR | LCR_SET_BREAK;
1141 else
1142 data = ATEN2011_port->shadowLCR & ~LCR_SET_BREAK;
1143
1144 ATEN2011_port->shadowLCR = data;
1145 dbg("ATEN2011_break ATEN2011_port->shadowLCR is %x",
1146 ATEN2011_port->shadowLCR);
1147 set_uart_reg(port, LINE_CONTROL_REGISTER, ATEN2011_port->shadowLCR);
1148
1149 return;
1150}
1151
1152static int ATEN2011_write_room(struct tty_struct *tty)
1153{
1154 struct usb_serial_port *port = tty->driver_data;
1155 int i;
1156 int room = 0;
1157 struct ATENINTL_port *ATEN2011_port;
1158
1159 ATEN2011_port = usb_get_serial_port_data(port);
1160 if (ATEN2011_port == NULL) {
1161 dbg("%s", "ATEN2011_break:leaving ...........");
1162 return -1;
1163 }
1164
1165 for (i = 0; i < NUM_URBS; ++i)
1166 if (ATEN2011_port->write_urb_pool[i]->status != -EINPROGRESS)
1167 room += URB_TRANSFER_BUFFER_SIZE;
1168
1169 dbg("%s - returns %d", __func__, room);
1170 return room;
1171
1172}
1173
1174static int ATEN2011_write(struct tty_struct *tty, struct usb_serial_port *port,
1175 const unsigned char *data, int count)
1176{
1177 int status;
1178 int i;
1179 int bytes_sent = 0;
1180 int transfer_size;
1181 int minor;
1182
1183 struct ATENINTL_port *ATEN2011_port;
1184 struct usb_serial *serial;
1185 struct ATENINTL_serial *ATEN2011_serial;
1186 struct urb *urb;
1187 const unsigned char *current_position = data;
1188 unsigned char *data1;
1189 dbg("%s", "entering ...........");
1190
1191 serial = port->serial;
1192
1193 ATEN2011_port = usb_get_serial_port_data(port);
1194 if (ATEN2011_port == NULL) {
1195 dbg("%s", "ATEN2011_port is NULL");
1196 return -1;
1197 }
1198
1199 ATEN2011_serial = usb_get_serial_data(serial);
1200 if (ATEN2011_serial == NULL) {
1201 dbg("%s", "ATEN2011_serial is NULL");
1202 return -1;
1203 }
1204
1205 /* try to find a free urb in the list */
1206 urb = NULL;
1207
1208 for (i = 0; i < NUM_URBS; ++i) {
1209 if (ATEN2011_port->write_urb_pool[i]->status != -EINPROGRESS) {
1210 urb = ATEN2011_port->write_urb_pool[i];
1211 dbg("URB:%d", i);
1212 break;
1213 }
1214 }
1215
1216 if (urb == NULL) {
1217 dbg("%s - no more free urbs", __func__);
1218 goto exit;
1219 }
1220
1221 if (urb->transfer_buffer == NULL) {
1222 urb->transfer_buffer =
1223 kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
1224
1225 if (urb->transfer_buffer == NULL) {
1226 err("%s no more kernel memory...", __func__);
1227 goto exit;
1228 }
1229 }
1230 transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE);
1231
1232 memcpy(urb->transfer_buffer, current_position, transfer_size);
1233 /* usb_serial_debug_data (__FILE__, __func__, transfer_size, urb->transfer_buffer); */
1234
1235 /* fill urb with data and submit */
1236 minor = port->serial->minor;
1237 if (minor == SERIAL_TTY_NO_MINOR)
1238 minor = 0;
1239 if ((ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)
1240 && (((__u16) port->number - (__u16) (minor)) != 0)) {
1241 usb_fill_bulk_urb(urb, ATEN2011_serial->serial->dev,
1242 usb_sndbulkpipe(ATEN2011_serial->serial->dev,
1243 (port->
1244 bulk_out_endpointAddress) +
1245 2), urb->transfer_buffer,
1246 transfer_size,
1247 ATEN2011_bulk_out_data_callback,
1248 ATEN2011_port);
1249 } else
1250
1251 usb_fill_bulk_urb(urb,
1252 ATEN2011_serial->serial->dev,
1253 usb_sndbulkpipe(ATEN2011_serial->serial->dev,
1254 port->
1255 bulk_out_endpointAddress),
1256 urb->transfer_buffer, transfer_size,
1257 ATEN2011_bulk_out_data_callback,
1258 ATEN2011_port);
1259
1260 data1 = urb->transfer_buffer;
1261 dbg("bulkout endpoint is %d", port->bulk_out_endpointAddress);
1262 /* for(i=0;i < urb->actual_length;i++) */
1263 /* dbg("Data is %c ",data1[i]); */
1264
1265 /* send it down the pipe */
1266 status = usb_submit_urb(urb, GFP_ATOMIC);
1267
1268 if (status) {
1269 err("%s - usb_submit_urb(write bulk) failed with status = %d",
1270 __func__, status);
1271 bytes_sent = status;
1272 goto exit;
1273 }
1274 bytes_sent = transfer_size;
1275 ATEN2011_port->icount.tx += transfer_size;
1276 dbg("ATEN2011_port->icount.tx is %d:", ATEN2011_port->icount.tx);
1277
1278exit:
1279 return bytes_sent;
1280}
1281
1282static void ATEN2011_throttle(struct tty_struct *tty)
1283{
1284 struct usb_serial_port *port = tty->driver_data;
1285 struct ATENINTL_port *ATEN2011_port;
1286 int status;
1287
1288 dbg("- port %d", port->number);
1289
1290 ATEN2011_port = usb_get_serial_port_data(port);
1291
1292 if (ATEN2011_port == NULL)
1293 return;
1294
1295 if (!ATEN2011_port->open) {
1296 dbg("%s", "port not opened");
1297 return;
1298 }
1299
1300 dbg("%s", "Entering .......... ");
1301
1302 if (!tty) {
1303 dbg("%s - no tty available", __func__);
1304 return;
1305 }
1306
1307 /* if we are implementing XON/XOFF, send the stop character */
1308 if (I_IXOFF(tty)) {
1309 unsigned char stop_char = STOP_CHAR(tty);
1310 status = ATEN2011_write(tty, port, &stop_char, 1);
1311 if (status <= 0)
1312 return;
1313 }
1314
1315 /* if we are implementing RTS/CTS, toggle that line */
1316 if (tty->termios->c_cflag & CRTSCTS) {
1317 ATEN2011_port->shadowMCR &= ~MCR_RTS;
1318 status = set_uart_reg(port, MODEM_CONTROL_REGISTER,
1319 ATEN2011_port->shadowMCR);
1320 if (status < 0)
1321 return;
1322 }
1323
1324 return;
1325}
1326
1327static void ATEN2011_unthrottle(struct tty_struct *tty)
1328{
1329 struct usb_serial_port *port = tty->driver_data;
1330 int status;
1331 struct ATENINTL_port *ATEN2011_port = usb_get_serial_port_data(port);
1332
1333 if (ATEN2011_port == NULL)
1334 return;
1335
1336 if (!ATEN2011_port->open) {
1337 dbg("%s - port not opened", __func__);
1338 return;
1339 }
1340
1341 dbg("%s", "Entering .......... ");
1342
1343 if (!tty) {
1344 dbg("%s - no tty available", __func__);
1345 return;
1346 }
1347
1348 /* if we are implementing XON/XOFF, send the start character */
1349 if (I_IXOFF(tty)) {
1350 unsigned char start_char = START_CHAR(tty);
1351 status = ATEN2011_write(tty, port, &start_char, 1);
1352 if (status <= 0)
1353 return;
1354 }
1355
1356 /* if we are implementing RTS/CTS, toggle that line */
1357 if (tty->termios->c_cflag & CRTSCTS) {
1358 ATEN2011_port->shadowMCR |= MCR_RTS;
1359 status = set_uart_reg(port, MODEM_CONTROL_REGISTER,
1360 ATEN2011_port->shadowMCR);
1361 if (status < 0)
1362 return;
1363 }
1364
1365 return;
1366}
1367
1368static int ATEN2011_tiocmget(struct tty_struct *tty, struct file *file)
1369{
1370 struct usb_serial_port *port = tty->driver_data;
1371 struct ATENINTL_port *ATEN2011_port;
1372 unsigned int result;
1373 __u16 msr;
1374 __u16 mcr;
1375 /* unsigned int mcr; */
1376 int status = 0;
1377 ATEN2011_port = usb_get_serial_port_data(port);
1378
1379 dbg("%s - port %d", __func__, port->number);
1380
1381 if (ATEN2011_port == NULL)
1382 return -ENODEV;
1383
1384 status = get_uart_reg(port, MODEM_STATUS_REGISTER, &msr);
1385 status = get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr);
1386 /* mcr = ATEN2011_port->shadowMCR; */
1387 /* COMMENT2: the Fallowing three line are commented for updating only MSR values */
1388 result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0)
1389 | ((mcr & MCR_RTS) ? TIOCM_RTS : 0)
1390 | ((mcr & MCR_LOOPBACK) ? TIOCM_LOOP : 0)
1391 | ((msr & ATEN2011_MSR_CTS) ? TIOCM_CTS : 0)
1392 | ((msr & ATEN2011_MSR_CD) ? TIOCM_CAR : 0)
1393 | ((msr & ATEN2011_MSR_RI) ? TIOCM_RI : 0)
1394 | ((msr & ATEN2011_MSR_DSR) ? TIOCM_DSR : 0);
1395
1396 dbg("%s - 0x%04X", __func__, result);
1397
1398 return result;
1399}
1400
1401static int ATEN2011_tiocmset(struct tty_struct *tty, struct file *file,
1402 unsigned int set, unsigned int clear)
1403{
1404 struct usb_serial_port *port = tty->driver_data;
1405 struct ATENINTL_port *ATEN2011_port;
1406 unsigned int mcr;
1407 unsigned int status;
1408
1409 dbg("%s - port %d", __func__, port->number);
1410
1411 ATEN2011_port = usb_get_serial_port_data(port);
1412
1413 if (ATEN2011_port == NULL)
1414 return -ENODEV;
1415
1416 mcr = ATEN2011_port->shadowMCR;
1417 if (clear & TIOCM_RTS)
1418 mcr &= ~MCR_RTS;
1419 if (clear & TIOCM_DTR)
1420 mcr &= ~MCR_DTR;
1421 if (clear & TIOCM_LOOP)
1422 mcr &= ~MCR_LOOPBACK;
1423
1424 if (set & TIOCM_RTS)
1425 mcr |= MCR_RTS;
1426 if (set & TIOCM_DTR)
1427 mcr |= MCR_DTR;
1428 if (set & TIOCM_LOOP)
1429 mcr |= MCR_LOOPBACK;
1430
1431 ATEN2011_port->shadowMCR = mcr;
1432
1433 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr);
1434 if (status < 0) {
1435 dbg("setting MODEM_CONTROL_REGISTER Failed");
1436 return -1;
1437 }
1438
1439 return 0;
1440}
1441
1442static void ATEN2011_set_termios(struct tty_struct *tty,
1443 struct usb_serial_port *port,
1444 struct ktermios *old_termios)
1445{
1446 int status;
1447 unsigned int cflag;
1448 struct usb_serial *serial;
1449 struct ATENINTL_port *ATEN2011_port;
1450
1451 dbg("ATEN2011_set_termios: START");
1452
1453 serial = port->serial;
1454
1455 ATEN2011_port = usb_get_serial_port_data(port);
1456
1457 if (ATEN2011_port == NULL)
1458 return;
1459
1460 if (!ATEN2011_port->open) {
1461 dbg("%s - port not opened", __func__);
1462 return;
1463 }
1464
1465 dbg("%s", "setting termios - ");
1466
1467 cflag = tty->termios->c_cflag;
1468
1469 dbg("%s - cflag %08x iflag %08x", __func__,
1470 tty->termios->c_cflag, RELEVANT_IFLAG(tty->termios->c_iflag));
1471
1472 if (old_termios) {
1473 dbg("%s - old clfag %08x old iflag %08x", __func__,
1474 old_termios->c_cflag, RELEVANT_IFLAG(old_termios->c_iflag));
1475 }
1476
1477 dbg("%s - port %d", __func__, port->number);
1478
1479 /* change the port settings to the new ones specified */
1480
1481 ATEN2011_change_port_settings(tty, ATEN2011_port, old_termios);
1482
1483 if (!ATEN2011_port->read_urb) {
1484 dbg("%s", "URB KILLED !!!!!");
1485 return;
1486 }
1487
1488 if (ATEN2011_port->read_urb->status != -EINPROGRESS) {
1489 ATEN2011_port->read_urb->dev = serial->dev;
1490 status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC);
1491 if (status) {
1492 dbg
1493 (" usb_submit_urb(read bulk) failed, status = %d",
1494 status);
1495 }
1496 }
1497 return;
1498}
1499
1500static int get_lsr_info(struct tty_struct *tty,
1501 struct ATENINTL_port *ATEN2011_port,
1502 unsigned int __user *value)
1503{
1504 int count;
1505 unsigned int result = 0;
1506
1507 count = ATEN2011_chars_in_buffer(tty);
1508 if (count == 0) {
1509 dbg("%s -- Empty", __func__);
1510 result = TIOCSER_TEMT;
1511 }
1512
1513 if (copy_to_user(value, &result, sizeof(int)))
1514 return -EFAULT;
1515 return 0;
1516}
1517
1518static int get_number_bytes_avail(struct tty_struct *tty,
1519 struct ATENINTL_port *ATEN2011_port,
1520 unsigned int __user *value)
1521{
1522 unsigned int result = 0;
1523
1524 if (!tty)
1525 return -ENOIOCTLCMD;
1526
1527 result = tty->read_cnt;
1528
1529 dbg("%s(%d) = %d", __func__, ATEN2011_port->port->number, result);
1530 if (copy_to_user(value, &result, sizeof(int)))
1531 return -EFAULT;
1532
1533 return -ENOIOCTLCMD;
1534}
1535
1536static int set_modem_info(struct ATENINTL_port *ATEN2011_port, unsigned int cmd,
1537 unsigned int __user *value)
1538{
1539 unsigned int mcr;
1540 unsigned int arg;
1541 __u16 Data;
1542 int status;
1543 struct usb_serial_port *port;
1544
1545 if (ATEN2011_port == NULL)
1546 return -1;
1547
1548 port = (struct usb_serial_port *)ATEN2011_port->port;
1549
1550 mcr = ATEN2011_port->shadowMCR;
1551
1552 if (copy_from_user(&arg, value, sizeof(int)))
1553 return -EFAULT;
1554
1555 switch (cmd) {
1556 case TIOCMBIS:
1557 if (arg & TIOCM_RTS)
1558 mcr |= MCR_RTS;
1559 if (arg & TIOCM_DTR)
1560 mcr |= MCR_RTS;
1561 if (arg & TIOCM_LOOP)
1562 mcr |= MCR_LOOPBACK;
1563 break;
1564
1565 case TIOCMBIC:
1566 if (arg & TIOCM_RTS)
1567 mcr &= ~MCR_RTS;
1568 if (arg & TIOCM_DTR)
1569 mcr &= ~MCR_RTS;
1570 if (arg & TIOCM_LOOP)
1571 mcr &= ~MCR_LOOPBACK;
1572 break;
1573
1574 case TIOCMSET:
1575 /* turn off the RTS and DTR and LOOPBACK
1576 * and then only turn on what was asked to */
1577 mcr &= ~(MCR_RTS | MCR_DTR | MCR_LOOPBACK);
1578 mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0);
1579 mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0);
1580 mcr |= ((arg & TIOCM_LOOP) ? MCR_LOOPBACK : 0);
1581 break;
1582 }
1583
1584 ATEN2011_port->shadowMCR = mcr;
1585
1586 Data = ATEN2011_port->shadowMCR;
1587 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1588 if (status < 0) {
1589 dbg("setting MODEM_CONTROL_REGISTER Failed");
1590 return -1;
1591 }
1592
1593 return 0;
1594}
1595
1596static int get_modem_info(struct ATENINTL_port *ATEN2011_port,
1597 unsigned int __user *value)
1598{
1599 unsigned int result = 0;
1600 __u16 msr;
1601 unsigned int mcr = ATEN2011_port->shadowMCR;
1602 int status;
1603
1604 status = get_uart_reg(ATEN2011_port->port, MODEM_STATUS_REGISTER, &msr);
1605 result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0) /* 0x002 */
1606 |((mcr & MCR_RTS) ? TIOCM_RTS : 0) /* 0x004 */
1607 |((msr & ATEN2011_MSR_CTS) ? TIOCM_CTS : 0) /* 0x020 */
1608 |((msr & ATEN2011_MSR_CD) ? TIOCM_CAR : 0) /* 0x040 */
1609 |((msr & ATEN2011_MSR_RI) ? TIOCM_RI : 0) /* 0x080 */
1610 |((msr & ATEN2011_MSR_DSR) ? TIOCM_DSR : 0); /* 0x100 */
1611
1612 dbg("%s -- %x", __func__, result);
1613
1614 if (copy_to_user(value, &result, sizeof(int)))
1615 return -EFAULT;
1616 return 0;
1617}
1618
1619static int get_serial_info(struct ATENINTL_port *ATEN2011_port,
1620 struct serial_struct __user *retinfo)
1621{
1622 struct serial_struct tmp;
1623
1624 if (ATEN2011_port == NULL)
1625 return -1;
1626
1627 if (!retinfo)
1628 return -EFAULT;
1629
1630 memset(&tmp, 0, sizeof(tmp));
1631
1632 tmp.type = PORT_16550A;
1633 tmp.line = ATEN2011_port->port->serial->minor;
1634 if (tmp.line == SERIAL_TTY_NO_MINOR)
1635 tmp.line = 0;
1636 tmp.port = ATEN2011_port->port->number;
1637 tmp.irq = 0;
1638 tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
1639 tmp.xmit_fifo_size = NUM_URBS * URB_TRANSFER_BUFFER_SIZE;
1640 tmp.baud_base = 9600;
1641 tmp.close_delay = 5 * HZ;
1642 tmp.closing_wait = 30 * HZ;
1643
1644 if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
1645 return -EFAULT;
1646 return 0;
1647}
1648
1649static int ATEN2011_ioctl(struct tty_struct *tty, struct file *file,
1650 unsigned int cmd, unsigned long arg)
1651{
1652 struct usb_serial_port *port = tty->driver_data;
1653 struct ATENINTL_port *ATEN2011_port;
1654 struct async_icount cnow;
1655 struct async_icount cprev;
1656 struct serial_icounter_struct icount;
1657 int ATENret = 0;
1658 unsigned int __user *user_arg = (unsigned int __user *)arg;
1659
1660 ATEN2011_port = usb_get_serial_port_data(port);
1661
1662 if (ATEN2011_port == NULL)
1663 return -1;
1664
1665 dbg("%s - port %d, cmd = 0x%x", __func__, port->number, cmd);
1666
1667 switch (cmd) {
1668 /* return number of bytes available */
1669
1670 case TIOCINQ:
1671 dbg("%s (%d) TIOCINQ", __func__, port->number);
1672 return get_number_bytes_avail(tty, ATEN2011_port, user_arg);
1673 break;
1674
1675 case TIOCOUTQ:
1676 dbg("%s (%d) TIOCOUTQ", __func__, port->number);
1677 return put_user(ATEN2011_chars_in_buffer(tty), user_arg);
1678 break;
1679
1680 case TIOCSERGETLSR:
1681 dbg("%s (%d) TIOCSERGETLSR", __func__, port->number);
1682 return get_lsr_info(tty, ATEN2011_port, user_arg);
1683 return 0;
1684
1685 case TIOCMBIS:
1686 case TIOCMBIC:
1687 case TIOCMSET:
1688 dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __func__,
1689 port->number);
1690 ATENret = set_modem_info(ATEN2011_port, cmd, user_arg);
1691 return ATENret;
1692
1693 case TIOCMGET:
1694 dbg("%s (%d) TIOCMGET", __func__, port->number);
1695 return get_modem_info(ATEN2011_port, user_arg);
1696
1697 case TIOCGSERIAL:
1698 dbg("%s (%d) TIOCGSERIAL", __func__, port->number);
1699 return get_serial_info(ATEN2011_port,
1700 (struct serial_struct __user *)arg);
1701
1702 case TIOCSSERIAL:
1703 dbg("%s (%d) TIOCSSERIAL", __func__, port->number);
1704 break;
1705
1706 case TIOCMIWAIT:
1707 dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
1708 cprev = ATEN2011_port->icount;
1709 while (1) {
1710 /* see if a signal did it */
1711 if (signal_pending(current))
1712 return -ERESTARTSYS;
1713 cnow = ATEN2011_port->icount;
1714 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
1715 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
1716 return -EIO; /* no change => error */
1717 if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
1718 ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
1719 ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) ||
1720 ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts))) {
1721 return 0;
1722 }
1723 cprev = cnow;
1724 }
1725 /* NOTREACHED */
1726 break;
1727
1728 case TIOCGICOUNT:
1729 cnow = ATEN2011_port->icount;
1730 icount.cts = cnow.cts;
1731 icount.dsr = cnow.dsr;
1732 icount.rng = cnow.rng;
1733 icount.dcd = cnow.dcd;
1734 icount.rx = cnow.rx;
1735 icount.tx = cnow.tx;
1736 icount.frame = cnow.frame;
1737 icount.overrun = cnow.overrun;
1738 icount.parity = cnow.parity;
1739 icount.brk = cnow.brk;
1740 icount.buf_overrun = cnow.buf_overrun;
1741
1742 dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__,
1743 port->number, icount.rx, icount.tx);
1744 if (copy_to_user((void __user *)arg, &icount, sizeof(icount)))
1745 return -EFAULT;
1746 return 0;
1747
1748 default:
1749 break;
1750 }
1751
1752 return -ENOIOCTLCMD;
1753}
1754
1755static int ATEN2011_calc_baud_rate_divisor(int baudRate, int *divisor,
1756 __u16 *clk_sel_val)
1757{
1758 dbg("%s - %d", __func__, baudRate);
1759
1760 if (baudRate <= 115200) {
1761 *divisor = 115200 / baudRate;
1762 *clk_sel_val = 0x0;
1763 }
1764 if ((baudRate > 115200) && (baudRate <= 230400)) {
1765 *divisor = 230400 / baudRate;
1766 *clk_sel_val = 0x10;
1767 } else if ((baudRate > 230400) && (baudRate <= 403200)) {
1768 *divisor = 403200 / baudRate;
1769 *clk_sel_val = 0x20;
1770 } else if ((baudRate > 403200) && (baudRate <= 460800)) {
1771 *divisor = 460800 / baudRate;
1772 *clk_sel_val = 0x30;
1773 } else if ((baudRate > 460800) && (baudRate <= 806400)) {
1774 *divisor = 806400 / baudRate;
1775 *clk_sel_val = 0x40;
1776 } else if ((baudRate > 806400) && (baudRate <= 921600)) {
1777 *divisor = 921600 / baudRate;
1778 *clk_sel_val = 0x50;
1779 } else if ((baudRate > 921600) && (baudRate <= 1572864)) {
1780 *divisor = 1572864 / baudRate;
1781 *clk_sel_val = 0x60;
1782 } else if ((baudRate > 1572864) && (baudRate <= 3145728)) {
1783 *divisor = 3145728 / baudRate;
1784 *clk_sel_val = 0x70;
1785 }
1786 return 0;
1787}
1788
1789static int ATEN2011_send_cmd_write_baud_rate(struct ATENINTL_port
1790 *ATEN2011_port, int baudRate)
1791{
1792 int divisor = 0;
1793 int status;
1794 __u16 Data;
1795 unsigned char number;
1796 __u16 clk_sel_val;
1797 struct usb_serial_port *port;
1798 int minor;
1799
1800 if (ATEN2011_port == NULL)
1801 return -1;
1802
1803 port = (struct usb_serial_port *)ATEN2011_port->port;
1804
1805 dbg("%s", "Entering .......... ");
1806
1807 minor = ATEN2011_port->port->serial->minor;
1808 if (minor == SERIAL_TTY_NO_MINOR)
1809 minor = 0;
1810 number = ATEN2011_port->port->number - minor;
1811
1812 dbg("%s - port = %d, baud = %d", __func__,
1813 ATEN2011_port->port->number, baudRate);
1814 /* reset clk_uart_sel in spregOffset */
1815 if (baudRate > 115200) {
1816#ifdef HW_flow_control
1817 /*
1818 * NOTE: need to see the pther register to modify
1819 * setting h/w flow control bit to 1;
1820 */
1821 /* Data = ATEN2011_port->shadowMCR; */
1822 Data = 0x2b;
1823 ATEN2011_port->shadowMCR = Data;
1824 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1825 if (status < 0) {
1826 dbg("Writing spreg failed in set_serial_baud");
1827 return -1;
1828 }
1829#endif
1830
1831 } else {
1832#ifdef HW_flow_control
1833 /* setting h/w flow control bit to 0; */
1834 /* Data = ATEN2011_port->shadowMCR; */
1835 Data = 0xb;
1836 ATEN2011_port->shadowMCR = Data;
1837 status = set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
1838 if (status < 0) {
1839 dbg("Writing spreg failed in set_serial_baud");
1840 return -1;
1841 }
1842#endif
1843
1844 }
1845
1846 if (1) /* baudRate <= 115200) */ {
1847 clk_sel_val = 0x0;
1848 Data = 0x0;
1849 status =
1850 ATEN2011_calc_baud_rate_divisor(baudRate, &divisor,
1851 &clk_sel_val);
1852 status = get_reg_sync(port, ATEN2011_port->SpRegOffset, &Data);
1853 if (status < 0) {
1854 dbg("reading spreg failed in set_serial_baud");
1855 return -1;
1856 }
1857 Data = (Data & 0x8f) | clk_sel_val;
1858 status = set_reg_sync(port, ATEN2011_port->SpRegOffset, Data);
1859 if (status < 0) {
1860 dbg("Writing spreg failed in set_serial_baud");
1861 return -1;
1862 }
1863 /* Calculate the Divisor */
1864
1865 if (status) {
1866 err("%s - bad baud rate", __func__);
1867 dbg("%s", "bad baud rate");
1868 return status;
1869 }
1870 /* Enable access to divisor latch */
1871 Data = ATEN2011_port->shadowLCR | SERIAL_LCR_DLAB;
1872 ATEN2011_port->shadowLCR = Data;
1873 set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
1874
1875 /* Write the divisor */
1876 Data = (unsigned char)(divisor & 0xff);
1877 dbg("set_serial_baud Value to write DLL is %x", Data);
1878 set_uart_reg(port, DIVISOR_LATCH_LSB, Data);
1879
1880 Data = (unsigned char)((divisor & 0xff00) >> 8);
1881 dbg("set_serial_baud Value to write DLM is %x", Data);
1882 set_uart_reg(port, DIVISOR_LATCH_MSB, Data);
1883
1884 /* Disable access to divisor latch */
1885 Data = ATEN2011_port->shadowLCR & ~SERIAL_LCR_DLAB;
1886 ATEN2011_port->shadowLCR = Data;
1887 set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
1888
1889 }
1890
1891 return status;
1892}
1893
1894static void ATEN2011_change_port_settings(struct tty_struct *tty,
1895 struct ATENINTL_port *ATEN2011_port,
1896 struct ktermios *old_termios)
1897{
1898 int baud;
1899 unsigned cflag;
1900 unsigned iflag;
1901 __u8 lData;
1902 __u8 lParity;
1903 __u8 lStop;
1904 int status;
1905 __u16 Data;
1906 struct usb_serial_port *port;
1907 struct usb_serial *serial;
1908
1909 if (ATEN2011_port == NULL)
1910 return;
1911
1912 port = (struct usb_serial_port *)ATEN2011_port->port;
1913
1914 serial = port->serial;
1915
1916 dbg("%s - port %d", __func__, ATEN2011_port->port->number);
1917
1918 if (!ATEN2011_port->open) {
1919 dbg("%s - port not opened", __func__);
1920 return;
1921 }
1922
1923 if ((!tty) || (!tty->termios)) {
1924 dbg("%s - no tty structures", __func__);
1925 return;
1926 }
1927
1928 dbg("%s", "Entering .......... ");
1929
1930 lData = LCR_BITS_8;
1931 lStop = LCR_STOP_1;
1932 lParity = LCR_PAR_NONE;
1933
1934 cflag = tty->termios->c_cflag;
1935 iflag = tty->termios->c_iflag;
1936
1937 /* Change the number of bits */
1938
1939 /* COMMENT1: the below Line"if(cflag & CSIZE)" is added for the errors we get for serial loop data test i.e serial_loopback.pl -v */
1940 /* if(cflag & CSIZE) */
1941 {
1942 switch (cflag & CSIZE) {
1943 case CS5:
1944 lData = LCR_BITS_5;
1945 break;
1946
1947 case CS6:
1948 lData = LCR_BITS_6;
1949 break;
1950
1951 case CS7:
1952 lData = LCR_BITS_7;
1953 break;
1954 default:
1955 case CS8:
1956 lData = LCR_BITS_8;
1957 break;
1958 }
1959 }
1960 /* Change the Parity bit */
1961 if (cflag & PARENB) {
1962 if (cflag & PARODD) {
1963 lParity = LCR_PAR_ODD;
1964 dbg("%s - parity = odd", __func__);
1965 } else {
1966 lParity = LCR_PAR_EVEN;
1967 dbg("%s - parity = even", __func__);
1968 }
1969
1970 } else {
1971 dbg("%s - parity = none", __func__);
1972 }
1973
1974 if (cflag & CMSPAR)
1975 lParity = lParity | 0x20;
1976
1977 /* Change the Stop bit */
1978 if (cflag & CSTOPB) {
1979 lStop = LCR_STOP_2;
1980 dbg("%s - stop bits = 2", __func__);
1981 } else {
1982 lStop = LCR_STOP_1;
1983 dbg("%s - stop bits = 1", __func__);
1984 }
1985
1986 /* Update the LCR with the correct value */
1987 ATEN2011_port->shadowLCR &=
1988 ~(LCR_BITS_MASK | LCR_STOP_MASK | LCR_PAR_MASK);
1989 ATEN2011_port->shadowLCR |= (lData | lParity | lStop);
1990
1991 dbg
1992 ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is %x",
1993 ATEN2011_port->shadowLCR);
1994 /* Disable Interrupts */
1995 Data = 0x00;
1996 set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
1997
1998 Data = 0x00;
1999 set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
2000
2001 Data = 0xcf;
2002 set_uart_reg(port, FIFO_CONTROL_REGISTER, Data);
2003
2004 /* Send the updated LCR value to the ATEN2011 */
2005 Data = ATEN2011_port->shadowLCR;
2006
2007 set_uart_reg(port, LINE_CONTROL_REGISTER, Data);
2008
2009 Data = 0x00b;
2010 ATEN2011_port->shadowMCR = Data;
2011 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
2012 Data = 0x00b;
2013 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
2014
2015 /* set up the MCR register and send it to the ATEN2011 */
2016
2017 ATEN2011_port->shadowMCR = MCR_MASTER_IE;
2018 if (cflag & CBAUD)
2019 ATEN2011_port->shadowMCR |= (MCR_DTR | MCR_RTS);
2020
2021 if (cflag & CRTSCTS)
2022 ATEN2011_port->shadowMCR |= (MCR_XON_ANY);
2023 else
2024 ATEN2011_port->shadowMCR &= ~(MCR_XON_ANY);
2025
2026 Data = ATEN2011_port->shadowMCR;
2027 set_uart_reg(port, MODEM_CONTROL_REGISTER, Data);
2028
2029 /* Determine divisor based on baud rate */
2030 baud = tty_get_baud_rate(tty);
2031
2032 if (!baud) {
2033 /* pick a default, any default... */
2034 dbg("%s", "Picked default baud...");
2035 baud = 9600;
2036 }
2037
2038 dbg("%s - baud rate = %d", __func__, baud);
2039 status = ATEN2011_send_cmd_write_baud_rate(ATEN2011_port, baud);
2040
2041 /* Enable Interrupts */
2042 Data = 0x0c;
2043 set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
2044
2045 if (ATEN2011_port->read_urb->status != -EINPROGRESS) {
2046 ATEN2011_port->read_urb->dev = serial->dev;
2047
2048 status = usb_submit_urb(ATEN2011_port->read_urb, GFP_ATOMIC);
2049
2050 if (status) {
2051 dbg
2052 (" usb_submit_urb(read bulk) failed, status = %d",
2053 status);
2054 }
2055 }
2056 dbg
2057 ("ATEN2011_change_port_settings ATEN2011_port->shadowLCR is End %x",
2058 ATEN2011_port->shadowLCR);
2059
2060 return;
2061}
2062
2063static int ATEN2011_calc_num_ports(struct usb_serial *serial)
2064{
2065
2066 __u16 Data = 0x00;
2067 int ret = 0;
2068 int ATEN2011_2or4ports;
2069 ret = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
2070 ATEN_RDREQ, ATEN_RD_RTYPE, 0, GPIO_REGISTER,
2071 &Data, VENDOR_READ_LENGTH, ATEN_WDR_TIMEOUT);
2072
2073/* ghostgum: here is where the problem appears to bet */
2074/* Which of the following are needed? */
2075/* Greg used the serial->type->num_ports=2 */
2076/* But the code in the ATEN2011_open relies on serial->num_ports=2 */
2077 if ((Data & 0x01) == 0) {
2078 ATEN2011_2or4ports = 2;
2079 serial->type->num_ports = 2;
2080 serial->num_ports = 2;
2081 }
2082 /* else if(serial->interface->cur_altsetting->desc.bNumEndpoints == 9) */
2083 else {
2084 ATEN2011_2or4ports = 4;
2085 serial->type->num_ports = 4;
2086 serial->num_ports = 4;
2087
2088 }
2089
2090 return ATEN2011_2or4ports;
2091}
2092
2093static int ATEN2011_startup(struct usb_serial *serial)
2094{
2095 struct ATENINTL_serial *ATEN2011_serial;
2096 struct ATENINTL_port *ATEN2011_port;
2097 struct usb_device *dev;
2098 int i, status;
2099 int minor;
2100
2101 __u16 Data;
2102 dbg("%s", " ATEN2011_startup :entering..........");
2103
2104 if (!serial) {
2105 dbg("%s", "Invalid Handler");
2106 return -1;
2107 }
2108
2109 dev = serial->dev;
2110
2111 dbg("%s", "Entering...");
2112
2113 /* create our private serial structure */
2114 ATEN2011_serial = kzalloc(sizeof(struct ATENINTL_serial), GFP_KERNEL);
2115 if (ATEN2011_serial == NULL) {
2116 err("%s - Out of memory", __func__);
2117 return -ENOMEM;
2118 }
2119
2120 /* resetting the private structure field values to zero */
2121 memset(ATEN2011_serial, 0, sizeof(struct ATENINTL_serial));
2122
2123 ATEN2011_serial->serial = serial;
2124 /* initilize status polling flag to 0 */
2125 ATEN2011_serial->status_polling_started = 0;
2126
2127 usb_set_serial_data(serial, ATEN2011_serial);
2128 ATEN2011_serial->ATEN2011_spectrum_2or4ports =
2129 ATEN2011_calc_num_ports(serial);
2130 /* we set up the pointers to the endpoints in the ATEN2011_open *
2131 * function, as the structures aren't created yet. */
2132
2133 /* set up port private structures */
2134 for (i = 0; i < serial->num_ports; ++i) {
2135 ATEN2011_port =
2136 kmalloc(sizeof(struct ATENINTL_port), GFP_KERNEL);
2137 if (ATEN2011_port == NULL) {
2138 err("%s - Out of memory", __func__);
2139 usb_set_serial_data(serial, NULL);
2140 kfree(ATEN2011_serial);
2141 return -ENOMEM;
2142 }
2143 memset(ATEN2011_port, 0, sizeof(struct ATENINTL_port));
2144
2145 /*
2146 * Initialize all port interrupt end point to port 0
2147 * int endpoint. Our device has only one interrupt end point
2148 * comman to all port
2149 */
2150 /* serial->port[i]->interrupt_in_endpointAddress = serial->port[0]->interrupt_in_endpointAddress; */
2151
2152 ATEN2011_port->port = serial->port[i];
2153 usb_set_serial_port_data(serial->port[i], ATEN2011_port);
2154
2155 minor = serial->port[i]->serial->minor;
2156 if (minor == SERIAL_TTY_NO_MINOR)
2157 minor = 0;
2158 ATEN2011_port->port_num =
2159 ((serial->port[i]->number - minor) + 1);
2160
2161 if (ATEN2011_port->port_num == 1) {
2162 ATEN2011_port->SpRegOffset = 0x0;
2163 ATEN2011_port->ControlRegOffset = 0x1;
2164 ATEN2011_port->DcrRegOffset = 0x4;
2165 } else if ((ATEN2011_port->port_num == 2)
2166 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2167 4)) {
2168 ATEN2011_port->SpRegOffset = 0x8;
2169 ATEN2011_port->ControlRegOffset = 0x9;
2170 ATEN2011_port->DcrRegOffset = 0x16;
2171 } else if ((ATEN2011_port->port_num == 2)
2172 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2173 2)) {
2174 ATEN2011_port->SpRegOffset = 0xa;
2175 ATEN2011_port->ControlRegOffset = 0xb;
2176 ATEN2011_port->DcrRegOffset = 0x19;
2177 } else if ((ATEN2011_port->port_num == 3)
2178 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2179 4)) {
2180 ATEN2011_port->SpRegOffset = 0xa;
2181 ATEN2011_port->ControlRegOffset = 0xb;
2182 ATEN2011_port->DcrRegOffset = 0x19;
2183 } else if ((ATEN2011_port->port_num == 4)
2184 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports ==
2185 4)) {
2186 ATEN2011_port->SpRegOffset = 0xc;
2187 ATEN2011_port->ControlRegOffset = 0xd;
2188 ATEN2011_port->DcrRegOffset = 0x1c;
2189 }
2190
2191 usb_set_serial_port_data(serial->port[i], ATEN2011_port);
2192
2193 /* enable rx_disable bit in control register */
2194
2195 status = get_reg_sync(serial->port[i],
2196 ATEN2011_port->ControlRegOffset, &Data);
2197 if (status < 0) {
2198 dbg("Reading ControlReg failed status-0x%x",
2199 status);
2200 break;
2201 } else
2202 dbg
2203 ("ControlReg Reading success val is %x, status%d",
2204 Data, status);
2205 Data |= 0x08; /* setting driver done bit */
2206 Data |= 0x04; /* sp1_bit to have cts change reflect in modem status reg */
2207
2208 /* Data |= 0x20; */ /* rx_disable bit */
2209 status = set_reg_sync(serial->port[i],
2210 ATEN2011_port->ControlRegOffset, Data);
2211 if (status < 0) {
2212 dbg
2213 ("Writing ControlReg failed(rx_disable) status-0x%x",
2214 status);
2215 break;
2216 } else
2217 dbg
2218 ("ControlReg Writing success(rx_disable) status%d",
2219 status);
2220
2221 /*
2222 * Write default values in DCR (i.e 0x01 in DCR0, 0x05 in DCR2
2223 * and 0x24 in DCR3
2224 */
2225 Data = 0x01;
2226 status = set_reg_sync(serial->port[i],
2227 (__u16)(ATEN2011_port->DcrRegOffset + 0),
2228 Data);
2229 if (status < 0) {
2230 dbg("Writing DCR0 failed status-0x%x", status);
2231 break;
2232 } else
2233 dbg("DCR0 Writing success status%d", status);
2234
2235 Data = 0x05;
2236 status = set_reg_sync(serial->port[i],
2237 (__u16)(ATEN2011_port->DcrRegOffset + 1),
2238 Data);
2239 if (status < 0) {
2240 dbg("Writing DCR1 failed status-0x%x", status);
2241 break;
2242 } else
2243 dbg("DCR1 Writing success status%d", status);
2244
2245 Data = 0x24;
2246 status = set_reg_sync(serial->port[i],
2247 (__u16)(ATEN2011_port->DcrRegOffset + 2),
2248 Data);
2249 if (status < 0) {
2250 dbg("Writing DCR2 failed status-0x%x", status);
2251 break;
2252 } else
2253 dbg("DCR2 Writing success status%d", status);
2254
2255 /* write values in clkstart0x0 and clkmulti 0x20 */
2256 Data = 0x0;
2257 status = set_reg_sync(serial->port[i], CLK_START_VALUE_REGISTER,
2258 Data);
2259 if (status < 0) {
2260 dbg
2261 ("Writing CLK_START_VALUE_REGISTER failed status-0x%x",
2262 status);
2263 break;
2264 } else
2265 dbg
2266 ("CLK_START_VALUE_REGISTER Writing success status%d",
2267 status);
2268
2269 Data = 0x20;
2270 status = set_reg_sync(serial->port[i], CLK_MULTI_REGISTER,
2271 Data);
2272 if (status < 0) {
2273 dbg
2274 ("Writing CLK_MULTI_REGISTER failed status-0x%x",
2275 status);
2276 break;
2277 } else
2278 dbg("CLK_MULTI_REGISTER Writing success status%d",
2279 status);
2280
2281 /* Zero Length flag register */
2282 if ((ATEN2011_port->port_num != 1)
2283 && (ATEN2011_serial->ATEN2011_spectrum_2or4ports == 2)) {
2284
2285 Data = 0xff;
2286 status = set_reg_sync(serial->port[i],
2287 (__u16)(ZLP_REG1 + ((__u16)ATEN2011_port->port_num)),
2288 Data);
2289 dbg("ZLIP offset%x",
2290 (__u16) (ZLP_REG1 +
2291 ((__u16) ATEN2011_port->port_num)));
2292 if (status < 0) {
2293 dbg
2294 ("Writing ZLP_REG%d failed status-0x%x",
2295 i + 2, status);
2296 break;
2297 } else
2298 dbg("ZLP_REG%d Writing success status%d",
2299 i + 2, status);
2300 } else {
2301 Data = 0xff;
2302 status = set_reg_sync(serial->port[i],
2303 (__u16)(ZLP_REG1 + ((__u16)ATEN2011_port->port_num) - 0x1),
2304 Data);
2305 dbg("ZLIP offset%x",
2306 (__u16) (ZLP_REG1 +
2307 ((__u16) ATEN2011_port->port_num) -
2308 0x1));
2309 if (status < 0) {
2310 dbg
2311 ("Writing ZLP_REG%d failed status-0x%x",
2312 i + 1, status);
2313 break;
2314 } else
2315 dbg("ZLP_REG%d Writing success status%d",
2316 i + 1, status);
2317
2318 }
2319 ATEN2011_port->control_urb = usb_alloc_urb(0, GFP_ATOMIC);
2320 ATEN2011_port->ctrl_buf = kmalloc(16, GFP_KERNEL);
2321
2322 }
2323
2324 /* Zero Length flag enable */
2325 Data = 0x0f;
2326 status = set_reg_sync(serial->port[0], ZLP_REG5, Data);
2327 if (status < 0) {
2328 dbg("Writing ZLP_REG5 failed status-0x%x", status);
2329 return -1;
2330 } else
2331 dbg("ZLP_REG5 Writing success status%d", status);
2332
2333 /* setting configuration feature to one */
2334 usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
2335 (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ);
2336 return 0;
2337}
2338
2339static void ATEN2011_release(struct usb_serial *serial)
2340{
2341 int i;
2342 struct ATENINTL_port *ATEN2011_port;
2343
2344 /* check for the ports to be closed,close the ports and disconnect */
2345
2346 /* free private structure allocated for serial port *
2347 * stop reads and writes on all ports */
2348
2349 for (i = 0; i < serial->num_ports; ++i) {
2350 ATEN2011_port = usb_get_serial_port_data(serial->port[i]);
2351 kfree(ATEN2011_port->ctrl_buf);
2352 usb_kill_urb(ATEN2011_port->control_urb);
2353 kfree(ATEN2011_port);
2354 usb_set_serial_port_data(serial->port[i], NULL);
2355 }
2356
2357 /* free private structure allocated for serial device */
2358
2359 kfree(usb_get_serial_data(serial));
2360 usb_set_serial_data(serial, NULL);
2361}
2362
2363static struct usb_serial_driver aten_serial_driver = {
2364 .driver = {
2365 .owner = THIS_MODULE,
2366 .name = "aten2011",
2367 },
2368 .description = DRIVER_DESC,
2369 .id_table = id_table,
2370 .open = ATEN2011_open,
2371 .close = ATEN2011_close,
2372 .write = ATEN2011_write,
2373 .write_room = ATEN2011_write_room,
2374 .chars_in_buffer = ATEN2011_chars_in_buffer,
2375 .throttle = ATEN2011_throttle,
2376 .unthrottle = ATEN2011_unthrottle,
2377 .calc_num_ports = ATEN2011_calc_num_ports,
2378
2379 .ioctl = ATEN2011_ioctl,
2380 .set_termios = ATEN2011_set_termios,
2381 .break_ctl = ATEN2011_break,
2382 .tiocmget = ATEN2011_tiocmget,
2383 .tiocmset = ATEN2011_tiocmset,
2384 .attach = ATEN2011_startup,
2385 .release = ATEN2011_release,
2386 .read_bulk_callback = ATEN2011_bulk_in_callback,
2387 .read_int_callback = ATEN2011_interrupt_callback,
2388};
2389
2390static struct usb_driver aten_driver = {
2391 .name = "aten2011",
2392 .probe = usb_serial_probe,
2393 .disconnect = usb_serial_disconnect,
2394 .id_table = id_table,
2395};
2396
2397static int __init aten_init(void)
2398{
2399 int retval;
2400
2401 /* Register with the usb serial */
2402 retval = usb_serial_register(&aten_serial_driver);
2403 if (retval)
2404 return retval;
2405
2406 printk(KERN_INFO KBUILD_MODNAME ":"
2407 DRIVER_DESC " " DRIVER_VERSION "\n");
2408
2409 /* Register with the usb */
2410 retval = usb_register(&aten_driver);
2411 if (retval)
2412 usb_serial_deregister(&aten_serial_driver);
2413
2414 return retval;
2415}
2416
2417static void __exit aten_exit(void)
2418{
2419 usb_deregister(&aten_driver);
2420 usb_serial_deregister(&aten_serial_driver);
2421}
2422
2423module_init(aten_init);
2424module_exit(aten_exit);
2425
2426/* Module information */
2427MODULE_DESCRIPTION(DRIVER_DESC);
2428MODULE_LICENSE("GPL");
2429
2430MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/staging/udlfb/udlfb.c
index 0ab9d15f3439..f5416af1e902 100644
--- a/drivers/staging/udlfb/udlfb.c
+++ b/drivers/staging/udlfb/udlfb.c
@@ -21,6 +21,7 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/fb.h> 22#include <linux/fb.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/vmalloc.h>
24 25
25#include "udlfb.h" 26#include "udlfb.h"
26 27
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
index 22f93dd0ba03..251220dc8851 100644
--- a/drivers/staging/usbip/usbip_common.c
+++ b/drivers/staging/usbip/usbip_common.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/smp_lock.h>
21#include <linux/file.h> 22#include <linux/file.h>
22#include <linux/tcp.h> 23#include <linux/tcp.h>
23#include <linux/in.h> 24#include <linux/in.h>
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index a10ed27acbc2..f43ca416e4a8 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -344,7 +344,7 @@ static CHIP_INFO chip_info_table[]= {
344}; 344};
345 345
346static struct pci_device_id device_id_table[] __devinitdata = { 346static struct pci_device_id device_id_table[] __devinitdata = {
347{ 0x1106, 0x3253, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (int)&chip_info_table[0]}, 347{ 0x1106, 0x3253, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long)&chip_info_table[0]},
348{ 0, } 348{ 0, }
349}; 349};
350#endif 350#endif
@@ -369,7 +369,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
369 369
370#ifdef CONFIG_PM 370#ifdef CONFIG_PM
371static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr); 371static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
372static int viawget_suspend(struct pci_dev *pcid, u32 state); 372static int viawget_suspend(struct pci_dev *pcid, pm_message_t state);
373static int viawget_resume(struct pci_dev *pcid); 373static int viawget_resume(struct pci_dev *pcid);
374struct notifier_block device_notifier = { 374struct notifier_block device_notifier = {
375 notifier_call: device_notify_reboot, 375 notifier_call: device_notify_reboot,
@@ -3941,7 +3941,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
3941 while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { 3941 while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
3942 if(pci_dev_driver(pdev) == &device_driver) { 3942 if(pci_dev_driver(pdev) == &device_driver) {
3943 if (pci_get_drvdata(pdev)) 3943 if (pci_get_drvdata(pdev))
3944 viawget_suspend(pdev, 3); 3944 viawget_suspend(pdev, PMSG_HIBERNATE);
3945 } 3945 }
3946 } 3946 }
3947 } 3947 }
@@ -3949,7 +3949,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
3949} 3949}
3950 3950
3951static int 3951static int
3952viawget_suspend(struct pci_dev *pcid, u32 state) 3952viawget_suspend(struct pci_dev *pcid, pm_message_t state)
3953{ 3953{
3954 int power_status; // to silence the compiler 3954 int power_status; // to silence the compiler
3955 3955
@@ -3971,7 +3971,7 @@ viawget_suspend(struct pci_dev *pcid, u32 state)
3971 memset(pMgmt->abyCurrBSSID, 0, 6); 3971 memset(pMgmt->abyCurrBSSID, 0, 6);
3972 pMgmt->eCurrState = WMAC_STATE_IDLE; 3972 pMgmt->eCurrState = WMAC_STATE_IDLE;
3973 pci_disable_device(pcid); 3973 pci_disable_device(pcid);
3974 power_status = pci_set_power_state(pcid, state); 3974 power_status = pci_set_power_state(pcid, pci_choose_state(pcid, state));
3975 spin_unlock_irq(&pDevice->lock); 3975 spin_unlock_irq(&pDevice->lock);
3976 return 0; 3976 return 0;
3977} 3977}
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index a913efc69669..40de151f2789 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -257,6 +257,7 @@
257#include <linux/fs.h> /* everything... */ 257#include <linux/fs.h> /* everything... */
258#include <linux/errno.h> /* error codes */ 258#include <linux/errno.h> /* error codes */
259#include <linux/slab.h> 259#include <linux/slab.h>
260#include <linux/smp_lock.h>
260#include <linux/mm.h> 261#include <linux/mm.h>
261#include <linux/ioport.h> 262#include <linux/ioport.h>
262#include <linux/interrupt.h> 263#include <linux/interrupt.h>
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index b52cc830c0b4..f3873f650bb4 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -23,7 +23,6 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/phonedev.h> 24#include <linux/phonedev.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/smp_lock.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28#include <asm/system.h> 27#include <asm/system.h>
29 28
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 3f1045993474..e1f89416ef8c 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -387,6 +387,7 @@ static void acm_rx_tasklet(unsigned long _acm)
387 struct acm_ru *rcv; 387 struct acm_ru *rcv;
388 unsigned long flags; 388 unsigned long flags;
389 unsigned char throttled; 389 unsigned char throttled;
390 struct usb_host_endpoint *ep;
390 391
391 dbg("Entering acm_rx_tasklet"); 392 dbg("Entering acm_rx_tasklet");
392 393
@@ -462,11 +463,20 @@ urbs:
462 463
463 rcv->buffer = buf; 464 rcv->buffer = buf;
464 465
465 usb_fill_bulk_urb(rcv->urb, acm->dev, 466 ep = (usb_pipein(acm->rx_endpoint) ? acm->dev->ep_in : acm->dev->ep_out)
466 acm->rx_endpoint, 467 [usb_pipeendpoint(acm->rx_endpoint)];
467 buf->base, 468 if (usb_endpoint_xfer_int(&ep->desc))
468 acm->readsize, 469 usb_fill_int_urb(rcv->urb, acm->dev,
469 acm_read_bulk, rcv); 470 acm->rx_endpoint,
471 buf->base,
472 acm->readsize,
473 acm_read_bulk, rcv, ep->desc.bInterval);
474 else
475 usb_fill_bulk_urb(rcv->urb, acm->dev,
476 acm->rx_endpoint,
477 buf->base,
478 acm->readsize,
479 acm_read_bulk, rcv);
470 rcv->urb->transfer_dma = buf->dma; 480 rcv->urb->transfer_dma = buf->dma;
471 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 481 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
472 482
@@ -740,7 +750,7 @@ static int acm_tty_chars_in_buffer(struct tty_struct *tty)
740{ 750{
741 struct acm *acm = tty->driver_data; 751 struct acm *acm = tty->driver_data;
742 if (!ACM_READY(acm)) 752 if (!ACM_READY(acm))
743 return -EINVAL; 753 return 0;
744 /* 754 /*
745 * This is inaccurate (overcounts), but it works. 755 * This is inaccurate (overcounts), but it works.
746 */ 756 */
@@ -1227,9 +1237,14 @@ made_compressed_probe:
1227 goto alloc_fail7; 1237 goto alloc_fail7;
1228 } 1238 }
1229 1239
1230 usb_fill_bulk_urb(snd->urb, usb_dev, 1240 if (usb_endpoint_xfer_int(epwrite))
1231 usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), 1241 usb_fill_int_urb(snd->urb, usb_dev,
1232 NULL, acm->writesize, acm_write_bulk, snd); 1242 usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
1243 NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval);
1244 else
1245 usb_fill_bulk_urb(snd->urb, usb_dev,
1246 usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
1247 NULL, acm->writesize, acm_write_bulk, snd);
1233 snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 1248 snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1234 snd->instance = acm; 1249 snd->instance = acm;
1235 } 1250 }
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 0fe434505ac4..ba589d4ca8bc 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/smp_lock.h>
19#include <linux/mutex.h> 18#include <linux/mutex.h>
20#include <linux/uaccess.h> 19#include <linux/uaccess.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 3703789d0d2a..b09a527f7341 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -751,7 +751,7 @@ static int get_capabilities(struct usbtmc_device_data *data)
751{ 751{
752 struct device *dev = &data->usb_dev->dev; 752 struct device *dev = &data->usb_dev->dev;
753 char *buffer; 753 char *buffer;
754 int rv; 754 int rv = 0;
755 755
756 buffer = kmalloc(0x18, GFP_KERNEL); 756 buffer = kmalloc(0x18, GFP_KERNEL);
757 if (!buffer) 757 if (!buffer)
@@ -763,7 +763,7 @@ static int get_capabilities(struct usbtmc_device_data *data)
763 0, 0, buffer, 0x18, USBTMC_TIMEOUT); 763 0, 0, buffer, 0x18, USBTMC_TIMEOUT);
764 if (rv < 0) { 764 if (rv < 0) {
765 dev_err(dev, "usb_control_msg returned %d\n", rv); 765 dev_err(dev, "usb_control_msg returned %d\n", rv);
766 return rv; 766 goto err_out;
767 } 767 }
768 768
769 dev_dbg(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); 769 dev_dbg(dev, "GET_CAPABILITIES returned %x\n", buffer[0]);
@@ -773,7 +773,8 @@ static int get_capabilities(struct usbtmc_device_data *data)
773 dev_dbg(dev, "USB488 device capabilities are %x\n", buffer[15]); 773 dev_dbg(dev, "USB488 device capabilities are %x\n", buffer[15]);
774 if (buffer[0] != USBTMC_STATUS_SUCCESS) { 774 if (buffer[0] != USBTMC_STATUS_SUCCESS) {
775 dev_err(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); 775 dev_err(dev, "GET_CAPABILITIES returned %x\n", buffer[0]);
776 return -EPERM; 776 rv = -EPERM;
777 goto err_out;
777 } 778 }
778 779
779 data->capabilities.interface_capabilities = buffer[4]; 780 data->capabilities.interface_capabilities = buffer[4];
@@ -781,8 +782,9 @@ static int get_capabilities(struct usbtmc_device_data *data)
781 data->capabilities.usb488_interface_capabilities = buffer[14]; 782 data->capabilities.usb488_interface_capabilities = buffer[14];
782 data->capabilities.usb488_device_capabilities = buffer[15]; 783 data->capabilities.usb488_device_capabilities = buffer[15];
783 784
785err_out:
784 kfree(buffer); 786 kfree(buffer);
785 return 0; 787 return rv;
786} 788}
787 789
788#define capability_attribute(name) \ 790#define capability_attribute(name) \
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 69280c35b5cb..ad925946f869 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -28,7 +28,7 @@ comment "Miscellaneous USB options"
28 depends on USB 28 depends on USB
29 29
30config USB_DEVICEFS 30config USB_DEVICEFS
31 bool "USB device filesystem (DEPRECATED)" if EMBEDDED 31 bool "USB device filesystem (DEPRECATED)"
32 depends on USB 32 depends on USB
33 ---help--- 33 ---help---
34 If you say Y here (and to "/proc file system support" in the "File 34 If you say Y here (and to "/proc file system support" in the "File
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 24dfb33f90cb..a16c538d0132 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -80,38 +80,18 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
80 int max_tx; 80 int max_tx;
81 int i; 81 int i;
82 82
83 /* Allocate space for the SS endpoint companion descriptor */
84 ep->ss_ep_comp = kzalloc(sizeof(struct usb_host_ss_ep_comp),
85 GFP_KERNEL);
86 if (!ep->ss_ep_comp)
87 return -ENOMEM;
88 desc = (struct usb_ss_ep_comp_descriptor *) buffer; 83 desc = (struct usb_ss_ep_comp_descriptor *) buffer;
89 if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) { 84 if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) {
90 dev_warn(ddev, "No SuperSpeed endpoint companion for config %d " 85 dev_warn(ddev, "No SuperSpeed endpoint companion for config %d "
91 " interface %d altsetting %d ep %d: " 86 " interface %d altsetting %d ep %d: "
92 "using minimum values\n", 87 "using minimum values\n",
93 cfgno, inum, asnum, ep->desc.bEndpointAddress); 88 cfgno, inum, asnum, ep->desc.bEndpointAddress);
94 ep->ss_ep_comp->desc.bLength = USB_DT_SS_EP_COMP_SIZE;
95 ep->ss_ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP;
96 ep->ss_ep_comp->desc.bMaxBurst = 0;
97 /*
98 * Leave bmAttributes as zero, which will mean no streams for
99 * bulk, and isoc won't support multiple bursts of packets.
100 * With bursts of only one packet, and a Mult of 1, the max
101 * amount of data moved per endpoint service interval is one
102 * packet.
103 */
104 if (usb_endpoint_xfer_isoc(&ep->desc) ||
105 usb_endpoint_xfer_int(&ep->desc))
106 ep->ss_ep_comp->desc.wBytesPerInterval =
107 ep->desc.wMaxPacketSize;
108 /* 89 /*
109 * The next descriptor is for an Endpoint or Interface, 90 * The next descriptor is for an Endpoint or Interface,
110 * no extra descriptors to copy into the companion structure, 91 * no extra descriptors to copy into the companion structure,
111 * and we didn't eat up any of the buffer. 92 * and we didn't eat up any of the buffer.
112 */ 93 */
113 retval = 0; 94 return 0;
114 goto valid;
115 } 95 }
116 memcpy(&ep->ss_ep_comp->desc, desc, USB_DT_SS_EP_COMP_SIZE); 96 memcpy(&ep->ss_ep_comp->desc, desc, USB_DT_SS_EP_COMP_SIZE);
117 desc = &ep->ss_ep_comp->desc; 97 desc = &ep->ss_ep_comp->desc;
@@ -320,6 +300,28 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
320 buffer += i; 300 buffer += i;
321 size -= i; 301 size -= i;
322 302
303 /* Allocate space for the SS endpoint companion descriptor */
304 endpoint->ss_ep_comp = kzalloc(sizeof(struct usb_host_ss_ep_comp),
305 GFP_KERNEL);
306 if (!endpoint->ss_ep_comp)
307 return -ENOMEM;
308
309 /* Fill in some default values (may be overwritten later) */
310 endpoint->ss_ep_comp->desc.bLength = USB_DT_SS_EP_COMP_SIZE;
311 endpoint->ss_ep_comp->desc.bDescriptorType = USB_DT_SS_ENDPOINT_COMP;
312 endpoint->ss_ep_comp->desc.bMaxBurst = 0;
313 /*
314 * Leave bmAttributes as zero, which will mean no streams for
315 * bulk, and isoc won't support multiple bursts of packets.
316 * With bursts of only one packet, and a Mult of 1, the max
317 * amount of data moved per endpoint service interval is one
318 * packet.
319 */
320 if (usb_endpoint_xfer_isoc(&endpoint->desc) ||
321 usb_endpoint_xfer_int(&endpoint->desc))
322 endpoint->ss_ep_comp->desc.wBytesPerInterval =
323 endpoint->desc.wMaxPacketSize;
324
323 if (size > 0) { 325 if (size > 0) {
324 retval = usb_parse_ss_endpoint_companion(ddev, cfgno, 326 retval = usb_parse_ss_endpoint_companion(ddev, cfgno,
325 inum, asnum, endpoint, num_ep, buffer, 327 inum, asnum, endpoint, num_ep, buffer,
@@ -329,6 +331,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
329 retval = buffer - buffer0; 331 retval = buffer - buffer0;
330 } 332 }
331 } else { 333 } else {
334 dev_warn(ddev, "config %d interface %d altsetting %d "
335 "endpoint 0x%X has no "
336 "SuperSpeed companion descriptor\n",
337 cfgno, inum, asnum, d->bEndpointAddress);
332 retval = buffer - buffer0; 338 retval = buffer - buffer0;
333 } 339 }
334 } else { 340 } else {
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 73c108d117b4..96f11715cd26 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -136,17 +136,19 @@ static const struct class_info clas_info[] =
136 {USB_CLASS_AUDIO, "audio"}, 136 {USB_CLASS_AUDIO, "audio"},
137 {USB_CLASS_COMM, "comm."}, 137 {USB_CLASS_COMM, "comm."},
138 {USB_CLASS_HID, "HID"}, 138 {USB_CLASS_HID, "HID"},
139 {USB_CLASS_HUB, "hub"},
140 {USB_CLASS_PHYSICAL, "PID"}, 139 {USB_CLASS_PHYSICAL, "PID"},
140 {USB_CLASS_STILL_IMAGE, "still"},
141 {USB_CLASS_PRINTER, "print"}, 141 {USB_CLASS_PRINTER, "print"},
142 {USB_CLASS_MASS_STORAGE, "stor."}, 142 {USB_CLASS_MASS_STORAGE, "stor."},
143 {USB_CLASS_HUB, "hub"},
143 {USB_CLASS_CDC_DATA, "data"}, 144 {USB_CLASS_CDC_DATA, "data"},
144 {USB_CLASS_APP_SPEC, "app."},
145 {USB_CLASS_VENDOR_SPEC, "vend."},
146 {USB_CLASS_STILL_IMAGE, "still"},
147 {USB_CLASS_CSCID, "scard"}, 145 {USB_CLASS_CSCID, "scard"},
148 {USB_CLASS_CONTENT_SEC, "c-sec"}, 146 {USB_CLASS_CONTENT_SEC, "c-sec"},
149 {USB_CLASS_VIDEO, "video"}, 147 {USB_CLASS_VIDEO, "video"},
148 {USB_CLASS_WIRELESS_CONTROLLER, "wlcon"},
149 {USB_CLASS_MISC, "misc"},
150 {USB_CLASS_APP_SPEC, "app."},
151 {USB_CLASS_VENDOR_SPEC, "vend."},
150 {-1, "unk."} /* leave as last */ 152 {-1, "unk."} /* leave as last */
151}; 153};
152 154
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 308609039c73..38b8bce782d6 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -325,21 +325,34 @@ static void async_completed(struct urb *urb)
325 struct async *as = urb->context; 325 struct async *as = urb->context;
326 struct dev_state *ps = as->ps; 326 struct dev_state *ps = as->ps;
327 struct siginfo sinfo; 327 struct siginfo sinfo;
328 struct pid *pid = NULL;
329 uid_t uid = 0;
330 uid_t euid = 0;
331 u32 secid = 0;
332 int signr;
328 333
329 spin_lock(&ps->lock); 334 spin_lock(&ps->lock);
330 list_move_tail(&as->asynclist, &ps->async_completed); 335 list_move_tail(&as->asynclist, &ps->async_completed);
331 spin_unlock(&ps->lock);
332 as->status = urb->status; 336 as->status = urb->status;
333 if (as->signr) { 337 signr = as->signr;
338 if (signr) {
334 sinfo.si_signo = as->signr; 339 sinfo.si_signo = as->signr;
335 sinfo.si_errno = as->status; 340 sinfo.si_errno = as->status;
336 sinfo.si_code = SI_ASYNCIO; 341 sinfo.si_code = SI_ASYNCIO;
337 sinfo.si_addr = as->userurb; 342 sinfo.si_addr = as->userurb;
338 kill_pid_info_as_uid(as->signr, &sinfo, as->pid, as->uid, 343 pid = as->pid;
339 as->euid, as->secid); 344 uid = as->uid;
345 euid = as->euid;
346 secid = as->secid;
340 } 347 }
341 snoop(&urb->dev->dev, "urb complete\n"); 348 snoop(&urb->dev->dev, "urb complete\n");
342 snoop_urb(urb, as->userurb); 349 snoop_urb(urb, as->userurb);
350 spin_unlock(&ps->lock);
351
352 if (signr)
353 kill_pid_info_as_uid(sinfo.si_signo, &sinfo, pid, uid,
354 euid, secid);
355
343 wake_up(&ps->wait); 356 wake_up(&ps->wait);
344} 357}
345 358
@@ -982,7 +995,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
982 USBDEVFS_URB_ZERO_PACKET | 995 USBDEVFS_URB_ZERO_PACKET |
983 USBDEVFS_URB_NO_INTERRUPT)) 996 USBDEVFS_URB_NO_INTERRUPT))
984 return -EINVAL; 997 return -EINVAL;
985 if (!uurb->buffer) 998 if (uurb->buffer_length > 0 && !uurb->buffer)
986 return -EINVAL; 999 return -EINVAL;
987 if (!(uurb->type == USBDEVFS_URB_TYPE_CONTROL && 1000 if (!(uurb->type == USBDEVFS_URB_TYPE_CONTROL &&
988 (uurb->endpoint & ~USB_ENDPOINT_DIR_MASK) == 0)) { 1001 (uurb->endpoint & ~USB_ENDPOINT_DIR_MASK) == 0)) {
@@ -1038,11 +1051,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1038 is_in = 0; 1051 is_in = 0;
1039 uurb->endpoint &= ~USB_DIR_IN; 1052 uurb->endpoint &= ~USB_DIR_IN;
1040 } 1053 }
1041 if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1042 uurb->buffer, uurb->buffer_length)) {
1043 kfree(dr);
1044 return -EFAULT;
1045 }
1046 snoop(&ps->dev->dev, "control urb: bRequest=%02x " 1054 snoop(&ps->dev->dev, "control urb: bRequest=%02x "
1047 "bRrequestType=%02x wValue=%04x " 1055 "bRrequestType=%02x wValue=%04x "
1048 "wIndex=%04x wLength=%04x\n", 1056 "wIndex=%04x wLength=%04x\n",
@@ -1062,9 +1070,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1062 uurb->number_of_packets = 0; 1070 uurb->number_of_packets = 0;
1063 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) 1071 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1064 return -EINVAL; 1072 return -EINVAL;
1065 if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1066 uurb->buffer, uurb->buffer_length))
1067 return -EFAULT;
1068 snoop(&ps->dev->dev, "bulk urb\n"); 1073 snoop(&ps->dev->dev, "bulk urb\n");
1069 break; 1074 break;
1070 1075
@@ -1106,28 +1111,35 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1106 return -EINVAL; 1111 return -EINVAL;
1107 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE) 1112 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1108 return -EINVAL; 1113 return -EINVAL;
1109 if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1110 uurb->buffer, uurb->buffer_length))
1111 return -EFAULT;
1112 snoop(&ps->dev->dev, "interrupt urb\n"); 1114 snoop(&ps->dev->dev, "interrupt urb\n");
1113 break; 1115 break;
1114 1116
1115 default: 1117 default:
1116 return -EINVAL; 1118 return -EINVAL;
1117 } 1119 }
1118 as = alloc_async(uurb->number_of_packets); 1120 if (uurb->buffer_length > 0 &&
1119 if (!as) { 1121 !access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1122 uurb->buffer, uurb->buffer_length)) {
1120 kfree(isopkt); 1123 kfree(isopkt);
1121 kfree(dr); 1124 kfree(dr);
1122 return -ENOMEM; 1125 return -EFAULT;
1123 } 1126 }
1124 as->urb->transfer_buffer = kmalloc(uurb->buffer_length, GFP_KERNEL); 1127 as = alloc_async(uurb->number_of_packets);
1125 if (!as->urb->transfer_buffer) { 1128 if (!as) {
1126 kfree(isopkt); 1129 kfree(isopkt);
1127 kfree(dr); 1130 kfree(dr);
1128 free_async(as);
1129 return -ENOMEM; 1131 return -ENOMEM;
1130 } 1132 }
1133 if (uurb->buffer_length > 0) {
1134 as->urb->transfer_buffer = kmalloc(uurb->buffer_length,
1135 GFP_KERNEL);
1136 if (!as->urb->transfer_buffer) {
1137 kfree(isopkt);
1138 kfree(dr);
1139 free_async(as);
1140 return -ENOMEM;
1141 }
1142 }
1131 as->urb->dev = ps->dev; 1143 as->urb->dev = ps->dev;
1132 as->urb->pipe = (uurb->type << 30) | 1144 as->urb->pipe = (uurb->type << 30) |
1133 __create_pipe(ps->dev, uurb->endpoint & 0xf) | 1145 __create_pipe(ps->dev, uurb->endpoint & 0xf) |
@@ -1169,7 +1181,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1169 kfree(isopkt); 1181 kfree(isopkt);
1170 as->ps = ps; 1182 as->ps = ps;
1171 as->userurb = arg; 1183 as->userurb = arg;
1172 if (uurb->endpoint & USB_DIR_IN) 1184 if (is_in && uurb->buffer_length > 0)
1173 as->userbuffer = uurb->buffer; 1185 as->userbuffer = uurb->buffer;
1174 else 1186 else
1175 as->userbuffer = NULL; 1187 as->userbuffer = NULL;
@@ -1179,9 +1191,9 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1179 as->uid = cred->uid; 1191 as->uid = cred->uid;
1180 as->euid = cred->euid; 1192 as->euid = cred->euid;
1181 security_task_getsecid(current, &as->secid); 1193 security_task_getsecid(current, &as->secid);
1182 if (!is_in) { 1194 if (!is_in && uurb->buffer_length > 0) {
1183 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, 1195 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer,
1184 as->urb->transfer_buffer_length)) { 1196 uurb->buffer_length)) {
1185 free_async(as); 1197 free_async(as);
1186 return -EFAULT; 1198 return -EFAULT;
1187 } 1199 }
@@ -1231,22 +1243,22 @@ static int processcompl(struct async *as, void __user * __user *arg)
1231 if (as->userbuffer) 1243 if (as->userbuffer)
1232 if (copy_to_user(as->userbuffer, urb->transfer_buffer, 1244 if (copy_to_user(as->userbuffer, urb->transfer_buffer,
1233 urb->transfer_buffer_length)) 1245 urb->transfer_buffer_length))
1234 return -EFAULT; 1246 goto err_out;
1235 if (put_user(as->status, &userurb->status)) 1247 if (put_user(as->status, &userurb->status))
1236 return -EFAULT; 1248 goto err_out;
1237 if (put_user(urb->actual_length, &userurb->actual_length)) 1249 if (put_user(urb->actual_length, &userurb->actual_length))
1238 return -EFAULT; 1250 goto err_out;
1239 if (put_user(urb->error_count, &userurb->error_count)) 1251 if (put_user(urb->error_count, &userurb->error_count))
1240 return -EFAULT; 1252 goto err_out;
1241 1253
1242 if (usb_endpoint_xfer_isoc(&urb->ep->desc)) { 1254 if (usb_endpoint_xfer_isoc(&urb->ep->desc)) {
1243 for (i = 0; i < urb->number_of_packets; i++) { 1255 for (i = 0; i < urb->number_of_packets; i++) {
1244 if (put_user(urb->iso_frame_desc[i].actual_length, 1256 if (put_user(urb->iso_frame_desc[i].actual_length,
1245 &userurb->iso_frame_desc[i].actual_length)) 1257 &userurb->iso_frame_desc[i].actual_length))
1246 return -EFAULT; 1258 goto err_out;
1247 if (put_user(urb->iso_frame_desc[i].status, 1259 if (put_user(urb->iso_frame_desc[i].status,
1248 &userurb->iso_frame_desc[i].status)) 1260 &userurb->iso_frame_desc[i].status))
1249 return -EFAULT; 1261 goto err_out;
1250 } 1262 }
1251 } 1263 }
1252 1264
@@ -1255,6 +1267,10 @@ static int processcompl(struct async *as, void __user * __user *arg)
1255 if (put_user(addr, (void __user * __user *)arg)) 1267 if (put_user(addr, (void __user * __user *)arg))
1256 return -EFAULT; 1268 return -EFAULT;
1257 return 0; 1269 return 0;
1270
1271err_out:
1272 free_async(as);
1273 return -EFAULT;
1258} 1274}
1259 1275
1260static struct async *reap_as(struct dev_state *ps) 1276static struct async *reap_as(struct dev_state *ps)
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index d397ecfd5b17..ec5c67ea07b7 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -227,6 +227,10 @@ struct hc_driver {
227 /* has a port been handed over to a companion? */ 227 /* has a port been handed over to a companion? */
228 int (*port_handed_over)(struct usb_hcd *, int); 228 int (*port_handed_over)(struct usb_hcd *, int);
229 229
230 /* CLEAR_TT_BUFFER completion callback */
231 void (*clear_tt_buffer_complete)(struct usb_hcd *,
232 struct usb_host_endpoint *);
233
230 /* xHCI specific functions */ 234 /* xHCI specific functions */
231 /* Called by usb_alloc_dev to alloc HC device structures */ 235 /* Called by usb_alloc_dev to alloc HC device structures */
232 int (*alloc_dev)(struct usb_hcd *, struct usb_device *); 236 int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 2af3b4f06054..71f86c60d83c 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -450,10 +450,10 @@ hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
450 * talking to TTs must queue control transfers (not just bulk and iso), so 450 * talking to TTs must queue control transfers (not just bulk and iso), so
451 * both can talk to the same hub concurrently. 451 * both can talk to the same hub concurrently.
452 */ 452 */
453static void hub_tt_kevent (struct work_struct *work) 453static void hub_tt_work(struct work_struct *work)
454{ 454{
455 struct usb_hub *hub = 455 struct usb_hub *hub =
456 container_of(work, struct usb_hub, tt.kevent); 456 container_of(work, struct usb_hub, tt.clear_work);
457 unsigned long flags; 457 unsigned long flags;
458 int limit = 100; 458 int limit = 100;
459 459
@@ -462,6 +462,7 @@ static void hub_tt_kevent (struct work_struct *work)
462 struct list_head *next; 462 struct list_head *next;
463 struct usb_tt_clear *clear; 463 struct usb_tt_clear *clear;
464 struct usb_device *hdev = hub->hdev; 464 struct usb_device *hdev = hub->hdev;
465 const struct hc_driver *drv;
465 int status; 466 int status;
466 467
467 next = hub->tt.clear_list.next; 468 next = hub->tt.clear_list.next;
@@ -471,21 +472,25 @@ static void hub_tt_kevent (struct work_struct *work)
471 /* drop lock so HCD can concurrently report other TT errors */ 472 /* drop lock so HCD can concurrently report other TT errors */
472 spin_unlock_irqrestore (&hub->tt.lock, flags); 473 spin_unlock_irqrestore (&hub->tt.lock, flags);
473 status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); 474 status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt);
474 spin_lock_irqsave (&hub->tt.lock, flags);
475
476 if (status) 475 if (status)
477 dev_err (&hdev->dev, 476 dev_err (&hdev->dev,
478 "clear tt %d (%04x) error %d\n", 477 "clear tt %d (%04x) error %d\n",
479 clear->tt, clear->devinfo, status); 478 clear->tt, clear->devinfo, status);
479
480 /* Tell the HCD, even if the operation failed */
481 drv = clear->hcd->driver;
482 if (drv->clear_tt_buffer_complete)
483 (drv->clear_tt_buffer_complete)(clear->hcd, clear->ep);
484
480 kfree(clear); 485 kfree(clear);
486 spin_lock_irqsave(&hub->tt.lock, flags);
481 } 487 }
482 spin_unlock_irqrestore (&hub->tt.lock, flags); 488 spin_unlock_irqrestore (&hub->tt.lock, flags);
483} 489}
484 490
485/** 491/**
486 * usb_hub_tt_clear_buffer - clear control/bulk TT state in high speed hub 492 * usb_hub_clear_tt_buffer - clear control/bulk TT state in high speed hub
487 * @udev: the device whose split transaction failed 493 * @urb: an URB associated with the failed or incomplete split transaction
488 * @pipe: identifies the endpoint of the failed transaction
489 * 494 *
490 * High speed HCDs use this to tell the hub driver that some split control or 495 * High speed HCDs use this to tell the hub driver that some split control or
491 * bulk transaction failed in a way that requires clearing internal state of 496 * bulk transaction failed in a way that requires clearing internal state of
@@ -495,8 +500,10 @@ static void hub_tt_kevent (struct work_struct *work)
495 * It may not be possible for that hub to handle additional full (or low) 500 * It may not be possible for that hub to handle additional full (or low)
496 * speed transactions until that state is fully cleared out. 501 * speed transactions until that state is fully cleared out.
497 */ 502 */
498void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe) 503int usb_hub_clear_tt_buffer(struct urb *urb)
499{ 504{
505 struct usb_device *udev = urb->dev;
506 int pipe = urb->pipe;
500 struct usb_tt *tt = udev->tt; 507 struct usb_tt *tt = udev->tt;
501 unsigned long flags; 508 unsigned long flags;
502 struct usb_tt_clear *clear; 509 struct usb_tt_clear *clear;
@@ -508,7 +515,7 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
508 if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { 515 if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) {
509 dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n"); 516 dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
510 /* FIXME recover somehow ... RESET_TT? */ 517 /* FIXME recover somehow ... RESET_TT? */
511 return; 518 return -ENOMEM;
512 } 519 }
513 520
514 /* info that CLEAR_TT_BUFFER needs */ 521 /* info that CLEAR_TT_BUFFER needs */
@@ -520,14 +527,19 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
520 : (USB_ENDPOINT_XFER_BULK << 11); 527 : (USB_ENDPOINT_XFER_BULK << 11);
521 if (usb_pipein (pipe)) 528 if (usb_pipein (pipe))
522 clear->devinfo |= 1 << 15; 529 clear->devinfo |= 1 << 15;
523 530
531 /* info for completion callback */
532 clear->hcd = bus_to_hcd(udev->bus);
533 clear->ep = urb->ep;
534
524 /* tell keventd to clear state for this TT */ 535 /* tell keventd to clear state for this TT */
525 spin_lock_irqsave (&tt->lock, flags); 536 spin_lock_irqsave (&tt->lock, flags);
526 list_add_tail (&clear->clear_list, &tt->clear_list); 537 list_add_tail (&clear->clear_list, &tt->clear_list);
527 schedule_work (&tt->kevent); 538 schedule_work(&tt->clear_work);
528 spin_unlock_irqrestore (&tt->lock, flags); 539 spin_unlock_irqrestore (&tt->lock, flags);
540 return 0;
529} 541}
530EXPORT_SYMBOL_GPL(usb_hub_tt_clear_buffer); 542EXPORT_SYMBOL_GPL(usb_hub_clear_tt_buffer);
531 543
532/* If do_delay is false, return the number of milliseconds the caller 544/* If do_delay is false, return the number of milliseconds the caller
533 * needs to delay. 545 * needs to delay.
@@ -818,7 +830,7 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type)
818 if (hub->has_indicators) 830 if (hub->has_indicators)
819 cancel_delayed_work_sync(&hub->leds); 831 cancel_delayed_work_sync(&hub->leds);
820 if (hub->tt.hub) 832 if (hub->tt.hub)
821 cancel_work_sync(&hub->tt.kevent); 833 cancel_work_sync(&hub->tt.clear_work);
822} 834}
823 835
824/* caller has locked the hub device */ 836/* caller has locked the hub device */
@@ -935,7 +947,7 @@ static int hub_configure(struct usb_hub *hub,
935 947
936 spin_lock_init (&hub->tt.lock); 948 spin_lock_init (&hub->tt.lock);
937 INIT_LIST_HEAD (&hub->tt.clear_list); 949 INIT_LIST_HEAD (&hub->tt.clear_list);
938 INIT_WORK (&hub->tt.kevent, hub_tt_kevent); 950 INIT_WORK(&hub->tt.clear_work, hub_tt_work);
939 switch (hdev->descriptor.bDeviceProtocol) { 951 switch (hdev->descriptor.bDeviceProtocol) {
940 case 0: 952 case 0:
941 break; 953 break;
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 889c0f32a40b..de8081f065ed 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -188,16 +188,18 @@ struct usb_tt {
188 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ 188 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */
189 spinlock_t lock; 189 spinlock_t lock;
190 struct list_head clear_list; /* of usb_tt_clear */ 190 struct list_head clear_list; /* of usb_tt_clear */
191 struct work_struct kevent; 191 struct work_struct clear_work;
192}; 192};
193 193
194struct usb_tt_clear { 194struct usb_tt_clear {
195 struct list_head clear_list; 195 struct list_head clear_list;
196 unsigned tt; 196 unsigned tt;
197 u16 devinfo; 197 u16 devinfo;
198 struct usb_hcd *hcd;
199 struct usb_host_endpoint *ep;
198}; 200};
199 201
200extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe); 202extern int usb_hub_clear_tt_buffer(struct urb *urb);
201extern void usb_ep0_reinit(struct usb_device *); 203extern void usb_ep0_reinit(struct usb_device *);
202 204
203#endif /* __LINUX_HUB_H */ 205#endif /* __LINUX_HUB_H */
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 2bed83caacb1..9720e699f472 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -806,6 +806,48 @@ static int usb_string_sub(struct usb_device *dev, unsigned int langid,
806 return rc; 806 return rc;
807} 807}
808 808
809static int usb_get_langid(struct usb_device *dev, unsigned char *tbuf)
810{
811 int err;
812
813 if (dev->have_langid)
814 return 0;
815
816 if (dev->string_langid < 0)
817 return -EPIPE;
818
819 err = usb_string_sub(dev, 0, 0, tbuf);
820
821 /* If the string was reported but is malformed, default to english
822 * (0x0409) */
823 if (err == -ENODATA || (err > 0 && err < 4)) {
824 dev->string_langid = 0x0409;
825 dev->have_langid = 1;
826 dev_err(&dev->dev,
827 "string descriptor 0 malformed (err = %d), "
828 "defaulting to 0x%04x\n",
829 err, dev->string_langid);
830 return 0;
831 }
832
833 /* In case of all other errors, we assume the device is not able to
834 * deal with strings at all. Set string_langid to -1 in order to
835 * prevent any string to be retrieved from the device */
836 if (err < 0) {
837 dev_err(&dev->dev, "string descriptor 0 read error: %d\n",
838 err);
839 dev->string_langid = -1;
840 return -EPIPE;
841 }
842
843 /* always use the first langid listed */
844 dev->string_langid = tbuf[2] | (tbuf[3] << 8);
845 dev->have_langid = 1;
846 dev_dbg(&dev->dev, "default language 0x%04x\n",
847 dev->string_langid);
848 return 0;
849}
850
809/** 851/**
810 * usb_string - returns UTF-8 version of a string descriptor 852 * usb_string - returns UTF-8 version of a string descriptor
811 * @dev: the device whose string descriptor is being retrieved 853 * @dev: the device whose string descriptor is being retrieved
@@ -837,24 +879,9 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
837 if (!tbuf) 879 if (!tbuf)
838 return -ENOMEM; 880 return -ENOMEM;
839 881
840 /* get langid for strings if it's not yet known */ 882 err = usb_get_langid(dev, tbuf);
841 if (!dev->have_langid) { 883 if (err < 0)
842 err = usb_string_sub(dev, 0, 0, tbuf); 884 goto errout;
843 if (err < 0) {
844 dev_err(&dev->dev,
845 "string descriptor 0 read error: %d\n",
846 err);
847 } else if (err < 4) {
848 dev_err(&dev->dev, "string descriptor 0 too short\n");
849 } else {
850 dev->string_langid = tbuf[2] | (tbuf[3] << 8);
851 /* always use the first langid listed */
852 dev_dbg(&dev->dev, "default language 0x%04x\n",
853 dev->string_langid);
854 }
855
856 dev->have_langid = 1;
857 }
858 885
859 err = usb_string_sub(dev, dev->string_langid, index, tbuf); 886 err = usb_string_sub(dev, dev->string_langid, index, tbuf);
860 if (err < 0) 887 if (err < 0)
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 5d1ddf485d1e..7f8e83a954ac 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -286,6 +286,27 @@ config USB_S3C_HSOTG
286 default USB_GADGET 286 default USB_GADGET
287 select USB_GADGET_SELECTED 287 select USB_GADGET_SELECTED
288 288
289config USB_GADGET_IMX
290 boolean "Freescale IMX USB Peripheral Controller"
291 depends on ARCH_MX1
292 help
293 Freescale's IMX series include an integrated full speed
294 USB 1.1 device controller. The controller in the IMX series
295 is register-compatible.
296
297 It has Six fixed-function endpoints, as well as endpoint
298 zero (for control transfers).
299
300 Say "y" to link the driver statically, or "m" to build a
301 dynamically linked module called "imx_udc" and force all
302 gadget drivers to also be dynamically linked.
303
304config USB_IMX
305 tristate
306 depends on USB_GADGET_IMX
307 default USB_GADGET
308 select USB_GADGET_SELECTED
309
289config USB_GADGET_S3C2410 310config USB_GADGET_S3C2410
290 boolean "S3C2410 USB Device Controller" 311 boolean "S3C2410 USB Device Controller"
291 depends on ARCH_S3C2410 312 depends on ARCH_S3C2410
@@ -321,27 +342,6 @@ config USB_GADGET_MUSB_HDRC
321 This OTG-capable silicon IP is used in dual designs including 342 This OTG-capable silicon IP is used in dual designs including
322 the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin 343 the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin
323 344
324config USB_GADGET_IMX
325 boolean "Freescale IMX USB Peripheral Controller"
326 depends on ARCH_MX1
327 help
328 Freescale's IMX series include an integrated full speed
329 USB 1.1 device controller. The controller in the IMX series
330 is register-compatible.
331
332 It has Six fixed-function endpoints, as well as endpoint
333 zero (for control transfers).
334
335 Say "y" to link the driver statically, or "m" to build a
336 dynamically linked module called "imx_udc" and force all
337 gadget drivers to also be dynamically linked.
338
339config USB_IMX
340 tristate
341 depends on USB_GADGET_IMX
342 default USB_GADGET
343 select USB_GADGET_SELECTED
344
345config USB_GADGET_M66592 345config USB_GADGET_M66592
346 boolean "Renesas M66592 USB Peripheral Controller" 346 boolean "Renesas M66592 USB Peripheral Controller"
347 select USB_GADGET_DUALSPEED 347 select USB_GADGET_DUALSPEED
@@ -604,6 +604,7 @@ config USB_ZERO_HNPTEST
604config USB_AUDIO 604config USB_AUDIO
605 tristate "Audio Gadget (EXPERIMENTAL)" 605 tristate "Audio Gadget (EXPERIMENTAL)"
606 depends on SND 606 depends on SND
607 select SND_PCM
607 help 608 help
608 Gadget Audio is compatible with USB Audio Class specification 1.0. 609 Gadget Audio is compatible with USB Audio Class specification 1.0.
609 It will include at least one AudioControl interface, zero or more 610 It will include at least one AudioControl interface, zero or more
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 826f3adde5d8..77352ccc245e 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -48,7 +48,6 @@
48#include <linux/ioport.h> 48#include <linux/ioport.h>
49#include <linux/sched.h> 49#include <linux/sched.h>
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <linux/smp_lock.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
53#include <linux/init.h> 52#include <linux/init.h>
54#include <linux/timer.h> 53#include <linux/timer.h>
diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c
index 94de7e864614..9f80f4e970bd 100644
--- a/drivers/usb/gadget/audio.c
+++ b/drivers/usb/gadget/audio.c
@@ -42,9 +42,9 @@
42 * Instead: allocate your own, using normal USB-IF procedures. 42 * Instead: allocate your own, using normal USB-IF procedures.
43 */ 43 */
44 44
45/* Thanks to NetChip Technologies for donating this product ID. */ 45/* Thanks to Linux Foundation for donating this product ID. */
46#define AUDIO_VENDOR_NUM 0x0525 /* NetChip */ 46#define AUDIO_VENDOR_NUM 0x1d6b /* Linux Foundation */
47#define AUDIO_PRODUCT_NUM 0xa4a1 /* Linux-USB Audio Gadget */ 47#define AUDIO_PRODUCT_NUM 0x0101 /* Linux-USB Audio Gadget */
48 48
49/*-------------------------------------------------------------------------*/ 49/*-------------------------------------------------------------------------*/
50 50
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d006dc652e02..bd102f5052ba 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -293,15 +293,16 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
293 /* CDC Subset */ 293 /* CDC Subset */
294 eth_config_driver.label = "CDC Subset/SAFE"; 294 eth_config_driver.label = "CDC Subset/SAFE";
295 295
296 device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM), 296 device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM);
297 device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM), 297 device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM);
298 device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC; 298 if (!has_rndis())
299 device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
299 } 300 }
300 301
301 if (has_rndis()) { 302 if (has_rndis()) {
302 /* RNDIS plus ECM-or-Subset */ 303 /* RNDIS plus ECM-or-Subset */
303 device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM), 304 device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM);
304 device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM), 305 device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM);
305 device_desc.bNumConfigurations = 2; 306 device_desc.bNumConfigurations = 2;
306 } 307 }
307 308
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index 6829d5961359..a3913519fd58 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -34,7 +34,6 @@
34#include <linux/ioport.h> 34#include <linux/ioport.h>
35#include <linux/sched.h> 35#include <linux/sched.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/smp_lock.h>
38#include <linux/errno.h> 37#include <linux/errno.h>
39#include <linux/init.h> 38#include <linux/init.h>
40#include <linux/timer.h> 39#include <linux/timer.h>
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 0ce4e2819847..ed21e263f832 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -139,7 +139,7 @@ static int is_vbus_present(void)
139{ 139{
140 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 140 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
141 141
142 if (mach->gpio_vbus) { 142 if (gpio_is_valid(mach->gpio_vbus)) {
143 int value = gpio_get_value(mach->gpio_vbus); 143 int value = gpio_get_value(mach->gpio_vbus);
144 144
145 if (mach->gpio_vbus_inverted) 145 if (mach->gpio_vbus_inverted)
@@ -158,7 +158,7 @@ static void pullup_off(void)
158 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 158 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
159 int off_level = mach->gpio_pullup_inverted; 159 int off_level = mach->gpio_pullup_inverted;
160 160
161 if (mach->gpio_pullup) 161 if (gpio_is_valid(mach->gpio_pullup))
162 gpio_set_value(mach->gpio_pullup, off_level); 162 gpio_set_value(mach->gpio_pullup, off_level);
163 else if (mach->udc_command) 163 else if (mach->udc_command)
164 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); 164 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
@@ -169,7 +169,7 @@ static void pullup_on(void)
169 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 169 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
170 int on_level = !mach->gpio_pullup_inverted; 170 int on_level = !mach->gpio_pullup_inverted;
171 171
172 if (mach->gpio_pullup) 172 if (gpio_is_valid(mach->gpio_pullup))
173 gpio_set_value(mach->gpio_pullup, on_level); 173 gpio_set_value(mach->gpio_pullup, on_level);
174 else if (mach->udc_command) 174 else if (mach->udc_command)
175 mach->udc_command(PXA2XX_UDC_CMD_CONNECT); 175 mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
@@ -1000,7 +1000,7 @@ static int pxa25x_udc_pullup(struct usb_gadget *_gadget, int is_active)
1000 udc = container_of(_gadget, struct pxa25x_udc, gadget); 1000 udc = container_of(_gadget, struct pxa25x_udc, gadget);
1001 1001
1002 /* not all boards support pullup control */ 1002 /* not all boards support pullup control */
1003 if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 1003 if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command)
1004 return -EOPNOTSUPP; 1004 return -EOPNOTSUPP;
1005 1005
1006 udc->pullup = (is_active != 0); 1006 udc->pullup = (is_active != 0);
@@ -1802,11 +1802,13 @@ pxa25x_udc_irq(int irq, void *_dev)
1802 USIR0 |= tmp; 1802 USIR0 |= tmp;
1803 handled = 1; 1803 handled = 1;
1804 } 1804 }
1805#ifndef CONFIG_USB_PXA25X_SMALL
1805 if (usir1 & tmp) { 1806 if (usir1 & tmp) {
1806 handle_ep(&dev->ep[i+8]); 1807 handle_ep(&dev->ep[i+8]);
1807 USIR1 |= tmp; 1808 USIR1 |= tmp;
1808 handled = 1; 1809 handled = 1;
1809 } 1810 }
1811#endif
1810 } 1812 }
1811 } 1813 }
1812 1814
@@ -2160,7 +2162,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
2160 dev->dev = &pdev->dev; 2162 dev->dev = &pdev->dev;
2161 dev->mach = pdev->dev.platform_data; 2163 dev->mach = pdev->dev.platform_data;
2162 2164
2163 if (dev->mach->gpio_vbus) { 2165 if (gpio_is_valid(dev->mach->gpio_vbus)) {
2164 if ((retval = gpio_request(dev->mach->gpio_vbus, 2166 if ((retval = gpio_request(dev->mach->gpio_vbus,
2165 "pxa25x_udc GPIO VBUS"))) { 2167 "pxa25x_udc GPIO VBUS"))) {
2166 dev_dbg(&pdev->dev, 2168 dev_dbg(&pdev->dev,
@@ -2173,7 +2175,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
2173 } else 2175 } else
2174 vbus_irq = 0; 2176 vbus_irq = 0;
2175 2177
2176 if (dev->mach->gpio_pullup) { 2178 if (gpio_is_valid(dev->mach->gpio_pullup)) {
2177 if ((retval = gpio_request(dev->mach->gpio_pullup, 2179 if ((retval = gpio_request(dev->mach->gpio_pullup,
2178 "pca25x_udc GPIO PULLUP"))) { 2180 "pca25x_udc GPIO PULLUP"))) {
2179 dev_dbg(&pdev->dev, 2181 dev_dbg(&pdev->dev,
@@ -2256,10 +2258,10 @@ lubbock_fail0:
2256#endif 2258#endif
2257 free_irq(irq, dev); 2259 free_irq(irq, dev);
2258 err_irq1: 2260 err_irq1:
2259 if (dev->mach->gpio_pullup) 2261 if (gpio_is_valid(dev->mach->gpio_pullup))
2260 gpio_free(dev->mach->gpio_pullup); 2262 gpio_free(dev->mach->gpio_pullup);
2261 err_gpio_pullup: 2263 err_gpio_pullup:
2262 if (dev->mach->gpio_vbus) 2264 if (gpio_is_valid(dev->mach->gpio_vbus))
2263 gpio_free(dev->mach->gpio_vbus); 2265 gpio_free(dev->mach->gpio_vbus);
2264 err_gpio_vbus: 2266 err_gpio_vbus:
2265 clk_put(dev->clk); 2267 clk_put(dev->clk);
@@ -2294,11 +2296,11 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
2294 free_irq(LUBBOCK_USB_IRQ, dev); 2296 free_irq(LUBBOCK_USB_IRQ, dev);
2295 } 2297 }
2296#endif 2298#endif
2297 if (dev->mach->gpio_vbus) { 2299 if (gpio_is_valid(dev->mach->gpio_vbus)) {
2298 free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev); 2300 free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev);
2299 gpio_free(dev->mach->gpio_vbus); 2301 gpio_free(dev->mach->gpio_vbus);
2300 } 2302 }
2301 if (dev->mach->gpio_pullup) 2303 if (gpio_is_valid(dev->mach->gpio_pullup))
2302 gpio_free(dev->mach->gpio_pullup); 2304 gpio_free(dev->mach->gpio_pullup);
2303 2305
2304 clk_put(dev->clk); 2306 clk_put(dev->clk);
@@ -2329,7 +2331,7 @@ static int pxa25x_udc_suspend(struct platform_device *dev, pm_message_t state)
2329 struct pxa25x_udc *udc = platform_get_drvdata(dev); 2331 struct pxa25x_udc *udc = platform_get_drvdata(dev);
2330 unsigned long flags; 2332 unsigned long flags;
2331 2333
2332 if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 2334 if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command)
2333 WARNING("USB host won't detect disconnect!\n"); 2335 WARNING("USB host won't detect disconnect!\n");
2334 udc->suspended = 1; 2336 udc->suspended = 1;
2335 2337
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 2b4660e08c4d..ca41b0b5afb3 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -442,6 +442,8 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
442 442
443 case OID_802_3_MAC_OPTIONS: 443 case OID_802_3_MAC_OPTIONS:
444 pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__); 444 pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__);
445 *outbuf = cpu_to_le32(0);
446 retval = 0;
445 break; 447 break;
446 448
447 /* ieee802.3 statistics OIDs (table 4-4) */ 449 /* ieee802.3 statistics OIDs (table 4-4) */
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index 9a2b8920532d..a9b452fe6221 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -28,7 +28,6 @@
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/init.h> 32#include <linux/init.h>
34#include <linux/timer.h> 33#include <linux/timer.h>
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0c03471f0d41..1a920c70b5a1 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -181,26 +181,27 @@ config USB_OHCI_HCD_PPC_SOC
181 Enables support for the USB controller on the MPC52xx or 181 Enables support for the USB controller on the MPC52xx or
182 STB03xxx processor chip. If unsure, say Y. 182 STB03xxx processor chip. If unsure, say Y.
183 183
184config USB_OHCI_HCD_PPC_OF
185 bool "OHCI support for PPC USB controller on OF platform bus"
186 depends on USB_OHCI_HCD && PPC_OF
187 default y
188 ---help---
189 Enables support for the USB controller PowerPC present on the
190 OpenFirmware platform bus.
191
192config USB_OHCI_HCD_PPC_OF_BE 184config USB_OHCI_HCD_PPC_OF_BE
193 bool "Support big endian HC" 185 bool "OHCI support for OF platform bus (big endian)"
194 depends on USB_OHCI_HCD_PPC_OF 186 depends on USB_OHCI_HCD && PPC_OF
195 default y
196 select USB_OHCI_BIG_ENDIAN_DESC 187 select USB_OHCI_BIG_ENDIAN_DESC
197 select USB_OHCI_BIG_ENDIAN_MMIO 188 select USB_OHCI_BIG_ENDIAN_MMIO
189 ---help---
190 Enables support for big-endian USB controllers present on the
191 OpenFirmware platform bus.
198 192
199config USB_OHCI_HCD_PPC_OF_LE 193config USB_OHCI_HCD_PPC_OF_LE
200 bool "Support little endian HC" 194 bool "OHCI support for OF platform bus (little endian)"
201 depends on USB_OHCI_HCD_PPC_OF 195 depends on USB_OHCI_HCD && PPC_OF
202 default n
203 select USB_OHCI_LITTLE_ENDIAN 196 select USB_OHCI_LITTLE_ENDIAN
197 ---help---
198 Enables support for little-endian USB controllers present on the
199 OpenFirmware platform bus.
200
201config USB_OHCI_HCD_PPC_OF
202 bool
203 depends on USB_OHCI_HCD && PPC_OF
204 default USB_OHCI_HCD_PPC_OF_BE || USB_OHCI_HCD_PPC_OF_LE
204 205
205config USB_OHCI_HCD_PCI 206config USB_OHCI_HCD_PCI
206 bool "OHCI support for PCI-bus USB controllers" 207 bool "OHCI support for PCI-bus USB controllers"
diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c
index c3a778bd359c..59d208d94d4e 100644
--- a/drivers/usb/host/ehci-au1xxx.c
+++ b/drivers/usb/host/ehci-au1xxx.c
@@ -113,6 +113,8 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
113 .bus_resume = ehci_bus_resume, 113 .bus_resume = ehci_bus_resume,
114 .relinquish_port = ehci_relinquish_port, 114 .relinquish_port = ehci_relinquish_port,
115 .port_handed_over = ehci_port_handed_over, 115 .port_handed_over = ehci_port_handed_over,
116
117 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
116}; 118};
117 119
118static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) 120static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index bf86809c5120..991174937db3 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -325,6 +325,8 @@ static const struct hc_driver ehci_fsl_hc_driver = {
325 .bus_resume = ehci_bus_resume, 325 .bus_resume = ehci_bus_resume,
326 .relinquish_port = ehci_relinquish_port, 326 .relinquish_port = ehci_relinquish_port,
327 .port_handed_over = ehci_port_handed_over, 327 .port_handed_over = ehci_port_handed_over,
328
329 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
328}; 330};
329 331
330static int ehci_fsl_drv_probe(struct platform_device *pdev) 332static int ehci_fsl_drv_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 2b72473544d3..7d03549c3339 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1003,6 +1003,8 @@ idle_timeout:
1003 schedule_timeout_uninterruptible(1); 1003 schedule_timeout_uninterruptible(1);
1004 goto rescan; 1004 goto rescan;
1005 case QH_STATE_IDLE: /* fully unlinked */ 1005 case QH_STATE_IDLE: /* fully unlinked */
1006 if (qh->clearing_tt)
1007 goto idle_timeout;
1006 if (list_empty (&qh->qtd_list)) { 1008 if (list_empty (&qh->qtd_list)) {
1007 qh_put (qh); 1009 qh_put (qh);
1008 break; 1010 break;
@@ -1030,12 +1032,14 @@ ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
1030 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 1032 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
1031 struct ehci_qh *qh; 1033 struct ehci_qh *qh;
1032 int eptype = usb_endpoint_type(&ep->desc); 1034 int eptype = usb_endpoint_type(&ep->desc);
1035 int epnum = usb_endpoint_num(&ep->desc);
1036 int is_out = usb_endpoint_dir_out(&ep->desc);
1037 unsigned long flags;
1033 1038
1034 if (eptype != USB_ENDPOINT_XFER_BULK && eptype != USB_ENDPOINT_XFER_INT) 1039 if (eptype != USB_ENDPOINT_XFER_BULK && eptype != USB_ENDPOINT_XFER_INT)
1035 return; 1040 return;
1036 1041
1037 rescan: 1042 spin_lock_irqsave(&ehci->lock, flags);
1038 spin_lock_irq(&ehci->lock);
1039 qh = ep->hcpriv; 1043 qh = ep->hcpriv;
1040 1044
1041 /* For Bulk and Interrupt endpoints we maintain the toggle state 1045 /* For Bulk and Interrupt endpoints we maintain the toggle state
@@ -1044,29 +1048,24 @@ ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep)
1044 * the toggle bit in the QH. 1048 * the toggle bit in the QH.
1045 */ 1049 */
1046 if (qh) { 1050 if (qh) {
1051 usb_settoggle(qh->dev, epnum, is_out, 0);
1047 if (!list_empty(&qh->qtd_list)) { 1052 if (!list_empty(&qh->qtd_list)) {
1048 WARN_ONCE(1, "clear_halt for a busy endpoint\n"); 1053 WARN_ONCE(1, "clear_halt for a busy endpoint\n");
1049 } else if (qh->qh_state == QH_STATE_IDLE) { 1054 } else if (qh->qh_state == QH_STATE_LINKED) {
1050 qh->hw_token &= ~cpu_to_hc32(ehci, QTD_TOGGLE); 1055
1051 } else { 1056 /* The toggle value in the QH can't be updated
1052 /* It's not safe to write into the overlay area 1057 * while the QH is active. Unlink it now;
1053 * while the QH is active. Unlink it first and 1058 * re-linking will call qh_refresh().
1054 * wait for the unlink to complete.
1055 */ 1059 */
1056 if (qh->qh_state == QH_STATE_LINKED) { 1060 if (eptype == USB_ENDPOINT_XFER_BULK) {
1057 if (eptype == USB_ENDPOINT_XFER_BULK) { 1061 unlink_async(ehci, qh);
1058 unlink_async(ehci, qh); 1062 } else {
1059 } else { 1063 intr_deschedule(ehci, qh);
1060 intr_deschedule(ehci, qh); 1064 (void) qh_schedule(ehci, qh);
1061 (void) qh_schedule(ehci, qh);
1062 }
1063 } 1065 }
1064 spin_unlock_irq(&ehci->lock);
1065 schedule_timeout_uninterruptible(1);
1066 goto rescan;
1067 } 1066 }
1068 } 1067 }
1069 spin_unlock_irq(&ehci->lock); 1068 spin_unlock_irqrestore(&ehci->lock, flags);
1070} 1069}
1071 1070
1072static int ehci_get_frame (struct usb_hcd *hcd) 1071static int ehci_get_frame (struct usb_hcd *hcd)
diff --git a/drivers/usb/host/ehci-ixp4xx.c b/drivers/usb/host/ehci-ixp4xx.c
index a44bb4a94954..89b7c70c6ed6 100644
--- a/drivers/usb/host/ehci-ixp4xx.c
+++ b/drivers/usb/host/ehci-ixp4xx.c
@@ -61,6 +61,8 @@ static const struct hc_driver ixp4xx_ehci_hc_driver = {
61#endif 61#endif
62 .relinquish_port = ehci_relinquish_port, 62 .relinquish_port = ehci_relinquish_port,
63 .port_handed_over = ehci_port_handed_over, 63 .port_handed_over = ehci_port_handed_over,
64
65 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
64}; 66};
65 67
66static int ixp4xx_ehci_probe(struct platform_device *pdev) 68static int ixp4xx_ehci_probe(struct platform_device *pdev)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 770dd9aba62a..1d283e1b2b8d 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -105,6 +105,7 @@ static int ehci_orion_setup(struct usb_hcd *hcd)
105 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 105 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
106 int retval; 106 int retval;
107 107
108 ehci_reset(ehci);
108 retval = ehci_halt(ehci); 109 retval = ehci_halt(ehci);
109 if (retval) 110 if (retval)
110 return retval; 111 return retval;
@@ -118,7 +119,6 @@ static int ehci_orion_setup(struct usb_hcd *hcd)
118 119
119 hcd->has_tt = 1; 120 hcd->has_tt = 1;
120 121
121 ehci_reset(ehci);
122 ehci_port_power(ehci, 0); 122 ehci_port_power(ehci, 0);
123 123
124 return retval; 124 return retval;
@@ -165,6 +165,8 @@ static const struct hc_driver ehci_orion_hc_driver = {
165 .bus_resume = ehci_bus_resume, 165 .bus_resume = ehci_bus_resume,
166 .relinquish_port = ehci_relinquish_port, 166 .relinquish_port = ehci_relinquish_port,
167 .port_handed_over = ehci_port_handed_over, 167 .port_handed_over = ehci_port_handed_over,
168
169 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
168}; 170};
169 171
170static void __init 172static void __init
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index f3683e1da161..c2f1b7df918c 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -404,6 +404,8 @@ static const struct hc_driver ehci_pci_hc_driver = {
404 .bus_resume = ehci_bus_resume, 404 .bus_resume = ehci_bus_resume,
405 .relinquish_port = ehci_relinquish_port, 405 .relinquish_port = ehci_relinquish_port,
406 .port_handed_over = ehci_port_handed_over, 406 .port_handed_over = ehci_port_handed_over,
407
408 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
407}; 409};
408 410
409/*-------------------------------------------------------------------------*/ 411/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c
index fbd272288fc2..36f96da129f5 100644
--- a/drivers/usb/host/ehci-ppc-of.c
+++ b/drivers/usb/host/ehci-ppc-of.c
@@ -79,6 +79,8 @@ static const struct hc_driver ehci_ppc_of_hc_driver = {
79#endif 79#endif
80 .relinquish_port = ehci_relinquish_port, 80 .relinquish_port = ehci_relinquish_port,
81 .port_handed_over = ehci_port_handed_over, 81 .port_handed_over = ehci_port_handed_over,
82
83 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
82}; 84};
83 85
84 86
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 93f7035d00a1..1dee33b9139e 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -75,6 +75,8 @@ static const struct hc_driver ps3_ehci_hc_driver = {
75#endif 75#endif
76 .relinquish_port = ehci_relinquish_port, 76 .relinquish_port = ehci_relinquish_port,
77 .port_handed_over = ehci_port_handed_over, 77 .port_handed_over = ehci_port_handed_over,
78
79 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
78}; 80};
79 81
80static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev) 82static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev)
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 3192f683f807..9a1384747f3b 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -93,6 +93,22 @@ qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd)
93 qh->hw_qtd_next = QTD_NEXT(ehci, qtd->qtd_dma); 93 qh->hw_qtd_next = QTD_NEXT(ehci, qtd->qtd_dma);
94 qh->hw_alt_next = EHCI_LIST_END(ehci); 94 qh->hw_alt_next = EHCI_LIST_END(ehci);
95 95
96 /* Except for control endpoints, we make hardware maintain data
97 * toggle (like OHCI) ... here (re)initialize the toggle in the QH,
98 * and set the pseudo-toggle in udev. Only usb_clear_halt() will
99 * ever clear it.
100 */
101 if (!(qh->hw_info1 & cpu_to_hc32(ehci, 1 << 14))) {
102 unsigned is_out, epnum;
103
104 is_out = !(qtd->hw_token & cpu_to_hc32(ehci, 1 << 8));
105 epnum = (hc32_to_cpup(ehci, &qh->hw_info1) >> 8) & 0x0f;
106 if (unlikely (!usb_gettoggle (qh->dev, epnum, is_out))) {
107 qh->hw_token &= ~cpu_to_hc32(ehci, QTD_TOGGLE);
108 usb_settoggle (qh->dev, epnum, is_out, 1);
109 }
110 }
111
96 /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */ 112 /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */
97 wmb (); 113 wmb ();
98 qh->hw_token &= cpu_to_hc32(ehci, QTD_TOGGLE | QTD_STS_PING); 114 qh->hw_token &= cpu_to_hc32(ehci, QTD_TOGGLE | QTD_STS_PING);
@@ -123,6 +139,55 @@ qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh)
123 139
124/*-------------------------------------------------------------------------*/ 140/*-------------------------------------------------------------------------*/
125 141
142static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh);
143
144static void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd,
145 struct usb_host_endpoint *ep)
146{
147 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
148 struct ehci_qh *qh = ep->hcpriv;
149 unsigned long flags;
150
151 spin_lock_irqsave(&ehci->lock, flags);
152 qh->clearing_tt = 0;
153 if (qh->qh_state == QH_STATE_IDLE && !list_empty(&qh->qtd_list)
154 && HC_IS_RUNNING(hcd->state))
155 qh_link_async(ehci, qh);
156 spin_unlock_irqrestore(&ehci->lock, flags);
157}
158
159static void ehci_clear_tt_buffer(struct ehci_hcd *ehci, struct ehci_qh *qh,
160 struct urb *urb, u32 token)
161{
162
163 /* If an async split transaction gets an error or is unlinked,
164 * the TT buffer may be left in an indeterminate state. We
165 * have to clear the TT buffer.
166 *
167 * Note: this routine is never called for Isochronous transfers.
168 */
169 if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) {
170#ifdef DEBUG
171 struct usb_device *tt = urb->dev->tt->hub;
172 dev_dbg(&tt->dev,
173 "clear tt buffer port %d, a%d ep%d t%08x\n",
174 urb->dev->ttport, urb->dev->devnum,
175 usb_pipeendpoint(urb->pipe), token);
176#endif /* DEBUG */
177 if (!ehci_is_TDI(ehci)
178 || urb->dev->tt->hub !=
179 ehci_to_hcd(ehci)->self.root_hub) {
180 if (usb_hub_clear_tt_buffer(urb) == 0)
181 qh->clearing_tt = 1;
182 } else {
183
184 /* REVISIT ARC-derived cores don't clear the root
185 * hub TT buffer in this way...
186 */
187 }
188 }
189}
190
126static int qtd_copy_status ( 191static int qtd_copy_status (
127 struct ehci_hcd *ehci, 192 struct ehci_hcd *ehci,
128 struct urb *urb, 193 struct urb *urb,
@@ -149,6 +214,14 @@ static int qtd_copy_status (
149 if (token & QTD_STS_BABBLE) { 214 if (token & QTD_STS_BABBLE) {
150 /* FIXME "must" disable babbling device's port too */ 215 /* FIXME "must" disable babbling device's port too */
151 status = -EOVERFLOW; 216 status = -EOVERFLOW;
217 /* CERR nonzero + halt --> stall */
218 } else if (QTD_CERR(token)) {
219 status = -EPIPE;
220
221 /* In theory, more than one of the following bits can be set
222 * since they are sticky and the transaction is retried.
223 * Which to test first is rather arbitrary.
224 */
152 } else if (token & QTD_STS_MMF) { 225 } else if (token & QTD_STS_MMF) {
153 /* fs/ls interrupt xfer missed the complete-split */ 226 /* fs/ls interrupt xfer missed the complete-split */
154 status = -EPROTO; 227 status = -EPROTO;
@@ -157,21 +230,15 @@ static int qtd_copy_status (
157 ? -ENOSR /* hc couldn't read data */ 230 ? -ENOSR /* hc couldn't read data */
158 : -ECOMM; /* hc couldn't write data */ 231 : -ECOMM; /* hc couldn't write data */
159 } else if (token & QTD_STS_XACT) { 232 } else if (token & QTD_STS_XACT) {
160 /* timeout, bad crc, wrong PID, etc; retried */ 233 /* timeout, bad CRC, wrong PID, etc */
161 if (QTD_CERR (token)) 234 ehci_dbg(ehci, "devpath %s ep%d%s 3strikes\n",
162 status = -EPIPE; 235 urb->dev->devpath,
163 else { 236 usb_pipeendpoint(urb->pipe),
164 ehci_dbg (ehci, "devpath %s ep%d%s 3strikes\n", 237 usb_pipein(urb->pipe) ? "in" : "out");
165 urb->dev->devpath, 238 status = -EPROTO;
166 usb_pipeendpoint (urb->pipe), 239 } else { /* unknown */
167 usb_pipein (urb->pipe) ? "in" : "out");
168 status = -EPROTO;
169 }
170 /* CERR nonzero + no errors + halt --> stall */
171 } else if (QTD_CERR (token))
172 status = -EPIPE;
173 else /* unknown */
174 status = -EPROTO; 240 status = -EPROTO;
241 }
175 242
176 ehci_vdbg (ehci, 243 ehci_vdbg (ehci,
177 "dev%d ep%d%s qtd token %08x --> status %d\n", 244 "dev%d ep%d%s qtd token %08x --> status %d\n",
@@ -179,28 +246,6 @@ static int qtd_copy_status (
179 usb_pipeendpoint (urb->pipe), 246 usb_pipeendpoint (urb->pipe),
180 usb_pipein (urb->pipe) ? "in" : "out", 247 usb_pipein (urb->pipe) ? "in" : "out",
181 token, status); 248 token, status);
182
183 /* if async CSPLIT failed, try cleaning out the TT buffer */
184 if (status != -EPIPE
185 && urb->dev->tt
186 && !usb_pipeint(urb->pipe)
187 && ((token & QTD_STS_MMF) != 0
188 || QTD_CERR(token) == 0)
189 && (!ehci_is_TDI(ehci)
190 || urb->dev->tt->hub !=
191 ehci_to_hcd(ehci)->self.root_hub)) {
192#ifdef DEBUG
193 struct usb_device *tt = urb->dev->tt->hub;
194 dev_dbg (&tt->dev,
195 "clear tt buffer port %d, a%d ep%d t%08x\n",
196 urb->dev->ttport, urb->dev->devnum,
197 usb_pipeendpoint (urb->pipe), token);
198#endif /* DEBUG */
199 /* REVISIT ARC-derived cores don't clear the root
200 * hub TT buffer in this way...
201 */
202 usb_hub_tt_clear_buffer (urb->dev, urb->pipe);
203 }
204 } 249 }
205 250
206 return status; 251 return status;
@@ -391,9 +436,16 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
391 /* qh unlinked; token in overlay may be most current */ 436 /* qh unlinked; token in overlay may be most current */
392 if (state == QH_STATE_IDLE 437 if (state == QH_STATE_IDLE
393 && cpu_to_hc32(ehci, qtd->qtd_dma) 438 && cpu_to_hc32(ehci, qtd->qtd_dma)
394 == qh->hw_current) 439 == qh->hw_current) {
395 token = hc32_to_cpu(ehci, qh->hw_token); 440 token = hc32_to_cpu(ehci, qh->hw_token);
396 441
442 /* An unlink may leave an incomplete
443 * async transaction in the TT buffer.
444 * We have to clear it.
445 */
446 ehci_clear_tt_buffer(ehci, qh, urb, token);
447 }
448
397 /* force halt for unlinked or blocked qh, so we'll 449 /* force halt for unlinked or blocked qh, so we'll
398 * patch the qh later and so that completions can't 450 * patch the qh later and so that completions can't
399 * activate it while we "know" it's stopped. 451 * activate it while we "know" it's stopped.
@@ -419,6 +471,13 @@ halt:
419 && (qtd->hw_alt_next 471 && (qtd->hw_alt_next
420 & EHCI_LIST_END(ehci))) 472 & EHCI_LIST_END(ehci)))
421 last_status = -EINPROGRESS; 473 last_status = -EINPROGRESS;
474
475 /* As part of low/full-speed endpoint-halt processing
476 * we must clear the TT buffer (11.17.5).
477 */
478 if (unlikely(last_status != -EINPROGRESS &&
479 last_status != -EREMOTEIO))
480 ehci_clear_tt_buffer(ehci, qh, urb, token);
422 } 481 }
423 482
424 /* if we're removing something not at the queue head, 483 /* if we're removing something not at the queue head,
@@ -834,6 +893,7 @@ done:
834 qh->qh_state = QH_STATE_IDLE; 893 qh->qh_state = QH_STATE_IDLE;
835 qh->hw_info1 = cpu_to_hc32(ehci, info1); 894 qh->hw_info1 = cpu_to_hc32(ehci, info1);
836 qh->hw_info2 = cpu_to_hc32(ehci, info2); 895 qh->hw_info2 = cpu_to_hc32(ehci, info2);
896 usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
837 qh_refresh (ehci, qh); 897 qh_refresh (ehci, qh);
838 return qh; 898 return qh;
839} 899}
@@ -847,6 +907,10 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
847 __hc32 dma = QH_NEXT(ehci, qh->qh_dma); 907 __hc32 dma = QH_NEXT(ehci, qh->qh_dma);
848 struct ehci_qh *head; 908 struct ehci_qh *head;
849 909
910 /* Don't link a QH if there's a Clear-TT-Buffer pending */
911 if (unlikely(qh->clearing_tt))
912 return;
913
850 /* (re)start the async schedule? */ 914 /* (re)start the async schedule? */
851 head = ehci->async; 915 head = ehci->async;
852 timer_action_done (ehci, TIMER_ASYNC_OFF); 916 timer_action_done (ehci, TIMER_ASYNC_OFF);
@@ -864,7 +928,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
864 } 928 }
865 } 929 }
866 930
867 /* clear halt and maybe recover from silicon quirk */ 931 /* clear halt and/or toggle; and maybe recover from silicon quirk */
868 if (qh->qh_state == QH_STATE_IDLE) 932 if (qh->qh_state == QH_STATE_IDLE)
869 qh_refresh (ehci, qh); 933 qh_refresh (ehci, qh);
870 934
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 9d1babc7ff65..74f7f83b29ad 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1619,11 +1619,14 @@ itd_complete (
1619 desc->status = -EPROTO; 1619 desc->status = -EPROTO;
1620 1620
1621 /* HC need not update length with this error */ 1621 /* HC need not update length with this error */
1622 if (!(t & EHCI_ISOC_BABBLE)) 1622 if (!(t & EHCI_ISOC_BABBLE)) {
1623 desc->actual_length = EHCI_ITD_LENGTH (t); 1623 desc->actual_length = EHCI_ITD_LENGTH(t);
1624 urb->actual_length += desc->actual_length;
1625 }
1624 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) { 1626 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
1625 desc->status = 0; 1627 desc->status = 0;
1626 desc->actual_length = EHCI_ITD_LENGTH (t); 1628 desc->actual_length = EHCI_ITD_LENGTH(t);
1629 urb->actual_length += desc->actual_length;
1627 } else { 1630 } else {
1628 /* URB was too late */ 1631 /* URB was too late */
1629 desc->status = -EXDEV; 1632 desc->status = -EXDEV;
@@ -2014,7 +2017,8 @@ sitd_complete (
2014 desc->status = -EPROTO; 2017 desc->status = -EPROTO;
2015 } else { 2018 } else {
2016 desc->status = 0; 2019 desc->status = 0;
2017 desc->actual_length = desc->length - SITD_LENGTH (t); 2020 desc->actual_length = desc->length - SITD_LENGTH(t);
2021 urb->actual_length += desc->actual_length;
2018 } 2022 }
2019 stream->depth -= stream->interval << 3; 2023 stream->depth -= stream->interval << 3;
2020 2024
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 90ad3395bb21..2bfff30f4704 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -354,7 +354,9 @@ struct ehci_qh {
354 unsigned short period; /* polling interval */ 354 unsigned short period; /* polling interval */
355 unsigned short start; /* where polling starts */ 355 unsigned short start; /* where polling starts */
356#define NO_FRAME ((unsigned short)~0) /* pick new start */ 356#define NO_FRAME ((unsigned short)~0) /* pick new start */
357
357 struct usb_device *dev; /* access to TT */ 358 struct usb_device *dev; /* access to TT */
359 unsigned clearing_tt:1; /* Clear-TT-Buf in progress */
358} __attribute__ ((aligned (32))); 360} __attribute__ ((aligned (32)));
359 361
360/*-------------------------------------------------------------------------*/ 362/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/fhci-sched.c b/drivers/usb/host/fhci-sched.c
index bb63b68ddb77..62a226b61670 100644
--- a/drivers/usb/host/fhci-sched.c
+++ b/drivers/usb/host/fhci-sched.c
@@ -576,9 +576,7 @@ irqreturn_t fhci_irq(struct usb_hcd *hcd)
576 out_be16(&usb->fhci->regs->usb_event, 576 out_be16(&usb->fhci->regs->usb_event,
577 usb->saved_msk); 577 usb->saved_msk);
578 } else if (usb->port_status == FHCI_PORT_DISABLED) { 578 } else if (usb->port_status == FHCI_PORT_DISABLED) {
579 if (fhci_ioports_check_bus_state(fhci) == 1 && 579 if (fhci_ioports_check_bus_state(fhci) == 1)
580 usb->port_status != FHCI_PORT_LOW &&
581 usb->port_status != FHCI_PORT_FULL)
582 fhci_device_connected_interrupt(fhci); 580 fhci_device_connected_interrupt(fhci);
583 } 581 }
584 usb_er &= ~USB_E_RESET_MASK; 582 usb_er &= ~USB_E_RESET_MASK;
@@ -605,9 +603,7 @@ irqreturn_t fhci_irq(struct usb_hcd *hcd)
605 } 603 }
606 604
607 if (usb_er & USB_E_IDLE_MASK) { 605 if (usb_er & USB_E_IDLE_MASK) {
608 if (usb->port_status == FHCI_PORT_DISABLED && 606 if (usb->port_status == FHCI_PORT_DISABLED) {
609 usb->port_status != FHCI_PORT_LOW &&
610 usb->port_status != FHCI_PORT_FULL) {
611 usb_er &= ~USB_E_RESET_MASK; 607 usb_er &= ~USB_E_RESET_MASK;
612 fhci_device_connected_interrupt(fhci); 608 fhci_device_connected_interrupt(fhci);
613 } else if (usb->port_status == 609 } else if (usb->port_status ==
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index 3fa3a1702796..d4feebfc63bd 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -361,7 +361,7 @@ static int __devexit isp1760_plat_remove(struct platform_device *pdev)
361 361
362static struct platform_driver isp1760_plat_driver = { 362static struct platform_driver isp1760_plat_driver = {
363 .probe = isp1760_plat_probe, 363 .probe = isp1760_plat_probe,
364 .remove = isp1760_plat_remove, 364 .remove = __devexit_p(isp1760_plat_remove),
365 .driver = { 365 .driver = {
366 .name = "isp1760", 366 .name = "isp1760",
367 }, 367 },
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index f3aaba35e912..83cbecd2a1ed 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -282,6 +282,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
282static void ohci_omap_stop(struct usb_hcd *hcd) 282static void ohci_omap_stop(struct usb_hcd *hcd)
283{ 283{
284 dev_dbg(hcd->self.controller, "stopping USB Controller\n"); 284 dev_dbg(hcd->self.controller, "stopping USB Controller\n");
285 ohci_stop(hcd);
285 omap_ohci_clock_power(0); 286 omap_ohci_clock_power(0);
286} 287}
287 288
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 56976cc0352a..e18f74946e68 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -26,7 +26,6 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/sched.h> 28#include <linux/sched.h>
29#include <linux/smp_lock.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/init.h> 30#include <linux/init.h>
32#include <linux/timer.h> 31#include <linux/timer.h>
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
index 2501c571f855..705e34324156 100644
--- a/drivers/usb/host/xhci-dbg.c
+++ b/drivers/usb/host/xhci-dbg.c
@@ -173,6 +173,7 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int
173{ 173{
174 void *addr; 174 void *addr;
175 u32 temp; 175 u32 temp;
176 u64 temp_64;
176 177
177 addr = &ir_set->irq_pending; 178 addr = &ir_set->irq_pending;
178 temp = xhci_readl(xhci, addr); 179 temp = xhci_readl(xhci, addr);
@@ -200,25 +201,15 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int
200 xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n", 201 xhci_dbg(xhci, " WARN: %p: ir_set.rsvd = 0x%x\n",
201 addr, (unsigned int)temp); 202 addr, (unsigned int)temp);
202 203
203 addr = &ir_set->erst_base[0]; 204 addr = &ir_set->erst_base;
204 temp = xhci_readl(xhci, addr); 205 temp_64 = xhci_read_64(xhci, addr);
205 xhci_dbg(xhci, " %p: ir_set.erst_base[0] = 0x%x\n", 206 xhci_dbg(xhci, " %p: ir_set.erst_base = @%08llx\n",
206 addr, (unsigned int) temp); 207 addr, temp_64);
207
208 addr = &ir_set->erst_base[1];
209 temp = xhci_readl(xhci, addr);
210 xhci_dbg(xhci, " %p: ir_set.erst_base[1] = 0x%x\n",
211 addr, (unsigned int) temp);
212 208
213 addr = &ir_set->erst_dequeue[0]; 209 addr = &ir_set->erst_dequeue;
214 temp = xhci_readl(xhci, addr); 210 temp_64 = xhci_read_64(xhci, addr);
215 xhci_dbg(xhci, " %p: ir_set.erst_dequeue[0] = 0x%x\n", 211 xhci_dbg(xhci, " %p: ir_set.erst_dequeue = @%08llx\n",
216 addr, (unsigned int) temp); 212 addr, temp_64);
217
218 addr = &ir_set->erst_dequeue[1];
219 temp = xhci_readl(xhci, addr);
220 xhci_dbg(xhci, " %p: ir_set.erst_dequeue[1] = 0x%x\n",
221 addr, (unsigned int) temp);
222} 213}
223 214
224void xhci_print_run_regs(struct xhci_hcd *xhci) 215void xhci_print_run_regs(struct xhci_hcd *xhci)
@@ -268,8 +259,7 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
268 xhci_dbg(xhci, "Link TRB:\n"); 259 xhci_dbg(xhci, "Link TRB:\n");
269 xhci_print_trb_offsets(xhci, trb); 260 xhci_print_trb_offsets(xhci, trb);
270 261
271 address = trb->link.segment_ptr[0] + 262 address = trb->link.segment_ptr;
272 (((u64) trb->link.segment_ptr[1]) << 32);
273 xhci_dbg(xhci, "Next ring segment DMA address = 0x%llx\n", address); 263 xhci_dbg(xhci, "Next ring segment DMA address = 0x%llx\n", address);
274 264
275 xhci_dbg(xhci, "Interrupter target = 0x%x\n", 265 xhci_dbg(xhci, "Interrupter target = 0x%x\n",
@@ -282,8 +272,7 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
282 (unsigned int) (trb->link.control & TRB_NO_SNOOP)); 272 (unsigned int) (trb->link.control & TRB_NO_SNOOP));
283 break; 273 break;
284 case TRB_TYPE(TRB_TRANSFER): 274 case TRB_TYPE(TRB_TRANSFER):
285 address = trb->trans_event.buffer[0] + 275 address = trb->trans_event.buffer;
286 (((u64) trb->trans_event.buffer[1]) << 32);
287 /* 276 /*
288 * FIXME: look at flags to figure out if it's an address or if 277 * FIXME: look at flags to figure out if it's an address or if
289 * the data is directly in the buffer field. 278 * the data is directly in the buffer field.
@@ -291,8 +280,7 @@ void xhci_debug_trb(struct xhci_hcd *xhci, union xhci_trb *trb)
291 xhci_dbg(xhci, "DMA address or buffer contents= %llu\n", address); 280 xhci_dbg(xhci, "DMA address or buffer contents= %llu\n", address);
292 break; 281 break;
293 case TRB_TYPE(TRB_COMPLETION): 282 case TRB_TYPE(TRB_COMPLETION):
294 address = trb->event_cmd.cmd_trb[0] + 283 address = trb->event_cmd.cmd_trb;
295 (((u64) trb->event_cmd.cmd_trb[1]) << 32);
296 xhci_dbg(xhci, "Command TRB pointer = %llu\n", address); 284 xhci_dbg(xhci, "Command TRB pointer = %llu\n", address);
297 xhci_dbg(xhci, "Completion status = %u\n", 285 xhci_dbg(xhci, "Completion status = %u\n",
298 (unsigned int) GET_COMP_CODE(trb->event_cmd.status)); 286 (unsigned int) GET_COMP_CODE(trb->event_cmd.status));
@@ -328,8 +316,8 @@ void xhci_debug_segment(struct xhci_hcd *xhci, struct xhci_segment *seg)
328 for (i = 0; i < TRBS_PER_SEGMENT; ++i) { 316 for (i = 0; i < TRBS_PER_SEGMENT; ++i) {
329 trb = &seg->trbs[i]; 317 trb = &seg->trbs[i];
330 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", addr, 318 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", addr,
331 (unsigned int) trb->link.segment_ptr[0], 319 lower_32_bits(trb->link.segment_ptr),
332 (unsigned int) trb->link.segment_ptr[1], 320 upper_32_bits(trb->link.segment_ptr),
333 (unsigned int) trb->link.intr_target, 321 (unsigned int) trb->link.intr_target,
334 (unsigned int) trb->link.control); 322 (unsigned int) trb->link.control);
335 addr += sizeof(*trb); 323 addr += sizeof(*trb);
@@ -386,8 +374,8 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
386 entry = &erst->entries[i]; 374 entry = &erst->entries[i];
387 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n", 375 xhci_dbg(xhci, "@%08x %08x %08x %08x %08x\n",
388 (unsigned int) addr, 376 (unsigned int) addr,
389 (unsigned int) entry->seg_addr[0], 377 lower_32_bits(entry->seg_addr),
390 (unsigned int) entry->seg_addr[1], 378 upper_32_bits(entry->seg_addr),
391 (unsigned int) entry->seg_size, 379 (unsigned int) entry->seg_size,
392 (unsigned int) entry->rsvd); 380 (unsigned int) entry->rsvd);
393 addr += sizeof(*entry); 381 addr += sizeof(*entry);
@@ -396,90 +384,147 @@ void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
396 384
397void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci) 385void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci)
398{ 386{
399 u32 val; 387 u64 val;
400 388
401 val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[0]); 389 val = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
402 xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = 0x%x\n", val); 390 xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = @%08x\n",
403 val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[1]); 391 lower_32_bits(val));
404 xhci_dbg(xhci, "// xHC command ring deq ptr high bits = 0x%x\n", val); 392 xhci_dbg(xhci, "// xHC command ring deq ptr high bits = @%08x\n",
393 upper_32_bits(val));
405} 394}
406 395
407void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_device_control *ctx, dma_addr_t dma, unsigned int last_ep) 396/* Print the last 32 bytes for 64-byte contexts */
397static void dbg_rsvd64(struct xhci_hcd *xhci, u64 *ctx, dma_addr_t dma)
398{
399 int i;
400 for (i = 0; i < 4; ++i) {
401 xhci_dbg(xhci, "@%p (virt) @%08llx "
402 "(dma) %#08llx - rsvd64[%d]\n",
403 &ctx[4 + i], (unsigned long long)dma,
404 ctx[4 + i], i);
405 dma += 8;
406 }
407}
408
409void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx)
408{ 410{
409 int i, j;
410 int last_ep_ctx = 31;
411 /* Fields are 32 bits wide, DMA addresses are in bytes */ 411 /* Fields are 32 bits wide, DMA addresses are in bytes */
412 int field_size = 32 / 8; 412 int field_size = 32 / 8;
413 int i;
413 414
414 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n", 415 struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
415 &ctx->drop_flags, (unsigned long long)dma, 416 dma_addr_t dma = ctx->dma + ((unsigned long)slot_ctx - (unsigned long)ctx);
416 ctx->drop_flags); 417 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
417 dma += field_size;
418 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
419 &ctx->add_flags, (unsigned long long)dma,
420 ctx->add_flags);
421 dma += field_size;
422 for (i = 0; i > 6; ++i) {
423 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
424 &ctx->rsvd[i], (unsigned long long)dma,
425 ctx->rsvd[i], i);
426 dma += field_size;
427 }
428 418
429 xhci_dbg(xhci, "Slot Context:\n"); 419 xhci_dbg(xhci, "Slot Context:\n");
430 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n", 420 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info\n",
431 &ctx->slot.dev_info, 421 &slot_ctx->dev_info,
432 (unsigned long long)dma, ctx->slot.dev_info); 422 (unsigned long long)dma, slot_ctx->dev_info);
433 dma += field_size; 423 dma += field_size;
434 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n", 424 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_info2\n",
435 &ctx->slot.dev_info2, 425 &slot_ctx->dev_info2,
436 (unsigned long long)dma, ctx->slot.dev_info2); 426 (unsigned long long)dma, slot_ctx->dev_info2);
437 dma += field_size; 427 dma += field_size;
438 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n", 428 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tt_info\n",
439 &ctx->slot.tt_info, 429 &slot_ctx->tt_info,
440 (unsigned long long)dma, ctx->slot.tt_info); 430 (unsigned long long)dma, slot_ctx->tt_info);
441 dma += field_size; 431 dma += field_size;
442 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n", 432 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - dev_state\n",
443 &ctx->slot.dev_state, 433 &slot_ctx->dev_state,
444 (unsigned long long)dma, ctx->slot.dev_state); 434 (unsigned long long)dma, slot_ctx->dev_state);
445 dma += field_size; 435 dma += field_size;
446 for (i = 0; i > 4; ++i) { 436 for (i = 0; i < 4; ++i) {
447 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n", 437 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
448 &ctx->slot.reserved[i], (unsigned long long)dma, 438 &slot_ctx->reserved[i], (unsigned long long)dma,
449 ctx->slot.reserved[i], i); 439 slot_ctx->reserved[i], i);
450 dma += field_size; 440 dma += field_size;
451 } 441 }
452 442
443 if (csz)
444 dbg_rsvd64(xhci, (u64 *)slot_ctx, dma);
445}
446
447void xhci_dbg_ep_ctx(struct xhci_hcd *xhci,
448 struct xhci_container_ctx *ctx,
449 unsigned int last_ep)
450{
451 int i, j;
452 int last_ep_ctx = 31;
453 /* Fields are 32 bits wide, DMA addresses are in bytes */
454 int field_size = 32 / 8;
455 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
456
453 if (last_ep < 31) 457 if (last_ep < 31)
454 last_ep_ctx = last_ep + 1; 458 last_ep_ctx = last_ep + 1;
455 for (i = 0; i < last_ep_ctx; ++i) { 459 for (i = 0; i < last_ep_ctx; ++i) {
460 struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, ctx, i);
461 dma_addr_t dma = ctx->dma +
462 ((unsigned long)ep_ctx - (unsigned long)ctx);
463
456 xhci_dbg(xhci, "Endpoint %02d Context:\n", i); 464 xhci_dbg(xhci, "Endpoint %02d Context:\n", i);
457 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n", 465 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info\n",
458 &ctx->ep[i].ep_info, 466 &ep_ctx->ep_info,
459 (unsigned long long)dma, ctx->ep[i].ep_info); 467 (unsigned long long)dma, ep_ctx->ep_info);
460 dma += field_size; 468 dma += field_size;
461 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n", 469 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - ep_info2\n",
462 &ctx->ep[i].ep_info2, 470 &ep_ctx->ep_info2,
463 (unsigned long long)dma, ctx->ep[i].ep_info2); 471 (unsigned long long)dma, ep_ctx->ep_info2);
464 dma += field_size;
465 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - deq[0]\n",
466 &ctx->ep[i].deq[0],
467 (unsigned long long)dma, ctx->ep[i].deq[0]);
468 dma += field_size;
469 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - deq[1]\n",
470 &ctx->ep[i].deq[1],
471 (unsigned long long)dma, ctx->ep[i].deq[1]);
472 dma += field_size; 472 dma += field_size;
473 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08llx - deq\n",
474 &ep_ctx->deq,
475 (unsigned long long)dma, ep_ctx->deq);
476 dma += 2*field_size;
473 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n", 477 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - tx_info\n",
474 &ctx->ep[i].tx_info, 478 &ep_ctx->tx_info,
475 (unsigned long long)dma, ctx->ep[i].tx_info); 479 (unsigned long long)dma, ep_ctx->tx_info);
476 dma += field_size; 480 dma += field_size;
477 for (j = 0; j < 3; ++j) { 481 for (j = 0; j < 3; ++j) {
478 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n", 482 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd[%d]\n",
479 &ctx->ep[i].reserved[j], 483 &ep_ctx->reserved[j],
480 (unsigned long long)dma, 484 (unsigned long long)dma,
481 ctx->ep[i].reserved[j], j); 485 ep_ctx->reserved[j], j);
486 dma += field_size;
487 }
488
489 if (csz)
490 dbg_rsvd64(xhci, (u64 *)ep_ctx, dma);
491 }
492}
493
494void xhci_dbg_ctx(struct xhci_hcd *xhci,
495 struct xhci_container_ctx *ctx,
496 unsigned int last_ep)
497{
498 int i;
499 /* Fields are 32 bits wide, DMA addresses are in bytes */
500 int field_size = 32 / 8;
501 struct xhci_slot_ctx *slot_ctx;
502 dma_addr_t dma = ctx->dma;
503 int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
504
505 if (ctx->type == XHCI_CTX_TYPE_INPUT) {
506 struct xhci_input_control_ctx *ctrl_ctx =
507 xhci_get_input_control_ctx(xhci, ctx);
508 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n",
509 &ctrl_ctx->drop_flags, (unsigned long long)dma,
510 ctrl_ctx->drop_flags);
511 dma += field_size;
512 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - add flags\n",
513 &ctrl_ctx->add_flags, (unsigned long long)dma,
514 ctrl_ctx->add_flags);
515 dma += field_size;
516 for (i = 0; i < 6; ++i) {
517 xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - rsvd2[%d]\n",
518 &ctrl_ctx->rsvd2[i], (unsigned long long)dma,
519 ctrl_ctx->rsvd2[i], i);
482 dma += field_size; 520 dma += field_size;
483 } 521 }
522
523 if (csz)
524 dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma);
484 } 525 }
526
527 slot_ctx = xhci_get_slot_ctx(xhci, ctx);
528 xhci_dbg_slot_ctx(xhci, ctx);
529 xhci_dbg_ep_ctx(xhci, ctx, last_ep);
485} 530}
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c
index dba3e07ccd09..816c39caca1c 100644
--- a/drivers/usb/host/xhci-hcd.c
+++ b/drivers/usb/host/xhci-hcd.c
@@ -103,7 +103,10 @@ int xhci_reset(struct xhci_hcd *xhci)
103 u32 state; 103 u32 state;
104 104
105 state = xhci_readl(xhci, &xhci->op_regs->status); 105 state = xhci_readl(xhci, &xhci->op_regs->status);
106 BUG_ON((state & STS_HALT) == 0); 106 if ((state & STS_HALT) == 0) {
107 xhci_warn(xhci, "Host controller not halted, aborting reset.\n");
108 return 0;
109 }
107 110
108 xhci_dbg(xhci, "// Reset the HC\n"); 111 xhci_dbg(xhci, "// Reset the HC\n");
109 command = xhci_readl(xhci, &xhci->op_regs->command); 112 command = xhci_readl(xhci, &xhci->op_regs->command);
@@ -226,6 +229,7 @@ int xhci_init(struct usb_hcd *hcd)
226static void xhci_work(struct xhci_hcd *xhci) 229static void xhci_work(struct xhci_hcd *xhci)
227{ 230{
228 u32 temp; 231 u32 temp;
232 u64 temp_64;
229 233
230 /* 234 /*
231 * Clear the op reg interrupt status first, 235 * Clear the op reg interrupt status first,
@@ -248,9 +252,9 @@ static void xhci_work(struct xhci_hcd *xhci)
248 /* FIXME this should be a delayed service routine that clears the EHB */ 252 /* FIXME this should be a delayed service routine that clears the EHB */
249 xhci_handle_event(xhci); 253 xhci_handle_event(xhci);
250 254
251 /* Clear the event handler busy flag; the event ring should be empty. */ 255 /* Clear the event handler busy flag (RW1C); the event ring should be empty. */
252 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]); 256 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
253 xhci_writel(xhci, temp & ~ERST_EHB, &xhci->ir_set->erst_dequeue[0]); 257 xhci_write_64(xhci, temp_64 | ERST_EHB, &xhci->ir_set->erst_dequeue);
254 /* Flush posted writes -- FIXME is this necessary? */ 258 /* Flush posted writes -- FIXME is this necessary? */
255 xhci_readl(xhci, &xhci->ir_set->irq_pending); 259 xhci_readl(xhci, &xhci->ir_set->irq_pending);
256} 260}
@@ -266,19 +270,34 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
266{ 270{
267 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 271 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
268 u32 temp, temp2; 272 u32 temp, temp2;
273 union xhci_trb *trb;
269 274
270 spin_lock(&xhci->lock); 275 spin_lock(&xhci->lock);
276 trb = xhci->event_ring->dequeue;
271 /* Check if the xHC generated the interrupt, or the irq is shared */ 277 /* Check if the xHC generated the interrupt, or the irq is shared */
272 temp = xhci_readl(xhci, &xhci->op_regs->status); 278 temp = xhci_readl(xhci, &xhci->op_regs->status);
273 temp2 = xhci_readl(xhci, &xhci->ir_set->irq_pending); 279 temp2 = xhci_readl(xhci, &xhci->ir_set->irq_pending);
280 if (temp == 0xffffffff && temp2 == 0xffffffff)
281 goto hw_died;
282
274 if (!(temp & STS_EINT) && !ER_IRQ_PENDING(temp2)) { 283 if (!(temp & STS_EINT) && !ER_IRQ_PENDING(temp2)) {
275 spin_unlock(&xhci->lock); 284 spin_unlock(&xhci->lock);
276 return IRQ_NONE; 285 return IRQ_NONE;
277 } 286 }
287 xhci_dbg(xhci, "op reg status = %08x\n", temp);
288 xhci_dbg(xhci, "ir set irq_pending = %08x\n", temp2);
289 xhci_dbg(xhci, "Event ring dequeue ptr:\n");
290 xhci_dbg(xhci, "@%llx %08x %08x %08x %08x\n",
291 (unsigned long long)xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, trb),
292 lower_32_bits(trb->link.segment_ptr),
293 upper_32_bits(trb->link.segment_ptr),
294 (unsigned int) trb->link.intr_target,
295 (unsigned int) trb->link.control);
278 296
279 if (temp & STS_FATAL) { 297 if (temp & STS_FATAL) {
280 xhci_warn(xhci, "WARNING: Host System Error\n"); 298 xhci_warn(xhci, "WARNING: Host System Error\n");
281 xhci_halt(xhci); 299 xhci_halt(xhci);
300hw_died:
282 xhci_to_hcd(xhci)->state = HC_STATE_HALT; 301 xhci_to_hcd(xhci)->state = HC_STATE_HALT;
283 spin_unlock(&xhci->lock); 302 spin_unlock(&xhci->lock);
284 return -ESHUTDOWN; 303 return -ESHUTDOWN;
@@ -295,6 +314,7 @@ void xhci_event_ring_work(unsigned long arg)
295{ 314{
296 unsigned long flags; 315 unsigned long flags;
297 int temp; 316 int temp;
317 u64 temp_64;
298 struct xhci_hcd *xhci = (struct xhci_hcd *) arg; 318 struct xhci_hcd *xhci = (struct xhci_hcd *) arg;
299 int i, j; 319 int i, j;
300 320
@@ -311,9 +331,9 @@ void xhci_event_ring_work(unsigned long arg)
311 xhci_dbg(xhci, "Event ring:\n"); 331 xhci_dbg(xhci, "Event ring:\n");
312 xhci_debug_segment(xhci, xhci->event_ring->deq_seg); 332 xhci_debug_segment(xhci, xhci->event_ring->deq_seg);
313 xhci_dbg_ring_ptrs(xhci, xhci->event_ring); 333 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
314 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]); 334 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
315 temp &= ERST_PTR_MASK; 335 temp_64 &= ~ERST_PTR_MASK;
316 xhci_dbg(xhci, "ERST deq = 0x%x\n", temp); 336 xhci_dbg(xhci, "ERST deq = 64'h%0lx\n", (long unsigned int) temp_64);
317 xhci_dbg(xhci, "Command ring:\n"); 337 xhci_dbg(xhci, "Command ring:\n");
318 xhci_debug_segment(xhci, xhci->cmd_ring->deq_seg); 338 xhci_debug_segment(xhci, xhci->cmd_ring->deq_seg);
319 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring); 339 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
@@ -356,6 +376,7 @@ void xhci_event_ring_work(unsigned long arg)
356int xhci_run(struct usb_hcd *hcd) 376int xhci_run(struct usb_hcd *hcd)
357{ 377{
358 u32 temp; 378 u32 temp;
379 u64 temp_64;
359 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 380 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
360 void (*doorbell)(struct xhci_hcd *) = NULL; 381 void (*doorbell)(struct xhci_hcd *) = NULL;
361 382
@@ -382,6 +403,20 @@ int xhci_run(struct usb_hcd *hcd)
382 add_timer(&xhci->event_ring_timer); 403 add_timer(&xhci->event_ring_timer);
383#endif 404#endif
384 405
406 xhci_dbg(xhci, "Command ring memory map follows:\n");
407 xhci_debug_ring(xhci, xhci->cmd_ring);
408 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
409 xhci_dbg_cmd_ptrs(xhci);
410
411 xhci_dbg(xhci, "ERST memory map follows:\n");
412 xhci_dbg_erst(xhci, &xhci->erst);
413 xhci_dbg(xhci, "Event ring:\n");
414 xhci_debug_ring(xhci, xhci->event_ring);
415 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
416 temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
417 temp_64 &= ~ERST_PTR_MASK;
418 xhci_dbg(xhci, "ERST deq = 64'h%0lx\n", (long unsigned int) temp_64);
419
385 xhci_dbg(xhci, "// Set the interrupt modulation register\n"); 420 xhci_dbg(xhci, "// Set the interrupt modulation register\n");
386 temp = xhci_readl(xhci, &xhci->ir_set->irq_control); 421 temp = xhci_readl(xhci, &xhci->ir_set->irq_control);
387 temp &= ~ER_IRQ_INTERVAL_MASK; 422 temp &= ~ER_IRQ_INTERVAL_MASK;
@@ -406,22 +441,6 @@ int xhci_run(struct usb_hcd *hcd)
406 if (NUM_TEST_NOOPS > 0) 441 if (NUM_TEST_NOOPS > 0)
407 doorbell = xhci_setup_one_noop(xhci); 442 doorbell = xhci_setup_one_noop(xhci);
408 443
409 xhci_dbg(xhci, "Command ring memory map follows:\n");
410 xhci_debug_ring(xhci, xhci->cmd_ring);
411 xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
412 xhci_dbg_cmd_ptrs(xhci);
413
414 xhci_dbg(xhci, "ERST memory map follows:\n");
415 xhci_dbg_erst(xhci, &xhci->erst);
416 xhci_dbg(xhci, "Event ring:\n");
417 xhci_debug_ring(xhci, xhci->event_ring);
418 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);
419 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]);
420 temp &= ERST_PTR_MASK;
421 xhci_dbg(xhci, "ERST deq = 0x%x\n", temp);
422 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[1]);
423 xhci_dbg(xhci, "ERST deq upper = 0x%x\n", temp);
424
425 temp = xhci_readl(xhci, &xhci->op_regs->command); 444 temp = xhci_readl(xhci, &xhci->op_regs->command);
426 temp |= (CMD_RUN); 445 temp |= (CMD_RUN);
427 xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n", 446 xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
@@ -601,10 +620,13 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
601 goto exit; 620 goto exit;
602 } 621 }
603 if (usb_endpoint_xfer_control(&urb->ep->desc)) 622 if (usb_endpoint_xfer_control(&urb->ep->desc))
604 ret = xhci_queue_ctrl_tx(xhci, mem_flags, urb, 623 /* We have a spinlock and interrupts disabled, so we must pass
624 * atomic context to this function, which may allocate memory.
625 */
626 ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb,
605 slot_id, ep_index); 627 slot_id, ep_index);
606 else if (usb_endpoint_xfer_bulk(&urb->ep->desc)) 628 else if (usb_endpoint_xfer_bulk(&urb->ep->desc))
607 ret = xhci_queue_bulk_tx(xhci, mem_flags, urb, 629 ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb,
608 slot_id, ep_index); 630 slot_id, ep_index);
609 else 631 else
610 ret = -EINVAL; 632 ret = -EINVAL;
@@ -661,8 +683,12 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
661 goto done; 683 goto done;
662 684
663 xhci_dbg(xhci, "Cancel URB %p\n", urb); 685 xhci_dbg(xhci, "Cancel URB %p\n", urb);
686 xhci_dbg(xhci, "Event ring:\n");
687 xhci_debug_ring(xhci, xhci->event_ring);
664 ep_index = xhci_get_endpoint_index(&urb->ep->desc); 688 ep_index = xhci_get_endpoint_index(&urb->ep->desc);
665 ep_ring = xhci->devs[urb->dev->slot_id]->ep_rings[ep_index]; 689 ep_ring = xhci->devs[urb->dev->slot_id]->ep_rings[ep_index];
690 xhci_dbg(xhci, "Endpoint ring:\n");
691 xhci_debug_ring(xhci, ep_ring);
666 td = (struct xhci_td *) urb->hcpriv; 692 td = (struct xhci_td *) urb->hcpriv;
667 693
668 ep_ring->cancels_pending++; 694 ep_ring->cancels_pending++;
@@ -696,7 +722,9 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
696 struct usb_host_endpoint *ep) 722 struct usb_host_endpoint *ep)
697{ 723{
698 struct xhci_hcd *xhci; 724 struct xhci_hcd *xhci;
699 struct xhci_device_control *in_ctx; 725 struct xhci_container_ctx *in_ctx, *out_ctx;
726 struct xhci_input_control_ctx *ctrl_ctx;
727 struct xhci_slot_ctx *slot_ctx;
700 unsigned int last_ctx; 728 unsigned int last_ctx;
701 unsigned int ep_index; 729 unsigned int ep_index;
702 struct xhci_ep_ctx *ep_ctx; 730 struct xhci_ep_ctx *ep_ctx;
@@ -724,31 +752,34 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
724 } 752 }
725 753
726 in_ctx = xhci->devs[udev->slot_id]->in_ctx; 754 in_ctx = xhci->devs[udev->slot_id]->in_ctx;
755 out_ctx = xhci->devs[udev->slot_id]->out_ctx;
756 ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
727 ep_index = xhci_get_endpoint_index(&ep->desc); 757 ep_index = xhci_get_endpoint_index(&ep->desc);
728 ep_ctx = &xhci->devs[udev->slot_id]->out_ctx->ep[ep_index]; 758 ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index);
729 /* If the HC already knows the endpoint is disabled, 759 /* If the HC already knows the endpoint is disabled,
730 * or the HCD has noted it is disabled, ignore this request 760 * or the HCD has noted it is disabled, ignore this request
731 */ 761 */
732 if ((ep_ctx->ep_info & EP_STATE_MASK) == EP_STATE_DISABLED || 762 if ((ep_ctx->ep_info & EP_STATE_MASK) == EP_STATE_DISABLED ||
733 in_ctx->drop_flags & xhci_get_endpoint_flag(&ep->desc)) { 763 ctrl_ctx->drop_flags & xhci_get_endpoint_flag(&ep->desc)) {
734 xhci_warn(xhci, "xHCI %s called with disabled ep %p\n", 764 xhci_warn(xhci, "xHCI %s called with disabled ep %p\n",
735 __func__, ep); 765 __func__, ep);
736 return 0; 766 return 0;
737 } 767 }
738 768
739 in_ctx->drop_flags |= drop_flag; 769 ctrl_ctx->drop_flags |= drop_flag;
740 new_drop_flags = in_ctx->drop_flags; 770 new_drop_flags = ctrl_ctx->drop_flags;
741 771
742 in_ctx->add_flags = ~drop_flag; 772 ctrl_ctx->add_flags = ~drop_flag;
743 new_add_flags = in_ctx->add_flags; 773 new_add_flags = ctrl_ctx->add_flags;
744 774
745 last_ctx = xhci_last_valid_endpoint(in_ctx->add_flags); 775 last_ctx = xhci_last_valid_endpoint(ctrl_ctx->add_flags);
776 slot_ctx = xhci_get_slot_ctx(xhci, in_ctx);
746 /* Update the last valid endpoint context, if we deleted the last one */ 777 /* Update the last valid endpoint context, if we deleted the last one */
747 if ((in_ctx->slot.dev_info & LAST_CTX_MASK) > LAST_CTX(last_ctx)) { 778 if ((slot_ctx->dev_info & LAST_CTX_MASK) > LAST_CTX(last_ctx)) {
748 in_ctx->slot.dev_info &= ~LAST_CTX_MASK; 779 slot_ctx->dev_info &= ~LAST_CTX_MASK;
749 in_ctx->slot.dev_info |= LAST_CTX(last_ctx); 780 slot_ctx->dev_info |= LAST_CTX(last_ctx);
750 } 781 }
751 new_slot_info = in_ctx->slot.dev_info; 782 new_slot_info = slot_ctx->dev_info;
752 783
753 xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep); 784 xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep);
754 785
@@ -778,17 +809,22 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
778 struct usb_host_endpoint *ep) 809 struct usb_host_endpoint *ep)
779{ 810{
780 struct xhci_hcd *xhci; 811 struct xhci_hcd *xhci;
781 struct xhci_device_control *in_ctx; 812 struct xhci_container_ctx *in_ctx, *out_ctx;
782 unsigned int ep_index; 813 unsigned int ep_index;
783 struct xhci_ep_ctx *ep_ctx; 814 struct xhci_ep_ctx *ep_ctx;
815 struct xhci_slot_ctx *slot_ctx;
816 struct xhci_input_control_ctx *ctrl_ctx;
784 u32 added_ctxs; 817 u32 added_ctxs;
785 unsigned int last_ctx; 818 unsigned int last_ctx;
786 u32 new_add_flags, new_drop_flags, new_slot_info; 819 u32 new_add_flags, new_drop_flags, new_slot_info;
787 int ret = 0; 820 int ret = 0;
788 821
789 ret = xhci_check_args(hcd, udev, ep, 1, __func__); 822 ret = xhci_check_args(hcd, udev, ep, 1, __func__);
790 if (ret <= 0) 823 if (ret <= 0) {
824 /* So we won't queue a reset ep command for a root hub */
825 ep->hcpriv = NULL;
791 return ret; 826 return ret;
827 }
792 xhci = hcd_to_xhci(hcd); 828 xhci = hcd_to_xhci(hcd);
793 829
794 added_ctxs = xhci_get_endpoint_flag(&ep->desc); 830 added_ctxs = xhci_get_endpoint_flag(&ep->desc);
@@ -810,12 +846,14 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
810 } 846 }
811 847
812 in_ctx = xhci->devs[udev->slot_id]->in_ctx; 848 in_ctx = xhci->devs[udev->slot_id]->in_ctx;
849 out_ctx = xhci->devs[udev->slot_id]->out_ctx;
850 ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
813 ep_index = xhci_get_endpoint_index(&ep->desc); 851 ep_index = xhci_get_endpoint_index(&ep->desc);
814 ep_ctx = &xhci->devs[udev->slot_id]->out_ctx->ep[ep_index]; 852 ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index);
815 /* If the HCD has already noted the endpoint is enabled, 853 /* If the HCD has already noted the endpoint is enabled,
816 * ignore this request. 854 * ignore this request.
817 */ 855 */
818 if (in_ctx->add_flags & xhci_get_endpoint_flag(&ep->desc)) { 856 if (ctrl_ctx->add_flags & xhci_get_endpoint_flag(&ep->desc)) {
819 xhci_warn(xhci, "xHCI %s called with enabled ep %p\n", 857 xhci_warn(xhci, "xHCI %s called with enabled ep %p\n",
820 __func__, ep); 858 __func__, ep);
821 return 0; 859 return 0;
@@ -833,8 +871,8 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
833 return -ENOMEM; 871 return -ENOMEM;
834 } 872 }
835 873
836 in_ctx->add_flags |= added_ctxs; 874 ctrl_ctx->add_flags |= added_ctxs;
837 new_add_flags = in_ctx->add_flags; 875 new_add_flags = ctrl_ctx->add_flags;
838 876
839 /* If xhci_endpoint_disable() was called for this endpoint, but the 877 /* If xhci_endpoint_disable() was called for this endpoint, but the
840 * xHC hasn't been notified yet through the check_bandwidth() call, 878 * xHC hasn't been notified yet through the check_bandwidth() call,
@@ -842,14 +880,18 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
842 * descriptors. We must drop and re-add this endpoint, so we leave the 880 * descriptors. We must drop and re-add this endpoint, so we leave the
843 * drop flags alone. 881 * drop flags alone.
844 */ 882 */
845 new_drop_flags = in_ctx->drop_flags; 883 new_drop_flags = ctrl_ctx->drop_flags;
846 884
885 slot_ctx = xhci_get_slot_ctx(xhci, in_ctx);
847 /* Update the last valid endpoint context, if we just added one past */ 886 /* Update the last valid endpoint context, if we just added one past */
848 if ((in_ctx->slot.dev_info & LAST_CTX_MASK) < LAST_CTX(last_ctx)) { 887 if ((slot_ctx->dev_info & LAST_CTX_MASK) < LAST_CTX(last_ctx)) {
849 in_ctx->slot.dev_info &= ~LAST_CTX_MASK; 888 slot_ctx->dev_info &= ~LAST_CTX_MASK;
850 in_ctx->slot.dev_info |= LAST_CTX(last_ctx); 889 slot_ctx->dev_info |= LAST_CTX(last_ctx);
851 } 890 }
852 new_slot_info = in_ctx->slot.dev_info; 891 new_slot_info = slot_ctx->dev_info;
892
893 /* Store the usb_device pointer for later use */
894 ep->hcpriv = udev;
853 895
854 xhci_dbg(xhci, "add ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x, new slot info = %#x\n", 896 xhci_dbg(xhci, "add ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x, new slot info = %#x\n",
855 (unsigned int) ep->desc.bEndpointAddress, 897 (unsigned int) ep->desc.bEndpointAddress,
@@ -860,9 +902,11 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
860 return 0; 902 return 0;
861} 903}
862 904
863static void xhci_zero_in_ctx(struct xhci_virt_device *virt_dev) 905static void xhci_zero_in_ctx(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev)
864{ 906{
907 struct xhci_input_control_ctx *ctrl_ctx;
865 struct xhci_ep_ctx *ep_ctx; 908 struct xhci_ep_ctx *ep_ctx;
909 struct xhci_slot_ctx *slot_ctx;
866 int i; 910 int i;
867 911
868 /* When a device's add flag and drop flag are zero, any subsequent 912 /* When a device's add flag and drop flag are zero, any subsequent
@@ -870,17 +914,18 @@ static void xhci_zero_in_ctx(struct xhci_virt_device *virt_dev)
870 * untouched. Make sure we don't leave any old state in the input 914 * untouched. Make sure we don't leave any old state in the input
871 * endpoint contexts. 915 * endpoint contexts.
872 */ 916 */
873 virt_dev->in_ctx->drop_flags = 0; 917 ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
874 virt_dev->in_ctx->add_flags = 0; 918 ctrl_ctx->drop_flags = 0;
875 virt_dev->in_ctx->slot.dev_info &= ~LAST_CTX_MASK; 919 ctrl_ctx->add_flags = 0;
920 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
921 slot_ctx->dev_info &= ~LAST_CTX_MASK;
876 /* Endpoint 0 is always valid */ 922 /* Endpoint 0 is always valid */
877 virt_dev->in_ctx->slot.dev_info |= LAST_CTX(1); 923 slot_ctx->dev_info |= LAST_CTX(1);
878 for (i = 1; i < 31; ++i) { 924 for (i = 1; i < 31; ++i) {
879 ep_ctx = &virt_dev->in_ctx->ep[i]; 925 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, i);
880 ep_ctx->ep_info = 0; 926 ep_ctx->ep_info = 0;
881 ep_ctx->ep_info2 = 0; 927 ep_ctx->ep_info2 = 0;
882 ep_ctx->deq[0] = 0; 928 ep_ctx->deq = 0;
883 ep_ctx->deq[1] = 0;
884 ep_ctx->tx_info = 0; 929 ep_ctx->tx_info = 0;
885 } 930 }
886} 931}
@@ -903,6 +948,8 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
903 unsigned long flags; 948 unsigned long flags;
904 struct xhci_hcd *xhci; 949 struct xhci_hcd *xhci;
905 struct xhci_virt_device *virt_dev; 950 struct xhci_virt_device *virt_dev;
951 struct xhci_input_control_ctx *ctrl_ctx;
952 struct xhci_slot_ctx *slot_ctx;
906 953
907 ret = xhci_check_args(hcd, udev, NULL, 0, __func__); 954 ret = xhci_check_args(hcd, udev, NULL, 0, __func__);
908 if (ret <= 0) 955 if (ret <= 0)
@@ -918,16 +965,18 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
918 virt_dev = xhci->devs[udev->slot_id]; 965 virt_dev = xhci->devs[udev->slot_id];
919 966
920 /* See section 4.6.6 - A0 = 1; A1 = D0 = D1 = 0 */ 967 /* See section 4.6.6 - A0 = 1; A1 = D0 = D1 = 0 */
921 virt_dev->in_ctx->add_flags |= SLOT_FLAG; 968 ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
922 virt_dev->in_ctx->add_flags &= ~EP0_FLAG; 969 ctrl_ctx->add_flags |= SLOT_FLAG;
923 virt_dev->in_ctx->drop_flags &= ~SLOT_FLAG; 970 ctrl_ctx->add_flags &= ~EP0_FLAG;
924 virt_dev->in_ctx->drop_flags &= ~EP0_FLAG; 971 ctrl_ctx->drop_flags &= ~SLOT_FLAG;
972 ctrl_ctx->drop_flags &= ~EP0_FLAG;
925 xhci_dbg(xhci, "New Input Control Context:\n"); 973 xhci_dbg(xhci, "New Input Control Context:\n");
926 xhci_dbg_ctx(xhci, virt_dev->in_ctx, virt_dev->in_ctx_dma, 974 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
927 LAST_CTX_TO_EP_NUM(virt_dev->in_ctx->slot.dev_info)); 975 xhci_dbg_ctx(xhci, virt_dev->in_ctx,
976 LAST_CTX_TO_EP_NUM(slot_ctx->dev_info));
928 977
929 spin_lock_irqsave(&xhci->lock, flags); 978 spin_lock_irqsave(&xhci->lock, flags);
930 ret = xhci_queue_configure_endpoint(xhci, virt_dev->in_ctx_dma, 979 ret = xhci_queue_configure_endpoint(xhci, virt_dev->in_ctx->dma,
931 udev->slot_id); 980 udev->slot_id);
932 if (ret < 0) { 981 if (ret < 0) {
933 spin_unlock_irqrestore(&xhci->lock, flags); 982 spin_unlock_irqrestore(&xhci->lock, flags);
@@ -982,10 +1031,10 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
982 } 1031 }
983 1032
984 xhci_dbg(xhci, "Output context after successful config ep cmd:\n"); 1033 xhci_dbg(xhci, "Output context after successful config ep cmd:\n");
985 xhci_dbg_ctx(xhci, virt_dev->out_ctx, virt_dev->out_ctx_dma, 1034 xhci_dbg_ctx(xhci, virt_dev->out_ctx,
986 LAST_CTX_TO_EP_NUM(virt_dev->in_ctx->slot.dev_info)); 1035 LAST_CTX_TO_EP_NUM(slot_ctx->dev_info));
987 1036
988 xhci_zero_in_ctx(virt_dev); 1037 xhci_zero_in_ctx(xhci, virt_dev);
989 /* Free any old rings */ 1038 /* Free any old rings */
990 for (i = 1; i < 31; ++i) { 1039 for (i = 1; i < 31; ++i) {
991 if (virt_dev->new_ep_rings[i]) { 1040 if (virt_dev->new_ep_rings[i]) {
@@ -1023,7 +1072,67 @@ void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
1023 virt_dev->new_ep_rings[i] = NULL; 1072 virt_dev->new_ep_rings[i] = NULL;
1024 } 1073 }
1025 } 1074 }
1026 xhci_zero_in_ctx(virt_dev); 1075 xhci_zero_in_ctx(xhci, virt_dev);
1076}
1077
1078/* Deal with stalled endpoints. The core should have sent the control message
1079 * to clear the halt condition. However, we need to make the xHCI hardware
1080 * reset its sequence number, since a device will expect a sequence number of
1081 * zero after the halt condition is cleared.
1082 * Context: in_interrupt
1083 */
1084void xhci_endpoint_reset(struct usb_hcd *hcd,
1085 struct usb_host_endpoint *ep)
1086{
1087 struct xhci_hcd *xhci;
1088 struct usb_device *udev;
1089 unsigned int ep_index;
1090 unsigned long flags;
1091 int ret;
1092 struct xhci_dequeue_state deq_state;
1093 struct xhci_ring *ep_ring;
1094
1095 xhci = hcd_to_xhci(hcd);
1096 udev = (struct usb_device *) ep->hcpriv;
1097 /* Called with a root hub endpoint (or an endpoint that wasn't added
1098 * with xhci_add_endpoint()
1099 */
1100 if (!ep->hcpriv)
1101 return;
1102 ep_index = xhci_get_endpoint_index(&ep->desc);
1103 ep_ring = xhci->devs[udev->slot_id]->ep_rings[ep_index];
1104 if (!ep_ring->stopped_td) {
1105 xhci_dbg(xhci, "Endpoint 0x%x not halted, refusing to reset.\n",
1106 ep->desc.bEndpointAddress);
1107 return;
1108 }
1109
1110 xhci_dbg(xhci, "Queueing reset endpoint command\n");
1111 spin_lock_irqsave(&xhci->lock, flags);
1112 ret = xhci_queue_reset_ep(xhci, udev->slot_id, ep_index);
1113 /*
1114 * Can't change the ring dequeue pointer until it's transitioned to the
1115 * stopped state, which is only upon a successful reset endpoint
1116 * command. Better hope that last command worked!
1117 */
1118 if (!ret) {
1119 xhci_dbg(xhci, "Cleaning up stalled endpoint ring\n");
1120 /* We need to move the HW's dequeue pointer past this TD,
1121 * or it will attempt to resend it on the next doorbell ring.
1122 */
1123 xhci_find_new_dequeue_state(xhci, udev->slot_id,
1124 ep_index, ep_ring->stopped_td, &deq_state);
1125 xhci_dbg(xhci, "Queueing new dequeue state\n");
1126 xhci_queue_new_dequeue_state(xhci, ep_ring,
1127 udev->slot_id,
1128 ep_index, &deq_state);
1129 kfree(ep_ring->stopped_td);
1130 xhci_ring_cmd_db(xhci);
1131 }
1132 spin_unlock_irqrestore(&xhci->lock, flags);
1133
1134 if (ret)
1135 xhci_warn(xhci, "FIXME allocate a new ring segment\n");
1027} 1136}
1028 1137
1029/* 1138/*
@@ -1120,7 +1229,9 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1120 struct xhci_virt_device *virt_dev; 1229 struct xhci_virt_device *virt_dev;
1121 int ret = 0; 1230 int ret = 0;
1122 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 1231 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1123 u32 temp; 1232 struct xhci_slot_ctx *slot_ctx;
1233 struct xhci_input_control_ctx *ctrl_ctx;
1234 u64 temp_64;
1124 1235
1125 if (!udev->slot_id) { 1236 if (!udev->slot_id) {
1126 xhci_dbg(xhci, "Bad Slot ID %d\n", udev->slot_id); 1237 xhci_dbg(xhci, "Bad Slot ID %d\n", udev->slot_id);
@@ -1133,10 +1244,12 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1133 if (!udev->config) 1244 if (!udev->config)
1134 xhci_setup_addressable_virt_dev(xhci, udev); 1245 xhci_setup_addressable_virt_dev(xhci, udev);
1135 /* Otherwise, assume the core has the device configured how it wants */ 1246 /* Otherwise, assume the core has the device configured how it wants */
1247 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1248 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
1136 1249
1137 spin_lock_irqsave(&xhci->lock, flags); 1250 spin_lock_irqsave(&xhci->lock, flags);
1138 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx_dma, 1251 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx->dma,
1139 udev->slot_id); 1252 udev->slot_id);
1140 if (ret) { 1253 if (ret) {
1141 spin_unlock_irqrestore(&xhci->lock, flags); 1254 spin_unlock_irqrestore(&xhci->lock, flags);
1142 xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); 1255 xhci_dbg(xhci, "FIXME: allocate a command ring segment\n");
@@ -1176,41 +1289,37 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1176 default: 1289 default:
1177 xhci_err(xhci, "ERROR: unexpected command completion " 1290 xhci_err(xhci, "ERROR: unexpected command completion "
1178 "code 0x%x.\n", virt_dev->cmd_status); 1291 "code 0x%x.\n", virt_dev->cmd_status);
1292 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
1293 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
1179 ret = -EINVAL; 1294 ret = -EINVAL;
1180 break; 1295 break;
1181 } 1296 }
1182 if (ret) { 1297 if (ret) {
1183 return ret; 1298 return ret;
1184 } 1299 }
1185 temp = xhci_readl(xhci, &xhci->op_regs->dcbaa_ptr[0]); 1300 temp_64 = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);
1186 xhci_dbg(xhci, "Op regs DCBAA ptr[0] = %#08x\n", temp); 1301 xhci_dbg(xhci, "Op regs DCBAA ptr = %#016llx\n", temp_64);
1187 temp = xhci_readl(xhci, &xhci->op_regs->dcbaa_ptr[1]); 1302 xhci_dbg(xhci, "Slot ID %d dcbaa entry @%p = %#016llx\n",
1188 xhci_dbg(xhci, "Op regs DCBAA ptr[1] = %#08x\n", temp);
1189 xhci_dbg(xhci, "Slot ID %d dcbaa entry[0] @%p = %#08x\n",
1190 udev->slot_id,
1191 &xhci->dcbaa->dev_context_ptrs[2*udev->slot_id],
1192 xhci->dcbaa->dev_context_ptrs[2*udev->slot_id]);
1193 xhci_dbg(xhci, "Slot ID %d dcbaa entry[1] @%p = %#08x\n",
1194 udev->slot_id, 1303 udev->slot_id,
1195 &xhci->dcbaa->dev_context_ptrs[2*udev->slot_id+1], 1304 &xhci->dcbaa->dev_context_ptrs[udev->slot_id],
1196 xhci->dcbaa->dev_context_ptrs[2*udev->slot_id+1]); 1305 (unsigned long long)
1306 xhci->dcbaa->dev_context_ptrs[udev->slot_id]);
1197 xhci_dbg(xhci, "Output Context DMA address = %#08llx\n", 1307 xhci_dbg(xhci, "Output Context DMA address = %#08llx\n",
1198 (unsigned long long)virt_dev->out_ctx_dma); 1308 (unsigned long long)virt_dev->out_ctx->dma);
1199 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); 1309 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1200 xhci_dbg_ctx(xhci, virt_dev->in_ctx, virt_dev->in_ctx_dma, 2); 1310 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
1201 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id); 1311 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);
1202 xhci_dbg_ctx(xhci, virt_dev->out_ctx, virt_dev->out_ctx_dma, 2); 1312 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);
1203 /* 1313 /*
1204 * USB core uses address 1 for the roothubs, so we add one to the 1314 * USB core uses address 1 for the roothubs, so we add one to the
1205 * address given back to us by the HC. 1315 * address given back to us by the HC.
1206 */ 1316 */
1207 udev->devnum = (virt_dev->out_ctx->slot.dev_state & DEV_ADDR_MASK) + 1; 1317 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);
1318 udev->devnum = (slot_ctx->dev_state & DEV_ADDR_MASK) + 1;
1208 /* Zero the input context control for later use */ 1319 /* Zero the input context control for later use */
1209 virt_dev->in_ctx->add_flags = 0; 1320 ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
1210 virt_dev->in_ctx->drop_flags = 0; 1321 ctrl_ctx->add_flags = 0;
1211 /* Mirror flags in the output context for future ep enable/disable */ 1322 ctrl_ctx->drop_flags = 0;
1212 virt_dev->out_ctx->add_flags = SLOT_FLAG | EP0_FLAG;
1213 virt_dev->out_ctx->drop_flags = 0;
1214 1323
1215 xhci_dbg(xhci, "Device address = %d\n", udev->devnum); 1324 xhci_dbg(xhci, "Device address = %d\n", udev->devnum);
1216 /* XXX Meh, not sure if anyone else but choose_address uses this. */ 1325 /* XXX Meh, not sure if anyone else but choose_address uses this. */
@@ -1252,7 +1361,6 @@ static int __init xhci_hcd_init(void)
1252 /* xhci_device_control has eight fields, and also 1361 /* xhci_device_control has eight fields, and also
1253 * embeds one xhci_slot_ctx and 31 xhci_ep_ctx 1362 * embeds one xhci_slot_ctx and 31 xhci_ep_ctx
1254 */ 1363 */
1255 BUILD_BUG_ON(sizeof(struct xhci_device_control) != (8+8+8*31)*32/8);
1256 BUILD_BUG_ON(sizeof(struct xhci_stream_ctx) != 4*32/8); 1364 BUILD_BUG_ON(sizeof(struct xhci_stream_ctx) != 4*32/8);
1257 BUILD_BUG_ON(sizeof(union xhci_trb) != 4*32/8); 1365 BUILD_BUG_ON(sizeof(union xhci_trb) != 4*32/8);
1258 BUILD_BUG_ON(sizeof(struct xhci_erst_entry) != 4*32/8); 1366 BUILD_BUG_ON(sizeof(struct xhci_erst_entry) != 4*32/8);
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index c8a72de1c508..e6b9a1c6002d 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -88,7 +88,7 @@ static void xhci_link_segments(struct xhci_hcd *xhci, struct xhci_segment *prev,
88 return; 88 return;
89 prev->next = next; 89 prev->next = next;
90 if (link_trbs) { 90 if (link_trbs) {
91 prev->trbs[TRBS_PER_SEGMENT-1].link.segment_ptr[0] = next->dma; 91 prev->trbs[TRBS_PER_SEGMENT-1].link.segment_ptr = next->dma;
92 92
93 /* Set the last TRB in the segment to have a TRB type ID of Link TRB */ 93 /* Set the last TRB in the segment to have a TRB type ID of Link TRB */
94 val = prev->trbs[TRBS_PER_SEGMENT-1].link.control; 94 val = prev->trbs[TRBS_PER_SEGMENT-1].link.control;
@@ -189,6 +189,63 @@ fail:
189 return 0; 189 return 0;
190} 190}
191 191
192#define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32)
193
194struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci,
195 int type, gfp_t flags)
196{
197 struct xhci_container_ctx *ctx = kzalloc(sizeof(*ctx), flags);
198 if (!ctx)
199 return NULL;
200
201 BUG_ON((type != XHCI_CTX_TYPE_DEVICE) && (type != XHCI_CTX_TYPE_INPUT));
202 ctx->type = type;
203 ctx->size = HCC_64BYTE_CONTEXT(xhci->hcc_params) ? 2048 : 1024;
204 if (type == XHCI_CTX_TYPE_INPUT)
205 ctx->size += CTX_SIZE(xhci->hcc_params);
206
207 ctx->bytes = dma_pool_alloc(xhci->device_pool, flags, &ctx->dma);
208 memset(ctx->bytes, 0, ctx->size);
209 return ctx;
210}
211
212void xhci_free_container_ctx(struct xhci_hcd *xhci,
213 struct xhci_container_ctx *ctx)
214{
215 dma_pool_free(xhci->device_pool, ctx->bytes, ctx->dma);
216 kfree(ctx);
217}
218
219struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci,
220 struct xhci_container_ctx *ctx)
221{
222 BUG_ON(ctx->type != XHCI_CTX_TYPE_INPUT);
223 return (struct xhci_input_control_ctx *)ctx->bytes;
224}
225
226struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci,
227 struct xhci_container_ctx *ctx)
228{
229 if (ctx->type == XHCI_CTX_TYPE_DEVICE)
230 return (struct xhci_slot_ctx *)ctx->bytes;
231
232 return (struct xhci_slot_ctx *)
233 (ctx->bytes + CTX_SIZE(xhci->hcc_params));
234}
235
236struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci,
237 struct xhci_container_ctx *ctx,
238 unsigned int ep_index)
239{
240 /* increment ep index by offset of start of ep ctx array */
241 ep_index++;
242 if (ctx->type == XHCI_CTX_TYPE_INPUT)
243 ep_index++;
244
245 return (struct xhci_ep_ctx *)
246 (ctx->bytes + (ep_index * CTX_SIZE(xhci->hcc_params)));
247}
248
192/* All the xhci_tds in the ring's TD list should be freed at this point */ 249/* All the xhci_tds in the ring's TD list should be freed at this point */
193void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) 250void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
194{ 251{
@@ -200,8 +257,7 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
200 return; 257 return;
201 258
202 dev = xhci->devs[slot_id]; 259 dev = xhci->devs[slot_id];
203 xhci->dcbaa->dev_context_ptrs[2*slot_id] = 0; 260 xhci->dcbaa->dev_context_ptrs[slot_id] = 0;
204 xhci->dcbaa->dev_context_ptrs[2*slot_id + 1] = 0;
205 if (!dev) 261 if (!dev)
206 return; 262 return;
207 263
@@ -210,11 +266,10 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
210 xhci_ring_free(xhci, dev->ep_rings[i]); 266 xhci_ring_free(xhci, dev->ep_rings[i]);
211 267
212 if (dev->in_ctx) 268 if (dev->in_ctx)
213 dma_pool_free(xhci->device_pool, 269 xhci_free_container_ctx(xhci, dev->in_ctx);
214 dev->in_ctx, dev->in_ctx_dma);
215 if (dev->out_ctx) 270 if (dev->out_ctx)
216 dma_pool_free(xhci->device_pool, 271 xhci_free_container_ctx(xhci, dev->out_ctx);
217 dev->out_ctx, dev->out_ctx_dma); 272
218 kfree(xhci->devs[slot_id]); 273 kfree(xhci->devs[slot_id]);
219 xhci->devs[slot_id] = 0; 274 xhci->devs[slot_id] = 0;
220} 275}
@@ -222,7 +277,6 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
222int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, 277int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
223 struct usb_device *udev, gfp_t flags) 278 struct usb_device *udev, gfp_t flags)
224{ 279{
225 dma_addr_t dma;
226 struct xhci_virt_device *dev; 280 struct xhci_virt_device *dev;
227 281
228 /* Slot ID 0 is reserved */ 282 /* Slot ID 0 is reserved */
@@ -236,23 +290,21 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
236 return 0; 290 return 0;
237 dev = xhci->devs[slot_id]; 291 dev = xhci->devs[slot_id];
238 292
239 /* Allocate the (output) device context that will be used in the HC */ 293 /* Allocate the (output) device context that will be used in the HC. */
240 dev->out_ctx = dma_pool_alloc(xhci->device_pool, flags, &dma); 294 dev->out_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_DEVICE, flags);
241 if (!dev->out_ctx) 295 if (!dev->out_ctx)
242 goto fail; 296 goto fail;
243 dev->out_ctx_dma = dma; 297
244 xhci_dbg(xhci, "Slot %d output ctx = 0x%llx (dma)\n", slot_id, 298 xhci_dbg(xhci, "Slot %d output ctx = 0x%llx (dma)\n", slot_id,
245 (unsigned long long)dma); 299 (unsigned long long)dev->out_ctx->dma);
246 memset(dev->out_ctx, 0, sizeof(*dev->out_ctx));
247 300
248 /* Allocate the (input) device context for address device command */ 301 /* Allocate the (input) device context for address device command */
249 dev->in_ctx = dma_pool_alloc(xhci->device_pool, flags, &dma); 302 dev->in_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_INPUT, flags);
250 if (!dev->in_ctx) 303 if (!dev->in_ctx)
251 goto fail; 304 goto fail;
252 dev->in_ctx_dma = dma; 305
253 xhci_dbg(xhci, "Slot %d input ctx = 0x%llx (dma)\n", slot_id, 306 xhci_dbg(xhci, "Slot %d input ctx = 0x%llx (dma)\n", slot_id,
254 (unsigned long long)dma); 307 (unsigned long long)dev->in_ctx->dma);
255 memset(dev->in_ctx, 0, sizeof(*dev->in_ctx));
256 308
257 /* Allocate endpoint 0 ring */ 309 /* Allocate endpoint 0 ring */
258 dev->ep_rings[0] = xhci_ring_alloc(xhci, 1, true, flags); 310 dev->ep_rings[0] = xhci_ring_alloc(xhci, 1, true, flags);
@@ -261,17 +313,12 @@ int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
261 313
262 init_completion(&dev->cmd_completion); 314 init_completion(&dev->cmd_completion);
263 315
264 /* 316 /* Point to output device context in dcbaa. */
265 * Point to output device context in dcbaa; skip the output control 317 xhci->dcbaa->dev_context_ptrs[slot_id] = dev->out_ctx->dma;
266 * context, which is eight 32 bit fields (or 32 bytes long)
267 */
268 xhci->dcbaa->dev_context_ptrs[2*slot_id] =
269 (u32) dev->out_ctx_dma + (32);
270 xhci_dbg(xhci, "Set slot id %d dcbaa entry %p to 0x%llx\n", 318 xhci_dbg(xhci, "Set slot id %d dcbaa entry %p to 0x%llx\n",
271 slot_id, 319 slot_id,
272 &xhci->dcbaa->dev_context_ptrs[2*slot_id], 320 &xhci->dcbaa->dev_context_ptrs[slot_id],
273 (unsigned long long)dev->out_ctx_dma); 321 (unsigned long long) xhci->dcbaa->dev_context_ptrs[slot_id]);
274 xhci->dcbaa->dev_context_ptrs[2*slot_id + 1] = 0;
275 322
276 return 1; 323 return 1;
277fail: 324fail:
@@ -285,6 +332,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
285 struct xhci_virt_device *dev; 332 struct xhci_virt_device *dev;
286 struct xhci_ep_ctx *ep0_ctx; 333 struct xhci_ep_ctx *ep0_ctx;
287 struct usb_device *top_dev; 334 struct usb_device *top_dev;
335 struct xhci_slot_ctx *slot_ctx;
336 struct xhci_input_control_ctx *ctrl_ctx;
288 337
289 dev = xhci->devs[udev->slot_id]; 338 dev = xhci->devs[udev->slot_id];
290 /* Slot ID 0 is reserved */ 339 /* Slot ID 0 is reserved */
@@ -293,27 +342,29 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
293 udev->slot_id); 342 udev->slot_id);
294 return -EINVAL; 343 return -EINVAL;
295 } 344 }
296 ep0_ctx = &dev->in_ctx->ep[0]; 345 ep0_ctx = xhci_get_ep_ctx(xhci, dev->in_ctx, 0);
346 ctrl_ctx = xhci_get_input_control_ctx(xhci, dev->in_ctx);
347 slot_ctx = xhci_get_slot_ctx(xhci, dev->in_ctx);
297 348
298 /* 2) New slot context and endpoint 0 context are valid*/ 349 /* 2) New slot context and endpoint 0 context are valid*/
299 dev->in_ctx->add_flags = SLOT_FLAG | EP0_FLAG; 350 ctrl_ctx->add_flags = SLOT_FLAG | EP0_FLAG;
300 351
301 /* 3) Only the control endpoint is valid - one endpoint context */ 352 /* 3) Only the control endpoint is valid - one endpoint context */
302 dev->in_ctx->slot.dev_info |= LAST_CTX(1); 353 slot_ctx->dev_info |= LAST_CTX(1);
303 354
304 switch (udev->speed) { 355 switch (udev->speed) {
305 case USB_SPEED_SUPER: 356 case USB_SPEED_SUPER:
306 dev->in_ctx->slot.dev_info |= (u32) udev->route; 357 slot_ctx->dev_info |= (u32) udev->route;
307 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_SS; 358 slot_ctx->dev_info |= (u32) SLOT_SPEED_SS;
308 break; 359 break;
309 case USB_SPEED_HIGH: 360 case USB_SPEED_HIGH:
310 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_HS; 361 slot_ctx->dev_info |= (u32) SLOT_SPEED_HS;
311 break; 362 break;
312 case USB_SPEED_FULL: 363 case USB_SPEED_FULL:
313 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_FS; 364 slot_ctx->dev_info |= (u32) SLOT_SPEED_FS;
314 break; 365 break;
315 case USB_SPEED_LOW: 366 case USB_SPEED_LOW:
316 dev->in_ctx->slot.dev_info |= (u32) SLOT_SPEED_LS; 367 slot_ctx->dev_info |= (u32) SLOT_SPEED_LS;
317 break; 368 break;
318 case USB_SPEED_VARIABLE: 369 case USB_SPEED_VARIABLE:
319 xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n"); 370 xhci_dbg(xhci, "FIXME xHCI doesn't support wireless speeds\n");
@@ -327,7 +378,7 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
327 for (top_dev = udev; top_dev->parent && top_dev->parent->parent; 378 for (top_dev = udev; top_dev->parent && top_dev->parent->parent;
328 top_dev = top_dev->parent) 379 top_dev = top_dev->parent)
329 /* Found device below root hub */; 380 /* Found device below root hub */;
330 dev->in_ctx->slot.dev_info2 |= (u32) ROOT_HUB_PORT(top_dev->portnum); 381 slot_ctx->dev_info2 |= (u32) ROOT_HUB_PORT(top_dev->portnum);
331 xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum); 382 xhci_dbg(xhci, "Set root hub portnum to %d\n", top_dev->portnum);
332 383
333 /* Is this a LS/FS device under a HS hub? */ 384 /* Is this a LS/FS device under a HS hub? */
@@ -337,8 +388,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
337 */ 388 */
338 if ((udev->speed == USB_SPEED_LOW || udev->speed == USB_SPEED_FULL) && 389 if ((udev->speed == USB_SPEED_LOW || udev->speed == USB_SPEED_FULL) &&
339 udev->tt) { 390 udev->tt) {
340 dev->in_ctx->slot.tt_info = udev->tt->hub->slot_id; 391 slot_ctx->tt_info = udev->tt->hub->slot_id;
341 dev->in_ctx->slot.tt_info |= udev->ttport << 8; 392 slot_ctx->tt_info |= udev->ttport << 8;
342 } 393 }
343 xhci_dbg(xhci, "udev->tt = %p\n", udev->tt); 394 xhci_dbg(xhci, "udev->tt = %p\n", udev->tt);
344 xhci_dbg(xhci, "udev->ttport = 0x%x\n", udev->ttport); 395 xhci_dbg(xhci, "udev->ttport = 0x%x\n", udev->ttport);
@@ -360,10 +411,9 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
360 ep0_ctx->ep_info2 |= MAX_BURST(0); 411 ep0_ctx->ep_info2 |= MAX_BURST(0);
361 ep0_ctx->ep_info2 |= ERROR_COUNT(3); 412 ep0_ctx->ep_info2 |= ERROR_COUNT(3);
362 413
363 ep0_ctx->deq[0] = 414 ep0_ctx->deq =
364 dev->ep_rings[0]->first_seg->dma; 415 dev->ep_rings[0]->first_seg->dma;
365 ep0_ctx->deq[0] |= dev->ep_rings[0]->cycle_state; 416 ep0_ctx->deq |= dev->ep_rings[0]->cycle_state;
366 ep0_ctx->deq[1] = 0;
367 417
368 /* Steps 7 and 8 were done in xhci_alloc_virt_device() */ 418 /* Steps 7 and 8 were done in xhci_alloc_virt_device() */
369 419
@@ -470,25 +520,26 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
470 unsigned int max_burst; 520 unsigned int max_burst;
471 521
472 ep_index = xhci_get_endpoint_index(&ep->desc); 522 ep_index = xhci_get_endpoint_index(&ep->desc);
473 ep_ctx = &virt_dev->in_ctx->ep[ep_index]; 523 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
474 524
475 /* Set up the endpoint ring */ 525 /* Set up the endpoint ring */
476 virt_dev->new_ep_rings[ep_index] = xhci_ring_alloc(xhci, 1, true, mem_flags); 526 virt_dev->new_ep_rings[ep_index] = xhci_ring_alloc(xhci, 1, true, mem_flags);
477 if (!virt_dev->new_ep_rings[ep_index]) 527 if (!virt_dev->new_ep_rings[ep_index])
478 return -ENOMEM; 528 return -ENOMEM;
479 ep_ring = virt_dev->new_ep_rings[ep_index]; 529 ep_ring = virt_dev->new_ep_rings[ep_index];
480 ep_ctx->deq[0] = ep_ring->first_seg->dma | ep_ring->cycle_state; 530 ep_ctx->deq = ep_ring->first_seg->dma | ep_ring->cycle_state;
481 ep_ctx->deq[1] = 0;
482 531
483 ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep); 532 ep_ctx->ep_info = xhci_get_endpoint_interval(udev, ep);
484 533
485 /* FIXME dig Mult and streams info out of ep companion desc */ 534 /* FIXME dig Mult and streams info out of ep companion desc */
486 535
487 /* Allow 3 retries for everything but isoc */ 536 /* Allow 3 retries for everything but isoc;
537 * error count = 0 means infinite retries.
538 */
488 if (!usb_endpoint_xfer_isoc(&ep->desc)) 539 if (!usb_endpoint_xfer_isoc(&ep->desc))
489 ep_ctx->ep_info2 = ERROR_COUNT(3); 540 ep_ctx->ep_info2 = ERROR_COUNT(3);
490 else 541 else
491 ep_ctx->ep_info2 = ERROR_COUNT(0); 542 ep_ctx->ep_info2 = ERROR_COUNT(1);
492 543
493 ep_ctx->ep_info2 |= xhci_get_endpoint_type(udev, ep); 544 ep_ctx->ep_info2 |= xhci_get_endpoint_type(udev, ep);
494 545
@@ -498,7 +549,12 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
498 max_packet = ep->desc.wMaxPacketSize; 549 max_packet = ep->desc.wMaxPacketSize;
499 ep_ctx->ep_info2 |= MAX_PACKET(max_packet); 550 ep_ctx->ep_info2 |= MAX_PACKET(max_packet);
500 /* dig out max burst from ep companion desc */ 551 /* dig out max burst from ep companion desc */
501 max_packet = ep->ss_ep_comp->desc.bMaxBurst; 552 if (!ep->ss_ep_comp) {
553 xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n");
554 max_packet = 0;
555 } else {
556 max_packet = ep->ss_ep_comp->desc.bMaxBurst;
557 }
502 ep_ctx->ep_info2 |= MAX_BURST(max_packet); 558 ep_ctx->ep_info2 |= MAX_BURST(max_packet);
503 break; 559 break;
504 case USB_SPEED_HIGH: 560 case USB_SPEED_HIGH:
@@ -531,18 +587,114 @@ void xhci_endpoint_zero(struct xhci_hcd *xhci,
531 struct xhci_ep_ctx *ep_ctx; 587 struct xhci_ep_ctx *ep_ctx;
532 588
533 ep_index = xhci_get_endpoint_index(&ep->desc); 589 ep_index = xhci_get_endpoint_index(&ep->desc);
534 ep_ctx = &virt_dev->in_ctx->ep[ep_index]; 590 ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
535 591
536 ep_ctx->ep_info = 0; 592 ep_ctx->ep_info = 0;
537 ep_ctx->ep_info2 = 0; 593 ep_ctx->ep_info2 = 0;
538 ep_ctx->deq[0] = 0; 594 ep_ctx->deq = 0;
539 ep_ctx->deq[1] = 0;
540 ep_ctx->tx_info = 0; 595 ep_ctx->tx_info = 0;
541 /* Don't free the endpoint ring until the set interface or configuration 596 /* Don't free the endpoint ring until the set interface or configuration
542 * request succeeds. 597 * request succeeds.
543 */ 598 */
544} 599}
545 600
601/* Set up the scratchpad buffer array and scratchpad buffers, if needed. */
602static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags)
603{
604 int i;
605 struct device *dev = xhci_to_hcd(xhci)->self.controller;
606 int num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
607
608 xhci_dbg(xhci, "Allocating %d scratchpad buffers\n", num_sp);
609
610 if (!num_sp)
611 return 0;
612
613 xhci->scratchpad = kzalloc(sizeof(*xhci->scratchpad), flags);
614 if (!xhci->scratchpad)
615 goto fail_sp;
616
617 xhci->scratchpad->sp_array =
618 pci_alloc_consistent(to_pci_dev(dev),
619 num_sp * sizeof(u64),
620 &xhci->scratchpad->sp_dma);
621 if (!xhci->scratchpad->sp_array)
622 goto fail_sp2;
623
624 xhci->scratchpad->sp_buffers = kzalloc(sizeof(void *) * num_sp, flags);
625 if (!xhci->scratchpad->sp_buffers)
626 goto fail_sp3;
627
628 xhci->scratchpad->sp_dma_buffers =
629 kzalloc(sizeof(dma_addr_t) * num_sp, flags);
630
631 if (!xhci->scratchpad->sp_dma_buffers)
632 goto fail_sp4;
633
634 xhci->dcbaa->dev_context_ptrs[0] = xhci->scratchpad->sp_dma;
635 for (i = 0; i < num_sp; i++) {
636 dma_addr_t dma;
637 void *buf = pci_alloc_consistent(to_pci_dev(dev),
638 xhci->page_size, &dma);
639 if (!buf)
640 goto fail_sp5;
641
642 xhci->scratchpad->sp_array[i] = dma;
643 xhci->scratchpad->sp_buffers[i] = buf;
644 xhci->scratchpad->sp_dma_buffers[i] = dma;
645 }
646
647 return 0;
648
649 fail_sp5:
650 for (i = i - 1; i >= 0; i--) {
651 pci_free_consistent(to_pci_dev(dev), xhci->page_size,
652 xhci->scratchpad->sp_buffers[i],
653 xhci->scratchpad->sp_dma_buffers[i]);
654 }
655 kfree(xhci->scratchpad->sp_dma_buffers);
656
657 fail_sp4:
658 kfree(xhci->scratchpad->sp_buffers);
659
660 fail_sp3:
661 pci_free_consistent(to_pci_dev(dev), num_sp * sizeof(u64),
662 xhci->scratchpad->sp_array,
663 xhci->scratchpad->sp_dma);
664
665 fail_sp2:
666 kfree(xhci->scratchpad);
667 xhci->scratchpad = NULL;
668
669 fail_sp:
670 return -ENOMEM;
671}
672
673static void scratchpad_free(struct xhci_hcd *xhci)
674{
675 int num_sp;
676 int i;
677 struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
678
679 if (!xhci->scratchpad)
680 return;
681
682 num_sp = HCS_MAX_SCRATCHPAD(xhci->hcs_params2);
683
684 for (i = 0; i < num_sp; i++) {
685 pci_free_consistent(pdev, xhci->page_size,
686 xhci->scratchpad->sp_buffers[i],
687 xhci->scratchpad->sp_dma_buffers[i]);
688 }
689 kfree(xhci->scratchpad->sp_dma_buffers);
690 kfree(xhci->scratchpad->sp_buffers);
691 pci_free_consistent(pdev, num_sp * sizeof(u64),
692 xhci->scratchpad->sp_array,
693 xhci->scratchpad->sp_dma);
694 kfree(xhci->scratchpad);
695 xhci->scratchpad = NULL;
696}
697
546void xhci_mem_cleanup(struct xhci_hcd *xhci) 698void xhci_mem_cleanup(struct xhci_hcd *xhci)
547{ 699{
548 struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller); 700 struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
@@ -551,10 +703,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
551 703
552 /* Free the Event Ring Segment Table and the actual Event Ring */ 704 /* Free the Event Ring Segment Table and the actual Event Ring */
553 xhci_writel(xhci, 0, &xhci->ir_set->erst_size); 705 xhci_writel(xhci, 0, &xhci->ir_set->erst_size);
554 xhci_writel(xhci, 0, &xhci->ir_set->erst_base[0]); 706 xhci_write_64(xhci, 0, &xhci->ir_set->erst_base);
555 xhci_writel(xhci, 0, &xhci->ir_set->erst_base[1]); 707 xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue);
556 xhci_writel(xhci, 0, &xhci->ir_set->erst_dequeue[0]);
557 xhci_writel(xhci, 0, &xhci->ir_set->erst_dequeue[1]);
558 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); 708 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
559 if (xhci->erst.entries) 709 if (xhci->erst.entries)
560 pci_free_consistent(pdev, size, 710 pci_free_consistent(pdev, size,
@@ -566,8 +716,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
566 xhci->event_ring = NULL; 716 xhci->event_ring = NULL;
567 xhci_dbg(xhci, "Freed event ring\n"); 717 xhci_dbg(xhci, "Freed event ring\n");
568 718
569 xhci_writel(xhci, 0, &xhci->op_regs->cmd_ring[0]); 719 xhci_write_64(xhci, 0, &xhci->op_regs->cmd_ring);
570 xhci_writel(xhci, 0, &xhci->op_regs->cmd_ring[1]);
571 if (xhci->cmd_ring) 720 if (xhci->cmd_ring)
572 xhci_ring_free(xhci, xhci->cmd_ring); 721 xhci_ring_free(xhci, xhci->cmd_ring);
573 xhci->cmd_ring = NULL; 722 xhci->cmd_ring = NULL;
@@ -586,8 +735,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
586 xhci->device_pool = NULL; 735 xhci->device_pool = NULL;
587 xhci_dbg(xhci, "Freed device context pool\n"); 736 xhci_dbg(xhci, "Freed device context pool\n");
588 737
589 xhci_writel(xhci, 0, &xhci->op_regs->dcbaa_ptr[0]); 738 xhci_write_64(xhci, 0, &xhci->op_regs->dcbaa_ptr);
590 xhci_writel(xhci, 0, &xhci->op_regs->dcbaa_ptr[1]);
591 if (xhci->dcbaa) 739 if (xhci->dcbaa)
592 pci_free_consistent(pdev, sizeof(*xhci->dcbaa), 740 pci_free_consistent(pdev, sizeof(*xhci->dcbaa),
593 xhci->dcbaa, xhci->dcbaa->dma); 741 xhci->dcbaa, xhci->dcbaa->dma);
@@ -595,6 +743,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
595 743
596 xhci->page_size = 0; 744 xhci->page_size = 0;
597 xhci->page_shift = 0; 745 xhci->page_shift = 0;
746 scratchpad_free(xhci);
598} 747}
599 748
600int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) 749int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
@@ -602,6 +751,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
602 dma_addr_t dma; 751 dma_addr_t dma;
603 struct device *dev = xhci_to_hcd(xhci)->self.controller; 752 struct device *dev = xhci_to_hcd(xhci)->self.controller;
604 unsigned int val, val2; 753 unsigned int val, val2;
754 u64 val_64;
605 struct xhci_segment *seg; 755 struct xhci_segment *seg;
606 u32 page_size; 756 u32 page_size;
607 int i; 757 int i;
@@ -647,8 +797,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
647 xhci->dcbaa->dma = dma; 797 xhci->dcbaa->dma = dma;
648 xhci_dbg(xhci, "// Device context base array address = 0x%llx (DMA), %p (virt)\n", 798 xhci_dbg(xhci, "// Device context base array address = 0x%llx (DMA), %p (virt)\n",
649 (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa); 799 (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa);
650 xhci_writel(xhci, dma, &xhci->op_regs->dcbaa_ptr[0]); 800 xhci_write_64(xhci, dma, &xhci->op_regs->dcbaa_ptr);
651 xhci_writel(xhci, (u32) 0, &xhci->op_regs->dcbaa_ptr[1]);
652 801
653 /* 802 /*
654 * Initialize the ring segment pool. The ring must be a contiguous 803 * Initialize the ring segment pool. The ring must be a contiguous
@@ -658,11 +807,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
658 */ 807 */
659 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, 808 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
660 SEGMENT_SIZE, 64, xhci->page_size); 809 SEGMENT_SIZE, 64, xhci->page_size);
810
661 /* See Table 46 and Note on Figure 55 */ 811 /* See Table 46 and Note on Figure 55 */
662 /* FIXME support 64-byte contexts */
663 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, 812 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev,
664 sizeof(struct xhci_device_control), 813 2112, 64, xhci->page_size);
665 64, xhci->page_size);
666 if (!xhci->segment_pool || !xhci->device_pool) 814 if (!xhci->segment_pool || !xhci->device_pool)
667 goto fail; 815 goto fail;
668 816
@@ -675,14 +823,12 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
675 (unsigned long long)xhci->cmd_ring->first_seg->dma); 823 (unsigned long long)xhci->cmd_ring->first_seg->dma);
676 824
677 /* Set the address in the Command Ring Control register */ 825 /* Set the address in the Command Ring Control register */
678 val = xhci_readl(xhci, &xhci->op_regs->cmd_ring[0]); 826 val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
679 val = (val & ~CMD_RING_ADDR_MASK) | 827 val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) |
680 (xhci->cmd_ring->first_seg->dma & CMD_RING_ADDR_MASK) | 828 (xhci->cmd_ring->first_seg->dma & (u64) ~CMD_RING_RSVD_BITS) |
681 xhci->cmd_ring->cycle_state; 829 xhci->cmd_ring->cycle_state;
682 xhci_dbg(xhci, "// Setting command ring address low bits to 0x%x\n", val); 830 xhci_dbg(xhci, "// Setting command ring address to 0x%x\n", val);
683 xhci_writel(xhci, val, &xhci->op_regs->cmd_ring[0]); 831 xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring);
684 xhci_dbg(xhci, "// Setting command ring address high bits to 0x0\n");
685 xhci_writel(xhci, (u32) 0, &xhci->op_regs->cmd_ring[1]);
686 xhci_dbg_cmd_ptrs(xhci); 832 xhci_dbg_cmd_ptrs(xhci);
687 833
688 val = xhci_readl(xhci, &xhci->cap_regs->db_off); 834 val = xhci_readl(xhci, &xhci->cap_regs->db_off);
@@ -722,8 +868,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
722 /* set ring base address and size for each segment table entry */ 868 /* set ring base address and size for each segment table entry */
723 for (val = 0, seg = xhci->event_ring->first_seg; val < ERST_NUM_SEGS; val++) { 869 for (val = 0, seg = xhci->event_ring->first_seg; val < ERST_NUM_SEGS; val++) {
724 struct xhci_erst_entry *entry = &xhci->erst.entries[val]; 870 struct xhci_erst_entry *entry = &xhci->erst.entries[val];
725 entry->seg_addr[0] = seg->dma; 871 entry->seg_addr = seg->dma;
726 entry->seg_addr[1] = 0;
727 entry->seg_size = TRBS_PER_SEGMENT; 872 entry->seg_size = TRBS_PER_SEGMENT;
728 entry->rsvd = 0; 873 entry->rsvd = 0;
729 seg = seg->next; 874 seg = seg->next;
@@ -741,11 +886,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
741 /* set the segment table base address */ 886 /* set the segment table base address */
742 xhci_dbg(xhci, "// Set ERST base address for ir_set 0 = 0x%llx\n", 887 xhci_dbg(xhci, "// Set ERST base address for ir_set 0 = 0x%llx\n",
743 (unsigned long long)xhci->erst.erst_dma_addr); 888 (unsigned long long)xhci->erst.erst_dma_addr);
744 val = xhci_readl(xhci, &xhci->ir_set->erst_base[0]); 889 val_64 = xhci_read_64(xhci, &xhci->ir_set->erst_base);
745 val &= ERST_PTR_MASK; 890 val_64 &= ERST_PTR_MASK;
746 val |= (xhci->erst.erst_dma_addr & ~ERST_PTR_MASK); 891 val_64 |= (xhci->erst.erst_dma_addr & (u64) ~ERST_PTR_MASK);
747 xhci_writel(xhci, val, &xhci->ir_set->erst_base[0]); 892 xhci_write_64(xhci, val_64, &xhci->ir_set->erst_base);
748 xhci_writel(xhci, 0, &xhci->ir_set->erst_base[1]);
749 893
750 /* Set the event ring dequeue address */ 894 /* Set the event ring dequeue address */
751 xhci_set_hc_event_deq(xhci); 895 xhci_set_hc_event_deq(xhci);
@@ -761,7 +905,11 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
761 for (i = 0; i < MAX_HC_SLOTS; ++i) 905 for (i = 0; i < MAX_HC_SLOTS; ++i)
762 xhci->devs[i] = 0; 906 xhci->devs[i] = 0;
763 907
908 if (scratchpad_alloc(xhci, flags))
909 goto fail;
910
764 return 0; 911 return 0;
912
765fail: 913fail:
766 xhci_warn(xhci, "Couldn't initialize memory\n"); 914 xhci_warn(xhci, "Couldn't initialize memory\n");
767 xhci_mem_cleanup(xhci); 915 xhci_mem_cleanup(xhci);
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 1462709e26c0..592fe7e623f7 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -117,6 +117,7 @@ static const struct hc_driver xhci_pci_hc_driver = {
117 .free_dev = xhci_free_dev, 117 .free_dev = xhci_free_dev,
118 .add_endpoint = xhci_add_endpoint, 118 .add_endpoint = xhci_add_endpoint,
119 .drop_endpoint = xhci_drop_endpoint, 119 .drop_endpoint = xhci_drop_endpoint,
120 .endpoint_reset = xhci_endpoint_reset,
120 .check_bandwidth = xhci_check_bandwidth, 121 .check_bandwidth = xhci_check_bandwidth,
121 .reset_bandwidth = xhci_reset_bandwidth, 122 .reset_bandwidth = xhci_reset_bandwidth,
122 .address_device = xhci_address_device, 123 .address_device = xhci_address_device,
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 02d81985c454..aa88a067148b 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -135,6 +135,7 @@ static void next_trb(struct xhci_hcd *xhci,
135static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer) 135static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer)
136{ 136{
137 union xhci_trb *next = ++(ring->dequeue); 137 union xhci_trb *next = ++(ring->dequeue);
138 unsigned long long addr;
138 139
139 ring->deq_updates++; 140 ring->deq_updates++;
140 /* Update the dequeue pointer further if that was a link TRB or we're at 141 /* Update the dequeue pointer further if that was a link TRB or we're at
@@ -152,6 +153,13 @@ static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
152 ring->dequeue = ring->deq_seg->trbs; 153 ring->dequeue = ring->deq_seg->trbs;
153 next = ring->dequeue; 154 next = ring->dequeue;
154 } 155 }
156 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue);
157 if (ring == xhci->event_ring)
158 xhci_dbg(xhci, "Event ring deq = 0x%llx (DMA)\n", addr);
159 else if (ring == xhci->cmd_ring)
160 xhci_dbg(xhci, "Command ring deq = 0x%llx (DMA)\n", addr);
161 else
162 xhci_dbg(xhci, "Ring deq = 0x%llx (DMA)\n", addr);
155} 163}
156 164
157/* 165/*
@@ -171,6 +179,7 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
171{ 179{
172 u32 chain; 180 u32 chain;
173 union xhci_trb *next; 181 union xhci_trb *next;
182 unsigned long long addr;
174 183
175 chain = ring->enqueue->generic.field[3] & TRB_CHAIN; 184 chain = ring->enqueue->generic.field[3] & TRB_CHAIN;
176 next = ++(ring->enqueue); 185 next = ++(ring->enqueue);
@@ -204,6 +213,13 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
204 ring->enqueue = ring->enq_seg->trbs; 213 ring->enqueue = ring->enq_seg->trbs;
205 next = ring->enqueue; 214 next = ring->enqueue;
206 } 215 }
216 addr = (unsigned long long) xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue);
217 if (ring == xhci->event_ring)
218 xhci_dbg(xhci, "Event ring enq = 0x%llx (DMA)\n", addr);
219 else if (ring == xhci->cmd_ring)
220 xhci_dbg(xhci, "Command ring enq = 0x%llx (DMA)\n", addr);
221 else
222 xhci_dbg(xhci, "Ring enq = 0x%llx (DMA)\n", addr);
207} 223}
208 224
209/* 225/*
@@ -237,7 +253,7 @@ static int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
237 253
238void xhci_set_hc_event_deq(struct xhci_hcd *xhci) 254void xhci_set_hc_event_deq(struct xhci_hcd *xhci)
239{ 255{
240 u32 temp; 256 u64 temp;
241 dma_addr_t deq; 257 dma_addr_t deq;
242 258
243 deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, 259 deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg,
@@ -246,13 +262,15 @@ void xhci_set_hc_event_deq(struct xhci_hcd *xhci)
246 xhci_warn(xhci, "WARN something wrong with SW event ring " 262 xhci_warn(xhci, "WARN something wrong with SW event ring "
247 "dequeue ptr.\n"); 263 "dequeue ptr.\n");
248 /* Update HC event ring dequeue pointer */ 264 /* Update HC event ring dequeue pointer */
249 temp = xhci_readl(xhci, &xhci->ir_set->erst_dequeue[0]); 265 temp = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);
250 temp &= ERST_PTR_MASK; 266 temp &= ERST_PTR_MASK;
251 if (!in_interrupt()) 267 /* Don't clear the EHB bit (which is RW1C) because
252 xhci_dbg(xhci, "// Write event ring dequeue pointer\n"); 268 * there might be more events to service.
253 xhci_writel(xhci, 0, &xhci->ir_set->erst_dequeue[1]); 269 */
254 xhci_writel(xhci, (deq & ~ERST_PTR_MASK) | temp, 270 temp &= ~ERST_EHB;
255 &xhci->ir_set->erst_dequeue[0]); 271 xhci_dbg(xhci, "// Write event ring dequeue pointer, preserving EHB bit\n");
272 xhci_write_64(xhci, ((u64) deq & (u64) ~ERST_PTR_MASK) | temp,
273 &xhci->ir_set->erst_dequeue);
256} 274}
257 275
258/* Ring the host controller doorbell after placing a command on the ring */ 276/* Ring the host controller doorbell after placing a command on the ring */
@@ -279,7 +297,8 @@ static void ring_ep_doorbell(struct xhci_hcd *xhci,
279 /* Don't ring the doorbell for this endpoint if there are pending 297 /* Don't ring the doorbell for this endpoint if there are pending
280 * cancellations because the we don't want to interrupt processing. 298 * cancellations because the we don't want to interrupt processing.
281 */ 299 */
282 if (!ep_ring->cancels_pending && !(ep_ring->state & SET_DEQ_PENDING)) { 300 if (!ep_ring->cancels_pending && !(ep_ring->state & SET_DEQ_PENDING)
301 && !(ep_ring->state & EP_HALTED)) {
283 field = xhci_readl(xhci, db_addr) & DB_MASK; 302 field = xhci_readl(xhci, db_addr) & DB_MASK;
284 xhci_writel(xhci, field | EPI_TO_DB(ep_index), db_addr); 303 xhci_writel(xhci, field | EPI_TO_DB(ep_index), db_addr);
285 /* Flush PCI posted writes - FIXME Matthew Wilcox says this 304 /* Flush PCI posted writes - FIXME Matthew Wilcox says this
@@ -316,12 +335,6 @@ static struct xhci_segment *find_trb_seg(
316 return cur_seg; 335 return cur_seg;
317} 336}
318 337
319struct dequeue_state {
320 struct xhci_segment *new_deq_seg;
321 union xhci_trb *new_deq_ptr;
322 int new_cycle_state;
323};
324
325/* 338/*
326 * Move the xHC's endpoint ring dequeue pointer past cur_td. 339 * Move the xHC's endpoint ring dequeue pointer past cur_td.
327 * Record the new state of the xHC's endpoint ring dequeue segment, 340 * Record the new state of the xHC's endpoint ring dequeue segment,
@@ -336,24 +349,30 @@ struct dequeue_state {
336 * - Finally we move the dequeue state one TRB further, toggling the cycle bit 349 * - Finally we move the dequeue state one TRB further, toggling the cycle bit
337 * if we've moved it past a link TRB with the toggle cycle bit set. 350 * if we've moved it past a link TRB with the toggle cycle bit set.
338 */ 351 */
339static void find_new_dequeue_state(struct xhci_hcd *xhci, 352void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
340 unsigned int slot_id, unsigned int ep_index, 353 unsigned int slot_id, unsigned int ep_index,
341 struct xhci_td *cur_td, struct dequeue_state *state) 354 struct xhci_td *cur_td, struct xhci_dequeue_state *state)
342{ 355{
343 struct xhci_virt_device *dev = xhci->devs[slot_id]; 356 struct xhci_virt_device *dev = xhci->devs[slot_id];
344 struct xhci_ring *ep_ring = dev->ep_rings[ep_index]; 357 struct xhci_ring *ep_ring = dev->ep_rings[ep_index];
345 struct xhci_generic_trb *trb; 358 struct xhci_generic_trb *trb;
359 struct xhci_ep_ctx *ep_ctx;
360 dma_addr_t addr;
346 361
347 state->new_cycle_state = 0; 362 state->new_cycle_state = 0;
363 xhci_dbg(xhci, "Finding segment containing stopped TRB.\n");
348 state->new_deq_seg = find_trb_seg(cur_td->start_seg, 364 state->new_deq_seg = find_trb_seg(cur_td->start_seg,
349 ep_ring->stopped_trb, 365 ep_ring->stopped_trb,
350 &state->new_cycle_state); 366 &state->new_cycle_state);
351 if (!state->new_deq_seg) 367 if (!state->new_deq_seg)
352 BUG(); 368 BUG();
353 /* Dig out the cycle state saved by the xHC during the stop ep cmd */ 369 /* Dig out the cycle state saved by the xHC during the stop ep cmd */
354 state->new_cycle_state = 0x1 & dev->out_ctx->ep[ep_index].deq[0]; 370 xhci_dbg(xhci, "Finding endpoint context\n");
371 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
372 state->new_cycle_state = 0x1 & ep_ctx->deq;
355 373
356 state->new_deq_ptr = cur_td->last_trb; 374 state->new_deq_ptr = cur_td->last_trb;
375 xhci_dbg(xhci, "Finding segment containing last TRB in TD.\n");
357 state->new_deq_seg = find_trb_seg(state->new_deq_seg, 376 state->new_deq_seg = find_trb_seg(state->new_deq_seg,
358 state->new_deq_ptr, 377 state->new_deq_ptr,
359 &state->new_cycle_state); 378 &state->new_cycle_state);
@@ -367,6 +386,12 @@ static void find_new_dequeue_state(struct xhci_hcd *xhci,
367 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); 386 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
368 387
369 /* Don't update the ring cycle state for the producer (us). */ 388 /* Don't update the ring cycle state for the producer (us). */
389 xhci_dbg(xhci, "New dequeue segment = %p (virtual)\n",
390 state->new_deq_seg);
391 addr = xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr);
392 xhci_dbg(xhci, "New dequeue pointer = 0x%llx (DMA)\n",
393 (unsigned long long) addr);
394 xhci_dbg(xhci, "Setting dequeue pointer in internal ring state.\n");
370 ep_ring->dequeue = state->new_deq_ptr; 395 ep_ring->dequeue = state->new_deq_ptr;
371 ep_ring->deq_seg = state->new_deq_seg; 396 ep_ring->deq_seg = state->new_deq_seg;
372} 397}
@@ -416,6 +441,30 @@ static int queue_set_tr_deq(struct xhci_hcd *xhci, int slot_id,
416 unsigned int ep_index, struct xhci_segment *deq_seg, 441 unsigned int ep_index, struct xhci_segment *deq_seg,
417 union xhci_trb *deq_ptr, u32 cycle_state); 442 union xhci_trb *deq_ptr, u32 cycle_state);
418 443
444void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
445 struct xhci_ring *ep_ring, unsigned int slot_id,
446 unsigned int ep_index, struct xhci_dequeue_state *deq_state)
447{
448 xhci_dbg(xhci, "Set TR Deq Ptr cmd, new deq seg = %p (0x%llx dma), "
449 "new deq ptr = %p (0x%llx dma), new cycle = %u\n",
450 deq_state->new_deq_seg,
451 (unsigned long long)deq_state->new_deq_seg->dma,
452 deq_state->new_deq_ptr,
453 (unsigned long long)xhci_trb_virt_to_dma(deq_state->new_deq_seg, deq_state->new_deq_ptr),
454 deq_state->new_cycle_state);
455 queue_set_tr_deq(xhci, slot_id, ep_index,
456 deq_state->new_deq_seg,
457 deq_state->new_deq_ptr,
458 (u32) deq_state->new_cycle_state);
459 /* Stop the TD queueing code from ringing the doorbell until
460 * this command completes. The HC won't set the dequeue pointer
461 * if the ring is running, and ringing the doorbell starts the
462 * ring running.
463 */
464 ep_ring->state |= SET_DEQ_PENDING;
465 xhci_ring_cmd_db(xhci);
466}
467
419/* 468/*
420 * When we get a command completion for a Stop Endpoint Command, we need to 469 * When we get a command completion for a Stop Endpoint Command, we need to
421 * unlink any cancelled TDs from the ring. There are two ways to do that: 470 * unlink any cancelled TDs from the ring. There are two ways to do that:
@@ -436,7 +485,7 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
436 struct xhci_td *cur_td = 0; 485 struct xhci_td *cur_td = 0;
437 struct xhci_td *last_unlinked_td; 486 struct xhci_td *last_unlinked_td;
438 487
439 struct dequeue_state deq_state; 488 struct xhci_dequeue_state deq_state;
440#ifdef CONFIG_USB_HCD_STAT 489#ifdef CONFIG_USB_HCD_STAT
441 ktime_t stop_time = ktime_get(); 490 ktime_t stop_time = ktime_get();
442#endif 491#endif
@@ -464,7 +513,7 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
464 * move the xHC endpoint ring dequeue pointer past this TD. 513 * move the xHC endpoint ring dequeue pointer past this TD.
465 */ 514 */
466 if (cur_td == ep_ring->stopped_td) 515 if (cur_td == ep_ring->stopped_td)
467 find_new_dequeue_state(xhci, slot_id, ep_index, cur_td, 516 xhci_find_new_dequeue_state(xhci, slot_id, ep_index, cur_td,
468 &deq_state); 517 &deq_state);
469 else 518 else
470 td_to_noop(xhci, ep_ring, cur_td); 519 td_to_noop(xhci, ep_ring, cur_td);
@@ -480,24 +529,8 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
480 529
481 /* If necessary, queue a Set Transfer Ring Dequeue Pointer command */ 530 /* If necessary, queue a Set Transfer Ring Dequeue Pointer command */
482 if (deq_state.new_deq_ptr && deq_state.new_deq_seg) { 531 if (deq_state.new_deq_ptr && deq_state.new_deq_seg) {
483 xhci_dbg(xhci, "Set TR Deq Ptr cmd, new deq seg = %p (0x%llx dma), " 532 xhci_queue_new_dequeue_state(xhci, ep_ring,
484 "new deq ptr = %p (0x%llx dma), new cycle = %u\n", 533 slot_id, ep_index, &deq_state);
485 deq_state.new_deq_seg,
486 (unsigned long long)deq_state.new_deq_seg->dma,
487 deq_state.new_deq_ptr,
488 (unsigned long long)xhci_trb_virt_to_dma(deq_state.new_deq_seg, deq_state.new_deq_ptr),
489 deq_state.new_cycle_state);
490 queue_set_tr_deq(xhci, slot_id, ep_index,
491 deq_state.new_deq_seg,
492 deq_state.new_deq_ptr,
493 (u32) deq_state.new_cycle_state);
494 /* Stop the TD queueing code from ringing the doorbell until
495 * this command completes. The HC won't set the dequeue pointer
496 * if the ring is running, and ringing the doorbell starts the
497 * ring running.
498 */
499 ep_ring->state |= SET_DEQ_PENDING;
500 xhci_ring_cmd_db(xhci);
501 } else { 534 } else {
502 /* Otherwise just ring the doorbell to restart the ring */ 535 /* Otherwise just ring the doorbell to restart the ring */
503 ring_ep_doorbell(xhci, slot_id, ep_index); 536 ring_ep_doorbell(xhci, slot_id, ep_index);
@@ -551,11 +584,15 @@ static void handle_set_deq_completion(struct xhci_hcd *xhci,
551 unsigned int ep_index; 584 unsigned int ep_index;
552 struct xhci_ring *ep_ring; 585 struct xhci_ring *ep_ring;
553 struct xhci_virt_device *dev; 586 struct xhci_virt_device *dev;
587 struct xhci_ep_ctx *ep_ctx;
588 struct xhci_slot_ctx *slot_ctx;
554 589
555 slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]); 590 slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]);
556 ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]); 591 ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]);
557 dev = xhci->devs[slot_id]; 592 dev = xhci->devs[slot_id];
558 ep_ring = dev->ep_rings[ep_index]; 593 ep_ring = dev->ep_rings[ep_index];
594 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
595 slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx);
559 596
560 if (GET_COMP_CODE(event->status) != COMP_SUCCESS) { 597 if (GET_COMP_CODE(event->status) != COMP_SUCCESS) {
561 unsigned int ep_state; 598 unsigned int ep_state;
@@ -569,9 +606,9 @@ static void handle_set_deq_completion(struct xhci_hcd *xhci,
569 case COMP_CTX_STATE: 606 case COMP_CTX_STATE:
570 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due " 607 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd failed due "
571 "to incorrect slot or ep state.\n"); 608 "to incorrect slot or ep state.\n");
572 ep_state = dev->out_ctx->ep[ep_index].ep_info; 609 ep_state = ep_ctx->ep_info;
573 ep_state &= EP_STATE_MASK; 610 ep_state &= EP_STATE_MASK;
574 slot_state = dev->out_ctx->slot.dev_state; 611 slot_state = slot_ctx->dev_state;
575 slot_state = GET_SLOT_STATE(slot_state); 612 slot_state = GET_SLOT_STATE(slot_state);
576 xhci_dbg(xhci, "Slot state = %u, EP state = %u\n", 613 xhci_dbg(xhci, "Slot state = %u, EP state = %u\n",
577 slot_state, ep_state); 614 slot_state, ep_state);
@@ -593,16 +630,33 @@ static void handle_set_deq_completion(struct xhci_hcd *xhci,
593 * cancelling URBs, which might not be an error... 630 * cancelling URBs, which might not be an error...
594 */ 631 */
595 } else { 632 } else {
596 xhci_dbg(xhci, "Successful Set TR Deq Ptr cmd, deq[0] = 0x%x, " 633 xhci_dbg(xhci, "Successful Set TR Deq Ptr cmd, deq = @%08llx\n",
597 "deq[1] = 0x%x.\n", 634 ep_ctx->deq);
598 dev->out_ctx->ep[ep_index].deq[0],
599 dev->out_ctx->ep[ep_index].deq[1]);
600 } 635 }
601 636
602 ep_ring->state &= ~SET_DEQ_PENDING; 637 ep_ring->state &= ~SET_DEQ_PENDING;
603 ring_ep_doorbell(xhci, slot_id, ep_index); 638 ring_ep_doorbell(xhci, slot_id, ep_index);
604} 639}
605 640
641static void handle_reset_ep_completion(struct xhci_hcd *xhci,
642 struct xhci_event_cmd *event,
643 union xhci_trb *trb)
644{
645 int slot_id;
646 unsigned int ep_index;
647
648 slot_id = TRB_TO_SLOT_ID(trb->generic.field[3]);
649 ep_index = TRB_TO_EP_INDEX(trb->generic.field[3]);
650 /* This command will only fail if the endpoint wasn't halted,
651 * but we don't care.
652 */
653 xhci_dbg(xhci, "Ignoring reset ep completion code of %u\n",
654 (unsigned int) GET_COMP_CODE(event->status));
655
656 /* Clear our internal halted state and restart the ring */
657 xhci->devs[slot_id]->ep_rings[ep_index]->state &= ~EP_HALTED;
658 ring_ep_doorbell(xhci, slot_id, ep_index);
659}
606 660
607static void handle_cmd_completion(struct xhci_hcd *xhci, 661static void handle_cmd_completion(struct xhci_hcd *xhci,
608 struct xhci_event_cmd *event) 662 struct xhci_event_cmd *event)
@@ -611,7 +665,7 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
611 u64 cmd_dma; 665 u64 cmd_dma;
612 dma_addr_t cmd_dequeue_dma; 666 dma_addr_t cmd_dequeue_dma;
613 667
614 cmd_dma = (((u64) event->cmd_trb[1]) << 32) + event->cmd_trb[0]; 668 cmd_dma = event->cmd_trb;
615 cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, 669 cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg,
616 xhci->cmd_ring->dequeue); 670 xhci->cmd_ring->dequeue);
617 /* Is the command ring deq ptr out of sync with the deq seg ptr? */ 671 /* Is the command ring deq ptr out of sync with the deq seg ptr? */
@@ -653,6 +707,9 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
653 case TRB_TYPE(TRB_CMD_NOOP): 707 case TRB_TYPE(TRB_CMD_NOOP):
654 ++xhci->noops_handled; 708 ++xhci->noops_handled;
655 break; 709 break;
710 case TRB_TYPE(TRB_RESET_EP):
711 handle_reset_ep_completion(xhci, event, xhci->cmd_ring->dequeue);
712 break;
656 default: 713 default:
657 /* Skip over unknown commands on the event ring */ 714 /* Skip over unknown commands on the event ring */
658 xhci->error_bitmask |= 1 << 6; 715 xhci->error_bitmask |= 1 << 6;
@@ -756,7 +813,9 @@ static int handle_tx_event(struct xhci_hcd *xhci,
756 union xhci_trb *event_trb; 813 union xhci_trb *event_trb;
757 struct urb *urb = 0; 814 struct urb *urb = 0;
758 int status = -EINPROGRESS; 815 int status = -EINPROGRESS;
816 struct xhci_ep_ctx *ep_ctx;
759 817
818 xhci_dbg(xhci, "In %s\n", __func__);
760 xdev = xhci->devs[TRB_TO_SLOT_ID(event->flags)]; 819 xdev = xhci->devs[TRB_TO_SLOT_ID(event->flags)];
761 if (!xdev) { 820 if (!xdev) {
762 xhci_err(xhci, "ERROR Transfer event pointed to bad slot\n"); 821 xhci_err(xhci, "ERROR Transfer event pointed to bad slot\n");
@@ -765,17 +824,17 @@ static int handle_tx_event(struct xhci_hcd *xhci,
765 824
766 /* Endpoint ID is 1 based, our index is zero based */ 825 /* Endpoint ID is 1 based, our index is zero based */
767 ep_index = TRB_TO_EP_ID(event->flags) - 1; 826 ep_index = TRB_TO_EP_ID(event->flags) - 1;
827 xhci_dbg(xhci, "%s - ep index = %d\n", __func__, ep_index);
768 ep_ring = xdev->ep_rings[ep_index]; 828 ep_ring = xdev->ep_rings[ep_index];
769 if (!ep_ring || (xdev->out_ctx->ep[ep_index].ep_info & EP_STATE_MASK) == EP_STATE_DISABLED) { 829 ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index);
830 if (!ep_ring || (ep_ctx->ep_info & EP_STATE_MASK) == EP_STATE_DISABLED) {
770 xhci_err(xhci, "ERROR Transfer event pointed to disabled endpoint\n"); 831 xhci_err(xhci, "ERROR Transfer event pointed to disabled endpoint\n");
771 return -ENODEV; 832 return -ENODEV;
772 } 833 }
773 834
774 event_dma = event->buffer[0]; 835 event_dma = event->buffer;
775 if (event->buffer[1] != 0)
776 xhci_warn(xhci, "WARN ignoring upper 32-bits of 64-bit TRB dma address\n");
777
778 /* This TRB should be in the TD at the head of this ring's TD list */ 836 /* This TRB should be in the TD at the head of this ring's TD list */
837 xhci_dbg(xhci, "%s - checking for list empty\n", __func__);
779 if (list_empty(&ep_ring->td_list)) { 838 if (list_empty(&ep_ring->td_list)) {
780 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", 839 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n",
781 TRB_TO_SLOT_ID(event->flags), ep_index); 840 TRB_TO_SLOT_ID(event->flags), ep_index);
@@ -785,11 +844,14 @@ static int handle_tx_event(struct xhci_hcd *xhci,
785 urb = NULL; 844 urb = NULL;
786 goto cleanup; 845 goto cleanup;
787 } 846 }
847 xhci_dbg(xhci, "%s - getting list entry\n", __func__);
788 td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list); 848 td = list_entry(ep_ring->td_list.next, struct xhci_td, td_list);
789 849
790 /* Is this a TRB in the currently executing TD? */ 850 /* Is this a TRB in the currently executing TD? */
851 xhci_dbg(xhci, "%s - looking for TD\n", __func__);
791 event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue, 852 event_seg = trb_in_td(ep_ring->deq_seg, ep_ring->dequeue,
792 td->last_trb, event_dma); 853 td->last_trb, event_dma);
854 xhci_dbg(xhci, "%s - found event_seg = %p\n", __func__, event_seg);
793 if (!event_seg) { 855 if (!event_seg) {
794 /* HC is busted, give up! */ 856 /* HC is busted, give up! */
795 xhci_err(xhci, "ERROR Transfer event TRB DMA ptr not part of current TD\n"); 857 xhci_err(xhci, "ERROR Transfer event TRB DMA ptr not part of current TD\n");
@@ -798,10 +860,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
798 event_trb = &event_seg->trbs[(event_dma - event_seg->dma) / sizeof(*event_trb)]; 860 event_trb = &event_seg->trbs[(event_dma - event_seg->dma) / sizeof(*event_trb)];
799 xhci_dbg(xhci, "Event TRB with TRB type ID %u\n", 861 xhci_dbg(xhci, "Event TRB with TRB type ID %u\n",
800 (unsigned int) (event->flags & TRB_TYPE_BITMASK)>>10); 862 (unsigned int) (event->flags & TRB_TYPE_BITMASK)>>10);
801 xhci_dbg(xhci, "Offset 0x00 (buffer[0]) = 0x%x\n", 863 xhci_dbg(xhci, "Offset 0x00 (buffer lo) = 0x%x\n",
802 (unsigned int) event->buffer[0]); 864 lower_32_bits(event->buffer));
803 xhci_dbg(xhci, "Offset 0x04 (buffer[0]) = 0x%x\n", 865 xhci_dbg(xhci, "Offset 0x04 (buffer hi) = 0x%x\n",
804 (unsigned int) event->buffer[1]); 866 upper_32_bits(event->buffer));
805 xhci_dbg(xhci, "Offset 0x08 (transfer length) = 0x%x\n", 867 xhci_dbg(xhci, "Offset 0x08 (transfer length) = 0x%x\n",
806 (unsigned int) event->transfer_len); 868 (unsigned int) event->transfer_len);
807 xhci_dbg(xhci, "Offset 0x0C (flags) = 0x%x\n", 869 xhci_dbg(xhci, "Offset 0x0C (flags) = 0x%x\n",
@@ -823,6 +885,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
823 break; 885 break;
824 case COMP_STALL: 886 case COMP_STALL:
825 xhci_warn(xhci, "WARN: Stalled endpoint\n"); 887 xhci_warn(xhci, "WARN: Stalled endpoint\n");
888 ep_ring->state |= EP_HALTED;
826 status = -EPIPE; 889 status = -EPIPE;
827 break; 890 break;
828 case COMP_TRB_ERR: 891 case COMP_TRB_ERR:
@@ -833,6 +896,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
833 xhci_warn(xhci, "WARN: transfer error on endpoint\n"); 896 xhci_warn(xhci, "WARN: transfer error on endpoint\n");
834 status = -EPROTO; 897 status = -EPROTO;
835 break; 898 break;
899 case COMP_BABBLE:
900 xhci_warn(xhci, "WARN: babble error on endpoint\n");
901 status = -EOVERFLOW;
902 break;
836 case COMP_DB_ERR: 903 case COMP_DB_ERR:
837 xhci_warn(xhci, "WARN: HC couldn't access mem fast enough\n"); 904 xhci_warn(xhci, "WARN: HC couldn't access mem fast enough\n");
838 status = -ENOSR; 905 status = -ENOSR;
@@ -874,15 +941,26 @@ static int handle_tx_event(struct xhci_hcd *xhci,
874 if (event_trb != ep_ring->dequeue) { 941 if (event_trb != ep_ring->dequeue) {
875 /* The event was for the status stage */ 942 /* The event was for the status stage */
876 if (event_trb == td->last_trb) { 943 if (event_trb == td->last_trb) {
877 td->urb->actual_length = 944 if (td->urb->actual_length != 0) {
878 td->urb->transfer_buffer_length; 945 /* Don't overwrite a previously set error code */
946 if (status == -EINPROGRESS || status == 0)
947 /* Did we already see a short data stage? */
948 status = -EREMOTEIO;
949 } else {
950 td->urb->actual_length =
951 td->urb->transfer_buffer_length;
952 }
879 } else { 953 } else {
880 /* Maybe the event was for the data stage? */ 954 /* Maybe the event was for the data stage? */
881 if (GET_COMP_CODE(event->transfer_len) != COMP_STOP_INVAL) 955 if (GET_COMP_CODE(event->transfer_len) != COMP_STOP_INVAL) {
882 /* We didn't stop on a link TRB in the middle */ 956 /* We didn't stop on a link TRB in the middle */
883 td->urb->actual_length = 957 td->urb->actual_length =
884 td->urb->transfer_buffer_length - 958 td->urb->transfer_buffer_length -
885 TRB_LEN(event->transfer_len); 959 TRB_LEN(event->transfer_len);
960 xhci_dbg(xhci, "Waiting for status stage event\n");
961 urb = NULL;
962 goto cleanup;
963 }
886 } 964 }
887 } 965 }
888 } else { 966 } else {
@@ -929,16 +1007,20 @@ static int handle_tx_event(struct xhci_hcd *xhci,
929 TRB_LEN(event->transfer_len)); 1007 TRB_LEN(event->transfer_len));
930 td->urb->actual_length = 0; 1008 td->urb->actual_length = 0;
931 } 1009 }
932 if (td->urb->transfer_flags & URB_SHORT_NOT_OK) 1010 /* Don't overwrite a previously set error code */
933 status = -EREMOTEIO; 1011 if (status == -EINPROGRESS) {
934 else 1012 if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
935 status = 0; 1013 status = -EREMOTEIO;
1014 else
1015 status = 0;
1016 }
936 } else { 1017 } else {
937 td->urb->actual_length = td->urb->transfer_buffer_length; 1018 td->urb->actual_length = td->urb->transfer_buffer_length;
938 /* Ignore a short packet completion if the 1019 /* Ignore a short packet completion if the
939 * untransferred length was zero. 1020 * untransferred length was zero.
940 */ 1021 */
941 status = 0; 1022 if (status == -EREMOTEIO)
1023 status = 0;
942 } 1024 }
943 } else { 1025 } else {
944 /* Slow path - walk the list, starting from the dequeue 1026 /* Slow path - walk the list, starting from the dequeue
@@ -965,19 +1047,30 @@ static int handle_tx_event(struct xhci_hcd *xhci,
965 TRB_LEN(event->transfer_len); 1047 TRB_LEN(event->transfer_len);
966 } 1048 }
967 } 1049 }
968 /* The Endpoint Stop Command completion will take care of
969 * any stopped TDs. A stopped TD may be restarted, so don't update the
970 * ring dequeue pointer or take this TD off any lists yet.
971 */
972 if (GET_COMP_CODE(event->transfer_len) == COMP_STOP_INVAL || 1050 if (GET_COMP_CODE(event->transfer_len) == COMP_STOP_INVAL ||
973 GET_COMP_CODE(event->transfer_len) == COMP_STOP) { 1051 GET_COMP_CODE(event->transfer_len) == COMP_STOP) {
1052 /* The Endpoint Stop Command completion will take care of any
1053 * stopped TDs. A stopped TD may be restarted, so don't update
1054 * the ring dequeue pointer or take this TD off any lists yet.
1055 */
974 ep_ring->stopped_td = td; 1056 ep_ring->stopped_td = td;
975 ep_ring->stopped_trb = event_trb; 1057 ep_ring->stopped_trb = event_trb;
976 } else { 1058 } else {
977 /* Update ring dequeue pointer */ 1059 if (GET_COMP_CODE(event->transfer_len) == COMP_STALL) {
978 while (ep_ring->dequeue != td->last_trb) 1060 /* The transfer is completed from the driver's
1061 * perspective, but we need to issue a set dequeue
1062 * command for this stalled endpoint to move the dequeue
1063 * pointer past the TD. We can't do that here because
1064 * the halt condition must be cleared first.
1065 */
1066 ep_ring->stopped_td = td;
1067 ep_ring->stopped_trb = event_trb;
1068 } else {
1069 /* Update ring dequeue pointer */
1070 while (ep_ring->dequeue != td->last_trb)
1071 inc_deq(xhci, ep_ring, false);
979 inc_deq(xhci, ep_ring, false); 1072 inc_deq(xhci, ep_ring, false);
980 inc_deq(xhci, ep_ring, false); 1073 }
981 1074
982 /* Clean up the endpoint's TD list */ 1075 /* Clean up the endpoint's TD list */
983 urb = td->urb; 1076 urb = td->urb;
@@ -987,7 +1080,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
987 list_del(&td->cancelled_td_list); 1080 list_del(&td->cancelled_td_list);
988 ep_ring->cancels_pending--; 1081 ep_ring->cancels_pending--;
989 } 1082 }
990 kfree(td); 1083 /* Leave the TD around for the reset endpoint function to use */
1084 if (GET_COMP_CODE(event->transfer_len) != COMP_STALL) {
1085 kfree(td);
1086 }
991 urb->hcpriv = NULL; 1087 urb->hcpriv = NULL;
992 } 1088 }
993cleanup: 1089cleanup:
@@ -997,6 +1093,8 @@ cleanup:
997 /* FIXME for multi-TD URBs (who have buffers bigger than 64MB) */ 1093 /* FIXME for multi-TD URBs (who have buffers bigger than 64MB) */
998 if (urb) { 1094 if (urb) {
999 usb_hcd_unlink_urb_from_ep(xhci_to_hcd(xhci), urb); 1095 usb_hcd_unlink_urb_from_ep(xhci_to_hcd(xhci), urb);
1096 xhci_dbg(xhci, "Giveback URB %p, len = %d, status = %d\n",
1097 urb, td->urb->actual_length, status);
1000 spin_unlock(&xhci->lock); 1098 spin_unlock(&xhci->lock);
1001 usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, status); 1099 usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, status);
1002 spin_lock(&xhci->lock); 1100 spin_lock(&xhci->lock);
@@ -1014,6 +1112,7 @@ void xhci_handle_event(struct xhci_hcd *xhci)
1014 int update_ptrs = 1; 1112 int update_ptrs = 1;
1015 int ret; 1113 int ret;
1016 1114
1115 xhci_dbg(xhci, "In %s\n", __func__);
1017 if (!xhci->event_ring || !xhci->event_ring->dequeue) { 1116 if (!xhci->event_ring || !xhci->event_ring->dequeue) {
1018 xhci->error_bitmask |= 1 << 1; 1117 xhci->error_bitmask |= 1 << 1;
1019 return; 1118 return;
@@ -1026,18 +1125,25 @@ void xhci_handle_event(struct xhci_hcd *xhci)
1026 xhci->error_bitmask |= 1 << 2; 1125 xhci->error_bitmask |= 1 << 2;
1027 return; 1126 return;
1028 } 1127 }
1128 xhci_dbg(xhci, "%s - OS owns TRB\n", __func__);
1029 1129
1030 /* FIXME: Handle more event types. */ 1130 /* FIXME: Handle more event types. */
1031 switch ((event->event_cmd.flags & TRB_TYPE_BITMASK)) { 1131 switch ((event->event_cmd.flags & TRB_TYPE_BITMASK)) {
1032 case TRB_TYPE(TRB_COMPLETION): 1132 case TRB_TYPE(TRB_COMPLETION):
1133 xhci_dbg(xhci, "%s - calling handle_cmd_completion\n", __func__);
1033 handle_cmd_completion(xhci, &event->event_cmd); 1134 handle_cmd_completion(xhci, &event->event_cmd);
1135 xhci_dbg(xhci, "%s - returned from handle_cmd_completion\n", __func__);
1034 break; 1136 break;
1035 case TRB_TYPE(TRB_PORT_STATUS): 1137 case TRB_TYPE(TRB_PORT_STATUS):
1138 xhci_dbg(xhci, "%s - calling handle_port_status\n", __func__);
1036 handle_port_status(xhci, event); 1139 handle_port_status(xhci, event);
1140 xhci_dbg(xhci, "%s - returned from handle_port_status\n", __func__);
1037 update_ptrs = 0; 1141 update_ptrs = 0;
1038 break; 1142 break;
1039 case TRB_TYPE(TRB_TRANSFER): 1143 case TRB_TYPE(TRB_TRANSFER):
1144 xhci_dbg(xhci, "%s - calling handle_tx_event\n", __func__);
1040 ret = handle_tx_event(xhci, &event->trans_event); 1145 ret = handle_tx_event(xhci, &event->trans_event);
1146 xhci_dbg(xhci, "%s - returned from handle_tx_event\n", __func__);
1041 if (ret < 0) 1147 if (ret < 0)
1042 xhci->error_bitmask |= 1 << 9; 1148 xhci->error_bitmask |= 1 << 9;
1043 else 1149 else
@@ -1093,13 +1199,13 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
1093 */ 1199 */
1094 xhci_warn(xhci, "WARN urb submitted to disabled ep\n"); 1200 xhci_warn(xhci, "WARN urb submitted to disabled ep\n");
1095 return -ENOENT; 1201 return -ENOENT;
1096 case EP_STATE_HALTED:
1097 case EP_STATE_ERROR: 1202 case EP_STATE_ERROR:
1098 xhci_warn(xhci, "WARN waiting for halt or error on ep " 1203 xhci_warn(xhci, "WARN waiting for error on ep to be cleared\n");
1099 "to be cleared\n");
1100 /* FIXME event handling code for error needs to clear it */ 1204 /* FIXME event handling code for error needs to clear it */
1101 /* XXX not sure if this should be -ENOENT or not */ 1205 /* XXX not sure if this should be -ENOENT or not */
1102 return -EINVAL; 1206 return -EINVAL;
1207 case EP_STATE_HALTED:
1208 xhci_dbg(xhci, "WARN halted endpoint, queueing URB anyway.\n");
1103 case EP_STATE_STOPPED: 1209 case EP_STATE_STOPPED:
1104 case EP_STATE_RUNNING: 1210 case EP_STATE_RUNNING:
1105 break; 1211 break;
@@ -1128,9 +1234,9 @@ static int prepare_transfer(struct xhci_hcd *xhci,
1128 gfp_t mem_flags) 1234 gfp_t mem_flags)
1129{ 1235{
1130 int ret; 1236 int ret;
1131 1237 struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index);
1132 ret = prepare_ring(xhci, xdev->ep_rings[ep_index], 1238 ret = prepare_ring(xhci, xdev->ep_rings[ep_index],
1133 xdev->out_ctx->ep[ep_index].ep_info & EP_STATE_MASK, 1239 ep_ctx->ep_info & EP_STATE_MASK,
1134 num_trbs, mem_flags); 1240 num_trbs, mem_flags);
1135 if (ret) 1241 if (ret)
1136 return ret; 1242 return ret;
@@ -1285,6 +1391,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1285 /* Queue the first TRB, even if it's zero-length */ 1391 /* Queue the first TRB, even if it's zero-length */
1286 do { 1392 do {
1287 u32 field = 0; 1393 u32 field = 0;
1394 u32 length_field = 0;
1288 1395
1289 /* Don't change the cycle bit of the first TRB until later */ 1396 /* Don't change the cycle bit of the first TRB until later */
1290 if (first_trb) 1397 if (first_trb)
@@ -1314,10 +1421,13 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1314 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), 1421 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1),
1315 (unsigned int) addr + trb_buff_len); 1422 (unsigned int) addr + trb_buff_len);
1316 } 1423 }
1424 length_field = TRB_LEN(trb_buff_len) |
1425 TD_REMAINDER(urb->transfer_buffer_length - running_total) |
1426 TRB_INTR_TARGET(0);
1317 queue_trb(xhci, ep_ring, false, 1427 queue_trb(xhci, ep_ring, false,
1318 (u32) addr, 1428 lower_32_bits(addr),
1319 (u32) ((u64) addr >> 32), 1429 upper_32_bits(addr),
1320 TRB_LEN(trb_buff_len) | TRB_INTR_TARGET(0), 1430 length_field,
1321 /* We always want to know if the TRB was short, 1431 /* We always want to know if the TRB was short,
1322 * or we won't get an event when it completes. 1432 * or we won't get an event when it completes.
1323 * (Unless we use event data TRBs, which are a 1433 * (Unless we use event data TRBs, which are a
@@ -1365,7 +1475,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1365 struct xhci_generic_trb *start_trb; 1475 struct xhci_generic_trb *start_trb;
1366 bool first_trb; 1476 bool first_trb;
1367 int start_cycle; 1477 int start_cycle;
1368 u32 field; 1478 u32 field, length_field;
1369 1479
1370 int running_total, trb_buff_len, ret; 1480 int running_total, trb_buff_len, ret;
1371 u64 addr; 1481 u64 addr;
@@ -1443,10 +1553,13 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1443 td->last_trb = ep_ring->enqueue; 1553 td->last_trb = ep_ring->enqueue;
1444 field |= TRB_IOC; 1554 field |= TRB_IOC;
1445 } 1555 }
1556 length_field = TRB_LEN(trb_buff_len) |
1557 TD_REMAINDER(urb->transfer_buffer_length - running_total) |
1558 TRB_INTR_TARGET(0);
1446 queue_trb(xhci, ep_ring, false, 1559 queue_trb(xhci, ep_ring, false,
1447 (u32) addr, 1560 lower_32_bits(addr),
1448 (u32) ((u64) addr >> 32), 1561 upper_32_bits(addr),
1449 TRB_LEN(trb_buff_len) | TRB_INTR_TARGET(0), 1562 length_field,
1450 /* We always want to know if the TRB was short, 1563 /* We always want to know if the TRB was short,
1451 * or we won't get an event when it completes. 1564 * or we won't get an event when it completes.
1452 * (Unless we use event data TRBs, which are a 1565 * (Unless we use event data TRBs, which are a
@@ -1478,7 +1591,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1478 struct usb_ctrlrequest *setup; 1591 struct usb_ctrlrequest *setup;
1479 struct xhci_generic_trb *start_trb; 1592 struct xhci_generic_trb *start_trb;
1480 int start_cycle; 1593 int start_cycle;
1481 u32 field; 1594 u32 field, length_field;
1482 struct xhci_td *td; 1595 struct xhci_td *td;
1483 1596
1484 ep_ring = xhci->devs[slot_id]->ep_rings[ep_index]; 1597 ep_ring = xhci->devs[slot_id]->ep_rings[ep_index];
@@ -1528,13 +1641,16 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
1528 1641
1529 /* If there's data, queue data TRBs */ 1642 /* If there's data, queue data TRBs */
1530 field = 0; 1643 field = 0;
1644 length_field = TRB_LEN(urb->transfer_buffer_length) |
1645 TD_REMAINDER(urb->transfer_buffer_length) |
1646 TRB_INTR_TARGET(0);
1531 if (urb->transfer_buffer_length > 0) { 1647 if (urb->transfer_buffer_length > 0) {
1532 if (setup->bRequestType & USB_DIR_IN) 1648 if (setup->bRequestType & USB_DIR_IN)
1533 field |= TRB_DIR_IN; 1649 field |= TRB_DIR_IN;
1534 queue_trb(xhci, ep_ring, false, 1650 queue_trb(xhci, ep_ring, false,
1535 lower_32_bits(urb->transfer_dma), 1651 lower_32_bits(urb->transfer_dma),
1536 upper_32_bits(urb->transfer_dma), 1652 upper_32_bits(urb->transfer_dma),
1537 TRB_LEN(urb->transfer_buffer_length) | TRB_INTR_TARGET(0), 1653 length_field,
1538 /* Event on short tx */ 1654 /* Event on short tx */
1539 field | TRB_ISP | TRB_TYPE(TRB_DATA) | ep_ring->cycle_state); 1655 field | TRB_ISP | TRB_TYPE(TRB_DATA) | ep_ring->cycle_state);
1540 } 1656 }
@@ -1603,7 +1719,8 @@ int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id)
1603int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1719int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1604 u32 slot_id) 1720 u32 slot_id)
1605{ 1721{
1606 return queue_command(xhci, in_ctx_ptr, 0, 0, 1722 return queue_command(xhci, lower_32_bits(in_ctx_ptr),
1723 upper_32_bits(in_ctx_ptr), 0,
1607 TRB_TYPE(TRB_ADDR_DEV) | SLOT_ID_FOR_TRB(slot_id)); 1724 TRB_TYPE(TRB_ADDR_DEV) | SLOT_ID_FOR_TRB(slot_id));
1608} 1725}
1609 1726
@@ -1611,7 +1728,8 @@ int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1611int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1728int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1612 u32 slot_id) 1729 u32 slot_id)
1613{ 1730{
1614 return queue_command(xhci, in_ctx_ptr, 0, 0, 1731 return queue_command(xhci, lower_32_bits(in_ctx_ptr),
1732 upper_32_bits(in_ctx_ptr), 0,
1615 TRB_TYPE(TRB_CONFIG_EP) | SLOT_ID_FOR_TRB(slot_id)); 1733 TRB_TYPE(TRB_CONFIG_EP) | SLOT_ID_FOR_TRB(slot_id));
1616} 1734}
1617 1735
@@ -1639,10 +1757,23 @@ static int queue_set_tr_deq(struct xhci_hcd *xhci, int slot_id,
1639 u32 type = TRB_TYPE(TRB_SET_DEQ); 1757 u32 type = TRB_TYPE(TRB_SET_DEQ);
1640 1758
1641 addr = xhci_trb_virt_to_dma(deq_seg, deq_ptr); 1759 addr = xhci_trb_virt_to_dma(deq_seg, deq_ptr);
1642 if (addr == 0) 1760 if (addr == 0) {
1643 xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n"); 1761 xhci_warn(xhci, "WARN Cannot submit Set TR Deq Ptr\n");
1644 xhci_warn(xhci, "WARN deq seg = %p, deq pt = %p\n", 1762 xhci_warn(xhci, "WARN deq seg = %p, deq pt = %p\n",
1645 deq_seg, deq_ptr); 1763 deq_seg, deq_ptr);
1646 return queue_command(xhci, (u32) addr | cycle_state, 0, 0, 1764 return 0;
1765 }
1766 return queue_command(xhci, lower_32_bits(addr) | cycle_state,
1767 upper_32_bits(addr), 0,
1647 trb_slot_id | trb_ep_index | type); 1768 trb_slot_id | trb_ep_index | type);
1648} 1769}
1770
1771int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id,
1772 unsigned int ep_index)
1773{
1774 u32 trb_slot_id = SLOT_ID_FOR_TRB(slot_id);
1775 u32 trb_ep_index = EP_ID_FOR_TRB(ep_index);
1776 u32 type = TRB_TYPE(TRB_RESET_EP);
1777
1778 return queue_command(xhci, 0, 0, 0, trb_slot_id | trb_ep_index | type);
1779}
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 8936eeb5588b..d31d32206ba3 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -25,6 +25,7 @@
25 25
26#include <linux/usb.h> 26#include <linux/usb.h>
27#include <linux/timer.h> 27#include <linux/timer.h>
28#include <linux/kernel.h>
28 29
29#include "../core/hcd.h" 30#include "../core/hcd.h"
30/* Code sharing between pci-quirks and xhci hcd */ 31/* Code sharing between pci-quirks and xhci hcd */
@@ -42,14 +43,6 @@
42 * xHCI register interface. 43 * xHCI register interface.
43 * This corresponds to the eXtensible Host Controller Interface (xHCI) 44 * This corresponds to the eXtensible Host Controller Interface (xHCI)
44 * Revision 0.95 specification 45 * Revision 0.95 specification
45 *
46 * Registers should always be accessed with double word or quad word accesses.
47 *
48 * Some xHCI implementations may support 64-bit address pointers. Registers
49 * with 64-bit address pointers should be written to with dword accesses by
50 * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second.
51 * xHCI implementations that do not support 64-bit address pointers will ignore
52 * the high dword, and write order is irrelevant.
53 */ 46 */
54 47
55/** 48/**
@@ -96,6 +89,7 @@ struct xhci_cap_regs {
96#define HCS_ERST_MAX(p) (((p) >> 4) & 0xf) 89#define HCS_ERST_MAX(p) (((p) >> 4) & 0xf)
97/* bit 26 Scratchpad restore - for save/restore HW state - not used yet */ 90/* bit 26 Scratchpad restore - for save/restore HW state - not used yet */
98/* bits 27:31 number of Scratchpad buffers SW must allocate for the HW */ 91/* bits 27:31 number of Scratchpad buffers SW must allocate for the HW */
92#define HCS_MAX_SCRATCHPAD(p) (((p) >> 27) & 0x1f)
99 93
100/* HCSPARAMS3 - hcs_params3 - bitmasks */ 94/* HCSPARAMS3 - hcs_params3 - bitmasks */
101/* bits 0:7, Max U1 to U0 latency for the roothub ports */ 95/* bits 0:7, Max U1 to U0 latency for the roothub ports */
@@ -166,10 +160,10 @@ struct xhci_op_regs {
166 u32 reserved1; 160 u32 reserved1;
167 u32 reserved2; 161 u32 reserved2;
168 u32 dev_notification; 162 u32 dev_notification;
169 u32 cmd_ring[2]; 163 u64 cmd_ring;
170 /* rsvd: offset 0x20-2F */ 164 /* rsvd: offset 0x20-2F */
171 u32 reserved3[4]; 165 u32 reserved3[4];
172 u32 dcbaa_ptr[2]; 166 u64 dcbaa_ptr;
173 u32 config_reg; 167 u32 config_reg;
174 /* rsvd: offset 0x3C-3FF */ 168 /* rsvd: offset 0x3C-3FF */
175 u32 reserved4[241]; 169 u32 reserved4[241];
@@ -254,7 +248,7 @@ struct xhci_op_regs {
254#define CMD_RING_RUNNING (1 << 3) 248#define CMD_RING_RUNNING (1 << 3)
255/* bits 4:5 reserved and should be preserved */ 249/* bits 4:5 reserved and should be preserved */
256/* Command Ring pointer - bit mask for the lower 32 bits. */ 250/* Command Ring pointer - bit mask for the lower 32 bits. */
257#define CMD_RING_ADDR_MASK (0xffffffc0) 251#define CMD_RING_RSVD_BITS (0x3f)
258 252
259/* CONFIG - Configure Register - config_reg bitmasks */ 253/* CONFIG - Configure Register - config_reg bitmasks */
260/* bits 0:7 - maximum number of device slots enabled (NumSlotsEn) */ 254/* bits 0:7 - maximum number of device slots enabled (NumSlotsEn) */
@@ -382,8 +376,8 @@ struct xhci_intr_reg {
382 u32 irq_control; 376 u32 irq_control;
383 u32 erst_size; 377 u32 erst_size;
384 u32 rsvd; 378 u32 rsvd;
385 u32 erst_base[2]; 379 u64 erst_base;
386 u32 erst_dequeue[2]; 380 u64 erst_dequeue;
387}; 381};
388 382
389/* irq_pending bitmasks */ 383/* irq_pending bitmasks */
@@ -453,6 +447,27 @@ struct xhci_doorbell_array {
453 447
454 448
455/** 449/**
450 * struct xhci_container_ctx
451 * @type: Type of context. Used to calculated offsets to contained contexts.
452 * @size: Size of the context data
453 * @bytes: The raw context data given to HW
454 * @dma: dma address of the bytes
455 *
456 * Represents either a Device or Input context. Holds a pointer to the raw
457 * memory used for the context (bytes) and dma address of it (dma).
458 */
459struct xhci_container_ctx {
460 unsigned type;
461#define XHCI_CTX_TYPE_DEVICE 0x1
462#define XHCI_CTX_TYPE_INPUT 0x2
463
464 int size;
465
466 u8 *bytes;
467 dma_addr_t dma;
468};
469
470/**
456 * struct xhci_slot_ctx 471 * struct xhci_slot_ctx
457 * @dev_info: Route string, device speed, hub info, and last valid endpoint 472 * @dev_info: Route string, device speed, hub info, and last valid endpoint
458 * @dev_info2: Max exit latency for device number, root hub port number 473 * @dev_info2: Max exit latency for device number, root hub port number
@@ -538,7 +553,7 @@ struct xhci_slot_ctx {
538struct xhci_ep_ctx { 553struct xhci_ep_ctx {
539 u32 ep_info; 554 u32 ep_info;
540 u32 ep_info2; 555 u32 ep_info2;
541 u32 deq[2]; 556 u64 deq;
542 u32 tx_info; 557 u32 tx_info;
543 /* offset 0x14 - 0x1f reserved for HC internal use */ 558 /* offset 0x14 - 0x1f reserved for HC internal use */
544 u32 reserved[3]; 559 u32 reserved[3];
@@ -589,18 +604,16 @@ struct xhci_ep_ctx {
589 604
590 605
591/** 606/**
592 * struct xhci_device_control 607 * struct xhci_input_control_context
593 * Input/Output context; see section 6.2.5. 608 * Input control context; see section 6.2.5.
594 * 609 *
595 * @drop_context: set the bit of the endpoint context you want to disable 610 * @drop_context: set the bit of the endpoint context you want to disable
596 * @add_context: set the bit of the endpoint context you want to enable 611 * @add_context: set the bit of the endpoint context you want to enable
597 */ 612 */
598struct xhci_device_control { 613struct xhci_input_control_ctx {
599 u32 drop_flags; 614 u32 drop_flags;
600 u32 add_flags; 615 u32 add_flags;
601 u32 rsvd[6]; 616 u32 rsvd2[6];
602 struct xhci_slot_ctx slot;
603 struct xhci_ep_ctx ep[31];
604}; 617};
605 618
606/* drop context bitmasks */ 619/* drop context bitmasks */
@@ -608,7 +621,6 @@ struct xhci_device_control {
608/* add context bitmasks */ 621/* add context bitmasks */
609#define ADD_EP(x) (0x1 << x) 622#define ADD_EP(x) (0x1 << x)
610 623
611
612struct xhci_virt_device { 624struct xhci_virt_device {
613 /* 625 /*
614 * Commands to the hardware are passed an "input context" that 626 * Commands to the hardware are passed an "input context" that
@@ -618,11 +630,10 @@ struct xhci_virt_device {
618 * track of input and output contexts separately because 630 * track of input and output contexts separately because
619 * these commands might fail and we don't trust the hardware. 631 * these commands might fail and we don't trust the hardware.
620 */ 632 */
621 struct xhci_device_control *out_ctx; 633 struct xhci_container_ctx *out_ctx;
622 dma_addr_t out_ctx_dma;
623 /* Used for addressing devices and configuration changes */ 634 /* Used for addressing devices and configuration changes */
624 struct xhci_device_control *in_ctx; 635 struct xhci_container_ctx *in_ctx;
625 dma_addr_t in_ctx_dma; 636
626 /* FIXME when stream support is added */ 637 /* FIXME when stream support is added */
627 struct xhci_ring *ep_rings[31]; 638 struct xhci_ring *ep_rings[31];
628 /* Temporary storage in case the configure endpoint command fails and we 639 /* Temporary storage in case the configure endpoint command fails and we
@@ -641,7 +652,7 @@ struct xhci_virt_device {
641 */ 652 */
642struct xhci_device_context_array { 653struct xhci_device_context_array {
643 /* 64-bit device addresses; we only write 32-bit addresses */ 654 /* 64-bit device addresses; we only write 32-bit addresses */
644 u32 dev_context_ptrs[2*MAX_HC_SLOTS]; 655 u64 dev_context_ptrs[MAX_HC_SLOTS];
645 /* private xHCD pointers */ 656 /* private xHCD pointers */
646 dma_addr_t dma; 657 dma_addr_t dma;
647}; 658};
@@ -654,7 +665,7 @@ struct xhci_device_context_array {
654 665
655struct xhci_stream_ctx { 666struct xhci_stream_ctx {
656 /* 64-bit stream ring address, cycle state, and stream type */ 667 /* 64-bit stream ring address, cycle state, and stream type */
657 u32 stream_ring[2]; 668 u64 stream_ring;
658 /* offset 0x14 - 0x1f reserved for HC internal use */ 669 /* offset 0x14 - 0x1f reserved for HC internal use */
659 u32 reserved[2]; 670 u32 reserved[2];
660}; 671};
@@ -662,7 +673,7 @@ struct xhci_stream_ctx {
662 673
663struct xhci_transfer_event { 674struct xhci_transfer_event {
664 /* 64-bit buffer address, or immediate data */ 675 /* 64-bit buffer address, or immediate data */
665 u32 buffer[2]; 676 u64 buffer;
666 u32 transfer_len; 677 u32 transfer_len;
667 /* This field is interpreted differently based on the type of TRB */ 678 /* This field is interpreted differently based on the type of TRB */
668 u32 flags; 679 u32 flags;
@@ -744,7 +755,7 @@ struct xhci_transfer_event {
744 755
745struct xhci_link_trb { 756struct xhci_link_trb {
746 /* 64-bit segment pointer*/ 757 /* 64-bit segment pointer*/
747 u32 segment_ptr[2]; 758 u64 segment_ptr;
748 u32 intr_target; 759 u32 intr_target;
749 u32 control; 760 u32 control;
750}; 761};
@@ -755,7 +766,7 @@ struct xhci_link_trb {
755/* Command completion event TRB */ 766/* Command completion event TRB */
756struct xhci_event_cmd { 767struct xhci_event_cmd {
757 /* Pointer to command TRB, or the value passed by the event data trb */ 768 /* Pointer to command TRB, or the value passed by the event data trb */
758 u32 cmd_trb[2]; 769 u64 cmd_trb;
759 u32 status; 770 u32 status;
760 u32 flags; 771 u32 flags;
761}; 772};
@@ -848,8 +859,8 @@ union xhci_trb {
848#define TRB_CONFIG_EP 12 859#define TRB_CONFIG_EP 12
849/* Evaluate Context Command */ 860/* Evaluate Context Command */
850#define TRB_EVAL_CONTEXT 13 861#define TRB_EVAL_CONTEXT 13
851/* Reset Transfer Ring Command */ 862/* Reset Endpoint Command */
852#define TRB_RESET_RING 14 863#define TRB_RESET_EP 14
853/* Stop Transfer Ring Command */ 864/* Stop Transfer Ring Command */
854#define TRB_STOP_RING 15 865#define TRB_STOP_RING 15
855/* Set Transfer Ring Dequeue Pointer Command */ 866/* Set Transfer Ring Dequeue Pointer Command */
@@ -929,6 +940,7 @@ struct xhci_ring {
929 unsigned int cancels_pending; 940 unsigned int cancels_pending;
930 unsigned int state; 941 unsigned int state;
931#define SET_DEQ_PENDING (1 << 0) 942#define SET_DEQ_PENDING (1 << 0)
943#define EP_HALTED (1 << 1)
932 /* The TRB that was last reported in a stopped endpoint ring */ 944 /* The TRB that was last reported in a stopped endpoint ring */
933 union xhci_trb *stopped_trb; 945 union xhci_trb *stopped_trb;
934 struct xhci_td *stopped_td; 946 struct xhci_td *stopped_td;
@@ -940,9 +952,15 @@ struct xhci_ring {
940 u32 cycle_state; 952 u32 cycle_state;
941}; 953};
942 954
955struct xhci_dequeue_state {
956 struct xhci_segment *new_deq_seg;
957 union xhci_trb *new_deq_ptr;
958 int new_cycle_state;
959};
960
943struct xhci_erst_entry { 961struct xhci_erst_entry {
944 /* 64-bit event ring segment address */ 962 /* 64-bit event ring segment address */
945 u32 seg_addr[2]; 963 u64 seg_addr;
946 u32 seg_size; 964 u32 seg_size;
947 /* Set to zero */ 965 /* Set to zero */
948 u32 rsvd; 966 u32 rsvd;
@@ -957,6 +975,13 @@ struct xhci_erst {
957 unsigned int erst_size; 975 unsigned int erst_size;
958}; 976};
959 977
978struct xhci_scratchpad {
979 u64 *sp_array;
980 dma_addr_t sp_dma;
981 void **sp_buffers;
982 dma_addr_t *sp_dma_buffers;
983};
984
960/* 985/*
961 * Each segment table entry is 4*32bits long. 1K seems like an ok size: 986 * Each segment table entry is 4*32bits long. 1K seems like an ok size:
962 * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table, 987 * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table,
@@ -1011,6 +1036,9 @@ struct xhci_hcd {
1011 struct xhci_ring *cmd_ring; 1036 struct xhci_ring *cmd_ring;
1012 struct xhci_ring *event_ring; 1037 struct xhci_ring *event_ring;
1013 struct xhci_erst erst; 1038 struct xhci_erst erst;
1039 /* Scratchpad */
1040 struct xhci_scratchpad *scratchpad;
1041
1014 /* slot enabling and address device helpers */ 1042 /* slot enabling and address device helpers */
1015 struct completion addr_dev; 1043 struct completion addr_dev;
1016 int slot_id; 1044 int slot_id;
@@ -1071,13 +1099,43 @@ static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,
1071static inline void xhci_writel(struct xhci_hcd *xhci, 1099static inline void xhci_writel(struct xhci_hcd *xhci,
1072 const unsigned int val, __u32 __iomem *regs) 1100 const unsigned int val, __u32 __iomem *regs)
1073{ 1101{
1074 if (!in_interrupt()) 1102 xhci_dbg(xhci,
1075 xhci_dbg(xhci, 1103 "`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n",
1076 "`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n", 1104 regs, val);
1077 regs, val);
1078 writel(val, regs); 1105 writel(val, regs);
1079} 1106}
1080 1107
1108/*
1109 * Registers should always be accessed with double word or quad word accesses.
1110 *
1111 * Some xHCI implementations may support 64-bit address pointers. Registers
1112 * with 64-bit address pointers should be written to with dword accesses by
1113 * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second.
1114 * xHCI implementations that do not support 64-bit address pointers will ignore
1115 * the high dword, and write order is irrelevant.
1116 */
1117static inline u64 xhci_read_64(const struct xhci_hcd *xhci,
1118 __u64 __iomem *regs)
1119{
1120 __u32 __iomem *ptr = (__u32 __iomem *) regs;
1121 u64 val_lo = readl(ptr);
1122 u64 val_hi = readl(ptr + 1);
1123 return val_lo + (val_hi << 32);
1124}
1125static inline void xhci_write_64(struct xhci_hcd *xhci,
1126 const u64 val, __u64 __iomem *regs)
1127{
1128 __u32 __iomem *ptr = (__u32 __iomem *) regs;
1129 u32 val_lo = lower_32_bits(val);
1130 u32 val_hi = upper_32_bits(val);
1131
1132 xhci_dbg(xhci,
1133 "`MEM_WRITE_DWORD(3'b000, 64'h%p, 64'h%0lx, 4'hf);\n",
1134 regs, (long unsigned int) val);
1135 writel(val_lo, ptr);
1136 writel(val_hi, ptr + 1);
1137}
1138
1081/* xHCI debugging */ 1139/* xHCI debugging */
1082void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num); 1140void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num);
1083void xhci_print_registers(struct xhci_hcd *xhci); 1141void xhci_print_registers(struct xhci_hcd *xhci);
@@ -1090,7 +1148,7 @@ void xhci_debug_ring(struct xhci_hcd *xhci, struct xhci_ring *ring);
1090void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst); 1148void xhci_dbg_erst(struct xhci_hcd *xhci, struct xhci_erst *erst);
1091void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci); 1149void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci);
1092void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring); 1150void xhci_dbg_ring_ptrs(struct xhci_hcd *xhci, struct xhci_ring *ring);
1093void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_device_control *ctx, dma_addr_t dma, unsigned int last_ep); 1151void xhci_dbg_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep);
1094 1152
1095/* xHCI memory managment */ 1153/* xHCI memory managment */
1096void xhci_mem_cleanup(struct xhci_hcd *xhci); 1154void xhci_mem_cleanup(struct xhci_hcd *xhci);
@@ -1128,6 +1186,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
1128int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status); 1186int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
1129int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); 1187int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep);
1130int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep); 1188int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep);
1189void xhci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep);
1131int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 1190int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1132void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 1191void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
1133 1192
@@ -1148,10 +1207,23 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
1148 int slot_id, unsigned int ep_index); 1207 int slot_id, unsigned int ep_index);
1149int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr, 1208int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
1150 u32 slot_id); 1209 u32 slot_id);
1210int xhci_queue_reset_ep(struct xhci_hcd *xhci, int slot_id,
1211 unsigned int ep_index);
1212void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
1213 unsigned int slot_id, unsigned int ep_index,
1214 struct xhci_td *cur_td, struct xhci_dequeue_state *state);
1215void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
1216 struct xhci_ring *ep_ring, unsigned int slot_id,
1217 unsigned int ep_index, struct xhci_dequeue_state *deq_state);
1151 1218
1152/* xHCI roothub code */ 1219/* xHCI roothub code */
1153int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex, 1220int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
1154 char *buf, u16 wLength); 1221 char *buf, u16 wLength);
1155int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); 1222int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
1156 1223
1224/* xHCI contexts */
1225struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
1226struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx);
1227struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index);
1228
1157#endif /* __LINUX_XHCI_HCD_H */ 1229#endif /* __LINUX_XHCI_HCD_H */
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index a68d91a11bee..abe3aa67ed00 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -220,7 +220,7 @@ config USB_IOWARRIOR
220 220
221config USB_TEST 221config USB_TEST
222 tristate "USB testing driver" 222 tristate "USB testing driver"
223 depends on USB && USB_DEVICEFS 223 depends on USB
224 help 224 help
225 This driver is for testing host controller software. It is used 225 This driver is for testing host controller software. It is used
226 with specialized device firmware for regression and stress testing, 226 with specialized device firmware for regression and stress testing,
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 3c5fe5cee05a..90e1a8dedfa9 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/smp_lock.h>
21#include <linux/poll.h> 22#include <linux/poll.h>
22#include <linux/usb/iowarrior.h> 23#include <linux/usb/iowarrior.h>
23 24
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index deb95bb49fd1..d645f3899fe1 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -32,6 +32,7 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/signal.h> 33#include <linux/signal.h>
34#include <linux/sched.h> 34#include <linux/sched.h>
35#include <linux/smp_lock.h>
35#include <linux/errno.h> 36#include <linux/errno.h>
36#include <linux/random.h> 37#include <linux/random.h>
37#include <linux/poll.h> 38#include <linux/poll.h>
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index e0ff9ccd866b..29092b8e59ce 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/smp_lock.h>
19#include <linux/errno.h> 20#include <linux/errno.h>
20#include <linux/mutex.h> 21#include <linux/mutex.h>
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
diff --git a/drivers/usb/musb/cppi_dma.h b/drivers/usb/musb/cppi_dma.h
index 8a39de3e6e47..59bf949e589b 100644
--- a/drivers/usb/musb/cppi_dma.h
+++ b/drivers/usb/musb/cppi_dma.h
@@ -5,7 +5,6 @@
5 5
6#include <linux/slab.h> 6#include <linux/slab.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/smp_lock.h>
9#include <linux/errno.h> 8#include <linux/errno.h>
10#include <linux/dmapool.h> 9#include <linux/dmapool.h>
11 10
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 180d7daa4099..e16ff605c458 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -35,13 +35,14 @@
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/memory.h> 36#include <mach/memory.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cputype.h>
38 39
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
40 41
41#include "musb_core.h" 42#include "musb_core.h"
42 43
43#ifdef CONFIG_MACH_DAVINCI_EVM 44#ifdef CONFIG_MACH_DAVINCI_EVM
44#define GPIO_nVBUS_DRV 87 45#define GPIO_nVBUS_DRV 144
45#endif 46#endif
46 47
47#include "davinci.h" 48#include "davinci.h"
@@ -329,7 +330,6 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
329 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); 330 mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
330 WARNING("VBUS error workaround (delay coming)\n"); 331 WARNING("VBUS error workaround (delay coming)\n");
331 } else if (is_host_enabled(musb) && drvvbus) { 332 } else if (is_host_enabled(musb) && drvvbus) {
332 musb->is_active = 1;
333 MUSB_HST_MODE(musb); 333 MUSB_HST_MODE(musb);
334 musb->xceiv->default_a = 1; 334 musb->xceiv->default_a = 1;
335 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 335 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
@@ -343,7 +343,9 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
343 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); 343 portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
344 } 344 }
345 345
346 /* NOTE: this must complete poweron within 100 msec */ 346 /* NOTE: this must complete poweron within 100 msec
347 * (OTG_TIME_A_WAIT_VRISE) but we don't check for that.
348 */
347 davinci_source_power(musb, drvvbus, 0); 349 davinci_source_power(musb, drvvbus, 0);
348 DBG(2, "VBUS %s (%s)%s, devctl %02x\n", 350 DBG(2, "VBUS %s (%s)%s, devctl %02x\n",
349 drvvbus ? "on" : "off", 351 drvvbus ? "on" : "off",
@@ -411,6 +413,21 @@ int __init musb_platform_init(struct musb *musb)
411 __raw_writel(phy_ctrl, USB_PHY_CTRL); 413 __raw_writel(phy_ctrl, USB_PHY_CTRL);
412 } 414 }
413 415
416 /* On dm355, the default-A state machine needs DRVVBUS control.
417 * If we won't be a host, there's no need to turn it on.
418 */
419 if (cpu_is_davinci_dm355()) {
420 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
421
422 if (is_host_enabled(musb)) {
423 deepsleep &= ~DRVVBUS_OVERRIDE;
424 } else {
425 deepsleep &= ~DRVVBUS_FORCE;
426 deepsleep |= DRVVBUS_OVERRIDE;
427 }
428 __raw_writel(deepsleep, DM355_DEEPSLEEP);
429 }
430
414 /* reset the controller */ 431 /* reset the controller */
415 musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1); 432 musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1);
416 433
@@ -437,6 +454,15 @@ int musb_platform_exit(struct musb *musb)
437 if (is_host_enabled(musb)) 454 if (is_host_enabled(musb))
438 del_timer_sync(&otg_workaround); 455 del_timer_sync(&otg_workaround);
439 456
457 /* force VBUS off */
458 if (cpu_is_davinci_dm355()) {
459 u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
460
461 deepsleep &= ~DRVVBUS_FORCE;
462 deepsleep |= DRVVBUS_OVERRIDE;
463 __raw_writel(deepsleep, DM355_DEEPSLEEP);
464 }
465
440 davinci_source_power(musb, 0 /*off*/, 1); 466 davinci_source_power(musb, 0 /*off*/, 1);
441 467
442 /* delay, to avoid problems with module reload */ 468 /* delay, to avoid problems with module reload */
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 554a414f65d1..c7c1ca0494cd 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1326,7 +1326,6 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1326 int i; 1326 int i;
1327 1327
1328 /* log core options (read using indexed model) */ 1328 /* log core options (read using indexed model) */
1329 musb_ep_select(mbase, 0);
1330 reg = musb_read_configdata(mbase); 1329 reg = musb_read_configdata(mbase);
1331 1330
1332 strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8"); 1331 strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");
@@ -1990,7 +1989,7 @@ bad_config:
1990 if (status < 0) 1989 if (status < 0)
1991 goto fail2; 1990 goto fail2;
1992 1991
1993#ifdef CONFIG_USB_OTG 1992#ifdef CONFIG_USB_MUSB_OTG
1994 setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); 1993 setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb);
1995#endif 1994#endif
1996 1995
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index f3772ca3b2cf..381d648a36b8 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -38,7 +38,6 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/list.h> 39#include <linux/list.h>
40#include <linux/interrupt.h> 40#include <linux/interrupt.h>
41#include <linux/smp_lock.h>
42#include <linux/errno.h> 41#include <linux/errno.h>
43#include <linux/timer.h> 42#include <linux/timer.h>
44#include <linux/clk.h> 43#include <linux/clk.h>
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 40ed50ecedff..7a6778675ad3 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -407,7 +407,7 @@ stall:
407 csr |= MUSB_RXCSR_P_SENDSTALL 407 csr |= MUSB_RXCSR_P_SENDSTALL
408 | MUSB_RXCSR_FLUSHFIFO 408 | MUSB_RXCSR_FLUSHFIFO
409 | MUSB_RXCSR_CLRDATATOG 409 | MUSB_RXCSR_CLRDATATOG
410 | MUSB_TXCSR_P_WZC_BITS; 410 | MUSB_RXCSR_P_WZC_BITS;
411 musb_writew(regs, MUSB_RXCSR, 411 musb_writew(regs, MUSB_RXCSR,
412 csr); 412 csr);
413 } 413 }
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 94a2a350a414..cf94511485f2 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -373,7 +373,7 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
373 musb_save_toggle(qh, is_in, urb); 373 musb_save_toggle(qh, is_in, urb);
374 break; 374 break;
375 case USB_ENDPOINT_XFER_ISOC: 375 case USB_ENDPOINT_XFER_ISOC:
376 if (urb->error_count) 376 if (status == 0 && urb->error_count)
377 status = -EXDEV; 377 status = -EXDEV;
378 break; 378 break;
379 } 379 }
@@ -2235,13 +2235,30 @@ static void musb_h_stop(struct usb_hcd *hcd)
2235static int musb_bus_suspend(struct usb_hcd *hcd) 2235static int musb_bus_suspend(struct usb_hcd *hcd)
2236{ 2236{
2237 struct musb *musb = hcd_to_musb(hcd); 2237 struct musb *musb = hcd_to_musb(hcd);
2238 u8 devctl;
2238 2239
2239 if (musb->xceiv->state == OTG_STATE_A_SUSPEND) 2240 if (!is_host_active(musb))
2240 return 0; 2241 return 0;
2241 2242
2242 if (is_host_active(musb) && musb->is_active) { 2243 switch (musb->xceiv->state) {
2243 WARNING("trying to suspend as %s is_active=%i\n", 2244 case OTG_STATE_A_SUSPEND:
2244 otg_state_string(musb), musb->is_active); 2245 return 0;
2246 case OTG_STATE_A_WAIT_VRISE:
2247 /* ID could be grounded even if there's no device
2248 * on the other end of the cable. NOTE that the
2249 * A_WAIT_VRISE timers are messy with MUSB...
2250 */
2251 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
2252 if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
2253 musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
2254 break;
2255 default:
2256 break;
2257 }
2258
2259 if (musb->is_active) {
2260 WARNING("trying to suspend as %s while active\n",
2261 otg_state_string(musb));
2245 return -EBUSY; 2262 return -EBUSY;
2246 } else 2263 } else
2247 return 0; 2264 return 0;
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index de3b2f18db44..fbfd3fd9ce1f 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -323,6 +323,7 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off)
323 323
324static inline u8 musb_read_configdata(void __iomem *mbase) 324static inline u8 musb_read_configdata(void __iomem *mbase)
325{ 325{
326 musb_writeb(mbase, MUSB_INDEX, 0);
326 return musb_readb(mbase, 0x10 + MUSB_CONFIGDATA); 327 return musb_readb(mbase, 0x10 + MUSB_CONFIGDATA);
327} 328}
328 329
diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig
index 69feeec1628c..aa884d072f0b 100644
--- a/drivers/usb/otg/Kconfig
+++ b/drivers/usb/otg/Kconfig
@@ -59,18 +59,4 @@ config NOP_USB_XCEIV
59 built-in with usb ip or which are autonomous and doesn't require any 59 built-in with usb ip or which are autonomous and doesn't require any
60 phy programming such as ISP1x04 etc. 60 phy programming such as ISP1x04 etc.
61 61
62config USB_LANGWELL_OTG
63 tristate "Intel Langwell USB OTG dual-role support"
64 depends on USB && MRST
65 select USB_OTG
66 select USB_OTG_UTILS
67 help
68 Say Y here if you want to build Intel Langwell USB OTG
69 transciever driver in kernel. This driver implements role
70 switch between EHCI host driver and Langwell USB OTG
71 client driver.
72
73 To compile this driver as a module, choose M here: the
74 module will be called langwell_otg.
75
76endif # USB || OTG 62endif # USB || OTG
diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
index 6d1abdd3c0ac..208167856529 100644
--- a/drivers/usb/otg/Makefile
+++ b/drivers/usb/otg/Makefile
@@ -9,7 +9,6 @@ obj-$(CONFIG_USB_OTG_UTILS) += otg.o
9obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o 9obj-$(CONFIG_USB_GPIO_VBUS) += gpio_vbus.o
10obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o 10obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
11obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o 11obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o
12obj-$(CONFIG_USB_LANGWELL_OTG) += langwell_otg.o
13obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o 12obj-$(CONFIG_NOP_USB_XCEIV) += nop-usb-xceiv.o
14 13
15ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG 14ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG
diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c
deleted file mode 100644
index 6f628d0e9f39..000000000000
--- a/drivers/usb/otg/langwell_otg.c
+++ /dev/null
@@ -1,1915 +0,0 @@
1/*
2 * Intel Langwell USB OTG transceiver driver
3 * Copyright (C) 2008 - 2009, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19/* This driver helps to switch Langwell OTG controller function between host
20 * and peripheral. It works with EHCI driver and Langwell client controller
21 * driver together.
22 */
23#include <linux/module.h>
24#include <linux/init.h>
25#include <linux/pci.h>
26#include <linux/errno.h>
27#include <linux/interrupt.h>
28#include <linux/kernel.h>
29#include <linux/device.h>
30#include <linux/moduleparam.h>
31#include <linux/usb/ch9.h>
32#include <linux/usb/gadget.h>
33#include <linux/usb.h>
34#include <linux/usb/otg.h>
35#include <linux/notifier.h>
36#include <asm/ipc_defs.h>
37#include <linux/delay.h>
38#include "../core/hcd.h"
39
40#include <linux/usb/langwell_otg.h>
41
42#define DRIVER_DESC "Intel Langwell USB OTG transceiver driver"
43#define DRIVER_VERSION "3.0.0.32L.0002"
44
45MODULE_DESCRIPTION(DRIVER_DESC);
46MODULE_AUTHOR("Henry Yuan <hang.yuan@intel.com>, Hao Wu <hao.wu@intel.com>");
47MODULE_VERSION(DRIVER_VERSION);
48MODULE_LICENSE("GPL");
49
50static const char driver_name[] = "langwell_otg";
51
52static int langwell_otg_probe(struct pci_dev *pdev,
53 const struct pci_device_id *id);
54static void langwell_otg_remove(struct pci_dev *pdev);
55static int langwell_otg_suspend(struct pci_dev *pdev, pm_message_t message);
56static int langwell_otg_resume(struct pci_dev *pdev);
57
58static int langwell_otg_set_host(struct otg_transceiver *otg,
59 struct usb_bus *host);
60static int langwell_otg_set_peripheral(struct otg_transceiver *otg,
61 struct usb_gadget *gadget);
62static int langwell_otg_start_srp(struct otg_transceiver *otg);
63
64static const struct pci_device_id pci_ids[] = {{
65 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
66 .class_mask = ~0,
67 .vendor = 0x8086,
68 .device = 0x0811,
69 .subvendor = PCI_ANY_ID,
70 .subdevice = PCI_ANY_ID,
71}, { /* end: all zeroes */ }
72};
73
74static struct pci_driver otg_pci_driver = {
75 .name = (char *) driver_name,
76 .id_table = pci_ids,
77
78 .probe = langwell_otg_probe,
79 .remove = langwell_otg_remove,
80
81 .suspend = langwell_otg_suspend,
82 .resume = langwell_otg_resume,
83};
84
85static const char *state_string(enum usb_otg_state state)
86{
87 switch (state) {
88 case OTG_STATE_A_IDLE:
89 return "a_idle";
90 case OTG_STATE_A_WAIT_VRISE:
91 return "a_wait_vrise";
92 case OTG_STATE_A_WAIT_BCON:
93 return "a_wait_bcon";
94 case OTG_STATE_A_HOST:
95 return "a_host";
96 case OTG_STATE_A_SUSPEND:
97 return "a_suspend";
98 case OTG_STATE_A_PERIPHERAL:
99 return "a_peripheral";
100 case OTG_STATE_A_WAIT_VFALL:
101 return "a_wait_vfall";
102 case OTG_STATE_A_VBUS_ERR:
103 return "a_vbus_err";
104 case OTG_STATE_B_IDLE:
105 return "b_idle";
106 case OTG_STATE_B_SRP_INIT:
107 return "b_srp_init";
108 case OTG_STATE_B_PERIPHERAL:
109 return "b_peripheral";
110 case OTG_STATE_B_WAIT_ACON:
111 return "b_wait_acon";
112 case OTG_STATE_B_HOST:
113 return "b_host";
114 default:
115 return "UNDEFINED";
116 }
117}
118
119/* HSM timers */
120static inline struct langwell_otg_timer *otg_timer_initializer
121(void (*function)(unsigned long), unsigned long expires, unsigned long data)
122{
123 struct langwell_otg_timer *timer;
124 timer = kmalloc(sizeof(struct langwell_otg_timer), GFP_KERNEL);
125 timer->function = function;
126 timer->expires = expires;
127 timer->data = data;
128 return timer;
129}
130
131static struct langwell_otg_timer *a_wait_vrise_tmr, *a_wait_bcon_tmr,
132 *a_aidl_bdis_tmr, *b_ase0_brst_tmr, *b_se0_srp_tmr, *b_srp_res_tmr,
133 *b_bus_suspend_tmr;
134
135static struct list_head active_timers;
136
137static struct langwell_otg *the_transceiver;
138
139/* host/client notify transceiver when event affects HNP state */
140void langwell_update_transceiver()
141{
142 otg_dbg("transceiver driver is notified\n");
143 queue_work(the_transceiver->qwork, &the_transceiver->work);
144}
145EXPORT_SYMBOL(langwell_update_transceiver);
146
147static int langwell_otg_set_host(struct otg_transceiver *otg,
148 struct usb_bus *host)
149{
150 otg->host = host;
151
152 return 0;
153}
154
155static int langwell_otg_set_peripheral(struct otg_transceiver *otg,
156 struct usb_gadget *gadget)
157{
158 otg->gadget = gadget;
159
160 return 0;
161}
162
163static int langwell_otg_set_power(struct otg_transceiver *otg,
164 unsigned mA)
165{
166 return 0;
167}
168
169/* A-device drives vbus, controlled through PMIC CHRGCNTL register*/
170static void langwell_otg_drv_vbus(int on)
171{
172 struct ipc_pmic_reg_data pmic_data = {0};
173 struct ipc_pmic_reg_data battery_data;
174
175 /* Check if battery is attached or not */
176 battery_data.pmic_reg_data[0].register_address = 0xd2;
177 battery_data.ioc = 0;
178 battery_data.num_entries = 1;
179 if (ipc_pmic_register_read(&battery_data)) {
180 otg_dbg("Failed to read PMIC register 0xd2.\n");
181 return;
182 }
183
184 if ((battery_data.pmic_reg_data[0].value & 0x20) == 0) {
185 otg_dbg("no battery attached\n");
186 return;
187 }
188
189 /* Workaround for battery attachment issue */
190 if (battery_data.pmic_reg_data[0].value == 0x34) {
191 otg_dbg("battery \n");
192 return;
193 }
194
195 otg_dbg("battery attached\n");
196
197 pmic_data.ioc = 0;
198 pmic_data.pmic_reg_data[0].register_address = 0xD4;
199 pmic_data.num_entries = 1;
200 if (on)
201 pmic_data.pmic_reg_data[0].value = 0x20;
202 else
203 pmic_data.pmic_reg_data[0].value = 0xc0;
204
205 if (ipc_pmic_register_write(&pmic_data, TRUE))
206 otg_dbg("Failed to write PMIC.\n");
207
208}
209
210/* charge vbus or discharge vbus through a resistor to ground */
211static void langwell_otg_chrg_vbus(int on)
212{
213
214 u32 val;
215
216 val = readl(the_transceiver->regs + CI_OTGSC);
217
218 if (on)
219 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_VC,
220 the_transceiver->regs + CI_OTGSC);
221 else
222 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_VD,
223 the_transceiver->regs + CI_OTGSC);
224
225}
226
227/* Start SRP */
228static int langwell_otg_start_srp(struct otg_transceiver *otg)
229{
230 u32 val;
231
232 otg_dbg("Start SRP ->\n");
233
234 val = readl(the_transceiver->regs + CI_OTGSC);
235
236 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_HADP,
237 the_transceiver->regs + CI_OTGSC);
238
239 /* Check if the data plus is finished or not */
240 msleep(8);
241 val = readl(the_transceiver->regs + CI_OTGSC);
242 if (val & (OTGSC_HADP | OTGSC_DP))
243 otg_dbg("DataLine SRP Error\n");
244
245 /* FIXME: VBus SRP */
246
247 return 0;
248}
249
250
251/* stop SOF via bus_suspend */
252static void langwell_otg_loc_sof(int on)
253{
254 struct usb_hcd *hcd;
255 int err;
256
257 otg_dbg("loc_sof -> %d\n", on);
258
259 hcd = bus_to_hcd(the_transceiver->otg.host);
260 if (on)
261 err = hcd->driver->bus_resume(hcd);
262 else
263 err = hcd->driver->bus_suspend(hcd);
264
265 if (err)
266 otg_dbg("Failed to resume/suspend bus - %d\n", err);
267}
268
269static void langwell_otg_phy_low_power(int on)
270{
271 u32 val;
272
273 otg_dbg("phy low power mode-> %d\n", on);
274
275 val = readl(the_transceiver->regs + CI_HOSTPC1);
276 if (on)
277 writel(val | HOSTPC1_PHCD, the_transceiver->regs + CI_HOSTPC1);
278 else
279 writel(val & ~HOSTPC1_PHCD, the_transceiver->regs + CI_HOSTPC1);
280}
281
282/* Enable/Disable OTG interrupt */
283static void langwell_otg_intr(int on)
284{
285 u32 val;
286
287 otg_dbg("interrupt -> %d\n", on);
288
289 val = readl(the_transceiver->regs + CI_OTGSC);
290 if (on) {
291 val = val | (OTGSC_INTEN_MASK | OTGSC_IDPU);
292 writel(val, the_transceiver->regs + CI_OTGSC);
293 } else {
294 val = val & ~(OTGSC_INTEN_MASK | OTGSC_IDPU);
295 writel(val, the_transceiver->regs + CI_OTGSC);
296 }
297}
298
299/* set HAAR: Hardware Assist Auto-Reset */
300static void langwell_otg_HAAR(int on)
301{
302 u32 val;
303
304 otg_dbg("HAAR -> %d\n", on);
305
306 val = readl(the_transceiver->regs + CI_OTGSC);
307 if (on)
308 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_HAAR,
309 the_transceiver->regs + CI_OTGSC);
310 else
311 writel((val & ~OTGSC_INTSTS_MASK) & ~OTGSC_HAAR,
312 the_transceiver->regs + CI_OTGSC);
313}
314
315/* set HABA: Hardware Assist B-Disconnect to A-Connect */
316static void langwell_otg_HABA(int on)
317{
318 u32 val;
319
320 otg_dbg("HABA -> %d\n", on);
321
322 val = readl(the_transceiver->regs + CI_OTGSC);
323 if (on)
324 writel((val & ~OTGSC_INTSTS_MASK) | OTGSC_HABA,
325 the_transceiver->regs + CI_OTGSC);
326 else
327 writel((val & ~OTGSC_INTSTS_MASK) & ~OTGSC_HABA,
328 the_transceiver->regs + CI_OTGSC);
329}
330
331static int langwell_otg_check_se0_srp(int on)
332{
333 u32 val;
334
335 int delay_time = TB_SE0_SRP * 10; /* step is 100us */
336
337 otg_dbg("check_se0_srp -> \n");
338
339 do {
340 udelay(100);
341 if (!delay_time--)
342 break;
343 val = readl(the_transceiver->regs + CI_PORTSC1);
344 val &= PORTSC_LS;
345 } while (!val);
346
347 otg_dbg("check_se0_srp <- \n");
348 return val;
349}
350
351/* The timeout callback function to set time out bit */
352static void set_tmout(unsigned long indicator)
353{
354 *(int *)indicator = 1;
355}
356
357void langwell_otg_nsf_msg(unsigned long indicator)
358{
359 switch (indicator) {
360 case 2:
361 case 4:
362 case 6:
363 case 7:
364 printk(KERN_ERR "OTG:NSF-%lu - deivce not responding\n",
365 indicator);
366 break;
367 case 3:
368 printk(KERN_ERR "OTG:NSF-%lu - deivce not supported\n",
369 indicator);
370 break;
371 default:
372 printk(KERN_ERR "Do not have this kind of NSF\n");
373 break;
374 }
375}
376
377/* Initialize timers */
378static void langwell_otg_init_timers(struct otg_hsm *hsm)
379{
380 /* HSM used timers */
381 a_wait_vrise_tmr = otg_timer_initializer(&set_tmout, TA_WAIT_VRISE,
382 (unsigned long)&hsm->a_wait_vrise_tmout);
383 a_wait_bcon_tmr = otg_timer_initializer(&set_tmout, TA_WAIT_BCON,
384 (unsigned long)&hsm->a_wait_bcon_tmout);
385 a_aidl_bdis_tmr = otg_timer_initializer(&set_tmout, TA_AIDL_BDIS,
386 (unsigned long)&hsm->a_aidl_bdis_tmout);
387 b_ase0_brst_tmr = otg_timer_initializer(&set_tmout, TB_ASE0_BRST,
388 (unsigned long)&hsm->b_ase0_brst_tmout);
389 b_se0_srp_tmr = otg_timer_initializer(&set_tmout, TB_SE0_SRP,
390 (unsigned long)&hsm->b_se0_srp);
391 b_srp_res_tmr = otg_timer_initializer(&set_tmout, TB_SRP_RES,
392 (unsigned long)&hsm->b_srp_res_tmout);
393 b_bus_suspend_tmr = otg_timer_initializer(&set_tmout, TB_BUS_SUSPEND,
394 (unsigned long)&hsm->b_bus_suspend_tmout);
395}
396
397/* Free timers */
398static void langwell_otg_free_timers(void)
399{
400 kfree(a_wait_vrise_tmr);
401 kfree(a_wait_bcon_tmr);
402 kfree(a_aidl_bdis_tmr);
403 kfree(b_ase0_brst_tmr);
404 kfree(b_se0_srp_tmr);
405 kfree(b_srp_res_tmr);
406 kfree(b_bus_suspend_tmr);
407}
408
409/* Add timer to timer list */
410static void langwell_otg_add_timer(void *gtimer)
411{
412 struct langwell_otg_timer *timer = (struct langwell_otg_timer *)gtimer;
413 struct langwell_otg_timer *tmp_timer;
414 u32 val32;
415
416 /* Check if the timer is already in the active list,
417 * if so update timer count
418 */
419 list_for_each_entry(tmp_timer, &active_timers, list)
420 if (tmp_timer == timer) {
421 timer->count = timer->expires;
422 return;
423 }
424 timer->count = timer->expires;
425
426 if (list_empty(&active_timers)) {
427 val32 = readl(the_transceiver->regs + CI_OTGSC);
428 writel(val32 | OTGSC_1MSE, the_transceiver->regs + CI_OTGSC);
429 }
430
431 list_add_tail(&timer->list, &active_timers);
432}
433
434/* Remove timer from the timer list; clear timeout status */
435static void langwell_otg_del_timer(void *gtimer)
436{
437 struct langwell_otg_timer *timer = (struct langwell_otg_timer *)gtimer;
438 struct langwell_otg_timer *tmp_timer, *del_tmp;
439 u32 val32;
440
441 list_for_each_entry_safe(tmp_timer, del_tmp, &active_timers, list)
442 if (tmp_timer == timer)
443 list_del(&timer->list);
444
445 if (list_empty(&active_timers)) {
446 val32 = readl(the_transceiver->regs + CI_OTGSC);
447 writel(val32 & ~OTGSC_1MSE, the_transceiver->regs + CI_OTGSC);
448 }
449}
450
451/* Reduce timer count by 1, and find timeout conditions.*/
452static int langwell_otg_tick_timer(u32 *int_sts)
453{
454 struct langwell_otg_timer *tmp_timer, *del_tmp;
455 int expired = 0;
456
457 list_for_each_entry_safe(tmp_timer, del_tmp, &active_timers, list) {
458 tmp_timer->count--;
459 /* check if timer expires */
460 if (!tmp_timer->count) {
461 list_del(&tmp_timer->list);
462 tmp_timer->function(tmp_timer->data);
463 expired = 1;
464 }
465 }
466
467 if (list_empty(&active_timers)) {
468 otg_dbg("tick timer: disable 1ms int\n");
469 *int_sts = *int_sts & ~OTGSC_1MSE;
470 }
471 return expired;
472}
473
474static void reset_otg(void)
475{
476 u32 val;
477 int delay_time = 1000;
478
479 otg_dbg("reseting OTG controller ...\n");
480 val = readl(the_transceiver->regs + CI_USBCMD);
481 writel(val | USBCMD_RST, the_transceiver->regs + CI_USBCMD);
482 do {
483 udelay(100);
484 if (!delay_time--)
485 otg_dbg("reset timeout\n");
486 val = readl(the_transceiver->regs + CI_USBCMD);
487 val &= USBCMD_RST;
488 } while (val != 0);
489 otg_dbg("reset done.\n");
490}
491
492static void set_host_mode(void)
493{
494 u32 val;
495
496 reset_otg();
497 val = readl(the_transceiver->regs + CI_USBMODE);
498 val = (val & (~USBMODE_CM)) | USBMODE_HOST;
499 writel(val, the_transceiver->regs + CI_USBMODE);
500}
501
502static void set_client_mode(void)
503{
504 u32 val;
505
506 reset_otg();
507 val = readl(the_transceiver->regs + CI_USBMODE);
508 val = (val & (~USBMODE_CM)) | USBMODE_DEVICE;
509 writel(val, the_transceiver->regs + CI_USBMODE);
510}
511
512static void init_hsm(void)
513{
514 struct langwell_otg *langwell = the_transceiver;
515 u32 val32;
516
517 /* read OTGSC after reset */
518 val32 = readl(langwell->regs + CI_OTGSC);
519 otg_dbg("%s: OTGSC init value = 0x%x\n", __func__, val32);
520
521 /* set init state */
522 if (val32 & OTGSC_ID) {
523 langwell->hsm.id = 1;
524 langwell->otg.default_a = 0;
525 set_client_mode();
526 langwell->otg.state = OTG_STATE_B_IDLE;
527 langwell_otg_drv_vbus(0);
528 } else {
529 langwell->hsm.id = 0;
530 langwell->otg.default_a = 1;
531 set_host_mode();
532 langwell->otg.state = OTG_STATE_A_IDLE;
533 }
534
535 /* set session indicator */
536 if (val32 & OTGSC_BSE)
537 langwell->hsm.b_sess_end = 1;
538 if (val32 & OTGSC_BSV)
539 langwell->hsm.b_sess_vld = 1;
540 if (val32 & OTGSC_ASV)
541 langwell->hsm.a_sess_vld = 1;
542 if (val32 & OTGSC_AVV)
543 langwell->hsm.a_vbus_vld = 1;
544
545 /* defautly power the bus */
546 langwell->hsm.a_bus_req = 1;
547 langwell->hsm.a_bus_drop = 0;
548 /* defautly don't request bus as B device */
549 langwell->hsm.b_bus_req = 0;
550 /* no system error */
551 langwell->hsm.a_clr_err = 0;
552}
553
554static irqreturn_t otg_dummy_irq(int irq, void *_dev)
555{
556 void __iomem *reg_base = _dev;
557 u32 val;
558 u32 int_mask = 0;
559
560 val = readl(reg_base + CI_USBMODE);
561 if ((val & USBMODE_CM) != USBMODE_DEVICE)
562 return IRQ_NONE;
563
564 val = readl(reg_base + CI_USBSTS);
565 int_mask = val & INTR_DUMMY_MASK;
566
567 if (int_mask == 0)
568 return IRQ_NONE;
569
570 /* clear hsm.b_conn here since host driver can't detect it
571 * otg_dummy_irq called means B-disconnect happened.
572 */
573 if (the_transceiver->hsm.b_conn) {
574 the_transceiver->hsm.b_conn = 0;
575 if (spin_trylock(&the_transceiver->wq_lock)) {
576 queue_work(the_transceiver->qwork,
577 &the_transceiver->work);
578 spin_unlock(&the_transceiver->wq_lock);
579 }
580 }
581 /* Clear interrupts */
582 writel(int_mask, reg_base + CI_USBSTS);
583 return IRQ_HANDLED;
584}
585
586static irqreturn_t otg_irq(int irq, void *_dev)
587{
588 struct langwell_otg *langwell = _dev;
589 u32 int_sts, int_en;
590 u32 int_mask = 0;
591 int flag = 0;
592
593 int_sts = readl(langwell->regs + CI_OTGSC);
594 int_en = (int_sts & OTGSC_INTEN_MASK) >> 8;
595 int_mask = int_sts & int_en;
596 if (int_mask == 0)
597 return IRQ_NONE;
598
599 if (int_mask & OTGSC_IDIS) {
600 otg_dbg("%s: id change int\n", __func__);
601 langwell->hsm.id = (int_sts & OTGSC_ID) ? 1 : 0;
602 flag = 1;
603 }
604 if (int_mask & OTGSC_DPIS) {
605 otg_dbg("%s: data pulse int\n", __func__);
606 langwell->hsm.a_srp_det = (int_sts & OTGSC_DPS) ? 1 : 0;
607 flag = 1;
608 }
609 if (int_mask & OTGSC_BSEIS) {
610 otg_dbg("%s: b session end int\n", __func__);
611 langwell->hsm.b_sess_end = (int_sts & OTGSC_BSE) ? 1 : 0;
612 flag = 1;
613 }
614 if (int_mask & OTGSC_BSVIS) {
615 otg_dbg("%s: b session valid int\n", __func__);
616 langwell->hsm.b_sess_vld = (int_sts & OTGSC_BSV) ? 1 : 0;
617 flag = 1;
618 }
619 if (int_mask & OTGSC_ASVIS) {
620 otg_dbg("%s: a session valid int\n", __func__);
621 langwell->hsm.a_sess_vld = (int_sts & OTGSC_ASV) ? 1 : 0;
622 flag = 1;
623 }
624 if (int_mask & OTGSC_AVVIS) {
625 otg_dbg("%s: a vbus valid int\n", __func__);
626 langwell->hsm.a_vbus_vld = (int_sts & OTGSC_AVV) ? 1 : 0;
627 flag = 1;
628 }
629
630 if (int_mask & OTGSC_1MSS) {
631 /* need to schedule otg_work if any timer is expired */
632 if (langwell_otg_tick_timer(&int_sts))
633 flag = 1;
634 }
635
636 writel((int_sts & ~OTGSC_INTSTS_MASK) | int_mask,
637 langwell->regs + CI_OTGSC);
638 if (flag)
639 queue_work(langwell->qwork, &langwell->work);
640
641 return IRQ_HANDLED;
642}
643
644static void langwell_otg_work(struct work_struct *work)
645{
646 struct langwell_otg *langwell = container_of(work,
647 struct langwell_otg, work);
648 int retval;
649
650 otg_dbg("%s: old state = %s\n", __func__,
651 state_string(langwell->otg.state));
652
653 switch (langwell->otg.state) {
654 case OTG_STATE_UNDEFINED:
655 case OTG_STATE_B_IDLE:
656 if (!langwell->hsm.id) {
657 langwell_otg_del_timer(b_srp_res_tmr);
658 langwell->otg.default_a = 1;
659 langwell->hsm.a_srp_det = 0;
660
661 langwell_otg_chrg_vbus(0);
662 langwell_otg_drv_vbus(0);
663
664 set_host_mode();
665 langwell->otg.state = OTG_STATE_A_IDLE;
666 queue_work(langwell->qwork, &langwell->work);
667 } else if (langwell->hsm.b_srp_res_tmout) {
668 langwell->hsm.b_srp_res_tmout = 0;
669 langwell->hsm.b_bus_req = 0;
670 langwell_otg_nsf_msg(6);
671 } else if (langwell->hsm.b_sess_vld) {
672 langwell_otg_del_timer(b_srp_res_tmr);
673 langwell->hsm.b_sess_end = 0;
674 langwell->hsm.a_bus_suspend = 0;
675
676 langwell_otg_chrg_vbus(0);
677 if (langwell->client_ops) {
678 langwell->client_ops->resume(langwell->pdev);
679 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
680 } else
681 otg_dbg("client driver not loaded.\n");
682
683 } else if (langwell->hsm.b_bus_req &&
684 (langwell->hsm.b_sess_end)) {
685 /* workaround for b_se0_srp detection */
686 retval = langwell_otg_check_se0_srp(0);
687 if (retval) {
688 langwell->hsm.b_bus_req = 0;
689 otg_dbg("LS is not SE0, try again later\n");
690 } else {
691 /* Start SRP */
692 langwell_otg_start_srp(&langwell->otg);
693 langwell_otg_add_timer(b_srp_res_tmr);
694 }
695 }
696 break;
697 case OTG_STATE_B_SRP_INIT:
698 if (!langwell->hsm.id) {
699 langwell->otg.default_a = 1;
700 langwell->hsm.a_srp_det = 0;
701
702 langwell_otg_drv_vbus(0);
703 langwell_otg_chrg_vbus(0);
704
705 langwell->otg.state = OTG_STATE_A_IDLE;
706 queue_work(langwell->qwork, &langwell->work);
707 } else if (langwell->hsm.b_sess_vld) {
708 langwell_otg_chrg_vbus(0);
709 if (langwell->client_ops) {
710 langwell->client_ops->resume(langwell->pdev);
711 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
712 } else
713 otg_dbg("client driver not loaded.\n");
714 }
715 break;
716 case OTG_STATE_B_PERIPHERAL:
717 if (!langwell->hsm.id) {
718 langwell->otg.default_a = 1;
719 langwell->hsm.a_srp_det = 0;
720
721 langwell_otg_drv_vbus(0);
722 langwell_otg_chrg_vbus(0);
723 set_host_mode();
724
725 if (langwell->client_ops) {
726 langwell->client_ops->suspend(langwell->pdev,
727 PMSG_FREEZE);
728 } else
729 otg_dbg("client driver has been removed.\n");
730
731 langwell->otg.state = OTG_STATE_A_IDLE;
732 queue_work(langwell->qwork, &langwell->work);
733 } else if (!langwell->hsm.b_sess_vld) {
734 langwell->hsm.b_hnp_enable = 0;
735
736 if (langwell->client_ops) {
737 langwell->client_ops->suspend(langwell->pdev,
738 PMSG_FREEZE);
739 } else
740 otg_dbg("client driver has been removed.\n");
741
742 langwell->otg.state = OTG_STATE_B_IDLE;
743 } else if (langwell->hsm.b_bus_req && langwell->hsm.b_hnp_enable
744 && langwell->hsm.a_bus_suspend) {
745
746 if (langwell->client_ops) {
747 langwell->client_ops->suspend(langwell->pdev,
748 PMSG_FREEZE);
749 } else
750 otg_dbg("client driver has been removed.\n");
751
752 langwell_otg_HAAR(1);
753 langwell->hsm.a_conn = 0;
754
755 if (langwell->host_ops) {
756 langwell->host_ops->probe(langwell->pdev,
757 langwell->host_ops->id_table);
758 langwell->otg.state = OTG_STATE_B_WAIT_ACON;
759 } else
760 otg_dbg("host driver not loaded.\n");
761
762 langwell->hsm.a_bus_resume = 0;
763 langwell->hsm.b_ase0_brst_tmout = 0;
764 langwell_otg_add_timer(b_ase0_brst_tmr);
765 }
766 break;
767
768 case OTG_STATE_B_WAIT_ACON:
769 if (!langwell->hsm.id) {
770 langwell_otg_del_timer(b_ase0_brst_tmr);
771 langwell->otg.default_a = 1;
772 langwell->hsm.a_srp_det = 0;
773
774 langwell_otg_drv_vbus(0);
775 langwell_otg_chrg_vbus(0);
776 set_host_mode();
777
778 langwell_otg_HAAR(0);
779 if (langwell->host_ops)
780 langwell->host_ops->remove(langwell->pdev);
781 else
782 otg_dbg("host driver has been removed.\n");
783 langwell->otg.state = OTG_STATE_A_IDLE;
784 queue_work(langwell->qwork, &langwell->work);
785 } else if (!langwell->hsm.b_sess_vld) {
786 langwell_otg_del_timer(b_ase0_brst_tmr);
787 langwell->hsm.b_hnp_enable = 0;
788 langwell->hsm.b_bus_req = 0;
789 langwell_otg_chrg_vbus(0);
790 langwell_otg_HAAR(0);
791
792 if (langwell->host_ops)
793 langwell->host_ops->remove(langwell->pdev);
794 else
795 otg_dbg("host driver has been removed.\n");
796 langwell->otg.state = OTG_STATE_B_IDLE;
797 } else if (langwell->hsm.a_conn) {
798 langwell_otg_del_timer(b_ase0_brst_tmr);
799 langwell_otg_HAAR(0);
800 langwell->otg.state = OTG_STATE_B_HOST;
801 queue_work(langwell->qwork, &langwell->work);
802 } else if (langwell->hsm.a_bus_resume ||
803 langwell->hsm.b_ase0_brst_tmout) {
804 langwell_otg_del_timer(b_ase0_brst_tmr);
805 langwell_otg_HAAR(0);
806 langwell_otg_nsf_msg(7);
807
808 if (langwell->host_ops)
809 langwell->host_ops->remove(langwell->pdev);
810 else
811 otg_dbg("host driver has been removed.\n");
812
813 langwell->hsm.a_bus_suspend = 0;
814 langwell->hsm.b_bus_req = 0;
815
816 if (langwell->client_ops)
817 langwell->client_ops->resume(langwell->pdev);
818 else
819 otg_dbg("client driver not loaded.\n");
820
821 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
822 }
823 break;
824
825 case OTG_STATE_B_HOST:
826 if (!langwell->hsm.id) {
827 langwell->otg.default_a = 1;
828 langwell->hsm.a_srp_det = 0;
829
830 langwell_otg_drv_vbus(0);
831 langwell_otg_chrg_vbus(0);
832 set_host_mode();
833 if (langwell->host_ops)
834 langwell->host_ops->remove(langwell->pdev);
835 else
836 otg_dbg("host driver has been removed.\n");
837 langwell->otg.state = OTG_STATE_A_IDLE;
838 queue_work(langwell->qwork, &langwell->work);
839 } else if (!langwell->hsm.b_sess_vld) {
840 langwell->hsm.b_hnp_enable = 0;
841 langwell->hsm.b_bus_req = 0;
842 langwell_otg_chrg_vbus(0);
843 if (langwell->host_ops)
844 langwell->host_ops->remove(langwell->pdev);
845 else
846 otg_dbg("host driver has been removed.\n");
847 langwell->otg.state = OTG_STATE_B_IDLE;
848 } else if ((!langwell->hsm.b_bus_req) ||
849 (!langwell->hsm.a_conn)) {
850 langwell->hsm.b_bus_req = 0;
851 langwell_otg_loc_sof(0);
852 if (langwell->host_ops)
853 langwell->host_ops->remove(langwell->pdev);
854 else
855 otg_dbg("host driver has been removed.\n");
856
857 langwell->hsm.a_bus_suspend = 0;
858
859 if (langwell->client_ops)
860 langwell->client_ops->resume(langwell->pdev);
861 else
862 otg_dbg("client driver not loaded.\n");
863
864 langwell->otg.state = OTG_STATE_B_PERIPHERAL;
865 }
866 break;
867
868 case OTG_STATE_A_IDLE:
869 langwell->otg.default_a = 1;
870 if (langwell->hsm.id) {
871 langwell->otg.default_a = 0;
872 langwell->hsm.b_bus_req = 0;
873 langwell_otg_drv_vbus(0);
874 langwell_otg_chrg_vbus(0);
875
876 langwell->otg.state = OTG_STATE_B_IDLE;
877 queue_work(langwell->qwork, &langwell->work);
878 } else if (langwell->hsm.a_sess_vld) {
879 langwell_otg_drv_vbus(1);
880 langwell->hsm.a_srp_det = 1;
881 langwell->hsm.a_wait_vrise_tmout = 0;
882 langwell_otg_add_timer(a_wait_vrise_tmr);
883 langwell->otg.state = OTG_STATE_A_WAIT_VRISE;
884 queue_work(langwell->qwork, &langwell->work);
885 } else if (!langwell->hsm.a_bus_drop &&
886 (langwell->hsm.a_srp_det || langwell->hsm.a_bus_req)) {
887 langwell_otg_drv_vbus(1);
888 langwell->hsm.a_wait_vrise_tmout = 0;
889 langwell_otg_add_timer(a_wait_vrise_tmr);
890 langwell->otg.state = OTG_STATE_A_WAIT_VRISE;
891 queue_work(langwell->qwork, &langwell->work);
892 }
893 break;
894 case OTG_STATE_A_WAIT_VRISE:
895 if (langwell->hsm.id) {
896 langwell_otg_del_timer(a_wait_vrise_tmr);
897 langwell->hsm.b_bus_req = 0;
898 langwell->otg.default_a = 0;
899 langwell_otg_drv_vbus(0);
900 langwell->otg.state = OTG_STATE_B_IDLE;
901 } else if (langwell->hsm.a_vbus_vld) {
902 langwell_otg_del_timer(a_wait_vrise_tmr);
903 if (langwell->host_ops)
904 langwell->host_ops->probe(langwell->pdev,
905 langwell->host_ops->id_table);
906 else
907 otg_dbg("host driver not loaded.\n");
908 langwell->hsm.b_conn = 0;
909 langwell->hsm.a_set_b_hnp_en = 0;
910 langwell->hsm.a_wait_bcon_tmout = 0;
911 langwell_otg_add_timer(a_wait_bcon_tmr);
912 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
913 } else if (langwell->hsm.a_wait_vrise_tmout) {
914 if (langwell->hsm.a_vbus_vld) {
915 if (langwell->host_ops)
916 langwell->host_ops->probe(
917 langwell->pdev,
918 langwell->host_ops->id_table);
919 else
920 otg_dbg("host driver not loaded.\n");
921 langwell->hsm.b_conn = 0;
922 langwell->hsm.a_set_b_hnp_en = 0;
923 langwell->hsm.a_wait_bcon_tmout = 0;
924 langwell_otg_add_timer(a_wait_bcon_tmr);
925 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
926 } else {
927 langwell_otg_drv_vbus(0);
928 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
929 }
930 }
931 break;
932 case OTG_STATE_A_WAIT_BCON:
933 if (langwell->hsm.id) {
934 langwell_otg_del_timer(a_wait_bcon_tmr);
935
936 langwell->otg.default_a = 0;
937 langwell->hsm.b_bus_req = 0;
938 if (langwell->host_ops)
939 langwell->host_ops->remove(langwell->pdev);
940 else
941 otg_dbg("host driver has been removed.\n");
942 langwell_otg_drv_vbus(0);
943 langwell->otg.state = OTG_STATE_B_IDLE;
944 queue_work(langwell->qwork, &langwell->work);
945 } else if (!langwell->hsm.a_vbus_vld) {
946 langwell_otg_del_timer(a_wait_bcon_tmr);
947
948 if (langwell->host_ops)
949 langwell->host_ops->remove(langwell->pdev);
950 else
951 otg_dbg("host driver has been removed.\n");
952 langwell_otg_drv_vbus(0);
953 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
954 } else if (langwell->hsm.a_bus_drop ||
955 (langwell->hsm.a_wait_bcon_tmout &&
956 !langwell->hsm.a_bus_req)) {
957 langwell_otg_del_timer(a_wait_bcon_tmr);
958
959 if (langwell->host_ops)
960 langwell->host_ops->remove(langwell->pdev);
961 else
962 otg_dbg("host driver has been removed.\n");
963 langwell_otg_drv_vbus(0);
964 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
965 } else if (langwell->hsm.b_conn) {
966 langwell_otg_del_timer(a_wait_bcon_tmr);
967
968 langwell->hsm.a_suspend_req = 0;
969 langwell->otg.state = OTG_STATE_A_HOST;
970 if (!langwell->hsm.a_bus_req &&
971 langwell->hsm.a_set_b_hnp_en) {
972 /* It is not safe enough to do a fast
973 * transistion from A_WAIT_BCON to
974 * A_SUSPEND */
975 msleep(10000);
976 if (langwell->hsm.a_bus_req)
977 break;
978
979 if (request_irq(langwell->pdev->irq,
980 otg_dummy_irq, IRQF_SHARED,
981 driver_name, langwell->regs) != 0) {
982 otg_dbg("request interrupt %d fail\n",
983 langwell->pdev->irq);
984 }
985
986 langwell_otg_HABA(1);
987 langwell->hsm.b_bus_resume = 0;
988 langwell->hsm.a_aidl_bdis_tmout = 0;
989 langwell_otg_add_timer(a_aidl_bdis_tmr);
990
991 langwell_otg_loc_sof(0);
992 langwell->otg.state = OTG_STATE_A_SUSPEND;
993 } else if (!langwell->hsm.a_bus_req &&
994 !langwell->hsm.a_set_b_hnp_en) {
995 struct pci_dev *pdev = langwell->pdev;
996 if (langwell->host_ops)
997 langwell->host_ops->remove(pdev);
998 else
999 otg_dbg("host driver removed.\n");
1000 langwell_otg_drv_vbus(0);
1001 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1002 }
1003 }
1004 break;
1005 case OTG_STATE_A_HOST:
1006 if (langwell->hsm.id) {
1007 langwell->otg.default_a = 0;
1008 langwell->hsm.b_bus_req = 0;
1009 if (langwell->host_ops)
1010 langwell->host_ops->remove(langwell->pdev);
1011 else
1012 otg_dbg("host driver has been removed.\n");
1013 langwell_otg_drv_vbus(0);
1014 langwell->otg.state = OTG_STATE_B_IDLE;
1015 queue_work(langwell->qwork, &langwell->work);
1016 } else if (langwell->hsm.a_bus_drop ||
1017 (!langwell->hsm.a_set_b_hnp_en && !langwell->hsm.a_bus_req)) {
1018 if (langwell->host_ops)
1019 langwell->host_ops->remove(langwell->pdev);
1020 else
1021 otg_dbg("host driver has been removed.\n");
1022 langwell_otg_drv_vbus(0);
1023 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1024 } else if (!langwell->hsm.a_vbus_vld) {
1025 if (langwell->host_ops)
1026 langwell->host_ops->remove(langwell->pdev);
1027 else
1028 otg_dbg("host driver has been removed.\n");
1029 langwell_otg_drv_vbus(0);
1030 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
1031 } else if (langwell->hsm.a_set_b_hnp_en
1032 && !langwell->hsm.a_bus_req) {
1033 /* Set HABA to enable hardware assistance to signal
1034 * A-connect after receiver B-disconnect. Hardware
1035 * will then set client mode and enable URE, SLE and
1036 * PCE after the assistance. otg_dummy_irq is used to
1037 * clean these ints when client driver is not resumed.
1038 */
1039 if (request_irq(langwell->pdev->irq,
1040 otg_dummy_irq, IRQF_SHARED, driver_name,
1041 langwell->regs) != 0) {
1042 otg_dbg("request interrupt %d failed\n",
1043 langwell->pdev->irq);
1044 }
1045
1046 /* set HABA */
1047 langwell_otg_HABA(1);
1048 langwell->hsm.b_bus_resume = 0;
1049 langwell->hsm.a_aidl_bdis_tmout = 0;
1050 langwell_otg_add_timer(a_aidl_bdis_tmr);
1051 langwell_otg_loc_sof(0);
1052 langwell->otg.state = OTG_STATE_A_SUSPEND;
1053 } else if (!langwell->hsm.b_conn || !langwell->hsm.a_bus_req) {
1054 langwell->hsm.a_wait_bcon_tmout = 0;
1055 langwell->hsm.a_set_b_hnp_en = 0;
1056 langwell_otg_add_timer(a_wait_bcon_tmr);
1057 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
1058 }
1059 break;
1060 case OTG_STATE_A_SUSPEND:
1061 if (langwell->hsm.id) {
1062 langwell_otg_del_timer(a_aidl_bdis_tmr);
1063 langwell_otg_HABA(0);
1064 free_irq(langwell->pdev->irq, langwell->regs);
1065 langwell->otg.default_a = 0;
1066 langwell->hsm.b_bus_req = 0;
1067 if (langwell->host_ops)
1068 langwell->host_ops->remove(langwell->pdev);
1069 else
1070 otg_dbg("host driver has been removed.\n");
1071 langwell_otg_drv_vbus(0);
1072 langwell->otg.state = OTG_STATE_B_IDLE;
1073 queue_work(langwell->qwork, &langwell->work);
1074 } else if (langwell->hsm.a_bus_req ||
1075 langwell->hsm.b_bus_resume) {
1076 langwell_otg_del_timer(a_aidl_bdis_tmr);
1077 langwell_otg_HABA(0);
1078 free_irq(langwell->pdev->irq, langwell->regs);
1079 langwell->hsm.a_suspend_req = 0;
1080 langwell_otg_loc_sof(1);
1081 langwell->otg.state = OTG_STATE_A_HOST;
1082 } else if (langwell->hsm.a_aidl_bdis_tmout ||
1083 langwell->hsm.a_bus_drop) {
1084 langwell_otg_del_timer(a_aidl_bdis_tmr);
1085 langwell_otg_HABA(0);
1086 free_irq(langwell->pdev->irq, langwell->regs);
1087 if (langwell->host_ops)
1088 langwell->host_ops->remove(langwell->pdev);
1089 else
1090 otg_dbg("host driver has been removed.\n");
1091 langwell_otg_drv_vbus(0);
1092 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1093 } else if (!langwell->hsm.b_conn &&
1094 langwell->hsm.a_set_b_hnp_en) {
1095 langwell_otg_del_timer(a_aidl_bdis_tmr);
1096 langwell_otg_HABA(0);
1097 free_irq(langwell->pdev->irq, langwell->regs);
1098
1099 if (langwell->host_ops)
1100 langwell->host_ops->remove(langwell->pdev);
1101 else
1102 otg_dbg("host driver has been removed.\n");
1103
1104 langwell->hsm.b_bus_suspend = 0;
1105 langwell->hsm.b_bus_suspend_vld = 0;
1106 langwell->hsm.b_bus_suspend_tmout = 0;
1107
1108 /* msleep(200); */
1109 if (langwell->client_ops)
1110 langwell->client_ops->resume(langwell->pdev);
1111 else
1112 otg_dbg("client driver not loaded.\n");
1113
1114 langwell_otg_add_timer(b_bus_suspend_tmr);
1115 langwell->otg.state = OTG_STATE_A_PERIPHERAL;
1116 break;
1117 } else if (!langwell->hsm.a_vbus_vld) {
1118 langwell_otg_del_timer(a_aidl_bdis_tmr);
1119 langwell_otg_HABA(0);
1120 free_irq(langwell->pdev->irq, langwell->regs);
1121 if (langwell->host_ops)
1122 langwell->host_ops->remove(langwell->pdev);
1123 else
1124 otg_dbg("host driver has been removed.\n");
1125 langwell_otg_drv_vbus(0);
1126 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
1127 }
1128 break;
1129 case OTG_STATE_A_PERIPHERAL:
1130 if (langwell->hsm.id) {
1131 langwell_otg_del_timer(b_bus_suspend_tmr);
1132 langwell->otg.default_a = 0;
1133 langwell->hsm.b_bus_req = 0;
1134 if (langwell->client_ops)
1135 langwell->client_ops->suspend(langwell->pdev,
1136 PMSG_FREEZE);
1137 else
1138 otg_dbg("client driver has been removed.\n");
1139 langwell_otg_drv_vbus(0);
1140 langwell->otg.state = OTG_STATE_B_IDLE;
1141 queue_work(langwell->qwork, &langwell->work);
1142 } else if (!langwell->hsm.a_vbus_vld) {
1143 langwell_otg_del_timer(b_bus_suspend_tmr);
1144 if (langwell->client_ops)
1145 langwell->client_ops->suspend(langwell->pdev,
1146 PMSG_FREEZE);
1147 else
1148 otg_dbg("client driver has been removed.\n");
1149 langwell_otg_drv_vbus(0);
1150 langwell->otg.state = OTG_STATE_A_VBUS_ERR;
1151 } else if (langwell->hsm.a_bus_drop) {
1152 langwell_otg_del_timer(b_bus_suspend_tmr);
1153 if (langwell->client_ops)
1154 langwell->client_ops->suspend(langwell->pdev,
1155 PMSG_FREEZE);
1156 else
1157 otg_dbg("client driver has been removed.\n");
1158 langwell_otg_drv_vbus(0);
1159 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1160 } else if (langwell->hsm.b_bus_suspend) {
1161 langwell_otg_del_timer(b_bus_suspend_tmr);
1162 if (langwell->client_ops)
1163 langwell->client_ops->suspend(langwell->pdev,
1164 PMSG_FREEZE);
1165 else
1166 otg_dbg("client driver has been removed.\n");
1167
1168 if (langwell->host_ops)
1169 langwell->host_ops->probe(langwell->pdev,
1170 langwell->host_ops->id_table);
1171 else
1172 otg_dbg("host driver not loaded.\n");
1173 langwell->hsm.a_set_b_hnp_en = 0;
1174 langwell->hsm.a_wait_bcon_tmout = 0;
1175 langwell_otg_add_timer(a_wait_bcon_tmr);
1176 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
1177 } else if (langwell->hsm.b_bus_suspend_tmout) {
1178 u32 val;
1179 val = readl(langwell->regs + CI_PORTSC1);
1180 if (!(val & PORTSC_SUSP))
1181 break;
1182 if (langwell->client_ops)
1183 langwell->client_ops->suspend(langwell->pdev,
1184 PMSG_FREEZE);
1185 else
1186 otg_dbg("client driver has been removed.\n");
1187 if (langwell->host_ops)
1188 langwell->host_ops->probe(langwell->pdev,
1189 langwell->host_ops->id_table);
1190 else
1191 otg_dbg("host driver not loaded.\n");
1192 langwell->hsm.a_set_b_hnp_en = 0;
1193 langwell->hsm.a_wait_bcon_tmout = 0;
1194 langwell_otg_add_timer(a_wait_bcon_tmr);
1195 langwell->otg.state = OTG_STATE_A_WAIT_BCON;
1196 }
1197 break;
1198 case OTG_STATE_A_VBUS_ERR:
1199 if (langwell->hsm.id) {
1200 langwell->otg.default_a = 0;
1201 langwell->hsm.a_clr_err = 0;
1202 langwell->hsm.a_srp_det = 0;
1203 langwell->otg.state = OTG_STATE_B_IDLE;
1204 queue_work(langwell->qwork, &langwell->work);
1205 } else if (langwell->hsm.a_clr_err) {
1206 langwell->hsm.a_clr_err = 0;
1207 langwell->hsm.a_srp_det = 0;
1208 reset_otg();
1209 init_hsm();
1210 if (langwell->otg.state == OTG_STATE_A_IDLE)
1211 queue_work(langwell->qwork, &langwell->work);
1212 }
1213 break;
1214 case OTG_STATE_A_WAIT_VFALL:
1215 if (langwell->hsm.id) {
1216 langwell->otg.default_a = 0;
1217 langwell->otg.state = OTG_STATE_B_IDLE;
1218 queue_work(langwell->qwork, &langwell->work);
1219 } else if (langwell->hsm.a_bus_req) {
1220 langwell_otg_drv_vbus(1);
1221 langwell->hsm.a_wait_vrise_tmout = 0;
1222 langwell_otg_add_timer(a_wait_vrise_tmr);
1223 langwell->otg.state = OTG_STATE_A_WAIT_VRISE;
1224 } else if (!langwell->hsm.a_sess_vld) {
1225 langwell->hsm.a_srp_det = 0;
1226 langwell_otg_drv_vbus(0);
1227 set_host_mode();
1228 langwell->otg.state = OTG_STATE_A_IDLE;
1229 }
1230 break;
1231 default:
1232 ;
1233 }
1234
1235 otg_dbg("%s: new state = %s\n", __func__,
1236 state_string(langwell->otg.state));
1237}
1238
1239 static ssize_t
1240show_registers(struct device *_dev, struct device_attribute *attr, char *buf)
1241{
1242 struct langwell_otg *langwell;
1243 char *next;
1244 unsigned size;
1245 unsigned t;
1246
1247 langwell = the_transceiver;
1248 next = buf;
1249 size = PAGE_SIZE;
1250
1251 t = scnprintf(next, size,
1252 "\n"
1253 "USBCMD = 0x%08x \n"
1254 "USBSTS = 0x%08x \n"
1255 "USBINTR = 0x%08x \n"
1256 "ASYNCLISTADDR = 0x%08x \n"
1257 "PORTSC1 = 0x%08x \n"
1258 "HOSTPC1 = 0x%08x \n"
1259 "OTGSC = 0x%08x \n"
1260 "USBMODE = 0x%08x \n",
1261 readl(langwell->regs + 0x30),
1262 readl(langwell->regs + 0x34),
1263 readl(langwell->regs + 0x38),
1264 readl(langwell->regs + 0x48),
1265 readl(langwell->regs + 0x74),
1266 readl(langwell->regs + 0xb4),
1267 readl(langwell->regs + 0xf4),
1268 readl(langwell->regs + 0xf8)
1269 );
1270 size -= t;
1271 next += t;
1272
1273 return PAGE_SIZE - size;
1274}
1275static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL);
1276
1277static ssize_t
1278show_hsm(struct device *_dev, struct device_attribute *attr, char *buf)
1279{
1280 struct langwell_otg *langwell;
1281 char *next;
1282 unsigned size;
1283 unsigned t;
1284
1285 langwell = the_transceiver;
1286 next = buf;
1287 size = PAGE_SIZE;
1288
1289 t = scnprintf(next, size,
1290 "\n"
1291 "current state = %s\n"
1292 "a_bus_resume = \t%d\n"
1293 "a_bus_suspend = \t%d\n"
1294 "a_conn = \t%d\n"
1295 "a_sess_vld = \t%d\n"
1296 "a_srp_det = \t%d\n"
1297 "a_vbus_vld = \t%d\n"
1298 "b_bus_resume = \t%d\n"
1299 "b_bus_suspend = \t%d\n"
1300 "b_conn = \t%d\n"
1301 "b_se0_srp = \t%d\n"
1302 "b_sess_end = \t%d\n"
1303 "b_sess_vld = \t%d\n"
1304 "id = \t%d\n"
1305 "a_set_b_hnp_en = \t%d\n"
1306 "b_srp_done = \t%d\n"
1307 "b_hnp_enable = \t%d\n"
1308 "a_wait_vrise_tmout = \t%d\n"
1309 "a_wait_bcon_tmout = \t%d\n"
1310 "a_aidl_bdis_tmout = \t%d\n"
1311 "b_ase0_brst_tmout = \t%d\n"
1312 "a_bus_drop = \t%d\n"
1313 "a_bus_req = \t%d\n"
1314 "a_clr_err = \t%d\n"
1315 "a_suspend_req = \t%d\n"
1316 "b_bus_req = \t%d\n"
1317 "b_bus_suspend_tmout = \t%d\n"
1318 "b_bus_suspend_vld = \t%d\n",
1319 state_string(langwell->otg.state),
1320 langwell->hsm.a_bus_resume,
1321 langwell->hsm.a_bus_suspend,
1322 langwell->hsm.a_conn,
1323 langwell->hsm.a_sess_vld,
1324 langwell->hsm.a_srp_det,
1325 langwell->hsm.a_vbus_vld,
1326 langwell->hsm.b_bus_resume,
1327 langwell->hsm.b_bus_suspend,
1328 langwell->hsm.b_conn,
1329 langwell->hsm.b_se0_srp,
1330 langwell->hsm.b_sess_end,
1331 langwell->hsm.b_sess_vld,
1332 langwell->hsm.id,
1333 langwell->hsm.a_set_b_hnp_en,
1334 langwell->hsm.b_srp_done,
1335 langwell->hsm.b_hnp_enable,
1336 langwell->hsm.a_wait_vrise_tmout,
1337 langwell->hsm.a_wait_bcon_tmout,
1338 langwell->hsm.a_aidl_bdis_tmout,
1339 langwell->hsm.b_ase0_brst_tmout,
1340 langwell->hsm.a_bus_drop,
1341 langwell->hsm.a_bus_req,
1342 langwell->hsm.a_clr_err,
1343 langwell->hsm.a_suspend_req,
1344 langwell->hsm.b_bus_req,
1345 langwell->hsm.b_bus_suspend_tmout,
1346 langwell->hsm.b_bus_suspend_vld
1347 );
1348 size -= t;
1349 next += t;
1350
1351 return PAGE_SIZE - size;
1352}
1353static DEVICE_ATTR(hsm, S_IRUGO, show_hsm, NULL);
1354
1355static ssize_t
1356get_a_bus_req(struct device *dev, struct device_attribute *attr, char *buf)
1357{
1358 struct langwell_otg *langwell;
1359 char *next;
1360 unsigned size;
1361 unsigned t;
1362
1363 langwell = the_transceiver;
1364 next = buf;
1365 size = PAGE_SIZE;
1366
1367 t = scnprintf(next, size, "%d", langwell->hsm.a_bus_req);
1368 size -= t;
1369 next += t;
1370
1371 return PAGE_SIZE - size;
1372}
1373
1374static ssize_t
1375set_a_bus_req(struct device *dev, struct device_attribute *attr,
1376 const char *buf, size_t count)
1377{
1378 struct langwell_otg *langwell;
1379 langwell = the_transceiver;
1380 if (!langwell->otg.default_a)
1381 return -1;
1382 if (count > 2)
1383 return -1;
1384
1385 if (buf[0] == '0') {
1386 langwell->hsm.a_bus_req = 0;
1387 otg_dbg("a_bus_req = 0\n");
1388 } else if (buf[0] == '1') {
1389 /* If a_bus_drop is TRUE, a_bus_req can't be set */
1390 if (langwell->hsm.a_bus_drop)
1391 return -1;
1392 langwell->hsm.a_bus_req = 1;
1393 otg_dbg("a_bus_req = 1\n");
1394 }
1395 if (spin_trylock(&langwell->wq_lock)) {
1396 queue_work(langwell->qwork, &langwell->work);
1397 spin_unlock(&langwell->wq_lock);
1398 }
1399 return count;
1400}
1401static DEVICE_ATTR(a_bus_req, S_IRUGO | S_IWUGO, get_a_bus_req, set_a_bus_req);
1402
1403static ssize_t
1404get_a_bus_drop(struct device *dev, struct device_attribute *attr, char *buf)
1405{
1406 struct langwell_otg *langwell;
1407 char *next;
1408 unsigned size;
1409 unsigned t;
1410
1411 langwell = the_transceiver;
1412 next = buf;
1413 size = PAGE_SIZE;
1414
1415 t = scnprintf(next, size, "%d", langwell->hsm.a_bus_drop);
1416 size -= t;
1417 next += t;
1418
1419 return PAGE_SIZE - size;
1420}
1421
1422static ssize_t
1423set_a_bus_drop(struct device *dev, struct device_attribute *attr,
1424 const char *buf, size_t count)
1425{
1426 struct langwell_otg *langwell;
1427 langwell = the_transceiver;
1428 if (!langwell->otg.default_a)
1429 return -1;
1430 if (count > 2)
1431 return -1;
1432
1433 if (buf[0] == '0') {
1434 langwell->hsm.a_bus_drop = 0;
1435 otg_dbg("a_bus_drop = 0\n");
1436 } else if (buf[0] == '1') {
1437 langwell->hsm.a_bus_drop = 1;
1438 langwell->hsm.a_bus_req = 0;
1439 otg_dbg("a_bus_drop = 1, then a_bus_req = 0\n");
1440 }
1441 if (spin_trylock(&langwell->wq_lock)) {
1442 queue_work(langwell->qwork, &langwell->work);
1443 spin_unlock(&langwell->wq_lock);
1444 }
1445 return count;
1446}
1447static DEVICE_ATTR(a_bus_drop, S_IRUGO | S_IWUGO,
1448 get_a_bus_drop, set_a_bus_drop);
1449
1450static ssize_t
1451get_b_bus_req(struct device *dev, struct device_attribute *attr, char *buf)
1452{
1453 struct langwell_otg *langwell;
1454 char *next;
1455 unsigned size;
1456 unsigned t;
1457
1458 langwell = the_transceiver;
1459 next = buf;
1460 size = PAGE_SIZE;
1461
1462 t = scnprintf(next, size, "%d", langwell->hsm.b_bus_req);
1463 size -= t;
1464 next += t;
1465
1466 return PAGE_SIZE - size;
1467}
1468
1469static ssize_t
1470set_b_bus_req(struct device *dev, struct device_attribute *attr,
1471 const char *buf, size_t count)
1472{
1473 struct langwell_otg *langwell;
1474 langwell = the_transceiver;
1475
1476 if (langwell->otg.default_a)
1477 return -1;
1478
1479 if (count > 2)
1480 return -1;
1481
1482 if (buf[0] == '0') {
1483 langwell->hsm.b_bus_req = 0;
1484 otg_dbg("b_bus_req = 0\n");
1485 } else if (buf[0] == '1') {
1486 langwell->hsm.b_bus_req = 1;
1487 otg_dbg("b_bus_req = 1\n");
1488 }
1489 if (spin_trylock(&langwell->wq_lock)) {
1490 queue_work(langwell->qwork, &langwell->work);
1491 spin_unlock(&langwell->wq_lock);
1492 }
1493 return count;
1494}
1495static DEVICE_ATTR(b_bus_req, S_IRUGO | S_IWUGO, get_b_bus_req, set_b_bus_req);
1496
1497static ssize_t
1498set_a_clr_err(struct device *dev, struct device_attribute *attr,
1499 const char *buf, size_t count)
1500{
1501 struct langwell_otg *langwell;
1502 langwell = the_transceiver;
1503
1504 if (!langwell->otg.default_a)
1505 return -1;
1506 if (count > 2)
1507 return -1;
1508
1509 if (buf[0] == '1') {
1510 langwell->hsm.a_clr_err = 1;
1511 otg_dbg("a_clr_err = 1\n");
1512 }
1513 if (spin_trylock(&langwell->wq_lock)) {
1514 queue_work(langwell->qwork, &langwell->work);
1515 spin_unlock(&langwell->wq_lock);
1516 }
1517 return count;
1518}
1519static DEVICE_ATTR(a_clr_err, S_IWUGO, NULL, set_a_clr_err);
1520
1521static struct attribute *inputs_attrs[] = {
1522 &dev_attr_a_bus_req.attr,
1523 &dev_attr_a_bus_drop.attr,
1524 &dev_attr_b_bus_req.attr,
1525 &dev_attr_a_clr_err.attr,
1526 NULL,
1527};
1528
1529static struct attribute_group debug_dev_attr_group = {
1530 .name = "inputs",
1531 .attrs = inputs_attrs,
1532};
1533
1534int langwell_register_host(struct pci_driver *host_driver)
1535{
1536 int ret = 0;
1537
1538 the_transceiver->host_ops = host_driver;
1539 queue_work(the_transceiver->qwork, &the_transceiver->work);
1540 otg_dbg("host controller driver is registered\n");
1541
1542 return ret;
1543}
1544EXPORT_SYMBOL(langwell_register_host);
1545
1546void langwell_unregister_host(struct pci_driver *host_driver)
1547{
1548 if (the_transceiver->host_ops)
1549 the_transceiver->host_ops->remove(the_transceiver->pdev);
1550 the_transceiver->host_ops = NULL;
1551 the_transceiver->hsm.a_bus_drop = 1;
1552 queue_work(the_transceiver->qwork, &the_transceiver->work);
1553 otg_dbg("host controller driver is unregistered\n");
1554}
1555EXPORT_SYMBOL(langwell_unregister_host);
1556
1557int langwell_register_peripheral(struct pci_driver *client_driver)
1558{
1559 int ret = 0;
1560
1561 if (client_driver)
1562 ret = client_driver->probe(the_transceiver->pdev,
1563 client_driver->id_table);
1564 if (!ret) {
1565 the_transceiver->client_ops = client_driver;
1566 queue_work(the_transceiver->qwork, &the_transceiver->work);
1567 otg_dbg("client controller driver is registered\n");
1568 }
1569
1570 return ret;
1571}
1572EXPORT_SYMBOL(langwell_register_peripheral);
1573
1574void langwell_unregister_peripheral(struct pci_driver *client_driver)
1575{
1576 if (the_transceiver->client_ops)
1577 the_transceiver->client_ops->remove(the_transceiver->pdev);
1578 the_transceiver->client_ops = NULL;
1579 the_transceiver->hsm.b_bus_req = 0;
1580 queue_work(the_transceiver->qwork, &the_transceiver->work);
1581 otg_dbg("client controller driver is unregistered\n");
1582}
1583EXPORT_SYMBOL(langwell_unregister_peripheral);
1584
1585static int langwell_otg_probe(struct pci_dev *pdev,
1586 const struct pci_device_id *id)
1587{
1588 unsigned long resource, len;
1589 void __iomem *base = NULL;
1590 int retval;
1591 u32 val32;
1592 struct langwell_otg *langwell;
1593 char qname[] = "langwell_otg_queue";
1594
1595 retval = 0;
1596 otg_dbg("\notg controller is detected.\n");
1597 if (pci_enable_device(pdev) < 0) {
1598 retval = -ENODEV;
1599 goto done;
1600 }
1601
1602 langwell = kzalloc(sizeof *langwell, GFP_KERNEL);
1603 if (langwell == NULL) {
1604 retval = -ENOMEM;
1605 goto done;
1606 }
1607 the_transceiver = langwell;
1608
1609 /* control register: BAR 0 */
1610 resource = pci_resource_start(pdev, 0);
1611 len = pci_resource_len(pdev, 0);
1612 if (!request_mem_region(resource, len, driver_name)) {
1613 retval = -EBUSY;
1614 goto err;
1615 }
1616 langwell->region = 1;
1617
1618 base = ioremap_nocache(resource, len);
1619 if (base == NULL) {
1620 retval = -EFAULT;
1621 goto err;
1622 }
1623 langwell->regs = base;
1624
1625 if (!pdev->irq) {
1626 otg_dbg("No IRQ.\n");
1627 retval = -ENODEV;
1628 goto err;
1629 }
1630
1631 langwell->qwork = create_workqueue(qname);
1632 if (!langwell->qwork) {
1633 otg_dbg("cannot create workqueue %s\n", qname);
1634 retval = -ENOMEM;
1635 goto err;
1636 }
1637 INIT_WORK(&langwell->work, langwell_otg_work);
1638
1639 /* OTG common part */
1640 langwell->pdev = pdev;
1641 langwell->otg.dev = &pdev->dev;
1642 langwell->otg.label = driver_name;
1643 langwell->otg.set_host = langwell_otg_set_host;
1644 langwell->otg.set_peripheral = langwell_otg_set_peripheral;
1645 langwell->otg.set_power = langwell_otg_set_power;
1646 langwell->otg.start_srp = langwell_otg_start_srp;
1647 langwell->otg.state = OTG_STATE_UNDEFINED;
1648 if (otg_set_transceiver(&langwell->otg)) {
1649 otg_dbg("can't set transceiver\n");
1650 retval = -EBUSY;
1651 goto err;
1652 }
1653
1654 reset_otg();
1655 init_hsm();
1656
1657 spin_lock_init(&langwell->lock);
1658 spin_lock_init(&langwell->wq_lock);
1659 INIT_LIST_HEAD(&active_timers);
1660 langwell_otg_init_timers(&langwell->hsm);
1661
1662 if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
1663 driver_name, langwell) != 0) {
1664 otg_dbg("request interrupt %d failed\n", pdev->irq);
1665 retval = -EBUSY;
1666 goto err;
1667 }
1668
1669 /* enable OTGSC int */
1670 val32 = OTGSC_DPIE | OTGSC_BSEIE | OTGSC_BSVIE |
1671 OTGSC_ASVIE | OTGSC_AVVIE | OTGSC_IDIE | OTGSC_IDPU;
1672 writel(val32, langwell->regs + CI_OTGSC);
1673
1674 retval = device_create_file(&pdev->dev, &dev_attr_registers);
1675 if (retval < 0) {
1676 otg_dbg("Can't register sysfs attribute: %d\n", retval);
1677 goto err;
1678 }
1679
1680 retval = device_create_file(&pdev->dev, &dev_attr_hsm);
1681 if (retval < 0) {
1682 otg_dbg("Can't hsm sysfs attribute: %d\n", retval);
1683 goto err;
1684 }
1685
1686 retval = sysfs_create_group(&pdev->dev.kobj, &debug_dev_attr_group);
1687 if (retval < 0) {
1688 otg_dbg("Can't register sysfs attr group: %d\n", retval);
1689 goto err;
1690 }
1691
1692 if (langwell->otg.state == OTG_STATE_A_IDLE)
1693 queue_work(langwell->qwork, &langwell->work);
1694
1695 return 0;
1696
1697err:
1698 if (the_transceiver)
1699 langwell_otg_remove(pdev);
1700done:
1701 return retval;
1702}
1703
1704static void langwell_otg_remove(struct pci_dev *pdev)
1705{
1706 struct langwell_otg *langwell;
1707
1708 langwell = the_transceiver;
1709
1710 if (langwell->qwork) {
1711 flush_workqueue(langwell->qwork);
1712 destroy_workqueue(langwell->qwork);
1713 }
1714 langwell_otg_free_timers();
1715
1716 /* disable OTGSC interrupt as OTGSC doesn't change in reset */
1717 writel(0, langwell->regs + CI_OTGSC);
1718
1719 if (pdev->irq)
1720 free_irq(pdev->irq, langwell);
1721 if (langwell->regs)
1722 iounmap(langwell->regs);
1723 if (langwell->region)
1724 release_mem_region(pci_resource_start(pdev, 0),
1725 pci_resource_len(pdev, 0));
1726
1727 otg_set_transceiver(NULL);
1728 pci_disable_device(pdev);
1729 sysfs_remove_group(&pdev->dev.kobj, &debug_dev_attr_group);
1730 device_remove_file(&pdev->dev, &dev_attr_hsm);
1731 device_remove_file(&pdev->dev, &dev_attr_registers);
1732 kfree(langwell);
1733 langwell = NULL;
1734}
1735
1736static void transceiver_suspend(struct pci_dev *pdev)
1737{
1738 pci_save_state(pdev);
1739 pci_set_power_state(pdev, PCI_D3hot);
1740 langwell_otg_phy_low_power(1);
1741}
1742
1743static int langwell_otg_suspend(struct pci_dev *pdev, pm_message_t message)
1744{
1745 int ret = 0;
1746 struct langwell_otg *langwell;
1747
1748 langwell = the_transceiver;
1749
1750 /* Disbale OTG interrupts */
1751 langwell_otg_intr(0);
1752
1753 if (pdev->irq)
1754 free_irq(pdev->irq, langwell);
1755
1756 /* Prevent more otg_work */
1757 flush_workqueue(langwell->qwork);
1758 spin_lock(&langwell->wq_lock);
1759
1760 /* start actions */
1761 switch (langwell->otg.state) {
1762 case OTG_STATE_A_IDLE:
1763 case OTG_STATE_B_IDLE:
1764 case OTG_STATE_A_WAIT_VFALL:
1765 case OTG_STATE_A_VBUS_ERR:
1766 transceiver_suspend(pdev);
1767 break;
1768 case OTG_STATE_A_WAIT_VRISE:
1769 langwell_otg_del_timer(a_wait_vrise_tmr);
1770 langwell->hsm.a_srp_det = 0;
1771 langwell_otg_drv_vbus(0);
1772 langwell->otg.state = OTG_STATE_A_IDLE;
1773 transceiver_suspend(pdev);
1774 break;
1775 case OTG_STATE_A_WAIT_BCON:
1776 langwell_otg_del_timer(a_wait_bcon_tmr);
1777 if (langwell->host_ops)
1778 ret = langwell->host_ops->suspend(pdev, message);
1779 langwell_otg_drv_vbus(0);
1780 break;
1781 case OTG_STATE_A_HOST:
1782 if (langwell->host_ops)
1783 ret = langwell->host_ops->suspend(pdev, message);
1784 langwell_otg_drv_vbus(0);
1785 langwell_otg_phy_low_power(1);
1786 break;
1787 case OTG_STATE_A_SUSPEND:
1788 langwell_otg_del_timer(a_aidl_bdis_tmr);
1789 langwell_otg_HABA(0);
1790 if (langwell->host_ops)
1791 langwell->host_ops->remove(pdev);
1792 else
1793 otg_dbg("host driver has been removed.\n");
1794 langwell_otg_drv_vbus(0);
1795 transceiver_suspend(pdev);
1796 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1797 break;
1798 case OTG_STATE_A_PERIPHERAL:
1799 if (langwell->client_ops)
1800 ret = langwell->client_ops->suspend(pdev, message);
1801 else
1802 otg_dbg("client driver has been removed.\n");
1803 langwell_otg_drv_vbus(0);
1804 transceiver_suspend(pdev);
1805 langwell->otg.state = OTG_STATE_A_WAIT_VFALL;
1806 break;
1807 case OTG_STATE_B_HOST:
1808 if (langwell->host_ops)
1809 langwell->host_ops->remove(pdev);
1810 else
1811 otg_dbg("host driver has been removed.\n");
1812 langwell->hsm.b_bus_req = 0;
1813 transceiver_suspend(pdev);
1814 langwell->otg.state = OTG_STATE_B_IDLE;
1815 break;
1816 case OTG_STATE_B_PERIPHERAL:
1817 if (langwell->client_ops)
1818 ret = langwell->client_ops->suspend(pdev, message);
1819 else
1820 otg_dbg("client driver has been removed.\n");
1821 break;
1822 case OTG_STATE_B_WAIT_ACON:
1823 langwell_otg_del_timer(b_ase0_brst_tmr);
1824 langwell_otg_HAAR(0);
1825 if (langwell->host_ops)
1826 langwell->host_ops->remove(pdev);
1827 else
1828 otg_dbg("host driver has been removed.\n");
1829 langwell->hsm.b_bus_req = 0;
1830 langwell->otg.state = OTG_STATE_B_IDLE;
1831 transceiver_suspend(pdev);
1832 break;
1833 default:
1834 otg_dbg("error state before suspend\n ");
1835 break;
1836 }
1837 spin_unlock(&langwell->wq_lock);
1838
1839 return ret;
1840}
1841
1842static void transceiver_resume(struct pci_dev *pdev)
1843{
1844 pci_restore_state(pdev);
1845 pci_set_power_state(pdev, PCI_D0);
1846 langwell_otg_phy_low_power(0);
1847}
1848
1849static int langwell_otg_resume(struct pci_dev *pdev)
1850{
1851 int ret = 0;
1852 struct langwell_otg *langwell;
1853
1854 langwell = the_transceiver;
1855
1856 spin_lock(&langwell->wq_lock);
1857
1858 switch (langwell->otg.state) {
1859 case OTG_STATE_A_IDLE:
1860 case OTG_STATE_B_IDLE:
1861 case OTG_STATE_A_WAIT_VFALL:
1862 case OTG_STATE_A_VBUS_ERR:
1863 transceiver_resume(pdev);
1864 break;
1865 case OTG_STATE_A_WAIT_BCON:
1866 langwell_otg_add_timer(a_wait_bcon_tmr);
1867 langwell_otg_drv_vbus(1);
1868 if (langwell->host_ops)
1869 ret = langwell->host_ops->resume(pdev);
1870 break;
1871 case OTG_STATE_A_HOST:
1872 langwell_otg_drv_vbus(1);
1873 langwell_otg_phy_low_power(0);
1874 if (langwell->host_ops)
1875 ret = langwell->host_ops->resume(pdev);
1876 break;
1877 case OTG_STATE_B_PERIPHERAL:
1878 if (langwell->client_ops)
1879 ret = langwell->client_ops->resume(pdev);
1880 else
1881 otg_dbg("client driver not loaded.\n");
1882 break;
1883 default:
1884 otg_dbg("error state before suspend\n ");
1885 break;
1886 }
1887
1888 if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
1889 driver_name, the_transceiver) != 0) {
1890 otg_dbg("request interrupt %d failed\n", pdev->irq);
1891 ret = -EBUSY;
1892 }
1893
1894 /* enable OTG interrupts */
1895 langwell_otg_intr(1);
1896
1897 spin_unlock(&langwell->wq_lock);
1898
1899 queue_work(langwell->qwork, &langwell->work);
1900
1901
1902 return ret;
1903}
1904
1905static int __init langwell_otg_init(void)
1906{
1907 return pci_register_driver(&otg_pci_driver);
1908}
1909module_init(langwell_otg_init);
1910
1911static void __exit langwell_otg_cleanup(void)
1912{
1913 pci_unregister_driver(&otg_pci_driver);
1914}
1915module_exit(langwell_otg_cleanup);
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 9ed5ea568679..af456b48985f 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -53,6 +53,7 @@ EXPORT_SYMBOL(usb_nop_xceiv_register);
53void usb_nop_xceiv_unregister(void) 53void usb_nop_xceiv_unregister(void)
54{ 54{
55 platform_device_unregister(pd); 55 platform_device_unregister(pd);
56 pd = NULL;
56} 57}
57EXPORT_SYMBOL(usb_nop_xceiv_unregister); 58EXPORT_SYMBOL(usb_nop_xceiv_unregister);
58 59
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 247b61bfb7f4..0e4f2e41ace5 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -169,9 +169,11 @@ static int usb_console_setup(struct console *co, char *options)
169 kfree(tty); 169 kfree(tty);
170 } 170 }
171 } 171 }
172 /* So we know not to kill the hardware on a hangup on this 172 /* Now that any required fake tty operations are completed restore
173 port. We have also bumped the use count by one so it won't go 173 * the tty port count */
174 idle */ 174 --port->port.count;
175 /* The console is special in terms of closing the device so
176 * indicate this port is now acting as a system console. */
175 port->console = 1; 177 port->console = 1;
176 retval = 0; 178 retval = 0;
177 179
@@ -204,7 +206,7 @@ static void usb_console_write(struct console *co,
204 206
205 dbg("%s - port %d, %d byte(s)", __func__, port->number, count); 207 dbg("%s - port %d, %d byte(s)", __func__, port->number, count);
206 208
207 if (!port->port.count) { 209 if (!port->console) {
208 dbg("%s - port not opened", __func__); 210 dbg("%s - port not opened", __func__);
209 return; 211 return;
210 } 212 }
@@ -300,8 +302,7 @@ void usb_serial_console_exit(void)
300{ 302{
301 if (usbcons_info.port) { 303 if (usbcons_info.port) {
302 unregister_console(&usbcons); 304 unregister_console(&usbcons);
303 if (usbcons_info.port->port.count) 305 usbcons_info.port->console = 0;
304 usbcons_info.port->port.count--;
305 usbcons_info.port = NULL; 306 usbcons_info.port = NULL;
306 } 307 }
307} 308}
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 2b9eeda62bfe..985cbcf48bda 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -67,6 +67,8 @@ static struct usb_device_id id_table [] = {
67 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */ 67 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
68 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */ 68 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
69 { USB_DEVICE(0x10C4, 0x0F91) }, /* Vstabi */ 69 { USB_DEVICE(0x10C4, 0x0F91) }, /* Vstabi */
70 { USB_DEVICE(0x10C4, 0x1101) }, /* Arkham Technology DS101 Bus Monitor */
71 { USB_DEVICE(0x10C4, 0x1601) }, /* Arkham Technology DS101 Adapter */
70 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ 72 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
71 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ 73 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
72 { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ 74 { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
@@ -78,6 +80,7 @@ static struct usb_device_id id_table [] = {
78 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ 80 { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
79 { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */ 81 { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */
80 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ 82 { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
83 { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */
81 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ 84 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
82 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 85 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
83 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 86 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
@@ -94,7 +97,9 @@ static struct usb_device_id id_table [] = {
94 { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ 97 { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */
95 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ 98 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */
96 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ 99 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
100 { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */
97 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ 101 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */
102 { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
98 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ 103 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
99 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 104 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
100 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 105 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 9734085fd2fe..59adfe123110 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -1228,8 +1228,8 @@ static void cypress_read_int_callback(struct urb *urb)
1228 /* precursor to disconnect so just go away */ 1228 /* precursor to disconnect so just go away */
1229 return; 1229 return;
1230 case -EPIPE: 1230 case -EPIPE:
1231 usb_clear_halt(port->serial->dev, 0x81); 1231 /* Can't call usb_clear_halt while in_interrupt */
1232 break; 1232 /* FALLS THROUGH */
1233 default: 1233 default:
1234 /* something ugly is going on... */ 1234 /* something ugly is going on... */
1235 dev_err(&urb->dev->dev, 1235 dev_err(&urb->dev->dev,
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 5f08702f672f..b574878c78b2 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -33,6 +33,7 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/smp_lock.h>
36#include <linux/tty.h> 37#include <linux/tty.h>
37#include <linux/tty_driver.h> 38#include <linux/tty_driver.h>
38#include <linux/tty_flip.h> 39#include <linux/tty_flip.h>
@@ -107,6 +108,7 @@ struct ftdi_sio_quirk {
107 108
108static int ftdi_jtag_probe(struct usb_serial *serial); 109static int ftdi_jtag_probe(struct usb_serial *serial);
109static int ftdi_mtxorb_hack_setup(struct usb_serial *serial); 110static int ftdi_mtxorb_hack_setup(struct usb_serial *serial);
111static int ftdi_NDI_device_setup(struct usb_serial *serial);
110static void ftdi_USB_UIRT_setup(struct ftdi_private *priv); 112static void ftdi_USB_UIRT_setup(struct ftdi_private *priv);
111static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv); 113static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv);
112 114
@@ -118,6 +120,10 @@ static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
118 .probe = ftdi_mtxorb_hack_setup, 120 .probe = ftdi_mtxorb_hack_setup,
119}; 121};
120 122
123static struct ftdi_sio_quirk ftdi_NDI_device_quirk = {
124 .probe = ftdi_NDI_device_setup,
125};
126
121static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = { 127static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
122 .port_probe = ftdi_USB_UIRT_setup, 128 .port_probe = ftdi_USB_UIRT_setup,
123}; 129};
@@ -191,6 +197,7 @@ static struct usb_device_id id_table_combined [] = {
191 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, 197 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
192 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, 198 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
193 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, 199 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
200 { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) },
194 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, 201 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) },
195 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, 202 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) },
196 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, 203 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) },
@@ -579,6 +586,9 @@ static struct usb_device_id id_table_combined [] = {
579 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 586 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
580 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 587 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
581 { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) }, 588 { USB_DEVICE(FTDI_VID, FTDI_CCSMACHX_2_PID) },
589 { USB_DEVICE(FTDI_VID, FTDI_CCSLOAD_N_GO_3_PID) },
590 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU64_4_PID) },
591 { USB_DEVICE(FTDI_VID, FTDI_CCSPRIME8_5_PID) },
582 { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 592 { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) },
583 { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) }, 593 { USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) },
584 { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) }, 594 { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) },
@@ -644,6 +654,16 @@ static struct usb_device_id id_table_combined [] = {
644 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) }, 654 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) },
645 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) }, 655 { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) },
646 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 656 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) },
657 { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID),
658 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
659 { USB_DEVICE(FTDI_VID, FTDI_NDI_SPECTRA_SCU_PID),
660 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
661 { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_2_PID),
662 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
663 { USB_DEVICE(FTDI_VID, FTDI_NDI_FUTURE_3_PID),
664 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
665 { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
666 .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
647 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 667 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
648 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 668 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
649 { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, 669 { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) },
@@ -660,6 +680,8 @@ static struct usb_device_id id_table_combined [] = {
660 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 680 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
661 { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID), 681 { USB_DEVICE(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID),
662 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 682 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
683 { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID),
684 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
663 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 685 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
664 { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, 686 { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
665 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) }, 687 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
@@ -667,7 +689,6 @@ static struct usb_device_id id_table_combined [] = {
667 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) }, 689 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
668 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) }, 690 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
669 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) }, 691 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) },
670 { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID) },
671 { USB_DEVICE(ATMEL_VID, STK541_PID) }, 692 { USB_DEVICE(ATMEL_VID, STK541_PID) },
672 { USB_DEVICE(DE_VID, STB_PID) }, 693 { USB_DEVICE(DE_VID, STB_PID) },
673 { USB_DEVICE(DE_VID, WHT_PID) }, 694 { USB_DEVICE(DE_VID, WHT_PID) },
@@ -677,6 +698,7 @@ static struct usb_device_id id_table_combined [] = {
677 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID), 698 { USB_DEVICE(MARVELL_VID, MARVELL_SHEEVAPLUG_PID),
678 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 699 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
679 { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, 700 { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) },
701 { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) },
680 { }, /* Optional parameter entry */ 702 { }, /* Optional parameter entry */
681 { } /* Terminating entry */ 703 { } /* Terminating entry */
682}; 704};
@@ -1023,6 +1045,16 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty,
1023 case FT2232C: /* FT2232C chip */ 1045 case FT2232C: /* FT2232C chip */
1024 case FT232RL: 1046 case FT232RL:
1025 if (baud <= 3000000) { 1047 if (baud <= 3000000) {
1048 __u16 product_id = le16_to_cpu(
1049 port->serial->dev->descriptor.idProduct);
1050 if (((FTDI_NDI_HUC_PID == product_id) ||
1051 (FTDI_NDI_SPECTRA_SCU_PID == product_id) ||
1052 (FTDI_NDI_FUTURE_2_PID == product_id) ||
1053 (FTDI_NDI_FUTURE_3_PID == product_id) ||
1054 (FTDI_NDI_AURORA_SCU_PID == product_id)) &&
1055 (baud == 19200)) {
1056 baud = 1200000;
1057 }
1026 div_value = ftdi_232bm_baud_to_divisor(baud); 1058 div_value = ftdi_232bm_baud_to_divisor(baud);
1027 } else { 1059 } else {
1028 dbg("%s - Baud rate too high!", __func__); 1060 dbg("%s - Baud rate too high!", __func__);
@@ -1554,6 +1586,39 @@ static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv)
1554} /* ftdi_HE_TIRA1_setup */ 1586} /* ftdi_HE_TIRA1_setup */
1555 1587
1556/* 1588/*
1589 * Module parameter to control latency timer for NDI FTDI-based USB devices.
1590 * If this value is not set in modprobe.conf.local its value will be set to 1ms.
1591 */
1592static int ndi_latency_timer = 1;
1593
1594/* Setup for the NDI FTDI-based USB devices, which requires hardwired
1595 * baudrate (19200 gets mapped to 1200000).
1596 *
1597 * Called from usbserial:serial_probe.
1598 */
1599static int ftdi_NDI_device_setup(struct usb_serial *serial)
1600{
1601 struct usb_device *udev = serial->dev;
1602 int latency = ndi_latency_timer;
1603 int rv = 0;
1604 char buf[1];
1605
1606 if (latency == 0)
1607 latency = 1;
1608 if (latency > 99)
1609 latency = 99;
1610
1611 dbg("%s setting NDI device latency to %d", __func__, latency);
1612 dev_info(&udev->dev, "NDI device with a latency value of %d", latency);
1613
1614 rv = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
1615 FTDI_SIO_SET_LATENCY_TIMER_REQUEST,
1616 FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE,
1617 latency, 0, buf, 0, WDR_TIMEOUT);
1618 return 0;
1619}
1620
1621/*
1557 * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko 1622 * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko
1558 * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from 1623 * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from
1559 * userspace using openocd. 1624 * userspace using openocd.
@@ -2622,3 +2687,5 @@ MODULE_PARM_DESC(vendor, "User specified vendor ID (default="
2622module_param(product, ushort, 0); 2687module_param(product, ushort, 0);
2623MODULE_PARM_DESC(product, "User specified product ID"); 2688MODULE_PARM_DESC(product, "User specified product ID");
2624 2689
2690module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR);
2691MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override");
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index f1d440a728a3..24dbd99e87d7 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -506,6 +506,7 @@
506 * 506 *
507 * Armin Laeuger originally sent the PID for the UM 100 module. 507 * Armin Laeuger originally sent the PID for the UM 100 module.
508 */ 508 */
509#define FTDI_R2000KU_TRUE_RNG 0xFB80 /* R2000KU TRUE RNG */
509#define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */ 510#define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */
510#define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */ 511#define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */
511#define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */ 512#define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */
@@ -614,6 +615,9 @@
614#define FTDI_CCSICDU20_0_PID 0xF9D0 615#define FTDI_CCSICDU20_0_PID 0xF9D0
615#define FTDI_CCSICDU40_1_PID 0xF9D1 616#define FTDI_CCSICDU40_1_PID 0xF9D1
616#define FTDI_CCSMACHX_2_PID 0xF9D2 617#define FTDI_CCSMACHX_2_PID 0xF9D2
618#define FTDI_CCSLOAD_N_GO_3_PID 0xF9D3
619#define FTDI_CCSICDU64_4_PID 0xF9D4
620#define FTDI_CCSPRIME8_5_PID 0xF9D5
617 621
618/* Inside Accesso contactless reader (http://www.insidefr.com) */ 622/* Inside Accesso contactless reader (http://www.insidefr.com) */
619#define INSIDE_ACCESSO 0xFAD0 623#define INSIDE_ACCESSO 0xFAD0
@@ -736,6 +740,15 @@
736#define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */ 740#define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */
737 741
738/* 742/*
743 * NDI (www.ndigital.com) product ids
744 */
745#define FTDI_NDI_HUC_PID 0xDA70 /* NDI Host USB Converter */
746#define FTDI_NDI_SPECTRA_SCU_PID 0xDA71 /* NDI Spectra SCU */
747#define FTDI_NDI_FUTURE_2_PID 0xDA72 /* NDI future device #2 */
748#define FTDI_NDI_FUTURE_3_PID 0xDA73 /* NDI future device #3 */
749#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
750
751/*
739 * Posiflex inc retail equipment (http://www.posiflex.com.tw) 752 * Posiflex inc retail equipment (http://www.posiflex.com.tw)
740 */ 753 */
741#define POSIFLEX_VID 0x0d3a /* Vendor ID */ 754#define POSIFLEX_VID 0x0d3a /* Vendor ID */
@@ -848,9 +861,6 @@
848#define TML_VID 0x1B91 /* Vendor ID */ 861#define TML_VID 0x1B91 /* Vendor ID */
849#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */ 862#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
850 863
851/* NDI Polaris System */
852#define FTDI_NDI_HUC_PID 0xDA70
853
854/* Propox devices */ 864/* Propox devices */
855#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 865#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
856 866
@@ -934,6 +944,15 @@
934#define MARVELL_VID 0x9e88 944#define MARVELL_VID 0x9e88
935#define MARVELL_SHEEVAPLUG_PID 0x9e8f 945#define MARVELL_SHEEVAPLUG_PID 0x9e8f
936 946
947#define FTDI_TURTELIZER_PID 0xBDC8 /* JTAG/RS-232 adapter by egnite GmBH */
948
949/*
950 * GN Otometrics (http://www.otometrics.com)
951 * Submitted by Ville Sundberg.
952 */
953#define GN_OTOMETRICS_VID 0x0c33 /* Vendor ID */
954#define AURICAL_USB_PID 0x0010 /* Aurical USB Audiometer */
955
937/* 956/*
938 * BmRequestType: 1100 0000b 957 * BmRequestType: 1100 0000b
939 * bRequest: FTDI_E2_READ 958 * bRequest: FTDI_E2_READ
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index bfc5ce000ef9..ccd4dd340d2c 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -521,7 +521,7 @@ static int mos7720_chars_in_buffer(struct tty_struct *tty)
521 mos7720_port = usb_get_serial_port_data(port); 521 mos7720_port = usb_get_serial_port_data(port);
522 if (mos7720_port == NULL) { 522 if (mos7720_port == NULL) {
523 dbg("%s:leaving ...........", __func__); 523 dbg("%s:leaving ...........", __func__);
524 return -ENODEV; 524 return 0;
525 } 525 }
526 526
527 for (i = 0; i < NUM_URBS; ++i) { 527 for (i = 0; i < NUM_URBS; ++i) {
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index c40f95c1951c..270009afdf77 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -26,6 +26,7 @@
26#include <linux/errno.h> 26#include <linux/errno.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/smp_lock.h>
29#include <linux/tty.h> 30#include <linux/tty.h>
30#include <linux/tty_driver.h> 31#include <linux/tty_driver.h>
31#include <linux/tty_flip.h> 32#include <linux/tty_flip.h>
@@ -123,10 +124,13 @@
123#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 124#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
124#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 125#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
125 126
126/* This driver also supports the ATEN UC2324 device since it is mos7840 based 127/* This driver also supports
127 * - if I knew the device id it would also support the ATEN UC2322 */ 128 * ATEN UC2324 device using Moschip MCS7840
129 * ATEN UC2322 device using Moschip MCS7820
130 */
128#define USB_VENDOR_ID_ATENINTL 0x0557 131#define USB_VENDOR_ID_ATENINTL 0x0557
129#define ATENINTL_DEVICE_ID_UC2324 0x2011 132#define ATENINTL_DEVICE_ID_UC2324 0x2011
133#define ATENINTL_DEVICE_ID_UC2322 0x7820
130 134
131/* Interrupt Routine Defines */ 135/* Interrupt Routine Defines */
132 136
@@ -176,6 +180,7 @@ static struct usb_device_id moschip_port_id_table[] = {
176 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, 180 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
177 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, 181 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
178 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, 182 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
183 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
179 {} /* terminating entry */ 184 {} /* terminating entry */
180}; 185};
181 186
@@ -185,6 +190,7 @@ static __devinitdata struct usb_device_id moschip_id_table_combined[] = {
185 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, 190 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
186 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, 191 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
187 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, 192 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
193 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
188 {} /* terminating entry */ 194 {} /* terminating entry */
189}; 195};
190 196
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 575816e6ba37..c784ddbe7b61 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -66,8 +66,10 @@ static int option_tiocmget(struct tty_struct *tty, struct file *file);
66static int option_tiocmset(struct tty_struct *tty, struct file *file, 66static int option_tiocmset(struct tty_struct *tty, struct file *file,
67 unsigned int set, unsigned int clear); 67 unsigned int set, unsigned int clear);
68static int option_send_setup(struct usb_serial_port *port); 68static int option_send_setup(struct usb_serial_port *port);
69#ifdef CONFIG_PM
69static int option_suspend(struct usb_serial *serial, pm_message_t message); 70static int option_suspend(struct usb_serial *serial, pm_message_t message);
70static int option_resume(struct usb_serial *serial); 71static int option_resume(struct usb_serial *serial);
72#endif
71 73
72/* Vendor and product IDs */ 74/* Vendor and product IDs */
73#define OPTION_VENDOR_ID 0x0AF0 75#define OPTION_VENDOR_ID 0x0AF0
@@ -205,7 +207,9 @@ static int option_resume(struct usb_serial *serial);
205#define NOVATELWIRELESS_PRODUCT_MC727 0x4100 207#define NOVATELWIRELESS_PRODUCT_MC727 0x4100
206#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 208#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
207#define NOVATELWIRELESS_PRODUCT_U727 0x5010 209#define NOVATELWIRELESS_PRODUCT_U727 0x5010
210#define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100
208#define NOVATELWIRELESS_PRODUCT_MC760 0x6000 211#define NOVATELWIRELESS_PRODUCT_MC760 0x6000
212#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002
209 213
210/* FUTURE NOVATEL PRODUCTS */ 214/* FUTURE NOVATEL PRODUCTS */
211#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 215#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001
@@ -258,11 +262,6 @@ static int option_resume(struct usb_serial *serial);
258#define AXESSTEL_VENDOR_ID 0x1726 262#define AXESSTEL_VENDOR_ID 0x1726
259#define AXESSTEL_PRODUCT_MV110H 0x1000 263#define AXESSTEL_PRODUCT_MV110H 0x1000
260 264
261#define ONDA_VENDOR_ID 0x19d2
262#define ONDA_PRODUCT_MSA501HS 0x0001
263#define ONDA_PRODUCT_ET502HS 0x0002
264#define ONDA_PRODUCT_MT503HS 0x2000
265
266#define BANDRICH_VENDOR_ID 0x1A8D 265#define BANDRICH_VENDOR_ID 0x1A8D
267#define BANDRICH_PRODUCT_C100_1 0x1002 266#define BANDRICH_PRODUCT_C100_1 0x1002
268#define BANDRICH_PRODUCT_C100_2 0x1003 267#define BANDRICH_PRODUCT_C100_2 0x1003
@@ -300,6 +299,7 @@ static int option_resume(struct usb_serial *serial);
300#define ZTE_PRODUCT_MF628 0x0015 299#define ZTE_PRODUCT_MF628 0x0015
301#define ZTE_PRODUCT_MF626 0x0031 300#define ZTE_PRODUCT_MF626 0x0031
302#define ZTE_PRODUCT_CDMA_TECH 0xfffe 301#define ZTE_PRODUCT_CDMA_TECH 0xfffe
302#define ZTE_PRODUCT_AC8710 0xfff1
303 303
304#define BENQ_VENDOR_ID 0x04a5 304#define BENQ_VENDOR_ID 0x04a5
305#define BENQ_PRODUCT_H10 0x4068 305#define BENQ_PRODUCT_H10 0x4068
@@ -307,11 +307,25 @@ static int option_resume(struct usb_serial *serial);
307#define DLINK_VENDOR_ID 0x1186 307#define DLINK_VENDOR_ID 0x1186
308#define DLINK_PRODUCT_DWM_652 0x3e04 308#define DLINK_PRODUCT_DWM_652 0x3e04
309 309
310#define QISDA_VENDOR_ID 0x1da5
311#define QISDA_PRODUCT_H21_4512 0x4512
312#define QISDA_PRODUCT_H21_4523 0x4523
313#define QISDA_PRODUCT_H20_4515 0x4515
314#define QISDA_PRODUCT_H20_4519 0x4519
315
310 316
311/* TOSHIBA PRODUCTS */ 317/* TOSHIBA PRODUCTS */
312#define TOSHIBA_VENDOR_ID 0x0930 318#define TOSHIBA_VENDOR_ID 0x0930
313#define TOSHIBA_PRODUCT_HSDPA_MINICARD 0x1302 319#define TOSHIBA_PRODUCT_HSDPA_MINICARD 0x1302
314 320
321#define ALINK_VENDOR_ID 0x1e0e
322#define ALINK_PRODUCT_3GU 0x9200
323
324/* ALCATEL PRODUCTS */
325#define ALCATEL_VENDOR_ID 0x1bbb
326#define ALCATEL_PRODUCT_X060S 0x0000
327
328
315static struct usb_device_id option_ids[] = { 329static struct usb_device_id option_ids[] = {
316 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 330 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
317 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 331 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -428,8 +442,10 @@ static struct usb_device_id option_ids[] = {
428 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ 442 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */
429 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ 443 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
430 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ 444 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
445 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727_NEW) }, /* Novatel MC727/U727/USB727 refresh */
431 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ 446 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */
432 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ 447 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */
448 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */
433 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ 449 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */
434 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ 450 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */
435 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ 451 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */
@@ -463,42 +479,6 @@ static struct usb_device_id option_ids[] = {
463 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 479 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
464 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, 480 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
465 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, 481 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
466 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) },
467 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) },
468 { USB_DEVICE(ONDA_VENDOR_ID, 0x0003) },
469 { USB_DEVICE(ONDA_VENDOR_ID, 0x0004) },
470 { USB_DEVICE(ONDA_VENDOR_ID, 0x0005) },
471 { USB_DEVICE(ONDA_VENDOR_ID, 0x0006) },
472 { USB_DEVICE(ONDA_VENDOR_ID, 0x0007) },
473 { USB_DEVICE(ONDA_VENDOR_ID, 0x0008) },
474 { USB_DEVICE(ONDA_VENDOR_ID, 0x0009) },
475 { USB_DEVICE(ONDA_VENDOR_ID, 0x000a) },
476 { USB_DEVICE(ONDA_VENDOR_ID, 0x000b) },
477 { USB_DEVICE(ONDA_VENDOR_ID, 0x000c) },
478 { USB_DEVICE(ONDA_VENDOR_ID, 0x000d) },
479 { USB_DEVICE(ONDA_VENDOR_ID, 0x000e) },
480 { USB_DEVICE(ONDA_VENDOR_ID, 0x000f) },
481 { USB_DEVICE(ONDA_VENDOR_ID, 0x0010) },
482 { USB_DEVICE(ONDA_VENDOR_ID, 0x0011) },
483 { USB_DEVICE(ONDA_VENDOR_ID, 0x0012) },
484 { USB_DEVICE(ONDA_VENDOR_ID, 0x0013) },
485 { USB_DEVICE(ONDA_VENDOR_ID, 0x0014) },
486 { USB_DEVICE(ONDA_VENDOR_ID, 0x0015) },
487 { USB_DEVICE(ONDA_VENDOR_ID, 0x0016) },
488 { USB_DEVICE(ONDA_VENDOR_ID, 0x0017) },
489 { USB_DEVICE(ONDA_VENDOR_ID, 0x0018) },
490 { USB_DEVICE(ONDA_VENDOR_ID, 0x0019) },
491 { USB_DEVICE(ONDA_VENDOR_ID, 0x0020) },
492 { USB_DEVICE(ONDA_VENDOR_ID, 0x0021) },
493 { USB_DEVICE(ONDA_VENDOR_ID, 0x0022) },
494 { USB_DEVICE(ONDA_VENDOR_ID, 0x0023) },
495 { USB_DEVICE(ONDA_VENDOR_ID, 0x0024) },
496 { USB_DEVICE(ONDA_VENDOR_ID, 0x0025) },
497 { USB_DEVICE(ONDA_VENDOR_ID, 0x0026) },
498 { USB_DEVICE(ONDA_VENDOR_ID, 0x0027) },
499 { USB_DEVICE(ONDA_VENDOR_ID, 0x0028) },
500 { USB_DEVICE(ONDA_VENDOR_ID, 0x0029) },
501 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MT503HS) },
502 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) }, 482 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) },
503 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 483 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
504 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 484 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
@@ -523,14 +503,85 @@ static struct usb_device_id option_ids[] = {
523 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 503 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
524 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ 504 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
525 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, 505 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
526 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622) }, 506 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
527 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, 507 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff) },
528 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, 508 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0003, 0xff, 0xff, 0xff) },
529 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, 509 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0004, 0xff, 0xff, 0xff) },
510 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0005, 0xff, 0xff, 0xff) },
511 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0006, 0xff, 0xff, 0xff) },
512 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0007, 0xff, 0xff, 0xff) },
513 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0008, 0xff, 0xff, 0xff) },
514 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0009, 0xff, 0xff, 0xff) },
515 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000a, 0xff, 0xff, 0xff) },
516 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000b, 0xff, 0xff, 0xff) },
517 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000c, 0xff, 0xff, 0xff) },
518 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000d, 0xff, 0xff, 0xff) },
519 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000e, 0xff, 0xff, 0xff) },
520 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x000f, 0xff, 0xff, 0xff) },
521 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0010, 0xff, 0xff, 0xff) },
522 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) },
523 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) },
524 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
525 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
526 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
527 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) },
528 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0018, 0xff, 0xff, 0xff) },
529 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0019, 0xff, 0xff, 0xff) },
530 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0020, 0xff, 0xff, 0xff) },
531 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0021, 0xff, 0xff, 0xff) },
532 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0022, 0xff, 0xff, 0xff) },
533 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) },
534 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
535 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) },
536 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) },
537 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
538 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
539 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
540 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) },
541 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
542 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
543 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) },
544 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) },
545 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) },
546 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) },
547 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) },
548 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) },
549 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
550 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) },
551 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
552 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) },
553 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
554 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) },
555 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
556 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
557 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) },
558 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) },
559 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
560 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
561 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
562 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
563 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0082, 0xff, 0xff, 0xff) },
564 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
565 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
566 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
567 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
568 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
569 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
570 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
571 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
572 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
573 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
574 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
530 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, 575 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
531 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, 576 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
532 { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */ 577 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) },
578 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) },
579 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) },
580 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) },
533 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ 581 { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
582 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) },
583 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) },
584 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
534 { } /* Terminating entry */ 585 { } /* Terminating entry */
535}; 586};
536MODULE_DEVICE_TABLE(usb, option_ids); 587MODULE_DEVICE_TABLE(usb, option_ids);
@@ -539,8 +590,10 @@ static struct usb_driver option_driver = {
539 .name = "option", 590 .name = "option",
540 .probe = usb_serial_probe, 591 .probe = usb_serial_probe,
541 .disconnect = usb_serial_disconnect, 592 .disconnect = usb_serial_disconnect,
593#ifdef CONFIG_PM
542 .suspend = usb_serial_suspend, 594 .suspend = usb_serial_suspend,
543 .resume = usb_serial_resume, 595 .resume = usb_serial_resume,
596#endif
544 .id_table = option_ids, 597 .id_table = option_ids,
545 .no_dynamic_id = 1, 598 .no_dynamic_id = 1,
546}; 599};
@@ -572,8 +625,10 @@ static struct usb_serial_driver option_1port_device = {
572 .disconnect = option_disconnect, 625 .disconnect = option_disconnect,
573 .release = option_release, 626 .release = option_release,
574 .read_int_callback = option_instat_callback, 627 .read_int_callback = option_instat_callback,
628#ifdef CONFIG_PM
575 .suspend = option_suspend, 629 .suspend = option_suspend,
576 .resume = option_resume, 630 .resume = option_resume,
631#endif
577}; 632};
578 633
579static int debug; 634static int debug;
@@ -732,7 +787,6 @@ static int option_write(struct tty_struct *tty, struct usb_serial_port *port,
732 memcpy(this_urb->transfer_buffer, buf, todo); 787 memcpy(this_urb->transfer_buffer, buf, todo);
733 this_urb->transfer_buffer_length = todo; 788 this_urb->transfer_buffer_length = todo;
734 789
735 this_urb->dev = port->serial->dev;
736 err = usb_submit_urb(this_urb, GFP_ATOMIC); 790 err = usb_submit_urb(this_urb, GFP_ATOMIC);
737 if (err) { 791 if (err) {
738 dbg("usb_submit_urb %p (write bulk) failed " 792 dbg("usb_submit_urb %p (write bulk) failed "
@@ -816,7 +870,6 @@ static void option_instat_callback(struct urb *urb)
816 int status = urb->status; 870 int status = urb->status;
817 struct usb_serial_port *port = urb->context; 871 struct usb_serial_port *port = urb->context;
818 struct option_port_private *portdata = usb_get_serial_port_data(port); 872 struct option_port_private *portdata = usb_get_serial_port_data(port);
819 struct usb_serial *serial = port->serial;
820 873
821 dbg("%s", __func__); 874 dbg("%s", __func__);
822 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); 875 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata);
@@ -860,7 +913,6 @@ static void option_instat_callback(struct urb *urb)
860 913
861 /* Resubmit urb so we continue receiving IRQ data */ 914 /* Resubmit urb so we continue receiving IRQ data */
862 if (status != -ESHUTDOWN && status != -ENOENT) { 915 if (status != -ESHUTDOWN && status != -ENOENT) {
863 urb->dev = serial->dev;
864 err = usb_submit_urb(urb, GFP_ATOMIC); 916 err = usb_submit_urb(urb, GFP_ATOMIC);
865 if (err) 917 if (err)
866 dbg("%s: resubmit intr urb failed. (%d)", 918 dbg("%s: resubmit intr urb failed. (%d)",
@@ -913,7 +965,6 @@ static int option_open(struct tty_struct *tty,
913 struct usb_serial_port *port, struct file *filp) 965 struct usb_serial_port *port, struct file *filp)
914{ 966{
915 struct option_port_private *portdata; 967 struct option_port_private *portdata;
916 struct usb_serial *serial = port->serial;
917 int i, err; 968 int i, err;
918 struct urb *urb; 969 struct urb *urb;
919 970
@@ -921,23 +972,11 @@ static int option_open(struct tty_struct *tty,
921 972
922 dbg("%s", __func__); 973 dbg("%s", __func__);
923 974
924 /* Reset low level data toggle and start reading from endpoints */ 975 /* Start reading from the IN endpoint */
925 for (i = 0; i < N_IN_URB; i++) { 976 for (i = 0; i < N_IN_URB; i++) {
926 urb = portdata->in_urbs[i]; 977 urb = portdata->in_urbs[i];
927 if (!urb) 978 if (!urb)
928 continue; 979 continue;
929 if (urb->dev != serial->dev) {
930 dbg("%s: dev %p != %p", __func__,
931 urb->dev, serial->dev);
932 continue;
933 }
934
935 /*
936 * make sure endpoint data toggle is synchronized with the
937 * device
938 */
939 usb_clear_halt(urb->dev, urb->pipe);
940
941 err = usb_submit_urb(urb, GFP_KERNEL); 980 err = usb_submit_urb(urb, GFP_KERNEL);
942 if (err) { 981 if (err) {
943 dbg("%s: submit urb %d failed (%d) %d", 982 dbg("%s: submit urb %d failed (%d) %d",
@@ -946,16 +985,6 @@ static int option_open(struct tty_struct *tty,
946 } 985 }
947 } 986 }
948 987
949 /* Reset low level data toggle on out endpoints */
950 for (i = 0; i < N_OUT_URB; i++) {
951 urb = portdata->out_urbs[i];
952 if (!urb)
953 continue;
954 urb->dev = serial->dev;
955 /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
956 usb_pipeout(urb->pipe), 0); */
957 }
958
959 option_send_setup(port); 988 option_send_setup(port);
960 989
961 return 0; 990 return 0;
@@ -1195,6 +1224,7 @@ static void option_release(struct usb_serial *serial)
1195 } 1224 }
1196} 1225}
1197 1226
1227#ifdef CONFIG_PM
1198static int option_suspend(struct usb_serial *serial, pm_message_t message) 1228static int option_suspend(struct usb_serial *serial, pm_message_t message)
1199{ 1229{
1200 dbg("%s entered", __func__); 1230 dbg("%s entered", __func__);
@@ -1218,7 +1248,6 @@ static int option_resume(struct usb_serial *serial)
1218 dbg("%s: No interrupt URB for port %d\n", __func__, i); 1248 dbg("%s: No interrupt URB for port %d\n", __func__, i);
1219 continue; 1249 continue;
1220 } 1250 }
1221 port->interrupt_in_urb->dev = serial->dev;
1222 err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); 1251 err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
1223 dbg("Submitted interrupt URB for port %d (result %d)", i, err); 1252 dbg("Submitted interrupt URB for port %d (result %d)", i, err);
1224 if (err < 0) { 1253 if (err < 0) {
@@ -1254,6 +1283,7 @@ static int option_resume(struct usb_serial *serial)
1254 } 1283 }
1255 return 0; 1284 return 0;
1256} 1285}
1286#endif
1257 1287
1258MODULE_AUTHOR(DRIVER_AUTHOR); 1288MODULE_AUTHOR(DRIVER_AUTHOR);
1259MODULE_DESCRIPTION(DRIVER_DESC); 1289MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index efaf59c4f5d0..7d15bfa7c2db 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -94,6 +94,7 @@ static struct usb_device_id id_table [] = {
94 { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, 94 { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) },
95 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, 95 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) },
96 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, 96 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
97 { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) },
97 { } /* Terminating entry */ 98 { } /* Terminating entry */
98}; 99};
99 100
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 1d7a22e3a9fd..12aac7d2462d 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -122,3 +122,7 @@
122/* Hewlett-Packard LD220-HP POS Pole Display */ 122/* Hewlett-Packard LD220-HP POS Pole Display */
123#define HP_VENDOR_ID 0x03f0 123#define HP_VENDOR_ID 0x03f0
124#define HP_LD220_PRODUCT_ID 0x3524 124#define HP_LD220_PRODUCT_ID 0x3524
125
126/* Cressi Edy (diving computer) PC interface */
127#define CRESSI_VENDOR_ID 0x04b8
128#define CRESSI_EDY_PRODUCT_ID 0x0521
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 032f7aeb40a4..f48d05e0acc1 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -181,35 +181,50 @@ static const struct sierra_iface_info direct_ip_interface_blacklist = {
181}; 181};
182 182
183static struct usb_device_id id_table [] = { 183static struct usb_device_id id_table [] = {
184 { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */
185 { USB_DEVICE(0x03F0, 0x1B1D) }, /* HP ev2200 a.k.a MC5720 */
186 { USB_DEVICE(0x03F0, 0x1E1D) }, /* HP hs2300 a.k.a MC8775 */
187
184 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ 188 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
185 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ 189 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
186 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 190 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
187 { USB_DEVICE(0x03f0, 0x1b1d) }, /* HP ev2200 a.k.a MC5720 */
188 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 191 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
189 { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */
190 { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */ 192 { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */
193 { USB_DEVICE(0x1199, 0x0022) }, /* Sierra Wireless EM5725 */
194 { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */
195 { USB_DEVICE(0x1199, 0x0224) }, /* Sierra Wireless MC5727 */
191 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 196 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
192 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 197 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
198 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
193 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ 199 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
194 /* Sierra Wireless C597 */ 200 /* Sierra Wireless C597 */
195 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, 201 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) },
196 /* Sierra Wireless Device */ 202 /* Sierra Wireless T598 */
197 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0025, 0xFF, 0xFF, 0xFF) }, 203 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0025, 0xFF, 0xFF, 0xFF) },
198 { USB_DEVICE(0x1199, 0x0026) }, /* Sierra Wireless Device */ 204 { USB_DEVICE(0x1199, 0x0026) }, /* Sierra Wireless T11 */
199 { USB_DEVICE(0x1199, 0x0027) }, /* Sierra Wireless Device */ 205 { USB_DEVICE(0x1199, 0x0027) }, /* Sierra Wireless AC402 */
200 { USB_DEVICE(0x1199, 0x0028) }, /* Sierra Wireless Device */ 206 { USB_DEVICE(0x1199, 0x0028) }, /* Sierra Wireless MC5728 */
207 { USB_DEVICE(0x1199, 0x0029) }, /* Sierra Wireless Device */
201 208
202 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 209 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
203 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
204 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ 210 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
211 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
212 { USB_DEVICE(0x1199, 0x6805) }, /* Sierra Wireless MC8765 */
213 { USB_DEVICE(0x1199, 0x6808) }, /* Sierra Wireless MC8755 */
214 { USB_DEVICE(0x1199, 0x6809) }, /* Sierra Wireless MC8765 */
205 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ 215 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
206 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Lenovo) */ 216 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 */
207 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */ 217 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */
208 { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */ 218 { USB_DEVICE(0x1199, 0x6816) }, /* Sierra Wireless MC8775 */
209 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ 219 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
210 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */ 220 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */
221 { USB_DEVICE(0x1199, 0x6822) }, /* Sierra Wireless AirCard 875E */
211 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */ 222 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */
212 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */ 223 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */
224 { USB_DEVICE(0x1199, 0x6834) }, /* Sierra Wireless MC8780 */
225 { USB_DEVICE(0x1199, 0x6835) }, /* Sierra Wireless MC8781 */
226 { USB_DEVICE(0x1199, 0x6838) }, /* Sierra Wireless MC8780 */
227 { USB_DEVICE(0x1199, 0x6839) }, /* Sierra Wireless MC8781 */
213 { USB_DEVICE(0x1199, 0x683A) }, /* Sierra Wireless MC8785 */ 228 { USB_DEVICE(0x1199, 0x683A) }, /* Sierra Wireless MC8785 */
214 { USB_DEVICE(0x1199, 0x683B) }, /* Sierra Wireless MC8785 Composite */ 229 { USB_DEVICE(0x1199, 0x683B) }, /* Sierra Wireless MC8785 Composite */
215 /* Sierra Wireless MC8790, MC8791, MC8792 Composite */ 230 /* Sierra Wireless MC8790, MC8791, MC8792 Composite */
@@ -227,16 +242,13 @@ static struct usb_device_id id_table [] = {
227 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */ 242 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */
228 /* Sierra Wireless C885 */ 243 /* Sierra Wireless C885 */
229 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)}, 244 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)},
230 /* Sierra Wireless Device */ 245 /* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */
231 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6890, 0xFF, 0xFF, 0xFF)}, 246 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6890, 0xFF, 0xFF, 0xFF)},
232 /* Sierra Wireless Device */ 247 /* Sierra Wireless C22/C33 */
233 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6891, 0xFF, 0xFF, 0xFF)}, 248 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6891, 0xFF, 0xFF, 0xFF)},
234 /* Sierra Wireless Device */ 249 /* Sierra Wireless HSPA Non-Composite Device */
235 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)}, 250 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
236 251 { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */
237 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
238 { USB_DEVICE(0x0F3D, 0x0112) }, /* Airprime/Sierra PC 5220 */
239
240 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ 252 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */
241 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist 253 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
242 }, 254 },
@@ -814,7 +826,7 @@ static int sierra_startup(struct usb_serial *serial)
814 return 0; 826 return 0;
815} 827}
816 828
817static void sierra_disconnect(struct usb_serial *serial) 829static void sierra_release(struct usb_serial *serial)
818{ 830{
819 int i; 831 int i;
820 struct usb_serial_port *port; 832 struct usb_serial_port *port;
@@ -830,7 +842,6 @@ static void sierra_disconnect(struct usb_serial *serial)
830 if (!portdata) 842 if (!portdata)
831 continue; 843 continue;
832 kfree(portdata); 844 kfree(portdata);
833 usb_set_serial_port_data(port, NULL);
834 } 845 }
835} 846}
836 847
@@ -853,7 +864,7 @@ static struct usb_serial_driver sierra_device = {
853 .tiocmget = sierra_tiocmget, 864 .tiocmget = sierra_tiocmget,
854 .tiocmset = sierra_tiocmset, 865 .tiocmset = sierra_tiocmset,
855 .attach = sierra_startup, 866 .attach = sierra_startup,
856 .disconnect = sierra_disconnect, 867 .release = sierra_release,
857 .read_int_callback = sierra_instat_callback, 868 .read_int_callback = sierra_instat_callback,
858}; 869};
859 870
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 991d8232e376..3bc609fe2242 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -191,7 +191,6 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
191 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, 191 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
192 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, 192 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
193 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, 193 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
194 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
195}; 194};
196 195
197static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = { 196static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = {
@@ -728,7 +727,7 @@ static int ti_write_room(struct tty_struct *tty)
728 dbg("%s - port %d", __func__, port->number); 727 dbg("%s - port %d", __func__, port->number);
729 728
730 if (tport == NULL) 729 if (tport == NULL)
731 return -ENODEV; 730 return 0;
732 731
733 spin_lock_irqsave(&tport->tp_lock, flags); 732 spin_lock_irqsave(&tport->tp_lock, flags);
734 room = ti_buf_space_avail(tport->tp_write_buf); 733 room = ti_buf_space_avail(tport->tp_write_buf);
@@ -749,7 +748,7 @@ static int ti_chars_in_buffer(struct tty_struct *tty)
749 dbg("%s - port %d", __func__, port->number); 748 dbg("%s - port %d", __func__, port->number);
750 749
751 if (tport == NULL) 750 if (tport == NULL)
752 return -ENODEV; 751 return 0;
753 752
754 spin_lock_irqsave(&tport->tp_lock, flags); 753 spin_lock_irqsave(&tport->tp_lock, flags);
755 chars = ti_buf_data_avail(tport->tp_write_buf); 754 chars = ti_buf_data_avail(tport->tp_write_buf);
@@ -1658,7 +1657,7 @@ static int ti_do_download(struct usb_device *dev, int pipe,
1658 u8 cs = 0; 1657 u8 cs = 0;
1659 int done; 1658 int done;
1660 struct ti_firmware_header *header; 1659 struct ti_firmware_header *header;
1661 int status; 1660 int status = 0;
1662 int len; 1661 int len;
1663 1662
1664 for (pos = sizeof(struct ti_firmware_header); pos < size; pos++) 1663 for (pos = sizeof(struct ti_firmware_header); pos < size; pos++)
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index a84216464ca0..99188c92068b 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -21,6 +21,7 @@
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/smp_lock.h>
24#include <linux/tty.h> 25#include <linux/tty.h>
25#include <linux/tty_driver.h> 26#include <linux/tty_driver.h>
26#include <linux/tty_flip.h> 27#include <linux/tty_flip.h>
@@ -31,6 +32,7 @@
31#include <linux/mutex.h> 32#include <linux/mutex.h>
32#include <linux/list.h> 33#include <linux/list.h>
33#include <linux/uaccess.h> 34#include <linux/uaccess.h>
35#include <linux/serial.h>
34#include <linux/usb.h> 36#include <linux/usb.h>
35#include <linux/usb/serial.h> 37#include <linux/usb/serial.h>
36#include "pl2303.h" 38#include "pl2303.h"
@@ -183,6 +185,7 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
183 struct usb_serial_port *port; 185 struct usb_serial_port *port;
184 unsigned int portNumber; 186 unsigned int portNumber;
185 int retval = 0; 187 int retval = 0;
188 int first = 0;
186 189
187 dbg("%s", __func__); 190 dbg("%s", __func__);
188 191
@@ -220,8 +223,9 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
220 tty->driver_data = port; 223 tty->driver_data = port;
221 tty_port_tty_set(&port->port, tty); 224 tty_port_tty_set(&port->port, tty);
222 225
223 if (port->port.count == 1) { 226 /* If the console is attached, the device is already open */
224 227 if (port->port.count == 1 && !port->console) {
228 first = 1;
225 /* lock this module before we call it 229 /* lock this module before we call it
226 * this may fail, which means we must bail out, 230 * this may fail, which means we must bail out,
227 * safe because we are called with BKL held */ 231 * safe because we are called with BKL held */
@@ -244,13 +248,21 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
244 if (retval) 248 if (retval)
245 goto bailout_interface_put; 249 goto bailout_interface_put;
246 mutex_unlock(&serial->disc_mutex); 250 mutex_unlock(&serial->disc_mutex);
251 set_bit(ASYNCB_INITIALIZED, &port->port.flags);
247 } 252 }
248 mutex_unlock(&port->mutex); 253 mutex_unlock(&port->mutex);
249 /* Now do the correct tty layer semantics */ 254 /* Now do the correct tty layer semantics */
250 retval = tty_port_block_til_ready(&port->port, tty, filp); 255 retval = tty_port_block_til_ready(&port->port, tty, filp);
251 if (retval == 0) 256 if (retval == 0) {
257 if (!first)
258 usb_serial_put(serial);
252 return 0; 259 return 0;
253 260 }
261 mutex_lock(&port->mutex);
262 if (first == 0)
263 goto bailout_mutex_unlock;
264 /* Undo the initial port actions */
265 mutex_lock(&serial->disc_mutex);
254bailout_interface_put: 266bailout_interface_put:
255 usb_autopm_put_interface(serial->interface); 267 usb_autopm_put_interface(serial->interface);
256bailout_module_put: 268bailout_module_put:
@@ -338,6 +350,22 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
338 350
339 dbg("%s - port %d", __func__, port->number); 351 dbg("%s - port %d", __func__, port->number);
340 352
353 /* FIXME:
354 This leaves a very narrow race. Really we should do the
355 serial_do_free() on tty->shutdown(), but tty->shutdown can
356 be called from IRQ context and serial_do_free can sleep.
357
358 The right fix is probably to make the tty free (which is rare)
359 and thus tty->shutdown() occur via a work queue and simplify all
360 the drivers that use it.
361 */
362 if (tty_hung_up_p(filp)) {
363 /* serial_hangup already called serial_down at this point.
364 Another user may have already reopened the port but
365 serial_do_free is refcounted */
366 serial_do_free(port);
367 return;
368 }
341 369
342 if (tty_port_close_start(&port->port, tty, filp) == 0) 370 if (tty_port_close_start(&port->port, tty, filp) == 0)
343 return; 371 return;
@@ -353,7 +381,8 @@ static void serial_hangup(struct tty_struct *tty)
353 struct usb_serial_port *port = tty->driver_data; 381 struct usb_serial_port *port = tty->driver_data;
354 serial_do_down(port); 382 serial_do_down(port);
355 tty_port_hangup(&port->port); 383 tty_port_hangup(&port->port);
356 serial_do_free(port); 384 /* We must not free port yet - the USB serial layer depends on it's
385 continued existence */
357} 386}
358 387
359static int serial_write(struct tty_struct *tty, const unsigned char *buf, 388static int serial_write(struct tty_struct *tty, const unsigned char *buf,
@@ -392,7 +421,6 @@ static int serial_chars_in_buffer(struct tty_struct *tty)
392 struct usb_serial_port *port = tty->driver_data; 421 struct usb_serial_port *port = tty->driver_data;
393 dbg("%s = port %d", __func__, port->number); 422 dbg("%s = port %d", __func__, port->number);
394 423
395 WARN_ON(!port->port.count);
396 /* if the device was unplugged then any remaining characters 424 /* if the device was unplugged then any remaining characters
397 fell out of the connector ;) */ 425 fell out of the connector ;) */
398 if (port->serial->disconnected) 426 if (port->serial->disconnected)
diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c
index d41cc0a970f7..773a5cd38c5a 100644
--- a/drivers/usb/storage/option_ms.c
+++ b/drivers/usb/storage/option_ms.c
@@ -118,6 +118,9 @@ static int option_inquiry(struct us_data *us)
118 118
119 result = memcmp(buffer+8, "Option", 6); 119 result = memcmp(buffer+8, "Option", 6);
120 120
121 if (result != 0)
122 result = memcmp(buffer+8, "ZCOPTION", 8);
123
121 /* Read the CSW */ 124 /* Read the CSW */
122 usb_stor_bulk_transfer_buf(us, 125 usb_stor_bulk_transfer_buf(us,
123 us->recv_bulk_pipe, 126 us->recv_bulk_pipe,
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index fcb320217218..e20dc525d177 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -961,7 +961,7 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
961 US_BULK_GET_MAX_LUN, 961 US_BULK_GET_MAX_LUN,
962 USB_DIR_IN | USB_TYPE_CLASS | 962 USB_DIR_IN | USB_TYPE_CLASS |
963 USB_RECIP_INTERFACE, 963 USB_RECIP_INTERFACE,
964 0, us->ifnum, us->iobuf, 1, HZ); 964 0, us->ifnum, us->iobuf, 1, 10*HZ);
965 965
966 US_DEBUGP("GetMaxLUN command result is %d, data is %d\n", 966 US_DEBUGP("GetMaxLUN command result is %d, data is %d\n",
967 result, us->iobuf[0]); 967 result, us->iobuf[0]);
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 41296a6807e2..1999b1834814 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1119,12 +1119,13 @@ config FB_CARILLO_RANCH
1119 1119
1120config FB_INTEL 1120config FB_INTEL
1121 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)" 1121 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)"
1122 depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL 1122 depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EMBEDDED
1123 select FB_MODE_HELPERS 1123 select FB_MODE_HELPERS
1124 select FB_CFB_FILLRECT 1124 select FB_CFB_FILLRECT
1125 select FB_CFB_COPYAREA 1125 select FB_CFB_COPYAREA
1126 select FB_CFB_IMAGEBLIT 1126 select FB_CFB_IMAGEBLIT
1127 select FB_BOOT_VESA_SUPPORT if FB_INTEL = y 1127 select FB_BOOT_VESA_SUPPORT if FB_INTEL = y
1128 depends on !DRM_I915
1128 help 1129 help
1129 This driver supports the on-board graphics built in to the Intel 1130 This driver supports the on-board graphics built in to the Intel
1130 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. 1131 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets.
diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c
index c3ebb6b41ce1..7aed2565c1bd 100644
--- a/drivers/video/backlight/jornada720_bl.c
+++ b/drivers/video/backlight/jornada720_bl.c
@@ -72,7 +72,7 @@ static int jornada_bl_update_status(struct backlight_device *bd)
72 if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) { 72 if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
73 printk(KERN_INFO "bl : failed to set brightness\n"); 73 printk(KERN_INFO "bl : failed to set brightness\n");
74 ret = -ETIMEDOUT; 74 ret = -ETIMEDOUT;
75 goto out 75 goto out;
76 } 76 }
77 77
78 /* at this point we expect that the mcu has accepted 78 /* at this point we expect that the mcu has accepted
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index e641584e212e..887166267443 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -145,6 +145,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
145 struct backlight_device *bl = platform_get_drvdata(pdev); 145 struct backlight_device *bl = platform_get_drvdata(pdev);
146 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); 146 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
147 147
148 if (pb->notify)
149 pb->notify(0);
148 pwm_config(pb->pwm, 0, pb->period); 150 pwm_config(pb->pwm, 0, pb->period);
149 pwm_disable(pb->pwm); 151 pwm_disable(pb->pwm);
150 return 0; 152 return 0;
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 53ea05645ff8..a85c818be945 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -16,7 +16,6 @@
16#include <linux/compat.h> 16#include <linux/compat.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/smp_lock.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/major.h> 20#include <linux/major.h>
22#include <linux/slab.h> 21#include <linux/slab.h>
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 5c1a2c01778f..9ae9cd32bd06 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -256,8 +256,8 @@ static void fix_edid(unsigned char *edid, int fix)
256 256
257static int edid_checksum(unsigned char *edid) 257static int edid_checksum(unsigned char *edid)
258{ 258{
259 unsigned char i, csum = 0, all_null = 0; 259 unsigned char csum = 0, all_null = 0;
260 int err = 0, fix = check_edid(edid); 260 int i, err = 0, fix = check_edid(edid);
261 261
262 if (fix) 262 if (fix)
263 fix_edid(edid, fix); 263 fix_edid(edid, fix);
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 15a0ee6d8e23..30ae3022f633 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -33,6 +33,7 @@
33#include <linux/math64.h> 33#include <linux/math64.h>
34 34
35#include <mach/imxfb.h> 35#include <mach/imxfb.h>
36#include <mach/hardware.h>
36 37
37/* 38/*
38 * Complain if VAR is out of range. 39 * Complain if VAR is out of range.
@@ -129,6 +130,10 @@
129#define LCDISR_EOF (1<<1) 130#define LCDISR_EOF (1<<1)
130#define LCDISR_BOF (1<<0) 131#define LCDISR_BOF (1<<0)
131 132
133/* Used fb-mode. Can be set on kernel command line, therefore file-static. */
134static const char *fb_mode;
135
136
132/* 137/*
133 * These are the bitfields for each 138 * These are the bitfields for each
134 * display depth that we support. 139 * display depth that we support.
@@ -145,10 +150,6 @@ struct imxfb_info {
145 void __iomem *regs; 150 void __iomem *regs;
146 struct clk *clk; 151 struct clk *clk;
147 152
148 u_int max_bpp;
149 u_int max_xres;
150 u_int max_yres;
151
152 /* 153 /*
153 * These are the addresses we mapped 154 * These are the addresses we mapped
154 * the framebuffer memory region to. 155 * the framebuffer memory region to.
@@ -172,6 +173,9 @@ struct imxfb_info {
172 cmap_static:1, 173 cmap_static:1,
173 unused:30; 174 unused:30;
174 175
176 struct imx_fb_videomode *mode;
177 int num_modes;
178
175 void (*lcd_power)(int); 179 void (*lcd_power)(int);
176 void (*backlight_power)(int); 180 void (*backlight_power)(int);
177}; 181};
@@ -298,6 +302,18 @@ static int imxfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
298 return ret; 302 return ret;
299} 303}
300 304
305static const struct imx_fb_videomode *imxfb_find_mode(struct imxfb_info *fbi)
306{
307 struct imx_fb_videomode *m;
308 int i;
309
310 for (i = 0, m = &fbi->mode[0]; i < fbi->num_modes; i++, m++) {
311 if (!strcmp(m->mode.name, fb_mode))
312 return m;
313 }
314 return NULL;
315}
316
301/* 317/*
302 * imxfb_check_var(): 318 * imxfb_check_var():
303 * Round up in the following order: bits_per_pixel, xres, 319 * Round up in the following order: bits_per_pixel, xres,
@@ -308,35 +324,81 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
308{ 324{
309 struct imxfb_info *fbi = info->par; 325 struct imxfb_info *fbi = info->par;
310 struct imxfb_rgb *rgb; 326 struct imxfb_rgb *rgb;
327 const struct imx_fb_videomode *imxfb_mode;
328 unsigned long lcd_clk;
329 unsigned long long tmp;
330 u32 pcr = 0;
311 331
312 if (var->xres < MIN_XRES) 332 if (var->xres < MIN_XRES)
313 var->xres = MIN_XRES; 333 var->xres = MIN_XRES;
314 if (var->yres < MIN_YRES) 334 if (var->yres < MIN_YRES)
315 var->yres = MIN_YRES; 335 var->yres = MIN_YRES;
316 if (var->xres > fbi->max_xres) 336
317 var->xres = fbi->max_xres; 337 imxfb_mode = imxfb_find_mode(fbi);
318 if (var->yres > fbi->max_yres) 338 if (!imxfb_mode)
319 var->yres = fbi->max_yres; 339 return -EINVAL;
320 var->xres_virtual = max(var->xres_virtual, var->xres); 340
321 var->yres_virtual = max(var->yres_virtual, var->yres); 341 var->xres = imxfb_mode->mode.xres;
342 var->yres = imxfb_mode->mode.yres;
343 var->bits_per_pixel = imxfb_mode->bpp;
344 var->pixclock = imxfb_mode->mode.pixclock;
345 var->hsync_len = imxfb_mode->mode.hsync_len;
346 var->left_margin = imxfb_mode->mode.left_margin;
347 var->right_margin = imxfb_mode->mode.right_margin;
348 var->vsync_len = imxfb_mode->mode.vsync_len;
349 var->upper_margin = imxfb_mode->mode.upper_margin;
350 var->lower_margin = imxfb_mode->mode.lower_margin;
351 var->sync = imxfb_mode->mode.sync;
352 var->xres_virtual = max(var->xres_virtual, var->xres);
353 var->yres_virtual = max(var->yres_virtual, var->yres);
322 354
323 pr_debug("var->bits_per_pixel=%d\n", var->bits_per_pixel); 355 pr_debug("var->bits_per_pixel=%d\n", var->bits_per_pixel);
356
357 lcd_clk = clk_get_rate(fbi->clk);
358
359 tmp = var->pixclock * (unsigned long long)lcd_clk;
360
361 do_div(tmp, 1000000);
362
363 if (do_div(tmp, 1000000) > 500000)
364 tmp++;
365
366 pcr = (unsigned int)tmp;
367
368 if (--pcr > 0x3F) {
369 pcr = 0x3F;
370 printk(KERN_WARNING "Must limit pixel clock to %luHz\n",
371 lcd_clk / pcr);
372 }
373
324 switch (var->bits_per_pixel) { 374 switch (var->bits_per_pixel) {
325 case 32: 375 case 32:
376 pcr |= PCR_BPIX_18;
326 rgb = &def_rgb_18; 377 rgb = &def_rgb_18;
327 break; 378 break;
328 case 16: 379 case 16:
329 default: 380 default:
330 if (fbi->pcr & PCR_TFT) 381 if (cpu_is_mx1())
382 pcr |= PCR_BPIX_12;
383 else
384 pcr |= PCR_BPIX_16;
385
386 if (imxfb_mode->pcr & PCR_TFT)
331 rgb = &def_rgb_16_tft; 387 rgb = &def_rgb_16_tft;
332 else 388 else
333 rgb = &def_rgb_16_stn; 389 rgb = &def_rgb_16_stn;
334 break; 390 break;
335 case 8: 391 case 8:
392 pcr |= PCR_BPIX_8;
336 rgb = &def_rgb_8; 393 rgb = &def_rgb_8;
337 break; 394 break;
338 } 395 }
339 396
397 /* add sync polarities */
398 pcr |= imxfb_mode->pcr & ~(0x3f | (7 << 25));
399
400 fbi->pcr = pcr;
401
340 /* 402 /*
341 * Copy the RGB parameters for this display 403 * Copy the RGB parameters for this display
342 * from the machine specific parameters. 404 * from the machine specific parameters.
@@ -393,10 +455,6 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
393 455
394 writel(fbi->screen_dma, fbi->regs + LCDC_SSA); 456 writel(fbi->screen_dma, fbi->regs + LCDC_SSA);
395 457
396 /* physical screen start address */
397 writel(VPW_VPW(fbi->max_xres * fbi->max_bpp / 8 / 4),
398 fbi->regs + LCDC_VPW);
399
400 /* panning offset 0 (0 pixel offset) */ 458 /* panning offset 0 (0 pixel offset) */
401 writel(0x00000000, fbi->regs + LCDC_POS); 459 writel(0x00000000, fbi->regs + LCDC_POS);
402 460
@@ -468,8 +526,6 @@ static struct fb_ops imxfb_ops = {
468static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *info) 526static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *info)
469{ 527{
470 struct imxfb_info *fbi = info->par; 528 struct imxfb_info *fbi = info->par;
471 unsigned int pcr, lcd_clk;
472 unsigned long long tmp;
473 529
474 pr_debug("var: xres=%d hslen=%d lm=%d rm=%d\n", 530 pr_debug("var: xres=%d hslen=%d lm=%d rm=%d\n",
475 var->xres, var->hsync_len, 531 var->xres, var->hsync_len,
@@ -505,6 +561,10 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
505 info->fix.id, var->lower_margin); 561 info->fix.id, var->lower_margin);
506#endif 562#endif
507 563
564 /* physical screen start address */
565 writel(VPW_VPW(var->xres * var->bits_per_pixel / 8 / 4),
566 fbi->regs + LCDC_VPW);
567
508 writel(HCR_H_WIDTH(var->hsync_len - 1) | 568 writel(HCR_H_WIDTH(var->hsync_len - 1) |
509 HCR_H_WAIT_1(var->right_margin - 1) | 569 HCR_H_WAIT_1(var->right_margin - 1) |
510 HCR_H_WAIT_2(var->left_margin - 3), 570 HCR_H_WAIT_2(var->left_margin - 3),
@@ -518,22 +578,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
518 writel(SIZE_XMAX(var->xres) | SIZE_YMAX(var->yres), 578 writel(SIZE_XMAX(var->xres) | SIZE_YMAX(var->yres),
519 fbi->regs + LCDC_SIZE); 579 fbi->regs + LCDC_SIZE);
520 580
521 lcd_clk = clk_get_rate(fbi->clk); 581 writel(fbi->pcr, fbi->regs + LCDC_PCR);
522 tmp = var->pixclock * (unsigned long long)lcd_clk;
523 do_div(tmp, 1000000);
524 if (do_div(tmp, 1000000) > 500000)
525 tmp++;
526 pcr = (unsigned int)tmp;
527 if (--pcr > 0x3F) {
528 pcr = 0x3F;
529 printk(KERN_WARNING "Must limit pixel clock to %uHz\n",
530 lcd_clk / pcr);
531 }
532
533 /* add sync polarities */
534 pcr |= fbi->pcr & ~0x3F;
535
536 writel(pcr, fbi->regs + LCDC_PCR);
537 writel(fbi->pwmr, fbi->regs + LCDC_PWMR); 582 writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
538 writel(fbi->lscr1, fbi->regs + LCDC_LSCR1); 583 writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
539 writel(fbi->dmacr, fbi->regs + LCDC_DMACR); 584 writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
@@ -575,6 +620,8 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
575 struct imx_fb_platform_data *pdata = pdev->dev.platform_data; 620 struct imx_fb_platform_data *pdata = pdev->dev.platform_data;
576 struct fb_info *info = dev_get_drvdata(&pdev->dev); 621 struct fb_info *info = dev_get_drvdata(&pdev->dev);
577 struct imxfb_info *fbi = info->par; 622 struct imxfb_info *fbi = info->par;
623 struct imx_fb_videomode *m;
624 int i;
578 625
579 pr_debug("%s\n",__func__); 626 pr_debug("%s\n",__func__);
580 627
@@ -603,35 +650,18 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
603 info->fbops = &imxfb_ops; 650 info->fbops = &imxfb_ops;
604 info->flags = FBINFO_FLAG_DEFAULT | 651 info->flags = FBINFO_FLAG_DEFAULT |
605 FBINFO_READS_FAST; 652 FBINFO_READS_FAST;
606
607 fbi->max_xres = pdata->xres;
608 info->var.xres = pdata->xres;
609 info->var.xres_virtual = pdata->xres;
610 fbi->max_yres = pdata->yres;
611 info->var.yres = pdata->yres;
612 info->var.yres_virtual = pdata->yres;
613 fbi->max_bpp = pdata->bpp;
614 info->var.bits_per_pixel = pdata->bpp;
615 info->var.nonstd = pdata->nonstd;
616 info->var.pixclock = pdata->pixclock;
617 info->var.hsync_len = pdata->hsync_len;
618 info->var.left_margin = pdata->left_margin;
619 info->var.right_margin = pdata->right_margin;
620 info->var.vsync_len = pdata->vsync_len;
621 info->var.upper_margin = pdata->upper_margin;
622 info->var.lower_margin = pdata->lower_margin;
623 info->var.sync = pdata->sync;
624 info->var.grayscale = pdata->cmap_greyscale; 653 info->var.grayscale = pdata->cmap_greyscale;
625 fbi->cmap_inverse = pdata->cmap_inverse; 654 fbi->cmap_inverse = pdata->cmap_inverse;
626 fbi->cmap_static = pdata->cmap_static; 655 fbi->cmap_static = pdata->cmap_static;
627 fbi->pcr = pdata->pcr;
628 fbi->lscr1 = pdata->lscr1; 656 fbi->lscr1 = pdata->lscr1;
629 fbi->dmacr = pdata->dmacr; 657 fbi->dmacr = pdata->dmacr;
630 fbi->pwmr = pdata->pwmr; 658 fbi->pwmr = pdata->pwmr;
631 fbi->lcd_power = pdata->lcd_power; 659 fbi->lcd_power = pdata->lcd_power;
632 fbi->backlight_power = pdata->backlight_power; 660 fbi->backlight_power = pdata->backlight_power;
633 info->fix.smem_len = fbi->max_xres * fbi->max_yres * 661
634 fbi->max_bpp / 8; 662 for (i = 0, m = &pdata->mode[0]; i < pdata->num_modes; i++, m++)
663 info->fix.smem_len = max_t(size_t, info->fix.smem_len,
664 m->mode.xres * m->mode.yres * m->bpp / 8);
635 665
636 return 0; 666 return 0;
637} 667}
@@ -642,9 +672,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
642 struct fb_info *info; 672 struct fb_info *info;
643 struct imx_fb_platform_data *pdata; 673 struct imx_fb_platform_data *pdata;
644 struct resource *res; 674 struct resource *res;
645 int ret; 675 int ret, i;
646 676
647 printk("i.MX Framebuffer driver\n"); 677 dev_info(&pdev->dev, "i.MX Framebuffer driver\n");
648 678
649 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 679 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
650 if (!res) 680 if (!res)
@@ -662,6 +692,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
662 692
663 fbi = info->par; 693 fbi = info->par;
664 694
695 if (!fb_mode)
696 fb_mode = pdata->mode[0].mode.name;
697
665 platform_set_drvdata(pdev, info); 698 platform_set_drvdata(pdev, info);
666 699
667 ret = imxfb_init_fbinfo(pdev); 700 ret = imxfb_init_fbinfo(pdev);
@@ -684,7 +717,7 @@ static int __init imxfb_probe(struct platform_device *pdev)
684 717
685 fbi->regs = ioremap(res->start, resource_size(res)); 718 fbi->regs = ioremap(res->start, resource_size(res));
686 if (fbi->regs == NULL) { 719 if (fbi->regs == NULL) {
687 printk(KERN_ERR"Cannot map frame buffer registers\n"); 720 dev_err(&pdev->dev, "Cannot map frame buffer registers\n");
688 goto failed_ioremap; 721 goto failed_ioremap;
689 } 722 }
690 723
@@ -719,6 +752,13 @@ static int __init imxfb_probe(struct platform_device *pdev)
719 goto failed_platform_init; 752 goto failed_platform_init;
720 } 753 }
721 754
755 fbi->mode = pdata->mode;
756 fbi->num_modes = pdata->num_modes;
757
758 INIT_LIST_HEAD(&info->modelist);
759 for (i = 0; i < pdata->num_modes; i++)
760 fb_add_videomode(&pdata->mode[i].mode, &info->modelist);
761
722 /* 762 /*
723 * This makes sure that our colour bitfield 763 * This makes sure that our colour bitfield
724 * descriptors are correctly initialised. 764 * descriptors are correctly initialised.
@@ -754,7 +794,7 @@ failed_map:
754failed_getclock: 794failed_getclock:
755 iounmap(fbi->regs); 795 iounmap(fbi->regs);
756failed_ioremap: 796failed_ioremap:
757 release_mem_region(res->start, res->end - res->start); 797 release_mem_region(res->start, resource_size(res));
758failed_req: 798failed_req:
759 kfree(info->pseudo_palette); 799 kfree(info->pseudo_palette);
760failed_init: 800failed_init:
@@ -785,7 +825,7 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
785 framebuffer_release(info); 825 framebuffer_release(info);
786 826
787 iounmap(fbi->regs); 827 iounmap(fbi->regs);
788 release_mem_region(res->start, res->end - res->start + 1); 828 release_mem_region(res->start, resource_size(res));
789 clk_disable(fbi->clk); 829 clk_disable(fbi->clk);
790 clk_put(fbi->clk); 830 clk_put(fbi->clk);
791 831
@@ -811,8 +851,34 @@ static struct platform_driver imxfb_driver = {
811 }, 851 },
812}; 852};
813 853
854static int imxfb_setup(void)
855{
856#ifndef MODULE
857 char *opt, *options = NULL;
858
859 if (fb_get_options("imxfb", &options))
860 return -ENODEV;
861
862 if (!options || !*options)
863 return 0;
864
865 while ((opt = strsep(&options, ",")) != NULL) {
866 if (!*opt)
867 continue;
868 else
869 fb_mode = opt;
870 }
871#endif
872 return 0;
873}
874
814int __init imxfb_init(void) 875int __init imxfb_init(void)
815{ 876{
877 int ret = imxfb_setup();
878
879 if (ret < 0)
880 return ret;
881
816 return platform_driver_probe(&imxfb_driver, imxfb_probe); 882 return platform_driver_probe(&imxfb_driver, imxfb_probe);
817} 883}
818 884
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 4ea99bfc37b4..8862233d57b6 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1254,7 +1254,7 @@ static struct fb_ops omapfb_ops = {
1254static ssize_t omapfb_show_caps_num(struct device *dev, 1254static ssize_t omapfb_show_caps_num(struct device *dev,
1255 struct device_attribute *attr, char *buf) 1255 struct device_attribute *attr, char *buf)
1256{ 1256{
1257 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1257 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1258 int plane; 1258 int plane;
1259 size_t size; 1259 size_t size;
1260 struct omapfb_caps caps; 1260 struct omapfb_caps caps;
@@ -1274,7 +1274,7 @@ static ssize_t omapfb_show_caps_num(struct device *dev,
1274static ssize_t omapfb_show_caps_text(struct device *dev, 1274static ssize_t omapfb_show_caps_text(struct device *dev,
1275 struct device_attribute *attr, char *buf) 1275 struct device_attribute *attr, char *buf)
1276{ 1276{
1277 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1277 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1278 int i; 1278 int i;
1279 struct omapfb_caps caps; 1279 struct omapfb_caps caps;
1280 int plane; 1280 int plane;
@@ -1321,7 +1321,7 @@ static DEVICE_ATTR(caps_text, 0444, omapfb_show_caps_text, NULL);
1321static ssize_t omapfb_show_panel_name(struct device *dev, 1321static ssize_t omapfb_show_panel_name(struct device *dev,
1322 struct device_attribute *attr, char *buf) 1322 struct device_attribute *attr, char *buf)
1323{ 1323{
1324 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1324 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1325 1325
1326 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name); 1326 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);
1327} 1327}
@@ -1330,7 +1330,7 @@ static ssize_t omapfb_show_bklight_level(struct device *dev,
1330 struct device_attribute *attr, 1330 struct device_attribute *attr,
1331 char *buf) 1331 char *buf)
1332{ 1332{
1333 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1333 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1334 int r; 1334 int r;
1335 1335
1336 if (fbdev->panel->get_bklight_level) { 1336 if (fbdev->panel->get_bklight_level) {
@@ -1345,7 +1345,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
1345 struct device_attribute *attr, 1345 struct device_attribute *attr,
1346 const char *buf, size_t size) 1346 const char *buf, size_t size)
1347{ 1347{
1348 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1348 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1349 int r; 1349 int r;
1350 1350
1351 if (fbdev->panel->set_bklight_level) { 1351 if (fbdev->panel->set_bklight_level) {
@@ -1364,7 +1364,7 @@ static ssize_t omapfb_store_bklight_level(struct device *dev,
1364static ssize_t omapfb_show_bklight_max(struct device *dev, 1364static ssize_t omapfb_show_bklight_max(struct device *dev,
1365 struct device_attribute *attr, char *buf) 1365 struct device_attribute *attr, char *buf)
1366{ 1366{
1367 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1367 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1368 int r; 1368 int r;
1369 1369
1370 if (fbdev->panel->get_bklight_level) { 1370 if (fbdev->panel->get_bklight_level) {
@@ -1397,7 +1397,7 @@ static struct attribute_group panel_attr_grp = {
1397static ssize_t omapfb_show_ctrl_name(struct device *dev, 1397static ssize_t omapfb_show_ctrl_name(struct device *dev,
1398 struct device_attribute *attr, char *buf) 1398 struct device_attribute *attr, char *buf)
1399{ 1399{
1400 struct omapfb_device *fbdev = (struct omapfb_device *)dev->driver_data; 1400 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1401 1401
1402 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name); 1402 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name);
1403} 1403}
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index bb63c07e13de..5a72083dc67c 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -964,7 +964,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
964 struct s3c_fb *sfb = platform_get_drvdata(pdev); 964 struct s3c_fb *sfb = platform_get_drvdata(pdev);
965 int win; 965 int win;
966 966
967 for (win = 0; win <= S3C_FB_MAX_WIN; win++) 967 for (win = 0; win < S3C_FB_MAX_WIN; win++)
968 if (sfb->windows[win]) 968 if (sfb->windows[win])
969 s3c_fb_release_win(sfb, sfb->windows[win]); 969 s3c_fb_release_win(sfb, sfb->windows[win]);
970 970
@@ -988,7 +988,7 @@ static int s3c_fb_suspend(struct platform_device *pdev, pm_message_t state)
988 struct s3c_fb_win *win; 988 struct s3c_fb_win *win;
989 int win_no; 989 int win_no;
990 990
991 for (win_no = S3C_FB_MAX_WIN; win_no >= 0; win_no--) { 991 for (win_no = S3C_FB_MAX_WIN - 1; win_no >= 0; win_no--) {
992 win = sfb->windows[win_no]; 992 win = sfb->windows[win_no];
993 if (!win) 993 if (!win)
994 continue; 994 continue;
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 193c8f0e5cc5..248e00ec4dc1 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -52,8 +52,10 @@ struct virtio_pci_device
52 char (*msix_names)[256]; 52 char (*msix_names)[256];
53 /* Number of available vectors */ 53 /* Number of available vectors */
54 unsigned msix_vectors; 54 unsigned msix_vectors;
55 /* Vectors allocated */ 55 /* Vectors allocated, excluding per-vq vectors if any */
56 unsigned msix_used_vectors; 56 unsigned msix_used_vectors;
57 /* Whether we have vector per vq */
58 bool per_vq_vectors;
57}; 59};
58 60
59/* Constants for MSI-X */ 61/* Constants for MSI-X */
@@ -258,7 +260,6 @@ static void vp_free_vectors(struct virtio_device *vdev)
258 260
259 for (i = 0; i < vp_dev->msix_used_vectors; ++i) 261 for (i = 0; i < vp_dev->msix_used_vectors; ++i)
260 free_irq(vp_dev->msix_entries[i].vector, vp_dev); 262 free_irq(vp_dev->msix_entries[i].vector, vp_dev);
261 vp_dev->msix_used_vectors = 0;
262 263
263 if (vp_dev->msix_enabled) { 264 if (vp_dev->msix_enabled) {
264 /* Disable the vector used for configuration */ 265 /* Disable the vector used for configuration */
@@ -267,80 +268,77 @@ static void vp_free_vectors(struct virtio_device *vdev)
267 /* Flush the write out to device */ 268 /* Flush the write out to device */
268 ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR); 269 ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
269 270
270 vp_dev->msix_enabled = 0;
271 pci_disable_msix(vp_dev->pci_dev); 271 pci_disable_msix(vp_dev->pci_dev);
272 vp_dev->msix_enabled = 0;
273 vp_dev->msix_vectors = 0;
272 } 274 }
273}
274 275
275static int vp_enable_msix(struct pci_dev *dev, struct msix_entry *entries, 276 vp_dev->msix_used_vectors = 0;
276 int *options, int noptions) 277 kfree(vp_dev->msix_names);
277{ 278 vp_dev->msix_names = NULL;
278 int i; 279 kfree(vp_dev->msix_entries);
279 for (i = 0; i < noptions; ++i) 280 vp_dev->msix_entries = NULL;
280 if (!pci_enable_msix(dev, entries, options[i]))
281 return options[i];
282 return -EBUSY;
283} 281}
284 282
285static int vp_request_vectors(struct virtio_device *vdev, unsigned max_vqs) 283static int vp_request_vectors(struct virtio_device *vdev, int nvectors,
284 bool per_vq_vectors)
286{ 285{
287 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 286 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
288 const char *name = dev_name(&vp_dev->vdev.dev); 287 const char *name = dev_name(&vp_dev->vdev.dev);
289 unsigned i, v; 288 unsigned i, v;
290 int err = -ENOMEM; 289 int err = -ENOMEM;
291 /* We want at most one vector per queue and one for config changes. 290
292 * Fallback to separate vectors for config and a shared for queues. 291 if (!nvectors) {
293 * Finally fall back to regular interrupts. */ 292 /* Can't allocate MSI-X vectors, use regular interrupt */
294 int options[] = { max_vqs + 1, 2 }; 293 vp_dev->msix_vectors = 0;
295 int nvectors = max(options[0], options[1]); 294 err = request_irq(vp_dev->pci_dev->irq, vp_interrupt,
295 IRQF_SHARED, name, vp_dev);
296 if (err)
297 return err;
298 vp_dev->intx_enabled = 1;
299 return 0;
300 }
296 301
297 vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries, 302 vp_dev->msix_entries = kmalloc(nvectors * sizeof *vp_dev->msix_entries,
298 GFP_KERNEL); 303 GFP_KERNEL);
299 if (!vp_dev->msix_entries) 304 if (!vp_dev->msix_entries)
300 goto error_entries; 305 goto error;
301 vp_dev->msix_names = kmalloc(nvectors * sizeof *vp_dev->msix_names, 306 vp_dev->msix_names = kmalloc(nvectors * sizeof *vp_dev->msix_names,
302 GFP_KERNEL); 307 GFP_KERNEL);
303 if (!vp_dev->msix_names) 308 if (!vp_dev->msix_names)
304 goto error_names; 309 goto error;
305 310
306 for (i = 0; i < nvectors; ++i) 311 for (i = 0; i < nvectors; ++i)
307 vp_dev->msix_entries[i].entry = i; 312 vp_dev->msix_entries[i].entry = i;
308 313
309 err = vp_enable_msix(vp_dev->pci_dev, vp_dev->msix_entries, 314 err = pci_enable_msix(vp_dev->pci_dev, vp_dev->msix_entries, nvectors);
310 options, ARRAY_SIZE(options)); 315 if (err > 0)
311 if (err < 0) { 316 err = -ENOSPC;
312 /* Can't allocate enough MSI-X vectors, use regular interrupt */ 317 if (err)
313 vp_dev->msix_vectors = 0; 318 goto error;
314 err = request_irq(vp_dev->pci_dev->irq, vp_interrupt, 319 vp_dev->msix_vectors = nvectors;
315 IRQF_SHARED, name, vp_dev); 320 vp_dev->msix_enabled = 1;
316 if (err) 321
317 goto error_irq; 322 /* Set the vector used for configuration */
318 vp_dev->intx_enabled = 1; 323 v = vp_dev->msix_used_vectors;
319 } else { 324 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names,
320 vp_dev->msix_vectors = err; 325 "%s-config", name);
321 vp_dev->msix_enabled = 1; 326 err = request_irq(vp_dev->msix_entries[v].vector,
322 327 vp_config_changed, 0, vp_dev->msix_names[v],
323 /* Set the vector used for configuration */ 328 vp_dev);
324 v = vp_dev->msix_used_vectors; 329 if (err)
325 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, 330 goto error;
326 "%s-config", name); 331 ++vp_dev->msix_used_vectors;
327 err = request_irq(vp_dev->msix_entries[v].vector, 332
328 vp_config_changed, 0, vp_dev->msix_names[v], 333 iowrite16(v, vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
329 vp_dev); 334 /* Verify we had enough resources to assign the vector */
330 if (err) 335 v = ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
331 goto error_irq; 336 if (v == VIRTIO_MSI_NO_VECTOR) {
332 ++vp_dev->msix_used_vectors; 337 err = -EBUSY;
333 338 goto error;
334 iowrite16(v, vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
335 /* Verify we had enough resources to assign the vector */
336 v = ioread16(vp_dev->ioaddr + VIRTIO_MSI_CONFIG_VECTOR);
337 if (v == VIRTIO_MSI_NO_VECTOR) {
338 err = -EBUSY;
339 goto error_irq;
340 }
341 } 339 }
342 340
343 if (vp_dev->msix_vectors && vp_dev->msix_vectors != max_vqs + 1) { 341 if (!per_vq_vectors) {
344 /* Shared vector for all VQs */ 342 /* Shared vector for all VQs */
345 v = vp_dev->msix_used_vectors; 343 v = vp_dev->msix_used_vectors;
346 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names, 344 snprintf(vp_dev->msix_names[v], sizeof *vp_dev->msix_names,
@@ -349,28 +347,25 @@ static int vp_request_vectors(struct virtio_device *vdev, unsigned max_vqs)
349 vp_vring_interrupt, 0, vp_dev->msix_names[v], 347 vp_vring_interrupt, 0, vp_dev->msix_names[v],
350 vp_dev); 348 vp_dev);
351 if (err) 349 if (err)
352 goto error_irq; 350 goto error;
353 ++vp_dev->msix_used_vectors; 351 ++vp_dev->msix_used_vectors;
354 } 352 }
355 return 0; 353 return 0;
356error_irq: 354error:
357 vp_free_vectors(vdev); 355 vp_free_vectors(vdev);
358 kfree(vp_dev->msix_names);
359error_names:
360 kfree(vp_dev->msix_entries);
361error_entries:
362 return err; 356 return err;
363} 357}
364 358
365static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, 359static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
366 void (*callback)(struct virtqueue *vq), 360 void (*callback)(struct virtqueue *vq),
367 const char *name) 361 const char *name,
362 u16 vector)
368{ 363{
369 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 364 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
370 struct virtio_pci_vq_info *info; 365 struct virtio_pci_vq_info *info;
371 struct virtqueue *vq; 366 struct virtqueue *vq;
372 unsigned long flags, size; 367 unsigned long flags, size;
373 u16 num, vector; 368 u16 num;
374 int err; 369 int err;
375 370
376 /* Select the queue we're interested in */ 371 /* Select the queue we're interested in */
@@ -389,7 +384,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
389 384
390 info->queue_index = index; 385 info->queue_index = index;
391 info->num = num; 386 info->num = num;
392 info->vector = VIRTIO_MSI_NO_VECTOR; 387 info->vector = vector;
393 388
394 size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN)); 389 size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
395 info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO); 390 info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
@@ -413,22 +408,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
413 vq->priv = info; 408 vq->priv = info;
414 info->vq = vq; 409 info->vq = vq;
415 410
416 /* allocate per-vq vector if available and necessary */ 411 if (vector != VIRTIO_MSI_NO_VECTOR) {
417 if (callback && vp_dev->msix_used_vectors < vp_dev->msix_vectors) {
418 vector = vp_dev->msix_used_vectors;
419 snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
420 "%s-%s", dev_name(&vp_dev->vdev.dev), name);
421 err = request_irq(vp_dev->msix_entries[vector].vector,
422 vring_interrupt, 0,
423 vp_dev->msix_names[vector], vq);
424 if (err)
425 goto out_request_irq;
426 info->vector = vector;
427 ++vp_dev->msix_used_vectors;
428 } else
429 vector = VP_MSIX_VQ_VECTOR;
430
431 if (callback && vp_dev->msix_enabled) {
432 iowrite16(vector, vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR); 412 iowrite16(vector, vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR);
433 vector = ioread16(vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR); 413 vector = ioread16(vp_dev->ioaddr + VIRTIO_MSI_QUEUE_VECTOR);
434 if (vector == VIRTIO_MSI_NO_VECTOR) { 414 if (vector == VIRTIO_MSI_NO_VECTOR) {
@@ -444,11 +424,6 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
444 return vq; 424 return vq;
445 425
446out_assign: 426out_assign:
447 if (info->vector != VIRTIO_MSI_NO_VECTOR) {
448 free_irq(vp_dev->msix_entries[info->vector].vector, vq);
449 --vp_dev->msix_used_vectors;
450 }
451out_request_irq:
452 vring_del_virtqueue(vq); 427 vring_del_virtqueue(vq);
453out_activate_queue: 428out_activate_queue:
454 iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); 429 iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
@@ -462,12 +437,13 @@ static void vp_del_vq(struct virtqueue *vq)
462{ 437{
463 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); 438 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
464 struct virtio_pci_vq_info *info = vq->priv; 439 struct virtio_pci_vq_info *info = vq->priv;
465 unsigned long size; 440 unsigned long flags, size;
466 441
467 iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); 442 spin_lock_irqsave(&vp_dev->lock, flags);
443 list_del(&info->node);
444 spin_unlock_irqrestore(&vp_dev->lock, flags);
468 445
469 if (info->vector != VIRTIO_MSI_NO_VECTOR) 446 iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
470 free_irq(vp_dev->msix_entries[info->vector].vector, vq);
471 447
472 if (vp_dev->msix_enabled) { 448 if (vp_dev->msix_enabled) {
473 iowrite16(VIRTIO_MSI_NO_VECTOR, 449 iowrite16(VIRTIO_MSI_NO_VECTOR,
@@ -489,36 +465,62 @@ static void vp_del_vq(struct virtqueue *vq)
489/* the config->del_vqs() implementation */ 465/* the config->del_vqs() implementation */
490static void vp_del_vqs(struct virtio_device *vdev) 466static void vp_del_vqs(struct virtio_device *vdev)
491{ 467{
468 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
492 struct virtqueue *vq, *n; 469 struct virtqueue *vq, *n;
470 struct virtio_pci_vq_info *info;
493 471
494 list_for_each_entry_safe(vq, n, &vdev->vqs, list) 472 list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
473 info = vq->priv;
474 if (vp_dev->per_vq_vectors)
475 free_irq(vp_dev->msix_entries[info->vector].vector, vq);
495 vp_del_vq(vq); 476 vp_del_vq(vq);
477 }
478 vp_dev->per_vq_vectors = false;
496 479
497 vp_free_vectors(vdev); 480 vp_free_vectors(vdev);
498} 481}
499 482
500/* the config->find_vqs() implementation */ 483static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs,
501static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, 484 struct virtqueue *vqs[],
502 struct virtqueue *vqs[], 485 vq_callback_t *callbacks[],
503 vq_callback_t *callbacks[], 486 const char *names[],
504 const char *names[]) 487 int nvectors,
488 bool per_vq_vectors)
505{ 489{
506 int vectors = 0; 490 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
507 int i, err; 491 u16 vector;
508 492 int i, err, allocated_vectors;
509 /* How many vectors would we like? */
510 for (i = 0; i < nvqs; ++i)
511 if (callbacks[i])
512 ++vectors;
513 493
514 err = vp_request_vectors(vdev, vectors); 494 err = vp_request_vectors(vdev, nvectors, per_vq_vectors);
515 if (err) 495 if (err)
516 goto error_request; 496 goto error_request;
517 497
498 vp_dev->per_vq_vectors = per_vq_vectors;
499 allocated_vectors = vp_dev->msix_used_vectors;
518 for (i = 0; i < nvqs; ++i) { 500 for (i = 0; i < nvqs; ++i) {
519 vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i]); 501 if (!callbacks[i] || !vp_dev->msix_enabled)
520 if (IS_ERR(vqs[i])) 502 vector = VIRTIO_MSI_NO_VECTOR;
503 else if (vp_dev->per_vq_vectors)
504 vector = allocated_vectors++;
505 else
506 vector = VP_MSIX_VQ_VECTOR;
507 vqs[i] = vp_find_vq(vdev, i, callbacks[i], names[i], vector);
508 if (IS_ERR(vqs[i])) {
509 err = PTR_ERR(vqs[i]);
521 goto error_find; 510 goto error_find;
511 }
512 /* allocate per-vq irq if available and necessary */
513 if (vp_dev->per_vq_vectors && vector != VIRTIO_MSI_NO_VECTOR) {
514 snprintf(vp_dev->msix_names[vector], sizeof *vp_dev->msix_names,
515 "%s-%s", dev_name(&vp_dev->vdev.dev), names[i]);
516 err = request_irq(vp_dev->msix_entries[vector].vector,
517 vring_interrupt, 0,
518 vp_dev->msix_names[vector], vqs[i]);
519 if (err) {
520 vp_del_vq(vqs[i]);
521 goto error_find;
522 }
523 }
522 } 524 }
523 return 0; 525 return 0;
524 526
@@ -526,7 +528,37 @@ error_find:
526 vp_del_vqs(vdev); 528 vp_del_vqs(vdev);
527 529
528error_request: 530error_request:
529 return PTR_ERR(vqs[i]); 531 return err;
532}
533
534/* the config->find_vqs() implementation */
535static int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
536 struct virtqueue *vqs[],
537 vq_callback_t *callbacks[],
538 const char *names[])
539{
540 int vectors = 0;
541 int i, uninitialized_var(err);
542
543 /* How many vectors would we like? */
544 for (i = 0; i < nvqs; ++i)
545 if (callbacks[i])
546 ++vectors;
547
548 /* We want at most one vector per queue and one for config changes. */
549 err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
550 vectors + 1, true);
551 if (!err)
552 return 0;
553 /* Fallback to separate vectors for config and a shared for queues. */
554 err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
555 2, false);
556 if (!err)
557 return 0;
558 /* Finally fall back to regular interrupts. */
559 err = vp_try_to_find_vqs(vdev, nvqs, vqs, callbacks, names,
560 0, false);
561 return err;
530} 562}
531 563
532static struct virtio_config_ops virtio_pci_config_ops = { 564static struct virtio_config_ops virtio_pci_config_ops = {
@@ -669,7 +701,7 @@ static int __init virtio_pci_init(void)
669 701
670 err = pci_register_driver(&virtio_pci_driver); 702 err = pci_register_driver(&virtio_pci_driver);
671 if (err) 703 if (err)
672 device_unregister(virtio_pci_root); 704 root_device_unregister(virtio_pci_root);
673 705
674 return err; 706 return err;
675} 707}
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c
index e9f950ff86ea..cdd55e0d09f8 100644
--- a/drivers/watchdog/ep93xx_wdt.c
+++ b/drivers/watchdog/ep93xx_wdt.c
@@ -29,6 +29,7 @@
29#include <linux/watchdog.h> 29#include <linux/watchdog.h>
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/uaccess.h> 31#include <linux/uaccess.h>
32#include <linux/io.h>
32#include <mach/hardware.h> 33#include <mach/hardware.h>
33 34
34#define WDT_VERSION "0.3" 35#define WDT_VERSION "0.3"
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 6fcb1e7095cf..92828281a30b 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -57,7 +57,7 @@ static int v9fs_vfs_readpage(struct file *filp, struct page *page)
57 buffer = kmap(page); 57 buffer = kmap(page);
58 offset = page_offset(page); 58 offset = page_offset(page);
59 59
60 retval = v9fs_file_readn(filp, buffer, NULL, offset, PAGE_CACHE_SIZE); 60 retval = v9fs_file_readn(filp, buffer, NULL, PAGE_CACHE_SIZE, offset);
61 if (retval < 0) 61 if (retval < 0)
62 goto done; 62 goto done;
63 63
diff --git a/fs/Kconfig b/fs/Kconfig
index a97263be6a91..0e7da7bb5d93 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -186,32 +186,7 @@ source "fs/romfs/Kconfig"
186source "fs/sysv/Kconfig" 186source "fs/sysv/Kconfig"
187source "fs/ufs/Kconfig" 187source "fs/ufs/Kconfig"
188source "fs/exofs/Kconfig" 188source "fs/exofs/Kconfig"
189 189source "fs/nilfs2/Kconfig"
190config NILFS2_FS
191 tristate "NILFS2 file system support (EXPERIMENTAL)"
192 depends on BLOCK && EXPERIMENTAL
193 select CRC32
194 help
195 NILFS2 is a log-structured file system (LFS) supporting continuous
196 snapshotting. In addition to versioning capability of the entire
197 file system, users can even restore files mistakenly overwritten or
198 destroyed just a few seconds ago. Since this file system can keep
199 consistency like conventional LFS, it achieves quick recovery after
200 system crashes.
201
202 NILFS2 creates a number of checkpoints every few seconds or per
203 synchronous write basis (unless there is no change). Users can
204 select significant versions among continuously created checkpoints,
205 and can change them into snapshots which will be preserved for long
206 periods until they are changed back to checkpoints. Each
207 snapshot is mountable as a read-only file system concurrently with
208 its writable mount, and this feature is convenient for online backup.
209
210 Some features including atime, extended attributes, and POSIX ACLs,
211 are not supported yet.
212
213 To compile this file system support as a module, choose M here: the
214 module will be called nilfs2. If unsure, say N.
215 190
216endif # MISC_FILESYSTEMS 191endif # MISC_FILESYSTEMS
217 192
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index aad92f0a1048..6910a98bd73c 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -13,6 +13,7 @@
13#include <linux/parser.h> 13#include <linux/parser.h>
14#include <linux/mount.h> 14#include <linux/mount.h>
15#include <linux/seq_file.h> 15#include <linux/seq_file.h>
16#include <linux/smp_lock.h>
16#include <linux/statfs.h> 17#include <linux/statfs.h>
17#include "adfs.h" 18#include "adfs.h"
18#include "dir_f.h" 19#include "dir_f.h"
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 9bd757774c9e..88067f36e5e7 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -564,7 +564,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
564static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd) 564static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
565{ 565{
566 struct afs_vnode *vnode, *dir; 566 struct afs_vnode *vnode, *dir;
567 struct afs_fid fid; 567 struct afs_fid uninitialized_var(fid);
568 struct dentry *parent; 568 struct dentry *parent;
569 struct key *key; 569 struct key *key;
570 void *dir_version; 570 void *dir_version;
diff --git a/fs/afs/super.c b/fs/afs/super.c
index ad0514d0115f..e1ea1c240b6a 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -18,6 +18,7 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/smp_lock.h>
21#include <linux/fs.h> 22#include <linux/fs.h>
22#include <linux/pagemap.h> 23#include <linux/pagemap.h>
23#include <linux/parser.h> 24#include <linux/parser.h>
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index f3da2eb51f56..00bf8fcb245f 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -19,7 +19,6 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/compat.h> 20#include <linux/compat.h>
21#include <linux/syscalls.h> 21#include <linux/syscalls.h>
22#include <linux/smp_lock.h>
23#include <linux/magic.h> 22#include <linux/magic.h>
24#include <linux/dcache.h> 23#include <linux/dcache.h>
25#include <linux/uaccess.h> 24#include <linux/uaccess.h>
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index 54bd07d44e68..1e41aadb1068 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -8,7 +8,6 @@
8#include <linux/time.h> 8#include <linux/time.h>
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/smp_lock.h>
12#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
13#include <linux/sched.h> 12#include <linux/sched.h>
14#include "bfs.h" 13#include "bfs.h"
diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index 6a021265f018..88b9a3ff44e4 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -11,7 +11,6 @@
11 11
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/buffer_head.h> 13#include <linux/buffer_head.h>
14#include <linux/smp_lock.h>
15#include "bfs.h" 14#include "bfs.h"
16 15
17#undef DEBUG 16#undef DEBUG
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 3a6d4fb2a329..94dfda24c06e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -564,6 +564,16 @@ struct block_device *bdget(dev_t dev)
564 564
565EXPORT_SYMBOL(bdget); 565EXPORT_SYMBOL(bdget);
566 566
567/**
568 * bdgrab -- Grab a reference to an already referenced block device
569 * @bdev: Block device to grab a reference to.
570 */
571struct block_device *bdgrab(struct block_device *bdev)
572{
573 atomic_inc(&bdev->bd_inode->i_count);
574 return bdev;
575}
576
567long nr_blockdev_pages(void) 577long nr_blockdev_pages(void)
568{ 578{
569 struct block_device *bdev; 579 struct block_device *bdev;
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index 6e4f6c50a120..019e8af449ab 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -424,11 +424,11 @@ int btrfs_requeue_work(struct btrfs_work *work)
424 * list 424 * list
425 */ 425 */
426 if (worker->idle) { 426 if (worker->idle) {
427 spin_lock_irqsave(&worker->workers->lock, flags); 427 spin_lock(&worker->workers->lock);
428 worker->idle = 0; 428 worker->idle = 0;
429 list_move_tail(&worker->worker_list, 429 list_move_tail(&worker->worker_list,
430 &worker->workers->worker_list); 430 &worker->workers->worker_list);
431 spin_unlock_irqrestore(&worker->workers->lock, flags); 431 spin_unlock(&worker->workers->lock);
432 } 432 }
433 if (!worker->working) { 433 if (!worker->working) {
434 wake = 1; 434 wake = 1;
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index de1e2fd32080..9d8ba4d54a37 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -26,7 +26,6 @@
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/smp_lock.h>
30#include <linux/backing-dev.h> 29#include <linux/backing-dev.h>
31#include <linux/mpage.h> 30#include <linux/mpage.h>
32#include <linux/swap.h> 31#include <linux/swap.h>
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 60a45f3a4e91..3fdcc0512d3a 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -557,19 +557,7 @@ static int comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2)
557 557
558 btrfs_disk_key_to_cpu(&k1, disk); 558 btrfs_disk_key_to_cpu(&k1, disk);
559 559
560 if (k1.objectid > k2->objectid) 560 return btrfs_comp_cpu_keys(&k1, k2);
561 return 1;
562 if (k1.objectid < k2->objectid)
563 return -1;
564 if (k1.type > k2->type)
565 return 1;
566 if (k1.type < k2->type)
567 return -1;
568 if (k1.offset > k2->offset)
569 return 1;
570 if (k1.offset < k2->offset)
571 return -1;
572 return 0;
573} 561}
574 562
575/* 563/*
@@ -1052,9 +1040,6 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
1052 BTRFS_NODEPTRS_PER_BLOCK(root) / 4) 1040 BTRFS_NODEPTRS_PER_BLOCK(root) / 4)
1053 return 0; 1041 return 0;
1054 1042
1055 if (btrfs_header_nritems(mid) > 2)
1056 return 0;
1057
1058 if (btrfs_header_nritems(mid) < 2) 1043 if (btrfs_header_nritems(mid) < 2)
1059 err_on_enospc = 1; 1044 err_on_enospc = 1;
1060 1045
@@ -1701,6 +1686,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
1701 struct extent_buffer *b; 1686 struct extent_buffer *b;
1702 int slot; 1687 int slot;
1703 int ret; 1688 int ret;
1689 int err;
1704 int level; 1690 int level;
1705 int lowest_unlock = 1; 1691 int lowest_unlock = 1;
1706 u8 lowest_level = 0; 1692 u8 lowest_level = 0;
@@ -1737,8 +1723,6 @@ again:
1737 p->locks[level] = 1; 1723 p->locks[level] = 1;
1738 1724
1739 if (cow) { 1725 if (cow) {
1740 int wret;
1741
1742 /* 1726 /*
1743 * if we don't really need to cow this block 1727 * if we don't really need to cow this block
1744 * then we don't want to set the path blocking, 1728 * then we don't want to set the path blocking,
@@ -1749,12 +1733,12 @@ again:
1749 1733
1750 btrfs_set_path_blocking(p); 1734 btrfs_set_path_blocking(p);
1751 1735
1752 wret = btrfs_cow_block(trans, root, b, 1736 err = btrfs_cow_block(trans, root, b,
1753 p->nodes[level + 1], 1737 p->nodes[level + 1],
1754 p->slots[level + 1], &b); 1738 p->slots[level + 1], &b);
1755 if (wret) { 1739 if (err) {
1756 free_extent_buffer(b); 1740 free_extent_buffer(b);
1757 ret = wret; 1741 ret = err;
1758 goto done; 1742 goto done;
1759 } 1743 }
1760 } 1744 }
@@ -1793,41 +1777,45 @@ cow_done:
1793 ret = bin_search(b, key, level, &slot); 1777 ret = bin_search(b, key, level, &slot);
1794 1778
1795 if (level != 0) { 1779 if (level != 0) {
1796 if (ret && slot > 0) 1780 int dec = 0;
1781 if (ret && slot > 0) {
1782 dec = 1;
1797 slot -= 1; 1783 slot -= 1;
1784 }
1798 p->slots[level] = slot; 1785 p->slots[level] = slot;
1799 ret = setup_nodes_for_search(trans, root, p, b, level, 1786 err = setup_nodes_for_search(trans, root, p, b, level,
1800 ins_len); 1787 ins_len);
1801 if (ret == -EAGAIN) 1788 if (err == -EAGAIN)
1802 goto again; 1789 goto again;
1803 else if (ret) 1790 if (err) {
1791 ret = err;
1804 goto done; 1792 goto done;
1793 }
1805 b = p->nodes[level]; 1794 b = p->nodes[level];
1806 slot = p->slots[level]; 1795 slot = p->slots[level];
1807 1796
1808 unlock_up(p, level, lowest_unlock); 1797 unlock_up(p, level, lowest_unlock);
1809 1798
1810 /* this is only true while dropping a snapshot */
1811 if (level == lowest_level) { 1799 if (level == lowest_level) {
1812 ret = 0; 1800 if (dec)
1801 p->slots[level]++;
1813 goto done; 1802 goto done;
1814 } 1803 }
1815 1804
1816 ret = read_block_for_search(trans, root, p, 1805 err = read_block_for_search(trans, root, p,
1817 &b, level, slot, key); 1806 &b, level, slot, key);
1818 if (ret == -EAGAIN) 1807 if (err == -EAGAIN)
1819 goto again; 1808 goto again;
1820 1809 if (err) {
1821 if (ret == -EIO) 1810 ret = err;
1822 goto done; 1811 goto done;
1812 }
1823 1813
1824 if (!p->skip_locking) { 1814 if (!p->skip_locking) {
1825 int lret;
1826
1827 btrfs_clear_path_blocking(p, NULL); 1815 btrfs_clear_path_blocking(p, NULL);
1828 lret = btrfs_try_spin_lock(b); 1816 err = btrfs_try_spin_lock(b);
1829 1817
1830 if (!lret) { 1818 if (!err) {
1831 btrfs_set_path_blocking(p); 1819 btrfs_set_path_blocking(p);
1832 btrfs_tree_lock(b); 1820 btrfs_tree_lock(b);
1833 btrfs_clear_path_blocking(p, b); 1821 btrfs_clear_path_blocking(p, b);
@@ -1837,16 +1825,14 @@ cow_done:
1837 p->slots[level] = slot; 1825 p->slots[level] = slot;
1838 if (ins_len > 0 && 1826 if (ins_len > 0 &&
1839 btrfs_leaf_free_space(root, b) < ins_len) { 1827 btrfs_leaf_free_space(root, b) < ins_len) {
1840 int sret;
1841
1842 btrfs_set_path_blocking(p); 1828 btrfs_set_path_blocking(p);
1843 sret = split_leaf(trans, root, key, 1829 err = split_leaf(trans, root, key,
1844 p, ins_len, ret == 0); 1830 p, ins_len, ret == 0);
1845 btrfs_clear_path_blocking(p, NULL); 1831 btrfs_clear_path_blocking(p, NULL);
1846 1832
1847 BUG_ON(sret > 0); 1833 BUG_ON(err > 0);
1848 if (sret) { 1834 if (err) {
1849 ret = sret; 1835 ret = err;
1850 goto done; 1836 goto done;
1851 } 1837 }
1852 } 1838 }
@@ -3807,7 +3793,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
3807 } 3793 }
3808 3794
3809 /* delete the leaf if it is mostly empty */ 3795 /* delete the leaf if it is mostly empty */
3810 if (used < BTRFS_LEAF_DATA_SIZE(root) / 2) { 3796 if (used < BTRFS_LEAF_DATA_SIZE(root) / 3) {
3811 /* push_leaf_left fixes the path. 3797 /* push_leaf_left fixes the path.
3812 * make sure the path still points to our leaf 3798 * make sure the path still points to our leaf
3813 * for possible call to del_ptr below 3799 * for possible call to del_ptr below
@@ -4042,10 +4028,9 @@ out:
4042 * calling this function. 4028 * calling this function.
4043 */ 4029 */
4044int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path, 4030int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
4045 struct btrfs_key *key, int lowest_level, 4031 struct btrfs_key *key, int level,
4046 int cache_only, u64 min_trans) 4032 int cache_only, u64 min_trans)
4047{ 4033{
4048 int level = lowest_level;
4049 int slot; 4034 int slot;
4050 struct extent_buffer *c; 4035 struct extent_buffer *c;
4051 4036
@@ -4058,11 +4043,40 @@ int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
4058 c = path->nodes[level]; 4043 c = path->nodes[level];
4059next: 4044next:
4060 if (slot >= btrfs_header_nritems(c)) { 4045 if (slot >= btrfs_header_nritems(c)) {
4061 level++; 4046 int ret;
4062 if (level == BTRFS_MAX_LEVEL) 4047 int orig_lowest;
4048 struct btrfs_key cur_key;
4049 if (level + 1 >= BTRFS_MAX_LEVEL ||
4050 !path->nodes[level + 1])
4063 return 1; 4051 return 1;
4064 continue; 4052
4053 if (path->locks[level + 1]) {
4054 level++;
4055 continue;
4056 }
4057
4058 slot = btrfs_header_nritems(c) - 1;
4059 if (level == 0)
4060 btrfs_item_key_to_cpu(c, &cur_key, slot);
4061 else
4062 btrfs_node_key_to_cpu(c, &cur_key, slot);
4063
4064 orig_lowest = path->lowest_level;
4065 btrfs_release_path(root, path);
4066 path->lowest_level = level;
4067 ret = btrfs_search_slot(NULL, root, &cur_key, path,
4068 0, 0);
4069 path->lowest_level = orig_lowest;
4070 if (ret < 0)
4071 return ret;
4072
4073 c = path->nodes[level];
4074 slot = path->slots[level];
4075 if (ret == 0)
4076 slot++;
4077 goto next;
4065 } 4078 }
4079
4066 if (level == 0) 4080 if (level == 0)
4067 btrfs_item_key_to_cpu(c, key, slot); 4081 btrfs_item_key_to_cpu(c, key, slot);
4068 else { 4082 else {
@@ -4146,7 +4160,8 @@ again:
4146 * advance the path if there are now more items available. 4160 * advance the path if there are now more items available.
4147 */ 4161 */
4148 if (nritems > 0 && path->slots[0] < nritems - 1) { 4162 if (nritems > 0 && path->slots[0] < nritems - 1) {
4149 path->slots[0]++; 4163 if (ret == 0)
4164 path->slots[0]++;
4150 ret = 0; 4165 ret = 0;
4151 goto done; 4166 goto done;
4152 } 4167 }
@@ -4278,10 +4293,10 @@ int btrfs_previous_item(struct btrfs_root *root,
4278 path->slots[0]--; 4293 path->slots[0]--;
4279 4294
4280 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); 4295 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
4281 if (found_key.type == type)
4282 return 0;
4283 if (found_key.objectid < min_objectid) 4296 if (found_key.objectid < min_objectid)
4284 break; 4297 break;
4298 if (found_key.type == type)
4299 return 0;
4285 if (found_key.objectid == min_objectid && 4300 if (found_key.objectid == min_objectid &&
4286 found_key.type < type) 4301 found_key.type < type)
4287 break; 4302 break;
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 98a873838717..837435ce84ca 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -481,7 +481,7 @@ struct btrfs_shared_data_ref {
481 481
482struct btrfs_extent_inline_ref { 482struct btrfs_extent_inline_ref {
483 u8 type; 483 u8 type;
484 u64 offset; 484 __le64 offset;
485} __attribute__ ((__packed__)); 485} __attribute__ ((__packed__));
486 486
487/* old style backrefs item */ 487/* old style backrefs item */
@@ -689,6 +689,7 @@ struct btrfs_space_info {
689 struct list_head block_groups; 689 struct list_head block_groups;
690 spinlock_t lock; 690 spinlock_t lock;
691 struct rw_semaphore groups_sem; 691 struct rw_semaphore groups_sem;
692 atomic_t caching_threads;
692}; 693};
693 694
694/* 695/*
@@ -707,6 +708,9 @@ struct btrfs_free_cluster {
707 /* first extent starting offset */ 708 /* first extent starting offset */
708 u64 window_start; 709 u64 window_start;
709 710
711 /* if this cluster simply points at a bitmap in the block group */
712 bool points_to_bitmap;
713
710 struct btrfs_block_group_cache *block_group; 714 struct btrfs_block_group_cache *block_group;
711 /* 715 /*
712 * when a cluster is allocated from a block group, we put the 716 * when a cluster is allocated from a block group, we put the
@@ -716,24 +720,37 @@ struct btrfs_free_cluster {
716 struct list_head block_group_list; 720 struct list_head block_group_list;
717}; 721};
718 722
723enum btrfs_caching_type {
724 BTRFS_CACHE_NO = 0,
725 BTRFS_CACHE_STARTED = 1,
726 BTRFS_CACHE_FINISHED = 2,
727};
728
719struct btrfs_block_group_cache { 729struct btrfs_block_group_cache {
720 struct btrfs_key key; 730 struct btrfs_key key;
721 struct btrfs_block_group_item item; 731 struct btrfs_block_group_item item;
732 struct btrfs_fs_info *fs_info;
722 spinlock_t lock; 733 spinlock_t lock;
723 struct mutex cache_mutex;
724 u64 pinned; 734 u64 pinned;
725 u64 reserved; 735 u64 reserved;
726 u64 flags; 736 u64 flags;
727 int cached; 737 u64 sectorsize;
738 int extents_thresh;
739 int free_extents;
740 int total_bitmaps;
728 int ro; 741 int ro;
729 int dirty; 742 int dirty;
730 743
744 /* cache tracking stuff */
745 wait_queue_head_t caching_q;
746 int cached;
747
731 struct btrfs_space_info *space_info; 748 struct btrfs_space_info *space_info;
732 749
733 /* free space cache stuff */ 750 /* free space cache stuff */
734 spinlock_t tree_lock; 751 spinlock_t tree_lock;
735 struct rb_root free_space_bytes;
736 struct rb_root free_space_offset; 752 struct rb_root free_space_offset;
753 u64 free_space;
737 754
738 /* block group cache stuff */ 755 /* block group cache stuff */
739 struct rb_node cache_node; 756 struct rb_node cache_node;
@@ -808,6 +825,7 @@ struct btrfs_fs_info {
808 struct mutex drop_mutex; 825 struct mutex drop_mutex;
809 struct mutex volume_mutex; 826 struct mutex volume_mutex;
810 struct mutex tree_reloc_mutex; 827 struct mutex tree_reloc_mutex;
828 struct rw_semaphore extent_commit_sem;
811 829
812 /* 830 /*
813 * this protects the ordered operations list only while we are 831 * this protects the ordered operations list only while we are
@@ -1988,6 +2006,7 @@ void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode,
1988 u64 bytes); 2006 u64 bytes);
1989void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode, 2007void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode,
1990 u64 bytes); 2008 u64 bytes);
2009void btrfs_free_pinned_extents(struct btrfs_fs_info *info);
1991/* ctree.c */ 2010/* ctree.c */
1992int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, 2011int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key,
1993 int level, int *slot); 2012 int level, int *slot);
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index d28d29c95f7c..e83be2e4602c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1639,6 +1639,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1639 mutex_init(&fs_info->cleaner_mutex); 1639 mutex_init(&fs_info->cleaner_mutex);
1640 mutex_init(&fs_info->volume_mutex); 1640 mutex_init(&fs_info->volume_mutex);
1641 mutex_init(&fs_info->tree_reloc_mutex); 1641 mutex_init(&fs_info->tree_reloc_mutex);
1642 init_rwsem(&fs_info->extent_commit_sem);
1642 1643
1643 btrfs_init_free_cluster(&fs_info->meta_alloc_cluster); 1644 btrfs_init_free_cluster(&fs_info->meta_alloc_cluster);
1644 btrfs_init_free_cluster(&fs_info->data_alloc_cluster); 1645 btrfs_init_free_cluster(&fs_info->data_alloc_cluster);
@@ -1799,6 +1800,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1799 btrfs_super_chunk_root(disk_super), 1800 btrfs_super_chunk_root(disk_super),
1800 blocksize, generation); 1801 blocksize, generation);
1801 BUG_ON(!chunk_root->node); 1802 BUG_ON(!chunk_root->node);
1803 if (!test_bit(EXTENT_BUFFER_UPTODATE, &chunk_root->node->bflags)) {
1804 printk(KERN_WARNING "btrfs: failed to read chunk root on %s\n",
1805 sb->s_id);
1806 goto fail_chunk_root;
1807 }
1802 btrfs_set_root_node(&chunk_root->root_item, chunk_root->node); 1808 btrfs_set_root_node(&chunk_root->root_item, chunk_root->node);
1803 chunk_root->commit_root = btrfs_root_node(chunk_root); 1809 chunk_root->commit_root = btrfs_root_node(chunk_root);
1804 1810
@@ -1826,6 +1832,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1826 blocksize, generation); 1832 blocksize, generation);
1827 if (!tree_root->node) 1833 if (!tree_root->node)
1828 goto fail_chunk_root; 1834 goto fail_chunk_root;
1835 if (!test_bit(EXTENT_BUFFER_UPTODATE, &tree_root->node->bflags)) {
1836 printk(KERN_WARNING "btrfs: failed to read tree root on %s\n",
1837 sb->s_id);
1838 goto fail_tree_root;
1839 }
1829 btrfs_set_root_node(&tree_root->root_item, tree_root->node); 1840 btrfs_set_root_node(&tree_root->root_item, tree_root->node);
1830 tree_root->commit_root = btrfs_root_node(tree_root); 1841 tree_root->commit_root = btrfs_root_node(tree_root);
1831 1842
@@ -2322,6 +2333,9 @@ int close_ctree(struct btrfs_root *root)
2322 printk(KERN_ERR "btrfs: commit super ret %d\n", ret); 2333 printk(KERN_ERR "btrfs: commit super ret %d\n", ret);
2323 } 2334 }
2324 2335
2336 fs_info->closing = 2;
2337 smp_mb();
2338
2325 if (fs_info->delalloc_bytes) { 2339 if (fs_info->delalloc_bytes) {
2326 printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n", 2340 printk(KERN_INFO "btrfs: at unmount delalloc count %llu\n",
2327 (unsigned long long)fs_info->delalloc_bytes); 2341 (unsigned long long)fs_info->delalloc_bytes);
@@ -2343,6 +2357,7 @@ int close_ctree(struct btrfs_root *root)
2343 free_extent_buffer(root->fs_info->csum_root->commit_root); 2357 free_extent_buffer(root->fs_info->csum_root->commit_root);
2344 2358
2345 btrfs_free_block_groups(root->fs_info); 2359 btrfs_free_block_groups(root->fs_info);
2360 btrfs_free_pinned_extents(root->fs_info);
2346 2361
2347 del_fs_roots(fs_info); 2362 del_fs_roots(fs_info);
2348 2363
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a5aca3997d42..dc84daee6bc4 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -21,6 +21,7 @@
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <linux/sort.h> 22#include <linux/sort.h>
23#include <linux/rcupdate.h> 23#include <linux/rcupdate.h>
24#include <linux/kthread.h>
24#include "compat.h" 25#include "compat.h"
25#include "hash.h" 26#include "hash.h"
26#include "ctree.h" 27#include "ctree.h"
@@ -61,6 +62,13 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans,
61 struct btrfs_root *extent_root, u64 alloc_bytes, 62 struct btrfs_root *extent_root, u64 alloc_bytes,
62 u64 flags, int force); 63 u64 flags, int force);
63 64
65static noinline int
66block_group_cache_done(struct btrfs_block_group_cache *cache)
67{
68 smp_mb();
69 return cache->cached == BTRFS_CACHE_FINISHED;
70}
71
64static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits) 72static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits)
65{ 73{
66 return (cache->flags & bits) == bits; 74 return (cache->flags & bits) == bits;
@@ -146,20 +154,70 @@ block_group_cache_tree_search(struct btrfs_fs_info *info, u64 bytenr,
146} 154}
147 155
148/* 156/*
157 * We always set EXTENT_LOCKED for the super mirror extents so we don't
158 * overwrite them, so those bits need to be unset. Also, if we are unmounting
159 * with pinned extents still sitting there because we had a block group caching,
160 * we need to clear those now, since we are done.
161 */
162void btrfs_free_pinned_extents(struct btrfs_fs_info *info)
163{
164 u64 start, end, last = 0;
165 int ret;
166
167 while (1) {
168 ret = find_first_extent_bit(&info->pinned_extents, last,
169 &start, &end,
170 EXTENT_LOCKED|EXTENT_DIRTY);
171 if (ret)
172 break;
173
174 clear_extent_bits(&info->pinned_extents, start, end,
175 EXTENT_LOCKED|EXTENT_DIRTY, GFP_NOFS);
176 last = end+1;
177 }
178}
179
180static int remove_sb_from_cache(struct btrfs_root *root,
181 struct btrfs_block_group_cache *cache)
182{
183 struct btrfs_fs_info *fs_info = root->fs_info;
184 u64 bytenr;
185 u64 *logical;
186 int stripe_len;
187 int i, nr, ret;
188
189 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
190 bytenr = btrfs_sb_offset(i);
191 ret = btrfs_rmap_block(&root->fs_info->mapping_tree,
192 cache->key.objectid, bytenr,
193 0, &logical, &nr, &stripe_len);
194 BUG_ON(ret);
195 while (nr--) {
196 try_lock_extent(&fs_info->pinned_extents,
197 logical[nr],
198 logical[nr] + stripe_len - 1, GFP_NOFS);
199 }
200 kfree(logical);
201 }
202
203 return 0;
204}
205
206/*
149 * this is only called by cache_block_group, since we could have freed extents 207 * this is only called by cache_block_group, since we could have freed extents
150 * we need to check the pinned_extents for any extents that can't be used yet 208 * we need to check the pinned_extents for any extents that can't be used yet
151 * since their free space will be released as soon as the transaction commits. 209 * since their free space will be released as soon as the transaction commits.
152 */ 210 */
153static int add_new_free_space(struct btrfs_block_group_cache *block_group, 211static u64 add_new_free_space(struct btrfs_block_group_cache *block_group,
154 struct btrfs_fs_info *info, u64 start, u64 end) 212 struct btrfs_fs_info *info, u64 start, u64 end)
155{ 213{
156 u64 extent_start, extent_end, size; 214 u64 extent_start, extent_end, size, total_added = 0;
157 int ret; 215 int ret;
158 216
159 while (start < end) { 217 while (start < end) {
160 ret = find_first_extent_bit(&info->pinned_extents, start, 218 ret = find_first_extent_bit(&info->pinned_extents, start,
161 &extent_start, &extent_end, 219 &extent_start, &extent_end,
162 EXTENT_DIRTY); 220 EXTENT_DIRTY|EXTENT_LOCKED);
163 if (ret) 221 if (ret)
164 break; 222 break;
165 223
@@ -167,6 +225,7 @@ static int add_new_free_space(struct btrfs_block_group_cache *block_group,
167 start = extent_end + 1; 225 start = extent_end + 1;
168 } else if (extent_start > start && extent_start < end) { 226 } else if (extent_start > start && extent_start < end) {
169 size = extent_start - start; 227 size = extent_start - start;
228 total_added += size;
170 ret = btrfs_add_free_space(block_group, start, 229 ret = btrfs_add_free_space(block_group, start,
171 size); 230 size);
172 BUG_ON(ret); 231 BUG_ON(ret);
@@ -178,84 +237,80 @@ static int add_new_free_space(struct btrfs_block_group_cache *block_group,
178 237
179 if (start < end) { 238 if (start < end) {
180 size = end - start; 239 size = end - start;
240 total_added += size;
181 ret = btrfs_add_free_space(block_group, start, size); 241 ret = btrfs_add_free_space(block_group, start, size);
182 BUG_ON(ret); 242 BUG_ON(ret);
183 } 243 }
184 244
185 return 0; 245 return total_added;
186} 246}
187 247
188static int remove_sb_from_cache(struct btrfs_root *root, 248static int caching_kthread(void *data)
189 struct btrfs_block_group_cache *cache)
190{
191 u64 bytenr;
192 u64 *logical;
193 int stripe_len;
194 int i, nr, ret;
195
196 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
197 bytenr = btrfs_sb_offset(i);
198 ret = btrfs_rmap_block(&root->fs_info->mapping_tree,
199 cache->key.objectid, bytenr, 0,
200 &logical, &nr, &stripe_len);
201 BUG_ON(ret);
202 while (nr--) {
203 btrfs_remove_free_space(cache, logical[nr],
204 stripe_len);
205 }
206 kfree(logical);
207 }
208 return 0;
209}
210
211static int cache_block_group(struct btrfs_root *root,
212 struct btrfs_block_group_cache *block_group)
213{ 249{
250 struct btrfs_block_group_cache *block_group = data;
251 struct btrfs_fs_info *fs_info = block_group->fs_info;
252 u64 last = 0;
214 struct btrfs_path *path; 253 struct btrfs_path *path;
215 int ret = 0; 254 int ret = 0;
216 struct btrfs_key key; 255 struct btrfs_key key;
217 struct extent_buffer *leaf; 256 struct extent_buffer *leaf;
218 int slot; 257 int slot;
219 u64 last; 258 u64 total_found = 0;
220
221 if (!block_group)
222 return 0;
223 259
224 root = root->fs_info->extent_root; 260 BUG_ON(!fs_info);
225
226 if (block_group->cached)
227 return 0;
228 261
229 path = btrfs_alloc_path(); 262 path = btrfs_alloc_path();
230 if (!path) 263 if (!path)
231 return -ENOMEM; 264 return -ENOMEM;
232 265
233 path->reada = 2; 266 atomic_inc(&block_group->space_info->caching_threads);
267 last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET);
268again:
269 /* need to make sure the commit_root doesn't disappear */
270 down_read(&fs_info->extent_commit_sem);
271
234 /* 272 /*
235 * we get into deadlocks with paths held by callers of this function. 273 * We don't want to deadlock with somebody trying to allocate a new
236 * since the alloc_mutex is protecting things right now, just 274 * extent for the extent root while also trying to search the extent
237 * skip the locking here 275 * root to add free space. So we skip locking and search the commit
276 * root, since its read-only
238 */ 277 */
239 path->skip_locking = 1; 278 path->skip_locking = 1;
240 last = max_t(u64, block_group->key.objectid, BTRFS_SUPER_INFO_OFFSET); 279 path->search_commit_root = 1;
280 path->reada = 2;
281
241 key.objectid = last; 282 key.objectid = last;
242 key.offset = 0; 283 key.offset = 0;
243 btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); 284 btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY);
244 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); 285 ret = btrfs_search_slot(NULL, fs_info->extent_root, &key, path, 0, 0);
245 if (ret < 0) 286 if (ret < 0)
246 goto err; 287 goto err;
247 288
248 while (1) { 289 while (1) {
290 smp_mb();
291 if (block_group->fs_info->closing > 1) {
292 last = (u64)-1;
293 break;
294 }
295
249 leaf = path->nodes[0]; 296 leaf = path->nodes[0];
250 slot = path->slots[0]; 297 slot = path->slots[0];
251 if (slot >= btrfs_header_nritems(leaf)) { 298 if (slot >= btrfs_header_nritems(leaf)) {
252 ret = btrfs_next_leaf(root, path); 299 ret = btrfs_next_leaf(fs_info->extent_root, path);
253 if (ret < 0) 300 if (ret < 0)
254 goto err; 301 goto err;
255 if (ret == 0) 302 else if (ret)
256 continue;
257 else
258 break; 303 break;
304
305 if (need_resched() ||
306 btrfs_transaction_in_commit(fs_info)) {
307 btrfs_release_path(fs_info->extent_root, path);
308 up_read(&fs_info->extent_commit_sem);
309 schedule_timeout(1);
310 goto again;
311 }
312
313 continue;
259 } 314 }
260 btrfs_item_key_to_cpu(leaf, &key, slot); 315 btrfs_item_key_to_cpu(leaf, &key, slot);
261 if (key.objectid < block_group->key.objectid) 316 if (key.objectid < block_group->key.objectid)
@@ -266,24 +321,59 @@ static int cache_block_group(struct btrfs_root *root,
266 break; 321 break;
267 322
268 if (btrfs_key_type(&key) == BTRFS_EXTENT_ITEM_KEY) { 323 if (btrfs_key_type(&key) == BTRFS_EXTENT_ITEM_KEY) {
269 add_new_free_space(block_group, root->fs_info, last, 324 total_found += add_new_free_space(block_group,
270 key.objectid); 325 fs_info, last,
271 326 key.objectid);
272 last = key.objectid + key.offset; 327 last = key.objectid + key.offset;
273 } 328 }
329
330 if (total_found > (1024 * 1024 * 2)) {
331 total_found = 0;
332 wake_up(&block_group->caching_q);
333 }
274next: 334next:
275 path->slots[0]++; 335 path->slots[0]++;
276 } 336 }
337 ret = 0;
277 338
278 add_new_free_space(block_group, root->fs_info, last, 339 total_found += add_new_free_space(block_group, fs_info, last,
279 block_group->key.objectid + 340 block_group->key.objectid +
280 block_group->key.offset); 341 block_group->key.offset);
342
343 spin_lock(&block_group->lock);
344 block_group->cached = BTRFS_CACHE_FINISHED;
345 spin_unlock(&block_group->lock);
281 346
282 block_group->cached = 1;
283 remove_sb_from_cache(root, block_group);
284 ret = 0;
285err: 347err:
286 btrfs_free_path(path); 348 btrfs_free_path(path);
349 up_read(&fs_info->extent_commit_sem);
350 atomic_dec(&block_group->space_info->caching_threads);
351 wake_up(&block_group->caching_q);
352
353 return 0;
354}
355
356static int cache_block_group(struct btrfs_block_group_cache *cache)
357{
358 struct task_struct *tsk;
359 int ret = 0;
360
361 spin_lock(&cache->lock);
362 if (cache->cached != BTRFS_CACHE_NO) {
363 spin_unlock(&cache->lock);
364 return ret;
365 }
366 cache->cached = BTRFS_CACHE_STARTED;
367 spin_unlock(&cache->lock);
368
369 tsk = kthread_run(caching_kthread, cache, "btrfs-cache-%llu\n",
370 cache->key.objectid);
371 if (IS_ERR(tsk)) {
372 ret = PTR_ERR(tsk);
373 printk(KERN_ERR "error running thread %d\n", ret);
374 BUG();
375 }
376
287 return ret; 377 return ret;
288} 378}
289 379
@@ -2387,13 +2477,29 @@ fail:
2387 2477
2388} 2478}
2389 2479
2480static struct btrfs_block_group_cache *
2481next_block_group(struct btrfs_root *root,
2482 struct btrfs_block_group_cache *cache)
2483{
2484 struct rb_node *node;
2485 spin_lock(&root->fs_info->block_group_cache_lock);
2486 node = rb_next(&cache->cache_node);
2487 btrfs_put_block_group(cache);
2488 if (node) {
2489 cache = rb_entry(node, struct btrfs_block_group_cache,
2490 cache_node);
2491 atomic_inc(&cache->count);
2492 } else
2493 cache = NULL;
2494 spin_unlock(&root->fs_info->block_group_cache_lock);
2495 return cache;
2496}
2497
2390int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans, 2498int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
2391 struct btrfs_root *root) 2499 struct btrfs_root *root)
2392{ 2500{
2393 struct btrfs_block_group_cache *cache, *entry; 2501 struct btrfs_block_group_cache *cache;
2394 struct rb_node *n;
2395 int err = 0; 2502 int err = 0;
2396 int werr = 0;
2397 struct btrfs_path *path; 2503 struct btrfs_path *path;
2398 u64 last = 0; 2504 u64 last = 0;
2399 2505
@@ -2402,39 +2508,35 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
2402 return -ENOMEM; 2508 return -ENOMEM;
2403 2509
2404 while (1) { 2510 while (1) {
2405 cache = NULL; 2511 if (last == 0) {
2406 spin_lock(&root->fs_info->block_group_cache_lock); 2512 err = btrfs_run_delayed_refs(trans, root,
2407 for (n = rb_first(&root->fs_info->block_group_cache_tree); 2513 (unsigned long)-1);
2408 n; n = rb_next(n)) { 2514 BUG_ON(err);
2409 entry = rb_entry(n, struct btrfs_block_group_cache,
2410 cache_node);
2411 if (entry->dirty) {
2412 cache = entry;
2413 break;
2414 }
2415 } 2515 }
2416 spin_unlock(&root->fs_info->block_group_cache_lock);
2417 2516
2418 if (!cache) 2517 cache = btrfs_lookup_first_block_group(root->fs_info, last);
2419 break; 2518 while (cache) {
2519 if (cache->dirty)
2520 break;
2521 cache = next_block_group(root, cache);
2522 }
2523 if (!cache) {
2524 if (last == 0)
2525 break;
2526 last = 0;
2527 continue;
2528 }
2420 2529
2421 cache->dirty = 0; 2530 cache->dirty = 0;
2422 last += cache->key.offset; 2531 last = cache->key.objectid + cache->key.offset;
2423 2532
2424 err = write_one_cache_group(trans, root, 2533 err = write_one_cache_group(trans, root, path, cache);
2425 path, cache); 2534 BUG_ON(err);
2426 /* 2535 btrfs_put_block_group(cache);
2427 * if we fail to write the cache group, we want
2428 * to keep it marked dirty in hopes that a later
2429 * write will work
2430 */
2431 if (err) {
2432 werr = err;
2433 continue;
2434 }
2435 } 2536 }
2537
2436 btrfs_free_path(path); 2538 btrfs_free_path(path);
2437 return werr; 2539 return 0;
2438} 2540}
2439 2541
2440int btrfs_extent_readonly(struct btrfs_root *root, u64 bytenr) 2542int btrfs_extent_readonly(struct btrfs_root *root, u64 bytenr)
@@ -2484,6 +2586,7 @@ static int update_space_info(struct btrfs_fs_info *info, u64 flags,
2484 found->force_alloc = 0; 2586 found->force_alloc = 0;
2485 *space_info = found; 2587 *space_info = found;
2486 list_add_rcu(&found->list, &info->space_info); 2588 list_add_rcu(&found->list, &info->space_info);
2589 atomic_set(&found->caching_threads, 0);
2487 return 0; 2590 return 0;
2488} 2591}
2489 2592
@@ -2947,13 +3050,9 @@ int btrfs_update_pinned_extents(struct btrfs_root *root,
2947 struct btrfs_block_group_cache *cache; 3050 struct btrfs_block_group_cache *cache;
2948 struct btrfs_fs_info *fs_info = root->fs_info; 3051 struct btrfs_fs_info *fs_info = root->fs_info;
2949 3052
2950 if (pin) { 3053 if (pin)
2951 set_extent_dirty(&fs_info->pinned_extents, 3054 set_extent_dirty(&fs_info->pinned_extents,
2952 bytenr, bytenr + num - 1, GFP_NOFS); 3055 bytenr, bytenr + num - 1, GFP_NOFS);
2953 } else {
2954 clear_extent_dirty(&fs_info->pinned_extents,
2955 bytenr, bytenr + num - 1, GFP_NOFS);
2956 }
2957 3056
2958 while (num > 0) { 3057 while (num > 0) {
2959 cache = btrfs_lookup_block_group(fs_info, bytenr); 3058 cache = btrfs_lookup_block_group(fs_info, bytenr);
@@ -2969,14 +3068,34 @@ int btrfs_update_pinned_extents(struct btrfs_root *root,
2969 spin_unlock(&cache->space_info->lock); 3068 spin_unlock(&cache->space_info->lock);
2970 fs_info->total_pinned += len; 3069 fs_info->total_pinned += len;
2971 } else { 3070 } else {
3071 int unpin = 0;
3072
3073 /*
3074 * in order to not race with the block group caching, we
3075 * only want to unpin the extent if we are cached. If
3076 * we aren't cached, we want to start async caching this
3077 * block group so we can free the extent the next time
3078 * around.
3079 */
2972 spin_lock(&cache->space_info->lock); 3080 spin_lock(&cache->space_info->lock);
2973 spin_lock(&cache->lock); 3081 spin_lock(&cache->lock);
2974 cache->pinned -= len; 3082 unpin = (cache->cached == BTRFS_CACHE_FINISHED);
2975 cache->space_info->bytes_pinned -= len; 3083 if (likely(unpin)) {
3084 cache->pinned -= len;
3085 cache->space_info->bytes_pinned -= len;
3086 fs_info->total_pinned -= len;
3087 }
2976 spin_unlock(&cache->lock); 3088 spin_unlock(&cache->lock);
2977 spin_unlock(&cache->space_info->lock); 3089 spin_unlock(&cache->space_info->lock);
2978 fs_info->total_pinned -= len; 3090
2979 if (cache->cached) 3091 if (likely(unpin))
3092 clear_extent_dirty(&fs_info->pinned_extents,
3093 bytenr, bytenr + len -1,
3094 GFP_NOFS);
3095 else
3096 cache_block_group(cache);
3097
3098 if (unpin)
2980 btrfs_add_free_space(cache, bytenr, len); 3099 btrfs_add_free_space(cache, bytenr, len);
2981 } 3100 }
2982 btrfs_put_block_group(cache); 3101 btrfs_put_block_group(cache);
@@ -3030,6 +3149,7 @@ int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy)
3030 &start, &end, EXTENT_DIRTY); 3149 &start, &end, EXTENT_DIRTY);
3031 if (ret) 3150 if (ret)
3032 break; 3151 break;
3152
3033 set_extent_dirty(copy, start, end, GFP_NOFS); 3153 set_extent_dirty(copy, start, end, GFP_NOFS);
3034 last = end + 1; 3154 last = end + 1;
3035 } 3155 }
@@ -3058,6 +3178,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
3058 3178
3059 cond_resched(); 3179 cond_resched();
3060 } 3180 }
3181
3061 return ret; 3182 return ret;
3062} 3183}
3063 3184
@@ -3436,6 +3557,45 @@ static u64 stripe_align(struct btrfs_root *root, u64 val)
3436} 3557}
3437 3558
3438/* 3559/*
3560 * when we wait for progress in the block group caching, its because
3561 * our allocation attempt failed at least once. So, we must sleep
3562 * and let some progress happen before we try again.
3563 *
3564 * This function will sleep at least once waiting for new free space to
3565 * show up, and then it will check the block group free space numbers
3566 * for our min num_bytes. Another option is to have it go ahead
3567 * and look in the rbtree for a free extent of a given size, but this
3568 * is a good start.
3569 */
3570static noinline int
3571wait_block_group_cache_progress(struct btrfs_block_group_cache *cache,
3572 u64 num_bytes)
3573{
3574 DEFINE_WAIT(wait);
3575
3576 prepare_to_wait(&cache->caching_q, &wait, TASK_UNINTERRUPTIBLE);
3577
3578 if (block_group_cache_done(cache)) {
3579 finish_wait(&cache->caching_q, &wait);
3580 return 0;
3581 }
3582 schedule();
3583 finish_wait(&cache->caching_q, &wait);
3584
3585 wait_event(cache->caching_q, block_group_cache_done(cache) ||
3586 (cache->free_space >= num_bytes));
3587 return 0;
3588}
3589
3590enum btrfs_loop_type {
3591 LOOP_CACHED_ONLY = 0,
3592 LOOP_CACHING_NOWAIT = 1,
3593 LOOP_CACHING_WAIT = 2,
3594 LOOP_ALLOC_CHUNK = 3,
3595 LOOP_NO_EMPTY_SIZE = 4,
3596};
3597
3598/*
3439 * walks the btree of allocated extents and find a hole of a given size. 3599 * walks the btree of allocated extents and find a hole of a given size.
3440 * The key ins is changed to record the hole: 3600 * The key ins is changed to record the hole:
3441 * ins->objectid == block start 3601 * ins->objectid == block start
@@ -3460,6 +3620,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
3460 struct btrfs_space_info *space_info; 3620 struct btrfs_space_info *space_info;
3461 int last_ptr_loop = 0; 3621 int last_ptr_loop = 0;
3462 int loop = 0; 3622 int loop = 0;
3623 bool found_uncached_bg = false;
3463 3624
3464 WARN_ON(num_bytes < root->sectorsize); 3625 WARN_ON(num_bytes < root->sectorsize);
3465 btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY); 3626 btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY);
@@ -3491,15 +3652,18 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
3491 search_start = max(search_start, first_logical_byte(root, 0)); 3652 search_start = max(search_start, first_logical_byte(root, 0));
3492 search_start = max(search_start, hint_byte); 3653 search_start = max(search_start, hint_byte);
3493 3654
3494 if (!last_ptr) { 3655 if (!last_ptr)
3495 empty_cluster = 0; 3656 empty_cluster = 0;
3496 loop = 1;
3497 }
3498 3657
3499 if (search_start == hint_byte) { 3658 if (search_start == hint_byte) {
3500 block_group = btrfs_lookup_block_group(root->fs_info, 3659 block_group = btrfs_lookup_block_group(root->fs_info,
3501 search_start); 3660 search_start);
3502 if (block_group && block_group_bits(block_group, data)) { 3661 /*
3662 * we don't want to use the block group if it doesn't match our
3663 * allocation bits, or if its not cached.
3664 */
3665 if (block_group && block_group_bits(block_group, data) &&
3666 block_group_cache_done(block_group)) {
3503 down_read(&space_info->groups_sem); 3667 down_read(&space_info->groups_sem);
3504 if (list_empty(&block_group->list) || 3668 if (list_empty(&block_group->list) ||
3505 block_group->ro) { 3669 block_group->ro) {
@@ -3522,21 +3686,35 @@ search:
3522 down_read(&space_info->groups_sem); 3686 down_read(&space_info->groups_sem);
3523 list_for_each_entry(block_group, &space_info->block_groups, list) { 3687 list_for_each_entry(block_group, &space_info->block_groups, list) {
3524 u64 offset; 3688 u64 offset;
3689 int cached;
3525 3690
3526 atomic_inc(&block_group->count); 3691 atomic_inc(&block_group->count);
3527 search_start = block_group->key.objectid; 3692 search_start = block_group->key.objectid;
3528 3693
3529have_block_group: 3694have_block_group:
3530 if (unlikely(!block_group->cached)) { 3695 if (unlikely(block_group->cached == BTRFS_CACHE_NO)) {
3531 mutex_lock(&block_group->cache_mutex); 3696 /*
3532 ret = cache_block_group(root, block_group); 3697 * we want to start caching kthreads, but not too many
3533 mutex_unlock(&block_group->cache_mutex); 3698 * right off the bat so we don't overwhelm the system,
3534 if (ret) { 3699 * so only start them if there are less than 2 and we're
3535 btrfs_put_block_group(block_group); 3700 * in the initial allocation phase.
3536 break; 3701 */
3702 if (loop > LOOP_CACHING_NOWAIT ||
3703 atomic_read(&space_info->caching_threads) < 2) {
3704 ret = cache_block_group(block_group);
3705 BUG_ON(ret);
3537 } 3706 }
3538 } 3707 }
3539 3708
3709 cached = block_group_cache_done(block_group);
3710 if (unlikely(!cached)) {
3711 found_uncached_bg = true;
3712
3713 /* if we only want cached bgs, loop */
3714 if (loop == LOOP_CACHED_ONLY)
3715 goto loop;
3716 }
3717
3540 if (unlikely(block_group->ro)) 3718 if (unlikely(block_group->ro))
3541 goto loop; 3719 goto loop;
3542 3720
@@ -3615,14 +3793,21 @@ refill_cluster:
3615 spin_unlock(&last_ptr->refill_lock); 3793 spin_unlock(&last_ptr->refill_lock);
3616 goto checks; 3794 goto checks;
3617 } 3795 }
3796 } else if (!cached && loop > LOOP_CACHING_NOWAIT) {
3797 spin_unlock(&last_ptr->refill_lock);
3798
3799 wait_block_group_cache_progress(block_group,
3800 num_bytes + empty_cluster + empty_size);
3801 goto have_block_group;
3618 } 3802 }
3803
3619 /* 3804 /*
3620 * at this point we either didn't find a cluster 3805 * at this point we either didn't find a cluster
3621 * or we weren't able to allocate a block from our 3806 * or we weren't able to allocate a block from our
3622 * cluster. Free the cluster we've been trying 3807 * cluster. Free the cluster we've been trying
3623 * to use, and go to the next block group 3808 * to use, and go to the next block group
3624 */ 3809 */
3625 if (loop < 2) { 3810 if (loop < LOOP_NO_EMPTY_SIZE) {
3626 btrfs_return_cluster_to_free_space(NULL, 3811 btrfs_return_cluster_to_free_space(NULL,
3627 last_ptr); 3812 last_ptr);
3628 spin_unlock(&last_ptr->refill_lock); 3813 spin_unlock(&last_ptr->refill_lock);
@@ -3633,11 +3818,17 @@ refill_cluster:
3633 3818
3634 offset = btrfs_find_space_for_alloc(block_group, search_start, 3819 offset = btrfs_find_space_for_alloc(block_group, search_start,
3635 num_bytes, empty_size); 3820 num_bytes, empty_size);
3636 if (!offset) 3821 if (!offset && (cached || (!cached &&
3822 loop == LOOP_CACHING_NOWAIT))) {
3637 goto loop; 3823 goto loop;
3824 } else if (!offset && (!cached &&
3825 loop > LOOP_CACHING_NOWAIT)) {
3826 wait_block_group_cache_progress(block_group,
3827 num_bytes + empty_size);
3828 goto have_block_group;
3829 }
3638checks: 3830checks:
3639 search_start = stripe_align(root, offset); 3831 search_start = stripe_align(root, offset);
3640
3641 /* move on to the next group */ 3832 /* move on to the next group */
3642 if (search_start + num_bytes >= search_end) { 3833 if (search_start + num_bytes >= search_end) {
3643 btrfs_add_free_space(block_group, offset, num_bytes); 3834 btrfs_add_free_space(block_group, offset, num_bytes);
@@ -3683,13 +3874,26 @@ loop:
3683 } 3874 }
3684 up_read(&space_info->groups_sem); 3875 up_read(&space_info->groups_sem);
3685 3876
3686 /* loop == 0, try to find a clustered alloc in every block group 3877 /* LOOP_CACHED_ONLY, only search fully cached block groups
3687 * loop == 1, try again after forcing a chunk allocation 3878 * LOOP_CACHING_NOWAIT, search partially cached block groups, but
3688 * loop == 2, set empty_size and empty_cluster to 0 and try again 3879 * dont wait foR them to finish caching
3880 * LOOP_CACHING_WAIT, search everything, and wait if our bg is caching
3881 * LOOP_ALLOC_CHUNK, force a chunk allocation and try again
3882 * LOOP_NO_EMPTY_SIZE, set empty_size and empty_cluster to 0 and try
3883 * again
3689 */ 3884 */
3690 if (!ins->objectid && loop < 3 && 3885 if (!ins->objectid && loop < LOOP_NO_EMPTY_SIZE &&
3691 (empty_size || empty_cluster || allowed_chunk_alloc)) { 3886 (found_uncached_bg || empty_size || empty_cluster ||
3692 if (loop >= 2) { 3887 allowed_chunk_alloc)) {
3888 if (found_uncached_bg) {
3889 found_uncached_bg = false;
3890 if (loop < LOOP_CACHING_WAIT) {
3891 loop++;
3892 goto search;
3893 }
3894 }
3895
3896 if (loop == LOOP_ALLOC_CHUNK) {
3693 empty_size = 0; 3897 empty_size = 0;
3694 empty_cluster = 0; 3898 empty_cluster = 0;
3695 } 3899 }
@@ -3702,7 +3906,7 @@ loop:
3702 space_info->force_alloc = 1; 3906 space_info->force_alloc = 1;
3703 } 3907 }
3704 3908
3705 if (loop < 3) { 3909 if (loop < LOOP_NO_EMPTY_SIZE) {
3706 loop++; 3910 loop++;
3707 goto search; 3911 goto search;
3708 } 3912 }
@@ -3798,7 +4002,7 @@ again:
3798 num_bytes, data, 1); 4002 num_bytes, data, 1);
3799 goto again; 4003 goto again;
3800 } 4004 }
3801 if (ret) { 4005 if (ret == -ENOSPC) {
3802 struct btrfs_space_info *sinfo; 4006 struct btrfs_space_info *sinfo;
3803 4007
3804 sinfo = __find_space_info(root->fs_info, data); 4008 sinfo = __find_space_info(root->fs_info, data);
@@ -3806,7 +4010,6 @@ again:
3806 "wanted %llu\n", (unsigned long long)data, 4010 "wanted %llu\n", (unsigned long long)data,
3807 (unsigned long long)num_bytes); 4011 (unsigned long long)num_bytes);
3808 dump_space_info(sinfo, num_bytes); 4012 dump_space_info(sinfo, num_bytes);
3809 BUG();
3810 } 4013 }
3811 4014
3812 return ret; 4015 return ret;
@@ -3844,7 +4047,9 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
3844 ret = __btrfs_reserve_extent(trans, root, num_bytes, min_alloc_size, 4047 ret = __btrfs_reserve_extent(trans, root, num_bytes, min_alloc_size,
3845 empty_size, hint_byte, search_end, ins, 4048 empty_size, hint_byte, search_end, ins,
3846 data); 4049 data);
3847 update_reserved_extents(root, ins->objectid, ins->offset, 1); 4050 if (!ret)
4051 update_reserved_extents(root, ins->objectid, ins->offset, 1);
4052
3848 return ret; 4053 return ret;
3849} 4054}
3850 4055
@@ -4006,9 +4211,9 @@ int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans,
4006 struct btrfs_block_group_cache *block_group; 4211 struct btrfs_block_group_cache *block_group;
4007 4212
4008 block_group = btrfs_lookup_block_group(root->fs_info, ins->objectid); 4213 block_group = btrfs_lookup_block_group(root->fs_info, ins->objectid);
4009 mutex_lock(&block_group->cache_mutex); 4214 cache_block_group(block_group);
4010 cache_block_group(root, block_group); 4215 wait_event(block_group->caching_q,
4011 mutex_unlock(&block_group->cache_mutex); 4216 block_group_cache_done(block_group));
4012 4217
4013 ret = btrfs_remove_free_space(block_group, ins->objectid, 4218 ret = btrfs_remove_free_space(block_group, ins->objectid,
4014 ins->offset); 4219 ins->offset);
@@ -4039,7 +4244,8 @@ static int alloc_tree_block(struct btrfs_trans_handle *trans,
4039 ret = __btrfs_reserve_extent(trans, root, num_bytes, num_bytes, 4244 ret = __btrfs_reserve_extent(trans, root, num_bytes, num_bytes,
4040 empty_size, hint_byte, search_end, 4245 empty_size, hint_byte, search_end,
4041 ins, 0); 4246 ins, 0);
4042 BUG_ON(ret); 4247 if (ret)
4248 return ret;
4043 4249
4044 if (root_objectid == BTRFS_TREE_RELOC_OBJECTID) { 4250 if (root_objectid == BTRFS_TREE_RELOC_OBJECTID) {
4045 if (parent == 0) 4251 if (parent == 0)
@@ -6955,11 +7161,16 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
6955 &info->block_group_cache_tree); 7161 &info->block_group_cache_tree);
6956 spin_unlock(&info->block_group_cache_lock); 7162 spin_unlock(&info->block_group_cache_lock);
6957 7163
6958 btrfs_remove_free_space_cache(block_group);
6959 down_write(&block_group->space_info->groups_sem); 7164 down_write(&block_group->space_info->groups_sem);
6960 list_del(&block_group->list); 7165 list_del(&block_group->list);
6961 up_write(&block_group->space_info->groups_sem); 7166 up_write(&block_group->space_info->groups_sem);
6962 7167
7168 if (block_group->cached == BTRFS_CACHE_STARTED)
7169 wait_event(block_group->caching_q,
7170 block_group_cache_done(block_group));
7171
7172 btrfs_remove_free_space_cache(block_group);
7173
6963 WARN_ON(atomic_read(&block_group->count) != 1); 7174 WARN_ON(atomic_read(&block_group->count) != 1);
6964 kfree(block_group); 7175 kfree(block_group);
6965 7176
@@ -7025,9 +7236,19 @@ int btrfs_read_block_groups(struct btrfs_root *root)
7025 atomic_set(&cache->count, 1); 7236 atomic_set(&cache->count, 1);
7026 spin_lock_init(&cache->lock); 7237 spin_lock_init(&cache->lock);
7027 spin_lock_init(&cache->tree_lock); 7238 spin_lock_init(&cache->tree_lock);
7028 mutex_init(&cache->cache_mutex); 7239 cache->fs_info = info;
7240 init_waitqueue_head(&cache->caching_q);
7029 INIT_LIST_HEAD(&cache->list); 7241 INIT_LIST_HEAD(&cache->list);
7030 INIT_LIST_HEAD(&cache->cluster_list); 7242 INIT_LIST_HEAD(&cache->cluster_list);
7243
7244 /*
7245 * we only want to have 32k of ram per block group for keeping
7246 * track of free space, and if we pass 1/2 of that we want to
7247 * start converting things over to using bitmaps
7248 */
7249 cache->extents_thresh = ((1024 * 32) / 2) /
7250 sizeof(struct btrfs_free_space);
7251
7031 read_extent_buffer(leaf, &cache->item, 7252 read_extent_buffer(leaf, &cache->item,
7032 btrfs_item_ptr_offset(leaf, path->slots[0]), 7253 btrfs_item_ptr_offset(leaf, path->slots[0]),
7033 sizeof(cache->item)); 7254 sizeof(cache->item));
@@ -7036,6 +7257,26 @@ int btrfs_read_block_groups(struct btrfs_root *root)
7036 key.objectid = found_key.objectid + found_key.offset; 7257 key.objectid = found_key.objectid + found_key.offset;
7037 btrfs_release_path(root, path); 7258 btrfs_release_path(root, path);
7038 cache->flags = btrfs_block_group_flags(&cache->item); 7259 cache->flags = btrfs_block_group_flags(&cache->item);
7260 cache->sectorsize = root->sectorsize;
7261
7262 remove_sb_from_cache(root, cache);
7263
7264 /*
7265 * check for two cases, either we are full, and therefore
7266 * don't need to bother with the caching work since we won't
7267 * find any space, or we are empty, and we can just add all
7268 * the space in and be done with it. This saves us _alot_ of
7269 * time, particularly in the full case.
7270 */
7271 if (found_key.offset == btrfs_block_group_used(&cache->item)) {
7272 cache->cached = BTRFS_CACHE_FINISHED;
7273 } else if (btrfs_block_group_used(&cache->item) == 0) {
7274 cache->cached = BTRFS_CACHE_FINISHED;
7275 add_new_free_space(cache, root->fs_info,
7276 found_key.objectid,
7277 found_key.objectid +
7278 found_key.offset);
7279 }
7039 7280
7040 ret = update_space_info(info, cache->flags, found_key.offset, 7281 ret = update_space_info(info, cache->flags, found_key.offset,
7041 btrfs_block_group_used(&cache->item), 7282 btrfs_block_group_used(&cache->item),
@@ -7079,10 +7320,19 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
7079 cache->key.objectid = chunk_offset; 7320 cache->key.objectid = chunk_offset;
7080 cache->key.offset = size; 7321 cache->key.offset = size;
7081 cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY; 7322 cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY;
7323 cache->sectorsize = root->sectorsize;
7324
7325 /*
7326 * we only want to have 32k of ram per block group for keeping track
7327 * of free space, and if we pass 1/2 of that we want to start
7328 * converting things over to using bitmaps
7329 */
7330 cache->extents_thresh = ((1024 * 32) / 2) /
7331 sizeof(struct btrfs_free_space);
7082 atomic_set(&cache->count, 1); 7332 atomic_set(&cache->count, 1);
7083 spin_lock_init(&cache->lock); 7333 spin_lock_init(&cache->lock);
7084 spin_lock_init(&cache->tree_lock); 7334 spin_lock_init(&cache->tree_lock);
7085 mutex_init(&cache->cache_mutex); 7335 init_waitqueue_head(&cache->caching_q);
7086 INIT_LIST_HEAD(&cache->list); 7336 INIT_LIST_HEAD(&cache->list);
7087 INIT_LIST_HEAD(&cache->cluster_list); 7337 INIT_LIST_HEAD(&cache->cluster_list);
7088 7338
@@ -7091,6 +7341,12 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
7091 cache->flags = type; 7341 cache->flags = type;
7092 btrfs_set_block_group_flags(&cache->item, type); 7342 btrfs_set_block_group_flags(&cache->item, type);
7093 7343
7344 cache->cached = BTRFS_CACHE_FINISHED;
7345 remove_sb_from_cache(root, cache);
7346
7347 add_new_free_space(cache, root->fs_info, chunk_offset,
7348 chunk_offset + size);
7349
7094 ret = update_space_info(root->fs_info, cache->flags, size, bytes_used, 7350 ret = update_space_info(root->fs_info, cache->flags, size, bytes_used,
7095 &cache->space_info); 7351 &cache->space_info);
7096 BUG_ON(ret); 7352 BUG_ON(ret);
@@ -7149,7 +7405,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
7149 rb_erase(&block_group->cache_node, 7405 rb_erase(&block_group->cache_node,
7150 &root->fs_info->block_group_cache_tree); 7406 &root->fs_info->block_group_cache_tree);
7151 spin_unlock(&root->fs_info->block_group_cache_lock); 7407 spin_unlock(&root->fs_info->block_group_cache_lock);
7152 btrfs_remove_free_space_cache(block_group); 7408
7153 down_write(&block_group->space_info->groups_sem); 7409 down_write(&block_group->space_info->groups_sem);
7154 /* 7410 /*
7155 * we must use list_del_init so people can check to see if they 7411 * we must use list_del_init so people can check to see if they
@@ -7158,11 +7414,18 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
7158 list_del_init(&block_group->list); 7414 list_del_init(&block_group->list);
7159 up_write(&block_group->space_info->groups_sem); 7415 up_write(&block_group->space_info->groups_sem);
7160 7416
7417 if (block_group->cached == BTRFS_CACHE_STARTED)
7418 wait_event(block_group->caching_q,
7419 block_group_cache_done(block_group));
7420
7421 btrfs_remove_free_space_cache(block_group);
7422
7161 spin_lock(&block_group->space_info->lock); 7423 spin_lock(&block_group->space_info->lock);
7162 block_group->space_info->total_bytes -= block_group->key.offset; 7424 block_group->space_info->total_bytes -= block_group->key.offset;
7163 block_group->space_info->bytes_readonly -= block_group->key.offset; 7425 block_group->space_info->bytes_readonly -= block_group->key.offset;
7164 spin_unlock(&block_group->space_info->lock); 7426 spin_unlock(&block_group->space_info->lock);
7165 block_group->space_info->full = 0; 7427
7428 btrfs_clear_space_info_full(root->fs_info);
7166 7429
7167 btrfs_put_block_group(block_group); 7430 btrfs_put_block_group(block_group);
7168 btrfs_put_block_group(block_group); 7431 btrfs_put_block_group(block_group);
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 7c3cd248d8d6..4b833972273a 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -22,7 +22,6 @@
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/string.h> 24#include <linux/string.h>
25#include <linux/smp_lock.h>
26#include <linux/backing-dev.h> 25#include <linux/backing-dev.h>
27#include <linux/mpage.h> 26#include <linux/mpage.h>
28#include <linux/swap.h> 27#include <linux/swap.h>
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 4538e48581a5..af99b78b288e 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -16,45 +16,46 @@
16 * Boston, MA 021110-1307, USA. 16 * Boston, MA 021110-1307, USA.
17 */ 17 */
18 18
19#include <linux/pagemap.h>
19#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/math64.h>
20#include "ctree.h" 22#include "ctree.h"
21#include "free-space-cache.h" 23#include "free-space-cache.h"
22#include "transaction.h" 24#include "transaction.h"
23 25
24struct btrfs_free_space { 26#define BITS_PER_BITMAP (PAGE_CACHE_SIZE * 8)
25 struct rb_node bytes_index; 27#define MAX_CACHE_BYTES_PER_GIG (32 * 1024)
26 struct rb_node offset_index;
27 u64 offset;
28 u64 bytes;
29};
30 28
31static int tree_insert_offset(struct rb_root *root, u64 offset, 29static inline unsigned long offset_to_bit(u64 bitmap_start, u64 sectorsize,
32 struct rb_node *node) 30 u64 offset)
33{ 31{
34 struct rb_node **p = &root->rb_node; 32 BUG_ON(offset < bitmap_start);
35 struct rb_node *parent = NULL; 33 offset -= bitmap_start;
36 struct btrfs_free_space *info; 34 return (unsigned long)(div64_u64(offset, sectorsize));
35}
37 36
38 while (*p) { 37static inline unsigned long bytes_to_bits(u64 bytes, u64 sectorsize)
39 parent = *p; 38{
40 info = rb_entry(parent, struct btrfs_free_space, offset_index); 39 return (unsigned long)(div64_u64(bytes, sectorsize));
40}
41 41
42 if (offset < info->offset) 42static inline u64 offset_to_bitmap(struct btrfs_block_group_cache *block_group,
43 p = &(*p)->rb_left; 43 u64 offset)
44 else if (offset > info->offset) 44{
45 p = &(*p)->rb_right; 45 u64 bitmap_start;
46 else 46 u64 bytes_per_bitmap;
47 return -EEXIST;
48 }
49 47
50 rb_link_node(node, parent, p); 48 bytes_per_bitmap = BITS_PER_BITMAP * block_group->sectorsize;
51 rb_insert_color(node, root); 49 bitmap_start = offset - block_group->key.objectid;
50 bitmap_start = div64_u64(bitmap_start, bytes_per_bitmap);
51 bitmap_start *= bytes_per_bitmap;
52 bitmap_start += block_group->key.objectid;
52 53
53 return 0; 54 return bitmap_start;
54} 55}
55 56
56static int tree_insert_bytes(struct rb_root *root, u64 bytes, 57static int tree_insert_offset(struct rb_root *root, u64 offset,
57 struct rb_node *node) 58 struct rb_node *node, int bitmap)
58{ 59{
59 struct rb_node **p = &root->rb_node; 60 struct rb_node **p = &root->rb_node;
60 struct rb_node *parent = NULL; 61 struct rb_node *parent = NULL;
@@ -62,12 +63,34 @@ static int tree_insert_bytes(struct rb_root *root, u64 bytes,
62 63
63 while (*p) { 64 while (*p) {
64 parent = *p; 65 parent = *p;
65 info = rb_entry(parent, struct btrfs_free_space, bytes_index); 66 info = rb_entry(parent, struct btrfs_free_space, offset_index);
66 67
67 if (bytes < info->bytes) 68 if (offset < info->offset) {
68 p = &(*p)->rb_left; 69 p = &(*p)->rb_left;
69 else 70 } else if (offset > info->offset) {
70 p = &(*p)->rb_right; 71 p = &(*p)->rb_right;
72 } else {
73 /*
74 * we could have a bitmap entry and an extent entry
75 * share the same offset. If this is the case, we want
76 * the extent entry to always be found first if we do a
77 * linear search through the tree, since we want to have
78 * the quickest allocation time, and allocating from an
79 * extent is faster than allocating from a bitmap. So
80 * if we're inserting a bitmap and we find an entry at
81 * this offset, we want to go right, or after this entry
82 * logically. If we are inserting an extent and we've
83 * found a bitmap, we want to go left, or before
84 * logically.
85 */
86 if (bitmap) {
87 WARN_ON(info->bitmap);
88 p = &(*p)->rb_right;
89 } else {
90 WARN_ON(!info->bitmap);
91 p = &(*p)->rb_left;
92 }
93 }
71 } 94 }
72 95
73 rb_link_node(node, parent, p); 96 rb_link_node(node, parent, p);
@@ -79,110 +102,143 @@ static int tree_insert_bytes(struct rb_root *root, u64 bytes,
79/* 102/*
80 * searches the tree for the given offset. 103 * searches the tree for the given offset.
81 * 104 *
82 * fuzzy == 1: this is used for allocations where we are given a hint of where 105 * fuzzy - If this is set, then we are trying to make an allocation, and we just
83 * to look for free space. Because the hint may not be completely on an offset 106 * want a section that has at least bytes size and comes at or after the given
84 * mark, or the hint may no longer point to free space we need to fudge our 107 * offset.
85 * results a bit. So we look for free space starting at or after offset with at
86 * least bytes size. We prefer to find as close to the given offset as we can.
87 * Also if the offset is within a free space range, then we will return the free
88 * space that contains the given offset, which means we can return a free space
89 * chunk with an offset before the provided offset.
90 *
91 * fuzzy == 0: this is just a normal tree search. Give us the free space that
92 * starts at the given offset which is at least bytes size, and if its not there
93 * return NULL.
94 */ 108 */
95static struct btrfs_free_space *tree_search_offset(struct rb_root *root, 109static struct btrfs_free_space *
96 u64 offset, u64 bytes, 110tree_search_offset(struct btrfs_block_group_cache *block_group,
97 int fuzzy) 111 u64 offset, int bitmap_only, int fuzzy)
98{ 112{
99 struct rb_node *n = root->rb_node; 113 struct rb_node *n = block_group->free_space_offset.rb_node;
100 struct btrfs_free_space *entry, *ret = NULL; 114 struct btrfs_free_space *entry, *prev = NULL;
115
116 /* find entry that is closest to the 'offset' */
117 while (1) {
118 if (!n) {
119 entry = NULL;
120 break;
121 }
101 122
102 while (n) {
103 entry = rb_entry(n, struct btrfs_free_space, offset_index); 123 entry = rb_entry(n, struct btrfs_free_space, offset_index);
124 prev = entry;
104 125
105 if (offset < entry->offset) { 126 if (offset < entry->offset)
106 if (fuzzy &&
107 (!ret || entry->offset < ret->offset) &&
108 (bytes <= entry->bytes))
109 ret = entry;
110 n = n->rb_left; 127 n = n->rb_left;
111 } else if (offset > entry->offset) { 128 else if (offset > entry->offset)
112 if (fuzzy &&
113 (entry->offset + entry->bytes - 1) >= offset &&
114 bytes <= entry->bytes) {
115 ret = entry;
116 break;
117 }
118 n = n->rb_right; 129 n = n->rb_right;
119 } else { 130 else
120 if (bytes > entry->bytes) {
121 n = n->rb_right;
122 continue;
123 }
124 ret = entry;
125 break; 131 break;
126 }
127 } 132 }
128 133
129 return ret; 134 if (bitmap_only) {
130} 135 if (!entry)
131 136 return NULL;
132/* 137 if (entry->bitmap)
133 * return a chunk at least bytes size, as close to offset that we can get. 138 return entry;
134 */
135static struct btrfs_free_space *tree_search_bytes(struct rb_root *root,
136 u64 offset, u64 bytes)
137{
138 struct rb_node *n = root->rb_node;
139 struct btrfs_free_space *entry, *ret = NULL;
140 139
141 while (n) { 140 /*
142 entry = rb_entry(n, struct btrfs_free_space, bytes_index); 141 * bitmap entry and extent entry may share same offset,
142 * in that case, bitmap entry comes after extent entry.
143 */
144 n = rb_next(n);
145 if (!n)
146 return NULL;
147 entry = rb_entry(n, struct btrfs_free_space, offset_index);
148 if (entry->offset != offset)
149 return NULL;
143 150
144 if (bytes < entry->bytes) { 151 WARN_ON(!entry->bitmap);
152 return entry;
153 } else if (entry) {
154 if (entry->bitmap) {
145 /* 155 /*
146 * We prefer to get a hole size as close to the size we 156 * if previous extent entry covers the offset,
147 * are asking for so we don't take small slivers out of 157 * we should return it instead of the bitmap entry
148 * huge holes, but we also want to get as close to the
149 * offset as possible so we don't have a whole lot of
150 * fragmentation.
151 */ 158 */
152 if (offset <= entry->offset) { 159 n = &entry->offset_index;
153 if (!ret) 160 while (1) {
154 ret = entry; 161 n = rb_prev(n);
155 else if (entry->bytes < ret->bytes) 162 if (!n)
156 ret = entry; 163 break;
157 else if (entry->offset < ret->offset) 164 prev = rb_entry(n, struct btrfs_free_space,
158 ret = entry; 165 offset_index);
166 if (!prev->bitmap) {
167 if (prev->offset + prev->bytes > offset)
168 entry = prev;
169 break;
170 }
159 } 171 }
160 n = n->rb_left; 172 }
161 } else if (bytes > entry->bytes) { 173 return entry;
162 n = n->rb_right; 174 }
175
176 if (!prev)
177 return NULL;
178
179 /* find last entry before the 'offset' */
180 entry = prev;
181 if (entry->offset > offset) {
182 n = rb_prev(&entry->offset_index);
183 if (n) {
184 entry = rb_entry(n, struct btrfs_free_space,
185 offset_index);
186 BUG_ON(entry->offset > offset);
163 } else { 187 } else {
164 /* 188 if (fuzzy)
165 * Ok we may have multiple chunks of the wanted size, 189 return entry;
166 * so we don't want to take the first one we find, we 190 else
167 * want to take the one closest to our given offset, so 191 return NULL;
168 * keep searching just in case theres a better match.
169 */
170 n = n->rb_right;
171 if (offset > entry->offset)
172 continue;
173 else if (!ret || entry->offset < ret->offset)
174 ret = entry;
175 } 192 }
176 } 193 }
177 194
178 return ret; 195 if (entry->bitmap) {
196 n = &entry->offset_index;
197 while (1) {
198 n = rb_prev(n);
199 if (!n)
200 break;
201 prev = rb_entry(n, struct btrfs_free_space,
202 offset_index);
203 if (!prev->bitmap) {
204 if (prev->offset + prev->bytes > offset)
205 return prev;
206 break;
207 }
208 }
209 if (entry->offset + BITS_PER_BITMAP *
210 block_group->sectorsize > offset)
211 return entry;
212 } else if (entry->offset + entry->bytes > offset)
213 return entry;
214
215 if (!fuzzy)
216 return NULL;
217
218 while (1) {
219 if (entry->bitmap) {
220 if (entry->offset + BITS_PER_BITMAP *
221 block_group->sectorsize > offset)
222 break;
223 } else {
224 if (entry->offset + entry->bytes > offset)
225 break;
226 }
227
228 n = rb_next(&entry->offset_index);
229 if (!n)
230 return NULL;
231 entry = rb_entry(n, struct btrfs_free_space, offset_index);
232 }
233 return entry;
179} 234}
180 235
181static void unlink_free_space(struct btrfs_block_group_cache *block_group, 236static void unlink_free_space(struct btrfs_block_group_cache *block_group,
182 struct btrfs_free_space *info) 237 struct btrfs_free_space *info)
183{ 238{
184 rb_erase(&info->offset_index, &block_group->free_space_offset); 239 rb_erase(&info->offset_index, &block_group->free_space_offset);
185 rb_erase(&info->bytes_index, &block_group->free_space_bytes); 240 block_group->free_extents--;
241 block_group->free_space -= info->bytes;
186} 242}
187 243
188static int link_free_space(struct btrfs_block_group_cache *block_group, 244static int link_free_space(struct btrfs_block_group_cache *block_group,
@@ -190,17 +246,314 @@ static int link_free_space(struct btrfs_block_group_cache *block_group,
190{ 246{
191 int ret = 0; 247 int ret = 0;
192 248
193 249 BUG_ON(!info->bitmap && !info->bytes);
194 BUG_ON(!info->bytes);
195 ret = tree_insert_offset(&block_group->free_space_offset, info->offset, 250 ret = tree_insert_offset(&block_group->free_space_offset, info->offset,
196 &info->offset_index); 251 &info->offset_index, (info->bitmap != NULL));
197 if (ret) 252 if (ret)
198 return ret; 253 return ret;
199 254
200 ret = tree_insert_bytes(&block_group->free_space_bytes, info->bytes, 255 block_group->free_space += info->bytes;
201 &info->bytes_index); 256 block_group->free_extents++;
202 if (ret) 257 return ret;
203 return ret; 258}
259
260static void recalculate_thresholds(struct btrfs_block_group_cache *block_group)
261{
262 u64 max_bytes, possible_bytes;
263
264 /*
265 * The goal is to keep the total amount of memory used per 1gb of space
266 * at or below 32k, so we need to adjust how much memory we allow to be
267 * used by extent based free space tracking
268 */
269 max_bytes = MAX_CACHE_BYTES_PER_GIG *
270 (div64_u64(block_group->key.offset, 1024 * 1024 * 1024));
271
272 possible_bytes = (block_group->total_bitmaps * PAGE_CACHE_SIZE) +
273 (sizeof(struct btrfs_free_space) *
274 block_group->extents_thresh);
275
276 if (possible_bytes > max_bytes) {
277 int extent_bytes = max_bytes -
278 (block_group->total_bitmaps * PAGE_CACHE_SIZE);
279
280 if (extent_bytes <= 0) {
281 block_group->extents_thresh = 0;
282 return;
283 }
284
285 block_group->extents_thresh = extent_bytes /
286 (sizeof(struct btrfs_free_space));
287 }
288}
289
290static void bitmap_clear_bits(struct btrfs_block_group_cache *block_group,
291 struct btrfs_free_space *info, u64 offset,
292 u64 bytes)
293{
294 unsigned long start, end;
295 unsigned long i;
296
297 start = offset_to_bit(info->offset, block_group->sectorsize, offset);
298 end = start + bytes_to_bits(bytes, block_group->sectorsize);
299 BUG_ON(end > BITS_PER_BITMAP);
300
301 for (i = start; i < end; i++)
302 clear_bit(i, info->bitmap);
303
304 info->bytes -= bytes;
305 block_group->free_space -= bytes;
306}
307
308static void bitmap_set_bits(struct btrfs_block_group_cache *block_group,
309 struct btrfs_free_space *info, u64 offset,
310 u64 bytes)
311{
312 unsigned long start, end;
313 unsigned long i;
314
315 start = offset_to_bit(info->offset, block_group->sectorsize, offset);
316 end = start + bytes_to_bits(bytes, block_group->sectorsize);
317 BUG_ON(end > BITS_PER_BITMAP);
318
319 for (i = start; i < end; i++)
320 set_bit(i, info->bitmap);
321
322 info->bytes += bytes;
323 block_group->free_space += bytes;
324}
325
326static int search_bitmap(struct btrfs_block_group_cache *block_group,
327 struct btrfs_free_space *bitmap_info, u64 *offset,
328 u64 *bytes)
329{
330 unsigned long found_bits = 0;
331 unsigned long bits, i;
332 unsigned long next_zero;
333
334 i = offset_to_bit(bitmap_info->offset, block_group->sectorsize,
335 max_t(u64, *offset, bitmap_info->offset));
336 bits = bytes_to_bits(*bytes, block_group->sectorsize);
337
338 for (i = find_next_bit(bitmap_info->bitmap, BITS_PER_BITMAP, i);
339 i < BITS_PER_BITMAP;
340 i = find_next_bit(bitmap_info->bitmap, BITS_PER_BITMAP, i + 1)) {
341 next_zero = find_next_zero_bit(bitmap_info->bitmap,
342 BITS_PER_BITMAP, i);
343 if ((next_zero - i) >= bits) {
344 found_bits = next_zero - i;
345 break;
346 }
347 i = next_zero;
348 }
349
350 if (found_bits) {
351 *offset = (u64)(i * block_group->sectorsize) +
352 bitmap_info->offset;
353 *bytes = (u64)(found_bits) * block_group->sectorsize;
354 return 0;
355 }
356
357 return -1;
358}
359
360static struct btrfs_free_space *find_free_space(struct btrfs_block_group_cache
361 *block_group, u64 *offset,
362 u64 *bytes, int debug)
363{
364 struct btrfs_free_space *entry;
365 struct rb_node *node;
366 int ret;
367
368 if (!block_group->free_space_offset.rb_node)
369 return NULL;
370
371 entry = tree_search_offset(block_group,
372 offset_to_bitmap(block_group, *offset),
373 0, 1);
374 if (!entry)
375 return NULL;
376
377 for (node = &entry->offset_index; node; node = rb_next(node)) {
378 entry = rb_entry(node, struct btrfs_free_space, offset_index);
379 if (entry->bytes < *bytes)
380 continue;
381
382 if (entry->bitmap) {
383 ret = search_bitmap(block_group, entry, offset, bytes);
384 if (!ret)
385 return entry;
386 continue;
387 }
388
389 *offset = entry->offset;
390 *bytes = entry->bytes;
391 return entry;
392 }
393
394 return NULL;
395}
396
397static void add_new_bitmap(struct btrfs_block_group_cache *block_group,
398 struct btrfs_free_space *info, u64 offset)
399{
400 u64 bytes_per_bg = BITS_PER_BITMAP * block_group->sectorsize;
401 int max_bitmaps = (int)div64_u64(block_group->key.offset +
402 bytes_per_bg - 1, bytes_per_bg);
403 BUG_ON(block_group->total_bitmaps >= max_bitmaps);
404
405 info->offset = offset_to_bitmap(block_group, offset);
406 link_free_space(block_group, info);
407 block_group->total_bitmaps++;
408
409 recalculate_thresholds(block_group);
410}
411
412static noinline int remove_from_bitmap(struct btrfs_block_group_cache *block_group,
413 struct btrfs_free_space *bitmap_info,
414 u64 *offset, u64 *bytes)
415{
416 u64 end;
417
418again:
419 end = bitmap_info->offset +
420 (u64)(BITS_PER_BITMAP * block_group->sectorsize) - 1;
421
422 if (*offset > bitmap_info->offset && *offset + *bytes > end) {
423 bitmap_clear_bits(block_group, bitmap_info, *offset,
424 end - *offset + 1);
425 *bytes -= end - *offset + 1;
426 *offset = end + 1;
427 } else if (*offset >= bitmap_info->offset && *offset + *bytes <= end) {
428 bitmap_clear_bits(block_group, bitmap_info, *offset, *bytes);
429 *bytes = 0;
430 }
431
432 if (*bytes) {
433 if (!bitmap_info->bytes) {
434 unlink_free_space(block_group, bitmap_info);
435 kfree(bitmap_info->bitmap);
436 kfree(bitmap_info);
437 block_group->total_bitmaps--;
438 recalculate_thresholds(block_group);
439 }
440
441 bitmap_info = tree_search_offset(block_group,
442 offset_to_bitmap(block_group,
443 *offset),
444 1, 0);
445 if (!bitmap_info)
446 return -EINVAL;
447
448 if (!bitmap_info->bitmap)
449 return -EAGAIN;
450
451 goto again;
452 } else if (!bitmap_info->bytes) {
453 unlink_free_space(block_group, bitmap_info);
454 kfree(bitmap_info->bitmap);
455 kfree(bitmap_info);
456 block_group->total_bitmaps--;
457 recalculate_thresholds(block_group);
458 }
459
460 return 0;
461}
462
463static int insert_into_bitmap(struct btrfs_block_group_cache *block_group,
464 struct btrfs_free_space *info)
465{
466 struct btrfs_free_space *bitmap_info;
467 int added = 0;
468 u64 bytes, offset, end;
469 int ret;
470
471 /*
472 * If we are below the extents threshold then we can add this as an
473 * extent, and don't have to deal with the bitmap
474 */
475 if (block_group->free_extents < block_group->extents_thresh &&
476 info->bytes > block_group->sectorsize * 4)
477 return 0;
478
479 /*
480 * some block groups are so tiny they can't be enveloped by a bitmap, so
481 * don't even bother to create a bitmap for this
482 */
483 if (BITS_PER_BITMAP * block_group->sectorsize >
484 block_group->key.offset)
485 return 0;
486
487 bytes = info->bytes;
488 offset = info->offset;
489
490again:
491 bitmap_info = tree_search_offset(block_group,
492 offset_to_bitmap(block_group, offset),
493 1, 0);
494 if (!bitmap_info) {
495 BUG_ON(added);
496 goto new_bitmap;
497 }
498
499 end = bitmap_info->offset +
500 (u64)(BITS_PER_BITMAP * block_group->sectorsize);
501
502 if (offset >= bitmap_info->offset && offset + bytes > end) {
503 bitmap_set_bits(block_group, bitmap_info, offset,
504 end - offset);
505 bytes -= end - offset;
506 offset = end;
507 added = 0;
508 } else if (offset >= bitmap_info->offset && offset + bytes <= end) {
509 bitmap_set_bits(block_group, bitmap_info, offset, bytes);
510 bytes = 0;
511 } else {
512 BUG();
513 }
514
515 if (!bytes) {
516 ret = 1;
517 goto out;
518 } else
519 goto again;
520
521new_bitmap:
522 if (info && info->bitmap) {
523 add_new_bitmap(block_group, info, offset);
524 added = 1;
525 info = NULL;
526 goto again;
527 } else {
528 spin_unlock(&block_group->tree_lock);
529
530 /* no pre-allocated info, allocate a new one */
531 if (!info) {
532 info = kzalloc(sizeof(struct btrfs_free_space),
533 GFP_NOFS);
534 if (!info) {
535 spin_lock(&block_group->tree_lock);
536 ret = -ENOMEM;
537 goto out;
538 }
539 }
540
541 /* allocate the bitmap */
542 info->bitmap = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS);
543 spin_lock(&block_group->tree_lock);
544 if (!info->bitmap) {
545 ret = -ENOMEM;
546 goto out;
547 }
548 goto again;
549 }
550
551out:
552 if (info) {
553 if (info->bitmap)
554 kfree(info->bitmap);
555 kfree(info);
556 }
204 557
205 return ret; 558 return ret;
206} 559}
@@ -208,8 +561,8 @@ static int link_free_space(struct btrfs_block_group_cache *block_group,
208int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, 561int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
209 u64 offset, u64 bytes) 562 u64 offset, u64 bytes)
210{ 563{
211 struct btrfs_free_space *right_info; 564 struct btrfs_free_space *right_info = NULL;
212 struct btrfs_free_space *left_info; 565 struct btrfs_free_space *left_info = NULL;
213 struct btrfs_free_space *info = NULL; 566 struct btrfs_free_space *info = NULL;
214 int ret = 0; 567 int ret = 0;
215 568
@@ -227,18 +580,38 @@ int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
227 * are adding, if there is remove that struct and add a new one to 580 * are adding, if there is remove that struct and add a new one to
228 * cover the entire range 581 * cover the entire range
229 */ 582 */
230 right_info = tree_search_offset(&block_group->free_space_offset, 583 right_info = tree_search_offset(block_group, offset + bytes, 0, 0);
231 offset+bytes, 0, 0); 584 if (right_info && rb_prev(&right_info->offset_index))
232 left_info = tree_search_offset(&block_group->free_space_offset, 585 left_info = rb_entry(rb_prev(&right_info->offset_index),
233 offset-1, 0, 1); 586 struct btrfs_free_space, offset_index);
587 else
588 left_info = tree_search_offset(block_group, offset - 1, 0, 0);
234 589
235 if (right_info) { 590 /*
591 * If there was no extent directly to the left or right of this new
592 * extent then we know we're going to have to allocate a new extent, so
593 * before we do that see if we need to drop this into a bitmap
594 */
595 if ((!left_info || left_info->bitmap) &&
596 (!right_info || right_info->bitmap)) {
597 ret = insert_into_bitmap(block_group, info);
598
599 if (ret < 0) {
600 goto out;
601 } else if (ret) {
602 ret = 0;
603 goto out;
604 }
605 }
606
607 if (right_info && !right_info->bitmap) {
236 unlink_free_space(block_group, right_info); 608 unlink_free_space(block_group, right_info);
237 info->bytes += right_info->bytes; 609 info->bytes += right_info->bytes;
238 kfree(right_info); 610 kfree(right_info);
239 } 611 }
240 612
241 if (left_info && left_info->offset + left_info->bytes == offset) { 613 if (left_info && !left_info->bitmap &&
614 left_info->offset + left_info->bytes == offset) {
242 unlink_free_space(block_group, left_info); 615 unlink_free_space(block_group, left_info);
243 info->offset = left_info->offset; 616 info->offset = left_info->offset;
244 info->bytes += left_info->bytes; 617 info->bytes += left_info->bytes;
@@ -248,11 +621,11 @@ int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
248 ret = link_free_space(block_group, info); 621 ret = link_free_space(block_group, info);
249 if (ret) 622 if (ret)
250 kfree(info); 623 kfree(info);
251 624out:
252 spin_unlock(&block_group->tree_lock); 625 spin_unlock(&block_group->tree_lock);
253 626
254 if (ret) { 627 if (ret) {
255 printk(KERN_ERR "btrfs: unable to add free space :%d\n", ret); 628 printk(KERN_CRIT "btrfs: unable to add free space :%d\n", ret);
256 BUG_ON(ret == -EEXIST); 629 BUG_ON(ret == -EEXIST);
257 } 630 }
258 631
@@ -263,40 +636,65 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
263 u64 offset, u64 bytes) 636 u64 offset, u64 bytes)
264{ 637{
265 struct btrfs_free_space *info; 638 struct btrfs_free_space *info;
639 struct btrfs_free_space *next_info = NULL;
266 int ret = 0; 640 int ret = 0;
267 641
268 spin_lock(&block_group->tree_lock); 642 spin_lock(&block_group->tree_lock);
269 643
270 info = tree_search_offset(&block_group->free_space_offset, offset, 0, 644again:
271 1); 645 info = tree_search_offset(block_group, offset, 0, 0);
272 if (info && info->offset == offset) { 646 if (!info) {
273 if (info->bytes < bytes) { 647 WARN_ON(1);
274 printk(KERN_ERR "Found free space at %llu, size %llu," 648 goto out_lock;
275 "trying to use %llu\n", 649 }
276 (unsigned long long)info->offset, 650
277 (unsigned long long)info->bytes, 651 if (info->bytes < bytes && rb_next(&info->offset_index)) {
278 (unsigned long long)bytes); 652 u64 end;
653 next_info = rb_entry(rb_next(&info->offset_index),
654 struct btrfs_free_space,
655 offset_index);
656
657 if (next_info->bitmap)
658 end = next_info->offset + BITS_PER_BITMAP *
659 block_group->sectorsize - 1;
660 else
661 end = next_info->offset + next_info->bytes;
662
663 if (next_info->bytes < bytes ||
664 next_info->offset > offset || offset > end) {
665 printk(KERN_CRIT "Found free space at %llu, size %llu,"
666 " trying to use %llu\n",
667 (unsigned long long)info->offset,
668 (unsigned long long)info->bytes,
669 (unsigned long long)bytes);
279 WARN_ON(1); 670 WARN_ON(1);
280 ret = -EINVAL; 671 ret = -EINVAL;
281 spin_unlock(&block_group->tree_lock); 672 goto out_lock;
282 goto out;
283 } 673 }
284 unlink_free_space(block_group, info);
285 674
286 if (info->bytes == bytes) { 675 info = next_info;
287 kfree(info); 676 }
288 spin_unlock(&block_group->tree_lock); 677
289 goto out; 678 if (info->bytes == bytes) {
679 unlink_free_space(block_group, info);
680 if (info->bitmap) {
681 kfree(info->bitmap);
682 block_group->total_bitmaps--;
290 } 683 }
684 kfree(info);
685 goto out_lock;
686 }
291 687
688 if (!info->bitmap && info->offset == offset) {
689 unlink_free_space(block_group, info);
292 info->offset += bytes; 690 info->offset += bytes;
293 info->bytes -= bytes; 691 info->bytes -= bytes;
692 link_free_space(block_group, info);
693 goto out_lock;
694 }
294 695
295 ret = link_free_space(block_group, info); 696 if (!info->bitmap && info->offset <= offset &&
296 spin_unlock(&block_group->tree_lock); 697 info->offset + info->bytes >= offset + bytes) {
297 BUG_ON(ret);
298 } else if (info && info->offset < offset &&
299 info->offset + info->bytes >= offset + bytes) {
300 u64 old_start = info->offset; 698 u64 old_start = info->offset;
301 /* 699 /*
302 * we're freeing space in the middle of the info, 700 * we're freeing space in the middle of the info,
@@ -312,7 +710,9 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
312 info->offset = offset + bytes; 710 info->offset = offset + bytes;
313 info->bytes = old_end - info->offset; 711 info->bytes = old_end - info->offset;
314 ret = link_free_space(block_group, info); 712 ret = link_free_space(block_group, info);
315 BUG_ON(ret); 713 WARN_ON(ret);
714 if (ret)
715 goto out_lock;
316 } else { 716 } else {
317 /* the hole we're creating ends at the end 717 /* the hole we're creating ends at the end
318 * of the info struct, just free the info 718 * of the info struct, just free the info
@@ -320,32 +720,22 @@ int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
320 kfree(info); 720 kfree(info);
321 } 721 }
322 spin_unlock(&block_group->tree_lock); 722 spin_unlock(&block_group->tree_lock);
323 /* step two, insert a new info struct to cover anything 723
324 * before the hole 724 /* step two, insert a new info struct to cover
725 * anything before the hole
325 */ 726 */
326 ret = btrfs_add_free_space(block_group, old_start, 727 ret = btrfs_add_free_space(block_group, old_start,
327 offset - old_start); 728 offset - old_start);
328 BUG_ON(ret); 729 WARN_ON(ret);
329 } else { 730 goto out;
330 spin_unlock(&block_group->tree_lock);
331 if (!info) {
332 printk(KERN_ERR "couldn't find space %llu to free\n",
333 (unsigned long long)offset);
334 printk(KERN_ERR "cached is %d, offset %llu bytes %llu\n",
335 block_group->cached,
336 (unsigned long long)block_group->key.objectid,
337 (unsigned long long)block_group->key.offset);
338 btrfs_dump_free_space(block_group, bytes);
339 } else if (info) {
340 printk(KERN_ERR "hmm, found offset=%llu bytes=%llu, "
341 "but wanted offset=%llu bytes=%llu\n",
342 (unsigned long long)info->offset,
343 (unsigned long long)info->bytes,
344 (unsigned long long)offset,
345 (unsigned long long)bytes);
346 }
347 WARN_ON(1);
348 } 731 }
732
733 ret = remove_from_bitmap(block_group, info, &offset, &bytes);
734 if (ret == -EAGAIN)
735 goto again;
736 BUG_ON(ret);
737out_lock:
738 spin_unlock(&block_group->tree_lock);
349out: 739out:
350 return ret; 740 return ret;
351} 741}
@@ -361,10 +751,13 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,
361 info = rb_entry(n, struct btrfs_free_space, offset_index); 751 info = rb_entry(n, struct btrfs_free_space, offset_index);
362 if (info->bytes >= bytes) 752 if (info->bytes >= bytes)
363 count++; 753 count++;
364 printk(KERN_ERR "entry offset %llu, bytes %llu\n", 754 printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n",
365 (unsigned long long)info->offset, 755 (unsigned long long)info->offset,
366 (unsigned long long)info->bytes); 756 (unsigned long long)info->bytes,
757 (info->bitmap) ? "yes" : "no");
367 } 758 }
759 printk(KERN_INFO "block group has cluster?: %s\n",
760 list_empty(&block_group->cluster_list) ? "no" : "yes");
368 printk(KERN_INFO "%d blocks of free space at or bigger than bytes is" 761 printk(KERN_INFO "%d blocks of free space at or bigger than bytes is"
369 "\n", count); 762 "\n", count);
370} 763}
@@ -397,26 +790,35 @@ __btrfs_return_cluster_to_free_space(
397{ 790{
398 struct btrfs_free_space *entry; 791 struct btrfs_free_space *entry;
399 struct rb_node *node; 792 struct rb_node *node;
793 bool bitmap;
400 794
401 spin_lock(&cluster->lock); 795 spin_lock(&cluster->lock);
402 if (cluster->block_group != block_group) 796 if (cluster->block_group != block_group)
403 goto out; 797 goto out;
404 798
799 bitmap = cluster->points_to_bitmap;
800 cluster->block_group = NULL;
405 cluster->window_start = 0; 801 cluster->window_start = 0;
802 list_del_init(&cluster->block_group_list);
803 cluster->points_to_bitmap = false;
804
805 if (bitmap)
806 goto out;
807
406 node = rb_first(&cluster->root); 808 node = rb_first(&cluster->root);
407 while(node) { 809 while (node) {
408 entry = rb_entry(node, struct btrfs_free_space, offset_index); 810 entry = rb_entry(node, struct btrfs_free_space, offset_index);
409 node = rb_next(&entry->offset_index); 811 node = rb_next(&entry->offset_index);
410 rb_erase(&entry->offset_index, &cluster->root); 812 rb_erase(&entry->offset_index, &cluster->root);
411 link_free_space(block_group, entry); 813 BUG_ON(entry->bitmap);
814 tree_insert_offset(&block_group->free_space_offset,
815 entry->offset, &entry->offset_index, 0);
412 } 816 }
413 list_del_init(&cluster->block_group_list);
414
415 btrfs_put_block_group(cluster->block_group);
416 cluster->block_group = NULL;
417 cluster->root.rb_node = NULL; 817 cluster->root.rb_node = NULL;
818
418out: 819out:
419 spin_unlock(&cluster->lock); 820 spin_unlock(&cluster->lock);
821 btrfs_put_block_group(block_group);
420 return 0; 822 return 0;
421} 823}
422 824
@@ -425,20 +827,28 @@ void btrfs_remove_free_space_cache(struct btrfs_block_group_cache *block_group)
425 struct btrfs_free_space *info; 827 struct btrfs_free_space *info;
426 struct rb_node *node; 828 struct rb_node *node;
427 struct btrfs_free_cluster *cluster; 829 struct btrfs_free_cluster *cluster;
428 struct btrfs_free_cluster *safe; 830 struct list_head *head;
429 831
430 spin_lock(&block_group->tree_lock); 832 spin_lock(&block_group->tree_lock);
431 833 while ((head = block_group->cluster_list.next) !=
432 list_for_each_entry_safe(cluster, safe, &block_group->cluster_list, 834 &block_group->cluster_list) {
433 block_group_list) { 835 cluster = list_entry(head, struct btrfs_free_cluster,
836 block_group_list);
434 837
435 WARN_ON(cluster->block_group != block_group); 838 WARN_ON(cluster->block_group != block_group);
436 __btrfs_return_cluster_to_free_space(block_group, cluster); 839 __btrfs_return_cluster_to_free_space(block_group, cluster);
840 if (need_resched()) {
841 spin_unlock(&block_group->tree_lock);
842 cond_resched();
843 spin_lock(&block_group->tree_lock);
844 }
437 } 845 }
438 846
439 while ((node = rb_last(&block_group->free_space_bytes)) != NULL) { 847 while ((node = rb_last(&block_group->free_space_offset)) != NULL) {
440 info = rb_entry(node, struct btrfs_free_space, bytes_index); 848 info = rb_entry(node, struct btrfs_free_space, offset_index);
441 unlink_free_space(block_group, info); 849 unlink_free_space(block_group, info);
850 if (info->bitmap)
851 kfree(info->bitmap);
442 kfree(info); 852 kfree(info);
443 if (need_resched()) { 853 if (need_resched()) {
444 spin_unlock(&block_group->tree_lock); 854 spin_unlock(&block_group->tree_lock);
@@ -446,6 +856,7 @@ void btrfs_remove_free_space_cache(struct btrfs_block_group_cache *block_group)
446 spin_lock(&block_group->tree_lock); 856 spin_lock(&block_group->tree_lock);
447 } 857 }
448 } 858 }
859
449 spin_unlock(&block_group->tree_lock); 860 spin_unlock(&block_group->tree_lock);
450} 861}
451 862
@@ -453,25 +864,35 @@ u64 btrfs_find_space_for_alloc(struct btrfs_block_group_cache *block_group,
453 u64 offset, u64 bytes, u64 empty_size) 864 u64 offset, u64 bytes, u64 empty_size)
454{ 865{
455 struct btrfs_free_space *entry = NULL; 866 struct btrfs_free_space *entry = NULL;
867 u64 bytes_search = bytes + empty_size;
456 u64 ret = 0; 868 u64 ret = 0;
457 869
458 spin_lock(&block_group->tree_lock); 870 spin_lock(&block_group->tree_lock);
459 entry = tree_search_offset(&block_group->free_space_offset, offset, 871 entry = find_free_space(block_group, &offset, &bytes_search, 0);
460 bytes + empty_size, 1);
461 if (!entry) 872 if (!entry)
462 entry = tree_search_bytes(&block_group->free_space_bytes, 873 goto out;
463 offset, bytes + empty_size); 874
464 if (entry) { 875 ret = offset;
876 if (entry->bitmap) {
877 bitmap_clear_bits(block_group, entry, offset, bytes);
878 if (!entry->bytes) {
879 unlink_free_space(block_group, entry);
880 kfree(entry->bitmap);
881 kfree(entry);
882 block_group->total_bitmaps--;
883 recalculate_thresholds(block_group);
884 }
885 } else {
465 unlink_free_space(block_group, entry); 886 unlink_free_space(block_group, entry);
466 ret = entry->offset;
467 entry->offset += bytes; 887 entry->offset += bytes;
468 entry->bytes -= bytes; 888 entry->bytes -= bytes;
469
470 if (!entry->bytes) 889 if (!entry->bytes)
471 kfree(entry); 890 kfree(entry);
472 else 891 else
473 link_free_space(block_group, entry); 892 link_free_space(block_group, entry);
474 } 893 }
894
895out:
475 spin_unlock(&block_group->tree_lock); 896 spin_unlock(&block_group->tree_lock);
476 897
477 return ret; 898 return ret;
@@ -517,6 +938,47 @@ int btrfs_return_cluster_to_free_space(
517 return ret; 938 return ret;
518} 939}
519 940
941static u64 btrfs_alloc_from_bitmap(struct btrfs_block_group_cache *block_group,
942 struct btrfs_free_cluster *cluster,
943 u64 bytes, u64 min_start)
944{
945 struct btrfs_free_space *entry;
946 int err;
947 u64 search_start = cluster->window_start;
948 u64 search_bytes = bytes;
949 u64 ret = 0;
950
951 spin_lock(&block_group->tree_lock);
952 spin_lock(&cluster->lock);
953
954 if (!cluster->points_to_bitmap)
955 goto out;
956
957 if (cluster->block_group != block_group)
958 goto out;
959
960 entry = tree_search_offset(block_group, search_start, 0, 0);
961
962 if (!entry || !entry->bitmap)
963 goto out;
964
965 search_start = min_start;
966 search_bytes = bytes;
967
968 err = search_bitmap(block_group, entry, &search_start,
969 &search_bytes);
970 if (err)
971 goto out;
972
973 ret = search_start;
974 bitmap_clear_bits(block_group, entry, ret, bytes);
975out:
976 spin_unlock(&cluster->lock);
977 spin_unlock(&block_group->tree_lock);
978
979 return ret;
980}
981
520/* 982/*
521 * given a cluster, try to allocate 'bytes' from it, returns 0 983 * given a cluster, try to allocate 'bytes' from it, returns 0
522 * if it couldn't find anything suitably large, or a logical disk offset 984 * if it couldn't find anything suitably large, or a logical disk offset
@@ -530,6 +992,10 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
530 struct rb_node *node; 992 struct rb_node *node;
531 u64 ret = 0; 993 u64 ret = 0;
532 994
995 if (cluster->points_to_bitmap)
996 return btrfs_alloc_from_bitmap(block_group, cluster, bytes,
997 min_start);
998
533 spin_lock(&cluster->lock); 999 spin_lock(&cluster->lock);
534 if (bytes > cluster->max_size) 1000 if (bytes > cluster->max_size)
535 goto out; 1001 goto out;
@@ -567,9 +1033,73 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
567 } 1033 }
568out: 1034out:
569 spin_unlock(&cluster->lock); 1035 spin_unlock(&cluster->lock);
1036
570 return ret; 1037 return ret;
571} 1038}
572 1039
1040static int btrfs_bitmap_cluster(struct btrfs_block_group_cache *block_group,
1041 struct btrfs_free_space *entry,
1042 struct btrfs_free_cluster *cluster,
1043 u64 offset, u64 bytes, u64 min_bytes)
1044{
1045 unsigned long next_zero;
1046 unsigned long i;
1047 unsigned long search_bits;
1048 unsigned long total_bits;
1049 unsigned long found_bits;
1050 unsigned long start = 0;
1051 unsigned long total_found = 0;
1052 bool found = false;
1053
1054 i = offset_to_bit(entry->offset, block_group->sectorsize,
1055 max_t(u64, offset, entry->offset));
1056 search_bits = bytes_to_bits(min_bytes, block_group->sectorsize);
1057 total_bits = bytes_to_bits(bytes, block_group->sectorsize);
1058
1059again:
1060 found_bits = 0;
1061 for (i = find_next_bit(entry->bitmap, BITS_PER_BITMAP, i);
1062 i < BITS_PER_BITMAP;
1063 i = find_next_bit(entry->bitmap, BITS_PER_BITMAP, i + 1)) {
1064 next_zero = find_next_zero_bit(entry->bitmap,
1065 BITS_PER_BITMAP, i);
1066 if (next_zero - i >= search_bits) {
1067 found_bits = next_zero - i;
1068 break;
1069 }
1070 i = next_zero;
1071 }
1072
1073 if (!found_bits)
1074 return -1;
1075
1076 if (!found) {
1077 start = i;
1078 found = true;
1079 }
1080
1081 total_found += found_bits;
1082
1083 if (cluster->max_size < found_bits * block_group->sectorsize)
1084 cluster->max_size = found_bits * block_group->sectorsize;
1085
1086 if (total_found < total_bits) {
1087 i = find_next_bit(entry->bitmap, BITS_PER_BITMAP, next_zero);
1088 if (i - start > total_bits * 2) {
1089 total_found = 0;
1090 cluster->max_size = 0;
1091 found = false;
1092 }
1093 goto again;
1094 }
1095
1096 cluster->window_start = start * block_group->sectorsize +
1097 entry->offset;
1098 cluster->points_to_bitmap = true;
1099
1100 return 0;
1101}
1102
573/* 1103/*
574 * here we try to find a cluster of blocks in a block group. The goal 1104 * here we try to find a cluster of blocks in a block group. The goal
575 * is to find at least bytes free and up to empty_size + bytes free. 1105 * is to find at least bytes free and up to empty_size + bytes free.
@@ -587,12 +1117,12 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle *trans,
587 struct btrfs_free_space *entry = NULL; 1117 struct btrfs_free_space *entry = NULL;
588 struct rb_node *node; 1118 struct rb_node *node;
589 struct btrfs_free_space *next; 1119 struct btrfs_free_space *next;
590 struct btrfs_free_space *last; 1120 struct btrfs_free_space *last = NULL;
591 u64 min_bytes; 1121 u64 min_bytes;
592 u64 window_start; 1122 u64 window_start;
593 u64 window_free; 1123 u64 window_free;
594 u64 max_extent = 0; 1124 u64 max_extent = 0;
595 int total_retries = 0; 1125 bool found_bitmap = false;
596 int ret; 1126 int ret;
597 1127
598 /* for metadata, allow allocates with more holes */ 1128 /* for metadata, allow allocates with more holes */
@@ -620,31 +1150,80 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle *trans,
620 goto out; 1150 goto out;
621 } 1151 }
622again: 1152again:
623 min_bytes = min(min_bytes, bytes + empty_size); 1153 entry = tree_search_offset(block_group, offset, found_bitmap, 1);
624 entry = tree_search_bytes(&block_group->free_space_bytes,
625 offset, min_bytes);
626 if (!entry) { 1154 if (!entry) {
627 ret = -ENOSPC; 1155 ret = -ENOSPC;
628 goto out; 1156 goto out;
629 } 1157 }
1158
1159 /*
1160 * If found_bitmap is true, we exhausted our search for extent entries,
1161 * and we just want to search all of the bitmaps that we can find, and
1162 * ignore any extent entries we find.
1163 */
1164 while (entry->bitmap || found_bitmap ||
1165 (!entry->bitmap && entry->bytes < min_bytes)) {
1166 struct rb_node *node = rb_next(&entry->offset_index);
1167
1168 if (entry->bitmap && entry->bytes > bytes + empty_size) {
1169 ret = btrfs_bitmap_cluster(block_group, entry, cluster,
1170 offset, bytes + empty_size,
1171 min_bytes);
1172 if (!ret)
1173 goto got_it;
1174 }
1175
1176 if (!node) {
1177 ret = -ENOSPC;
1178 goto out;
1179 }
1180 entry = rb_entry(node, struct btrfs_free_space, offset_index);
1181 }
1182
1183 /*
1184 * We already searched all the extent entries from the passed in offset
1185 * to the end and didn't find enough space for the cluster, and we also
1186 * didn't find any bitmaps that met our criteria, just go ahead and exit
1187 */
1188 if (found_bitmap) {
1189 ret = -ENOSPC;
1190 goto out;
1191 }
1192
1193 cluster->points_to_bitmap = false;
630 window_start = entry->offset; 1194 window_start = entry->offset;
631 window_free = entry->bytes; 1195 window_free = entry->bytes;
632 last = entry; 1196 last = entry;
633 max_extent = entry->bytes; 1197 max_extent = entry->bytes;
634 1198
635 while(1) { 1199 while (1) {
636 /* out window is just right, lets fill it */ 1200 /* out window is just right, lets fill it */
637 if (window_free >= bytes + empty_size) 1201 if (window_free >= bytes + empty_size)
638 break; 1202 break;
639 1203
640 node = rb_next(&last->offset_index); 1204 node = rb_next(&last->offset_index);
641 if (!node) { 1205 if (!node) {
1206 if (found_bitmap)
1207 goto again;
642 ret = -ENOSPC; 1208 ret = -ENOSPC;
643 goto out; 1209 goto out;
644 } 1210 }
645 next = rb_entry(node, struct btrfs_free_space, offset_index); 1211 next = rb_entry(node, struct btrfs_free_space, offset_index);
646 1212
647 /* 1213 /*
1214 * we found a bitmap, so if this search doesn't result in a
1215 * cluster, we know to go and search again for the bitmaps and
1216 * start looking for space there
1217 */
1218 if (next->bitmap) {
1219 if (!found_bitmap)
1220 offset = next->offset;
1221 found_bitmap = true;
1222 last = next;
1223 continue;
1224 }
1225
1226 /*
648 * we haven't filled the empty size and the window is 1227 * we haven't filled the empty size and the window is
649 * very large. reset and try again 1228 * very large. reset and try again
650 */ 1229 */
@@ -655,19 +1234,6 @@ again:
655 window_free = entry->bytes; 1234 window_free = entry->bytes;
656 last = entry; 1235 last = entry;
657 max_extent = 0; 1236 max_extent = 0;
658 total_retries++;
659 if (total_retries % 64 == 0) {
660 if (min_bytes >= (bytes + empty_size)) {
661 ret = -ENOSPC;
662 goto out;
663 }
664 /*
665 * grow our allocation a bit, we're not having
666 * much luck
667 */
668 min_bytes *= 2;
669 goto again;
670 }
671 } else { 1237 } else {
672 last = next; 1238 last = next;
673 window_free += next->bytes; 1239 window_free += next->bytes;
@@ -685,11 +1251,19 @@ again:
685 * The cluster includes an rbtree, but only uses the offset index 1251 * The cluster includes an rbtree, but only uses the offset index
686 * of each free space cache entry. 1252 * of each free space cache entry.
687 */ 1253 */
688 while(1) { 1254 while (1) {
689 node = rb_next(&entry->offset_index); 1255 node = rb_next(&entry->offset_index);
690 unlink_free_space(block_group, entry); 1256 if (entry->bitmap && node) {
1257 entry = rb_entry(node, struct btrfs_free_space,
1258 offset_index);
1259 continue;
1260 } else if (entry->bitmap && !node) {
1261 break;
1262 }
1263
1264 rb_erase(&entry->offset_index, &block_group->free_space_offset);
691 ret = tree_insert_offset(&cluster->root, entry->offset, 1265 ret = tree_insert_offset(&cluster->root, entry->offset,
692 &entry->offset_index); 1266 &entry->offset_index, 0);
693 BUG_ON(ret); 1267 BUG_ON(ret);
694 1268
695 if (!node || entry == last) 1269 if (!node || entry == last)
@@ -697,8 +1271,10 @@ again:
697 1271
698 entry = rb_entry(node, struct btrfs_free_space, offset_index); 1272 entry = rb_entry(node, struct btrfs_free_space, offset_index);
699 } 1273 }
700 ret = 0; 1274
701 cluster->max_size = max_extent; 1275 cluster->max_size = max_extent;
1276got_it:
1277 ret = 0;
702 atomic_inc(&block_group->count); 1278 atomic_inc(&block_group->count);
703 list_add_tail(&cluster->block_group_list, &block_group->cluster_list); 1279 list_add_tail(&cluster->block_group_list, &block_group->cluster_list);
704 cluster->block_group = block_group; 1280 cluster->block_group = block_group;
@@ -718,6 +1294,7 @@ void btrfs_init_free_cluster(struct btrfs_free_cluster *cluster)
718 spin_lock_init(&cluster->refill_lock); 1294 spin_lock_init(&cluster->refill_lock);
719 cluster->root.rb_node = NULL; 1295 cluster->root.rb_node = NULL;
720 cluster->max_size = 0; 1296 cluster->max_size = 0;
1297 cluster->points_to_bitmap = false;
721 INIT_LIST_HEAD(&cluster->block_group_list); 1298 INIT_LIST_HEAD(&cluster->block_group_list);
722 cluster->block_group = NULL; 1299 cluster->block_group = NULL;
723} 1300}
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
index 266fb8764054..890a8e79011b 100644
--- a/fs/btrfs/free-space-cache.h
+++ b/fs/btrfs/free-space-cache.h
@@ -19,6 +19,14 @@
19#ifndef __BTRFS_FREE_SPACE_CACHE 19#ifndef __BTRFS_FREE_SPACE_CACHE
20#define __BTRFS_FREE_SPACE_CACHE 20#define __BTRFS_FREE_SPACE_CACHE
21 21
22struct btrfs_free_space {
23 struct rb_node offset_index;
24 u64 offset;
25 u64 bytes;
26 unsigned long *bitmap;
27 struct list_head list;
28};
29
22int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, 30int btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
23 u64 bytenr, u64 size); 31 u64 bytenr, u64 size);
24int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group, 32int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7ffa3d34ea19..56fe83fa60c4 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -26,7 +26,6 @@
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/smp_lock.h>
30#include <linux/backing-dev.h> 29#include <linux/backing-dev.h>
31#include <linux/mpage.h> 30#include <linux/mpage.h>
32#include <linux/swap.h> 31#include <linux/swap.h>
@@ -2604,8 +2603,8 @@ noinline int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
2604 if (root->ref_cows) 2603 if (root->ref_cows)
2605 btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0); 2604 btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0);
2606 path = btrfs_alloc_path(); 2605 path = btrfs_alloc_path();
2607 path->reada = -1;
2608 BUG_ON(!path); 2606 BUG_ON(!path);
2607 path->reada = -1;
2609 2608
2610 /* FIXME, add redo link to tree so we don't leak on crash */ 2609 /* FIXME, add redo link to tree so we don't leak on crash */
2611 key.objectid = inode->i_ino; 2610 key.objectid = inode->i_ino;
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 9f4db848db10..bd88f25889f7 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -27,7 +27,6 @@
27#include <linux/time.h> 27#include <linux/time.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/smp_lock.h>
31#include <linux/backing-dev.h> 30#include <linux/backing-dev.h>
32#include <linux/mount.h> 31#include <linux/mount.h>
33#include <linux/mpage.h> 32#include <linux/mpage.h>
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 6d6523da0a30..0d126be22b63 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -309,7 +309,7 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
309 } 309 }
310 printk(KERN_INFO "node %llu level %d total ptrs %d free spc %u\n", 310 printk(KERN_INFO "node %llu level %d total ptrs %d free spc %u\n",
311 (unsigned long long)btrfs_header_bytenr(c), 311 (unsigned long long)btrfs_header_bytenr(c),
312 btrfs_header_level(c), nr, 312 level, nr,
313 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); 313 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
314 for (i = 0; i < nr; i++) { 314 for (i = 0; i < nr; i++) {
315 btrfs_node_key_to_cpu(c, &key, i); 315 btrfs_node_key_to_cpu(c, &key, i);
@@ -326,10 +326,10 @@ void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
326 btrfs_level_size(root, level - 1), 326 btrfs_level_size(root, level - 1),
327 btrfs_node_ptr_generation(c, i)); 327 btrfs_node_ptr_generation(c, i));
328 if (btrfs_is_leaf(next) && 328 if (btrfs_is_leaf(next) &&
329 btrfs_header_level(c) != 1) 329 level != 1)
330 BUG(); 330 BUG();
331 if (btrfs_header_level(next) != 331 if (btrfs_header_level(next) !=
332 btrfs_header_level(c) - 1) 332 level - 1)
333 BUG(); 333 BUG();
334 btrfs_print_tree(root, next); 334 btrfs_print_tree(root, next);
335 free_extent_buffer(next); 335 free_extent_buffer(next);
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 008397934778..e71264d1c2c9 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -670,6 +670,8 @@ again:
670 err = ret; 670 err = ret;
671 goto out; 671 goto out;
672 } 672 }
673 if (ret > 0 && path2->slots[level] > 0)
674 path2->slots[level]--;
673 675
674 eb = path2->nodes[level]; 676 eb = path2->nodes[level];
675 WARN_ON(btrfs_node_blockptr(eb, path2->slots[level]) != 677 WARN_ON(btrfs_node_blockptr(eb, path2->slots[level]) !=
@@ -1609,6 +1611,7 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc,
1609 BUG_ON(level == 0); 1611 BUG_ON(level == 0);
1610 path->lowest_level = level; 1612 path->lowest_level = level;
1611 ret = btrfs_search_slot(NULL, reloc_root, &key, path, 0, 0); 1613 ret = btrfs_search_slot(NULL, reloc_root, &key, path, 0, 0);
1614 path->lowest_level = 0;
1612 if (ret < 0) { 1615 if (ret < 0) {
1613 btrfs_free_path(path); 1616 btrfs_free_path(path);
1614 return ret; 1617 return ret;
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 9f179d4832d5..6d6d06cb6dfc 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -26,7 +26,6 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/smp_lock.h>
30#include <linux/backing-dev.h> 29#include <linux/backing-dev.h>
31#include <linux/mount.h> 30#include <linux/mount.h>
32#include <linux/mpage.h> 31#include <linux/mpage.h>
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 2dbf1c1f56ee..cdbb5022da52 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -40,6 +40,12 @@ static noinline void put_transaction(struct btrfs_transaction *transaction)
40 } 40 }
41} 41}
42 42
43static noinline void switch_commit_root(struct btrfs_root *root)
44{
45 free_extent_buffer(root->commit_root);
46 root->commit_root = btrfs_root_node(root);
47}
48
43/* 49/*
44 * either allocate a new transaction or hop into the existing one 50 * either allocate a new transaction or hop into the existing one
45 */ 51 */
@@ -444,9 +450,6 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
444 450
445 btrfs_write_dirty_block_groups(trans, root); 451 btrfs_write_dirty_block_groups(trans, root);
446 452
447 ret = btrfs_run_delayed_refs(trans, root, (unsigned long)-1);
448 BUG_ON(ret);
449
450 while (1) { 453 while (1) {
451 old_root_bytenr = btrfs_root_bytenr(&root->root_item); 454 old_root_bytenr = btrfs_root_bytenr(&root->root_item);
452 if (old_root_bytenr == root->node->start) 455 if (old_root_bytenr == root->node->start)
@@ -457,13 +460,14 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
457 &root->root_key, 460 &root->root_key,
458 &root->root_item); 461 &root->root_item);
459 BUG_ON(ret); 462 BUG_ON(ret);
460 btrfs_write_dirty_block_groups(trans, root);
461 463
462 ret = btrfs_run_delayed_refs(trans, root, (unsigned long)-1); 464 ret = btrfs_write_dirty_block_groups(trans, root);
463 BUG_ON(ret); 465 BUG_ON(ret);
464 } 466 }
465 free_extent_buffer(root->commit_root); 467
466 root->commit_root = btrfs_root_node(root); 468 if (root != root->fs_info->extent_root)
469 switch_commit_root(root);
470
467 return 0; 471 return 0;
468} 472}
469 473
@@ -495,10 +499,12 @@ static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans,
495 root = list_entry(next, struct btrfs_root, dirty_list); 499 root = list_entry(next, struct btrfs_root, dirty_list);
496 500
497 update_cowonly_root(trans, root); 501 update_cowonly_root(trans, root);
498
499 ret = btrfs_run_delayed_refs(trans, root, (unsigned long)-1);
500 BUG_ON(ret);
501 } 502 }
503
504 down_write(&fs_info->extent_commit_sem);
505 switch_commit_root(fs_info->extent_root);
506 up_write(&fs_info->extent_commit_sem);
507
502 return 0; 508 return 0;
503} 509}
504 510
@@ -544,8 +550,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans,
544 btrfs_update_reloc_root(trans, root); 550 btrfs_update_reloc_root(trans, root);
545 551
546 if (root->commit_root != root->node) { 552 if (root->commit_root != root->node) {
547 free_extent_buffer(root->commit_root); 553 switch_commit_root(root);
548 root->commit_root = btrfs_root_node(root);
549 btrfs_set_root_node(&root->root_item, 554 btrfs_set_root_node(&root->root_item,
550 root->node); 555 root->node);
551 } 556 }
@@ -852,6 +857,16 @@ static void update_super_roots(struct btrfs_root *root)
852 super->root_level = root_item->level; 857 super->root_level = root_item->level;
853} 858}
854 859
860int btrfs_transaction_in_commit(struct btrfs_fs_info *info)
861{
862 int ret = 0;
863 spin_lock(&info->new_trans_lock);
864 if (info->running_transaction)
865 ret = info->running_transaction->in_commit;
866 spin_unlock(&info->new_trans_lock);
867 return ret;
868}
869
855int btrfs_commit_transaction(struct btrfs_trans_handle *trans, 870int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
856 struct btrfs_root *root) 871 struct btrfs_root *root)
857{ 872{
@@ -943,9 +958,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
943 958
944 mutex_unlock(&root->fs_info->trans_mutex); 959 mutex_unlock(&root->fs_info->trans_mutex);
945 960
946 if (flush_on_commit || snap_pending) { 961 if (flush_on_commit) {
947 if (flush_on_commit) 962 btrfs_start_delalloc_inodes(root);
948 btrfs_start_delalloc_inodes(root); 963 ret = btrfs_wait_ordered_extents(root, 0);
964 BUG_ON(ret);
965 } else if (snap_pending) {
949 ret = btrfs_wait_ordered_extents(root, 1); 966 ret = btrfs_wait_ordered_extents(root, 1);
950 BUG_ON(ret); 967 BUG_ON(ret);
951 } 968 }
@@ -1009,15 +1026,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1009 1026
1010 btrfs_set_root_node(&root->fs_info->tree_root->root_item, 1027 btrfs_set_root_node(&root->fs_info->tree_root->root_item,
1011 root->fs_info->tree_root->node); 1028 root->fs_info->tree_root->node);
1012 free_extent_buffer(root->fs_info->tree_root->commit_root); 1029 switch_commit_root(root->fs_info->tree_root);
1013 root->fs_info->tree_root->commit_root =
1014 btrfs_root_node(root->fs_info->tree_root);
1015 1030
1016 btrfs_set_root_node(&root->fs_info->chunk_root->root_item, 1031 btrfs_set_root_node(&root->fs_info->chunk_root->root_item,
1017 root->fs_info->chunk_root->node); 1032 root->fs_info->chunk_root->node);
1018 free_extent_buffer(root->fs_info->chunk_root->commit_root); 1033 switch_commit_root(root->fs_info->chunk_root);
1019 root->fs_info->chunk_root->commit_root =
1020 btrfs_root_node(root->fs_info->chunk_root);
1021 1034
1022 update_super_roots(root); 1035 update_super_roots(root);
1023 1036
@@ -1057,6 +1070,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1057 cur_trans->commit_done = 1; 1070 cur_trans->commit_done = 1;
1058 1071
1059 root->fs_info->last_trans_committed = cur_trans->transid; 1072 root->fs_info->last_trans_committed = cur_trans->transid;
1073
1060 wake_up(&cur_trans->commit_wait); 1074 wake_up(&cur_trans->commit_wait);
1061 1075
1062 put_transaction(cur_trans); 1076 put_transaction(cur_trans);
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 961c3ee5a2e1..663c67404918 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -107,4 +107,5 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
107 struct btrfs_root *root); 107 struct btrfs_root *root);
108int btrfs_write_and_wait_marked_extents(struct btrfs_root *root, 108int btrfs_write_and_wait_marked_extents(struct btrfs_root *root,
109 struct extent_io_tree *dirty_pages); 109 struct extent_io_tree *dirty_pages);
110int btrfs_transaction_in_commit(struct btrfs_fs_info *info);
110#endif 111#endif
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c13922206d1b..d91b0de7c502 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -797,7 +797,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
797 return -ENOENT; 797 return -ENOENT;
798 798
799 inode = read_one_inode(root, key->objectid); 799 inode = read_one_inode(root, key->objectid);
800 BUG_ON(!dir); 800 BUG_ON(!inode);
801 801
802 ref_ptr = btrfs_item_ptr_offset(eb, slot); 802 ref_ptr = btrfs_item_ptr_offset(eb, slot);
803 ref_end = ref_ptr + btrfs_item_size_nr(eb, slot); 803 ref_end = ref_ptr + btrfs_item_size_nr(eb, slot);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3ab80e9cd767..5dbefd11b4af 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -721,7 +721,8 @@ error:
721 */ 721 */
722static noinline int find_free_dev_extent(struct btrfs_trans_handle *trans, 722static noinline int find_free_dev_extent(struct btrfs_trans_handle *trans,
723 struct btrfs_device *device, 723 struct btrfs_device *device,
724 u64 num_bytes, u64 *start) 724 u64 num_bytes, u64 *start,
725 u64 *max_avail)
725{ 726{
726 struct btrfs_key key; 727 struct btrfs_key key;
727 struct btrfs_root *root = device->dev_root; 728 struct btrfs_root *root = device->dev_root;
@@ -758,9 +759,13 @@ static noinline int find_free_dev_extent(struct btrfs_trans_handle *trans,
758 ret = btrfs_search_slot(trans, root, &key, path, 0, 0); 759 ret = btrfs_search_slot(trans, root, &key, path, 0, 0);
759 if (ret < 0) 760 if (ret < 0)
760 goto error; 761 goto error;
761 ret = btrfs_previous_item(root, path, 0, key.type); 762 if (ret > 0) {
762 if (ret < 0) 763 ret = btrfs_previous_item(root, path, key.objectid, key.type);
763 goto error; 764 if (ret < 0)
765 goto error;
766 if (ret > 0)
767 start_found = 1;
768 }
764 l = path->nodes[0]; 769 l = path->nodes[0];
765 btrfs_item_key_to_cpu(l, &key, path->slots[0]); 770 btrfs_item_key_to_cpu(l, &key, path->slots[0]);
766 while (1) { 771 while (1) {
@@ -803,6 +808,10 @@ no_more_items:
803 if (last_byte < search_start) 808 if (last_byte < search_start)
804 last_byte = search_start; 809 last_byte = search_start;
805 hole_size = key.offset - last_byte; 810 hole_size = key.offset - last_byte;
811
812 if (hole_size > *max_avail)
813 *max_avail = hole_size;
814
806 if (key.offset > last_byte && 815 if (key.offset > last_byte &&
807 hole_size >= num_bytes) { 816 hole_size >= num_bytes) {
808 *start = last_byte; 817 *start = last_byte;
@@ -1621,6 +1630,7 @@ static int __btrfs_grow_device(struct btrfs_trans_handle *trans,
1621 device->fs_devices->total_rw_bytes += diff; 1630 device->fs_devices->total_rw_bytes += diff;
1622 1631
1623 device->total_bytes = new_size; 1632 device->total_bytes = new_size;
1633 device->disk_total_bytes = new_size;
1624 btrfs_clear_space_info_full(device->dev_root->fs_info); 1634 btrfs_clear_space_info_full(device->dev_root->fs_info);
1625 1635
1626 return btrfs_update_device(trans, device); 1636 return btrfs_update_device(trans, device);
@@ -2007,7 +2017,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
2007 goto done; 2017 goto done;
2008 if (ret) { 2018 if (ret) {
2009 ret = 0; 2019 ret = 0;
2010 goto done; 2020 break;
2011 } 2021 }
2012 2022
2013 l = path->nodes[0]; 2023 l = path->nodes[0];
@@ -2015,7 +2025,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
2015 btrfs_item_key_to_cpu(l, &key, path->slots[0]); 2025 btrfs_item_key_to_cpu(l, &key, path->slots[0]);
2016 2026
2017 if (key.objectid != device->devid) 2027 if (key.objectid != device->devid)
2018 goto done; 2028 break;
2019 2029
2020 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent); 2030 dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
2021 length = btrfs_dev_extent_length(l, dev_extent); 2031 length = btrfs_dev_extent_length(l, dev_extent);
@@ -2171,6 +2181,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
2171 max_chunk_size); 2181 max_chunk_size);
2172 2182
2173again: 2183again:
2184 max_avail = 0;
2174 if (!map || map->num_stripes != num_stripes) { 2185 if (!map || map->num_stripes != num_stripes) {
2175 kfree(map); 2186 kfree(map);
2176 map = kmalloc(map_lookup_size(num_stripes), GFP_NOFS); 2187 map = kmalloc(map_lookup_size(num_stripes), GFP_NOFS);
@@ -2219,7 +2230,8 @@ again:
2219 2230
2220 if (device->in_fs_metadata && avail >= min_free) { 2231 if (device->in_fs_metadata && avail >= min_free) {
2221 ret = find_free_dev_extent(trans, device, 2232 ret = find_free_dev_extent(trans, device,
2222 min_free, &dev_offset); 2233 min_free, &dev_offset,
2234 &max_avail);
2223 if (ret == 0) { 2235 if (ret == 0) {
2224 list_move_tail(&device->dev_alloc_list, 2236 list_move_tail(&device->dev_alloc_list,
2225 &private_devs); 2237 &private_devs);
@@ -2795,26 +2807,6 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
2795 } 2807 }
2796 } 2808 }
2797 2809
2798 for (i = 0; i > nr; i++) {
2799 struct btrfs_multi_bio *multi;
2800 struct btrfs_bio_stripe *stripe;
2801 int ret;
2802
2803 length = 1;
2804 ret = btrfs_map_block(map_tree, WRITE, buf[i],
2805 &length, &multi, 0);
2806 BUG_ON(ret);
2807
2808 stripe = multi->stripes;
2809 for (j = 0; j < multi->num_stripes; j++) {
2810 if (stripe->physical >= physical &&
2811 physical < stripe->physical + length)
2812 break;
2813 }
2814 BUG_ON(j >= multi->num_stripes);
2815 kfree(multi);
2816 }
2817
2818 *logical = buf; 2810 *logical = buf;
2819 *naddrs = nr; 2811 *naddrs = nr;
2820 *stripe_len = map->stripe_len; 2812 *stripe_len = map->stripe_len;
diff --git a/fs/char_dev.c b/fs/char_dev.c
index b7c9d5187a75..a173551e19d7 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -13,7 +13,6 @@
13#include <linux/major.h> 13#include <linux/major.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/smp_lock.h>
17#include <linux/seq_file.h> 16#include <linux/seq_file.h>
18 17
19#include <linux/kobject.h> 18#include <linux/kobject.h>
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 7f19fefd3d45..42cec2a7c0cf 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -261,6 +261,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
261 atomic_set(&tcon->num_reads, 0); 261 atomic_set(&tcon->num_reads, 0);
262 atomic_set(&tcon->num_oplock_brks, 0); 262 atomic_set(&tcon->num_oplock_brks, 0);
263 atomic_set(&tcon->num_opens, 0); 263 atomic_set(&tcon->num_opens, 0);
264 atomic_set(&tcon->num_posixopens, 0);
265 atomic_set(&tcon->num_posixmkdirs, 0);
264 atomic_set(&tcon->num_closes, 0); 266 atomic_set(&tcon->num_closes, 0);
265 atomic_set(&tcon->num_deletes, 0); 267 atomic_set(&tcon->num_deletes, 0);
266 atomic_set(&tcon->num_mkdirs, 0); 268 atomic_set(&tcon->num_mkdirs, 0);
@@ -347,11 +349,15 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
347 atomic_read(&tcon->num_locks), 349 atomic_read(&tcon->num_locks),
348 atomic_read(&tcon->num_hardlinks), 350 atomic_read(&tcon->num_hardlinks),
349 atomic_read(&tcon->num_symlinks)); 351 atomic_read(&tcon->num_symlinks));
350 seq_printf(m, "\nOpens: %d Closes: %d" 352 seq_printf(m, "\nOpens: %d Closes: %d "
351 "Deletes: %d", 353 "Deletes: %d",
352 atomic_read(&tcon->num_opens), 354 atomic_read(&tcon->num_opens),
353 atomic_read(&tcon->num_closes), 355 atomic_read(&tcon->num_closes),
354 atomic_read(&tcon->num_deletes)); 356 atomic_read(&tcon->num_deletes));
357 seq_printf(m, "\nPosix Opens: %d "
358 "Posix Mkdirs: %d",
359 atomic_read(&tcon->num_posixopens),
360 atomic_read(&tcon->num_posixmkdirs));
355 seq_printf(m, "\nMkdirs: %d Rmdirs: %d", 361 seq_printf(m, "\nMkdirs: %d Rmdirs: %d",
356 atomic_read(&tcon->num_mkdirs), 362 atomic_read(&tcon->num_mkdirs),
357 atomic_read(&tcon->num_rmdirs)); 363 atomic_read(&tcon->num_rmdirs));
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 63f6cdfa5638..6084d6379c03 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -260,6 +260,8 @@ struct cifsTconInfo {
260 atomic_t num_closes; 260 atomic_t num_closes;
261 atomic_t num_deletes; 261 atomic_t num_deletes;
262 atomic_t num_mkdirs; 262 atomic_t num_mkdirs;
263 atomic_t num_posixopens;
264 atomic_t num_posixmkdirs;
263 atomic_t num_rmdirs; 265 atomic_t num_rmdirs;
264 atomic_t num_renames; 266 atomic_t num_renames;
265 atomic_t num_t2renames; 267 atomic_t num_t2renames;
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 922f5fe2084c..1866bc2927d4 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1113,7 +1113,10 @@ PsxCreat:
1113psx_create_err: 1113psx_create_err:
1114 cifs_buf_release(pSMB); 1114 cifs_buf_release(pSMB);
1115 1115
1116 cifs_stats_inc(&tcon->num_mkdirs); 1116 if (posix_flags & SMB_O_DIRECTORY)
1117 cifs_stats_inc(&tcon->num_posixmkdirs);
1118 else
1119 cifs_stats_inc(&tcon->num_posixopens);
1117 1120
1118 if (rc == -EAGAIN) 1121 if (rc == -EAGAIN)
1119 goto PsxCreat; 1122 goto PsxCreat;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e16d7592116a..fc44d316d0bb 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2452,10 +2452,10 @@ try_mount_again:
2452 tcon->local_lease = volume_info->local_lease; 2452 tcon->local_lease = volume_info->local_lease;
2453 } 2453 }
2454 if (pSesInfo) { 2454 if (pSesInfo) {
2455 if (pSesInfo->capabilities & CAP_LARGE_FILES) { 2455 if (pSesInfo->capabilities & CAP_LARGE_FILES)
2456 sb->s_maxbytes = (u64) 1 << 63; 2456 sb->s_maxbytes = MAX_LFS_FILESIZE;
2457 } else 2457 else
2458 sb->s_maxbytes = (u64) 1 << 31; /* 2 GB */ 2458 sb->s_maxbytes = MAX_NON_LFS;
2459 } 2459 }
2460 2460
2461 /* BB FIXME fix time_gran to be larger for LANMAN sessions */ 2461 /* BB FIXME fix time_gran to be larger for LANMAN sessions */
@@ -2726,6 +2726,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
2726 strncpy(tcon->treeName, tree, MAX_TREE_SIZE); 2726 strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
2727 2727
2728 /* mostly informational -- no need to fail on error here */ 2728 /* mostly informational -- no need to fail on error here */
2729 kfree(tcon->nativeFileSystem);
2729 tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, 2730 tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr,
2730 bytes_left, is_unicode, 2731 bytes_left, is_unicode,
2731 nls_codepage); 2732 nls_codepage);
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 18afe57b2461..82d83839655e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -212,7 +212,7 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
212 * junction to the new submount (ie to setup the fake directory 212 * junction to the new submount (ie to setup the fake directory
213 * which represents a DFS referral). 213 * which represents a DFS referral).
214 */ 214 */
215void 215static void
216cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) 216cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
217{ 217{
218 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 218 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
@@ -388,7 +388,7 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
388} 388}
389 389
390/* Fill a cifs_fattr struct with info from FILE_ALL_INFO */ 390/* Fill a cifs_fattr struct with info from FILE_ALL_INFO */
391void 391static void
392cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, 392cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
393 struct cifs_sb_info *cifs_sb, bool adjust_tz) 393 struct cifs_sb_info *cifs_sb, bool adjust_tz)
394{ 394{
@@ -513,9 +513,12 @@ int cifs_get_inode_info(struct inode **pinode,
513 cifs_sb->mnt_cifs_flags & 513 cifs_sb->mnt_cifs_flags &
514 CIFS_MOUNT_MAP_SPECIAL_CHR); 514 CIFS_MOUNT_MAP_SPECIAL_CHR);
515 if (rc1) { 515 if (rc1) {
516 /* BB EOPNOSUPP disable SERVER_INUM? */
517 cFYI(1, ("GetSrvInodeNum rc %d", rc1)); 516 cFYI(1, ("GetSrvInodeNum rc %d", rc1));
518 fattr.cf_uniqueid = iunique(sb, ROOT_I); 517 fattr.cf_uniqueid = iunique(sb, ROOT_I);
518 /* disable serverino if call not supported */
519 if (rc1 == -EINVAL)
520 cifs_sb->mnt_cifs_flags &=
521 ~CIFS_MOUNT_SERVER_INUM;
519 } 522 }
520 } else { 523 } else {
521 fattr.cf_uniqueid = iunique(sb, ROOT_I); 524 fattr.cf_uniqueid = iunique(sb, ROOT_I);
diff --git a/fs/compat.c b/fs/compat.c
index fbadb947727b..94502dab972a 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -32,7 +32,6 @@
32#include <linux/smb_mount.h> 32#include <linux/smb_mount.h>
33#include <linux/ncp_mount.h> 33#include <linux/ncp_mount.h>
34#include <linux/nfs4_mount.h> 34#include <linux/nfs4_mount.h>
35#include <linux/smp_lock.h>
36#include <linux/syscalls.h> 35#include <linux/syscalls.h>
37#include <linux/ctype.h> 36#include <linux/ctype.h>
38#include <linux/module.h> 37#include <linux/module.h>
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 626c7483b4de..f28f070a60fc 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -19,6 +19,7 @@
19#include <linux/compiler.h> 19#include <linux/compiler.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/smp_lock.h>
22#include <linux/ioctl.h> 23#include <linux/ioctl.h>
23#include <linux/if.h> 24#include <linux/if.h>
24#include <linux/if_bridge.h> 25#include <linux/if_bridge.h>
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 205ec95b347e..eb507c453c5f 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -435,7 +435,7 @@ static int search_rsb(struct dlm_ls *ls, char *name, int len, int b,
435static int find_rsb(struct dlm_ls *ls, char *name, int namelen, 435static int find_rsb(struct dlm_ls *ls, char *name, int namelen,
436 unsigned int flags, struct dlm_rsb **r_ret) 436 unsigned int flags, struct dlm_rsb **r_ret)
437{ 437{
438 struct dlm_rsb *r, *tmp; 438 struct dlm_rsb *r = NULL, *tmp;
439 uint32_t hash, bucket; 439 uint32_t hash, bucket;
440 int error = -EINVAL; 440 int error = -EINVAL;
441 441
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index cdb580a9c7a2..618a60f03886 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -902,7 +902,7 @@ static void tcp_connect_to_sock(struct connection *con)
902 int result = -EHOSTUNREACH; 902 int result = -EHOSTUNREACH;
903 struct sockaddr_storage saddr, src_addr; 903 struct sockaddr_storage saddr, src_addr;
904 int addr_len; 904 int addr_len;
905 struct socket *sock; 905 struct socket *sock = NULL;
906 906
907 if (con->nodeid == 0) { 907 if (con->nodeid == 0) {
908 log_print("attempt to connect sock 0 foiled"); 908 log_print("attempt to connect sock 0 foiled");
@@ -962,6 +962,8 @@ out_err:
962 if (con->sock) { 962 if (con->sock) {
963 sock_release(con->sock); 963 sock_release(con->sock);
964 con->sock = NULL; 964 con->sock = NULL;
965 } else if (sock) {
966 sock_release(sock);
965 } 967 }
966 /* 968 /*
967 * Some errors are fatal and this list might need adjusting. For other 969 * Some errors are fatal and this list might need adjusting. For other
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index 894a32d438d5..16f682e26c07 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -353,7 +353,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
353{ 353{
354 struct dlm_plock_info info; 354 struct dlm_plock_info info;
355 struct plock_op *op; 355 struct plock_op *op;
356 int found = 0; 356 int found = 0, do_callback = 0;
357 357
358 if (count != sizeof(info)) 358 if (count != sizeof(info))
359 return -EINVAL; 359 return -EINVAL;
@@ -366,21 +366,24 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
366 366
367 spin_lock(&ops_lock); 367 spin_lock(&ops_lock);
368 list_for_each_entry(op, &recv_list, list) { 368 list_for_each_entry(op, &recv_list, list) {
369 if (op->info.fsid == info.fsid && op->info.number == info.number && 369 if (op->info.fsid == info.fsid &&
370 op->info.number == info.number &&
370 op->info.owner == info.owner) { 371 op->info.owner == info.owner) {
372 struct plock_xop *xop = (struct plock_xop *)op;
371 list_del_init(&op->list); 373 list_del_init(&op->list);
372 found = 1;
373 op->done = 1;
374 memcpy(&op->info, &info, sizeof(info)); 374 memcpy(&op->info, &info, sizeof(info));
375 if (xop->callback)
376 do_callback = 1;
377 else
378 op->done = 1;
379 found = 1;
375 break; 380 break;
376 } 381 }
377 } 382 }
378 spin_unlock(&ops_lock); 383 spin_unlock(&ops_lock);
379 384
380 if (found) { 385 if (found) {
381 struct plock_xop *xop; 386 if (do_callback)
382 xop = (struct plock_xop *)op;
383 if (xop->callback)
384 dlm_plock_callback(op); 387 dlm_plock_callback(op);
385 else 388 else
386 wake_up(&recv_wq); 389 wake_up(&recv_wq);
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index af737bb56cb7..259525c9abb8 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1303,6 +1303,13 @@ parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat,
1303 } 1303 }
1304 (*new_auth_tok)->session_key.encrypted_key_size = 1304 (*new_auth_tok)->session_key.encrypted_key_size =
1305 (body_size - (ECRYPTFS_SALT_SIZE + 5)); 1305 (body_size - (ECRYPTFS_SALT_SIZE + 5));
1306 if ((*new_auth_tok)->session_key.encrypted_key_size
1307 > ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES) {
1308 printk(KERN_WARNING "Tag 3 packet contains key larger "
1309 "than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES\n");
1310 rc = -EINVAL;
1311 goto out_free;
1312 }
1306 if (unlikely(data[(*packet_size)++] != 0x04)) { 1313 if (unlikely(data[(*packet_size)++] != 0x04)) {
1307 printk(KERN_WARNING "Unknown version number [%d]\n", 1314 printk(KERN_WARNING "Unknown version number [%d]\n",
1308 data[(*packet_size) - 1]); 1315 data[(*packet_size) - 1]);
@@ -1449,6 +1456,12 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents,
1449 rc = -EINVAL; 1456 rc = -EINVAL;
1450 goto out; 1457 goto out;
1451 } 1458 }
1459 if (unlikely((*tag_11_contents_size) > max_contents_bytes)) {
1460 printk(KERN_ERR "Literal data section in tag 11 packet exceeds "
1461 "expected size\n");
1462 rc = -EINVAL;
1463 goto out;
1464 }
1452 if (data[(*packet_size)++] != 0x62) { 1465 if (data[(*packet_size)++] != 0x62) {
1453 printk(KERN_WARNING "Unrecognizable packet\n"); 1466 printk(KERN_WARNING "Unrecognizable packet\n");
1454 rc = -EINVAL; 1467 rc = -EINVAL;
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index a343b4ea62f6..5ab10c3bbebe 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -31,6 +31,7 @@
31 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 31 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 */ 32 */
33 33
34#include <linux/smp_lock.h>
34#include <linux/string.h> 35#include <linux/string.h>
35#include <linux/parser.h> 36#include <linux/parser.h>
36#include <linux/vfs.h> 37#include <linux/vfs.h>
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c
index 7cb4badef927..e7431309bdca 100644
--- a/fs/ext2/ioctl.c
+++ b/fs/ext2/ioctl.c
@@ -13,7 +13,6 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/compat.h> 14#include <linux/compat.h>
15#include <linux/mount.h> 15#include <linux/mount.h>
16#include <linux/smp_lock.h>
17#include <asm/current.h> 16#include <asm/current.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19 18
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index 3d724a95882f..373fa90c796a 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -130,8 +130,7 @@ static int ext3_readdir(struct file * filp,
130 struct buffer_head *bh = NULL; 130 struct buffer_head *bh = NULL;
131 131
132 map_bh.b_state = 0; 132 map_bh.b_state = 0;
133 err = ext3_get_blocks_handle(NULL, inode, blk, 1, 133 err = ext3_get_blocks_handle(NULL, inode, blk, 1, &map_bh, 0);
134 &map_bh, 0, 0);
135 if (err > 0) { 134 if (err > 0) {
136 pgoff_t index = map_bh.b_blocknr >> 135 pgoff_t index = map_bh.b_blocknr >>
137 (PAGE_CACHE_SHIFT - inode->i_blkbits); 136 (PAGE_CACHE_SHIFT - inode->i_blkbits);
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 5f51fed5c750..b49908a167ae 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -788,7 +788,7 @@ err_out:
788int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, 788int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
789 sector_t iblock, unsigned long maxblocks, 789 sector_t iblock, unsigned long maxblocks,
790 struct buffer_head *bh_result, 790 struct buffer_head *bh_result,
791 int create, int extend_disksize) 791 int create)
792{ 792{
793 int err = -EIO; 793 int err = -EIO;
794 int offsets[4]; 794 int offsets[4];
@@ -911,13 +911,6 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
911 if (!err) 911 if (!err)
912 err = ext3_splice_branch(handle, inode, iblock, 912 err = ext3_splice_branch(handle, inode, iblock,
913 partial, indirect_blks, count); 913 partial, indirect_blks, count);
914 /*
915 * i_disksize growing is protected by truncate_mutex. Don't forget to
916 * protect it if you're about to implement concurrent
917 * ext3_get_block() -bzzz
918 */
919 if (!err && extend_disksize && inode->i_size > ei->i_disksize)
920 ei->i_disksize = inode->i_size;
921 mutex_unlock(&ei->truncate_mutex); 914 mutex_unlock(&ei->truncate_mutex);
922 if (err) 915 if (err)
923 goto cleanup; 916 goto cleanup;
@@ -972,7 +965,7 @@ static int ext3_get_block(struct inode *inode, sector_t iblock,
972 } 965 }
973 966
974 ret = ext3_get_blocks_handle(handle, inode, iblock, 967 ret = ext3_get_blocks_handle(handle, inode, iblock,
975 max_blocks, bh_result, create, 0); 968 max_blocks, bh_result, create);
976 if (ret > 0) { 969 if (ret > 0) {
977 bh_result->b_size = (ret << inode->i_blkbits); 970 bh_result->b_size = (ret << inode->i_blkbits);
978 ret = 0; 971 ret = 0;
@@ -1005,7 +998,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
1005 dummy.b_blocknr = -1000; 998 dummy.b_blocknr = -1000;
1006 buffer_trace_init(&dummy.b_history); 999 buffer_trace_init(&dummy.b_history);
1007 err = ext3_get_blocks_handle(handle, inode, block, 1, 1000 err = ext3_get_blocks_handle(handle, inode, block, 1,
1008 &dummy, create, 1); 1001 &dummy, create);
1009 /* 1002 /*
1010 * ext3_get_blocks_handle() returns number of blocks 1003 * ext3_get_blocks_handle() returns number of blocks
1011 * mapped. 0 in case of a HOLE. 1004 * mapped. 0 in case of a HOLE.
@@ -1193,15 +1186,16 @@ write_begin_failed:
1193 * i_size_read because we hold i_mutex. 1186 * i_size_read because we hold i_mutex.
1194 * 1187 *
1195 * Add inode to orphan list in case we crash before truncate 1188 * Add inode to orphan list in case we crash before truncate
1196 * finishes. 1189 * finishes. Do this only if ext3_can_truncate() agrees so
1190 * that orphan processing code is happy.
1197 */ 1191 */
1198 if (pos + len > inode->i_size) 1192 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1199 ext3_orphan_add(handle, inode); 1193 ext3_orphan_add(handle, inode);
1200 ext3_journal_stop(handle); 1194 ext3_journal_stop(handle);
1201 unlock_page(page); 1195 unlock_page(page);
1202 page_cache_release(page); 1196 page_cache_release(page);
1203 if (pos + len > inode->i_size) 1197 if (pos + len > inode->i_size)
1204 vmtruncate(inode, inode->i_size); 1198 ext3_truncate(inode);
1205 } 1199 }
1206 if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries)) 1200 if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
1207 goto retry; 1201 goto retry;
@@ -1287,7 +1281,7 @@ static int ext3_ordered_write_end(struct file *file,
1287 * There may be allocated blocks outside of i_size because 1281 * There may be allocated blocks outside of i_size because
1288 * we failed to copy some data. Prepare for truncate. 1282 * we failed to copy some data. Prepare for truncate.
1289 */ 1283 */
1290 if (pos + len > inode->i_size) 1284 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1291 ext3_orphan_add(handle, inode); 1285 ext3_orphan_add(handle, inode);
1292 ret2 = ext3_journal_stop(handle); 1286 ret2 = ext3_journal_stop(handle);
1293 if (!ret) 1287 if (!ret)
@@ -1296,7 +1290,7 @@ static int ext3_ordered_write_end(struct file *file,
1296 page_cache_release(page); 1290 page_cache_release(page);
1297 1291
1298 if (pos + len > inode->i_size) 1292 if (pos + len > inode->i_size)
1299 vmtruncate(inode, inode->i_size); 1293 ext3_truncate(inode);
1300 return ret ? ret : copied; 1294 return ret ? ret : copied;
1301} 1295}
1302 1296
@@ -1315,14 +1309,14 @@ static int ext3_writeback_write_end(struct file *file,
1315 * There may be allocated blocks outside of i_size because 1309 * There may be allocated blocks outside of i_size because
1316 * we failed to copy some data. Prepare for truncate. 1310 * we failed to copy some data. Prepare for truncate.
1317 */ 1311 */
1318 if (pos + len > inode->i_size) 1312 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1319 ext3_orphan_add(handle, inode); 1313 ext3_orphan_add(handle, inode);
1320 ret = ext3_journal_stop(handle); 1314 ret = ext3_journal_stop(handle);
1321 unlock_page(page); 1315 unlock_page(page);
1322 page_cache_release(page); 1316 page_cache_release(page);
1323 1317
1324 if (pos + len > inode->i_size) 1318 if (pos + len > inode->i_size)
1325 vmtruncate(inode, inode->i_size); 1319 ext3_truncate(inode);
1326 return ret ? ret : copied; 1320 return ret ? ret : copied;
1327} 1321}
1328 1322
@@ -1358,7 +1352,7 @@ static int ext3_journalled_write_end(struct file *file,
1358 * There may be allocated blocks outside of i_size because 1352 * There may be allocated blocks outside of i_size because
1359 * we failed to copy some data. Prepare for truncate. 1353 * we failed to copy some data. Prepare for truncate.
1360 */ 1354 */
1361 if (pos + len > inode->i_size) 1355 if (pos + len > inode->i_size && ext3_can_truncate(inode))
1362 ext3_orphan_add(handle, inode); 1356 ext3_orphan_add(handle, inode);
1363 EXT3_I(inode)->i_state |= EXT3_STATE_JDATA; 1357 EXT3_I(inode)->i_state |= EXT3_STATE_JDATA;
1364 if (inode->i_size > EXT3_I(inode)->i_disksize) { 1358 if (inode->i_size > EXT3_I(inode)->i_disksize) {
@@ -1375,7 +1369,7 @@ static int ext3_journalled_write_end(struct file *file,
1375 page_cache_release(page); 1369 page_cache_release(page);
1376 1370
1377 if (pos + len > inode->i_size) 1371 if (pos + len > inode->i_size)
1378 vmtruncate(inode, inode->i_size); 1372 ext3_truncate(inode);
1379 return ret ? ret : copied; 1373 return ret ? ret : copied;
1380} 1374}
1381 1375
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0ddf7e55abe1..9714db393efe 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -93,20 +93,20 @@ typedef unsigned int ext4_group_t;
93struct ext4_allocation_request { 93struct ext4_allocation_request {
94 /* target inode for block we're allocating */ 94 /* target inode for block we're allocating */
95 struct inode *inode; 95 struct inode *inode;
96 /* how many blocks we want to allocate */
97 unsigned int len;
96 /* logical block in target inode */ 98 /* logical block in target inode */
97 ext4_lblk_t logical; 99 ext4_lblk_t logical;
98 /* phys. target (a hint) */
99 ext4_fsblk_t goal;
100 /* the closest logical allocated block to the left */ 100 /* the closest logical allocated block to the left */
101 ext4_lblk_t lleft; 101 ext4_lblk_t lleft;
102 /* phys. block for ^^^ */
103 ext4_fsblk_t pleft;
104 /* the closest logical allocated block to the right */ 102 /* the closest logical allocated block to the right */
105 ext4_lblk_t lright; 103 ext4_lblk_t lright;
106 /* phys. block for ^^^ */ 104 /* phys. target (a hint) */
105 ext4_fsblk_t goal;
106 /* phys. block for the closest logical allocated block to the left */
107 ext4_fsblk_t pleft;
108 /* phys. block for the closest logical allocated block to the right */
107 ext4_fsblk_t pright; 109 ext4_fsblk_t pright;
108 /* how many blocks we want to allocate */
109 unsigned int len;
110 /* flags. see above EXT4_MB_HINT_* */ 110 /* flags. see above EXT4_MB_HINT_* */
111 unsigned int flags; 111 unsigned int flags;
112}; 112};
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index ad13a84644e1..eb27fd0f2ee8 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -43,6 +43,8 @@ int __ext4_journal_forget(const char *where, handle_t *handle,
43 ext4_journal_abort_handle(where, __func__, bh, 43 ext4_journal_abort_handle(where, __func__, bh,
44 handle, err); 44 handle, err);
45 } 45 }
46 else
47 brelse(bh);
46 return err; 48 return err;
47} 49}
48 50
@@ -57,6 +59,8 @@ int __ext4_journal_revoke(const char *where, handle_t *handle,
57 ext4_journal_abort_handle(where, __func__, bh, 59 ext4_journal_abort_handle(where, __func__, bh,
58 handle, err); 60 handle, err);
59 } 61 }
62 else
63 brelse(bh);
60 return err; 64 return err;
61} 65}
62 66
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index be2f426f6805..139fb8cb87e4 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -131,9 +131,11 @@ int __ext4_journal_get_undo_access(const char *where, handle_t *handle,
131int __ext4_journal_get_write_access(const char *where, handle_t *handle, 131int __ext4_journal_get_write_access(const char *where, handle_t *handle,
132 struct buffer_head *bh); 132 struct buffer_head *bh);
133 133
134/* When called with an invalid handle, this will still do a put on the BH */
134int __ext4_journal_forget(const char *where, handle_t *handle, 135int __ext4_journal_forget(const char *where, handle_t *handle,
135 struct buffer_head *bh); 136 struct buffer_head *bh);
136 137
138/* When called with an invalid handle, this will still do a put on the BH */
137int __ext4_journal_revoke(const char *where, handle_t *handle, 139int __ext4_journal_revoke(const char *where, handle_t *handle,
138 ext4_fsblk_t blocknr, struct buffer_head *bh); 140 ext4_fsblk_t blocknr, struct buffer_head *bh);
139 141
@@ -281,10 +283,10 @@ static inline int ext4_should_order_data(struct inode *inode)
281 283
282static inline int ext4_should_writeback_data(struct inode *inode) 284static inline int ext4_should_writeback_data(struct inode *inode)
283{ 285{
284 if (EXT4_JOURNAL(inode) == NULL)
285 return 0;
286 if (!S_ISREG(inode->i_mode)) 286 if (!S_ISREG(inode->i_mode))
287 return 0; 287 return 0;
288 if (EXT4_JOURNAL(inode) == NULL)
289 return 1;
288 if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL) 290 if (EXT4_I(inode)->i_flags & EXT4_JOURNAL_DATA_FL)
289 return 0; 291 return 0;
290 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) 292 if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 50322a09bd01..73ebfb44ad75 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1977,6 +1977,7 @@ int ext4_ext_calc_credits_for_single_extent(struct inode *inode, int nrblocks,
1977 */ 1977 */
1978 /* 1 bitmap, 1 block group descriptor */ 1978 /* 1 bitmap, 1 block group descriptor */
1979 ret = 2 + EXT4_META_TRANS_BLOCKS(inode->i_sb); 1979 ret = 2 + EXT4_META_TRANS_BLOCKS(inode->i_sb);
1980 return ret;
1980 } 1981 }
1981 } 1982 }
1982 1983
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 2f645732e3b7..29e6dc7299b8 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -833,7 +833,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
833 if (!goal) 833 if (!goal)
834 goal = sbi->s_inode_goal; 834 goal = sbi->s_inode_goal;
835 835
836 if (goal && goal < le32_to_cpu(sbi->s_es->s_inodes_count)) { 836 if (goal && goal <= le32_to_cpu(sbi->s_es->s_inodes_count)) {
837 group = (goal - 1) / EXT4_INODES_PER_GROUP(sb); 837 group = (goal - 1) / EXT4_INODES_PER_GROUP(sb);
838 ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb); 838 ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb);
839 ret2 = 0; 839 ret2 = 0;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 60a26f3a6f8b..f9c642b22efa 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -78,16 +78,14 @@ static int ext4_inode_is_fast_symlink(struct inode *inode)
78 * but there may still be a record of it in the journal, and that record 78 * but there may still be a record of it in the journal, and that record
79 * still needs to be revoked. 79 * still needs to be revoked.
80 * 80 *
81 * If the handle isn't valid we're not journaling so there's nothing to do. 81 * If the handle isn't valid we're not journaling, but we still need to
82 * call into ext4_journal_revoke() to put the buffer head.
82 */ 83 */
83int ext4_forget(handle_t *handle, int is_metadata, struct inode *inode, 84int ext4_forget(handle_t *handle, int is_metadata, struct inode *inode,
84 struct buffer_head *bh, ext4_fsblk_t blocknr) 85 struct buffer_head *bh, ext4_fsblk_t blocknr)
85{ 86{
86 int err; 87 int err;
87 88
88 if (!ext4_handle_valid(handle))
89 return 0;
90
91 might_sleep(); 89 might_sleep();
92 90
93 BUFFER_TRACE(bh, "enter"); 91 BUFFER_TRACE(bh, "enter");
@@ -1513,14 +1511,14 @@ retry:
1513 * Add inode to orphan list in case we crash before 1511 * Add inode to orphan list in case we crash before
1514 * truncate finishes 1512 * truncate finishes
1515 */ 1513 */
1516 if (pos + len > inode->i_size) 1514 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1517 ext4_orphan_add(handle, inode); 1515 ext4_orphan_add(handle, inode);
1518 1516
1519 ext4_journal_stop(handle); 1517 ext4_journal_stop(handle);
1520 if (pos + len > inode->i_size) { 1518 if (pos + len > inode->i_size) {
1521 vmtruncate(inode, inode->i_size); 1519 ext4_truncate(inode);
1522 /* 1520 /*
1523 * If vmtruncate failed early the inode might 1521 * If truncate failed early the inode might
1524 * still be on the orphan list; we need to 1522 * still be on the orphan list; we need to
1525 * make sure the inode is removed from the 1523 * make sure the inode is removed from the
1526 * orphan list in that case. 1524 * orphan list in that case.
@@ -1614,7 +1612,7 @@ static int ext4_ordered_write_end(struct file *file,
1614 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied, 1612 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied,
1615 page, fsdata); 1613 page, fsdata);
1616 copied = ret2; 1614 copied = ret2;
1617 if (pos + len > inode->i_size) 1615 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1618 /* if we have allocated more blocks and copied 1616 /* if we have allocated more blocks and copied
1619 * less. We will have blocks allocated outside 1617 * less. We will have blocks allocated outside
1620 * inode->i_size. So truncate them 1618 * inode->i_size. So truncate them
@@ -1628,9 +1626,9 @@ static int ext4_ordered_write_end(struct file *file,
1628 ret = ret2; 1626 ret = ret2;
1629 1627
1630 if (pos + len > inode->i_size) { 1628 if (pos + len > inode->i_size) {
1631 vmtruncate(inode, inode->i_size); 1629 ext4_truncate(inode);
1632 /* 1630 /*
1633 * If vmtruncate failed early the inode might still be 1631 * If truncate failed early the inode might still be
1634 * on the orphan list; we need to make sure the inode 1632 * on the orphan list; we need to make sure the inode
1635 * is removed from the orphan list in that case. 1633 * is removed from the orphan list in that case.
1636 */ 1634 */
@@ -1655,7 +1653,7 @@ static int ext4_writeback_write_end(struct file *file,
1655 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied, 1653 ret2 = ext4_generic_write_end(file, mapping, pos, len, copied,
1656 page, fsdata); 1654 page, fsdata);
1657 copied = ret2; 1655 copied = ret2;
1658 if (pos + len > inode->i_size) 1656 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1659 /* if we have allocated more blocks and copied 1657 /* if we have allocated more blocks and copied
1660 * less. We will have blocks allocated outside 1658 * less. We will have blocks allocated outside
1661 * inode->i_size. So truncate them 1659 * inode->i_size. So truncate them
@@ -1670,9 +1668,9 @@ static int ext4_writeback_write_end(struct file *file,
1670 ret = ret2; 1668 ret = ret2;
1671 1669
1672 if (pos + len > inode->i_size) { 1670 if (pos + len > inode->i_size) {
1673 vmtruncate(inode, inode->i_size); 1671 ext4_truncate(inode);
1674 /* 1672 /*
1675 * If vmtruncate failed early the inode might still be 1673 * If truncate failed early the inode might still be
1676 * on the orphan list; we need to make sure the inode 1674 * on the orphan list; we need to make sure the inode
1677 * is removed from the orphan list in that case. 1675 * is removed from the orphan list in that case.
1678 */ 1676 */
@@ -1722,7 +1720,7 @@ static int ext4_journalled_write_end(struct file *file,
1722 1720
1723 unlock_page(page); 1721 unlock_page(page);
1724 page_cache_release(page); 1722 page_cache_release(page);
1725 if (pos + len > inode->i_size) 1723 if (pos + len > inode->i_size && ext4_can_truncate(inode))
1726 /* if we have allocated more blocks and copied 1724 /* if we have allocated more blocks and copied
1727 * less. We will have blocks allocated outside 1725 * less. We will have blocks allocated outside
1728 * inode->i_size. So truncate them 1726 * inode->i_size. So truncate them
@@ -1733,9 +1731,9 @@ static int ext4_journalled_write_end(struct file *file,
1733 if (!ret) 1731 if (!ret)
1734 ret = ret2; 1732 ret = ret2;
1735 if (pos + len > inode->i_size) { 1733 if (pos + len > inode->i_size) {
1736 vmtruncate(inode, inode->i_size); 1734 ext4_truncate(inode);
1737 /* 1735 /*
1738 * If vmtruncate failed early the inode might still be 1736 * If truncate failed early the inode might still be
1739 * on the orphan list; we need to make sure the inode 1737 * on the orphan list; we need to make sure the inode
1740 * is removed from the orphan list in that case. 1738 * is removed from the orphan list in that case.
1741 */ 1739 */
@@ -2305,15 +2303,9 @@ flush_it:
2305 return; 2303 return;
2306} 2304}
2307 2305
2308static int ext4_bh_unmapped_or_delay(handle_t *handle, struct buffer_head *bh) 2306static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh)
2309{ 2307{
2310 /* 2308 return (buffer_delay(bh) || buffer_unwritten(bh)) && buffer_dirty(bh);
2311 * unmapped buffer is possible for holes.
2312 * delay buffer is possible with delayed allocation.
2313 * We also need to consider unwritten buffer as unmapped.
2314 */
2315 return (!buffer_mapped(bh) || buffer_delay(bh) ||
2316 buffer_unwritten(bh)) && buffer_dirty(bh);
2317} 2309}
2318 2310
2319/* 2311/*
@@ -2398,9 +2390,9 @@ static int __mpage_da_writepage(struct page *page,
2398 * We need to try to allocate 2390 * We need to try to allocate
2399 * unmapped blocks in the same page. 2391 * unmapped blocks in the same page.
2400 * Otherwise we won't make progress 2392 * Otherwise we won't make progress
2401 * with the page in ext4_da_writepage 2393 * with the page in ext4_writepage
2402 */ 2394 */
2403 if (ext4_bh_unmapped_or_delay(NULL, bh)) { 2395 if (ext4_bh_delay_or_unwritten(NULL, bh)) {
2404 mpage_add_bh_to_extent(mpd, logical, 2396 mpage_add_bh_to_extent(mpd, logical,
2405 bh->b_size, 2397 bh->b_size,
2406 bh->b_state); 2398 bh->b_state);
@@ -2517,7 +2509,6 @@ static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
2517 * so call get_block_wrap with create = 0 2509 * so call get_block_wrap with create = 0
2518 */ 2510 */
2519 ret = ext4_get_blocks(NULL, inode, iblock, max_blocks, bh_result, 0); 2511 ret = ext4_get_blocks(NULL, inode, iblock, max_blocks, bh_result, 0);
2520 BUG_ON(create && ret == 0);
2521 if (ret > 0) { 2512 if (ret > 0) {
2522 bh_result->b_size = (ret << inode->i_blkbits); 2513 bh_result->b_size = (ret << inode->i_blkbits);
2523 ret = 0; 2514 ret = 0;
@@ -2525,15 +2516,102 @@ static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
2525 return ret; 2516 return ret;
2526} 2517}
2527 2518
2519static int bget_one(handle_t *handle, struct buffer_head *bh)
2520{
2521 get_bh(bh);
2522 return 0;
2523}
2524
2525static int bput_one(handle_t *handle, struct buffer_head *bh)
2526{
2527 put_bh(bh);
2528 return 0;
2529}
2530
2531static int __ext4_journalled_writepage(struct page *page,
2532 struct writeback_control *wbc,
2533 unsigned int len)
2534{
2535 struct address_space *mapping = page->mapping;
2536 struct inode *inode = mapping->host;
2537 struct buffer_head *page_bufs;
2538 handle_t *handle = NULL;
2539 int ret = 0;
2540 int err;
2541
2542 page_bufs = page_buffers(page);
2543 BUG_ON(!page_bufs);
2544 walk_page_buffers(handle, page_bufs, 0, len, NULL, bget_one);
2545 /* As soon as we unlock the page, it can go away, but we have
2546 * references to buffers so we are safe */
2547 unlock_page(page);
2548
2549 handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode));
2550 if (IS_ERR(handle)) {
2551 ret = PTR_ERR(handle);
2552 goto out;
2553 }
2554
2555 ret = walk_page_buffers(handle, page_bufs, 0, len, NULL,
2556 do_journal_get_write_access);
2557
2558 err = walk_page_buffers(handle, page_bufs, 0, len, NULL,
2559 write_end_fn);
2560 if (ret == 0)
2561 ret = err;
2562 err = ext4_journal_stop(handle);
2563 if (!ret)
2564 ret = err;
2565
2566 walk_page_buffers(handle, page_bufs, 0, len, NULL, bput_one);
2567 EXT4_I(inode)->i_state |= EXT4_STATE_JDATA;
2568out:
2569 return ret;
2570}
2571
2528/* 2572/*
2573 * Note that we don't need to start a transaction unless we're journaling data
2574 * because we should have holes filled from ext4_page_mkwrite(). We even don't
2575 * need to file the inode to the transaction's list in ordered mode because if
2576 * we are writing back data added by write(), the inode is already there and if
2577 * we are writing back data modified via mmap(), noone guarantees in which
2578 * transaction the data will hit the disk. In case we are journaling data, we
2579 * cannot start transaction directly because transaction start ranks above page
2580 * lock so we have to do some magic.
2581 *
2529 * This function can get called via... 2582 * This function can get called via...
2530 * - ext4_da_writepages after taking page lock (have journal handle) 2583 * - ext4_da_writepages after taking page lock (have journal handle)
2531 * - journal_submit_inode_data_buffers (no journal handle) 2584 * - journal_submit_inode_data_buffers (no journal handle)
2532 * - shrink_page_list via pdflush (no journal handle) 2585 * - shrink_page_list via pdflush (no journal handle)
2533 * - grab_page_cache when doing write_begin (have journal handle) 2586 * - grab_page_cache when doing write_begin (have journal handle)
2587 *
2588 * We don't do any block allocation in this function. If we have page with
2589 * multiple blocks we need to write those buffer_heads that are mapped. This
2590 * is important for mmaped based write. So if we do with blocksize 1K
2591 * truncate(f, 1024);
2592 * a = mmap(f, 0, 4096);
2593 * a[0] = 'a';
2594 * truncate(f, 4096);
2595 * we have in the page first buffer_head mapped via page_mkwrite call back
2596 * but other bufer_heads would be unmapped but dirty(dirty done via the
2597 * do_wp_page). So writepage should write the first block. If we modify
2598 * the mmap area beyond 1024 we will again get a page_fault and the
2599 * page_mkwrite callback will do the block allocation and mark the
2600 * buffer_heads mapped.
2601 *
2602 * We redirty the page if we have any buffer_heads that is either delay or
2603 * unwritten in the page.
2604 *
2605 * We can get recursively called as show below.
2606 *
2607 * ext4_writepage() -> kmalloc() -> __alloc_pages() -> page_launder() ->
2608 * ext4_writepage()
2609 *
2610 * But since we don't do any block allocation we should not deadlock.
2611 * Page also have the dirty flag cleared so we don't get recurive page_lock.
2534 */ 2612 */
2535static int ext4_da_writepage(struct page *page, 2613static int ext4_writepage(struct page *page,
2536 struct writeback_control *wbc) 2614 struct writeback_control *wbc)
2537{ 2615{
2538 int ret = 0; 2616 int ret = 0;
2539 loff_t size; 2617 loff_t size;
@@ -2541,7 +2619,7 @@ static int ext4_da_writepage(struct page *page,
2541 struct buffer_head *page_bufs; 2619 struct buffer_head *page_bufs;
2542 struct inode *inode = page->mapping->host; 2620 struct inode *inode = page->mapping->host;
2543 2621
2544 trace_ext4_da_writepage(inode, page); 2622 trace_ext4_writepage(inode, page);
2545 size = i_size_read(inode); 2623 size = i_size_read(inode);
2546 if (page->index == size >> PAGE_CACHE_SHIFT) 2624 if (page->index == size >> PAGE_CACHE_SHIFT)
2547 len = size & ~PAGE_CACHE_MASK; 2625 len = size & ~PAGE_CACHE_MASK;
@@ -2551,7 +2629,7 @@ static int ext4_da_writepage(struct page *page,
2551 if (page_has_buffers(page)) { 2629 if (page_has_buffers(page)) {
2552 page_bufs = page_buffers(page); 2630 page_bufs = page_buffers(page);
2553 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL, 2631 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL,
2554 ext4_bh_unmapped_or_delay)) { 2632 ext4_bh_delay_or_unwritten)) {
2555 /* 2633 /*
2556 * We don't want to do block allocation 2634 * We don't want to do block allocation
2557 * So redirty the page and return 2635 * So redirty the page and return
@@ -2578,13 +2656,13 @@ static int ext4_da_writepage(struct page *page,
2578 * all are mapped and non delay. We don't want to 2656 * all are mapped and non delay. We don't want to
2579 * do block allocation here. 2657 * do block allocation here.
2580 */ 2658 */
2581 ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE, 2659 ret = block_prepare_write(page, 0, len,
2582 noalloc_get_block_write); 2660 noalloc_get_block_write);
2583 if (!ret) { 2661 if (!ret) {
2584 page_bufs = page_buffers(page); 2662 page_bufs = page_buffers(page);
2585 /* check whether all are mapped and non delay */ 2663 /* check whether all are mapped and non delay */
2586 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL, 2664 if (walk_page_buffers(NULL, page_bufs, 0, len, NULL,
2587 ext4_bh_unmapped_or_delay)) { 2665 ext4_bh_delay_or_unwritten)) {
2588 redirty_page_for_writepage(wbc, page); 2666 redirty_page_for_writepage(wbc, page);
2589 unlock_page(page); 2667 unlock_page(page);
2590 return 0; 2668 return 0;
@@ -2600,7 +2678,16 @@ static int ext4_da_writepage(struct page *page,
2600 return 0; 2678 return 0;
2601 } 2679 }
2602 /* now mark the buffer_heads as dirty and uptodate */ 2680 /* now mark the buffer_heads as dirty and uptodate */
2603 block_commit_write(page, 0, PAGE_CACHE_SIZE); 2681 block_commit_write(page, 0, len);
2682 }
2683
2684 if (PageChecked(page) && ext4_should_journal_data(inode)) {
2685 /*
2686 * It's mmapped pagecache. Add buffers and journal it. There
2687 * doesn't seem much point in redirtying the page here.
2688 */
2689 ClearPageChecked(page);
2690 return __ext4_journalled_writepage(page, wbc, len);
2604 } 2691 }
2605 2692
2606 if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) 2693 if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode))
@@ -2907,7 +2994,7 @@ retry:
2907 * i_size_read because we hold i_mutex. 2994 * i_size_read because we hold i_mutex.
2908 */ 2995 */
2909 if (pos + len > inode->i_size) 2996 if (pos + len > inode->i_size)
2910 vmtruncate(inode, inode->i_size); 2997 ext4_truncate(inode);
2911 } 2998 }
2912 2999
2913 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) 3000 if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
@@ -3130,222 +3217,6 @@ static sector_t ext4_bmap(struct address_space *mapping, sector_t block)
3130 return generic_block_bmap(mapping, block, ext4_get_block); 3217 return generic_block_bmap(mapping, block, ext4_get_block);
3131} 3218}
3132 3219
3133static int bget_one(handle_t *handle, struct buffer_head *bh)
3134{
3135 get_bh(bh);
3136 return 0;
3137}
3138
3139static int bput_one(handle_t *handle, struct buffer_head *bh)
3140{
3141 put_bh(bh);
3142 return 0;
3143}
3144
3145/*
3146 * Note that we don't need to start a transaction unless we're journaling data
3147 * because we should have holes filled from ext4_page_mkwrite(). We even don't
3148 * need to file the inode to the transaction's list in ordered mode because if
3149 * we are writing back data added by write(), the inode is already there and if
3150 * we are writing back data modified via mmap(), noone guarantees in which
3151 * transaction the data will hit the disk. In case we are journaling data, we
3152 * cannot start transaction directly because transaction start ranks above page
3153 * lock so we have to do some magic.
3154 *
3155 * In all journaling modes block_write_full_page() will start the I/O.
3156 *
3157 * Problem:
3158 *
3159 * ext4_writepage() -> kmalloc() -> __alloc_pages() -> page_launder() ->
3160 * ext4_writepage()
3161 *
3162 * Similar for:
3163 *
3164 * ext4_file_write() -> generic_file_write() -> __alloc_pages() -> ...
3165 *
3166 * Same applies to ext4_get_block(). We will deadlock on various things like
3167 * lock_journal and i_data_sem
3168 *
3169 * Setting PF_MEMALLOC here doesn't work - too many internal memory
3170 * allocations fail.
3171 *
3172 * 16May01: If we're reentered then journal_current_handle() will be
3173 * non-zero. We simply *return*.
3174 *
3175 * 1 July 2001: @@@ FIXME:
3176 * In journalled data mode, a data buffer may be metadata against the
3177 * current transaction. But the same file is part of a shared mapping
3178 * and someone does a writepage() on it.
3179 *
3180 * We will move the buffer onto the async_data list, but *after* it has
3181 * been dirtied. So there's a small window where we have dirty data on
3182 * BJ_Metadata.
3183 *
3184 * Note that this only applies to the last partial page in the file. The
3185 * bit which block_write_full_page() uses prepare/commit for. (That's
3186 * broken code anyway: it's wrong for msync()).
3187 *
3188 * It's a rare case: affects the final partial page, for journalled data
3189 * where the file is subject to bith write() and writepage() in the same
3190 * transction. To fix it we'll need a custom block_write_full_page().
3191 * We'll probably need that anyway for journalling writepage() output.
3192 *
3193 * We don't honour synchronous mounts for writepage(). That would be
3194 * disastrous. Any write() or metadata operation will sync the fs for
3195 * us.
3196 *
3197 */
3198static int __ext4_normal_writepage(struct page *page,
3199 struct writeback_control *wbc)
3200{
3201 struct inode *inode = page->mapping->host;
3202
3203 if (test_opt(inode->i_sb, NOBH))
3204 return nobh_writepage(page, noalloc_get_block_write, wbc);
3205 else
3206 return block_write_full_page(page, noalloc_get_block_write,
3207 wbc);
3208}
3209
3210static int ext4_normal_writepage(struct page *page,
3211 struct writeback_control *wbc)
3212{
3213 struct inode *inode = page->mapping->host;
3214 loff_t size = i_size_read(inode);
3215 loff_t len;
3216
3217 trace_ext4_normal_writepage(inode, page);
3218 J_ASSERT(PageLocked(page));
3219 if (page->index == size >> PAGE_CACHE_SHIFT)
3220 len = size & ~PAGE_CACHE_MASK;
3221 else
3222 len = PAGE_CACHE_SIZE;
3223
3224 if (page_has_buffers(page)) {
3225 /* if page has buffers it should all be mapped
3226 * and allocated. If there are not buffers attached
3227 * to the page we know the page is dirty but it lost
3228 * buffers. That means that at some moment in time
3229 * after write_begin() / write_end() has been called
3230 * all buffers have been clean and thus they must have been
3231 * written at least once. So they are all mapped and we can
3232 * happily proceed with mapping them and writing the page.
3233 */
3234 BUG_ON(walk_page_buffers(NULL, page_buffers(page), 0, len, NULL,
3235 ext4_bh_unmapped_or_delay));
3236 }
3237
3238 if (!ext4_journal_current_handle())
3239 return __ext4_normal_writepage(page, wbc);
3240
3241 redirty_page_for_writepage(wbc, page);
3242 unlock_page(page);
3243 return 0;
3244}
3245
3246static int __ext4_journalled_writepage(struct page *page,
3247 struct writeback_control *wbc)
3248{
3249 struct address_space *mapping = page->mapping;
3250 struct inode *inode = mapping->host;
3251 struct buffer_head *page_bufs;
3252 handle_t *handle = NULL;
3253 int ret = 0;
3254 int err;
3255
3256 ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE,
3257 noalloc_get_block_write);
3258 if (ret != 0)
3259 goto out_unlock;
3260
3261 page_bufs = page_buffers(page);
3262 walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE, NULL,
3263 bget_one);
3264 /* As soon as we unlock the page, it can go away, but we have
3265 * references to buffers so we are safe */
3266 unlock_page(page);
3267
3268 handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode));
3269 if (IS_ERR(handle)) {
3270 ret = PTR_ERR(handle);
3271 goto out;
3272 }
3273
3274 ret = walk_page_buffers(handle, page_bufs, 0,
3275 PAGE_CACHE_SIZE, NULL, do_journal_get_write_access);
3276
3277 err = walk_page_buffers(handle, page_bufs, 0,
3278 PAGE_CACHE_SIZE, NULL, write_end_fn);
3279 if (ret == 0)
3280 ret = err;
3281 err = ext4_journal_stop(handle);
3282 if (!ret)
3283 ret = err;
3284
3285 walk_page_buffers(handle, page_bufs, 0,
3286 PAGE_CACHE_SIZE, NULL, bput_one);
3287 EXT4_I(inode)->i_state |= EXT4_STATE_JDATA;
3288 goto out;
3289
3290out_unlock:
3291 unlock_page(page);
3292out:
3293 return ret;
3294}
3295
3296static int ext4_journalled_writepage(struct page *page,
3297 struct writeback_control *wbc)
3298{
3299 struct inode *inode = page->mapping->host;
3300 loff_t size = i_size_read(inode);
3301 loff_t len;
3302
3303 trace_ext4_journalled_writepage(inode, page);
3304 J_ASSERT(PageLocked(page));
3305 if (page->index == size >> PAGE_CACHE_SHIFT)
3306 len = size & ~PAGE_CACHE_MASK;
3307 else
3308 len = PAGE_CACHE_SIZE;
3309
3310 if (page_has_buffers(page)) {
3311 /* if page has buffers it should all be mapped
3312 * and allocated. If there are not buffers attached
3313 * to the page we know the page is dirty but it lost
3314 * buffers. That means that at some moment in time
3315 * after write_begin() / write_end() has been called
3316 * all buffers have been clean and thus they must have been
3317 * written at least once. So they are all mapped and we can
3318 * happily proceed with mapping them and writing the page.
3319 */
3320 BUG_ON(walk_page_buffers(NULL, page_buffers(page), 0, len, NULL,
3321 ext4_bh_unmapped_or_delay));
3322 }
3323
3324 if (ext4_journal_current_handle())
3325 goto no_write;
3326
3327 if (PageChecked(page)) {
3328 /*
3329 * It's mmapped pagecache. Add buffers and journal it. There
3330 * doesn't seem much point in redirtying the page here.
3331 */
3332 ClearPageChecked(page);
3333 return __ext4_journalled_writepage(page, wbc);
3334 } else {
3335 /*
3336 * It may be a page full of checkpoint-mode buffers. We don't
3337 * really know unless we go poke around in the buffer_heads.
3338 * But block_write_full_page will do the right thing.
3339 */
3340 return block_write_full_page(page, noalloc_get_block_write,
3341 wbc);
3342 }
3343no_write:
3344 redirty_page_for_writepage(wbc, page);
3345 unlock_page(page);
3346 return 0;
3347}
3348
3349static int ext4_readpage(struct file *file, struct page *page) 3220static int ext4_readpage(struct file *file, struct page *page)
3350{ 3221{
3351 return mpage_readpage(page, ext4_get_block); 3222 return mpage_readpage(page, ext4_get_block);
@@ -3492,7 +3363,7 @@ static int ext4_journalled_set_page_dirty(struct page *page)
3492static const struct address_space_operations ext4_ordered_aops = { 3363static const struct address_space_operations ext4_ordered_aops = {
3493 .readpage = ext4_readpage, 3364 .readpage = ext4_readpage,
3494 .readpages = ext4_readpages, 3365 .readpages = ext4_readpages,
3495 .writepage = ext4_normal_writepage, 3366 .writepage = ext4_writepage,
3496 .sync_page = block_sync_page, 3367 .sync_page = block_sync_page,
3497 .write_begin = ext4_write_begin, 3368 .write_begin = ext4_write_begin,
3498 .write_end = ext4_ordered_write_end, 3369 .write_end = ext4_ordered_write_end,
@@ -3507,7 +3378,7 @@ static const struct address_space_operations ext4_ordered_aops = {
3507static const struct address_space_operations ext4_writeback_aops = { 3378static const struct address_space_operations ext4_writeback_aops = {
3508 .readpage = ext4_readpage, 3379 .readpage = ext4_readpage,
3509 .readpages = ext4_readpages, 3380 .readpages = ext4_readpages,
3510 .writepage = ext4_normal_writepage, 3381 .writepage = ext4_writepage,
3511 .sync_page = block_sync_page, 3382 .sync_page = block_sync_page,
3512 .write_begin = ext4_write_begin, 3383 .write_begin = ext4_write_begin,
3513 .write_end = ext4_writeback_write_end, 3384 .write_end = ext4_writeback_write_end,
@@ -3522,7 +3393,7 @@ static const struct address_space_operations ext4_writeback_aops = {
3522static const struct address_space_operations ext4_journalled_aops = { 3393static const struct address_space_operations ext4_journalled_aops = {
3523 .readpage = ext4_readpage, 3394 .readpage = ext4_readpage,
3524 .readpages = ext4_readpages, 3395 .readpages = ext4_readpages,
3525 .writepage = ext4_journalled_writepage, 3396 .writepage = ext4_writepage,
3526 .sync_page = block_sync_page, 3397 .sync_page = block_sync_page,
3527 .write_begin = ext4_write_begin, 3398 .write_begin = ext4_write_begin,
3528 .write_end = ext4_journalled_write_end, 3399 .write_end = ext4_journalled_write_end,
@@ -3536,7 +3407,7 @@ static const struct address_space_operations ext4_journalled_aops = {
3536static const struct address_space_operations ext4_da_aops = { 3407static const struct address_space_operations ext4_da_aops = {
3537 .readpage = ext4_readpage, 3408 .readpage = ext4_readpage,
3538 .readpages = ext4_readpages, 3409 .readpages = ext4_readpages,
3539 .writepage = ext4_da_writepage, 3410 .writepage = ext4_writepage,
3540 .writepages = ext4_da_writepages, 3411 .writepages = ext4_da_writepages,
3541 .sync_page = block_sync_page, 3412 .sync_page = block_sync_page,
3542 .write_begin = ext4_da_write_begin, 3413 .write_begin = ext4_da_write_begin,
@@ -3583,7 +3454,8 @@ int ext4_block_truncate_page(handle_t *handle,
3583 struct page *page; 3454 struct page *page;
3584 int err = 0; 3455 int err = 0;
3585 3456
3586 page = grab_cache_page(mapping, from >> PAGE_CACHE_SHIFT); 3457 page = find_or_create_page(mapping, from >> PAGE_CACHE_SHIFT,
3458 mapping_gfp_mask(mapping) & ~__GFP_FS);
3587 if (!page) 3459 if (!page)
3588 return -EINVAL; 3460 return -EINVAL;
3589 3461
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index bb415408fdb6..7050a9cd04a4 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -12,7 +12,6 @@
12#include <linux/capability.h> 12#include <linux/capability.h>
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/compat.h> 14#include <linux/compat.h>
15#include <linux/smp_lock.h>
16#include <linux/mount.h> 15#include <linux/mount.h>
17#include <linux/file.h> 16#include <linux/file.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
@@ -192,7 +191,7 @@ setversion_out:
192 case EXT4_IOC_GROUP_EXTEND: { 191 case EXT4_IOC_GROUP_EXTEND: {
193 ext4_fsblk_t n_blocks_count; 192 ext4_fsblk_t n_blocks_count;
194 struct super_block *sb = inode->i_sb; 193 struct super_block *sb = inode->i_sb;
195 int err, err2; 194 int err, err2=0;
196 195
197 if (!capable(CAP_SYS_RESOURCE)) 196 if (!capable(CAP_SYS_RESOURCE))
198 return -EPERM; 197 return -EPERM;
@@ -205,9 +204,11 @@ setversion_out:
205 return err; 204 return err;
206 205
207 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count); 206 err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count);
208 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 207 if (EXT4_SB(sb)->s_journal) {
209 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 208 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
210 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 209 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
210 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
211 }
211 if (err == 0) 212 if (err == 0)
212 err = err2; 213 err = err2;
213 mnt_drop_write(filp->f_path.mnt); 214 mnt_drop_write(filp->f_path.mnt);
@@ -252,7 +253,7 @@ setversion_out:
252 case EXT4_IOC_GROUP_ADD: { 253 case EXT4_IOC_GROUP_ADD: {
253 struct ext4_new_group_data input; 254 struct ext4_new_group_data input;
254 struct super_block *sb = inode->i_sb; 255 struct super_block *sb = inode->i_sb;
255 int err, err2; 256 int err, err2=0;
256 257
257 if (!capable(CAP_SYS_RESOURCE)) 258 if (!capable(CAP_SYS_RESOURCE))
258 return -EPERM; 259 return -EPERM;
@@ -266,9 +267,11 @@ setversion_out:
266 return err; 267 return err;
267 268
268 err = ext4_group_add(sb, &input); 269 err = ext4_group_add(sb, &input);
269 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); 270 if (EXT4_SB(sb)->s_journal) {
270 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal); 271 jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
271 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); 272 err2 = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
273 jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
274 }
272 if (err == 0) 275 if (err == 0)
273 err = err2; 276 err = err2;
274 mnt_drop_write(filp->f_path.mnt); 277 mnt_drop_write(filp->f_path.mnt);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 519a0a686d94..cd258463e2a9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -657,7 +657,8 @@ static void ext4_mb_mark_free_simple(struct super_block *sb,
657 } 657 }
658} 658}
659 659
660static void ext4_mb_generate_buddy(struct super_block *sb, 660static noinline_for_stack
661void ext4_mb_generate_buddy(struct super_block *sb,
661 void *buddy, void *bitmap, ext4_group_t group) 662 void *buddy, void *bitmap, ext4_group_t group)
662{ 663{
663 struct ext4_group_info *grp = ext4_get_group_info(sb, group); 664 struct ext4_group_info *grp = ext4_get_group_info(sb, group);
@@ -1480,7 +1481,8 @@ static void ext4_mb_measure_extent(struct ext4_allocation_context *ac,
1480 ext4_mb_check_limits(ac, e4b, 0); 1481 ext4_mb_check_limits(ac, e4b, 0);
1481} 1482}
1482 1483
1483static int ext4_mb_try_best_found(struct ext4_allocation_context *ac, 1484static noinline_for_stack
1485int ext4_mb_try_best_found(struct ext4_allocation_context *ac,
1484 struct ext4_buddy *e4b) 1486 struct ext4_buddy *e4b)
1485{ 1487{
1486 struct ext4_free_extent ex = ac->ac_b_ex; 1488 struct ext4_free_extent ex = ac->ac_b_ex;
@@ -1507,7 +1509,8 @@ static int ext4_mb_try_best_found(struct ext4_allocation_context *ac,
1507 return 0; 1509 return 0;
1508} 1510}
1509 1511
1510static int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, 1512static noinline_for_stack
1513int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
1511 struct ext4_buddy *e4b) 1514 struct ext4_buddy *e4b)
1512{ 1515{
1513 ext4_group_t group = ac->ac_g_ex.fe_group; 1516 ext4_group_t group = ac->ac_g_ex.fe_group;
@@ -1566,7 +1569,8 @@ static int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
1566 * The routine scans buddy structures (not bitmap!) from given order 1569 * The routine scans buddy structures (not bitmap!) from given order
1567 * to max order and tries to find big enough chunk to satisfy the req 1570 * to max order and tries to find big enough chunk to satisfy the req
1568 */ 1571 */
1569static void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac, 1572static noinline_for_stack
1573void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
1570 struct ext4_buddy *e4b) 1574 struct ext4_buddy *e4b)
1571{ 1575{
1572 struct super_block *sb = ac->ac_sb; 1576 struct super_block *sb = ac->ac_sb;
@@ -1609,7 +1613,8 @@ static void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
1609 * In order to optimize scanning, caller must pass number of 1613 * In order to optimize scanning, caller must pass number of
1610 * free blocks in the group, so the routine can know upper limit. 1614 * free blocks in the group, so the routine can know upper limit.
1611 */ 1615 */
1612static void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac, 1616static noinline_for_stack
1617void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
1613 struct ext4_buddy *e4b) 1618 struct ext4_buddy *e4b)
1614{ 1619{
1615 struct super_block *sb = ac->ac_sb; 1620 struct super_block *sb = ac->ac_sb;
@@ -1668,7 +1673,8 @@ static void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
1668 * we try to find stripe-aligned chunks for stripe-size requests 1673 * we try to find stripe-aligned chunks for stripe-size requests
1669 * XXX should do so at least for multiples of stripe size as well 1674 * XXX should do so at least for multiples of stripe size as well
1670 */ 1675 */
1671static void ext4_mb_scan_aligned(struct ext4_allocation_context *ac, 1676static noinline_for_stack
1677void ext4_mb_scan_aligned(struct ext4_allocation_context *ac,
1672 struct ext4_buddy *e4b) 1678 struct ext4_buddy *e4b)
1673{ 1679{
1674 struct super_block *sb = ac->ac_sb; 1680 struct super_block *sb = ac->ac_sb;
@@ -1831,7 +1837,8 @@ void ext4_mb_put_buddy_cache_lock(struct super_block *sb,
1831 1837
1832} 1838}
1833 1839
1834static int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) 1840static noinline_for_stack
1841int ext4_mb_init_group(struct super_block *sb, ext4_group_t group)
1835{ 1842{
1836 1843
1837 int ret; 1844 int ret;
@@ -2902,7 +2909,11 @@ int __init init_ext4_mballoc(void)
2902 2909
2903void exit_ext4_mballoc(void) 2910void exit_ext4_mballoc(void)
2904{ 2911{
2905 /* XXX: synchronize_rcu(); */ 2912 /*
2913 * Wait for completion of call_rcu()'s on ext4_pspace_cachep
2914 * before destroying the slab cache.
2915 */
2916 rcu_barrier();
2906 kmem_cache_destroy(ext4_pspace_cachep); 2917 kmem_cache_destroy(ext4_pspace_cachep);
2907 kmem_cache_destroy(ext4_ac_cachep); 2918 kmem_cache_destroy(ext4_ac_cachep);
2908 kmem_cache_destroy(ext4_free_ext_cachep); 2919 kmem_cache_destroy(ext4_free_ext_cachep);
@@ -3457,7 +3468,8 @@ static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap,
3457 * used in in-core bitmap. buddy must be generated from this bitmap 3468 * used in in-core bitmap. buddy must be generated from this bitmap
3458 * Need to be called with ext4 group lock held 3469 * Need to be called with ext4 group lock held
3459 */ 3470 */
3460static void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap, 3471static noinline_for_stack
3472void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap,
3461 ext4_group_t group) 3473 ext4_group_t group)
3462{ 3474{
3463 struct ext4_group_info *grp = ext4_get_group_info(sb, group); 3475 struct ext4_group_info *grp = ext4_get_group_info(sb, group);
@@ -4215,14 +4227,9 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac,
4215 ext4_get_group_no_and_offset(sb, goal, &group, &block); 4227 ext4_get_group_no_and_offset(sb, goal, &group, &block);
4216 4228
4217 /* set up allocation goals */ 4229 /* set up allocation goals */
4230 memset(ac, 0, sizeof(struct ext4_allocation_context));
4218 ac->ac_b_ex.fe_logical = ar->logical; 4231 ac->ac_b_ex.fe_logical = ar->logical;
4219 ac->ac_b_ex.fe_group = 0;
4220 ac->ac_b_ex.fe_start = 0;
4221 ac->ac_b_ex.fe_len = 0;
4222 ac->ac_status = AC_STATUS_CONTINUE; 4232 ac->ac_status = AC_STATUS_CONTINUE;
4223 ac->ac_groups_scanned = 0;
4224 ac->ac_ex_scanned = 0;
4225 ac->ac_found = 0;
4226 ac->ac_sb = sb; 4233 ac->ac_sb = sb;
4227 ac->ac_inode = ar->inode; 4234 ac->ac_inode = ar->inode;
4228 ac->ac_o_ex.fe_logical = ar->logical; 4235 ac->ac_o_ex.fe_logical = ar->logical;
@@ -4233,15 +4240,7 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac,
4233 ac->ac_g_ex.fe_group = group; 4240 ac->ac_g_ex.fe_group = group;
4234 ac->ac_g_ex.fe_start = block; 4241 ac->ac_g_ex.fe_start = block;
4235 ac->ac_g_ex.fe_len = len; 4242 ac->ac_g_ex.fe_len = len;
4236 ac->ac_f_ex.fe_len = 0;
4237 ac->ac_flags = ar->flags; 4243 ac->ac_flags = ar->flags;
4238 ac->ac_2order = 0;
4239 ac->ac_criteria = 0;
4240 ac->ac_pa = NULL;
4241 ac->ac_bitmap_page = NULL;
4242 ac->ac_buddy_page = NULL;
4243 ac->alloc_semp = NULL;
4244 ac->ac_lg = NULL;
4245 4244
4246 /* we have to define context: we'll we work with a file or 4245 /* we have to define context: we'll we work with a file or
4247 * locality group. this is a policy, actually */ 4246 * locality group. this is a policy, actually */
@@ -4509,10 +4508,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4509 } 4508 }
4510 4509
4511 ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); 4510 ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
4512 if (ac) { 4511 if (!ac) {
4513 ac->ac_sb = sb;
4514 ac->ac_inode = ar->inode;
4515 } else {
4516 ar->len = 0; 4512 ar->len = 0;
4517 *errp = -ENOMEM; 4513 *errp = -ENOMEM;
4518 goto out1; 4514 goto out1;
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 38ff75a0fe22..530b4ca01510 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -16,7 +16,6 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/time.h> 18#include <linux/time.h>
19#include <linux/smp_lock.h>
20#include <linux/buffer_head.h> 19#include <linux/buffer_head.h>
21#include <linux/compat.h> 20#include <linux/compat.h>
22#include <asm/uaccess.h> 21#include <asm/uaccess.h>
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index 82f88733b681..bbc94ae4fd77 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -9,7 +9,6 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/time.h> 10#include <linux/time.h>
11#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
12#include <linux/smp_lock.h>
13#include "fat.h" 12#include "fat.h"
14 13
15/* Characters that are undesirable in an MS-DOS file name */ 14/* Characters that are undesirable in an MS-DOS file name */
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 73471b7ecc8c..cb6e83557112 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -19,7 +19,6 @@
19#include <linux/jiffies.h> 19#include <linux/jiffies.h>
20#include <linux/ctype.h> 20#include <linux/ctype.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/smp_lock.h>
23#include <linux/buffer_head.h> 22#include <linux/buffer_head.h>
24#include <linux/namei.h> 23#include <linux/namei.h>
25#include "fat.h" 24#include "fat.h"
diff --git a/fs/fcntl.c b/fs/fcntl.c
index a040b764f8e3..ae413086db97 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -19,7 +19,6 @@
19#include <linux/signal.h> 19#include <linux/signal.h>
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/pid_namespace.h> 21#include <linux/pid_namespace.h>
22#include <linux/smp_lock.h>
23 22
24#include <asm/poll.h> 23#include <asm/poll.h>
25#include <asm/siginfo.h> 24#include <asm/siginfo.h>
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index cdbd1654e4cd..1e8af939b3e4 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -38,6 +38,7 @@
38#include <linux/buffer_head.h> 38#include <linux/buffer_head.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/slab.h> 40#include <linux/slab.h>
41#include <linux/smp_lock.h>
41#include <linux/stat.h> 42#include <linux/stat.h>
42#include <linux/vfs.h> 43#include <linux/vfs.h>
43#include <linux/mount.h> 44#include <linux/mount.h>
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index cbceacbc0bf9..6484eb75acd6 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -16,7 +16,6 @@
16#include <linux/pagemap.h> 16#include <linux/pagemap.h>
17#include <linux/file.h> 17#include <linux/file.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/blkdev.h>
20 19
21MODULE_ALIAS_MISCDEV(FUSE_MINOR); 20MODULE_ALIAS_MISCDEV(FUSE_MINOR);
22 21
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 03ebb439ace0..7ebae9a4ecc0 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -624,6 +624,7 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
624{ 624{
625 struct gfs2_inode *ip = GFS2_I(mapping->host); 625 struct gfs2_inode *ip = GFS2_I(mapping->host);
626 struct gfs2_sbd *sdp = GFS2_SB(mapping->host); 626 struct gfs2_sbd *sdp = GFS2_SB(mapping->host);
627 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
627 unsigned int data_blocks = 0, ind_blocks = 0, rblocks; 628 unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
628 int alloc_required; 629 int alloc_required;
629 int error = 0; 630 int error = 0;
@@ -637,6 +638,14 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
637 error = gfs2_glock_nq(&ip->i_gh); 638 error = gfs2_glock_nq(&ip->i_gh);
638 if (unlikely(error)) 639 if (unlikely(error))
639 goto out_uninit; 640 goto out_uninit;
641 if (&ip->i_inode == sdp->sd_rindex) {
642 error = gfs2_glock_nq_init(m_ip->i_gl, LM_ST_EXCLUSIVE,
643 GL_NOCACHE, &m_ip->i_gh);
644 if (unlikely(error)) {
645 gfs2_glock_dq(&ip->i_gh);
646 goto out_uninit;
647 }
648 }
640 649
641 error = gfs2_write_alloc_required(ip, pos, len, &alloc_required); 650 error = gfs2_write_alloc_required(ip, pos, len, &alloc_required);
642 if (error) 651 if (error)
@@ -667,6 +676,8 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
667 rblocks += data_blocks ? data_blocks : 1; 676 rblocks += data_blocks ? data_blocks : 1;
668 if (ind_blocks || data_blocks) 677 if (ind_blocks || data_blocks)
669 rblocks += RES_STATFS + RES_QUOTA; 678 rblocks += RES_STATFS + RES_QUOTA;
679 if (&ip->i_inode == sdp->sd_rindex)
680 rblocks += 2 * RES_STATFS;
670 681
671 error = gfs2_trans_begin(sdp, rblocks, 682 error = gfs2_trans_begin(sdp, rblocks,
672 PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize); 683 PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize);
@@ -712,6 +723,10 @@ out_alloc_put:
712 gfs2_alloc_put(ip); 723 gfs2_alloc_put(ip);
713 } 724 }
714out_unlock: 725out_unlock:
726 if (&ip->i_inode == sdp->sd_rindex) {
727 gfs2_glock_dq(&m_ip->i_gh);
728 gfs2_holder_uninit(&m_ip->i_gh);
729 }
715 gfs2_glock_dq(&ip->i_gh); 730 gfs2_glock_dq(&ip->i_gh);
716out_uninit: 731out_uninit:
717 gfs2_holder_uninit(&ip->i_gh); 732 gfs2_holder_uninit(&ip->i_gh);
@@ -725,14 +740,21 @@ out_uninit:
725static void adjust_fs_space(struct inode *inode) 740static void adjust_fs_space(struct inode *inode)
726{ 741{
727 struct gfs2_sbd *sdp = inode->i_sb->s_fs_info; 742 struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
743 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
744 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
728 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master; 745 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
729 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; 746 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
747 struct buffer_head *m_bh, *l_bh;
730 u64 fs_total, new_free; 748 u64 fs_total, new_free;
731 749
732 /* Total up the file system space, according to the latest rindex. */ 750 /* Total up the file system space, according to the latest rindex. */
733 fs_total = gfs2_ri_total(sdp); 751 fs_total = gfs2_ri_total(sdp);
752 if (gfs2_meta_inode_buffer(m_ip, &m_bh) != 0)
753 return;
734 754
735 spin_lock(&sdp->sd_statfs_spin); 755 spin_lock(&sdp->sd_statfs_spin);
756 gfs2_statfs_change_in(m_sc, m_bh->b_data +
757 sizeof(struct gfs2_dinode));
736 if (fs_total > (m_sc->sc_total + l_sc->sc_total)) 758 if (fs_total > (m_sc->sc_total + l_sc->sc_total))
737 new_free = fs_total - (m_sc->sc_total + l_sc->sc_total); 759 new_free = fs_total - (m_sc->sc_total + l_sc->sc_total);
738 else 760 else
@@ -741,6 +763,13 @@ static void adjust_fs_space(struct inode *inode)
741 fs_warn(sdp, "File system extended by %llu blocks.\n", 763 fs_warn(sdp, "File system extended by %llu blocks.\n",
742 (unsigned long long)new_free); 764 (unsigned long long)new_free);
743 gfs2_statfs_change(sdp, new_free, new_free, 0); 765 gfs2_statfs_change(sdp, new_free, new_free, 0);
766
767 if (gfs2_meta_inode_buffer(l_ip, &l_bh) != 0)
768 goto out;
769 update_statfs(sdp, m_bh, l_bh);
770 brelse(l_bh);
771out:
772 brelse(m_bh);
744} 773}
745 774
746/** 775/**
@@ -763,6 +792,7 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
763{ 792{
764 struct gfs2_inode *ip = GFS2_I(inode); 793 struct gfs2_inode *ip = GFS2_I(inode);
765 struct gfs2_sbd *sdp = GFS2_SB(inode); 794 struct gfs2_sbd *sdp = GFS2_SB(inode);
795 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
766 u64 to = pos + copied; 796 u64 to = pos + copied;
767 void *kaddr; 797 void *kaddr;
768 unsigned char *buf = dibh->b_data + sizeof(struct gfs2_dinode); 798 unsigned char *buf = dibh->b_data + sizeof(struct gfs2_dinode);
@@ -794,6 +824,10 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
794 824
795 brelse(dibh); 825 brelse(dibh);
796 gfs2_trans_end(sdp); 826 gfs2_trans_end(sdp);
827 if (inode == sdp->sd_rindex) {
828 gfs2_glock_dq(&m_ip->i_gh);
829 gfs2_holder_uninit(&m_ip->i_gh);
830 }
797 gfs2_glock_dq(&ip->i_gh); 831 gfs2_glock_dq(&ip->i_gh);
798 gfs2_holder_uninit(&ip->i_gh); 832 gfs2_holder_uninit(&ip->i_gh);
799 return copied; 833 return copied;
@@ -823,6 +857,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
823 struct inode *inode = page->mapping->host; 857 struct inode *inode = page->mapping->host;
824 struct gfs2_inode *ip = GFS2_I(inode); 858 struct gfs2_inode *ip = GFS2_I(inode);
825 struct gfs2_sbd *sdp = GFS2_SB(inode); 859 struct gfs2_sbd *sdp = GFS2_SB(inode);
860 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
826 struct buffer_head *dibh; 861 struct buffer_head *dibh;
827 struct gfs2_alloc *al = ip->i_alloc; 862 struct gfs2_alloc *al = ip->i_alloc;
828 unsigned int from = pos & (PAGE_CACHE_SIZE - 1); 863 unsigned int from = pos & (PAGE_CACHE_SIZE - 1);
@@ -865,6 +900,10 @@ failed:
865 gfs2_quota_unlock(ip); 900 gfs2_quota_unlock(ip);
866 gfs2_alloc_put(ip); 901 gfs2_alloc_put(ip);
867 } 902 }
903 if (inode == sdp->sd_rindex) {
904 gfs2_glock_dq(&m_ip->i_gh);
905 gfs2_holder_uninit(&m_ip->i_gh);
906 }
868 gfs2_glock_dq(&ip->i_gh); 907 gfs2_glock_dq(&ip->i_gh);
869 gfs2_holder_uninit(&ip->i_gh); 908 gfs2_holder_uninit(&ip->i_gh);
870 return ret; 909 return ret;
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 297421c0427a..8b674b1f3a55 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -63,6 +63,7 @@ static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int
63static DECLARE_RWSEM(gfs2_umount_flush_sem); 63static DECLARE_RWSEM(gfs2_umount_flush_sem);
64static struct dentry *gfs2_root; 64static struct dentry *gfs2_root;
65static struct workqueue_struct *glock_workqueue; 65static struct workqueue_struct *glock_workqueue;
66struct workqueue_struct *gfs2_delete_workqueue;
66static LIST_HEAD(lru_list); 67static LIST_HEAD(lru_list);
67static atomic_t lru_count = ATOMIC_INIT(0); 68static atomic_t lru_count = ATOMIC_INIT(0);
68static DEFINE_SPINLOCK(lru_lock); 69static DEFINE_SPINLOCK(lru_lock);
@@ -167,13 +168,33 @@ static void glock_free(struct gfs2_glock *gl)
167 * 168 *
168 */ 169 */
169 170
170static void gfs2_glock_hold(struct gfs2_glock *gl) 171void gfs2_glock_hold(struct gfs2_glock *gl)
171{ 172{
172 GLOCK_BUG_ON(gl, atomic_read(&gl->gl_ref) == 0); 173 GLOCK_BUG_ON(gl, atomic_read(&gl->gl_ref) == 0);
173 atomic_inc(&gl->gl_ref); 174 atomic_inc(&gl->gl_ref);
174} 175}
175 176
176/** 177/**
178 * demote_ok - Check to see if it's ok to unlock a glock
179 * @gl: the glock
180 *
181 * Returns: 1 if it's ok
182 */
183
184static int demote_ok(const struct gfs2_glock *gl)
185{
186 const struct gfs2_glock_operations *glops = gl->gl_ops;
187
188 if (gl->gl_state == LM_ST_UNLOCKED)
189 return 0;
190 if (!list_empty(&gl->gl_holders))
191 return 0;
192 if (glops->go_demote_ok)
193 return glops->go_demote_ok(gl);
194 return 1;
195}
196
197/**
177 * gfs2_glock_schedule_for_reclaim - Add a glock to the reclaim list 198 * gfs2_glock_schedule_for_reclaim - Add a glock to the reclaim list
178 * @gl: the glock 199 * @gl: the glock
179 * 200 *
@@ -181,8 +202,13 @@ static void gfs2_glock_hold(struct gfs2_glock *gl)
181 202
182static void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl) 203static void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl)
183{ 204{
205 int may_reclaim;
206 may_reclaim = (demote_ok(gl) &&
207 (atomic_read(&gl->gl_ref) == 1 ||
208 (gl->gl_name.ln_type == LM_TYPE_INODE &&
209 atomic_read(&gl->gl_ref) <= 2)));
184 spin_lock(&lru_lock); 210 spin_lock(&lru_lock);
185 if (list_empty(&gl->gl_lru) && gl->gl_state != LM_ST_UNLOCKED) { 211 if (list_empty(&gl->gl_lru) && may_reclaim) {
186 list_add_tail(&gl->gl_lru, &lru_list); 212 list_add_tail(&gl->gl_lru, &lru_list);
187 atomic_inc(&lru_count); 213 atomic_inc(&lru_count);
188 } 214 }
@@ -190,6 +216,21 @@ static void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl)
190} 216}
191 217
192/** 218/**
219 * gfs2_glock_put_nolock() - Decrement reference count on glock
220 * @gl: The glock to put
221 *
222 * This function should only be used if the caller has its own reference
223 * to the glock, in addition to the one it is dropping.
224 */
225
226void gfs2_glock_put_nolock(struct gfs2_glock *gl)
227{
228 if (atomic_dec_and_test(&gl->gl_ref))
229 GLOCK_BUG_ON(gl, 1);
230 gfs2_glock_schedule_for_reclaim(gl);
231}
232
233/**
193 * gfs2_glock_put() - Decrement reference count on glock 234 * gfs2_glock_put() - Decrement reference count on glock
194 * @gl: The glock to put 235 * @gl: The glock to put
195 * 236 *
@@ -214,9 +255,9 @@ int gfs2_glock_put(struct gfs2_glock *gl)
214 rv = 1; 255 rv = 1;
215 goto out; 256 goto out;
216 } 257 }
217 /* 1 for being hashed, 1 for having state != LM_ST_UNLOCKED */ 258 spin_lock(&gl->gl_spin);
218 if (atomic_read(&gl->gl_ref) == 2) 259 gfs2_glock_schedule_for_reclaim(gl);
219 gfs2_glock_schedule_for_reclaim(gl); 260 spin_unlock(&gl->gl_spin);
220 write_unlock(gl_lock_addr(gl->gl_hash)); 261 write_unlock(gl_lock_addr(gl->gl_hash));
221out: 262out:
222 return rv; 263 return rv;
@@ -398,7 +439,7 @@ static void state_change(struct gfs2_glock *gl, unsigned int new_state)
398 if (held2) 439 if (held2)
399 gfs2_glock_hold(gl); 440 gfs2_glock_hold(gl);
400 else 441 else
401 gfs2_glock_put(gl); 442 gfs2_glock_put_nolock(gl);
402 } 443 }
403 444
404 gl->gl_state = new_state; 445 gl->gl_state = new_state;
@@ -633,12 +674,35 @@ out:
633out_sched: 674out_sched:
634 gfs2_glock_hold(gl); 675 gfs2_glock_hold(gl);
635 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) 676 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
636 gfs2_glock_put(gl); 677 gfs2_glock_put_nolock(gl);
637out_unlock: 678out_unlock:
638 clear_bit(GLF_LOCK, &gl->gl_flags); 679 clear_bit(GLF_LOCK, &gl->gl_flags);
639 goto out; 680 goto out;
640} 681}
641 682
683static void delete_work_func(struct work_struct *work)
684{
685 struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete);
686 struct gfs2_sbd *sdp = gl->gl_sbd;
687 struct gfs2_inode *ip = NULL;
688 struct inode *inode;
689 u64 no_addr = 0;
690
691 spin_lock(&gl->gl_spin);
692 ip = (struct gfs2_inode *)gl->gl_object;
693 if (ip)
694 no_addr = ip->i_no_addr;
695 spin_unlock(&gl->gl_spin);
696 if (ip) {
697 inode = gfs2_ilookup(sdp->sd_vfs, no_addr);
698 if (inode) {
699 d_prune_aliases(inode);
700 iput(inode);
701 }
702 }
703 gfs2_glock_put(gl);
704}
705
642static void glock_work_func(struct work_struct *work) 706static void glock_work_func(struct work_struct *work)
643{ 707{
644 unsigned long delay = 0; 708 unsigned long delay = 0;
@@ -717,6 +781,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
717 gl->gl_sbd = sdp; 781 gl->gl_sbd = sdp;
718 gl->gl_aspace = NULL; 782 gl->gl_aspace = NULL;
719 INIT_DELAYED_WORK(&gl->gl_work, glock_work_func); 783 INIT_DELAYED_WORK(&gl->gl_work, glock_work_func);
784 INIT_WORK(&gl->gl_delete, delete_work_func);
720 785
721 /* If this glock protects actual on-disk data or metadata blocks, 786 /* If this glock protects actual on-disk data or metadata blocks,
722 create a VFS inode to manage the pages/buffers holding them. */ 787 create a VFS inode to manage the pages/buffers holding them. */
@@ -858,6 +923,8 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state,
858 gl->gl_demote_state != state) { 923 gl->gl_demote_state != state) {
859 gl->gl_demote_state = LM_ST_UNLOCKED; 924 gl->gl_demote_state = LM_ST_UNLOCKED;
860 } 925 }
926 if (gl->gl_ops->go_callback)
927 gl->gl_ops->go_callback(gl);
861 trace_gfs2_demote_rq(gl); 928 trace_gfs2_demote_rq(gl);
862} 929}
863 930
@@ -1274,33 +1341,12 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
1274 gfs2_glock_put(gl); 1341 gfs2_glock_put(gl);
1275} 1342}
1276 1343
1277/**
1278 * demote_ok - Check to see if it's ok to unlock a glock
1279 * @gl: the glock
1280 *
1281 * Returns: 1 if it's ok
1282 */
1283
1284static int demote_ok(const struct gfs2_glock *gl)
1285{
1286 const struct gfs2_glock_operations *glops = gl->gl_ops;
1287
1288 if (gl->gl_state == LM_ST_UNLOCKED)
1289 return 0;
1290 if (!list_empty(&gl->gl_holders))
1291 return 0;
1292 if (glops->go_demote_ok)
1293 return glops->go_demote_ok(gl);
1294 return 1;
1295}
1296
1297 1344
1298static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask) 1345static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
1299{ 1346{
1300 struct gfs2_glock *gl; 1347 struct gfs2_glock *gl;
1301 int may_demote; 1348 int may_demote;
1302 int nr_skipped = 0; 1349 int nr_skipped = 0;
1303 int got_ref = 0;
1304 LIST_HEAD(skipped); 1350 LIST_HEAD(skipped);
1305 1351
1306 if (nr == 0) 1352 if (nr == 0)
@@ -1315,37 +1361,29 @@ static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
1315 list_del_init(&gl->gl_lru); 1361 list_del_init(&gl->gl_lru);
1316 atomic_dec(&lru_count); 1362 atomic_dec(&lru_count);
1317 1363
1364 /* Check if glock is about to be freed */
1365 if (atomic_read(&gl->gl_ref) == 0)
1366 continue;
1367
1318 /* Test for being demotable */ 1368 /* Test for being demotable */
1319 if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) { 1369 if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
1320 gfs2_glock_hold(gl); 1370 gfs2_glock_hold(gl);
1321 got_ref = 1;
1322 spin_unlock(&lru_lock); 1371 spin_unlock(&lru_lock);
1323 spin_lock(&gl->gl_spin); 1372 spin_lock(&gl->gl_spin);
1324 may_demote = demote_ok(gl); 1373 may_demote = demote_ok(gl);
1325 spin_unlock(&gl->gl_spin);
1326 clear_bit(GLF_LOCK, &gl->gl_flags);
1327 if (may_demote) { 1374 if (may_demote) {
1328 handle_callback(gl, LM_ST_UNLOCKED, 0); 1375 handle_callback(gl, LM_ST_UNLOCKED, 0);
1329 nr--; 1376 nr--;
1330 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
1331 gfs2_glock_put(gl);
1332 got_ref = 0;
1333 } 1377 }
1378 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
1379 gfs2_glock_put_nolock(gl);
1380 spin_unlock(&gl->gl_spin);
1381 clear_bit(GLF_LOCK, &gl->gl_flags);
1334 spin_lock(&lru_lock); 1382 spin_lock(&lru_lock);
1335 if (may_demote) 1383 continue;
1336 continue;
1337 }
1338 if (list_empty(&gl->gl_lru) &&
1339 (atomic_read(&gl->gl_ref) <= (2 + got_ref))) {
1340 nr_skipped++;
1341 list_add(&gl->gl_lru, &skipped);
1342 }
1343 if (got_ref) {
1344 spin_unlock(&lru_lock);
1345 gfs2_glock_put(gl);
1346 spin_lock(&lru_lock);
1347 got_ref = 0;
1348 } 1384 }
1385 nr_skipped++;
1386 list_add(&gl->gl_lru, &skipped);
1349 } 1387 }
1350 list_splice(&skipped, &lru_list); 1388 list_splice(&skipped, &lru_list);
1351 atomic_add(nr_skipped, &lru_count); 1389 atomic_add(nr_skipped, &lru_count);
@@ -1727,6 +1765,11 @@ int __init gfs2_glock_init(void)
1727 glock_workqueue = create_workqueue("glock_workqueue"); 1765 glock_workqueue = create_workqueue("glock_workqueue");
1728 if (IS_ERR(glock_workqueue)) 1766 if (IS_ERR(glock_workqueue))
1729 return PTR_ERR(glock_workqueue); 1767 return PTR_ERR(glock_workqueue);
1768 gfs2_delete_workqueue = create_workqueue("delete_workqueue");
1769 if (IS_ERR(gfs2_delete_workqueue)) {
1770 destroy_workqueue(glock_workqueue);
1771 return PTR_ERR(gfs2_delete_workqueue);
1772 }
1730 1773
1731 register_shrinker(&glock_shrinker); 1774 register_shrinker(&glock_shrinker);
1732 1775
@@ -1737,6 +1780,7 @@ void gfs2_glock_exit(void)
1737{ 1780{
1738 unregister_shrinker(&glock_shrinker); 1781 unregister_shrinker(&glock_shrinker);
1739 destroy_workqueue(glock_workqueue); 1782 destroy_workqueue(glock_workqueue);
1783 destroy_workqueue(gfs2_delete_workqueue);
1740} 1784}
1741 1785
1742static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi) 1786static int gfs2_glock_iter_next(struct gfs2_glock_iter *gi)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index a602a28f6f08..c609894ec0d0 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -143,6 +143,7 @@ struct lm_lockops {
143 143
144#define GLR_TRYFAILED 13 144#define GLR_TRYFAILED 13
145 145
146extern struct workqueue_struct *gfs2_delete_workqueue;
146static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl) 147static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
147{ 148{
148 struct gfs2_holder *gh; 149 struct gfs2_holder *gh;
@@ -191,6 +192,8 @@ static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl)
191int gfs2_glock_get(struct gfs2_sbd *sdp, 192int gfs2_glock_get(struct gfs2_sbd *sdp,
192 u64 number, const struct gfs2_glock_operations *glops, 193 u64 number, const struct gfs2_glock_operations *glops,
193 int create, struct gfs2_glock **glp); 194 int create, struct gfs2_glock **glp);
195void gfs2_glock_hold(struct gfs2_glock *gl);
196void gfs2_glock_put_nolock(struct gfs2_glock *gl);
194int gfs2_glock_put(struct gfs2_glock *gl); 197int gfs2_glock_put(struct gfs2_glock *gl);
195void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags, 198void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags,
196 struct gfs2_holder *gh); 199 struct gfs2_holder *gh);
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index d5e4ab155ca0..6985eef06c39 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -323,6 +323,7 @@ static void trans_go_sync(struct gfs2_glock *gl)
323 323
324 if (gl->gl_state != LM_ST_UNLOCKED && 324 if (gl->gl_state != LM_ST_UNLOCKED &&
325 test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { 325 test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
326 flush_workqueue(gfs2_delete_workqueue);
326 gfs2_meta_syncfs(sdp); 327 gfs2_meta_syncfs(sdp);
327 gfs2_log_shutdown(sdp); 328 gfs2_log_shutdown(sdp);
328 } 329 }
@@ -372,6 +373,25 @@ static int trans_go_demote_ok(const struct gfs2_glock *gl)
372 return 0; 373 return 0;
373} 374}
374 375
376/**
377 * iopen_go_callback - schedule the dcache entry for the inode to be deleted
378 * @gl: the glock
379 *
380 * gl_spin lock is held while calling this
381 */
382static void iopen_go_callback(struct gfs2_glock *gl)
383{
384 struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object;
385
386 if (gl->gl_demote_state == LM_ST_UNLOCKED &&
387 gl->gl_state == LM_ST_SHARED &&
388 ip && test_bit(GIF_USER, &ip->i_flags)) {
389 gfs2_glock_hold(gl);
390 if (queue_work(gfs2_delete_workqueue, &gl->gl_delete) == 0)
391 gfs2_glock_put_nolock(gl);
392 }
393}
394
375const struct gfs2_glock_operations gfs2_meta_glops = { 395const struct gfs2_glock_operations gfs2_meta_glops = {
376 .go_type = LM_TYPE_META, 396 .go_type = LM_TYPE_META,
377}; 397};
@@ -406,6 +426,7 @@ const struct gfs2_glock_operations gfs2_trans_glops = {
406 426
407const struct gfs2_glock_operations gfs2_iopen_glops = { 427const struct gfs2_glock_operations gfs2_iopen_glops = {
408 .go_type = LM_TYPE_IOPEN, 428 .go_type = LM_TYPE_IOPEN,
429 .go_callback = iopen_go_callback,
409}; 430};
410 431
411const struct gfs2_glock_operations gfs2_flock_glops = { 432const struct gfs2_glock_operations gfs2_flock_glops = {
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 225347fbff3c..61801ada36f0 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -159,6 +159,7 @@ struct gfs2_glock_operations {
159 int (*go_lock) (struct gfs2_holder *gh); 159 int (*go_lock) (struct gfs2_holder *gh);
160 void (*go_unlock) (struct gfs2_holder *gh); 160 void (*go_unlock) (struct gfs2_holder *gh);
161 int (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl); 161 int (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl);
162 void (*go_callback) (struct gfs2_glock *gl);
162 const int go_type; 163 const int go_type;
163 const unsigned long go_min_hold_time; 164 const unsigned long go_min_hold_time;
164}; 165};
@@ -228,6 +229,7 @@ struct gfs2_glock {
228 struct list_head gl_ail_list; 229 struct list_head gl_ail_list;
229 atomic_t gl_ail_count; 230 atomic_t gl_ail_count;
230 struct delayed_work gl_work; 231 struct delayed_work gl_work;
232 struct work_struct gl_delete;
231}; 233};
232 234
233#define GFS2_MIN_LVB_SIZE 32 /* Min size of LVB that gfs2 supports */ 235#define GFS2_MIN_LVB_SIZE 32 /* Min size of LVB that gfs2 supports */
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index daa4ae341a29..fba795798d3a 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -285,27 +285,19 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
285 } 285 }
286 286
287 tmp = rgd->rd_data - rgd->rd_free - rgd->rd_dinodes; 287 tmp = rgd->rd_data - rgd->rd_free - rgd->rd_dinodes;
288 if (count[1] + count[2] != tmp) { 288 if (count[1] != tmp) {
289 if (gfs2_consist_rgrpd(rgd)) 289 if (gfs2_consist_rgrpd(rgd))
290 fs_err(sdp, "used data mismatch: %u != %u\n", 290 fs_err(sdp, "used data mismatch: %u != %u\n",
291 count[1], tmp); 291 count[1], tmp);
292 return; 292 return;
293 } 293 }
294 294
295 if (count[3] != rgd->rd_dinodes) { 295 if (count[2] + count[3] != rgd->rd_dinodes) {
296 if (gfs2_consist_rgrpd(rgd)) 296 if (gfs2_consist_rgrpd(rgd))
297 fs_err(sdp, "used metadata mismatch: %u != %u\n", 297 fs_err(sdp, "used metadata mismatch: %u != %u\n",
298 count[3], rgd->rd_dinodes); 298 count[2] + count[3], rgd->rd_dinodes);
299 return; 299 return;
300 } 300 }
301
302 if (count[2] > count[3]) {
303 if (gfs2_consist_rgrpd(rgd))
304 fs_err(sdp, "unlinked inodes > inodes: %u\n",
305 count[2]);
306 return;
307 }
308
309} 301}
310 302
311static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block) 303static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block)
@@ -961,7 +953,8 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al)
961 * Returns: The inode, if one has been found 953 * Returns: The inode, if one has been found
962 */ 954 */
963 955
964static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked) 956static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked,
957 u64 skip)
965{ 958{
966 struct inode *inode; 959 struct inode *inode;
967 u32 goal = 0, block; 960 u32 goal = 0, block;
@@ -985,6 +978,8 @@ static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked)
985 goal++; 978 goal++;
986 if (*last_unlinked != NO_BLOCK && no_addr <= *last_unlinked) 979 if (*last_unlinked != NO_BLOCK && no_addr <= *last_unlinked)
987 continue; 980 continue;
981 if (no_addr == skip)
982 continue;
988 *last_unlinked = no_addr; 983 *last_unlinked = no_addr;
989 inode = gfs2_inode_lookup(rgd->rd_sbd->sd_vfs, DT_UNKNOWN, 984 inode = gfs2_inode_lookup(rgd->rd_sbd->sd_vfs, DT_UNKNOWN,
990 no_addr, -1, 1); 985 no_addr, -1, 1);
@@ -1104,7 +1099,7 @@ static struct inode *get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
1104 if (try_rgrp_fit(rgd, al)) 1099 if (try_rgrp_fit(rgd, al))
1105 goto out; 1100 goto out;
1106 if (rgd->rd_flags & GFS2_RDF_CHECK) 1101 if (rgd->rd_flags & GFS2_RDF_CHECK)
1107 inode = try_rgrp_unlink(rgd, last_unlinked); 1102 inode = try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr);
1108 if (!rg_locked) 1103 if (!rg_locked)
1109 gfs2_glock_dq_uninit(&al->al_rgd_gh); 1104 gfs2_glock_dq_uninit(&al->al_rgd_gh);
1110 if (inode) 1105 if (inode)
@@ -1138,7 +1133,7 @@ static struct inode *get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked)
1138 if (try_rgrp_fit(rgd, al)) 1133 if (try_rgrp_fit(rgd, al))
1139 goto out; 1134 goto out;
1140 if (rgd->rd_flags & GFS2_RDF_CHECK) 1135 if (rgd->rd_flags & GFS2_RDF_CHECK)
1141 inode = try_rgrp_unlink(rgd, last_unlinked); 1136 inode = try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr);
1142 if (!rg_locked) 1137 if (!rg_locked)
1143 gfs2_glock_dq_uninit(&al->al_rgd_gh); 1138 gfs2_glock_dq_uninit(&al->al_rgd_gh);
1144 if (inode) 1139 if (inode)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 0a6801336470..f522bb017973 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -353,7 +353,7 @@ fail:
353 return error; 353 return error;
354} 354}
355 355
356static void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf) 356void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf)
357{ 357{
358 const struct gfs2_statfs_change *str = buf; 358 const struct gfs2_statfs_change *str = buf;
359 359
@@ -441,6 +441,29 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
441 brelse(l_bh); 441 brelse(l_bh);
442} 442}
443 443
444void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
445 struct buffer_head *l_bh)
446{
447 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
448 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
449 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
450 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
451
452 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
453
454 spin_lock(&sdp->sd_statfs_spin);
455 m_sc->sc_total += l_sc->sc_total;
456 m_sc->sc_free += l_sc->sc_free;
457 m_sc->sc_dinodes += l_sc->sc_dinodes;
458 memset(l_sc, 0, sizeof(struct gfs2_statfs_change));
459 memset(l_bh->b_data + sizeof(struct gfs2_dinode),
460 0, sizeof(struct gfs2_statfs_change));
461 spin_unlock(&sdp->sd_statfs_spin);
462
463 gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
464 gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode));
465}
466
444int gfs2_statfs_sync(struct gfs2_sbd *sdp) 467int gfs2_statfs_sync(struct gfs2_sbd *sdp)
445{ 468{
446 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode); 469 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
@@ -477,19 +500,7 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
477 if (error) 500 if (error)
478 goto out_bh2; 501 goto out_bh2;
479 502
480 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); 503 update_statfs(sdp, m_bh, l_bh);
481
482 spin_lock(&sdp->sd_statfs_spin);
483 m_sc->sc_total += l_sc->sc_total;
484 m_sc->sc_free += l_sc->sc_free;
485 m_sc->sc_dinodes += l_sc->sc_dinodes;
486 memset(l_sc, 0, sizeof(struct gfs2_statfs_change));
487 memset(l_bh->b_data + sizeof(struct gfs2_dinode),
488 0, sizeof(struct gfs2_statfs_change));
489 spin_unlock(&sdp->sd_statfs_spin);
490
491 gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
492 gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode));
493 504
494 gfs2_trans_end(sdp); 505 gfs2_trans_end(sdp);
495 506
@@ -680,6 +691,7 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
680 struct gfs2_holder t_gh; 691 struct gfs2_holder t_gh;
681 int error; 692 int error;
682 693
694 flush_workqueue(gfs2_delete_workqueue);
683 gfs2_quota_sync(sdp); 695 gfs2_quota_sync(sdp);
684 gfs2_statfs_sync(sdp); 696 gfs2_statfs_sync(sdp);
685 697
diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h
index b56413e3e40d..22e0417ed996 100644
--- a/fs/gfs2/super.h
+++ b/fs/gfs2/super.h
@@ -40,6 +40,10 @@ extern int gfs2_make_fs_rw(struct gfs2_sbd *sdp);
40extern int gfs2_statfs_init(struct gfs2_sbd *sdp); 40extern int gfs2_statfs_init(struct gfs2_sbd *sdp);
41extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free, 41extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
42 s64 dinodes); 42 s64 dinodes);
43extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc,
44 const void *buf);
45extern void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
46 struct buffer_head *l_bh);
43extern int gfs2_statfs_sync(struct gfs2_sbd *sdp); 47extern int gfs2_statfs_sync(struct gfs2_sbd *sdp);
44 48
45extern int gfs2_freeze_fs(struct gfs2_sbd *sdp); 49extern int gfs2_freeze_fs(struct gfs2_sbd *sdp);
diff --git a/fs/gfs2/trace_gfs2.h b/fs/gfs2/trace_gfs2.h
index 98d6ef1c1dc0..148d55c14171 100644
--- a/fs/gfs2/trace_gfs2.h
+++ b/fs/gfs2/trace_gfs2.h
@@ -1,12 +1,11 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM gfs2
3
1#if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_GFS2_H 5#define _TRACE_GFS2_H
3 6
4#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
5 8
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM gfs2
8#define TRACE_INCLUDE_FILE trace_gfs2
9
10#include <linux/fs.h> 9#include <linux/fs.h>
11#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
12#include <linux/dlmconstants.h> 11#include <linux/dlmconstants.h>
@@ -403,5 +402,6 @@ TRACE_EVENT(gfs2_block_alloc,
403/* This part must be outside protection */ 402/* This part must be outside protection */
404#undef TRACE_INCLUDE_PATH 403#undef TRACE_INCLUDE_PATH
405#define TRACE_INCLUDE_PATH . 404#define TRACE_INCLUDE_PATH .
405#define TRACE_INCLUDE_FILE trace_gfs2
406#include <trace/define_trace.h> 406#include <trace/define_trace.h>
407 407
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 6f833dc8e910..f7fcbe49da72 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -19,6 +19,7 @@
19#include <linux/nls.h> 19#include <linux/nls.h>
20#include <linux/parser.h> 20#include <linux/parser.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/smp_lock.h>
22#include <linux/vfs.h> 23#include <linux/vfs.h>
23 24
24#include "hfs_fs.h" 25#include "hfs_fs.h"
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 9fc3af0c0dab..c0759fe0855b 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -12,6 +12,7 @@
12#include <linux/pagemap.h> 12#include <linux/pagemap.h>
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/smp_lock.h>
15#include <linux/vfs.h> 16#include <linux/vfs.h>
16#include <linux/nls.h> 17#include <linux/nls.h>
17 18
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c
index 6916c41d7017..8865c94f55f6 100644
--- a/fs/hpfs/dir.c
+++ b/fs/hpfs/dir.c
@@ -6,6 +6,7 @@
6 * directory VFS functions 6 * directory VFS functions
7 */ 7 */
8 8
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11static int hpfs_dir_release(struct inode *inode, struct file *filp) 12static int hpfs_dir_release(struct inode *inode, struct file *filp)
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index 64ab52259204..3efabff00367 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -6,6 +6,7 @@
6 * file VFS functions 6 * file VFS functions
7 */ 7 */
8 8
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11#define BLOCKS(size) (((size) + 511) >> 9) 12#define BLOCKS(size) (((size) + 511) >> 9)
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index c2ea31bae313..701ca54c0867 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -13,7 +13,6 @@
13#include <linux/pagemap.h> 13#include <linux/pagemap.h>
14#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/smp_lock.h>
17 16
18#include "hpfs.h" 17#include "hpfs.h"
19 18
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index 39a1bfbea312..fe703ae46bc7 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -6,6 +6,7 @@
6 * inode VFS functions 6 * inode VFS functions
7 */ 7 */
8 8
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11void hpfs_init_inode(struct inode *i) 12void hpfs_init_inode(struct inode *i)
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index b649232dde97..82b9c4ba9ed0 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -6,6 +6,7 @@
6 * adding & removing files & directories 6 * adding & removing files & directories
7 */ 7 */
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/smp_lock.h>
9#include "hpfs_fn.h" 10#include "hpfs_fn.h"
10 11
11static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 12static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 737f7246a4b5..f96f85092d1c 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -287,6 +287,7 @@ int journal_write_metadata_buffer(transaction_t *transaction,
287 struct page *new_page; 287 struct page *new_page;
288 unsigned int new_offset; 288 unsigned int new_offset;
289 struct buffer_head *bh_in = jh2bh(jh_in); 289 struct buffer_head *bh_in = jh2bh(jh_in);
290 journal_t *journal = transaction->t_journal;
290 291
291 /* 292 /*
292 * The buffer really shouldn't be locked: only the current committing 293 * The buffer really shouldn't be locked: only the current committing
@@ -300,6 +301,11 @@ int journal_write_metadata_buffer(transaction_t *transaction,
300 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in)); 301 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in));
301 302
302 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL); 303 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
304 /* keep subsequent assertions sane */
305 new_bh->b_state = 0;
306 init_buffer(new_bh, NULL, NULL);
307 atomic_set(&new_bh->b_count, 1);
308 new_jh = journal_add_journal_head(new_bh); /* This sleeps */
303 309
304 /* 310 /*
305 * If a new transaction has already done a buffer copy-out, then 311 * If a new transaction has already done a buffer copy-out, then
@@ -361,14 +367,6 @@ repeat:
361 kunmap_atomic(mapped_data, KM_USER0); 367 kunmap_atomic(mapped_data, KM_USER0);
362 } 368 }
363 369
364 /* keep subsequent assertions sane */
365 new_bh->b_state = 0;
366 init_buffer(new_bh, NULL, NULL);
367 atomic_set(&new_bh->b_count, 1);
368 jbd_unlock_bh_state(bh_in);
369
370 new_jh = journal_add_journal_head(new_bh); /* This sleeps */
371
372 set_bh_page(new_bh, new_page, new_offset); 370 set_bh_page(new_bh, new_page, new_offset);
373 new_jh->b_transaction = NULL; 371 new_jh->b_transaction = NULL;
374 new_bh->b_size = jh2bh(jh_in)->b_size; 372 new_bh->b_size = jh2bh(jh_in)->b_size;
@@ -385,7 +383,11 @@ repeat:
385 * copying is moved to the transaction's shadow queue. 383 * copying is moved to the transaction's shadow queue.
386 */ 384 */
387 JBUFFER_TRACE(jh_in, "file as BJ_Shadow"); 385 JBUFFER_TRACE(jh_in, "file as BJ_Shadow");
388 journal_file_buffer(jh_in, transaction, BJ_Shadow); 386 spin_lock(&journal->j_list_lock);
387 __journal_file_buffer(jh_in, transaction, BJ_Shadow);
388 spin_unlock(&journal->j_list_lock);
389 jbd_unlock_bh_state(bh_in);
390
389 JBUFFER_TRACE(new_jh, "file as BJ_IO"); 391 JBUFFER_TRACE(new_jh, "file as BJ_IO");
390 journal_file_buffer(new_jh, transaction, BJ_IO); 392 journal_file_buffer(new_jh, transaction, BJ_IO);
391 393
@@ -848,6 +850,12 @@ static int journal_reset(journal_t *journal)
848 850
849 first = be32_to_cpu(sb->s_first); 851 first = be32_to_cpu(sb->s_first);
850 last = be32_to_cpu(sb->s_maxlen); 852 last = be32_to_cpu(sb->s_maxlen);
853 if (first + JFS_MIN_JOURNAL_BLOCKS > last + 1) {
854 printk(KERN_ERR "JBD: Journal too short (blocks %lu-%lu).\n",
855 first, last);
856 journal_fail_superblock(journal);
857 return -EINVAL;
858 }
851 859
852 journal->j_first = first; 860 journal->j_first = first;
853 journal->j_last = last; 861 journal->j_last = last;
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 73242ba7c7b1..c03ac11f74be 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -489,34 +489,15 @@ void journal_unlock_updates (journal_t *journal)
489 wake_up(&journal->j_wait_transaction_locked); 489 wake_up(&journal->j_wait_transaction_locked);
490} 490}
491 491
492/* 492static void warn_dirty_buffer(struct buffer_head *bh)
493 * Report any unexpected dirty buffers which turn up. Normally those
494 * indicate an error, but they can occur if the user is running (say)
495 * tune2fs to modify the live filesystem, so we need the option of
496 * continuing as gracefully as possible. #
497 *
498 * The caller should already hold the journal lock and
499 * j_list_lock spinlock: most callers will need those anyway
500 * in order to probe the buffer's journaling state safely.
501 */
502static void jbd_unexpected_dirty_buffer(struct journal_head *jh)
503{ 493{
504 int jlist; 494 char b[BDEVNAME_SIZE];
505
506 /* If this buffer is one which might reasonably be dirty
507 * --- ie. data, or not part of this journal --- then
508 * we're OK to leave it alone, but otherwise we need to
509 * move the dirty bit to the journal's own internal
510 * JBDDirty bit. */
511 jlist = jh->b_jlist;
512 495
513 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 496 printk(KERN_WARNING
514 jlist == BJ_Shadow || jlist == BJ_Forget) { 497 "JBD: Spotted dirty metadata buffer (dev = %s, blocknr = %llu). "
515 struct buffer_head *bh = jh2bh(jh); 498 "There's a risk of filesystem corruption in case of system "
516 499 "crash.\n",
517 if (test_clear_buffer_dirty(bh)) 500 bdevname(bh->b_bdev, b), (unsigned long long)bh->b_blocknr);
518 set_buffer_jbddirty(bh);
519 }
520} 501}
521 502
522/* 503/*
@@ -583,14 +564,16 @@ repeat:
583 if (jh->b_next_transaction) 564 if (jh->b_next_transaction)
584 J_ASSERT_JH(jh, jh->b_next_transaction == 565 J_ASSERT_JH(jh, jh->b_next_transaction ==
585 transaction); 566 transaction);
567 warn_dirty_buffer(bh);
586 } 568 }
587 /* 569 /*
588 * In any case we need to clean the dirty flag and we must 570 * In any case we need to clean the dirty flag and we must
589 * do it under the buffer lock to be sure we don't race 571 * do it under the buffer lock to be sure we don't race
590 * with running write-out. 572 * with running write-out.
591 */ 573 */
592 JBUFFER_TRACE(jh, "Unexpected dirty buffer"); 574 JBUFFER_TRACE(jh, "Journalling dirty buffer");
593 jbd_unexpected_dirty_buffer(jh); 575 clear_buffer_dirty(bh);
576 set_buffer_jbddirty(bh);
594 } 577 }
595 578
596 unlock_buffer(bh); 579 unlock_buffer(bh);
@@ -826,6 +809,15 @@ int journal_get_create_access(handle_t *handle, struct buffer_head *bh)
826 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh))); 809 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
827 810
828 if (jh->b_transaction == NULL) { 811 if (jh->b_transaction == NULL) {
812 /*
813 * Previous journal_forget() could have left the buffer
814 * with jbddirty bit set because it was being committed. When
815 * the commit finished, we've filed the buffer for
816 * checkpointing and marked it dirty. Now we are reallocating
817 * the buffer so the transaction freeing it must have
818 * committed and so it's safe to clear the dirty bit.
819 */
820 clear_buffer_dirty(jh2bh(jh));
829 jh->b_transaction = transaction; 821 jh->b_transaction = transaction;
830 822
831 /* first access by this transaction */ 823 /* first access by this transaction */
@@ -1782,8 +1774,13 @@ static int __dispose_buffer(struct journal_head *jh, transaction_t *transaction)
1782 1774
1783 if (jh->b_cp_transaction) { 1775 if (jh->b_cp_transaction) {
1784 JBUFFER_TRACE(jh, "on running+cp transaction"); 1776 JBUFFER_TRACE(jh, "on running+cp transaction");
1777 /*
1778 * We don't want to write the buffer anymore, clear the
1779 * bit so that we don't confuse checks in
1780 * __journal_file_buffer
1781 */
1782 clear_buffer_dirty(bh);
1785 __journal_file_buffer(jh, transaction, BJ_Forget); 1783 __journal_file_buffer(jh, transaction, BJ_Forget);
1786 clear_buffer_jbddirty(bh);
1787 may_free = 0; 1784 may_free = 0;
1788 } else { 1785 } else {
1789 JBUFFER_TRACE(jh, "on running transaction"); 1786 JBUFFER_TRACE(jh, "on running transaction");
@@ -2041,12 +2038,17 @@ void __journal_file_buffer(struct journal_head *jh,
2041 if (jh->b_transaction && jh->b_jlist == jlist) 2038 if (jh->b_transaction && jh->b_jlist == jlist)
2042 return; 2039 return;
2043 2040
2044 /* The following list of buffer states needs to be consistent
2045 * with __jbd_unexpected_dirty_buffer()'s handling of dirty
2046 * state. */
2047
2048 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 2041 if (jlist == BJ_Metadata || jlist == BJ_Reserved ||
2049 jlist == BJ_Shadow || jlist == BJ_Forget) { 2042 jlist == BJ_Shadow || jlist == BJ_Forget) {
2043 /*
2044 * For metadata buffers, we track dirty bit in buffer_jbddirty
2045 * instead of buffer_dirty. We should not see a dirty bit set
2046 * here because we clear it in do_get_write_access but e.g.
2047 * tune2fs can modify the sb and set the dirty bit at any time
2048 * so we try to gracefully handle that.
2049 */
2050 if (buffer_dirty(bh))
2051 warn_dirty_buffer(bh);
2050 if (test_clear_buffer_dirty(bh) || 2052 if (test_clear_buffer_dirty(bh) ||
2051 test_clear_buffer_jbddirty(bh)) 2053 test_clear_buffer_jbddirty(bh))
2052 was_dirty = 1; 2054 was_dirty = 1;
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 18bfd5dab642..e378cb383979 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -297,6 +297,7 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
297 unsigned int new_offset; 297 unsigned int new_offset;
298 struct buffer_head *bh_in = jh2bh(jh_in); 298 struct buffer_head *bh_in = jh2bh(jh_in);
299 struct jbd2_buffer_trigger_type *triggers; 299 struct jbd2_buffer_trigger_type *triggers;
300 journal_t *journal = transaction->t_journal;
300 301
301 /* 302 /*
302 * The buffer really shouldn't be locked: only the current committing 303 * The buffer really shouldn't be locked: only the current committing
@@ -310,6 +311,11 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
310 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in)); 311 J_ASSERT_BH(bh_in, buffer_jbddirty(bh_in));
311 312
312 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL); 313 new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
314 /* keep subsequent assertions sane */
315 new_bh->b_state = 0;
316 init_buffer(new_bh, NULL, NULL);
317 atomic_set(&new_bh->b_count, 1);
318 new_jh = jbd2_journal_add_journal_head(new_bh); /* This sleeps */
313 319
314 /* 320 /*
315 * If a new transaction has already done a buffer copy-out, then 321 * If a new transaction has already done a buffer copy-out, then
@@ -388,14 +394,6 @@ repeat:
388 kunmap_atomic(mapped_data, KM_USER0); 394 kunmap_atomic(mapped_data, KM_USER0);
389 } 395 }
390 396
391 /* keep subsequent assertions sane */
392 new_bh->b_state = 0;
393 init_buffer(new_bh, NULL, NULL);
394 atomic_set(&new_bh->b_count, 1);
395 jbd_unlock_bh_state(bh_in);
396
397 new_jh = jbd2_journal_add_journal_head(new_bh); /* This sleeps */
398
399 set_bh_page(new_bh, new_page, new_offset); 397 set_bh_page(new_bh, new_page, new_offset);
400 new_jh->b_transaction = NULL; 398 new_jh->b_transaction = NULL;
401 new_bh->b_size = jh2bh(jh_in)->b_size; 399 new_bh->b_size = jh2bh(jh_in)->b_size;
@@ -412,7 +410,11 @@ repeat:
412 * copying is moved to the transaction's shadow queue. 410 * copying is moved to the transaction's shadow queue.
413 */ 411 */
414 JBUFFER_TRACE(jh_in, "file as BJ_Shadow"); 412 JBUFFER_TRACE(jh_in, "file as BJ_Shadow");
415 jbd2_journal_file_buffer(jh_in, transaction, BJ_Shadow); 413 spin_lock(&journal->j_list_lock);
414 __jbd2_journal_file_buffer(jh_in, transaction, BJ_Shadow);
415 spin_unlock(&journal->j_list_lock);
416 jbd_unlock_bh_state(bh_in);
417
416 JBUFFER_TRACE(new_jh, "file as BJ_IO"); 418 JBUFFER_TRACE(new_jh, "file as BJ_IO");
417 jbd2_journal_file_buffer(new_jh, transaction, BJ_IO); 419 jbd2_journal_file_buffer(new_jh, transaction, BJ_IO);
418 420
@@ -2410,6 +2412,7 @@ const char *jbd2_dev_to_name(dev_t device)
2410 int i = hash_32(device, CACHE_SIZE_BITS); 2412 int i = hash_32(device, CACHE_SIZE_BITS);
2411 char *ret; 2413 char *ret;
2412 struct block_device *bd; 2414 struct block_device *bd;
2415 static struct devname_cache *new_dev;
2413 2416
2414 rcu_read_lock(); 2417 rcu_read_lock();
2415 if (devcache[i] && devcache[i]->device == device) { 2418 if (devcache[i] && devcache[i]->device == device) {
@@ -2419,20 +2422,20 @@ const char *jbd2_dev_to_name(dev_t device)
2419 } 2422 }
2420 rcu_read_unlock(); 2423 rcu_read_unlock();
2421 2424
2425 new_dev = kmalloc(sizeof(struct devname_cache), GFP_KERNEL);
2426 if (!new_dev)
2427 return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
2422 spin_lock(&devname_cache_lock); 2428 spin_lock(&devname_cache_lock);
2423 if (devcache[i]) { 2429 if (devcache[i]) {
2424 if (devcache[i]->device == device) { 2430 if (devcache[i]->device == device) {
2431 kfree(new_dev);
2425 ret = devcache[i]->devname; 2432 ret = devcache[i]->devname;
2426 spin_unlock(&devname_cache_lock); 2433 spin_unlock(&devname_cache_lock);
2427 return ret; 2434 return ret;
2428 } 2435 }
2429 call_rcu(&devcache[i]->rcu, free_devcache); 2436 call_rcu(&devcache[i]->rcu, free_devcache);
2430 } 2437 }
2431 devcache[i] = kmalloc(sizeof(struct devname_cache), GFP_KERNEL); 2438 devcache[i] = new_dev;
2432 if (!devcache[i]) {
2433 spin_unlock(&devname_cache_lock);
2434 return "NODEV-ALLOCFAILURE"; /* Something non-NULL */
2435 }
2436 devcache[i]->device = device; 2439 devcache[i]->device = device;
2437 bd = bdget(device); 2440 bd = bdget(device);
2438 if (bd) { 2441 if (bd) {
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 494501edba6b..6213ac728f30 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -499,34 +499,15 @@ void jbd2_journal_unlock_updates (journal_t *journal)
499 wake_up(&journal->j_wait_transaction_locked); 499 wake_up(&journal->j_wait_transaction_locked);
500} 500}
501 501
502/* 502static void warn_dirty_buffer(struct buffer_head *bh)
503 * Report any unexpected dirty buffers which turn up. Normally those
504 * indicate an error, but they can occur if the user is running (say)
505 * tune2fs to modify the live filesystem, so we need the option of
506 * continuing as gracefully as possible. #
507 *
508 * The caller should already hold the journal lock and
509 * j_list_lock spinlock: most callers will need those anyway
510 * in order to probe the buffer's journaling state safely.
511 */
512static void jbd_unexpected_dirty_buffer(struct journal_head *jh)
513{ 503{
514 int jlist; 504 char b[BDEVNAME_SIZE];
515
516 /* If this buffer is one which might reasonably be dirty
517 * --- ie. data, or not part of this journal --- then
518 * we're OK to leave it alone, but otherwise we need to
519 * move the dirty bit to the journal's own internal
520 * JBDDirty bit. */
521 jlist = jh->b_jlist;
522 505
523 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 506 printk(KERN_WARNING
524 jlist == BJ_Shadow || jlist == BJ_Forget) { 507 "JBD: Spotted dirty metadata buffer (dev = %s, blocknr = %llu). "
525 struct buffer_head *bh = jh2bh(jh); 508 "There's a risk of filesystem corruption in case of system "
526 509 "crash.\n",
527 if (test_clear_buffer_dirty(bh)) 510 bdevname(bh->b_bdev, b), (unsigned long long)bh->b_blocknr);
528 set_buffer_jbddirty(bh);
529 }
530} 511}
531 512
532/* 513/*
@@ -593,14 +574,16 @@ repeat:
593 if (jh->b_next_transaction) 574 if (jh->b_next_transaction)
594 J_ASSERT_JH(jh, jh->b_next_transaction == 575 J_ASSERT_JH(jh, jh->b_next_transaction ==
595 transaction); 576 transaction);
577 warn_dirty_buffer(bh);
596 } 578 }
597 /* 579 /*
598 * In any case we need to clean the dirty flag and we must 580 * In any case we need to clean the dirty flag and we must
599 * do it under the buffer lock to be sure we don't race 581 * do it under the buffer lock to be sure we don't race
600 * with running write-out. 582 * with running write-out.
601 */ 583 */
602 JBUFFER_TRACE(jh, "Unexpected dirty buffer"); 584 JBUFFER_TRACE(jh, "Journalling dirty buffer");
603 jbd_unexpected_dirty_buffer(jh); 585 clear_buffer_dirty(bh);
586 set_buffer_jbddirty(bh);
604 } 587 }
605 588
606 unlock_buffer(bh); 589 unlock_buffer(bh);
@@ -843,6 +826,15 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
843 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh))); 826 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
844 827
845 if (jh->b_transaction == NULL) { 828 if (jh->b_transaction == NULL) {
829 /*
830 * Previous jbd2_journal_forget() could have left the buffer
831 * with jbddirty bit set because it was being committed. When
832 * the commit finished, we've filed the buffer for
833 * checkpointing and marked it dirty. Now we are reallocating
834 * the buffer so the transaction freeing it must have
835 * committed and so it's safe to clear the dirty bit.
836 */
837 clear_buffer_dirty(jh2bh(jh));
846 jh->b_transaction = transaction; 838 jh->b_transaction = transaction;
847 839
848 /* first access by this transaction */ 840 /* first access by this transaction */
@@ -1644,8 +1636,13 @@ static int __dispose_buffer(struct journal_head *jh, transaction_t *transaction)
1644 1636
1645 if (jh->b_cp_transaction) { 1637 if (jh->b_cp_transaction) {
1646 JBUFFER_TRACE(jh, "on running+cp transaction"); 1638 JBUFFER_TRACE(jh, "on running+cp transaction");
1639 /*
1640 * We don't want to write the buffer anymore, clear the
1641 * bit so that we don't confuse checks in
1642 * __journal_file_buffer
1643 */
1644 clear_buffer_dirty(bh);
1647 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); 1645 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget);
1648 clear_buffer_jbddirty(bh);
1649 may_free = 0; 1646 may_free = 0;
1650 } else { 1647 } else {
1651 JBUFFER_TRACE(jh, "on running transaction"); 1648 JBUFFER_TRACE(jh, "on running transaction");
@@ -1896,12 +1893,17 @@ void __jbd2_journal_file_buffer(struct journal_head *jh,
1896 if (jh->b_transaction && jh->b_jlist == jlist) 1893 if (jh->b_transaction && jh->b_jlist == jlist)
1897 return; 1894 return;
1898 1895
1899 /* The following list of buffer states needs to be consistent
1900 * with __jbd_unexpected_dirty_buffer()'s handling of dirty
1901 * state. */
1902
1903 if (jlist == BJ_Metadata || jlist == BJ_Reserved || 1896 if (jlist == BJ_Metadata || jlist == BJ_Reserved ||
1904 jlist == BJ_Shadow || jlist == BJ_Forget) { 1897 jlist == BJ_Shadow || jlist == BJ_Forget) {
1898 /*
1899 * For metadata buffers, we track dirty bit in buffer_jbddirty
1900 * instead of buffer_dirty. We should not see a dirty bit set
1901 * here because we clear it in do_get_write_access but e.g.
1902 * tune2fs can modify the sb and set the dirty bit at any time
1903 * so we try to gracefully handle that.
1904 */
1905 if (buffer_dirty(bh))
1906 warn_dirty_buffer(bh);
1905 if (test_clear_buffer_dirty(bh) || 1907 if (test_clear_buffer_dirty(bh) ||
1906 test_clear_buffer_jbddirty(bh)) 1908 test_clear_buffer_jbddirty(bh))
1907 was_dirty = 1; 1909 was_dirty = 1;
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 07a22caf2687..0035c021395a 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/smp_lock.h>
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/list.h> 17#include <linux/list.h>
17#include <linux/fs.h> 18#include <linux/fs.h>
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 91fa3ad6e8c2..a29c7c3e3fb8 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -67,10 +67,8 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
67 acl = posix_acl_from_xattr(value, size); 67 acl = posix_acl_from_xattr(value, size);
68 } 68 }
69 kfree(value); 69 kfree(value);
70 if (!IS_ERR(acl)) { 70 if (!IS_ERR(acl))
71 set_cached_acl(inode, type, acl); 71 set_cached_acl(inode, type, acl);
72 posix_acl_release(acl);
73 }
74 return acl; 72 return acl;
75} 73}
76 74
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index f2fdcbce143e..4336adba952a 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/smp_lock.h>
10#include <linux/types.h> 11#include <linux/types.h>
11#include <linux/errno.h> 12#include <linux/errno.h>
12#include <linux/fs.h> 13#include <linux/fs.h>
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 1725037374c5..bd173a6ca3b1 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -10,6 +10,7 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/smp_lock.h>
13#include <linux/in.h> 14#include <linux/in.h>
14#include <linux/sunrpc/svc.h> 15#include <linux/sunrpc/svc.h>
15#include <linux/sunrpc/clnt.h> 16#include <linux/sunrpc/clnt.h>
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 3688e55901fc..e1d28ddd2169 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -10,6 +10,7 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/smp_lock.h>
13#include <linux/in.h> 14#include <linux/in.h>
14#include <linux/sunrpc/svc.h> 15#include <linux/sunrpc/svc.h>
15#include <linux/sunrpc/clnt.h> 16#include <linux/sunrpc/clnt.h>
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c2d061675d80..8d25ccb2d51d 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1242,20 +1242,6 @@ error:
1242 return error; 1242 return error;
1243} 1243}
1244 1244
1245/*
1246 * Initialize a session.
1247 * Note: save the mount rsize and wsize for create_server negotiation.
1248 */
1249static void nfs4_init_session(struct nfs_client *clp,
1250 unsigned int wsize, unsigned int rsize)
1251{
1252#if defined(CONFIG_NFS_V4_1)
1253 if (nfs4_has_session(clp)) {
1254 clp->cl_session->fc_attrs.max_rqst_sz = wsize;
1255 clp->cl_session->fc_attrs.max_resp_sz = rsize;
1256 }
1257#endif /* CONFIG_NFS_V4_1 */
1258}
1259 1245
1260/* 1246/*
1261 * Session has been established, and the client marked ready. 1247 * Session has been established, and the client marked ready.
@@ -1350,7 +1336,9 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data,
1350 BUG_ON(!server->nfs_client->rpc_ops); 1336 BUG_ON(!server->nfs_client->rpc_ops);
1351 BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); 1337 BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
1352 1338
1353 nfs4_init_session(server->nfs_client, server->wsize, server->rsize); 1339 error = nfs4_init_session(server);
1340 if (error < 0)
1341 goto error;
1354 1342
1355 /* Probe the root fh to retrieve its FSID */ 1343 /* Probe the root fh to retrieve its FSID */
1356 error = nfs4_path_walk(server, mntfh, data->nfs_server.export_path); 1344 error = nfs4_path_walk(server, mntfh, data->nfs_server.export_path);
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index af05b918cb5b..6dd48a4405b4 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -10,6 +10,7 @@
10#include <linux/kthread.h> 10#include <linux/kthread.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/smp_lock.h>
13#include <linux/spinlock.h> 14#include <linux/spinlock.h>
14 15
15#include <linux/nfs4.h> 16#include <linux/nfs4.h>
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 89f98e9a024b..32062c33c859 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -29,7 +29,6 @@
29#include <linux/nfs_fs.h> 29#include <linux/nfs_fs.h>
30#include <linux/nfs_mount.h> 30#include <linux/nfs_mount.h>
31#include <linux/pagemap.h> 31#include <linux/pagemap.h>
32#include <linux/smp_lock.h>
33#include <linux/pagevec.h> 32#include <linux/pagevec.h>
34#include <linux/namei.h> 33#include <linux/namei.h>
35#include <linux/mount.h> 34#include <linux/mount.h>
@@ -1026,12 +1025,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
1026 res = NULL; 1025 res = NULL;
1027 goto out; 1026 goto out;
1028 /* This turned out not to be a regular file */ 1027 /* This turned out not to be a regular file */
1029 case -EISDIR:
1030 case -ENOTDIR: 1028 case -ENOTDIR:
1031 goto no_open; 1029 goto no_open;
1032 case -ELOOP: 1030 case -ELOOP:
1033 if (!(nd->intent.open.flags & O_NOFOLLOW)) 1031 if (!(nd->intent.open.flags & O_NOFOLLOW))
1034 goto no_open; 1032 goto no_open;
1033 /* case -EISDIR: */
1035 /* case -EINVAL: */ 1034 /* case -EINVAL: */
1036 default: 1035 default:
1037 goto out; 1036 goto out;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 0055b813ec2c..05062329b678 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -26,7 +26,6 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/pagemap.h> 28#include <linux/pagemap.h>
29#include <linux/smp_lock.h>
30#include <linux/aio.h> 29#include <linux/aio.h>
31 30
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 64f87194d390..bd7938eda6a8 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -30,7 +30,6 @@
30#include <linux/nfs_mount.h> 30#include <linux/nfs_mount.h>
31#include <linux/nfs4_mount.h> 31#include <linux/nfs4_mount.h>
32#include <linux/lockd/bind.h> 32#include <linux/lockd/bind.h>
33#include <linux/smp_lock.h>
34#include <linux/seq_file.h> 33#include <linux/seq_file.h>
35#include <linux/mount.h> 34#include <linux/mount.h>
36#include <linux/nfs_idmap.h> 35#include <linux/nfs_idmap.h>
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 61bc3a32e1e2..6ea07a3c75d4 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -220,6 +220,7 @@ extern void nfs4_destroy_session(struct nfs4_session *session);
220extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp); 220extern struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp);
221extern int nfs4_proc_create_session(struct nfs_client *, int reset); 221extern int nfs4_proc_create_session(struct nfs_client *, int reset);
222extern int nfs4_proc_destroy_session(struct nfs4_session *); 222extern int nfs4_proc_destroy_session(struct nfs4_session *);
223extern int nfs4_init_session(struct nfs_server *server);
223#else /* CONFIG_NFS_v4_1 */ 224#else /* CONFIG_NFS_v4_1 */
224static inline int nfs4_setup_sequence(struct nfs_client *clp, 225static inline int nfs4_setup_sequence(struct nfs_client *clp,
225 struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, 226 struct nfs4_sequence_args *args, struct nfs4_sequence_res *res,
@@ -227,6 +228,11 @@ static inline int nfs4_setup_sequence(struct nfs_client *clp,
227{ 228{
228 return 0; 229 return 0;
229} 230}
231
232static inline int nfs4_init_session(struct nfs_server *server)
233{
234 return 0;
235}
230#endif /* CONFIG_NFS_V4_1 */ 236#endif /* CONFIG_NFS_V4_1 */
231 237
232extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[]; 238extern struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[];
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 92ce43517814..6917311f201c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -45,7 +45,6 @@
45#include <linux/nfs4.h> 45#include <linux/nfs4.h>
46#include <linux/nfs_fs.h> 46#include <linux/nfs_fs.h>
47#include <linux/nfs_page.h> 47#include <linux/nfs_page.h>
48#include <linux/smp_lock.h>
49#include <linux/namei.h> 48#include <linux/namei.h>
50#include <linux/mount.h> 49#include <linux/mount.h>
51#include <linux/module.h> 50#include <linux/module.h>
@@ -2041,15 +2040,9 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
2041 .rpc_argp = &args, 2040 .rpc_argp = &args,
2042 .rpc_resp = &res, 2041 .rpc_resp = &res,
2043 }; 2042 };
2044 int status;
2045 2043
2046 nfs_fattr_init(info->fattr); 2044 nfs_fattr_init(info->fattr);
2047 status = nfs4_recover_expired_lease(server); 2045 return nfs4_call_sync(server, &msg, &args, &res, 0);
2048 if (!status)
2049 status = nfs4_check_client_ready(server->nfs_client);
2050 if (!status)
2051 status = nfs4_call_sync(server, &msg, &args, &res, 0);
2052 return status;
2053} 2046}
2054 2047
2055static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, 2048static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
@@ -4100,15 +4093,23 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
4100 if (request->fl_start < 0 || request->fl_end < 0) 4093 if (request->fl_start < 0 || request->fl_end < 0)
4101 return -EINVAL; 4094 return -EINVAL;
4102 4095
4103 if (IS_GETLK(cmd)) 4096 if (IS_GETLK(cmd)) {
4104 return nfs4_proc_getlk(state, F_GETLK, request); 4097 if (state != NULL)
4098 return nfs4_proc_getlk(state, F_GETLK, request);
4099 return 0;
4100 }
4105 4101
4106 if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) 4102 if (!(IS_SETLK(cmd) || IS_SETLKW(cmd)))
4107 return -EINVAL; 4103 return -EINVAL;
4108 4104
4109 if (request->fl_type == F_UNLCK) 4105 if (request->fl_type == F_UNLCK) {
4110 return nfs4_proc_unlck(state, cmd, request); 4106 if (state != NULL)
4107 return nfs4_proc_unlck(state, cmd, request);
4108 return 0;
4109 }
4111 4110
4111 if (state == NULL)
4112 return -ENOLCK;
4112 do { 4113 do {
4113 status = nfs4_proc_setlk(state, cmd, request); 4114 status = nfs4_proc_setlk(state, cmd, request);
4114 if ((status != -EAGAIN) || IS_SETLK(cmd)) 4115 if ((status != -EAGAIN) || IS_SETLK(cmd))
@@ -4794,6 +4795,22 @@ int nfs4_proc_destroy_session(struct nfs4_session *session)
4794 return status; 4795 return status;
4795} 4796}
4796 4797
4798int nfs4_init_session(struct nfs_server *server)
4799{
4800 struct nfs_client *clp = server->nfs_client;
4801 int ret;
4802
4803 if (!nfs4_has_session(clp))
4804 return 0;
4805
4806 clp->cl_session->fc_attrs.max_rqst_sz = server->wsize;
4807 clp->cl_session->fc_attrs.max_resp_sz = server->rsize;
4808 ret = nfs4_recover_expired_lease(server);
4809 if (!ret)
4810 ret = nfs4_check_client_ready(clp);
4811 return ret;
4812}
4813
4797/* 4814/*
4798 * Renew the cl_session lease. 4815 * Renew the cl_session lease.
4799 */ 4816 */
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index b73c5a728655..65ca8c18476f 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -553,6 +553,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
553 INIT_LIST_HEAD(&lsp->ls_sequence.list); 553 INIT_LIST_HEAD(&lsp->ls_sequence.list);
554 lsp->ls_seqid.sequence = &lsp->ls_sequence; 554 lsp->ls_seqid.sequence = &lsp->ls_sequence;
555 atomic_set(&lsp->ls_count, 1); 555 atomic_set(&lsp->ls_count, 1);
556 lsp->ls_state = state;
556 lsp->ls_owner = fl_owner; 557 lsp->ls_owner = fl_owner;
557 spin_lock(&clp->cl_lock); 558 spin_lock(&clp->cl_lock);
558 nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64); 559 nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64);
@@ -587,7 +588,6 @@ static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_
587 if (lsp != NULL) 588 if (lsp != NULL)
588 break; 589 break;
589 if (new != NULL) { 590 if (new != NULL) {
590 new->ls_state = state;
591 list_add(&new->ls_locks, &state->lock_states); 591 list_add(&new->ls_locks, &state->lock_states);
592 set_bit(LK_STATE_IN_USE, &state->flags); 592 set_bit(LK_STATE_IN_USE, &state->flags);
593 lsp = new; 593 lsp = new;
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 96c4ebfa46f4..73ea5e8d66ce 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -18,7 +18,6 @@
18#include <linux/sunrpc/clnt.h> 18#include <linux/sunrpc/clnt.h>
19#include <linux/nfs_fs.h> 19#include <linux/nfs_fs.h>
20#include <linux/nfs_page.h> 20#include <linux/nfs_page.h>
21#include <linux/smp_lock.h>
22 21
23#include <asm/system.h> 22#include <asm/system.h>
24 23
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 35d81316163f..0a0a2ff767c3 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -19,7 +19,6 @@
19#include <linux/nfs_mount.h> 19#include <linux/nfs_mount.h>
20#include <linux/nfs_page.h> 20#include <linux/nfs_page.h>
21#include <linux/backing-dev.h> 21#include <linux/backing-dev.h>
22#include <linux/blkdev.h>
23 22
24#include <asm/uaccess.h> 23#include <asm/uaccess.h>
25 24
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 1250fb978ac1..6d0847562d87 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -25,7 +25,6 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/inet.h> 26#include <linux/inet.h>
27#include <linux/string.h> 27#include <linux/string.h>
28#include <linux/smp_lock.h>
29#include <linux/ctype.h> 28#include <linux/ctype.h>
30 29
31#include <linux/nfs.h> 30#include <linux/nfs.h>
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index d4c9884cd54b..492c79b7800b 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -18,7 +18,6 @@
18#include <linux/unistd.h> 18#include <linux/unistd.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/freezer.h> 21#include <linux/freezer.h>
23#include <linux/fs_struct.h> 22#include <linux/fs_struct.h>
24#include <linux/kthread.h> 23#include <linux/kthread.h>
diff --git a/fs/nilfs2/Kconfig b/fs/nilfs2/Kconfig
new file mode 100644
index 000000000000..72da095d4009
--- /dev/null
+++ b/fs/nilfs2/Kconfig
@@ -0,0 +1,25 @@
1config NILFS2_FS
2 tristate "NILFS2 file system support (EXPERIMENTAL)"
3 depends on BLOCK && EXPERIMENTAL
4 select CRC32
5 help
6 NILFS2 is a log-structured file system (LFS) supporting continuous
7 snapshotting. In addition to versioning capability of the entire
8 file system, users can even restore files mistakenly overwritten or
9 destroyed just a few seconds ago. Since this file system can keep
10 consistency like conventional LFS, it achieves quick recovery after
11 system crashes.
12
13 NILFS2 creates a number of checkpoints every few seconds or per
14 synchronous write basis (unless there is no change). Users can
15 select significant versions among continuously created checkpoints,
16 and can change them into snapshots which will be preserved for long
17 periods until they are changed back to checkpoints. Each
18 snapshot is mountable as a read-only file system concurrently with
19 its writable mount, and this feature is convenient for online backup.
20
21 Some features including atime, extended attributes, and POSIX ACLs,
22 are not supported yet.
23
24 To compile this file system support as a module, choose M here: the
25 module will be called nilfs2. If unsure, say N.
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
index 54100acc1102..1a4fa04cf071 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -43,7 +43,6 @@
43 */ 43 */
44 44
45#include <linux/pagemap.h> 45#include <linux/pagemap.h>
46#include <linux/smp_lock.h>
47#include "nilfs.h" 46#include "nilfs.h"
48#include "page.h" 47#include "page.h"
49 48
diff --git a/fs/notify/Kconfig b/fs/notify/Kconfig
index 31dac7e3b0f1..dffbb0911d02 100644
--- a/fs/notify/Kconfig
+++ b/fs/notify/Kconfig
@@ -1,15 +1,5 @@
1config FSNOTIFY 1config FSNOTIFY
2 bool "Filesystem notification backend" 2 def_bool n
3 default y
4 ---help---
5 fsnotify is a backend for filesystem notification. fsnotify does
6 not provide any userspace interface but does provide the basis
7 needed for other notification schemes such as dnotify, inotify,
8 and fanotify.
9
10 Say Y here to enable fsnotify suport.
11
12 If unsure, say Y.
13 3
14source "fs/notify/dnotify/Kconfig" 4source "fs/notify/dnotify/Kconfig"
15source "fs/notify/inotify/Kconfig" 5source "fs/notify/inotify/Kconfig"
diff --git a/fs/notify/dnotify/Kconfig b/fs/notify/dnotify/Kconfig
index 904ff8d5405a..f9c1ca139d8f 100644
--- a/fs/notify/dnotify/Kconfig
+++ b/fs/notify/dnotify/Kconfig
@@ -1,6 +1,6 @@
1config DNOTIFY 1config DNOTIFY
2 bool "Dnotify support" 2 bool "Dnotify support"
3 depends on FSNOTIFY 3 select FSNOTIFY
4 default y 4 default y
5 help 5 help
6 Dnotify is a directory-based per-fd file change notification system 6 Dnotify is a directory-based per-fd file change notification system
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index ec2f7bd76818..037e878e03fc 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -159,7 +159,9 @@ void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, const
159 if (!group->ops->should_send_event(group, to_tell, mask)) 159 if (!group->ops->should_send_event(group, to_tell, mask))
160 continue; 160 continue;
161 if (!event) { 161 if (!event) {
162 event = fsnotify_create_event(to_tell, mask, data, data_is, file_name, cookie); 162 event = fsnotify_create_event(to_tell, mask, data,
163 data_is, file_name, cookie,
164 GFP_KERNEL);
163 /* shit, we OOM'd and now we can't tell, maybe 165 /* shit, we OOM'd and now we can't tell, maybe
164 * someday someone else will want to do something 166 * someday someone else will want to do something
165 * here */ 167 * here */
diff --git a/fs/notify/inotify/Kconfig b/fs/notify/inotify/Kconfig
index 5356884289a1..3e56dbffe729 100644
--- a/fs/notify/inotify/Kconfig
+++ b/fs/notify/inotify/Kconfig
@@ -15,7 +15,7 @@ config INOTIFY
15 15
16config INOTIFY_USER 16config INOTIFY_USER
17 bool "Inotify support for userspace" 17 bool "Inotify support for userspace"
18 depends on FSNOTIFY 18 select FSNOTIFY
19 default y 19 default y
20 ---help--- 20 ---help---
21 Say Y here to enable inotify support for userspace, including the 21 Say Y here to enable inotify support for userspace, including the
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index ff27a2965844..f30d9bbc2e1b 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -57,7 +57,6 @@ int inotify_max_user_watches __read_mostly;
57 57
58static struct kmem_cache *inotify_inode_mark_cachep __read_mostly; 58static struct kmem_cache *inotify_inode_mark_cachep __read_mostly;
59struct kmem_cache *event_priv_cachep __read_mostly; 59struct kmem_cache *event_priv_cachep __read_mostly;
60static struct fsnotify_event *inotify_ignored_event;
61 60
62/* 61/*
63 * When inotify registers a new group it increments this and uses that 62 * When inotify registers a new group it increments this and uses that
@@ -365,6 +364,17 @@ static int inotify_find_inode(const char __user *dirname, struct path *path, uns
365 return error; 364 return error;
366} 365}
367 366
367static void inotify_remove_from_idr(struct fsnotify_group *group,
368 struct inotify_inode_mark_entry *ientry)
369{
370 struct idr *idr;
371
372 spin_lock(&group->inotify_data.idr_lock);
373 idr = &group->inotify_data.idr;
374 idr_remove(idr, ientry->wd);
375 spin_unlock(&group->inotify_data.idr_lock);
376 ientry->wd = -1;
377}
368/* 378/*
369 * Send IN_IGNORED for this wd, remove this wd from the idr, and drop the 379 * Send IN_IGNORED for this wd, remove this wd from the idr, and drop the
370 * internal reference help on the mark because it is in the idr. 380 * internal reference help on the mark because it is in the idr.
@@ -373,13 +383,19 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
373 struct fsnotify_group *group) 383 struct fsnotify_group *group)
374{ 384{
375 struct inotify_inode_mark_entry *ientry; 385 struct inotify_inode_mark_entry *ientry;
386 struct fsnotify_event *ignored_event;
376 struct inotify_event_private_data *event_priv; 387 struct inotify_event_private_data *event_priv;
377 struct fsnotify_event_private_data *fsn_event_priv; 388 struct fsnotify_event_private_data *fsn_event_priv;
378 struct idr *idr; 389
390 ignored_event = fsnotify_create_event(NULL, FS_IN_IGNORED, NULL,
391 FSNOTIFY_EVENT_NONE, NULL, 0,
392 GFP_NOFS);
393 if (!ignored_event)
394 return;
379 395
380 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 396 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);
381 397
382 event_priv = kmem_cache_alloc(event_priv_cachep, GFP_KERNEL); 398 event_priv = kmem_cache_alloc(event_priv_cachep, GFP_NOFS);
383 if (unlikely(!event_priv)) 399 if (unlikely(!event_priv))
384 goto skip_send_ignore; 400 goto skip_send_ignore;
385 401
@@ -388,7 +404,7 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
388 fsn_event_priv->group = group; 404 fsn_event_priv->group = group;
389 event_priv->wd = ientry->wd; 405 event_priv->wd = ientry->wd;
390 406
391 fsnotify_add_notify_event(group, inotify_ignored_event, fsn_event_priv); 407 fsnotify_add_notify_event(group, ignored_event, fsn_event_priv);
392 408
393 /* did the private data get added? */ 409 /* did the private data get added? */
394 if (list_empty(&fsn_event_priv->event_list)) 410 if (list_empty(&fsn_event_priv->event_list))
@@ -396,14 +412,16 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
396 412
397skip_send_ignore: 413skip_send_ignore:
398 414
415 /* matches the reference taken when the event was created */
416 fsnotify_put_event(ignored_event);
417
399 /* remove this entry from the idr */ 418 /* remove this entry from the idr */
400 spin_lock(&group->inotify_data.idr_lock); 419 inotify_remove_from_idr(group, ientry);
401 idr = &group->inotify_data.idr;
402 idr_remove(idr, ientry->wd);
403 spin_unlock(&group->inotify_data.idr_lock);
404 420
405 /* removed from idr, drop that reference */ 421 /* removed from idr, drop that reference */
406 fsnotify_put_mark(entry); 422 fsnotify_put_mark(entry);
423
424 atomic_dec(&group->inotify_data.user->inotify_watches);
407} 425}
408 426
409/* ding dong the mark is dead */ 427/* ding dong the mark is dead */
@@ -418,6 +436,7 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
418{ 436{
419 struct fsnotify_mark_entry *entry = NULL; 437 struct fsnotify_mark_entry *entry = NULL;
420 struct inotify_inode_mark_entry *ientry; 438 struct inotify_inode_mark_entry *ientry;
439 struct inotify_inode_mark_entry *tmp_ientry;
421 int ret = 0; 440 int ret = 0;
422 int add = (arg & IN_MASK_ADD); 441 int add = (arg & IN_MASK_ADD);
423 __u32 mask; 442 __u32 mask;
@@ -428,54 +447,66 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
428 if (unlikely(!mask)) 447 if (unlikely(!mask))
429 return -EINVAL; 448 return -EINVAL;
430 449
431 ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL); 450 tmp_ientry = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);
432 if (unlikely(!ientry)) 451 if (unlikely(!tmp_ientry))
433 return -ENOMEM; 452 return -ENOMEM;
434 /* we set the mask at the end after attaching it */ 453 /* we set the mask at the end after attaching it */
435 fsnotify_init_mark(&ientry->fsn_entry, inotify_free_mark); 454 fsnotify_init_mark(&tmp_ientry->fsn_entry, inotify_free_mark);
436 ientry->wd = 0; 455 tmp_ientry->wd = -1;
437 456
438find_entry: 457find_entry:
439 spin_lock(&inode->i_lock); 458 spin_lock(&inode->i_lock);
440 entry = fsnotify_find_mark_entry(group, inode); 459 entry = fsnotify_find_mark_entry(group, inode);
441 spin_unlock(&inode->i_lock); 460 spin_unlock(&inode->i_lock);
442 if (entry) { 461 if (entry) {
443 kmem_cache_free(inotify_inode_mark_cachep, ientry);
444 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry); 462 ientry = container_of(entry, struct inotify_inode_mark_entry, fsn_entry);
445 } else { 463 } else {
446 if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches) { 464 ret = -ENOSPC;
447 ret = -ENOSPC; 465 if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)
448 goto out_err;
449 }
450
451 ret = fsnotify_add_mark(&ientry->fsn_entry, group, inode);
452 if (ret == -EEXIST)
453 goto find_entry;
454 else if (ret)
455 goto out_err; 466 goto out_err;
456
457 entry = &ientry->fsn_entry;
458retry: 467retry:
459 ret = -ENOMEM; 468 ret = -ENOMEM;
460 if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL))) 469 if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL)))
461 goto out_err; 470 goto out_err;
462 471
463 spin_lock(&group->inotify_data.idr_lock); 472 spin_lock(&group->inotify_data.idr_lock);
464 /* if entry is added to the idr we keep the reference obtained 473 ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry,
465 * through fsnotify_mark_add. remember to drop this reference 474 group->inotify_data.last_wd,
466 * when entry is removed from idr */ 475 &tmp_ientry->wd);
467 ret = idr_get_new_above(&group->inotify_data.idr, entry,
468 ++group->inotify_data.last_wd,
469 &ientry->wd);
470 spin_unlock(&group->inotify_data.idr_lock); 476 spin_unlock(&group->inotify_data.idr_lock);
471 if (ret) { 477 if (ret) {
472 if (ret == -EAGAIN) 478 if (ret == -EAGAIN)
473 goto retry; 479 goto retry;
474 goto out_err; 480 goto out_err;
475 } 481 }
482
483 ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode);
484 if (ret) {
485 inotify_remove_from_idr(group, tmp_ientry);
486 if (ret == -EEXIST)
487 goto find_entry;
488 goto out_err;
489 }
490
491 /* tmp_ientry has been added to the inode, so we are all set up.
492 * now we just need to make sure tmp_ientry doesn't get freed and
493 * we need to set up entry and ientry so the generic code can
494 * do its thing. */
495 ientry = tmp_ientry;
496 entry = &ientry->fsn_entry;
497 tmp_ientry = NULL;
498
476 atomic_inc(&group->inotify_data.user->inotify_watches); 499 atomic_inc(&group->inotify_data.user->inotify_watches);
500
501 /* update the idr hint */
502 group->inotify_data.last_wd = ientry->wd;
503
504 /* we put the mark on the idr, take a reference */
505 fsnotify_get_mark(entry);
477 } 506 }
478 507
508 ret = ientry->wd;
509
479 spin_lock(&entry->lock); 510 spin_lock(&entry->lock);
480 511
481 old_mask = entry->mask; 512 old_mask = entry->mask;
@@ -506,14 +537,19 @@ retry:
506 fsnotify_recalc_group_mask(group); 537 fsnotify_recalc_group_mask(group);
507 } 538 }
508 539
509 return ientry->wd; 540 /* this either matches fsnotify_find_mark_entry, or init_mark_entry
541 * depending on which path we took... */
542 fsnotify_put_mark(entry);
510 543
511out_err: 544out_err:
512 /* see this isn't supposed to happen, just kill the watch */ 545 /* could be an error, could be that we found an existing mark */
513 if (entry) { 546 if (tmp_ientry) {
514 fsnotify_destroy_mark_by_entry(entry); 547 /* on the idr but didn't make it on the inode */
515 fsnotify_put_mark(entry); 548 if (tmp_ientry->wd != -1)
549 inotify_remove_from_idr(group, tmp_ientry);
550 kmem_cache_free(inotify_inode_mark_cachep, tmp_ientry);
516 } 551 }
552
517 return ret; 553 return ret;
518} 554}
519 555
@@ -721,9 +757,6 @@ static int __init inotify_user_setup(void)
721 757
722 inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark_entry, SLAB_PANIC); 758 inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark_entry, SLAB_PANIC);
723 event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC); 759 event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC);
724 inotify_ignored_event = fsnotify_create_event(NULL, FS_IN_IGNORED, NULL, FSNOTIFY_EVENT_NONE, NULL, 0);
725 if (!inotify_ignored_event)
726 panic("unable to allocate the inotify ignored event\n");
727 760
728 inotify_max_queued_events = 16384; 761 inotify_max_queued_events = 16384;
729 inotify_max_user_instances = 128; 762 inotify_max_user_instances = 128;
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index 959b73e756fd..521368574e97 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -136,18 +136,24 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new
136{ 136{
137 if ((old->mask == new->mask) && 137 if ((old->mask == new->mask) &&
138 (old->to_tell == new->to_tell) && 138 (old->to_tell == new->to_tell) &&
139 (old->data_type == new->data_type)) { 139 (old->data_type == new->data_type) &&
140 (old->name_len == new->name_len)) {
140 switch (old->data_type) { 141 switch (old->data_type) {
141 case (FSNOTIFY_EVENT_INODE): 142 case (FSNOTIFY_EVENT_INODE):
142 if (old->inode == new->inode) 143 /* remember, after old was put on the wait_q we aren't
144 * allowed to look at the inode any more, only thing
145 * left to check was if the file_name is the same */
146 if (old->name_len &&
147 !strcmp(old->file_name, new->file_name))
143 return true; 148 return true;
144 break; 149 break;
145 case (FSNOTIFY_EVENT_PATH): 150 case (FSNOTIFY_EVENT_PATH):
146 if ((old->path.mnt == new->path.mnt) && 151 if ((old->path.mnt == new->path.mnt) &&
147 (old->path.dentry == new->path.dentry)) 152 (old->path.dentry == new->path.dentry))
148 return true; 153 return true;
154 break;
149 case (FSNOTIFY_EVENT_NONE): 155 case (FSNOTIFY_EVENT_NONE):
150 return true; 156 return false;
151 }; 157 };
152 } 158 }
153 return false; 159 return false;
@@ -339,18 +345,19 @@ static void initialize_event(struct fsnotify_event *event)
339 * @name the filename, if available 345 * @name the filename, if available
340 */ 346 */
341struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, void *data, 347struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, void *data,
342 int data_type, const char *name, u32 cookie) 348 int data_type, const char *name, u32 cookie,
349 gfp_t gfp)
343{ 350{
344 struct fsnotify_event *event; 351 struct fsnotify_event *event;
345 352
346 event = kmem_cache_alloc(fsnotify_event_cachep, GFP_KERNEL); 353 event = kmem_cache_alloc(fsnotify_event_cachep, gfp);
347 if (!event) 354 if (!event)
348 return NULL; 355 return NULL;
349 356
350 initialize_event(event); 357 initialize_event(event);
351 358
352 if (name) { 359 if (name) {
353 event->file_name = kstrdup(name, GFP_KERNEL); 360 event->file_name = kstrdup(name, gfp);
354 if (!event->file_name) { 361 if (!event->file_name) {
355 kmem_cache_free(fsnotify_event_cachep, event); 362 kmem_cache_free(fsnotify_event_cachep, event);
356 return NULL; 363 return NULL;
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 9fcd36dcc9a0..467b413bec21 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -7,7 +7,6 @@
7 7
8#include <linux/fs.h> 8#include <linux/fs.h>
9#include <linux/mount.h> 9#include <linux/mount.h>
10#include <linux/smp_lock.h>
11 10
12#define MLOG_MASK_PREFIX ML_INODE 11#define MLOG_MASK_PREFIX ML_INODE
13#include <cluster/masklog.h> 12#include <cluster/masklog.h>
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 1a9c7878f864..ea4e6cb29e13 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -436,7 +436,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
436 rcu_assign_pointer(ptbl->part[partno], p); 436 rcu_assign_pointer(ptbl->part[partno], p);
437 437
438 /* suppress uevent if the disk supresses it */ 438 /* suppress uevent if the disk supresses it */
439 if (!dev_get_uevent_suppress(pdev)) 439 if (!dev_get_uevent_suppress(ddev))
440 kobject_uevent(&pdev->kobj, KOBJ_ADD); 440 kobject_uevent(&pdev->kobj, KOBJ_ADD);
441 441
442 return p; 442 return p;
diff --git a/fs/pipe.c b/fs/pipe.c
index f7dd21ad85a6..52c415114838 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -68,8 +68,8 @@ void pipe_double_lock(struct pipe_inode_info *pipe1,
68 pipe_lock_nested(pipe1, I_MUTEX_PARENT); 68 pipe_lock_nested(pipe1, I_MUTEX_PARENT);
69 pipe_lock_nested(pipe2, I_MUTEX_CHILD); 69 pipe_lock_nested(pipe2, I_MUTEX_CHILD);
70 } else { 70 } else {
71 pipe_lock_nested(pipe2, I_MUTEX_CHILD); 71 pipe_lock_nested(pipe2, I_MUTEX_PARENT);
72 pipe_lock_nested(pipe1, I_MUTEX_PARENT); 72 pipe_lock_nested(pipe1, I_MUTEX_CHILD);
73 } 73 }
74} 74}
75 75
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 70f36c043d62..38f7bd559f35 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2043,7 +2043,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2043 invalidate_bdev(sb->s_bdev); 2043 invalidate_bdev(sb->s_bdev);
2044 } 2044 }
2045 mutex_lock(&dqopt->dqonoff_mutex); 2045 mutex_lock(&dqopt->dqonoff_mutex);
2046 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2047 if (sb_has_quota_loaded(sb, type)) { 2046 if (sb_has_quota_loaded(sb, type)) {
2048 error = -EBUSY; 2047 error = -EBUSY;
2049 goto out_lock; 2048 goto out_lock;
@@ -2054,9 +2053,11 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2054 * possible) Also nobody should write to the file - we use 2053 * possible) Also nobody should write to the file - we use
2055 * special IO operations which ignore the immutable bit. */ 2054 * special IO operations which ignore the immutable bit. */
2056 down_write(&dqopt->dqptr_sem); 2055 down_write(&dqopt->dqptr_sem);
2056 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2057 oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE | 2057 oldflags = inode->i_flags & (S_NOATIME | S_IMMUTABLE |
2058 S_NOQUOTA); 2058 S_NOQUOTA);
2059 inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE; 2059 inode->i_flags |= S_NOQUOTA | S_NOATIME | S_IMMUTABLE;
2060 mutex_unlock(&inode->i_mutex);
2060 up_write(&dqopt->dqptr_sem); 2061 up_write(&dqopt->dqptr_sem);
2061 sb->dq_op->drop(inode); 2062 sb->dq_op->drop(inode);
2062 } 2063 }
@@ -2080,7 +2081,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
2080 goto out_file_init; 2081 goto out_file_init;
2081 } 2082 }
2082 mutex_unlock(&dqopt->dqio_mutex); 2083 mutex_unlock(&dqopt->dqio_mutex);
2083 mutex_unlock(&inode->i_mutex);
2084 spin_lock(&dq_state_lock); 2084 spin_lock(&dq_state_lock);
2085 dqopt->flags |= dquot_state_flag(flags, type); 2085 dqopt->flags |= dquot_state_flag(flags, type);
2086 spin_unlock(&dq_state_lock); 2086 spin_unlock(&dq_state_lock);
@@ -2096,13 +2096,14 @@ out_file_init:
2096out_lock: 2096out_lock:
2097 if (oldflags != -1) { 2097 if (oldflags != -1) {
2098 down_write(&dqopt->dqptr_sem); 2098 down_write(&dqopt->dqptr_sem);
2099 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
2099 /* Set the flags back (in the case of accidental quotaon() 2100 /* Set the flags back (in the case of accidental quotaon()
2100 * on a wrong file we don't want to mess up the flags) */ 2101 * on a wrong file we don't want to mess up the flags) */
2101 inode->i_flags &= ~(S_NOATIME | S_NOQUOTA | S_IMMUTABLE); 2102 inode->i_flags &= ~(S_NOATIME | S_NOQUOTA | S_IMMUTABLE);
2102 inode->i_flags |= oldflags; 2103 inode->i_flags |= oldflags;
2104 mutex_unlock(&inode->i_mutex);
2103 up_write(&dqopt->dqptr_sem); 2105 up_write(&dqopt->dqptr_sem);
2104 } 2106 }
2105 mutex_unlock(&inode->i_mutex);
2106 mutex_unlock(&dqopt->dqonoff_mutex); 2107 mutex_unlock(&dqopt->dqonoff_mutex);
2107out_fmt: 2108out_fmt:
2108 put_quota_format(fmt); 2109 put_quota_format(fmt);
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index ebb2c417912c..11f0c06316de 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -20,6 +20,7 @@
20#include <linux/ramfs.h> 20#include <linux/ramfs.h>
21#include <linux/pagevec.h> 21#include <linux/pagevec.h>
22#include <linux/mman.h> 22#include <linux/mman.h>
23#include <linux/sched.h>
23 24
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25#include "internal.h" 26#include "internal.h"
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index f3d47d856848..6925b835a43b 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -46,7 +46,6 @@
46#include <linux/reiserfs_acl.h> 46#include <linux/reiserfs_acl.h>
47#include <asm/uaccess.h> 47#include <asm/uaccess.h>
48#include <net/checksum.h> 48#include <net/checksum.h>
49#include <linux/smp_lock.h>
50#include <linux/stat.h> 49#include <linux/stat.h>
51#include <linux/quotaops.h> 50#include <linux/quotaops.h>
52 51
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 3b52770f46ff..cb5fc57e370b 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -30,6 +30,7 @@
30#include <linux/fs.h> 30#include <linux/fs.h>
31#include <linux/vfs.h> 31#include <linux/vfs.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/smp_lock.h>
33#include <linux/mutex.h> 34#include <linux/mutex.h>
34#include <linux/pagemap.h> 35#include <linux/pagemap.h>
35#include <linux/init.h> 36#include <linux/init.h>
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index d88d0fac9fa5..14f2d71ea3ce 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -939,8 +939,10 @@ again:
939 /* Remove from old parent's list and insert into new parent's list. */ 939 /* Remove from old parent's list and insert into new parent's list. */
940 sysfs_unlink_sibling(sd); 940 sysfs_unlink_sibling(sd);
941 sysfs_get(new_parent_sd); 941 sysfs_get(new_parent_sd);
942 drop_nlink(old_parent->d_inode);
942 sysfs_put(sd->s_parent); 943 sysfs_put(sd->s_parent);
943 sd->s_parent = new_parent_sd; 944 sd->s_parent = new_parent_sd;
945 inc_nlink(new_parent->d_inode);
944 sysfs_link_sibling(sd); 946 sysfs_link_sibling(sd);
945 947
946 out_unlock: 948 out_unlock:
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c
index 6db7a6be6c97..8aacd64957a2 100644
--- a/fs/ubifs/ioctl.c
+++ b/fs/ubifs/ioctl.c
@@ -25,7 +25,6 @@
25/* This file implements EXT2-compatible extended attribute ioctl() calls */ 25/* This file implements EXT2-compatible extended attribute ioctl() calls */
26 26
27#include <linux/compat.h> 27#include <linux/compat.h>
28#include <linux/smp_lock.h>
29#include <linux/mount.h> 28#include <linux/mount.h>
30#include "ubifs.h" 29#include "ubifs.h"
31 30
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 6832135159b6..9d1b8c2e6c45 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1087,11 +1087,23 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
1087 struct udf_inode_info *vati; 1087 struct udf_inode_info *vati;
1088 uint32_t pos; 1088 uint32_t pos;
1089 struct virtualAllocationTable20 *vat20; 1089 struct virtualAllocationTable20 *vat20;
1090 sector_t blocks = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
1090 1091
1091 /* VAT file entry is in the last recorded block */ 1092 /* VAT file entry is in the last recorded block */
1092 ino.partitionReferenceNum = type1_index; 1093 ino.partitionReferenceNum = type1_index;
1093 ino.logicalBlockNum = sbi->s_last_block - map->s_partition_root; 1094 ino.logicalBlockNum = sbi->s_last_block - map->s_partition_root;
1094 sbi->s_vat_inode = udf_iget(sb, &ino); 1095 sbi->s_vat_inode = udf_iget(sb, &ino);
1096 if (!sbi->s_vat_inode &&
1097 sbi->s_last_block != blocks - 1) {
1098 printk(KERN_NOTICE "UDF-fs: Failed to read VAT inode from the"
1099 " last recorded block (%lu), retrying with the last "
1100 "block of the device (%lu).\n",
1101 (unsigned long)sbi->s_last_block,
1102 (unsigned long)blocks - 1);
1103 ino.partitionReferenceNum = type1_index;
1104 ino.logicalBlockNum = blocks - 1 - map->s_partition_root;
1105 sbi->s_vat_inode = udf_iget(sb, &ino);
1106 }
1095 if (!sbi->s_vat_inode) 1107 if (!sbi->s_vat_inode)
1096 return 1; 1108 return 1;
1097 1109
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 7ec89fc05b2b..aecf2519db76 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1268,6 +1268,14 @@ xfs_vm_writepage(
1268 if (!page_has_buffers(page)) 1268 if (!page_has_buffers(page))
1269 create_empty_buffers(page, 1 << inode->i_blkbits, 0); 1269 create_empty_buffers(page, 1 << inode->i_blkbits, 0);
1270 1270
1271
1272 /*
1273 * VM calculation for nr_to_write seems off. Bump it way
1274 * up, this gets simple streaming writes zippy again.
1275 * To be reviewed again after Jens' writeback changes.
1276 */
1277 wbc->nr_to_write *= 4;
1278
1271 /* 1279 /*
1272 * Convert delayed allocate, unwritten or unmapped space 1280 * Convert delayed allocate, unwritten or unmapped space
1273 * to real space and flush out to disk. 1281 * to real space and flush out to disk.
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index f4e255441574..0542fd507649 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -41,7 +41,6 @@
41#include "xfs_ioctl.h" 41#include "xfs_ioctl.h"
42 42
43#include <linux/dcache.h> 43#include <linux/dcache.h>
44#include <linux/smp_lock.h>
45 44
46static struct vm_operations_struct xfs_file_vm_ops; 45static struct vm_operations_struct xfs_file_vm_ops;
47 46
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 58973bb46038..8070b34cc287 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -680,8 +680,8 @@ xfs_vn_fiemap(
680 else 680 else
681 bm.bmv_length = BTOBB(length); 681 bm.bmv_length = BTOBB(length);
682 682
683 /* our formatter will tell xfs_getbmap when to stop. */ 683 /* We add one because in getbmap world count includes the header */
684 bm.bmv_count = MAXEXTNUM; 684 bm.bmv_count = fieinfo->fi_extents_max + 1;
685 bm.bmv_iflags = BMV_IF_PREALLOC; 685 bm.bmv_iflags = BMV_IF_PREALLOC;
686 if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR) 686 if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR)
687 bm.bmv_iflags |= BMV_IF_ATTRFORK; 687 bm.bmv_iflags |= BMV_IF_ATTRFORK;
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h
index 9d40e879f99e..77ff547730af 100644
--- a/include/asm-generic/4level-fixup.h
+++ b/include/asm-generic/4level-fixup.h
@@ -27,9 +27,9 @@
27#define pud_page_vaddr(pud) pgd_page_vaddr(pud) 27#define pud_page_vaddr(pud) pgd_page_vaddr(pud)
28 28
29#undef pud_free_tlb 29#undef pud_free_tlb
30#define pud_free_tlb(tlb, x) do { } while (0) 30#define pud_free_tlb(tlb, x, addr) do { } while (0)
31#define pud_free(mm, x) do { } while (0) 31#define pud_free(mm, x) do { } while (0)
32#define __pud_free_tlb(tlb, x) do { } while (0) 32#define __pud_free_tlb(tlb, x, addr) do { } while (0)
33 33
34#undef pud_addr_end 34#undef pud_addr_end
35#define pud_addr_end(addr, end) (end) 35#define pud_addr_end(addr, end) (end)
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
index a7cdc48e8b78..725612b793ce 100644
--- a/include/asm-generic/pgtable-nopmd.h
+++ b/include/asm-generic/pgtable-nopmd.h
@@ -59,7 +59,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
59static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) 59static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
60{ 60{
61} 61}
62#define __pmd_free_tlb(tlb, x) do { } while (0) 62#define __pmd_free_tlb(tlb, x, a) do { } while (0)
63 63
64#undef pmd_addr_end 64#undef pmd_addr_end
65#define pmd_addr_end(addr, end) (end) 65#define pmd_addr_end(addr, end) (end)
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h
index 87cf449a6df3..810431d8351b 100644
--- a/include/asm-generic/pgtable-nopud.h
+++ b/include/asm-generic/pgtable-nopud.h
@@ -52,7 +52,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address)
52 */ 52 */
53#define pud_alloc_one(mm, address) NULL 53#define pud_alloc_one(mm, address) NULL
54#define pud_free(mm, x) do { } while (0) 54#define pud_free(mm, x) do { } while (0)
55#define __pud_free_tlb(tlb, x) do { } while (0) 55#define __pud_free_tlb(tlb, x, a) do { } while (0)
56 56
57#undef pud_addr_end 57#undef pud_addr_end
58#define pud_addr_end(addr, end) (end) 58#define pud_addr_end(addr, end) (end)
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index f490e43a90b9..e43f9766259f 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -123,24 +123,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
123 __tlb_remove_tlb_entry(tlb, ptep, address); \ 123 __tlb_remove_tlb_entry(tlb, ptep, address); \
124 } while (0) 124 } while (0)
125 125
126#define pte_free_tlb(tlb, ptep) \ 126#define pte_free_tlb(tlb, ptep, address) \
127 do { \ 127 do { \
128 tlb->need_flush = 1; \ 128 tlb->need_flush = 1; \
129 __pte_free_tlb(tlb, ptep); \ 129 __pte_free_tlb(tlb, ptep, address); \
130 } while (0) 130 } while (0)
131 131
132#ifndef __ARCH_HAS_4LEVEL_HACK 132#ifndef __ARCH_HAS_4LEVEL_HACK
133#define pud_free_tlb(tlb, pudp) \ 133#define pud_free_tlb(tlb, pudp, address) \
134 do { \ 134 do { \
135 tlb->need_flush = 1; \ 135 tlb->need_flush = 1; \
136 __pud_free_tlb(tlb, pudp); \ 136 __pud_free_tlb(tlb, pudp, address); \
137 } while (0) 137 } while (0)
138#endif 138#endif
139 139
140#define pmd_free_tlb(tlb, pmdp) \ 140#define pmd_free_tlb(tlb, pmdp, address) \
141 do { \ 141 do { \
142 tlb->need_flush = 1; \ 142 tlb->need_flush = 1; \
143 __pmd_free_tlb(tlb, pmdp); \ 143 __pmd_free_tlb(tlb, pmdp, address); \
144 } while (0) 144 } while (0)
145 145
146#define tlb_migrate_finish(mm) do {} while (0) 146#define tlb_migrate_finish(mm) do {} while (0)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index a553f1041cf1..6ad76bf5fb40 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -30,9 +30,7 @@
30 * EXCEPTION_TABLE(...) 30 * EXCEPTION_TABLE(...)
31 * NOTES 31 * NOTES
32 * 32 *
33 * __bss_start = .; 33 * BSS_SECTION(0, 0, 0)
34 * BSS_SECTION(0, 0)
35 * __bss_stop = .;
36 * _end = .; 34 * _end = .;
37 * 35 *
38 * /DISCARD/ : { 36 * /DISCARD/ : {
@@ -489,7 +487,8 @@
489 * bss (Block Started by Symbol) - uninitialized data 487 * bss (Block Started by Symbol) - uninitialized data
490 * zeroed during startup 488 * zeroed during startup
491 */ 489 */
492#define SBSS \ 490#define SBSS(sbss_align) \
491 . = ALIGN(sbss_align); \
493 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ 492 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \
494 *(.sbss) \ 493 *(.sbss) \
495 *(.scommon) \ 494 *(.scommon) \
@@ -498,12 +497,10 @@
498#define BSS(bss_align) \ 497#define BSS(bss_align) \
499 . = ALIGN(bss_align); \ 498 . = ALIGN(bss_align); \
500 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ 499 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
501 VMLINUX_SYMBOL(__bss_start) = .; \
502 *(.bss.page_aligned) \ 500 *(.bss.page_aligned) \
503 *(.dynbss) \ 501 *(.dynbss) \
504 *(.bss) \ 502 *(.bss) \
505 *(COMMON) \ 503 *(COMMON) \
506 VMLINUX_SYMBOL(__bss_stop) = .; \
507 } 504 }
508 505
509/* 506/*
@@ -735,8 +732,10 @@
735 INIT_RAM_FS \ 732 INIT_RAM_FS \
736 } 733 }
737 734
738#define BSS_SECTION(sbss_align, bss_align) \ 735#define BSS_SECTION(sbss_align, bss_align, stop_align) \
739 SBSS \ 736 . = ALIGN(sbss_align); \
737 VMLINUX_SYMBOL(__bss_start) = .; \
738 SBSS(sbss_align) \
740 BSS(bss_align) \ 739 BSS(bss_align) \
741 . = ALIGN(4); 740 . = ALIGN(stop_align); \
742 741 VMLINUX_SYMBOL(__bss_stop) = .;
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 45c18672b093..7174818c2c13 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -43,6 +43,7 @@
43 {0x1002, 0x4A4F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 43 {0x1002, 0x4A4F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
44 {0x1002, 0x4A50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 44 {0x1002, 0x4A50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
45 {0x1002, 0x4A54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 45 {0x1002, 0x4A54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
46 {0x1002, 0x4B48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
46 {0x1002, 0x4B49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 47 {0x1002, 0x4B49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
47 {0x1002, 0x4B4A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 48 {0x1002, 0x4B4A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
48 {0x1002, 0x4B4B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ 49 {0x1002, 0x4B4B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \
@@ -262,6 +263,7 @@
262 {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 263 {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
263 {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 264 {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
264 {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 265 {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
266 {0x1002, 0x9443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
265 {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 267 {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
266 {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ 268 {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
267 {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 269 {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -346,12 +348,12 @@
346 {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \ 348 {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \
347 {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 349 {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
348 {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 350 {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
351 {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
352 {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
349 {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 353 {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
350 {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 354 {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
351 {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 355 {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
352 {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 356 {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
353 {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
354 {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
355 {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 357 {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
356 {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 358 {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
357 {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ 359 {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index 41862e9a4c20..af4b4826997e 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -506,6 +506,8 @@ typedef struct {
506#define DRM_RADEON_GEM_WAIT_IDLE 0x24 506#define DRM_RADEON_GEM_WAIT_IDLE 0x24
507#define DRM_RADEON_CS 0x26 507#define DRM_RADEON_CS 0x26
508#define DRM_RADEON_INFO 0x27 508#define DRM_RADEON_INFO 0x27
509#define DRM_RADEON_GEM_SET_TILING 0x28
510#define DRM_RADEON_GEM_GET_TILING 0x29
509 511
510#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) 512#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
511#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) 513#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
@@ -544,7 +546,8 @@ typedef struct {
544#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) 546#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
545#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) 547#define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
546#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) 548#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
547 549#define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
550#define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
548 551
549typedef struct drm_radeon_init { 552typedef struct drm_radeon_init {
550 enum { 553 enum {
@@ -796,6 +799,24 @@ struct drm_radeon_gem_create {
796 uint32_t flags; 799 uint32_t flags;
797}; 800};
798 801
802#define RADEON_TILING_MACRO 0x1
803#define RADEON_TILING_MICRO 0x2
804#define RADEON_TILING_SWAP 0x4
805#define RADEON_TILING_SURFACE 0x8 /* this object requires a surface
806 * when mapped - i.e. front buffer */
807
808struct drm_radeon_gem_set_tiling {
809 uint32_t handle;
810 uint32_t tiling_flags;
811 uint32_t pitch;
812};
813
814struct drm_radeon_gem_get_tiling {
815 uint32_t handle;
816 uint32_t tiling_flags;
817 uint32_t pitch;
818};
819
799struct drm_radeon_gem_mmap { 820struct drm_radeon_gem_mmap {
800 uint32_t handle; 821 uint32_t handle;
801 uint32_t pad; 822 uint32_t pad;
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 62ed733c52a2..a68829db381a 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -121,6 +121,7 @@ struct ttm_backend {
121#define TTM_PAGE_FLAG_SWAPPED (1 << 4) 121#define TTM_PAGE_FLAG_SWAPPED (1 << 4)
122#define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) 122#define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5)
123#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) 123#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6)
124#define TTM_PAGE_FLAG_DMA32 (1 << 7)
124 125
125enum ttm_caching_state { 126enum ttm_caching_state {
126 tt_uncached, 127 tt_uncached,
@@ -353,6 +354,14 @@ struct ttm_bo_driver {
353 int (*sync_obj_flush) (void *sync_obj, void *sync_arg); 354 int (*sync_obj_flush) (void *sync_obj, void *sync_arg);
354 void (*sync_obj_unref) (void **sync_obj); 355 void (*sync_obj_unref) (void **sync_obj);
355 void *(*sync_obj_ref) (void *sync_obj); 356 void *(*sync_obj_ref) (void *sync_obj);
357
358 /* hook to notify driver about a driver move so it
359 * can do tiling things */
360 void (*move_notify)(struct ttm_buffer_object *bo,
361 struct ttm_mem_reg *new_mem);
362 /* notify the driver we are taking a fault on this BO
363 * and have reserved it */
364 void (*fault_reserve_notify)(struct ttm_buffer_object *bo);
356}; 365};
357 366
358#define TTM_NUM_MEM_TYPES 8 367#define TTM_NUM_MEM_TYPES 8
@@ -429,6 +438,8 @@ struct ttm_bo_device {
429 */ 438 */
430 439
431 struct delayed_work wq; 440 struct delayed_work wq;
441
442 bool need_dma32;
432}; 443};
433 444
434/** 445/**
@@ -648,7 +659,14 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
648extern int ttm_bo_device_init(struct ttm_bo_device *bdev, 659extern int ttm_bo_device_init(struct ttm_bo_device *bdev,
649 struct ttm_mem_global *mem_glob, 660 struct ttm_mem_global *mem_glob,
650 struct ttm_bo_driver *driver, 661 struct ttm_bo_driver *driver,
651 uint64_t file_page_offset); 662 uint64_t file_page_offset, bool need_dma32);
663
664/**
665 * ttm_bo_unmap_virtual
666 *
667 * @bo: tear down the virtual mappings for this BO
668 */
669extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo);
652 670
653/** 671/**
654 * ttm_bo_reserve: 672 * ttm_bo_reserve:
diff --git a/include/drm/ttm/ttm_module.h b/include/drm/ttm/ttm_module.h
index 889a4c7958ae..d1d433834e4f 100644
--- a/include/drm/ttm/ttm_module.h
+++ b/include/drm/ttm/ttm_module.h
@@ -33,7 +33,7 @@
33 33
34#include <linux/kernel.h> 34#include <linux/kernel.h>
35 35
36#define TTM_PFX "[TTM]" 36#define TTM_PFX "[TTM] "
37 37
38enum ttm_global_types { 38enum ttm_global_types {
39 TTM_GLOBAL_TTM_MEM = 0, 39 TTM_GLOBAL_TTM_MEM = 0,
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 9b93cafa82a0..ab94335b4bb9 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -36,6 +36,11 @@ struct amba_driver {
36 struct amba_id *id_table; 36 struct amba_id *id_table;
37}; 37};
38 38
39enum amba_vendor {
40 AMBA_VENDOR_ARM = 0x41,
41 AMBA_VENDOR_ST = 0x80,
42};
43
39#define amba_get_drvdata(d) dev_get_drvdata(&d->dev) 44#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
40#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) 45#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
41 46
diff --git a/include/linux/amba/pl093.h b/include/linux/amba/pl093.h
new file mode 100644
index 000000000000..2983e3671adb
--- /dev/null
+++ b/include/linux/amba/pl093.h
@@ -0,0 +1,80 @@
1/* linux/amba/pl093.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * AMBA PL093 SSMC (synchronous static memory controller)
8 * See DDI0236.pdf (r0p4) for more details
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */
16
17/* Offsets for SMBxxxxRy registers */
18
19#define SMBIDCYR (0x00)
20#define SMBWSTRDR (0x04)
21#define SMBWSTWRR (0x08)
22#define SMBWSTOENR (0x0C)
23#define SMBWSTWENR (0x10)
24#define SMBCR (0x14)
25#define SMBSR (0x18)
26#define SMBWSTBRDR (0x1C)
27
28/* Masks for SMB registers */
29#define IDCY_MASK (0xf)
30#define WSTRD_MASK (0xf)
31#define WSTWR_MASK (0xf)
32#define WSTOEN_MASK (0xf)
33#define WSTWEN_MASK (0xf)
34
35/* Notes from datasheet:
36 * WSTOEN <= WSTRD
37 * WSTWEN <= WSTWR
38 *
39 * WSTOEN is not used with nWAIT
40 */
41
42/* SMBCR bit definitions */
43#define SMBCR_BIWRITEEN (1 << 21)
44#define SMBCR_ADDRVALIDWRITEEN (1 << 20)
45#define SMBCR_SYNCWRITE (1 << 17)
46#define SMBCR_BMWRITE (1 << 16)
47#define SMBCR_WRAPREAD (1 << 14)
48#define SMBCR_BIREADEN (1 << 13)
49#define SMBCR_ADDRVALIDREADEN (1 << 12)
50#define SMBCR_SYNCREAD (1 << 9)
51#define SMBCR_BMREAD (1 << 8)
52#define SMBCR_SMBLSPOL (1 << 6)
53#define SMBCR_WP (1 << 3)
54#define SMBCR_WAITEN (1 << 2)
55#define SMBCR_WAITPOL (1 << 1)
56#define SMBCR_RBLE (1 << 0)
57
58#define SMBCR_BURSTLENWRITE_MASK (3 << 18)
59#define SMBCR_BURSTLENWRITE_4 (0 << 18)
60#define SMBCR_BURSTLENWRITE_8 (1 << 18)
61#define SMBCR_BURSTLENWRITE_RESERVED (2 << 18)
62#define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18)
63
64#define SMBCR_BURSTLENREAD_MASK (3 << 10)
65#define SMBCR_BURSTLENREAD_4 (0 << 10)
66#define SMBCR_BURSTLENREAD_8 (1 << 10)
67#define SMBCR_BURSTLENREAD_16 (2 << 10)
68#define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10)
69
70#define SMBCR_MW_MASK (3 << 4)
71#define SMBCR_MW_8BIT (0 << 4)
72#define SMBCR_MW_16BIT (1 << 4)
73#define SMBCR_MW_M32BIT (2 << 4)
74
75/* SSMC status registers */
76#define SSMCCSR (0x200)
77#define SSMCCR (0x204)
78#define SSMCITCR (0x208)
79#define SSMCITIP (0x20C)
80#define SSMCITIOP (0x210)
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3a52a63c1351..1d52425a6118 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -229,6 +229,11 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
229 (1 << BDI_async_congested)); 229 (1 << BDI_async_congested));
230} 230}
231 231
232enum {
233 BLK_RW_ASYNC = 0,
234 BLK_RW_SYNC = 1,
235};
236
232void clear_bdi_congested(struct backing_dev_info *bdi, int sync); 237void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
233void set_bdi_congested(struct backing_dev_info *bdi, int sync); 238void set_bdi_congested(struct backing_dev_info *bdi, int sync);
234long congestion_wait(int sync, long timeout); 239long congestion_wait(int sync, long timeout);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0146e0fecf1a..e7cb5dbf6c26 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -70,11 +70,6 @@ enum rq_cmd_type_bits {
70 REQ_TYPE_ATA_PC, 70 REQ_TYPE_ATA_PC,
71}; 71};
72 72
73enum {
74 BLK_RW_ASYNC = 0,
75 BLK_RW_SYNC = 1,
76};
77
78/* 73/*
79 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being 74 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
80 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a 75 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
diff --git a/include/linux/cb710.h b/include/linux/cb710.h
index 63bc9a4d2926..8cc10411bab2 100644
--- a/include/linux/cb710.h
+++ b/include/linux/cb710.h
@@ -140,29 +140,6 @@ void cb710_dump_regs(struct cb710_chip *chip, unsigned dump);
140#include <linux/highmem.h> 140#include <linux/highmem.h>
141#include <linux/scatterlist.h> 141#include <linux/scatterlist.h>
142 142
143/**
144 * cb710_sg_miter_stop_writing - stop mapping iteration after writing
145 * @miter: sg mapping iter to be stopped
146 *
147 * Description:
148 * Stops mapping iterator @miter. @miter should have been started
149 * started using sg_miter_start(). A stopped iteration can be
150 * resumed by calling sg_miter_next() on it. This is useful when
151 * resources (kmap) need to be released during iteration.
152 *
153 * This is a convenience wrapper that will be optimized out for arches
154 * that don't need flush_kernel_dcache_page().
155 *
156 * Context:
157 * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
158 */
159static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
160{
161 if (miter->page)
162 flush_kernel_dcache_page(miter->page);
163 sg_miter_stop(miter);
164}
165
166/* 143/*
167 * 32-bit PIO mapping sg iterator 144 * 32-bit PIO mapping sg iterator
168 * 145 *
@@ -171,12 +148,12 @@ static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
171 * without DMA support). 148 * without DMA support).
172 * 149 *
173 * Best-case reading (transfer from device): 150 * Best-case reading (transfer from device):
174 * sg_miter_start(); 151 * sg_miter_start(, SG_MITER_TO_SG);
175 * cb710_sg_dwiter_write_from_io(); 152 * cb710_sg_dwiter_write_from_io();
176 * cb710_sg_miter_stop_writing(); 153 * sg_miter_stop();
177 * 154 *
178 * Best-case writing (transfer to device): 155 * Best-case writing (transfer to device):
179 * sg_miter_start(); 156 * sg_miter_start(, SG_MITER_FROM_SG);
180 * cb710_sg_dwiter_read_to_io(); 157 * cb710_sg_dwiter_read_to_io();
181 * sg_miter_stop(); 158 * sg_miter_stop();
182 */ 159 */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 665fa70e4094..90bba9e62286 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -179,14 +179,11 @@ struct cgroup {
179 */ 179 */
180 struct list_head release_list; 180 struct list_head release_list;
181 181
182 /* pids_mutex protects the fields below */ 182 /* pids_mutex protects pids_list and cached pid arrays. */
183 struct rw_semaphore pids_mutex; 183 struct rw_semaphore pids_mutex;
184 /* Array of process ids in the cgroup */ 184
185 pid_t *tasks_pids; 185 /* Linked list of struct cgroup_pids */
186 /* How many files are using the current tasks_pids array */ 186 struct list_head pids_list;
187 int pids_use_count;
188 /* Length of the current tasks_pids array */
189 int pids_length;
190 187
191 /* For RCU-protected deletion */ 188 /* For RCU-protected deletion */
192 struct rcu_head rcu_head; 189 struct rcu_head rcu_head;
@@ -366,6 +363,23 @@ int cgroup_task_count(const struct cgroup *cgrp);
366int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); 363int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
367 364
368/* 365/*
366 * When the subsys has to access css and may add permanent refcnt to css,
367 * it should take care of racy conditions with rmdir(). Following set of
368 * functions, is for stop/restart rmdir if necessary.
369 * Because these will call css_get/put, "css" should be alive css.
370 *
371 * cgroup_exclude_rmdir();
372 * ...do some jobs which may access arbitrary empty cgroup
373 * cgroup_release_and_wakeup_rmdir();
374 *
375 * When someone removes a cgroup while cgroup_exclude_rmdir() holds it,
376 * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up.
377 */
378
379void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
380void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
381
382/*
369 * Control Group subsystem type. 383 * Control Group subsystem type.
370 * See Documentation/cgroups/cgroups.txt for details 384 * See Documentation/cgroups/cgroups.txt for details
371 */ 385 */
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 20a100fe2b4f..3a1dbba4d3ae 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -143,12 +143,3 @@ extern void clockevents_notify(unsigned long reason, void *arg);
143#endif 143#endif
144 144
145#endif 145#endif
146
147#ifdef CONFIG_GENERIC_CLOCKEVENTS
148extern ktime_t clockevents_get_next_event(int cpu);
149#else
150static inline ktime_t clockevents_get_next_event(int cpu)
151{
152 return (ktime_t) { .tv64 = KTIME_MAX };
153}
154#endif
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index c56457c8334e..1219be4fb42e 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -293,7 +293,12 @@ static inline int clocksource_enable(struct clocksource *cs)
293 if (cs->enable) 293 if (cs->enable)
294 ret = cs->enable(cs); 294 ret = cs->enable(cs);
295 295
296 /* save mult_orig on enable */ 296 /*
297 * The frequency may have changed while the clocksource
298 * was disabled. If so the code in ->enable() must update
299 * the mult value to reflect the new frequency. Make sure
300 * mult_orig follows this change.
301 */
297 cs->mult_orig = cs->mult; 302 cs->mult_orig = cs->mult;
298 303
299 return ret; 304 return ret;
@@ -309,6 +314,13 @@ static inline int clocksource_enable(struct clocksource *cs)
309 */ 314 */
310static inline void clocksource_disable(struct clocksource *cs) 315static inline void clocksource_disable(struct clocksource *cs)
311{ 316{
317 /*
318 * Save mult_orig in mult so clocksource_enable() can
319 * restore the value regardless if ->enable() updates
320 * the value of mult or not.
321 */
322 cs->mult = cs->mult_orig;
323
312 if (cs->disable) 324 if (cs->disable)
313 cs->disable(cs); 325 cs->disable(cs);
314} 326}
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index d71f7c0f931b..38fe59dc89ae 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -89,7 +89,6 @@ struct vc_data {
89 unsigned int vc_need_wrap : 1; 89 unsigned int vc_need_wrap : 1;
90 unsigned int vc_can_do_color : 1; 90 unsigned int vc_can_do_color : 1;
91 unsigned int vc_report_mouse : 2; 91 unsigned int vc_report_mouse : 2;
92 unsigned int vc_kmalloced : 1;
93 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ 92 unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
94 unsigned char vc_utf_count; 93 unsigned char vc_utf_count;
95 int vc_utf_char; 94 int vc_utf_char;
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 2dac064d8359..0026f267da20 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -3,7 +3,6 @@
3 3
4#ifdef CONFIG_CRASH_DUMP 4#ifdef CONFIG_CRASH_DUMP
5#include <linux/kexec.h> 5#include <linux/kexec.h>
6#include <linux/smp_lock.h>
7#include <linux/device.h> 6#include <linux/device.h>
8#include <linux/proc_fs.h> 7#include <linux/proc_fs.h>
9 8
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 0d6310657f32..655e7721580a 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -84,7 +84,7 @@ typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
84 84
85typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, 85typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
86 struct dm_dev *dev, 86 struct dm_dev *dev,
87 sector_t physical_start, 87 sector_t start, sector_t len,
88 void *data); 88 void *data);
89 89
90typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, 90typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
@@ -104,7 +104,7 @@ void dm_error(const char *message);
104 * Combine device limits. 104 * Combine device limits.
105 */ 105 */
106int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, 106int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
107 sector_t start, void *data); 107 sector_t start, sector_t len, void *data);
108 108
109struct dm_dev { 109struct dm_dev {
110 struct block_device *bdev; 110 struct block_device *bdev;
diff --git a/include/linux/device.h b/include/linux/device.h
index ed4e39f2c423..aebb81036db2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -25,8 +25,6 @@
25#include <asm/atomic.h> 25#include <asm/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
27 27
28#define BUS_ID_SIZE 20
29
30struct device; 28struct device;
31struct device_private; 29struct device_private;
32struct device_driver; 30struct device_driver;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 634a5e5aba3e..7499b3667798 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
874struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); 874struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
875int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, 875int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
876 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, 876 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
877 int create, int extend_disksize); 877 int create);
878 878
879extern struct inode *ext3_iget(struct super_block *, unsigned long); 879extern struct inode *ext3_iget(struct super_block *, unsigned long);
880extern int ext3_write_inode (struct inode *, int); 880extern int ext3_write_inode (struct inode *, int);
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
new file mode 100644
index 000000000000..23c1ec79a31b
--- /dev/null
+++ b/include/linux/flex_array.h
@@ -0,0 +1,47 @@
1#ifndef _FLEX_ARRAY_H
2#define _FLEX_ARRAY_H
3
4#include <linux/types.h>
5#include <asm/page.h>
6
7#define FLEX_ARRAY_PART_SIZE PAGE_SIZE
8#define FLEX_ARRAY_BASE_SIZE PAGE_SIZE
9
10struct flex_array_part;
11
12/*
13 * This is meant to replace cases where an array-like
14 * structure has gotten too big to fit into kmalloc()
15 * and the developer is getting tempted to use
16 * vmalloc().
17 */
18
19struct flex_array {
20 union {
21 struct {
22 int element_size;
23 int total_nr_elements;
24 struct flex_array_part *parts[0];
25 };
26 /*
27 * This little trick makes sure that
28 * sizeof(flex_array) == PAGE_SIZE
29 */
30 char padding[FLEX_ARRAY_BASE_SIZE];
31 };
32};
33
34#define FLEX_ARRAY_INIT(size, total) { { {\
35 .element_size = (size), \
36 .total_nr_elements = (total), \
37} } }
38
39struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags);
40int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags);
41void flex_array_free(struct flex_array *fa);
42void flex_array_free_parts(struct flex_array *fa);
43int flex_array_put(struct flex_array *fa, int element_nr, void *src,
44 gfp_t flags);
45void *flex_array_get(struct flex_array *fa, int element_nr);
46
47#endif /* _FLEX_ARRAY_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0872372184fe..a36ffa5a77a4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1946,6 +1946,7 @@ extern void putname(const char *name);
1946extern int register_blkdev(unsigned int, const char *); 1946extern int register_blkdev(unsigned int, const char *);
1947extern void unregister_blkdev(unsigned int, const char *); 1947extern void unregister_blkdev(unsigned int, const char *);
1948extern struct block_device *bdget(dev_t); 1948extern struct block_device *bdget(dev_t);
1949extern struct block_device *bdgrab(struct block_device *bdev);
1949extern void bd_set_size(struct block_device *, loff_t size); 1950extern void bd_set_size(struct block_device *, loff_t size);
1950extern void bd_forget(struct inode *inode); 1951extern void bd_forget(struct inode *inode);
1951extern void bdput(struct block_device *); 1952extern void bdput(struct block_device *);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 6c3de999fb34..4d6f47b51189 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -352,7 +352,7 @@ extern void fsnotify_unmount_inodes(struct list_head *list);
352/* put here because inotify does some weird stuff when destroying watches */ 352/* put here because inotify does some weird stuff when destroying watches */
353extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, 353extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
354 void *data, int data_is, const char *name, 354 void *data, int data_is, const char *name,
355 u32 cookie); 355 u32 cookie, gfp_t gfp);
356 356
357#else 357#else
358 358
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 45257475623c..8246c697863d 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -2,7 +2,9 @@
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/preempt.h> 4#include <linux/preempt.h>
5#ifdef CONFIG_PREEMPT
5#include <linux/smp_lock.h> 6#include <linux/smp_lock.h>
7#endif
6#include <linux/lockdep.h> 8#include <linux/lockdep.h>
7#include <linux/ftrace_irq.h> 9#include <linux/ftrace_irq.h>
8#include <asm/hardirq.h> 10#include <asm/hardirq.h>
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 54648e625efd..4759917adc71 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -448,7 +448,7 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
448 448
449static inline void timer_stats_account_hrtimer(struct hrtimer *timer) 449static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
450{ 450{
451 if (likely(!timer->start_pid)) 451 if (likely(!timer->start_site))
452 return; 452 return;
453 timer_stats_update_stats(timer, timer->start_pid, timer->start_site, 453 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
454 timer->function, timer->start_comm, 0); 454 timer->function, timer->start_comm, 0);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 2721f07e9354..35e7df1e9f30 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -14,6 +14,7 @@
14#include <linux/irqflags.h> 14#include <linux/irqflags.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/percpu.h> 16#include <linux/percpu.h>
17#include <linux/hrtimer.h>
17 18
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
@@ -64,11 +65,13 @@
64 * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run 65 * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run
65 * IRQTF_DIED - handler thread died 66 * IRQTF_DIED - handler thread died
66 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed 67 * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed
68 * IRQTF_AFFINITY - irq thread is requested to adjust affinity
67 */ 69 */
68enum { 70enum {
69 IRQTF_RUNTHREAD, 71 IRQTF_RUNTHREAD,
70 IRQTF_DIED, 72 IRQTF_DIED,
71 IRQTF_WARNED, 73 IRQTF_WARNED,
74 IRQTF_AFFINITY,
72}; 75};
73 76
74typedef irqreturn_t (*irq_handler_t)(int, void *); 77typedef irqreturn_t (*irq_handler_t)(int, void *);
@@ -517,6 +520,31 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
517extern void tasklet_init(struct tasklet_struct *t, 520extern void tasklet_init(struct tasklet_struct *t,
518 void (*func)(unsigned long), unsigned long data); 521 void (*func)(unsigned long), unsigned long data);
519 522
523struct tasklet_hrtimer {
524 struct hrtimer timer;
525 struct tasklet_struct tasklet;
526 enum hrtimer_restart (*function)(struct hrtimer *);
527};
528
529extern void
530tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
531 enum hrtimer_restart (*function)(struct hrtimer *),
532 clockid_t which_clock, enum hrtimer_mode mode);
533
534static inline
535int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
536 const enum hrtimer_mode mode)
537{
538 return hrtimer_start(&ttimer->timer, time, mode);
539}
540
541static inline
542void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
543{
544 hrtimer_cancel(&ttimer->timer);
545 tasklet_kill(&ttimer->tasklet);
546}
547
520/* 548/*
521 * Autoprobing for irqs: 549 * Autoprobing for irqs:
522 * 550 *
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index dd05434fa45f..4da4a75c3f1e 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
92 * a race). 92 * a race).
93 */ 93 */
94 if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { 94 if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) {
95 atomic_long_inc(&ioc->refcount); 95 atomic_inc(&ioc->nr_tasks);
96 return ioc; 96 return ioc;
97 } 97 }
98 98
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
index 7796aed6cdd5..6a63807f714e 100644
--- a/include/linux/kmemleak.h
+++ b/include/linux/kmemleak.h
@@ -27,6 +27,7 @@ extern void kmemleak_init(void);
27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, 27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count,
28 gfp_t gfp); 28 gfp_t gfp);
29extern void kmemleak_free(const void *ptr); 29extern void kmemleak_free(const void *ptr);
30extern void kmemleak_free_part(const void *ptr, size_t size);
30extern void kmemleak_padding(const void *ptr, unsigned long offset, 31extern void kmemleak_padding(const void *ptr, unsigned long offset,
31 size_t size); 32 size_t size);
32extern void kmemleak_not_leak(const void *ptr); 33extern void kmemleak_not_leak(const void *ptr);
@@ -71,6 +72,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
71static inline void kmemleak_free(const void *ptr) 72static inline void kmemleak_free(const void *ptr)
72{ 73{
73} 74}
75static inline void kmemleak_free_part(const void *ptr, size_t size)
76{
77}
74static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) 78static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags)
75{ 79{
76} 80}
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
index 7bc1440fc473..2fb1dcbcb5aa 100644
--- a/include/linux/lguest.h
+++ b/include/linux/lguest.h
@@ -1,5 +1,7 @@
1/* Things the lguest guest needs to know. Note: like all lguest interfaces, 1/*
2 * this is subject to wild and random change between versions. */ 2 * Things the lguest guest needs to know. Note: like all lguest interfaces,
3 * this is subject to wild and random change between versions.
4 */
3#ifndef _LINUX_LGUEST_H 5#ifndef _LINUX_LGUEST_H
4#define _LINUX_LGUEST_H 6#define _LINUX_LGUEST_H
5 7
@@ -11,32 +13,41 @@
11#define LG_CLOCK_MIN_DELTA 100UL 13#define LG_CLOCK_MIN_DELTA 100UL
12#define LG_CLOCK_MAX_DELTA ULONG_MAX 14#define LG_CLOCK_MAX_DELTA ULONG_MAX
13 15
14/*G:032 The second method of communicating with the Host is to via "struct 16/*G:031
17 * The second method of communicating with the Host is to via "struct
15 * lguest_data". Once the Guest's initialization hypercall tells the Host where 18 * lguest_data". Once the Guest's initialization hypercall tells the Host where
16 * this is, the Guest and Host both publish information in it. :*/ 19 * this is, the Guest and Host both publish information in it.
17struct lguest_data 20:*/
18{ 21struct lguest_data {
19 /* 512 == enabled (same as eflags in normal hardware). The Guest 22 /*
20 * changes interrupts so often that a hypercall is too slow. */ 23 * 512 == enabled (same as eflags in normal hardware). The Guest
24 * changes interrupts so often that a hypercall is too slow.
25 */
21 unsigned int irq_enabled; 26 unsigned int irq_enabled;
22 /* Fine-grained interrupt disabling by the Guest */ 27 /* Fine-grained interrupt disabling by the Guest */
23 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); 28 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
24 29
25 /* The Host writes the virtual address of the last page fault here, 30 /*
31 * The Host writes the virtual address of the last page fault here,
26 * which saves the Guest a hypercall. CR2 is the native register where 32 * which saves the Guest a hypercall. CR2 is the native register where
27 * this address would normally be found. */ 33 * this address would normally be found.
34 */
28 unsigned long cr2; 35 unsigned long cr2;
29 36
30 /* Wallclock time set by the Host. */ 37 /* Wallclock time set by the Host. */
31 struct timespec time; 38 struct timespec time;
32 39
33 /* Interrupt pending set by the Host. The Guest should do a hypercall 40 /*
34 * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). */ 41 * Interrupt pending set by the Host. The Guest should do a hypercall
42 * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF).
43 */
35 int irq_pending; 44 int irq_pending;
36 45
37 /* Async hypercall ring. Instead of directly making hypercalls, we can 46 /*
47 * Async hypercall ring. Instead of directly making hypercalls, we can
38 * place them in here for processing the next time the Host wants. 48 * place them in here for processing the next time the Host wants.
39 * This batching can be quite efficient. */ 49 * This batching can be quite efficient.
50 */
40 51
41 /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ 52 /* 0xFF == done (set by Host), 0 == pending (set by Guest). */
42 u8 hcall_status[LHCALL_RING_SIZE]; 53 u8 hcall_status[LHCALL_RING_SIZE];
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
index bfefbdf7498a..495203ff221c 100644
--- a/include/linux/lguest_launcher.h
+++ b/include/linux/lguest_launcher.h
@@ -29,8 +29,10 @@ struct lguest_device_desc {
29 __u8 type; 29 __u8 type;
30 /* The number of virtqueues (first in config array) */ 30 /* The number of virtqueues (first in config array) */
31 __u8 num_vq; 31 __u8 num_vq;
32 /* The number of bytes of feature bits. Multiply by 2: one for host 32 /*
33 * features and one for Guest acknowledgements. */ 33 * The number of bytes of feature bits. Multiply by 2: one for host
34 * features and one for Guest acknowledgements.
35 */
34 __u8 feature_len; 36 __u8 feature_len;
35 /* The number of bytes of the config array after virtqueues. */ 37 /* The number of bytes of the config array after virtqueues. */
36 __u8 config_len; 38 __u8 config_len;
@@ -39,8 +41,10 @@ struct lguest_device_desc {
39 __u8 config[0]; 41 __u8 config[0];
40}; 42};
41 43
42/*D:135 This is how we expect the device configuration field for a virtqueue 44/*D:135
43 * to be laid out in config space. */ 45 * This is how we expect the device configuration field for a virtqueue
46 * to be laid out in config space.
47 */
44struct lguest_vqconfig { 48struct lguest_vqconfig {
45 /* The number of entries in the virtio_ring */ 49 /* The number of entries in the virtio_ring */
46 __u16 num; 50 __u16 num;
@@ -61,7 +65,9 @@ enum lguest_req
61 LHREQ_EVENTFD, /* + address, fd. */ 65 LHREQ_EVENTFD, /* + address, fd. */
62}; 66};
63 67
64/* The alignment to use between consumer and producer parts of vring. 68/*
65 * x86 pagesize for historical reasons. */ 69 * The alignment to use between consumer and producer parts of vring.
70 * x86 pagesize for historical reasons.
71 */
66#define LGUEST_VRING_ALIGN 4096 72#define LGUEST_VRING_ALIGN 4096
67#endif /* _LINUX_LGUEST_LAUNCHER */ 73#endif /* _LINUX_LGUEST_LAUNCHER */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 3d501db36a26..e5b6e33c6571 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -385,6 +385,7 @@ enum {
385 not multiple of 16 bytes */ 385 not multiple of 16 bytes */
386 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ 386 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */
387 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ 387 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
388 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
388 389
389 /* DMA mask for user DMA control: User visible values; DO NOT 390 /* DMA mask for user DMA control: User visible values; DO NOT
390 renumber */ 391 renumber */
@@ -588,6 +589,7 @@ struct ata_device {
588#endif 589#endif
589 /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ 590 /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */
590 u64 n_sectors; /* size of device, if ATA */ 591 u64 n_sectors; /* size of device, if ATA */
592 u64 n_native_sectors; /* native size, if ATA */
591 unsigned int class; /* ATA_DEV_xxx */ 593 unsigned int class; /* ATA_DEV_xxx */
592 unsigned long unpark_deadline; 594 unsigned long unpark_deadline;
593 595
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index c9663c690303..53b94e025c7c 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -18,5 +18,8 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
18 struct device_node *phy_np, 18 struct device_node *phy_np,
19 void (*hndlr)(struct net_device *), 19 void (*hndlr)(struct net_device *),
20 u32 flags, phy_interface_t iface); 20 u32 flags, phy_interface_t iface);
21extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
22 void (*hndlr)(struct net_device *),
23 phy_interface_t iface);
21 24
22#endif /* __LINUX_OF_MDIO_H */ 25#endif /* __LINUX_OF_MDIO_H */
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 5e970c7d3fd5..bd15d7a5f5ce 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -120,8 +120,9 @@ enum perf_counter_sample_format {
120 PERF_SAMPLE_ID = 1U << 6, 120 PERF_SAMPLE_ID = 1U << 6,
121 PERF_SAMPLE_CPU = 1U << 7, 121 PERF_SAMPLE_CPU = 1U << 7,
122 PERF_SAMPLE_PERIOD = 1U << 8, 122 PERF_SAMPLE_PERIOD = 1U << 8,
123 PERF_SAMPLE_STREAM_ID = 1U << 9,
123 124
124 PERF_SAMPLE_MAX = 1U << 9, /* non-ABI */ 125 PERF_SAMPLE_MAX = 1U << 10, /* non-ABI */
125}; 126};
126 127
127/* 128/*
@@ -312,16 +313,7 @@ enum perf_event_type {
312 * struct perf_event_header header; 313 * struct perf_event_header header;
313 * u64 time; 314 * u64 time;
314 * u64 id; 315 * u64 id;
315 * u64 sample_period; 316 * u64 stream_id;
316 * };
317 */
318 PERF_EVENT_PERIOD = 4,
319
320 /*
321 * struct {
322 * struct perf_event_header header;
323 * u64 time;
324 * u64 id;
325 * }; 317 * };
326 */ 318 */
327 PERF_EVENT_THROTTLE = 5, 319 PERF_EVENT_THROTTLE = 5,
@@ -356,6 +348,7 @@ enum perf_event_type {
356 * { u64 time; } && PERF_SAMPLE_TIME 348 * { u64 time; } && PERF_SAMPLE_TIME
357 * { u64 addr; } && PERF_SAMPLE_ADDR 349 * { u64 addr; } && PERF_SAMPLE_ADDR
358 * { u64 id; } && PERF_SAMPLE_ID 350 * { u64 id; } && PERF_SAMPLE_ID
351 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
359 * { u32 cpu, res; } && PERF_SAMPLE_CPU 352 * { u32 cpu, res; } && PERF_SAMPLE_CPU
360 * { u64 period; } && PERF_SAMPLE_PERIOD 353 * { u64 period; } && PERF_SAMPLE_PERIOD
361 * 354 *
diff --git a/include/linux/personality.h b/include/linux/personality.h
index a84e9ff9b27e..126120819a0d 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -40,7 +40,10 @@ enum {
40 * Security-relevant compatibility flags that must be 40 * Security-relevant compatibility flags that must be
41 * cleared upon setuid or setgid exec: 41 * cleared upon setuid or setgid exec:
42 */ 42 */
43#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE) 43#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
44 ADDR_NO_RANDOMIZE | \
45 ADDR_COMPAT_LAYOUT | \
46 MMAP_PAGE_ZERO)
44 47
45/* 48/*
46 * Personality types. 49 * Personality types.
diff --git a/include/linux/pps.h b/include/linux/pps.h
index cfe5c7214ec6..0194ab06177b 100644
--- a/include/linux/pps.h
+++ b/include/linux/pps.h
@@ -22,6 +22,8 @@
22#ifndef _PPS_H_ 22#ifndef _PPS_H_
23#define _PPS_H_ 23#define _PPS_H_
24 24
25#include <linux/types.h>
26
25#define PPS_VERSION "5.3.6" 27#define PPS_VERSION "5.3.6"
26#define PPS_MAX_SOURCES 16 /* should be enough... */ 28#define PPS_MAX_SOURCES 16 /* should be enough... */
27 29
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 7bc457593684..26361c4c037a 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -7,7 +7,6 @@
7#ifndef _LINUX_QUOTAOPS_ 7#ifndef _LINUX_QUOTAOPS_
8#define _LINUX_QUOTAOPS_ 8#define _LINUX_QUOTAOPS_
9 9
10#include <linux/smp_lock.h>
11#include <linux/fs.h> 10#include <linux/fs.h>
12 11
13static inline struct quota_info *sb_dqopt(struct super_block *sb) 12static inline struct quota_info *sb_dqopt(struct super_block *sb)
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 2ce29831feb6..278777fa8a3a 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -224,7 +224,7 @@ void rfkill_destroy(struct rfkill *rfkill);
224 * should be blocked) so that drivers need not keep track of the soft 224 * should be blocked) so that drivers need not keep track of the soft
225 * block state -- which they might not be able to. 225 * block state -- which they might not be able to.
226 */ 226 */
227bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); 227bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
228 228
229/** 229/**
230 * rfkill_set_sw_state - Set the internal rfkill software block state 230 * rfkill_set_sw_state - Set the internal rfkill software block state
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index e5996984ddd0..9aaf5bfdad1a 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -242,6 +242,8 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
242 */ 242 */
243 243
244#define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ 244#define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */
245#define SG_MITER_TO_SG (1 << 1) /* flush back to phys on unmap */
246#define SG_MITER_FROM_SG (1 << 2) /* nop */
245 247
246struct sg_mapping_iter { 248struct sg_mapping_iter {
247 /* the following three fields can be accessed directly */ 249 /* the following three fields can be accessed directly */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 16a982e389fb..3ab08e4bb6b8 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -209,7 +209,7 @@ extern unsigned long long time_sync_thresh;
209 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) 209 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
210#define task_contributes_to_load(task) \ 210#define task_contributes_to_load(task) \
211 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ 211 ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
212 (task->flags & PF_FROZEN) == 0) 212 (task->flags & PF_FREEZING) == 0)
213 213
214#define __set_task_state(tsk, state_value) \ 214#define __set_task_state(tsk, state_value) \
215 do { (tsk)->state = (state_value); } while (0) 215 do { (tsk)->state = (state_value); } while (0)
@@ -1680,6 +1680,7 @@ extern cputime_t task_gtime(struct task_struct *p);
1680#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1680#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1681#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ 1681#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
1682#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1682#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1683#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1683#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1684#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
1684#define PF_FROZEN 0x00010000 /* frozen for system suspend */ 1685#define PF_FROZEN 0x00010000 /* frozen for system suspend */
1685#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ 1686#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b47b3f039d14..f2c69a2cca17 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1342,12 +1342,12 @@ static inline int skb_network_offset(const struct sk_buff *skb)
1342 * shifting the start of the packet by 2 bytes. Drivers should do this 1342 * shifting the start of the packet by 2 bytes. Drivers should do this
1343 * with: 1343 * with:
1344 * 1344 *
1345 * skb_reserve(NET_IP_ALIGN); 1345 * skb_reserve(skb, NET_IP_ALIGN);
1346 * 1346 *
1347 * The downside to this alignment of the IP header is that the DMA is now 1347 * The downside to this alignment of the IP header is that the DMA is now
1348 * unaligned. On some architectures the cost of an unaligned DMA is high 1348 * unaligned. On some architectures the cost of an unaligned DMA is high
1349 * and this cost outweighs the gains made by aligning the IP header. 1349 * and this cost outweighs the gains made by aligning the IP header.
1350 * 1350 *
1351 * Since this trade off varies between architectures, we allow NET_IP_ALIGN 1351 * Since this trade off varies between architectures, we allow NET_IP_ALIGN
1352 * to be overridden. 1352 * to be overridden.
1353 */ 1353 */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 4dcbc2c71491..c1c862b1d01a 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -11,6 +11,7 @@
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kobject.h> 12#include <linux/kobject.h>
13#include <linux/kmemtrace.h> 13#include <linux/kmemtrace.h>
14#include <linux/kmemleak.h>
14 15
15enum stat_item { 16enum stat_item {
16 ALLOC_FASTPATH, /* Allocation from cpu slab */ 17 ALLOC_FASTPATH, /* Allocation from cpu slab */
@@ -233,6 +234,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
233 unsigned int order = get_order(size); 234 unsigned int order = get_order(size);
234 void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); 235 void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order);
235 236
237 kmemleak_alloc(ret, size, 1, flags);
236 trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); 238 trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags);
237 239
238 return ret; 240 return ret;
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index d8910b68e1bd..b99c625fddfe 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -12,7 +12,6 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/smp_lock.h>
16 15
17/* 16/*
18 * Buffer adjustment 17 * Buffer adjustment
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 1488d8c81aac..e8c6c9136c97 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -394,6 +394,7 @@ extern void __do_SAK(struct tty_struct *tty);
394extern void disassociate_ctty(int priv); 394extern void disassociate_ctty(int priv);
395extern void no_tty(void); 395extern void no_tty(void);
396extern void tty_flip_buffer_push(struct tty_struct *tty); 396extern void tty_flip_buffer_push(struct tty_struct *tty);
397extern void tty_flush_to_ldisc(struct tty_struct *tty);
397extern void tty_buffer_free_all(struct tty_struct *tty); 398extern void tty_buffer_free_all(struct tty_struct *tty);
398extern void tty_buffer_flush(struct tty_struct *tty); 399extern void tty_buffer_flush(struct tty_struct *tty);
399extern void tty_buffer_init(struct tty_struct *tty); 400extern void tty_buffer_init(struct tty_struct *tty);
diff --git a/include/linux/uio.h b/include/linux/uio.h
index b7fe13883bdb..98c114323a8b 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -19,15 +19,6 @@ struct iovec
19 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ 19 __kernel_size_t iov_len; /* Must be size_t (1003.1g) */
20}; 20};
21 21
22#ifdef __KERNEL__
23
24struct kvec {
25 void *iov_base; /* and that should *never* hold a userland pointer */
26 size_t iov_len;
27};
28
29#endif
30
31/* 22/*
32 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) 23 * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
33 */ 24 */
@@ -35,6 +26,13 @@ struct kvec {
35#define UIO_FASTIOV 8 26#define UIO_FASTIOV 8
36#define UIO_MAXIOV 1024 27#define UIO_MAXIOV 1024
37 28
29#ifdef __KERNEL__
30
31struct kvec {
32 void *iov_base; /* and that should *never* hold a userland pointer */
33 size_t iov_len;
34};
35
38/* 36/*
39 * Total number of bytes covered by an iovec. 37 * Total number of bytes covered by an iovec.
40 * 38 *
@@ -53,5 +51,6 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
53} 51}
54 52
55unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); 53unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
54#endif
56 55
57#endif 56#endif
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 84929e914034..b1e3c2fbfe11 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -888,8 +888,6 @@ struct usb_driver {
888 * struct usb_device_driver - identifies USB device driver to usbcore 888 * struct usb_device_driver - identifies USB device driver to usbcore
889 * @name: The driver name should be unique among USB drivers, 889 * @name: The driver name should be unique among USB drivers,
890 * and should normally be the same as the module name. 890 * and should normally be the same as the module name.
891 * @nodename: Callback to provide a naming hint for a possible
892 * device node to create.
893 * @probe: Called to see if the driver is willing to manage a particular 891 * @probe: Called to see if the driver is willing to manage a particular
894 * device. If it is, probe returns zero and uses dev_set_drvdata() 892 * device. If it is, probe returns zero and uses dev_set_drvdata()
895 * to associate driver-specific data with the device. If unwilling 893 * to associate driver-specific data with the device. If unwilling
@@ -924,6 +922,8 @@ extern struct bus_type usb_bus_type;
924/** 922/**
925 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number 923 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
926 * @name: the usb class device name for this driver. Will show up in sysfs. 924 * @name: the usb class device name for this driver. Will show up in sysfs.
925 * @nodename: Callback to provide a naming hint for a possible
926 * device node to create.
927 * @fops: pointer to the struct file_operations of this driver. 927 * @fops: pointer to the struct file_operations of this driver.
928 * @minor_base: the start of the minor range for this driver. 928 * @minor_base: the start of the minor range for this driver.
929 * 929 *
@@ -1046,6 +1046,8 @@ typedef void (*usb_complete_t)(struct urb *);
1046 * the device driver is saying that it provided this DMA address, 1046 * the device driver is saying that it provided this DMA address,
1047 * which the host controller driver should use in preference to the 1047 * which the host controller driver should use in preference to the
1048 * transfer_buffer. 1048 * transfer_buffer.
1049 * @sg: scatter gather buffer list
1050 * @num_sgs: number of entries in the sg list
1049 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1051 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
1050 * be broken up into chunks according to the current maximum packet 1052 * be broken up into chunks according to the current maximum packet
1051 * size for the endpoint, which is a function of the configuration 1053 * size for the endpoint, which is a function of the configuration
diff --git a/include/linux/usb/langwell_otg.h b/include/linux/usb/langwell_otg.h
deleted file mode 100644
index e115ae6df1da..000000000000
--- a/include/linux/usb/langwell_otg.h
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * Intel Langwell USB OTG transceiver driver
3 * Copyright (C) 2008, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19
20#ifndef __LANGWELL_OTG_H__
21#define __LANGWELL_OTG_H__
22
23/* notify transceiver driver about OTG events */
24extern void langwell_update_transceiver(void);
25/* HCD register bus driver */
26extern int langwell_register_host(struct pci_driver *host_driver);
27/* HCD unregister bus driver */
28extern void langwell_unregister_host(struct pci_driver *host_driver);
29/* DCD register bus driver */
30extern int langwell_register_peripheral(struct pci_driver *client_driver);
31/* DCD unregister bus driver */
32extern void langwell_unregister_peripheral(struct pci_driver *client_driver);
33/* No silent failure, output warning message */
34extern void langwell_otg_nsf_msg(unsigned long message);
35
36#define CI_USBCMD 0x30
37# define USBCMD_RST BIT(1)
38# define USBCMD_RS BIT(0)
39#define CI_USBSTS 0x34
40# define USBSTS_SLI BIT(8)
41# define USBSTS_URI BIT(6)
42# define USBSTS_PCI BIT(2)
43#define CI_PORTSC1 0x74
44# define PORTSC_PP BIT(12)
45# define PORTSC_LS (BIT(11) | BIT(10))
46# define PORTSC_SUSP BIT(7)
47# define PORTSC_CCS BIT(0)
48#define CI_HOSTPC1 0xb4
49# define HOSTPC1_PHCD BIT(22)
50#define CI_OTGSC 0xf4
51# define OTGSC_DPIE BIT(30)
52# define OTGSC_1MSE BIT(29)
53# define OTGSC_BSEIE BIT(28)
54# define OTGSC_BSVIE BIT(27)
55# define OTGSC_ASVIE BIT(26)
56# define OTGSC_AVVIE BIT(25)
57# define OTGSC_IDIE BIT(24)
58# define OTGSC_DPIS BIT(22)
59# define OTGSC_1MSS BIT(21)
60# define OTGSC_BSEIS BIT(20)
61# define OTGSC_BSVIS BIT(19)
62# define OTGSC_ASVIS BIT(18)
63# define OTGSC_AVVIS BIT(17)
64# define OTGSC_IDIS BIT(16)
65# define OTGSC_DPS BIT(14)
66# define OTGSC_1MST BIT(13)
67# define OTGSC_BSE BIT(12)
68# define OTGSC_BSV BIT(11)
69# define OTGSC_ASV BIT(10)
70# define OTGSC_AVV BIT(9)
71# define OTGSC_ID BIT(8)
72# define OTGSC_HABA BIT(7)
73# define OTGSC_HADP BIT(6)
74# define OTGSC_IDPU BIT(5)
75# define OTGSC_DP BIT(4)
76# define OTGSC_OT BIT(3)
77# define OTGSC_HAAR BIT(2)
78# define OTGSC_VC BIT(1)
79# define OTGSC_VD BIT(0)
80# define OTGSC_INTEN_MASK (0x7f << 24)
81# define OTGSC_INTSTS_MASK (0x7f << 16)
82#define CI_USBMODE 0xf8
83# define USBMODE_CM (BIT(1) | BIT(0))
84# define USBMODE_IDLE 0
85# define USBMODE_DEVICE 0x2
86# define USBMODE_HOST 0x3
87
88#define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI)
89
90struct otg_hsm {
91 /* Input */
92 int a_bus_resume;
93 int a_bus_suspend;
94 int a_conn;
95 int a_sess_vld;
96 int a_srp_det;
97 int a_vbus_vld;
98 int b_bus_resume;
99 int b_bus_suspend;
100 int b_conn;
101 int b_se0_srp;
102 int b_sess_end;
103 int b_sess_vld;
104 int id;
105
106 /* Internal variables */
107 int a_set_b_hnp_en;
108 int b_srp_done;
109 int b_hnp_enable;
110
111 /* Timeout indicator for timers */
112 int a_wait_vrise_tmout;
113 int a_wait_bcon_tmout;
114 int a_aidl_bdis_tmout;
115 int b_ase0_brst_tmout;
116 int b_bus_suspend_tmout;
117 int b_srp_res_tmout;
118
119 /* Informative variables */
120 int a_bus_drop;
121 int a_bus_req;
122 int a_clr_err;
123 int a_suspend_req;
124 int b_bus_req;
125
126 /* Output */
127 int drv_vbus;
128 int loc_conn;
129 int loc_sof;
130
131 /* Others */
132 int b_bus_suspend_vld;
133};
134
135#define TA_WAIT_VRISE 100
136#define TA_WAIT_BCON 30000
137#define TA_AIDL_BDIS 15000
138#define TB_ASE0_BRST 5000
139#define TB_SE0_SRP 2
140#define TB_SRP_RES 100
141#define TB_BUS_SUSPEND 500
142
143struct langwell_otg_timer {
144 unsigned long expires; /* Number of count increase to timeout */
145 unsigned long count; /* Tick counter */
146 void (*function)(unsigned long); /* Timeout function */
147 unsigned long data; /* Data passed to function */
148 struct list_head list;
149};
150
151struct langwell_otg {
152 struct otg_transceiver otg;
153 struct otg_hsm hsm;
154 void __iomem *regs;
155 unsigned region;
156 struct pci_driver *host_ops;
157 struct pci_driver *client_ops;
158 struct pci_dev *pdev;
159 struct work_struct work;
160 struct workqueue_struct *qwork;
161 spinlock_t lock;
162 spinlock_t wq_lock;
163};
164
165static inline struct langwell_otg *otg_to_langwell(struct otg_transceiver *otg)
166{
167 return container_of(otg, struct langwell_otg, otg);
168}
169
170#ifdef DEBUG
171#define otg_dbg(fmt, args...) \
172 printk(KERN_DEBUG fmt , ## args)
173#else
174#define otg_dbg(fmt, args...) \
175 do { } while (0)
176#endif /* DEBUG */
177#endif /* __LANGWELL_OTG_H__ */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 95846d988011..74f16876f38d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -338,6 +338,7 @@ struct v4l2_pix_format {
338/* Vendor-specific formats */ 338/* Vendor-specific formats */
339#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ 339#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
340#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ 340#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
341#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
341#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ 342#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
342#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ 343#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
343#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ 344#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index be7d255fc7cf..8dab9f2b8832 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -20,8 +20,7 @@
20 20
21#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ 21#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */
22 22
23struct virtio_blk_config 23struct virtio_blk_config {
24{
25 /* The capacity (in 512-byte sectors). */ 24 /* The capacity (in 512-byte sectors). */
26 __u64 capacity; 25 __u64 capacity;
27 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ 26 /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
@@ -50,8 +49,7 @@ struct virtio_blk_config
50#define VIRTIO_BLK_T_BARRIER 0x80000000 49#define VIRTIO_BLK_T_BARRIER 0x80000000
51 50
52/* This is the first element of the read scatter-gather list. */ 51/* This is the first element of the read scatter-gather list. */
53struct virtio_blk_outhdr 52struct virtio_blk_outhdr {
54{
55 /* VIRTIO_BLK_T* */ 53 /* VIRTIO_BLK_T* */
56 __u32 type; 54 __u32 type;
57 /* io priority. */ 55 /* io priority. */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 99f514575f6a..e547e3c8ee9a 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -79,8 +79,7 @@
79 * the dev->feature bits if it wants. 79 * the dev->feature bits if it wants.
80 */ 80 */
81typedef void vq_callback_t(struct virtqueue *); 81typedef void vq_callback_t(struct virtqueue *);
82struct virtio_config_ops 82struct virtio_config_ops {
83{
84 void (*get)(struct virtio_device *vdev, unsigned offset, 83 void (*get)(struct virtio_device *vdev, unsigned offset,
85 void *buf, unsigned len); 84 void *buf, unsigned len);
86 void (*set)(struct virtio_device *vdev, unsigned offset, 85 void (*set)(struct virtio_device *vdev, unsigned offset,
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index cec79adbe3ea..d8dd539c9f48 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -27,11 +27,11 @@
27#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */ 27#define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */
28#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ 28#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
29#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ 29#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
30#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
30 31
31#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ 32#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
32 33
33struct virtio_net_config 34struct virtio_net_config {
34{
35 /* The config defining mac address (if VIRTIO_NET_F_MAC) */ 35 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
36 __u8 mac[6]; 36 __u8 mac[6];
37 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ 37 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
@@ -40,8 +40,7 @@ struct virtio_net_config
40 40
41/* This is the first element of the scatter-gather list. If you don't 41/* This is the first element of the scatter-gather list. If you don't
42 * specify GSO or CSUM features, you can simply ignore the header. */ 42 * specify GSO or CSUM features, you can simply ignore the header. */
43struct virtio_net_hdr 43struct virtio_net_hdr {
44{
45#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 44#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
46 __u8 flags; 45 __u8 flags;
47#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame 46#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
@@ -81,14 +80,19 @@ typedef __u8 virtio_net_ctrl_ack;
81#define VIRTIO_NET_ERR 1 80#define VIRTIO_NET_ERR 1
82 81
83/* 82/*
84 * Control the RX mode, ie. promisucous and allmulti. PROMISC and 83 * Control the RX mode, ie. promisucous, allmulti, etc...
85 * ALLMULTI commands require an "out" sg entry containing a 1 byte 84 * All commands require an "out" sg entry containing a 1 byte
86 * state value, zero = disable, non-zero = enable. These commands 85 * state value, zero = disable, non-zero = enable. Commands
87 * are supported with the VIRTIO_NET_F_CTRL_RX feature. 86 * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature.
87 * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA.
88 */ 88 */
89#define VIRTIO_NET_CTRL_RX 0 89#define VIRTIO_NET_CTRL_RX 0
90 #define VIRTIO_NET_CTRL_RX_PROMISC 0 90 #define VIRTIO_NET_CTRL_RX_PROMISC 0
91 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 91 #define VIRTIO_NET_CTRL_RX_ALLMULTI 1
92 #define VIRTIO_NET_CTRL_RX_ALLUNI 2
93 #define VIRTIO_NET_CTRL_RX_NOMULTI 3
94 #define VIRTIO_NET_CTRL_RX_NOUNI 4
95 #define VIRTIO_NET_CTRL_RX_NOBCAST 5
92 96
93/* 97/*
94 * Control the MAC filter table. 98 * Control the MAC filter table.
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 693e0ec5afa6..e4d144b132b5 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -30,8 +30,7 @@
30#define VIRTIO_RING_F_INDIRECT_DESC 28 30#define VIRTIO_RING_F_INDIRECT_DESC 28
31 31
32/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ 32/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
33struct vring_desc 33struct vring_desc {
34{
35 /* Address (guest-physical). */ 34 /* Address (guest-physical). */
36 __u64 addr; 35 __u64 addr;
37 /* Length. */ 36 /* Length. */
@@ -42,24 +41,21 @@ struct vring_desc
42 __u16 next; 41 __u16 next;
43}; 42};
44 43
45struct vring_avail 44struct vring_avail {
46{
47 __u16 flags; 45 __u16 flags;
48 __u16 idx; 46 __u16 idx;
49 __u16 ring[]; 47 __u16 ring[];
50}; 48};
51 49
52/* u32 is used here for ids for padding reasons. */ 50/* u32 is used here for ids for padding reasons. */
53struct vring_used_elem 51struct vring_used_elem {
54{
55 /* Index of start of used descriptor chain. */ 52 /* Index of start of used descriptor chain. */
56 __u32 id; 53 __u32 id;
57 /* Total length of the descriptor chain which was used (written to) */ 54 /* Total length of the descriptor chain which was used (written to) */
58 __u32 len; 55 __u32 len;
59}; 56};
60 57
61struct vring_used 58struct vring_used {
62{
63 __u16 flags; 59 __u16 flags;
64 __u16 idx; 60 __u16 idx;
65 struct vring_used_elem ring[]; 61 struct vring_used_elem ring[];
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 11a4a2d3e364..94e908c0d7a0 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -60,6 +60,10 @@ enum {
60 V4L2_IDENT_OV7670 = 250, 60 V4L2_IDENT_OV7670 = 250,
61 V4L2_IDENT_OV7720 = 251, 61 V4L2_IDENT_OV7720 = 251,
62 V4L2_IDENT_OV7725 = 252, 62 V4L2_IDENT_OV7725 = 252,
63 V4L2_IDENT_OV7660 = 253,
64 V4L2_IDENT_OV9650 = 254,
65 V4L2_IDENT_OV9655 = 255,
66 V4L2_IDENT_SOI968 = 256,
63 67
64 /* module saa7146: reserved range 300-309 */ 68 /* module saa7146: reserved range 300-309 */
65 V4L2_IDENT_SAA7146 = 300, 69 V4L2_IDENT_SAA7146 = 300,
@@ -161,6 +165,9 @@ enum {
161 /* module tw9910: just ident 9910 */ 165 /* module tw9910: just ident 9910 */
162 V4L2_IDENT_TW9910 = 9910, 166 V4L2_IDENT_TW9910 = 9910,
163 167
168 /* module sn9c20x: just ident 10000 */
169 V4L2_IDENT_SN9C20X = 10000,
170
164 /* module msp3400: reserved range 34000-34999 and 44000-44999 */ 171 /* module msp3400: reserved range 34000-34999 and 44000-44999 */
165 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only 172 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only
166 use internally (tveeprom.c). */ 173 use internally (tveeprom.c). */
@@ -237,6 +244,11 @@ enum {
237 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ 244 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */
238 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ 245 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */
239 V4L2_IDENT_MT9T031 = 45020, 246 V4L2_IDENT_MT9T031 = 45020,
247 V4L2_IDENT_MT9V111 = 45031,
248 V4L2_IDENT_MT9V112 = 45032,
249
250 /* HV7131R CMOS sensor: just ident 46000 */
251 V4L2_IDENT_HV7131R = 46000,
240 252
241 /* module cs53132a: just ident 53132 */ 253 /* module cs53132a: just ident 53132 */
242 V4L2_IDENT_CS53l32A = 53132, 254 V4L2_IDENT_CS53l32A = 53132,
diff --git a/include/net/rose.h b/include/net/rose.h
index cbd5364b2c8a..5ba9f02731eb 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -156,7 +156,7 @@ extern int sysctl_rose_maximum_vcs;
156extern int sysctl_rose_window_size; 156extern int sysctl_rose_window_size;
157extern int rosecmp(rose_address *, rose_address *); 157extern int rosecmp(rose_address *, rose_address *);
158extern int rosecmpm(rose_address *, rose_address *, unsigned short); 158extern int rosecmpm(rose_address *, rose_address *, unsigned short);
159extern const char *rose2asc(const rose_address *); 159extern char *rose2asc(char *buf, const rose_address *);
160extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); 160extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *);
161extern void rose_kill_by_neigh(struct rose_neigh *); 161extern void rose_kill_by_neigh(struct rose_neigh *);
162extern unsigned int rose_new_lci(struct rose_neigh *); 162extern unsigned int rose_new_lci(struct rose_neigh *);
diff --git a/include/net/sock.h b/include/net/sock.h
index 2c0da9239b95..950409dcec3d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -104,15 +104,15 @@ struct net;
104 104
105/** 105/**
106 * struct sock_common - minimal network layer representation of sockets 106 * struct sock_common - minimal network layer representation of sockets
107 * @skc_node: main hash linkage for various protocol lookup tables
108 * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol
109 * @skc_refcnt: reference count
110 * @skc_hash: hash value used with various protocol lookup tables
107 * @skc_family: network address family 111 * @skc_family: network address family
108 * @skc_state: Connection state 112 * @skc_state: Connection state
109 * @skc_reuse: %SO_REUSEADDR setting 113 * @skc_reuse: %SO_REUSEADDR setting
110 * @skc_bound_dev_if: bound device index if != 0 114 * @skc_bound_dev_if: bound device index if != 0
111 * @skc_node: main hash linkage for various protocol lookup tables
112 * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol
113 * @skc_bind_node: bind hash linkage for various protocol lookup tables 115 * @skc_bind_node: bind hash linkage for various protocol lookup tables
114 * @skc_refcnt: reference count
115 * @skc_hash: hash value used with various protocol lookup tables
116 * @skc_prot: protocol handlers inside a network family 116 * @skc_prot: protocol handlers inside a network family
117 * @skc_net: reference to the network namespace of this socket 117 * @skc_net: reference to the network namespace of this socket
118 * 118 *
@@ -120,17 +120,21 @@ struct net;
120 * for struct sock and struct inet_timewait_sock. 120 * for struct sock and struct inet_timewait_sock.
121 */ 121 */
122struct sock_common { 122struct sock_common {
123 unsigned short skc_family; 123 /*
124 volatile unsigned char skc_state; 124 * first fields are not copied in sock_copy()
125 unsigned char skc_reuse; 125 */
126 int skc_bound_dev_if;
127 union { 126 union {
128 struct hlist_node skc_node; 127 struct hlist_node skc_node;
129 struct hlist_nulls_node skc_nulls_node; 128 struct hlist_nulls_node skc_nulls_node;
130 }; 129 };
131 struct hlist_node skc_bind_node;
132 atomic_t skc_refcnt; 130 atomic_t skc_refcnt;
131
133 unsigned int skc_hash; 132 unsigned int skc_hash;
133 unsigned short skc_family;
134 volatile unsigned char skc_state;
135 unsigned char skc_reuse;
136 int skc_bound_dev_if;
137 struct hlist_node skc_bind_node;
134 struct proto *skc_prot; 138 struct proto *skc_prot;
135#ifdef CONFIG_NET_NS 139#ifdef CONFIG_NET_NS
136 struct net *skc_net; 140 struct net *skc_net;
@@ -208,15 +212,17 @@ struct sock {
208 * don't add nothing before this first member (__sk_common) --acme 212 * don't add nothing before this first member (__sk_common) --acme
209 */ 213 */
210 struct sock_common __sk_common; 214 struct sock_common __sk_common;
215#define sk_node __sk_common.skc_node
216#define sk_nulls_node __sk_common.skc_nulls_node
217#define sk_refcnt __sk_common.skc_refcnt
218
219#define sk_copy_start __sk_common.skc_hash
220#define sk_hash __sk_common.skc_hash
211#define sk_family __sk_common.skc_family 221#define sk_family __sk_common.skc_family
212#define sk_state __sk_common.skc_state 222#define sk_state __sk_common.skc_state
213#define sk_reuse __sk_common.skc_reuse 223#define sk_reuse __sk_common.skc_reuse
214#define sk_bound_dev_if __sk_common.skc_bound_dev_if 224#define sk_bound_dev_if __sk_common.skc_bound_dev_if
215#define sk_node __sk_common.skc_node
216#define sk_nulls_node __sk_common.skc_nulls_node
217#define sk_bind_node __sk_common.skc_bind_node 225#define sk_bind_node __sk_common.skc_bind_node
218#define sk_refcnt __sk_common.skc_refcnt
219#define sk_hash __sk_common.skc_hash
220#define sk_prot __sk_common.skc_prot 226#define sk_prot __sk_common.skc_prot
221#define sk_net __sk_common.skc_net 227#define sk_net __sk_common.skc_net
222 kmemcheck_bitfield_begin(flags); 228 kmemcheck_bitfield_begin(flags);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 19f4150f4d4d..88af84306471 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1425,6 +1425,11 @@ struct tcp_request_sock_ops {
1425#ifdef CONFIG_TCP_MD5SIG 1425#ifdef CONFIG_TCP_MD5SIG
1426 struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, 1426 struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk,
1427 struct request_sock *req); 1427 struct request_sock *req);
1428 int (*calc_md5_hash) (char *location,
1429 struct tcp_md5sig_key *md5,
1430 struct sock *sk,
1431 struct request_sock *req,
1432 struct sk_buff *skb);
1428#endif 1433#endif
1429}; 1434};
1430 1435
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index d6b05f42dd44..9a74b468a229 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -1,3 +1,6 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM block
3
1#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_BLOCK_H 5#define _TRACE_BLOCK_H
3 6
@@ -5,9 +8,6 @@
5#include <linux/blkdev.h> 8#include <linux/blkdev.h>
6#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
7 10
8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM block
10
11TRACE_EVENT(block_rq_abort, 11TRACE_EVENT(block_rq_abort,
12 12
13 TP_PROTO(struct request_queue *q, struct request *rq), 13 TP_PROTO(struct request_queue *q, struct request *rq),
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index acf4cc9cd36d..7d8b5bc74185 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -1,9 +1,9 @@
1#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_EXT4_H
3
4#undef TRACE_SYSTEM 1#undef TRACE_SYSTEM
5#define TRACE_SYSTEM ext4 2#define TRACE_SYSTEM ext4
6 3
4#if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_EXT4_H
6
7#include <linux/writeback.h> 7#include <linux/writeback.h>
8#include "../../../fs/ext4/ext4.h" 8#include "../../../fs/ext4/ext4.h"
9#include "../../../fs/ext4/mballoc.h" 9#include "../../../fs/ext4/mballoc.h"
@@ -34,7 +34,8 @@ TRACE_EVENT(ext4_free_inode,
34 34
35 TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu", 35 TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu",
36 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->mode, 36 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->mode,
37 __entry->uid, __entry->gid, __entry->blocks) 37 __entry->uid, __entry->gid,
38 (unsigned long long) __entry->blocks)
38); 39);
39 40
40TRACE_EVENT(ext4_request_inode, 41TRACE_EVENT(ext4_request_inode,
@@ -189,7 +190,7 @@ TRACE_EVENT(ext4_journalled_write_end,
189 __entry->copied) 190 __entry->copied)
190); 191);
191 192
192TRACE_EVENT(ext4_da_writepage, 193TRACE_EVENT(ext4_writepage,
193 TP_PROTO(struct inode *inode, struct page *page), 194 TP_PROTO(struct inode *inode, struct page *page),
194 195
195 TP_ARGS(inode, page), 196 TP_ARGS(inode, page),
@@ -341,49 +342,6 @@ TRACE_EVENT(ext4_da_write_end,
341 __entry->copied) 342 __entry->copied)
342); 343);
343 344
344TRACE_EVENT(ext4_normal_writepage,
345 TP_PROTO(struct inode *inode, struct page *page),
346
347 TP_ARGS(inode, page),
348
349 TP_STRUCT__entry(
350 __field( dev_t, dev )
351 __field( ino_t, ino )
352 __field( pgoff_t, index )
353 ),
354
355 TP_fast_assign(
356 __entry->dev = inode->i_sb->s_dev;
357 __entry->ino = inode->i_ino;
358 __entry->index = page->index;
359 ),
360
361 TP_printk("dev %s ino %lu page_index %lu",
362 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index)
363);
364
365TRACE_EVENT(ext4_journalled_writepage,
366 TP_PROTO(struct inode *inode, struct page *page),
367
368 TP_ARGS(inode, page),
369
370 TP_STRUCT__entry(
371 __field( dev_t, dev )
372 __field( ino_t, ino )
373 __field( pgoff_t, index )
374
375 ),
376
377 TP_fast_assign(
378 __entry->dev = inode->i_sb->s_dev;
379 __entry->ino = inode->i_ino;
380 __entry->index = page->index;
381 ),
382
383 TP_printk("dev %s ino %lu page_index %lu",
384 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index)
385);
386
387TRACE_EVENT(ext4_discard_blocks, 345TRACE_EVENT(ext4_discard_blocks,
388 TP_PROTO(struct super_block *sb, unsigned long long blk, 346 TP_PROTO(struct super_block *sb, unsigned long long blk,
389 unsigned long long count), 347 unsigned long long count),
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index b0c7ede55eb1..1cb0c3aa11e6 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM irq
3
1#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_IRQ_H 5#define _TRACE_IRQ_H
3 6
4#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
5#include <linux/interrupt.h> 8#include <linux/interrupt.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM irq
9
10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } 10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
11#define show_softirq_name(val) \ 11#define show_softirq_name(val) \
12 __print_symbolic(val, \ 12 __print_symbolic(val, \
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index 845b0b4b48fd..10813fa0c8d0 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM jbd2
3
1#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_JBD2_H 5#define _TRACE_JBD2_H
3 6
4#include <linux/jbd2.h> 7#include <linux/jbd2.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM jbd2
9
10TRACE_EVENT(jbd2_checkpoint, 10TRACE_EVENT(jbd2_checkpoint,
11 11
12 TP_PROTO(journal_t *journal, int result), 12 TP_PROTO(journal_t *journal, int result),
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index 9baba50d6512..1493c541f9c4 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM kmem
3
1#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_KMEM_H 5#define _TRACE_KMEM_H
3 6
4#include <linux/types.h> 7#include <linux/types.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM kmem
9
10/* 10/*
11 * The order of these masks is important. Matching masks will be seen 11 * The order of these masks is important. Matching masks will be seen
12 * first and the left over flags will end up showing by themselves. 12 * first and the left over flags will end up showing by themselves.
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h
index 0e956c9dfd7e..bcf1d209a00d 100644
--- a/include/trace/events/lockdep.h
+++ b/include/trace/events/lockdep.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM lockdep
3
1#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_LOCKDEP_H 5#define _TRACE_LOCKDEP_H
3 6
4#include <linux/lockdep.h> 7#include <linux/lockdep.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM lockdep
9
10#ifdef CONFIG_LOCKDEP 10#ifdef CONFIG_LOCKDEP
11 11
12TRACE_EVENT(lock_acquire, 12TRACE_EVENT(lock_acquire,
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 24ab5bcff7b2..8949bb7eb082 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM sched
3
1#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_SCHED_H 5#define _TRACE_SCHED_H
3 6
4#include <linux/sched.h> 7#include <linux/sched.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM sched
9
10/* 10/*
11 * Tracepoint for calling kthread_stop, performed to end a kthread: 11 * Tracepoint for calling kthread_stop, performed to end a kthread:
12 */ 12 */
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 1e8fabb57c06..e499863b9669 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -1,12 +1,12 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM skb
3
1#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_SKB_H 5#define _TRACE_SKB_H
3 6
4#include <linux/skbuff.h> 7#include <linux/skbuff.h>
5#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
6 9
7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM skb
9
10/* 10/*
11 * Tracepoint for free an sk_buff: 11 * Tracepoint for free an sk_buff:
12 */ 12 */
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index 035f1bff288e..fcfd9a1e4b96 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -1,3 +1,6 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM workqueue
3
1#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_WORKQUEUE_H 5#define _TRACE_WORKQUEUE_H
3 6
@@ -5,9 +8,6 @@
5#include <linux/sched.h> 8#include <linux/sched.h>
6#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
7 10
8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM workqueue
10
11TRACE_EVENT(workqueue_insertion, 11TRACE_EVENT(workqueue_insertion,
12 12
13 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), 13 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
diff --git a/init/Kconfig b/init/Kconfig
index 1ce05a4cb5f6..cb2c09270226 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -962,7 +962,7 @@ config PERF_COUNTERS
962 962
963config EVENT_PROFILE 963config EVENT_PROFILE
964 bool "Tracepoint profile sources" 964 bool "Tracepoint profile sources"
965 depends on PERF_COUNTERS && EVENT_TRACER 965 depends on PERF_COUNTERS && EVENT_TRACING
966 default y 966 default y
967 967
968endmenu 968endmenu
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3737a682cdf5..b6eadfe30e7b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -47,6 +47,7 @@
47#include <linux/hash.h> 47#include <linux/hash.h>
48#include <linux/namei.h> 48#include <linux/namei.h>
49#include <linux/smp_lock.h> 49#include <linux/smp_lock.h>
50#include <linux/pid_namespace.h>
50 51
51#include <asm/atomic.h> 52#include <asm/atomic.h>
52 53
@@ -734,16 +735,28 @@ static void cgroup_d_remove_dir(struct dentry *dentry)
734 * reference to css->refcnt. In general, this refcnt is expected to goes down 735 * reference to css->refcnt. In general, this refcnt is expected to goes down
735 * to zero, soon. 736 * to zero, soon.
736 * 737 *
737 * CGRP_WAIT_ON_RMDIR flag is modified under cgroup's inode->i_mutex; 738 * CGRP_WAIT_ON_RMDIR flag is set under cgroup's inode->i_mutex;
738 */ 739 */
739DECLARE_WAIT_QUEUE_HEAD(cgroup_rmdir_waitq); 740DECLARE_WAIT_QUEUE_HEAD(cgroup_rmdir_waitq);
740 741
741static void cgroup_wakeup_rmdir_waiters(const struct cgroup *cgrp) 742static void cgroup_wakeup_rmdir_waiter(struct cgroup *cgrp)
742{ 743{
743 if (unlikely(test_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags))) 744 if (unlikely(test_and_clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags)))
744 wake_up_all(&cgroup_rmdir_waitq); 745 wake_up_all(&cgroup_rmdir_waitq);
745} 746}
746 747
748void cgroup_exclude_rmdir(struct cgroup_subsys_state *css)
749{
750 css_get(css);
751}
752
753void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css)
754{
755 cgroup_wakeup_rmdir_waiter(css->cgroup);
756 css_put(css);
757}
758
759
747static int rebind_subsystems(struct cgroupfs_root *root, 760static int rebind_subsystems(struct cgroupfs_root *root,
748 unsigned long final_bits) 761 unsigned long final_bits)
749{ 762{
@@ -960,6 +973,7 @@ static void init_cgroup_housekeeping(struct cgroup *cgrp)
960 INIT_LIST_HEAD(&cgrp->children); 973 INIT_LIST_HEAD(&cgrp->children);
961 INIT_LIST_HEAD(&cgrp->css_sets); 974 INIT_LIST_HEAD(&cgrp->css_sets);
962 INIT_LIST_HEAD(&cgrp->release_list); 975 INIT_LIST_HEAD(&cgrp->release_list);
976 INIT_LIST_HEAD(&cgrp->pids_list);
963 init_rwsem(&cgrp->pids_mutex); 977 init_rwsem(&cgrp->pids_mutex);
964} 978}
965static void init_cgroup_root(struct cgroupfs_root *root) 979static void init_cgroup_root(struct cgroupfs_root *root)
@@ -1357,7 +1371,7 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
1357 * wake up rmdir() waiter. the rmdir should fail since the cgroup 1371 * wake up rmdir() waiter. the rmdir should fail since the cgroup
1358 * is no longer empty. 1372 * is no longer empty.
1359 */ 1373 */
1360 cgroup_wakeup_rmdir_waiters(cgrp); 1374 cgroup_wakeup_rmdir_waiter(cgrp);
1361 return 0; 1375 return 0;
1362} 1376}
1363 1377
@@ -2201,12 +2215,30 @@ err:
2201 return ret; 2215 return ret;
2202} 2216}
2203 2217
2218/*
2219 * Cache pids for all threads in the same pid namespace that are
2220 * opening the same "tasks" file.
2221 */
2222struct cgroup_pids {
2223 /* The node in cgrp->pids_list */
2224 struct list_head list;
2225 /* The cgroup those pids belong to */
2226 struct cgroup *cgrp;
2227 /* The namepsace those pids belong to */
2228 struct pid_namespace *ns;
2229 /* Array of process ids in the cgroup */
2230 pid_t *tasks_pids;
2231 /* How many files are using the this tasks_pids array */
2232 int use_count;
2233 /* Length of the current tasks_pids array */
2234 int length;
2235};
2236
2204static int cmppid(const void *a, const void *b) 2237static int cmppid(const void *a, const void *b)
2205{ 2238{
2206 return *(pid_t *)a - *(pid_t *)b; 2239 return *(pid_t *)a - *(pid_t *)b;
2207} 2240}
2208 2241
2209
2210/* 2242/*
2211 * seq_file methods for the "tasks" file. The seq_file position is the 2243 * seq_file methods for the "tasks" file. The seq_file position is the
2212 * next pid to display; the seq_file iterator is a pointer to the pid 2244 * next pid to display; the seq_file iterator is a pointer to the pid
@@ -2221,45 +2253,47 @@ static void *cgroup_tasks_start(struct seq_file *s, loff_t *pos)
2221 * after a seek to the start). Use a binary-search to find the 2253 * after a seek to the start). Use a binary-search to find the
2222 * next pid to display, if any 2254 * next pid to display, if any
2223 */ 2255 */
2224 struct cgroup *cgrp = s->private; 2256 struct cgroup_pids *cp = s->private;
2257 struct cgroup *cgrp = cp->cgrp;
2225 int index = 0, pid = *pos; 2258 int index = 0, pid = *pos;
2226 int *iter; 2259 int *iter;
2227 2260
2228 down_read(&cgrp->pids_mutex); 2261 down_read(&cgrp->pids_mutex);
2229 if (pid) { 2262 if (pid) {
2230 int end = cgrp->pids_length; 2263 int end = cp->length;
2231 2264
2232 while (index < end) { 2265 while (index < end) {
2233 int mid = (index + end) / 2; 2266 int mid = (index + end) / 2;
2234 if (cgrp->tasks_pids[mid] == pid) { 2267 if (cp->tasks_pids[mid] == pid) {
2235 index = mid; 2268 index = mid;
2236 break; 2269 break;
2237 } else if (cgrp->tasks_pids[mid] <= pid) 2270 } else if (cp->tasks_pids[mid] <= pid)
2238 index = mid + 1; 2271 index = mid + 1;
2239 else 2272 else
2240 end = mid; 2273 end = mid;
2241 } 2274 }
2242 } 2275 }
2243 /* If we're off the end of the array, we're done */ 2276 /* If we're off the end of the array, we're done */
2244 if (index >= cgrp->pids_length) 2277 if (index >= cp->length)
2245 return NULL; 2278 return NULL;
2246 /* Update the abstract position to be the actual pid that we found */ 2279 /* Update the abstract position to be the actual pid that we found */
2247 iter = cgrp->tasks_pids + index; 2280 iter = cp->tasks_pids + index;
2248 *pos = *iter; 2281 *pos = *iter;
2249 return iter; 2282 return iter;
2250} 2283}
2251 2284
2252static void cgroup_tasks_stop(struct seq_file *s, void *v) 2285static void cgroup_tasks_stop(struct seq_file *s, void *v)
2253{ 2286{
2254 struct cgroup *cgrp = s->private; 2287 struct cgroup_pids *cp = s->private;
2288 struct cgroup *cgrp = cp->cgrp;
2255 up_read(&cgrp->pids_mutex); 2289 up_read(&cgrp->pids_mutex);
2256} 2290}
2257 2291
2258static void *cgroup_tasks_next(struct seq_file *s, void *v, loff_t *pos) 2292static void *cgroup_tasks_next(struct seq_file *s, void *v, loff_t *pos)
2259{ 2293{
2260 struct cgroup *cgrp = s->private; 2294 struct cgroup_pids *cp = s->private;
2261 int *p = v; 2295 int *p = v;
2262 int *end = cgrp->tasks_pids + cgrp->pids_length; 2296 int *end = cp->tasks_pids + cp->length;
2263 2297
2264 /* 2298 /*
2265 * Advance to the next pid in the array. If this goes off the 2299 * Advance to the next pid in the array. If this goes off the
@@ -2286,26 +2320,33 @@ static struct seq_operations cgroup_tasks_seq_operations = {
2286 .show = cgroup_tasks_show, 2320 .show = cgroup_tasks_show,
2287}; 2321};
2288 2322
2289static void release_cgroup_pid_array(struct cgroup *cgrp) 2323static void release_cgroup_pid_array(struct cgroup_pids *cp)
2290{ 2324{
2325 struct cgroup *cgrp = cp->cgrp;
2326
2291 down_write(&cgrp->pids_mutex); 2327 down_write(&cgrp->pids_mutex);
2292 BUG_ON(!cgrp->pids_use_count); 2328 BUG_ON(!cp->use_count);
2293 if (!--cgrp->pids_use_count) { 2329 if (!--cp->use_count) {
2294 kfree(cgrp->tasks_pids); 2330 list_del(&cp->list);
2295 cgrp->tasks_pids = NULL; 2331 put_pid_ns(cp->ns);
2296 cgrp->pids_length = 0; 2332 kfree(cp->tasks_pids);
2333 kfree(cp);
2297 } 2334 }
2298 up_write(&cgrp->pids_mutex); 2335 up_write(&cgrp->pids_mutex);
2299} 2336}
2300 2337
2301static int cgroup_tasks_release(struct inode *inode, struct file *file) 2338static int cgroup_tasks_release(struct inode *inode, struct file *file)
2302{ 2339{
2303 struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent); 2340 struct seq_file *seq;
2341 struct cgroup_pids *cp;
2304 2342
2305 if (!(file->f_mode & FMODE_READ)) 2343 if (!(file->f_mode & FMODE_READ))
2306 return 0; 2344 return 0;
2307 2345
2308 release_cgroup_pid_array(cgrp); 2346 seq = file->private_data;
2347 cp = seq->private;
2348
2349 release_cgroup_pid_array(cp);
2309 return seq_release(inode, file); 2350 return seq_release(inode, file);
2310} 2351}
2311 2352
@@ -2324,6 +2365,8 @@ static struct file_operations cgroup_tasks_operations = {
2324static int cgroup_tasks_open(struct inode *unused, struct file *file) 2365static int cgroup_tasks_open(struct inode *unused, struct file *file)
2325{ 2366{
2326 struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent); 2367 struct cgroup *cgrp = __d_cgrp(file->f_dentry->d_parent);
2368 struct pid_namespace *ns = current->nsproxy->pid_ns;
2369 struct cgroup_pids *cp;
2327 pid_t *pidarray; 2370 pid_t *pidarray;
2328 int npids; 2371 int npids;
2329 int retval; 2372 int retval;
@@ -2350,20 +2393,37 @@ static int cgroup_tasks_open(struct inode *unused, struct file *file)
2350 * array if necessary 2393 * array if necessary
2351 */ 2394 */
2352 down_write(&cgrp->pids_mutex); 2395 down_write(&cgrp->pids_mutex);
2353 kfree(cgrp->tasks_pids); 2396
2354 cgrp->tasks_pids = pidarray; 2397 list_for_each_entry(cp, &cgrp->pids_list, list) {
2355 cgrp->pids_length = npids; 2398 if (ns == cp->ns)
2356 cgrp->pids_use_count++; 2399 goto found;
2400 }
2401
2402 cp = kzalloc(sizeof(*cp), GFP_KERNEL);
2403 if (!cp) {
2404 up_write(&cgrp->pids_mutex);
2405 kfree(pidarray);
2406 return -ENOMEM;
2407 }
2408 cp->cgrp = cgrp;
2409 cp->ns = ns;
2410 get_pid_ns(ns);
2411 list_add(&cp->list, &cgrp->pids_list);
2412found:
2413 kfree(cp->tasks_pids);
2414 cp->tasks_pids = pidarray;
2415 cp->length = npids;
2416 cp->use_count++;
2357 up_write(&cgrp->pids_mutex); 2417 up_write(&cgrp->pids_mutex);
2358 2418
2359 file->f_op = &cgroup_tasks_operations; 2419 file->f_op = &cgroup_tasks_operations;
2360 2420
2361 retval = seq_open(file, &cgroup_tasks_seq_operations); 2421 retval = seq_open(file, &cgroup_tasks_seq_operations);
2362 if (retval) { 2422 if (retval) {
2363 release_cgroup_pid_array(cgrp); 2423 release_cgroup_pid_array(cp);
2364 return retval; 2424 return retval;
2365 } 2425 }
2366 ((struct seq_file *)file->private_data)->private = cgrp; 2426 ((struct seq_file *)file->private_data)->private = cp;
2367 return 0; 2427 return 0;
2368} 2428}
2369 2429
@@ -2696,33 +2756,42 @@ again:
2696 mutex_unlock(&cgroup_mutex); 2756 mutex_unlock(&cgroup_mutex);
2697 2757
2698 /* 2758 /*
2759 * In general, subsystem has no css->refcnt after pre_destroy(). But
2760 * in racy cases, subsystem may have to get css->refcnt after
2761 * pre_destroy() and it makes rmdir return with -EBUSY. This sometimes
2762 * make rmdir return -EBUSY too often. To avoid that, we use waitqueue
2763 * for cgroup's rmdir. CGRP_WAIT_ON_RMDIR is for synchronizing rmdir
2764 * and subsystem's reference count handling. Please see css_get/put
2765 * and css_tryget() and cgroup_wakeup_rmdir_waiter() implementation.
2766 */
2767 set_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2768
2769 /*
2699 * Call pre_destroy handlers of subsys. Notify subsystems 2770 * Call pre_destroy handlers of subsys. Notify subsystems
2700 * that rmdir() request comes. 2771 * that rmdir() request comes.
2701 */ 2772 */
2702 ret = cgroup_call_pre_destroy(cgrp); 2773 ret = cgroup_call_pre_destroy(cgrp);
2703 if (ret) 2774 if (ret) {
2775 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2704 return ret; 2776 return ret;
2777 }
2705 2778
2706 mutex_lock(&cgroup_mutex); 2779 mutex_lock(&cgroup_mutex);
2707 parent = cgrp->parent; 2780 parent = cgrp->parent;
2708 if (atomic_read(&cgrp->count) || !list_empty(&cgrp->children)) { 2781 if (atomic_read(&cgrp->count) || !list_empty(&cgrp->children)) {
2782 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2709 mutex_unlock(&cgroup_mutex); 2783 mutex_unlock(&cgroup_mutex);
2710 return -EBUSY; 2784 return -EBUSY;
2711 } 2785 }
2712 /*
2713 * css_put/get is provided for subsys to grab refcnt to css. In typical
2714 * case, subsystem has no reference after pre_destroy(). But, under
2715 * hierarchy management, some *temporal* refcnt can be hold.
2716 * To avoid returning -EBUSY to a user, waitqueue is used. If subsys
2717 * is really busy, it should return -EBUSY at pre_destroy(). wake_up
2718 * is called when css_put() is called and refcnt goes down to 0.
2719 */
2720 set_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2721 prepare_to_wait(&cgroup_rmdir_waitq, &wait, TASK_INTERRUPTIBLE); 2786 prepare_to_wait(&cgroup_rmdir_waitq, &wait, TASK_INTERRUPTIBLE);
2722
2723 if (!cgroup_clear_css_refs(cgrp)) { 2787 if (!cgroup_clear_css_refs(cgrp)) {
2724 mutex_unlock(&cgroup_mutex); 2788 mutex_unlock(&cgroup_mutex);
2725 schedule(); 2789 /*
2790 * Because someone may call cgroup_wakeup_rmdir_waiter() before
2791 * prepare_to_wait(), we need to check this flag.
2792 */
2793 if (test_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags))
2794 schedule();
2726 finish_wait(&cgroup_rmdir_waitq, &wait); 2795 finish_wait(&cgroup_rmdir_waitq, &wait);
2727 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags); 2796 clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags);
2728 if (signal_pending(current)) 2797 if (signal_pending(current))
@@ -3294,7 +3363,7 @@ void __css_put(struct cgroup_subsys_state *css)
3294 set_bit(CGRP_RELEASABLE, &cgrp->flags); 3363 set_bit(CGRP_RELEASABLE, &cgrp->flags);
3295 check_for_release(cgrp); 3364 check_for_release(cgrp);
3296 } 3365 }
3297 cgroup_wakeup_rmdir_waiters(cgrp); 3366 cgroup_wakeup_rmdir_waiter(cgrp);
3298 } 3367 }
3299 rcu_read_unlock(); 3368 rcu_read_unlock();
3300} 3369}
diff --git a/kernel/fork.c b/kernel/fork.c
index bd2959228871..29b532e718f7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -426,6 +426,7 @@ static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
426 init_rwsem(&mm->mmap_sem); 426 init_rwsem(&mm->mmap_sem);
427 INIT_LIST_HEAD(&mm->mmlist); 427 INIT_LIST_HEAD(&mm->mmlist);
428 mm->flags = (current->mm) ? current->mm->flags : default_dump_filter; 428 mm->flags = (current->mm) ? current->mm->flags : default_dump_filter;
429 mm->oom_adj = (current->mm) ? current->mm->oom_adj : 0;
429 mm->core_state = NULL; 430 mm->core_state = NULL;
430 mm->nr_ptes = 0; 431 mm->nr_ptes = 0;
431 set_mm_counter(mm, file_rss, 0); 432 set_mm_counter(mm, file_rss, 0);
@@ -1407,14 +1408,11 @@ long do_fork(unsigned long clone_flags,
1407 if (clone_flags & CLONE_VFORK) { 1408 if (clone_flags & CLONE_VFORK) {
1408 p->vfork_done = &vfork; 1409 p->vfork_done = &vfork;
1409 init_completion(&vfork); 1410 init_completion(&vfork);
1410 } else if (!(clone_flags & CLONE_VM)) {
1411 /*
1412 * vfork will do an exec which will call
1413 * set_task_comm()
1414 */
1415 perf_counter_fork(p);
1416 } 1411 }
1417 1412
1413 if (!(clone_flags & CLONE_THREAD))
1414 perf_counter_fork(p);
1415
1418 audit_finish_fork(p); 1416 audit_finish_fork(p);
1419 tracehook_report_clone(regs, clone_flags, nr, p); 1417 tracehook_report_clone(regs, clone_flags, nr, p);
1420 1418
diff --git a/kernel/freezer.c b/kernel/freezer.c
index 2f4936cf7083..bd1d42b17cb2 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -44,12 +44,19 @@ void refrigerator(void)
44 recalc_sigpending(); /* We sent fake signal, clean it up */ 44 recalc_sigpending(); /* We sent fake signal, clean it up */
45 spin_unlock_irq(&current->sighand->siglock); 45 spin_unlock_irq(&current->sighand->siglock);
46 46
47 /* prevent accounting of that task to load */
48 current->flags |= PF_FREEZING;
49
47 for (;;) { 50 for (;;) {
48 set_current_state(TASK_UNINTERRUPTIBLE); 51 set_current_state(TASK_UNINTERRUPTIBLE);
49 if (!frozen(current)) 52 if (!frozen(current))
50 break; 53 break;
51 schedule(); 54 schedule();
52 } 55 }
56
57 /* Remove the accounting blocker */
58 current->flags &= ~PF_FREEZING;
59
53 pr_debug("%s left refrigerator\n", current->comm); 60 pr_debug("%s left refrigerator\n", current->comm);
54 __set_current_state(save); 61 __set_current_state(save);
55} 62}
diff --git a/kernel/futex.c b/kernel/futex.c
index 794c862125fe..0672ff88f159 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -247,6 +247,7 @@ again:
247 if (err < 0) 247 if (err < 0)
248 return err; 248 return err;
249 249
250 page = compound_head(page);
250 lock_page(page); 251 lock_page(page);
251 if (!page->mapping) { 252 if (!page->mapping) {
252 unlock_page(page); 253 unlock_page(page);
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 9002958a96e7..49da79ab8486 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -191,6 +191,46 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
191 } 191 }
192} 192}
193 193
194
195/*
196 * Get the preferred target CPU for NOHZ
197 */
198static int hrtimer_get_target(int this_cpu, int pinned)
199{
200#ifdef CONFIG_NO_HZ
201 if (!pinned && get_sysctl_timer_migration() && idle_cpu(this_cpu)) {
202 int preferred_cpu = get_nohz_load_balancer();
203
204 if (preferred_cpu >= 0)
205 return preferred_cpu;
206 }
207#endif
208 return this_cpu;
209}
210
211/*
212 * With HIGHRES=y we do not migrate the timer when it is expiring
213 * before the next event on the target cpu because we cannot reprogram
214 * the target cpu hardware and we would cause it to fire late.
215 *
216 * Called with cpu_base->lock of target cpu held.
217 */
218static int
219hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base)
220{
221#ifdef CONFIG_HIGH_RES_TIMERS
222 ktime_t expires;
223
224 if (!new_base->cpu_base->hres_active)
225 return 0;
226
227 expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset);
228 return expires.tv64 <= new_base->cpu_base->expires_next.tv64;
229#else
230 return 0;
231#endif
232}
233
194/* 234/*
195 * Switch the timer base to the current CPU when possible. 235 * Switch the timer base to the current CPU when possible.
196 */ 236 */
@@ -200,16 +240,8 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base,
200{ 240{
201 struct hrtimer_clock_base *new_base; 241 struct hrtimer_clock_base *new_base;
202 struct hrtimer_cpu_base *new_cpu_base; 242 struct hrtimer_cpu_base *new_cpu_base;
203 int cpu, preferred_cpu = -1; 243 int this_cpu = smp_processor_id();
204 244 int cpu = hrtimer_get_target(this_cpu, pinned);
205 cpu = smp_processor_id();
206#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
207 if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) {
208 preferred_cpu = get_nohz_load_balancer();
209 if (preferred_cpu >= 0)
210 cpu = preferred_cpu;
211 }
212#endif
213 245
214again: 246again:
215 new_cpu_base = &per_cpu(hrtimer_bases, cpu); 247 new_cpu_base = &per_cpu(hrtimer_bases, cpu);
@@ -217,7 +249,7 @@ again:
217 249
218 if (base != new_base) { 250 if (base != new_base) {
219 /* 251 /*
220 * We are trying to schedule the timer on the local CPU. 252 * We are trying to move timer to new_base.
221 * However we can't change timer's base while it is running, 253 * However we can't change timer's base while it is running,
222 * so we keep it on the same CPU. No hassle vs. reprogramming 254 * so we keep it on the same CPU. No hassle vs. reprogramming
223 * the event source in the high resolution case. The softirq 255 * the event source in the high resolution case. The softirq
@@ -233,38 +265,12 @@ again:
233 spin_unlock(&base->cpu_base->lock); 265 spin_unlock(&base->cpu_base->lock);
234 spin_lock(&new_base->cpu_base->lock); 266 spin_lock(&new_base->cpu_base->lock);
235 267
236 /* Optimized away for NOHZ=n SMP=n */ 268 if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
237 if (cpu == preferred_cpu) { 269 cpu = this_cpu;
238 /* Calculate clock monotonic expiry time */ 270 spin_unlock(&new_base->cpu_base->lock);
239#ifdef CONFIG_HIGH_RES_TIMERS 271 spin_lock(&base->cpu_base->lock);
240 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), 272 timer->base = base;
241 new_base->offset); 273 goto again;
242#else
243 ktime_t expires = hrtimer_get_expires(timer);
244#endif
245
246 /*
247 * Get the next event on target cpu from the
248 * clock events layer.
249 * This covers the highres=off nohz=on case as well.
250 */
251 ktime_t next = clockevents_get_next_event(cpu);
252
253 ktime_t delta = ktime_sub(expires, next);
254
255 /*
256 * We do not migrate the timer when it is expiring
257 * before the next event on the target cpu because
258 * we cannot reprogram the target cpu hardware and
259 * we would cause it to fire late.
260 */
261 if (delta.tv64 < 0) {
262 cpu = smp_processor_id();
263 spin_unlock(&new_base->cpu_base->lock);
264 spin_lock(&base->cpu_base->lock);
265 timer->base = base;
266 goto again;
267 }
268 } 274 }
269 timer->base = new_base; 275 timer->base = new_base;
270 } 276 }
@@ -1276,14 +1282,22 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1276 1282
1277 expires_next.tv64 = KTIME_MAX; 1283 expires_next.tv64 = KTIME_MAX;
1278 1284
1285 spin_lock(&cpu_base->lock);
1286 /*
1287 * We set expires_next to KTIME_MAX here with cpu_base->lock
1288 * held to prevent that a timer is enqueued in our queue via
1289 * the migration code. This does not affect enqueueing of
1290 * timers which run their callback and need to be requeued on
1291 * this CPU.
1292 */
1293 cpu_base->expires_next.tv64 = KTIME_MAX;
1294
1279 base = cpu_base->clock_base; 1295 base = cpu_base->clock_base;
1280 1296
1281 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { 1297 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
1282 ktime_t basenow; 1298 ktime_t basenow;
1283 struct rb_node *node; 1299 struct rb_node *node;
1284 1300
1285 spin_lock(&cpu_base->lock);
1286
1287 basenow = ktime_add(now, base->offset); 1301 basenow = ktime_add(now, base->offset);
1288 1302
1289 while ((node = base->first)) { 1303 while ((node = base->first)) {
@@ -1316,11 +1330,15 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1316 1330
1317 __run_hrtimer(timer); 1331 __run_hrtimer(timer);
1318 } 1332 }
1319 spin_unlock(&cpu_base->lock);
1320 base++; 1333 base++;
1321 } 1334 }
1322 1335
1336 /*
1337 * Store the new expiry value so the migration code can verify
1338 * against it.
1339 */
1323 cpu_base->expires_next = expires_next; 1340 cpu_base->expires_next = expires_next;
1341 spin_unlock(&cpu_base->lock);
1324 1342
1325 /* Reprogramming necessary ? */ 1343 /* Reprogramming necessary ? */
1326 if (expires_next.tv64 != KTIME_MAX) { 1344 if (expires_next.tv64 != KTIME_MAX) {
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index 73468253143b..e70ed5592eb9 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -42,8 +42,7 @@ static inline void unregister_handler_proc(unsigned int irq,
42 42
43extern int irq_select_affinity_usr(unsigned int irq); 43extern int irq_select_affinity_usr(unsigned int irq);
44 44
45extern void 45extern void irq_set_thread_affinity(struct irq_desc *desc);
46irq_set_thread_affinity(struct irq_desc *desc, const struct cpumask *cpumask);
47 46
48/* 47/*
49 * Debugging printout: 48 * Debugging printout:
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 50da67672901..61c679db4687 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -80,14 +80,22 @@ int irq_can_set_affinity(unsigned int irq)
80 return 1; 80 return 1;
81} 81}
82 82
83void 83/**
84irq_set_thread_affinity(struct irq_desc *desc, const struct cpumask *cpumask) 84 * irq_set_thread_affinity - Notify irq threads to adjust affinity
85 * @desc: irq descriptor which has affitnity changed
86 *
87 * We just set IRQTF_AFFINITY and delegate the affinity setting
88 * to the interrupt thread itself. We can not call
89 * set_cpus_allowed_ptr() here as we hold desc->lock and this
90 * code can be called from hard interrupt context.
91 */
92void irq_set_thread_affinity(struct irq_desc *desc)
85{ 93{
86 struct irqaction *action = desc->action; 94 struct irqaction *action = desc->action;
87 95
88 while (action) { 96 while (action) {
89 if (action->thread) 97 if (action->thread)
90 set_cpus_allowed_ptr(action->thread, cpumask); 98 set_bit(IRQTF_AFFINITY, &action->thread_flags);
91 action = action->next; 99 action = action->next;
92 } 100 }
93} 101}
@@ -112,7 +120,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
112 if (desc->status & IRQ_MOVE_PCNTXT) { 120 if (desc->status & IRQ_MOVE_PCNTXT) {
113 if (!desc->chip->set_affinity(irq, cpumask)) { 121 if (!desc->chip->set_affinity(irq, cpumask)) {
114 cpumask_copy(desc->affinity, cpumask); 122 cpumask_copy(desc->affinity, cpumask);
115 irq_set_thread_affinity(desc, cpumask); 123 irq_set_thread_affinity(desc);
116 } 124 }
117 } 125 }
118 else { 126 else {
@@ -122,7 +130,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
122#else 130#else
123 if (!desc->chip->set_affinity(irq, cpumask)) { 131 if (!desc->chip->set_affinity(irq, cpumask)) {
124 cpumask_copy(desc->affinity, cpumask); 132 cpumask_copy(desc->affinity, cpumask);
125 irq_set_thread_affinity(desc, cpumask); 133 irq_set_thread_affinity(desc);
126 } 134 }
127#endif 135#endif
128 desc->status |= IRQ_AFFINITY_SET; 136 desc->status |= IRQ_AFFINITY_SET;
@@ -176,7 +184,7 @@ int irq_select_affinity_usr(unsigned int irq)
176 spin_lock_irqsave(&desc->lock, flags); 184 spin_lock_irqsave(&desc->lock, flags);
177 ret = setup_affinity(irq, desc); 185 ret = setup_affinity(irq, desc);
178 if (!ret) 186 if (!ret)
179 irq_set_thread_affinity(desc, desc->affinity); 187 irq_set_thread_affinity(desc);
180 spin_unlock_irqrestore(&desc->lock, flags); 188 spin_unlock_irqrestore(&desc->lock, flags);
181 189
182 return ret; 190 return ret;
@@ -443,6 +451,39 @@ static int irq_wait_for_interrupt(struct irqaction *action)
443 return -1; 451 return -1;
444} 452}
445 453
454#ifdef CONFIG_SMP
455/*
456 * Check whether we need to change the affinity of the interrupt thread.
457 */
458static void
459irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
460{
461 cpumask_var_t mask;
462
463 if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags))
464 return;
465
466 /*
467 * In case we are out of memory we set IRQTF_AFFINITY again and
468 * try again next time
469 */
470 if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
471 set_bit(IRQTF_AFFINITY, &action->thread_flags);
472 return;
473 }
474
475 spin_lock_irq(&desc->lock);
476 cpumask_copy(mask, desc->affinity);
477 spin_unlock_irq(&desc->lock);
478
479 set_cpus_allowed_ptr(current, mask);
480 free_cpumask_var(mask);
481}
482#else
483static inline void
484irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) { }
485#endif
486
446/* 487/*
447 * Interrupt handler thread 488 * Interrupt handler thread
448 */ 489 */
@@ -458,6 +499,8 @@ static int irq_thread(void *data)
458 499
459 while (!irq_wait_for_interrupt(action)) { 500 while (!irq_wait_for_interrupt(action)) {
460 501
502 irq_thread_check_affinity(desc, action);
503
461 atomic_inc(&desc->threads_active); 504 atomic_inc(&desc->threads_active);
462 505
463 spin_lock_irq(&desc->lock); 506 spin_lock_irq(&desc->lock);
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index cfe767ca1545..fcb6c96f2627 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -45,7 +45,7 @@ void move_masked_irq(int irq)
45 < nr_cpu_ids)) 45 < nr_cpu_ids))
46 if (!desc->chip->set_affinity(irq, desc->pending_mask)) { 46 if (!desc->chip->set_affinity(irq, desc->pending_mask)) {
47 cpumask_copy(desc->affinity, desc->pending_mask); 47 cpumask_copy(desc->affinity, desc->pending_mask);
48 irq_set_thread_affinity(desc, desc->pending_mask); 48 irq_set_thread_affinity(desc);
49 } 49 }
50 50
51 cpumask_clear(desc->pending_mask); 51 cpumask_clear(desc->pending_mask);
diff --git a/kernel/kexec.c b/kernel/kexec.c
index ae1c35201cc8..f336e2107f98 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1228,7 +1228,7 @@ static int __init parse_crashkernel_mem(char *cmdline,
1228 } while (*cur++ == ','); 1228 } while (*cur++ == ',');
1229 1229
1230 if (*crash_size > 0) { 1230 if (*crash_size > 0) {
1231 while (*cur != ' ' && *cur != '@') 1231 while (*cur && *cur != ' ' && *cur != '@')
1232 cur++; 1232 cur++;
1233 if (*cur == '@') { 1233 if (*cur == '@') {
1234 cur++; 1234 cur++;
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 16b5739c516a..0540948e29ab 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -694,7 +694,7 @@ int __kprobes register_kprobe(struct kprobe *p)
694 p->addr = addr; 694 p->addr = addr;
695 695
696 preempt_disable(); 696 preempt_disable();
697 if (!__kernel_text_address((unsigned long) p->addr) || 697 if (!kernel_text_address((unsigned long) p->addr) ||
698 in_kprobes_functions((unsigned long) p->addr)) { 698 in_kprobes_functions((unsigned long) p->addr)) {
699 preempt_enable(); 699 preempt_enable();
700 return -EINVAL; 700 return -EINVAL;
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 9b1a7de26979..eb8751aa0418 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -180,10 +180,12 @@ EXPORT_SYMBOL(kthread_bind);
180 * @k: thread created by kthread_create(). 180 * @k: thread created by kthread_create().
181 * 181 *
182 * Sets kthread_should_stop() for @k to return true, wakes it, and 182 * Sets kthread_should_stop() for @k to return true, wakes it, and
183 * waits for it to exit. Your threadfn() must not call do_exit() 183 * waits for it to exit. This can also be called after kthread_create()
184 * itself if you use this function! This can also be called after 184 * instead of calling wake_up_process(): the thread will exit without
185 * kthread_create() instead of calling wake_up_process(): the thread 185 * calling threadfn().
186 * will exit without calling threadfn(). 186 *
187 * If threadfn() may call do_exit() itself, the caller must ensure
188 * task_struct can't go away.
187 * 189 *
188 * Returns the result of threadfn(), or %-EINTR if wake_up_process() 190 * Returns the result of threadfn(), or %-EINTR if wake_up_process()
189 * was never called. 191 * was never called.
diff --git a/kernel/module.c b/kernel/module.c
index 0a049837008e..fd1411403558 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1068,7 +1068,8 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs,
1068{ 1068{
1069 const unsigned long *crc; 1069 const unsigned long *crc;
1070 1070
1071 if (!find_symbol("module_layout", NULL, &crc, true, false)) 1071 if (!find_symbol(MODULE_SYMBOL_PREFIX "module_layout", NULL,
1072 &crc, true, false))
1072 BUG(); 1073 BUG();
1073 return check_version(sechdrs, versindex, "module_layout", mod, crc); 1074 return check_version(sechdrs, versindex, "module_layout", mod, crc);
1074} 1075}
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index a641eb753b8c..950931041954 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -146,6 +146,28 @@ static void put_ctx(struct perf_counter_context *ctx)
146 } 146 }
147} 147}
148 148
149static void unclone_ctx(struct perf_counter_context *ctx)
150{
151 if (ctx->parent_ctx) {
152 put_ctx(ctx->parent_ctx);
153 ctx->parent_ctx = NULL;
154 }
155}
156
157/*
158 * If we inherit counters we want to return the parent counter id
159 * to userspace.
160 */
161static u64 primary_counter_id(struct perf_counter *counter)
162{
163 u64 id = counter->id;
164
165 if (counter->parent)
166 id = counter->parent->id;
167
168 return id;
169}
170
149/* 171/*
150 * Get the perf_counter_context for a task and lock it. 172 * Get the perf_counter_context for a task and lock it.
151 * This has to cope with with the fact that until it is locked, 173 * This has to cope with with the fact that until it is locked,
@@ -1288,7 +1310,6 @@ static void perf_counter_cpu_sched_in(struct perf_cpu_context *cpuctx, int cpu)
1288#define MAX_INTERRUPTS (~0ULL) 1310#define MAX_INTERRUPTS (~0ULL)
1289 1311
1290static void perf_log_throttle(struct perf_counter *counter, int enable); 1312static void perf_log_throttle(struct perf_counter *counter, int enable);
1291static void perf_log_period(struct perf_counter *counter, u64 period);
1292 1313
1293static void perf_adjust_period(struct perf_counter *counter, u64 events) 1314static void perf_adjust_period(struct perf_counter *counter, u64 events)
1294{ 1315{
@@ -1307,8 +1328,6 @@ static void perf_adjust_period(struct perf_counter *counter, u64 events)
1307 if (!sample_period) 1328 if (!sample_period)
1308 sample_period = 1; 1329 sample_period = 1;
1309 1330
1310 perf_log_period(counter, sample_period);
1311
1312 hwc->sample_period = sample_period; 1331 hwc->sample_period = sample_period;
1313} 1332}
1314 1333
@@ -1463,10 +1482,8 @@ static void perf_counter_enable_on_exec(struct task_struct *task)
1463 /* 1482 /*
1464 * Unclone this context if we enabled any counter. 1483 * Unclone this context if we enabled any counter.
1465 */ 1484 */
1466 if (enabled && ctx->parent_ctx) { 1485 if (enabled)
1467 put_ctx(ctx->parent_ctx); 1486 unclone_ctx(ctx);
1468 ctx->parent_ctx = NULL;
1469 }
1470 1487
1471 spin_unlock(&ctx->lock); 1488 spin_unlock(&ctx->lock);
1472 1489
@@ -1526,7 +1543,6 @@ __perf_counter_init_context(struct perf_counter_context *ctx,
1526 1543
1527static struct perf_counter_context *find_get_context(pid_t pid, int cpu) 1544static struct perf_counter_context *find_get_context(pid_t pid, int cpu)
1528{ 1545{
1529 struct perf_counter_context *parent_ctx;
1530 struct perf_counter_context *ctx; 1546 struct perf_counter_context *ctx;
1531 struct perf_cpu_context *cpuctx; 1547 struct perf_cpu_context *cpuctx;
1532 struct task_struct *task; 1548 struct task_struct *task;
@@ -1586,11 +1602,7 @@ static struct perf_counter_context *find_get_context(pid_t pid, int cpu)
1586 retry: 1602 retry:
1587 ctx = perf_lock_task_context(task, &flags); 1603 ctx = perf_lock_task_context(task, &flags);
1588 if (ctx) { 1604 if (ctx) {
1589 parent_ctx = ctx->parent_ctx; 1605 unclone_ctx(ctx);
1590 if (parent_ctx) {
1591 put_ctx(parent_ctx);
1592 ctx->parent_ctx = NULL; /* no longer a clone */
1593 }
1594 spin_unlock_irqrestore(&ctx->lock, flags); 1606 spin_unlock_irqrestore(&ctx->lock, flags);
1595 } 1607 }
1596 1608
@@ -1704,7 +1716,7 @@ perf_read_hw(struct perf_counter *counter, char __user *buf, size_t count)
1704 values[n++] = counter->total_time_running + 1716 values[n++] = counter->total_time_running +
1705 atomic64_read(&counter->child_total_time_running); 1717 atomic64_read(&counter->child_total_time_running);
1706 if (counter->attr.read_format & PERF_FORMAT_ID) 1718 if (counter->attr.read_format & PERF_FORMAT_ID)
1707 values[n++] = counter->id; 1719 values[n++] = primary_counter_id(counter);
1708 mutex_unlock(&counter->child_mutex); 1720 mutex_unlock(&counter->child_mutex);
1709 1721
1710 if (count < n * sizeof(u64)) 1722 if (count < n * sizeof(u64))
@@ -1811,8 +1823,6 @@ static int perf_counter_period(struct perf_counter *counter, u64 __user *arg)
1811 1823
1812 counter->attr.sample_freq = value; 1824 counter->attr.sample_freq = value;
1813 } else { 1825 } else {
1814 perf_log_period(counter, value);
1815
1816 counter->attr.sample_period = value; 1826 counter->attr.sample_period = value;
1817 counter->hw.sample_period = value; 1827 counter->hw.sample_period = value;
1818 } 1828 }
@@ -2661,10 +2671,14 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2661 if (sample_type & PERF_SAMPLE_ID) 2671 if (sample_type & PERF_SAMPLE_ID)
2662 header.size += sizeof(u64); 2672 header.size += sizeof(u64);
2663 2673
2674 if (sample_type & PERF_SAMPLE_STREAM_ID)
2675 header.size += sizeof(u64);
2676
2664 if (sample_type & PERF_SAMPLE_CPU) { 2677 if (sample_type & PERF_SAMPLE_CPU) {
2665 header.size += sizeof(cpu_entry); 2678 header.size += sizeof(cpu_entry);
2666 2679
2667 cpu_entry.cpu = raw_smp_processor_id(); 2680 cpu_entry.cpu = raw_smp_processor_id();
2681 cpu_entry.reserved = 0;
2668 } 2682 }
2669 2683
2670 if (sample_type & PERF_SAMPLE_PERIOD) 2684 if (sample_type & PERF_SAMPLE_PERIOD)
@@ -2703,7 +2717,13 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2703 if (sample_type & PERF_SAMPLE_ADDR) 2717 if (sample_type & PERF_SAMPLE_ADDR)
2704 perf_output_put(&handle, data->addr); 2718 perf_output_put(&handle, data->addr);
2705 2719
2706 if (sample_type & PERF_SAMPLE_ID) 2720 if (sample_type & PERF_SAMPLE_ID) {
2721 u64 id = primary_counter_id(counter);
2722
2723 perf_output_put(&handle, id);
2724 }
2725
2726 if (sample_type & PERF_SAMPLE_STREAM_ID)
2707 perf_output_put(&handle, counter->id); 2727 perf_output_put(&handle, counter->id);
2708 2728
2709 if (sample_type & PERF_SAMPLE_CPU) 2729 if (sample_type & PERF_SAMPLE_CPU)
@@ -2726,7 +2746,7 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
2726 if (sub != counter) 2746 if (sub != counter)
2727 sub->pmu->read(sub); 2747 sub->pmu->read(sub);
2728 2748
2729 group_entry.id = sub->id; 2749 group_entry.id = primary_counter_id(sub);
2730 group_entry.counter = atomic64_read(&sub->count); 2750 group_entry.counter = atomic64_read(&sub->count);
2731 2751
2732 perf_output_put(&handle, group_entry); 2752 perf_output_put(&handle, group_entry);
@@ -2786,15 +2806,8 @@ perf_counter_read_event(struct perf_counter *counter,
2786 } 2806 }
2787 2807
2788 if (counter->attr.read_format & PERF_FORMAT_ID) { 2808 if (counter->attr.read_format & PERF_FORMAT_ID) {
2789 u64 id;
2790
2791 event.header.size += sizeof(u64); 2809 event.header.size += sizeof(u64);
2792 if (counter->parent) 2810 event.format[i++] = primary_counter_id(counter);
2793 id = counter->parent->id;
2794 else
2795 id = counter->id;
2796
2797 event.format[i++] = id;
2798 } 2811 }
2799 2812
2800 ret = perf_output_begin(&handle, counter, event.header.size, 0, 0); 2813 ret = perf_output_begin(&handle, counter, event.header.size, 0, 0);
@@ -2895,8 +2908,11 @@ void perf_counter_fork(struct task_struct *task)
2895 .event = { 2908 .event = {
2896 .header = { 2909 .header = {
2897 .type = PERF_EVENT_FORK, 2910 .type = PERF_EVENT_FORK,
2911 .misc = 0,
2898 .size = sizeof(fork_event.event), 2912 .size = sizeof(fork_event.event),
2899 }, 2913 },
2914 /* .pid */
2915 /* .ppid */
2900 }, 2916 },
2901 }; 2917 };
2902 2918
@@ -2968,8 +2984,10 @@ static void perf_counter_comm_event(struct perf_comm_event *comm_event)
2968 struct perf_cpu_context *cpuctx; 2984 struct perf_cpu_context *cpuctx;
2969 struct perf_counter_context *ctx; 2985 struct perf_counter_context *ctx;
2970 unsigned int size; 2986 unsigned int size;
2971 char *comm = comm_event->task->comm; 2987 char comm[TASK_COMM_LEN];
2972 2988
2989 memset(comm, 0, sizeof(comm));
2990 strncpy(comm, comm_event->task->comm, sizeof(comm));
2973 size = ALIGN(strlen(comm)+1, sizeof(u64)); 2991 size = ALIGN(strlen(comm)+1, sizeof(u64));
2974 2992
2975 comm_event->comm = comm; 2993 comm_event->comm = comm;
@@ -3004,8 +3022,16 @@ void perf_counter_comm(struct task_struct *task)
3004 3022
3005 comm_event = (struct perf_comm_event){ 3023 comm_event = (struct perf_comm_event){
3006 .task = task, 3024 .task = task,
3025 /* .comm */
3026 /* .comm_size */
3007 .event = { 3027 .event = {
3008 .header = { .type = PERF_EVENT_COMM, }, 3028 .header = {
3029 .type = PERF_EVENT_COMM,
3030 .misc = 0,
3031 /* .size */
3032 },
3033 /* .pid */
3034 /* .tid */
3009 }, 3035 },
3010 }; 3036 };
3011 3037
@@ -3088,8 +3114,15 @@ static void perf_counter_mmap_event(struct perf_mmap_event *mmap_event)
3088 char *buf = NULL; 3114 char *buf = NULL;
3089 const char *name; 3115 const char *name;
3090 3116
3117 memset(tmp, 0, sizeof(tmp));
3118
3091 if (file) { 3119 if (file) {
3092 buf = kzalloc(PATH_MAX, GFP_KERNEL); 3120 /*
3121 * d_path works from the end of the buffer backwards, so we
3122 * need to add enough zero bytes after the string to handle
3123 * the 64bit alignment we do later.
3124 */
3125 buf = kzalloc(PATH_MAX + sizeof(u64), GFP_KERNEL);
3093 if (!buf) { 3126 if (!buf) {
3094 name = strncpy(tmp, "//enomem", sizeof(tmp)); 3127 name = strncpy(tmp, "//enomem", sizeof(tmp));
3095 goto got_name; 3128 goto got_name;
@@ -3100,9 +3133,11 @@ static void perf_counter_mmap_event(struct perf_mmap_event *mmap_event)
3100 goto got_name; 3133 goto got_name;
3101 } 3134 }
3102 } else { 3135 } else {
3103 name = arch_vma_name(mmap_event->vma); 3136 if (arch_vma_name(mmap_event->vma)) {
3104 if (name) 3137 name = strncpy(tmp, arch_vma_name(mmap_event->vma),
3138 sizeof(tmp));
3105 goto got_name; 3139 goto got_name;
3140 }
3106 3141
3107 if (!vma->vm_mm) { 3142 if (!vma->vm_mm) {
3108 name = strncpy(tmp, "[vdso]", sizeof(tmp)); 3143 name = strncpy(tmp, "[vdso]", sizeof(tmp));
@@ -3147,8 +3182,16 @@ void __perf_counter_mmap(struct vm_area_struct *vma)
3147 3182
3148 mmap_event = (struct perf_mmap_event){ 3183 mmap_event = (struct perf_mmap_event){
3149 .vma = vma, 3184 .vma = vma,
3185 /* .file_name */
3186 /* .file_size */
3150 .event = { 3187 .event = {
3151 .header = { .type = PERF_EVENT_MMAP, }, 3188 .header = {
3189 .type = PERF_EVENT_MMAP,
3190 .misc = 0,
3191 /* .size */
3192 },
3193 /* .pid */
3194 /* .tid */
3152 .start = vma->vm_start, 3195 .start = vma->vm_start,
3153 .len = vma->vm_end - vma->vm_start, 3196 .len = vma->vm_end - vma->vm_start,
3154 .pgoff = vma->vm_pgoff, 3197 .pgoff = vma->vm_pgoff,
@@ -3159,49 +3202,6 @@ void __perf_counter_mmap(struct vm_area_struct *vma)
3159} 3202}
3160 3203
3161/* 3204/*
3162 * Log sample_period changes so that analyzing tools can re-normalize the
3163 * event flow.
3164 */
3165
3166struct freq_event {
3167 struct perf_event_header header;
3168 u64 time;
3169 u64 id;
3170 u64 period;
3171};
3172
3173static void perf_log_period(struct perf_counter *counter, u64 period)
3174{
3175 struct perf_output_handle handle;
3176 struct freq_event event;
3177 int ret;
3178
3179 if (counter->hw.sample_period == period)
3180 return;
3181
3182 if (counter->attr.sample_type & PERF_SAMPLE_PERIOD)
3183 return;
3184
3185 event = (struct freq_event) {
3186 .header = {
3187 .type = PERF_EVENT_PERIOD,
3188 .misc = 0,
3189 .size = sizeof(event),
3190 },
3191 .time = sched_clock(),
3192 .id = counter->id,
3193 .period = period,
3194 };
3195
3196 ret = perf_output_begin(&handle, counter, sizeof(event), 1, 0);
3197 if (ret)
3198 return;
3199
3200 perf_output_put(&handle, event);
3201 perf_output_end(&handle);
3202}
3203
3204/*
3205 * IRQ throttle logging 3205 * IRQ throttle logging
3206 */ 3206 */
3207 3207
@@ -3214,16 +3214,21 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
3214 struct perf_event_header header; 3214 struct perf_event_header header;
3215 u64 time; 3215 u64 time;
3216 u64 id; 3216 u64 id;
3217 u64 stream_id;
3217 } throttle_event = { 3218 } throttle_event = {
3218 .header = { 3219 .header = {
3219 .type = PERF_EVENT_THROTTLE + 1, 3220 .type = PERF_EVENT_THROTTLE,
3220 .misc = 0, 3221 .misc = 0,
3221 .size = sizeof(throttle_event), 3222 .size = sizeof(throttle_event),
3222 }, 3223 },
3223 .time = sched_clock(), 3224 .time = sched_clock(),
3224 .id = counter->id, 3225 .id = primary_counter_id(counter),
3226 .stream_id = counter->id,
3225 }; 3227 };
3226 3228
3229 if (enable)
3230 throttle_event.header.type = PERF_EVENT_UNTHROTTLE;
3231
3227 ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0); 3232 ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0);
3228 if (ret) 3233 if (ret)
3229 return; 3234 return;
@@ -3671,7 +3676,7 @@ static const struct pmu perf_ops_task_clock = {
3671void perf_tpcounter_event(int event_id) 3676void perf_tpcounter_event(int event_id)
3672{ 3677{
3673 struct perf_sample_data data = { 3678 struct perf_sample_data data = {
3674 .regs = get_irq_regs(); 3679 .regs = get_irq_regs(),
3675 .addr = 0, 3680 .addr = 0,
3676 }; 3681 };
3677 3682
@@ -3687,16 +3692,12 @@ extern void ftrace_profile_disable(int);
3687 3692
3688static void tp_perf_counter_destroy(struct perf_counter *counter) 3693static void tp_perf_counter_destroy(struct perf_counter *counter)
3689{ 3694{
3690 ftrace_profile_disable(perf_event_id(&counter->attr)); 3695 ftrace_profile_disable(counter->attr.config);
3691} 3696}
3692 3697
3693static const struct pmu *tp_perf_counter_init(struct perf_counter *counter) 3698static const struct pmu *tp_perf_counter_init(struct perf_counter *counter)
3694{ 3699{
3695 int event_id = perf_event_id(&counter->attr); 3700 if (ftrace_profile_enable(counter->attr.config))
3696 int ret;
3697
3698 ret = ftrace_profile_enable(event_id);
3699 if (ret)
3700 return NULL; 3701 return NULL;
3701 3702
3702 counter->destroy = tp_perf_counter_destroy; 3703 counter->destroy = tp_perf_counter_destroy;
@@ -4255,15 +4256,12 @@ void perf_counter_exit_task(struct task_struct *child)
4255 */ 4256 */
4256 spin_lock(&child_ctx->lock); 4257 spin_lock(&child_ctx->lock);
4257 child->perf_counter_ctxp = NULL; 4258 child->perf_counter_ctxp = NULL;
4258 if (child_ctx->parent_ctx) { 4259 /*
4259 /* 4260 * If this context is a clone; unclone it so it can't get
4260 * This context is a clone; unclone it so it can't get 4261 * swapped to another process while we're removing all
4261 * swapped to another process while we're removing all 4262 * the counters from it.
4262 * the counters from it. 4263 */
4263 */ 4264 unclone_ctx(child_ctx);
4264 put_ctx(child_ctx->parent_ctx);
4265 child_ctx->parent_ctx = NULL;
4266 }
4267 spin_unlock(&child_ctx->lock); 4265 spin_unlock(&child_ctx->lock);
4268 local_irq_restore(flags); 4266 local_irq_restore(flags);
4269 4267
diff --git a/kernel/pid.c b/kernel/pid.c
index 5fa1db48d8b7..31310b5d3f50 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -36,7 +36,6 @@
36#include <linux/pid_namespace.h> 36#include <linux/pid_namespace.h>
37#include <linux/init_task.h> 37#include <linux/init_task.h>
38#include <linux/syscalls.h> 38#include <linux/syscalls.h>
39#include <linux/kmemleak.h>
40 39
41#define pid_hashfn(nr, ns) \ 40#define pid_hashfn(nr, ns) \
42 hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift) 41 hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift)
@@ -513,12 +512,6 @@ void __init pidhash_init(void)
513 pid_hash = alloc_bootmem(pidhash_size * sizeof(*(pid_hash))); 512 pid_hash = alloc_bootmem(pidhash_size * sizeof(*(pid_hash)));
514 if (!pid_hash) 513 if (!pid_hash)
515 panic("Could not alloc pidhash!\n"); 514 panic("Could not alloc pidhash!\n");
516 /*
517 * pid_hash contains references to allocated struct pid objects and it
518 * must be scanned by kmemleak to avoid false positives.
519 */
520 kmemleak_alloc(pid_hash, pidhash_size * sizeof(*(pid_hash)), 0,
521 GFP_KERNEL);
522 for (i = 0; i < pidhash_size; i++) 515 for (i = 0; i < pidhash_size; i++)
523 INIT_HLIST_HEAD(&pid_hash[i]); 516 INIT_HLIST_HEAD(&pid_hash[i]);
524} 517}
diff --git a/kernel/power/user.c b/kernel/power/user.c
index ed97375daae9..bf0014d6a5f0 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -23,7 +23,6 @@
23#include <linux/console.h> 23#include <linux/console.h>
24#include <linux/cpu.h> 24#include <linux/cpu.h>
25#include <linux/freezer.h> 25#include <linux/freezer.h>
26#include <linux/smp_lock.h>
27#include <scsi/scsi_scan.h> 26#include <scsi/scsi_scan.h>
28 27
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
diff --git a/kernel/profile.c b/kernel/profile.c
index 69911b5745eb..419250ebec4d 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -117,11 +117,12 @@ int __ref profile_init(void)
117 117
118 cpumask_copy(prof_cpu_mask, cpu_possible_mask); 118 cpumask_copy(prof_cpu_mask, cpu_possible_mask);
119 119
120 prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL); 120 prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL|__GFP_NOWARN);
121 if (prof_buffer) 121 if (prof_buffer)
122 return 0; 122 return 0;
123 123
124 prof_buffer = alloc_pages_exact(buffer_bytes, GFP_KERNEL|__GFP_ZERO); 124 prof_buffer = alloc_pages_exact(buffer_bytes,
125 GFP_KERNEL|__GFP_ZERO|__GFP_NOWARN);
125 if (prof_buffer) 126 if (prof_buffer)
126 return 0; 127 return 0;
127 128
diff --git a/kernel/sched.c b/kernel/sched.c
index 01f55ada3598..1b59e265273b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -493,6 +493,7 @@ struct rt_rq {
493#endif 493#endif
494#ifdef CONFIG_SMP 494#ifdef CONFIG_SMP
495 unsigned long rt_nr_migratory; 495 unsigned long rt_nr_migratory;
496 unsigned long rt_nr_total;
496 int overloaded; 497 int overloaded;
497 struct plist_head pushable_tasks; 498 struct plist_head pushable_tasks;
498#endif 499#endif
@@ -2571,15 +2572,37 @@ static void __sched_fork(struct task_struct *p)
2571 p->se.avg_wakeup = sysctl_sched_wakeup_granularity; 2572 p->se.avg_wakeup = sysctl_sched_wakeup_granularity;
2572 2573
2573#ifdef CONFIG_SCHEDSTATS 2574#ifdef CONFIG_SCHEDSTATS
2574 p->se.wait_start = 0; 2575 p->se.wait_start = 0;
2575 p->se.sum_sleep_runtime = 0; 2576 p->se.wait_max = 0;
2576 p->se.sleep_start = 0; 2577 p->se.wait_count = 0;
2577 p->se.block_start = 0; 2578 p->se.wait_sum = 0;
2578 p->se.sleep_max = 0; 2579
2579 p->se.block_max = 0; 2580 p->se.sleep_start = 0;
2580 p->se.exec_max = 0; 2581 p->se.sleep_max = 0;
2581 p->se.slice_max = 0; 2582 p->se.sum_sleep_runtime = 0;
2582 p->se.wait_max = 0; 2583
2584 p->se.block_start = 0;
2585 p->se.block_max = 0;
2586 p->se.exec_max = 0;
2587 p->se.slice_max = 0;
2588
2589 p->se.nr_migrations_cold = 0;
2590 p->se.nr_failed_migrations_affine = 0;
2591 p->se.nr_failed_migrations_running = 0;
2592 p->se.nr_failed_migrations_hot = 0;
2593 p->se.nr_forced_migrations = 0;
2594 p->se.nr_forced2_migrations = 0;
2595
2596 p->se.nr_wakeups = 0;
2597 p->se.nr_wakeups_sync = 0;
2598 p->se.nr_wakeups_migrate = 0;
2599 p->se.nr_wakeups_local = 0;
2600 p->se.nr_wakeups_remote = 0;
2601 p->se.nr_wakeups_affine = 0;
2602 p->se.nr_wakeups_affine_attempts = 0;
2603 p->se.nr_wakeups_passive = 0;
2604 p->se.nr_wakeups_idle = 0;
2605
2583#endif 2606#endif
2584 2607
2585 INIT_LIST_HEAD(&p->rt.run_list); 2608 INIT_LIST_HEAD(&p->rt.run_list);
@@ -7266,6 +7289,7 @@ static void migrate_dead_tasks(unsigned int dead_cpu)
7266static void calc_global_load_remove(struct rq *rq) 7289static void calc_global_load_remove(struct rq *rq)
7267{ 7290{
7268 atomic_long_sub(rq->calc_load_active, &calc_load_tasks); 7291 atomic_long_sub(rq->calc_load_active, &calc_load_tasks);
7292 rq->calc_load_active = 0;
7269} 7293}
7270#endif /* CONFIG_HOTPLUG_CPU */ 7294#endif /* CONFIG_HOTPLUG_CPU */
7271 7295
@@ -7492,6 +7516,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
7492 task_rq_unlock(rq, &flags); 7516 task_rq_unlock(rq, &flags);
7493 get_task_struct(p); 7517 get_task_struct(p);
7494 cpu_rq(cpu)->migration_thread = p; 7518 cpu_rq(cpu)->migration_thread = p;
7519 rq->calc_load_update = calc_load_update;
7495 break; 7520 break;
7496 7521
7497 case CPU_ONLINE: 7522 case CPU_ONLINE:
@@ -7502,8 +7527,6 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
7502 /* Update our root-domain */ 7527 /* Update our root-domain */
7503 rq = cpu_rq(cpu); 7528 rq = cpu_rq(cpu);
7504 spin_lock_irqsave(&rq->lock, flags); 7529 spin_lock_irqsave(&rq->lock, flags);
7505 rq->calc_load_update = calc_load_update;
7506 rq->calc_load_active = 0;
7507 if (rq->rd) { 7530 if (rq->rd) {
7508 BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); 7531 BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span));
7509 7532
@@ -9074,7 +9097,7 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
9074#ifdef CONFIG_SMP 9097#ifdef CONFIG_SMP
9075 rt_rq->rt_nr_migratory = 0; 9098 rt_rq->rt_nr_migratory = 0;
9076 rt_rq->overloaded = 0; 9099 rt_rq->overloaded = 0;
9077 plist_head_init(&rq->rt.pushable_tasks, &rq->lock); 9100 plist_head_init(&rt_rq->pushable_tasks, &rq->lock);
9078#endif 9101#endif
9079 9102
9080 rt_rq->rt_time = 0; 9103 rt_rq->rt_time = 0;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index ba7fd6e9556f..9ffb2b2ceba4 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -266,6 +266,12 @@ static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
266 return min_vruntime; 266 return min_vruntime;
267} 267}
268 268
269static inline int entity_before(struct sched_entity *a,
270 struct sched_entity *b)
271{
272 return (s64)(a->vruntime - b->vruntime) < 0;
273}
274
269static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se) 275static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
270{ 276{
271 return se->vruntime - cfs_rq->min_vruntime; 277 return se->vruntime - cfs_rq->min_vruntime;
@@ -687,7 +693,8 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
687 * all of which have the same weight. 693 * all of which have the same weight.
688 */ 694 */
689 if (sched_feat(NORMALIZED_SLEEPER) && 695 if (sched_feat(NORMALIZED_SLEEPER) &&
690 task_of(se)->policy != SCHED_IDLE) 696 (!entity_is_task(se) ||
697 task_of(se)->policy != SCHED_IDLE))
691 thresh = calc_delta_fair(thresh, se); 698 thresh = calc_delta_fair(thresh, se);
692 699
693 vruntime -= thresh; 700 vruntime -= thresh;
@@ -1016,7 +1023,7 @@ static void yield_task_fair(struct rq *rq)
1016 /* 1023 /*
1017 * Already in the rightmost position? 1024 * Already in the rightmost position?
1018 */ 1025 */
1019 if (unlikely(!rightmost || rightmost->vruntime < se->vruntime)) 1026 if (unlikely(!rightmost || entity_before(rightmost, se)))
1020 return; 1027 return;
1021 1028
1022 /* 1029 /*
@@ -1712,7 +1719,7 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
1712 1719
1713 /* 'curr' will be NULL if the child belongs to a different group */ 1720 /* 'curr' will be NULL if the child belongs to a different group */
1714 if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && 1721 if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) &&
1715 curr && curr->vruntime < se->vruntime) { 1722 curr && entity_before(curr, se)) {
1716 /* 1723 /*
1717 * Upon rescheduling, sched_class::put_prev_task() will place 1724 * Upon rescheduling, sched_class::put_prev_task() will place
1718 * 'current' within the tree based on its new key value. 1725 * 'current' within the tree based on its new key value.
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 9bf0d2a73045..3918e01994e0 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -10,6 +10,8 @@ static inline struct task_struct *rt_task_of(struct sched_rt_entity *rt_se)
10 10
11#ifdef CONFIG_RT_GROUP_SCHED 11#ifdef CONFIG_RT_GROUP_SCHED
12 12
13#define rt_entity_is_task(rt_se) (!(rt_se)->my_q)
14
13static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq) 15static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
14{ 16{
15 return rt_rq->rq; 17 return rt_rq->rq;
@@ -22,6 +24,8 @@ static inline struct rt_rq *rt_rq_of_se(struct sched_rt_entity *rt_se)
22 24
23#else /* CONFIG_RT_GROUP_SCHED */ 25#else /* CONFIG_RT_GROUP_SCHED */
24 26
27#define rt_entity_is_task(rt_se) (1)
28
25static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq) 29static inline struct rq *rq_of_rt_rq(struct rt_rq *rt_rq)
26{ 30{
27 return container_of(rt_rq, struct rq, rt); 31 return container_of(rt_rq, struct rq, rt);
@@ -73,7 +77,7 @@ static inline void rt_clear_overload(struct rq *rq)
73 77
74static void update_rt_migration(struct rt_rq *rt_rq) 78static void update_rt_migration(struct rt_rq *rt_rq)
75{ 79{
76 if (rt_rq->rt_nr_migratory && (rt_rq->rt_nr_running > 1)) { 80 if (rt_rq->rt_nr_migratory && rt_rq->rt_nr_total > 1) {
77 if (!rt_rq->overloaded) { 81 if (!rt_rq->overloaded) {
78 rt_set_overload(rq_of_rt_rq(rt_rq)); 82 rt_set_overload(rq_of_rt_rq(rt_rq));
79 rt_rq->overloaded = 1; 83 rt_rq->overloaded = 1;
@@ -86,6 +90,12 @@ static void update_rt_migration(struct rt_rq *rt_rq)
86 90
87static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) 91static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
88{ 92{
93 if (!rt_entity_is_task(rt_se))
94 return;
95
96 rt_rq = &rq_of_rt_rq(rt_rq)->rt;
97
98 rt_rq->rt_nr_total++;
89 if (rt_se->nr_cpus_allowed > 1) 99 if (rt_se->nr_cpus_allowed > 1)
90 rt_rq->rt_nr_migratory++; 100 rt_rq->rt_nr_migratory++;
91 101
@@ -94,6 +104,12 @@ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
94 104
95static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) 105static void dec_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
96{ 106{
107 if (!rt_entity_is_task(rt_se))
108 return;
109
110 rt_rq = &rq_of_rt_rq(rt_rq)->rt;
111
112 rt_rq->rt_nr_total--;
97 if (rt_se->nr_cpus_allowed > 1) 113 if (rt_se->nr_cpus_allowed > 1)
98 rt_rq->rt_nr_migratory--; 114 rt_rq->rt_nr_migratory--;
99 115
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 3a94905fa5d2..eb5e131a0485 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -345,7 +345,9 @@ void open_softirq(int nr, void (*action)(struct softirq_action *))
345 softirq_vec[nr].action = action; 345 softirq_vec[nr].action = action;
346} 346}
347 347
348/* Tasklets */ 348/*
349 * Tasklets
350 */
349struct tasklet_head 351struct tasklet_head
350{ 352{
351 struct tasklet_struct *head; 353 struct tasklet_struct *head;
@@ -493,6 +495,66 @@ void tasklet_kill(struct tasklet_struct *t)
493 495
494EXPORT_SYMBOL(tasklet_kill); 496EXPORT_SYMBOL(tasklet_kill);
495 497
498/*
499 * tasklet_hrtimer
500 */
501
502/*
503 * The trampoline is called when the hrtimer expires. If this is
504 * called from the hrtimer interrupt then we schedule the tasklet as
505 * the timer callback function expects to run in softirq context. If
506 * it's called in softirq context anyway (i.e. high resolution timers
507 * disabled) then the hrtimer callback is called right away.
508 */
509static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer)
510{
511 struct tasklet_hrtimer *ttimer =
512 container_of(timer, struct tasklet_hrtimer, timer);
513
514 if (hrtimer_is_hres_active(timer)) {
515 tasklet_hi_schedule(&ttimer->tasklet);
516 return HRTIMER_NORESTART;
517 }
518 return ttimer->function(timer);
519}
520
521/*
522 * Helper function which calls the hrtimer callback from
523 * tasklet/softirq context
524 */
525static void __tasklet_hrtimer_trampoline(unsigned long data)
526{
527 struct tasklet_hrtimer *ttimer = (void *)data;
528 enum hrtimer_restart restart;
529
530 restart = ttimer->function(&ttimer->timer);
531 if (restart != HRTIMER_NORESTART)
532 hrtimer_restart(&ttimer->timer);
533}
534
535/**
536 * tasklet_hrtimer_init - Init a tasklet/hrtimer combo for softirq callbacks
537 * @ttimer: tasklet_hrtimer which is initialized
538 * @function: hrtimer callback funtion which gets called from softirq context
539 * @which_clock: clock id (CLOCK_MONOTONIC/CLOCK_REALTIME)
540 * @mode: hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL)
541 */
542void tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
543 enum hrtimer_restart (*function)(struct hrtimer *),
544 clockid_t which_clock, enum hrtimer_mode mode)
545{
546 hrtimer_init(&ttimer->timer, which_clock, mode);
547 ttimer->timer.function = __hrtimer_tasklet_trampoline;
548 tasklet_init(&ttimer->tasklet, __tasklet_hrtimer_trampoline,
549 (unsigned long)ttimer);
550 ttimer->function = function;
551}
552EXPORT_SYMBOL_GPL(tasklet_hrtimer_init);
553
554/*
555 * Remote softirq bits
556 */
557
496DEFINE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); 558DEFINE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list);
497EXPORT_PER_CPU_SYMBOL(softirq_work_list); 559EXPORT_PER_CPU_SYMBOL(softirq_work_list);
498 560
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 1ad6dd461119..a6dcd67b041d 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -254,15 +254,4 @@ void clockevents_notify(unsigned long reason, void *arg)
254 spin_unlock(&clockevents_lock); 254 spin_unlock(&clockevents_lock);
255} 255}
256EXPORT_SYMBOL_GPL(clockevents_notify); 256EXPORT_SYMBOL_GPL(clockevents_notify);
257
258ktime_t clockevents_get_next_event(int cpu)
259{
260 struct tick_device *td;
261 struct clock_event_device *dev;
262
263 td = &per_cpu(tick_cpu_device, cpu);
264 dev = td->evtdev;
265
266 return dev->next_event;
267}
268#endif 257#endif
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 592bf584d1d2..7466cb811251 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -513,7 +513,7 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev,
513 * Check to make sure we don't switch to a non-highres capable 513 * Check to make sure we don't switch to a non-highres capable
514 * clocksource if the tick code is in oneshot mode (highres or nohz) 514 * clocksource if the tick code is in oneshot mode (highres or nohz)
515 */ 515 */
516 if (tick_oneshot_mode_active() && 516 if (tick_oneshot_mode_active() && ovr &&
517 !(ovr->flags & CLOCK_SOURCE_VALID_FOR_HRES)) { 517 !(ovr->flags & CLOCK_SOURCE_VALID_FOR_HRES)) {
518 printk(KERN_WARNING "%s clocksource is not HRT compatible. " 518 printk(KERN_WARNING "%s clocksource is not HRT compatible. "
519 "Cannot switch while in HRT/NOHZ mode\n", ovr->name); 519 "Cannot switch while in HRT/NOHZ mode\n", ovr->name);
diff --git a/kernel/timer.c b/kernel/timer.c
index 0b36b9e5cc8b..a7f07d5a6241 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -714,7 +714,7 @@ int mod_timer(struct timer_list *timer, unsigned long expires)
714 * networking code - if the timer is re-modified 714 * networking code - if the timer is re-modified
715 * to be the same thing then just return: 715 * to be the same thing then just return:
716 */ 716 */
717 if (timer->expires == expires && timer_pending(timer)) 717 if (timer_pending(timer) && timer->expires == expires)
718 return 1; 718 return 1;
719 719
720 return __mod_timer(timer, expires, false, TIMER_NOT_PINNED); 720 return __mod_timer(timer, expires, false, TIMER_NOT_PINNED);
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 39af8af6fc30..1090b0aed9ba 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -22,6 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/debugfs.h> 24#include <linux/debugfs.h>
25#include <linux/smp_lock.h>
25#include <linux/time.h> 26#include <linux/time.h>
26#include <linux/uaccess.h> 27#include <linux/uaccess.h>
27 28
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index bce9e01a29c8..1f3ec2afa511 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -768,7 +768,7 @@ static struct tracer_stat function_stats __initdata = {
768 .stat_show = function_stat_show 768 .stat_show = function_stat_show
769}; 769};
770 770
771static void ftrace_profile_debugfs(struct dentry *d_tracer) 771static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
772{ 772{
773 struct ftrace_profile_stat *stat; 773 struct ftrace_profile_stat *stat;
774 struct dentry *entry; 774 struct dentry *entry;
@@ -786,7 +786,6 @@ static void ftrace_profile_debugfs(struct dentry *d_tracer)
786 * The files created are permanent, if something happens 786 * The files created are permanent, if something happens
787 * we still do not free memory. 787 * we still do not free memory.
788 */ 788 */
789 kfree(stat);
790 WARN(1, 789 WARN(1,
791 "Could not allocate stat file for cpu %d\n", 790 "Could not allocate stat file for cpu %d\n",
792 cpu); 791 cpu);
@@ -813,7 +812,7 @@ static void ftrace_profile_debugfs(struct dentry *d_tracer)
813} 812}
814 813
815#else /* CONFIG_FUNCTION_PROFILER */ 814#else /* CONFIG_FUNCTION_PROFILER */
816static void ftrace_profile_debugfs(struct dentry *d_tracer) 815static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
817{ 816{
818} 817}
819#endif /* CONFIG_FUNCTION_PROFILER */ 818#endif /* CONFIG_FUNCTION_PROFILER */
@@ -2597,6 +2596,14 @@ ftrace_graph_open(struct inode *inode, struct file *file)
2597} 2596}
2598 2597
2599static int 2598static int
2599ftrace_graph_release(struct inode *inode, struct file *file)
2600{
2601 if (file->f_mode & FMODE_READ)
2602 seq_release(inode, file);
2603 return 0;
2604}
2605
2606static int
2600ftrace_set_func(unsigned long *array, int *idx, char *buffer) 2607ftrace_set_func(unsigned long *array, int *idx, char *buffer)
2601{ 2608{
2602 struct dyn_ftrace *rec; 2609 struct dyn_ftrace *rec;
@@ -2725,9 +2732,10 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
2725} 2732}
2726 2733
2727static const struct file_operations ftrace_graph_fops = { 2734static const struct file_operations ftrace_graph_fops = {
2728 .open = ftrace_graph_open, 2735 .open = ftrace_graph_open,
2729 .read = seq_read, 2736 .read = seq_read,
2730 .write = ftrace_graph_write, 2737 .write = ftrace_graph_write,
2738 .release = ftrace_graph_release,
2731}; 2739};
2732#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 2740#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2733 2741
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 3aa0a0dfdfa8..8bc8d8afea6a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -17,6 +17,7 @@
17#include <linux/writeback.h> 17#include <linux/writeback.h>
18#include <linux/kallsyms.h> 18#include <linux/kallsyms.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/smp_lock.h>
20#include <linux/notifier.h> 21#include <linux/notifier.h>
21#include <linux/irqflags.h> 22#include <linux/irqflags.h>
22#include <linux/debugfs.h> 23#include <linux/debugfs.h>
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 7402144bff21..75ef000613c3 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -363,7 +363,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable)
363 out_reg: 363 out_reg:
364 ret = register_ftrace_function_probe(glob, ops, count); 364 ret = register_ftrace_function_probe(glob, ops, count);
365 365
366 return ret; 366 return ret < 0 ? ret : 0;
367} 367}
368 368
369static struct ftrace_func_command ftrace_traceon_cmd = { 369static struct ftrace_func_command ftrace_traceon_cmd = {
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index e644af910124..6a2a9d484cd6 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -301,17 +301,14 @@ static const struct seq_operations stack_trace_seq_ops = {
301 301
302static int stack_trace_open(struct inode *inode, struct file *file) 302static int stack_trace_open(struct inode *inode, struct file *file)
303{ 303{
304 int ret; 304 return seq_open(file, &stack_trace_seq_ops);
305
306 ret = seq_open(file, &stack_trace_seq_ops);
307
308 return ret;
309} 305}
310 306
311static const struct file_operations stack_trace_fops = { 307static const struct file_operations stack_trace_fops = {
312 .open = stack_trace_open, 308 .open = stack_trace_open,
313 .read = seq_read, 309 .read = seq_read,
314 .llseek = seq_lseek, 310 .llseek = seq_lseek,
311 .release = seq_release,
315}; 312};
316 313
317int 314int
diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c
index e66f5e493342..aea321c82fa0 100644
--- a/kernel/trace/trace_stat.c
+++ b/kernel/trace/trace_stat.c
@@ -73,7 +73,7 @@ static struct rb_node *release_next(struct rb_node *node)
73 } 73 }
74} 74}
75 75
76static void reset_stat_session(struct stat_session *session) 76static void __reset_stat_session(struct stat_session *session)
77{ 77{
78 struct rb_node *node = session->stat_root.rb_node; 78 struct rb_node *node = session->stat_root.rb_node;
79 79
@@ -83,10 +83,17 @@ static void reset_stat_session(struct stat_session *session)
83 session->stat_root = RB_ROOT; 83 session->stat_root = RB_ROOT;
84} 84}
85 85
86static void reset_stat_session(struct stat_session *session)
87{
88 mutex_lock(&session->stat_mutex);
89 __reset_stat_session(session);
90 mutex_unlock(&session->stat_mutex);
91}
92
86static void destroy_session(struct stat_session *session) 93static void destroy_session(struct stat_session *session)
87{ 94{
88 debugfs_remove(session->file); 95 debugfs_remove(session->file);
89 reset_stat_session(session); 96 __reset_stat_session(session);
90 mutex_destroy(&session->stat_mutex); 97 mutex_destroy(&session->stat_mutex);
91 kfree(session); 98 kfree(session);
92} 99}
@@ -150,7 +157,7 @@ static int stat_seq_init(struct stat_session *session)
150 int i; 157 int i;
151 158
152 mutex_lock(&session->stat_mutex); 159 mutex_lock(&session->stat_mutex);
153 reset_stat_session(session); 160 __reset_stat_session(session);
154 161
155 if (!ts->stat_cmp) 162 if (!ts->stat_cmp)
156 ts->stat_cmp = dummy_cmp; 163 ts->stat_cmp = dummy_cmp;
@@ -183,7 +190,7 @@ exit:
183 return ret; 190 return ret;
184 191
185exit_free_rbtree: 192exit_free_rbtree:
186 reset_stat_session(session); 193 __reset_stat_session(session);
187 mutex_unlock(&session->stat_mutex); 194 mutex_unlock(&session->stat_mutex);
188 return ret; 195 return ret;
189} 196}
@@ -250,16 +257,21 @@ static const struct seq_operations trace_stat_seq_ops = {
250static int tracing_stat_open(struct inode *inode, struct file *file) 257static int tracing_stat_open(struct inode *inode, struct file *file)
251{ 258{
252 int ret; 259 int ret;
253 260 struct seq_file *m;
254 struct stat_session *session = inode->i_private; 261 struct stat_session *session = inode->i_private;
255 262
263 ret = stat_seq_init(session);
264 if (ret)
265 return ret;
266
256 ret = seq_open(file, &trace_stat_seq_ops); 267 ret = seq_open(file, &trace_stat_seq_ops);
257 if (!ret) { 268 if (ret) {
258 struct seq_file *m = file->private_data; 269 reset_stat_session(session);
259 m->private = session; 270 return ret;
260 ret = stat_seq_init(session);
261 } 271 }
262 272
273 m = file->private_data;
274 m->private = session;
263 return ret; 275 return ret;
264} 276}
265 277
@@ -270,11 +282,9 @@ static int tracing_stat_release(struct inode *i, struct file *f)
270{ 282{
271 struct stat_session *session = i->i_private; 283 struct stat_session *session = i->i_private;
272 284
273 mutex_lock(&session->stat_mutex);
274 reset_stat_session(session); 285 reset_stat_session(session);
275 mutex_unlock(&session->stat_mutex);
276 286
277 return 0; 287 return seq_release(i, f);
278} 288}
279 289
280static const struct file_operations tracing_stat_fops = { 290static const struct file_operations tracing_stat_fops = {
diff --git a/lib/Makefile b/lib/Makefile
index b6d1857bbf08..2e78277eff9d 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -12,7 +12,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
12 idr.o int_sqrt.o extable.o prio_tree.o \ 12 idr.o int_sqrt.o extable.o prio_tree.o \
13 sha1.o irq_regs.o reciprocal_div.o argv_split.o \ 13 sha1.o irq_regs.o reciprocal_div.o argv_split.o \
14 proportions.o prio_heap.o ratelimit.o show_mem.o \ 14 proportions.o prio_heap.o ratelimit.o show_mem.o \
15 is_single_threaded.o plist.o decompress.o 15 is_single_threaded.o plist.o decompress.o flex_array.o
16 16
17lib-$(CONFIG_MMU) += ioremap.o 17lib-$(CONFIG_MMU) += ioremap.o
18lib-$(CONFIG_SMP) += cpumask.o 18lib-$(CONFIG_SMP) += cpumask.o
diff --git a/lib/atomic64.c b/lib/atomic64.c
index c5e725562416..8bee16ec7524 100644
--- a/lib/atomic64.c
+++ b/lib/atomic64.c
@@ -13,6 +13,7 @@
13#include <linux/cache.h> 13#include <linux/cache.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h>
16#include <asm/atomic.h> 17#include <asm/atomic.h>
17 18
18/* 19/*
@@ -52,6 +53,7 @@ long long atomic64_read(const atomic64_t *v)
52 spin_unlock_irqrestore(lock, flags); 53 spin_unlock_irqrestore(lock, flags);
53 return val; 54 return val;
54} 55}
56EXPORT_SYMBOL(atomic64_read);
55 57
56void atomic64_set(atomic64_t *v, long long i) 58void atomic64_set(atomic64_t *v, long long i)
57{ 59{
@@ -62,6 +64,7 @@ void atomic64_set(atomic64_t *v, long long i)
62 v->counter = i; 64 v->counter = i;
63 spin_unlock_irqrestore(lock, flags); 65 spin_unlock_irqrestore(lock, flags);
64} 66}
67EXPORT_SYMBOL(atomic64_set);
65 68
66void atomic64_add(long long a, atomic64_t *v) 69void atomic64_add(long long a, atomic64_t *v)
67{ 70{
@@ -72,6 +75,7 @@ void atomic64_add(long long a, atomic64_t *v)
72 v->counter += a; 75 v->counter += a;
73 spin_unlock_irqrestore(lock, flags); 76 spin_unlock_irqrestore(lock, flags);
74} 77}
78EXPORT_SYMBOL(atomic64_add);
75 79
76long long atomic64_add_return(long long a, atomic64_t *v) 80long long atomic64_add_return(long long a, atomic64_t *v)
77{ 81{
@@ -84,6 +88,7 @@ long long atomic64_add_return(long long a, atomic64_t *v)
84 spin_unlock_irqrestore(lock, flags); 88 spin_unlock_irqrestore(lock, flags);
85 return val; 89 return val;
86} 90}
91EXPORT_SYMBOL(atomic64_add_return);
87 92
88void atomic64_sub(long long a, atomic64_t *v) 93void atomic64_sub(long long a, atomic64_t *v)
89{ 94{
@@ -94,6 +99,7 @@ void atomic64_sub(long long a, atomic64_t *v)
94 v->counter -= a; 99 v->counter -= a;
95 spin_unlock_irqrestore(lock, flags); 100 spin_unlock_irqrestore(lock, flags);
96} 101}
102EXPORT_SYMBOL(atomic64_sub);
97 103
98long long atomic64_sub_return(long long a, atomic64_t *v) 104long long atomic64_sub_return(long long a, atomic64_t *v)
99{ 105{
@@ -106,6 +112,7 @@ long long atomic64_sub_return(long long a, atomic64_t *v)
106 spin_unlock_irqrestore(lock, flags); 112 spin_unlock_irqrestore(lock, flags);
107 return val; 113 return val;
108} 114}
115EXPORT_SYMBOL(atomic64_sub_return);
109 116
110long long atomic64_dec_if_positive(atomic64_t *v) 117long long atomic64_dec_if_positive(atomic64_t *v)
111{ 118{
@@ -120,6 +127,7 @@ long long atomic64_dec_if_positive(atomic64_t *v)
120 spin_unlock_irqrestore(lock, flags); 127 spin_unlock_irqrestore(lock, flags);
121 return val; 128 return val;
122} 129}
130EXPORT_SYMBOL(atomic64_dec_if_positive);
123 131
124long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n) 132long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n)
125{ 133{
@@ -134,6 +142,7 @@ long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n)
134 spin_unlock_irqrestore(lock, flags); 142 spin_unlock_irqrestore(lock, flags);
135 return val; 143 return val;
136} 144}
145EXPORT_SYMBOL(atomic64_cmpxchg);
137 146
138long long atomic64_xchg(atomic64_t *v, long long new) 147long long atomic64_xchg(atomic64_t *v, long long new)
139{ 148{
@@ -147,6 +156,7 @@ long long atomic64_xchg(atomic64_t *v, long long new)
147 spin_unlock_irqrestore(lock, flags); 156 spin_unlock_irqrestore(lock, flags);
148 return val; 157 return val;
149} 158}
159EXPORT_SYMBOL(atomic64_xchg);
150 160
151int atomic64_add_unless(atomic64_t *v, long long a, long long u) 161int atomic64_add_unless(atomic64_t *v, long long a, long long u)
152{ 162{
@@ -162,6 +172,7 @@ int atomic64_add_unless(atomic64_t *v, long long a, long long u)
162 spin_unlock_irqrestore(lock, flags); 172 spin_unlock_irqrestore(lock, flags);
163 return ret; 173 return ret;
164} 174}
175EXPORT_SYMBOL(atomic64_add_unless);
165 176
166static int init_atomic64_lock(void) 177static int init_atomic64_lock(void)
167{ 178{
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 833139ce1e22..e22c148e4b7f 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -164,7 +164,7 @@ static void ddebug_change(const struct ddebug_query *query,
164 164
165 if (!newflags) 165 if (!newflags)
166 dt->num_enabled--; 166 dt->num_enabled--;
167 else if (!dp-flags) 167 else if (!dp->flags)
168 dt->num_enabled++; 168 dt->num_enabled++;
169 dp->flags = newflags; 169 dp->flags = newflags;
170 if (newflags) { 170 if (newflags) {
diff --git a/lib/flex_array.c b/lib/flex_array.c
new file mode 100644
index 000000000000..0e7894ce8882
--- /dev/null
+++ b/lib/flex_array.c
@@ -0,0 +1,269 @@
1/*
2 * Flexible array managed in PAGE_SIZE parts
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright IBM Corporation, 2009
19 *
20 * Author: Dave Hansen <dave@linux.vnet.ibm.com>
21 */
22
23#include <linux/flex_array.h>
24#include <linux/slab.h>
25#include <linux/stddef.h>
26
27struct flex_array_part {
28 char elements[FLEX_ARRAY_PART_SIZE];
29};
30
31static inline int __elements_per_part(int element_size)
32{
33 return FLEX_ARRAY_PART_SIZE / element_size;
34}
35
36static inline int bytes_left_in_base(void)
37{
38 int element_offset = offsetof(struct flex_array, parts);
39 int bytes_left = FLEX_ARRAY_BASE_SIZE - element_offset;
40 return bytes_left;
41}
42
43static inline int nr_base_part_ptrs(void)
44{
45 return bytes_left_in_base() / sizeof(struct flex_array_part *);
46}
47
48/*
49 * If a user requests an allocation which is small
50 * enough, we may simply use the space in the
51 * flex_array->parts[] array to store the user
52 * data.
53 */
54static inline int elements_fit_in_base(struct flex_array *fa)
55{
56 int data_size = fa->element_size * fa->total_nr_elements;
57 if (data_size <= bytes_left_in_base())
58 return 1;
59 return 0;
60}
61
62/**
63 * flex_array_alloc - allocate a new flexible array
64 * @element_size: the size of individual elements in the array
65 * @total: total number of elements that this should hold
66 *
67 * Note: all locking must be provided by the caller.
68 *
69 * @total is used to size internal structures. If the user ever
70 * accesses any array indexes >=@total, it will produce errors.
71 *
72 * The maximum number of elements is defined as: the number of
73 * elements that can be stored in a page times the number of
74 * page pointers that we can fit in the base structure or (using
75 * integer math):
76 *
77 * (PAGE_SIZE/element_size) * (PAGE_SIZE-8)/sizeof(void *)
78 *
79 * Here's a table showing example capacities. Note that the maximum
80 * index that the get/put() functions is just nr_objects-1. This
81 * basically means that you get 4MB of storage on 32-bit and 2MB on
82 * 64-bit.
83 *
84 *
85 * Element size | Objects | Objects |
86 * PAGE_SIZE=4k | 32-bit | 64-bit |
87 * ---------------------------------|
88 * 1 bytes | 4186112 | 2093056 |
89 * 2 bytes | 2093056 | 1046528 |
90 * 3 bytes | 1395030 | 697515 |
91 * 4 bytes | 1046528 | 523264 |
92 * 32 bytes | 130816 | 65408 |
93 * 33 bytes | 126728 | 63364 |
94 * 2048 bytes | 2044 | 1022 |
95 * 2049 bytes | 1022 | 511 |
96 * void * | 1046528 | 261632 |
97 *
98 * Since 64-bit pointers are twice the size, we lose half the
99 * capacity in the base structure. Also note that no effort is made
100 * to efficiently pack objects across page boundaries.
101 */
102struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags)
103{
104 struct flex_array *ret;
105 int max_size = nr_base_part_ptrs() * __elements_per_part(element_size);
106
107 /* max_size will end up 0 if element_size > PAGE_SIZE */
108 if (total > max_size)
109 return NULL;
110 ret = kzalloc(sizeof(struct flex_array), flags);
111 if (!ret)
112 return NULL;
113 ret->element_size = element_size;
114 ret->total_nr_elements = total;
115 return ret;
116}
117
118static int fa_element_to_part_nr(struct flex_array *fa, int element_nr)
119{
120 return element_nr / __elements_per_part(fa->element_size);
121}
122
123/**
124 * flex_array_free_parts - just free the second-level pages
125 * @src: address of data to copy into the array
126 * @element_nr: index of the position in which to insert
127 * the new element.
128 *
129 * This is to be used in cases where the base 'struct flex_array'
130 * has been statically allocated and should not be free.
131 */
132void flex_array_free_parts(struct flex_array *fa)
133{
134 int part_nr;
135 int max_part = nr_base_part_ptrs();
136
137 if (elements_fit_in_base(fa))
138 return;
139 for (part_nr = 0; part_nr < max_part; part_nr++)
140 kfree(fa->parts[part_nr]);
141}
142
143void flex_array_free(struct flex_array *fa)
144{
145 flex_array_free_parts(fa);
146 kfree(fa);
147}
148
149static int fa_index_inside_part(struct flex_array *fa, int element_nr)
150{
151 return element_nr % __elements_per_part(fa->element_size);
152}
153
154static int index_inside_part(struct flex_array *fa, int element_nr)
155{
156 int part_offset = fa_index_inside_part(fa, element_nr);
157 return part_offset * fa->element_size;
158}
159
160static struct flex_array_part *
161__fa_get_part(struct flex_array *fa, int part_nr, gfp_t flags)
162{
163 struct flex_array_part *part = fa->parts[part_nr];
164 if (!part) {
165 /*
166 * This leaves the part pages uninitialized
167 * and with potentially random data, just
168 * as if the user had kmalloc()'d the whole.
169 * __GFP_ZERO can be used to zero it.
170 */
171 part = kmalloc(FLEX_ARRAY_PART_SIZE, flags);
172 if (!part)
173 return NULL;
174 fa->parts[part_nr] = part;
175 }
176 return part;
177}
178
179/**
180 * flex_array_put - copy data into the array at @element_nr
181 * @src: address of data to copy into the array
182 * @element_nr: index of the position in which to insert
183 * the new element.
184 *
185 * Note that this *copies* the contents of @src into
186 * the array. If you are trying to store an array of
187 * pointers, make sure to pass in &ptr instead of ptr.
188 *
189 * Locking must be provided by the caller.
190 */
191int flex_array_put(struct flex_array *fa, int element_nr, void *src, gfp_t flags)
192{
193 int part_nr = fa_element_to_part_nr(fa, element_nr);
194 struct flex_array_part *part;
195 void *dst;
196
197 if (element_nr >= fa->total_nr_elements)
198 return -ENOSPC;
199 if (elements_fit_in_base(fa))
200 part = (struct flex_array_part *)&fa->parts[0];
201 else
202 part = __fa_get_part(fa, part_nr, flags);
203 if (!part)
204 return -ENOMEM;
205 dst = &part->elements[index_inside_part(fa, element_nr)];
206 memcpy(dst, src, fa->element_size);
207 return 0;
208}
209
210/**
211 * flex_array_prealloc - guarantee that array space exists
212 * @start: index of first array element for which space is allocated
213 * @end: index of last (inclusive) element for which space is allocated
214 *
215 * This will guarantee that no future calls to flex_array_put()
216 * will allocate memory. It can be used if you are expecting to
217 * be holding a lock or in some atomic context while writing
218 * data into the array.
219 *
220 * Locking must be provided by the caller.
221 */
222int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags)
223{
224 int start_part;
225 int end_part;
226 int part_nr;
227 struct flex_array_part *part;
228
229 if (start >= fa->total_nr_elements || end >= fa->total_nr_elements)
230 return -ENOSPC;
231 if (elements_fit_in_base(fa))
232 return 0;
233 start_part = fa_element_to_part_nr(fa, start);
234 end_part = fa_element_to_part_nr(fa, end);
235 for (part_nr = start_part; part_nr <= end_part; part_nr++) {
236 part = __fa_get_part(fa, part_nr, flags);
237 if (!part)
238 return -ENOMEM;
239 }
240 return 0;
241}
242
243/**
244 * flex_array_get - pull data back out of the array
245 * @element_nr: index of the element to fetch from the array
246 *
247 * Returns a pointer to the data at index @element_nr. Note
248 * that this is a copy of the data that was passed in. If you
249 * are using this to store pointers, you'll get back &ptr.
250 *
251 * Locking must be provided by the caller.
252 */
253void *flex_array_get(struct flex_array *fa, int element_nr)
254{
255 int part_nr = fa_element_to_part_nr(fa, element_nr);
256 struct flex_array_part *part;
257 int index;
258
259 if (element_nr >= fa->total_nr_elements)
260 return NULL;
261 if (!fa->parts[part_nr])
262 return NULL;
263 if (elements_fit_in_base(fa))
264 part = (struct flex_array_part *)&fa->parts[0];
265 else
266 part = fa->parts[part_nr];
267 index = index_inside_part(fa, element_nr);
268 return &part->elements[index_inside_part(fa, element_nr)];
269}
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index a295e404e908..0d475d8167bf 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -314,6 +314,7 @@ void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
314 miter->__sg = sgl; 314 miter->__sg = sgl;
315 miter->__nents = nents; 315 miter->__nents = nents;
316 miter->__offset = 0; 316 miter->__offset = 0;
317 WARN_ON(!(flags & (SG_MITER_TO_SG | SG_MITER_FROM_SG)));
317 miter->__flags = flags; 318 miter->__flags = flags;
318} 319}
319EXPORT_SYMBOL(sg_miter_start); 320EXPORT_SYMBOL(sg_miter_start);
@@ -394,6 +395,9 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
394 if (miter->addr) { 395 if (miter->addr) {
395 miter->__offset += miter->consumed; 396 miter->__offset += miter->consumed;
396 397
398 if (miter->__flags & SG_MITER_TO_SG)
399 flush_kernel_dcache_page(miter->page);
400
397 if (miter->__flags & SG_MITER_ATOMIC) { 401 if (miter->__flags & SG_MITER_ATOMIC) {
398 WARN_ON(!irqs_disabled()); 402 WARN_ON(!irqs_disabled());
399 kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ); 403 kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ);
@@ -426,8 +430,14 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents,
426 unsigned int offset = 0; 430 unsigned int offset = 0;
427 struct sg_mapping_iter miter; 431 struct sg_mapping_iter miter;
428 unsigned long flags; 432 unsigned long flags;
433 unsigned int sg_flags = SG_MITER_ATOMIC;
434
435 if (to_buffer)
436 sg_flags |= SG_MITER_FROM_SG;
437 else
438 sg_flags |= SG_MITER_TO_SG;
429 439
430 sg_miter_start(&miter, sgl, nents, SG_MITER_ATOMIC); 440 sg_miter_start(&miter, sgl, nents, sg_flags);
431 441
432 local_irq_save(flags); 442 local_irq_save(flags);
433 443
@@ -438,10 +448,8 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents,
438 448
439 if (to_buffer) 449 if (to_buffer)
440 memcpy(buf + offset, miter.addr, len); 450 memcpy(buf + offset, miter.addr, len);
441 else { 451 else
442 memcpy(miter.addr, buf + offset, len); 452 memcpy(miter.addr, buf + offset, len);
443 flush_kernel_dcache_page(miter.page);
444 }
445 453
446 offset += len; 454 offset += len;
447 } 455 }
diff --git a/mm/bootmem.c b/mm/bootmem.c
index d2a9ce952768..701740c9e81b 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -12,6 +12,7 @@
12#include <linux/pfn.h> 12#include <linux/pfn.h>
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/kmemleak.h>
15 16
16#include <asm/bug.h> 17#include <asm/bug.h>
17#include <asm/io.h> 18#include <asm/io.h>
@@ -335,6 +336,8 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
335{ 336{
336 unsigned long start, end; 337 unsigned long start, end;
337 338
339 kmemleak_free_part(__va(physaddr), size);
340
338 start = PFN_UP(physaddr); 341 start = PFN_UP(physaddr);
339 end = PFN_DOWN(physaddr + size); 342 end = PFN_DOWN(physaddr + size);
340 343
@@ -354,6 +357,8 @@ void __init free_bootmem(unsigned long addr, unsigned long size)
354{ 357{
355 unsigned long start, end; 358 unsigned long start, end;
356 359
360 kmemleak_free_part(__va(addr), size);
361
357 start = PFN_UP(addr); 362 start = PFN_UP(addr);
358 end = PFN_DOWN(addr + size); 363 end = PFN_DOWN(addr + size);
359 364
@@ -516,6 +521,7 @@ find_block:
516 region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) + 521 region = phys_to_virt(PFN_PHYS(bdata->node_min_pfn) +
517 start_off); 522 start_off);
518 memset(region, 0, size); 523 memset(region, 0, size);
524 kmemleak_alloc(region, size, 1, 0);
519 return region; 525 return region;
520 } 526 }
521 527
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index d0351e31f474..cafdcee154e8 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2370,7 +2370,7 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed)
2370 long chg = region_truncate(&inode->i_mapping->private_list, offset); 2370 long chg = region_truncate(&inode->i_mapping->private_list, offset);
2371 2371
2372 spin_lock(&inode->i_lock); 2372 spin_lock(&inode->i_lock);
2373 inode->i_blocks -= blocks_per_huge_page(h); 2373 inode->i_blocks -= (blocks_per_huge_page(h) * freed);
2374 spin_unlock(&inode->i_lock); 2374 spin_unlock(&inode->i_lock);
2375 2375
2376 hugetlb_put_quota(inode->i_mapping, (chg - freed)); 2376 hugetlb_put_quota(inode->i_mapping, (chg - freed));
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index e766e1da09d2..487267310a84 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -103,10 +103,10 @@
103 * Kmemleak configuration and common defines. 103 * Kmemleak configuration and common defines.
104 */ 104 */
105#define MAX_TRACE 16 /* stack trace length */ 105#define MAX_TRACE 16 /* stack trace length */
106#define REPORTS_NR 50 /* maximum number of reported leaks */
107#define MSECS_MIN_AGE 5000 /* minimum object age for reporting */ 106#define MSECS_MIN_AGE 5000 /* minimum object age for reporting */
108#define SECS_FIRST_SCAN 60 /* delay before the first scan */ 107#define SECS_FIRST_SCAN 60 /* delay before the first scan */
109#define SECS_SCAN_WAIT 600 /* subsequent auto scanning delay */ 108#define SECS_SCAN_WAIT 600 /* subsequent auto scanning delay */
109#define GRAY_LIST_PASSES 25 /* maximum number of gray list scans */
110 110
111#define BYTES_PER_POINTER sizeof(void *) 111#define BYTES_PER_POINTER sizeof(void *)
112 112
@@ -158,6 +158,8 @@ struct kmemleak_object {
158#define OBJECT_REPORTED (1 << 1) 158#define OBJECT_REPORTED (1 << 1)
159/* flag set to not scan the object */ 159/* flag set to not scan the object */
160#define OBJECT_NO_SCAN (1 << 2) 160#define OBJECT_NO_SCAN (1 << 2)
161/* flag set on newly allocated objects */
162#define OBJECT_NEW (1 << 3)
161 163
162/* the list of all allocated objects */ 164/* the list of all allocated objects */
163static LIST_HEAD(object_list); 165static LIST_HEAD(object_list);
@@ -196,9 +198,6 @@ static int kmemleak_stack_scan = 1;
196/* protects the memory scanning, parameters and debug/kmemleak file access */ 198/* protects the memory scanning, parameters and debug/kmemleak file access */
197static DEFINE_MUTEX(scan_mutex); 199static DEFINE_MUTEX(scan_mutex);
198 200
199/* number of leaks reported (for limitation purposes) */
200static int reported_leaks;
201
202/* 201/*
203 * Early object allocation/freeing logging. Kmemleak is initialized after the 202 * Early object allocation/freeing logging. Kmemleak is initialized after the
204 * kernel allocator. However, both the kernel allocator and kmemleak may 203 * kernel allocator. However, both the kernel allocator and kmemleak may
@@ -211,6 +210,7 @@ static int reported_leaks;
211enum { 210enum {
212 KMEMLEAK_ALLOC, 211 KMEMLEAK_ALLOC,
213 KMEMLEAK_FREE, 212 KMEMLEAK_FREE,
213 KMEMLEAK_FREE_PART,
214 KMEMLEAK_NOT_LEAK, 214 KMEMLEAK_NOT_LEAK,
215 KMEMLEAK_IGNORE, 215 KMEMLEAK_IGNORE,
216 KMEMLEAK_SCAN_AREA, 216 KMEMLEAK_SCAN_AREA,
@@ -274,6 +274,11 @@ static int color_gray(const struct kmemleak_object *object)
274 return object->min_count != -1 && object->count >= object->min_count; 274 return object->min_count != -1 && object->count >= object->min_count;
275} 275}
276 276
277static int color_black(const struct kmemleak_object *object)
278{
279 return object->min_count == -1;
280}
281
277/* 282/*
278 * Objects are considered unreferenced only if their color is white, they have 283 * Objects are considered unreferenced only if their color is white, they have
279 * not be deleted and have a minimum age to avoid false positives caused by 284 * not be deleted and have a minimum age to avoid false positives caused by
@@ -451,7 +456,7 @@ static void create_object(unsigned long ptr, size_t size, int min_count,
451 INIT_HLIST_HEAD(&object->area_list); 456 INIT_HLIST_HEAD(&object->area_list);
452 spin_lock_init(&object->lock); 457 spin_lock_init(&object->lock);
453 atomic_set(&object->use_count, 1); 458 atomic_set(&object->use_count, 1);
454 object->flags = OBJECT_ALLOCATED; 459 object->flags = OBJECT_ALLOCATED | OBJECT_NEW;
455 object->pointer = ptr; 460 object->pointer = ptr;
456 object->size = size; 461 object->size = size;
457 object->min_count = min_count; 462 object->min_count = min_count;
@@ -519,27 +524,17 @@ out:
519 * Remove the metadata (struct kmemleak_object) for a memory block from the 524 * Remove the metadata (struct kmemleak_object) for a memory block from the
520 * object_list and object_tree_root and decrement its use_count. 525 * object_list and object_tree_root and decrement its use_count.
521 */ 526 */
522static void delete_object(unsigned long ptr) 527static void __delete_object(struct kmemleak_object *object)
523{ 528{
524 unsigned long flags; 529 unsigned long flags;
525 struct kmemleak_object *object;
526 530
527 write_lock_irqsave(&kmemleak_lock, flags); 531 write_lock_irqsave(&kmemleak_lock, flags);
528 object = lookup_object(ptr, 0);
529 if (!object) {
530#ifdef DEBUG
531 kmemleak_warn("Freeing unknown object at 0x%08lx\n",
532 ptr);
533#endif
534 write_unlock_irqrestore(&kmemleak_lock, flags);
535 return;
536 }
537 prio_tree_remove(&object_tree_root, &object->tree_node); 532 prio_tree_remove(&object_tree_root, &object->tree_node);
538 list_del_rcu(&object->object_list); 533 list_del_rcu(&object->object_list);
539 write_unlock_irqrestore(&kmemleak_lock, flags); 534 write_unlock_irqrestore(&kmemleak_lock, flags);
540 535
541 WARN_ON(!(object->flags & OBJECT_ALLOCATED)); 536 WARN_ON(!(object->flags & OBJECT_ALLOCATED));
542 WARN_ON(atomic_read(&object->use_count) < 1); 537 WARN_ON(atomic_read(&object->use_count) < 2);
543 538
544 /* 539 /*
545 * Locking here also ensures that the corresponding memory block 540 * Locking here also ensures that the corresponding memory block
@@ -552,6 +547,64 @@ static void delete_object(unsigned long ptr)
552} 547}
553 548
554/* 549/*
550 * Look up the metadata (struct kmemleak_object) corresponding to ptr and
551 * delete it.
552 */
553static void delete_object_full(unsigned long ptr)
554{
555 struct kmemleak_object *object;
556
557 object = find_and_get_object(ptr, 0);
558 if (!object) {
559#ifdef DEBUG
560 kmemleak_warn("Freeing unknown object at 0x%08lx\n",
561 ptr);
562#endif
563 return;
564 }
565 __delete_object(object);
566 put_object(object);
567}
568
569/*
570 * Look up the metadata (struct kmemleak_object) corresponding to ptr and
571 * delete it. If the memory block is partially freed, the function may create
572 * additional metadata for the remaining parts of the block.
573 */
574static void delete_object_part(unsigned long ptr, size_t size)
575{
576 struct kmemleak_object *object;
577 unsigned long start, end;
578
579 object = find_and_get_object(ptr, 1);
580 if (!object) {
581#ifdef DEBUG
582 kmemleak_warn("Partially freeing unknown object at 0x%08lx "
583 "(size %zu)\n", ptr, size);
584#endif
585 return;
586 }
587 __delete_object(object);
588
589 /*
590 * Create one or two objects that may result from the memory block
591 * split. Note that partial freeing is only done by free_bootmem() and
592 * this happens before kmemleak_init() is called. The path below is
593 * only executed during early log recording in kmemleak_init(), so
594 * GFP_KERNEL is enough.
595 */
596 start = object->pointer;
597 end = object->pointer + object->size;
598 if (ptr > start)
599 create_object(start, ptr - start, object->min_count,
600 GFP_KERNEL);
601 if (ptr + size < end)
602 create_object(ptr + size, end - ptr - size, object->min_count,
603 GFP_KERNEL);
604
605 put_object(object);
606}
607/*
555 * Make a object permanently as gray-colored so that it can no longer be 608 * Make a object permanently as gray-colored so that it can no longer be
556 * reported as a leak. This is used in general to mark a false positive. 609 * reported as a leak. This is used in general to mark a false positive.
557 */ 610 */
@@ -715,13 +768,28 @@ void kmemleak_free(const void *ptr)
715 pr_debug("%s(0x%p)\n", __func__, ptr); 768 pr_debug("%s(0x%p)\n", __func__, ptr);
716 769
717 if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr)) 770 if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr))
718 delete_object((unsigned long)ptr); 771 delete_object_full((unsigned long)ptr);
719 else if (atomic_read(&kmemleak_early_log)) 772 else if (atomic_read(&kmemleak_early_log))
720 log_early(KMEMLEAK_FREE, ptr, 0, 0, 0, 0); 773 log_early(KMEMLEAK_FREE, ptr, 0, 0, 0, 0);
721} 774}
722EXPORT_SYMBOL_GPL(kmemleak_free); 775EXPORT_SYMBOL_GPL(kmemleak_free);
723 776
724/* 777/*
778 * Partial memory freeing function callback. This function is usually called
779 * from bootmem allocator when (part of) a memory block is freed.
780 */
781void kmemleak_free_part(const void *ptr, size_t size)
782{
783 pr_debug("%s(0x%p)\n", __func__, ptr);
784
785 if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr))
786 delete_object_part((unsigned long)ptr, size);
787 else if (atomic_read(&kmemleak_early_log))
788 log_early(KMEMLEAK_FREE_PART, ptr, size, 0, 0, 0);
789}
790EXPORT_SYMBOL_GPL(kmemleak_free_part);
791
792/*
725 * Mark an already allocated memory block as a false positive. This will cause 793 * Mark an already allocated memory block as a false positive. This will cause
726 * the block to no longer be reported as leak and always be scanned. 794 * the block to no longer be reported as leak and always be scanned.
727 */ 795 */
@@ -807,7 +875,7 @@ static int scan_should_stop(void)
807 * found to the gray list. 875 * found to the gray list.
808 */ 876 */
809static void scan_block(void *_start, void *_end, 877static void scan_block(void *_start, void *_end,
810 struct kmemleak_object *scanned) 878 struct kmemleak_object *scanned, int allow_resched)
811{ 879{
812 unsigned long *ptr; 880 unsigned long *ptr;
813 unsigned long *start = PTR_ALIGN(_start, BYTES_PER_POINTER); 881 unsigned long *start = PTR_ALIGN(_start, BYTES_PER_POINTER);
@@ -818,6 +886,8 @@ static void scan_block(void *_start, void *_end,
818 unsigned long pointer = *ptr; 886 unsigned long pointer = *ptr;
819 struct kmemleak_object *object; 887 struct kmemleak_object *object;
820 888
889 if (allow_resched)
890 cond_resched();
821 if (scan_should_stop()) 891 if (scan_should_stop())
822 break; 892 break;
823 893
@@ -881,12 +951,12 @@ static void scan_object(struct kmemleak_object *object)
881 goto out; 951 goto out;
882 if (hlist_empty(&object->area_list)) 952 if (hlist_empty(&object->area_list))
883 scan_block((void *)object->pointer, 953 scan_block((void *)object->pointer,
884 (void *)(object->pointer + object->size), object); 954 (void *)(object->pointer + object->size), object, 0);
885 else 955 else
886 hlist_for_each_entry(area, elem, &object->area_list, node) 956 hlist_for_each_entry(area, elem, &object->area_list, node)
887 scan_block((void *)(object->pointer + area->offset), 957 scan_block((void *)(object->pointer + area->offset),
888 (void *)(object->pointer + area->offset 958 (void *)(object->pointer + area->offset
889 + area->length), object); 959 + area->length), object, 0);
890out: 960out:
891 spin_unlock_irqrestore(&object->lock, flags); 961 spin_unlock_irqrestore(&object->lock, flags);
892} 962}
@@ -903,6 +973,7 @@ static void kmemleak_scan(void)
903 struct task_struct *task; 973 struct task_struct *task;
904 int i; 974 int i;
905 int new_leaks = 0; 975 int new_leaks = 0;
976 int gray_list_pass = 0;
906 977
907 jiffies_last_scan = jiffies; 978 jiffies_last_scan = jiffies;
908 979
@@ -923,6 +994,7 @@ static void kmemleak_scan(void)
923#endif 994#endif
924 /* reset the reference count (whiten the object) */ 995 /* reset the reference count (whiten the object) */
925 object->count = 0; 996 object->count = 0;
997 object->flags &= ~OBJECT_NEW;
926 if (color_gray(object) && get_object(object)) 998 if (color_gray(object) && get_object(object))
927 list_add_tail(&object->gray_list, &gray_list); 999 list_add_tail(&object->gray_list, &gray_list);
928 1000
@@ -931,14 +1003,14 @@ static void kmemleak_scan(void)
931 rcu_read_unlock(); 1003 rcu_read_unlock();
932 1004
933 /* data/bss scanning */ 1005 /* data/bss scanning */
934 scan_block(_sdata, _edata, NULL); 1006 scan_block(_sdata, _edata, NULL, 1);
935 scan_block(__bss_start, __bss_stop, NULL); 1007 scan_block(__bss_start, __bss_stop, NULL, 1);
936 1008
937#ifdef CONFIG_SMP 1009#ifdef CONFIG_SMP
938 /* per-cpu sections scanning */ 1010 /* per-cpu sections scanning */
939 for_each_possible_cpu(i) 1011 for_each_possible_cpu(i)
940 scan_block(__per_cpu_start + per_cpu_offset(i), 1012 scan_block(__per_cpu_start + per_cpu_offset(i),
941 __per_cpu_end + per_cpu_offset(i), NULL); 1013 __per_cpu_end + per_cpu_offset(i), NULL, 1);
942#endif 1014#endif
943 1015
944 /* 1016 /*
@@ -960,7 +1032,7 @@ static void kmemleak_scan(void)
960 /* only scan if page is in use */ 1032 /* only scan if page is in use */
961 if (page_count(page) == 0) 1033 if (page_count(page) == 0)
962 continue; 1034 continue;
963 scan_block(page, page + 1, NULL); 1035 scan_block(page, page + 1, NULL, 1);
964 } 1036 }
965 } 1037 }
966 1038
@@ -972,7 +1044,8 @@ static void kmemleak_scan(void)
972 read_lock(&tasklist_lock); 1044 read_lock(&tasklist_lock);
973 for_each_process(task) 1045 for_each_process(task)
974 scan_block(task_stack_page(task), 1046 scan_block(task_stack_page(task),
975 task_stack_page(task) + THREAD_SIZE, NULL); 1047 task_stack_page(task) + THREAD_SIZE,
1048 NULL, 0);
976 read_unlock(&tasklist_lock); 1049 read_unlock(&tasklist_lock);
977 } 1050 }
978 1051
@@ -984,6 +1057,7 @@ static void kmemleak_scan(void)
984 * kmemleak objects cannot be freed from outside the loop because their 1057 * kmemleak objects cannot be freed from outside the loop because their
985 * use_count was increased. 1058 * use_count was increased.
986 */ 1059 */
1060repeat:
987 object = list_entry(gray_list.next, typeof(*object), gray_list); 1061 object = list_entry(gray_list.next, typeof(*object), gray_list);
988 while (&object->gray_list != &gray_list) { 1062 while (&object->gray_list != &gray_list) {
989 cond_resched(); 1063 cond_resched();
@@ -1001,12 +1075,38 @@ static void kmemleak_scan(void)
1001 1075
1002 object = tmp; 1076 object = tmp;
1003 } 1077 }
1078
1079 if (scan_should_stop() || ++gray_list_pass >= GRAY_LIST_PASSES)
1080 goto scan_end;
1081
1082 /*
1083 * Check for new objects allocated during this scanning and add them
1084 * to the gray list.
1085 */
1086 rcu_read_lock();
1087 list_for_each_entry_rcu(object, &object_list, object_list) {
1088 spin_lock_irqsave(&object->lock, flags);
1089 if ((object->flags & OBJECT_NEW) && !color_black(object) &&
1090 get_object(object)) {
1091 object->flags &= ~OBJECT_NEW;
1092 list_add_tail(&object->gray_list, &gray_list);
1093 }
1094 spin_unlock_irqrestore(&object->lock, flags);
1095 }
1096 rcu_read_unlock();
1097
1098 if (!list_empty(&gray_list))
1099 goto repeat;
1100
1101scan_end:
1004 WARN_ON(!list_empty(&gray_list)); 1102 WARN_ON(!list_empty(&gray_list));
1005 1103
1006 /* 1104 /*
1007 * If scanning was stopped do not report any new unreferenced objects. 1105 * If scanning was stopped or new objects were being allocated at a
1106 * higher rate than gray list scanning, do not report any new
1107 * unreferenced objects.
1008 */ 1108 */
1009 if (scan_should_stop()) 1109 if (scan_should_stop() || gray_list_pass >= GRAY_LIST_PASSES)
1010 return; 1110 return;
1011 1111
1012 /* 1112 /*
@@ -1039,6 +1139,7 @@ static int kmemleak_scan_thread(void *arg)
1039 static int first_run = 1; 1139 static int first_run = 1;
1040 1140
1041 pr_info("Automatic memory scanning thread started\n"); 1141 pr_info("Automatic memory scanning thread started\n");
1142 set_user_nice(current, 10);
1042 1143
1043 /* 1144 /*
1044 * Wait before the first scan to allow the system to fully initialize. 1145 * Wait before the first scan to allow the system to fully initialize.
@@ -1101,11 +1202,11 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
1101{ 1202{
1102 struct kmemleak_object *object; 1203 struct kmemleak_object *object;
1103 loff_t n = *pos; 1204 loff_t n = *pos;
1205 int err;
1104 1206
1105 if (!n) 1207 err = mutex_lock_interruptible(&scan_mutex);
1106 reported_leaks = 0; 1208 if (err < 0)
1107 if (reported_leaks >= REPORTS_NR) 1209 return ERR_PTR(err);
1108 return NULL;
1109 1210
1110 rcu_read_lock(); 1211 rcu_read_lock();
1111 list_for_each_entry_rcu(object, &object_list, object_list) { 1212 list_for_each_entry_rcu(object, &object_list, object_list) {
@@ -1116,7 +1217,6 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
1116 } 1217 }
1117 object = NULL; 1218 object = NULL;
1118out: 1219out:
1119 rcu_read_unlock();
1120 return object; 1220 return object;
1121} 1221}
1122 1222
@@ -1131,17 +1231,13 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1131 struct list_head *n = &prev_obj->object_list; 1231 struct list_head *n = &prev_obj->object_list;
1132 1232
1133 ++(*pos); 1233 ++(*pos);
1134 if (reported_leaks >= REPORTS_NR)
1135 goto out;
1136 1234
1137 rcu_read_lock();
1138 list_for_each_continue_rcu(n, &object_list) { 1235 list_for_each_continue_rcu(n, &object_list) {
1139 next_obj = list_entry(n, struct kmemleak_object, object_list); 1236 next_obj = list_entry(n, struct kmemleak_object, object_list);
1140 if (get_object(next_obj)) 1237 if (get_object(next_obj))
1141 break; 1238 break;
1142 } 1239 }
1143 rcu_read_unlock(); 1240
1144out:
1145 put_object(prev_obj); 1241 put_object(prev_obj);
1146 return next_obj; 1242 return next_obj;
1147} 1243}
@@ -1151,8 +1247,16 @@ out:
1151 */ 1247 */
1152static void kmemleak_seq_stop(struct seq_file *seq, void *v) 1248static void kmemleak_seq_stop(struct seq_file *seq, void *v)
1153{ 1249{
1154 if (v) 1250 if (!IS_ERR(v)) {
1155 put_object(v); 1251 /*
1252 * kmemleak_seq_start may return ERR_PTR if the scan_mutex
1253 * waiting was interrupted, so only release it if !IS_ERR.
1254 */
1255 rcu_read_unlock();
1256 mutex_unlock(&scan_mutex);
1257 if (v)
1258 put_object(v);
1259 }
1156} 1260}
1157 1261
1158/* 1262/*
@@ -1164,10 +1268,8 @@ static int kmemleak_seq_show(struct seq_file *seq, void *v)
1164 unsigned long flags; 1268 unsigned long flags;
1165 1269
1166 spin_lock_irqsave(&object->lock, flags); 1270 spin_lock_irqsave(&object->lock, flags);
1167 if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object)) { 1271 if ((object->flags & OBJECT_REPORTED) && unreferenced_object(object))
1168 print_unreferenced(seq, object); 1272 print_unreferenced(seq, object);
1169 reported_leaks++;
1170 }
1171 spin_unlock_irqrestore(&object->lock, flags); 1273 spin_unlock_irqrestore(&object->lock, flags);
1172 return 0; 1274 return 0;
1173} 1275}
@@ -1181,36 +1283,15 @@ static const struct seq_operations kmemleak_seq_ops = {
1181 1283
1182static int kmemleak_open(struct inode *inode, struct file *file) 1284static int kmemleak_open(struct inode *inode, struct file *file)
1183{ 1285{
1184 int ret = 0;
1185
1186 if (!atomic_read(&kmemleak_enabled)) 1286 if (!atomic_read(&kmemleak_enabled))
1187 return -EBUSY; 1287 return -EBUSY;
1188 1288
1189 ret = mutex_lock_interruptible(&scan_mutex); 1289 return seq_open(file, &kmemleak_seq_ops);
1190 if (ret < 0)
1191 goto out;
1192 if (file->f_mode & FMODE_READ) {
1193 ret = seq_open(file, &kmemleak_seq_ops);
1194 if (ret < 0)
1195 goto scan_unlock;
1196 }
1197 return ret;
1198
1199scan_unlock:
1200 mutex_unlock(&scan_mutex);
1201out:
1202 return ret;
1203} 1290}
1204 1291
1205static int kmemleak_release(struct inode *inode, struct file *file) 1292static int kmemleak_release(struct inode *inode, struct file *file)
1206{ 1293{
1207 int ret = 0; 1294 return seq_release(inode, file);
1208
1209 if (file->f_mode & FMODE_READ)
1210 seq_release(inode, file);
1211 mutex_unlock(&scan_mutex);
1212
1213 return ret;
1214} 1295}
1215 1296
1216/* 1297/*
@@ -1230,15 +1311,17 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
1230{ 1311{
1231 char buf[64]; 1312 char buf[64];
1232 int buf_size; 1313 int buf_size;
1233 1314 int ret;
1234 if (!atomic_read(&kmemleak_enabled))
1235 return -EBUSY;
1236 1315
1237 buf_size = min(size, (sizeof(buf) - 1)); 1316 buf_size = min(size, (sizeof(buf) - 1));
1238 if (strncpy_from_user(buf, user_buf, buf_size) < 0) 1317 if (strncpy_from_user(buf, user_buf, buf_size) < 0)
1239 return -EFAULT; 1318 return -EFAULT;
1240 buf[buf_size] = 0; 1319 buf[buf_size] = 0;
1241 1320
1321 ret = mutex_lock_interruptible(&scan_mutex);
1322 if (ret < 0)
1323 return ret;
1324
1242 if (strncmp(buf, "off", 3) == 0) 1325 if (strncmp(buf, "off", 3) == 0)
1243 kmemleak_disable(); 1326 kmemleak_disable();
1244 else if (strncmp(buf, "stack=on", 8) == 0) 1327 else if (strncmp(buf, "stack=on", 8) == 0)
@@ -1251,11 +1334,10 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
1251 stop_scan_thread(); 1334 stop_scan_thread();
1252 else if (strncmp(buf, "scan=", 5) == 0) { 1335 else if (strncmp(buf, "scan=", 5) == 0) {
1253 unsigned long secs; 1336 unsigned long secs;
1254 int err;
1255 1337
1256 err = strict_strtoul(buf + 5, 0, &secs); 1338 ret = strict_strtoul(buf + 5, 0, &secs);
1257 if (err < 0) 1339 if (ret < 0)
1258 return err; 1340 goto out;
1259 stop_scan_thread(); 1341 stop_scan_thread();
1260 if (secs) { 1342 if (secs) {
1261 jiffies_scan_wait = msecs_to_jiffies(secs * 1000); 1343 jiffies_scan_wait = msecs_to_jiffies(secs * 1000);
@@ -1264,7 +1346,12 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
1264 } else if (strncmp(buf, "scan", 4) == 0) 1346 } else if (strncmp(buf, "scan", 4) == 0)
1265 kmemleak_scan(); 1347 kmemleak_scan();
1266 else 1348 else
1267 return -EINVAL; 1349 ret = -EINVAL;
1350
1351out:
1352 mutex_unlock(&scan_mutex);
1353 if (ret < 0)
1354 return ret;
1268 1355
1269 /* ignore the rest of the buffer, only one command at a time */ 1356 /* ignore the rest of the buffer, only one command at a time */
1270 *ppos += size; 1357 *ppos += size;
@@ -1293,7 +1380,7 @@ static int kmemleak_cleanup_thread(void *arg)
1293 1380
1294 rcu_read_lock(); 1381 rcu_read_lock();
1295 list_for_each_entry_rcu(object, &object_list, object_list) 1382 list_for_each_entry_rcu(object, &object_list, object_list)
1296 delete_object(object->pointer); 1383 delete_object_full(object->pointer);
1297 rcu_read_unlock(); 1384 rcu_read_unlock();
1298 mutex_unlock(&scan_mutex); 1385 mutex_unlock(&scan_mutex);
1299 1386
@@ -1388,6 +1475,9 @@ void __init kmemleak_init(void)
1388 case KMEMLEAK_FREE: 1475 case KMEMLEAK_FREE:
1389 kmemleak_free(log->ptr); 1476 kmemleak_free(log->ptr);
1390 break; 1477 break;
1478 case KMEMLEAK_FREE_PART:
1479 kmemleak_free_part(log->ptr, log->size);
1480 break;
1391 case KMEMLEAK_NOT_LEAK: 1481 case KMEMLEAK_NOT_LEAK:
1392 kmemleak_not_leak(log->ptr); 1482 kmemleak_not_leak(log->ptr);
1393 break; 1483 break;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e717964cb5a0..fd4529d86de5 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1207,6 +1207,12 @@ static int mem_cgroup_move_account(struct page_cgroup *pc,
1207 ret = 0; 1207 ret = 0;
1208out: 1208out:
1209 unlock_page_cgroup(pc); 1209 unlock_page_cgroup(pc);
1210 /*
1211 * We charges against "to" which may not have any tasks. Then, "to"
1212 * can be under rmdir(). But in current implementation, caller of
1213 * this function is just force_empty() and it's garanteed that
1214 * "to" is never removed. So, we don't check rmdir status here.
1215 */
1210 return ret; 1216 return ret;
1211} 1217}
1212 1218
@@ -1428,6 +1434,7 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
1428 return; 1434 return;
1429 if (!ptr) 1435 if (!ptr)
1430 return; 1436 return;
1437 cgroup_exclude_rmdir(&ptr->css);
1431 pc = lookup_page_cgroup(page); 1438 pc = lookup_page_cgroup(page);
1432 mem_cgroup_lru_del_before_commit_swapcache(page); 1439 mem_cgroup_lru_del_before_commit_swapcache(page);
1433 __mem_cgroup_commit_charge(ptr, pc, ctype); 1440 __mem_cgroup_commit_charge(ptr, pc, ctype);
@@ -1457,8 +1464,12 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
1457 } 1464 }
1458 rcu_read_unlock(); 1465 rcu_read_unlock();
1459 } 1466 }
1460 /* add this page(page_cgroup) to the LRU we want. */ 1467 /*
1461 1468 * At swapin, we may charge account against cgroup which has no tasks.
1469 * So, rmdir()->pre_destroy() can be called while we do this charge.
1470 * In that case, we need to call pre_destroy() again. check it here.
1471 */
1472 cgroup_release_and_wakeup_rmdir(&ptr->css);
1462} 1473}
1463 1474
1464void mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr) 1475void mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr)
@@ -1664,7 +1675,7 @@ void mem_cgroup_end_migration(struct mem_cgroup *mem,
1664 1675
1665 if (!mem) 1676 if (!mem)
1666 return; 1677 return;
1667 1678 cgroup_exclude_rmdir(&mem->css);
1668 /* at migration success, oldpage->mapping is NULL. */ 1679 /* at migration success, oldpage->mapping is NULL. */
1669 if (oldpage->mapping) { 1680 if (oldpage->mapping) {
1670 target = oldpage; 1681 target = oldpage;
@@ -1704,6 +1715,12 @@ void mem_cgroup_end_migration(struct mem_cgroup *mem,
1704 */ 1715 */
1705 if (ctype == MEM_CGROUP_CHARGE_TYPE_MAPPED) 1716 if (ctype == MEM_CGROUP_CHARGE_TYPE_MAPPED)
1706 mem_cgroup_uncharge_page(target); 1717 mem_cgroup_uncharge_page(target);
1718 /*
1719 * At migration, we may charge account against cgroup which has no tasks
1720 * So, rmdir()->pre_destroy() can be called while we do this charge.
1721 * In that case, we need to call pre_destroy() again. check it here.
1722 */
1723 cgroup_release_and_wakeup_rmdir(&mem->css);
1707} 1724}
1708 1725
1709/* 1726/*
diff --git a/mm/memory.c b/mm/memory.c
index 65216194eb8d..aede2ce3aba4 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -135,11 +135,12 @@ void pmd_clear_bad(pmd_t *pmd)
135 * Note: this doesn't free the actual pages themselves. That 135 * Note: this doesn't free the actual pages themselves. That
136 * has been handled earlier when unmapping all the memory regions. 136 * has been handled earlier when unmapping all the memory regions.
137 */ 137 */
138static void free_pte_range(struct mmu_gather *tlb, pmd_t *pmd) 138static void free_pte_range(struct mmu_gather *tlb, pmd_t *pmd,
139 unsigned long addr)
139{ 140{
140 pgtable_t token = pmd_pgtable(*pmd); 141 pgtable_t token = pmd_pgtable(*pmd);
141 pmd_clear(pmd); 142 pmd_clear(pmd);
142 pte_free_tlb(tlb, token); 143 pte_free_tlb(tlb, token, addr);
143 tlb->mm->nr_ptes--; 144 tlb->mm->nr_ptes--;
144} 145}
145 146
@@ -157,7 +158,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
157 next = pmd_addr_end(addr, end); 158 next = pmd_addr_end(addr, end);
158 if (pmd_none_or_clear_bad(pmd)) 159 if (pmd_none_or_clear_bad(pmd))
159 continue; 160 continue;
160 free_pte_range(tlb, pmd); 161 free_pte_range(tlb, pmd, addr);
161 } while (pmd++, addr = next, addr != end); 162 } while (pmd++, addr = next, addr != end);
162 163
163 start &= PUD_MASK; 164 start &= PUD_MASK;
@@ -173,7 +174,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
173 174
174 pmd = pmd_offset(pud, start); 175 pmd = pmd_offset(pud, start);
175 pud_clear(pud); 176 pud_clear(pud);
176 pmd_free_tlb(tlb, pmd); 177 pmd_free_tlb(tlb, pmd, start);
177} 178}
178 179
179static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd, 180static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
@@ -206,7 +207,7 @@ static inline void free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
206 207
207 pud = pud_offset(pgd, start); 208 pud = pud_offset(pgd, start);
208 pgd_clear(pgd); 209 pgd_clear(pgd);
209 pud_free_tlb(tlb, pud); 210 pud_free_tlb(tlb, pud, start);
210} 211}
211 212
212/* 213/*
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a35eeab2724c..d052abbe3063 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -882,7 +882,7 @@ retry_reserve:
882 */ 882 */
883static int rmqueue_bulk(struct zone *zone, unsigned int order, 883static int rmqueue_bulk(struct zone *zone, unsigned int order,
884 unsigned long count, struct list_head *list, 884 unsigned long count, struct list_head *list,
885 int migratetype) 885 int migratetype, int cold)
886{ 886{
887 int i; 887 int i;
888 888
@@ -901,7 +901,10 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
901 * merge IO requests if the physical pages are ordered 901 * merge IO requests if the physical pages are ordered
902 * properly. 902 * properly.
903 */ 903 */
904 list_add(&page->lru, list); 904 if (likely(cold == 0))
905 list_add(&page->lru, list);
906 else
907 list_add_tail(&page->lru, list);
905 set_page_private(page, migratetype); 908 set_page_private(page, migratetype);
906 list = &page->lru; 909 list = &page->lru;
907 } 910 }
@@ -1119,7 +1122,8 @@ again:
1119 local_irq_save(flags); 1122 local_irq_save(flags);
1120 if (!pcp->count) { 1123 if (!pcp->count) {
1121 pcp->count = rmqueue_bulk(zone, 0, 1124 pcp->count = rmqueue_bulk(zone, 0,
1122 pcp->batch, &pcp->list, migratetype); 1125 pcp->batch, &pcp->list,
1126 migratetype, cold);
1123 if (unlikely(!pcp->count)) 1127 if (unlikely(!pcp->count))
1124 goto failed; 1128 goto failed;
1125 } 1129 }
@@ -1138,7 +1142,8 @@ again:
1138 /* Allocate more to the pcp list if necessary */ 1142 /* Allocate more to the pcp list if necessary */
1139 if (unlikely(&page->lru == &pcp->list)) { 1143 if (unlikely(&page->lru == &pcp->list)) {
1140 pcp->count += rmqueue_bulk(zone, 0, 1144 pcp->count += rmqueue_bulk(zone, 0,
1141 pcp->batch, &pcp->list, migratetype); 1145 pcp->batch, &pcp->list,
1146 migratetype, cold);
1142 page = list_entry(pcp->list.next, struct page, lru); 1147 page = list_entry(pcp->list.next, struct page, lru);
1143 } 1148 }
1144 1149
@@ -1740,8 +1745,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
1740 * be using allocators in order of preference for an area that is 1745 * be using allocators in order of preference for an area that is
1741 * too large. 1746 * too large.
1742 */ 1747 */
1743 if (WARN_ON_ONCE(order >= MAX_ORDER)) 1748 if (order >= MAX_ORDER) {
1749 WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
1744 return NULL; 1750 return NULL;
1751 }
1745 1752
1746 /* 1753 /*
1747 * GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and 1754 * GFP_THISNODE (meaning __GFP_THISNODE, __GFP_NORETRY and
@@ -1789,6 +1796,10 @@ rebalance:
1789 if (p->flags & PF_MEMALLOC) 1796 if (p->flags & PF_MEMALLOC)
1790 goto nopage; 1797 goto nopage;
1791 1798
1799 /* Avoid allocations with no watermarks from looping endlessly */
1800 if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))
1801 goto nopage;
1802
1792 /* Try direct reclaim and then allocating */ 1803 /* Try direct reclaim and then allocating */
1793 page = __alloc_pages_direct_reclaim(gfp_mask, order, 1804 page = __alloc_pages_direct_reclaim(gfp_mask, order,
1794 zonelist, high_zoneidx, 1805 zonelist, high_zoneidx,
@@ -4745,8 +4756,10 @@ void *__init alloc_large_system_hash(const char *tablename,
4745 * some pages at the end of hash table which 4756 * some pages at the end of hash table which
4746 * alloc_pages_exact() automatically does 4757 * alloc_pages_exact() automatically does
4747 */ 4758 */
4748 if (get_order(size) < MAX_ORDER) 4759 if (get_order(size) < MAX_ORDER) {
4749 table = alloc_pages_exact(size, GFP_ATOMIC); 4760 table = alloc_pages_exact(size, GFP_ATOMIC);
4761 kmemleak_alloc(table, size, 1, GFP_ATOMIC);
4762 }
4750 } 4763 }
4751 } while (!table && size > PAGE_SIZE && --log2qty); 4764 } while (!table && size > PAGE_SIZE && --log2qty);
4752 4765
@@ -4764,16 +4777,6 @@ void *__init alloc_large_system_hash(const char *tablename,
4764 if (_hash_mask) 4777 if (_hash_mask)
4765 *_hash_mask = (1 << log2qty) - 1; 4778 *_hash_mask = (1 << log2qty) - 1;
4766 4779
4767 /*
4768 * If hashdist is set, the table allocation is done with __vmalloc()
4769 * which invokes the kmemleak_alloc() callback. This function may also
4770 * be called before the slab and kmemleak are initialised when
4771 * kmemleak simply buffers the request to be executed later
4772 * (GFP_ATOMIC flag ignored in this case).
4773 */
4774 if (!hashdist)
4775 kmemleak_alloc(table, size, 1, GFP_ATOMIC);
4776
4777 return table; 4780 return table;
4778} 4781}
4779 4782
diff --git a/mm/slub.c b/mm/slub.c
index a9201d83178b..b9f1491a58a1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -21,7 +21,6 @@
21#include <linux/kmemcheck.h> 21#include <linux/kmemcheck.h>
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <linux/cpuset.h> 23#include <linux/cpuset.h>
24#include <linux/kmemleak.h>
25#include <linux/mempolicy.h> 24#include <linux/mempolicy.h>
26#include <linux/ctype.h> 25#include <linux/ctype.h>
27#include <linux/debugobjects.h> 26#include <linux/debugobjects.h>
@@ -2835,13 +2834,15 @@ EXPORT_SYMBOL(__kmalloc);
2835static void *kmalloc_large_node(size_t size, gfp_t flags, int node) 2834static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
2836{ 2835{
2837 struct page *page; 2836 struct page *page;
2837 void *ptr = NULL;
2838 2838
2839 flags |= __GFP_COMP | __GFP_NOTRACK; 2839 flags |= __GFP_COMP | __GFP_NOTRACK;
2840 page = alloc_pages_node(node, flags, get_order(size)); 2840 page = alloc_pages_node(node, flags, get_order(size));
2841 if (page) 2841 if (page)
2842 return page_address(page); 2842 ptr = page_address(page);
2843 else 2843
2844 return NULL; 2844 kmemleak_alloc(ptr, size, 1, flags);
2845 return ptr;
2845} 2846}
2846 2847
2847#ifdef CONFIG_NUMA 2848#ifdef CONFIG_NUMA
@@ -2926,6 +2927,7 @@ void kfree(const void *x)
2926 page = virt_to_head_page(x); 2927 page = virt_to_head_page(x);
2927 if (unlikely(!PageSlab(page))) { 2928 if (unlikely(!PageSlab(page))) {
2928 BUG_ON(!PageCompound(page)); 2929 BUG_ON(!PageCompound(page));
2930 kmemleak_free(x);
2929 put_page(page); 2931 put_page(page);
2930 return; 2932 return;
2931 } 2933 }
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d1ade1a48ee7..8ffdc0d23c53 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -753,7 +753,7 @@ int swap_type_of(dev_t device, sector_t offset, struct block_device **bdev_p)
753 753
754 if (!bdev) { 754 if (!bdev) {
755 if (bdev_p) 755 if (bdev_p)
756 *bdev_p = bdget(sis->bdev->bd_dev); 756 *bdev_p = bdgrab(sis->bdev);
757 757
758 spin_unlock(&swap_lock); 758 spin_unlock(&swap_lock);
759 return i; 759 return i;
@@ -765,7 +765,7 @@ int swap_type_of(dev_t device, sector_t offset, struct block_device **bdev_p)
765 struct swap_extent, list); 765 struct swap_extent, list);
766 if (se->start_block == offset) { 766 if (se->start_block == offset) {
767 if (bdev_p) 767 if (bdev_p)
768 *bdev_p = bdget(sis->bdev->bd_dev); 768 *bdev_p = bdgrab(sis->bdev);
769 769
770 spin_unlock(&swap_lock); 770 spin_unlock(&swap_lock);
771 bdput(bdev); 771 bdput(bdev);
diff --git a/net/9p/client.c b/net/9p/client.c
index dd43a8289b0d..787ccddb85ea 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -117,9 +117,6 @@ static int parse_opts(char *opts, struct p9_client *clnt)
117 } 117 }
118 } 118 }
119 119
120 if (!clnt->trans_mod)
121 clnt->trans_mod = v9fs_get_default_trans();
122
123 kfree(options); 120 kfree(options);
124 return ret; 121 return ret;
125} 122}
@@ -689,6 +686,9 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
689 if (err < 0) 686 if (err < 0)
690 goto error; 687 goto error;
691 688
689 if (!clnt->trans_mod)
690 clnt->trans_mod = v9fs_get_default_trans();
691
692 if (clnt->trans_mod == NULL) { 692 if (clnt->trans_mod == NULL) {
693 err = -EPROTONOSUPPORT; 693 err = -EPROTONOSUPPORT;
694 P9_DPRINTK(P9_DEBUG_ERROR, 694 P9_DPRINTK(P9_DEBUG_ERROR,
@@ -1098,7 +1098,6 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
1098 1098
1099 if (data) { 1099 if (data) {
1100 memmove(data, dataptr, count); 1100 memmove(data, dataptr, count);
1101 data += count;
1102 } 1101 }
1103 1102
1104 if (udata) { 1103 if (udata) {
@@ -1192,9 +1191,9 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1192 1191
1193 err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret); 1192 err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret);
1194 if (err) { 1193 if (err) {
1195 ret = ERR_PTR(err);
1196 p9pdu_dump(1, req->rc); 1194 p9pdu_dump(1, req->rc);
1197 goto free_and_error; 1195 p9_free_req(clnt, req);
1196 goto error;
1198 } 1197 }
1199 1198
1200 P9_DPRINTK(P9_DEBUG_9P, 1199 P9_DPRINTK(P9_DEBUG_9P,
@@ -1211,8 +1210,6 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1211 p9_free_req(clnt, req); 1210 p9_free_req(clnt, req);
1212 return ret; 1211 return ret;
1213 1212
1214free_and_error:
1215 p9_free_req(clnt, req);
1216error: 1213error:
1217 kfree(ret); 1214 kfree(ret);
1218 return ERR_PTR(err); 1215 return ERR_PTR(err);
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 590b83963622..bfbe13786bb4 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -54,6 +54,7 @@
54#include <linux/capability.h> 54#include <linux/capability.h>
55#include <linux/module.h> 55#include <linux/module.h>
56#include <linux/if_arp.h> 56#include <linux/if_arp.h>
57#include <linux/smp_lock.h>
57#include <linux/termios.h> /* For TIOCOUTQ/INQ */ 58#include <linux/termios.h> /* For TIOCOUTQ/INQ */
58#include <net/datalink.h> 59#include <net/datalink.h>
59#include <net/psnap.h> 60#include <net/psnap.h>
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 8a96672e2c5c..eb404dc3ed6e 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -424,7 +424,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
424err2: 424err2:
425 br_fdb_delete_by_port(br, p, 1); 425 br_fdb_delete_by_port(br, p, 1);
426err1: 426err1:
427 kobject_del(&p->kobj); 427 kobject_put(&p->kobj);
428err0: 428err0:
429 dev_set_promiscuity(dev, -1); 429 dev_set_promiscuity(dev, -1);
430put_back: 430put_back:
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 95d7f32643ae..72720c710351 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -75,6 +75,7 @@ static __initdata const char banner[] = KERN_INFO
75MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); 75MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
76MODULE_LICENSE("Dual BSD/GPL"); 76MODULE_LICENSE("Dual BSD/GPL");
77MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>"); 77MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");
78MODULE_ALIAS("can-proto-2");
78 79
79/* easy access to can_frame payload */ 80/* easy access to can_frame payload */
80static inline u64 GET_U64(const struct can_frame *cp) 81static inline u64 GET_U64(const struct can_frame *cp)
@@ -1469,6 +1470,9 @@ static int bcm_release(struct socket *sock)
1469 bo->ifindex = 0; 1470 bo->ifindex = 0;
1470 } 1471 }
1471 1472
1473 sock_orphan(sk);
1474 sock->sk = NULL;
1475
1472 release_sock(sk); 1476 release_sock(sk);
1473 sock_put(sk); 1477 sock_put(sk);
1474 1478
diff --git a/net/can/raw.c b/net/can/raw.c
index 6aa154e806ae..f4cc44548bda 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -62,6 +62,7 @@ static __initdata const char banner[] =
62MODULE_DESCRIPTION("PF_CAN raw protocol"); 62MODULE_DESCRIPTION("PF_CAN raw protocol");
63MODULE_LICENSE("Dual BSD/GPL"); 63MODULE_LICENSE("Dual BSD/GPL");
64MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>"); 64MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
65MODULE_ALIAS("can-proto-1");
65 66
66#define MASK_ALL 0 67#define MASK_ALL 0
67 68
@@ -306,6 +307,9 @@ static int raw_release(struct socket *sock)
306 ro->bound = 0; 307 ro->bound = 0;
307 ro->count = 0; 308 ro->count = 0;
308 309
310 sock_orphan(sk);
311 sock->sk = NULL;
312
309 release_sock(sk); 313 release_sock(sk);
310 sock_put(sk); 314 sock_put(sk);
311 315
diff --git a/net/core/sock.c b/net/core/sock.c
index 6354863b1c68..bbb25be7ddfe 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -631,7 +631,7 @@ set_rcvbuf:
631 631
632 case SO_TIMESTAMPING: 632 case SO_TIMESTAMPING:
633 if (val & ~SOF_TIMESTAMPING_MASK) { 633 if (val & ~SOF_TIMESTAMPING_MASK) {
634 ret = EINVAL; 634 ret = -EINVAL;
635 break; 635 break;
636 } 636 }
637 sock_valbool_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE, 637 sock_valbool_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE,
@@ -919,13 +919,19 @@ static inline void sock_lock_init(struct sock *sk)
919 af_family_keys + sk->sk_family); 919 af_family_keys + sk->sk_family);
920} 920}
921 921
922/*
923 * Copy all fields from osk to nsk but nsk->sk_refcnt must not change yet,
924 * even temporarly, because of RCU lookups. sk_node should also be left as is.
925 */
922static void sock_copy(struct sock *nsk, const struct sock *osk) 926static void sock_copy(struct sock *nsk, const struct sock *osk)
923{ 927{
924#ifdef CONFIG_SECURITY_NETWORK 928#ifdef CONFIG_SECURITY_NETWORK
925 void *sptr = nsk->sk_security; 929 void *sptr = nsk->sk_security;
926#endif 930#endif
927 931 BUILD_BUG_ON(offsetof(struct sock, sk_copy_start) !=
928 memcpy(nsk, osk, osk->sk_prot->obj_size); 932 sizeof(osk->sk_node) + sizeof(osk->sk_refcnt));
933 memcpy(&nsk->sk_copy_start, &osk->sk_copy_start,
934 osk->sk_prot->obj_size - offsetof(struct sock, sk_copy_start));
929#ifdef CONFIG_SECURITY_NETWORK 935#ifdef CONFIG_SECURITY_NETWORK
930 nsk->sk_security = sptr; 936 nsk->sk_security = sptr;
931 security_sk_clone(osk, nsk); 937 security_sk_clone(osk, nsk);
@@ -939,8 +945,23 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority,
939 struct kmem_cache *slab; 945 struct kmem_cache *slab;
940 946
941 slab = prot->slab; 947 slab = prot->slab;
942 if (slab != NULL) 948 if (slab != NULL) {
943 sk = kmem_cache_alloc(slab, priority); 949 sk = kmem_cache_alloc(slab, priority & ~__GFP_ZERO);
950 if (!sk)
951 return sk;
952 if (priority & __GFP_ZERO) {
953 /*
954 * caches using SLAB_DESTROY_BY_RCU should let
955 * sk_node.next un-modified. Special care is taken
956 * when initializing object to zero.
957 */
958 if (offsetof(struct sock, sk_node.next) != 0)
959 memset(sk, 0, offsetof(struct sock, sk_node.next));
960 memset(&sk->sk_node.pprev, 0,
961 prot->obj_size - offsetof(struct sock,
962 sk_node.pprev));
963 }
964 }
944 else 965 else
945 sk = kmalloc(prot->obj_size, priority); 966 sk = kmalloc(prot->obj_size, priority);
946 967
@@ -1125,6 +1146,11 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
1125 1146
1126 newsk->sk_err = 0; 1147 newsk->sk_err = 0;
1127 newsk->sk_priority = 0; 1148 newsk->sk_priority = 0;
1149 /*
1150 * Before updating sk_refcnt, we must commit prior changes to memory
1151 * (Documentation/RCU/rculist_nulls.txt for details)
1152 */
1153 smp_wmb();
1128 atomic_set(&newsk->sk_refcnt, 2); 1154 atomic_set(&newsk->sk_refcnt, 2);
1129 1155
1130 /* 1156 /*
@@ -1840,6 +1866,11 @@ void sock_init_data(struct socket *sock, struct sock *sk)
1840 1866
1841 sk->sk_stamp = ktime_set(-1L, 0); 1867 sk->sk_stamp = ktime_set(-1L, 0);
1842 1868
1869 /*
1870 * Before updating sk_refcnt, we must commit prior changes to memory
1871 * (Documentation/RCU/rculist_nulls.txt for details)
1872 */
1873 smp_wmb();
1843 atomic_set(&sk->sk_refcnt, 1); 1874 atomic_set(&sk->sk_refcnt, 1);
1844 atomic_set(&sk->sk_wmem_alloc, 1); 1875 atomic_set(&sk->sk_wmem_alloc, 1);
1845 atomic_set(&sk->sk_drops, 0); 1876 atomic_set(&sk->sk_drops, 0);
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 94ca8eaace7d..3281013ce038 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -1066,7 +1066,7 @@ static int __init dccp_init(void)
1066 (dccp_hashinfo.ehash_size - 1)) 1066 (dccp_hashinfo.ehash_size - 1))
1067 dccp_hashinfo.ehash_size--; 1067 dccp_hashinfo.ehash_size--;
1068 dccp_hashinfo.ehash = (struct inet_ehash_bucket *) 1068 dccp_hashinfo.ehash = (struct inet_ehash_bucket *)
1069 __get_free_pages(GFP_ATOMIC, ehash_order); 1069 __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, ehash_order);
1070 } while (!dccp_hashinfo.ehash && --ehash_order > 0); 1070 } while (!dccp_hashinfo.ehash && --ehash_order > 0);
1071 1071
1072 if (!dccp_hashinfo.ehash) { 1072 if (!dccp_hashinfo.ehash) {
@@ -1091,7 +1091,7 @@ static int __init dccp_init(void)
1091 bhash_order > 0) 1091 bhash_order > 0)
1092 continue; 1092 continue;
1093 dccp_hashinfo.bhash = (struct inet_bind_hashbucket *) 1093 dccp_hashinfo.bhash = (struct inet_bind_hashbucket *)
1094 __get_free_pages(GFP_ATOMIC, bhash_order); 1094 __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, bhash_order);
1095 } while (!dccp_hashinfo.bhash && --bhash_order >= 0); 1095 } while (!dccp_hashinfo.bhash && --bhash_order >= 0);
1096 1096
1097 if (!dccp_hashinfo.bhash) { 1097 if (!dccp_hashinfo.bhash) {
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 44e2a3d2359a..cb4a0f4bd5e5 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -735,10 +735,10 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
735 } 735 }
736 736
737 tos = tiph->tos; 737 tos = tiph->tos;
738 if (tos&1) { 738 if (tos == 1) {
739 tos = 0;
739 if (skb->protocol == htons(ETH_P_IP)) 740 if (skb->protocol == htons(ETH_P_IP))
740 tos = old_iph->tos; 741 tos = old_iph->tos;
741 tos &= ~1;
742 } 742 }
743 743
744 { 744 {
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 247026282669..7d0821054729 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1243,7 +1243,6 @@ int ip_push_pending_frames(struct sock *sk)
1243 skb->len += tmp_skb->len; 1243 skb->len += tmp_skb->len;
1244 skb->data_len += tmp_skb->len; 1244 skb->data_len += tmp_skb->len;
1245 skb->truesize += tmp_skb->truesize; 1245 skb->truesize += tmp_skb->truesize;
1246 __sock_put(tmp_skb->sk);
1247 tmp_skb->destructor = NULL; 1246 tmp_skb->destructor = NULL;
1248 tmp_skb->sk = NULL; 1247 tmp_skb->sk = NULL;
1249 } 1248 }
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 5a1ca2698c88..6d88219c5e22 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1160,6 +1160,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = {
1160#ifdef CONFIG_TCP_MD5SIG 1160#ifdef CONFIG_TCP_MD5SIG
1161static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { 1161static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
1162 .md5_lookup = tcp_v4_reqsk_md5_lookup, 1162 .md5_lookup = tcp_v4_reqsk_md5_lookup,
1163 .calc_md5_hash = tcp_v4_md5_hash_skb,
1163}; 1164};
1164#endif 1165#endif
1165 1166
@@ -1373,7 +1374,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1373 */ 1374 */
1374 char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC); 1375 char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC);
1375 if (newkey != NULL) 1376 if (newkey != NULL)
1376 tcp_v4_md5_do_add(newsk, inet_sk(sk)->daddr, 1377 tcp_v4_md5_do_add(newsk, newinet->daddr,
1377 newkey, key->keylen); 1378 newkey, key->keylen);
1378 newsk->sk_route_caps &= ~NETIF_F_GSO_MASK; 1379 newsk->sk_route_caps &= ~NETIF_F_GSO_MASK;
1379 } 1380 }
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5bdf08d312d9..bd62712848fa 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2261,7 +2261,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2261#ifdef CONFIG_TCP_MD5SIG 2261#ifdef CONFIG_TCP_MD5SIG
2262 /* Okay, we have all we need - do the md5 hash if needed */ 2262 /* Okay, we have all we need - do the md5 hash if needed */
2263 if (md5) { 2263 if (md5) {
2264 tp->af_specific->calc_md5_hash(md5_hash_location, 2264 tcp_rsk(req)->af_specific->calc_md5_hash(md5_hash_location,
2265 md5, NULL, req, skb); 2265 md5, NULL, req, skb);
2266 } 2266 }
2267#endif 2267#endif
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7c76e3d18215..87f8419a68fd 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1484,7 +1484,6 @@ int ip6_push_pending_frames(struct sock *sk)
1484 skb->len += tmp_skb->len; 1484 skb->len += tmp_skb->len;
1485 skb->data_len += tmp_skb->len; 1485 skb->data_len += tmp_skb->len;
1486 skb->truesize += tmp_skb->truesize; 1486 skb->truesize += tmp_skb->truesize;
1487 __sock_put(tmp_skb->sk);
1488 tmp_skb->destructor = NULL; 1487 tmp_skb->destructor = NULL;
1489 tmp_skb->sk = NULL; 1488 tmp_skb->sk = NULL;
1490 } 1489 }
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 68e52308e552..98b7327d0949 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1018,6 +1018,7 @@ static void ipip6_tunnel_setup(struct net_device *dev)
1018 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); 1018 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
1019 dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); 1019 dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr);
1020 dev->flags = IFF_NOARP; 1020 dev->flags = IFF_NOARP;
1021 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1021 dev->iflink = 0; 1022 dev->iflink = 0;
1022 dev->addr_len = 4; 1023 dev->addr_len = 4;
1023 dev->features |= NETIF_F_NETNS_LOCAL; 1024 dev->features |= NETIF_F_NETNS_LOCAL;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 58810c65b635..d849dd53b788 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -896,6 +896,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = {
896#ifdef CONFIG_TCP_MD5SIG 896#ifdef CONFIG_TCP_MD5SIG
897static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { 897static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
898 .md5_lookup = tcp_v6_reqsk_md5_lookup, 898 .md5_lookup = tcp_v6_reqsk_md5_lookup,
899 .calc_md5_hash = tcp_v6_md5_hash_skb,
899}; 900};
900#endif 901#endif
901 902
@@ -1441,7 +1442,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1441 */ 1442 */
1442 char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC); 1443 char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC);
1443 if (newkey != NULL) 1444 if (newkey != NULL)
1444 tcp_v6_md5_do_add(newsk, &inet6_sk(sk)->daddr, 1445 tcp_v6_md5_do_add(newsk, &newnp->daddr,
1445 newkey, key->keylen); 1446 newkey, key->keylen);
1446 } 1447 }
1447#endif 1448#endif
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 417b0e309495..f1118d92a191 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -41,6 +41,7 @@
41#include <linux/netdevice.h> 41#include <linux/netdevice.h>
42#include <linux/uio.h> 42#include <linux/uio.h>
43#include <linux/skbuff.h> 43#include <linux/skbuff.h>
44#include <linux/smp_lock.h>
44#include <linux/socket.h> 45#include <linux/socket.h>
45#include <linux/sockios.h> 46#include <linux/sockios.h>
46#include <linux/string.h> 47#include <linux/string.h>
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index cb762c8723ea..80cf29aae096 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -45,6 +45,7 @@
45#include <linux/capability.h> 45#include <linux/capability.h>
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/types.h> 47#include <linux/types.h>
48#include <linux/smp_lock.h>
48#include <linux/socket.h> 49#include <linux/socket.h>
49#include <linux/sockios.h> 50#include <linux/sockios.h>
50#include <linux/init.h> 51#include <linux/init.h>
diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h
index bccf4d0059f0..b001c361ad30 100644
--- a/net/irda/irnet/irnet.h
+++ b/net/irda/irnet/irnet.h
@@ -241,7 +241,6 @@
241#include <linux/module.h> 241#include <linux/module.h>
242 242
243#include <linux/kernel.h> 243#include <linux/kernel.h>
244#include <linux/smp_lock.h>
245#include <linux/skbuff.h> 244#include <linux/skbuff.h>
246#include <linux/tty.h> 245#include <linux/tty.h>
247#include <linux/proc_fs.h> 246#include <linux/proc_fs.h>
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index 6d8ae03c14f5..68cbcb19cbd8 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -13,6 +13,7 @@
13 * 2) as a control channel (write commands, read events) 13 * 2) as a control channel (write commands, read events)
14 */ 14 */
15 15
16#include <linux/smp_lock.h>
16#include "irnet_ppp.h" /* Private header */ 17#include "irnet_ppp.h" /* Private header */
17/* Please put other headers in irnet.h - Thanks */ 18/* Please put other headers in irnet.h - Thanks */
18 19
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index ecf4eb2717cb..9cb79f95bf63 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -1453,6 +1453,7 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)
1453 } 1453 }
1454 /* Dup */ 1454 /* Dup */
1455 memcpy(new, orig, sizeof(struct tsap_cb)); 1455 memcpy(new, orig, sizeof(struct tsap_cb));
1456 spin_lock_init(&new->lock);
1456 1457
1457 /* We don't need the old instance any more */ 1458 /* We don't need the old instance any more */
1458 spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags); 1459 spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index ba2643a43c73..7836ee928983 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -83,6 +83,7 @@ endmenu
83config MAC80211_MESH 83config MAC80211_MESH
84 bool "Enable mac80211 mesh networking (pre-802.11s) support" 84 bool "Enable mac80211 mesh networking (pre-802.11s) support"
85 depends on MAC80211 && EXPERIMENTAL 85 depends on MAC80211 && EXPERIMENTAL
86 depends on BROKEN
86 ---help--- 87 ---help---
87 This options enables support of Draft 802.11s mesh networking. 88 This options enables support of Draft 802.11s mesh networking.
88 The implementation is based on Draft 1.08 of the Mesh Networking 89 The implementation is based on Draft 1.08 of the Mesh Networking
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 3c72557df45a..479597e88583 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -175,6 +175,8 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
175 int err = 0; 175 int err = 0;
176 u32 hash_idx; 176 u32 hash_idx;
177 177
178 might_sleep();
179
178 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 180 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
179 /* never add ourselves as neighbours */ 181 /* never add ourselves as neighbours */
180 return -ENOTSUPP; 182 return -ENOTSUPP;
@@ -265,6 +267,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
265 int err = 0; 267 int err = 0;
266 u32 hash_idx; 268 u32 hash_idx;
267 269
270 might_sleep();
268 271
269 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0) 272 if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
270 /* never add ourselves as neighbours */ 273 /* never add ourselves as neighbours */
@@ -491,8 +494,10 @@ void mesh_path_tx_pending(struct mesh_path *mpath)
491 * @skb: frame to discard 494 * @skb: frame to discard
492 * @sdata: network subif the frame was to be sent through 495 * @sdata: network subif the frame was to be sent through
493 * 496 *
494 * If the frame was beign forwarded from another MP, a PERR frame will be sent 497 * If the frame was being forwarded from another MP, a PERR frame will be sent
495 * to the precursor. 498 * to the precursor. The precursor's address (i.e. the previous hop) was saved
499 * in addr1 of the frame-to-be-forwarded, and would only be overwritten once
500 * the destination is successfully resolved.
496 * 501 *
497 * Locking: the function must me called within a rcu_read_lock region 502 * Locking: the function must me called within a rcu_read_lock region
498 */ 503 */
@@ -507,7 +512,7 @@ void mesh_path_discard_frame(struct sk_buff *skb,
507 u8 *ra, *da; 512 u8 *ra, *da;
508 513
509 da = hdr->addr3; 514 da = hdr->addr3;
510 ra = hdr->addr2; 515 ra = hdr->addr1;
511 mpath = mesh_path_lookup(da, sdata); 516 mpath = mesh_path_lookup(da, sdata);
512 if (mpath) 517 if (mpath)
513 dsn = ++mpath->dsn; 518 dsn = ++mpath->dsn;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index d238a8939a09..3a8922cd1038 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1455,7 +1455,7 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
1455 monitor_iface = UNKNOWN_ADDRESS; 1455 monitor_iface = UNKNOWN_ADDRESS;
1456 1456
1457 len_rthdr = ieee80211_get_radiotap_len(skb->data); 1457 len_rthdr = ieee80211_get_radiotap_len(skb->data);
1458 hdr = (struct ieee80211_hdr *)skb->data + len_rthdr; 1458 hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
1459 hdrlen = ieee80211_hdrlen(hdr->frame_control); 1459 hdrlen = ieee80211_hdrlen(hdr->frame_control);
1460 1460
1461 /* check the header is complete in the frame */ 1461 /* check the header is complete in the frame */
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 7508f11c5b39..b5869b9574b0 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -561,23 +561,38 @@ struct nf_conn *nf_conntrack_alloc(struct net *net,
561 } 561 }
562 } 562 }
563 563
564 ct = kmem_cache_zalloc(nf_conntrack_cachep, gfp); 564 /*
565 * Do not use kmem_cache_zalloc(), as this cache uses
566 * SLAB_DESTROY_BY_RCU.
567 */
568 ct = kmem_cache_alloc(nf_conntrack_cachep, gfp);
565 if (ct == NULL) { 569 if (ct == NULL) {
566 pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n"); 570 pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n");
567 atomic_dec(&net->ct.count); 571 atomic_dec(&net->ct.count);
568 return ERR_PTR(-ENOMEM); 572 return ERR_PTR(-ENOMEM);
569 } 573 }
570 574 /*
575 * Let ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode.next
576 * and ct->tuplehash[IP_CT_DIR_REPLY].hnnode.next unchanged.
577 */
578 memset(&ct->tuplehash[IP_CT_DIR_MAX], 0,
579 sizeof(*ct) - offsetof(struct nf_conn, tuplehash[IP_CT_DIR_MAX]));
571 spin_lock_init(&ct->lock); 580 spin_lock_init(&ct->lock);
572 atomic_set(&ct->ct_general.use, 1);
573 ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig; 581 ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig;
582 ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode.pprev = NULL;
574 ct->tuplehash[IP_CT_DIR_REPLY].tuple = *repl; 583 ct->tuplehash[IP_CT_DIR_REPLY].tuple = *repl;
584 ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev = NULL;
575 /* Don't set timer yet: wait for confirmation */ 585 /* Don't set timer yet: wait for confirmation */
576 setup_timer(&ct->timeout, death_by_timeout, (unsigned long)ct); 586 setup_timer(&ct->timeout, death_by_timeout, (unsigned long)ct);
577#ifdef CONFIG_NET_NS 587#ifdef CONFIG_NET_NS
578 ct->ct_net = net; 588 ct->ct_net = net;
579#endif 589#endif
580 590
591 /*
592 * changes to lookup keys must be done before setting refcnt to 1
593 */
594 smp_wmb();
595 atomic_set(&ct->ct_general.use, 1);
581 return ct; 596 return ct;
582} 597}
583EXPORT_SYMBOL_GPL(nf_conntrack_alloc); 598EXPORT_SYMBOL_GPL(nf_conntrack_alloc);
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 863e40977a4d..0f482e2440b4 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -330,7 +330,8 @@ static bool xt_osf_match_packet(const struct sk_buff *skb,
330 fcount++; 330 fcount++;
331 331
332 if (info->flags & XT_OSF_LOG) 332 if (info->flags & XT_OSF_LOG)
333 nf_log_packet(p->hooknum, 0, skb, p->in, p->out, NULL, 333 nf_log_packet(p->family, p->hooknum, skb,
334 p->in, p->out, NULL,
334 "%s [%s:%s] : %pi4:%d -> %pi4:%d hops=%d\n", 335 "%s [%s:%s] : %pi4:%d -> %pi4:%d hops=%d\n",
335 f->genre, f->version, f->subtype, 336 f->genre, f->version, f->subtype,
336 &ip->saddr, ntohs(tcp->source), 337 &ip->saddr, ntohs(tcp->source),
@@ -345,7 +346,7 @@ static bool xt_osf_match_packet(const struct sk_buff *skb,
345 rcu_read_unlock(); 346 rcu_read_unlock();
346 347
347 if (!fcount && (info->flags & XT_OSF_LOG)) 348 if (!fcount && (info->flags & XT_OSF_LOG))
348 nf_log_packet(p->hooknum, 0, skb, p->in, p->out, NULL, 349 nf_log_packet(p->family, p->hooknum, skb, p->in, p->out, NULL,
349 "Remote OS is not known: %pi4:%u -> %pi4:%u\n", 350 "Remote OS is not known: %pi4:%u -> %pi4:%u\n",
350 &ip->saddr, ntohs(tcp->source), 351 &ip->saddr, ntohs(tcp->source),
351 &ip->daddr, ntohs(tcp->dest)); 352 &ip->daddr, ntohs(tcp->dest));
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 79693fe2001e..2fc4a1724eb8 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -549,6 +549,10 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW); 549 swprev = !!(rfkill->state & RFKILL_BLOCK_SW);
550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW); 550 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW);
551 __rfkill_set_sw_state(rfkill, sw); 551 __rfkill_set_sw_state(rfkill, sw);
552 if (hw)
553 rfkill->state |= RFKILL_BLOCK_HW;
554 else
555 rfkill->state &= ~RFKILL_BLOCK_HW;
552 556
553 spin_unlock_irqrestore(&rfkill->lock, flags); 557 spin_unlock_irqrestore(&rfkill->lock, flags);
554 558
@@ -648,15 +652,26 @@ static ssize_t rfkill_state_store(struct device *dev,
648 struct device_attribute *attr, 652 struct device_attribute *attr,
649 const char *buf, size_t count) 653 const char *buf, size_t count)
650{ 654{
651 /* 655 struct rfkill *rfkill = to_rfkill(dev);
652 * The intention was that userspace can only take control over 656 unsigned long state;
653 * a given device when/if rfkill-input doesn't control it due 657 int err;
654 * to user_claim. Since user_claim is currently unsupported, 658
655 * we never support changing the state from userspace -- this 659 if (!capable(CAP_NET_ADMIN))
656 * can be implemented again later. 660 return -EPERM;
657 */ 661
662 err = strict_strtoul(buf, 0, &state);
663 if (err)
664 return err;
665
666 if (state != RFKILL_USER_STATE_SOFT_BLOCKED &&
667 state != RFKILL_USER_STATE_UNBLOCKED)
668 return -EINVAL;
669
670 mutex_lock(&rfkill_global_mutex);
671 rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED);
672 mutex_unlock(&rfkill_global_mutex);
658 673
659 return -EPERM; 674 return err ?: count;
660} 675}
661 676
662static ssize_t rfkill_claim_show(struct device *dev, 677static ssize_t rfkill_claim_show(struct device *dev,
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 6bd8e93869ed..f0a76f6bca71 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -92,23 +92,21 @@ static void rose_set_lockdep_key(struct net_device *dev)
92/* 92/*
93 * Convert a ROSE address into text. 93 * Convert a ROSE address into text.
94 */ 94 */
95const char *rose2asc(const rose_address *addr) 95char *rose2asc(char *buf, const rose_address *addr)
96{ 96{
97 static char buffer[11];
98
99 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 && 97 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 &&
100 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 && 98 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 &&
101 addr->rose_addr[4] == 0x00) { 99 addr->rose_addr[4] == 0x00) {
102 strcpy(buffer, "*"); 100 strcpy(buf, "*");
103 } else { 101 } else {
104 sprintf(buffer, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, 102 sprintf(buf, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF,
105 addr->rose_addr[1] & 0xFF, 103 addr->rose_addr[1] & 0xFF,
106 addr->rose_addr[2] & 0xFF, 104 addr->rose_addr[2] & 0xFF,
107 addr->rose_addr[3] & 0xFF, 105 addr->rose_addr[3] & 0xFF,
108 addr->rose_addr[4] & 0xFF); 106 addr->rose_addr[4] & 0xFF);
109 } 107 }
110 108
111 return buffer; 109 return buf;
112} 110}
113 111
114/* 112/*
@@ -1437,7 +1435,7 @@ static void rose_info_stop(struct seq_file *seq, void *v)
1437 1435
1438static int rose_info_show(struct seq_file *seq, void *v) 1436static int rose_info_show(struct seq_file *seq, void *v)
1439{ 1437{
1440 char buf[11]; 1438 char buf[11], rsbuf[11];
1441 1439
1442 if (v == SEQ_START_TOKEN) 1440 if (v == SEQ_START_TOKEN)
1443 seq_puts(seq, 1441 seq_puts(seq,
@@ -1455,8 +1453,8 @@ static int rose_info_show(struct seq_file *seq, void *v)
1455 devname = dev->name; 1453 devname = dev->name;
1456 1454
1457 seq_printf(seq, "%-10s %-9s ", 1455 seq_printf(seq, "%-10s %-9s ",
1458 rose2asc(&rose->dest_addr), 1456 rose2asc(rsbuf, &rose->dest_addr),
1459 ax2asc(buf, &rose->dest_call)); 1457 ax2asc(buf, &rose->dest_call));
1460 1458
1461 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0) 1459 if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
1462 callsign = "??????-?"; 1460 callsign = "??????-?";
@@ -1465,7 +1463,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
1465 1463
1466 seq_printf(seq, 1464 seq_printf(seq,
1467 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n", 1465 "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n",
1468 rose2asc(&rose->source_addr), 1466 rose2asc(rsbuf, &rose->source_addr),
1469 callsign, 1467 callsign,
1470 devname, 1468 devname,
1471 rose->lci & 0x0FFF, 1469 rose->lci & 0x0FFF,
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index a81066a1010a..9478d9b3d977 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -1104,6 +1104,7 @@ static void rose_node_stop(struct seq_file *seq, void *v)
1104 1104
1105static int rose_node_show(struct seq_file *seq, void *v) 1105static int rose_node_show(struct seq_file *seq, void *v)
1106{ 1106{
1107 char rsbuf[11];
1107 int i; 1108 int i;
1108 1109
1109 if (v == SEQ_START_TOKEN) 1110 if (v == SEQ_START_TOKEN)
@@ -1112,13 +1113,13 @@ static int rose_node_show(struct seq_file *seq, void *v)
1112 const struct rose_node *rose_node = v; 1113 const struct rose_node *rose_node = v;
1113 /* if (rose_node->loopback) { 1114 /* if (rose_node->loopback) {
1114 seq_printf(seq, "%-10s %04d 1 loopback\n", 1115 seq_printf(seq, "%-10s %04d 1 loopback\n",
1115 rose2asc(&rose_node->address), 1116 rose2asc(rsbuf, &rose_node->address),
1116 rose_node->mask); 1117 rose_node->mask);
1117 } else { */ 1118 } else { */
1118 seq_printf(seq, "%-10s %04d %d", 1119 seq_printf(seq, "%-10s %04d %d",
1119 rose2asc(&rose_node->address), 1120 rose2asc(rsbuf, &rose_node->address),
1120 rose_node->mask, 1121 rose_node->mask,
1121 rose_node->count); 1122 rose_node->count);
1122 1123
1123 for (i = 0; i < rose_node->count; i++) 1124 for (i = 0; i < rose_node->count; i++)
1124 seq_printf(seq, " %05d", 1125 seq_printf(seq, " %05d",
@@ -1267,7 +1268,7 @@ static void rose_route_stop(struct seq_file *seq, void *v)
1267 1268
1268static int rose_route_show(struct seq_file *seq, void *v) 1269static int rose_route_show(struct seq_file *seq, void *v)
1269{ 1270{
1270 char buf[11]; 1271 char buf[11], rsbuf[11];
1271 1272
1272 if (v == SEQ_START_TOKEN) 1273 if (v == SEQ_START_TOKEN)
1273 seq_puts(seq, 1274 seq_puts(seq,
@@ -1279,7 +1280,7 @@ static int rose_route_show(struct seq_file *seq, void *v)
1279 seq_printf(seq, 1280 seq_printf(seq,
1280 "%3.3X %-10s %-9s %05d ", 1281 "%3.3X %-10s %-9s %05d ",
1281 rose_route->lci1, 1282 rose_route->lci1,
1282 rose2asc(&rose_route->src_addr), 1283 rose2asc(rsbuf, &rose_route->src_addr),
1283 ax2asc(buf, &rose_route->src_call), 1284 ax2asc(buf, &rose_route->src_call),
1284 rose_route->neigh1->number); 1285 rose_route->neigh1->number);
1285 else 1286 else
@@ -1289,10 +1290,10 @@ static int rose_route_show(struct seq_file *seq, void *v)
1289 if (rose_route->neigh2) 1290 if (rose_route->neigh2)
1290 seq_printf(seq, 1291 seq_printf(seq,
1291 "%3.3X %-10s %-9s %05d\n", 1292 "%3.3X %-10s %-9s %05d\n",
1292 rose_route->lci2, 1293 rose_route->lci2,
1293 rose2asc(&rose_route->dest_addr), 1294 rose2asc(rsbuf, &rose_route->dest_addr),
1294 ax2asc(buf, &rose_route->dest_call), 1295 ax2asc(buf, &rose_route->dest_call),
1295 rose_route->neigh2->number); 1296 rose_route->neigh2->number);
1296 else 1297 else
1297 seq_puts(seq, 1298 seq_puts(seq,
1298 "000 * * 00000\n"); 1299 "000 * * 00000\n");
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 5bc2f45bddf0..ebfcf9b89909 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -28,7 +28,6 @@
28#include <linux/kallsyms.h> 28#include <linux/kallsyms.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
32#include <linux/utsname.h> 31#include <linux/utsname.h>
33#include <linux/workqueue.h> 32#include <linux/workqueue.h>
34#include <linux/in6.h> 33#include <linux/in6.h>
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 1102ce1251f7..8f459abe97cf 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -16,7 +16,6 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/mempool.h> 17#include <linux/mempool.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h>
20#include <linux/spinlock.h> 19#include <linux/spinlock.h>
21#include <linux/mutex.h> 20#include <linux/mutex.h>
22 21
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 6f33d33cc064..27d44332f017 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/smp_lock.h>
8#include <linux/errno.h> 9#include <linux/errno.h>
9#include <linux/freezer.h> 10#include <linux/freezer.h>
10#include <linux/kthread.h> 11#include <linux/kthread.h>
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 466e2d22d256..258daa80ad92 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -48,6 +48,7 @@
48#include <linux/kernel.h> 48#include <linux/kernel.h>
49#include <linux/module.h> /* support for loadable modules */ 49#include <linux/module.h> /* support for loadable modules */
50#include <linux/slab.h> /* kmalloc(), kfree() */ 50#include <linux/slab.h> /* kmalloc(), kfree() */
51#include <linux/smp_lock.h>
51#include <linux/mm.h> 52#include <linux/mm.h>
52#include <linux/string.h> /* inline mem*, str* functions */ 53#include <linux/string.h> /* inline mem*, str* functions */
53 54
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 43bdb1372cae..634496b3ed77 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
997 997
998 if (IS_ERR(hdr)) { 998 if (IS_ERR(hdr)) {
999 err = PTR_ERR(hdr); 999 err = PTR_ERR(hdr);
1000 goto out; 1000 goto free_msg;
1001 } 1001 }
1002 1002
1003 cookie.msg = msg; 1003 cookie.msg = msg;
@@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1011 &cookie, get_key_callback); 1011 &cookie, get_key_callback);
1012 1012
1013 if (err) 1013 if (err)
1014 goto out; 1014 goto free_msg;
1015 1015
1016 if (cookie.error) 1016 if (cookie.error)
1017 goto nla_put_failure; 1017 goto nla_put_failure;
@@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1022 1022
1023 nla_put_failure: 1023 nla_put_failure:
1024 err = -ENOBUFS; 1024 err = -ENOBUFS;
1025 free_msg:
1025 nlmsg_free(msg); 1026 nlmsg_free(msg);
1026 out: 1027 out:
1027 cfg80211_put_dev(drv); 1028 cfg80211_put_dev(drv);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index f8e71b300001..9271118e1fc4 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -35,8 +35,6 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
35 else 35 else
36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev); 36 nl80211_send_scan_done(wiphy_to_dev(request->wiphy), dev);
37 37
38 wiphy_to_dev(request->wiphy)->scan_req = NULL;
39
40#ifdef CONFIG_WIRELESS_EXT 38#ifdef CONFIG_WIRELESS_EXT
41 if (!aborted) { 39 if (!aborted) {
42 memset(&wrqu, 0, sizeof(wrqu)); 40 memset(&wrqu, 0, sizeof(wrqu));
@@ -48,6 +46,7 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted)
48 dev_put(dev); 46 dev_put(dev);
49 47
50 out: 48 out:
49 wiphy_to_dev(request->wiphy)->scan_req = NULL;
51 kfree(request); 50 kfree(request);
52} 51}
53EXPORT_SYMBOL(cfg80211_scan_done); 52EXPORT_SYMBOL(cfg80211_scan_done);
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 21cdc872004e..5e6c072c64d3 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -40,6 +40,7 @@
40#include <linux/errno.h> 40#include <linux/errno.h>
41#include <linux/kernel.h> 41#include <linux/kernel.h>
42#include <linux/sched.h> 42#include <linux/sched.h>
43#include <linux/smp_lock.h>
43#include <linux/timer.h> 44#include <linux/timer.h>
44#include <linux/string.h> 45#include <linux/string.h>
45#include <linux/net.h> 46#include <linux/net.h>
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 9977a756fb32..f24ae370e514 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -1,21 +1,4 @@
1/* 1/*
2 * Notice that this file is not protected like a normal header.
3 * We also must allow for rereading of this file. The
4 *
5 * || defined(TRACE_HEADER_MULTI_READ)
6 *
7 * serves this purpose.
8 */
9#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_EVENT_SAMPLE_H
11
12/*
13 * All trace headers should include tracepoint.h, until we finally
14 * make it into a standard header.
15 */
16#include <linux/tracepoint.h>
17
18/*
19 * If TRACE_SYSTEM is defined, that will be the directory created 2 * If TRACE_SYSTEM is defined, that will be the directory created
20 * in the ftrace directory under /debugfs/tracing/events/<system> 3 * in the ftrace directory under /debugfs/tracing/events/<system>
21 * 4 *
@@ -34,11 +17,31 @@
34 * #define TRACE_INCLUDE_FILE trace-events-sample 17 * #define TRACE_INCLUDE_FILE trace-events-sample
35 * 18 *
36 * As we do an the bottom of this file. 19 * As we do an the bottom of this file.
20 *
21 * Notice that TRACE_SYSTEM should be defined outside of #if
22 * protection, just like TRACE_INCLUDE_FILE.
37 */ 23 */
38#undef TRACE_SYSTEM 24#undef TRACE_SYSTEM
39#define TRACE_SYSTEM sample 25#define TRACE_SYSTEM sample
40 26
41/* 27/*
28 * Notice that this file is not protected like a normal header.
29 * We also must allow for rereading of this file. The
30 *
31 * || defined(TRACE_HEADER_MULTI_READ)
32 *
33 * serves this purpose.
34 */
35#if !defined(_TRACE_EVENT_SAMPLE_H) || defined(TRACE_HEADER_MULTI_READ)
36#define _TRACE_EVENT_SAMPLE_H
37
38/*
39 * All trace headers should include tracepoint.h, until we finally
40 * make it into a standard header.
41 */
42#include <linux/tracepoint.h>
43
44/*
42 * The TRACE_EVENT macro is broken up into 5 parts. 45 * The TRACE_EVENT macro is broken up into 5 parts.
43 * 46 *
44 * name: name of the trace point. This is also how to enable the tracepoint. 47 * name: name of the trace point. This is also how to enable the tracepoint.
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 3e733146cd51..278a45bd45a5 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -13,7 +13,7 @@
13use strict; 13use strict;
14 14
15my $P = $0; 15my $P = $0;
16my $V = '0.16'; 16my $V = '0.17';
17 17
18use Getopt::Long qw(:config no_auto_abbrev); 18use Getopt::Long qw(:config no_auto_abbrev);
19 19
@@ -27,6 +27,7 @@ my $email_git = 1;
27my $email_git_penguin_chiefs = 0; 27my $email_git_penguin_chiefs = 0;
28my $email_git_min_signatures = 1; 28my $email_git_min_signatures = 1;
29my $email_git_max_maintainers = 5; 29my $email_git_max_maintainers = 5;
30my $email_git_min_percent = 5;
30my $email_git_since = "1-year-ago"; 31my $email_git_since = "1-year-ago";
31my $output_multiline = 1; 32my $output_multiline = 1;
32my $output_separator = ", "; 33my $output_separator = ", ";
@@ -65,6 +66,7 @@ if (!GetOptions(
65 'git-chief-penguins!' => \$email_git_penguin_chiefs, 66 'git-chief-penguins!' => \$email_git_penguin_chiefs,
66 'git-min-signatures=i' => \$email_git_min_signatures, 67 'git-min-signatures=i' => \$email_git_min_signatures,
67 'git-max-maintainers=i' => \$email_git_max_maintainers, 68 'git-max-maintainers=i' => \$email_git_max_maintainers,
69 'git-min-percent=i' => \$email_git_min_percent,
68 'git-since=s' => \$email_git_since, 70 'git-since=s' => \$email_git_since,
69 'm!' => \$email_maintainer, 71 'm!' => \$email_maintainer,
70 'n!' => \$email_usename, 72 'n!' => \$email_usename,
@@ -132,6 +134,10 @@ while (<MAINT>) {
132 $value =~ s@\.@\\\.@g; ##Convert . to \. 134 $value =~ s@\.@\\\.@g; ##Convert . to \.
133 $value =~ s/\*/\.\*/g; ##Convert * to .* 135 $value =~ s/\*/\.\*/g; ##Convert * to .*
134 $value =~ s/\?/\./g; ##Convert ? to . 136 $value =~ s/\?/\./g; ##Convert ? to .
137 ##if pattern is a directory and it lacks a trailing slash, add one
138 if ((-d $value)) {
139 $value =~ s@([^/])$@$1/@;
140 }
135 } 141 }
136 push(@typevalue, "$type:$value"); 142 push(@typevalue, "$type:$value");
137 } elsif (!/^(\s)*$/) { 143 } elsif (!/^(\s)*$/) {
@@ -146,8 +152,10 @@ close(MAINT);
146my @files = (); 152my @files = ();
147 153
148foreach my $file (@ARGV) { 154foreach my $file (@ARGV) {
149 next if ((-d $file)); 155 ##if $file is a directory and it lacks a trailing slash, add one
150 if (!(-f $file)) { 156 if ((-d $file)) {
157 $file =~ s@([^/])$@$1/@;
158 } elsif (!(-f $file)) {
151 die "$P: file '${file}' not found\n"; 159 die "$P: file '${file}' not found\n";
152 } 160 }
153 if ($from_filename) { 161 if ($from_filename) {
@@ -292,7 +300,7 @@ sub file_match_pattern {
292sub usage { 300sub usage {
293 print <<EOT; 301 print <<EOT;
294usage: $P [options] patchfile 302usage: $P [options] patchfile
295 $P [options] -f file 303 $P [options] -f file|directory
296version: $V 304version: $V
297 305
298MAINTAINER field selection options: 306MAINTAINER field selection options:
@@ -301,6 +309,7 @@ MAINTAINER field selection options:
301 --git-chief-penguins => include ${penguin_chiefs} 309 --git-chief-penguins => include ${penguin_chiefs}
302 --git-min-signatures => number of signatures required (default: 1) 310 --git-min-signatures => number of signatures required (default: 1)
303 --git-max-maintainers => maximum maintainers to add (default: 5) 311 --git-max-maintainers => maximum maintainers to add (default: 5)
312 --git-min-percent => minimum percentage of commits required (default: 5)
304 --git-since => git history to use (default: 1-year-ago) 313 --git-since => git history to use (default: 1-year-ago)
305 --m => include maintainer(s) if any 314 --m => include maintainer(s) if any
306 --n => include name 'Full Name <addr\@domain.tld>' 315 --n => include name 'Full Name <addr\@domain.tld>'
@@ -322,6 +331,15 @@ Other options:
322 --version => show version 331 --version => show version
323 --help => show this help information 332 --help => show this help information
324 333
334Notes:
335 Using "-f directory" may give unexpected results:
336
337 Used with "--git", git signators for _all_ files in and below
338 directory are examined as git recurses directories.
339 Any specified X: (exclude) pattern matches are _not_ ignored.
340 Used with "--nogit", directory is used as a pattern match,
341 no individual file within the directory or subdirectory
342 is matched.
325EOT 343EOT
326} 344}
327 345
@@ -482,6 +500,7 @@ sub recent_git_signoffs {
482 my $output = ""; 500 my $output = "";
483 my $count = 0; 501 my $count = 0;
484 my @lines = (); 502 my @lines = ();
503 my $total_sign_offs;
485 504
486 if (which("git") eq "") { 505 if (which("git") eq "") {
487 warn("$P: git not found. Add --nogit to options?\n"); 506 warn("$P: git not found. Add --nogit to options?\n");
@@ -505,17 +524,26 @@ sub recent_git_signoffs {
505 $output =~ s/^\s*//gm; 524 $output =~ s/^\s*//gm;
506 525
507 @lines = split("\n", $output); 526 @lines = split("\n", $output);
527
528 $total_sign_offs = 0;
529 foreach my $line (@lines) {
530 if ($line =~ m/([0-9]+)\s+(.*)/) {
531 $total_sign_offs += $1;
532 } else {
533 die("$P: Unexpected git output: ${line}\n");
534 }
535 }
536
508 foreach my $line (@lines) { 537 foreach my $line (@lines) {
509 if ($line =~ m/([0-9]+)\s+(.*)/) { 538 if ($line =~ m/([0-9]+)\s+(.*)/) {
510 my $sign_offs = $1; 539 my $sign_offs = $1;
511 $line = $2; 540 $line = $2;
512 $count++; 541 $count++;
513 if ($sign_offs < $email_git_min_signatures || 542 if ($sign_offs < $email_git_min_signatures ||
514 $count > $email_git_max_maintainers) { 543 $count > $email_git_max_maintainers ||
544 $sign_offs * 100 / $total_sign_offs < $email_git_min_percent) {
515 last; 545 last;
516 } 546 }
517 } else {
518 die("$P: Unexpected git output: ${line}\n");
519 } 547 }
520 if ($line =~ m/(.+)<(.+)>/) { 548 if ($line =~ m/(.+)<(.+)>/) {
521 my $git_name = $1; 549 my $git_name = $1;
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index 86d95cca46a7..f2375ad7ebc9 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -19,6 +19,8 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#include <stdarg.h>
23
22#include "dialog.h" 24#include "dialog.h"
23 25
24struct dialog_info dlg; 26struct dialog_info dlg;
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 3bcacb4bfd3a..25b60bc117f7 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -888,6 +888,8 @@ int main(int ac, char **av)
888 single_menu_mode = 1; 888 single_menu_mode = 1;
889 } 889 }
890 890
891 initscr();
892
891 getyx(stdscr, saved_y, saved_x); 893 getyx(stdscr, saved_y, saved_x);
892 if (init_dialog(NULL)) { 894 if (init_dialog(NULL)) {
893 fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); 895 fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index 528492bcba5b..89774011965d 100644
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -1,6 +1,7 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3use File::Basename; 3use File::Basename;
4use Math::BigInt;
4 5
5# Copyright 2008, Intel Corporation 6# Copyright 2008, Intel Corporation
6# 7#
@@ -172,8 +173,8 @@ while (<STDIN>) {
172 parse_x86_regs($line); 173 parse_x86_regs($line);
173} 174}
174 175
175my $decodestart = hex($target) - hex($func_offset); 176my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$func_offset");
176my $decodestop = hex($target) + 8192; 177my $decodestop = Math::BigInt->from_hex("0x$target") + 8192;
177if ($target eq "0") { 178if ($target eq "0") {
178 print "No oops found!\n"; 179 print "No oops found!\n";
179 print "Usage: \n"; 180 print "Usage: \n";
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index b19f1f4962e3..8b357b0bd250 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -89,7 +89,7 @@ for script in postinst postrm preinst prerm ; do
89set -e 89set -e
90 90
91# Pass maintainer script parameters to hook scripts 91# Pass maintainer script parameters to hook scripts
92export DEB_MAINT_PARAMS="\$@" 92export DEB_MAINT_PARAMS="\$*"
93 93
94test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d 94test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d
95exit 0 95exit 0
diff --git a/sound/aoa/core/gpio-pmf.c b/sound/aoa/core/gpio-pmf.c
index 5ca2220eac7d..1dd0c28d1fb7 100644
--- a/sound/aoa/core/gpio-pmf.c
+++ b/sound/aoa/core/gpio-pmf.c
@@ -182,6 +182,10 @@ static int pmf_set_notify(struct gpio_runtime *rt,
182 if (!old && notify) { 182 if (!old && notify) {
183 irq_client = kzalloc(sizeof(struct pmf_irq_client), 183 irq_client = kzalloc(sizeof(struct pmf_irq_client),
184 GFP_KERNEL); 184 GFP_KERNEL);
185 if (!irq_client) {
186 err = -ENOMEM;
187 goto out_unlock;
188 }
185 irq_client->data = notif; 189 irq_client->data = notif;
186 irq_client->handler = pmf_handle_notify_irq; 190 irq_client->handler = pmf_handle_notify_irq;
187 irq_client->owner = THIS_MODULE; 191 irq_client->owner = THIS_MODULE;
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index 108b643229ba..6205f37d547c 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -75,7 +75,7 @@ int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
75{ 75{
76 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; 76 struct pxa2xx_runtime_data *rtd = substream->runtime->private_data;
77 77
78 if (rtd && rtd->params) 78 if (rtd && rtd->params && rtd->params->drcmr)
79 *rtd->params->drcmr = 0; 79 *rtd->params->drcmr = 0;
80 80
81 snd_pcm_set_runtime_buffer(substream, NULL); 81 snd_pcm_set_runtime_buffer(substream, NULL);
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 333e4dd29450..72cfd47af6b8 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -233,6 +233,18 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
233 xrun(substream); 233 xrun(substream);
234 return -EPIPE; 234 return -EPIPE;
235 } 235 }
236 if (xrun_debug(substream, 8)) {
237 char name[16];
238 pcm_debug_name(substream, name, sizeof(name));
239 snd_printd("period_update: %s: pos=0x%x/0x%x/0x%x, "
240 "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n",
241 name, (unsigned int)pos,
242 (unsigned int)runtime->period_size,
243 (unsigned int)runtime->buffer_size,
244 (unsigned long)old_hw_ptr,
245 (unsigned long)runtime->hw_ptr_base,
246 (unsigned long)runtime->hw_ptr_interrupt);
247 }
236 hw_base = runtime->hw_ptr_base; 248 hw_base = runtime->hw_ptr_base;
237 new_hw_ptr = hw_base + pos; 249 new_hw_ptr = hw_base + pos;
238 hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; 250 hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size;
@@ -244,18 +256,27 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
244 delta = new_hw_ptr - hw_ptr_interrupt; 256 delta = new_hw_ptr - hw_ptr_interrupt;
245 } 257 }
246 if (delta < 0) { 258 if (delta < 0) {
247 delta += runtime->buffer_size; 259 if (runtime->periods == 1 || new_hw_ptr < old_hw_ptr)
260 delta += runtime->buffer_size;
248 if (delta < 0) { 261 if (delta < 0) {
249 hw_ptr_error(substream, 262 hw_ptr_error(substream,
250 "Unexpected hw_pointer value " 263 "Unexpected hw_pointer value "
251 "(stream=%i, pos=%ld, intr_ptr=%ld)\n", 264 "(stream=%i, pos=%ld, intr_ptr=%ld)\n",
252 substream->stream, (long)pos, 265 substream->stream, (long)pos,
253 (long)hw_ptr_interrupt); 266 (long)hw_ptr_interrupt);
267#if 1
268 /* simply skipping the hwptr update seems more
269 * robust in some cases, e.g. on VMware with
270 * inaccurate timer source
271 */
272 return 0; /* skip this update */
273#else
254 /* rebase to interrupt position */ 274 /* rebase to interrupt position */
255 hw_base = new_hw_ptr = hw_ptr_interrupt; 275 hw_base = new_hw_ptr = hw_ptr_interrupt;
256 /* align hw_base to buffer_size */ 276 /* align hw_base to buffer_size */
257 hw_base -= hw_base % runtime->buffer_size; 277 hw_base -= hw_base % runtime->buffer_size;
258 delta = 0; 278 delta = 0;
279#endif
259 } else { 280 } else {
260 hw_base += runtime->buffer_size; 281 hw_base += runtime->buffer_size;
261 if (hw_base >= runtime->boundary) 282 if (hw_base >= runtime->boundary)
@@ -344,6 +365,19 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
344 xrun(substream); 365 xrun(substream);
345 return -EPIPE; 366 return -EPIPE;
346 } 367 }
368 if (xrun_debug(substream, 16)) {
369 char name[16];
370 pcm_debug_name(substream, name, sizeof(name));
371 snd_printd("hw_update: %s: pos=0x%x/0x%x/0x%x, "
372 "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n",
373 name, (unsigned int)pos,
374 (unsigned int)runtime->period_size,
375 (unsigned int)runtime->buffer_size,
376 (unsigned long)old_hw_ptr,
377 (unsigned long)runtime->hw_ptr_base,
378 (unsigned long)runtime->hw_ptr_interrupt);
379 }
380
347 hw_base = runtime->hw_ptr_base; 381 hw_base = runtime->hw_ptr_base;
348 new_hw_ptr = hw_base + pos; 382 new_hw_ptr = hw_base + pos;
349 383
diff --git a/sound/core/seq/Makefile b/sound/core/seq/Makefile
index 1bcb360330e5..941f64a853eb 100644
--- a/sound/core/seq/Makefile
+++ b/sound/core/seq/Makefile
@@ -3,10 +3,6 @@
3# Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz> 3# Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz>
4# 4#
5 5
6ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
7 obj-$(CONFIG_SND_SEQUENCER) += oss/
8endif
9
10snd-seq-device-objs := seq_device.o 6snd-seq-device-objs := seq_device.o
11snd-seq-objs := seq.o seq_lock.o seq_clientmgr.o seq_memory.o seq_queue.o \ 7snd-seq-objs := seq.o seq_lock.o seq_clientmgr.o seq_memory.o seq_queue.o \
12 seq_fifo.o seq_prioq.o seq_timer.o \ 8 seq_fifo.o seq_prioq.o seq_timer.o \
@@ -19,7 +15,8 @@ snd-seq-virmidi-objs := seq_virmidi.o
19 15
20obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o 16obj-$(CONFIG_SND_SEQUENCER) += snd-seq.o snd-seq-device.o
21ifeq ($(CONFIG_SND_SEQUENCER_OSS),y) 17ifeq ($(CONFIG_SND_SEQUENCER_OSS),y)
22obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o 18 obj-$(CONFIG_SND_SEQUENCER) += snd-seq-midi-event.o
19 obj-$(CONFIG_SND_SEQUENCER) += oss/
23endif 20endif
24obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o 21obj-$(CONFIG_SND_SEQ_DUMMY) += snd-seq-dummy.o
25 22
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index edb11eefdfe3..2dcf45bf7293 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -795,13 +795,13 @@ static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
795 if (!(pcmp->flags & SNDRV_GF1_PCM_PFLG_ACTIVE)) 795 if (!(pcmp->flags & SNDRV_GF1_PCM_PFLG_ACTIVE))
796 continue; 796 continue;
797 /* load real volume - better precision */ 797 /* load real volume - better precision */
798 spin_lock_irqsave(&gus->reg_lock, flags); 798 spin_lock(&gus->reg_lock);
799 snd_gf1_select_voice(gus, pvoice->number); 799 snd_gf1_select_voice(gus, pvoice->number);
800 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 800 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
801 vol = pvoice == pcmp->pvoices[0] ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right; 801 vol = pvoice == pcmp->pvoices[0] ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right;
802 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, vol); 802 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, vol);
803 pcmp->final_volume = 1; 803 pcmp->final_volume = 1;
804 spin_unlock_irqrestore(&gus->reg_lock, flags); 804 spin_unlock(&gus->reg_lock);
805 } 805 }
806 spin_unlock_irqrestore(&gus->voice_alloc, flags); 806 spin_unlock_irqrestore(&gus->voice_alloc, flags);
807 return change; 807 return change;
diff --git a/sound/oss/aedsp16.c b/sound/oss/aedsp16.c
index 3ee9900ffd7b..35b5912cf3f8 100644
--- a/sound/oss/aedsp16.c
+++ b/sound/oss/aedsp16.c
@@ -325,8 +325,9 @@
325/* 325/*
326 * Size of character arrays that store name and version of sound card 326 * Size of character arrays that store name and version of sound card
327 */ 327 */
328#define CARDNAMELEN 15 /* Size of the card's name in chars */ 328#define CARDNAMELEN 15 /* Size of the card's name in chars */
329#define CARDVERLEN 2 /* Size of the card's version in chars */ 329#define CARDVERLEN 10 /* Size of the card's version in chars */
330#define CARDVERDIGITS 2 /* Number of digits in the version */
330 331
331#if defined(CONFIG_SC6600) 332#if defined(CONFIG_SC6600)
332/* 333/*
@@ -410,7 +411,7 @@
410 411
411static int soft_cfg __initdata = 0; /* bitmapped config */ 412static int soft_cfg __initdata = 0; /* bitmapped config */
412static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */ 413static int soft_cfg_mss __initdata = 0; /* bitmapped mss config */
413static int ver[CARDVERLEN] __initdata = {0, 0}; /* DSP Ver: 414static int ver[CARDVERDIGITS] __initdata = {0, 0}; /* DSP Ver:
414 hi->ver[0] lo->ver[1] */ 415 hi->ver[0] lo->ver[1] */
415 416
416#if defined(CONFIG_SC6600) 417#if defined(CONFIG_SC6600)
@@ -957,7 +958,7 @@ static int __init aedsp16_dsp_version(int port)
957 * string is finished. 958 * string is finished.
958 */ 959 */
959 ver[len++] = ret; 960 ver[len++] = ret;
960 } while (len < CARDVERLEN); 961 } while (len < CARDVERDIGITS);
961 sprintf(DSPVersion, "%d.%d", ver[0], ver[1]); 962 sprintf(DSPVersion, "%d.%d", ver[0], ver[1]);
962 963
963 DBG(("success.\n")); 964 DBG(("success.\n"));
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index 1b2316f35b1f..734b8f9e2f78 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -1074,7 +1074,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
1074 sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name); 1074 sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name);
1075 else 1075 else
1076 sprintf(mpu_synth_info[m].name, 1076 sprintf(mpu_synth_info[m].name,
1077 "MPU-401 %d.%d%c Midi interface #%d", 1077 "MPU-401 %d.%d%c MIDI #%d",
1078 (int) (devc->version & 0xf0) >> 4, 1078 (int) (devc->version & 0xf0) >> 4,
1079 devc->version & 0x0f, 1079 devc->version & 0x0f,
1080 revision_char, 1080 revision_char,
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index f24bf1ecb36d..15e4138bce17 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -325,9 +325,9 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
325 .rate_max = 192000, 325 .rate_max = 192000,
326 .channels_min = 2, 326 .channels_min = 2,
327 .channels_max = 2, 327 .channels_max = 2,
328 .buffer_bytes_max = ((65536 - 64) * 8), 328 .buffer_bytes_max = 65536 - 128,
329 .period_bytes_min = 64, 329 .period_bytes_min = 64,
330 .period_bytes_max = (65536 - 64), 330 .period_bytes_max = 32768 - 64,
331 .periods_min = 2, 331 .periods_min = 2,
332 .periods_max = 2, 332 .periods_max = 2,
333 .fifo_size = 0, 333 .fifo_size = 0,
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
index a1db51b3ead8..a7f4a671f7b7 100644
--- a/sound/pci/ctxfi/ctamixer.c
+++ b/sound/pci/ctxfi/ctamixer.c
@@ -242,13 +242,12 @@ static int get_amixer_rsc(struct amixer_mgr *mgr,
242 242
243 /* Allocate mem for amixer resource */ 243 /* Allocate mem for amixer resource */
244 amixer = kzalloc(sizeof(*amixer), GFP_KERNEL); 244 amixer = kzalloc(sizeof(*amixer), GFP_KERNEL);
245 if (NULL == amixer) { 245 if (!amixer)
246 err = -ENOMEM; 246 return -ENOMEM;
247 return err;
248 }
249 247
250 /* Check whether there are sufficient 248 /* Check whether there are sufficient
251 * amixer resources to meet request. */ 249 * amixer resources to meet request. */
250 err = 0;
252 spin_lock_irqsave(&mgr->mgr_lock, flags); 251 spin_lock_irqsave(&mgr->mgr_lock, flags);
253 for (i = 0; i < desc->msr; i++) { 252 for (i = 0; i < desc->msr; i++) {
254 err = mgr_get_resource(&mgr->mgr, 1, &idx); 253 err = mgr_get_resource(&mgr->mgr, 1, &idx);
@@ -397,12 +396,11 @@ static int get_sum_rsc(struct sum_mgr *mgr,
397 396
398 /* Allocate mem for sum resource */ 397 /* Allocate mem for sum resource */
399 sum = kzalloc(sizeof(*sum), GFP_KERNEL); 398 sum = kzalloc(sizeof(*sum), GFP_KERNEL);
400 if (NULL == sum) { 399 if (!sum)
401 err = -ENOMEM; 400 return -ENOMEM;
402 return err;
403 }
404 401
405 /* Check whether there are sufficient sum resources to meet request. */ 402 /* Check whether there are sufficient sum resources to meet request. */
403 err = 0;
406 spin_lock_irqsave(&mgr->mgr_lock, flags); 404 spin_lock_irqsave(&mgr->mgr_lock, flags);
407 for (i = 0; i < desc->msr; i++) { 405 for (i = 0; i < desc->msr; i++) {
408 err = mgr_get_resource(&mgr->mgr, 1, &idx); 406 err = mgr_get_resource(&mgr->mgr, 1, &idx);
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index 082e35c08c02..deb6cfa73600 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -57,9 +57,9 @@ struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = {
57 57
58struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = { 58struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = {
59 [LINEO1] = {.left = 0x40, .right = 0x41}, 59 [LINEO1] = {.left = 0x40, .right = 0x41},
60 [LINEO2] = {.left = 0x70, .right = 0x71}, 60 [LINEO2] = {.left = 0x60, .right = 0x61},
61 [LINEO3] = {.left = 0x50, .right = 0x51}, 61 [LINEO3] = {.left = 0x50, .right = 0x51},
62 [LINEO4] = {.left = 0x60, .right = 0x61}, 62 [LINEO4] = {.left = 0x70, .right = 0x71},
63 [LINEIM] = {.left = 0x45, .right = 0xc5}, 63 [LINEIM] = {.left = 0x45, .right = 0xc5},
64 [SPDIFOO] = {.left = 0x00, .right = 0x01}, 64 [SPDIFOO] = {.left = 0x00, .right = 0x01},
65 [SPDIFIO] = {.left = 0x05, .right = 0x85}, 65 [SPDIFIO] = {.left = 0x05, .right = 0x85},
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
index e1c145d8b702..df43a5cd3938 100644
--- a/sound/pci/ctxfi/ctsrc.c
+++ b/sound/pci/ctxfi/ctsrc.c
@@ -724,12 +724,11 @@ static int get_srcimp_rsc(struct srcimp_mgr *mgr,
724 724
725 /* Allocate mem for SRCIMP resource */ 725 /* Allocate mem for SRCIMP resource */
726 srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL); 726 srcimp = kzalloc(sizeof(*srcimp), GFP_KERNEL);
727 if (NULL == srcimp) { 727 if (!srcimp)
728 err = -ENOMEM; 728 return -ENOMEM;
729 return err;
730 }
731 729
732 /* Check whether there are sufficient SRCIMP resources. */ 730 /* Check whether there are sufficient SRCIMP resources. */
731 err = 0;
733 spin_lock_irqsave(&mgr->mgr_lock, flags); 732 spin_lock_irqsave(&mgr->mgr_lock, flags);
734 for (i = 0; i < desc->msr; i++) { 733 for (i = 0; i < desc->msr; i++) {
735 err = mgr_get_resource(&mgr->mgr, 1, &idx); 734 err = mgr_get_resource(&mgr->mgr, 1, &idx);
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 26d255de6beb..88480c0c58a0 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -332,6 +332,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
332 AC_VERB_GET_CONNECT_LIST, i); 332 AC_VERB_GET_CONNECT_LIST, i);
333 range_val = !!(parm & (1 << (shift-1))); /* ranges */ 333 range_val = !!(parm & (1 << (shift-1))); /* ranges */
334 val = parm & mask; 334 val = parm & mask;
335 if (val == 0) {
336 snd_printk(KERN_WARNING "hda_codec: "
337 "invalid CONNECT_LIST verb %x[%i]:%x\n",
338 nid, i, parm);
339 return 0;
340 }
335 parm >>= shift; 341 parm >>= shift;
336 if (range_val) { 342 if (range_val) {
337 /* ranges between the previous and this one */ 343 /* ranges between the previous and this one */
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index fcad5ec31773..9446a5abea13 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -508,7 +508,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry,
508 char name[64]; 508 char name[64];
509 char *sname; 509 char *sname;
510 long long val; 510 long long val;
511 int n; 511 unsigned int n;
512 512
513 while (!snd_info_get_line(buffer, line, sizeof(line))) { 513 while (!snd_info_get_line(buffer, line, sizeof(line))) {
514 if (sscanf(line, "%s %llx", name, &val) != 2) 514 if (sscanf(line, "%s %llx", name, &val) != 2)
@@ -539,7 +539,7 @@ static void hdmi_write_eld_info(struct snd_info_entry *entry,
539 sname++; 539 sname++;
540 n = 10 * n + name[4] - '0'; 540 n = 10 * n + name[4] - '0';
541 } 541 }
542 if (n < 0 || n > 31) /* double the CEA limit */ 542 if (n >= ELD_MAX_SAD)
543 continue; 543 continue;
544 if (!strcmp(sname, "_coding_type")) 544 if (!strcmp(sname, "_coding_type"))
545 e->sad[n].format = val; 545 e->sad[n].format = val;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index be7d25fa7f35..3da85caf8af1 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3754,7 +3754,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol,
3754 int mute = (!ucontrol->value.integer.value[0] && 3754 int mute = (!ucontrol->value.integer.value[0] &&
3755 !ucontrol->value.integer.value[1]); 3755 !ucontrol->value.integer.value[1]);
3756 /* toggle GPIO1 according to the mute state */ 3756 /* toggle GPIO1 according to the mute state */
3757 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 3757 snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
3758 mute ? 0x02 : 0x0); 3758 mute ? 0x02 : 0x0);
3759 return ret; 3759 return ret;
3760} 3760}
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bbb9b42e2604..b95df5d5dcc2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -275,13 +275,13 @@ struct alc_spec {
275 */ 275 */
276 unsigned int num_init_verbs; 276 unsigned int num_init_verbs;
277 277
278 char stream_name_analog[16]; /* analog PCM stream */ 278 char stream_name_analog[32]; /* analog PCM stream */
279 struct hda_pcm_stream *stream_analog_playback; 279 struct hda_pcm_stream *stream_analog_playback;
280 struct hda_pcm_stream *stream_analog_capture; 280 struct hda_pcm_stream *stream_analog_capture;
281 struct hda_pcm_stream *stream_analog_alt_playback; 281 struct hda_pcm_stream *stream_analog_alt_playback;
282 struct hda_pcm_stream *stream_analog_alt_capture; 282 struct hda_pcm_stream *stream_analog_alt_capture;
283 283
284 char stream_name_digital[16]; /* digital PCM stream */ 284 char stream_name_digital[32]; /* digital PCM stream */
285 struct hda_pcm_stream *stream_digital_playback; 285 struct hda_pcm_stream *stream_digital_playback;
286 struct hda_pcm_stream *stream_digital_capture; 286 struct hda_pcm_stream *stream_digital_capture;
287 287
@@ -4505,6 +4505,12 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
4505 &dig_nid, 1); 4505 &dig_nid, 1);
4506 if (err < 0) 4506 if (err < 0)
4507 continue; 4507 continue;
4508 if (dig_nid > 0x7f) {
4509 printk(KERN_ERR "alc880_auto: invalid dig_nid "
4510 "connection 0x%x for NID 0x%x\n", dig_nid,
4511 spec->autocfg.dig_out_pins[i]);
4512 continue;
4513 }
4508 if (!i) 4514 if (!i)
4509 spec->multiout.dig_out_nid = dig_nid; 4515 spec->multiout.dig_out_nid = dig_nid;
4510 else { 4516 else {
@@ -10625,6 +10631,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec,
10625 alc262_lenovo_3000_automute(codec, 1); 10631 alc262_lenovo_3000_automute(codec, 1);
10626} 10632}
10627 10633
10634static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid,
10635 int dir, int idx, long *valp)
10636{
10637 int i, change = 0;
10638
10639 for (i = 0; i < 2; i++, valp++)
10640 change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx,
10641 HDA_AMP_MUTE,
10642 *valp ? 0 : HDA_AMP_MUTE);
10643 return change;
10644}
10645
10628/* bind hp and internal speaker mute (with plug check) */ 10646/* bind hp and internal speaker mute (with plug check) */
10629static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, 10647static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
10630 struct snd_ctl_elem_value *ucontrol) 10648 struct snd_ctl_elem_value *ucontrol)
@@ -10633,13 +10651,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
10633 long *valp = ucontrol->value.integer.value; 10651 long *valp = ucontrol->value.integer.value;
10634 int change; 10652 int change;
10635 10653
10636 change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, 10654 change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
10637 HDA_AMP_MUTE, 10655 change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
10638 valp ? 0 : HDA_AMP_MUTE);
10639 change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
10640 HDA_AMP_MUTE,
10641 valp ? 0 : HDA_AMP_MUTE);
10642
10643 if (change) 10656 if (change)
10644 alc262_fujitsu_automute(codec, 0); 10657 alc262_fujitsu_automute(codec, 0);
10645 return change; 10658 return change;
@@ -10674,10 +10687,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol,
10674 long *valp = ucontrol->value.integer.value; 10687 long *valp = ucontrol->value.integer.value;
10675 int change; 10688 int change;
10676 10689
10677 change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, 10690 change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
10678 HDA_AMP_MUTE,
10679 valp ? 0 : HDA_AMP_MUTE);
10680
10681 if (change) 10691 if (change)
10682 alc262_lenovo_3000_automute(codec, 0); 10692 alc262_lenovo_3000_automute(codec, 0);
10683 return change; 10693 return change;
@@ -11848,12 +11858,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol,
11848 long *valp = ucontrol->value.integer.value; 11858 long *valp = ucontrol->value.integer.value;
11849 int change; 11859 int change;
11850 11860
11851 change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 11861 change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
11852 HDA_AMP_MUTE,
11853 valp[0] ? 0 : HDA_AMP_MUTE);
11854 change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
11855 HDA_AMP_MUTE,
11856 valp[1] ? 0 : HDA_AMP_MUTE);
11857 if (change) 11862 if (change)
11858 alc268_acer_automute(codec, 0); 11863 alc268_acer_automute(codec, 0);
11859 return change; 11864 return change;
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 41b5b3a18c1e..5383d8cff88b 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1809,6 +1809,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1809 "Dell Studio 1537", STAC_DELL_M6_DMIC), 1809 "Dell Studio 1537", STAC_DELL_M6_DMIC),
1810 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0, 1810 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a0,
1811 "Dell Studio 17", STAC_DELL_M6_DMIC), 1811 "Dell Studio 17", STAC_DELL_M6_DMIC),
1812 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
1813 "Dell Studio 1555", STAC_DELL_M6_DMIC),
1812 {} /* terminator */ 1814 {} /* terminator */
1813}; 1815};
1814 1816
@@ -2378,6 +2380,7 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = {
2378 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, 2380 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228,
2379 "Dell Vostro 1500", STAC_9205_DELL_M42), 2381 "Dell Vostro 1500", STAC_9205_DELL_M42),
2380 /* Gateway */ 2382 /* Gateway */
2383 SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD),
2381 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), 2384 SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD),
2382 {} /* terminator */ 2385 {} /* terminator */
2383}; 2386};
@@ -4065,7 +4068,7 @@ static int stac92xx_add_jack(struct hda_codec *codec,
4065 jack->nid = nid; 4068 jack->nid = nid;
4066 jack->type = type; 4069 jack->type = type;
4067 4070
4068 sprintf(name, "%s at %s %s Jack", 4071 snprintf(name, sizeof(name), "%s at %s %s Jack",
4069 snd_hda_get_jack_type(def_conf), 4072 snd_hda_get_jack_type(def_conf),
4070 snd_hda_get_jack_connectivity(def_conf), 4073 snd_hda_get_jack_connectivity(def_conf),
4071 snd_hda_get_jack_location(def_conf)); 4074 snd_hda_get_jack_location(def_conf));
@@ -5854,6 +5857,8 @@ static unsigned int *stac9872_brd_tbl[STAC_9872_MODELS] = {
5854}; 5857};
5855 5858
5856static struct snd_pci_quirk stac9872_cfg_tbl[] = { 5859static struct snd_pci_quirk stac9872_cfg_tbl[] = {
5860 SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
5861 "Sony VAIO F/S", STAC_9872_VAIO),
5857 {} /* terminator */ 5862 {} /* terminator */
5858}; 5863};
5859 5864
@@ -5866,6 +5871,8 @@ static int patch_stac9872(struct hda_codec *codec)
5866 if (spec == NULL) 5871 if (spec == NULL)
5867 return -ENOMEM; 5872 return -ENOMEM;
5868 codec->spec = spec; 5873 codec->spec = spec;
5874 spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
5875 spec->pin_nids = stac9872_pin_nids;
5869 5876
5870 spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS, 5877 spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS,
5871 stac9872_models, 5878 stac9872_models,
@@ -5877,8 +5884,6 @@ static int patch_stac9872(struct hda_codec *codec)
5877 stac92xx_set_config_regs(codec, 5884 stac92xx_set_config_regs(codec,
5878 stac9872_brd_tbl[spec->board_config]); 5885 stac9872_brd_tbl[spec->board_config]);
5879 5886
5880 spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
5881 spec->pin_nids = stac9872_pin_nids;
5882 spec->multiout.dac_nids = spec->dac_nids; 5887 spec->multiout.dac_nids = spec->dac_nids;
5883 spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids); 5888 spec->num_adcs = ARRAY_SIZE(stac9872_adc_nids);
5884 spec->adc_nids = stac9872_adc_nids; 5889 spec->adc_nids = stac9872_adc_nids;
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 235a71e5ac8d..b5ca02e2038c 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -2197,9 +2197,12 @@ static int __init alsa_card_riptide_init(void)
2197 if (err < 0) 2197 if (err < 0)
2198 return err; 2198 return err;
2199#if defined(SUPPORT_JOYSTICK) 2199#if defined(SUPPORT_JOYSTICK)
2200 pci_register_driver(&joystick_driver); 2200 err = pci_register_driver(&joystick_driver);
2201 /* On failure unregister formerly registered audio driver */
2202 if (err < 0)
2203 pci_unregister_driver(&driver);
2201#endif 2204#endif
2202 return 0; 2205 return err;
2203} 2206}
2204 2207
2205static void __exit alsa_card_riptide_exit(void) 2208static void __exit alsa_card_riptide_exit(void)
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index ab099f482487..cb0d1bf34b57 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -767,6 +767,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
767 int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; 767 int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0;
768 u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; 768 u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1;
769 u16 pll_d = 1; 769 u16 pll_d = 1;
770 u8 reg;
770 771
771 /* select data word length */ 772 /* select data word length */
772 data = 773 data =
@@ -801,8 +802,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
801 pll_q &= 0xf; 802 pll_q &= 0xf;
802 aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); 803 aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT);
803 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); 804 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV);
804 } else 805 /* disable PLL if it is bypassed */
806 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG);
807 aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE);
808
809 } else {
805 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); 810 aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV);
811 /* enable PLL when it is used */
812 reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG);
813 aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE);
814 }
806 815
807 /* Route Left DAC to left channel input and 816 /* Route Left DAC to left channel input and
808 * right DAC to right channel input */ 817 * right DAC to right channel input */
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index c05f71803aa8..8c0fdf84aac3 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -1037,14 +1037,14 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
1037 codec->control_data = spi; 1037 codec->control_data = spi;
1038 codec->dev = &spi->dev; 1038 codec->dev = &spi->dev;
1039 1039
1040 spi->dev.driver_data = wm8988; 1040 dev_set_drvdata(&spi->dev, wm8988);
1041 1041
1042 return wm8988_register(wm8988); 1042 return wm8988_register(wm8988);
1043} 1043}
1044 1044
1045static int __devexit wm8988_spi_remove(struct spi_device *spi) 1045static int __devexit wm8988_spi_remove(struct spi_device *spi)
1046{ 1046{
1047 struct wm8988_priv *wm8988 = spi->dev.driver_data; 1047 struct wm8988_priv *wm8988 = dev_get_drvdata(&spi->dev);
1048 1048
1049 wm8988_unregister(wm8988); 1049 wm8988_unregister(wm8988);
1050 1050
diff --git a/sound/soc/s3c24xx/s3c24xx-ac97.h b/sound/soc/s3c24xx/s3c24xx-ac97.h
index a96dcadf28b4..e96f941a810b 100644
--- a/sound/soc/s3c24xx/s3c24xx-ac97.h
+++ b/sound/soc/s3c24xx/s3c24xx-ac97.h
@@ -20,12 +20,6 @@
20#define AC_CMD_ADDR(x) (x << 16) 20#define AC_CMD_ADDR(x) (x << 16)
21#define AC_CMD_DATA(x) (x & 0xffff) 21#define AC_CMD_DATA(x) (x & 0xffff)
22 22
23#ifdef CONFIG_CPU_S3C2440
24#define IRQ_S3C244x_AC97 IRQ_S3C2440_AC97
25#else
26#define IRQ_S3C244x_AC97 IRQ_S3C2443_AC97
27#endif
28
29extern struct snd_soc_dai s3c2443_ac97_dai[]; 23extern struct snd_soc_dai s3c2443_ac97_dai[];
30 24
31#endif /*S3C24XXAC97_H_*/ 25#endif /*S3C24XXAC97_H_*/
diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig
index 523aec188ccf..73525c048e7f 100644
--- a/sound/usb/Kconfig
+++ b/sound/usb/Kconfig
@@ -48,6 +48,7 @@ config SND_USB_CAIAQ
48 * Native Instruments Kore Controller 48 * Native Instruments Kore Controller
49 * Native Instruments Kore Controller 2 49 * Native Instruments Kore Controller 2
50 * Native Instruments Audio Kontrol 1 50 * Native Instruments Audio Kontrol 1
51 * Native Instruments Audio 2 DJ
51 * Native Instruments Audio 4 DJ 52 * Native Instruments Audio 4 DJ
52 * Native Instruments Audio 8 DJ 53 * Native Instruments Audio 8 DJ
53 * Native Instruments Guitar Rig Session I/O 54 * Native Instruments Guitar Rig Session I/O
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 8f9b60c5d74c..121af0644fd9 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -646,6 +646,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev)
646 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE): 646 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_GUITARRIGMOBILE):
647 dev->samplerates |= SNDRV_PCM_RATE_192000; 647 dev->samplerates |= SNDRV_PCM_RATE_192000;
648 /* fall thru */ 648 /* fall thru */
649 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO2DJ):
649 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): 650 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ):
650 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 651 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
651 dev->samplerates |= SNDRV_PCM_RATE_88200; 652 dev->samplerates |= SNDRV_PCM_RATE_88200;
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index de38108f0b28..83e6c1312d47 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -35,13 +35,14 @@
35#include "input.h" 35#include "input.h"
36 36
37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.18"); 38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.19");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," 40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
41 "{Native Instruments, RigKontrol3}," 41 "{Native Instruments, RigKontrol3},"
42 "{Native Instruments, Kore Controller}," 42 "{Native Instruments, Kore Controller},"
43 "{Native Instruments, Kore Controller 2}," 43 "{Native Instruments, Kore Controller 2},"
44 "{Native Instruments, Audio Kontrol 1}," 44 "{Native Instruments, Audio Kontrol 1},"
45 "{Native Instruments, Audio 2 DJ},"
45 "{Native Instruments, Audio 4 DJ}," 46 "{Native Instruments, Audio 4 DJ},"
46 "{Native Instruments, Audio 8 DJ}," 47 "{Native Instruments, Audio 8 DJ},"
47 "{Native Instruments, Session I/O}," 48 "{Native Instruments, Session I/O},"
@@ -121,6 +122,11 @@ static struct usb_device_id snd_usb_id_table[] = {
121 .idVendor = USB_VID_NATIVEINSTRUMENTS, 122 .idVendor = USB_VID_NATIVEINSTRUMENTS,
122 .idProduct = USB_PID_AUDIO4DJ 123 .idProduct = USB_PID_AUDIO4DJ
123 }, 124 },
125 {
126 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
127 .idVendor = USB_VID_NATIVEINSTRUMENTS,
128 .idProduct = USB_PID_AUDIO2DJ
129 },
124 { /* terminator */ } 130 { /* terminator */ }
125}; 131};
126 132
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h
index ece73514854e..44e3edf88bef 100644
--- a/sound/usb/caiaq/device.h
+++ b/sound/usb/caiaq/device.h
@@ -10,6 +10,7 @@
10#define USB_PID_KORECONTROLLER 0x4711 10#define USB_PID_KORECONTROLLER 0x4711
11#define USB_PID_KORECONTROLLER2 0x4712 11#define USB_PID_KORECONTROLLER2 0x4712
12#define USB_PID_AK1 0x0815 12#define USB_PID_AK1 0x0815
13#define USB_PID_AUDIO2DJ 0x041c
13#define USB_PID_AUDIO4DJ 0x0839 14#define USB_PID_AUDIO4DJ 0x0839
14#define USB_PID_AUDIO8DJ 0x1978 15#define USB_PID_AUDIO8DJ 0x1978
15#define USB_PID_SESSIONIO 0x1915 16#define USB_PID_SESSIONIO 0x1915
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c7b902358b7b..44b9cdc8a83b 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2661,7 +2661,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
2661 struct usb_interface_descriptor *altsd; 2661 struct usb_interface_descriptor *altsd;
2662 int i, altno, err, stream; 2662 int i, altno, err, stream;
2663 int format; 2663 int format;
2664 struct audioformat *fp; 2664 struct audioformat *fp = NULL;
2665 unsigned char *fmt, *csep; 2665 unsigned char *fmt, *csep;
2666 int num; 2666 int num;
2667 2667
@@ -2734,6 +2734,18 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
2734 continue; 2734 continue;
2735 } 2735 }
2736 2736
2737 /*
2738 * Blue Microphones workaround: The last altsetting is identical
2739 * with the previous one, except for a larger packet size, but
2740 * is actually a mislabeled two-channel setting; ignore it.
2741 */
2742 if (fmt[4] == 1 && fmt[5] == 2 && altno == 2 && num == 3 &&
2743 fp && fp->altsetting == 1 && fp->channels == 1 &&
2744 fp->format == SNDRV_PCM_FORMAT_S16_LE &&
2745 le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) ==
2746 fp->maxpacksize * 2)
2747 continue;
2748
2737 csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT); 2749 csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT);
2738 /* Creamware Noah has this descriptor after the 2nd endpoint */ 2750 /* Creamware Noah has this descriptor after the 2nd endpoint */
2739 if (!csep && altsd->bNumEndpoints >= 2) 2751 if (!csep && altsd->bNumEndpoints >= 2)
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 4bd3a7a0edc1..ec9cdf986928 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -990,20 +990,35 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
990 break; 990 break;
991 } 991 }
992 992
993 /* quirk for UDA1321/N101 */ 993 /* volume control quirks */
994 /* note that detection between firmware 2.1.1.7 (N101) and later 2.1.1.21 */
995 /* is not very clear from datasheets */
996 /* I hope that the min value is -15360 for newer firmware --jk */
997 switch (state->chip->usb_id) { 994 switch (state->chip->usb_id) {
998 case USB_ID(0x0471, 0x0101): 995 case USB_ID(0x0471, 0x0101):
999 case USB_ID(0x0471, 0x0104): 996 case USB_ID(0x0471, 0x0104):
1000 case USB_ID(0x0471, 0x0105): 997 case USB_ID(0x0471, 0x0105):
1001 case USB_ID(0x0672, 0x1041): 998 case USB_ID(0x0672, 0x1041):
999 /* quirk for UDA1321/N101.
1000 * note that detection between firmware 2.1.1.7 (N101)
1001 * and later 2.1.1.21 is not very clear from datasheets.
1002 * I hope that the min value is -15360 for newer firmware --jk
1003 */
1002 if (!strcmp(kctl->id.name, "PCM Playback Volume") && 1004 if (!strcmp(kctl->id.name, "PCM Playback Volume") &&
1003 cval->min == -15616) { 1005 cval->min == -15616) {
1004 snd_printk(KERN_INFO "using volume control quirk for the UDA1321/N101 chip\n"); 1006 snd_printk(KERN_INFO
1007 "set volume quirk for UDA1321/N101 chip\n");
1005 cval->max = -256; 1008 cval->max = -256;
1006 } 1009 }
1010 break;
1011
1012 case USB_ID(0x046d, 0x09a4):
1013 if (!strcmp(kctl->id.name, "Mic Capture Volume")) {
1014 snd_printk(KERN_INFO
1015 "set volume quirk for QuickCam E3500\n");
1016 cval->min = 6080;
1017 cval->max = 8768;
1018 cval->res = 192;
1019 }
1020 break;
1021
1007 } 1022 }
1008 1023
1009 snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n", 1024 snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 8aa3f8c88707..e72e93110782 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -24,6 +24,9 @@ OPTIONS
24--dsos=:: 24--dsos=::
25 Only consider symbols in these dsos. CSV that understands 25 Only consider symbols in these dsos. CSV that understands
26 file://filename entries. 26 file://filename entries.
27-n
28--show-nr-samples
29 Show the number of samples for each symbol
27-C:: 30-C::
28--comms=:: 31--comms=::
29 Only consider symbols in these comms. CSV that understands 32 Only consider symbols in these comms. CSV that understands
@@ -33,6 +36,18 @@ OPTIONS
33 Only consider these symbols. CSV that understands 36 Only consider these symbols. CSV that understands
34 file://filename entries. 37 file://filename entries.
35 38
39-w::
40--field-width=::
41 Force each column width to the provided list, for large terminal
42 readability.
43
44-t::
45--field-separator=::
46
47 Use a special separator character and don't pad with spaces, replacing
48 all occurances of this separator in symbol names (and other output)
49 with a '.' character, that thus it's the only non valid separator.
50
36SEE ALSO 51SEE ALSO
37-------- 52--------
38linkperf:perf-stat[1] 53linkperf:perf-stat[1]
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7822b3d6baca..a5e9b876ca09 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -345,7 +345,7 @@ BUILTIN_OBJS += builtin-stat.o
345BUILTIN_OBJS += builtin-top.o 345BUILTIN_OBJS += builtin-top.o
346 346
347PERFLIBS = $(LIB_FILE) 347PERFLIBS = $(LIB_FILE)
348EXTLIBS = 348EXTLIBS = -lbfd
349 349
350# 350#
351# Platform specific tweaks 351# Platform specific tweaks
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 5f9eefecc574..1dba568e1941 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -74,20 +74,12 @@ struct fork_event {
74 u32 pid, ppid; 74 u32 pid, ppid;
75}; 75};
76 76
77struct period_event {
78 struct perf_event_header header;
79 u64 time;
80 u64 id;
81 u64 sample_period;
82};
83
84typedef union event_union { 77typedef union event_union {
85 struct perf_event_header header; 78 struct perf_event_header header;
86 struct ip_event ip; 79 struct ip_event ip;
87 struct mmap_event mmap; 80 struct mmap_event mmap;
88 struct comm_event comm; 81 struct comm_event comm;
89 struct fork_event fork; 82 struct fork_event fork;
90 struct period_event period;
91} event_t; 83} event_t;
92 84
93 85
@@ -998,19 +990,6 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
998} 990}
999 991
1000static int 992static int
1001process_period_event(event_t *event, unsigned long offset, unsigned long head)
1002{
1003 dprintf("%p [%p]: PERF_EVENT_PERIOD: time:%Ld, id:%Ld: period:%Ld\n",
1004 (void *)(offset + head),
1005 (void *)(long)(event->header.size),
1006 event->period.time,
1007 event->period.id,
1008 event->period.sample_period);
1009
1010 return 0;
1011}
1012
1013static int
1014process_event(event_t *event, unsigned long offset, unsigned long head) 993process_event(event_t *event, unsigned long offset, unsigned long head)
1015{ 994{
1016 switch (event->header.type) { 995 switch (event->header.type) {
@@ -1025,9 +1004,6 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1025 1004
1026 case PERF_EVENT_FORK: 1005 case PERF_EVENT_FORK:
1027 return process_fork_event(event, offset, head); 1006 return process_fork_event(event, offset, head);
1028
1029 case PERF_EVENT_PERIOD:
1030 return process_period_event(event, offset, head);
1031 /* 1007 /*
1032 * We dont process them right now but they are fine: 1008 * We dont process them right now but they are fine:
1033 */ 1009 */
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 4ef78a5e6f32..6da09928130f 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -43,6 +43,7 @@ static int call_graph = 0;
43static int verbose = 0; 43static int verbose = 0;
44static int inherit_stat = 0; 44static int inherit_stat = 0;
45static int no_samples = 0; 45static int no_samples = 0;
46static int sample_address = 0;
46 47
47static long samples; 48static long samples;
48static struct timeval last_read; 49static struct timeval last_read;
@@ -313,6 +314,10 @@ static void pid_synthesize_mmap_samples(pid_t pid)
313 if (*pbf == 'x') { /* vm_exec */ 314 if (*pbf == 'x') { /* vm_exec */
314 char *execname = strchr(bf, '/'); 315 char *execname = strchr(bf, '/');
315 316
317 /* Catch VDSO */
318 if (execname == NULL)
319 execname = strstr(bf, "[vdso]");
320
316 if (execname == NULL) 321 if (execname == NULL)
317 continue; 322 continue;
318 323
@@ -401,6 +406,9 @@ static void create_counter(int counter, int cpu, pid_t pid)
401 if (inherit_stat) 406 if (inherit_stat)
402 attr->inherit_stat = 1; 407 attr->inherit_stat = 1;
403 408
409 if (sample_address)
410 attr->sample_type |= PERF_SAMPLE_ADDR;
411
404 if (call_graph) 412 if (call_graph)
405 attr->sample_type |= PERF_SAMPLE_CALLCHAIN; 413 attr->sample_type |= PERF_SAMPLE_CALLCHAIN;
406 414
@@ -645,6 +653,8 @@ static const struct option options[] = {
645 "be more verbose (show counter open errors, etc)"), 653 "be more verbose (show counter open errors, etc)"),
646 OPT_BOOLEAN('s', "stat", &inherit_stat, 654 OPT_BOOLEAN('s', "stat", &inherit_stat,
647 "per thread counts"), 655 "per thread counts"),
656 OPT_BOOLEAN('d', "data", &sample_address,
657 "Sample addresses"),
648 OPT_BOOLEAN('n', "no-samples", &no_samples, 658 OPT_BOOLEAN('n', "no-samples", &no_samples,
649 "don't sample"), 659 "don't sample"),
650 OPT_END() 660 OPT_END()
@@ -654,7 +664,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
654{ 664{
655 int counter; 665 int counter;
656 666
657 argc = parse_options(argc, argv, options, record_usage, 0); 667 argc = parse_options(argc, argv, options, record_usage,
668 PARSE_OPT_STOP_AT_NON_OPTION);
658 if (!argc && target_pid == -1 && !system_wide) 669 if (!argc && target_pid == -1 && !system_wide)
659 usage_with_options(record_usage, options); 670 usage_with_options(record_usage, options);
660 671
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 4e5cc266311e..b20a4b6e31b7 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -33,8 +33,10 @@ static char *vmlinux = NULL;
33 33
34static char default_sort_order[] = "comm,dso"; 34static char default_sort_order[] = "comm,dso";
35static char *sort_order = default_sort_order; 35static char *sort_order = default_sort_order;
36static char *dso_list_str, *comm_list_str, *sym_list_str; 36static char *dso_list_str, *comm_list_str, *sym_list_str,
37 *col_width_list_str;
37static struct strlist *dso_list, *comm_list, *sym_list; 38static struct strlist *dso_list, *comm_list, *sym_list;
39static char *field_sep;
38 40
39static int input; 41static int input;
40static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; 42static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
@@ -49,6 +51,7 @@ static int verbose;
49static int modules; 51static int modules;
50 52
51static int full_paths; 53static int full_paths;
54static int show_nr_samples;
52 55
53static unsigned long page_size; 56static unsigned long page_size;
54static unsigned long mmap_window = 32; 57static unsigned long mmap_window = 32;
@@ -98,13 +101,6 @@ struct fork_event {
98 u32 pid, ppid; 101 u32 pid, ppid;
99}; 102};
100 103
101struct period_event {
102 struct perf_event_header header;
103 u64 time;
104 u64 id;
105 u64 sample_period;
106};
107
108struct lost_event { 104struct lost_event {
109 struct perf_event_header header; 105 struct perf_event_header header;
110 u64 id; 106 u64 id;
@@ -124,11 +120,37 @@ typedef union event_union {
124 struct mmap_event mmap; 120 struct mmap_event mmap;
125 struct comm_event comm; 121 struct comm_event comm;
126 struct fork_event fork; 122 struct fork_event fork;
127 struct period_event period;
128 struct lost_event lost; 123 struct lost_event lost;
129 struct read_event read; 124 struct read_event read;
130} event_t; 125} event_t;
131 126
127static int repsep_fprintf(FILE *fp, const char *fmt, ...)
128{
129 int n;
130 va_list ap;
131
132 va_start(ap, fmt);
133 if (!field_sep)
134 n = vfprintf(fp, fmt, ap);
135 else {
136 char *bf = NULL;
137 n = vasprintf(&bf, fmt, ap);
138 if (n > 0) {
139 char *sep = bf;
140 while (1) {
141 sep = strchr(sep, *field_sep);
142 if (sep == NULL)
143 break;
144 *sep = '.';
145 }
146 }
147 fputs(bf, fp);
148 free(bf);
149 }
150 va_end(ap);
151 return n;
152}
153
132static LIST_HEAD(dsos); 154static LIST_HEAD(dsos);
133static struct dso *kernel_dso; 155static struct dso *kernel_dso;
134static struct dso *vdso; 156static struct dso *vdso;
@@ -360,12 +382,28 @@ static struct thread *thread__new(pid_t pid)
360 return self; 382 return self;
361} 383}
362 384
385static unsigned int dsos__col_width,
386 comms__col_width,
387 threads__col_width;
388
363static int thread__set_comm(struct thread *self, const char *comm) 389static int thread__set_comm(struct thread *self, const char *comm)
364{ 390{
365 if (self->comm) 391 if (self->comm)
366 free(self->comm); 392 free(self->comm);
367 self->comm = strdup(comm); 393 self->comm = strdup(comm);
368 return self->comm ? 0 : -ENOMEM; 394 if (!self->comm)
395 return -ENOMEM;
396
397 if (!col_width_list_str && !field_sep &&
398 (!comm_list || strlist__has_entry(comm_list, comm))) {
399 unsigned int slen = strlen(comm);
400 if (slen > comms__col_width) {
401 comms__col_width = slen;
402 threads__col_width = slen + 6;
403 }
404 }
405
406 return 0;
369} 407}
370 408
371static size_t thread__fprintf(struct thread *self, FILE *fp) 409static size_t thread__fprintf(struct thread *self, FILE *fp)
@@ -536,7 +574,9 @@ struct sort_entry {
536 574
537 int64_t (*cmp)(struct hist_entry *, struct hist_entry *); 575 int64_t (*cmp)(struct hist_entry *, struct hist_entry *);
538 int64_t (*collapse)(struct hist_entry *, struct hist_entry *); 576 int64_t (*collapse)(struct hist_entry *, struct hist_entry *);
539 size_t (*print)(FILE *fp, struct hist_entry *); 577 size_t (*print)(FILE *fp, struct hist_entry *, unsigned int width);
578 unsigned int *width;
579 bool elide;
540}; 580};
541 581
542static int64_t cmp_null(void *l, void *r) 582static int64_t cmp_null(void *l, void *r)
@@ -558,15 +598,17 @@ sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
558} 598}
559 599
560static size_t 600static size_t
561sort__thread_print(FILE *fp, struct hist_entry *self) 601sort__thread_print(FILE *fp, struct hist_entry *self, unsigned int width)
562{ 602{
563 return fprintf(fp, "%16s:%5d", self->thread->comm ?: "", self->thread->pid); 603 return repsep_fprintf(fp, "%*s:%5d", width - 6,
604 self->thread->comm ?: "", self->thread->pid);
564} 605}
565 606
566static struct sort_entry sort_thread = { 607static struct sort_entry sort_thread = {
567 .header = " Command: Pid", 608 .header = "Command: Pid",
568 .cmp = sort__thread_cmp, 609 .cmp = sort__thread_cmp,
569 .print = sort__thread_print, 610 .print = sort__thread_print,
611 .width = &threads__col_width,
570}; 612};
571 613
572/* --sort comm */ 614/* --sort comm */
@@ -590,16 +632,17 @@ sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
590} 632}
591 633
592static size_t 634static size_t
593sort__comm_print(FILE *fp, struct hist_entry *self) 635sort__comm_print(FILE *fp, struct hist_entry *self, unsigned int width)
594{ 636{
595 return fprintf(fp, "%16s", self->thread->comm); 637 return repsep_fprintf(fp, "%*s", width, self->thread->comm);
596} 638}
597 639
598static struct sort_entry sort_comm = { 640static struct sort_entry sort_comm = {
599 .header = " Command", 641 .header = "Command",
600 .cmp = sort__comm_cmp, 642 .cmp = sort__comm_cmp,
601 .collapse = sort__comm_collapse, 643 .collapse = sort__comm_collapse,
602 .print = sort__comm_print, 644 .print = sort__comm_print,
645 .width = &comms__col_width,
603}; 646};
604 647
605/* --sort dso */ 648/* --sort dso */
@@ -617,18 +660,19 @@ sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
617} 660}
618 661
619static size_t 662static size_t
620sort__dso_print(FILE *fp, struct hist_entry *self) 663sort__dso_print(FILE *fp, struct hist_entry *self, unsigned int width)
621{ 664{
622 if (self->dso) 665 if (self->dso)
623 return fprintf(fp, "%-25s", self->dso->name); 666 return repsep_fprintf(fp, "%-*s", width, self->dso->name);
624 667
625 return fprintf(fp, "%016llx ", (u64)self->ip); 668 return repsep_fprintf(fp, "%*llx", width, (u64)self->ip);
626} 669}
627 670
628static struct sort_entry sort_dso = { 671static struct sort_entry sort_dso = {
629 .header = "Shared Object ", 672 .header = "Shared Object",
630 .cmp = sort__dso_cmp, 673 .cmp = sort__dso_cmp,
631 .print = sort__dso_print, 674 .print = sort__dso_print,
675 .width = &dsos__col_width,
632}; 676};
633 677
634/* --sort symbol */ 678/* --sort symbol */
@@ -648,22 +692,22 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
648} 692}
649 693
650static size_t 694static size_t
651sort__sym_print(FILE *fp, struct hist_entry *self) 695sort__sym_print(FILE *fp, struct hist_entry *self, unsigned int width __used)
652{ 696{
653 size_t ret = 0; 697 size_t ret = 0;
654 698
655 if (verbose) 699 if (verbose)
656 ret += fprintf(fp, "%#018llx ", (u64)self->ip); 700 ret += repsep_fprintf(fp, "%#018llx ", (u64)self->ip);
657 701
702 ret += repsep_fprintf(fp, "[%c] ", self->level);
658 if (self->sym) { 703 if (self->sym) {
659 ret += fprintf(fp, "[%c] %s", 704 ret += repsep_fprintf(fp, "%s", self->sym->name);
660 self->dso == kernel_dso ? 'k' :
661 self->dso == hypervisor_dso ? 'h' : '.', self->sym->name);
662 705
663 if (self->sym->module) 706 if (self->sym->module)
664 ret += fprintf(fp, "\t[%s]", self->sym->module->name); 707 ret += repsep_fprintf(fp, "\t[%s]",
708 self->sym->module->name);
665 } else { 709 } else {
666 ret += fprintf(fp, "%#016llx", (u64)self->ip); 710 ret += repsep_fprintf(fp, "%#016llx", (u64)self->ip);
667 } 711 }
668 712
669 return ret; 713 return ret;
@@ -690,19 +734,19 @@ sort__parent_cmp(struct hist_entry *left, struct hist_entry *right)
690} 734}
691 735
692static size_t 736static size_t
693sort__parent_print(FILE *fp, struct hist_entry *self) 737sort__parent_print(FILE *fp, struct hist_entry *self, unsigned int width)
694{ 738{
695 size_t ret = 0; 739 return repsep_fprintf(fp, "%-*s", width,
696 740 self->parent ? self->parent->name : "[other]");
697 ret += fprintf(fp, "%-20s", self->parent ? self->parent->name : "[other]");
698
699 return ret;
700} 741}
701 742
743static unsigned int parent_symbol__col_width;
744
702static struct sort_entry sort_parent = { 745static struct sort_entry sort_parent = {
703 .header = "Parent symbol ", 746 .header = "Parent symbol",
704 .cmp = sort__parent_cmp, 747 .cmp = sort__parent_cmp,
705 .print = sort__parent_print, 748 .print = sort__parent_print,
749 .width = &parent_symbol__col_width,
706}; 750};
707 751
708static int sort__need_collapse = 0; 752static int sort__need_collapse = 0;
@@ -967,17 +1011,25 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
967 return 0; 1011 return 0;
968 1012
969 if (total_samples) 1013 if (total_samples)
970 ret = percent_color_fprintf(fp, " %6.2f%%", 1014 ret = percent_color_fprintf(fp,
971 (self->count * 100.0) / total_samples); 1015 field_sep ? "%.2f" : " %6.2f%%",
1016 (self->count * 100.0) / total_samples);
972 else 1017 else
973 ret = fprintf(fp, "%12Ld ", self->count); 1018 ret = fprintf(fp, field_sep ? "%lld" : "%12lld ", self->count);
1019
1020 if (show_nr_samples) {
1021 if (field_sep)
1022 fprintf(fp, "%c%lld", *field_sep, self->count);
1023 else
1024 fprintf(fp, "%11lld", self->count);
1025 }
974 1026
975 list_for_each_entry(se, &hist_entry__sort_list, list) { 1027 list_for_each_entry(se, &hist_entry__sort_list, list) {
976 if (exclude_other && (se == &sort_parent)) 1028 if (se->elide)
977 continue; 1029 continue;
978 1030
979 fprintf(fp, " "); 1031 fprintf(fp, "%s", field_sep ?: " ");
980 ret += se->print(fp, self); 1032 ret += se->print(fp, self, se->width ? *se->width : 0);
981 } 1033 }
982 1034
983 ret += fprintf(fp, "\n"); 1035 ret += fprintf(fp, "\n");
@@ -992,6 +1044,18 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
992 * 1044 *
993 */ 1045 */
994 1046
1047static void dso__calc_col_width(struct dso *self)
1048{
1049 if (!col_width_list_str && !field_sep &&
1050 (!dso_list || strlist__has_entry(dso_list, self->name))) {
1051 unsigned int slen = strlen(self->name);
1052 if (slen > dsos__col_width)
1053 dsos__col_width = slen;
1054 }
1055
1056 self->slen_calculated = 1;
1057}
1058
995static struct symbol * 1059static struct symbol *
996resolve_symbol(struct thread *thread, struct map **mapp, 1060resolve_symbol(struct thread *thread, struct map **mapp,
997 struct dso **dsop, u64 *ipp) 1061 struct dso **dsop, u64 *ipp)
@@ -1011,6 +1075,14 @@ resolve_symbol(struct thread *thread, struct map **mapp,
1011 1075
1012 map = thread__find_map(thread, ip); 1076 map = thread__find_map(thread, ip);
1013 if (map != NULL) { 1077 if (map != NULL) {
1078 /*
1079 * We have to do this here as we may have a dso
1080 * with no symbol hit that has a name longer than
1081 * the ones with symbols sampled.
1082 */
1083 if (!sort_dso.elide && !map->dso->slen_calculated)
1084 dso__calc_col_width(map->dso);
1085
1014 if (mapp) 1086 if (mapp)
1015 *mapp = map; 1087 *mapp = map;
1016got_map: 1088got_map:
@@ -1282,35 +1354,67 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
1282 struct sort_entry *se; 1354 struct sort_entry *se;
1283 struct rb_node *nd; 1355 struct rb_node *nd;
1284 size_t ret = 0; 1356 size_t ret = 0;
1357 unsigned int width;
1358 char *col_width = col_width_list_str;
1285 1359
1286 fprintf(fp, "\n"); 1360 fprintf(fp, "# Samples: %Ld\n", (u64)total_samples);
1287 fprintf(fp, "#\n");
1288 fprintf(fp, "# (%Ld samples)\n", (u64)total_samples);
1289 fprintf(fp, "#\n"); 1361 fprintf(fp, "#\n");
1290 1362
1291 fprintf(fp, "# Overhead"); 1363 fprintf(fp, "# Overhead");
1364 if (show_nr_samples) {
1365 if (field_sep)
1366 fprintf(fp, "%cSamples", *field_sep);
1367 else
1368 fputs(" Samples ", fp);
1369 }
1292 list_for_each_entry(se, &hist_entry__sort_list, list) { 1370 list_for_each_entry(se, &hist_entry__sort_list, list) {
1293 if (exclude_other && (se == &sort_parent)) 1371 if (se->elide)
1294 continue; 1372 continue;
1295 fprintf(fp, " %s", se->header); 1373 if (field_sep) {
1374 fprintf(fp, "%c%s", *field_sep, se->header);
1375 continue;
1376 }
1377 width = strlen(se->header);
1378 if (se->width) {
1379 if (col_width_list_str) {
1380 if (col_width) {
1381 *se->width = atoi(col_width);
1382 col_width = strchr(col_width, ',');
1383 if (col_width)
1384 ++col_width;
1385 }
1386 }
1387 width = *se->width = max(*se->width, width);
1388 }
1389 fprintf(fp, " %*s", width, se->header);
1296 } 1390 }
1297 fprintf(fp, "\n"); 1391 fprintf(fp, "\n");
1298 1392
1393 if (field_sep)
1394 goto print_entries;
1395
1299 fprintf(fp, "# ........"); 1396 fprintf(fp, "# ........");
1397 if (show_nr_samples)
1398 fprintf(fp, " ..........");
1300 list_for_each_entry(se, &hist_entry__sort_list, list) { 1399 list_for_each_entry(se, &hist_entry__sort_list, list) {
1301 unsigned int i; 1400 unsigned int i;
1302 1401
1303 if (exclude_other && (se == &sort_parent)) 1402 if (se->elide)
1304 continue; 1403 continue;
1305 1404
1306 fprintf(fp, " "); 1405 fprintf(fp, " ");
1307 for (i = 0; i < strlen(se->header); i++) 1406 if (se->width)
1407 width = *se->width;
1408 else
1409 width = strlen(se->header);
1410 for (i = 0; i < width; i++)
1308 fprintf(fp, "."); 1411 fprintf(fp, ".");
1309 } 1412 }
1310 fprintf(fp, "\n"); 1413 fprintf(fp, "\n");
1311 1414
1312 fprintf(fp, "#\n"); 1415 fprintf(fp, "#\n");
1313 1416
1417print_entries:
1314 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) { 1418 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) {
1315 pos = rb_entry(nd, struct hist_entry, rb_node); 1419 pos = rb_entry(nd, struct hist_entry, rb_node);
1316 ret += hist_entry__fprintf(fp, pos, total_samples); 1420 ret += hist_entry__fprintf(fp, pos, total_samples);
@@ -1524,19 +1628,6 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
1524} 1628}
1525 1629
1526static int 1630static int
1527process_period_event(event_t *event, unsigned long offset, unsigned long head)
1528{
1529 dprintf("%p [%p]: PERF_EVENT_PERIOD: time:%Ld, id:%Ld: period:%Ld\n",
1530 (void *)(offset + head),
1531 (void *)(long)(event->header.size),
1532 event->period.time,
1533 event->period.id,
1534 event->period.sample_period);
1535
1536 return 0;
1537}
1538
1539static int
1540process_lost_event(event_t *event, unsigned long offset, unsigned long head) 1631process_lost_event(event_t *event, unsigned long offset, unsigned long head)
1541{ 1632{
1542 dprintf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n", 1633 dprintf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n",
@@ -1617,9 +1708,6 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1617 case PERF_EVENT_FORK: 1708 case PERF_EVENT_FORK:
1618 return process_fork_event(event, offset, head); 1709 return process_fork_event(event, offset, head);
1619 1710
1620 case PERF_EVENT_PERIOD:
1621 return process_period_event(event, offset, head);
1622
1623 case PERF_EVENT_LOST: 1711 case PERF_EVENT_LOST:
1624 return process_lost_event(event, offset, head); 1712 return process_lost_event(event, offset, head);
1625 1713
@@ -1883,6 +1971,8 @@ static const struct option options[] = {
1883 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 1971 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
1884 OPT_BOOLEAN('m', "modules", &modules, 1972 OPT_BOOLEAN('m', "modules", &modules,
1885 "load module symbols - WARNING: use only with -k and LIVE kernel"), 1973 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1974 OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples,
1975 "Show a column with the number of samples"),
1886 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 1976 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
1887 "sort by key(s): pid, comm, dso, symbol, parent"), 1977 "sort by key(s): pid, comm, dso, symbol, parent"),
1888 OPT_BOOLEAN('P', "full-paths", &full_paths, 1978 OPT_BOOLEAN('P', "full-paths", &full_paths,
@@ -1891,15 +1981,21 @@ static const struct option options[] = {
1891 "regex filter to identify parent, see: '--sort parent'"), 1981 "regex filter to identify parent, see: '--sort parent'"),
1892 OPT_BOOLEAN('x', "exclude-other", &exclude_other, 1982 OPT_BOOLEAN('x', "exclude-other", &exclude_other,
1893 "Only display entries with parent-match"), 1983 "Only display entries with parent-match"),
1894 OPT_CALLBACK_DEFAULT('c', "callchain", NULL, "output_type,min_percent", 1984 OPT_CALLBACK_DEFAULT('g', "call-graph", NULL, "output_type,min_percent",
1895 "Display callchains using output_type and min percent threshold. " 1985 "Display callchains using output_type and min percent threshold. "
1896 "Default: flat,0", &parse_callchain_opt, callchain_default_opt), 1986 "Default: fractal,0.5", &parse_callchain_opt, callchain_default_opt),
1897 OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]", 1987 OPT_STRING('d', "dsos", &dso_list_str, "dso[,dso...]",
1898 "only consider symbols in these dsos"), 1988 "only consider symbols in these dsos"),
1899 OPT_STRING('C', "comms", &comm_list_str, "comm[,comm...]", 1989 OPT_STRING('C', "comms", &comm_list_str, "comm[,comm...]",
1900 "only consider symbols in these comms"), 1990 "only consider symbols in these comms"),
1901 OPT_STRING('S', "symbols", &sym_list_str, "symbol[,symbol...]", 1991 OPT_STRING('S', "symbols", &sym_list_str, "symbol[,symbol...]",
1902 "only consider these symbols"), 1992 "only consider these symbols"),
1993 OPT_STRING('w', "column-widths", &col_width_list_str,
1994 "width[,width...]",
1995 "don't try to adjust column width, use these fixed values"),
1996 OPT_STRING('t', "field-separator", &field_sep, "separator",
1997 "separator for columns, no spaces will be added between "
1998 "columns '.' is reserved."),
1903 OPT_END() 1999 OPT_END()
1904}; 2000};
1905 2001
@@ -1919,7 +2015,8 @@ static void setup_sorting(void)
1919} 2015}
1920 2016
1921static void setup_list(struct strlist **list, const char *list_str, 2017static void setup_list(struct strlist **list, const char *list_str,
1922 const char *list_name) 2018 struct sort_entry *se, const char *list_name,
2019 FILE *fp)
1923{ 2020{
1924 if (list_str) { 2021 if (list_str) {
1925 *list = strlist__new(true, list_str); 2022 *list = strlist__new(true, list_str);
@@ -1928,6 +2025,11 @@ static void setup_list(struct strlist **list, const char *list_str,
1928 list_name); 2025 list_name);
1929 exit(129); 2026 exit(129);
1930 } 2027 }
2028 if (strlist__nr_entries(*list) == 1) {
2029 fprintf(fp, "# %s: %s\n", list_name,
2030 strlist__entry(*list, 0)->s);
2031 se->elide = true;
2032 }
1931 } 2033 }
1932} 2034}
1933 2035
@@ -1941,9 +2043,10 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
1941 2043
1942 setup_sorting(); 2044 setup_sorting();
1943 2045
1944 if (parent_pattern != default_parent_pattern) 2046 if (parent_pattern != default_parent_pattern) {
1945 sort_dimension__add("parent"); 2047 sort_dimension__add("parent");
1946 else 2048 sort_parent.elide = 1;
2049 } else
1947 exclude_other = 0; 2050 exclude_other = 0;
1948 2051
1949 /* 2052 /*
@@ -1952,11 +2055,17 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
1952 if (argc) 2055 if (argc)
1953 usage_with_options(report_usage, options); 2056 usage_with_options(report_usage, options);
1954 2057
1955 setup_list(&dso_list, dso_list_str, "dso");
1956 setup_list(&comm_list, comm_list_str, "comm");
1957 setup_list(&sym_list, sym_list_str, "symbol");
1958
1959 setup_pager(); 2058 setup_pager();
1960 2059
2060 setup_list(&dso_list, dso_list_str, &sort_dso, "dso", stdout);
2061 setup_list(&comm_list, comm_list_str, &sort_comm, "comm", stdout);
2062 setup_list(&sym_list, sym_list_str, &sort_sym, "symbol", stdout);
2063
2064 if (field_sep && *field_sep == '.') {
2065 fputs("'.' is the only non valid --field-separator argument\n",
2066 stderr);
2067 exit(129);
2068 }
2069
1961 return __cmd_report(); 2070 return __cmd_report();
1962} 2071}
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 27921a8ce1a9..f9510eeeb6c7 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -511,7 +511,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
511{ 511{
512 int status; 512 int status;
513 513
514 argc = parse_options(argc, argv, options, stat_usage, 0); 514 argc = parse_options(argc, argv, options, stat_usage,
515 PARSE_OPT_STOP_AT_NON_OPTION);
515 if (!argc) 516 if (!argc)
516 usage_with_options(stat_usage, options); 517 usage_with_options(stat_usage, options);
517 if (run_count <= 0 || run_count > MAX_RUN) 518 if (run_count <= 0 || run_count > MAX_RUN)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 95d5c0ae375a..c0a423004e15 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -58,6 +58,7 @@ static u64 count_filter = 5;
58static int print_entries = 15; 58static int print_entries = 15;
59 59
60static int target_pid = -1; 60static int target_pid = -1;
61static int inherit = 0;
61static int profile_cpu = -1; 62static int profile_cpu = -1;
62static int nr_cpus = 0; 63static int nr_cpus = 0;
63static unsigned int realtime_prio = 0; 64static unsigned int realtime_prio = 0;
@@ -549,7 +550,7 @@ int group_fd;
549static void start_counter(int i, int counter) 550static void start_counter(int i, int counter)
550{ 551{
551 struct perf_counter_attr *attr; 552 struct perf_counter_attr *attr;
552 unsigned int cpu; 553 int cpu;
553 554
554 cpu = profile_cpu; 555 cpu = profile_cpu;
555 if (target_pid == -1 && profile_cpu == -1) 556 if (target_pid == -1 && profile_cpu == -1)
@@ -559,6 +560,7 @@ static void start_counter(int i, int counter)
559 560
560 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; 561 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
561 attr->freq = freq; 562 attr->freq = freq;
563 attr->inherit = (cpu < 0) && inherit;
562 564
563try_again: 565try_again:
564 fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0); 566 fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0);
@@ -685,6 +687,8 @@ static const struct option options[] = {
685 "only display functions with more events than this"), 687 "only display functions with more events than this"),
686 OPT_BOOLEAN('g', "group", &group, 688 OPT_BOOLEAN('g', "group", &group,
687 "put the counters into a counter group"), 689 "put the counters into a counter group"),
690 OPT_BOOLEAN('i', "inherit", &inherit,
691 "child tasks inherit counters"),
688 OPT_STRING('s', "sym-filter", &sym_filter, "pattern", 692 OPT_STRING('s', "sym-filter", &sym_filter, "pattern",
689 "only display symbols matchig this pattern"), 693 "only display symbols matchig this pattern"),
690 OPT_BOOLEAN('z', "zero", &zero, 694 OPT_BOOLEAN('z', "zero", &zero,
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index c5656784c61d..31982ad064b4 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -12,6 +12,8 @@
12#include "util/cache.h" 12#include "util/cache.h"
13#include "util/quote.h" 13#include "util/quote.h"
14#include "util/run-command.h" 14#include "util/run-command.h"
15#include "util/parse-events.h"
16#include "util/string.h"
15 17
16const char perf_usage_string[] = 18const char perf_usage_string[] =
17 "perf [--version] [--help] COMMAND [ARGS]"; 19 "perf [--version] [--help] COMMAND [ARGS]";
@@ -25,6 +27,8 @@ struct pager_config {
25 int val; 27 int val;
26}; 28};
27 29
30static char debugfs_mntpt[MAXPATHLEN];
31
28static int pager_command_config(const char *var, const char *value, void *data) 32static int pager_command_config(const char *var, const char *value, void *data)
29{ 33{
30 struct pager_config *c = data; 34 struct pager_config *c = data;
@@ -56,6 +60,15 @@ static void commit_pager_choice(void) {
56 } 60 }
57} 61}
58 62
63static void set_debugfs_path(void)
64{
65 char *path;
66
67 path = getenv(PERF_DEBUGFS_ENVIRONMENT);
68 snprintf(debugfs_path, MAXPATHLEN, "%s/%s", path ?: debugfs_mntpt,
69 "tracing/events");
70}
71
59static int handle_options(const char*** argv, int* argc, int* envchanged) 72static int handle_options(const char*** argv, int* argc, int* envchanged)
60{ 73{
61 int handled = 0; 74 int handled = 0;
@@ -122,6 +135,22 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
122 setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + 12, 1); 135 setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + 12, 1);
123 if (envchanged) 136 if (envchanged)
124 *envchanged = 1; 137 *envchanged = 1;
138 } else if (!strcmp(cmd, "--debugfs-dir")) {
139 if (*argc < 2) {
140 fprintf(stderr, "No directory given for --debugfs-dir.\n");
141 usage(perf_usage_string);
142 }
143 strncpy(debugfs_mntpt, (*argv)[1], MAXPATHLEN);
144 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
145 if (envchanged)
146 *envchanged = 1;
147 (*argv)++;
148 (*argc)--;
149 } else if (!prefixcmp(cmd, "--debugfs-dir=")) {
150 strncpy(debugfs_mntpt, cmd + 14, MAXPATHLEN);
151 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
152 if (envchanged)
153 *envchanged = 1;
125 } else { 154 } else {
126 fprintf(stderr, "Unknown option: %s\n", cmd); 155 fprintf(stderr, "Unknown option: %s\n", cmd);
127 usage(perf_usage_string); 156 usage(perf_usage_string);
@@ -228,6 +257,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
228 if (use_pager == -1 && p->option & USE_PAGER) 257 if (use_pager == -1 && p->option & USE_PAGER)
229 use_pager = 1; 258 use_pager = 1;
230 commit_pager_choice(); 259 commit_pager_choice();
260 set_debugfs_path();
231 261
232 status = p->fn(argc, argv, prefix); 262 status = p->fn(argc, argv, prefix);
233 if (status) 263 if (status)
@@ -346,6 +376,49 @@ static int run_argv(int *argcp, const char ***argv)
346 return done_alias; 376 return done_alias;
347} 377}
348 378
379/* mini /proc/mounts parser: searching for "^blah /mount/point debugfs" */
380static void get_debugfs_mntpt(void)
381{
382 FILE *file;
383 char fs_type[100];
384 char debugfs[MAXPATHLEN];
385
386 /*
387 * try the standard location
388 */
389 if (valid_debugfs_mount("/sys/kernel/debug/") == 0) {
390 strcpy(debugfs_mntpt, "/sys/kernel/debug/");
391 return;
392 }
393
394 /*
395 * try the sane location
396 */
397 if (valid_debugfs_mount("/debug/") == 0) {
398 strcpy(debugfs_mntpt, "/debug/");
399 return;
400 }
401
402 /*
403 * give up and parse /proc/mounts
404 */
405 file = fopen("/proc/mounts", "r");
406 if (file == NULL)
407 return;
408
409 while (fscanf(file, "%*s %"
410 STR(MAXPATHLEN)
411 "s %99s %*s %*d %*d\n",
412 debugfs, fs_type) == 2) {
413 if (strcmp(fs_type, "debugfs") == 0)
414 break;
415 }
416 fclose(file);
417 if (strcmp(fs_type, "debugfs") == 0) {
418 strncpy(debugfs_mntpt, debugfs, MAXPATHLEN);
419 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
420 }
421}
349 422
350int main(int argc, const char **argv) 423int main(int argc, const char **argv)
351{ 424{
@@ -354,7 +427,8 @@ int main(int argc, const char **argv)
354 cmd = perf_extract_argv0_path(argv[0]); 427 cmd = perf_extract_argv0_path(argv[0]);
355 if (!cmd) 428 if (!cmd)
356 cmd = "perf-help"; 429 cmd = "perf-help";
357 430 /* get debugfs mount point from /proc/mounts */
431 get_debugfs_mntpt();
358 /* 432 /*
359 * "perf-xxxx" is the same as "perf xxxx", but we obviously: 433 * "perf-xxxx" is the same as "perf xxxx", but we obviously:
360 * 434 *
@@ -377,6 +451,7 @@ int main(int argc, const char **argv)
377 argc--; 451 argc--;
378 handle_options(&argv, &argc, NULL); 452 handle_options(&argv, &argc, NULL);
379 commit_pager_choice(); 453 commit_pager_choice();
454 set_debugfs_path();
380 if (argc > 0) { 455 if (argc > 0) {
381 if (!prefixcmp(argv[0], "--")) 456 if (!prefixcmp(argv[0], "--"))
382 argv[0] += 2; 457 argv[0] += 2;
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 63e67cc5487b..e5148e2b6134 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,7 +1,13 @@
1#ifndef _PERF_PERF_H 1#ifndef _PERF_PERF_H
2#define _PERF_PERF_H 2#define _PERF_PERF_H
3 3
4#if defined(__x86_64__) || defined(__i386__) 4#if defined(__i386__)
5#include "../../arch/x86/include/asm/unistd.h"
6#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
7#define cpu_relax() asm volatile("rep; nop" ::: "memory");
8#endif
9
10#if defined(__x86_64__)
5#include "../../arch/x86/include/asm/unistd.h" 11#include "../../arch/x86/include/asm/unistd.h"
6#define rmb() asm volatile("lfence" ::: "memory") 12#define rmb() asm volatile("lfence" ::: "memory")
7#define cpu_relax() asm volatile("rep; nop" ::: "memory"); 13#define cpu_relax() asm volatile("rep; nop" ::: "memory");
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index 161d5f413e28..4b50c412b9c5 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -18,6 +18,7 @@
18#define PERFATTRIBUTES_FILE ".perfattributes" 18#define PERFATTRIBUTES_FILE ".perfattributes"
19#define INFOATTRIBUTES_FILE "info/attributes" 19#define INFOATTRIBUTES_FILE "info/attributes"
20#define ATTRIBUTE_MACRO_PREFIX "[attr]" 20#define ATTRIBUTE_MACRO_PREFIX "[attr]"
21#define PERF_DEBUGFS_ENVIRONMENT "PERF_DEBUGFS_DIR"
21 22
22typedef int (*config_fn_t)(const char *, const char *, void *); 23typedef int (*config_fn_t)(const char *, const char *, void *);
23extern int perf_default_config(const char *, const char *, void *); 24extern int perf_default_config(const char *, const char *, void *);
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index b5ef53ad4c7a..bf280449fcfd 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -16,7 +16,7 @@ struct perf_header {
16 int frozen; 16 int frozen;
17 int attrs, size; 17 int attrs, size;
18 struct perf_header_attr **attr; 18 struct perf_header_attr **attr;
19 off_t attr_offset; 19 s64 attr_offset;
20 u64 data_offset; 20 u64 data_offset;
21 u64 data_size; 21 u64 data_size;
22}; 22};
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h
index 99c1b3d1edd9..a6b87390cb52 100644
--- a/tools/perf/util/include/linux/kernel.h
+++ b/tools/perf/util/include/linux/kernel.h
@@ -18,4 +18,12 @@
18 (type *)((char *)__mptr - offsetof(type, member)); }) 18 (type *)((char *)__mptr - offsetof(type, member)); })
19#endif 19#endif
20 20
21#ifndef max
22#define max(x, y) ({ \
23 typeof(x) _max1 = (x); \
24 typeof(y) _max2 = (y); \
25 (void) (&_max1 == &_max2); \
26 _max1 > _max2 ? _max1 : _max2; })
27#endif
28
21#endif 29#endif
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 5184959e0615..7bdad8df22a6 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -5,6 +5,7 @@
5#include "parse-events.h" 5#include "parse-events.h"
6#include "exec_cmd.h" 6#include "exec_cmd.h"
7#include "string.h" 7#include "string.h"
8#include "cache.h"
8 9
9extern char *strcasestr(const char *haystack, const char *needle); 10extern char *strcasestr(const char *haystack, const char *needle);
10 11
@@ -19,6 +20,8 @@ struct event_symbol {
19 char *alias; 20 char *alias;
20}; 21};
21 22
23char debugfs_path[MAXPATHLEN];
24
22#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x 25#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
23#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x 26#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
24 27
@@ -71,8 +74,8 @@ static char *sw_event_names[] = {
71#define MAX_ALIASES 8 74#define MAX_ALIASES 8
72 75
73static char *hw_cache[][MAX_ALIASES] = { 76static char *hw_cache[][MAX_ALIASES] = {
74 { "L1-d$", "l1-d", "l1d", "L1-data", }, 77 { "L1-dcache", "l1-d", "l1d", "L1-data", },
75 { "L1-i$", "l1-i", "l1i", "L1-instruction", }, 78 { "L1-icache", "l1-i", "l1i", "L1-instruction", },
76 { "LLC", "L2" }, 79 { "LLC", "L2" },
77 { "dTLB", "d-tlb", "Data-TLB", }, 80 { "dTLB", "d-tlb", "Data-TLB", },
78 { "iTLB", "i-tlb", "Instruction-TLB", }, 81 { "iTLB", "i-tlb", "Instruction-TLB", },
@@ -110,6 +113,88 @@ static unsigned long hw_cache_stat[C(MAX)] = {
110 [C(BPU)] = (CACHE_READ), 113 [C(BPU)] = (CACHE_READ),
111}; 114};
112 115
116#define for_each_subsystem(sys_dir, sys_dirent, sys_next, file, st) \
117 while (!readdir_r(sys_dir, &sys_dirent, &sys_next) && sys_next) \
118 if (snprintf(file, MAXPATHLEN, "%s/%s", debugfs_path, \
119 sys_dirent.d_name) && \
120 (!stat(file, &st)) && (S_ISDIR(st.st_mode)) && \
121 (strcmp(sys_dirent.d_name, ".")) && \
122 (strcmp(sys_dirent.d_name, "..")))
123
124#define for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next, file, st) \
125 while (!readdir_r(evt_dir, &evt_dirent, &evt_next) && evt_next) \
126 if (snprintf(file, MAXPATHLEN, "%s/%s/%s", debugfs_path, \
127 sys_dirent.d_name, evt_dirent.d_name) && \
128 (!stat(file, &st)) && (S_ISDIR(st.st_mode)) && \
129 (strcmp(evt_dirent.d_name, ".")) && \
130 (strcmp(evt_dirent.d_name, "..")))
131
132#define MAX_EVENT_LENGTH 30
133
134int valid_debugfs_mount(const char *debugfs)
135{
136 struct statfs st_fs;
137
138 if (statfs(debugfs, &st_fs) < 0)
139 return -ENOENT;
140 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
141 return -ENOENT;
142 return 0;
143}
144
145static char *tracepoint_id_to_name(u64 config)
146{
147 static char tracepoint_name[2 * MAX_EVENT_LENGTH];
148 DIR *sys_dir, *evt_dir;
149 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
150 struct stat st;
151 char id_buf[4];
152 int fd;
153 u64 id;
154 char evt_path[MAXPATHLEN];
155
156 if (valid_debugfs_mount(debugfs_path))
157 return "unkown";
158
159 sys_dir = opendir(debugfs_path);
160 if (!sys_dir)
161 goto cleanup;
162
163 for_each_subsystem(sys_dir, sys_dirent, sys_next, evt_path, st) {
164 evt_dir = opendir(evt_path);
165 if (!evt_dir)
166 goto cleanup;
167 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next,
168 evt_path, st) {
169 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id",
170 debugfs_path, sys_dirent.d_name,
171 evt_dirent.d_name);
172 fd = open(evt_path, O_RDONLY);
173 if (fd < 0)
174 continue;
175 if (read(fd, id_buf, sizeof(id_buf)) < 0) {
176 close(fd);
177 continue;
178 }
179 close(fd);
180 id = atoll(id_buf);
181 if (id == config) {
182 closedir(evt_dir);
183 closedir(sys_dir);
184 snprintf(tracepoint_name, 2 * MAX_EVENT_LENGTH,
185 "%s:%s", sys_dirent.d_name,
186 evt_dirent.d_name);
187 return tracepoint_name;
188 }
189 }
190 closedir(evt_dir);
191 }
192
193cleanup:
194 closedir(sys_dir);
195 return "unkown";
196}
197
113static int is_cache_op_valid(u8 cache_type, u8 cache_op) 198static int is_cache_op_valid(u8 cache_type, u8 cache_op)
114{ 199{
115 if (hw_cache_stat[cache_type] & COP(cache_op)) 200 if (hw_cache_stat[cache_type] & COP(cache_op))
@@ -177,6 +262,9 @@ char *event_name(int counter)
177 return sw_event_names[config]; 262 return sw_event_names[config];
178 return "unknown-software"; 263 return "unknown-software";
179 264
265 case PERF_TYPE_TRACEPOINT:
266 return tracepoint_id_to_name(config);
267
180 default: 268 default:
181 break; 269 break;
182 } 270 }
@@ -265,6 +353,53 @@ parse_generic_hw_event(const char **str, struct perf_counter_attr *attr)
265 return 1; 353 return 1;
266} 354}
267 355
356static int parse_tracepoint_event(const char **strp,
357 struct perf_counter_attr *attr)
358{
359 const char *evt_name;
360 char sys_name[MAX_EVENT_LENGTH];
361 char id_buf[4];
362 int fd;
363 unsigned int sys_length, evt_length;
364 u64 id;
365 char evt_path[MAXPATHLEN];
366
367 if (valid_debugfs_mount(debugfs_path))
368 return 0;
369
370 evt_name = strchr(*strp, ':');
371 if (!evt_name)
372 return 0;
373
374 sys_length = evt_name - *strp;
375 if (sys_length >= MAX_EVENT_LENGTH)
376 return 0;
377
378 strncpy(sys_name, *strp, sys_length);
379 sys_name[sys_length] = '\0';
380 evt_name = evt_name + 1;
381 evt_length = strlen(evt_name);
382 if (evt_length >= MAX_EVENT_LENGTH)
383 return 0;
384
385 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
386 sys_name, evt_name);
387 fd = open(evt_path, O_RDONLY);
388 if (fd < 0)
389 return 0;
390
391 if (read(fd, id_buf, sizeof(id_buf)) < 0) {
392 close(fd);
393 return 0;
394 }
395 close(fd);
396 id = atoll(id_buf);
397 attr->config = id;
398 attr->type = PERF_TYPE_TRACEPOINT;
399 *strp = evt_name + evt_length;
400 return 1;
401}
402
268static int check_events(const char *str, unsigned int i) 403static int check_events(const char *str, unsigned int i)
269{ 404{
270 int n; 405 int n;
@@ -374,7 +509,8 @@ parse_event_modifier(const char **strp, struct perf_counter_attr *attr)
374 */ 509 */
375static int parse_event_symbols(const char **str, struct perf_counter_attr *attr) 510static int parse_event_symbols(const char **str, struct perf_counter_attr *attr)
376{ 511{
377 if (!(parse_raw_event(str, attr) || 512 if (!(parse_tracepoint_event(str, attr) ||
513 parse_raw_event(str, attr) ||
378 parse_numeric_event(str, attr) || 514 parse_numeric_event(str, attr) ||
379 parse_symbolic_event(str, attr) || 515 parse_symbolic_event(str, attr) ||
380 parse_generic_hw_event(str, attr))) 516 parse_generic_hw_event(str, attr)))
@@ -423,6 +559,42 @@ static const char * const event_type_descriptors[] = {
423}; 559};
424 560
425/* 561/*
562 * Print the events from <debugfs_mount_point>/tracing/events
563 */
564
565static void print_tracepoint_events(void)
566{
567 DIR *sys_dir, *evt_dir;
568 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
569 struct stat st;
570 char evt_path[MAXPATHLEN];
571
572 if (valid_debugfs_mount(debugfs_path))
573 return;
574
575 sys_dir = opendir(debugfs_path);
576 if (!sys_dir)
577 goto cleanup;
578
579 for_each_subsystem(sys_dir, sys_dirent, sys_next, evt_path, st) {
580 evt_dir = opendir(evt_path);
581 if (!evt_dir)
582 goto cleanup;
583 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next,
584 evt_path, st) {
585 snprintf(evt_path, MAXPATHLEN, "%s:%s",
586 sys_dirent.d_name, evt_dirent.d_name);
587 fprintf(stderr, " %-40s [%s]\n", evt_path,
588 event_type_descriptors[PERF_TYPE_TRACEPOINT+1]);
589 }
590 closedir(evt_dir);
591 }
592
593cleanup:
594 closedir(sys_dir);
595}
596
597/*
426 * Print the help text for the event symbols: 598 * Print the help text for the event symbols:
427 */ 599 */
428void print_events(void) 600void print_events(void)
@@ -436,7 +608,7 @@ void print_events(void)
436 608
437 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { 609 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
438 type = syms->type + 1; 610 type = syms->type + 1;
439 if (type > ARRAY_SIZE(event_type_descriptors)) 611 if (type >= ARRAY_SIZE(event_type_descriptors))
440 type = 0; 612 type = 0;
441 613
442 if (type != prev_type) 614 if (type != prev_type)
@@ -472,5 +644,7 @@ void print_events(void)
472 "rNNN"); 644 "rNNN");
473 fprintf(stderr, "\n"); 645 fprintf(stderr, "\n");
474 646
647 print_tracepoint_events();
648
475 exit(129); 649 exit(129);
476} 650}
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index e3d552908e60..1ea5d09b6eb1 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -3,6 +3,8 @@
3 * Parse symbolic events/counts passed in as options: 3 * Parse symbolic events/counts passed in as options:
4 */ 4 */
5 5
6struct option;
7
6extern int nr_counters; 8extern int nr_counters;
7 9
8extern struct perf_counter_attr attrs[MAX_COUNTERS]; 10extern struct perf_counter_attr attrs[MAX_COUNTERS];
@@ -15,3 +17,6 @@ extern int parse_events(const struct option *opt, const char *str, int unset);
15 17
16extern void print_events(void); 18extern void print_events(void);
17 19
20extern char debugfs_path[];
21extern int valid_debugfs_mount(const char *debugfs);
22
diff --git a/tools/perf/util/string.h b/tools/perf/util/string.h
index 3dca2f654cd0..bf39dfadfd24 100644
--- a/tools/perf/util/string.h
+++ b/tools/perf/util/string.h
@@ -5,4 +5,7 @@
5 5
6int hex2u64(const char *ptr, u64 *val); 6int hex2u64(const char *ptr, u64 *val);
7 7
8#define _STR(x) #x
9#define STR(x) _STR(x)
10
8#endif 11#endif
diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
index 025a78edfffe..7ad38171dc2b 100644
--- a/tools/perf/util/strlist.c
+++ b/tools/perf/util/strlist.c
@@ -64,6 +64,7 @@ int strlist__add(struct strlist *self, const char *new_entry)
64 64
65 rb_link_node(&sn->rb_node, parent, p); 65 rb_link_node(&sn->rb_node, parent, p);
66 rb_insert_color(&sn->rb_node, &self->entries); 66 rb_insert_color(&sn->rb_node, &self->entries);
67 ++self->nr_entries;
67 68
68 return 0; 69 return 0;
69} 70}
@@ -155,8 +156,9 @@ struct strlist *strlist__new(bool dupstr, const char *slist)
155 struct strlist *self = malloc(sizeof(*self)); 156 struct strlist *self = malloc(sizeof(*self));
156 157
157 if (self != NULL) { 158 if (self != NULL) {
158 self->entries = RB_ROOT; 159 self->entries = RB_ROOT;
159 self->dupstr = dupstr; 160 self->dupstr = dupstr;
161 self->nr_entries = 0;
160 if (slist && strlist__parse_list(self, slist) != 0) 162 if (slist && strlist__parse_list(self, slist) != 0)
161 goto out_error; 163 goto out_error;
162 } 164 }
@@ -182,3 +184,17 @@ void strlist__delete(struct strlist *self)
182 free(self); 184 free(self);
183 } 185 }
184} 186}
187
188struct str_node *strlist__entry(const struct strlist *self, unsigned int idx)
189{
190 struct rb_node *nd;
191
192 for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) {
193 struct str_node *pos = rb_entry(nd, struct str_node, rb_node);
194
195 if (!idx--)
196 return pos;
197 }
198
199 return NULL;
200}
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
index 2fdcfee87586..921818e44a54 100644
--- a/tools/perf/util/strlist.h
+++ b/tools/perf/util/strlist.h
@@ -11,7 +11,8 @@ struct str_node {
11 11
12struct strlist { 12struct strlist {
13 struct rb_root entries; 13 struct rb_root entries;
14 bool dupstr; 14 unsigned int nr_entries;
15 bool dupstr;
15}; 16};
16 17
17struct strlist *strlist__new(bool dupstr, const char *slist); 18struct strlist *strlist__new(bool dupstr, const char *slist);
@@ -21,11 +22,17 @@ void strlist__remove(struct strlist *self, struct str_node *sn);
21int strlist__load(struct strlist *self, const char *filename); 22int strlist__load(struct strlist *self, const char *filename);
22int strlist__add(struct strlist *self, const char *str); 23int strlist__add(struct strlist *self, const char *str);
23 24
25struct str_node *strlist__entry(const struct strlist *self, unsigned int idx);
24bool strlist__has_entry(struct strlist *self, const char *entry); 26bool strlist__has_entry(struct strlist *self, const char *entry);
25 27
26static inline bool strlist__empty(const struct strlist *self) 28static inline bool strlist__empty(const struct strlist *self)
27{ 29{
28 return rb_first(&self->entries) == NULL; 30 return self->nr_entries == 0;
31}
32
33static inline unsigned int strlist__nr_entries(const struct strlist *self)
34{
35 return self->nr_entries;
29} 36}
30 37
31int strlist__parse_list(struct strlist *self, const char *s); 38int strlist__parse_list(struct strlist *self, const char *s);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 4683b67b5ee4..28106059bf12 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -6,9 +6,15 @@
6#include <libelf.h> 6#include <libelf.h>
7#include <gelf.h> 7#include <gelf.h>
8#include <elf.h> 8#include <elf.h>
9#include <bfd.h>
9 10
10const char *sym_hist_filter; 11const char *sym_hist_filter;
11 12
13#ifndef DMGL_PARAMS
14#define DMGL_PARAMS (1 << 0) /* Include function args */
15#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
16#endif
17
12static struct symbol *symbol__new(u64 start, u64 len, 18static struct symbol *symbol__new(u64 start, u64 len,
13 const char *name, unsigned int priv_size, 19 const char *name, unsigned int priv_size,
14 u64 obj_start, int verbose) 20 u64 obj_start, int verbose)
@@ -65,6 +71,7 @@ struct dso *dso__new(const char *name, unsigned int sym_priv_size)
65 self->syms = RB_ROOT; 71 self->syms = RB_ROOT;
66 self->sym_priv_size = sym_priv_size; 72 self->sym_priv_size = sym_priv_size;
67 self->find_symbol = dso__find_symbol; 73 self->find_symbol = dso__find_symbol;
74 self->slen_calculated = 0;
68 } 75 }
69 76
70 return self; 77 return self;
@@ -373,36 +380,61 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
373 idx < nr_entries; \ 380 idx < nr_entries; \
374 ++idx, pos = gelf_getrela(reldata, idx, &pos_mem)) 381 ++idx, pos = gelf_getrela(reldata, idx, &pos_mem))
375 382
376static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf, 383/*
377 GElf_Ehdr *ehdr, Elf_Scn *scn_dynsym, 384 * We need to check if we have a .dynsym, so that we can handle the
378 GElf_Shdr *shdr_dynsym, 385 * .plt, synthesizing its symbols, that aren't on the symtabs (be it
379 size_t dynsym_idx, int verbose) 386 * .dynsym or .symtab).
387 * And always look at the original dso, not at debuginfo packages, that
388 * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
389 */
390static int dso__synthesize_plt_symbols(struct dso *self, int verbose)
380{ 391{
381 uint32_t nr_rel_entries, idx; 392 uint32_t nr_rel_entries, idx;
382 GElf_Sym sym; 393 GElf_Sym sym;
383 u64 plt_offset; 394 u64 plt_offset;
384 GElf_Shdr shdr_plt; 395 GElf_Shdr shdr_plt;
385 struct symbol *f; 396 struct symbol *f;
386 GElf_Shdr shdr_rel_plt; 397 GElf_Shdr shdr_rel_plt, shdr_dynsym;
387 Elf_Data *reldata, *syms, *symstrs; 398 Elf_Data *reldata, *syms, *symstrs;
388 Elf_Scn *scn_plt_rel, *scn_symstrs; 399 Elf_Scn *scn_plt_rel, *scn_symstrs, *scn_dynsym;
400 size_t dynsym_idx;
401 GElf_Ehdr ehdr;
389 char sympltname[1024]; 402 char sympltname[1024];
390 int nr = 0, symidx; 403 Elf *elf;
404 int nr = 0, symidx, fd, err = 0;
405
406 fd = open(self->name, O_RDONLY);
407 if (fd < 0)
408 goto out;
409
410 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
411 if (elf == NULL)
412 goto out_close;
413
414 if (gelf_getehdr(elf, &ehdr) == NULL)
415 goto out_elf_end;
416
417 scn_dynsym = elf_section_by_name(elf, &ehdr, &shdr_dynsym,
418 ".dynsym", &dynsym_idx);
419 if (scn_dynsym == NULL)
420 goto out_elf_end;
391 421
392 scn_plt_rel = elf_section_by_name(elf, ehdr, &shdr_rel_plt, 422 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
393 ".rela.plt", NULL); 423 ".rela.plt", NULL);
394 if (scn_plt_rel == NULL) { 424 if (scn_plt_rel == NULL) {
395 scn_plt_rel = elf_section_by_name(elf, ehdr, &shdr_rel_plt, 425 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
396 ".rel.plt", NULL); 426 ".rel.plt", NULL);
397 if (scn_plt_rel == NULL) 427 if (scn_plt_rel == NULL)
398 return 0; 428 goto out_elf_end;
399 } 429 }
400 430
431 err = -1;
432
401 if (shdr_rel_plt.sh_link != dynsym_idx) 433 if (shdr_rel_plt.sh_link != dynsym_idx)
402 return 0; 434 goto out_elf_end;
403 435
404 if (elf_section_by_name(elf, ehdr, &shdr_plt, ".plt", NULL) == NULL) 436 if (elf_section_by_name(elf, &ehdr, &shdr_plt, ".plt", NULL) == NULL)
405 return 0; 437 goto out_elf_end;
406 438
407 /* 439 /*
408 * Fetch the relocation section to find the indexes to the GOT 440 * Fetch the relocation section to find the indexes to the GOT
@@ -410,19 +442,19 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
410 */ 442 */
411 reldata = elf_getdata(scn_plt_rel, NULL); 443 reldata = elf_getdata(scn_plt_rel, NULL);
412 if (reldata == NULL) 444 if (reldata == NULL)
413 return -1; 445 goto out_elf_end;
414 446
415 syms = elf_getdata(scn_dynsym, NULL); 447 syms = elf_getdata(scn_dynsym, NULL);
416 if (syms == NULL) 448 if (syms == NULL)
417 return -1; 449 goto out_elf_end;
418 450
419 scn_symstrs = elf_getscn(elf, shdr_dynsym->sh_link); 451 scn_symstrs = elf_getscn(elf, shdr_dynsym.sh_link);
420 if (scn_symstrs == NULL) 452 if (scn_symstrs == NULL)
421 return -1; 453 goto out_elf_end;
422 454
423 symstrs = elf_getdata(scn_symstrs, NULL); 455 symstrs = elf_getdata(scn_symstrs, NULL);
424 if (symstrs == NULL) 456 if (symstrs == NULL)
425 return -1; 457 goto out_elf_end;
426 458
427 nr_rel_entries = shdr_rel_plt.sh_size / shdr_rel_plt.sh_entsize; 459 nr_rel_entries = shdr_rel_plt.sh_size / shdr_rel_plt.sh_entsize;
428 plt_offset = shdr_plt.sh_offset; 460 plt_offset = shdr_plt.sh_offset;
@@ -441,7 +473,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
441 f = symbol__new(plt_offset, shdr_plt.sh_entsize, 473 f = symbol__new(plt_offset, shdr_plt.sh_entsize,
442 sympltname, self->sym_priv_size, 0, verbose); 474 sympltname, self->sym_priv_size, 0, verbose);
443 if (!f) 475 if (!f)
444 return -1; 476 goto out_elf_end;
445 477
446 dso__insert_symbol(self, f); 478 dso__insert_symbol(self, f);
447 ++nr; 479 ++nr;
@@ -459,19 +491,25 @@ static int dso__synthesize_plt_symbols(struct dso *self, Elf *elf,
459 f = symbol__new(plt_offset, shdr_plt.sh_entsize, 491 f = symbol__new(plt_offset, shdr_plt.sh_entsize,
460 sympltname, self->sym_priv_size, 0, verbose); 492 sympltname, self->sym_priv_size, 0, verbose);
461 if (!f) 493 if (!f)
462 return -1; 494 goto out_elf_end;
463 495
464 dso__insert_symbol(self, f); 496 dso__insert_symbol(self, f);
465 ++nr; 497 ++nr;
466 } 498 }
467 } else {
468 /*
469 * TODO: There are still one more shdr_rel_plt.sh_type
470 * I have to investigate, but probably should be ignored.
471 */
472 } 499 }
473 500
474 return nr; 501 err = 0;
502out_elf_end:
503 elf_end(elf);
504out_close:
505 close(fd);
506
507 if (err == 0)
508 return nr;
509out:
510 fprintf(stderr, "%s: problems reading %s PLT info.\n",
511 __func__, self->name);
512 return 0;
475} 513}
476 514
477static int dso__load_sym(struct dso *self, int fd, const char *name, 515static int dso__load_sym(struct dso *self, int fd, const char *name,
@@ -485,10 +523,9 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
485 GElf_Shdr shdr; 523 GElf_Shdr shdr;
486 Elf_Data *syms; 524 Elf_Data *syms;
487 GElf_Sym sym; 525 GElf_Sym sym;
488 Elf_Scn *sec, *sec_dynsym, *sec_strndx; 526 Elf_Scn *sec, *sec_strndx;
489 Elf *elf; 527 Elf *elf;
490 size_t dynsym_idx; 528 int nr = 0, kernel = !strcmp("[kernel]", self->name);
491 int nr = 0;
492 529
493 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); 530 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
494 if (elf == NULL) { 531 if (elf == NULL) {
@@ -504,32 +541,11 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
504 goto out_elf_end; 541 goto out_elf_end;
505 } 542 }
506 543
507 /*
508 * We need to check if we have a .dynsym, so that we can handle the
509 * .plt, synthesizing its symbols, that aren't on the symtabs (be it
510 * .dynsym or .symtab)
511 */
512 sec_dynsym = elf_section_by_name(elf, &ehdr, &shdr,
513 ".dynsym", &dynsym_idx);
514 if (sec_dynsym != NULL) {
515 nr = dso__synthesize_plt_symbols(self, elf, &ehdr,
516 sec_dynsym, &shdr,
517 dynsym_idx, verbose);
518 if (nr < 0)
519 goto out_elf_end;
520 }
521
522 /*
523 * But if we have a full .symtab (that is a superset of .dynsym) we
524 * should add the symbols not in the .dynsyn
525 */
526 sec = elf_section_by_name(elf, &ehdr, &shdr, ".symtab", NULL); 544 sec = elf_section_by_name(elf, &ehdr, &shdr, ".symtab", NULL);
527 if (sec == NULL) { 545 if (sec == NULL) {
528 if (sec_dynsym == NULL) 546 sec = elf_section_by_name(elf, &ehdr, &shdr, ".dynsym", NULL);
547 if (sec == NULL)
529 goto out_elf_end; 548 goto out_elf_end;
530
531 sec = sec_dynsym;
532 gelf_getshdr(sec, &shdr);
533 } 549 }
534 550
535 syms = elf_getdata(sec, NULL); 551 syms = elf_getdata(sec, NULL);
@@ -555,12 +571,17 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
555 nr_syms = shdr.sh_size / shdr.sh_entsize; 571 nr_syms = shdr.sh_size / shdr.sh_entsize;
556 572
557 memset(&sym, 0, sizeof(sym)); 573 memset(&sym, 0, sizeof(sym));
558 self->adjust_symbols = (ehdr.e_type == ET_EXEC || 574 if (!kernel) {
575 self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
559 elf_section_by_name(elf, &ehdr, &shdr, 576 elf_section_by_name(elf, &ehdr, &shdr,
560 ".gnu.prelink_undo", 577 ".gnu.prelink_undo",
561 NULL) != NULL); 578 NULL) != NULL);
579 } else self->adjust_symbols = 0;
580
562 elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { 581 elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
563 struct symbol *f; 582 struct symbol *f;
583 const char *name;
584 char *demangled;
564 u64 obj_start; 585 u64 obj_start;
565 struct section *section = NULL; 586 struct section *section = NULL;
566 int is_label = elf_sym__is_label(&sym); 587 int is_label = elf_sym__is_label(&sym);
@@ -599,10 +620,19 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
599 goto out_elf_end; 620 goto out_elf_end;
600 } 621 }
601 } 622 }
623 /*
624 * We need to figure out if the object was created from C++ sources
625 * DWARF DW_compile_unit has this, but we don't always have access
626 * to it...
627 */
628 name = elf_sym__name(&sym, symstrs);
629 demangled = bfd_demangle(NULL, name, DMGL_PARAMS | DMGL_ANSI);
630 if (demangled != NULL)
631 name = demangled;
602 632
603 f = symbol__new(sym.st_value, sym.st_size, 633 f = symbol__new(sym.st_value, sym.st_size, name,
604 elf_sym__name(&sym, symstrs),
605 self->sym_priv_size, obj_start, verbose); 634 self->sym_priv_size, obj_start, verbose);
635 free(demangled);
606 if (!f) 636 if (!f)
607 goto out_elf_end; 637 goto out_elf_end;
608 638
@@ -668,6 +698,11 @@ more:
668 if (!ret) 698 if (!ret)
669 goto more; 699 goto more;
670 700
701 if (ret > 0) {
702 int nr_plt = dso__synthesize_plt_symbols(self, verbose);
703 if (nr_plt > 0)
704 ret += nr_plt;
705 }
671out: 706out:
672 free(name); 707 free(name);
673 return ret; 708 return ret;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 7918cffb23cd..2f92b21c712d 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -25,6 +25,7 @@ struct dso {
25 struct symbol *(*find_symbol)(struct dso *, u64 ip); 25 struct symbol *(*find_symbol)(struct dso *, u64 ip);
26 unsigned int sym_priv_size; 26 unsigned int sym_priv_size;
27 unsigned char adjust_symbols; 27 unsigned char adjust_symbols;
28 unsigned char slen_calculated;
28 char name[0]; 29 char name[0];
29}; 30};
30 31
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index b4be6071c105..68fe157d72fb 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -50,6 +50,7 @@
50#include <unistd.h> 50#include <unistd.h>
51#include <stdio.h> 51#include <stdio.h>
52#include <sys/stat.h> 52#include <sys/stat.h>
53#include <sys/statfs.h>
53#include <fcntl.h> 54#include <fcntl.h>
54#include <stddef.h> 55#include <stddef.h>
55#include <stdlib.h> 56#include <stdlib.h>
@@ -80,6 +81,7 @@
80#include <netdb.h> 81#include <netdb.h>
81#include <pwd.h> 82#include <pwd.h>
82#include <inttypes.h> 83#include <inttypes.h>
84#include "../../../include/linux/magic.h"
83 85
84#ifndef NO_ICONV 86#ifndef NO_ICONV
85#include <iconv.h> 87#include <iconv.h>