aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/ABI/testing/debugfs-pktcdvd6
-rw-r--r--Documentation/DocBook/Makefile11
-rw-r--r--Documentation/cgroups/memory.txt55
-rw-r--r--Documentation/cgroups/resource_counter.txt27
-rw-r--r--Documentation/feature-removal-schedule.txt9
-rw-r--r--Documentation/input/rotary-encoder.txt101
-rw-r--r--Documentation/kbuild/makefiles.txt83
-rw-r--r--Documentation/sparse.txt8
-rw-r--r--Documentation/sysctl/net.txt2
-rw-r--r--Documentation/tomoyo.txt55
-rw-r--r--Documentation/vm/00-INDEX2
-rw-r--r--Documentation/vm/active_mm.txt83
-rw-r--r--Documentation/vm/unevictable-lru.txt1041
-rw-r--r--MAINTAINERS1607
-rw-r--r--Makefile15
-rw-r--r--arch/Kconfig3
-rw-r--r--arch/arm/mach-omap2/usb-musb.c8
-rw-r--r--arch/ia64/kernel/pci-swiotlb.c2
-rw-r--r--arch/microblaze/Kconfig141
-rw-r--r--arch/microblaze/Kconfig.debug26
-rw-r--r--arch/microblaze/Makefile69
-rw-r--r--arch/microblaze/boot/Makefile17
-rw-r--r--arch/microblaze/configs/nommu_defconfig804
-rw-r--r--arch/microblaze/include/asm/Kbuild26
-rw-r--r--arch/microblaze/include/asm/atomic.h123
-rw-r--r--arch/microblaze/include/asm/auxvec.h1
-rw-r--r--arch/microblaze/include/asm/bitops.h27
-rw-r--r--arch/microblaze/include/asm/bug.h15
-rw-r--r--arch/microblaze/include/asm/bugs.h17
-rw-r--r--arch/microblaze/include/asm/byteorder.h6
-rw-r--r--arch/microblaze/include/asm/cache.h45
-rw-r--r--arch/microblaze/include/asm/cacheflush.h85
-rw-r--r--arch/microblaze/include/asm/checksum.h98
-rw-r--r--arch/microblaze/include/asm/clinkage.h1
-rw-r--r--arch/microblaze/include/asm/cpuinfo.h102
-rw-r--r--arch/microblaze/include/asm/cputable.h1
-rw-r--r--arch/microblaze/include/asm/cputime.h1
-rw-r--r--arch/microblaze/include/asm/current.h21
-rw-r--r--arch/microblaze/include/asm/delay.h72
-rw-r--r--arch/microblaze/include/asm/device.h21
-rw-r--r--arch/microblaze/include/asm/div64.h1
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h129
-rw-r--r--arch/microblaze/include/asm/dma.h16
-rw-r--r--arch/microblaze/include/asm/elf.h30
-rw-r--r--arch/microblaze/include/asm/emergency-restart.h1
-rw-r--r--arch/microblaze/include/asm/entry.h35
-rw-r--r--arch/microblaze/include/asm/errno.h1
-rw-r--r--arch/microblaze/include/asm/exceptions.h96
-rw-r--r--arch/microblaze/include/asm/fcntl.h1
-rw-r--r--arch/microblaze/include/asm/flat.h90
-rw-r--r--arch/microblaze/include/asm/ftrace.h1
-rw-r--r--arch/microblaze/include/asm/futex.h1
-rw-r--r--arch/microblaze/include/asm/gpio.h56
-rw-r--r--arch/microblaze/include/asm/hardirq.h29
-rw-r--r--arch/microblaze/include/asm/hw_irq.h1
-rw-r--r--arch/microblaze/include/asm/io.h208
-rw-r--r--arch/microblaze/include/asm/ioctl.h1
-rw-r--r--arch/microblaze/include/asm/ioctls.h91
-rw-r--r--arch/microblaze/include/asm/ipc.h1
-rw-r--r--arch/microblaze/include/asm/ipcbuf.h36
-rw-r--r--arch/microblaze/include/asm/irq.h47
-rw-r--r--arch/microblaze/include/asm/irq_regs.h1
-rw-r--r--arch/microblaze/include/asm/irqflags.h123
-rw-r--r--arch/microblaze/include/asm/kdebug.h1
-rw-r--r--arch/microblaze/include/asm/kmap_types.h29
-rw-r--r--arch/microblaze/include/asm/linkage.h15
-rw-r--r--arch/microblaze/include/asm/lmb.h17
-rw-r--r--arch/microblaze/include/asm/local.h1
-rw-r--r--arch/microblaze/include/asm/mman.h25
-rw-r--r--arch/microblaze/include/asm/mmu.h19
-rw-r--r--arch/microblaze/include/asm/mmu_context.h21
-rw-r--r--arch/microblaze/include/asm/module.h37
-rw-r--r--arch/microblaze/include/asm/msgbuf.h31
-rw-r--r--arch/microblaze/include/asm/mutex.h1
-rw-r--r--arch/microblaze/include/asm/namei.h22
-rw-r--r--arch/microblaze/include/asm/of_device.h45
-rw-r--r--arch/microblaze/include/asm/of_platform.h64
-rw-r--r--arch/microblaze/include/asm/page.h140
-rw-r--r--arch/microblaze/include/asm/param.h30
-rw-r--r--arch/microblaze/include/asm/pci-bridge.h1
-rw-r--r--arch/microblaze/include/asm/pci.h1
-rw-r--r--arch/microblaze/include/asm/percpu.h1
-rw-r--r--arch/microblaze/include/asm/pgalloc.h14
-rw-r--r--arch/microblaze/include/asm/pgtable.h54
-rw-r--r--arch/microblaze/include/asm/poll.h1
-rw-r--r--arch/microblaze/include/asm/posix_types.h73
-rw-r--r--arch/microblaze/include/asm/processor.h93
-rw-r--r--arch/microblaze/include/asm/prom.h313
-rw-r--r--arch/microblaze/include/asm/ptrace.h68
-rw-r--r--arch/microblaze/include/asm/pvr.h209
-rw-r--r--arch/microblaze/include/asm/registers.h33
-rw-r--r--arch/microblaze/include/asm/resource.h1
-rw-r--r--arch/microblaze/include/asm/scatterlist.h28
-rw-r--r--arch/microblaze/include/asm/sections.h25
-rw-r--r--arch/microblaze/include/asm/segment.h43
-rw-r--r--arch/microblaze/include/asm/selfmod.h24
-rw-r--r--arch/microblaze/include/asm/sembuf.h34
-rw-r--r--arch/microblaze/include/asm/serial.h14
-rw-r--r--arch/microblaze/include/asm/setup.h44
-rw-r--r--arch/microblaze/include/asm/shmbuf.h42
-rw-r--r--arch/microblaze/include/asm/shmparam.h6
-rw-r--r--arch/microblaze/include/asm/sigcontext.h20
-rw-r--r--arch/microblaze/include/asm/siginfo.h15
-rw-r--r--arch/microblaze/include/asm/signal.h165
-rw-r--r--arch/microblaze/include/asm/socket.h69
-rw-r--r--arch/microblaze/include/asm/sockios.h23
-rw-r--r--arch/microblaze/include/asm/stat.h73
-rw-r--r--arch/microblaze/include/asm/statfs.h1
-rw-r--r--arch/microblaze/include/asm/string.h24
-rw-r--r--arch/microblaze/include/asm/swab.h8
-rw-r--r--arch/microblaze/include/asm/syscalls.h45
-rw-r--r--arch/microblaze/include/asm/system.h91
-rw-r--r--arch/microblaze/include/asm/termbits.h203
-rw-r--r--arch/microblaze/include/asm/termios.h88
-rw-r--r--arch/microblaze/include/asm/thread_info.h159
-rw-r--r--arch/microblaze/include/asm/timex.h18
-rw-r--r--arch/microblaze/include/asm/tlb.h16
-rw-r--r--arch/microblaze/include/asm/tlbflush.h20
-rw-r--r--arch/microblaze/include/asm/topology.h11
-rw-r--r--arch/microblaze/include/asm/types.h38
-rw-r--r--arch/microblaze/include/asm/uaccess.h134
-rw-r--r--arch/microblaze/include/asm/ucontext.h22
-rw-r--r--arch/microblaze/include/asm/unaligned.h22
-rw-r--r--arch/microblaze/include/asm/unistd.h421
-rw-r--r--arch/microblaze/include/asm/user.h1
-rw-r--r--arch/microblaze/include/asm/vga.h1
-rw-r--r--arch/microblaze/include/asm/xor.h1
-rw-r--r--arch/microblaze/kernel/Makefile19
-rw-r--r--arch/microblaze/kernel/asm-offsets.c115
-rw-r--r--arch/microblaze/kernel/cpu/Makefile8
-rw-r--r--arch/microblaze/kernel/cpu/cache.c258
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c101
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-static.c144
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo.c86
-rw-r--r--arch/microblaze/kernel/cpu/mb.c148
-rw-r--r--arch/microblaze/kernel/cpu/pvr.c81
-rw-r--r--arch/microblaze/kernel/early_printk.c107
-rw-r--r--arch/microblaze/kernel/entry-nommu.S596
-rw-r--r--arch/microblaze/kernel/exceptions.c124
-rw-r--r--arch/microblaze/kernel/head.S56
-rw-r--r--arch/microblaze/kernel/heartbeat.c67
-rw-r--r--arch/microblaze/kernel/hw_exception_handler.S458
-rw-r--r--arch/microblaze/kernel/init_task.c29
-rw-r--r--arch/microblaze/kernel/intc.c172
-rw-r--r--arch/microblaze/kernel/irq.c104
-rw-r--r--arch/microblaze/kernel/microblaze_ksyms.c47
-rw-r--r--arch/microblaze/kernel/module.c151
-rw-r--r--arch/microblaze/kernel/of_device.c113
-rw-r--r--arch/microblaze/kernel/of_platform.c201
-rw-r--r--arch/microblaze/kernel/process.c186
-rw-r--r--arch/microblaze/kernel/prom.c1146
-rw-r--r--arch/microblaze/kernel/prom_parse.c1025
-rw-r--r--arch/microblaze/kernel/ptrace.c181
-rw-r--r--arch/microblaze/kernel/selfmod.c81
-rw-r--r--arch/microblaze/kernel/setup.c199
-rw-r--r--arch/microblaze/kernel/signal.c537
-rw-r--r--arch/microblaze/kernel/sys_microblaze.c225
-rw-r--r--arch/microblaze/kernel/syscall_table.S365
-rw-r--r--arch/microblaze/kernel/timer.c262
-rw-r--r--arch/microblaze/kernel/traps.c107
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S163
-rw-r--r--arch/microblaze/lib/Makefile13
-rw-r--r--arch/microblaze/lib/checksum.c163
-rw-r--r--arch/microblaze/lib/fastcopy.S662
-rw-r--r--arch/microblaze/lib/memcpy.c161
-rw-r--r--arch/microblaze/lib/memmove.c175
-rw-r--r--arch/microblaze/lib/memset.c82
-rw-r--r--arch/microblaze/lib/uaccess.c41
-rw-r--r--arch/microblaze/mm/Makefile5
-rw-r--r--arch/microblaze/mm/init.c201
-rw-r--r--arch/microblaze/platform/Kconfig.platform85
-rw-r--r--arch/microblaze/platform/Makefile6
-rw-r--r--arch/microblaze/platform/generic/Kconfig.auto62
-rw-r--r--arch/microblaze/platform/generic/Makefile3
-rw-r--r--arch/microblaze/platform/generic/system.dts332
-rw-r--r--arch/microblaze/platform/platform.c31
-rw-r--r--arch/mips/include/asm/mach-rc32434/gpio.h3
-rw-r--r--arch/mips/rb532/devices.c19
-rw-r--r--arch/powerpc/include/asm/parport.h2
-rw-r--r--arch/s390/Kconfig1
-rw-r--r--arch/sh/Kconfig18
-rw-r--r--arch/sh/boards/board-ap325rxa.c1
-rw-r--r--arch/sh/boards/board-urquell.c30
-rw-r--r--arch/sh/drivers/pci/ops-sh7785lcr.c5
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.h2
-rw-r--r--arch/sh/drivers/pci/pci.c3
-rw-r--r--arch/sh/include/asm/dma-mapping.h36
-rw-r--r--arch/sh/include/asm/scatterlist.h11
-rw-r--r--arch/sh/include/asm/topology.h7
-rw-r--r--arch/sh/include/asm/unistd_32.h4
-rw-r--r--arch/sh/include/asm/unistd_64.h4
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c14
-rw-r--r--arch/sh/kernel/syscalls_32.S2
-rw-r--r--arch/sh/kernel/syscalls_64.S2
-rw-r--r--arch/sh/mm/consistent.c31
-rw-r--r--arch/sparc/include/asm/parport.h5
-rw-r--r--arch/x86/include/asm/io.h6
-rw-r--r--arch/x86/include/asm/processor.h6
-rw-r--r--arch/x86/include/asm/required-features.h2
-rw-r--r--arch/x86/include/asm/sigcontext.h6
-rw-r--r--arch/x86/include/asm/xen/page.h3
-rw-r--r--arch/x86/include/asm/xsave.h3
-rw-r--r--arch/x86/kernel/apic/io_apic.c5
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c24
-rw-r--r--arch/x86/kernel/mpparse.c7
-rw-r--r--arch/x86/kernel/xsave.c2
-rw-r--r--arch/x86/mm/gup.c16
-rw-r--r--arch/x86/mm/ioremap.c23
-rw-r--r--arch/x86/mm/pat.c2
-rw-r--r--arch/x86/xen/enlighten.c89
-rw-r--r--arch/x86/xen/mmu.c116
-rw-r--r--arch/x86/xen/mmu.h3
-rw-r--r--arch/x86/xen/smp.c4
-rw-r--r--arch/x86/xen/xen-ops.h2
-rw-r--r--drivers/ata/ahci.c57
-rw-r--r--drivers/ata/libata-core.c4
-rw-r--r--drivers/ata/sata_via.c2
-rw-r--r--drivers/atm/solos-pci.c2
-rw-r--r--drivers/block/cciss.c2
-rw-r--r--drivers/char/agp/intel-agp.c3
-rw-r--r--drivers/char/sysrq.c1
-rw-r--r--drivers/edac/edac_core.h12
-rw-r--r--drivers/edac/edac_device.c2
-rw-r--r--drivers/edac/edac_mc.c2
-rw-r--r--drivers/edac/edac_pci.c2
-rw-r--r--drivers/hwmon/Kconfig10
-rw-r--r--drivers/hwmon/Makefile1
-rw-r--r--drivers/hwmon/hp_accel.c1
-rw-r--r--drivers/hwmon/sht15.c692
-rw-r--r--drivers/i2c/algos/i2c-algo-pca.c2
-rw-r--r--drivers/i2c/busses/Kconfig6
-rw-r--r--drivers/i2c/i2c-core.c3
-rw-r--r--drivers/input/input.c13
-rw-r--r--drivers/input/keyboard/atkbd.c135
-rw-r--r--drivers/input/keyboard/bf54x-keys.c4
-rw-r--r--drivers/input/keyboard/hilkbd.c140
-rw-r--r--drivers/input/misc/Kconfig23
-rw-r--r--drivers/input/misc/Makefile28
-rw-r--r--drivers/input/misc/ati_remote2.c277
-rw-r--r--drivers/input/misc/rb532_button.c120
-rw-r--r--drivers/input/misc/rotary_encoder.c221
-rw-r--r--drivers/input/mouse/Kconfig11
-rw-r--r--drivers/input/mouse/Makefile9
-rw-r--r--drivers/input/mouse/hgpk.c2
-rw-r--r--drivers/input/mouse/maplemouse.c147
-rw-r--r--drivers/input/mouse/pc110pad.c5
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h8
-rw-r--r--drivers/input/touchscreen/Kconfig58
-rw-r--r--drivers/input/touchscreen/Makefile3
-rw-r--r--drivers/input/touchscreen/ad7877.c844
-rw-r--r--drivers/input/touchscreen/ad7879.c782
-rw-r--r--drivers/input/touchscreen/mainstone-wm97xx.c3
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c5
-rw-r--r--drivers/input/touchscreen/wm97xx-core.c13
-rw-r--r--drivers/input/touchscreen/zylonite-wm97xx.c240
-rw-r--r--drivers/leds/leds-gpio.c2
-rw-r--r--drivers/misc/eeprom/at24.c8
-rw-r--r--drivers/misc/eeprom/at25.c5
-rw-r--r--drivers/misc/sgi-xp/xpc.h254
-rw-r--r--drivers/misc/sgi-xp/xpc_channel.c138
-rw-r--r--drivers/misc/sgi-xp/xpc_main.c128
-rw-r--r--drivers/misc/sgi-xp/xpc_partition.c20
-rw-r--r--drivers/misc/sgi-xp/xpc_sn2.c164
-rw-r--r--drivers/misc/sgi-xp/xpc_uv.c257
-rw-r--r--drivers/net/atl1c/atl1c_main.c4
-rw-r--r--drivers/net/benet/be_main.c4
-rw-r--r--drivers/net/jme.c8
-rw-r--r--drivers/net/wireless/ath9k/pci.c4
-rw-r--r--drivers/net/wireless/p54/p54pci.c4
-rw-r--r--drivers/parisc/superio.c3
-rw-r--r--drivers/pci/dmar.c11
-rw-r--r--drivers/pci/intel-iommu.c4
-rw-r--r--drivers/scsi/3w-9xxx.c8
-rw-r--r--drivers/scsi/aacraid/aachba.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c2
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c10
-rw-r--r--drivers/scsi/scsi_priv.h3
-rw-r--r--drivers/scsi/scsi_wait_scan.c2
-rw-r--r--drivers/serial/Kconfig4
-rw-r--r--drivers/sh/intc.c35
-rw-r--r--drivers/spi/spi.c22
-rw-r--r--drivers/staging/b3dfg/b3dfg.c2
-rw-r--r--drivers/usb/class/cdc-acm.c4
-rw-r--r--drivers/usb/otg/nop-usb-xceiv.c4
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c26
-rw-r--r--drivers/video/aty/radeon_base.c4
-rw-r--r--drivers/video/backlight/backlight.c3
-rw-r--r--drivers/video/backlight/lcd.c3
-rw-r--r--drivers/video/cirrusfb.c4
-rw-r--r--drivers/video/console/fbcon.c55
-rw-r--r--drivers/video/efifb.c7
-rw-r--r--drivers/video/fbmem.c19
-rw-r--r--drivers/video/intelfb/intelfb.h2
-rw-r--r--drivers/video/intelfb/intelfb_i2c.c1
-rw-r--r--drivers/video/intelfb/intelfbdrv.c1
-rw-r--r--drivers/video/intelfb/intelfbhw.c5
-rw-r--r--drivers/video/s3fb.c6
-rw-r--r--drivers/video/sa1100fb.c15
-rw-r--r--drivers/video/sa1100fb.h7
-rw-r--r--drivers/video/sis/sis_main.c2
-rw-r--r--drivers/video/skeletonfb.c8
-rw-r--r--drivers/video/uvesafb.c35
-rw-r--r--drivers/video/vfb.c11
-rw-r--r--drivers/watchdog/Kconfig2
-rw-r--r--drivers/watchdog/Makefile2
-rw-r--r--drivers/watchdog/at91rm9200_wdt.c6
-rw-r--r--drivers/watchdog/i6300esb.c155
-rw-r--r--drivers/watchdog/ks8695_wdt.c6
-rw-r--r--drivers/watchdog/omap_wdt.c6
-rw-r--r--drivers/watchdog/orion5x_wdt.c57
-rw-r--r--drivers/xen/cpu_hotplug.c40
-rw-r--r--drivers/xen/manage.c5
-rw-r--r--fs/ext2/inode.c44
-rw-r--r--fs/hfs/inode.c4
-rw-r--r--fs/hfs/mdb.c1
-rw-r--r--fs/jbd/revoke.c24
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c38
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.h1
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c9
-rw-r--r--fs/xfs/linux-2.6/xfs_fs_subr.c14
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c18
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c78
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.h9
-rw-r--r--fs/xfs/xfs_iget.c23
-rw-r--r--fs/xfs/xfs_iomap.c61
-rw-r--r--fs/xfs/xfs_iomap.h3
-rw-r--r--fs/xfs/xfs_log.c78
-rw-r--r--fs/xfs/xfs_mount.h2
-rw-r--r--fs/xfs/xfs_vnodeops.c7
-rw-r--r--include/asm-generic/percpu.h52
-rw-r--r--include/asm-generic/siginfo.h2
-rw-r--r--include/drm/drm_pciids.h2
-rw-r--r--include/linux/capability.h23
-rw-r--r--include/linux/debug_locks.h7
-rw-r--r--include/linux/fb.h8
-rw-r--r--include/linux/fiemap.h2
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/init_task.h13
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/percpu.h52
-rw-r--r--include/linux/rotary_encoder.h13
-rw-r--r--include/linux/sht15.h24
-rw-r--r--include/linux/spi/ad7879.h35
-rw-r--r--include/linux/stringify.h4
-rw-r--r--include/linux/usb/serial.h7
-rw-r--r--include/scsi/scsi_scan.h11
-rw-r--r--include/video/cyblafb.h175
-rw-r--r--init/Kconfig8
-rw-r--r--init/initramfs.c5
-rw-r--r--ipc/mq_sysctl.c2
-rw-r--r--kernel/mutex.c3
-rw-r--r--kernel/panic.c12
-rw-r--r--kernel/power/disk.c8
-rw-r--r--kernel/power/user.c9
-rw-r--r--kernel/ptrace.c7
-rw-r--r--kernel/sys.c24
-rw-r--r--kernel/sysctl.c20
-rw-r--r--kernel/trace/Kconfig4
-rw-r--r--kernel/trace/trace.c36
-rw-r--r--kernel/trace/trace_events.c12
-rw-r--r--kernel/trace/trace_events_filter.c14
-rw-r--r--kernel/trace/trace_events_stage_2.h4
-rw-r--r--lib/debug_locks.c2
-rw-r--r--mm/Kconfig2
-rw-r--r--mm/filemap.c4
-rw-r--r--mm/memcontrol.c2
-rw-r--r--mm/shmem.c27
-rw-r--r--mm/util.c16
-rw-r--r--scripts/Makefile.headersinst2
-rw-r--r--scripts/gen_initramfs_list.sh2
-rwxr-xr-xscripts/get_maintainer.pl515
-rwxr-xr-xscripts/headerdep.pl2
-rw-r--r--scripts/kconfig/kxgettext.c4
-rw-r--r--scripts/mod/modpost.c4
-rwxr-xr-xscripts/setlocalversion2
-rw-r--r--security/tomoyo/common.c6
-rw-r--r--security/tomoyo/common.h2
-rw-r--r--security/tomoyo/domain.c2
-rw-r--r--security/tomoyo/file.c2
-rw-r--r--security/tomoyo/realpath.c2
-rw-r--r--security/tomoyo/realpath.h2
-rw-r--r--security/tomoyo/tomoyo.c2
-rw-r--r--security/tomoyo/tomoyo.h2
-rw-r--r--sound/pci/hda/hda_intel.c8
384 files changed, 24087 insertions, 2390 deletions
diff --git a/Documentation/ABI/testing/debugfs-pktcdvd b/Documentation/ABI/testing/debugfs-pktcdvd
index bf9c16b64c34..cf11736acb76 100644
--- a/Documentation/ABI/testing/debugfs-pktcdvd
+++ b/Documentation/ABI/testing/debugfs-pktcdvd
@@ -1,4 +1,4 @@
1What: /debug/pktcdvd/pktcdvd[0-7] 1What: /sys/kernel/debug/pktcdvd/pktcdvd[0-7]
2Date: Oct. 2006 2Date: Oct. 2006
3KernelVersion: 2.6.20 3KernelVersion: 2.6.20
4Contact: Thomas Maier <balagi@justmail.de> 4Contact: Thomas Maier <balagi@justmail.de>
@@ -10,10 +10,10 @@ debugfs interface
10The pktcdvd module (packet writing driver) creates 10The pktcdvd module (packet writing driver) creates
11these files in debugfs: 11these files in debugfs:
12 12
13/debug/pktcdvd/pktcdvd[0-7]/ 13/sys/kernel/debug/pktcdvd/pktcdvd[0-7]/
14 info (0444) Lots of driver statistics and infos. 14 info (0444) Lots of driver statistics and infos.
15 15
16Example: 16Example:
17------- 17-------
18 18
19cat /debug/pktcdvd/pktcdvd0/info 19cat /sys/kernel/debug/pktcdvd/pktcdvd0/info
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index a3a83d38f96f..8918a32c6b3a 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -31,7 +31,7 @@ PS_METHOD = $(prefer-db2x)
31 31
32### 32###
33# The targets that may be used. 33# The targets that may be used.
34PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs 34PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
35 35
36BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) 36BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
37xmldocs: $(BOOKS) 37xmldocs: $(BOOKS)
@@ -213,11 +213,12 @@ silent_gen_xml = :
213dochelp: 213dochelp:
214 @echo ' Linux kernel internal documentation in different formats:' 214 @echo ' Linux kernel internal documentation in different formats:'
215 @echo ' htmldocs - HTML' 215 @echo ' htmldocs - HTML'
216 @echo ' installmandocs - install man pages generated by mandocs'
217 @echo ' mandocs - man pages'
218 @echo ' pdfdocs - PDF' 216 @echo ' pdfdocs - PDF'
219 @echo ' psdocs - Postscript' 217 @echo ' psdocs - Postscript'
220 @echo ' xmldocs - XML DocBook' 218 @echo ' xmldocs - XML DocBook'
219 @echo ' mandocs - man pages'
220 @echo ' installmandocs - install man pages generated by mandocs'
221 @echo ' cleandocs - clean all generated DocBook files'
221 222
222### 223###
223# Temporary files left by various tools 224# Temporary files left by various tools
@@ -235,6 +236,10 @@ clean-files := $(DOCBOOKS) \
235 236
236clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man 237clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
237 238
239cleandocs:
240 $(Q)rm -f $(call objectify, $(clean-files))
241 $(Q)rm -rf $(call objectify, $(clean-dirs))
242
238# Declare the contents of the .PHONY variable as phony. We keep that 243# Declare the contents of the .PHONY variable as phony. We keep that
239# information in a variable se we can use it in if_changed and friends. 244# information in a variable se we can use it in if_changed and friends.
240 245
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index a98a7fe7aabb..1a608877b14e 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -6,15 +6,14 @@ used here with the memory controller that is used in hardware.
6 6
7Salient features 7Salient features
8 8
9a. Enable control of both RSS (mapped) and Page Cache (unmapped) pages 9a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
10 Swap Cache memory pages.
10b. The infrastructure allows easy addition of other types of memory to control 11b. The infrastructure allows easy addition of other types of memory to control
11c. Provides *zero overhead* for non memory controller users 12c. Provides *zero overhead* for non memory controller users
12d. Provides a double LRU: global memory pressure causes reclaim from the 13d. Provides a double LRU: global memory pressure causes reclaim from the
13 global LRU; a cgroup on hitting a limit, reclaims from the per 14 global LRU; a cgroup on hitting a limit, reclaims from the per
14 cgroup LRU 15 cgroup LRU
15 16
16NOTE: Swap Cache (unmapped) is not accounted now.
17
18Benefits and Purpose of the memory controller 17Benefits and Purpose of the memory controller
19 18
20The memory controller isolates the memory behaviour of a group of tasks 19The memory controller isolates the memory behaviour of a group of tasks
@@ -290,34 +289,44 @@ will be charged as a new owner of it.
290 moved to the parent. If you want to avoid that, force_empty will be useful. 289 moved to the parent. If you want to avoid that, force_empty will be useful.
291 290
2925.2 stat file 2915.2 stat file
293 memory.stat file includes following statistics (now) 292
294 cache - # of pages from page-cache and shmem. 293memory.stat file includes following statistics
295 rss - # of pages from anonymous memory. 294
296 pgpgin - # of event of charging 295cache - # of bytes of page cache memory.
297 pgpgout - # of event of uncharging 296rss - # of bytes of anonymous and swap cache memory.
298 active_anon - # of pages on active lru of anon, shmem. 297pgpgin - # of pages paged in (equivalent to # of charging events).
299 inactive_anon - # of pages on active lru of anon, shmem 298pgpgout - # of pages paged out (equivalent to # of uncharging events).
300 active_file - # of pages on active lru of file-cache 299active_anon - # of bytes of anonymous and swap cache memory on active
301 inactive_file - # of pages on inactive lru of file cache 300 lru list.
302 unevictable - # of pages cannot be reclaimed.(mlocked etc) 301inactive_anon - # of bytes of anonymous memory and swap cache memory on
303 302 inactive lru list.
304 Below is depend on CONFIG_DEBUG_VM. 303active_file - # of bytes of file-backed memory on active lru list.
305 inactive_ratio - VM internal parameter. (see mm/page_alloc.c) 304inactive_file - # of bytes of file-backed memory on inactive lru list.
306 recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) 305unevictable - # of bytes of memory that cannot be reclaimed (mlocked etc).
307 recent_rotated_file - VM internal parameter. (see mm/vmscan.c) 306
308 recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) 307The following additional stats are dependent on CONFIG_DEBUG_VM.
309 recent_scanned_file - VM internal parameter. (see mm/vmscan.c) 308
310 309inactive_ratio - VM internal parameter. (see mm/page_alloc.c)
311 Memo: 310recent_rotated_anon - VM internal parameter. (see mm/vmscan.c)
311recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
312recent_scanned_anon - VM internal parameter. (see mm/vmscan.c)
313recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
314
315Memo:
312 recent_rotated means recent frequency of lru rotation. 316 recent_rotated means recent frequency of lru rotation.
313 recent_scanned means recent # of scans to lru. 317 recent_scanned means recent # of scans to lru.
314 showing for better debug please see the code for meanings. 318 showing for better debug please see the code for meanings.
315 319
320Note:
321 Only anonymous and swap cache memory is listed as part of 'rss' stat.
322 This should not be confused with the true 'resident set size' or the
323 amount of physical memory used by the cgroup. Per-cgroup rss
324 accounting is not done yet.
316 325
3175.3 swappiness 3265.3 swappiness
318 Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. 327 Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
319 328
320 Following cgroup's swapiness can't be changed. 329 Following cgroups' swapiness can't be changed.
321 - root cgroup (uses /proc/sys/vm/swappiness). 330 - root cgroup (uses /proc/sys/vm/swappiness).
322 - a cgroup which uses hierarchy and it has child cgroup. 331 - a cgroup which uses hierarchy and it has child cgroup.
323 - a cgroup which uses hierarchy and not the root of hierarchy. 332 - a cgroup which uses hierarchy and not the root of hierarchy.
diff --git a/Documentation/cgroups/resource_counter.txt b/Documentation/cgroups/resource_counter.txt
index f196ac1d7d25..95b24d766eab 100644
--- a/Documentation/cgroups/resource_counter.txt
+++ b/Documentation/cgroups/resource_counter.txt
@@ -47,13 +47,18 @@ to work with it.
47 47
482. Basic accounting routines 482. Basic accounting routines
49 49
50 a. void res_counter_init(struct res_counter *rc) 50 a. void res_counter_init(struct res_counter *rc,
51 struct res_counter *rc_parent)
51 52
52 Initializes the resource counter. As usual, should be the first 53 Initializes the resource counter. As usual, should be the first
53 routine called for a new counter. 54 routine called for a new counter.
54 55
55 b. int res_counter_charge[_locked] 56 The struct res_counter *parent can be used to define a hierarchical
56 (struct res_counter *rc, unsigned long val) 57 child -> parent relationship directly in the res_counter structure,
58 NULL can be used to define no relationship.
59
60 c. int res_counter_charge(struct res_counter *rc, unsigned long val,
61 struct res_counter **limit_fail_at)
57 62
58 When a resource is about to be allocated it has to be accounted 63 When a resource is about to be allocated it has to be accounted
59 with the appropriate resource counter (controller should determine 64 with the appropriate resource counter (controller should determine
@@ -67,15 +72,25 @@ to work with it.
67 * if the charging is performed first, then it should be uncharged 72 * if the charging is performed first, then it should be uncharged
68 on error path (if the one is called). 73 on error path (if the one is called).
69 74
70 c. void res_counter_uncharge[_locked] 75 If the charging fails and a hierarchical dependency exists, the
76 limit_fail_at parameter is set to the particular res_counter element
77 where the charging failed.
78
79 d. int res_counter_charge_locked
80 (struct res_counter *rc, unsigned long val)
81
82 The same as res_counter_charge(), but it must not acquire/release the
83 res_counter->lock internally (it must be called with res_counter->lock
84 held).
85
86 e. void res_counter_uncharge[_locked]
71 (struct res_counter *rc, unsigned long val) 87 (struct res_counter *rc, unsigned long val)
72 88
73 When a resource is released (freed) it should be de-accounted 89 When a resource is released (freed) it should be de-accounted
74 from the resource counter it was accounted to. This is called 90 from the resource counter it was accounted to. This is called
75 "uncharging". 91 "uncharging".
76 92
77 The _locked routines imply that the res_counter->lock is taken. 93 The _locked routines imply that the res_counter->lock is taken.
78
79 94
80 2.1 Other accounting routines 95 2.1 Other accounting routines
81 96
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 7e2af10e8264..de491a3e2313 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -428,3 +428,12 @@ Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
428 After a reasonable transition period, we will remove the legacy 428 After a reasonable transition period, we will remove the legacy
429 fakephp interface. 429 fakephp interface.
430Who: Alex Chiang <achiang@hp.com> 430Who: Alex Chiang <achiang@hp.com>
431
432---------------------------
433
434What: i2c-voodoo3 driver
435When: October 2009
436Why: Superseded by tdfxfb. I2C/DDC support used to live in a separate
437 driver but this caused driver conflicts.
438Who: Jean Delvare <khali@linux-fr.org>
439 Krzysztof Helt <krzysztof.h1@wp.pl>
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt
new file mode 100644
index 000000000000..435102a26d96
--- /dev/null
+++ b/Documentation/input/rotary-encoder.txt
@@ -0,0 +1,101 @@
1rotary-encoder - a generic driver for GPIO connected devices
2Daniel Mack <daniel@caiaq.de>, Feb 2009
3
40. Function
5-----------
6
7Rotary encoders are devices which are connected to the CPU or other
8peripherals with two wires. The outputs are phase-shifted by 90 degrees
9and by triggering on falling and rising edges, the turn direction can
10be determined.
11
12The phase diagram of these two outputs look like this:
13
14 _____ _____ _____
15 | | | | | |
16 Channel A ____| |_____| |_____| |____
17
18 : : : : : : : : : : : :
19 __ _____ _____ _____
20 | | | | | | |
21 Channel B |_____| |_____| |_____| |__
22
23 : : : : : : : : : : : :
24 Event a b c d a b c d a b c d
25
26 |<-------->|
27 one step
28
29
30For more information, please see
31 http://en.wikipedia.org/wiki/Rotary_encoder
32
33
341. Events / state machine
35-------------------------
36
37a) Rising edge on channel A, channel B in low state
38 This state is used to recognize a clockwise turn
39
40b) Rising edge on channel B, channel A in high state
41 When entering this state, the encoder is put into 'armed' state,
42 meaning that there it has seen half the way of a one-step transition.
43
44c) Falling edge on channel A, channel B in high state
45 This state is used to recognize a counter-clockwise turn
46
47d) Falling edge on channel B, channel A in low state
48 Parking position. If the encoder enters this state, a full transition
49 should have happend, unless it flipped back on half the way. The
50 'armed' state tells us about that.
51
522. Platform requirements
53------------------------
54
55As there is no hardware dependent call in this driver, the platform it is
56used with must support gpiolib. Another requirement is that IRQs must be
57able to fire on both edges.
58
59
603. Board integration
61--------------------
62
63To use this driver in your system, register a platform_device with the
64name 'rotary-encoder' and associate the IRQs and some specific platform
65data with it.
66
67struct rotary_encoder_platform_data is declared in
68include/linux/rotary-encoder.h and needs to be filled with the number of
69steps the encoder has and can carry information about externally inverted
70signals (because of used invertig buffer or other reasons).
71
72Because GPIO to IRQ mapping is platform specific, this information must
73be given in seperately to the driver. See the example below.
74
75---------<snip>---------
76
77/* board support file example */
78
79#include <linux/input.h>
80#include <linux/rotary_encoder.h>
81
82#define GPIO_ROTARY_A 1
83#define GPIO_ROTARY_B 2
84
85static struct rotary_encoder_platform_data my_rotary_encoder_info = {
86 .steps = 24,
87 .axis = ABS_X,
88 .gpio_a = GPIO_ROTARY_A,
89 .gpio_b = GPIO_ROTARY_B,
90 .inverted_a = 0,
91 .inverted_b = 0,
92};
93
94static struct platform_device rotary_encoder_device = {
95 .name = "rotary-encoder",
96 .id = 0,
97 .dev = {
98 .platform_data = &my_rotary_encoder_info,
99 }
100};
101
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 51104f9194a5..d4b05672f9f7 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -40,10 +40,16 @@ This document describes the Linux kernel Makefiles.
40 --- 6.7 Custom kbuild commands 40 --- 6.7 Custom kbuild commands
41 --- 6.8 Preprocessing linker scripts 41 --- 6.8 Preprocessing linker scripts
42 42
43 === 7 Kbuild Variables 43 === 7 Kbuild syntax for exported headers
44 === 8 Makefile language 44 --- 7.1 header-y
45 === 9 Credits 45 --- 7.2 objhdr-y
46 === 10 TODO 46 --- 7.3 destination-y
47 --- 7.4 unifdef-y (deprecated)
48
49 === 8 Kbuild Variables
50 === 9 Makefile language
51 === 10 Credits
52 === 11 TODO
47 53
48=== 1 Overview 54=== 1 Overview
49 55
@@ -1143,8 +1149,69 @@ When kbuild executes, the following steps are followed (roughly):
1143 The kbuild infrastructure for *lds file are used in several 1149 The kbuild infrastructure for *lds file are used in several
1144 architecture-specific files. 1150 architecture-specific files.
1145 1151
1152=== 7 Kbuild syntax for exported headers
1153
1154The kernel include a set of headers that is exported to userspace.
1155Many headers can be exported as-is but other headers requires a
1156minimal pre-processing before they are ready for user-space.
1157The pre-processing does:
1158- drop kernel specific annotations
1159- drop include of compiler.h
1160- drop all sections that is kernel internat (guarded by ifdef __KERNEL__)
1161
1162Each relevant directory contain a file name "Kbuild" which specify the
1163headers to be exported.
1164See subsequent chapter for the syntax of the Kbuild file.
1165
1166 --- 7.1 header-y
1167
1168 header-y specify header files to be exported.
1169
1170 Example:
1171 #include/linux/Kbuild
1172 header-y += usb/
1173 header-y += aio_abi.h
1174
1175 The convention is to list one file per line and
1176 preferably in alphabetic order.
1177
1178 header-y also specify which subdirectories to visit.
1179 A subdirectory is identified by a trailing '/' which
1180 can be seen in the example above for the usb subdirectory.
1181
1182 Subdirectories are visited before their parent directories.
1183
1184 --- 7.2 objhdr-y
1185
1186 objhdr-y specifies generated files to be exported.
1187 Generated files are special as they need to be looked
1188 up in another directory when doing 'make O=...' builds.
1189
1190 Example:
1191 #include/linux/Kbuild
1192 objhdr-y += version.h
1193
1194 --- 7.3 destination-y
1195
1196 When an architecture have a set of exported headers that needs to be
1197 exported to a different directory destination-y is used.
1198 destination-y specify the destination directory for all exported
1199 headers in the file where it is present.
1200
1201 Example:
1202 #arch/xtensa/platforms/s6105/include/platform/Kbuild
1203 destination-y := include/linux
1204
1205 In the example above all exported headers in the Kbuild file
1206 will be located in the directory "include/linux" when exported.
1207
1208
1209 --- 7.4 unifdef-y (deprecated)
1210
1211 unifdef-y is deprecated. A direct replacement is header-y.
1212
1146 1213
1147=== 7 Kbuild Variables 1214=== 8 Kbuild Variables
1148 1215
1149The top Makefile exports the following variables: 1216The top Makefile exports the following variables:
1150 1217
@@ -1206,7 +1273,7 @@ The top Makefile exports the following variables:
1206 INSTALL_MOD_STRIP will used as the option(s) to the strip command. 1273 INSTALL_MOD_STRIP will used as the option(s) to the strip command.
1207 1274
1208 1275
1209=== 8 Makefile language 1276=== 9 Makefile language
1210 1277
1211The kernel Makefiles are designed to be run with GNU Make. The Makefiles 1278The kernel Makefiles are designed to be run with GNU Make. The Makefiles
1212use only the documented features of GNU Make, but they do use many 1279use only the documented features of GNU Make, but they do use many
@@ -1225,14 +1292,14 @@ time the left-hand side is used.
1225There are some cases where "=" is appropriate. Usually, though, ":=" 1292There are some cases where "=" is appropriate. Usually, though, ":="
1226is the right choice. 1293is the right choice.
1227 1294
1228=== 9 Credits 1295=== 10 Credits
1229 1296
1230Original version made by Michael Elizabeth Chastain, <mailto:mec@shout.net> 1297Original version made by Michael Elizabeth Chastain, <mailto:mec@shout.net>
1231Updates by Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> 1298Updates by Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
1232Updates by Sam Ravnborg <sam@ravnborg.org> 1299Updates by Sam Ravnborg <sam@ravnborg.org>
1233Language QA by Jan Engelhardt <jengelh@gmx.de> 1300Language QA by Jan Engelhardt <jengelh@gmx.de>
1234 1301
1235=== 10 TODO 1302=== 11 TODO
1236 1303
1237- Describe how kbuild supports shipped files with _shipped. 1304- Describe how kbuild supports shipped files with _shipped.
1238- Generating offset header files. 1305- Generating offset header files.
diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt
index 42f43fa59f24..34c76a55bc04 100644
--- a/Documentation/sparse.txt
+++ b/Documentation/sparse.txt
@@ -42,6 +42,14 @@ sure that bitwise types don't get mixed up (little-endian vs big-endian
42vs cpu-endian vs whatever), and there the constant "0" really _is_ 42vs cpu-endian vs whatever), and there the constant "0" really _is_
43special. 43special.
44 44
45__bitwise__ - to be used for relatively compact stuff (gfp_t, etc.) that
46is mostly warning-free and is supposed to stay that way. Warnings will
47be generated without __CHECK_ENDIAN__.
48
49__bitwise - noisy stuff; in particular, __le*/__be* are that. We really
50don't want to drown in noise unless we'd explicitly asked for it.
51
52
45Getting sparse 53Getting sparse
46~~~~~~~~~~~~~~ 54~~~~~~~~~~~~~~
47 55
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index a34d55b65441..df38ef046f8d 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -95,7 +95,7 @@ of struct cmsghdr structures with appended data.
95 95
96There is only one file in this directory. 96There is only one file in this directory.
97unix_dgram_qlen limits the max number of datagrams queued in Unix domain 97unix_dgram_qlen limits the max number of datagrams queued in Unix domain
98socket's buffer. It will not take effect unless PF_UNIX flag is spicified. 98socket's buffer. It will not take effect unless PF_UNIX flag is specified.
99 99
100 100
1013. /proc/sys/net/ipv4 - IPV4 settings 1013. /proc/sys/net/ipv4 - IPV4 settings
diff --git a/Documentation/tomoyo.txt b/Documentation/tomoyo.txt
new file mode 100644
index 000000000000..b3a232cae7f8
--- /dev/null
+++ b/Documentation/tomoyo.txt
@@ -0,0 +1,55 @@
1--- What is TOMOYO? ---
2
3TOMOYO is a name-based MAC extension (LSM module) for the Linux kernel.
4
5LiveCD-based tutorials are available at
6http://tomoyo.sourceforge.jp/en/1.6.x/1st-step/ubuntu8.04-live/
7http://tomoyo.sourceforge.jp/en/1.6.x/1st-step/centos5-live/ .
8Though these tutorials use non-LSM version of TOMOYO, they are useful for you
9to know what TOMOYO is.
10
11--- How to enable TOMOYO? ---
12
13Build the kernel with CONFIG_SECURITY_TOMOYO=y and pass "security=tomoyo" on
14kernel's command line.
15
16Please see http://tomoyo.sourceforge.jp/en/2.2.x/ for details.
17
18--- Where is documentation? ---
19
20User <-> Kernel interface documentation is available at
21http://tomoyo.sourceforge.jp/en/2.2.x/policy-reference.html .
22
23Materials we prepared for seminars and symposiums are available at
24http://sourceforge.jp/projects/tomoyo/docs/?category_id=532&language_id=1 .
25Below lists are chosen from three aspects.
26
27What is TOMOYO?
28 TOMOYO Linux Overview
29 http://sourceforge.jp/projects/tomoyo/docs/lca2009-takeda.pdf
30 TOMOYO Linux: pragmatic and manageable security for Linux
31 http://sourceforge.jp/projects/tomoyo/docs/freedomhectaipei-tomoyo.pdf
32 TOMOYO Linux: A Practical Method to Understand and Protect Your Own Linux Box
33 http://sourceforge.jp/projects/tomoyo/docs/PacSec2007-en-no-demo.pdf
34
35What can TOMOYO do?
36 Deep inside TOMOYO Linux
37 http://sourceforge.jp/projects/tomoyo/docs/lca2009-kumaneko.pdf
38 The role of "pathname based access control" in security.
39 http://sourceforge.jp/projects/tomoyo/docs/lfj2008-bof.pdf
40
41History of TOMOYO?
42 Realities of Mainlining
43 http://sourceforge.jp/projects/tomoyo/docs/lfj2008.pdf
44
45--- What is future plan? ---
46
47We believe that inode based security and name based security are complementary
48and both should be used together. But unfortunately, so far, we cannot enable
49multiple LSM modules at the same time. We feel sorry that you have to give up
50SELinux/SMACK/AppArmor etc. when you want to use TOMOYO.
51
52We hope that LSM becomes stackable in future. Meanwhile, you can use non-LSM
53version of TOMOYO, available at http://tomoyo.sourceforge.jp/en/1.6.x/ .
54LSM version of TOMOYO is a subset of non-LSM version of TOMOYO. We are planning
55to port non-LSM version's functionalities to LSM versions.
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX
index 2131b00b63f6..2f77ced35df7 100644
--- a/Documentation/vm/00-INDEX
+++ b/Documentation/vm/00-INDEX
@@ -1,5 +1,7 @@
100-INDEX 100-INDEX
2 - this file. 2 - this file.
3active_mm.txt
4 - An explanation from Linus about tsk->active_mm vs tsk->mm.
3balance 5balance
4 - various information on memory balancing. 6 - various information on memory balancing.
5hugetlbpage.txt 7hugetlbpage.txt
diff --git a/Documentation/vm/active_mm.txt b/Documentation/vm/active_mm.txt
new file mode 100644
index 000000000000..4ee1f643d897
--- /dev/null
+++ b/Documentation/vm/active_mm.txt
@@ -0,0 +1,83 @@
1List: linux-kernel
2Subject: Re: active_mm
3From: Linus Torvalds <torvalds () transmeta ! com>
4Date: 1999-07-30 21:36:24
5
6Cc'd to linux-kernel, because I don't write explanations all that often,
7and when I do I feel better about more people reading them.
8
9On Fri, 30 Jul 1999, David Mosberger wrote:
10>
11> Is there a brief description someplace on how "mm" vs. "active_mm" in
12> the task_struct are supposed to be used? (My apologies if this was
13> discussed on the mailing lists---I just returned from vacation and
14> wasn't able to follow linux-kernel for a while).
15
16Basically, the new setup is:
17
18 - we have "real address spaces" and "anonymous address spaces". The
19 difference is that an anonymous address space doesn't care about the
20 user-level page tables at all, so when we do a context switch into an
21 anonymous address space we just leave the previous address space
22 active.
23
24 The obvious use for a "anonymous address space" is any thread that
25 doesn't need any user mappings - all kernel threads basically fall into
26 this category, but even "real" threads can temporarily say that for
27 some amount of time they are not going to be interested in user space,
28 and that the scheduler might as well try to avoid wasting time on
29 switching the VM state around. Currently only the old-style bdflush
30 sync does that.
31
32 - "tsk->mm" points to the "real address space". For an anonymous process,
33 tsk->mm will be NULL, for the logical reason that an anonymous process
34 really doesn't _have_ a real address space at all.
35
36 - however, we obviously need to keep track of which address space we
37 "stole" for such an anonymous user. For that, we have "tsk->active_mm",
38 which shows what the currently active address space is.
39
40 The rule is that for a process with a real address space (ie tsk->mm is
41 non-NULL) the active_mm obviously always has to be the same as the real
42 one.
43
44 For a anonymous process, tsk->mm == NULL, and tsk->active_mm is the
45 "borrowed" mm while the anonymous process is running. When the
46 anonymous process gets scheduled away, the borrowed address space is
47 returned and cleared.
48
49To support all that, the "struct mm_struct" now has two counters: a
50"mm_users" counter that is how many "real address space users" there are,
51and a "mm_count" counter that is the number of "lazy" users (ie anonymous
52users) plus one if there are any real users.
53
54Usually there is at least one real user, but it could be that the real
55user exited on another CPU while a lazy user was still active, so you do
56actually get cases where you have a address space that is _only_ used by
57lazy users. That is often a short-lived state, because once that thread
58gets scheduled away in favour of a real thread, the "zombie" mm gets
59released because "mm_users" becomes zero.
60
61Also, a new rule is that _nobody_ ever has "init_mm" as a real MM any
62more. "init_mm" should be considered just a "lazy context when no other
63context is available", and in fact it is mainly used just at bootup when
64no real VM has yet been created. So code that used to check
65
66 if (current->mm == &init_mm)
67
68should generally just do
69
70 if (!current->mm)
71
72instead (which makes more sense anyway - the test is basically one of "do
73we have a user context", and is generally done by the page fault handler
74and things like that).
75
76Anyway, I put a pre-patch-2.3.13-1 on ftp.kernel.org just a moment ago,
77because it slightly changes the interfaces to accomodate the alpha (who
78would have thought it, but the alpha actually ends up having one of the
79ugliest context switch codes - unlike the other architectures where the MM
80and register state is separate, the alpha PALcode joins the two, and you
81need to switch both together).
82
83(From http://marc.info/?l=linux-kernel&m=93337278602211&w=2)
diff --git a/Documentation/vm/unevictable-lru.txt b/Documentation/vm/unevictable-lru.txt
index 0706a7282a8c..2d70d0d95108 100644
--- a/Documentation/vm/unevictable-lru.txt
+++ b/Documentation/vm/unevictable-lru.txt
@@ -1,588 +1,691 @@
1 1 ==============================
2This document describes the Linux memory management "Unevictable LRU" 2 UNEVICTABLE LRU INFRASTRUCTURE
3infrastructure and the use of this infrastructure to manage several types 3 ==============================
4of "unevictable" pages. The document attempts to provide the overall 4
5rationale behind this mechanism and the rationale for some of the design 5========
6decisions that drove the implementation. The latter design rationale is 6CONTENTS
7discussed in the context of an implementation description. Admittedly, one 7========
8can obtain the implementation details--the "what does it do?"--by reading the 8
9code. One hopes that the descriptions below add value by provide the answer 9 (*) The Unevictable LRU
10to "why does it do that?". 10
11 11 - The unevictable page list.
12Unevictable LRU Infrastructure: 12 - Memory control group interaction.
13 13 - Marking address spaces unevictable.
14The Unevictable LRU adds an additional LRU list to track unevictable pages 14 - Detecting Unevictable Pages.
15and to hide these pages from vmscan. This mechanism is based on a patch by 15 - vmscan's handling of unevictable pages.
16Larry Woodman of Red Hat to address several scalability problems with page 16
17 (*) mlock()'d pages.
18
19 - History.
20 - Basic management.
21 - mlock()/mlockall() system call handling.
22 - Filtering special vmas.
23 - munlock()/munlockall() system call handling.
24 - Migrating mlocked pages.
25 - mmap(MAP_LOCKED) system call handling.
26 - munmap()/exit()/exec() system call handling.
27 - try_to_unmap().
28 - try_to_munlock() reverse map scan.
29 - Page reclaim in shrink_*_list().
30
31
32============
33INTRODUCTION
34============
35
36This document describes the Linux memory manager's "Unevictable LRU"
37infrastructure and the use of this to manage several types of "unevictable"
38pages.
39
40The document attempts to provide the overall rationale behind this mechanism
41and the rationale for some of the design decisions that drove the
42implementation. The latter design rationale is discussed in the context of an
43implementation description. Admittedly, one can obtain the implementation
44details - the "what does it do?" - by reading the code. One hopes that the
45descriptions below add value by provide the answer to "why does it do that?".
46
47
48===================
49THE UNEVICTABLE LRU
50===================
51
52The Unevictable LRU facility adds an additional LRU list to track unevictable
53pages and to hide these pages from vmscan. This mechanism is based on a patch
54by Larry Woodman of Red Hat to address several scalability problems with page
17reclaim in Linux. The problems have been observed at customer sites on large 55reclaim in Linux. The problems have been observed at customer sites on large
18memory x86_64 systems. For example, a non-numal x86_64 platform with 128GB 56memory x86_64 systems.
19of main memory will have over 32 million 4k pages in a single zone. When a 57
20large fraction of these pages are not evictable for any reason [see below], 58To illustrate this with an example, a non-NUMA x86_64 platform with 128GB of
21vmscan will spend a lot of time scanning the LRU lists looking for the small 59main memory will have over 32 million 4k pages in a single zone. When a large
22fraction of pages that are evictable. This can result in a situation where 60fraction of these pages are not evictable for any reason [see below], vmscan
23all cpus are spending 100% of their time in vmscan for hours or days on end, 61will spend a lot of time scanning the LRU lists looking for the small fraction
24with the system completely unresponsive. 62of pages that are evictable. This can result in a situation where all CPUs are
25 63spending 100% of their time in vmscan for hours or days on end, with the system
26The Unevictable LRU infrastructure addresses the following classes of 64completely unresponsive.
27unevictable pages: 65
28 66The unevictable list addresses the following classes of unevictable pages:
29+ page owned by ramfs 67
30+ page mapped into SHM_LOCKed shared memory regions 68 (*) Those owned by ramfs.
31+ page mapped into VM_LOCKED [mlock()ed] vmas 69
32 70 (*) Those mapped into SHM_LOCK'd shared memory regions.
33The infrastructure might be able to handle other conditions that make pages 71
72 (*) Those mapped into VM_LOCKED [mlock()ed] VMAs.
73
74The infrastructure may also be able to handle other conditions that make pages
34unevictable, either by definition or by circumstance, in the future. 75unevictable, either by definition or by circumstance, in the future.
35 76
36 77
37The Unevictable LRU List 78THE UNEVICTABLE PAGE LIST
79-------------------------
38 80
39The Unevictable LRU infrastructure consists of an additional, per-zone, LRU list 81The Unevictable LRU infrastructure consists of an additional, per-zone, LRU list
40called the "unevictable" list and an associated page flag, PG_unevictable, to 82called the "unevictable" list and an associated page flag, PG_unevictable, to
41indicate that the page is being managed on the unevictable list. The 83indicate that the page is being managed on the unevictable list.
42PG_unevictable flag is analogous to, and mutually exclusive with, the PG_active 84
43flag in that it indicates on which LRU list a page resides when PG_lru is set. 85The PG_unevictable flag is analogous to, and mutually exclusive with, the
44The unevictable LRU list is source configurable based on the UNEVICTABLE_LRU 86PG_active flag in that it indicates on which LRU list a page resides when
45Kconfig option. 87PG_lru is set. The unevictable list is compile-time configurable based on the
88UNEVICTABLE_LRU Kconfig option.
46 89
47The Unevictable LRU infrastructure maintains unevictable pages on an additional 90The Unevictable LRU infrastructure maintains unevictable pages on an additional
48LRU list for a few reasons: 91LRU list for a few reasons:
49 92
501) We get to "treat unevictable pages just like we treat other pages in the 93 (1) We get to "treat unevictable pages just like we treat other pages in the
51 system, which means we get to use the same code to manipulate them, the 94 system - which means we get to use the same code to manipulate them, the
52 same code to isolate them (for migrate, etc.), the same code to keep track 95 same code to isolate them (for migrate, etc.), the same code to keep track
53 of the statistics, etc..." [Rik van Riel] 96 of the statistics, etc..." [Rik van Riel]
97
98 (2) We want to be able to migrate unevictable pages between nodes for memory
99 defragmentation, workload management and memory hotplug. The linux kernel
100 can only migrate pages that it can successfully isolate from the LRU
101 lists. If we were to maintain pages elsewhere than on an LRU-like list,
102 where they can be found by isolate_lru_page(), we would prevent their
103 migration, unless we reworked migration code to find the unevictable pages
104 itself.
54 105
552) We want to be able to migrate unevictable pages between nodes--for memory
56 defragmentation, workload management and memory hotplug. The linux kernel
57 can only migrate pages that it can successfully isolate from the lru lists.
58 If we were to maintain pages elsewise than on an lru-like list, where they
59 can be found by isolate_lru_page(), we would prevent their migration, unless
60 we reworked migration code to find the unevictable pages.
61 106
107The unevictable list does not differentiate between file-backed and anonymous,
108swap-backed pages. This differentiation is only important while the pages are,
109in fact, evictable.
62 110
63The unevictable LRU list does not differentiate between file backed and swap 111The unevictable list benefits from the "arrayification" of the per-zone LRU
64backed [anon] pages. This differentiation is only important while the pages 112lists and statistics originally proposed and posted by Christoph Lameter.
65are, in fact, evictable.
66 113
67The unevictable LRU list benefits from the "arrayification" of the per-zone 114The unevictable list does not use the LRU pagevec mechanism. Rather,
68LRU lists and statistics originally proposed and posted by Christoph Lameter. 115unevictable pages are placed directly on the page's zone's unevictable list
116under the zone lru_lock. This allows us to prevent the stranding of pages on
117the unevictable list when one task has the page isolated from the LRU and other
118tasks are changing the "evictability" state of the page.
69 119
70The unevictable list does not use the lru pagevec mechanism. Rather,
71unevictable pages are placed directly on the page's zone's unevictable
72list under the zone lru_lock. The reason for this is to prevent stranding
73of pages on the unevictable list when one task has the page isolated from the
74lru and other tasks are changing the "evictability" state of the page.
75 120
121MEMORY CONTROL GROUP INTERACTION
122--------------------------------
76 123
77Unevictable LRU and Memory Controller Interaction 124The unevictable LRU facility interacts with the memory control group [aka
125memory controller; see Documentation/cgroups/memory.txt] by extending the
126lru_list enum.
127
128The memory controller data structure automatically gets a per-zone unevictable
129list as a result of the "arrayification" of the per-zone LRU lists (one per
130lru_list enum element). The memory controller tracks the movement of pages to
131and from the unevictable list.
78 132
79The memory controller data structure automatically gets a per zone unevictable
80lru list as a result of the "arrayification" of the per-zone LRU lists. The
81memory controller tracks the movement of pages to and from the unevictable list.
82When a memory control group comes under memory pressure, the controller will 133When a memory control group comes under memory pressure, the controller will
83not attempt to reclaim pages on the unevictable list. This has a couple of 134not attempt to reclaim pages on the unevictable list. This has a couple of
84effects. Because the pages are "hidden" from reclaim on the unevictable list, 135effects:
85the reclaim process can be more efficient, dealing only with pages that have 136
86a chance of being reclaimed. On the other hand, if too many of the pages 137 (1) Because the pages are "hidden" from reclaim on the unevictable list, the
87charged to the control group are unevictable, the evictable portion of the 138 reclaim process can be more efficient, dealing only with pages that have a
88working set of the tasks in the control group may not fit into the available 139 chance of being reclaimed.
89memory. This can cause the control group to thrash or to oom-kill tasks. 140
90 141 (2) On the other hand, if too many of the pages charged to the control group
91 142 are unevictable, the evictable portion of the working set of the tasks in
92Unevictable LRU: Detecting Unevictable Pages 143 the control group may not fit into the available memory. This can cause
93 144 the control group to thrash or to OOM-kill tasks.
94The function page_evictable(page, vma) in vmscan.c determines whether a 145
95page is evictable or not. For ramfs pages and pages in SHM_LOCKed regions, 146
96page_evictable() tests a new address space flag, AS_UNEVICTABLE, in the page's 147MARKING ADDRESS SPACES UNEVICTABLE
97address space using a wrapper function. Wrapper functions are used to set, 148----------------------------------
98clear and test the flag to reduce the requirement for #ifdef's throughout the 149
99source code. AS_UNEVICTABLE is set on ramfs inode/mapping when it is created. 150For facilities such as ramfs none of the pages attached to the address space
100This flag remains for the life of the inode. 151may be evicted. To prevent eviction of any such pages, the AS_UNEVICTABLE
101 152address space flag is provided, and this can be manipulated by a filesystem
102For shared memory regions, AS_UNEVICTABLE is set when an application 153using a number of wrapper functions:
103successfully SHM_LOCKs the region and is removed when the region is 154
104SHM_UNLOCKed. Note that shmctl(SHM_LOCK, ...) does not populate the page 155 (*) void mapping_set_unevictable(struct address_space *mapping);
105tables for the region as does, for example, mlock(). So, we make no special 156
106effort to push any pages in the SHM_LOCKed region to the unevictable list. 157 Mark the address space as being completely unevictable.
107Vmscan will do this when/if it encounters the pages during reclaim. On 158
108SHM_UNLOCK, shmctl() scans the pages in the region and "rescues" them from the 159 (*) void mapping_clear_unevictable(struct address_space *mapping);
109unevictable list if no other condition keeps them unevictable. If a SHM_LOCKed 160
110region is destroyed, the pages are also "rescued" from the unevictable list in 161 Mark the address space as being evictable.
111the process of freeing them. 162
112 163 (*) int mapping_unevictable(struct address_space *mapping);
113page_evictable() detects mlock()ed pages by testing an additional page flag, 164
114PG_mlocked via the PageMlocked() wrapper. If the page is NOT mlocked, and a 165 Query the address space, and return true if it is completely
115non-NULL vma is supplied, page_evictable() will check whether the vma is 166 unevictable.
167
168These are currently used in two places in the kernel:
169
170 (1) By ramfs to mark the address spaces of its inodes when they are created,
171 and this mark remains for the life of the inode.
172
173 (2) By SYSV SHM to mark SHM_LOCK'd address spaces until SHM_UNLOCK is called.
174
175 Note that SHM_LOCK is not required to page in the locked pages if they're
176 swapped out; the application must touch the pages manually if it wants to
177 ensure they're in memory.
178
179
180DETECTING UNEVICTABLE PAGES
181---------------------------
182
183The function page_evictable() in vmscan.c determines whether a page is
184evictable or not using the query function outlined above [see section "Marking
185address spaces unevictable"] to check the AS_UNEVICTABLE flag.
186
187For address spaces that are so marked after being populated (as SHM regions
188might be), the lock action (eg: SHM_LOCK) can be lazy, and need not populate
189the page tables for the region as does, for example, mlock(), nor need it make
190any special effort to push any pages in the SHM_LOCK'd area to the unevictable
191list. Instead, vmscan will do this if and when it encounters the pages during
192a reclamation scan.
193
194On an unlock action (such as SHM_UNLOCK), the unlocker (eg: shmctl()) must scan
195the pages in the region and "rescue" them from the unevictable list if no other
196condition is keeping them unevictable. If an unevictable region is destroyed,
197the pages are also "rescued" from the unevictable list in the process of
198freeing them.
199
200page_evictable() also checks for mlocked pages by testing an additional page
201flag, PG_mlocked (as wrapped by PageMlocked()). If the page is NOT mlocked,
202and a non-NULL VMA is supplied, page_evictable() will check whether the VMA is
116VM_LOCKED via is_mlocked_vma(). is_mlocked_vma() will SetPageMlocked() and 203VM_LOCKED via is_mlocked_vma(). is_mlocked_vma() will SetPageMlocked() and
117update the appropriate statistics if the vma is VM_LOCKED. This method allows 204update the appropriate statistics if the vma is VM_LOCKED. This method allows
118efficient "culling" of pages in the fault path that are being faulted in to 205efficient "culling" of pages in the fault path that are being faulted in to
119VM_LOCKED vmas. 206VM_LOCKED VMAs.
120 207
121 208
122Unevictable Pages and Vmscan [shrink_*_list()] 209VMSCAN'S HANDLING OF UNEVICTABLE PAGES
210--------------------------------------
123 211
124If unevictable pages are culled in the fault path, or moved to the unevictable 212If unevictable pages are culled in the fault path, or moved to the unevictable
125list at mlock() or mmap() time, vmscan will never encounter the pages until 213list at mlock() or mmap() time, vmscan will not encounter the pages until they
126they have become evictable again, for example, via munlock() and have been 214have become evictable again (via munlock() for example) and have been "rescued"
127"rescued" from the unevictable list. However, there may be situations where we 215from the unevictable list. However, there may be situations where we decide,
128decide, for the sake of expediency, to leave a unevictable page on one of the 216for the sake of expediency, to leave a unevictable page on one of the regular
129regular active/inactive LRU lists for vmscan to deal with. Vmscan checks for 217active/inactive LRU lists for vmscan to deal with. vmscan checks for such
130such pages in all of the shrink_{active|inactive|page}_list() functions and 218pages in all of the shrink_{active|inactive|page}_list() functions and will
131will "cull" such pages that it encounters--that is, it diverts those pages to 219"cull" such pages that it encounters: that is, it diverts those pages to the
132the unevictable list for the zone being scanned. 220unevictable list for the zone being scanned.
133 221
134There may be situations where a page is mapped into a VM_LOCKED vma, but the 222There may be situations where a page is mapped into a VM_LOCKED VMA, but the
135page is not marked as PageMlocked. Such pages will make it all the way to 223page is not marked as PG_mlocked. Such pages will make it all the way to
136shrink_page_list() where they will be detected when vmscan walks the reverse 224shrink_page_list() where they will be detected when vmscan walks the reverse
137map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK, shrink_page_list() 225map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK,
138will cull the page at that point. 226shrink_page_list() will cull the page at that point.
139 227
140To "cull" an unevictable page, vmscan simply puts the page back on the lru 228To "cull" an unevictable page, vmscan simply puts the page back on the LRU list
141list using putback_lru_page()--the inverse operation to isolate_lru_page()-- 229using putback_lru_page() - the inverse operation to isolate_lru_page() - after
142after dropping the page lock. Because the condition which makes the page 230dropping the page lock. Because the condition which makes the page unevictable
143unevictable may change once the page is unlocked, putback_lru_page() will 231may change once the page is unlocked, putback_lru_page() will recheck the
144recheck the unevictable state of a page that it places on the unevictable lru 232unevictable state of a page that it places on the unevictable list. If the
145list. If the page has become unevictable, putback_lru_page() removes it from 233page has become unevictable, putback_lru_page() removes it from the list and
146the list and retries, including the page_unevictable() test. Because such a 234retries, including the page_unevictable() test. Because such a race is a rare
147race is a rare event and movement of pages onto the unevictable list should be 235event and movement of pages onto the unevictable list should be rare, these
148rare, these extra evictabilty checks should not occur in the majority of calls 236extra evictabilty checks should not occur in the majority of calls to
149to putback_lru_page(). 237putback_lru_page().
150 238
151 239
152Mlocked Page: Prior Work 240=============
241MLOCKED PAGES
242=============
153 243
154The "Unevictable Mlocked Pages" infrastructure is based on work originally 244The unevictable page list is also useful for mlock(), in addition to ramfs and
245SYSV SHM. Note that mlock() is only available in CONFIG_MMU=y situations; in
246NOMMU situations, all mappings are effectively mlocked.
247
248
249HISTORY
250-------
251
252The "Unevictable mlocked Pages" infrastructure is based on work originally
155posted by Nick Piggin in an RFC patch entitled "mm: mlocked pages off LRU". 253posted by Nick Piggin in an RFC patch entitled "mm: mlocked pages off LRU".
156Nick posted his patch as an alternative to a patch posted by Christoph 254Nick posted his patch as an alternative to a patch posted by Christoph Lameter
157Lameter to achieve the same objective--hiding mlocked pages from vmscan. 255to achieve the same objective: hiding mlocked pages from vmscan.
158In Nick's patch, he used one of the struct page lru list link fields as a count 256
159of VM_LOCKED vmas that map the page. This use of the link field for a count 257In Nick's patch, he used one of the struct page LRU list link fields as a count
160prevented the management of the pages on an LRU list. Thus, mlocked pages were 258of VM_LOCKED VMAs that map the page. This use of the link field for a count
161not migratable as isolate_lru_page() could not find them and the lru list link 259prevented the management of the pages on an LRU list, and thus mlocked pages
162field was not available to the migration subsystem. Nick resolved this by 260were not migratable as isolate_lru_page() could not find them, and the LRU list
163putting mlocked pages back on the lru list before attempting to isolate them, 261link field was not available to the migration subsystem.
164thus abandoning the count of VM_LOCKED vmas. When Nick's patch was integrated 262
165with the Unevictable LRU work, the count was replaced by walking the reverse 263Nick resolved this by putting mlocked pages back on the lru list before
166map to determine whether any VM_LOCKED vmas mapped the page. More on this 264attempting to isolate them, thus abandoning the count of VM_LOCKED VMAs. When
167below. 265Nick's patch was integrated with the Unevictable LRU work, the count was
168 266replaced by walking the reverse map to determine whether any VM_LOCKED VMAs
169 267mapped the page. More on this below.
170Mlocked Pages: Basic Management 268
171 269
172Mlocked pages--pages mapped into a VM_LOCKED vma--represent one class of 270BASIC MANAGEMENT
173unevictable pages. When such a page has been "noticed" by the memory 271----------------
174management subsystem, the page is marked with the PG_mlocked [PageMlocked()] 272
175flag. A PageMlocked() page will be placed on the unevictable LRU list when 273mlocked pages - pages mapped into a VM_LOCKED VMA - are a class of unevictable
176it is added to the LRU. Pages can be "noticed" by memory management in 274pages. When such a page has been "noticed" by the memory management subsystem,
177several places: 275the page is marked with the PG_mlocked flag. This can be manipulated using the
178 276PageMlocked() functions.
1791) in the mlock()/mlockall() system call handlers. 277
1802) in the mmap() system call handler when mmap()ing a region with the 278A PG_mlocked page will be placed on the unevictable list when it is added to
181 MAP_LOCKED flag, or mmap()ing a region in a task that has called 279the LRU. Such pages can be "noticed" by memory management in several places:
182 mlockall() with the MCL_FUTURE flag. Both of these conditions result 280
183 in the VM_LOCKED flag being set for the vma. 281 (1) in the mlock()/mlockall() system call handlers;
1843) in the fault path, if mlocked pages are "culled" in the fault path, 282
185 and when a VM_LOCKED stack segment is expanded. 283 (2) in the mmap() system call handler when mmapping a region with the
1864) as mentioned above, in vmscan:shrink_page_list() when attempting to 284 MAP_LOCKED flag;
187 reclaim a page in a VM_LOCKED vma via try_to_unmap(). 285
188 286 (3) mmapping a region in a task that has called mlockall() with the MCL_FUTURE
189Mlocked pages become unlocked and rescued from the unevictable list when: 287 flag
190 288
1911) mapped in a range unlocked via the munlock()/munlockall() system calls. 289 (4) in the fault path, if mlocked pages are "culled" in the fault path,
1922) munmapped() out of the last VM_LOCKED vma that maps the page, including 290 and when a VM_LOCKED stack segment is expanded; or
193 unmapping at task exit. 291
1943) when the page is truncated from the last VM_LOCKED vma of an mmap()ed file. 292 (5) as mentioned above, in vmscan:shrink_page_list() when attempting to
1954) before a page is COWed in a VM_LOCKED vma. 293 reclaim a page in a VM_LOCKED VMA via try_to_unmap()
196 294
197 295all of which result in the VM_LOCKED flag being set for the VMA if it doesn't
198Mlocked Pages: mlock()/mlockall() System Call Handling 296already have it set.
297
298mlocked pages become unlocked and rescued from the unevictable list when:
299
300 (1) mapped in a range unlocked via the munlock()/munlockall() system calls;
301
302 (2) munmap()'d out of the last VM_LOCKED VMA that maps the page, including
303 unmapping at task exit;
304
305 (3) when the page is truncated from the last VM_LOCKED VMA of an mmapped file;
306 or
307
308 (4) before a page is COW'd in a VM_LOCKED VMA.
309
310
311mlock()/mlockall() SYSTEM CALL HANDLING
312---------------------------------------
199 313
200Both [do_]mlock() and [do_]mlockall() system call handlers call mlock_fixup() 314Both [do_]mlock() and [do_]mlockall() system call handlers call mlock_fixup()
201for each vma in the range specified by the call. In the case of mlockall(), 315for each VMA in the range specified by the call. In the case of mlockall(),
202this is the entire active address space of the task. Note that mlock_fixup() 316this is the entire active address space of the task. Note that mlock_fixup()
203is used for both mlock()ing and munlock()ing a range of memory. A call to 317is used for both mlocking and munlocking a range of memory. A call to mlock()
204mlock() an already VM_LOCKED vma, or to munlock() a vma that is not VM_LOCKED 318an already VM_LOCKED VMA, or to munlock() a VMA that is not VM_LOCKED is
205is treated as a no-op--mlock_fixup() simply returns. 319treated as a no-op, and mlock_fixup() simply returns.
206 320
207If the vma passes some filtering described in "Mlocked Pages: Filtering Vmas" 321If the VMA passes some filtering as described in "Filtering Special Vmas"
208below, mlock_fixup() will attempt to merge the vma with its neighbors or split 322below, mlock_fixup() will attempt to merge the VMA with its neighbors or split
209off a subset of the vma if the range does not cover the entire vma. Once the 323off a subset of the VMA if the range does not cover the entire VMA. Once the
210vma has been merged or split or neither, mlock_fixup() will call 324VMA has been merged or split or neither, mlock_fixup() will call
211__mlock_vma_pages_range() to fault in the pages via get_user_pages() and 325__mlock_vma_pages_range() to fault in the pages via get_user_pages() and to
212to mark the pages as mlocked via mlock_vma_page(). 326mark the pages as mlocked via mlock_vma_page().
213 327
214Note that the vma being mlocked might be mapped with PROT_NONE. In this case, 328Note that the VMA being mlocked might be mapped with PROT_NONE. In this case,
215get_user_pages() will be unable to fault in the pages. That's OK. If pages 329get_user_pages() will be unable to fault in the pages. That's okay. If pages
216do end up getting faulted into this VM_LOCKED vma, we'll handle them in the 330do end up getting faulted into this VM_LOCKED VMA, we'll handle them in the
217fault path or in vmscan. 331fault path or in vmscan.
218 332
219Also note that a page returned by get_user_pages() could be truncated or 333Also note that a page returned by get_user_pages() could be truncated or
220migrated out from under us, while we're trying to mlock it. To detect 334migrated out from under us, while we're trying to mlock it. To detect this,
221this, __mlock_vma_pages_range() tests the page_mapping after acquiring 335__mlock_vma_pages_range() checks page_mapping() after acquiring the page lock.
222the page lock. If the page is still associated with its mapping, we'll 336If the page is still associated with its mapping, we'll go ahead and call
223go ahead and call mlock_vma_page(). If the mapping is gone, we just 337mlock_vma_page(). If the mapping is gone, we just unlock the page and move on.
224unlock the page and move on. Worse case, this results in page mapped 338In the worst case, this will result in a page mapped in a VM_LOCKED VMA
225in a VM_LOCKED vma remaining on a normal LRU list without being 339remaining on a normal LRU list without being PageMlocked(). Again, vmscan will
226PageMlocked(). Again, vmscan will detect and cull such pages. 340detect and cull such pages.
227 341
228mlock_vma_page(), called with the page locked [N.B., not "mlocked"], will 342mlock_vma_page() will call TestSetPageMlocked() for each page returned by
229TestSetPageMlocked() for each page returned by get_user_pages(). We use 343get_user_pages(). We use TestSetPageMlocked() because the page might already
230TestSetPageMlocked() because the page might already be mlocked by another 344be mlocked by another task/VMA and we don't want to do extra work. We
231task/vma and we don't want to do extra work. We especially do not want to 345especially do not want to count an mlocked page more than once in the
232count an mlocked page more than once in the statistics. If the page was 346statistics. If the page was already mlocked, mlock_vma_page() need do nothing
233already mlocked, mlock_vma_page() is done. 347more.
234 348
235If the page was NOT already mlocked, mlock_vma_page() attempts to isolate the 349If the page was NOT already mlocked, mlock_vma_page() attempts to isolate the
236page from the LRU, as it is likely on the appropriate active or inactive list 350page from the LRU, as it is likely on the appropriate active or inactive list
237at that time. If the isolate_lru_page() succeeds, mlock_vma_page() will 351at that time. If the isolate_lru_page() succeeds, mlock_vma_page() will put
238putback the page--putback_lru_page()--which will notice that the page is now 352back the page - by calling putback_lru_page() - which will notice that the page
239mlocked and divert the page to the zone's unevictable LRU list. If 353is now mlocked and divert the page to the zone's unevictable list. If
240mlock_vma_page() is unable to isolate the page from the LRU, vmscan will handle 354mlock_vma_page() is unable to isolate the page from the LRU, vmscan will handle
241it later if/when it attempts to reclaim the page. 355it later if and when it attempts to reclaim the page.
242 356
243 357
244Mlocked Pages: Filtering Special Vmas 358FILTERING SPECIAL VMAS
359----------------------
245 360
246mlock_fixup() filters several classes of "special" vmas: 361mlock_fixup() filters several classes of "special" VMAs:
247 362
2481) vmas with VM_IO|VM_PFNMAP set are skipped entirely. The pages behind 3631) VMAs with VM_IO or VM_PFNMAP set are skipped entirely. The pages behind
249 these mappings are inherently pinned, so we don't need to mark them as 364 these mappings are inherently pinned, so we don't need to mark them as
250 mlocked. In any case, most of the pages have no struct page in which to 365 mlocked. In any case, most of the pages have no struct page in which to so
251 so mark the page. Because of this, get_user_pages() will fail for these 366 mark the page. Because of this, get_user_pages() will fail for these VMAs,
252 vmas, so there is no sense in attempting to visit them. 367 so there is no sense in attempting to visit them.
253 368
2542) vmas mapping hugetlbfs page are already effectively pinned into memory. 3692) VMAs mapping hugetlbfs page are already effectively pinned into memory. We
255 We don't need nor want to mlock() these pages. However, to preserve the 370 neither need nor want to mlock() these pages. However, to preserve the
256 prior behavior of mlock()--before the unevictable/mlock changes-- 371 prior behavior of mlock() - before the unevictable/mlock changes -
257 mlock_fixup() will call make_pages_present() in the hugetlbfs vma range 372 mlock_fixup() will call make_pages_present() in the hugetlbfs VMA range to
258 to allocate the huge pages and populate the ptes. 373 allocate the huge pages and populate the ptes.
259 374
2603) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of 3753) VMAs with VM_DONTEXPAND or VM_RESERVED are generally userspace mappings of
261 kernel pages, such as the vdso page, relay channel pages, etc. These pages 376 kernel pages, such as the VDSO page, relay channel pages, etc. These pages
262 are inherently unevictable and are not managed on the LRU lists. 377 are inherently unevictable and are not managed on the LRU lists.
263 mlock_fixup() treats these vmas the same as hugetlbfs vmas. It calls 378 mlock_fixup() treats these VMAs the same as hugetlbfs VMAs. It calls
264 make_pages_present() to populate the ptes. 379 make_pages_present() to populate the ptes.
265 380
266Note that for all of these special vmas, mlock_fixup() does not set the 381Note that for all of these special VMAs, mlock_fixup() does not set the
267VM_LOCKED flag. Therefore, we won't have to deal with them later during 382VM_LOCKED flag. Therefore, we won't have to deal with them later during
268munlock() or munmap()--for example, at task exit. Neither does mlock_fixup() 383munlock(), munmap() or task exit. Neither does mlock_fixup() account these
269account these vmas against the task's "locked_vm". 384VMAs against the task's "locked_vm".
270 385
271Mlocked Pages: Downgrading the Mmap Semaphore. 386
272 387munlock()/munlockall() SYSTEM CALL HANDLING
273mlock_fixup() must be called with the mmap semaphore held for write, because 388-------------------------------------------
274it may have to merge or split vmas. However, mlocking a large region of 389
275memory can take a long time--especially if vmscan must reclaim pages to 390The munlock() and munlockall() system calls are handled by the same functions -
276satisfy the regions requirements. Faulting in a large region with the mmap 391do_mlock[all]() - as the mlock() and mlockall() system calls with the unlock vs
277semaphore held for write can hold off other faults on the address space, in 392lock operation indicated by an argument. So, these system calls are also
278the case of a multi-threaded task. It can also hold off scans of the task's 393handled by mlock_fixup(). Again, if called for an already munlocked VMA,
279address space via /proc. While testing under heavy load, it was observed that 394mlock_fixup() simply returns. Because of the VMA filtering discussed above,
280the ps(1) command could be held off for many minutes while a large segment was 395VM_LOCKED will not be set in any "special" VMAs. So, these VMAs will be
281mlock()ed down.
282
283To address this issue, and to make the system more responsive during mlock()ing
284of large segments, mlock_fixup() downgrades the mmap semaphore to read mode
285during the call to __mlock_vma_pages_range(). This works fine. However, the
286callers of mlock_fixup() expect the semaphore to be returned in write mode.
287So, mlock_fixup() "upgrades" the semphore to write mode. Linux does not
288support an atomic upgrade_sem() call, so mlock_fixup() must drop the semaphore
289and reacquire it in write mode. In a multi-threaded task, it is possible for
290the task memory map to change while the semaphore is dropped. Therefore,
291mlock_fixup() looks up the vma at the range start address after reacquiring
292the semaphore in write mode and verifies that it still covers the original
293range. If not, mlock_fixup() returns an error [-EAGAIN]. All callers of
294mlock_fixup() have been changed to deal with this new error condition.
295
296Note: when munlocking a region, all of the pages should already be resident--
297unless we have racing threads mlocking() and munlocking() regions. So,
298unlocking should not have to wait for page allocations nor faults of any kind.
299Therefore mlock_fixup() does not downgrade the semaphore for munlock().
300
301
302Mlocked Pages: munlock()/munlockall() System Call Handling
303
304The munlock() and munlockall() system calls are handled by the same functions--
305do_mlock[all]()--as the mlock() and mlockall() system calls with the unlock
306vs lock operation indicated by an argument. So, these system calls are also
307handled by mlock_fixup(). Again, if called for an already munlock()ed vma,
308mlock_fixup() simply returns. Because of the vma filtering discussed above,
309VM_LOCKED will not be set in any "special" vmas. So, these vmas will be
310ignored for munlock. 396ignored for munlock.
311 397
312If the vma is VM_LOCKED, mlock_fixup() again attempts to merge or split off 398If the VMA is VM_LOCKED, mlock_fixup() again attempts to merge or split off the
313the specified range. The range is then munlocked via the function 399specified range. The range is then munlocked via the function
314__mlock_vma_pages_range()--the same function used to mlock a vma range-- 400__mlock_vma_pages_range() - the same function used to mlock a VMA range -
315passing a flag to indicate that munlock() is being performed. 401passing a flag to indicate that munlock() is being performed.
316 402
317Because the vma access protections could have been changed to PROT_NONE after 403Because the VMA access protections could have been changed to PROT_NONE after
318faulting in and mlocking pages, get_user_pages() was unreliable for visiting 404faulting in and mlocking pages, get_user_pages() was unreliable for visiting
319these pages for munlocking. Because we don't want to leave pages mlocked(), 405these pages for munlocking. Because we don't want to leave pages mlocked,
320get_user_pages() was enhanced to accept a flag to ignore the permissions when 406get_user_pages() was enhanced to accept a flag to ignore the permissions when
321fetching the pages--all of which should be resident as a result of previous 407fetching the pages - all of which should be resident as a result of previous
322mlock()ing. 408mlocking.
323 409
324For munlock(), __mlock_vma_pages_range() unlocks individual pages by calling 410For munlock(), __mlock_vma_pages_range() unlocks individual pages by calling
325munlock_vma_page(). munlock_vma_page() unconditionally clears the PG_mlocked 411munlock_vma_page(). munlock_vma_page() unconditionally clears the PG_mlocked
326flag using TestClearPageMlocked(). As with mlock_vma_page(), munlock_vma_page() 412flag using TestClearPageMlocked(). As with mlock_vma_page(),
327use the Test*PageMlocked() function to handle the case where the page might 413munlock_vma_page() use the Test*PageMlocked() function to handle the case where
328have already been unlocked by another task. If the page was mlocked, 414the page might have already been unlocked by another task. If the page was
329munlock_vma_page() updates that zone statistics for the number of mlocked 415mlocked, munlock_vma_page() updates that zone statistics for the number of
330pages. Note, however, that at this point we haven't checked whether the page 416mlocked pages. Note, however, that at this point we haven't checked whether
331is mapped by other VM_LOCKED vmas. 417the page is mapped by other VM_LOCKED VMAs.
332 418
333We can't call try_to_munlock(), the function that walks the reverse map to check 419We can't call try_to_munlock(), the function that walks the reverse map to
334for other VM_LOCKED vmas, without first isolating the page from the LRU. 420check for other VM_LOCKED VMAs, without first isolating the page from the LRU.
335try_to_munlock() is a variant of try_to_unmap() and thus requires that the page 421try_to_munlock() is a variant of try_to_unmap() and thus requires that the page
336not be on an lru list. [More on these below.] However, the call to 422not be on an LRU list [more on these below]. However, the call to
337isolate_lru_page() could fail, in which case we couldn't try_to_munlock(). 423isolate_lru_page() could fail, in which case we couldn't try_to_munlock(). So,
338So, we go ahead and clear PG_mlocked up front, as this might be the only chance 424we go ahead and clear PG_mlocked up front, as this might be the only chance we
339we have. If we can successfully isolate the page, we go ahead and 425have. If we can successfully isolate the page, we go ahead and
340try_to_munlock(), which will restore the PG_mlocked flag and update the zone 426try_to_munlock(), which will restore the PG_mlocked flag and update the zone
341page statistics if it finds another vma holding the page mlocked. If we fail 427page statistics if it finds another VMA holding the page mlocked. If we fail
342to isolate the page, we'll have left a potentially mlocked page on the LRU. 428to isolate the page, we'll have left a potentially mlocked page on the LRU.
343This is fine, because we'll catch it later when/if vmscan tries to reclaim the 429This is fine, because we'll catch it later if and if vmscan tries to reclaim
344page. This should be relatively rare. 430the page. This should be relatively rare.
345 431
346Mlocked Pages: Migrating Them... 432
347 433MIGRATING MLOCKED PAGES
348A page that is being migrated has been isolated from the lru lists and is 434-----------------------
349held locked across unmapping of the page, updating the page's mapping 435
350[address_space] entry and copying the contents and state, until the 436A page that is being migrated has been isolated from the LRU lists and is held
351page table entry has been replaced with an entry that refers to the new 437locked across unmapping of the page, updating the page's address space entry
352page. Linux supports migration of mlocked pages and other unevictable 438and copying the contents and state, until the page table entry has been
353pages. This involves simply moving the PageMlocked and PageUnevictable states 439replaced with an entry that refers to the new page. Linux supports migration
354from the old page to the new page. 440of mlocked pages and other unevictable pages. This involves simply moving the
355 441PG_mlocked and PG_unevictable states from the old page to the new page.
356Note that page migration can race with mlocking or munlocking of the same 442
357page. This has been discussed from the mlock/munlock perspective in the 443Note that page migration can race with mlocking or munlocking of the same page.
358respective sections above. Both processes [migration, m[un]locking], hold 444This has been discussed from the mlock/munlock perspective in the respective
359the page locked. This provides the first level of synchronization. Page 445sections above. Both processes (migration and m[un]locking) hold the page
360migration zeros out the page_mapping of the old page before unlocking it, 446locked. This provides the first level of synchronization. Page migration
361so m[un]lock can skip these pages by testing the page mapping under page 447zeros out the page_mapping of the old page before unlocking it, so m[un]lock
362lock. 448can skip these pages by testing the page mapping under page lock.
363 449
364When completing page migration, we place the new and old pages back onto the 450To complete page migration, we place the new and old pages back onto the LRU
365lru after dropping the page lock. The "unneeded" page--old page on success, 451after dropping the page lock. The "unneeded" page - old page on success, new
366new page on failure--will be freed when the reference count held by the 452page on failure - will be freed when the reference count held by the migration
367migration process is released. To ensure that we don't strand pages on the 453process is released. To ensure that we don't strand pages on the unevictable
368unevictable list because of a race between munlock and migration, page 454list because of a race between munlock and migration, page migration uses the
369migration uses the putback_lru_page() function to add migrated pages back to 455putback_lru_page() function to add migrated pages back to the LRU.
370the lru. 456
371 457
372 458mmap(MAP_LOCKED) SYSTEM CALL HANDLING
373Mlocked Pages: mmap(MAP_LOCKED) System Call Handling 459-------------------------------------
374 460
375In addition the the mlock()/mlockall() system calls, an application can request 461In addition the the mlock()/mlockall() system calls, an application can request
376that a region of memory be mlocked using the MAP_LOCKED flag with the mmap() 462that a region of memory be mlocked supplying the MAP_LOCKED flag to the mmap()
377call. Furthermore, any mmap() call or brk() call that expands the heap by a 463call. Furthermore, any mmap() call or brk() call that expands the heap by a
378task that has previously called mlockall() with the MCL_FUTURE flag will result 464task that has previously called mlockall() with the MCL_FUTURE flag will result
379in the newly mapped memory being mlocked. Before the unevictable/mlock changes, 465in the newly mapped memory being mlocked. Before the unevictable/mlock
380the kernel simply called make_pages_present() to allocate pages and populate 466changes, the kernel simply called make_pages_present() to allocate pages and
381the page table. 467populate the page table.
382 468
383To mlock a range of memory under the unevictable/mlock infrastructure, the 469To mlock a range of memory under the unevictable/mlock infrastructure, the
384mmap() handler and task address space expansion functions call 470mmap() handler and task address space expansion functions call
385mlock_vma_pages_range() specifying the vma and the address range to mlock. 471mlock_vma_pages_range() specifying the vma and the address range to mlock.
386mlock_vma_pages_range() filters vmas like mlock_fixup(), as described above in 472mlock_vma_pages_range() filters VMAs like mlock_fixup(), as described above in
387"Mlocked Pages: Filtering Vmas". It will clear the VM_LOCKED flag, which will 473"Filtering Special VMAs". It will clear the VM_LOCKED flag, which will have
388have already been set by the caller, in filtered vmas. Thus these vma's need 474already been set by the caller, in filtered VMAs. Thus these VMA's need not be
389not be visited for munlock when the region is unmapped. 475visited for munlock when the region is unmapped.
390 476
391For "normal" vmas, mlock_vma_pages_range() calls __mlock_vma_pages_range() to 477For "normal" VMAs, mlock_vma_pages_range() calls __mlock_vma_pages_range() to
392fault/allocate the pages and mlock them. Again, like mlock_fixup(), 478fault/allocate the pages and mlock them. Again, like mlock_fixup(),
393mlock_vma_pages_range() downgrades the mmap semaphore to read mode before 479mlock_vma_pages_range() downgrades the mmap semaphore to read mode before
394attempting to fault/allocate and mlock the pages; and "upgrades" the semaphore 480attempting to fault/allocate and mlock the pages and "upgrades" the semaphore
395back to write mode before returning. 481back to write mode before returning.
396 482
397The callers of mlock_vma_pages_range() will have already added the memory 483The callers of mlock_vma_pages_range() will have already added the memory range
398range to be mlocked to the task's "locked_vm". To account for filtered vmas, 484to be mlocked to the task's "locked_vm". To account for filtered VMAs,
399mlock_vma_pages_range() returns the number of pages NOT mlocked. All of the 485mlock_vma_pages_range() returns the number of pages NOT mlocked. All of the
400callers then subtract a non-negative return value from the task's locked_vm. 486callers then subtract a non-negative return value from the task's locked_vm. A
401A negative return value represent an error--for example, from get_user_pages() 487negative return value represent an error - for example, from get_user_pages()
402attempting to fault in a vma with PROT_NONE access. In this case, we leave 488attempting to fault in a VMA with PROT_NONE access. In this case, we leave the
403the memory range accounted as locked_vm, as the protections could be changed 489memory range accounted as locked_vm, as the protections could be changed later
404later and pages allocated into that region. 490and pages allocated into that region.
405 491
406 492
407Mlocked Pages: munmap()/exit()/exec() System Call Handling 493munmap()/exit()/exec() SYSTEM CALL HANDLING
494-------------------------------------------
408 495
409When unmapping an mlocked region of memory, whether by an explicit call to 496When unmapping an mlocked region of memory, whether by an explicit call to
410munmap() or via an internal unmap from exit() or exec() processing, we must 497munmap() or via an internal unmap from exit() or exec() processing, we must
411munlock the pages if we're removing the last VM_LOCKED vma that maps the pages. 498munlock the pages if we're removing the last VM_LOCKED VMA that maps the pages.
412Before the unevictable/mlock changes, mlocking did not mark the pages in any 499Before the unevictable/mlock changes, mlocking did not mark the pages in any
413way, so unmapping them required no processing. 500way, so unmapping them required no processing.
414 501
415To munlock a range of memory under the unevictable/mlock infrastructure, the 502To munlock a range of memory under the unevictable/mlock infrastructure, the
416munmap() hander and task address space tear down function call 503munmap() handler and task address space call tear down function
417munlock_vma_pages_all(). The name reflects the observation that one always 504munlock_vma_pages_all(). The name reflects the observation that one always
418specifies the entire vma range when munlock()ing during unmap of a region. 505specifies the entire VMA range when munlock()ing during unmap of a region.
419Because of the vma filtering when mlocking() regions, only "normal" vmas that 506Because of the VMA filtering when mlocking() regions, only "normal" VMAs that
420actually contain mlocked pages will be passed to munlock_vma_pages_all(). 507actually contain mlocked pages will be passed to munlock_vma_pages_all().
421 508
422munlock_vma_pages_all() clears the VM_LOCKED vma flag and, like mlock_fixup() 509munlock_vma_pages_all() clears the VM_LOCKED VMA flag and, like mlock_fixup()
423for the munlock case, calls __munlock_vma_pages_range() to walk the page table 510for the munlock case, calls __munlock_vma_pages_range() to walk the page table
424for the vma's memory range and munlock_vma_page() each resident page mapped by 511for the VMA's memory range and munlock_vma_page() each resident page mapped by
425the vma. This effectively munlocks the page, only if this is the last 512the VMA. This effectively munlocks the page, only if this is the last
426VM_LOCKED vma that maps the page. 513VM_LOCKED VMA that maps the page.
427
428 514
429Mlocked Page: try_to_unmap()
430 515
431[Note: the code changes represented by this section are really quite small 516try_to_unmap()
432compared to the text to describe what happening and why, and to discuss the 517--------------
433implications.]
434 518
435Pages can, of course, be mapped into multiple vmas. Some of these vmas may 519Pages can, of course, be mapped into multiple VMAs. Some of these VMAs may
436have VM_LOCKED flag set. It is possible for a page mapped into one or more 520have VM_LOCKED flag set. It is possible for a page mapped into one or more
437VM_LOCKED vmas not to have the PG_mlocked flag set and therefore reside on one 521VM_LOCKED VMAs not to have the PG_mlocked flag set and therefore reside on one
438of the active or inactive LRU lists. This could happen if, for example, a 522of the active or inactive LRU lists. This could happen if, for example, a task
439task in the process of munlock()ing the page could not isolate the page from 523in the process of munlocking the page could not isolate the page from the LRU.
440the LRU. As a result, vmscan/shrink_page_list() might encounter such a page 524As a result, vmscan/shrink_page_list() might encounter such a page as described
441as described in "Unevictable Pages and Vmscan [shrink_*_list()]". To 525in section "vmscan's handling of unevictable pages". To handle this situation,
442handle this situation, try_to_unmap() has been enhanced to check for VM_LOCKED 526try_to_unmap() checks for VM_LOCKED VMAs while it is walking a page's reverse
443vmas while it is walking a page's reverse map. 527map.
444 528
445try_to_unmap() is always called, by either vmscan for reclaim or for page 529try_to_unmap() is always called, by either vmscan for reclaim or for page
446migration, with the argument page locked and isolated from the LRU. BUG_ON() 530migration, with the argument page locked and isolated from the LRU. Separate
447assertions enforce this requirement. Separate functions handle anonymous and 531functions handle anonymous and mapped file pages, as these types of pages have
448mapped file pages, as these types of pages have different reverse map 532different reverse map mechanisms.
449mechanisms. 533
450 534 (*) try_to_unmap_anon()
451 try_to_unmap_anon() 535
452 536 To unmap anonymous pages, each VMA in the list anchored in the anon_vma
453To unmap anonymous pages, each vma in the list anchored in the anon_vma must be 537 must be visited - at least until a VM_LOCKED VMA is encountered. If the
454visited--at least until a VM_LOCKED vma is encountered. If the page is being 538 page is being unmapped for migration, VM_LOCKED VMAs do not stop the
455unmapped for migration, VM_LOCKED vmas do not stop the process because mlocked 539 process because mlocked pages are migratable. However, for reclaim, if
456pages are migratable. However, for reclaim, if the page is mapped into a 540 the page is mapped into a VM_LOCKED VMA, the scan stops.
457VM_LOCKED vma, the scan stops. try_to_unmap() attempts to acquire the mmap 541
458semphore of the mm_struct to which the vma belongs in read mode. If this is 542 try_to_unmap_anon() attempts to acquire in read mode the mmap semphore of
459successful, try_to_unmap() will mlock the page via mlock_vma_page()--we 543 the mm_struct to which the VMA belongs. If this is successful, it will
460wouldn't have gotten to try_to_unmap() if the page were already mlocked--and 544 mlock the page via mlock_vma_page() - we wouldn't have gotten to
461will return SWAP_MLOCK, indicating that the page is unevictable. If the 545 try_to_unmap_anon() if the page were already mlocked - and will return
462mmap semaphore cannot be acquired, we are not sure whether the page is really 546 SWAP_MLOCK, indicating that the page is unevictable.
463unevictable or not. In this case, try_to_unmap() will return SWAP_AGAIN. 547
464 548 If the mmap semaphore cannot be acquired, we are not sure whether the page
465 try_to_unmap_file() -- linear mappings 549 is really unevictable or not. In this case, try_to_unmap_anon() will
466 550 return SWAP_AGAIN.
467Unmapping of a mapped file page works the same, except that the scan visits 551
468all vmas that maps the page's index/page offset in the page's mapping's 552 (*) try_to_unmap_file() - linear mappings
469reverse map priority search tree. It must also visit each vma in the page's 553
470mapping's non-linear list, if the list is non-empty. As for anonymous pages, 554 Unmapping of a mapped file page works the same as for anonymous mappings,
471on encountering a VM_LOCKED vma for a mapped file page, try_to_unmap() will 555 except that the scan visits all VMAs that map the page's index/page offset
472attempt to acquire the associated mm_struct's mmap semaphore to mlock the page, 556 in the page's mapping's reverse map priority search tree. It also visits
473returning SWAP_MLOCK if this is successful, and SWAP_AGAIN, if not. 557 each VMA in the page's mapping's non-linear list, if the list is
474 558 non-empty.
475 try_to_unmap_file() -- non-linear mappings 559
476 560 As for anonymous pages, on encountering a VM_LOCKED VMA for a mapped file
477If a page's mapping contains a non-empty non-linear mapping vma list, then 561 page, try_to_unmap_file() will attempt to acquire the associated
478try_to_un{map|lock}() must also visit each vma in that list to determine 562 mm_struct's mmap semaphore to mlock the page, returning SWAP_MLOCK if this
479whether the page is mapped in a VM_LOCKED vma. Again, the scan must visit 563 is successful, and SWAP_AGAIN, if not.
480all vmas in the non-linear list to ensure that the pages is not/should not be 564
481mlocked. If a VM_LOCKED vma is found in the list, the scan could terminate. 565 (*) try_to_unmap_file() - non-linear mappings
482However, there is no easy way to determine whether the page is actually mapped 566
483in a given vma--either for unmapping or testing whether the VM_LOCKED vma 567 If a page's mapping contains a non-empty non-linear mapping VMA list, then
484actually pins the page. 568 try_to_un{map|lock}() must also visit each VMA in that list to determine
485 569 whether the page is mapped in a VM_LOCKED VMA. Again, the scan must visit
486So, try_to_unmap_file() handles non-linear mappings by scanning a certain 570 all VMAs in the non-linear list to ensure that the pages is not/should not
487number of pages--a "cluster"--in each non-linear vma associated with the page's 571 be mlocked.
488mapping, for each file mapped page that vmscan tries to unmap. If this happens 572
489to unmap the page we're trying to unmap, try_to_unmap() will notice this on 573 If a VM_LOCKED VMA is found in the list, the scan could terminate.
490return--(page_mapcount(page) == 0)--and return SWAP_SUCCESS. Otherwise, it 574 However, there is no easy way to determine whether the page is actually
491will return SWAP_AGAIN, causing vmscan to recirculate this page. We take 575 mapped in a given VMA - either for unmapping or testing whether the
492advantage of the cluster scan in try_to_unmap_cluster() as follows: 576 VM_LOCKED VMA actually pins the page.
493 577
494For each non-linear vma, try_to_unmap_cluster() attempts to acquire the mmap 578 try_to_unmap_file() handles non-linear mappings by scanning a certain
495semaphore of the associated mm_struct for read without blocking. If this 579 number of pages - a "cluster" - in each non-linear VMA associated with the
496attempt is successful and the vma is VM_LOCKED, try_to_unmap_cluster() will 580 page's mapping, for each file mapped page that vmscan tries to unmap. If
497retain the mmap semaphore for the scan; otherwise it drops it here. Then, 581 this happens to unmap the page we're trying to unmap, try_to_unmap() will
498for each page in the cluster, if we're holding the mmap semaphore for a locked 582 notice this on return (page_mapcount(page) will be 0) and return
499vma, try_to_unmap_cluster() calls mlock_vma_page() to mlock the page. This 583 SWAP_SUCCESS. Otherwise, it will return SWAP_AGAIN, causing vmscan to
500call is a no-op if the page is already locked, but will mlock any pages in 584 recirculate this page. We take advantage of the cluster scan in
501the non-linear mapping that happen to be unlocked. If one of the pages so 585 try_to_unmap_cluster() as follows:
502mlocked is the page passed in to try_to_unmap(), try_to_unmap_cluster() will 586
503return SWAP_MLOCK, rather than the default SWAP_AGAIN. This will allow vmscan 587 For each non-linear VMA, try_to_unmap_cluster() attempts to acquire the
504to cull the page, rather than recirculating it on the inactive list. Again, 588 mmap semaphore of the associated mm_struct for read without blocking.
505if try_to_unmap_cluster() cannot acquire the vma's mmap sem, it returns 589
506SWAP_AGAIN, indicating that the page is mapped by a VM_LOCKED vma, but 590 If this attempt is successful and the VMA is VM_LOCKED,
507couldn't be mlocked. 591 try_to_unmap_cluster() will retain the mmap semaphore for the scan;
508 592 otherwise it drops it here.
509 593
510Mlocked pages: try_to_munlock() Reverse Map Scan 594 Then, for each page in the cluster, if we're holding the mmap semaphore
511 595 for a locked VMA, try_to_unmap_cluster() calls mlock_vma_page() to
512TODO/FIXME: a better name might be page_mlocked()--analogous to the 596 mlock the page. This call is a no-op if the page is already locked,
513page_referenced() reverse map walker. 597 but will mlock any pages in the non-linear mapping that happen to be
514 598 unlocked.
515When munlock_vma_page()--see "Mlocked Pages: munlock()/munlockall() 599
516System Call Handling" above--tries to munlock a page, it needs to 600 If one of the pages so mlocked is the page passed in to try_to_unmap(),
517determine whether or not the page is mapped by any VM_LOCKED vma, without 601 try_to_unmap_cluster() will return SWAP_MLOCK, rather than the default
518actually attempting to unmap all ptes from the page. For this purpose, the 602 SWAP_AGAIN. This will allow vmscan to cull the page, rather than
519unevictable/mlock infrastructure introduced a variant of try_to_unmap() called 603 recirculating it on the inactive list.
520try_to_munlock(). 604
605 Again, if try_to_unmap_cluster() cannot acquire the VMA's mmap sem, it
606 returns SWAP_AGAIN, indicating that the page is mapped by a VM_LOCKED
607 VMA, but couldn't be mlocked.
608
609
610try_to_munlock() REVERSE MAP SCAN
611---------------------------------
612
613 [!] TODO/FIXME: a better name might be page_mlocked() - analogous to the
614 page_referenced() reverse map walker.
615
616When munlock_vma_page() [see section "munlock()/munlockall() System Call
617Handling" above] tries to munlock a page, it needs to determine whether or not
618the page is mapped by any VM_LOCKED VMA without actually attempting to unmap
619all PTEs from the page. For this purpose, the unevictable/mlock infrastructure
620introduced a variant of try_to_unmap() called try_to_munlock().
521 621
522try_to_munlock() calls the same functions as try_to_unmap() for anonymous and 622try_to_munlock() calls the same functions as try_to_unmap() for anonymous and
523mapped file pages with an additional argument specifing unlock versus unmap 623mapped file pages with an additional argument specifing unlock versus unmap
524processing. Again, these functions walk the respective reverse maps looking 624processing. Again, these functions walk the respective reverse maps looking
525for VM_LOCKED vmas. When such a vma is found for anonymous pages and file 625for VM_LOCKED VMAs. When such a VMA is found for anonymous pages and file
526pages mapped in linear VMAs, as in the try_to_unmap() case, the functions 626pages mapped in linear VMAs, as in the try_to_unmap() case, the functions
527attempt to acquire the associated mmap semphore, mlock the page via 627attempt to acquire the associated mmap semphore, mlock the page via
528mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the 628mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the
529pre-clearing of the page's PG_mlocked done by munlock_vma_page. 629pre-clearing of the page's PG_mlocked done by munlock_vma_page.
530 630
531If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap 631If try_to_unmap() is unable to acquire a VM_LOCKED VMA's associated mmap
532semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list() 632semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list() to
533to recycle the page on the inactive list and hope that it has better luck 633recycle the page on the inactive list and hope that it has better luck with the
534with the page next time. 634page next time.
535 635
536For file pages mapped into non-linear vmas, the try_to_munlock() logic works 636For file pages mapped into non-linear VMAs, the try_to_munlock() logic works
537slightly differently. On encountering a VM_LOCKED non-linear vma that might 637slightly differently. On encountering a VM_LOCKED non-linear VMA that might
538map the page, try_to_munlock() returns SWAP_AGAIN without actually mlocking 638map the page, try_to_munlock() returns SWAP_AGAIN without actually mlocking the
539the page. munlock_vma_page() will just leave the page unlocked and let 639page. munlock_vma_page() will just leave the page unlocked and let vmscan deal
540vmscan deal with it--the usual fallback position. 640with it - the usual fallback position.
541 641
542Note that try_to_munlock()'s reverse map walk must visit every vma in a pages' 642Note that try_to_munlock()'s reverse map walk must visit every VMA in a page's
543reverse map to determine that a page is NOT mapped into any VM_LOCKED vma. 643reverse map to determine that a page is NOT mapped into any VM_LOCKED VMA.
544However, the scan can terminate when it encounters a VM_LOCKED vma and can 644However, the scan can terminate when it encounters a VM_LOCKED VMA and can
545successfully acquire the vma's mmap semphore for read and mlock the page. 645successfully acquire the VMA's mmap semphore for read and mlock the page.
546Although try_to_munlock() can be called many [very many!] times when 646Although try_to_munlock() might be called a great many times when munlocking a
547munlock()ing a large region or tearing down a large address space that has been 647large region or tearing down a large address space that has been mlocked via
548mlocked via mlockall(), overall this is a fairly rare event. 648mlockall(), overall this is a fairly rare event.
549 649
550Mlocked Page: Page Reclaim in shrink_*_list() 650
551 651PAGE RECLAIM IN shrink_*_list()
552shrink_active_list() culls any obviously unevictable pages--i.e., 652-------------------------------
553!page_evictable(page, NULL)--diverting these to the unevictable lru 653
554list. However, shrink_active_list() only sees unevictable pages that 654shrink_active_list() culls any obviously unevictable pages - i.e.
555made it onto the active/inactive lru lists. Note that these pages do not 655!page_evictable(page, NULL) - diverting these to the unevictable list.
556have PageUnevictable set--otherwise, they would be on the unevictable list and 656However, shrink_active_list() only sees unevictable pages that made it onto the
557shrink_active_list would never see them. 657active/inactive lru lists. Note that these pages do not have PageUnevictable
658set - otherwise they would be on the unevictable list and shrink_active_list
659would never see them.
558 660
559Some examples of these unevictable pages on the LRU lists are: 661Some examples of these unevictable pages on the LRU lists are:
560 662
5611) ramfs pages that have been placed on the lru lists when first allocated. 663 (1) ramfs pages that have been placed on the LRU lists when first allocated.
664
665 (2) SHM_LOCK'd shared memory pages. shmctl(SHM_LOCK) does not attempt to
666 allocate or fault in the pages in the shared memory region. This happens
667 when an application accesses the page the first time after SHM_LOCK'ing
668 the segment.
562 669
5632) SHM_LOCKed shared memory pages. shmctl(SHM_LOCK) does not attempt to 670 (3) mlocked pages that could not be isolated from the LRU and moved to the
564 allocate or fault in the pages in the shared memory region. This happens 671 unevictable list in mlock_vma_page().
565 when an application accesses the page the first time after SHM_LOCKing
566 the segment.
567 672
5683) Mlocked pages that could not be isolated from the lru and moved to the 673 (4) Pages mapped into multiple VM_LOCKED VMAs, but try_to_munlock() couldn't
569 unevictable list in mlock_vma_page(). 674 acquire the VMA's mmap semaphore to test the flags and set PageMlocked.
675 munlock_vma_page() was forced to let the page back on to the normal LRU
676 list for vmscan to handle.
570 677
5713) Pages mapped into multiple VM_LOCKED vmas, but try_to_munlock() couldn't 678shrink_inactive_list() also diverts any unevictable pages that it finds on the
572 acquire the vma's mmap semaphore to test the flags and set PageMlocked. 679inactive lists to the appropriate zone's unevictable list.
573 munlock_vma_page() was forced to let the page back on to the normal
574 LRU list for vmscan to handle.
575 680
576shrink_inactive_list() also culls any unevictable pages that it finds on 681shrink_inactive_list() should only see SHM_LOCK'd pages that became SHM_LOCK'd
577the inactive lists, again diverting them to the appropriate zone's unevictable 682after shrink_active_list() had moved them to the inactive list, or pages mapped
578lru list. shrink_inactive_list() should only see SHM_LOCKed pages that became 683into VM_LOCKED VMAs that munlock_vma_page() couldn't isolate from the LRU to
579SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or 684recheck via try_to_munlock(). shrink_inactive_list() won't notice the latter,
580pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from 685but will pass on to shrink_page_list().
581the lru to recheck via try_to_munlock(). shrink_inactive_list() won't notice
582the latter, but will pass on to shrink_page_list().
583 686
584shrink_page_list() again culls obviously unevictable pages that it could 687shrink_page_list() again culls obviously unevictable pages that it could
585encounter for similar reason to shrink_inactive_list(). Pages mapped into 688encounter for similar reason to shrink_inactive_list(). Pages mapped into
586VM_LOCKED vmas but without PG_mlocked set will make it all the way to 689VM_LOCKED VMAs but without PG_mlocked set will make it all the way to
587try_to_unmap(). shrink_page_list() will divert them to the unevictable list 690try_to_unmap(). shrink_page_list() will divert them to the unevictable list
588when try_to_unmap() returns SWAP_MLOCK, as discussed above. 691when try_to_unmap() returns SWAP_MLOCK, as discussed above.
diff --git a/MAINTAINERS b/MAINTAINERS
index 5d843588e1de..0cb20d821694 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -72,7 +72,6 @@ M: Mail patches to
72L: Mailing list that is relevant to this area 72L: Mailing list that is relevant to this area
73W: Web-page with status/info 73W: Web-page with status/info
74T: SCM tree type and location. Type is one of: git, hg, quilt. 74T: SCM tree type and location. Type is one of: git, hg, quilt.
75F: Applicable files and/or directories
76S: Status, one of the following: 75S: Status, one of the following:
77 76
78 Supported: Someone is actually paid to look after this. 77 Supported: Someone is actually paid to look after this.
@@ -85,23 +84,40 @@ S: Status, one of the following:
85 it has been replaced by a better system and you 84 it has been replaced by a better system and you
86 should be using that. 85 should be using that.
87 86
87F: Files and directories with wildcard patterns.
88 A trailing slash includes all files and subdirectory files.
89 F: drivers/net/ all files in and below drivers/net
90 F: drivers/net/* all files in drivers/net, but not below
91 F: */net/* all files in "any top level directory"/net
92 One pattern per line. Multiple F: lines acceptable.
93X: Files and directories that are NOT maintained, same rules as F:
94 Files exclusions are tested before file matches.
95 Can be useful for excluding a specific subdirectory, for instance:
96 F: net/
97 X: net/ipv6/
98 matches all files in and below net excluding net/ipv6/
99
883C505 NETWORK DRIVER 1003C505 NETWORK DRIVER
89P: Philip Blundell 101P: Philip Blundell
90M: philb@gnu.org 102M: philb@gnu.org
91L: netdev@vger.kernel.org 103L: netdev@vger.kernel.org
92S: Maintained 104S: Maintained
105F: drivers/net/3c505*
93 106
943C59X NETWORK DRIVER 1073C59X NETWORK DRIVER
95P: Steffen Klassert 108P: Steffen Klassert
96M: klassert@mathematik.tu-chemnitz.de 109M: klassert@mathematik.tu-chemnitz.de
97L: netdev@vger.kernel.org 110L: netdev@vger.kernel.org
98S: Maintained 111S: Maintained
112F: Documentation/networking/vortex.txt
113F: drivers/net/3c59x.c
99 114
1003CR990 NETWORK DRIVER 1153CR990 NETWORK DRIVER
101P: David Dillow 116P: David Dillow
102M: dave@thedillows.org 117M: dave@thedillows.org
103L: netdev@vger.kernel.org 118L: netdev@vger.kernel.org
104S: Maintained 119S: Maintained
120F: drivers/net/typhoon*
105 121
1063W-9XXX SATA-RAID CONTROLLER DRIVER 1223W-9XXX SATA-RAID CONTROLLER DRIVER
107P: Adam Radford 123P: Adam Radford
@@ -109,6 +125,7 @@ M: linuxraid@amcc.com
109L: linux-scsi@vger.kernel.org 125L: linux-scsi@vger.kernel.org
110W: http://www.amcc.com 126W: http://www.amcc.com
111S: Supported 127S: Supported
128F: drivers/scsi/3w-9xxx*
112 129
1133W-XXXX ATA-RAID CONTROLLER DRIVER 1303W-XXXX ATA-RAID CONTROLLER DRIVER
114P: Adam Radford 131P: Adam Radford
@@ -116,35 +133,43 @@ M: linuxraid@amcc.com
116L: linux-scsi@vger.kernel.org 133L: linux-scsi@vger.kernel.org
117W: http://www.amcc.com 134W: http://www.amcc.com
118S: Supported 135S: Supported
136F: drivers/scsi/3w-xxxx*
119 137
12053C700 AND 53C700-66 SCSI DRIVER 13853C700 AND 53C700-66 SCSI DRIVER
121P: James E.J. Bottomley 139P: James E.J. Bottomley
122M: James.Bottomley@HansenPartnership.com 140M: James.Bottomley@HansenPartnership.com
123L: linux-scsi@vger.kernel.org 141L: linux-scsi@vger.kernel.org
124S: Maintained 142S: Maintained
143F: drivers/scsi/53c700*
125 144
1266PACK NETWORK DRIVER FOR AX.25 1456PACK NETWORK DRIVER FOR AX.25
127P: Andreas Koensgen 146P: Andreas Koensgen
128M: ajk@iehk.rwth-aachen.de 147M: ajk@iehk.rwth-aachen.de
129L: linux-hams@vger.kernel.org 148L: linux-hams@vger.kernel.org
130S: Maintained 149S: Maintained
150F: drivers/net/hamradio/6pack.c
131 151
1328169 10/100/1000 GIGABIT ETHERNET DRIVER 1528169 10/100/1000 GIGABIT ETHERNET DRIVER
133P: Francois Romieu 153P: Francois Romieu
134M: romieu@fr.zoreil.com 154M: romieu@fr.zoreil.com
135L: netdev@vger.kernel.org 155L: netdev@vger.kernel.org
136S: Maintained 156S: Maintained
157F: drivers/net/r8169.c
137 158
1388250/16?50 (AND CLONE UARTS) SERIAL DRIVER 1598250/16?50 (AND CLONE UARTS) SERIAL DRIVER
139L: linux-serial@vger.kernel.org 160L: linux-serial@vger.kernel.org
140W: http://serial.sourceforge.net 161W: http://serial.sourceforge.net
141S: Orphan 162S: Orphan
163F: drivers/serial/8250*
164F: include/linux/serial_8250.h
142 165
1438390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.] 1668390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
144P: Paul Gortmaker 167P: Paul Gortmaker
145M: p_gortmaker@yahoo.com 168M: p_gortmaker@yahoo.com
146L: netdev@vger.kernel.org 169L: netdev@vger.kernel.org
147S: Maintained 170S: Maintained
171F: drivers/net/*8390*
172F: drivers/net/ax88796.c
148 173
1499P FILE SYSTEM 1749P FILE SYSTEM
150P: Eric Van Hensbergen 175P: Eric Van Hensbergen
@@ -155,14 +180,17 @@ P: Latchesar Ionkov
155M: lucho@ionkov.net 180M: lucho@ionkov.net
156L: v9fs-developer@lists.sourceforge.net 181L: v9fs-developer@lists.sourceforge.net
157W: http://swik.net/v9fs 182W: http://swik.net/v9fs
158T: git kernel.org:/pub/scm/linux/kernel/ericvh/v9fs.git 183T: git git://git.kernel.org/pub/scm/linux/kernel/ericvh/v9fs.git
159S: Maintained 184S: Maintained
185F: Documentation/filesystems/9p.txt
186F: fs/9p/
160 187
161A2232 SERIAL BOARD DRIVER 188A2232 SERIAL BOARD DRIVER
162P: Enver Haase 189P: Enver Haase
163M: A2232@gmx.net 190M: A2232@gmx.net
164L: linux-m68k@lists.linux-m68k.org 191L: linux-m68k@lists.linux-m68k.org
165S: Maintained 192S: Maintained
193F: drivers/char/ser_a2232*
166 194
167AACRAID SCSI RAID DRIVER 195AACRAID SCSI RAID DRIVER
168P: Adaptec OEM Raid Solutions 196P: Adaptec OEM Raid Solutions
@@ -170,24 +198,29 @@ M: aacraid@adaptec.com
170L: linux-scsi@vger.kernel.org 198L: linux-scsi@vger.kernel.org
171W: http://www.adaptec.com/ 199W: http://www.adaptec.com/
172S: Supported 200S: Supported
201F: Documentation/scsi/aacraid.txt
202F: drivers/scsi/aacraid/
173 203
174ABIT UGURU 1,2 HARDWARE MONITOR DRIVER 204ABIT UGURU 1,2 HARDWARE MONITOR DRIVER
175P: Hans de Goede 205P: Hans de Goede
176M: j.w.r.degoede@hhs.nl 206M: j.w.r.degoede@hhs.nl
177L: lm-sensors@lm-sensors.org 207L: lm-sensors@lm-sensors.org
178S: Maintained 208S: Maintained
209F: drivers/hwmon/abituguru.c
179 210
180ABIT UGURU 3 HARDWARE MONITOR DRIVER 211ABIT UGURU 3 HARDWARE MONITOR DRIVER
181P: Alistair John Strachan 212P: Alistair John Strachan
182M: alistair@devzero.co.uk 213M: alistair@devzero.co.uk
183L: lm-sensors@lm-sensors.org 214L: lm-sensors@lm-sensors.org
184S: Maintained 215S: Maintained
216F: drivers/hwmon/abituguru3.c
185 217
186ACENIC DRIVER 218ACENIC DRIVER
187P: Jes Sorensen 219P: Jes Sorensen
188M: jes@trained-monkey.org 220M: jes@trained-monkey.org
189L: linux-acenic@sunsite.dk 221L: linux-acenic@sunsite.dk
190S: Maintained 222S: Maintained
223F: drivers/net/acenic*
191 224
192ACER WMI LAPTOP EXTRAS 225ACER WMI LAPTOP EXTRAS
193P: Carlos Corbacho 226P: Carlos Corbacho
@@ -195,14 +228,18 @@ M: carlos@strangeworlds.co.uk
195L: aceracpi@googlegroups.com (subscribers-only) 228L: aceracpi@googlegroups.com (subscribers-only)
196W: http://code.google.com/p/aceracpi 229W: http://code.google.com/p/aceracpi
197S: Maintained 230S: Maintained
231F: drivers/platform/x86/acer-wmi.c
198 232
199ACPI 233ACPI
200P: Len Brown 234P: Len Brown
201M: lenb@kernel.org 235M: lenb@kernel.org
202L: linux-acpi@vger.kernel.org 236L: linux-acpi@vger.kernel.org
203W: http://www.lesswatts.org/projects/acpi/ 237W: http://www.lesswatts.org/projects/acpi/
204T: git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 238T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
205S: Supported 239S: Supported
240F: drivers/acpi/
241F: drivers/pnp/pnpacpi/
242F: include/linux/acpi.h
206 243
207ACPI BATTERY DRIVERS 244ACPI BATTERY DRIVERS
208P: Alexey Starikovskiy 245P: Alexey Starikovskiy
@@ -210,6 +247,8 @@ M: astarikovskiy@suse.de
210L: linux-acpi@vger.kernel.org 247L: linux-acpi@vger.kernel.org
211W: http://www.lesswatts.org/projects/acpi/ 248W: http://www.lesswatts.org/projects/acpi/
212S: Supported 249S: Supported
250F: drivers/acpi/battery.c
251F: drivers/acpi/*sbs*
213 252
214ACPI EC DRIVER 253ACPI EC DRIVER
215P: Alexey Starikovskiy 254P: Alexey Starikovskiy
@@ -217,6 +256,7 @@ M: astarikovskiy@suse.de
217L: linux-acpi@vger.kernel.org 256L: linux-acpi@vger.kernel.org
218W: http://www.lesswatts.org/projects/acpi/ 257W: http://www.lesswatts.org/projects/acpi/
219S: Supported 258S: Supported
259F: drivers/acpi/ec.c
220 260
221ACPI FAN DRIVER 261ACPI FAN DRIVER
222P: Zhang Rui 262P: Zhang Rui
@@ -224,12 +264,14 @@ M: rui.zhang@intel.com
224L: linux-acpi@vger.kernel.org 264L: linux-acpi@vger.kernel.org
225W: http://www.lesswatts.org/projects/acpi/ 265W: http://www.lesswatts.org/projects/acpi/
226S: Supported 266S: Supported
267F: drivers/acpi/fan.c
227 268
228ACPI PCI HOTPLUG DRIVER 269ACPI PCI HOTPLUG DRIVER
229P: Kristen Carlson Accardi 270P: Kristen Carlson Accardi
230M: kristen.c.accardi@intel.com 271M: kristen.c.accardi@intel.com
231L: linux-pci@vger.kernel.org 272L: linux-pci@vger.kernel.org
232S: Supported 273S: Supported
274F: drivers/pci/hotplug/acpi*
233 275
234ACPI THERMAL DRIVER 276ACPI THERMAL DRIVER
235P: Zhang Rui 277P: Zhang Rui
@@ -237,6 +279,7 @@ M: rui.zhang@intel.com
237L: linux-acpi@vger.kernel.org 279L: linux-acpi@vger.kernel.org
238W: http://www.lesswatts.org/projects/acpi/ 280W: http://www.lesswatts.org/projects/acpi/
239S: Supported 281S: Supported
282F: drivers/acpi/*thermal*
240 283
241ACPI VIDEO DRIVER 284ACPI VIDEO DRIVER
242P: Zhang Rui 285P: Zhang Rui
@@ -244,6 +287,7 @@ M: rui.zhang@intel.com
244L: linux-acpi@vger.kernel.org 287L: linux-acpi@vger.kernel.org
245W: http://www.lesswatts.org/projects/acpi/ 288W: http://www.lesswatts.org/projects/acpi/
246S: Supported 289S: Supported
290F: drivers/acpi/video.c
247 291
248ACPI WMI DRIVER 292ACPI WMI DRIVER
249P: Carlos Corbacho 293P: Carlos Corbacho
@@ -251,6 +295,7 @@ M: carlos@strangeworlds.co.uk
251L: linux-acpi@vger.kernel.org 295L: linux-acpi@vger.kernel.org
252W: http://www.lesswatts.org/projects/acpi/ 296W: http://www.lesswatts.org/projects/acpi/
253S: Maintained 297S: Maintained
298F: drivers/platform/x86/wmi.c
254 299
255AD1889 ALSA SOUND DRIVER 300AD1889 ALSA SOUND DRIVER
256P: Kyle McMartin 301P: Kyle McMartin
@@ -260,77 +305,99 @@ M: T-Bone@parisc-linux.org
260W: http://wiki.parisc-linux.org/AD1889 305W: http://wiki.parisc-linux.org/AD1889
261L: linux-parisc@vger.kernel.org 306L: linux-parisc@vger.kernel.org
262S: Maintained 307S: Maintained
308F: sound/pci/ad1889.*
263 309
264ADM1025 HARDWARE MONITOR DRIVER 310ADM1025 HARDWARE MONITOR DRIVER
265P: Jean Delvare 311P: Jean Delvare
266M: khali@linux-fr.org 312M: khali@linux-fr.org
267L: lm-sensors@lm-sensors.org 313L: lm-sensors@lm-sensors.org
268S: Maintained 314S: Maintained
315F: Documentation/hwmon/adm1025
316F: drivers/hwmon/adm1025.c
269 317
270ADM1029 HARDWARE MONITOR DRIVER 318ADM1029 HARDWARE MONITOR DRIVER
271P: Corentin Labbe 319P: Corentin Labbe
272M: corentin.labbe@geomatys.fr 320M: corentin.labbe@geomatys.fr
273L: lm-sensors@lm-sensors.org 321L: lm-sensors@lm-sensors.org
274S: Maintained 322S: Maintained
323F: drivers/hwmon/adm1029.c
275 324
276ADM8211 WIRELESS DRIVER 325ADM8211 WIRELESS DRIVER
277P: Michael Wu 326P: Michael Wu
278M: flamingice@sourmilk.net 327M: flamingice@sourmilk.net
279L: linux-wireless@vger.kernel.org 328L: linux-wireless@vger.kernel.org
280W: http://linuxwireless.org/ 329W: http://linuxwireless.org/
281T: git kernel.org:/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git 330T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
282S: Maintained 331S: Maintained
332F: drivers/net/wireless/adm8211.*
283 333
284ADT746X FAN DRIVER 334ADT746X FAN DRIVER
285P: Colin Leroy 335P: Colin Leroy
286M: colin@colino.net 336M: colin@colino.net
287S: Maintained 337S: Maintained
338F: drivers/macintosh/therm_adt746x.c
288 339
289ADVANSYS SCSI DRIVER 340ADVANSYS SCSI DRIVER
290P: Matthew Wilcox 341P: Matthew Wilcox
291M: matthew@wil.cx 342M: matthew@wil.cx
292L: linux-scsi@vger.kernel.org 343L: linux-scsi@vger.kernel.org
293S: Maintained 344S: Maintained
345F: Documentation/scsi/advansys.txt
346F: drivers/scsi/advansys.c
294 347
295AEDSP16 DRIVER 348AEDSP16 DRIVER
296P: Riccardo Facchetti 349P: Riccardo Facchetti
297M: fizban@tin.it 350M: fizban@tin.it
298S: Maintained 351S: Maintained
352F: sound/oss/aedsp16.c
299 353
300AFFS FILE SYSTEM 354AFFS FILE SYSTEM
301P: Roman Zippel 355P: Roman Zippel
302M: zippel@linux-m68k.org 356M: zippel@linux-m68k.org
303S: Maintained 357S: Maintained
358F: Documentation/filesystems/affs.txt
359F: fs/affs/
304 360
305AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN 361AFS FILESYSTEM & AF_RXRPC SOCKET DOMAIN
306P: David Howells 362P: David Howells
307M: dhowells@redhat.com 363M: dhowells@redhat.com
308L: linux-afs@lists.infradead.org 364L: linux-afs@lists.infradead.org
309S: Supported 365S: Supported
366F: fs/afs/
367F: include/net/af_rxrpc.h
368F: net/rxrpc/af_rxrpc.c
310 369
311AGPGART DRIVER 370AGPGART DRIVER
312P: David Airlie 371P: David Airlie
313M: airlied@linux.ie 372M: airlied@linux.ie
314T: git kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git 373T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
315S: Maintained 374S: Maintained
375F: drivers/char/agp/
376F: include/linux/agp*
316 377
317AHA152X SCSI DRIVER 378AHA152X SCSI DRIVER
318P: Juergen E. Fischer 379P: Juergen E. Fischer
319M: Juergen Fischer <fischer@norbit.de> 380M: fischer@norbit.de
320L: linux-scsi@vger.kernel.org 381L: linux-scsi@vger.kernel.org
321S: Maintained 382S: Maintained
383F: drivers/scsi/aha152x*
384F: drivers/scsi/pcmcia/aha152x*
322 385
323AIC7XXX / AIC79XX SCSI DRIVER 386AIC7XXX / AIC79XX SCSI DRIVER
324P: Hannes Reinecke 387P: Hannes Reinecke
325M: hare@suse.de 388M: hare@suse.de
326L: linux-scsi@vger.kernel.org 389L: linux-scsi@vger.kernel.org
327S: Maintained 390S: Maintained
391F: drivers/scsi/aic7xxx/
392F: drivers/scsi/aic7xxx_old/
328 393
329AIO 394AIO
330P: Benjamin LaHaise 395P: Benjamin LaHaise
331M: bcrl@kvack.org 396M: bcrl@kvack.org
332L: linux-aio@kvack.org 397L: linux-aio@kvack.org
333S: Supported 398S: Supported
399F: fs/aio.c
400F: include/linux/*aio*.h
334 401
335ALCATEL SPEEDTOUCH USB DRIVER 402ALCATEL SPEEDTOUCH USB DRIVER
336P: Duncan Sands 403P: Duncan Sands
@@ -338,17 +405,22 @@ M: duncan.sands@free.fr
338L: linux-usb@vger.kernel.org 405L: linux-usb@vger.kernel.org
339W: http://www.linux-usb.org/SpeedTouch/ 406W: http://www.linux-usb.org/SpeedTouch/
340S: Maintained 407S: Maintained
408F: drivers/usb/atm/speedtch.c
409F: drivers/usb/atm/usbatm.c
341 410
342ALCHEMY AU1XX0 MMC DRIVER 411ALCHEMY AU1XX0 MMC DRIVER
343P: Manuel Lauss 412P: Manuel Lauss
344M: manuel.lauss@gmail.com 413M: manuel.lauss@gmail.com
345S: Maintained 414S: Maintained
415F: drivers/mmc/host/au1xmmc.c
346 416
347ALI1563 I2C DRIVER 417ALI1563 I2C DRIVER
348P: Rudolf Marek 418P: Rudolf Marek
349M: r.marek@assembler.cz 419M: r.marek@assembler.cz
350L: linux-i2c@vger.kernel.org 420L: linux-i2c@vger.kernel.org
351S: Maintained 421S: Maintained
422F: Documentation/i2c/busses/i2c-ali1563
423F: drivers/i2c/busses/i2c-ali1563.c
352 424
353ALPHA PORT 425ALPHA PORT
354P: Richard Henderson 426P: Richard Henderson
@@ -358,31 +430,41 @@ P: Ivan Kokshaysky
358M: ink@jurassic.park.msu.ru 430M: ink@jurassic.park.msu.ru
359S: Maintained for 2.4; PCI support for 2.6. 431S: Maintained for 2.4; PCI support for 2.6.
360L: linux-alpha@vger.kernel.org 432L: linux-alpha@vger.kernel.org
433F: arch/alpha/
361 434
362AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER 435AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
363P: Thomas Dahlmann 436P: Thomas Dahlmann
364M: thomas.dahlmann@amd.com 437M: thomas.dahlmann@amd.com
365L: linux-geode@lists.infradead.org (moderated for non-subscribers) 438L: linux-geode@lists.infradead.org (moderated for non-subscribers)
366S: Supported 439S: Supported
440F: drivers/usb/gadget/amd5536udc.*
367 441
368AMD GEODE PROCESSOR/CHIPSET SUPPORT 442AMD GEODE PROCESSOR/CHIPSET SUPPORT
369P: Jordan Crouse 443P: Jordan Crouse
370L: linux-geode@lists.infradead.org (moderated for non-subscribers) 444L: linux-geode@lists.infradead.org (moderated for non-subscribers)
371W: http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html 445W: http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
372S: Supported 446S: Supported
447F: arch/x86/kernel/geode_32.c
448F: drivers/char/hw_random/geode-rng.c
449F: drivers/crypto/geode*
450F: drivers/video/geode/
451F: arch/x86/include/asm/geode.h
373 452
374AMD IOMMU (AMD-VI) 453AMD IOMMU (AMD-VI)
375P: Joerg Roedel 454P: Joerg Roedel
376M: joerg.roedel@amd.com 455M: joerg.roedel@amd.com
377L: iommu@lists.linux-foundation.org 456L: iommu@lists.linux-foundation.org
378T: git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git 457T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git
379S: Supported 458S: Supported
459F: arch/x86/kernel/amd_iommu*.c
460F: arch/x86/include/asm/amd_iommu*.h
380 461
381AMD MICROCODE UPDATE SUPPORT 462AMD MICROCODE UPDATE SUPPORT
382P: Andreas Herrmann 463P: Andreas Herrmann
383M: andeas.herrmann3@amd.com 464M: andreas.herrmann3@amd.com
384L: amd64-microcode@amd64.org 465L: amd64-microcode@amd64.org
385S: Supported 466S: Supported
467F: arch/x86/kernel/microcode_amd.c
386 468
387AMS (Apple Motion Sensor) DRIVER 469AMS (Apple Motion Sensor) DRIVER
388P: Stelian Pop 470P: Stelian Pop
@@ -390,6 +472,7 @@ M: stelian@popies.net
390P: Michael Hanselmann 472P: Michael Hanselmann
391M: linux-kernel@hansmi.ch 473M: linux-kernel@hansmi.ch
392S: Supported 474S: Supported
475F: drivers/hwmon/ams/
393 476
394AMSO1100 RNIC DRIVER 477AMSO1100 RNIC DRIVER
395P: Tom Tucker 478P: Tom Tucker
@@ -398,6 +481,7 @@ P: Steve Wise
398M: swise@opengridcomputing.com 481M: swise@opengridcomputing.com
399L: general@lists.openfabrics.org 482L: general@lists.openfabrics.org
400S: Maintained 483S: Maintained
484F: drivers/infiniband/hw/amso1100/
401 485
402AOA (Apple Onboard Audio) ALSA DRIVER 486AOA (Apple Onboard Audio) ALSA DRIVER
403P: Johannes Berg 487P: Johannes Berg
@@ -405,6 +489,7 @@ M: johannes@sipsolutions.net
405L: linuxppc-dev@ozlabs.org 489L: linuxppc-dev@ozlabs.org
406L: alsa-devel@alsa-project.org (subscribers-only) 490L: alsa-devel@alsa-project.org (subscribers-only)
407S: Maintained 491S: Maintained
492F: sound/aoa/
408 493
409APM DRIVER 494APM DRIVER
410P: Stephen Rothwell 495P: Stephen Rothwell
@@ -412,48 +497,63 @@ M: sfr@canb.auug.org.au
412L: linux-laptop@vger.kernel.org 497L: linux-laptop@vger.kernel.org
413W: http://www.canb.auug.org.au/~sfr/ 498W: http://www.canb.auug.org.au/~sfr/
414S: Supported 499S: Supported
500F: arch/x86/kernel/apm_32.c
501F: include/linux/apm_bios.h
415 502
416APPLE BCM5974 MULTITOUCH DRIVER 503APPLE BCM5974 MULTITOUCH DRIVER
417P: Henrik Rydberg 504P: Henrik Rydberg
418M: rydberg@euromail.se 505M: rydberg@euromail.se
419L: linux-input@vger.kernel.org 506L: linux-input@vger.kernel.org
420S: Maintained 507S: Maintained
508F: drivers/input/mouse/bcm5974.c
421 509
422APPLE SMC DRIVER 510APPLE SMC DRIVER
423P: Nicolas Boichat 511P: Nicolas Boichat
424M: nicolas@boichat.ch 512M: nicolas@boichat.ch
425L: mactel-linux-devel@lists.sourceforge.net 513L: mactel-linux-devel@lists.sourceforge.net
426S: Maintained 514S: Maintained
515F: drivers/hwmon/applesmc.c
427 516
428APPLETALK NETWORK LAYER 517APPLETALK NETWORK LAYER
429P: Arnaldo Carvalho de Melo 518P: Arnaldo Carvalho de Melo
430M: acme@ghostprotocols.net 519M: acme@ghostprotocols.net
431S: Maintained 520S: Maintained
521F: drivers/net/appletalk/
522F: net/appletalk/
432 523
433APPLETOUCH TOUCHPAD DRIVER 524APPLETOUCH TOUCHPAD DRIVER
434P: Johannes Berg 525P: Johannes Berg
435M: johannes@sipsolutions.net 526M: johannes@sipsolutions.net
436L: linux-input@vger.kernel.org 527L: linux-input@vger.kernel.org
437S: Maintained 528S: Maintained
529F: Documentation/input/appletouch.txt
530F: drivers/input/mouse/appletouch.c
438 531
439ARC FRAMEBUFFER DRIVER 532ARC FRAMEBUFFER DRIVER
440P: Jaya Kumar 533P: Jaya Kumar
441M: jayalk@intworks.biz 534M: jayalk@intworks.biz
442S: Maintained 535S: Maintained
536F: drivers/video/arcfb.c
537F: drivers/video/fb_defio.c
443 538
444ARM MFM AND FLOPPY DRIVERS 539ARM MFM AND FLOPPY DRIVERS
445P: Ian Molton 540P: Ian Molton
446M: spyro@f2s.com 541M: spyro@f2s.com
447S: Maintained 542S: Maintained
543F: arch/arm/lib/floppydma.S
544F: arch/arm/include/asm/floppy.h
448 545
449ARM PRIMECELL MMCI PL180/1 DRIVER 546ARM PRIMECELL MMCI PL180/1 DRIVER
450S: Orphan 547S: Orphan
548F: drivers/mmc/host/mmci.*
451 549
452ARM/ADI ROADRUNNER MACHINE SUPPORT 550ARM/ADI ROADRUNNER MACHINE SUPPORT
453P: Lennert Buytenhek 551P: Lennert Buytenhek
454M: kernel@wantstofly.org 552M: kernel@wantstofly.org
455L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 553L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
456S: Maintained 554S: Maintained
555F: arch/arm/mach-ixp23xx/
556F: arch/arm/mach-ixp23xx/include/mach/
457 557
458ARM/ADS SPHERE MACHINE SUPPORT 558ARM/ADS SPHERE MACHINE SUPPORT
459P: Lennert Buytenhek 559P: Lennert Buytenhek
@@ -507,7 +607,7 @@ ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE
507P: Paulius Zaleckas 607P: Paulius Zaleckas
508M: paulius.zaleckas@teltonika.lt 608M: paulius.zaleckas@teltonika.lt
509L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 609L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
510T: git gitorious.org/linux-gemini/mainline.git 610T: git git://gitorious.org/linux-gemini/mainline.git
511S: Maintained 611S: Maintained
512 612
513ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) 613ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6)
@@ -643,10 +743,10 @@ W: http://hackndev.com
643S: Maintained 743S: Maintained
644 744
645ARM/PALMZ72 SUPPORT 745ARM/PALMZ72 SUPPORT
646P: Sergey Lapin 746P: Sergey Lapin
647M: slapin@ossfans.org 747M: slapin@ossfans.org
648W: http://hackndev.com 748W: http://hackndev.com
649S: Maintained 749S: Maintained
650 750
651ARM/PLEB SUPPORT 751ARM/PLEB SUPPORT
652P: Peter Chubb 752P: Peter Chubb
@@ -707,16 +807,17 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
707S: Maintained 807S: Maintained
708 808
709ARM/NUVOTON W90X900 ARM ARCHITECTURE 809ARM/NUVOTON W90X900 ARM ARCHITECTURE
710P: Wan ZongShun 810P: Wan ZongShun
711M: mcuos.com@gmail.com 811M: mcuos.com@gmail.com
712L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 812L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
713W: http://www.mcuos.com 813W: http://www.mcuos.com
714S: Maintained 814S: Maintained
715 815
716ARPD SUPPORT 816ARPD SUPPORT
717P: Jonathan Layes 817P: Jonathan Layes
718L: netdev@vger.kernel.org 818L: netdev@vger.kernel.org
719S: Maintained 819S: Maintained
820F: net/ipv4/arp.c
720 821
721ASUS ACPI EXTRAS DRIVER 822ASUS ACPI EXTRAS DRIVER
722P: Corentin Chary 823P: Corentin Chary
@@ -727,12 +828,15 @@ L: acpi4asus-user@lists.sourceforge.net
727W: http://sourceforge.net/projects/acpi4asus 828W: http://sourceforge.net/projects/acpi4asus
728W: http://xf.iksaif.net/acpi4asus 829W: http://xf.iksaif.net/acpi4asus
729S: Maintained 830S: Maintained
831F: arch/x86/kernel/acpi/boot.c
832F: drivers/platform/x86/asus_acpi.c
730 833
731ASUS ASB100 HARDWARE MONITOR DRIVER 834ASUS ASB100 HARDWARE MONITOR DRIVER
732P: Mark M. Hoffman 835P: Mark M. Hoffman
733M: mhoffman@lightlink.com 836M: mhoffman@lightlink.com
734L: lm-sensors@lm-sensors.org 837L: lm-sensors@lm-sensors.org
735S: Maintained 838S: Maintained
839F: drivers/hwmon/asb100.c
736 840
737ASUS LAPTOP EXTRAS DRIVER 841ASUS LAPTOP EXTRAS DRIVER
738P: Corentin Chary 842P: Corentin Chary
@@ -741,6 +845,7 @@ L: acpi4asus-user@lists.sourceforge.net
741W: http://sourceforge.net/projects/acpi4asus 845W: http://sourceforge.net/projects/acpi4asus
742W: http://xf.iksaif.net/acpi4asus 846W: http://xf.iksaif.net/acpi4asus
743S: Maintained 847S: Maintained
848F: drivers/platform/x86/asus-laptop.c
744 849
745ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API 850ASYNCHRONOUS TRANSFERS/TRANSFORMS (IOAT) API
746P: Dan Williams 851P: Dan Williams
@@ -750,12 +855,19 @@ M: maciej.sosnowski@intel.com
750L: linux-kernel@vger.kernel.org 855L: linux-kernel@vger.kernel.org
751W: http://sourceforge.net/projects/xscaleiop 856W: http://sourceforge.net/projects/xscaleiop
752S: Supported 857S: Supported
858F: Documentation/crypto/async-tx-api.txt
859F: crypto/async_tx/
860F: drivers/dma/
861F: include/linux/dmaengine.h
862F: include/linux/async_tx.h
753 863
754ATA OVER ETHERNET (AOE) DRIVER 864ATA OVER ETHERNET (AOE) DRIVER
755P: Ed L. Cashin 865P: Ed L. Cashin
756M: ecashin@coraid.com 866M: ecashin@coraid.com
757W: http://www.coraid.com/support/linux 867W: http://www.coraid.com/support/linux
758S: Supported 868S: Supported
869F: Documentation/aoe/
870F: drivers/block/aoe/
759 871
760ATHEROS ATH5K WIRELESS DRIVER 872ATHEROS ATH5K WIRELESS DRIVER
761P: Jiri Slaby 873P: Jiri Slaby
@@ -769,6 +881,7 @@ M: me@bobcopeland.com
769L: linux-wireless@vger.kernel.org 881L: linux-wireless@vger.kernel.org
770L: ath5k-devel@lists.ath5k.org 882L: ath5k-devel@lists.ath5k.org
771S: Maintained 883S: Maintained
884F: drivers/net/wireless/ath5k/
772 885
773ATHEROS ATH9K WIRELESS DRIVER 886ATHEROS ATH9K WIRELESS DRIVER
774P: Luis R. Rodriguez 887P: Luis R. Rodriguez
@@ -778,6 +891,7 @@ M: jmalinen@atheros.com
778L: linux-wireless@vger.kernel.org 891L: linux-wireless@vger.kernel.org
779L: ath9k-devel@lists.ath9k.org 892L: ath9k-devel@lists.ath9k.org
780S: Supported 893S: Supported
894F: drivers/net/wireless/ath9k/
781 895
782ATHEROS AR9170 WIRELESS DRIVER 896ATHEROS AR9170 WIRELESS DRIVER
783P: Christian Lamparter 897P: Christian Lamparter
@@ -791,6 +905,7 @@ ATI_REMOTE2 DRIVER
791P: Ville Syrjala 905P: Ville Syrjala
792M: syrjala@sci.fi 906M: syrjala@sci.fi
793S: Maintained 907S: Maintained
908F: drivers/input/misc/ati_remote2.c
794 909
795ATLX ETHERNET DRIVERS 910ATLX ETHERNET DRIVERS
796P: Jay Cliburn 911P: Jay Cliburn
@@ -803,6 +918,7 @@ L: atl1-devel@lists.sourceforge.net
803W: http://sourceforge.net/projects/atl1 918W: http://sourceforge.net/projects/atl1
804W: http://atl1.sourceforge.net 919W: http://atl1.sourceforge.net
805S: Maintained 920S: Maintained
921F: drivers/net/atlx/
806 922
807ATM 923ATM
808P: Chas Williams 924P: Chas Williams
@@ -811,6 +927,8 @@ L: linux-atm-general@lists.sourceforge.net (subscribers-only)
811L: netdev@vger.kernel.org 927L: netdev@vger.kernel.org
812W: http://linux-atm.sourceforge.net 928W: http://linux-atm.sourceforge.net
813S: Maintained 929S: Maintained
930F: drivers/atm/
931F: include/linux/atm*
814 932
815ATMEL AT91 MCI DRIVER 933ATMEL AT91 MCI DRIVER
816P: Nicolas Ferre 934P: Nicolas Ferre
@@ -819,28 +937,34 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
819W: http://www.atmel.com/products/AT91/ 937W: http://www.atmel.com/products/AT91/
820W: http://www.at91.com/ 938W: http://www.at91.com/
821S: Maintained 939S: Maintained
940F: drivers/mmc/host/at91_mci.c
822 941
823ATMEL AT91 / AT32 SERIAL DRIVER 942ATMEL AT91 / AT32 SERIAL DRIVER
824P: Haavard Skinnemoen 943P: Haavard Skinnemoen
825M: hskinnemoen@atmel.com 944M: hskinnemoen@atmel.com
826L: linux-kernel@vger.kernel.org 945L: linux-kernel@vger.kernel.org
827S: Supported 946S: Supported
947F: drivers/serial/atmel_serial.c
828 948
829ATMEL LCDFB DRIVER 949ATMEL LCDFB DRIVER
830P: Nicolas Ferre 950P: Nicolas Ferre
831M: nicolas.ferre@atmel.com 951M: nicolas.ferre@atmel.com
832L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 952L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
833S: Maintained 953S: Maintained
954F: drivers/video/atmel_lcdfb.c
955F: include/video/atmel_lcdc.h
834 956
835ATMEL MACB ETHERNET DRIVER 957ATMEL MACB ETHERNET DRIVER
836P: Haavard Skinnemoen 958P: Haavard Skinnemoen
837M: hskinnemoen@atmel.com 959M: hskinnemoen@atmel.com
838S: Supported 960S: Supported
961F: drivers/net/macb.*
839 962
840ATMEL SPI DRIVER 963ATMEL SPI DRIVER
841P: Haavard Skinnemoen 964P: Haavard Skinnemoen
842M: hskinnemoen@atmel.com 965M: hskinnemoen@atmel.com
843S: Supported 966S: Supported
967F: drivers/spi/atmel_spi.*
844 968
845ATMEL USBA UDC DRIVER 969ATMEL USBA UDC DRIVER
846P: Haavard Skinnemoen 970P: Haavard Skinnemoen
@@ -848,6 +972,7 @@ M: hskinnemoen@atmel.com
848L: kernel@avr32linux.org 972L: kernel@avr32linux.org
849W: http://avr32linux.org/twiki/bin/view/Main/AtmelUsbDeviceDriver 973W: http://avr32linux.org/twiki/bin/view/Main/AtmelUsbDeviceDriver
850S: Supported 974S: Supported
975F: drivers/usb/gadget/atmel_usba_udc.*
851 976
852ATMEL WIRELESS DRIVER 977ATMEL WIRELESS DRIVER
853P: Simon Kelley 978P: Simon Kelley
@@ -856,6 +981,7 @@ L: linux-wireless@vger.kernel.org
856W: http://www.thekelleys.org.uk/atmel 981W: http://www.thekelleys.org.uk/atmel
857W: http://atmelwlandriver.sourceforge.net/ 982W: http://atmelwlandriver.sourceforge.net/
858S: Maintained 983S: Maintained
984F: drivers/net/wireless/atmel*
859 985
860AUDIT SUBSYSTEM 986AUDIT SUBSYSTEM
861P: Al Viro 987P: Al Viro
@@ -864,8 +990,10 @@ P: Eric Paris
864M: eparis@redhat.com 990M: eparis@redhat.com
865L: linux-audit@redhat.com (subscribers-only) 991L: linux-audit@redhat.com (subscribers-only)
866W: http://people.redhat.com/sgrubb/audit/ 992W: http://people.redhat.com/sgrubb/audit/
867T: git git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git 993T: git git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current.git
868S: Maintained 994S: Maintained
995F: include/linux/audit.h
996F: kernel/audit*
869 997
870AUXILIARY DISPLAY DRIVERS 998AUXILIARY DISPLAY DRIVERS
871P: Miguel Ojeda Sandonis 999P: Miguel Ojeda Sandonis
@@ -874,6 +1002,8 @@ L: linux-kernel@vger.kernel.org
874W: http://miguelojeda.es/auxdisplay.htm 1002W: http://miguelojeda.es/auxdisplay.htm
875W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1003W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
876S: Maintained 1004S: Maintained
1005F: drivers/auxdisplay/
1006F: include/linux/cfag12864b.h
877 1007
878AVR32 ARCHITECTURE 1008AVR32 ARCHITECTURE
879P: Haavard Skinnemoen 1009P: Haavard Skinnemoen
@@ -882,11 +1012,13 @@ W: http://www.atmel.com/products/AVR32/
882W: http://avr32linux.org/ 1012W: http://avr32linux.org/
883W: http://avrfreaks.net/ 1013W: http://avrfreaks.net/
884S: Supported 1014S: Supported
1015F: arch/avr32/
885 1016
886AVR32/AT32AP MACHINE SUPPORT 1017AVR32/AT32AP MACHINE SUPPORT
887P: Haavard Skinnemoen 1018P: Haavard Skinnemoen
888M: hskinnemoen@atmel.com 1019M: hskinnemoen@atmel.com
889S: Supported 1020S: Supported
1021F: arch/avr32/mach-at32ap/
890 1022
891AX.25 NETWORK LAYER 1023AX.25 NETWORK LAYER
892P: Ralf Baechle 1024P: Ralf Baechle
@@ -894,6 +1026,9 @@ M: ralf@linux-mips.org
894L: linux-hams@vger.kernel.org 1026L: linux-hams@vger.kernel.org
895W: http://www.linux-ax25.org/ 1027W: http://www.linux-ax25.org/
896S: Maintained 1028S: Maintained
1029F: include/linux/ax25.h
1030F: include/net/ax25.h
1031F: net/ax25/
897 1032
898B43 WIRELESS DRIVER 1033B43 WIRELESS DRIVER
899P: Michael Buesch 1034P: Michael Buesch
@@ -903,6 +1038,7 @@ M: stefano.brivio@polimi.it
903L: linux-wireless@vger.kernel.org 1038L: linux-wireless@vger.kernel.org
904W: http://linuxwireless.org/en/users/Drivers/b43 1039W: http://linuxwireless.org/en/users/Drivers/b43
905S: Maintained 1040S: Maintained
1041F: drivers/net/wireless/b43/
906 1042
907B43LEGACY WIRELESS DRIVER 1043B43LEGACY WIRELESS DRIVER
908P: Larry Finger 1044P: Larry Finger
@@ -912,11 +1048,14 @@ M: stefano.brivio@polimi.it
912L: linux-wireless@vger.kernel.org 1048L: linux-wireless@vger.kernel.org
913W: http://linuxwireless.org/en/users/Drivers/b43 1049W: http://linuxwireless.org/en/users/Drivers/b43
914S: Maintained 1050S: Maintained
1051F: drivers/net/wireless/b43legacy/
915 1052
916BACKLIGHT CLASS/SUBSYSTEM 1053BACKLIGHT CLASS/SUBSYSTEM
917P: Richard Purdie 1054P: Richard Purdie
918M: rpurdie@rpsys.net 1055M: rpurdie@rpsys.net
919S: Maintained 1056S: Maintained
1057F: drivers/video/backlight/
1058F: include/linux/backlight.h
920 1059
921BAYCOM/HDLCDRV DRIVERS FOR AX.25 1060BAYCOM/HDLCDRV DRIVERS FOR AX.25
922P: Thomas Sailer 1061P: Thomas Sailer
@@ -924,18 +1063,24 @@ M: t.sailer@alumni.ethz.ch
924L: linux-hams@vger.kernel.org 1063L: linux-hams@vger.kernel.org
925W: http://www.baycom.org/~tom/ham/ham.html 1064W: http://www.baycom.org/~tom/ham/ham.html
926S: Maintained 1065S: Maintained
1066F: drivers/net/hamradio/baycom*
927 1067
928BEFS FILE SYSTEM 1068BEFS FILE SYSTEM
929P: Sergey S. Kostyliov 1069P: Sergey S. Kostyliov
930M: rathamahata@php4.ru 1070M: rathamahata@php4.ru
931L: linux-kernel@vger.kernel.org 1071L: linux-kernel@vger.kernel.org
932S: Maintained 1072S: Maintained
1073F: Documentation/filesystems/befs.txt
1074F: fs/befs/
933 1075
934BFS FILE SYSTEM 1076BFS FILE SYSTEM
935P: Tigran A. Aivazian 1077P: Tigran A. Aivazian
936M: tigran@aivazian.fsnet.co.uk 1078M: tigran@aivazian.fsnet.co.uk
937L: linux-kernel@vger.kernel.org 1079L: linux-kernel@vger.kernel.org
938S: Maintained 1080S: Maintained
1081F: Documentation/filesystems/bfs.txt
1082F: fs/bfs/
1083F: include/linux/bfs_fs.h
939 1084
940BLACKFIN ARCHITECTURE 1085BLACKFIN ARCHITECTURE
941P: Bryan Wu 1086P: Bryan Wu
@@ -943,6 +1088,7 @@ M: cooloney@kernel.org
943L: uclinux-dist-devel@blackfin.uclinux.org 1088L: uclinux-dist-devel@blackfin.uclinux.org
944W: http://blackfin.uclinux.org 1089W: http://blackfin.uclinux.org
945S: Supported 1090S: Supported
1091F: arch/blackfin/
946 1092
947BLACKFIN EMAC DRIVER 1093BLACKFIN EMAC DRIVER
948P: Bryan Wu 1094P: Bryan Wu
@@ -950,6 +1096,7 @@ M: cooloney@kernel.org
950L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1096L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
951W: http://blackfin.uclinux.org 1097W: http://blackfin.uclinux.org
952S: Supported 1098S: Supported
1099F: drivers/net/bfin_mac.*
953 1100
954BLACKFIN RTC DRIVER 1101BLACKFIN RTC DRIVER
955P: Mike Frysinger 1102P: Mike Frysinger
@@ -957,6 +1104,7 @@ M: vapier.adi@gmail.com
957L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1104L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
958W: http://blackfin.uclinux.org 1105W: http://blackfin.uclinux.org
959S: Supported 1106S: Supported
1107F: drivers/rtc/rtc-bfin.c
960 1108
961BLACKFIN SERIAL DRIVER 1109BLACKFIN SERIAL DRIVER
962P: Sonic Zhang 1110P: Sonic Zhang
@@ -964,6 +1112,7 @@ M: sonic.zhang@analog.com
964L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1112L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
965W: http://blackfin.uclinux.org 1113W: http://blackfin.uclinux.org
966S: Supported 1114S: Supported
1115F: drivers/serial/bfin_5xx.c
967 1116
968BLACKFIN WATCHDOG DRIVER 1117BLACKFIN WATCHDOG DRIVER
969P: Mike Frysinger 1118P: Mike Frysinger
@@ -971,6 +1120,7 @@ M: vapier.adi@gmail.com
971L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1120L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
972W: http://blackfin.uclinux.org 1121W: http://blackfin.uclinux.org
973S: Supported 1122S: Supported
1123F: drivers/watchdog/bfin_wdt.c
974 1124
975BLACKFIN I2C TWI DRIVER 1125BLACKFIN I2C TWI DRIVER
976P: Sonic Zhang 1126P: Sonic Zhang
@@ -978,19 +1128,22 @@ M: sonic.zhang@analog.com
978L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only) 1128L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
979W: http://blackfin.uclinux.org/ 1129W: http://blackfin.uclinux.org/
980S: Supported 1130S: Supported
1131F: drivers/i2c/busses/i2c-bfin-twi.c
981 1132
982BLOCK LAYER 1133BLOCK LAYER
983P: Jens Axboe 1134P: Jens Axboe
984M: axboe@kernel.dk 1135M: axboe@kernel.dk
985L: linux-kernel@vger.kernel.org 1136L: linux-kernel@vger.kernel.org
986T: git kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git 1137T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
987S: Maintained 1138S: Maintained
1139F: block/
988 1140
989BLOCK2MTD DRIVER 1141BLOCK2MTD DRIVER
990P: Joern Engel 1142P: Joern Engel
991M: joern@lazybastard.org 1143M: joern@lazybastard.org
992L: linux-mtd@lists.infradead.org 1144L: linux-mtd@lists.infradead.org
993S: Maintained 1145S: Maintained
1146F: drivers/mtd/devices/block2mtd.c
994 1147
995BLUETOOTH DRIVERS 1148BLUETOOTH DRIVERS
996P: Marcel Holtmann 1149P: Marcel Holtmann
@@ -998,14 +1151,17 @@ M: marcel@holtmann.org
998L: linux-bluetooth@vger.kernel.org 1151L: linux-bluetooth@vger.kernel.org
999W: http://www.bluez.org/ 1152W: http://www.bluez.org/
1000S: Maintained 1153S: Maintained
1154F: drivers/bluetooth/
1001 1155
1002BLUETOOTH SUBSYSTEM 1156BLUETOOTH SUBSYSTEM
1003P: Marcel Holtmann 1157P: Marcel Holtmann
1004M: marcel@holtmann.org 1158M: marcel@holtmann.org
1005L: linux-bluetooth@vger.kernel.org 1159L: linux-bluetooth@vger.kernel.org
1006W: http://www.bluez.org/ 1160W: http://www.bluez.org/
1007T: git kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git 1161T: git git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
1008S: Maintained 1162S: Maintained
1163F: net/bluetooth/
1164F: include/net/bluetooth/
1009 1165
1010BONDING DRIVER 1166BONDING DRIVER
1011P: Jay Vosburgh 1167P: Jay Vosburgh
@@ -1013,24 +1169,30 @@ M: fubar@us.ibm.com
1013L: bonding-devel@lists.sourceforge.net 1169L: bonding-devel@lists.sourceforge.net
1014W: http://sourceforge.net/projects/bonding/ 1170W: http://sourceforge.net/projects/bonding/
1015S: Supported 1171S: Supported
1172F: drivers/net/bonding/
1173F: include/linux/if_bonding.h
1016 1174
1017BROADCOM B44 10/100 ETHERNET DRIVER 1175BROADCOM B44 10/100 ETHERNET DRIVER
1018P: Gary Zambrano 1176P: Gary Zambrano
1019M: zambrano@broadcom.com 1177M: zambrano@broadcom.com
1020L: netdev@vger.kernel.org 1178L: netdev@vger.kernel.org
1021S: Supported 1179S: Supported
1180F: drivers/net/b44.*
1022 1181
1023BROADCOM BNX2 GIGABIT ETHERNET DRIVER 1182BROADCOM BNX2 GIGABIT ETHERNET DRIVER
1024P: Michael Chan 1183P: Michael Chan
1025M: mchan@broadcom.com 1184M: mchan@broadcom.com
1026L: netdev@vger.kernel.org 1185L: netdev@vger.kernel.org
1027S: Supported 1186S: Supported
1187F: drivers/net/bnx2.*
1188F: drivers/net/bnx2_*
1028 1189
1029BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER 1190BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
1030P: Eilon Greenstein 1191P: Eilon Greenstein
1031M: eilong@broadcom.com 1192M: eilong@broadcom.com
1032L: netdev@vger.kernel.org 1193L: netdev@vger.kernel.org
1033S: Supported 1194S: Supported
1195F: drivers/net/bnx2x*
1034 1196
1035BROADCOM TG3 GIGABIT ETHERNET DRIVER 1197BROADCOM TG3 GIGABIT ETHERNET DRIVER
1036P: Matt Carlson 1198P: Matt Carlson
@@ -1039,41 +1201,51 @@ P: Michael Chan
1039M: mchan@broadcom.com 1201M: mchan@broadcom.com
1040L: netdev@vger.kernel.org 1202L: netdev@vger.kernel.org
1041S: Supported 1203S: Supported
1204F: drivers/net/tg3.*
1042 1205
1043BSG (block layer generic sg v4 driver) 1206BSG (block layer generic sg v4 driver)
1044P: FUJITA Tomonori 1207P: FUJITA Tomonori
1045M: fujita.tomonori@lab.ntt.co.jp 1208M: fujita.tomonori@lab.ntt.co.jp
1046L: linux-scsi@vger.kernel.org 1209L: linux-scsi@vger.kernel.org
1047S: Supported 1210S: Supported
1211F: block/bsg.c
1212F: include/linux/bsg.h
1048 1213
1049BT8XXGPIO DRIVER 1214BT8XXGPIO DRIVER
1050P: Michael Buesch 1215P: Michael Buesch
1051M: mb@bu3sch.de 1216M: mb@bu3sch.de
1052W: http://bu3sch.de/btgpio.php 1217W: http://bu3sch.de/btgpio.php
1053S: Maintained 1218S: Maintained
1219F: drivers/gpio/bt8xxgpio.c
1054 1220
1055BTRFS FILE SYSTEM 1221BTRFS FILE SYSTEM
1056P: Chris Mason 1222P: Chris Mason
1057M: chris.mason@oracle.com 1223M: chris.mason@oracle.com
1058L: linux-btrfs@vger.kernel.org 1224L: linux-btrfs@vger.kernel.org
1059W: http://btrfs.wiki.kernel.org/ 1225W: http://btrfs.wiki.kernel.org/
1060T: git kernel.org:/pub/scm/linux/kernel/git/mason/btrfs-unstable.git 1226T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
1061S: Maintained 1227S: Maintained
1228F: Documentation/filesystems/btrfs.txt
1229F: fs/btrfs/
1062 1230
1063BTTV VIDEO4LINUX DRIVER 1231BTTV VIDEO4LINUX DRIVER
1064P: Mauro Carvalho Chehab 1232P: Mauro Carvalho Chehab
1065M: mchehab@infradead.org 1233M: mchehab@infradead.org
1066L: linux-media@vger.kernel.org 1234L: linux-media@vger.kernel.org
1067W: http://linuxtv.org 1235W: http://linuxtv.org
1068T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1236T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1069S: Maintained 1237S: Maintained
1238F: Documentation/video4linux/bttv/
1239F: drivers/media/video/bt8xx/bttv*
1070 1240
1071CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER 1241CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER
1072P: Jonathan Corbet 1242P: Jonathan Corbet
1073M: corbet@lwn.net 1243M: corbet@lwn.net
1074L: linux-media@vger.kernel.org 1244L: linux-media@vger.kernel.org
1075T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1245T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1076S: Maintained 1246S: Maintained
1247F: Documentation/video4linux/cafe_ccic
1248F: drivers/media/video/cafe_ccic*
1077 1249
1078CALGARY x86-64 IOMMU 1250CALGARY x86-64 IOMMU
1079P: Muli Ben-Yehuda 1251P: Muli Ben-Yehuda
@@ -1083,6 +1255,10 @@ M: jdmason@kudzu.us
1083L: linux-kernel@vger.kernel.org 1255L: linux-kernel@vger.kernel.org
1084L: discuss@x86-64.org 1256L: discuss@x86-64.org
1085S: Maintained 1257S: Maintained
1258F: arch/x86/kernel/pci-calgary_64.c
1259F: arch/x86/kernel/tce_64.c
1260F: arch/x86/include/asm/calgary.h
1261F: arch/x86/include/asm/tce.h
1086 1262
1087CAN NETWORK LAYER 1263CAN NETWORK LAYER
1088P: Urs Thuermann 1264P: Urs Thuermann
@@ -1092,6 +1268,9 @@ M: oliver.hartkopp@volkswagen.de
1092L: socketcan-core@lists.berlios.de (subscribers-only) 1268L: socketcan-core@lists.berlios.de (subscribers-only)
1093W: http://developer.berlios.de/projects/socketcan/ 1269W: http://developer.berlios.de/projects/socketcan/
1094S: Maintained 1270S: Maintained
1271F: drivers/net/can/
1272F: include/linux/can/
1273F: include/linux/can.h
1095 1274
1096CELL BROADBAND ENGINE ARCHITECTURE 1275CELL BROADBAND ENGINE ARCHITECTURE
1097P: Arnd Bergmann 1276P: Arnd Bergmann
@@ -1100,12 +1279,23 @@ L: linuxppc-dev@ozlabs.org
1100L: cbe-oss-dev@ozlabs.org 1279L: cbe-oss-dev@ozlabs.org
1101W: http://www.ibm.com/developerworks/power/cell/ 1280W: http://www.ibm.com/developerworks/power/cell/
1102S: Supported 1281S: Supported
1282F: arch/powerpc/include/asm/cell*.h
1283F: arch/powerpc/include/asm/lv1call.h
1284F: arch/powerpc/include/asm/ps3*.h
1285F: arch/powerpc/include/asm/spu*.h
1286F: arch/powerpc/oprofile/*cell*
1287F: arch/powerpc/platforms/cell/
1288F: arch/powerpc/platforms/ps3/
1103 1289
1104CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM: 1290CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
1105P: David Vrabel 1291P: David Vrabel
1106M: david.vrabel@csr.com 1292M: david.vrabel@csr.com
1107L: linux-usb@vger.kernel.org 1293L: linux-usb@vger.kernel.org
1108S: Supported 1294S: Supported
1295F: Documentation/usb/WUSB-Design-overview.txt
1296F: Documentation/usb/wusb-cbaf
1297F: drivers/usb/wusbcore/
1298F: include/linux/usb/wusb*
1109 1299
1110CFAG12864B LCD DRIVER 1300CFAG12864B LCD DRIVER
1111P: Miguel Ojeda Sandonis 1301P: Miguel Ojeda Sandonis
@@ -1114,6 +1304,8 @@ L: linux-kernel@vger.kernel.org
1114W: http://miguelojeda.es/auxdisplay.htm 1304W: http://miguelojeda.es/auxdisplay.htm
1115W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1305W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1116S: Maintained 1306S: Maintained
1307F: drivers/auxdisplay/cfag12864b.c
1308F: include/linux/cfag12864b.h
1117 1309
1118CFAG12864BFB LCD FRAMEBUFFER DRIVER 1310CFAG12864BFB LCD FRAMEBUFFER DRIVER
1119P: Miguel Ojeda Sandonis 1311P: Miguel Ojeda Sandonis
@@ -1122,18 +1314,25 @@ L: linux-kernel@vger.kernel.org
1122W: http://miguelojeda.es/auxdisplay.htm 1314W: http://miguelojeda.es/auxdisplay.htm
1123W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 1315W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
1124S: Maintained 1316S: Maintained
1317F: drivers/auxdisplay/cfag12864bfb.c
1318F: include/linux/cfag12864b.h
1125 1319
1126CFG80211 and NL80211 1320CFG80211 and NL80211
1127P: Johannes Berg 1321P: Johannes Berg
1128M: johannes@sipsolutions.net 1322M: johannes@sipsolutions.net
1129L: linux-wireless@vger.kernel.org 1323L: linux-wireless@vger.kernel.org
1130S: Maintained 1324S: Maintained
1325F: include/linux/nl80211.h
1326F: include/net/cfg80211.h
1327F: net/wireless/*
1328X: net/wireless/wext*
1131 1329
1132CHECKPATCH 1330CHECKPATCH
1133P: Andy Whitcroft 1331P: Andy Whitcroft
1134M: apw@canonical.com 1332M: apw@canonical.com
1135L: linux-kernel@vger.kernel.org 1333L: linux-kernel@vger.kernel.org
1136S: Supported 1334S: Supported
1335F: scripts/checkpatch.pl
1137 1336
1138CISCO 10G ETHERNET DRIVER 1337CISCO 10G ETHERNET DRIVER
1139P: Scott Feldman 1338P: Scott Feldman
@@ -1141,24 +1340,28 @@ M: scofeldm@cisco.com
1141P: Joe Eykholt 1340P: Joe Eykholt
1142M: jeykholt@cisco.com 1341M: jeykholt@cisco.com
1143S: Supported 1342S: Supported
1343F: drivers/net/enic/
1144 1344
1145CIRRUS LOGIC EP93XX ETHERNET DRIVER 1345CIRRUS LOGIC EP93XX ETHERNET DRIVER
1146P: Lennert Buytenhek 1346P: Lennert Buytenhek
1147M: kernel@wantstofly.org 1347M: kernel@wantstofly.org
1148L: netdev@vger.kernel.org 1348L: netdev@vger.kernel.org
1149S: Maintained 1349S: Maintained
1350F: drivers/net/arm/ep93xx_eth.c
1150 1351
1151CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER 1352CIRRUS LOGIC EP93XX OHCI USB HOST DRIVER
1152P: Lennert Buytenhek 1353P: Lennert Buytenhek
1153M: kernel@wantstofly.org 1354M: kernel@wantstofly.org
1154L: linux-usb@vger.kernel.org 1355L: linux-usb@vger.kernel.org
1155S: Maintained 1356S: Maintained
1357F: drivers/usb/host/ohci-ep93xx.c
1156 1358
1157CIRRUS LOGIC CS4270 SOUND DRIVER 1359CIRRUS LOGIC CS4270 SOUND DRIVER
1158P: Timur Tabi 1360P: Timur Tabi
1159M: timur@freescale.com 1361M: timur@freescale.com
1160L: alsa-devel@alsa-project.org 1362L: alsa-devel@alsa-project.org
1161S: Supported 1363S: Supported
1364F: sound/soc/codecs/cs4270*
1162 1365
1163CIRRUS LOGIC CS4280/CS461x SOUNDDRIVER 1366CIRRUS LOGIC CS4280/CS461x SOUNDDRIVER
1164P: Cirrus Logic Corporation (kernel 2.2 driver) 1367P: Cirrus Logic Corporation (kernel 2.2 driver)
@@ -1166,6 +1369,8 @@ M: Cirrus Logic Corporation, Thomas Woller <twoller@crystal.cirrus.com>
1166P: Nils Faerber (port to kernel 2.4) 1369P: Nils Faerber (port to kernel 2.4)
1167M: Nils Faerber <nils@kernelconcepts.de> 1370M: Nils Faerber <nils@kernelconcepts.de>
1168S: Maintained 1371S: Maintained
1372F: Documentation/input/cs461x.txt
1373F: sound/pci/cs46xx/
1169 1374
1170CODA FILE SYSTEM 1375CODA FILE SYSTEM
1171P: Jan Harkes 1376P: Jan Harkes
@@ -1174,6 +1379,9 @@ M: coda@cs.cmu.edu
1174L: codalist@coda.cs.cmu.edu 1379L: codalist@coda.cs.cmu.edu
1175W: http://www.coda.cs.cmu.edu/ 1380W: http://www.coda.cs.cmu.edu/
1176S: Maintained 1381S: Maintained
1382F: Documentation/filesystems/coda.txt
1383F: fs/coda/
1384F: include/linux/coda*.h
1177 1385
1178COMMON INTERNET FILE SYSTEM (CIFS) 1386COMMON INTERNET FILE SYSTEM (CIFS)
1179P: Steve French 1387P: Steve French
@@ -1181,8 +1389,10 @@ M: sfrench@samba.org
1181L: linux-cifs-client@lists.samba.org 1389L: linux-cifs-client@lists.samba.org
1182L: samba-technical@lists.samba.org 1390L: samba-technical@lists.samba.org
1183W: http://linux-cifs.samba.org/ 1391W: http://linux-cifs.samba.org/
1184T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git 1392T: git git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
1185S: Supported 1393S: Supported
1394F: Documentation/filesystems/cifs.txt
1395F: fs/cifs/
1186 1396
1187COMPACTPCI HOTPLUG CORE 1397COMPACTPCI HOTPLUG CORE
1188P: Scott Murray 1398P: Scott Murray
@@ -1190,6 +1400,7 @@ M: scottm@somanetworks.com
1190M: scott@spiteful.org 1400M: scott@spiteful.org
1191L: linux-pci@vger.kernel.org 1401L: linux-pci@vger.kernel.org
1192S: Supported 1402S: Supported
1403F: drivers/pci/hotplug/cpci_hotplug*
1193 1404
1194COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER 1405COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER
1195P: Scott Murray 1406P: Scott Murray
@@ -1197,6 +1408,7 @@ M: scottm@somanetworks.com
1197M: scott@spiteful.org 1408M: scott@spiteful.org
1198L: linux-pci@vger.kernel.org 1409L: linux-pci@vger.kernel.org
1199S: Supported 1410S: Supported
1411F: drivers/pci/hotplug/cpcihp_zt5550.*
1200 1412
1201COMPACTPCI HOTPLUG GENERIC DRIVER 1413COMPACTPCI HOTPLUG GENERIC DRIVER
1202P: Scott Murray 1414P: Scott Murray
@@ -1204,17 +1416,21 @@ M: scottm@somanetworks.com
1204M: scott@spiteful.org 1416M: scott@spiteful.org
1205L: linux-pci@vger.kernel.org 1417L: linux-pci@vger.kernel.org
1206S: Supported 1418S: Supported
1419F: drivers/pci/hotplug/cpcihp_generic.c
1207 1420
1208COMPAL LAPTOP SUPPORT 1421COMPAL LAPTOP SUPPORT
1209P: Cezary Jackiewicz 1422P: Cezary Jackiewicz
1210M: cezary.jackiewicz@gmail.com 1423M: cezary.jackiewicz@gmail.com
1211S: Maintained 1424S: Maintained
1425F: drivers/platform/x86/compal-laptop.c
1212 1426
1213COMPUTONE INTELLIPORT MULTIPORT CARD 1427COMPUTONE INTELLIPORT MULTIPORT CARD
1214P: Michael H. Warfield 1428P: Michael H. Warfield
1215M: mhw@wittsend.com 1429M: mhw@wittsend.com
1216W: http://www.wittsend.com/computone.html 1430W: http://www.wittsend.com/computone.html
1217S: Maintained 1431S: Maintained
1432F: Documentation/serial/computone.txt
1433F: drivers/char/ip2/
1218 1434
1219CONEXANT ACCESSRUNNER USB DRIVER 1435CONEXANT ACCESSRUNNER USB DRIVER
1220P: Simon Arlott 1436P: Simon Arlott
@@ -1222,12 +1438,15 @@ M: cxacru@fire.lp0.eu
1222L: accessrunner-general@lists.sourceforge.net 1438L: accessrunner-general@lists.sourceforge.net
1223W: http://accessrunner.sourceforge.net/ 1439W: http://accessrunner.sourceforge.net/
1224S: Maintained 1440S: Maintained
1441F: drivers/usb/atm/cxacru.c
1225 1442
1226CONFIGFS 1443CONFIGFS
1227P: Joel Becker 1444P: Joel Becker
1228M: joel.becker@oracle.com 1445M: joel.becker@oracle.com
1229L: linux-kernel@vger.kernel.org 1446L: linux-kernel@vger.kernel.org
1230S: Supported 1447S: Supported
1448F: fs/configfs/
1449F: include/linux/configfs.h
1231 1450
1232CONTROL GROUPS (CGROUPS) 1451CONTROL GROUPS (CGROUPS)
1233P: Paul Menage 1452P: Paul Menage
@@ -1236,31 +1455,41 @@ P: Li Zefan
1236M: lizf@cn.fujitsu.com 1455M: lizf@cn.fujitsu.com
1237L: containers@lists.linux-foundation.org 1456L: containers@lists.linux-foundation.org
1238S: Maintained 1457S: Maintained
1458F: include/linux/cgroup*
1459F: kernel/cgroup*
1239 1460
1240CORETEMP HARDWARE MONITORING DRIVER 1461CORETEMP HARDWARE MONITORING DRIVER
1241P: Rudolf Marek 1462P: Rudolf Marek
1242M: r.marek@assembler.cz 1463M: r.marek@assembler.cz
1243L: lm-sensors@lm-sensors.org 1464L: lm-sensors@lm-sensors.org
1244S: Maintained 1465S: Maintained
1466F: Documentation/hwmon/coretemp
1467F: drivers/hwmon/coretemp.c
1245 1468
1246COSA/SRP SYNC SERIAL DRIVER 1469COSA/SRP SYNC SERIAL DRIVER
1247P: Jan "Yenya" Kasprzak 1470P: Jan "Yenya" Kasprzak
1248M: kas@fi.muni.cz 1471M: kas@fi.muni.cz
1249W: http://www.fi.muni.cz/~kas/cosa/ 1472W: http://www.fi.muni.cz/~kas/cosa/
1250S: Maintained 1473S: Maintained
1474F: drivers/net/wan/cosa*
1251 1475
1252CPU FREQUENCY DRIVERS 1476CPU FREQUENCY DRIVERS
1253P: Dave Jones 1477P: Dave Jones
1254M: davej@redhat.com 1478M: davej@redhat.com
1255L: cpufreq@vger.kernel.org 1479L: cpufreq@vger.kernel.org
1256W: http://www.codemonkey.org.uk/projects/cpufreq/ 1480W: http://www.codemonkey.org.uk/projects/cpufreq/
1257T: git kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git 1481T: git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git
1258S: Maintained 1482S: Maintained
1483F: arch/x86/kernel/cpu/cpufreq/
1484F: drivers/cpufreq/
1485F: include/linux/cpufreq.h
1259 1486
1260CPUID/MSR DRIVER 1487CPUID/MSR DRIVER
1261P: H. Peter Anvin 1488P: H. Peter Anvin
1262M: hpa@zytor.com 1489M: hpa@zytor.com
1263S: Maintained 1490S: Maintained
1491F: arch/x86/kernel/cpuid.c
1492F: arch/x86/kernel/msr.c
1264 1493
1265CPUSETS 1494CPUSETS
1266P: Paul Menage 1495P: Paul Menage
@@ -1269,10 +1498,15 @@ L: linux-kernel@vger.kernel.org
1269W: http://www.bullopensource.org/cpuset/ 1498W: http://www.bullopensource.org/cpuset/
1270W: http://oss.sgi.com/projects/cpusets/ 1499W: http://oss.sgi.com/projects/cpusets/
1271S: Supported 1500S: Supported
1501F: Documentation/cgroups/cpusets.txt
1502F: include/linux/cpuset.h
1503F: kernel/cpuset.c
1272 1504
1273CRAMFS FILESYSTEM 1505CRAMFS FILESYSTEM
1274W: http://sourceforge.net/projects/cramfs/ 1506W: http://sourceforge.net/projects/cramfs/
1275S: Orphan 1507S: Orphan
1508F: Documentation/filesystems/cramfs.txt
1509F: fs/cramfs/
1276 1510
1277CRIS PORT 1511CRIS PORT
1278P: Mikael Starvik 1512P: Mikael Starvik
@@ -1282,6 +1516,7 @@ M: jesper.nilsson@axis.com
1282L: dev-etrax@axis.com 1516L: dev-etrax@axis.com
1283W: http://developer.axis.com 1517W: http://developer.axis.com
1284S: Maintained 1518S: Maintained
1519F: arch/cris/
1285 1520
1286CRYPTO API 1521CRYPTO API
1287P: Herbert Xu 1522P: Herbert Xu
@@ -1289,8 +1524,13 @@ M: herbert@gondor.apana.org.au
1289P: David S. Miller 1524P: David S. Miller
1290M: davem@davemloft.net 1525M: davem@davemloft.net
1291L: linux-crypto@vger.kernel.org 1526L: linux-crypto@vger.kernel.org
1292T: git kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git 1527T: git git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
1293S: Maintained 1528S: Maintained
1529F: Documentation/crypto/
1530F: arch/*/crypto/
1531F: crypto/
1532F: drivers/crypto/
1533F: include/crypto/
1294 1534
1295CRYPTOGRAPHIC RANDOM NUMBER GENERATOR 1535CRYPTOGRAPHIC RANDOM NUMBER GENERATOR
1296P: Neil Horman 1536P: Neil Horman
@@ -1302,16 +1542,21 @@ CS5535 Audio ALSA driver
1302P: Jaya Kumar 1542P: Jaya Kumar
1303M: jayakumar.alsa@gmail.com 1543M: jayakumar.alsa@gmail.com
1304S: Maintained 1544S: Maintained
1545F: sound/pci/cs5535audio/
1305 1546
1306CX18 VIDEO4LINUX DRIVER 1547CX18 VIDEO4LINUX DRIVER
1307P: Hans Verkuil, Andy Walls 1548P: Hans Verkuil
1308M: hverkuil@xs4all.nl, awalls@radix.net 1549M: hverkuil@xs4all.nl
1550P: Andy Walls
1551M: awalls@radix.net
1309L: ivtv-devel@ivtvdriver.org 1552L: ivtv-devel@ivtvdriver.org
1310L: ivtv-users@ivtvdriver.org 1553L: ivtv-users@ivtvdriver.org
1311L: linux-media@vger.kernel.org 1554L: linux-media@vger.kernel.org
1312T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 1555T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1313W: http://linuxtv.org 1556W: http://linuxtv.org
1314S: Maintained 1557S: Maintained
1558F: Documentation/video4linux/cx18.txt
1559F: drivers/media/video/cx18/
1315 1560
1316CXGB3 ETHERNET DRIVER (CXGB3) 1561CXGB3 ETHERNET DRIVER (CXGB3)
1317P: Divy Le Ray 1562P: Divy Le Ray
@@ -1319,6 +1564,7 @@ M: divy@chelsio.com
1319L: netdev@vger.kernel.org 1564L: netdev@vger.kernel.org
1320W: http://www.chelsio.com 1565W: http://www.chelsio.com
1321S: Supported 1566S: Supported
1567F: drivers/net/cxgb3/
1322 1568
1323CXGB3 IWARP RNIC DRIVER (IW_CXGB3) 1569CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
1324P: Steve Wise 1570P: Steve Wise
@@ -1326,32 +1572,32 @@ M: swise@chelsio.com
1326L: general@lists.openfabrics.org 1572L: general@lists.openfabrics.org
1327W: http://www.openfabrics.org 1573W: http://www.openfabrics.org
1328S: Supported 1574S: Supported
1575F: drivers/infiniband/hw/cxgb3/
1329 1576
1330CYBERPRO FB DRIVER 1577CYBERPRO FB DRIVER
1331P: Russell King 1578P: Russell King
1332M: rmk@arm.linux.org.uk 1579M: rmk@arm.linux.org.uk
1333W: http://www.arm.linux.org.uk/ 1580W: http://www.arm.linux.org.uk/
1334S: Maintained 1581S: Maintained
1335 1582F: drivers/video/cyber2000fb.*
1336CYBLAFB FRAMEBUFFER DRIVER
1337P: Knut Petersen
1338M: Knut_Petersen@t-online.de
1339L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
1340S: Maintained
1341 1583
1342CYCLADES 2X SYNC CARD DRIVER 1584CYCLADES 2X SYNC CARD DRIVER
1343P: Arnaldo Carvalho de Melo 1585P: Arnaldo Carvalho de Melo
1344M: acme@ghostprotocols.net 1586M: acme@ghostprotocols.net
1345W: http://oops.ghostprotocols.net:81/blog 1587W: http://oops.ghostprotocols.net:81/blog
1346S: Maintained 1588S: Maintained
1589F: drivers/net/wan/cycx*
1347 1590
1348CYCLADES ASYNC MUX DRIVER 1591CYCLADES ASYNC MUX DRIVER
1349W: http://www.cyclades.com/ 1592W: http://www.cyclades.com/
1350S: Orphan 1593S: Orphan
1594F: drivers/char/cyclades.c
1595F: include/linux/cyclades.h
1351 1596
1352CYCLADES PC300 DRIVER 1597CYCLADES PC300 DRIVER
1353W: http://www.cyclades.com/ 1598W: http://www.cyclades.com/
1354S: Orphan 1599S: Orphan
1600F: drivers/net/wan/pc300*
1355 1601
1356DAMA SLAVE for AX.25 1602DAMA SLAVE for AX.25
1357P: Joerg Reuter 1603P: Joerg Reuter
@@ -1360,12 +1606,21 @@ W: http://yaina.de/jreuter/
1360W: http://www.qsl.net/dl1bke/ 1606W: http://www.qsl.net/dl1bke/
1361L: linux-hams@vger.kernel.org 1607L: linux-hams@vger.kernel.org
1362S: Maintained 1608S: Maintained
1609F: net/ax25/af_ax25.c
1610F: net/ax25/ax25_dev.c
1611F: net/ax25/ax25_ds_*
1612F: net/ax25/ax25_in.c
1613F: net/ax25/ax25_out.c
1614F: net/ax25/ax25_timer.c
1615F: net/ax25/sysctl_net_ax25.c
1363 1616
1364DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER 1617DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER
1365P: Tobias Ringstrom 1618P: Tobias Ringstrom
1366M: tori@unhappy.mine.nu 1619M: tori@unhappy.mine.nu
1367L: netdev@vger.kernel.org 1620L: netdev@vger.kernel.org
1368S: Maintained 1621S: Maintained
1622F: Documentation/networking/dmfe.txt
1623F: drivers/net/tulip/dmfe.c
1369 1624
1370DC390/AM53C974 SCSI driver 1625DC390/AM53C974 SCSI driver
1371P: Kurt Garloff 1626P: Kurt Garloff
@@ -1374,6 +1629,7 @@ W: http://www.garloff.de/kurt/linux/dc390/
1374P: Guennadi Liakhovetski 1629P: Guennadi Liakhovetski
1375M: g.liakhovetski@gmx.de 1630M: g.liakhovetski@gmx.de
1376S: Maintained 1631S: Maintained
1632F: drivers/scsi/tmscsim.*
1377 1633
1378DC395x SCSI driver 1634DC395x SCSI driver
1379P: Oliver Neukum 1635P: Oliver Neukum
@@ -1386,6 +1642,8 @@ W: http://twibble.org/dist/dc395x/
1386L: dc395x@twibble.org 1642L: dc395x@twibble.org
1387L: http://lists.twibble.org/mailman/listinfo/dc395x/ 1643L: http://lists.twibble.org/mailman/listinfo/dc395x/
1388S: Maintained 1644S: Maintained
1645F: Documentation/scsi/dc395x.txt
1646F: drivers/scsi/dc395x.*
1389 1647
1390DCCP PROTOCOL 1648DCCP PROTOCOL
1391P: Arnaldo Carvalho de Melo 1649P: Arnaldo Carvalho de Melo
@@ -1393,6 +1651,9 @@ M: acme@ghostprotocols.net
1393L: dccp@vger.kernel.org 1651L: dccp@vger.kernel.org
1394W: http://linux-net.osdl.org/index.php/DCCP 1652W: http://linux-net.osdl.org/index.php/DCCP
1395S: Maintained 1653S: Maintained
1654F: include/linux/dccp.h
1655F: include/linux/tfrc.h
1656F: net/dccp/
1396 1657
1397DECnet NETWORK LAYER 1658DECnet NETWORK LAYER
1398P: Christine Caulfield 1659P: Christine Caulfield
@@ -1400,27 +1661,35 @@ M: christine.caulfield@googlemail.com
1400W: http://linux-decnet.sourceforge.net 1661W: http://linux-decnet.sourceforge.net
1401L: linux-decnet-user@lists.sourceforge.net 1662L: linux-decnet-user@lists.sourceforge.net
1402S: Maintained 1663S: Maintained
1664F: Documentation/networking/decnet.txt
1665F: net/decnet/
1403 1666
1404DEFXX FDDI NETWORK DRIVER 1667DEFXX FDDI NETWORK DRIVER
1405P: Maciej W. Rozycki 1668P: Maciej W. Rozycki
1406M: macro@linux-mips.org 1669M: macro@linux-mips.org
1407S: Maintained 1670S: Maintained
1671F: drivers/net/defxx.*
1408 1672
1409DELL LAPTOP DRIVER 1673DELL LAPTOP DRIVER
1410P: Matthew Garrett 1674P: Matthew Garrett
1411M: mjg59@srcf.ucam.org 1675M: mjg59@srcf.ucam.org
1412S: Maintained 1676S: Maintained
1677F: drivers/platform/x86/dell-laptop.c
1413 1678
1414DELL LAPTOP SMM DRIVER 1679DELL LAPTOP SMM DRIVER
1415P: Massimo Dal Zotto 1680P: Massimo Dal Zotto
1416M: dz@debian.org 1681M: dz@debian.org
1417W: http://www.debian.org/~dz/i8k/ 1682W: http://www.debian.org/~dz/i8k/
1418S: Maintained 1683S: Maintained
1684F: drivers/char/i8k.c
1685F: include/linux/i8k.h
1419 1686
1420DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas) 1687DELL SYSTEMS MANAGEMENT BASE DRIVER (dcdbas)
1421P: Doug Warzecha 1688P: Doug Warzecha
1422M: Douglas_Warzecha@dell.com 1689M: Douglas_Warzecha@dell.com
1423S: Maintained 1690S: Maintained
1691F: Documentation/dcdbas.txt
1692F: drivers/firmware/dcdbas.*
1424 1693
1425DELL WMI EXTRAS DRIVER 1694DELL WMI EXTRAS DRIVER
1426P: Matthew Garrett 1695P: Matthew Garrett
@@ -1439,6 +1708,10 @@ P: Alasdair Kergon
1439L: dm-devel@redhat.com 1708L: dm-devel@redhat.com
1440W: http://sources.redhat.com/dm 1709W: http://sources.redhat.com/dm
1441S: Maintained 1710S: Maintained
1711F: Documentation/device-mapper/
1712F: drivers/md/dm*
1713F: include/linux/device-mapper.h
1714F: include/linux/dm-*.h
1442 1715
1443DIGI INTL. EPCA DRIVER 1716DIGI INTL. EPCA DRIVER
1444P: Digi International, Inc 1717P: Digi International, Inc
@@ -1446,12 +1719,18 @@ M: Eng.Linux@digi.com
1446L: Eng.Linux@digi.com 1719L: Eng.Linux@digi.com
1447W: http://www.digi.com 1720W: http://www.digi.com
1448S: Orphan 1721S: Orphan
1722F: Documentation/serial/digiepca.txt
1723F: drivers/char/epca*
1724F: drivers/char/digi*
1449 1725
1450DIRECTORY NOTIFICATION (DNOTIFY) 1726DIRECTORY NOTIFICATION (DNOTIFY)
1451P: Stephen Rothwell 1727P: Stephen Rothwell
1452M: sfr@canb.auug.org.au 1728M: sfr@canb.auug.org.au
1453L: linux-kernel@vger.kernel.org 1729L: linux-kernel@vger.kernel.org
1454S: Supported 1730S: Supported
1731F: Documentation/filesystems/dnotify.txt
1732F: fs/notify/dnotify/
1733F: include/linux/dnotify.h
1455 1734
1456DISK GEOMETRY AND PARTITION HANDLING 1735DISK GEOMETRY AND PARTITION HANDLING
1457P: Andries Brouwer 1736P: Andries Brouwer
@@ -1466,6 +1745,9 @@ P: Jan Kara
1466M: jack@suse.cz 1745M: jack@suse.cz
1467L: linux-kernel@vger.kernel.org 1746L: linux-kernel@vger.kernel.org
1468S: Maintained 1747S: Maintained
1748F: Documentation/filesystems/quota.txt
1749F: fs/quota/
1750F: include/linux/quota*.h
1469 1751
1470DISTRIBUTED LOCK MANAGER (DLM) 1752DISTRIBUTED LOCK MANAGER (DLM)
1471P: Christine Caulfield 1753P: Christine Caulfield
@@ -1474,8 +1756,9 @@ P: David Teigland
1474M: teigland@redhat.com 1756M: teigland@redhat.com
1475L: cluster-devel@redhat.com 1757L: cluster-devel@redhat.com
1476W: http://sources.redhat.com/cluster/ 1758W: http://sources.redhat.com/cluster/
1477T: git kernel.org:/pub/scm/linux/kernel/git/teigland/dlm.git 1759T: git git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm.git
1478S: Supported 1760S: Supported
1761F: fs/dlm/
1479 1762
1480DMA GENERIC OFFLOAD ENGINE SUBSYSTEM 1763DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
1481P: Maciej Sosnowski 1764P: Maciej Sosnowski
@@ -1484,12 +1767,16 @@ P: Dan Williams
1484M: dan.j.williams@intel.com 1767M: dan.j.williams@intel.com
1485L: linux-kernel@vger.kernel.org 1768L: linux-kernel@vger.kernel.org
1486S: Supported 1769S: Supported
1770F: drivers/dma/
1771F: include/linux/dma*
1487 1772
1488DME1737 HARDWARE MONITOR DRIVER 1773DME1737 HARDWARE MONITOR DRIVER
1489P: Juerg Haefliger 1774P: Juerg Haefliger
1490M: juergh@gmail.com 1775M: juergh@gmail.com
1491L: lm-sensors@lm-sensors.org 1776L: lm-sensors@lm-sensors.org
1492S: Maintained 1777S: Maintained
1778F: Documentation/hwmon/dme1737
1779F: drivers/hwmon/dme1737.c
1493 1780
1494DOCBOOK FOR DOCUMENTATION 1781DOCBOOK FOR DOCUMENTATION
1495P: Randy Dunlap 1782P: Randy Dunlap
@@ -1501,18 +1788,22 @@ P: Shaohua Li
1501M: shaohua.li@intel.com 1788M: shaohua.li@intel.com
1502L: linux-acpi@vger.kernel.org 1789L: linux-acpi@vger.kernel.org
1503S: Supported 1790S: Supported
1791F: drivers/acpi/dock.c
1504 1792
1505DOCUMENTATION (/Documentation directory) 1793DOCUMENTATION
1506P: Randy Dunlap 1794P: Randy Dunlap
1507M: rdunlap@xenotime.net 1795M: rdunlap@xenotime.net
1508L: linux-doc@vger.kernel.org 1796L: linux-doc@vger.kernel.org
1509S: Maintained 1797S: Maintained
1798F: Documentation/
1510 1799
1511DOUBLETALK DRIVER 1800DOUBLETALK DRIVER
1512P: James R. Van Zandt 1801P: James R. Van Zandt
1513M: jrv@vanzandt.mv.com 1802M: jrv@vanzandt.mv.com
1514L: blinux-list@redhat.com 1803L: blinux-list@redhat.com
1515S: Maintained 1804S: Maintained
1805F: drivers/char/dtlk.c
1806F: include/linux/dtlk.h
1516 1807
1517DPT_I2O SCSI RAID DRIVER 1808DPT_I2O SCSI RAID DRIVER
1518P: Adaptec OEM Raid Solutions 1809P: Adaptec OEM Raid Solutions
@@ -1520,6 +1811,8 @@ M: aacraid@adaptec.com
1520L: linux-scsi@vger.kernel.org 1811L: linux-scsi@vger.kernel.org
1521W: http://www.adaptec.com/ 1812W: http://www.adaptec.com/
1522S: Maintained 1813S: Maintained
1814F: drivers/scsi/dpt*
1815F: drivers/scsi/dpt/
1523 1816
1524DRIVER CORE, KOBJECTS, AND SYSFS 1817DRIVER CORE, KOBJECTS, AND SYSFS
1525P: Greg Kroah-Hartman 1818P: Greg Kroah-Hartman
@@ -1527,48 +1820,55 @@ M: gregkh@suse.de
1527L: linux-kernel@vger.kernel.org 1820L: linux-kernel@vger.kernel.org
1528T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 1821T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
1529S: Supported 1822S: Supported
1823F: Documentation/kobject.txt
1824F: drivers/base/
1825F: fs/sysfs/
1826F: include/linux/kobj*
1827F: lib/kobj*
1530 1828
1531DRM DRIVERS 1829DRM DRIVERS
1532P: David Airlie 1830P: David Airlie
1533M: airlied@linux.ie 1831M: airlied@linux.ie
1534L: dri-devel@lists.sourceforge.net 1832L: dri-devel@lists.sourceforge.net
1535T: git kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git 1833T: git git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
1536S: Maintained 1834S: Maintained
1835F: drivers/gpu/drm/
1537 1836
1538DSCC4 DRIVER 1837DSCC4 DRIVER
1539P: Francois Romieu 1838P: Francois Romieu
1540M: romieu@fr.zoreil.com 1839M: romieu@fr.zoreil.com
1541L: netdev@vger.kernel.org 1840L: netdev@vger.kernel.org
1542S: Maintained 1841S: Maintained
1543 1842F: drivers/net/wan/dscc4.c
1544DVB SUBSYSTEM AND DRIVERS
1545P: LinuxTV.org Project
1546M: linux-media@vger.kernel.org
1547W: http://linuxtv.org/
1548T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1549S: Maintained
1550 1843
1551DZ DECSTATION DZ11 SERIAL DRIVER 1844DZ DECSTATION DZ11 SERIAL DRIVER
1552P: Maciej W. Rozycki 1845P: Maciej W. Rozycki
1553M: macro@linux-mips.org 1846M: macro@linux-mips.org
1554S: Maintained 1847S: Maintained
1848F: drivers/serial/dz.*
1555 1849
1556EATA-DMA SCSI DRIVER 1850EATA-DMA SCSI DRIVER
1557P: Michael Neuffer 1851P: Michael Neuffer
1558L: linux-eata@i-connect.net, linux-scsi@vger.kernel.org 1852M: mike@i-Connect.Net
1853L: linux-eata@i-connect.net
1854L: linux-scsi@vger.kernel.org
1559S: Maintained 1855S: Maintained
1856F: drivers/scsi/eata*
1560 1857
1561EATA ISA/EISA/PCI SCSI DRIVER 1858EATA ISA/EISA/PCI SCSI DRIVER
1562P: Dario Ballabio 1859P: Dario Ballabio
1563M: ballabio_dario@emc.com 1860M: ballabio_dario@emc.com
1564L: linux-scsi@vger.kernel.org 1861L: linux-scsi@vger.kernel.org
1565S: Maintained 1862S: Maintained
1863F: drivers/scsi/eata.c
1566 1864
1567EATA-PIO SCSI DRIVER 1865EATA-PIO SCSI DRIVER
1568P: Michael Neuffer 1866P: Michael Neuffer
1569M: mike@i-Connect.Net 1867M: mike@i-Connect.Net
1570L: linux-eata@i-connect.net, linux-scsi@vger.kernel.org 1868L: linux-eata@i-connect.net
1869L: linux-scsi@vger.kernel.org
1571S: Maintained 1870S: Maintained
1871F: drivers/scsi/eata_pio.*
1572 1872
1573EBTABLES 1873EBTABLES
1574P: Bart De Schuymer 1874P: Bart De Schuymer
@@ -1577,87 +1877,105 @@ L: ebtables-user@lists.sourceforge.net
1577L: ebtables-devel@lists.sourceforge.net 1877L: ebtables-devel@lists.sourceforge.net
1578W: http://ebtables.sourceforge.net/ 1878W: http://ebtables.sourceforge.net/
1579S: Maintained 1879S: Maintained
1880F: include/linux/netfilter_bridge/ebt_*.h
1881F: net/bridge/netfilter/ebt*.c
1580 1882
1581ECRYPT FILE SYSTEM 1883ECRYPT FILE SYSTEM
1582P: Tyler Hicks, Dustin Kirkland 1884P: Tyler Hicks
1583M: tyhicks@linux.vnet.ibm.com, kirkland@canonical.com 1885M: tyhicks@linux.vnet.ibm.com
1886M: Dustin Kirkland
1887P: kirkland@canonical.com
1584L: ecryptfs-devel@lists.launchpad.net 1888L: ecryptfs-devel@lists.launchpad.net
1585W: https://launchpad.net/ecryptfs 1889W: https://launchpad.net/ecryptfs
1586S: Supported 1890S: Supported
1891F: Documentation/filesystems/ecryptfs.txt
1892F: fs/ecryptfs/
1587 1893
1588EDAC-CORE 1894EDAC-CORE
1589P: Doug Thompson 1895P: Doug Thompson
1590M: dougthompson@xmission.com 1896M: dougthompson@xmission.com
1591L: bluesmoke-devel@lists.sourceforge.net 1897L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1592W: bluesmoke.sourceforge.net 1898W: bluesmoke.sourceforge.net
1593S: Supported 1899S: Supported
1900F: Documentation/edac.txt
1901F: drivers/edac/edac_*
1902F: include/linux/edac.h
1594 1903
1595EDAC-E752X 1904EDAC-E752X
1596P: Mark Gross 1905P: Mark Gross
1597P: Doug Thompson 1906P: Doug Thompson
1598M: mark.gross@intel.com 1907M: mark.gross@intel.com
1599M: dougthompson@xmission.com 1908M: dougthompson@xmission.com
1600L: bluesmoke-devel@lists.sourceforge.net 1909L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1601W: bluesmoke.sourceforge.net 1910W: bluesmoke.sourceforge.net
1602S: Maintained 1911S: Maintained
1912F: drivers/edac/e752x_edac.c
1603 1913
1604EDAC-E7XXX 1914EDAC-E7XXX
1605P: Doug Thompson 1915P: Doug Thompson
1606M: dougthompson@xmission.com 1916M: dougthompson@xmission.com
1607L: bluesmoke-devel@lists.sourceforge.net 1917L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1608W: bluesmoke.sourceforge.net 1918W: bluesmoke.sourceforge.net
1609S: Maintained 1919S: Maintained
1920F: drivers/edac/e7xxx_edac.c
1610 1921
1611EDAC-I82443BXGX 1922EDAC-I82443BXGX
1612P: Tim Small 1923P: Tim Small
1613M: tim@buttersideup.com 1924M: tim@buttersideup.com
1614L: bluesmoke-devel@lists.sourceforge.net 1925L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1615W: bluesmoke.sourceforge.net 1926W: bluesmoke.sourceforge.net
1616S: Maintained 1927S: Maintained
1928F: drivers/edac/i82443bxgx_edac.c
1617 1929
1618EDAC-I3000 1930EDAC-I3000
1619P: Jason Uhlenkott 1931P: Jason Uhlenkott
1620M: juhlenko@akamai.com 1932M: juhlenko@akamai.com
1621L: bluesmoke-devel@lists.sourceforge.net 1933L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1622W: bluesmoke.sourceforge.net 1934W: bluesmoke.sourceforge.net
1623S: Maintained 1935S: Maintained
1936F: drivers/edac/i3000_edac.c
1624 1937
1625EDAC-I5000 1938EDAC-I5000
1626P: Doug Thompson 1939P: Doug Thompson
1627M: dougthompson@xmission.com 1940M: dougthompson@xmission.com
1628L: bluesmoke-devel@lists.sourceforge.net 1941L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1629W: bluesmoke.sourceforge.net 1942W: bluesmoke.sourceforge.net
1630S: Maintained 1943S: Maintained
1944F: drivers/edac/i5000_edac.c
1631 1945
1632EDAC-I5400 1946EDAC-I5400
1633P: Mauro Carvalho Chehab 1947P: Mauro Carvalho Chehab
1634M: mchehab@redhat.com 1948M: mchehab@redhat.com
1635L: bluesmoke-devel@lists.sourceforge.net 1949L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1636W: bluesmoke.sourceforge.net 1950W: bluesmoke.sourceforge.net
1637S: Maintained 1951S: Maintained
1952F: drivers/edac/i5400_edac.c
1638 1953
1639EDAC-I82975X 1954EDAC-I82975X
1640P: Ranganathan Desikan 1955P: Ranganathan Desikan
1641P: Arvind R. 1956P: Arvind R.
1642M: rdesikan@jetzbroadband.com 1957M: rdesikan@jetzbroadband.com
1643M: arvind@acarlab.com 1958M: arvind@acarlab.com
1644L: bluesmoke-devel@lists.sourceforge.net 1959L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1645W: bluesmoke.sourceforge.net 1960W: bluesmoke.sourceforge.net
1646S: Maintained 1961S: Maintained
1962F: drivers/edac/i82975x_edac.c
1647 1963
1648EDAC-PASEMI 1964EDAC-PASEMI
1649P: Egor Martovetsky 1965P: Egor Martovetsky
1650M: egor@pasemi.com 1966M: egor@pasemi.com
1651L: bluesmoke-devel@lists.sourceforge.net 1967L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1652W: bluesmoke.sourceforge.net 1968W: bluesmoke.sourceforge.net
1653S: Maintained 1969S: Maintained
1970F: drivers/edac/pasemi_edac.c
1654 1971
1655EDAC-R82600 1972EDAC-R82600
1656P: Tim Small 1973P: Tim Small
1657M: tim@buttersideup.com 1974M: tim@buttersideup.com
1658L: bluesmoke-devel@lists.sourceforge.net 1975L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
1659W: bluesmoke.sourceforge.net 1976W: bluesmoke.sourceforge.net
1660S: Maintained 1977S: Maintained
1978F: drivers/edac/r82600_edac.c
1661 1979
1662EEEPC LAPTOP EXTRAS DRIVER 1980EEEPC LAPTOP EXTRAS DRIVER
1663P: Corentin Chary 1981P: Corentin Chary
@@ -1665,10 +1983,12 @@ M: corentincj@iksaif.net
1665L: acpi4asus-user@lists.sourceforge.net 1983L: acpi4asus-user@lists.sourceforge.net
1666W: http://sourceforge.net/projects/acpi4asus 1984W: http://sourceforge.net/projects/acpi4asus
1667S: Maintained 1985S: Maintained
1986F: drivers/platform/x86/eeepc-laptop.c
1668 1987
1669EFS FILESYSTEM 1988EFS FILESYSTEM
1670W: http://aeschi.ch.eu.org/efs/ 1989W: http://aeschi.ch.eu.org/efs/
1671S: Orphan 1990S: Orphan
1991F: fs/efs/
1672 1992
1673EHCA (IBM GX bus InfiniBand adapter) DRIVER 1993EHCA (IBM GX bus InfiniBand adapter) DRIVER
1674P: Hoang-Nam Nguyen 1994P: Hoang-Nam Nguyen
@@ -1677,6 +1997,7 @@ P: Christoph Raisch
1677M: raisch@de.ibm.com 1997M: raisch@de.ibm.com
1678L: general@lists.openfabrics.org 1998L: general@lists.openfabrics.org
1679S: Supported 1999S: Supported
2000F: drivers/infiniband/hw/ehca/
1680 2001
1681EMBEDDED LINUX 2002EMBEDDED LINUX
1682P: Paul Gortmaker 2003P: Paul Gortmaker
@@ -1692,22 +2013,29 @@ M: james.smart@emulex.com
1692L: linux-scsi@vger.kernel.org 2013L: linux-scsi@vger.kernel.org
1693W: http://sourceforge.net/projects/lpfcxxxx 2014W: http://sourceforge.net/projects/lpfcxxxx
1694S: Supported 2015S: Supported
2016F: drivers/scsi/lpfc/
1695 2017
1696EPSON 1355 FRAMEBUFFER DRIVER 2018EPSON 1355 FRAMEBUFFER DRIVER
1697P: Christopher Hoover 2019P: Christopher Hoover
1698M: ch@murgatroid.com, ch@hpl.hp.com 2020M: ch@murgatroid.com
2021P: Christopher Hoover
2022M: ch@hpl.hp.com
1699S: Maintained 2023S: Maintained
2024F: drivers/video/epson1355fb.c
1700 2025
1701EPSON S1D13XXX FRAMEBUFFER DRIVER 2026EPSON S1D13XXX FRAMEBUFFER DRIVER
1702P: Kristoffer Ericson 2027P: Kristoffer Ericson
1703M: kristoffer.ericson@gmail.com 2028M: kristoffer.ericson@gmail.com
1704S: Maintained 2029S: Maintained
2030F: drivers/video/s1d13xxxfb.c
2031F: include/video/s1d13xxxfb.h
1705 2032
1706ETHEREXPRESS-16 NETWORK DRIVER 2033ETHEREXPRESS-16 NETWORK DRIVER
1707P: Philip Blundell 2034P: Philip Blundell
1708M: philb@gnu.org 2035M: philb@gnu.org
1709L: netdev@vger.kernel.org 2036L: netdev@vger.kernel.org
1710S: Maintained 2037S: Maintained
2038F: drivers/net/eexpress.*
1711 2039
1712ETHERNET BRIDGE 2040ETHERNET BRIDGE
1713P: Stephen Hemminger 2041P: Stephen Hemminger
@@ -1715,87 +2043,126 @@ M: shemminger@linux-foundation.org
1715L: bridge@lists.linux-foundation.org 2043L: bridge@lists.linux-foundation.org
1716W: http://www.linux-foundation.org/en/Net:Bridge 2044W: http://www.linux-foundation.org/en/Net:Bridge
1717S: Maintained 2045S: Maintained
2046F: include/linux/netfilter_bridge/
2047F: net/bridge/
1718 2048
1719ETHERTEAM 16I DRIVER 2049ETHERTEAM 16I DRIVER
1720P: Mika Kuoppala 2050P: Mika Kuoppala
1721M: miku@iki.fi 2051M: miku@iki.fi
1722S: Maintained 2052S: Maintained
2053F: drivers/net/eth16i.c
1723 2054
1724EXT2 FILE SYSTEM 2055EXT2 FILE SYSTEM
1725L: linux-ext4@vger.kernel.org 2056L: linux-ext4@vger.kernel.org
1726S: Maintained 2057S: Maintained
2058F: Documentation/filesystems/ext2.txt
2059F: fs/ext2/
2060F: include/linux/ext2*
1727 2061
1728EXT3 FILE SYSTEM 2062EXT3 FILE SYSTEM
1729P: Stephen Tweedie, Andrew Morton 2063P: Stephen Tweedie
1730M: sct@redhat.com, akpm@linux-foundation.org, adilger@sun.com 2064M: sct@redhat.com
2065P: Andrew Morton
2066M: akpm@linux-foundation.org
2067P: Andreas Dilger
2068M: adilger@sun.com
1731L: linux-ext4@vger.kernel.org 2069L: linux-ext4@vger.kernel.org
1732S: Maintained 2070S: Maintained
2071F: Documentation/filesystems/ext3.txt
2072F: fs/ext3/
2073F: include/linux/ext3*
1733 2074
1734EXT4 FILE SYSTEM 2075EXT4 FILE SYSTEM
1735P: Theodore Ts'o 2076P: Theodore Ts'o
1736M: tytso@mit.edu, adilger@sun.com 2077M: tytso@mit.edu
2078P: Andreas Dilger
2079M: adilger@sun.com
1737L: linux-ext4@vger.kernel.org 2080L: linux-ext4@vger.kernel.org
1738W: http://ext4.wiki.kernel.org 2081W: http://ext4.wiki.kernel.org
1739S: Maintained 2082S: Maintained
2083F: Documentation/filesystems/ext4.txt
2084F: fs/ext4/
1740 2085
1741F71805F HARDWARE MONITORING DRIVER 2086F71805F HARDWARE MONITORING DRIVER
1742P: Jean Delvare 2087P: Jean Delvare
1743M: khali@linux-fr.org 2088M: khali@linux-fr.org
1744L: lm-sensors@lm-sensors.org 2089L: lm-sensors@lm-sensors.org
1745S: Maintained 2090S: Maintained
2091F: Documentation/hwmon/f71805f
2092F: drivers/hwmon/f71805f.c
1746 2093
1747FARSYNC SYNCHRONOUS DRIVER 2094FARSYNC SYNCHRONOUS DRIVER
1748P: Kevin Curtis 2095P: Kevin Curtis
1749M: kevin.curtis@farsite.co.uk 2096M: kevin.curtis@farsite.co.uk
1750W: http://www.farsite.co.uk/ 2097W: http://www.farsite.co.uk/
1751S: Supported 2098S: Supported
2099F: drivers/net/wan/farsync.*
1752 2100
1753FAULT INJECTION SUPPORT 2101FAULT INJECTION SUPPORT
1754P: Akinobu Mita 2102P: Akinobu Mita
1755M: akinobu.mita@gmail.com 2103M: akinobu.mita@gmail.com
1756S: Supported 2104S: Supported
2105F: Documentation/fault-injection/
2106F: lib/fault-inject.c
1757 2107
1758FILE LOCKING (flock() and fcntl()/lockf()) 2108FILE LOCKING (flock() and fcntl()/lockf())
1759P: Matthew Wilcox 2109P: Matthew Wilcox
1760M: matthew@wil.cx 2110M: matthew@wil.cx
1761L: linux-fsdevel@vger.kernel.org 2111L: linux-fsdevel@vger.kernel.org
1762S: Maintained 2112S: Maintained
2113F: include/linux/fcntl.h
2114F: include/linux/fs.h
2115F: fs/fcntl.c
2116F: fs/locks.c
1763 2117
1764FILESYSTEMS (VFS and infrastructure) 2118FILESYSTEMS (VFS and infrastructure)
1765P: Alexander Viro 2119P: Alexander Viro
1766M: viro@zeniv.linux.org.uk 2120M: viro@zeniv.linux.org.uk
1767L: linux-fsdevel@vger.kernel.org 2121L: linux-fsdevel@vger.kernel.org
1768S: Maintained 2122S: Maintained
2123F: fs/*
1769 2124
1770FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER 2125FINTEK F75375S HARDWARE MONITOR AND FAN CONTROLLER DRIVER
1771P: Riku Voipio 2126P: Riku Voipio
1772M: riku.vipio@iki.fi 2127M: riku.vipio@iki.fi
1773L: lm-sensors@lm-sensors.org 2128L: lm-sensors@lm-sensors.org
1774S: Maintained 2129S: Maintained
2130F: drivers/hwmon/f75375s.c
2131F: include/linux/f75375s.h
1775 2132
1776FIREWIRE SUBSYSTEM (drivers/firewire, <linux/firewire*.h>) 2133FIREWIRE SUBSYSTEM
1777P: Kristian Hoegsberg, Stefan Richter 2134P: Kristian Hoegsberg
1778M: krh@redhat.com, stefanr@s5r6.in-berlin.de 2135M: krh@redhat.com
2136P: Stefan Richter
2137M: stefanr@s5r6.in-berlin.de
1779L: linux1394-devel@lists.sourceforge.net 2138L: linux1394-devel@lists.sourceforge.net
1780W: http://www.linux1394.org/ 2139W: http://www.linux1394.org/
1781T: git kernel.org:/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git 2140T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
1782S: Maintained 2141S: Maintained
2142F: drivers/firewire/
2143F: include/linux/firewire*.h
1783 2144
1784FIRMWARE LOADER (request_firmware) 2145FIRMWARE LOADER (request_firmware)
1785L: linux-kernel@vger.kernel.org 2146L: linux-kernel@vger.kernel.org
1786S: Orphan 2147S: Orphan
2148F: Documentation/firmware_class/
2149F: drivers/base/firmware*.c
2150F: include/linux/firmware.h
1787 2151
1788FPU EMULATOR 2152FPU EMULATOR
1789P: Bill Metzenthen 2153P: Bill Metzenthen
1790M: billm@suburbia.net 2154M: billm@melbpc.org.au
1791W: http://suburbia.net/~billm/floating-point/emulator/ 2155W: http://floatingpoint.sourceforge.net/emulator/index.html
1792S: Maintained 2156S: Maintained
2157F: arch/x86/math-emu/
1793 2158
1794FRAME RELAY DLCI/FRAD (Sangoma drivers too) 2159FRAME RELAY DLCI/FRAD (Sangoma drivers too)
1795P: Mike McLagan 2160P: Mike McLagan
1796M: mike.mclagan@linux.org 2161M: mike.mclagan@linux.org
1797L: netdev@vger.kernel.org 2162L: netdev@vger.kernel.org
1798S: Maintained 2163S: Maintained
2164F: drivers/net/wan/dlci.c
2165F: drivers/net/wan/sdla.c
1799 2166
1800FRAMEBUFFER LAYER 2167FRAMEBUFFER LAYER
1801P: Antonino Daplas 2168P: Antonino Daplas
@@ -1803,6 +2170,9 @@ M: adaplas@gmail.com
1803L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2170L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
1804W: http://linux-fbdev.sourceforge.net/ 2171W: http://linux-fbdev.sourceforge.net/
1805S: Maintained 2172S: Maintained
2173F: Documentation/fb/
2174F: drivers/video/fb*
2175F: include/linux/fb.h
1806 2176
1807FREESCALE DMA DRIVER 2177FREESCALE DMA DRIVER
1808P: Li Yang 2178P: Li Yang
@@ -1812,6 +2182,7 @@ M: zw@zh-kernel.org
1812L: linuxppc-embedded@ozlabs.org 2182L: linuxppc-embedded@ozlabs.org
1813L: linux-kernel@vger.kernel.org 2183L: linux-kernel@vger.kernel.org
1814S: Maintained 2184S: Maintained
2185F: drivers/dma/fsldma.*
1815 2186
1816FREESCALE I2C CPM DRIVER 2187FREESCALE I2C CPM DRIVER
1817P: Jochen Friedrich 2188P: Jochen Friedrich
@@ -1819,6 +2190,7 @@ M: jochen@scram.de
1819L: linuxppc-dev@ozlabs.org 2190L: linuxppc-dev@ozlabs.org
1820L: linux-i2c@vger.kernel.org 2191L: linux-i2c@vger.kernel.org
1821S: Maintained 2192S: Maintained
2193F: drivers/i2c/busses/i2c-cpm.c
1822 2194
1823FREESCALE IMX / MXC FRAMEBUFFER DRIVER 2195FREESCALE IMX / MXC FRAMEBUFFER DRIVER
1824P: Sascha Hauer 2196P: Sascha Hauer
@@ -1826,6 +2198,8 @@ M: kernel@pengutronix.de
1826L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2198L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
1827L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 2199L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
1828S: Maintained 2200S: Maintained
2201F: arch/arm/plat-mxc/include/mach/imxfb.h
2202F: drivers/video/imxfb.c
1829 2203
1830FREESCALE SOC FS_ENET DRIVER 2204FREESCALE SOC FS_ENET DRIVER
1831P: Pantelis Antoniou 2205P: Pantelis Antoniou
@@ -1835,12 +2209,16 @@ M: vbordug@ru.mvista.com
1835L: linuxppc-dev@ozlabs.org 2209L: linuxppc-dev@ozlabs.org
1836L: netdev@vger.kernel.org 2210L: netdev@vger.kernel.org
1837S: Maintained 2211S: Maintained
2212F: drivers/net/fs_enet/
2213F: include/linux/fs_enet_pd.h
1838 2214
1839FREESCALE QUICC ENGINE LIBRARY 2215FREESCALE QUICC ENGINE LIBRARY
1840P: Timur Tabi 2216P: Timur Tabi
1841M: timur@freescale.com 2217M: timur@freescale.com
1842L: linuxppc-dev@ozlabs.org 2218L: linuxppc-dev@ozlabs.org
1843S: Supported 2219S: Supported
2220F: arch/powerpc/sysdev/qe_lib/
2221F: arch/powerpc/include/asm/*qe.h
1844 2222
1845FREESCALE HIGHSPEED USB DEVICE DRIVER 2223FREESCALE HIGHSPEED USB DEVICE DRIVER
1846P: Li Yang 2224P: Li Yang
@@ -1848,6 +2226,7 @@ M: leoli@freescale.com
1848L: linux-usb@vger.kernel.org 2226L: linux-usb@vger.kernel.org
1849L: linuxppc-dev@ozlabs.org 2227L: linuxppc-dev@ozlabs.org
1850S: Maintained 2228S: Maintained
2229F: drivers/usb/gadget/fsl_usb2_udc.c
1851 2230
1852FREESCALE QUICC ENGINE UCC ETHERNET DRIVER 2231FREESCALE QUICC ENGINE UCC ETHERNET DRIVER
1853P: Li Yang 2232P: Li Yang
@@ -1855,12 +2234,14 @@ M: leoli@freescale.com
1855L: netdev@vger.kernel.org 2234L: netdev@vger.kernel.org
1856L: linuxppc-dev@ozlabs.org 2235L: linuxppc-dev@ozlabs.org
1857S: Maintained 2236S: Maintained
2237F: drivers/net/ucc_geth*
1858 2238
1859FREESCALE QUICC ENGINE UCC UART DRIVER 2239FREESCALE QUICC ENGINE UCC UART DRIVER
1860P: Timur Tabi 2240P: Timur Tabi
1861M: timur@freescale.com 2241M: timur@freescale.com
1862L: linuxppc-dev@ozlabs.org 2242L: linuxppc-dev@ozlabs.org
1863S: Supported 2243S: Supported
2244F: drivers/serial/ucc_uart.c
1864 2245
1865FREESCALE SOC SOUND DRIVERS 2246FREESCALE SOC SOUND DRIVERS
1866P: Timur Tabi 2247P: Timur Tabi
@@ -1868,12 +2249,15 @@ M: timur@freescale.com
1868L: alsa-devel@alsa-project.org 2249L: alsa-devel@alsa-project.org
1869L: linuxppc-dev@ozlabs.org 2250L: linuxppc-dev@ozlabs.org
1870S: Supported 2251S: Supported
2252F: sound/soc/fsl/fsl*
2253F: sound/soc/fsl/mpc8610_hpcd.c
1871 2254
1872FREEVXFS FILESYSTEM 2255FREEVXFS FILESYSTEM
1873P: Christoph Hellwig 2256P: Christoph Hellwig
1874M: hch@infradead.org 2257M: hch@infradead.org
1875W: ftp://ftp.openlinux.org/pub/people/hch/vxfs 2258W: ftp://ftp.openlinux.org/pub/people/hch/vxfs
1876S: Maintained 2259S: Maintained
2260F: fs/freevxfs/
1877 2261
1878FREEZER 2262FREEZER
1879P: Pavel Machek 2263P: Pavel Machek
@@ -1882,22 +2266,32 @@ P: Rafael J. Wysocki
1882M: rjw@sisk.pl 2266M: rjw@sisk.pl
1883L: linux-pm@lists.linux-foundation.org 2267L: linux-pm@lists.linux-foundation.org
1884S: Supported 2268S: Supported
2269F: Documentation/power/freezing-of-tasks.txt
2270F: include/linux/freezer.h
2271F: kernel/freezer.c
1885 2272
1886FTRACE 2273FTRACE
1887P: Steven Rostedt 2274P: Steven Rostedt
1888M: rostedt@goodmis.org 2275M: rostedt@goodmis.org
1889S: Maintained 2276S: Maintained
2277F: Documentation/ftrace.txt
2278F: arch/*/*/*/ftrace.h
2279F: arch/*/kernel/ftrace.c
2280F: include/*/ftrace.h
2281F: kernel/trace/
1890 2282
1891FUJITSU FR-V (FRV) PORT 2283FUJITSU FR-V (FRV) PORT
1892P: David Howells 2284P: David Howells
1893M: dhowells@redhat.com 2285M: dhowells@redhat.com
1894S: Maintained 2286S: Maintained
2287F: arch/frv/
1895 2288
1896FUJITSU LAPTOP EXTRAS 2289FUJITSU LAPTOP EXTRAS
1897P: Jonathan Woithe 2290P: Jonathan Woithe
1898M: jwoithe@physics.adelaide.edu.au 2291M: jwoithe@physics.adelaide.edu.au
1899L: linux-acpi@vger.kernel.org 2292L: linux-acpi@vger.kernel.org
1900S: Maintained 2293S: Maintained
2294F: drivers/platform/x86/fujitsu-laptop.c
1901 2295
1902FUSE: FILESYSTEM IN USERSPACE 2296FUSE: FILESYSTEM IN USERSPACE
1903P: Miklos Szeredi 2297P: Miklos Szeredi
@@ -1905,12 +2299,15 @@ M: miklos@szeredi.hu
1905L: fuse-devel@lists.sourceforge.net 2299L: fuse-devel@lists.sourceforge.net
1906W: http://fuse.sourceforge.net/ 2300W: http://fuse.sourceforge.net/
1907S: Maintained 2301S: Maintained
2302F: fs/fuse/
2303F: include/linux/fuse.h
1908 2304
1909FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) 2305FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit)
1910P: Rik Faith 2306P: Rik Faith
1911M: faith@cs.unc.edu 2307M: faith@cs.unc.edu
1912L: linux-scsi@vger.kernel.org 2308L: linux-scsi@vger.kernel.org
1913S: Odd Fixes (e.g., new signatures) 2309S: Odd Fixes (e.g., new signatures)
2310F: drivers/scsi/fdomain.*
1914 2311
1915GDT SCSI DISK ARRAY CONTROLLER DRIVER 2312GDT SCSI DISK ARRAY CONTROLLER DRIVER
1916P: Achim Leubner 2313P: Achim Leubner
@@ -1918,26 +2315,39 @@ M: achim_leubner@adaptec.com
1918L: linux-scsi@vger.kernel.org 2315L: linux-scsi@vger.kernel.org
1919W: http://www.icp-vortex.com/ 2316W: http://www.icp-vortex.com/
1920S: Supported 2317S: Supported
2318F: drivers/scsi/gdt*
1921 2319
1922GENERIC GPIO I2C DRIVER 2320GENERIC GPIO I2C DRIVER
1923P: Haavard Skinnemoen 2321P: Haavard Skinnemoen
1924M: hskinnemoen@atmel.com 2322M: hskinnemoen@atmel.com
1925S: Supported 2323S: Supported
2324F: drivers/i2c/busses/i2c-gpio.c
2325F: include/linux/i2c-gpio.h
1926 2326
1927GENERIC HDLC (WAN) DRIVERS 2327GENERIC HDLC (WAN) DRIVERS
1928P: Krzysztof Halasa 2328P: Krzysztof Halasa
1929M: khc@pm.waw.pl 2329M: khc@pm.waw.pl
1930W: http://www.kernel.org/pub/linux/utils/net/hdlc/ 2330W: http://www.kernel.org/pub/linux/utils/net/hdlc/
1931S: Maintained 2331S: Maintained
2332F: drivers/net/wan/c101.c
2333F: drivers/net/wan/hd6457*
2334F: drivers/net/wan/hdlc*
2335F: drivers/net/wan/n2.c
2336F: drivers/net/wan/pc300too.c
2337F: drivers/net/wan/pci200syn.c
2338F: drivers/net/wan/wanxl*
1932 2339
1933GFS2 FILE SYSTEM 2340GFS2 FILE SYSTEM
1934P: Steven Whitehouse 2341P: Steven Whitehouse
1935M: swhiteho@redhat.com 2342M: swhiteho@redhat.com
1936L: cluster-devel@redhat.com 2343L: cluster-devel@redhat.com
1937W: http://sources.redhat.com/cluster/ 2344W: http://sources.redhat.com/cluster/
1938T: git kernel.org:/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git 2345T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes.git
1939T: git kernel.org:/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw.git 2346T: git git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw.git
1940S: Supported 2347S: Supported
2348F: Documentation/filesystems/gfs2*.txt
2349F: fs/gfs2/
2350F: include/linux/gfs2_ondisk.h
1941 2351
1942GIGASET ISDN DRIVERS 2352GIGASET ISDN DRIVERS
1943P: Hansjoerg Lipp 2353P: Hansjoerg Lipp
@@ -1947,6 +2357,9 @@ M: tilman@imap.cc
1947L: gigaset307x-common@lists.sourceforge.net 2357L: gigaset307x-common@lists.sourceforge.net
1948W: http://gigaset307x.sourceforge.net/ 2358W: http://gigaset307x.sourceforge.net/
1949S: Maintained 2359S: Maintained
2360F: Documentation/isdn/README.gigaset
2361F: drivers/isdn/gigaset/
2362F: include/linux/gigaset_dev.h
1950 2363
1951HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER 2364HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
1952P: Frank Seidel 2365P: Frank Seidel
@@ -1954,6 +2367,7 @@ M: frank@f-seidel.de
1954L: lm-sensors@lm-sensors.org 2367L: lm-sensors@lm-sensors.org
1955W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/ 2368W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
1956S: Maintained 2369S: Maintained
2370F: drivers/hwmon/hdaps.c
1957 2371
1958HYPERVISOR VIRTUAL CONSOLE DRIVER 2372HYPERVISOR VIRTUAL CONSOLE DRIVER
1959L: linuxppc-dev@ozlabs.org 2373L: linuxppc-dev@ozlabs.org
@@ -1965,51 +2379,61 @@ GSPCA FINEPIX SUBDRIVER
1965P: Frank Zago 2379P: Frank Zago
1966M: frank@zago.net 2380M: frank@zago.net
1967L: linux-media@vger.kernel.org 2381L: linux-media@vger.kernel.org
1968T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2382T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1969S: Maintained 2383S: Maintained
2384F: drivers/media/video/gspca/finepix.c
1970 2385
1971GSPCA M5602 SUBDRIVER 2386GSPCA M5602 SUBDRIVER
1972P: Erik Andren 2387P: Erik Andren
1973M: erik.andren@gmail.com 2388M: erik.andren@gmail.com
1974L: linux-media@vger.kernel.org 2389L: linux-media@vger.kernel.org
1975T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2390T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1976S: Maintained 2391S: Maintained
2392F: drivers/media/video/gspca/m5602/
1977 2393
1978GSPCA PAC207 SONIXB SUBDRIVER 2394GSPCA PAC207 SONIXB SUBDRIVER
1979P: Hans de Goede 2395P: Hans de Goede
1980M: hdegoede@redhat.com 2396M: hdegoede@redhat.com
1981L: linux-media@vger.kernel.org 2397L: linux-media@vger.kernel.org
1982T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2398T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1983S: Maintained 2399S: Maintained
2400F: drivers/media/video/gspca/pac207.c
1984 2401
1985GSPCA T613 SUBDRIVER 2402GSPCA T613 SUBDRIVER
1986P: Leandro Costantino 2403P: Leandro Costantino
1987M: lcostantino@gmail.com 2404M: lcostantino@gmail.com
1988L: linux-media@vger.kernel.org 2405L: linux-media@vger.kernel.org
1989T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2406T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1990S: Maintained 2407S: Maintained
2408F: drivers/media/video/gspca/t613.c
1991 2409
1992GSPCA USB WEBCAM DRIVER 2410GSPCA USB WEBCAM DRIVER
1993P: Jean-Francois Moine 2411P: Jean-Francois Moine
1994M: moinejf@free.fr 2412M: moinejf@free.fr
1995W: http://moinejf.free.fr 2413W: http://moinejf.free.fr
1996L: linux-media@vger.kernel.org 2414L: linux-media@vger.kernel.org
1997T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 2415T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
1998S: Maintained 2416S: Maintained
2417F: drivers/media/video/gspca/
1999 2418
2000HARDWARE MONITORING 2419HARDWARE MONITORING
2001L: lm-sensors@lm-sensors.org 2420L: lm-sensors@lm-sensors.org
2002W: http://www.lm-sensors.org/ 2421W: http://www.lm-sensors.org/
2003S: Orphan 2422S: Orphan
2423F: drivers/hwmon/
2004 2424
2005HARDWARE RANDOM NUMBER GENERATOR CORE 2425HARDWARE RANDOM NUMBER GENERATOR CORE
2006S: Orphan 2426S: Orphan
2427F: Documentation/hw_random.txt
2428F: drivers/char/hw_random/
2429F: include/linux/hw_random.h
2007 2430
2008HARMONY SOUND DRIVER 2431HARMONY SOUND DRIVER
2009P: Kyle McMartin 2432P: Kyle McMartin
2010M: kyle@mcmartin.ca 2433M: kyle@mcmartin.ca
2011L: linux-parisc@vger.kernel.org 2434L: linux-parisc@vger.kernel.org
2012S: Maintained 2435S: Maintained
2436F: sound/parisc/harmony.*
2013 2437
2014HAYES ESP SERIAL DRIVER 2438HAYES ESP SERIAL DRIVER
2015P: Andrew J. Robinson 2439P: Andrew J. Robinson
@@ -2017,30 +2441,33 @@ M: arobinso@nyx.net
2017L: linux-kernel@vger.kernel.org 2441L: linux-kernel@vger.kernel.org
2018W: http://www.nyx.net/~arobinso 2442W: http://www.nyx.net/~arobinso
2019S: Maintained 2443S: Maintained
2020 2444F: Documentation/serial/hayes-esp.txt
2021HEWLETT-PACKARD FIBRE CHANNEL 64-bit/66MHz PCI non-intelligent HBA 2445F: drivers/char/esp.c
2022P: Chirag Kantharia
2023M: chirag.kantharia@hp.com
2024L: iss_storagedev@hp.com
2025S: Maintained
2026 2446
2027HEWLETT-PACKARD SMART2 RAID DRIVER 2447HEWLETT-PACKARD SMART2 RAID DRIVER
2028P: Chirag Kantharia 2448P: Chirag Kantharia
2029M: chirag.kantharia@hp.com 2449M: chirag.kantharia@hp.com
2030L: iss_storagedev@hp.com 2450L: iss_storagedev@hp.com
2031S: Maintained 2451S: Maintained
2452F: Documentation/blockdev/cpqarray.txt
2453F: drivers/block/cpqarray.*
2032 2454
2033HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss) 2455HEWLETT-PACKARD SMART CISS RAID DRIVER (cciss)
2034P: Mike Miller 2456P: Mike Miller
2035M: mike.miller@hp.com 2457M: mike.miller@hp.com
2036L: iss_storagedev@hp.com 2458L: iss_storagedev@hp.com
2037S: Supported 2459S: Supported
2460F: Documentation/blockdev/cciss.txt
2461F: drivers/block/cciss*
2462F: include/linux/cciss_ioctl.h
2038 2463
2039HFS FILESYSTEM 2464HFS FILESYSTEM
2040P: Roman Zippel 2465P: Roman Zippel
2041M: zippel@linux-m68k.org 2466M: zippel@linux-m68k.org
2042L: linux-kernel@vger.kernel.org 2467L: linux-kernel@vger.kernel.org
2043S: Maintained 2468S: Maintained
2469F: Documentation/filesystems/hfs.txt
2470F: fs/hfs/
2044 2471
2045HGA FRAMEBUFFER DRIVER 2472HGA FRAMEBUFFER DRIVER
2046P: Ferenc Bakonyi 2473P: Ferenc Bakonyi
@@ -2048,6 +2475,7 @@ M: fero@drama.obuda.kando.hu
2048L: linux-nvidia@lists.surfsouth.com 2475L: linux-nvidia@lists.surfsouth.com
2049W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml 2476W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml
2050S: Maintained 2477S: Maintained
2478F: drivers/video/hgafb.c
2051 2479
2052HIBERNATION (aka Software Suspend, aka swsusp) 2480HIBERNATION (aka Software Suspend, aka swsusp)
2053P: Pavel Machek 2481P: Pavel Machek
@@ -2056,19 +2484,32 @@ P: Rafael J. Wysocki
2056M: rjw@sisk.pl 2484M: rjw@sisk.pl
2057L: linux-pm@lists.linux-foundation.org 2485L: linux-pm@lists.linux-foundation.org
2058S: Supported 2486S: Supported
2487F: arch/x86/power/
2488F: drivers/base/power/
2489F: kernel/power/
2490F: include/linux/suspend.h
2491F: include/linux/freezer.h
2492F: include/linux/pm.h
2493F: include/asm-*/suspend*.h
2494F: arch/*/include/asm/suspend*.h
2059 2495
2060HID CORE LAYER 2496HID CORE LAYER
2061P: Jiri Kosina 2497P: Jiri Kosina
2062M: jkosina@suse.cz 2498M: jkosina@suse.cz
2063L: linux-input@vger.kernel.org 2499L: linux-input@vger.kernel.org
2064T: git kernel.org:/pub/scm/linux/kernel/git/jikos/hid.git 2500T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
2065S: Maintained 2501S: Maintained
2502F: drivers/hid/
2503F: include/linux/hid*
2066 2504
2067HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS 2505HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS
2068P: Thomas Gleixner 2506P: Thomas Gleixner
2069M: tglx@linutronix.de 2507M: tglx@linutronix.de
2070L: linux-kernel@vger.kernel.org 2508L: linux-kernel@vger.kernel.org
2071S: Maintained 2509S: Maintained
2510F: Documentation/timers/
2511F: kernel/hrtimer.c
2512F: include/linux/hrtimer.h
2072 2513
2073HIGH-SPEED SCC DRIVER FOR AX.25 2514HIGH-SPEED SCC DRIVER FOR AX.25
2074P: Klaus Kudielka 2515P: Klaus Kudielka
@@ -2076,18 +2517,25 @@ M: klaus.kudielka@ieee.org
2076L: linux-hams@vger.kernel.org 2517L: linux-hams@vger.kernel.org
2077W: http://www.nt.tuwien.ac.at/~kkudielk/Linux/ 2518W: http://www.nt.tuwien.ac.at/~kkudielk/Linux/
2078S: Maintained 2519S: Maintained
2520F: drivers/net/hamradio/dmascc.c
2521F: drivers/net/hamradio/scc.c
2079 2522
2080HIGHPOINT ROCKETRAID 3xxx RAID DRIVER 2523HIGHPOINT ROCKETRAID 3xxx RAID DRIVER
2081P: HighPoint Linux Team 2524P: HighPoint Linux Team
2082M: linux@highpoint-tech.com 2525M: linux@highpoint-tech.com
2083W: http://www.highpoint-tech.com 2526W: http://www.highpoint-tech.com
2084S: Supported 2527S: Supported
2528F: Documentation/scsi/hptiop.txt
2529F: drivers/scsi/hptiop.c
2085 2530
2086HIPPI 2531HIPPI
2087P: Jes Sorensen 2532P: Jes Sorensen
2088M: jes@trained-monkey.org 2533M: jes@trained-monkey.org
2089L: linux-hippi@sunsite.dk 2534L: linux-hippi@sunsite.dk
2090S: Maintained 2535S: Maintained
2536F: include/linux/hippidevice.h
2537F: include/linux/if_hippi.h
2538F: net/802/hippi.c
2091 2539
2092HOST AP DRIVER 2540HOST AP DRIVER
2093P: Jouni Malinen 2541P: Jouni Malinen
@@ -2096,65 +2544,79 @@ L: hostap@shmoo.com (subscribers-only)
2096L: linux-wireless@vger.kernel.org 2544L: linux-wireless@vger.kernel.org
2097W: http://hostap.epitest.fi/ 2545W: http://hostap.epitest.fi/
2098S: Maintained 2546S: Maintained
2547F: drivers/net/wireless/hostap/
2099 2548
2100HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER 2549HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
2101P: Carlos Corbacho 2550P: Carlos Corbacho
2102M: carlos@strangeworlds.co.uk 2551M: carlos@strangeworlds.co.uk
2103S: Odd Fixes 2552S: Odd Fixes
2553F: drivers/platform/x86/tc1100-wmi.c
2104 2554
2105HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series 2555HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
2106P: Jaroslav Kysela 2556P: Jaroslav Kysela
2107M: perex@perex.cz 2557M: perex@perex.cz
2108S: Maintained 2558S: Maintained
2559F: drivers/net/hp100.*
2109 2560
2110HPET: High Precision Event Timers driver (drivers/char/hpet.c) 2561HPET: High Precision Event Timers driver
2111P: Clemens Ladisch 2562P: Clemens Ladisch
2112M: clemens@ladisch.de 2563M: clemens@ladisch.de
2113S: Maintained 2564S: Maintained
2565F: Documentation/timers/hpet.txt
2566F: drivers/char/hpet.c
2567F: include/linux/hpet.h
2114 2568
2115HPET: i386 2569HPET: i386
2116P: Venkatesh Pallipadi (Venki) 2570P: Venkatesh Pallipadi (Venki)
2117M: venkatesh.pallipadi@intel.com 2571M: venkatesh.pallipadi@intel.com
2118S: Maintained 2572S: Maintained
2573F: arch/x86/kernel/hpet.c
2574F: arch/x86/include/asm/hpet.h
2119 2575
2120HPET: x86_64 2576HPET: x86_64
2121P: Vojtech Pavlik 2577P: Vojtech Pavlik
2122M: vojtech@suse.cz 2578M: vojtech@suse.cz
2123S: Maintained 2579S: Maintained
2124 2580
2125HPET: ACPI hpet.c 2581HPET: ACPI
2126P: Bob Picco 2582P: Bob Picco
2127M: bob.picco@hp.com 2583M: bob.picco@hp.com
2128S: Maintained 2584S: Maintained
2585F: drivers/char/hpet.c
2129 2586
2130HPFS FILESYSTEM 2587HPFS FILESYSTEM
2131P: Mikulas Patocka 2588P: Mikulas Patocka
2132M: mikulas@artax.karlin.mff.cuni.cz 2589M: mikulas@artax.karlin.mff.cuni.cz
2133W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi 2590W: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
2134S: Maintained 2591S: Maintained
2592F: fs/hpfs/
2135 2593
2136HSO 3G Modem Driver (hso.c) 2594HSO 3G MODEM DRIVER
2137P: Denis Joseph Barrow 2595P: Jan Dumon
2138M: d.barow@option.com 2596M: j.dumon@option.com
2139W: http://www.pharscape.org 2597W: http://www.pharscape.org
2140S: Maintained 2598S: Maintained
2599F: drivers/net/usb/hso.c
2141 2600
2142HTCPEN TOUCHSCREEN DRIVER 2601HTCPEN TOUCHSCREEN DRIVER
2143P: Pau Oliva Fora 2602P: Pau Oliva Fora
2144M: pof@eslack.org 2603M: pof@eslack.org
2145L: linux-input@vger.kernel.org 2604L: linux-input@vger.kernel.org
2146S: Maintained 2605S: Maintained
2606F: drivers/input/touchscreen/htcpen.c
2147 2607
2148HUGETLB FILESYSTEM 2608HUGETLB FILESYSTEM
2149P: William Irwin 2609P: William Irwin
2150M: wli@holomorphy.com 2610M: wli@holomorphy.com
2151S: Maintained 2611S: Maintained
2612F: fs/hugetlbfs/
2152 2613
2153I2C/SMBUS STUB DRIVER 2614I2C/SMBUS STUB DRIVER
2154P: Mark M. Hoffman 2615P: Mark M. Hoffman
2155M: mhoffman@lightlink.com 2616M: mhoffman@lightlink.com
2156L: linux-i2c@vger.kernel.org 2617L: linux-i2c@vger.kernel.org
2157S: Maintained 2618S: Maintained
2619F: drivers/i2c/busses/i2c-stub.c
2158 2620
2159I2C SUBSYSTEM 2621I2C SUBSYSTEM
2160P: Jean Delvare (PC drivers, core) 2622P: Jean Delvare (PC drivers, core)
@@ -2165,24 +2627,31 @@ L: linux-i2c@vger.kernel.org
2165W: http://i2c.wiki.kernel.org/ 2627W: http://i2c.wiki.kernel.org/
2166T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/ 2628T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
2167S: Maintained 2629S: Maintained
2630F: Documentation/i2c/
2631F: drivers/i2c/
2632F: include/linux/i2c.h
2633F: include/linux/i2c-dev.h
2634F: include/linux/i2c-id.h
2168 2635
2169I2C-TINY-USB DRIVER 2636I2C-TINY-USB DRIVER
2170P: Till Harbaum 2637P: Till Harbaum
2171M: till@harbaum.org 2638M: till@harbaum.org
2172L: linux-i2c@vger.kernel.org 2639L: linux-i2c@vger.kernel.org
2173T: http://www.harbaum.org/till/i2c_tiny_usb 2640W: http://www.harbaum.org/till/i2c_tiny_usb
2174S: Maintained 2641S: Maintained
2642F: drivers/i2c/busses/i2c-tiny-usb.c
2175 2643
2176i386 BOOT CODE 2644i386 BOOT CODE
2177P: H. Peter Anvin 2645P: H. Peter Anvin
2178M: hpa@zytor.com 2646M: hpa@zytor.com
2179L: Linux-Kernel@vger.kernel.org 2647L: Linux-Kernel@vger.kernel.org
2180S: Maintained 2648S: Maintained
2649F: arch/x86/boot/
2181 2650
2182i386 SETUP CODE / CPU ERRATA WORKAROUNDS 2651i386 SETUP CODE / CPU ERRATA WORKAROUNDS
2183P: H. Peter Anvin 2652P: H. Peter Anvin
2184M: hpa@zytor.com 2653M: hpa@zytor.com
2185T: git.kernel.org:/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git 2654T: git git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git
2186S: Maintained 2655S: Maintained
2187 2656
2188IA64 (Itanium) PLATFORM 2657IA64 (Itanium) PLATFORM
@@ -2190,19 +2659,22 @@ P: Tony Luck
2190M: tony.luck@intel.com 2659M: tony.luck@intel.com
2191L: linux-ia64@vger.kernel.org 2660L: linux-ia64@vger.kernel.org
2192W: http://www.ia64-linux.org/ 2661W: http://www.ia64-linux.org/
2193T: git kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git 2662T: git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git
2194S: Maintained 2663S: Maintained
2664F: arch/ia64/
2195 2665
2196IBM MCA SCSI SUBSYSTEM DRIVER 2666IBM MCA SCSI SUBSYSTEM DRIVER
2197P: Michael Lang 2667P: Michael Lang
2198M: langa2@kph.uni-mainz.de 2668M: langa2@kph.uni-mainz.de
2199W: http://www.uni-mainz.de/~langm000/linux.html 2669W: http://www.uni-mainz.de/~langm000/linux.html
2200S: Maintained 2670S: Maintained
2671F: drivers/scsi/ibmmca.c
2201 2672
2202IBM Power Linux RAID adapter 2673IBM Power Linux RAID adapter
2203P: Brian King 2674P: Brian King
2204M: brking@us.ibm.com 2675M: brking@us.ibm.com
2205S: Supported 2676S: Supported
2677F: drivers/scsi/ipr.*
2206 2678
2207IBM ServeRAID RAID DRIVER 2679IBM ServeRAID RAID DRIVER
2208P: Jack Hammer 2680P: Jack Hammer
@@ -2210,6 +2682,7 @@ P: Dave Jeffery
2210M: ipslinux@adaptec.com 2682M: ipslinux@adaptec.com
2211W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html 2683W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html
2212S: Supported 2684S: Supported
2685F: drivers/scsi/ips.*
2213 2686
2214IDE SUBSYSTEM 2687IDE SUBSYSTEM
2215P: Bartlomiej Zolnierkiewicz 2688P: Bartlomiej Zolnierkiewicz
@@ -2217,45 +2690,55 @@ M: bzolnier@gmail.com
2217L: linux-ide@vger.kernel.org 2690L: linux-ide@vger.kernel.org
2218T: quilt kernel.org/pub/linux/kernel/people/bart/pata-2.6/ 2691T: quilt kernel.org/pub/linux/kernel/people/bart/pata-2.6/
2219S: Maintained 2692S: Maintained
2693F: Documentation/ide/
2694F: drivers/ide/
2695F: include/linux/ide.h
2220 2696
2221IDE/ATAPI DRIVERS 2697IDE/ATAPI DRIVERS
2222P: Borislav Petkov 2698P: Borislav Petkov
2223M: petkovbb@gmail.com 2699M: petkovbb@gmail.com
2224L: linux-ide@vger.kernel.org 2700L: linux-ide@vger.kernel.org
2225S: Maintained 2701S: Maintained
2702F: Documentation/cdrom/ide-cd
2703F: drivers/ide/ide-cd*
2226 2704
2227IDLE-I7300 2705IDLE-I7300
2228P: Andy Henroid 2706P: Andy Henroid
2229M: andrew.d.henroid@intel.com 2707M: andrew.d.henroid@intel.com
2230L: linux-pm@lists.linux-foundation.org 2708L: linux-pm@lists.linux-foundation.org
2231S: Supported 2709S: Supported
2710F: drivers/idle/i7300_idle.c
2232 2711
2233IEEE 1394 SUBSYSTEM (drivers/ieee1394) 2712IEEE 1394 SUBSYSTEM
2234P: Ben Collins 2713P: Ben Collins
2235M: ben.collins@ubuntu.com 2714M: ben.collins@ubuntu.com
2236P: Stefan Richter 2715P: Stefan Richter
2237M: stefanr@s5r6.in-berlin.de 2716M: stefanr@s5r6.in-berlin.de
2238L: linux1394-devel@lists.sourceforge.net 2717L: linux1394-devel@lists.sourceforge.net
2239W: http://www.linux1394.org/ 2718W: http://www.linux1394.org/
2240T: git kernel.org:/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git 2719T: git git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
2241S: Maintained 2720S: Maintained
2721F: drivers/ieee1394/
2242 2722
2243IEEE 1394 RAW I/O DRIVER (raw1394) 2723IEEE 1394 RAW I/O DRIVER
2244P: Dan Dennedy 2724P: Dan Dennedy
2245M: dan@dennedy.org 2725M: dan@dennedy.org
2246P: Stefan Richter 2726P: Stefan Richter
2247M: stefanr@s5r6.in-berlin.de 2727M: stefanr@s5r6.in-berlin.de
2248L: linux1394-devel@lists.sourceforge.net 2728L: linux1394-devel@lists.sourceforge.net
2249S: Maintained 2729S: Maintained
2730F: drivers/ieee1394/raw1394*
2250 2731
2251INTEGRITY MEASUREMENT ARCHITECTURE (IMA) 2732INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
2252P: Mimi Zohar 2733P: Mimi Zohar
2253M: zohar@us.ibm.com 2734M: zohar@us.ibm.com
2254S: Supported 2735S: Supported
2736F: security/integrity/ima/
2255 2737
2256IMS TWINTURBO FRAMEBUFFER DRIVER 2738IMS TWINTURBO FRAMEBUFFER DRIVER
2257L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2739L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2258S: Orphan 2740S: Orphan
2741F: drivers/video/imsttfb.c
2259 2742
2260INFINIBAND SUBSYSTEM 2743INFINIBAND SUBSYSTEM
2261P: Roland Dreier 2744P: Roland Dreier
@@ -2266,8 +2749,11 @@ P: Hal Rosenstock
2266M: hal.rosenstock@gmail.com 2749M: hal.rosenstock@gmail.com
2267L: general@lists.openfabrics.org (moderated for non-subscribers) 2750L: general@lists.openfabrics.org (moderated for non-subscribers)
2268W: http://www.openib.org/ 2751W: http://www.openib.org/
2269T: git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git 2752T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
2270S: Supported 2753S: Supported
2754F: Documentation/infiniband/
2755F: drivers/infiniband/
2756F: include/linux/if_infiniband.h
2271 2757
2272INOTIFY 2758INOTIFY
2273P: John McCutchan 2759P: John McCutchan
@@ -2276,26 +2762,33 @@ P: Robert Love
2276M: rlove@rlove.org 2762M: rlove@rlove.org
2277L: linux-kernel@vger.kernel.org 2763L: linux-kernel@vger.kernel.org
2278S: Maintained 2764S: Maintained
2765F: Documentation/filesystems/inotify.txt
2766F: fs/notify/inotify/
2767F: include/linux/inotify.h
2279 2768
2280INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS 2769INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
2281P: Dmitry Torokhov 2770P: Dmitry Torokhov
2282M: dmitry.torokhov@gmail.com 2771M: dmitry.torokhov@gmail.com
2283M: dtor@mail.ru 2772M: dtor@mail.ru
2284L: linux-input@vger.kernel.org 2773L: linux-input@vger.kernel.org
2285T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git 2774T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
2286S: Maintained 2775S: Maintained
2776F: drivers/input/
2287 2777
2288INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) 2778INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
2289P: Sylvain Meyer 2779P: Sylvain Meyer
2290M: sylvain.meyer@worldonline.fr 2780M: sylvain.meyer@worldonline.fr
2291L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2781L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2292S: Maintained 2782S: Maintained
2783F: Documentation/fb/intelfb.txt
2784F: drivers/video/intelfb/
2293 2785
2294INTEL 810/815 FRAMEBUFFER DRIVER 2786INTEL 810/815 FRAMEBUFFER DRIVER
2295P: Antonino Daplas 2787P: Antonino Daplas
2296M: adaplas@gmail.com 2788M: adaplas@gmail.com
2297L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2789L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2298S: Maintained 2790S: Maintained
2791F: drivers/video/i810/
2299 2792
2300INTEL MENLOW THERMAL DRIVER 2793INTEL MENLOW THERMAL DRIVER
2301P: Sujith Thomas 2794P: Sujith Thomas
@@ -2303,46 +2796,61 @@ M: sujith.thomas@intel.com
2303L: linux-acpi@vger.kernel.org 2796L: linux-acpi@vger.kernel.org
2304W: http://www.lesswatts.org/projects/acpi/ 2797W: http://www.lesswatts.org/projects/acpi/
2305S: Supported 2798S: Supported
2799F: drivers/platform/x86/intel_menlow.c
2306 2800
2307INTEL IA32 MICROCODE UPDATE SUPPORT 2801INTEL IA32 MICROCODE UPDATE SUPPORT
2308P: Tigran Aivazian 2802P: Tigran Aivazian
2309M: tigran@aivazian.fsnet.co.uk 2803M: tigran@aivazian.fsnet.co.uk
2310S: Maintained 2804S: Maintained
2805F: arch/x86/kernel/microcode_core.c
2806F: arch/x86/kernel/microcode_intel.c
2311 2807
2312INTEL I/OAT DMA DRIVER 2808INTEL I/OAT DMA DRIVER
2313P: Maciej Sosnowski 2809P: Maciej Sosnowski
2314M: maciej.sosnowski@intel.com 2810M: maciej.sosnowski@intel.com
2315L: linux-kernel@vger.kernel.org 2811L: linux-kernel@vger.kernel.org
2316S: Supported 2812S: Supported
2813F: drivers/dma/ioat*
2317 2814
2318INTEL IOMMU (VT-d) 2815INTEL IOMMU (VT-d)
2319P: David Woodhouse 2816P: David Woodhouse
2320M: dwmw2@infradead.org 2817M: dwmw2@infradead.org
2321L: iommu@lists.linux-foundation.org 2818L: iommu@lists.linux-foundation.org
2322T: git://git.infradead.org/iommu-2.6.git 2819T: git git://git.infradead.org/iommu-2.6.git
2323S: Supported 2820S: Supported
2821F: drivers/pci/intel-iommu.c
2822F: include/linux/intel-iommu.h
2324 2823
2325INTEL IOP-ADMA DMA DRIVER 2824INTEL IOP-ADMA DMA DRIVER
2326P: Dan Williams 2825P: Dan Williams
2327M: dan.j.williams@intel.com 2826M: dan.j.williams@intel.com
2328L: linux-kernel@vger.kernel.org 2827L: linux-kernel@vger.kernel.org
2329S: Supported 2828S: Supported
2829F: drivers/dma/iop-adma.c
2330 2830
2331INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT 2831INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
2332P: Krzysztof Halasa 2832P: Krzysztof Halasa
2333M: khc@pm.waw.pl 2833M: khc@pm.waw.pl
2334S: Maintained 2834S: Maintained
2835F: arch/arm/mach-ixp4xx/include/mach/qmgr.h
2836F: arch/arm/mach-ixp4xx/include/mach/npe.h
2837F: arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
2838F: arch/arm/mach-ixp4xx/ixp4xx_npe.c
2839F: drivers/net/arm/ixp4xx_eth.c
2840F: drivers/net/wan/ixp4xx_hss.c
2335 2841
2336INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT 2842INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
2337P: Deepak Saxena 2843P: Deepak Saxena
2338M: dsaxena@plexity.net 2844M: dsaxena@plexity.net
2339S: Maintained 2845S: Maintained
2846F: drivers/char/hw_random/ixp4xx-rng.c
2340 2847
2341INTEL IXP2000 ETHERNET DRIVER 2848INTEL IXP2000 ETHERNET DRIVER
2342P: Lennert Buytenhek 2849P: Lennert Buytenhek
2343M: kernel@wantstofly.org 2850M: kernel@wantstofly.org
2344L: netdev@vger.kernel.org 2851L: netdev@vger.kernel.org
2345S: Maintained 2852S: Maintained
2853F: drivers/net/ixp2000/
2346 2854
2347INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe) 2855INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe)
2348P: Jeff Kirsher 2856P: Jeff Kirsher
@@ -2358,6 +2866,12 @@ M: john.ronciak@intel.com
2358L: e1000-devel@lists.sourceforge.net 2866L: e1000-devel@lists.sourceforge.net
2359W: http://e1000.sourceforge.net/ 2867W: http://e1000.sourceforge.net/
2360S: Supported 2868S: Supported
2869F: drivers/net/e100.c
2870F: drivers/net/e1000/
2871F: drivers/net/e1000e/
2872F: drivers/net/igb/
2873F: drivers/net/ixgb/
2874F: drivers/net/ixgbe/
2361 2875
2362INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT 2876INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
2363P: Zhu Yi 2877P: Zhu Yi
@@ -2371,6 +2885,8 @@ L: ipw2100-devel@lists.sourceforge.net
2371W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 2885W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
2372W: http://ipw2100.sourceforge.net 2886W: http://ipw2100.sourceforge.net
2373S: Supported 2887S: Supported
2888F: Documentation/networking/README.ipw2100
2889F: drivers/net/wireless/ipw2x00/ipw2100.*
2374 2890
2375INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT 2891INTEL PRO/WIRELESS 2915ABG NETWORK CONNECTION SUPPORT
2376P: Zhu Yi 2892P: Zhu Yi
@@ -2384,6 +2900,8 @@ L: ipw2100-devel@lists.sourceforge.net
2384W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel 2900W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
2385W: http://ipw2200.sourceforge.net 2901W: http://ipw2200.sourceforge.net
2386S: Supported 2902S: Supported
2903F: Documentation/networking/README.ipw2200
2904F: drivers/net/wireless/ipw2x00/ipw2200.*
2387 2905
2388INTEL WIRELESS WIMAX CONNECTION 2400 2906INTEL WIRELESS WIMAX CONNECTION 2400
2389P: Inaky Perez-Gonzalez 2907P: Inaky Perez-Gonzalez
@@ -2392,6 +2910,9 @@ M: linux-wimax@intel.com
2392L: wimax@linuxwimax.org 2910L: wimax@linuxwimax.org
2393S: Supported 2911S: Supported
2394W: http://linuxwimax.org 2912W: http://linuxwimax.org
2913F: Documentation/wimax/README.i2400m
2914F: drivers/net/wimax/i2400m/
2915F: include/linux/wimax/i2400m.h
2395 2916
2396INTEL WIRELESS WIFI LINK (iwlwifi) 2917INTEL WIRELESS WIFI LINK (iwlwifi)
2397P: Zhu Yi 2918P: Zhu Yi
@@ -2401,25 +2922,29 @@ M: reinette.chatre@intel.com
2401L: linux-wireless@vger.kernel.org 2922L: linux-wireless@vger.kernel.org
2402L: ipw3945-devel@lists.sourceforge.net 2923L: ipw3945-devel@lists.sourceforge.net
2403W: http://intellinuxwireless.org 2924W: http://intellinuxwireless.org
2404T: git kernel.org:/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.git 2925T: git git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.git
2405S: Supported 2926S: Supported
2927F: drivers/net/wireless/iwlwifi/
2406 2928
2407IOC3 ETHERNET DRIVER 2929IOC3 ETHERNET DRIVER
2408P: Ralf Baechle 2930P: Ralf Baechle
2409M: ralf@linux-mips.org 2931M: ralf@linux-mips.org
2410L: linux-mips@linux-mips.org 2932L: linux-mips@linux-mips.org
2411S: Maintained 2933S: Maintained
2934F: drivers/net/ioc3-eth.c
2412 2935
2413IOC3 SERIAL DRIVER 2936IOC3 SERIAL DRIVER
2414P: Pat Gefre 2937P: Pat Gefre
2415M: pfg@sgi.com 2938M: pfg@sgi.com
2416L: linux-mips@linux-mips.org 2939L: linux-mips@linux-mips.org
2417S: Maintained 2940S: Maintained
2941F: drivers/serial/ioc3_serial.c
2418 2942
2419IP MASQUERADING 2943IP MASQUERADING
2420P: Juanjo Ciarlante 2944P: Juanjo Ciarlante
2421M: jjciarla@raiz.uncu.edu.ar 2945M: jjciarla@raiz.uncu.edu.ar
2422S: Maintained 2946S: Maintained
2947F: net/ipv4/netfilter/ipt_MASQUERADE.c
2423 2948
2424IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER 2949IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER
2425P: Francois Romieu 2950P: Francois Romieu
@@ -2430,6 +2955,7 @@ P: Jesse Huang
2430M: jesse@icplus.com.tw 2955M: jesse@icplus.com.tw
2431L: netdev@vger.kernel.org 2956L: netdev@vger.kernel.org
2432S: Maintained 2957S: Maintained
2958F: drivers/net/ipg.c
2433 2959
2434IPATH DRIVER 2960IPATH DRIVER
2435P: Ralph Campbell 2961P: Ralph Campbell
@@ -2437,6 +2963,7 @@ M: infinipath@qlogic.com
2437L: general@lists.openfabrics.org 2963L: general@lists.openfabrics.org
2438T: git git://git.qlogic.com/ipath-linux-2.6 2964T: git git://git.qlogic.com/ipath-linux-2.6
2439S: Supported 2965S: Supported
2966F: drivers/infiniband/hw/ipath/
2440 2967
2441IPMI SUBSYSTEM 2968IPMI SUBSYSTEM
2442P: Corey Minyard 2969P: Corey Minyard
@@ -2444,6 +2971,9 @@ M: minyard@acm.org
2444L: openipmi-developer@lists.sourceforge.net 2971L: openipmi-developer@lists.sourceforge.net
2445W: http://openipmi.sourceforge.net/ 2972W: http://openipmi.sourceforge.net/
2446S: Supported 2973S: Supported
2974F: Documentation/IPMI.txt
2975F: drivers/char/ipmi/
2976F: include/linux/ipmi*
2447 2977
2448IPS SCSI RAID DRIVER 2978IPS SCSI RAID DRIVER
2449P: Adaptec OEM Raid Solutions 2979P: Adaptec OEM Raid Solutions
@@ -2451,6 +2981,7 @@ M: aacraid@adaptec.com
2451L: linux-scsi@vger.kernel.org 2981L: linux-scsi@vger.kernel.org
2452W: http://www.adaptec.com/ 2982W: http://www.adaptec.com/
2453S: Maintained 2983S: Maintained
2984F: drivers/scsi/ips*
2454 2985
2455IPVS 2986IPVS
2456P: Wensong Zhang 2987P: Wensong Zhang
@@ -2462,6 +2993,8 @@ M: ja@ssi.bg
2462L: netdev@vger.kernel.org 2993L: netdev@vger.kernel.org
2463L: lvs-devel@vger.kernel.org 2994L: lvs-devel@vger.kernel.org
2464S: Maintained 2995S: Maintained
2996F: Documentation/networking/ipvs-sysctl.txt
2997F: net/netfilter/ipvs/
2465 2998
2466IPWIRELESS DRIVER 2999IPWIRELESS DRIVER
2467P: Jiri Kosina 3000P: Jiri Kosina
@@ -2469,13 +3002,17 @@ M: jkosina@suse.cz
2469P: David Sterba 3002P: David Sterba
2470M: dsterba@suse.cz 3003M: dsterba@suse.cz
2471S: Maintained 3004S: Maintained
2472T: git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git 3005T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/ipwireless_cs.git
3006F: drivers/char/pcmcia/ipwireless/
2473 3007
2474IPX NETWORK LAYER 3008IPX NETWORK LAYER
2475P: Arnaldo Carvalho de Melo 3009P: Arnaldo Carvalho de Melo
2476M: acme@ghostprotocols.net 3010M: acme@ghostprotocols.net
2477L: netdev@vger.kernel.org 3011L: netdev@vger.kernel.org
2478S: Maintained 3012S: Maintained
3013F: include/linux/ipx.h
3014F: include/net/ipx.h
3015F: net/ipx/
2479 3016
2480IRDA SUBSYSTEM 3017IRDA SUBSYSTEM
2481P: Samuel Ortiz 3018P: Samuel Ortiz
@@ -2483,27 +3020,40 @@ M: samuel@sortiz.org
2483L: irda-users@lists.sourceforge.net (subscribers-only) 3020L: irda-users@lists.sourceforge.net (subscribers-only)
2484W: http://irda.sourceforge.net/ 3021W: http://irda.sourceforge.net/
2485S: Maintained 3022S: Maintained
3023F: Documentation/networking/irda.txt
3024F: drivers/net/irda/
3025F: include/net/irda/
3026F: net/irda/
2486 3027
2487ISAPNP 3028ISAPNP
2488P: Jaroslav Kysela 3029P: Jaroslav Kysela
2489M: perex@perex.cz 3030M: perex@perex.cz
2490S: Maintained 3031S: Maintained
3032F: Documentation/isapnp.txt
3033F: drivers/pnp/isapnp/
3034F: include/linux/isapnp.h
2491 3035
2492ISCSI 3036ISCSI
2493P: Mike Christie 3037P: Mike Christie
2494M: michaelc@cs.wisc.edu 3038M: michaelc@cs.wisc.edu
2495L: open-iscsi@googlegroups.com 3039L: open-iscsi@googlegroups.com
2496W: www.open-iscsi.org 3040W: www.open-iscsi.org
2497T: git kernel.org:/pub/scm/linux/kernel/mnc/linux-2.6-iscsi.git 3041T: git git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
2498S: Maintained 3042S: Maintained
3043F: drivers/scsi/*iscsi*
3044F: include/scsi/*iscsi*
2499 3045
2500ISDN SUBSYSTEM 3046ISDN SUBSYSTEM
2501P: Karsten Keil 3047P: Karsten Keil
2502M: isdn@linux-pingi.de 3048M: isdn@linux-pingi.de
2503L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 3049L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
2504W: http://www.isdn4linux.de 3050W: http://www.isdn4linux.de
2505T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git 3051T: git git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/isdn-2.6.git
2506S: Maintained 3052S: Maintained
3053F: Documentation/isdn/
3054F: drivers/isdn/
3055F: include/linux/isdn.h
3056F: include/linux/isdn/
2507 3057
2508ISDN SUBSYSTEM (Eicon active card driver) 3058ISDN SUBSYSTEM (Eicon active card driver)
2509P: Armin Schindler 3059P: Armin Schindler
@@ -2511,6 +3061,7 @@ M: mac@melware.de
2511L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 3061L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
2512W: http://www.melware.de 3062W: http://www.melware.de
2513S: Maintained 3063S: Maintained
3064F: drivers/isdn/hardware/eicon/
2514 3065
2515IVTV VIDEO4LINUX DRIVER 3066IVTV VIDEO4LINUX DRIVER
2516P: Hans Verkuil 3067P: Hans Verkuil
@@ -2518,23 +3069,29 @@ M: hverkuil@xs4all.nl
2518L: ivtv-devel@ivtvdriver.org 3069L: ivtv-devel@ivtvdriver.org
2519L: ivtv-users@ivtvdriver.org 3070L: ivtv-users@ivtvdriver.org
2520L: linux-media@vger.kernel.org 3071L: linux-media@vger.kernel.org
2521T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 3072T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2522W: http://www.ivtvdriver.org 3073W: http://www.ivtvdriver.org
2523S: Maintained 3074S: Maintained
3075F: Documentation/video4linux/*.ivtv
3076F: drivers/media/video/ivtv/
3077F: include/linux/ivtv*
2524 3078
2525JFS FILESYSTEM 3079JFS FILESYSTEM
2526P: Dave Kleikamp 3080P: Dave Kleikamp
2527M: shaggy@austin.ibm.com 3081M: shaggy@austin.ibm.com
2528L: jfs-discussion@lists.sourceforge.net 3082L: jfs-discussion@lists.sourceforge.net
2529W: http://jfs.sourceforge.net/ 3083W: http://jfs.sourceforge.net/
2530T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git 3084T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git
2531S: Supported 3085S: Supported
3086F: Documentation/filesystems/jfs.txt
3087F: fs/jfs/
2532 3088
2533JME NETWORK DRIVER 3089JME NETWORK DRIVER
2534P: Guo-Fu Tseng 3090P: Guo-Fu Tseng
2535M: cooldavid@cooldavid.org 3091M: cooldavid@cooldavid.org
2536L: netdev@vger.kernel.org 3092L: netdev@vger.kernel.org
2537S: Maintained 3093S: Maintained
3094F: drivers/net/jme.*
2538 3095
2539JOURNALLING FLASH FILE SYSTEM V2 (JFFS2) 3096JOURNALLING FLASH FILE SYSTEM V2 (JFFS2)
2540P: David Woodhouse 3097P: David Woodhouse
@@ -2542,24 +3099,36 @@ M: dwmw2@infradead.org
2542L: linux-mtd@lists.infradead.org 3099L: linux-mtd@lists.infradead.org
2543W: http://www.linux-mtd.infradead.org/doc/jffs2.html 3100W: http://www.linux-mtd.infradead.org/doc/jffs2.html
2544S: Maintained 3101S: Maintained
3102F: fs/jffs2/
3103F: include/linux/jffs2.h
3104F: include/mtd/jffs2-user.h
2545 3105
2546JOURNALLING LAYER FOR BLOCK DEVICES (JBD) 3106JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
2547P: Stephen Tweedie, Andrew Morton 3107P: Stephen Tweedie
2548M: sct@redhat.com, akpm@linux-foundation.org 3108M: sct@redhat.com
3109P: Andrew Morton
3110M: akpm@linux-foundation.org
2549L: linux-ext4@vger.kernel.org 3111L: linux-ext4@vger.kernel.org
2550S: Maintained 3112S: Maintained
3113F: fs/jbd*/
3114F: include/linux/ext*jbd*.h
3115F: include/linux/jbd*.h
2551 3116
2552K8TEMP HARDWARE MONITORING DRIVER 3117K8TEMP HARDWARE MONITORING DRIVER
2553P: Rudolf Marek 3118P: Rudolf Marek
2554M: r.marek@assembler.cz 3119M: r.marek@assembler.cz
2555L: lm-sensors@lm-sensors.org 3120L: lm-sensors@lm-sensors.org
2556S: Maintained 3121S: Maintained
3122F: Documentation/hwmon/k8temp
3123F: drivers/hwmon/k8temp.c
2557 3124
2558KCONFIG 3125KCONFIG
2559P: Roman Zippel 3126P: Roman Zippel
2560M: zippel@linux-m68k.org 3127M: zippel@linux-m68k.org
2561L: linux-kbuild@vger.kernel.org 3128L: linux-kbuild@vger.kernel.org
2562S: Maintained 3129S: Maintained
3130F: Documentation/kbuild/kconfig-language.txt
3131F: scripts/kconfig/
2563 3132
2564KDUMP 3133KDUMP
2565P: Vivek Goyal 3134P: Vivek Goyal
@@ -2570,26 +3139,32 @@ L: kexec@lists.infradead.org
2570L: linux-kernel@vger.kernel.org 3139L: linux-kernel@vger.kernel.org
2571W: http://lse.sourceforge.net/kdump/ 3140W: http://lse.sourceforge.net/kdump/
2572S: Maintained 3141S: Maintained
3142F: Documentation/kdump/
2573 3143
2574KERNEL AUTOMOUNTER (AUTOFS) 3144KERNEL AUTOMOUNTER (AUTOFS)
2575P: H. Peter Anvin 3145P: H. Peter Anvin
2576M: hpa@zytor.com 3146M: hpa@zytor.com
2577L: autofs@linux.kernel.org 3147L: autofs@linux.kernel.org
2578S: Odd Fixes 3148S: Odd Fixes
3149F: fs/autofs/
2579 3150
2580KERNEL AUTOMOUNTER v4 (AUTOFS4) 3151KERNEL AUTOMOUNTER v4 (AUTOFS4)
2581P: Ian Kent 3152P: Ian Kent
2582M: raven@themaw.net 3153M: raven@themaw.net
2583L: autofs@linux.kernel.org 3154L: autofs@linux.kernel.org
2584S: Maintained 3155S: Maintained
3156F: fs/autofs4/
2585 3157
2586KERNEL BUILD (kbuild: Makefile, scripts/Makefile.*) 3158KERNEL BUILD
2587P: Sam Ravnborg 3159P: Sam Ravnborg
2588M: sam@ravnborg.org 3160M: sam@ravnborg.org
2589T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild-next.git 3161T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git
2590T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild-fixes.git 3162T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git
2591L: linux-kbuild@vger.kernel.org 3163L: linux-kbuild@vger.kernel.org
2592S: Maintained 3164S: Maintained
3165F: Documentation/kbuild/
3166F: Makefile
3167F: scripts/Makefile.*
2593 3168
2594KERNEL JANITORS 3169KERNEL JANITORS
2595P: Several 3170P: Several
@@ -2605,6 +3180,13 @@ M: neilb@suse.de
2605L: linux-nfs@vger.kernel.org 3180L: linux-nfs@vger.kernel.org
2606W: http://nfs.sourceforge.net/ 3181W: http://nfs.sourceforge.net/
2607S: Supported 3182S: Supported
3183F: fs/nfsd/
3184F: include/linux/nfsd/
3185F: fs/lockd/
3186F: fs/nfs_common/
3187F: net/sunrpc/
3188F: include/linux/lockd/
3189F: include/linux/sunrpc/
2608 3190
2609KERNEL VIRTUAL MACHINE (KVM) 3191KERNEL VIRTUAL MACHINE (KVM)
2610P: Avi Kivity 3192P: Avi Kivity
@@ -2612,6 +3194,11 @@ M: avi@redhat.com
2612L: kvm@vger.kernel.org 3194L: kvm@vger.kernel.org
2613W: http://kvm.qumranet.com 3195W: http://kvm.qumranet.com
2614S: Supported 3196S: Supported
3197F: Documentation/*/kvm.txt
3198F: arch/*/kvm/
3199F: arch/*/include/asm/kvm*
3200F: include/linux/kvm*
3201F: virt/kvm/
2615 3202
2616KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V 3203KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V
2617P: Joerg Roedel 3204P: Joerg Roedel
@@ -2619,6 +3206,9 @@ M: joerg.roedel@amd.com
2619L: kvm@vger.kernel.org 3206L: kvm@vger.kernel.org
2620W: http://kvm.qumranet.com 3207W: http://kvm.qumranet.com
2621S: Supported 3208S: Supported
3209F: arch/x86/include/asm/svm.h
3210F: arch/x86/kvm/kvm_svm.h
3211F: arch/x86/kvm/svm.c
2622 3212
2623KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC 3213KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
2624P: Hollis Blanchard 3214P: Hollis Blanchard
@@ -2626,6 +3216,8 @@ M: hollisb@us.ibm.com
2626L: kvm-ppc@vger.kernel.org 3216L: kvm-ppc@vger.kernel.org
2627W: http://kvm.qumranet.com 3217W: http://kvm.qumranet.com
2628S: Supported 3218S: Supported
3219F: arch/powerpc/include/asm/kvm*
3220F: arch/powerpc/kvm/
2629 3221
2630KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64) 3222KERNEL VIRTUAL MACHINE For Itanium (KVM/IA64)
2631P: Xiantao Zhang 3223P: Xiantao Zhang
@@ -2633,6 +3225,9 @@ M: xiantao.zhang@intel.com
2633L: kvm-ia64@vger.kernel.org 3225L: kvm-ia64@vger.kernel.org
2634W: http://kvm.qumranet.com 3226W: http://kvm.qumranet.com
2635S: Supported 3227S: Supported
3228F: Documentation/ia64/kvm.txt
3229F: arch/ia64/include/asm/kvm*
3230F: arch/ia64/kvm/
2636 3231
2637KERNEL VIRTUAL MACHINE for s390 (KVM/s390) 3232KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
2638P: Carsten Otte 3233P: Carsten Otte
@@ -2643,6 +3238,9 @@ M: linux390@de.ibm.com
2643L: linux-s390@vger.kernel.org 3238L: linux-s390@vger.kernel.org
2644W: http://www.ibm.com/developerworks/linux/linux390/ 3239W: http://www.ibm.com/developerworks/linux/linux390/
2645S: Supported 3240S: Supported
3241F: Documentation/s390/kvm.txt
3242F: arch/s390/include/asm/kvm*
3243F: arch/s390/kvm/
2646 3244
2647KEXEC 3245KEXEC
2648P: Eric Biederman 3246P: Eric Biederman
@@ -2651,18 +3249,28 @@ W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
2651L: linux-kernel@vger.kernel.org 3249L: linux-kernel@vger.kernel.org
2652L: kexec@lists.infradead.org 3250L: kexec@lists.infradead.org
2653S: Maintained 3251S: Maintained
3252F: include/linux/kexec.h
3253F: kernel/kexec.c
2654 3254
2655KGDB 3255KGDB
2656P: Jason Wessel 3256P: Jason Wessel
2657M: jason.wessel@windriver.com 3257M: jason.wessel@windriver.com
2658L: kgdb-bugreport@lists.sourceforge.net 3258L: kgdb-bugreport@lists.sourceforge.net
2659S: Maintained 3259S: Maintained
3260F: Documentation/DocBook/kgdb.tmpl
3261F: drivers/misc/kgdbts.c
3262F: drivers/serial/kgdboc.c
3263F: include/linux/kgdb.h
3264F: kernel/kgdb.c
2660 3265
2661KMEMTRACE 3266KMEMTRACE
2662P: Eduard - Gabriel Munteanu 3267P: Eduard - Gabriel Munteanu
2663M: eduard.munteanu@linux360.ro 3268M: eduard.munteanu@linux360.ro
2664L: linux-kernel@vger.kernel.org 3269L: linux-kernel@vger.kernel.org
2665S: Maintained 3270S: Maintained
3271F: Documentation/vm/kmemtrace.txt
3272F: include/trace/kmemtrace.h
3273F: kernel/trace/kmemtrace.c
2666 3274
2667KPROBES 3275KPROBES
2668P: Ananth N Mavinakayanahalli 3276P: Ananth N Mavinakayanahalli
@@ -2675,6 +3283,9 @@ P: Masami Hiramatsu
2675M: mhiramat@redhat.com 3283M: mhiramat@redhat.com
2676L: linux-kernel@vger.kernel.org 3284L: linux-kernel@vger.kernel.org
2677S: Maintained 3285S: Maintained
3286F: Documentation/kprobes.txt
3287F: include/linux/kprobes.h
3288F: kernel/kprobes.c
2678 3289
2679KS0108 LCD CONTROLLER DRIVER 3290KS0108 LCD CONTROLLER DRIVER
2680P: Miguel Ojeda Sandonis 3291P: Miguel Ojeda Sandonis
@@ -2683,21 +3294,31 @@ L: linux-kernel@vger.kernel.org
2683W: http://miguelojeda.es/auxdisplay.htm 3294W: http://miguelojeda.es/auxdisplay.htm
2684W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm 3295W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm
2685S: Maintained 3296S: Maintained
3297F: Documentation/auxdisplay/ks0108
3298F: drivers/auxdisplay/ks0108.c
3299F: include/linux/ks0108.h
2686 3300
2687LAPB module 3301LAPB module
2688L: linux-x25@vger.kernel.org 3302L: linux-x25@vger.kernel.org
2689S: Orphan 3303S: Orphan
3304F: Documentation/networking/lapb-module.txt
3305F: include/*/lapb.h
3306F: net/lapb/
2690 3307
2691LASI 53c700 driver for PARISC 3308LASI 53c700 driver for PARISC
2692P: James E.J. Bottomley 3309P: James E.J. Bottomley
2693M: James.Bottomley@HansenPartnership.com 3310M: James.Bottomley@HansenPartnership.com
2694L: linux-scsi@vger.kernel.org 3311L: linux-scsi@vger.kernel.org
2695S: Maintained 3312S: Maintained
3313F: Documentation/scsi/53c700.txt
3314F: drivers/scsi/53c700*
2696 3315
2697LED SUBSYSTEM 3316LED SUBSYSTEM
2698P: Richard Purdie 3317P: Richard Purdie
2699M: rpurdie@rpsys.net 3318M: rpurdie@rpsys.net
2700S: Maintained 3319S: Maintained
3320F: drivers/leds/
3321F: include/linux/leds.h
2701 3322
2702LEGO USB Tower driver 3323LEGO USB Tower driver
2703P: Juergen Stuber 3324P: Juergen Stuber
@@ -2705,6 +3326,7 @@ M: starblue@users.sourceforge.net
2705L: legousb-devel@lists.sourceforge.net 3326L: legousb-devel@lists.sourceforge.net
2706W: http://legousb.sourceforge.net/ 3327W: http://legousb.sourceforge.net/
2707S: Maintained 3328S: Maintained
3329F: drivers/usb/misc/legousbtower.c
2708 3330
2709LGUEST 3331LGUEST
2710P: Rusty Russell 3332P: Rusty Russell
@@ -2712,6 +3334,11 @@ M: rusty@rustcorp.com.au
2712L: lguest@ozlabs.org 3334L: lguest@ozlabs.org
2713W: http://lguest.ozlabs.org/ 3335W: http://lguest.ozlabs.org/
2714S: Maintained 3336S: Maintained
3337F: Documentation/lguest/
3338F: arch/x86/lguest/
3339F: drivers/lguest/
3340F: include/linux/lguest*.h
3341F: arch/x86/include/asm/lguest*.h
2715 3342
2716LINUX FOR IBM pSERIES (RS/6000) 3343LINUX FOR IBM pSERIES (RS/6000)
2717P: Paul Mackerras 3344P: Paul Mackerras
@@ -2719,12 +3346,6 @@ M: paulus@au.ibm.com
2719W: http://www.ibm.com/linux/ltc/projects/ppc 3346W: http://www.ibm.com/linux/ltc/projects/ppc
2720S: Supported 3347S: Supported
2721 3348
2722LINUX FOR NCR VOYAGER
2723P: James Bottomley
2724M: James.Bottomley@HansenPartnership.com
2725W: http://www.hansenpartnership.com/voyager
2726S: Maintained
2727
2728LINUX FOR POWERPC (32-BIT AND 64-BIT) 3349LINUX FOR POWERPC (32-BIT AND 64-BIT)
2729P: Benjamin Herrenschmidt 3350P: Benjamin Herrenschmidt
2730M: benh@kernel.crashing.org 3351M: benh@kernel.crashing.org
@@ -2732,7 +3353,7 @@ P: Paul Mackerras
2732M: paulus@samba.org 3353M: paulus@samba.org
2733W: http://www.penguinppc.org/ 3354W: http://www.penguinppc.org/
2734L: linuxppc-dev@ozlabs.org 3355L: linuxppc-dev@ozlabs.org
2735T: git kernel.org:/pub/scm/linux/kernel/git/benh/powerpc.git 3356T: git git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
2736S: Supported 3357S: Supported
2737 3358
2738LINUX FOR POWER MACINTOSH 3359LINUX FOR POWER MACINTOSH
@@ -2757,7 +3378,7 @@ P: Matt Porter
2757M: mporter@kernel.crashing.org 3378M: mporter@kernel.crashing.org
2758W: http://www.penguinppc.org/ 3379W: http://www.penguinppc.org/
2759L: linuxppc-dev@ozlabs.org 3380L: linuxppc-dev@ozlabs.org
2760T: git kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc.git 3381T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc.git
2761S: Maintained 3382S: Maintained
2762 3383
2763LINUX FOR POWERPC EMBEDDED XILINX VIRTEX 3384LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
@@ -2794,30 +3415,39 @@ LINUX SECURITY MODULE (LSM) FRAMEWORK
2794P: Chris Wright 3415P: Chris Wright
2795M: chrisw@sous-sol.org 3416M: chrisw@sous-sol.org
2796L: linux-security-module@vger.kernel.org 3417L: linux-security-module@vger.kernel.org
2797T: git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git 3418T: git git://git.kernel.org/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git
2798S: Supported 3419S: Supported
2799 3420
2800LLC (802.2) 3421LLC (802.2)
2801P: Arnaldo Carvalho de Melo 3422P: Arnaldo Carvalho de Melo
2802M: acme@ghostprotocols.net 3423M: acme@ghostprotocols.net
2803S: Maintained 3424S: Maintained
3425F: include/linux/llc.h
3426F: include/net/llc*
3427F: net/llc/
2804 3428
2805LIS3LV02D ACCELEROMETER DRIVER 3429LIS3LV02D ACCELEROMETER DRIVER
2806P: Eric Piel 3430P: Eric Piel
2807M: eric.piel@tremplin-utc.net 3431M: eric.piel@tremplin-utc.net
2808S: Maintained 3432S: Maintained
3433F: Documentation/hwmon/lis3lv02d
3434F: drivers/hwmon/lis3lv02d.*
2809 3435
2810LM83 HARDWARE MONITOR DRIVER 3436LM83 HARDWARE MONITOR DRIVER
2811P: Jean Delvare 3437P: Jean Delvare
2812M: khali@linux-fr.org 3438M: khali@linux-fr.org
2813L: lm-sensors@lm-sensors.org 3439L: lm-sensors@lm-sensors.org
2814S: Maintained 3440S: Maintained
3441F: Documentation/hwmon/lm83
3442F: drivers/hwmon/lm83.c
2815 3443
2816LM90 HARDWARE MONITOR DRIVER 3444LM90 HARDWARE MONITOR DRIVER
2817P: Jean Delvare 3445P: Jean Delvare
2818M: khali@linux-fr.org 3446M: khali@linux-fr.org
2819L: lm-sensors@lm-sensors.org 3447L: lm-sensors@lm-sensors.org
2820S: Maintained 3448S: Maintained
3449F: Documentation/hwmon/lm90
3450F: drivers/hwmon/lm90.c
2821 3451
2822LOCKDEP AND LOCKSTAT 3452LOCKDEP AND LOCKSTAT
2823P: Peter Zijlstra 3453P: Peter Zijlstra
@@ -2825,8 +3455,12 @@ M: peterz@infradead.org
2825P: Ingo Molnar 3455P: Ingo Molnar
2826M: mingo@redhat.com 3456M: mingo@redhat.com
2827L: linux-kernel@vger.kernel.org 3457L: linux-kernel@vger.kernel.org
2828T: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git 3458T: git git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git
2829S: Maintained 3459S: Maintained
3460F: Documentation/lockdep*.txt
3461F: Documentation/lockstat.txt
3462F: include/linux/lockdep.h
3463F: kernel/lockdep*
2830 3464
2831LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks) 3465LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks)
2832P: Richard Russon (FlatCap) 3466P: Richard Russon (FlatCap)
@@ -2834,6 +3468,8 @@ M: ldm@flatcap.org
2834L: linux-ntfs-dev@lists.sourceforge.net 3468L: linux-ntfs-dev@lists.sourceforge.net
2835W: http://www.linux-ntfs.org/content/view/19/37/ 3469W: http://www.linux-ntfs.org/content/view/19/37/
2836S: Maintained 3470S: Maintained
3471F: Documentation/ldm.txt
3472F: fs/partitions/ldm.*
2837 3473
2838LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 3474LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
2839P: Eric Moore 3475P: Eric Moore
@@ -2843,12 +3479,14 @@ L: DL-MPTFusionLinux@lsi.com
2843L: linux-scsi@vger.kernel.org 3479L: linux-scsi@vger.kernel.org
2844W: http://www.lsilogic.com/support 3480W: http://www.lsilogic.com/support
2845S: Supported 3481S: Supported
3482F: drivers/message/fusion/
2846 3483
2847LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers 3484LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
2848P: Matthew Wilcox 3485P: Matthew Wilcox
2849M: matthew@wil.cx 3486M: matthew@wil.cx
2850L: linux-scsi@vger.kernel.org 3487L: linux-scsi@vger.kernel.org
2851S: Maintained 3488S: Maintained
3489F: drivers/scsi/sym53c8xx_2/
2852 3490
2853LTP (Linux Test Project) 3491LTP (Linux Test Project)
2854P: Subrata Modak 3492P: Subrata Modak
@@ -2857,7 +3495,7 @@ P: Mike Frysinger
2857M: vapier@gentoo.org 3495M: vapier@gentoo.org
2858L: ltp-list@lists.sourceforge.net (subscribers-only) 3496L: ltp-list@lists.sourceforge.net (subscribers-only)
2859W: http://ltp.sourceforge.net/ 3497W: http://ltp.sourceforge.net/
2860T: git kernel.org/pub/scm/linux/kernel/git/galak/ltp.git 3498T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git
2861S: Maintained 3499S: Maintained
2862 3500
2863M32R ARCHITECTURE 3501M32R ARCHITECTURE
@@ -2867,6 +3505,8 @@ L: linux-m32r@ml.linux-m32r.org
2867L: linux-m32r-ja@ml.linux-m32r.org (in Japanese) 3505L: linux-m32r-ja@ml.linux-m32r.org (in Japanese)
2868W: http://www.linux-m32r.org/ 3506W: http://www.linux-m32r.org/
2869S: Maintained 3507S: Maintained
3508F: arch/m32r/
3509F: include/asm-m32r/
2870 3510
2871M68K ARCHITECTURE 3511M68K ARCHITECTURE
2872P: Geert Uytterhoeven 3512P: Geert Uytterhoeven
@@ -2875,8 +3515,10 @@ P: Roman Zippel
2875M: zippel@linux-m68k.org 3515M: zippel@linux-m68k.org
2876L: linux-m68k@lists.linux-m68k.org 3516L: linux-m68k@lists.linux-m68k.org
2877W: http://www.linux-m68k.org/ 3517W: http://www.linux-m68k.org/
2878T: git git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git 3518T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git
2879S: Maintained 3519S: Maintained
3520F: arch/m68k/
3521F: drivers/zorro/
2880 3522
2881M68K ON APPLE MACINTOSH 3523M68K ON APPLE MACINTOSH
2882P: Joshua Thompson 3524P: Joshua Thompson
@@ -2884,20 +3526,25 @@ M: funaho@jurai.org
2884W: http://www.mac.linux-m68k.org/ 3526W: http://www.mac.linux-m68k.org/
2885L: linux-m68k@lists.linux-m68k.org 3527L: linux-m68k@lists.linux-m68k.org
2886S: Maintained 3528S: Maintained
3529F: arch/m68k/mac/
2887 3530
2888M68K ON HP9000/300 3531M68K ON HP9000/300
2889P: Philip Blundell 3532P: Philip Blundell
2890M: philb@gnu.org 3533M: philb@gnu.org
2891W: http://www.tazenda.demon.co.uk/phil/linux-hp 3534W: http://www.tazenda.demon.co.uk/phil/linux-hp
2892S: Maintained 3535S: Maintained
3536F: arch/m68k/hp300/
2893 3537
2894MAC80211 3538MAC80211
2895P: Johannes Berg 3539P: Johannes Berg
2896M: johannes@sipsolutions.net 3540M: johannes@sipsolutions.net
2897L: linux-wireless@vger.kernel.org 3541L: linux-wireless@vger.kernel.org
2898W: http://linuxwireless.org/ 3542W: http://linuxwireless.org/
2899T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3543T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
2900S: Maintained 3544S: Maintained
3545F: Documentation/networking/mac80211-injection.txt
3546F: include/net/mac80211.h
3547F: net/mac80211/
2901 3548
2902MAC80211 PID RATE CONTROL 3549MAC80211 PID RATE CONTROL
2903P: Stefano Brivio 3550P: Stefano Brivio
@@ -2906,14 +3553,17 @@ P: Mattias Nissler
2906M: mattias.nissler@gmx.de 3553M: mattias.nissler@gmx.de
2907L: linux-wireless@vger.kernel.org 3554L: linux-wireless@vger.kernel.org
2908W: http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID 3555W: http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/PID
2909T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3556T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
2910S: Maintained 3557S: Maintained
3558F: net/mac80211/rc80211_pid*
2911 3559
2912MACVLAN DRIVER 3560MACVLAN DRIVER
2913P: Patrick McHardy 3561P: Patrick McHardy
2914M: kaber@trash.net 3562M: kaber@trash.net
2915L: netdev@vger.kernel.org 3563L: netdev@vger.kernel.org
2916S: Maintained 3564S: Maintained
3565F: drivers/net/macvlan.c
3566F: include/linux/if_macvlan.h
2917 3567
2918MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 3568MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7
2919P: Michael Kerrisk 3569P: Michael Kerrisk
@@ -2927,12 +3577,15 @@ P: Dan Williams
2927M: dcbw@redhat.com 3577M: dcbw@redhat.com
2928L: libertas-dev@lists.infradead.org 3578L: libertas-dev@lists.infradead.org
2929S: Maintained 3579S: Maintained
3580F: drivers/net/wireless/libertas/
2930 3581
2931MARVELL MV643XX ETHERNET DRIVER 3582MARVELL MV643XX ETHERNET DRIVER
2932P: Lennert Buytenhek 3583P: Lennert Buytenhek
2933M: buytenh@marvell.com 3584M: buytenh@marvell.com
2934L: netdev@vger.kernel.org 3585L: netdev@vger.kernel.org
2935S: Supported 3586S: Supported
3587F: drivers/net/mv643xx_eth.*
3588F: include/linux/mv643xx.h
2936 3589
2937MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER 3590MARVELL SOC MMC/SD/SDIO CONTROLLER DRIVER
2938P: Nicolas Pitre 3591P: Nicolas Pitre
@@ -2953,12 +3606,31 @@ P: Petr Vandrovec
2953M: vandrove@vc.cvut.cz 3606M: vandrove@vc.cvut.cz
2954L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3607L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
2955S: Maintained 3608S: Maintained
3609F: drivers/video/matrox/matroxfb_*
3610F: include/linux/matroxfb.h
2956 3611
2957MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER 3612MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
2958P: Hans J. Koch 3613P: Hans J. Koch
2959M: hjk@linutronix.de 3614M: hjk@linutronix.de
2960L: lm-sensors@lm-sensors.org 3615L: lm-sensors@lm-sensors.org
2961S: Maintained 3616S: Maintained
3617F: Documentation/hwmon/max6650
3618F: drivers/hwmon/max6650.c
3619
3620MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
3621P: Mauro Carvalho Chehab
3622M: mchehab@infradead.org
3623P: LinuxTV.org Project
3624L: linux-media@vger.kernel.org
3625W: http://linuxtv.org
3626T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
3627S: Maintained
3628F: Documentation/dvb/
3629F: Documentation/video4linux/
3630F: drivers/media/
3631F: include/media/
3632F: include/linux/dvb/
3633F: include/linux/videodev*.h
2962 3634
2963MEGARAID SCSI DRIVERS 3635MEGARAID SCSI DRIVERS
2964P: Neela Syam Kolli 3636P: Neela Syam Kolli
@@ -2966,12 +3638,17 @@ M: megaraidlinux@lsi.com
2966L: linux-scsi@vger.kernel.org 3638L: linux-scsi@vger.kernel.org
2967W: http://megaraid.lsilogic.com 3639W: http://megaraid.lsilogic.com
2968S: Maintained 3640S: Maintained
3641F: Documentation/scsi/megaraid.txt
3642F: drivers/scsi/megaraid.*
3643F: drivers/scsi/megaraid/
2969 3644
2970MEMORY MANAGEMENT 3645MEMORY MANAGEMENT
2971L: linux-mm@kvack.org 3646L: linux-mm@kvack.org
2972L: linux-kernel@vger.kernel.org 3647L: linux-kernel@vger.kernel.org
2973W: http://www.linux-mm.org 3648W: http://www.linux-mm.org
2974S: Maintained 3649S: Maintained
3650F: include/linux/mm.h
3651F: mm/
2975 3652
2976MEMORY RESOURCE CONTROLLER 3653MEMORY RESOURCE CONTROLLER
2977P: Balbir Singh 3654P: Balbir Singh
@@ -2983,6 +3660,7 @@ M: kamezawa.hiroyu@jp.fujitsu.com
2983L: linux-mm@kvack.org 3660L: linux-mm@kvack.org
2984L: linux-kernel@vger.kernel.org 3661L: linux-kernel@vger.kernel.org
2985S: Maintained 3662S: Maintained
3663F: mm/memcontrol.c
2986 3664
2987MEMORY TECHNOLOGY DEVICES (MTD) 3665MEMORY TECHNOLOGY DEVICES (MTD)
2988P: David Woodhouse 3666P: David Woodhouse
@@ -2991,55 +3669,84 @@ W: http://www.linux-mtd.infradead.org/
2991L: linux-mtd@lists.infradead.org 3669L: linux-mtd@lists.infradead.org
2992T: git git://git.infradead.org/mtd-2.6.git 3670T: git git://git.infradead.org/mtd-2.6.git
2993S: Maintained 3671S: Maintained
3672F: drivers/mtd/
3673F: include/linux/mtd/
3674F: include/mtd/
3675
3676MICROBLAZE ARCHITECTURE
3677P: Michal Simek
3678M: monstr@monstr.eu
3679L: microblaze-uclinux@itee.uq.edu.au
3680W: http://www.monstr.eu/fdt/
3681T: git git://git.monstr.eu/linux-2.6-microblaze.git
3682S: Supported
3683F: arch/microblaze/
2994 3684
2995MICROTEK X6 SCANNER 3685MICROTEK X6 SCANNER
2996P: Oliver Neukum 3686P: Oliver Neukum
2997M: oliver@neukum.name 3687M: oliver@neukum.name
2998S: Maintained 3688S: Maintained
3689F: drivers/usb/image/microtek.*
2999 3690
3000MIPS 3691MIPS
3001P: Ralf Baechle 3692P: Ralf Baechle
3002M: ralf@linux-mips.org 3693M: ralf@linux-mips.org
3003W: http://www.linux-mips.org/ 3694W: http://www.linux-mips.org/
3004L: linux-mips@linux-mips.org 3695L: linux-mips@linux-mips.org
3005T: git www.linux-mips.org:/pub/scm/linux.git 3696T: git git://git.linux-mips.org/pub/scm/linux.git
3006S: Supported 3697S: Supported
3698F: Documentation/mips/
3699F: arch/mips/
3007 3700
3008MISCELLANEOUS MCA-SUPPORT 3701MISCELLANEOUS MCA-SUPPORT
3009P: James Bottomley 3702P: James Bottomley
3010M: James.Bottomley@HansenPartnership.com 3703M: James.Bottomley@HansenPartnership.com
3011L: linux-kernel@vger.kernel.org 3704L: linux-kernel@vger.kernel.org
3012S: Maintained 3705S: Maintained
3706F: Documentation/ia64/mca.txt
3707F: Documentation/mca.txt
3708F: drivers/mca/
3709F: include/linux/mca*
3013 3710
3014MODULE SUPPORT 3711MODULE SUPPORT
3015P: Rusty Russell 3712P: Rusty Russell
3016M: rusty@rustcorp.com.au 3713M: rusty@rustcorp.com.au
3017L: linux-kernel@vger.kernel.org 3714L: linux-kernel@vger.kernel.org
3018S: Maintained 3715S: Maintained
3716F: include/linux/module.h
3717F: kernel/module.c
3019 3718
3020MOTION EYE VAIO PICTUREBOOK CAMERA DRIVER 3719MOTION EYE VAIO PICTUREBOOK CAMERA DRIVER
3021P: Stelian Pop 3720P: Stelian Pop
3022M: stelian@popies.net 3721M: stelian@popies.net
3023W: http://popies.net/meye/ 3722W: http://popies.net/meye/
3024S: Maintained 3723S: Maintained
3724F: Documentation/video4linux/meye.txt
3725F: drivers/media/video/meye.*
3726F: include/linux/meye.h
3025 3727
3026MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER 3728MOTOROLA IMX MMC/SD HOST CONTROLLER INTERFACE DRIVER
3027P: Pavel Pisa 3729P: Pavel Pisa
3028M: ppisa@pikron.com 3730M: ppisa@pikron.com
3029L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 3731L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3030S: Maintained 3732S: Maintained
3733F: drivers/mmc/host/imxmmc.*
3031 3734
3032MOUSE AND MISC DEVICES [GENERAL] 3735MOUSE AND MISC DEVICES [GENERAL]
3033P: Alessandro Rubini 3736P: Alessandro Rubini
3034M: rubini@ipvvis.unipv.it 3737M: rubini@ipvvis.unipv.it
3035L: linux-kernel@vger.kernel.org 3738L: linux-kernel@vger.kernel.org
3036S: Maintained 3739S: Maintained
3740F: drivers/input/mouse/
3741F: include/linux/gpio_mouse.h
3037 3742
3038MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD 3743MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD
3039P: Jiri Slaby 3744P: Jiri Slaby
3040M: jirislaby@gmail.com 3745M: jirislaby@gmail.com
3041L: linux-kernel@vger.kernel.org 3746L: linux-kernel@vger.kernel.org
3042S: Maintained 3747S: Maintained
3748F: Documentation/serial/moxa-smartio
3749F: drivers/char/mxser.*
3043 3750
3044MSI LAPTOP SUPPORT 3751MSI LAPTOP SUPPORT
3045P: Lennart Poettering 3752P: Lennart Poettering
@@ -3047,43 +3754,54 @@ M: mzxreary@0pointer.de
3047W: https://tango.0pointer.de/mailman/listinfo/s270-linux 3754W: https://tango.0pointer.de/mailman/listinfo/s270-linux
3048W: http://0pointer.de/lennart/tchibo.html 3755W: http://0pointer.de/lennart/tchibo.html
3049S: Maintained 3756S: Maintained
3757F: drivers/platform/x86/msi-laptop.c
3050 3758
3051MULTIFUNCTION DEVICES (MFD) 3759MULTIFUNCTION DEVICES (MFD)
3052P: Samuel Ortiz 3760P: Samuel Ortiz
3053M: sameo@linux.intel.com 3761M: sameo@linux.intel.com
3054L: linux-kernel@vger.kernel.org 3762L: linux-kernel@vger.kernel.org
3055T: git kernel.org:/pub/scm/linux/kernel/git/sameo/mfd-2.6.git 3763T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6.git
3056S: Supported 3764S: Supported
3765F: drivers/mfd/
3057 3766
3058MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM 3767MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
3059P: Pierre Ossman 3768P: Pierre Ossman
3060M: pierre@ossman.eu 3769M: pierre@ossman.eu
3061L: linux-kernel@vger.kernel.org 3770L: linux-kernel@vger.kernel.org
3062S: Maintained 3771S: Maintained
3772F: drivers/mmc/
3773F: include/linux/mmc/
3063 3774
3064MULTIMEDIA CARD (MMC) ETC. OVER SPI 3775MULTIMEDIA CARD (MMC) ETC. OVER SPI
3065P: David Brownell 3776P: David Brownell
3066M: dbrownell@users.sourceforge.net 3777M: dbrownell@users.sourceforge.net
3067L: linux-kernel@vger.kernel.org 3778L: linux-kernel@vger.kernel.org
3068S: Odd Fixes 3779S: Odd Fixes
3780F: drivers/mmc/host/mmc_spi.c
3781F: include/linux/spi/mmc_spi.h
3069 3782
3070MULTISOUND SOUND DRIVER 3783MULTISOUND SOUND DRIVER
3071P: Andrew Veliath 3784P: Andrew Veliath
3072M: andrewtv@usa.net 3785M: andrewtv@usa.net
3073S: Maintained 3786S: Maintained
3787F: Documentation/sound/oss/MultiSound
3788F: sound/oss/msnd*
3074 3789
3075MULTITECH MULTIPORT CARD (ISICOM) 3790MULTITECH MULTIPORT CARD (ISICOM)
3076P: Jiri Slaby 3791P: Jiri Slaby
3077M: jirislaby@gmail.com 3792M: jirislaby@gmail.com
3078L: linux-kernel@vger.kernel.org 3793L: linux-kernel@vger.kernel.org
3079S: Maintained 3794S: Maintained
3795F: drivers/char/isicom.c
3796F: include/linux/isicom.h
3080 3797
3081MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER 3798MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
3082P: Felipe Balbi 3799P: Felipe Balbi
3083M: felipe.balbi@nokia.com 3800M: felipe.balbi@nokia.com
3084L: linux-usb@vger.kernel.org 3801L: linux-usb@vger.kernel.org
3085T: git gitorious.org:/musb/mainline.git 3802T: git git://gitorious.org/musb/mainline.git
3086S: Maintained 3803S: Maintained
3804F: drivers/usb/musb/
3087 3805
3088MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE) 3806MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
3089P: Andrew Gallatin 3807P: Andrew Gallatin
@@ -3093,23 +3811,27 @@ M: brice@myri.com
3093L: netdev@vger.kernel.org 3811L: netdev@vger.kernel.org
3094W: http://www.myri.com/scs/download-Myri10GE.html 3812W: http://www.myri.com/scs/download-Myri10GE.html
3095S: Supported 3813S: Supported
3814F: drivers/net/myri10ge/
3096 3815
3097NATSEMI ETHERNET DRIVER (DP8381x) 3816NATSEMI ETHERNET DRIVER (DP8381x)
3098P: Tim Hockin 3817P: Tim Hockin
3099M: thockin@hockin.org 3818M: thockin@hockin.org
3100S: Maintained 3819S: Maintained
3820F: drivers/net/natsemi.c
3101 3821
3102NCP FILESYSTEM 3822NCP FILESYSTEM
3103P: Petr Vandrovec 3823P: Petr Vandrovec
3104M: vandrove@vc.cvut.cz 3824M: vandrove@vc.cvut.cz
3105L: linware@sh.cvut.cz 3825L: linware@sh.cvut.cz
3106S: Maintained 3826S: Maintained
3827F: fs/ncpfs/
3107 3828
3108NCR DUAL 700 SCSI DRIVER (MICROCHANNEL) 3829NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)
3109P: James E.J. Bottomley 3830P: James E.J. Bottomley
3110M: James.Bottomley@HansenPartnership.com 3831M: James.Bottomley@HansenPartnership.com
3111L: linux-scsi@vger.kernel.org 3832L: linux-scsi@vger.kernel.org
3112S: Maintained 3833S: Maintained
3834F: drivers/scsi/NCR_D700.*
3113 3835
3114NETEFFECT IWARP RNIC DRIVER (IW_NES) 3836NETEFFECT IWARP RNIC DRIVER (IW_NES)
3115P: Faisal Latif 3837P: Faisal Latif
@@ -3126,6 +3848,7 @@ P: Stephen Hemminger
3126M: shemminger@linux-foundation.org 3848M: shemminger@linux-foundation.org
3127L: netem@lists.linux-foundation.org 3849L: netem@lists.linux-foundation.org
3128S: Maintained 3850S: Maintained
3851F: net/sched/sch_netem.c
3129 3852
3130NETERION (S2IO) 10GbE DRIVER (xframe/vxge) 3853NETERION (S2IO) 10GbE DRIVER (xframe/vxge)
3131P: Ramkrishna Vepa 3854P: Ramkrishna Vepa
@@ -3142,6 +3865,8 @@ L: netdev@vger.kernel.org
3142W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous 3865W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/Linux?Anonymous
3143W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous 3866W: http://trac.neterion.com/cgi-bin/trac.cgi/wiki/X3100Linux?Anonymous
3144S: Supported 3867S: Supported
3868F: Documentation/networking/s2io.txt
3869F: drivers/net/s2io*
3145 3870
3146NETFILTER/IPTABLES/IPCHAINS 3871NETFILTER/IPTABLES/IPCHAINS
3147P: Rusty Russell 3872P: Rusty Russell
@@ -3157,6 +3882,12 @@ L: coreteam@netfilter.org
3157W: http://www.netfilter.org/ 3882W: http://www.netfilter.org/
3158W: http://www.iptables.org/ 3883W: http://www.iptables.org/
3159S: Supported 3884S: Supported
3885F: include/linux/netfilter*
3886F: include/linux/netfilter/
3887F: include/net/netfilter/
3888F: net/*/netfilter.c
3889F: net/*/netfilter/
3890F: net/netfilter/
3160 3891
3161NETLABEL 3892NETLABEL
3162P: Paul Moore 3893P: Paul Moore
@@ -3164,6 +3895,9 @@ M: paul.moore@hp.com
3164W: http://netlabel.sf.net 3895W: http://netlabel.sf.net
3165L: netdev@vger.kernel.org 3896L: netdev@vger.kernel.org
3166S: Supported 3897S: Supported
3898F: Documentation/netlabel/
3899F: include/net/netlabel.h
3900F: net/netlabel/
3167 3901
3168NETROM NETWORK LAYER 3902NETROM NETWORK LAYER
3169P: Ralf Baechle 3903P: Ralf Baechle
@@ -3171,18 +3905,25 @@ M: ralf@linux-mips.org
3171L: linux-hams@vger.kernel.org 3905L: linux-hams@vger.kernel.org
3172W: http://www.linux-ax25.org/ 3906W: http://www.linux-ax25.org/
3173S: Maintained 3907S: Maintained
3908F: include/linux/netrom.h
3909F: include/net/netrom.h
3910F: net/netrom/
3174 3911
3175NETWORK BLOCK DEVICE (NBD) 3912NETWORK BLOCK DEVICE (NBD)
3176P: Paul Clements 3913P: Paul Clements
3177M: Paul.Clements@steeleye.com 3914M: Paul.Clements@steeleye.com
3178S: Maintained 3915S: Maintained
3916F: Documentation/blockdev/nbd.txt
3917F: drivers/block/nbd.c
3918F: include/linux/nbd.h
3179 3919
3180NETWORK DEVICE DRIVERS 3920NETWORK DEVICE DRIVERS
3181P: Jeff Garzik 3921P: Jeff Garzik
3182M: jgarzik@pobox.com 3922M: jgarzik@pobox.com
3183L: netdev@vger.kernel.org 3923L: netdev@vger.kernel.org
3184T: git kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git 3924T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
3185S: Maintained 3925S: Maintained
3926F: drivers/net/
3186 3927
3187NETWORKING [GENERAL] 3928NETWORKING [GENERAL]
3188P: Networking Team 3929P: Networking Team
@@ -3190,6 +3931,8 @@ M: netdev@vger.kernel.org
3190L: netdev@vger.kernel.org 3931L: netdev@vger.kernel.org
3191W: http://linux-net.osdl.org/ 3932W: http://linux-net.osdl.org/
3192S: Maintained 3933S: Maintained
3934F: net/
3935F: include/net/
3193 3936
3194NETWORKING [IPv4/IPv6] 3937NETWORKING [IPv4/IPv6]
3195P: David S. Miller 3938P: David S. Miller
@@ -3205,8 +3948,11 @@ M: yoshfuji@linux-ipv6.org
3205P: Patrick McHardy 3948P: Patrick McHardy
3206M: kaber@trash.net 3949M: kaber@trash.net
3207L: netdev@vger.kernel.org 3950L: netdev@vger.kernel.org
3208T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git 3951T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
3209S: Maintained 3952S: Maintained
3953F: net/ipv4/
3954F: net/ipv6/
3955F: include/net/ip*
3210 3956
3211NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK) 3957NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK)
3212P: Paul Moore 3958P: Paul Moore
@@ -3218,8 +3964,11 @@ NETWORKING [WIRELESS]
3218P: John W. Linville 3964P: John W. Linville
3219M: linville@tuxdriver.com 3965M: linville@tuxdriver.com
3220L: linux-wireless@vger.kernel.org 3966L: linux-wireless@vger.kernel.org
3221T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git 3967T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
3222S: Maintained 3968S: Maintained
3969F: net/wireless/
3970F: include/net/ieee80211*
3971F: include/net/wireless.h
3223 3972
3224NETXEN (1/10) GbE SUPPORT 3973NETXEN (1/10) GbE SUPPORT
3225P: Dhananjay Phadke 3974P: Dhananjay Phadke
@@ -3227,6 +3976,7 @@ M: dhananjay@netxen.com
3227L: netdev@vger.kernel.org 3976L: netdev@vger.kernel.org
3228W: http://www.netxen.com 3977W: http://www.netxen.com
3229S: Supported 3978S: Supported
3979F: drivers/net/netxen/
3230 3980
3231NFS, SUNRPC, AND LOCKD CLIENTS 3981NFS, SUNRPC, AND LOCKD CLIENTS
3232P: Trond Myklebust 3982P: Trond Myklebust
@@ -3235,6 +3985,13 @@ L: linux-nfs@vger.kernel.org
3235W: http://client.linux-nfs.org 3985W: http://client.linux-nfs.org
3236T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git 3986T: git git://git.linux-nfs.org/pub/linux/nfs-2.6.git
3237S: Maintained 3987S: Maintained
3988F: fs/lockd/
3989F: fs/nfs/
3990F: fs/nfs_common/
3991F: net/sunrpc/
3992F: include/linux/lockd/
3993F: include/linux/nfs*
3994F: include/linux/sunrpc/
3238 3995
3239NI5010 NETWORK DRIVER 3996NI5010 NETWORK DRIVER
3240P: Jan-Pascal van Best 3997P: Jan-Pascal van Best
@@ -3243,6 +4000,7 @@ P: Andreas Mohr
3243M: andi@lisas.de 4000M: andi@lisas.de
3244L: netdev@vger.kernel.org 4001L: netdev@vger.kernel.org
3245S: Maintained 4002S: Maintained
4003F: drivers/net/ni5010.*
3246 4004
3247NILFS2 FILESYSTEM 4005NILFS2 FILESYSTEM
3248P: KONISHI Ryusuke 4006P: KONISHI Ryusuke
@@ -3250,12 +4008,17 @@ M: konishi.ryusuke@lab.ntt.co.jp
3250L: users@nilfs.org 4008L: users@nilfs.org
3251W: http://www.nilfs.org/en/ 4009W: http://www.nilfs.org/en/
3252S: Supported 4010S: Supported
4011F: Documentation/filesystems/nilfs2.txt
4012F: fs/nilfs2/
4013F: include/linux/nilfs2_fs.h
3253 4014
3254NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER 4015NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER
3255P: YOKOTA Hiroshi 4016P: YOKOTA Hiroshi
3256M: yokota@netlab.is.tsukuba.ac.jp 4017M: yokota@netlab.is.tsukuba.ac.jp
3257W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/ 4018W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
3258S: Maintained 4019S: Maintained
4020F: Documentation/scsi/NinjaSCSI.txt
4021F: drivers/scsi/pcmcia/nsp_*
3259 4022
3260NINJA SCSI-32Bi/UDE PCI/CARDBUS SCSI HOST ADAPTER DRIVER 4023NINJA SCSI-32Bi/UDE PCI/CARDBUS SCSI HOST ADAPTER DRIVER
3261P: GOTO Masanori 4024P: GOTO Masanori
@@ -3264,6 +4027,8 @@ P: YOKOTA Hiroshi
3264M: yokota@netlab.is.tsukuba.ac.jp 4027M: yokota@netlab.is.tsukuba.ac.jp
3265W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/ 4028W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
3266S: Maintained 4029S: Maintained
4030F: Documentation/scsi/NinjaSCSI.txt
4031F: drivers/scsi/nsp32*
3267 4032
3268NTFS FILESYSTEM 4033NTFS FILESYSTEM
3269P: Anton Altaparmakov 4034P: Anton Altaparmakov
@@ -3271,43 +4036,55 @@ M: aia21@cantab.net
3271L: linux-ntfs-dev@lists.sourceforge.net 4036L: linux-ntfs-dev@lists.sourceforge.net
3272L: linux-kernel@vger.kernel.org 4037L: linux-kernel@vger.kernel.org
3273W: http://www.linux-ntfs.org/ 4038W: http://www.linux-ntfs.org/
3274T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git 4039T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
3275S: Maintained 4040S: Maintained
4041F: Documentation/filesystems/ntfs.txt
4042F: fs/ntfs/
3276 4043
3277NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER 4044NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER
3278P: Antonino Daplas 4045P: Antonino Daplas
3279M: adaplas@gmail.com 4046M: adaplas@gmail.com
3280L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4047L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3281S: Maintained 4048S: Maintained
4049F: drivers/video/riva/
4050F: drivers/video/nvidia/
3282 4051
3283OMFS FILESYSTEM 4052OMFS FILESYSTEM
3284P: Bob Copeland 4053P: Bob Copeland
3285M: me@bobcopeland.com 4054M: me@bobcopeland.com
3286L: linux-karma-devel@lists.sourceforge.net 4055L: linux-karma-devel@lists.sourceforge.net
3287S: Maintained 4056S: Maintained
4057F: Documentation/filesystems/omfs.txt
4058F: fs/omfs/
3288 4059
3289OMNIKEY CARDMAN 4000 DRIVER 4060OMNIKEY CARDMAN 4000 DRIVER
3290P: Harald Welte 4061P: Harald Welte
3291M: laforge@gnumonks.org 4062M: laforge@gnumonks.org
3292S: Maintained 4063S: Maintained
4064F: drivers/char/pcmcia/cm4000_cs.c
4065F: include/linux/cm4000_cs.h
3293 4066
3294OMNIKEY CARDMAN 4040 DRIVER 4067OMNIKEY CARDMAN 4040 DRIVER
3295P: Harald Welte 4068P: Harald Welte
3296M: laforge@gnumonks.org 4069M: laforge@gnumonks.org
3297S: Maintained 4070S: Maintained
4071F: drivers/char/pcmcia/cm4040_cs.*
3298 4072
3299OMNIVISION OV7670 SENSOR DRIVER 4073OMNIVISION OV7670 SENSOR DRIVER
3300P: Jonathan Corbet 4074P: Jonathan Corbet
3301M: corbet@lwn.net 4075M: corbet@lwn.net
3302L: linux-media@vger.kernel.org 4076L: linux-media@vger.kernel.org
3303T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4077T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
3304S: Maintained 4078S: Maintained
4079F: drivers/media/video/ov7670.c
3305 4080
3306ONENAND FLASH DRIVER 4081ONENAND FLASH DRIVER
3307P: Kyungmin Park 4082P: Kyungmin Park
3308M: kyungmin.park@samsung.com 4083M: kyungmin.park@samsung.com
3309L: linux-mtd@lists.infradead.org 4084L: linux-mtd@lists.infradead.org
3310S: Maintained 4085S: Maintained
4086F: drivers/mtd/onenand/
4087F: include/linux/mtd/onenand*.h
3311 4088
3312ONSTREAM SCSI TAPE DRIVER 4089ONSTREAM SCSI TAPE DRIVER
3313P: Willem Riede 4090P: Willem Riede
@@ -3315,18 +4092,25 @@ M: osst@riede.org
3315L: osst-users@lists.sourceforge.net 4092L: osst-users@lists.sourceforge.net
3316L: linux-scsi@vger.kernel.org 4093L: linux-scsi@vger.kernel.org
3317S: Maintained 4094S: Maintained
4095F: drivers/scsi/osst*
4096F: drivers/scsi/st*
3318 4097
3319OPENCORES I2C BUS DRIVER 4098OPENCORES I2C BUS DRIVER
3320P: Peter Korsgaard 4099P: Peter Korsgaard
3321M: jacmet@sunsite.dk 4100M: jacmet@sunsite.dk
3322L: linux-i2c@vger.kernel.org 4101L: linux-i2c@vger.kernel.org
3323S: Maintained 4102S: Maintained
4103F: Documentation/i2c/busses/i2c-ocores
4104F: drivers/i2c/busses/i2c-ocores.c
3324 4105
3325OPROFILE 4106OPROFILE
3326P: Robert Richter 4107P: Robert Richter
3327M: robert.richter@amd.com 4108M: robert.richter@amd.com
3328L: oprofile-list@lists.sf.net 4109L: oprofile-list@lists.sf.net
3329S: Maintained 4110S: Maintained
4111F: arch/*/oprofile/
4112F: drivers/oprofile/
4113F: include/linux/oprofile.h
3330 4114
3331ORACLE CLUSTER FILESYSTEM 2 (OCFS2) 4115ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
3332P: Mark Fasheh 4116P: Mark Fasheh
@@ -3337,6 +4121,9 @@ L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
3337W: http://oss.oracle.com/projects/ocfs2/ 4121W: http://oss.oracle.com/projects/ocfs2/
3338T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git 4122T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git
3339S: Supported 4123S: Supported
4124F: Documentation/filesystems/ocfs2.txt
4125F: Documentation/filesystems/dlmfs.txt
4126F: fs/ocfs2/
3340 4127
3341ORINOCO DRIVER 4128ORINOCO DRIVER
3342P: Pavel Roskin 4129P: Pavel Roskin
@@ -3348,6 +4135,7 @@ L: orinoco-users@lists.sourceforge.net
3348L: orinoco-devel@lists.sourceforge.net 4135L: orinoco-devel@lists.sourceforge.net
3349W: http://www.nongnu.org/orinoco/ 4136W: http://www.nongnu.org/orinoco/
3350S: Maintained 4137S: Maintained
4138F: drivers/net/wireless/orinoco/
3351 4139
3352OSD LIBRARY 4140OSD LIBRARY
3353P: Boaz Harrosh 4141P: Boaz Harrosh
@@ -3356,7 +4144,7 @@ P: Benny Halevy
3356M: bhalevy@panasas.com 4144M: bhalevy@panasas.com
3357L: osd-dev@open-osd.org 4145L: osd-dev@open-osd.org
3358W: http://open-osd.org 4146W: http://open-osd.org
3359T: git://git.open-osd.org/open-osd.git 4147T: git git://git.open-osd.org/open-osd.git
3360S: Maintained 4148S: Maintained
3361 4149
3362P54 WIRELESS DRIVER 4150P54 WIRELESS DRIVER
@@ -3364,25 +4152,29 @@ P: Michael Wu
3364M: flamingice@sourmilk.net 4152M: flamingice@sourmilk.net
3365L: linux-wireless@vger.kernel.org 4153L: linux-wireless@vger.kernel.org
3366W: http://prism54.org 4154W: http://prism54.org
3367T: git kernel.org:/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git 4155T: git git://git.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
3368S: Maintained 4156S: Maintained
4157F: drivers/net/wireless/p54/
3369 4158
3370PA SEMI ETHERNET DRIVER 4159PA SEMI ETHERNET DRIVER
3371P: Olof Johansson 4160P: Olof Johansson
3372M: olof@lixom.net 4161M: olof@lixom.net
3373L: netdev@vger.kernel.org 4162L: netdev@vger.kernel.org
3374S: Maintained 4163S: Maintained
4164F: drivers/net/pasemi_mac.*
3375 4165
3376PA SEMI SMBUS DRIVER 4166PA SEMI SMBUS DRIVER
3377P: Olof Johansson 4167P: Olof Johansson
3378M: olof@lixom.net 4168M: olof@lixom.net
3379L: linux-i2c@vger.kernel.org 4169L: linux-i2c@vger.kernel.org
3380S: Maintained 4170S: Maintained
4171F: drivers/i2c/busses/i2c-pasemi.c
3381 4172
3382PANASONIC LAPTOP ACPI EXTRAS DRIVER 4173PANASONIC LAPTOP ACPI EXTRAS DRIVER
3383P: Harald Welte 4174P: Harald Welte
3384M: laforge@gnumonks.org 4175M: laforge@gnumonks.org
3385S: Maintained 4176S: Maintained
4177F: drivers/platform/x86/panasonic-laptop.c
3386 4178
3387PANASONIC MN10300/AM33 PORT 4179PANASONIC MN10300/AM33 PORT
3388P: David Howells 4180P: David Howells
@@ -3392,10 +4184,16 @@ M: yasutake.koichi@jp.panasonic.com
3392L: linux-am33-list@redhat.com (moderated for non-subscribers) 4184L: linux-am33-list@redhat.com (moderated for non-subscribers)
3393W: ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/ 4185W: ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/
3394S: Maintained 4186S: Maintained
4187F: Documentation/mn10300/
4188F: arch/mn10300/
3395 4189
3396PARALLEL PORT SUPPORT 4190PARALLEL PORT SUPPORT
3397L: linux-parport@lists.infradead.org (subscribers-only) 4191L: linux-parport@lists.infradead.org (subscribers-only)
3398S: Orphan 4192S: Orphan
4193F: drivers/parport/
4194F: include/linux/parport*.h
4195F: drivers/char/ppdev.c
4196F: include/linux/ppdev.h
3399 4197
3400PARAVIRT_OPS INTERFACE 4198PARAVIRT_OPS INTERFACE
3401P: Jeremy Fitzhardinge 4199P: Jeremy Fitzhardinge
@@ -3409,6 +4207,9 @@ M: rusty@rustcorp.com.au
3409L: virtualization@lists.osdl.org 4207L: virtualization@lists.osdl.org
3410L: linux-kernel@vger.kernel.org 4208L: linux-kernel@vger.kernel.org
3411S: Supported 4209S: Supported
4210F: Documentation/ia64/paravirt_ops.txt
4211F: arch/*/kernel/paravirt*
4212F: arch/*/include/asm/paravirt.h
3412 4213
3413PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES 4214PARIDE DRIVERS FOR PARALLEL PORT IDE DEVICES
3414P: Tim Waugh 4215P: Tim Waugh
@@ -3416,6 +4217,8 @@ M: tim@cyberelk.net
3416L: linux-parport@lists.infradead.org (subscribers-only) 4217L: linux-parport@lists.infradead.org (subscribers-only)
3417W: http://www.torque.net/linux-pp.html 4218W: http://www.torque.net/linux-pp.html
3418S: Maintained 4219S: Maintained
4220F: Documentation/blockdev/paride.txt
4221F: drivers/block/paride/
3419 4222
3420PARISC ARCHITECTURE 4223PARISC ARCHITECTURE
3421P: Kyle McMartin 4224P: Kyle McMartin
@@ -3424,24 +4227,31 @@ P: Helge Deller
3424M: deller@gmx.de 4227M: deller@gmx.de
3425L: linux-parisc@vger.kernel.org 4228L: linux-parisc@vger.kernel.org
3426W: http://www.parisc-linux.org/ 4229W: http://www.parisc-linux.org/
3427T: git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git 4230T: git git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
3428S: Maintained 4231S: Maintained
4232F: arch/parisc/
4233F: drivers/parisc/
3429 4234
3430PC87360 HARDWARE MONITORING DRIVER 4235PC87360 HARDWARE MONITORING DRIVER
3431P: Jim Cromie 4236P: Jim Cromie
3432M: jim.cromie@gmail.com 4237M: jim.cromie@gmail.com
3433L: lm-sensors@lm-sensors.org 4238L: lm-sensors@lm-sensors.org
3434S: Maintained 4239S: Maintained
4240F: Documentation/hwmon/pc87360
4241F: drivers/hwmon/pc87360.c
3435 4242
3436PC8736x GPIO DRIVER 4243PC8736x GPIO DRIVER
3437P: Jim Cromie 4244P: Jim Cromie
3438M: jim.cromie@gmail.com 4245M: jim.cromie@gmail.com
3439S: Maintained 4246S: Maintained
4247F: drivers/char/pc8736x_gpio.c
3440 4248
3441PCA9532 LED DRIVER 4249PCA9532 LED DRIVER
3442P: Riku Voipio 4250P: Riku Voipio
3443M: riku.voipio@iki.fi 4251M: riku.voipio@iki.fi
3444S: Maintained 4252S: Maintained
4253F: drivers/leds/leds-pca9532.c
4254F: include/linux/leds-pca9532.h
3445 4255
3446PCI ERROR RECOVERY 4256PCI ERROR RECOVERY
3447P: Linas Vepstas 4257P: Linas Vepstas
@@ -3449,63 +4259,82 @@ M: linas@austin.ibm.com
3449L: linux-kernel@vger.kernel.org 4259L: linux-kernel@vger.kernel.org
3450L: linux-pci@vger.kernel.org 4260L: linux-pci@vger.kernel.org
3451S: Supported 4261S: Supported
4262F: Documentation/PCI/pci-error-recovery.txt
4263F: Documentation/powerpc/eeh-pci-error-recovery.txt
3452 4264
3453PCI SUBSYSTEM 4265PCI SUBSYSTEM
3454P: Jesse Barnes 4266P: Jesse Barnes
3455M: jbarnes@virtuousgeek.org 4267M: jbarnes@virtuousgeek.org
3456L: linux-kernel@vger.kernel.org 4268L: linux-kernel@vger.kernel.org
3457L: linux-pci@vger.kernel.org 4269L: linux-pci@vger.kernel.org
3458T: git kernel.org:/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git 4270T: git git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git
3459S: Supported 4271S: Supported
4272F: Documentation/PCI/
4273F: drivers/pci/
4274F: include/linux/pci*
3460 4275
3461PCIE HOTPLUG DRIVER 4276PCIE HOTPLUG DRIVER
3462P: Kristen Carlson Accardi 4277P: Kristen Carlson Accardi
3463M: kristen.c.accardi@intel.com 4278M: kristen.c.accardi@intel.com
3464L: linux-pci@vger.kernel.org 4279L: linux-pci@vger.kernel.org
3465S: Supported 4280S: Supported
4281F: drivers/pci/pcie/
3466 4282
3467PCMCIA SUBSYSTEM 4283PCMCIA SUBSYSTEM
3468P: Linux PCMCIA Team 4284P: Linux PCMCIA Team
3469L: linux-pcmcia@lists.infradead.org 4285L: linux-pcmcia@lists.infradead.org
3470W: http://lists.infradead.org/mailman/listinfo/linux-pcmcia 4286W: http://lists.infradead.org/mailman/listinfo/linux-pcmcia
3471T: git kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git 4287T: git git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
3472S: Maintained 4288S: Maintained
4289F: Documentation/pcmcia/
4290F: drivers/pcmcia/
4291F: include/pcmcia/
3473 4292
3474PCNET32 NETWORK DRIVER 4293PCNET32 NETWORK DRIVER
3475P: Don Fry 4294P: Don Fry
3476M: pcnet32@verizon.net 4295M: pcnet32@verizon.net
3477L: netdev@vger.kernel.org 4296L: netdev@vger.kernel.org
3478S: Maintained 4297S: Maintained
4298F: drivers/net/pcnet32.c
3479 4299
3480PER-TASK DELAY ACCOUNTING 4300PER-TASK DELAY ACCOUNTING
3481P: Balbir Singh 4301P: Balbir Singh
3482M: balbir@linux.vnet.ibm.com 4302M: balbir@linux.vnet.ibm.com
3483L: linux-kernel@vger.kernel.org 4303L: linux-kernel@vger.kernel.org
3484S: Maintained 4304S: Maintained
4305F: include/linux/delayacct.h
4306F: kernel/delayacct.c
3485 4307
3486PERSONALITY HANDLING 4308PERSONALITY HANDLING
3487P: Christoph Hellwig 4309P: Christoph Hellwig
3488M: hch@infradead.org 4310M: hch@infradead.org
3489L: linux-abi-devel@lists.sourceforge.net 4311L: linux-abi-devel@lists.sourceforge.net
3490S: Maintained 4312S: Maintained
4313F: include/linux/personality.h
3491 4314
3492PHRAM MTD DRIVER 4315PHRAM MTD DRIVER
3493P: Joern Engel 4316P: Joern Engel
3494M: joern@lazybastard.org 4317M: joern@lazybastard.org
3495L: linux-mtd@lists.infradead.org 4318L: linux-mtd@lists.infradead.org
3496S: Maintained 4319S: Maintained
4320F: drivers/mtd/devices/phram.c
3497 4321
3498PKTCDVD DRIVER 4322PKTCDVD DRIVER
3499P: Peter Osterlund 4323P: Peter Osterlund
3500M: petero2@telia.com 4324M: petero2@telia.com
3501L: linux-kernel@vger.kernel.org 4325L: linux-kernel@vger.kernel.org
3502S: Maintained 4326S: Maintained
4327F: drivers/block/pktcdvd.c
4328F: include/linux/pktcdvd.h
3503 4329
3504POSIX CLOCKS and TIMERS 4330POSIX CLOCKS and TIMERS
3505P: Thomas Gleixner 4331P: Thomas Gleixner
3506M: tglx@linutronix.de 4332M: tglx@linutronix.de
3507L: linux-kernel@vger.kernel.org 4333L: linux-kernel@vger.kernel.org
3508S: Supported 4334S: Supported
4335F: fs/timerfd.c
4336F: include/linux/timer*
4337F: kernel/*timer*
3509 4338
3510POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS 4339POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
3511P: Anton Vorontsov 4340P: Anton Vorontsov
@@ -3513,8 +4342,10 @@ M: cbou@mail.ru
3513P: David Woodhouse 4342P: David Woodhouse
3514M: dwmw2@infradead.org 4343M: dwmw2@infradead.org
3515L: linux-kernel@vger.kernel.org 4344L: linux-kernel@vger.kernel.org
3516T: git git.infradead.org/battery-2.6.git 4345T: git git://git.infradead.org/battery-2.6.git
3517S: Maintained 4346S: Maintained
4347F: include/linux/power_supply.h
4348F: drivers/power/power_supply*
3518 4349
3519PNP SUPPORT 4350PNP SUPPORT
3520P: Adam Belay 4351P: Adam Belay
@@ -3522,33 +4353,42 @@ M: abelay@mit.edu
3522P: Bjorn Helgaas 4353P: Bjorn Helgaas
3523M: bjorn.helgaas@hp.com 4354M: bjorn.helgaas@hp.com
3524S: Maintained 4355S: Maintained
4356F: drivers/pnp/
3525 4357
3526PNXxxxx I2C DRIVER 4358PNXxxxx I2C DRIVER
3527P: Vitaly Wool 4359P: Vitaly Wool
3528M: vitalywool@gmail.com 4360M: vitalywool@gmail.com
3529L: linux-i2c@vger.kernel.org 4361L: linux-i2c@vger.kernel.org
3530S: Maintained 4362S: Maintained
4363F: drivers/i2c/busses/i2c-pnx.c
3531 4364
3532PPP PROTOCOL DRIVERS AND COMPRESSORS 4365PPP PROTOCOL DRIVERS AND COMPRESSORS
3533P: Paul Mackerras 4366P: Paul Mackerras
3534M: paulus@samba.org 4367M: paulus@samba.org
3535L: linux-ppp@vger.kernel.org 4368L: linux-ppp@vger.kernel.org
3536S: Maintained 4369S: Maintained
4370F: drivers/net/ppp_*
3537 4371
3538PPP OVER ATM (RFC 2364) 4372PPP OVER ATM (RFC 2364)
3539P: Mitchell Blank Jr 4373P: Mitchell Blank Jr
3540M: mitch@sfgoth.com 4374M: mitch@sfgoth.com
3541S: Maintained 4375S: Maintained
4376F: net/atm/pppoatm.c
4377F: include/linux/atmppp.h
3542 4378
3543PPP OVER ETHERNET 4379PPP OVER ETHERNET
3544P: Michal Ostrowski 4380P: Michal Ostrowski
3545M: mostrows@earthlink.net 4381M: mostrows@earthlink.net
3546S: Maintained 4382S: Maintained
4383F: drivers/net/pppoe.c
4384F: drivers/net/pppox.c
3547 4385
3548PPP OVER L2TP 4386PPP OVER L2TP
3549P: James Chapman 4387P: James Chapman
3550M: jchapman@katalix.com 4388M: jchapman@katalix.com
3551S: Maintained 4389S: Maintained
4390F: drivers/net/pppol2tp.c
4391F: include/linux/if_pppol2tp.h
3552 4392
3553PREEMPTIBLE KERNEL 4393PREEMPTIBLE KERNEL
3554P: Robert Love 4394P: Robert Love
@@ -3557,6 +4397,8 @@ L: linux-kernel@vger.kernel.org
3557L: kpreempt-tech@lists.sourceforge.net 4397L: kpreempt-tech@lists.sourceforge.net
3558W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel 4398W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel
3559S: Supported 4399S: Supported
4400F: Documentation/preempt-locking.txt
4401F: include/linux/preempt.h
3560 4402
3561PRISM54 WIRELESS DRIVER 4403PRISM54 WIRELESS DRIVER
3562P: Luis R. Rodriguez 4404P: Luis R. Rodriguez
@@ -3564,6 +4406,7 @@ M: mcgrof@gmail.com
3564L: linux-wireless@vger.kernel.org 4406L: linux-wireless@vger.kernel.org
3565W: http://prism54.org 4407W: http://prism54.org
3566S: Maintained 4408S: Maintained
4409F: drivers/net/wireless/prism54/
3567 4410
3568PROMISE DC4030 CACHING DISK CONTROLLER DRIVER 4411PROMISE DC4030 CACHING DISK CONTROLLER DRIVER
3569P: Peter Denison 4412P: Peter Denison
@@ -3576,6 +4419,7 @@ P: Mikael Pettersson
3576M: mikpe@it.uu.se 4419M: mikpe@it.uu.se
3577L: linux-ide@vger.kernel.org 4420L: linux-ide@vger.kernel.org
3578S: Maintained 4421S: Maintained
4422F: drivers/ata/sata_promise.*
3579 4423
3580PS3 NETWORK SUPPORT 4424PS3 NETWORK SUPPORT
3581P: Masakazu Mokuno 4425P: Masakazu Mokuno
@@ -3583,6 +4427,7 @@ M: mokuno@sm.sony.co.jp
3583L: netdev@vger.kernel.org 4427L: netdev@vger.kernel.org
3584L: cbe-oss-dev@ozlabs.org 4428L: cbe-oss-dev@ozlabs.org
3585S: Supported 4429S: Supported
4430F: drivers/net/ps3_gelic_net.*
3586 4431
3587PS3 PLATFORM SUPPORT 4432PS3 PLATFORM SUPPORT
3588P: Geoff Levand 4433P: Geoff Levand
@@ -3590,6 +4435,13 @@ M: geoffrey.levand@am.sony.com
3590L: linuxppc-dev@ozlabs.org 4435L: linuxppc-dev@ozlabs.org
3591L: cbe-oss-dev@ozlabs.org 4436L: cbe-oss-dev@ozlabs.org
3592S: Supported 4437S: Supported
4438F: arch/powerpc/boot/ps3*
4439F: arch/powerpc/include/asm/lv1call.h
4440F: arch/powerpc/include/asm/ps3*.h
4441F: arch/powerpc/platforms/ps3/
4442F: drivers/*/ps3*
4443F: drivers/ps3/
4444F: drivers/usb/host/*ps3.c
3593 4445
3594PS3VRAM DRIVER 4446PS3VRAM DRIVER
3595P: Jim Paris 4447P: Jim Paris
@@ -3603,8 +4455,10 @@ M: isely@pobox.com
3603L: pvrusb2@isely.net (subscribers-only) 4455L: pvrusb2@isely.net (subscribers-only)
3604L: linux-media@vger.kernel.org 4456L: linux-media@vger.kernel.org
3605W: http://www.isely.net/pvrusb2/ 4457W: http://www.isely.net/pvrusb2/
3606T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4458T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
3607S: Maintained 4459S: Maintained
4460F: Documentation/video4linux/README.pvrusb2
4461F: drivers/media/video/pvrusb2/
3608 4462
3609PXA2xx/PXA3xx SUPPORT 4463PXA2xx/PXA3xx SUPPORT
3610P: Eric Miao 4464P: Eric Miao
@@ -3613,6 +4467,12 @@ P: Russell King
3613M: linux@arm.linux.org.uk 4467M: linux@arm.linux.org.uk
3614L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4468L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3615S: Maintained 4469S: Maintained
4470F: arch/arm/mach-pxa/
4471F: drivers/pcmcia/pxa2xx*
4472F: drivers/spi/pxa2xx*
4473F: drivers/usb/gadget/pxa2*
4474F: include/sound/pxa2xx-lib.h
4475F: sound/soc/pxa/pxa2xx*
3616 4476
3617PXA168 SUPPORT 4477PXA168 SUPPORT
3618P: Eric Miao 4478P: Eric Miao
@@ -3620,14 +4480,14 @@ M: eric.miao@marvell.com
3620P: Jason Chagas 4480P: Jason Chagas
3621M: jason.chagas@marvell.com 4481M: jason.chagas@marvell.com
3622L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4482L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3623T: git kernel.org:/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4483T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
3624S: Supported 4484S: Supported
3625 4485
3626PXA910 SUPPORT 4486PXA910 SUPPORT
3627P: Eric Miao 4487P: Eric Miao
3628M: eric.miao@marvell.com 4488M: eric.miao@marvell.com
3629L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4489L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3630T: git kernel.org:/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4490T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
3631S: Supported 4491S: Supported
3632 4492
3633PXA MMCI DRIVER 4493PXA MMCI DRIVER
@@ -3644,12 +4504,16 @@ P: Andrew Vasquez
3644M: linux-driver@qlogic.com 4504M: linux-driver@qlogic.com
3645L: linux-scsi@vger.kernel.org 4505L: linux-scsi@vger.kernel.org
3646S: Supported 4506S: Supported
4507F: Documentation/scsi/LICENSE.qla2xxx
4508F: drivers/scsi/qla2xxx/
3647 4509
3648QLOGIC QLA3XXX NETWORK DRIVER 4510QLOGIC QLA3XXX NETWORK DRIVER
3649P: Ron Mercer 4511P: Ron Mercer
3650M: linux-driver@qlogic.com 4512M: linux-driver@qlogic.com
3651L: netdev@vger.kernel.org 4513L: netdev@vger.kernel.org
3652S: Supported 4514S: Supported
4515F: Documentation/networking/LICENSE.qla3xxx
4516F: drivers/net/qla3xxx.*
3653 4517
3654QLOGIC QLGE 10Gb ETHERNET DRIVER 4518QLOGIC QLGE 10Gb ETHERNET DRIVER
3655P: Ron Mercer 4519P: Ron Mercer
@@ -3657,6 +4521,7 @@ M: linux-driver@qlogic.com
3657M: ron.mercer@qlogic.com 4521M: ron.mercer@qlogic.com
3658L: netdev@vger.kernel.org 4522L: netdev@vger.kernel.org
3659S: Supported 4523S: Supported
4524F: drivers/net/qlge/
3660 4525
3661QNX4 FILESYSTEM 4526QNX4 FILESYSTEM
3662P: Anders Larsen 4527P: Anders Larsen
@@ -3664,18 +4529,24 @@ M: al@alarsen.net
3664L: linux-kernel@vger.kernel.org 4529L: linux-kernel@vger.kernel.org
3665W: http://www.alarsen.net/linux/qnx4fs/ 4530W: http://www.alarsen.net/linux/qnx4fs/
3666S: Maintained 4531S: Maintained
4532F: fs/qnx4/
4533F: include/linux/qnx4_fs.h
4534F: include/linux/qnxtypes.h
3667 4535
3668RADEON FRAMEBUFFER DISPLAY DRIVER 4536RADEON FRAMEBUFFER DISPLAY DRIVER
3669P: Benjamin Herrenschmidt 4537P: Benjamin Herrenschmidt
3670M: benh@kernel.crashing.org 4538M: benh@kernel.crashing.org
3671L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4539L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3672S: Maintained 4540S: Maintained
4541F: drivers/video/aty/radeon*
4542F: include/linux/radeonfb.h
3673 4543
3674RAGE128 FRAMEBUFFER DISPLAY DRIVER 4544RAGE128 FRAMEBUFFER DISPLAY DRIVER
3675P: Paul Mackerras 4545P: Paul Mackerras
3676M: paulus@samba.org 4546M: paulus@samba.org
3677L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4547L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3678S: Maintained 4548S: Maintained
4549F: drivers/video/aty/aty128fb.c
3679 4550
3680RALINK RT2X00 WIRELESS LAN DRIVER 4551RALINK RT2X00 WIRELESS LAN DRIVER
3681P: rt2x00 project 4552P: rt2x00 project
@@ -3683,36 +4554,43 @@ L: linux-wireless@vger.kernel.org
3683L: users@rt2x00.serialmonkey.com 4554L: users@rt2x00.serialmonkey.com
3684W: http://rt2x00.serialmonkey.com/ 4555W: http://rt2x00.serialmonkey.com/
3685S: Maintained 4556S: Maintained
3686T: git kernel.org:/pub/scm/linux/kernel/git/ivd/rt2x00.git 4557T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git
3687F: drivers/net/wireless/rt2x00/ 4558F: drivers/net/wireless/rt2x00/
3688 4559
3689RAMDISK RAM BLOCK DEVICE DRIVER 4560RAMDISK RAM BLOCK DEVICE DRIVER
3690P: Nick Piggin 4561P: Nick Piggin
3691M: npiggin@suse.de 4562M: npiggin@suse.de
3692S: Maintained 4563S: Maintained
4564F: Documentation/blockdev/ramdisk.txt
4565F: drivers/block/brd.c
3693 4566
3694RANDOM NUMBER DRIVER 4567RANDOM NUMBER DRIVER
3695P: Matt Mackall 4568P: Matt Mackall
3696M: mpm@selenic.com 4569M: mpm@selenic.com
3697S: Maintained 4570S: Maintained
4571F: drivers/char/random.c
3698 4572
3699RAPIDIO SUBSYSTEM 4573RAPIDIO SUBSYSTEM
3700P: Matt Porter 4574P: Matt Porter
3701M: mporter@kernel.crashing.org 4575M: mporter@kernel.crashing.org
3702L: linux-kernel@vger.kernel.org 4576L: linux-kernel@vger.kernel.org
3703S: Maintained 4577S: Maintained
4578F: drivers/rapidio/
3704 4579
3705RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER 4580RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
3706P: Corey Thomas 4581P: Corey Thomas
3707M: coreythomas@charter.net 4582M: coreythomas@charter.net
3708L: linux-wireless@vger.kernel.org 4583L: linux-wireless@vger.kernel.org
3709S: Maintained 4584S: Maintained
4585F: drivers/net/wireless/ray*
3710 4586
3711RCUTORTURE MODULE 4587RCUTORTURE MODULE
3712P: Josh Triplett 4588P: Josh Triplett
3713M: josh@freedesktop.org 4589M: josh@freedesktop.org
3714L: linux-kernel@vger.kernel.org 4590L: linux-kernel@vger.kernel.org
3715S: Maintained 4591S: Maintained
4592F: Documentation/RCU/torture.txt
4593F: kernel/rcutorture.c
3716 4594
3717RDC R-321X SoC 4595RDC R-321X SoC
3718P: Florian Fainelli 4596P: Florian Fainelli
@@ -3725,12 +4603,14 @@ P: Florian Fainelli
3725M: florian.fainelli@telecomint.eu 4603M: florian.fainelli@telecomint.eu
3726L: netdev@vger.kernel.org 4604L: netdev@vger.kernel.org
3727S: Maintained 4605S: Maintained
4606F: drivers/net/r6040.c
3728 4607
3729RDS - RELIABLE DATAGRAM SOCKETS 4608RDS - RELIABLE DATAGRAM SOCKETS
3730P: Andy Grover 4609P: Andy Grover
3731M: andy.grover@oracle.com 4610M: andy.grover@oracle.com
3732L: rds-devel@oss.oracle.com 4611L: rds-devel@oss.oracle.com
3733S: Supported 4612S: Supported
4613F: net/rds/
3734 4614
3735READ-COPY UPDATE (RCU) 4615READ-COPY UPDATE (RCU)
3736P: Dipankar Sarma 4616P: Dipankar Sarma
@@ -3738,37 +4618,54 @@ M: dipankar@in.ibm.com
3738W: http://www.rdrop.com/users/paulmck/rclock/ 4618W: http://www.rdrop.com/users/paulmck/rclock/
3739L: linux-kernel@vger.kernel.org 4619L: linux-kernel@vger.kernel.org
3740S: Supported 4620S: Supported
4621F: Documentation/RCU/rcu.txt
4622F: Documentation/RCU/rcuref.txt
4623F: include/linux/rcupdate.h
4624F: include/linux/srcu.h
4625F: kernel/rcupdate.c
3741 4626
3742REAL TIME CLOCK DRIVER 4627REAL TIME CLOCK DRIVER
3743P: Paul Gortmaker 4628P: Paul Gortmaker
3744M: p_gortmaker@yahoo.com 4629M: p_gortmaker@yahoo.com
3745L: linux-kernel@vger.kernel.org 4630L: linux-kernel@vger.kernel.org
3746S: Maintained 4631S: Maintained
4632F: Documentation/rtc.txt
4633F: drivers/rtc/
4634F: include/linux/rtc.h
3747 4635
3748REAL TIME CLOCK (RTC) SUBSYSTEM 4636REAL TIME CLOCK (RTC) SUBSYSTEM
3749P: Alessandro Zummo 4637P: Alessandro Zummo
3750M: a.zummo@towertech.it 4638M: a.zummo@towertech.it
3751L: rtc-linux@googlegroups.com 4639L: rtc-linux@googlegroups.com
3752S: Maintained 4640S: Maintained
4641F: Documentation/rtc.txt
4642F: drivers/rtc/
4643F: include/linux/rtc.h
3753 4644
3754REISERFS FILE SYSTEM 4645REISERFS FILE SYSTEM
3755L: reiserfs-devel@vger.kernel.org 4646L: reiserfs-devel@vger.kernel.org
3756S: Supported 4647S: Supported
4648F: fs/reiserfs/
3757 4649
3758RFKILL 4650RFKILL
3759P: Ivo van Doorn 4651P: Ivo van Doorn
3760M: IvDoorn@gmail.com 4652M: IvDoorn@gmail.com
3761L: netdev@vger.kernel.org 4653L: netdev@vger.kernel.org
3762S: Maintained 4654S: Maintained
3763F: net/rfkill 4655F Documentation/rfkill.txt
4656F: net/rfkill/
3764 4657
3765RISCOM8 DRIVER 4658RISCOM8 DRIVER
3766S: Orphan 4659S: Orphan
4660F: Documentation/serial/riscom8.txt
4661F: drivers/char/riscom8*
3767 4662
3768ROCKETPORT DRIVER 4663ROCKETPORT DRIVER
3769P: Comtrol Corp. 4664P: Comtrol Corp.
3770W: http://www.comtrol.com 4665W: http://www.comtrol.com
3771S: Maintained 4666S: Maintained
4667F: Documentation/serial/rocket.txt
4668F: drivers/char/rocket*
3772 4669
3773ROSE NETWORK LAYER 4670ROSE NETWORK LAYER
3774P: Ralf Baechle 4671P: Ralf Baechle
@@ -3776,32 +4673,38 @@ M: ralf@linux-mips.org
3776L: linux-hams@vger.kernel.org 4673L: linux-hams@vger.kernel.org
3777W: http://www.linux-ax25.org/ 4674W: http://www.linux-ax25.org/
3778S: Maintained 4675S: Maintained
4676F: include/linux/rose.h
4677F: include/net/rose.h
4678F: net/rose/
3779 4679
3780RTL8180 WIRELESS DRIVER 4680RTL8180 WIRELESS DRIVER
3781P: John W. Linville 4681P: John W. Linville
3782M: linville@tuxdriver.com 4682M: linville@tuxdriver.com
3783L: linux-wireless@vger.kernel.org 4683L: linux-wireless@vger.kernel.org
3784W: http://linuxwireless.org/ 4684W: http://linuxwireless.org/
3785T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-testing.git 4685T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
3786S: Maintained 4686S: Maintained
4687F: drivers/net/wireless/rtl818*
3787 4688
3788RTL8187 WIRELESS DRIVER 4689RTL8187 WIRELESS DRIVER
3789P: Herton Ronaldo Krzesinski 4690P: Herton Ronaldo Krzesinski
3790M: herton@mandriva.com.br 4691M: herton@mandriva.com.br
3791P: Hin-Tak Leung 4692P: Hin-Tak Leung
3792M htl10@users.sourceforge.net 4693M: htl10@users.sourceforge.net
3793P: Larry Finger 4694P: Larry Finger
3794M: Larry.Finger@lwfinger.net 4695M: Larry.Finger@lwfinger.net
3795L: linux-wireless@vger.kernel.org 4696L: linux-wireless@vger.kernel.org
3796W: http://linuxwireless.org/ 4697W: http://linuxwireless.org/
3797T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-testing.git 4698T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
3798S: Maintained 4699S: Maintained
4700F: drivers/net/wireless/rtl818x/rtl8187*
3799 4701
3800S3 SAVAGE FRAMEBUFFER DRIVER 4702S3 SAVAGE FRAMEBUFFER DRIVER
3801P: Antonino Daplas 4703P: Antonino Daplas
3802M: adaplas@gmail.com 4704M: adaplas@gmail.com
3803L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4705L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
3804S: Maintained 4706S: Maintained
4707F: drivers/video/savage/
3805 4708
3806S390 4709S390
3807P: Martin Schwidefsky 4710P: Martin Schwidefsky
@@ -3812,6 +4715,7 @@ M: linux390@de.ibm.com
3812L: linux-s390@vger.kernel.org 4715L: linux-s390@vger.kernel.org
3813W: http://www.ibm.com/developerworks/linux/linux390/ 4716W: http://www.ibm.com/developerworks/linux/linux390/
3814S: Supported 4717S: Supported
4718F: arch/s390/
3815 4719
3816S390 NETWORK DRIVERS 4720S390 NETWORK DRIVERS
3817P: Ursula Braun 4721P: Ursula Braun
@@ -3822,6 +4726,7 @@ M: linux390@de.ibm.com
3822L: linux-s390@vger.kernel.org 4726L: linux-s390@vger.kernel.org
3823W: http://www.ibm.com/developerworks/linux/linux390/ 4727W: http://www.ibm.com/developerworks/linux/linux390/
3824S: Supported 4728S: Supported
4729F: drivers/s390/net/
3825 4730
3826S390 ZCRYPT DRIVER 4731S390 ZCRYPT DRIVER
3827P: Felix Beck 4732P: Felix Beck
@@ -3831,6 +4736,7 @@ M: ralph.wuerthner@de.ibm.com
3831M: linux390@de.ibm.com 4736M: linux390@de.ibm.com
3832L: linux-s390@vger.kernel.org 4737L: linux-s390@vger.kernel.org
3833S: Supported 4738S: Supported
4739F: drivers/s390/crypto/
3834 4740
3835S390 ZFCP DRIVER 4741S390 ZFCP DRIVER
3836P: Christof Schmitt 4742P: Christof Schmitt
@@ -3841,6 +4747,8 @@ M: linux390@de.ibm.com
3841L: linux-s390@vger.kernel.org 4747L: linux-s390@vger.kernel.org
3842W: http://www.ibm.com/developerworks/linux/linux390/ 4748W: http://www.ibm.com/developerworks/linux/linux390/
3843S: Supported 4749S: Supported
4750F: Documentation/s390/zfcpdump.txt
4751F: drivers/s390/scsi/zfcp_*
3844 4752
3845S390 IUCV NETWORK LAYER 4753S390 IUCV NETWORK LAYER
3846P: Ursula Braun 4754P: Ursula Braun
@@ -3849,6 +4757,9 @@ M: linux390@de.ibm.com
3849L: linux-s390@vger.kernel.org 4757L: linux-s390@vger.kernel.org
3850W: http://www.ibm.com/developerworks/linux/linux390/ 4758W: http://www.ibm.com/developerworks/linux/linux390/
3851S: Supported 4759S: Supported
4760F: drivers/s390/net/*iucv*
4761F: include/net/iucv/
4762F: net/iucv/
3852 4763
3853S3C24XX SD/MMC Driver 4764S3C24XX SD/MMC Driver
3854P: Ben Dooks 4765P: Ben Dooks
@@ -3856,19 +4767,24 @@ M: ben-linux@fluff.org
3856L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4767L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
3857L: linux-kernel@vger.kernel.org 4768L: linux-kernel@vger.kernel.org
3858S: Supported 4769S: Supported
4770F: drivers/mmc/host/s3cmci.*
3859 4771
3860SAA7146 VIDEO4LINUX-2 DRIVER 4772SAA7146 VIDEO4LINUX-2 DRIVER
3861P: Michael Hunold 4773P: Michael Hunold
3862M: michael@mihu.de 4774M: michael@mihu.de
3863L: linux-media@vger.kernel.org 4775L: linux-media@vger.kernel.org
3864T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 4776T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
3865W: http://www.mihu.de/linux/saa7146 4777W: http://www.mihu.de/linux/saa7146
3866S: Maintained 4778S: Maintained
4779F: drivers/media/common/saa7146*
4780F: drivers/media/video/*7146*
4781F: include/media/*7146*
3867 4782
3868SC1200 WDT DRIVER 4783SC1200 WDT DRIVER
3869P: Zwane Mwaikambo 4784P: Zwane Mwaikambo
3870M: zwane@arm.linux.org.uk 4785M: zwane@arm.linux.org.uk
3871S: Maintained 4786S: Maintained
4787F: drivers/watchdog/sc1200wdt.c
3872 4788
3873SCHEDULER 4789SCHEDULER
3874P: Ingo Molnar 4790P: Ingo Molnar
@@ -3877,6 +4793,8 @@ P: Peter Zijlstra
3877M: peterz@infradead.org 4793M: peterz@infradead.org
3878L: linux-kernel@vger.kernel.org 4794L: linux-kernel@vger.kernel.org
3879S: Maintained 4795S: Maintained
4796F: kernel/sched*
4797F: include/linux/sched.h
3880 4798
3881SCSI CDROM DRIVER 4799SCSI CDROM DRIVER
3882P: Jens Axboe 4800P: Jens Axboe
@@ -3884,6 +4802,7 @@ M: axboe@kernel.dk
3884L: linux-scsi@vger.kernel.org 4802L: linux-scsi@vger.kernel.org
3885W: http://www.kernel.dk 4803W: http://www.kernel.dk
3886S: Maintained 4804S: Maintained
4805F: drivers/scsi/sr*
3887 4806
3888SCSI SG DRIVER 4807SCSI SG DRIVER
3889P: Doug Gilbert 4808P: Doug Gilbert
@@ -3891,21 +4810,27 @@ M: dgilbert@interlog.com
3891L: linux-scsi@vger.kernel.org 4810L: linux-scsi@vger.kernel.org
3892W: http://www.torque.net/sg 4811W: http://www.torque.net/sg
3893S: Maintained 4812S: Maintained
4813F: drivers/scsi/sg.c
4814F: include/scsi/sg.h
3894 4815
3895SCSI SUBSYSTEM 4816SCSI SUBSYSTEM
3896P: James E.J. Bottomley 4817P: James E.J. Bottomley
3897M: James.Bottomley@HansenPartnership.com 4818M: James.Bottomley@HansenPartnership.com
3898L: linux-scsi@vger.kernel.org 4819L: linux-scsi@vger.kernel.org
3899T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 4820T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
3900T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git 4821T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git
3901T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-pending-2.6.git 4822T: git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-pending-2.6.git
3902S: Maintained 4823S: Maintained
4824F: drivers/scsi/
4825F: include/scsi/
3903 4826
3904SCSI TAPE DRIVER 4827SCSI TAPE DRIVER
3905P: Kai Mäkisara 4828P: Kai Mäkisara
3906M: Kai.Makisara@kolumbus.fi 4829M: Kai.Makisara@kolumbus.fi
3907L: linux-scsi@vger.kernel.org 4830L: linux-scsi@vger.kernel.org
3908S: Maintained 4831S: Maintained
4832F: Documentation/scsi/st.txt
4833F: drivers/scsi/st*
3909 4834
3910SCTP PROTOCOL 4835SCTP PROTOCOL
3911P: Vlad Yasevich 4836P: Vlad Yasevich
@@ -3915,27 +4840,41 @@ M: sri@us.ibm.com
3915L: linux-sctp@vger.kernel.org 4840L: linux-sctp@vger.kernel.org
3916W: http://lksctp.sourceforge.net 4841W: http://lksctp.sourceforge.net
3917S: Supported 4842S: Supported
4843F: Documentation/networking/sctp.txt
4844F: include/linux/sctp.h
4845F: include/net/sctp/
4846F: net/sctp/
3918 4847
3919SCx200 CPU SUPPORT 4848SCx200 CPU SUPPORT
3920P: Jim Cromie 4849P: Jim Cromie
3921M: jim.cromie@gmail.com 4850M: jim.cromie@gmail.com
3922S: Odd Fixes 4851S: Odd Fixes
4852F: Documentation/i2c/busses/scx200_acb
4853F: arch/x86/kernel/scx200_32.c
4854F: drivers/watchdog/scx200_wdt.c
4855F: drivers/i2c/busses/scx200*
4856F: drivers/mtd/maps/scx200_docflash.c
4857F: include/linux/scx200.h
3923 4858
3924SCx200 GPIO DRIVER 4859SCx200 GPIO DRIVER
3925P: Jim Cromie 4860P: Jim Cromie
3926M: jim.cromie@gmail.com 4861M: jim.cromie@gmail.com
3927S: Maintained 4862S: Maintained
4863F: drivers/char/scx200_gpio.c
4864F: include/linux/scx200_gpio.h
3928 4865
3929SCx200 HRT CLOCKSOURCE DRIVER 4866SCx200 HRT CLOCKSOURCE DRIVER
3930P: Jim Cromie 4867P: Jim Cromie
3931M: jim.cromie@gmail.com 4868M: jim.cromie@gmail.com
3932S: Maintained 4869S: Maintained
4870F: drivers/clocksource/scx200_hrt.c
3933 4871
3934SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER 4872SDRICOH_CS MMC/SD HOST CONTROLLER INTERFACE DRIVER
3935P: Sascha Sommer 4873P: Sascha Sommer
3936M: saschasommer@freenet.de 4874M: saschasommer@freenet.de
3937L: sdricohcs-devel@lists.sourceforge.net (subscribers-only) 4875L: sdricohcs-devel@lists.sourceforge.net (subscribers-only)
3938S: Maintained 4876S: Maintained
4877F: drivers/mmc/host/sdricoh_cs.c
3939 4878
3940SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER 4879SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
3941P: Pierre Ossman 4880P: Pierre Ossman
@@ -3949,16 +4888,17 @@ M: avorontsov@ru.mvista.com
3949L: linuxppc-dev@ozlabs.org 4888L: linuxppc-dev@ozlabs.org
3950L: sdhci-devel@lists.ossman.eu 4889L: sdhci-devel@lists.ossman.eu
3951S: Maintained 4890S: Maintained
4891F: drivers/mmc/host/sdhci.*
3952 4892
3953SECURITY SUBSYSTEM 4893SECURITY SUBSYSTEM
3954F: security/
3955P: James Morris 4894P: James Morris
3956M: jmorris@namei.org 4895M: jmorris@namei.org
3957L: linux-kernel@vger.kernel.org 4896L: linux-kernel@vger.kernel.org
3958L: linux-security-module@vger.kernel.org (suggested Cc:) 4897L: linux-security-module@vger.kernel.org (suggested Cc:)
3959T: git kernel.org:pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4898T: git git://www.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
3960W: http://security.wiki.kernel.org/ 4899W: http://security.wiki.kernel.org/
3961S: Supported 4900S: Supported
4901F: security/
3962 4902
3963SECURITY CONTACT 4903SECURITY CONTACT
3964P: Security Officers 4904P: Security Officers
@@ -3973,31 +4913,39 @@ M: jmorris@namei.org
3973P: Eric Paris 4913P: Eric Paris
3974M: eparis@parisplace.org 4914M: eparis@parisplace.org
3975L: linux-kernel@vger.kernel.org (kernel issues) 4915L: linux-kernel@vger.kernel.org (kernel issues)
3976L: selinux@tycho.nsa.gov (subscribers-only, general discussion) 4916L: selinux@tycho.nsa.gov (subscribers-only, general discussion)
3977W: http://selinuxproject.org 4917W: http://selinuxproject.org
3978T: git kernel.org:pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4918T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
3979S: Supported 4919S: Supported
4920F: include/linux/selinux*
4921F: security/selinux/
3980 4922
3981SENSABLE PHANTOM 4923SENSABLE PHANTOM
3982P: Jiri Slaby 4924P: Jiri Slaby
3983M: jirislaby@gmail.com 4925M: jirislaby@gmail.com
3984S: Maintained 4926S: Maintained
4927F: drivers/misc/phantom.c
4928F: include/linux/phantom.h
3985 4929
3986SERIAL ATA (SATA) SUBSYSTEM 4930SERIAL ATA (SATA) SUBSYSTEM
3987P: Jeff Garzik 4931P: Jeff Garzik
3988M: jgarzik@pobox.com 4932M: jgarzik@pobox.com
3989L: linux-ide@vger.kernel.org 4933L: linux-ide@vger.kernel.org
3990T: git kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 4934T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
3991S: Supported 4935S: Supported
4936F: drivers/ata/
4937F: include/linux/ata.h
4938F: include/linux/libata.h
3992 4939
3993SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER 4940SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
3994P: Sathya Perla 4941P: Sathya Perla
3995M: sathyap@serverengines.com 4942M: sathyap@serverengines.com
3996P: Subbu Seetharaman 4943P: Subbu Seetharaman
3997M: subbus@serverengines.com 4944M: subbus@serverengines.com
3998L: netdev@vger.kernel.org 4945L: netdev@vger.kernel.org
3999W: http://www.serverengines.com 4946W: http://www.serverengines.com
4000S: Supported 4947S: Supported
4948F: drivers/net/benet/
4001 4949
4002SFC NETWORK DRIVER 4950SFC NETWORK DRIVER
4003P: Steve Hodgson 4951P: Steve Hodgson
@@ -4005,17 +4953,22 @@ P: Ben Hutchings
4005P: Robert Stonehouse 4953P: Robert Stonehouse
4006M: linux-net-drivers@solarflare.com 4954M: linux-net-drivers@solarflare.com
4007S: Supported 4955S: Supported
4956F: drivers/net/sfc/
4008 4957
4009SGI GRU DRIVER 4958SGI GRU DRIVER
4010P: Jack Steiner 4959P: Jack Steiner
4011M: steiner@sgi.com 4960M: steiner@sgi.com
4012S: Maintained 4961S: Maintained
4962F: drivers/misc/sgi-gru/
4013 4963
4014SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER 4964SGI SN-IA64 (Altix) SERIAL CONSOLE DRIVER
4015P: Pat Gefre 4965P: Pat Gefre
4016M: pfg@sgi.com 4966M: pfg@sgi.com
4017L: linux-ia64@vger.kernel.org 4967L: linux-ia64@vger.kernel.org
4018S: Supported 4968S: Supported
4969F: Documentation/ia64/serial.txt
4970F: drivers/serial/ioc?_serial.c
4971F: include/linux/ioc?.h
4019 4972
4020SGI VISUAL WORKSTATION 320 AND 540 4973SGI VISUAL WORKSTATION 320 AND 540
4021P: Andrey Panin 4974P: Andrey Panin
@@ -4023,11 +4976,13 @@ M: pazke@donpac.ru
4023L: linux-visws-devel@lists.sf.net 4976L: linux-visws-devel@lists.sf.net
4024W: http://linux-visws.sf.net 4977W: http://linux-visws.sf.net
4025S: Maintained for 2.6. 4978S: Maintained for 2.6.
4979F: Documentation/sgi-visws.txt
4026 4980
4027SGI XP/XPC/XPNET DRIVER 4981SGI XP/XPC/XPNET DRIVER
4028P: Dean Nelson 4982P: Robin Holt
4029M: dcn@sgi.com 4983M: holt@sgi.com
4030S: Maintained 4984S: Maintained
4985F: drivers/misc/sgi-xp/
4031 4986
4032SHARP LH SUPPORT (LH7952X & LH7A40X) 4987SHARP LH SUPPORT (LH7952X & LH7A40X)
4033P: Marc Singer 4988P: Marc Singer
@@ -4035,12 +4990,18 @@ M: elf@buici.com
4035W: http://projects.buici.com/arm 4990W: http://projects.buici.com/arm
4036L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 4991L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
4037S: Maintained 4992S: Maintained
4993F: Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen
4994F: arch/arm/mach-lh7a40x/
4995F: drivers/serial/serial_lh7a40x.c
4996F: drivers/usb/gadget/lh7a40*
4997F: drivers/usb/host/ohci-lh7a40*
4038 4998
4039SHPC HOTPLUG DRIVER 4999SHPC HOTPLUG DRIVER
4040P: Kristen Carlson Accardi 5000P: Kristen Carlson Accardi
4041M: kristen.c.accardi@intel.com 5001M: kristen.c.accardi@intel.com
4042L: linux-pci@vger.kernel.org 5002L: linux-pci@vger.kernel.org
4043S: Supported 5003S: Supported
5004F: drivers/pci/hotplug/shpchp*
4044 5005
4045SIMTEC EB110ATX (Chalice CATS) 5006SIMTEC EB110ATX (Chalice CATS)
4046P: Ben Dooks 5007P: Ben Dooks
@@ -4048,6 +5009,7 @@ P: Vincent Sanders
4048M: support@simtec.co.uk 5009M: support@simtec.co.uk
4049W: http://www.simtec.co.uk/products/EB110ATX/ 5010W: http://www.simtec.co.uk/products/EB110ATX/
4050S: Supported 5011S: Supported
5012F: arch/arm/mach-ebsa110/
4051 5013
4052SIMTEC EB2410ITX (BAST) 5014SIMTEC EB2410ITX (BAST)
4053P: Ben Dooks 5015P: Ben Dooks
@@ -4055,12 +5017,16 @@ P: Vincent Sanders
4055M: support@simtec.co.uk 5017M: support@simtec.co.uk
4056W: http://www.simtec.co.uk/products/EB2410ITX/ 5018W: http://www.simtec.co.uk/products/EB2410ITX/
4057S: Supported 5019S: Supported
5020F: arch/arm/mach-s3c2410/
5021F: drivers/*/*s3c2410*
5022F: drivers/*/*/*s3c2410*
4058 5023
4059SIS 190 ETHERNET DRIVER 5024SIS 190 ETHERNET DRIVER
4060P: Francois Romieu 5025P: Francois Romieu
4061M: romieu@fr.zoreil.com 5026M: romieu@fr.zoreil.com
4062L: netdev@vger.kernel.org 5027L: netdev@vger.kernel.org
4063S: Maintained 5028S: Maintained
5029F: drivers/net/sis190.c
4064 5030
4065SIS 900/7016 FAST ETHERNET DRIVER 5031SIS 900/7016 FAST ETHERNET DRIVER
4066P: Daniele Venzano 5032P: Daniele Venzano
@@ -4068,30 +5034,39 @@ M: venza@brownhat.org
4068W: http://www.brownhat.org/sis900.html 5034W: http://www.brownhat.org/sis900.html
4069L: netdev@vger.kernel.org 5035L: netdev@vger.kernel.org
4070S: Maintained 5036S: Maintained
5037F: drivers/net/sis900.*
4071 5038
4072SIS 96X I2C/SMBUS DRIVER 5039SIS 96X I2C/SMBUS DRIVER
4073P: Mark M. Hoffman 5040P: Mark M. Hoffman
4074M: mhoffman@lightlink.com 5041M: mhoffman@lightlink.com
4075L: linux-i2c@vger.kernel.org 5042L: linux-i2c@vger.kernel.org
4076S: Maintained 5043S: Maintained
5044F: Documentation/i2c/busses/i2c-sis96x
5045F: drivers/i2c/busses/i2c-sis96x.c
4077 5046
4078SIS FRAMEBUFFER DRIVER 5047SIS FRAMEBUFFER DRIVER
4079P: Thomas Winischhofer 5048P: Thomas Winischhofer
4080M: thomas@winischhofer.net 5049M: thomas@winischhofer.net
4081W: http://www.winischhofer.net/linuxsisvga.shtml 5050W: http://www.winischhofer.net/linuxsisvga.shtml
4082S: Maintained 5051S: Maintained
5052F: Documentation/fb/sisfb.txt
5053F: drivers/video/sis/
5054F: include/video/sisfb.h
4083 5055
4084SIS USB2VGA DRIVER 5056SIS USB2VGA DRIVER
4085P: Thomas Winischhofer 5057P: Thomas Winischhofer
4086M: thomas@winischhofer.net 5058M: thomas@winischhofer.net
4087W: http://www.winischhofer.at/linuxsisusbvga.shtml 5059W: http://www.winischhofer.at/linuxsisusbvga.shtml
4088S: Maintained 5060S: Maintained
5061F: drivers/usb/misc/sisusbvga/
4089 5062
4090SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS 5063SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS
4091P: Stephen Hemminger 5064P: Stephen Hemminger
4092M: shemminger@linux-foundation.org 5065M: shemminger@linux-foundation.org
4093L: netdev@vger.kernel.org 5066L: netdev@vger.kernel.org
4094S: Maintained 5067S: Maintained
5068F: drivers/net/skge.*
5069F: drivers/net/sky2.*
4095 5070
4096SLAB ALLOCATOR 5071SLAB ALLOCATOR
4097P: Christoph Lameter 5072P: Christoph Lameter
@@ -4102,34 +5077,43 @@ P: Matt Mackall
4102M: mpm@selenic.com 5077M: mpm@selenic.com
4103L: linux-mm@kvack.org 5078L: linux-mm@kvack.org
4104S: Maintained 5079S: Maintained
5080F: include/linux/sl?b*.h
5081F: mm/sl?b.c
4105 5082
4106SMC91x ETHERNET DRIVER 5083SMC91x ETHERNET DRIVER
4107P: Nicolas Pitre 5084P: Nicolas Pitre
4108M: nico@cam.org 5085M: nico@cam.org
4109S: Maintained 5086S: Maintained
5087F: drivers/net/smc91x.*
4110 5088
4111SMSC47B397 HARDWARE MONITOR DRIVER 5089SMSC47B397 HARDWARE MONITOR DRIVER
4112P: Mark M. Hoffman 5090P: Mark M. Hoffman
4113M: mhoffman@lightlink.com 5091M: mhoffman@lightlink.com
4114L: lm-sensors@lm-sensors.org 5092L: lm-sensors@lm-sensors.org
4115S: Maintained 5093S: Maintained
5094F: Documentation/hwmon/smsc47b397
5095F: drivers/hwmon/smsc47b397.c
4116 5096
4117SMSC911x ETHERNET DRIVER 5097SMSC911x ETHERNET DRIVER
4118P: Steve Glendinning 5098P: Steve Glendinning
4119M: steve.glendinning@smsc.com 5099M: steve.glendinning@smsc.com
4120L: netdev@vger.kernel.org 5100L: netdev@vger.kernel.org
4121S: Supported 5101S: Supported
5102F: include/linux/smsc911x.h
5103F: drivers/net/smsc911x.*
4122 5104
4123SMSC9420 PCI ETHERNET DRIVER 5105SMSC9420 PCI ETHERNET DRIVER
4124P: Steve Glendinning 5106P: Steve Glendinning
4125M: steve.glendinning@smsc.com 5107M: steve.glendinning@smsc.com
4126L: netdev@vger.kernel.org 5108L: netdev@vger.kernel.org
4127S: Supported 5109S: Supported
5110F: drivers/net/smsc9420.*
4128 5111
4129SMX UIO Interface 5112SMX UIO Interface
4130P: Ben Nizette 5113P: Ben Nizette
4131M: bn@niasdigital.com 5114M: bn@niasdigital.com
4132S: Maintained 5115S: Maintained
5116F: drivers/uio/uio_smx.c
4133 5117
4134SN-IA64 (Itanium) SUB-PLATFORM 5118SN-IA64 (Itanium) SUB-PLATFORM
4135P: Jes Sorensen 5119P: Jes Sorensen
@@ -4138,36 +5122,45 @@ L: linux-altix@sgi.com
4138L: linux-ia64@vger.kernel.org 5122L: linux-ia64@vger.kernel.org
4139W: http://www.sgi.com/altix 5123W: http://www.sgi.com/altix
4140S: Maintained 5124S: Maintained
5125F: arch/ia64/sn/
4141 5126
4142SOC-CAMERA V4L2 SUBSYSTEM 5127SOC-CAMERA V4L2 SUBSYSTEM
4143P: Guennadi Liakhovetski 5128P: Guennadi Liakhovetski
4144M: g.liakhovetski@gmx.de 5129M: g.liakhovetski@gmx.de
4145L: linux-media@vger.kernel.org 5130L: linux-media@vger.kernel.org
4146T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5131T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4147S: Maintained 5132S: Maintained
5133F: include/media/v4l2*
5134F: drivers/media/video/v4l2*
4148 5135
4149SOEKRIS NET48XX LED SUPPORT 5136SOEKRIS NET48XX LED SUPPORT
4150P: Chris Boot 5137P: Chris Boot
4151M: bootc@bootc.net 5138M: bootc@bootc.net
4152S: Maintained 5139S: Maintained
5140F: drivers/leds/leds-net48xx.c
4153 5141
4154SOFTWARE RAID (Multiple Disks) SUPPORT 5142SOFTWARE RAID (Multiple Disks) SUPPORT
4155P: Neil Brown 5143P: Neil Brown
4156M: neilb@suse.de 5144M: neilb@suse.de
4157L: linux-raid@vger.kernel.org 5145L: linux-raid@vger.kernel.org
4158S: Supported 5146S: Supported
5147F: drivers/md/
5148F: include/linux/raid/
4159 5149
4160SONIC NETWORK DRIVER 5150SONIC NETWORK DRIVER
4161P: Thomas Bogendoerfer 5151P: Thomas Bogendoerfer
4162M: tsbogend@alpha.franken.de 5152M: tsbogend@alpha.franken.de
4163L: netdev@vger.kernel.org 5153L: netdev@vger.kernel.org
4164S: Maintained 5154S: Maintained
5155F: drivers/net/sonic.*
4165 5156
4166SONICS SILICON BACKPLANE DRIVER (SSB) 5157SONICS SILICON BACKPLANE DRIVER (SSB)
4167P: Michael Buesch 5158P: Michael Buesch
4168M: mb@bu3sch.de 5159M: mb@bu3sch.de
4169L: netdev@vger.kernel.org 5160L: netdev@vger.kernel.org
4170S: Maintained 5161S: Maintained
5162F: drivers/ssb/
5163F: include/linux/ssb/
4171 5164
4172SONY VAIO CONTROL DEVICE DRIVER 5165SONY VAIO CONTROL DEVICE DRIVER
4173P: Mattia Dongili 5166P: Mattia Dongili
@@ -4175,6 +5168,10 @@ M: malattia@linux.it
4175L: linux-acpi@vger.kernel.org 5168L: linux-acpi@vger.kernel.org
4176W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers 5169W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
4177S: Maintained 5170S: Maintained
5171F: Documentation/laptops/sony-laptop.txt
5172F: drivers/char/sonypi.c
5173F: drivers/platform/x86/sony-laptop.c
5174F: include/linux/sony-laptop.h
4178 5175
4179SONY MEMORYSTICK CARD SUPPORT 5176SONY MEMORYSTICK CARD SUPPORT
4180P: Alex Dubov 5177P: Alex Dubov
@@ -4182,6 +5179,7 @@ M: oakad@yahoo.com
4182L: linux-kernel@vger.kernel.org 5179L: linux-kernel@vger.kernel.org
4183W: http://tifmxx.berlios.de/ 5180W: http://tifmxx.berlios.de/
4184S: Maintained 5181S: Maintained
5182F: drivers/memstick/host/tifm_ms.c
4185 5183
4186SOUND 5184SOUND
4187P: Jaroslav Kysela 5185P: Jaroslav Kysela
@@ -4190,36 +5188,44 @@ P: Takashi Iwai
4190M: tiwai@suse.de 5188M: tiwai@suse.de
4191L: alsa-devel@alsa-project.org (subscribers-only) 5189L: alsa-devel@alsa-project.org (subscribers-only)
4192S: Maintained 5190S: Maintained
5191F: sound/
4193 5192
4194SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) 5193SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
4195P: Liam Girdwood 5194P: Liam Girdwood
4196M: lrg@slimlogic.co.uk 5195M: lrg@slimlogic.co.uk
4197P: Mark Brown 5196P: Mark Brown
4198M: broonie@opensource.wolfsonmicro.com 5197M: broonie@opensource.wolfsonmicro.com
4199T: git opensource.wolfsonmicro.com/linux-2.6-asoc 5198T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc
4200L: alsa-devel@alsa-project.org (subscribers-only) 5199L: alsa-devel@alsa-project.org (subscribers-only)
4201W: http://alsa-project.org/main/index.php/ASoC 5200W: http://alsa-project.org/main/index.php/ASoC
4202S: Supported 5201S: Supported
5202F: sound/soc/
4203 5203
4204SPARC + UltraSPARC (sparc/sparc64) 5204SPARC + UltraSPARC (sparc/sparc64)
4205P: David S. Miller 5205P: David S. Miller
4206M: davem@davemloft.net 5206M: davem@davemloft.net
4207L: sparclinux@vger.kernel.org 5207L: sparclinux@vger.kernel.org
4208T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git 5208T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
4209T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git 5209T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
4210S: Maintained 5210S: Maintained
5211F: arch/sparc/
4211 5212
4212SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER 5213SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
4213P: Roger Wolff 5214P: Roger Wolff
4214M: R.E.Wolff@BitWizard.nl 5215M: R.E.Wolff@BitWizard.nl
4215L: linux-kernel@vger.kernel.org ? 5216L: linux-kernel@vger.kernel.org
4216S: Supported 5217S: Supported
5218F: Documentation/serial/specialix.txt
5219F: drivers/char/specialix*
4217 5220
4218SPI SUBSYSTEM 5221SPI SUBSYSTEM
4219P: David Brownell 5222P: David Brownell
4220M: dbrownell@users.sourceforge.net 5223M: dbrownell@users.sourceforge.net
4221L: spi-devel-general@lists.sourceforge.net 5224L: spi-devel-general@lists.sourceforge.net
4222S: Maintained 5225S: Maintained
5226F: Documentation/spi/
5227F: drivers/spi/
5228F: include/linux/spi/
4223 5229
4224SPIDERNET NETWORK DRIVER for CELL 5230SPIDERNET NETWORK DRIVER for CELL
4225P: Ishizaki Kou 5231P: Ishizaki Kou
@@ -4228,6 +5234,8 @@ P: Jens Osterkamp
4228M: jens@de.ibm.com 5234M: jens@de.ibm.com
4229L: netdev@vger.kernel.org 5235L: netdev@vger.kernel.org
4230S: Supported 5236S: Supported
5237F: Documentation/networking/spider_net.txt
5238F: drivers/net/spider_net*
4231 5239
4232SPU FILE SYSTEM 5240SPU FILE SYSTEM
4233P: Jeremy Kerr 5241P: Jeremy Kerr
@@ -4236,6 +5244,8 @@ L: linuxppc-dev@ozlabs.org
4236L: cbe-oss-dev@ozlabs.org 5244L: cbe-oss-dev@ozlabs.org
4237W: http://www.ibm.com/developerworks/power/cell/ 5245W: http://www.ibm.com/developerworks/power/cell/
4238S: Supported 5246S: Supported
5247F: Documentation/filesystems/spufs.txt
5248F: arch/powerpc/platforms/cell/spufs/
4239 5249
4240SQUASHFS FILE SYSTEM 5250SQUASHFS FILE SYSTEM
4241P: Phillip Lougher 5251P: Phillip Lougher
@@ -4243,12 +5253,15 @@ M: phillip@lougher.demon.co.uk
4243L: squashfs-devel@lists.sourceforge.net (subscribers-only) 5253L: squashfs-devel@lists.sourceforge.net (subscribers-only)
4244W: http://squashfs.org.uk 5254W: http://squashfs.org.uk
4245S: Maintained 5255S: Maintained
5256F: Documentation/filesystems/squashfs.txt
5257F: fs/squashfs/
4246 5258
4247SRM (Alpha) environment access 5259SRM (Alpha) environment access
4248P: Jan-Benedict Glaw 5260P: Jan-Benedict Glaw
4249M: jbglaw@lug-owl.de 5261M: jbglaw@lug-owl.de
4250L: linux-kernel@vger.kernel.org 5262L: linux-kernel@vger.kernel.org
4251S: Maintained 5263S: Maintained
5264F: arch/alpha/kernel/srm_env.c
4252 5265
4253STABLE BRANCH 5266STABLE BRANCH
4254P: Greg Kroah-Hartman 5267P: Greg Kroah-Hartman
@@ -4264,35 +5277,46 @@ M: gregkh@suse.de
4264L: linux-kernel@vger.kernel.org 5277L: linux-kernel@vger.kernel.org
4265T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 5278T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
4266S: Maintained 5279S: Maintained
5280F: drivers/staging/
4267 5281
4268STARFIRE/DURALAN NETWORK DRIVER 5282STARFIRE/DURALAN NETWORK DRIVER
4269P: Ion Badulescu 5283P: Ion Badulescu
4270M: ionut@cs.columbia.edu 5284M: ionut@cs.columbia.edu
4271S: Maintained 5285S: Maintained
5286F: drivers/net/starfire*
4272 5287
4273STARMODE RADIO IP (STRIP) PROTOCOL DRIVER 5288STARMODE RADIO IP (STRIP) PROTOCOL DRIVER
4274W: http://mosquitonet.Stanford.EDU/strip.html 5289W: http://mosquitonet.Stanford.EDU/strip.html
4275S: Orphan 5290S: Orphan
5291F: drivers/net/wireless/strip.c
5292F: include/linux/if_strip.h
4276 5293
4277STRADIS MPEG-2 DECODER DRIVER 5294STRADIS MPEG-2 DECODER DRIVER
4278P: Nathan Laredo 5295P: Nathan Laredo
4279M: laredo@gnu.org 5296M: laredo@gnu.org
4280W: http://www.stradis.com/ 5297W: http://www.stradis.com/
4281S: Maintained 5298S: Maintained
5299F: drivers/media/video/stradis.c
4282 5300
4283SUN3/3X 5301SUN3/3X
4284P: Sam Creasey 5302P: Sam Creasey
4285M: sammy@sammy.net 5303M: sammy@sammy.net
4286W: http://sammy.net/sun3/ 5304W: http://sammy.net/sun3/
4287S: Maintained 5305S: Maintained
5306F: arch/m68k/kernel/*sun3*
5307F: arch/m68k/sun3*/
5308F: arch/m68k/include/asm/sun3*
4288 5309
4289SUPERH 5310SUPERH
4290P: Paul Mundt 5311P: Paul Mundt
4291M: lethal@linux-sh.org 5312M: lethal@linux-sh.org
4292L: linux-sh@vger.kernel.org 5313L: linux-sh@vger.kernel.org
4293W: http://www.linux-sh.org 5314W: http://www.linux-sh.org
4294T: git kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.git 5315T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git
4295S: Supported 5316S: Supported
5317F: Documentation/sh/
5318F: arch/sh/
5319F: drivers/sh/
4296 5320
4297SUSPEND TO RAM 5321SUSPEND TO RAM
4298P: Len Brown 5322P: Len Brown
@@ -4303,29 +5327,48 @@ P: Rafael J. Wysocki
4303M: rjw@sisk.pl 5327M: rjw@sisk.pl
4304L: linux-pm@lists.linux-foundation.org 5328L: linux-pm@lists.linux-foundation.org
4305S: Supported 5329S: Supported
5330F: Documentation/power/
5331F: arch/x86/kernel/acpi/
5332F: drivers/base/power/
5333F: kernel/power/
5334F: include/linux/suspend.h
5335F: include/linux/freezer.h
5336F: include/linux/pm.h
5337F: include/asm-*/suspend.h
4306 5338
4307SVGA HANDLING 5339SVGA HANDLING
4308P: Martin Mares 5340P: Martin Mares
4309M: mj@ucw.cz 5341M: mj@ucw.cz
4310L: linux-video@atrey.karlin.mff.cuni.cz 5342L: linux-video@atrey.karlin.mff.cuni.cz
4311S: Maintained 5343S: Maintained
5344F: Documentation/svga.txt
5345F: arch/x86/boot/video*
4312 5346
4313SYSV FILESYSTEM 5347SYSV FILESYSTEM
4314P: Christoph Hellwig 5348P: Christoph Hellwig
4315M: hch@infradead.org 5349M: hch@infradead.org
4316S: Maintained 5350S: Maintained
5351F: Documentation/filesystems/sysv-fs.txt
5352F: fs/sysv/
5353F: include/linux/sysv_fs.h
4317 5354
4318TASKSTATS STATISTICS INTERFACE 5355TASKSTATS STATISTICS INTERFACE
4319P: Balbir Singh 5356P: Balbir Singh
4320M: balbir@linux.vnet.ibm.com 5357M: balbir@linux.vnet.ibm.com
4321L: linux-kernel@vger.kernel.org 5358L: linux-kernel@vger.kernel.org
4322S: Maintained 5359S: Maintained
5360F: Documentation/accounting/taskstats*
5361F: include/linux/taskstats*
5362F: kernel/taskstats.c
4323 5363
4324TC CLASSIFIER 5364TC CLASSIFIER
4325P: Jamal Hadi Salim 5365P: Jamal Hadi Salim
4326M: hadi@cyberus.ca 5366M: hadi@cyberus.ca
4327L: netdev@vger.kernel.org 5367L: netdev@vger.kernel.org
4328S: Maintained 5368S: Maintained
5369F: include/linux/pkt_cls.h
5370F: include/net/pkt_cls.h
5371F: net/sched/
4329 5372
4330TCP LOW PRIORITY MODULE 5373TCP LOW PRIORITY MODULE
4331P: Wong Hoi Sing, Edison 5374P: Wong Hoi Sing, Edison
@@ -4334,6 +5377,7 @@ P: Hung Hing Lun, Mike
4334M: hlhung3i@gmail.com 5377M: hlhung3i@gmail.com
4335W: http://tcp-lp-mod.sourceforge.net/ 5378W: http://tcp-lp-mod.sourceforge.net/
4336S: Maintained 5379S: Maintained
5380F: net/ipv4/tcp_lp.c
4337 5381
4338TEHUTI ETHERNET DRIVER 5382TEHUTI ETHERNET DRIVER
4339P: Alexander Indenbaum 5383P: Alexander Indenbaum
@@ -4342,16 +5386,19 @@ P: Andy Gospodarek
4342M: andy@greyhouse.net 5386M: andy@greyhouse.net
4343L: netdev@vger.kernel.org 5387L: netdev@vger.kernel.org
4344S: Supported 5388S: Supported
5389F: drivers/net/tehuti*
4345 5390
4346Telecom Clock Driver for MCPL0010 5391Telecom Clock Driver for MCPL0010
4347P: Mark Gross 5392P: Mark Gross
4348M: mark.gross@intel.com 5393M: mark.gross@intel.com
4349S: Supported 5394S: Supported
5395F: drivers/char/tlclk.c
4350 5396
4351TENSILICA XTENSA PORT (xtensa) 5397TENSILICA XTENSA PORT (xtensa)
4352P: Chris Zankel 5398P: Chris Zankel
4353M: chris@zankel.net 5399M: chris@zankel.net
4354S: Maintained 5400S: Maintained
5401F: arch/xtensa/
4355 5402
4356THINKPAD ACPI EXTRAS DRIVER 5403THINKPAD ACPI EXTRAS DRIVER
4357P: Henrique de Moraes Holschuh 5404P: Henrique de Moraes Holschuh
@@ -4359,13 +5406,17 @@ M: ibm-acpi@hmh.eng.br
4359L: ibm-acpi-devel@lists.sourceforge.net 5406L: ibm-acpi-devel@lists.sourceforge.net
4360W: http://ibm-acpi.sourceforge.net 5407W: http://ibm-acpi.sourceforge.net
4361W: http://thinkwiki.org/wiki/Ibm-acpi 5408W: http://thinkwiki.org/wiki/Ibm-acpi
4362T: git repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git 5409T: git git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
4363S: Maintained 5410S: Maintained
5411F: drivers/platform/x86/thinkpad_acpi.c
4364 5412
4365TI FLASH MEDIA INTERFACE DRIVER 5413TI FLASH MEDIA INTERFACE DRIVER
4366P: Alex Dubov 5414P: Alex Dubov
4367M: oakad@yahoo.com 5415M: oakad@yahoo.com
4368S: Maintained 5416S: Maintained
5417F: drivers/misc/tifm*
5418F: drivers/mmc/host/tifm_sd.c
5419F: include/linux/tifm.h
4369 5420
4370TI OMAP MMC INTERFACE DRIVER 5421TI OMAP MMC INTERFACE DRIVER
4371P: Carlos Aguiar, Anderson Briglia and Syed Khasim 5422P: Carlos Aguiar, Anderson Briglia and Syed Khasim
@@ -4373,11 +5424,13 @@ M: linux-omap@vger.kernel.org
4373W: http://linux.omap.com 5424W: http://linux.omap.com
4374W: http://www.muru.com/linux/omap/ 5425W: http://www.muru.com/linux/omap/
4375S: Maintained 5426S: Maintained
5427F: drivers/mmc/host/omap.c
4376 5428
4377TI OMAP RANDOM NUMBER GENERATOR SUPPORT 5429TI OMAP RANDOM NUMBER GENERATOR SUPPORT
4378P: Deepak Saxena 5430P: Deepak Saxena
4379M: dsaxena@plexity.net 5431M: dsaxena@plexity.net
4380S: Maintained 5432S: Maintained
5433F: drivers/char/hw_random/omap-rng.c
4381 5434
4382TIPC NETWORK LAYER 5435TIPC NETWORK LAYER
4383P: Per Liden 5436P: Per Liden
@@ -4389,8 +5442,11 @@ M: allan.stephens@windriver.com
4389L: tipc-discussion@lists.sourceforge.net 5442L: tipc-discussion@lists.sourceforge.net
4390W: http://tipc.sourceforge.net/ 5443W: http://tipc.sourceforge.net/
4391W: http://tipc.cslab.ericsson.net/ 5444W: http://tipc.cslab.ericsson.net/
4392T: git tipc.cslab.ericsson.net:/pub/git/tipc.git 5445T: git git://tipc.cslab.ericsson.net/pub/git/tipc.git
4393S: Maintained 5446S: Maintained
5447F: include/linux/tipc*.h
5448F: include/net/tipc/
5449F: net/tipc/
4394 5450
4395TLAN NETWORK DRIVER 5451TLAN NETWORK DRIVER
4396P: Samuel Chessman 5452P: Samuel Chessman
@@ -4398,6 +5454,8 @@ M: chessman@tux.org
4398L: tlan-devel@lists.sourceforge.net (subscribers-only) 5454L: tlan-devel@lists.sourceforge.net (subscribers-only)
4399W: http://sourceforge.net/projects/tlan/ 5455W: http://sourceforge.net/projects/tlan/
4400S: Maintained 5456S: Maintained
5457F: Documentation/networking/tlan.txt
5458F: drivers/net/tlan.*
4401 5459
4402TOMOYO SECURITY MODULE 5460TOMOYO SECURITY MODULE
4403P: Kentaro Takeda 5461P: Kentaro Takeda
@@ -4411,9 +5469,11 @@ L: tomoyo-users@lists.sourceforge.jp (subscribers-only, for users in Japanese)
4411W: http://tomoyo.sourceforge.jp/ 5469W: http://tomoyo.sourceforge.jp/
4412T: quilt http://svn.sourceforge.jp/svnroot/tomoyo/trunk/2.2.x/tomoyo-lsm/patches/ 5470T: quilt http://svn.sourceforge.jp/svnroot/tomoyo/trunk/2.2.x/tomoyo-lsm/patches/
4413S: Maintained 5471S: Maintained
5472F: security/tomoyo/
4414 5473
4415TOSHIBA ACPI EXTRAS DRIVER 5474TOSHIBA ACPI EXTRAS DRIVER
4416S: Orphan 5475S: Orphan
5476F: drivers/platform/x86/toshiba_acpi.c
4417 5477
4418TOSHIBA SMM DRIVER 5478TOSHIBA SMM DRIVER
4419P: Jonathan Buzzard 5479P: Jonathan Buzzard
@@ -4421,11 +5481,14 @@ M: jonathan@buzzard.org.uk
4421L: tlinux-users@tce.toshiba-dme.co.jp 5481L: tlinux-users@tce.toshiba-dme.co.jp
4422W: http://www.buzzard.org.uk/toshiba/ 5482W: http://www.buzzard.org.uk/toshiba/
4423S: Maintained 5483S: Maintained
5484F: drivers/char/toshiba.c
5485F: include/linux/toshiba.h
4424 5486
4425TMIO MMC DRIVER 5487TMIO MMC DRIVER
4426P: Ian Molton 5488P: Ian Molton
4427M: ian@mnementh.co.uk 5489M: ian@mnementh.co.uk
4428S: Maintained 5490S: Maintained
5491F: drivers/mmc/host/tmio_mmc.*
4429 5492
4430TPM DEVICE DRIVER 5493TPM DEVICE DRIVER
4431P: Debora Velarde 5494P: Debora Velarde
@@ -4438,12 +5501,13 @@ M: m.selhorst@sirrix.com
4438W: http://www.sirrix.com 5501W: http://www.sirrix.com
4439L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers) 5502L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
4440S: Maintained 5503S: Maintained
5504F: drivers/char/tpm/
4441 5505
4442TRIVIAL PATCHES 5506TRIVIAL PATCHES
4443P: Jiri Kosina 5507P: Jiri Kosina
4444M: trivial@kernel.org 5508M: trivial@kernel.org
4445L: linux-kernel@vger.kernel.org 5509L: linux-kernel@vger.kernel.org
4446T: git kernel.org:/pub/scm/linux/kernel/git/jikos/trivial.git 5510T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git
4447S: Maintained 5511S: Maintained
4448 5512
4449TTY LAYER 5513TTY LAYER
@@ -4459,6 +5523,7 @@ P: Kyle McMartin
4459M: kyle@mcmartin.ca 5523M: kyle@mcmartin.ca
4460L: netdev@vger.kernel.org 5524L: netdev@vger.kernel.org
4461S: Maintained 5525S: Maintained
5526F: drivers/net/tulip/
4462 5527
4463TUN/TAP driver 5528TUN/TAP driver
4464P: Maxim Krasnyansky 5529P: Maxim Krasnyansky
@@ -4466,17 +5531,22 @@ M: maxk@qualcomm.com
4466L: vtun@office.satix.net 5531L: vtun@office.satix.net
4467W: http://vtun.sourceforge.net/tun 5532W: http://vtun.sourceforge.net/tun
4468S: Maintained 5533S: Maintained
5534F: Documentation/networking/tuntap.txt
5535F: arch/um/os-Linux/drivers/
4469 5536
4470TURBOCHANNEL SUBSYSTEM 5537TURBOCHANNEL SUBSYSTEM
4471P: Maciej W. Rozycki 5538P: Maciej W. Rozycki
4472M: macro@linux-mips.org 5539M: macro@linux-mips.org
4473S: Maintained 5540S: Maintained
5541F: drivers/tc/
5542F: include/linux/tc.h
4474 5543
4475U14-34F SCSI DRIVER 5544U14-34F SCSI DRIVER
4476P: Dario Ballabio 5545P: Dario Ballabio
4477M: ballabio_dario@emc.com 5546M: ballabio_dario@emc.com
4478L: linux-scsi@vger.kernel.org 5547L: linux-scsi@vger.kernel.org
4479S: Maintained 5548S: Maintained
5549F: drivers/scsi/u14-34f.c
4480 5550
4481UBI FILE SYSTEM (UBIFS) 5551UBI FILE SYSTEM (UBIFS)
4482P: Artem Bityutskiy 5552P: Artem Bityutskiy
@@ -4487,6 +5557,8 @@ L: linux-mtd@lists.infradead.org
4487T: git git://git.infradead.org/ubifs-2.6.git 5557T: git git://git.infradead.org/ubifs-2.6.git
4488W: http://www.linux-mtd.infradead.org/doc/ubifs.html 5558W: http://www.linux-mtd.infradead.org/doc/ubifs.html
4489S: Maintained 5559S: Maintained
5560F: Documentation/filesystems/ubifs.txt
5561F: fs/ubifs/
4490 5562
4491UCLINUX (AND M68KNOMMU) 5563UCLINUX (AND M68KNOMMU)
4492P: Greg Ungerer 5564P: Greg Ungerer
@@ -4494,6 +5566,7 @@ M: gerg@uclinux.org
4494W: http://www.uclinux.org/ 5566W: http://www.uclinux.org/
4495L: uclinux-dev@uclinux.org (subscribers-only) 5567L: uclinux-dev@uclinux.org (subscribers-only)
4496S: Maintained 5568S: Maintained
5569F: arch/m68knommu/
4497 5570
4498UCLINUX FOR RENESAS H8/300 5571UCLINUX FOR RENESAS H8/300
4499P: Yoshinori Sato 5572P: Yoshinori Sato
@@ -4506,18 +5579,25 @@ P: Jan Kara
4506M: jack@suse.cz 5579M: jack@suse.cz
4507W: http://linux-udf.sourceforge.net 5580W: http://linux-udf.sourceforge.net
4508S: Maintained 5581S: Maintained
5582F: Documentation/filesystems/udf.txt
5583F: fs/udf/
4509 5584
4510UFS FILESYSTEM 5585UFS FILESYSTEM
4511P: Evgeniy Dushistov 5586P: Evgeniy Dushistov
4512M: dushistov@mail.ru 5587M: dushistov@mail.ru
4513L: linux-kernel@vger.kernel.org 5588L: linux-kernel@vger.kernel.org
4514S: Maintained 5589S: Maintained
5590F: Documentation/filesystems/ufs.txt
5591F: fs/ufs/
4515 5592
4516ULTRA-WIDEBAND (UWB) SUBSYSTEM: 5593ULTRA-WIDEBAND (UWB) SUBSYSTEM:
4517P: David Vrabel 5594P: David Vrabel
4518M: david.vrabel@csr.com 5595M: david.vrabel@csr.com
4519L: linux-usb@vger.kernel.org 5596L: linux-usb@vger.kernel.org
4520S: Supported 5597S: Supported
5598F: drivers/uwb/*
5599F: include/linux/uwb.h
5600F: include/linux/uwb/
4521 5601
4522UNIFORM CDROM DRIVER 5602UNIFORM CDROM DRIVER
4523P: Jens Axboe 5603P: Jens Axboe
@@ -4525,6 +5605,9 @@ M: axboe@kernel.dk
4525L: linux-kernel@vger.kernel.org 5605L: linux-kernel@vger.kernel.org
4526W: http://www.kernel.dk 5606W: http://www.kernel.dk
4527S: Maintained 5607S: Maintained
5608F: Documentation/cdrom/
5609F: drivers/cdrom/cdrom.c
5610F: include/linux/cdrom.h
4528 5611
4529UNSORTED BLOCK IMAGES (UBI) 5612UNSORTED BLOCK IMAGES (UBI)
4530P: Artem Bityutskiy 5613P: Artem Bityutskiy
@@ -4533,12 +5616,17 @@ W: http://www.linux-mtd.infradead.org/
4533L: linux-mtd@lists.infradead.org 5616L: linux-mtd@lists.infradead.org
4534T: git git://git.infradead.org/ubi-2.6.git 5617T: git git://git.infradead.org/ubi-2.6.git
4535S: Maintained 5618S: Maintained
5619F: drivers/mtd/ubi/
5620F: include/linux/mtd/ubi.h
5621F: include/mtd/ubi-user.h
4536 5622
4537USB ACM DRIVER 5623USB ACM DRIVER
4538P: Oliver Neukum 5624P: Oliver Neukum
4539M: oliver@neukum.name 5625M: oliver@neukum.name
4540L: linux-usb@vger.kernel.org 5626L: linux-usb@vger.kernel.org
4541S: Maintained 5627S: Maintained
5628F: Documentation/usb/acm.txt
5629F: drivers/usb/class/cdc-acm.*
4542 5630
4543USB BLOCK DRIVER (UB ub) 5631USB BLOCK DRIVER (UB ub)
4544P: Pete Zaitcev 5632P: Pete Zaitcev
@@ -4546,6 +5634,7 @@ M: zaitcev@redhat.com
4546L: linux-kernel@vger.kernel.org 5634L: linux-kernel@vger.kernel.org
4547L: linux-usb@vger.kernel.org 5635L: linux-usb@vger.kernel.org
4548S: Supported 5636S: Supported
5637F: drivers/block/ub.c
4549 5638
4550USB CDC ETHERNET DRIVER 5639USB CDC ETHERNET DRIVER
4551P: Greg Kroah-Hartman 5640P: Greg Kroah-Hartman
@@ -4553,12 +5642,15 @@ M: greg@kroah.com
4553L: linux-usb@vger.kernel.org 5642L: linux-usb@vger.kernel.org
4554S: Maintained 5643S: Maintained
4555W: http://www.kroah.com/linux-usb/ 5644W: http://www.kroah.com/linux-usb/
5645F: drivers/net/usb/cdc_*.c
5646F: include/linux/usb/cdc.h
4556 5647
4557USB CYPRESS C67X00 DRIVER 5648USB CYPRESS C67X00 DRIVER
4558P: Peter Korsgaard 5649P: Peter Korsgaard
4559M: jacmet@sunsite.dk 5650M: jacmet@sunsite.dk
4560L: linux-usb@vger.kernel.org 5651L: linux-usb@vger.kernel.org
4561S: Maintained 5652S: Maintained
5653F: drivers/usb/c67x00/
4562 5654
4563USB DAVICOM DM9601 DRIVER 5655USB DAVICOM DM9601 DRIVER
4564P: Peter Korsgaard 5656P: Peter Korsgaard
@@ -4566,6 +5658,7 @@ M: jacmet@sunsite.dk
4566L: netdev@vger.kernel.org 5658L: netdev@vger.kernel.org
4567W: http://www.linux-usb.org/usbnet 5659W: http://www.linux-usb.org/usbnet
4568S: Maintained 5660S: Maintained
5661F: drivers/net/usb/dm9601.c
4569 5662
4570USB DIAMOND RIO500 DRIVER 5663USB DIAMOND RIO500 DRIVER
4571P: Cesar Miquel 5664P: Cesar Miquel
@@ -4573,21 +5666,25 @@ M: miquel@df.uba.ar
4573L: rio500-users@lists.sourceforge.net 5666L: rio500-users@lists.sourceforge.net
4574W: http://rio500.sourceforge.net 5667W: http://rio500.sourceforge.net
4575S: Maintained 5668S: Maintained
5669F: drivers/usb/misc/rio500*
4576 5670
4577USB EHCI DRIVER 5671USB EHCI DRIVER
4578P: David Brownell 5672P: David Brownell
4579M: dbrownell@users.sourceforge.net 5673M: dbrownell@users.sourceforge.net
4580L: linux-usb@vger.kernel.org 5674L: linux-usb@vger.kernel.org
4581S: Odd Fixes 5675S: Odd Fixes
5676F: Documentation/usb/ehci.txt
5677F: drivers/usb/host/ehci*
4582 5678
4583USB ET61X[12]51 DRIVER 5679USB ET61X[12]51 DRIVER
4584P: Luca Risolia 5680P: Luca Risolia
4585M: luca.risolia@studio.unibo.it 5681M: luca.risolia@studio.unibo.it
4586L: linux-usb@vger.kernel.org 5682L: linux-usb@vger.kernel.org
4587L: linux-media@vger.kernel.org 5683L: linux-media@vger.kernel.org
4588T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5684T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4589W: http://www.linux-projects.org 5685W: http://www.linux-projects.org
4590S: Maintained 5686S: Maintained
5687F: drivers/media/video/et61x251/
4591 5688
4592USB GADGET/PERIPHERAL SUBSYSTEM 5689USB GADGET/PERIPHERAL SUBSYSTEM
4593P: David Brownell 5690P: David Brownell
@@ -4595,25 +5692,32 @@ M: dbrownell@users.sourceforge.net
4595L: linux-usb@vger.kernel.org 5692L: linux-usb@vger.kernel.org
4596W: http://www.linux-usb.org/gadget 5693W: http://www.linux-usb.org/gadget
4597S: Maintained 5694S: Maintained
5695F: drivers/usb/gadget/
5696F: include/linux/usb/gadget*
4598 5697
4599USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...) 5698USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
4600P: Jiri Kosina 5699P: Jiri Kosina
4601M: jkosina@suse.cz 5700M: jkosina@suse.cz
4602L: linux-usb@vger.kernel.org 5701L: linux-usb@vger.kernel.org
4603T: git kernel.org:/pub/scm/linux/kernel/git/jikos/hid.git 5702T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
4604S: Maintained 5703S: Maintained
5704F: Documentation/usb/hiddev.txt
5705F: drivers/hid/usbhid/
4605 5706
4606USB ISP116X DRIVER 5707USB ISP116X DRIVER
4607P: Olav Kongas 5708P: Olav Kongas
4608M: ok@artecdesign.ee 5709M: ok@artecdesign.ee
4609L: linux-usb@vger.kernel.org 5710L: linux-usb@vger.kernel.org
4610S: Maintained 5711S: Maintained
5712F: drivers/usb/host/isp116x*
5713F: include/linux/usb/isp116x.h
4611 5714
4612USB KAWASAKI LSI DRIVER 5715USB KAWASAKI LSI DRIVER
4613P: Oliver Neukum 5716P: Oliver Neukum
4614M: oliver@neukum.name 5717M: oliver@neukum.name
4615L: linux-usb@vger.kernel.org 5718L: linux-usb@vger.kernel.org
4616S: Maintained 5719S: Maintained
5720F: drivers/usb/serial/kl5kusb105.*
4617 5721
4618USB MASS STORAGE DRIVER 5722USB MASS STORAGE DRIVER
4619P: Matthew Dharm 5723P: Matthew Dharm
@@ -4622,18 +5726,22 @@ L: linux-usb@vger.kernel.org
4622L: usb-storage@lists.one-eyed-alien.net 5726L: usb-storage@lists.one-eyed-alien.net
4623S: Maintained 5727S: Maintained
4624W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ 5728W: http://www.one-eyed-alien.net/~mdharm/linux-usb/
5729F: drivers/usb/storage/
4625 5730
4626USB OHCI DRIVER 5731USB OHCI DRIVER
4627P: David Brownell 5732P: David Brownell
4628M: dbrownell@users.sourceforge.net 5733M: dbrownell@users.sourceforge.net
4629L: linux-usb@vger.kernel.org 5734L: linux-usb@vger.kernel.org
4630S: Odd Fixes 5735S: Odd Fixes
5736F: Documentation/usb/ohci.txt
5737F: drivers/usb/host/ohci*
4631 5738
4632USB OPTION-CARD DRIVER 5739USB OPTION-CARD DRIVER
4633P: Matthias Urlichs 5740P: Matthias Urlichs
4634M: smurf@smurf.noris.de 5741M: smurf@smurf.noris.de
4635L: linux-usb@vger.kernel.org 5742L: linux-usb@vger.kernel.org
4636S: Maintained 5743S: Maintained
5744F: drivers/usb/serial/option.c
4637 5745
4638USB OV511 DRIVER 5746USB OV511 DRIVER
4639P: Mark McClelland 5747P: Mark McClelland
@@ -4641,6 +5749,7 @@ M: mmcclell@bigfoot.com
4641L: linux-usb@vger.kernel.org 5749L: linux-usb@vger.kernel.org
4642W: http://alpha.dyndns.org/ov511/ 5750W: http://alpha.dyndns.org/ov511/
4643S: Maintained 5751S: Maintained
5752F: drivers/media/video/ov511.*
4644 5753
4645USB PEGASUS DRIVER 5754USB PEGASUS DRIVER
4646P: Petko Manolov 5755P: Petko Manolov
@@ -4649,12 +5758,14 @@ L: linux-usb@vger.kernel.org
4649L: netdev@vger.kernel.org 5758L: netdev@vger.kernel.org
4650W: http://pegasus2.sourceforge.net/ 5759W: http://pegasus2.sourceforge.net/
4651S: Maintained 5760S: Maintained
5761F: drivers/net/usb/pegasus.*
4652 5762
4653USB PRINTER DRIVER (usblp) 5763USB PRINTER DRIVER (usblp)
4654P: Pete Zaitcev 5764P: Pete Zaitcev
4655M: zaitcev@redhat.com 5765M: zaitcev@redhat.com
4656L: linux-usb@vger.kernel.org 5766L: linux-usb@vger.kernel.org
4657S: Supported 5767S: Supported
5768F: drivers/usb/class/usblp.c
4658 5769
4659USB RTL8150 DRIVER 5770USB RTL8150 DRIVER
4660P: Petko Manolov 5771P: Petko Manolov
@@ -4663,6 +5774,7 @@ L: linux-usb@vger.kernel.org
4663L: netdev@vger.kernel.org 5774L: netdev@vger.kernel.org
4664W: http://pegasus2.sourceforge.net/ 5775W: http://pegasus2.sourceforge.net/
4665S: Maintained 5776S: Maintained
5777F: drivers/net/usb/rtl8150.c
4666 5778
4667USB SE401 DRIVER 5779USB SE401 DRIVER
4668P: Jeroen Vreeken 5780P: Jeroen Vreeken
@@ -4670,12 +5782,15 @@ M: pe1rxq@amsat.org
4670L: linux-usb@vger.kernel.org 5782L: linux-usb@vger.kernel.org
4671W: http://www.chello.nl/~j.vreeken/se401/ 5783W: http://www.chello.nl/~j.vreeken/se401/
4672S: Maintained 5784S: Maintained
5785F: Documentation/video4linux/se401.txt
5786F: drivers/media/video/se401.*
4673 5787
4674USB SERIAL BELKIN F5U103 DRIVER 5788USB SERIAL BELKIN F5U103 DRIVER
4675P: William Greathouse 5789P: William Greathouse
4676M: wgreathouse@smva.com 5790M: wgreathouse@smva.com
4677L: linux-usb@vger.kernel.org 5791L: linux-usb@vger.kernel.org
4678S: Maintained 5792S: Maintained
5793F: drivers/usb/serial/belkin_sa.*
4679 5794
4680USB SERIAL CYPRESS M8 DRIVER 5795USB SERIAL CYPRESS M8 DRIVER
4681P: Lonnie Mendez 5796P: Lonnie Mendez
@@ -4684,12 +5799,14 @@ L: linux-usb@vger.kernel.org
4684S: Maintained 5799S: Maintained
4685W: http://geocities.com/i0xox0i 5800W: http://geocities.com/i0xox0i
4686W: http://firstlight.net/cvs 5801W: http://firstlight.net/cvs
5802F: drivers/usb/serial/cypress_m8.*
4687 5803
4688USB SERIAL CYBERJACK DRIVER 5804USB SERIAL CYBERJACK DRIVER
4689P: Matthias Bruestle and Harald Welte 5805P: Matthias Bruestle and Harald Welte
4690M: support@reiner-sct.com 5806M: support@reiner-sct.com
4691W: http://www.reiner-sct.de/support/treiber_cyberjack.php 5807W: http://www.reiner-sct.de/support/treiber_cyberjack.php
4692S: Maintained 5808S: Maintained
5809F: drivers/usb/serial/cyberjack.c
4693 5810
4694USB SERIAL DIGI ACCELEPORT DRIVER 5811USB SERIAL DIGI ACCELEPORT DRIVER
4695P: Peter Berger and Al Borchers 5812P: Peter Berger and Al Borchers
@@ -4697,18 +5814,24 @@ M: pberger@brimson.com
4697M: alborchers@steinerpoint.com 5814M: alborchers@steinerpoint.com
4698L: linux-usb@vger.kernel.org 5815L: linux-usb@vger.kernel.org
4699S: Maintained 5816S: Maintained
5817F: drivers/usb/serial/digi_acceleport.c
4700 5818
4701USB SERIAL DRIVER 5819USB SERIAL DRIVER
4702P: Greg Kroah-Hartman 5820P: Greg Kroah-Hartman
4703M: gregkh@suse.de 5821M: gregkh@suse.de
4704L: linux-usb@vger.kernel.org 5822L: linux-usb@vger.kernel.org
4705S: Supported 5823S: Supported
5824F: Documentation/usb/usb-serial.txt
5825F: drivers/usb/serial/generic.c
5826F: drivers/usb/serial/usb-serial.c
5827F: include/linux/usb/serial.h
4706 5828
4707USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER 5829USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER
4708P: Gary Brubaker 5830P: Gary Brubaker
4709M: xavyer@ix.netcom.com 5831M: xavyer@ix.netcom.com
4710L: linux-usb@vger.kernel.org 5832L: linux-usb@vger.kernel.org
4711S: Maintained 5833S: Maintained
5834F: drivers/usb/serial/empeg.c
4712 5835
4713USB SERIAL KEYSPAN DRIVER 5836USB SERIAL KEYSPAN DRIVER
4714P: Greg Kroah-Hartman 5837P: Greg Kroah-Hartman
@@ -4716,6 +5839,7 @@ M: greg@kroah.com
4716L: linux-usb@vger.kernel.org 5839L: linux-usb@vger.kernel.org
4717W: http://www.kroah.com/linux/ 5840W: http://www.kroah.com/linux/
4718S: Maintained 5841S: Maintained
5842F: drivers/usb/serial/*keyspan*
4719 5843
4720USB SERIAL WHITEHEAT DRIVER 5844USB SERIAL WHITEHEAT DRIVER
4721P: Support Department 5845P: Support Department
@@ -4723,21 +5847,25 @@ M: support@connecttech.com
4723L: linux-usb@vger.kernel.org 5847L: linux-usb@vger.kernel.org
4724W: http://www.connecttech.com 5848W: http://www.connecttech.com
4725S: Supported 5849S: Supported
5850F: drivers/usb/serial/whiteheat*
4726 5851
4727USB SMSC95XX ETHERNET DRIVER 5852USB SMSC95XX ETHERNET DRIVER
4728P: Steve Glendinning 5853P: Steve Glendinning
4729M: steve.glendinning@smsc.com 5854M: steve.glendinning@smsc.com
4730L: netdev@vger.kernel.org 5855L: netdev@vger.kernel.org
4731S: Supported 5856S: Supported
5857F: drivers/net/usb/smsc95xx.*
4732 5858
4733USB SN9C1xx DRIVER 5859USB SN9C1xx DRIVER
4734P: Luca Risolia 5860P: Luca Risolia
4735M: luca.risolia@studio.unibo.it 5861M: luca.risolia@studio.unibo.it
4736L: linux-usb@vger.kernel.org 5862L: linux-usb@vger.kernel.org
4737L: linux-media@vger.kernel.org 5863L: linux-media@vger.kernel.org
4738T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5864T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4739W: http://www.linux-projects.org 5865W: http://www.linux-projects.org
4740S: Maintained 5866S: Maintained
5867F: Documentation/video4linux/sn9c102.txt
5868F: drivers/media/video/sn9c102/
4741 5869
4742USB SUBSYSTEM 5870USB SUBSYSTEM
4743P: Greg Kroah-Hartman 5871P: Greg Kroah-Hartman
@@ -4746,12 +5874,18 @@ L: linux-usb@vger.kernel.org
4746W: http://www.linux-usb.org 5874W: http://www.linux-usb.org
4747T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 5875T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
4748S: Supported 5876S: Supported
5877F: Documentation/usb/
5878F: drivers/net/usb/
5879F: drivers/usb/
5880F: include/linux/usb.h
5881F: include/linux/usb/
4749 5882
4750USB UHCI DRIVER 5883USB UHCI DRIVER
4751P: Alan Stern 5884P: Alan Stern
4752M: stern@rowland.harvard.edu 5885M: stern@rowland.harvard.edu
4753L: linux-usb@vger.kernel.org 5886L: linux-usb@vger.kernel.org
4754S: Maintained 5887S: Maintained
5888F: drivers/usb/host/uhci*
4755 5889
4756USB "USBNET" DRIVER FRAMEWORK 5890USB "USBNET" DRIVER FRAMEWORK
4757P: David Brownell 5891P: David Brownell
@@ -4759,39 +5893,47 @@ M: dbrownell@users.sourceforge.net
4759L: netdev@vger.kernel.org 5893L: netdev@vger.kernel.org
4760W: http://www.linux-usb.org/usbnet 5894W: http://www.linux-usb.org/usbnet
4761S: Maintained 5895S: Maintained
5896F: drivers/net/usb/usbnet.c
5897F: include/linux/usb/usbnet.h
4762 5898
4763USB VIDEO CLASS 5899USB VIDEO CLASS
4764P: Laurent Pinchart 5900P: Laurent Pinchart
4765M: laurent.pinchart@skynet.be 5901M: laurent.pinchart@skynet.be
4766L: linux-uvc-devel@lists.berlios.de (subscribers-only) 5902L: linux-uvc-devel@lists.berlios.de (subscribers-only)
4767L: linux-media@vger.kernel.org 5903L: linux-media@vger.kernel.org
4768T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5904T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4769W: http://linux-uvc.berlios.de 5905W: http://linux-uvc.berlios.de
4770S: Maintained 5906S: Maintained
5907F: drivers/media/video/uvc/
4771 5908
4772USB W996[87]CF DRIVER 5909USB W996[87]CF DRIVER
4773P: Luca Risolia 5910P: Luca Risolia
4774M: luca.risolia@studio.unibo.it 5911M: luca.risolia@studio.unibo.it
4775L: linux-usb@vger.kernel.org 5912L: linux-usb@vger.kernel.org
4776L: linux-media@vger.kernel.org 5913L: linux-media@vger.kernel.org
4777T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5914T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4778W: http://www.linux-projects.org 5915W: http://www.linux-projects.org
4779S: Maintained 5916S: Maintained
5917F: Documentation/video4linux/w9968cf.txt
5918F: drivers/media/video/w996*
4780 5919
4781USB WIRELESS RNDIS DRIVER (rndis_wlan) 5920USB WIRELESS RNDIS DRIVER (rndis_wlan)
4782P: Jussi Kivilinna 5921P: Jussi Kivilinna
4783M: jussi.kivilinna@mbnet.fi 5922M: jussi.kivilinna@mbnet.fi
4784L: linux-wireless@vger.kernel.org 5923L: linux-wireless@vger.kernel.org
4785S: Maintained 5924S: Maintained
5925F: drivers/net/wireless/rndis_wlan.c
4786 5926
4787USB ZC0301 DRIVER 5927USB ZC0301 DRIVER
4788P: Luca Risolia 5928P: Luca Risolia
4789M: luca.risolia@studio.unibo.it 5929M: luca.risolia@studio.unibo.it
4790L: linux-usb@vger.kernel.org 5930L: linux-usb@vger.kernel.org
4791L: linux-media@vger.kernel.org 5931L: linux-media@vger.kernel.org
4792T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5932T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4793W: http://www.linux-projects.org 5933W: http://www.linux-projects.org
4794S: Maintained 5934S: Maintained
5935F: Documentation/video4linux/zc0301.txt
5936F: drivers/media/video/zc0301/
4795 5937
4796USB ZD1201 DRIVER 5938USB ZD1201 DRIVER
4797P: Jeroen Vreeken 5939P: Jeroen Vreeken
@@ -4799,15 +5941,18 @@ M: pe1rxq@amsat.org
4799L: linux-usb@vger.kernel.org 5941L: linux-usb@vger.kernel.org
4800W: http://linux-lc100020.sourceforge.net 5942W: http://linux-lc100020.sourceforge.net
4801S: Maintained 5943S: Maintained
5944F: drivers/net/wireless/zd1201.*
4802 5945
4803USB ZR364XX DRIVER 5946USB ZR364XX DRIVER
4804P: Antoine Jacquet 5947P: Antoine Jacquet
4805M: royale@zerezo.com 5948M: royale@zerezo.com
4806L: linux-usb@vger.kernel.org 5949L: linux-usb@vger.kernel.org
4807L: linux-media@vger.kernel.org 5950L: linux-media@vger.kernel.org
4808T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 5951T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4809W: http://royale.zerezo.com/zr364xx/ 5952W: http://royale.zerezo.com/zr364xx/
4810S: Maintained 5953S: Maintained
5954F: Documentation/video4linux/zr364xx.txt
5955F: drivers/media/video/zr364xx.c
4811 5956
4812USER-MODE LINUX (UML) 5957USER-MODE LINUX (UML)
4813P: Jeff Dike 5958P: Jeff Dike
@@ -4816,6 +5961,10 @@ L: user-mode-linux-devel@lists.sourceforge.net
4816L: user-mode-linux-user@lists.sourceforge.net 5961L: user-mode-linux-user@lists.sourceforge.net
4817W: http://user-mode-linux.sourceforge.net 5962W: http://user-mode-linux.sourceforge.net
4818S: Maintained 5963S: Maintained
5964F: Documentation/uml/
5965F: arch/um/
5966F: fs/hostfs/
5967F: fs/hppfs/
4819 5968
4820USERSPACE I/O (UIO) 5969USERSPACE I/O (UIO)
4821P: Hans J. Koch 5970P: Hans J. Koch
@@ -4824,13 +5973,16 @@ P: Greg Kroah-Hartman
4824M: gregkh@suse.de 5973M: gregkh@suse.de
4825L: linux-kernel@vger.kernel.org 5974L: linux-kernel@vger.kernel.org
4826S: Maintained 5975S: Maintained
5976F: Documentation/DocBook/uio-howto.tmpl
5977F: drivers/uio/
5978F: include/linux/uio*.h
4827 5979
4828UTIL-LINUX-NG PACKAGE 5980UTIL-LINUX-NG PACKAGE
4829P: Karel Zak 5981P: Karel Zak
4830M: kzak@redhat.com 5982M: kzak@redhat.com
4831L: util-linux-ng@vger.kernel.org 5983L: util-linux-ng@vger.kernel.org
4832W: http://kernel.org/~kzak/util-linux-ng/ 5984W: http://kernel.org/~kzak/util-linux-ng/
4833T: git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git 5985T: git git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
4834S: Maintained 5986S: Maintained
4835 5987
4836UVESAFB DRIVER 5988UVESAFB DRIVER
@@ -4839,23 +5991,30 @@ M: spock@gentoo.org
4839L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5991L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4840W: http://dev.gentoo.org/~spock/projects/uvesafb/ 5992W: http://dev.gentoo.org/~spock/projects/uvesafb/
4841S: Maintained 5993S: Maintained
5994F: Documentation/fb/uvesafb.txt
5995F: drivers/video/uvesafb.*
4842 5996
4843VFAT/FAT/MSDOS FILESYSTEM 5997VFAT/FAT/MSDOS FILESYSTEM
4844P: OGAWA Hirofumi 5998P: OGAWA Hirofumi
4845M: hirofumi@mail.parknet.co.jp 5999M: hirofumi@mail.parknet.co.jp
4846L: linux-kernel@vger.kernel.org 6000L: linux-kernel@vger.kernel.org
4847S: Maintained 6001S: Maintained
6002F: Documentation/filesystems/vfat.txt
6003F: fs/fat/
4848 6004
4849VIA RHINE NETWORK DRIVER 6005VIA RHINE NETWORK DRIVER
4850P: Roger Luethi 6006P: Roger Luethi
4851M: rl@hellgate.ch 6007M: rl@hellgate.ch
4852S: Maintained 6008S: Maintained
6009F: drivers/net/via-rhine.c
4853 6010
4854VIAPRO SMBUS DRIVER 6011VIAPRO SMBUS DRIVER
4855P: Jean Delvare 6012P: Jean Delvare
4856M: khali@linux-fr.org 6013M: khali@linux-fr.org
4857L: linux-i2c@vger.kernel.org 6014L: linux-i2c@vger.kernel.org
4858S: Maintained 6015S: Maintained
6016F: Documentation/i2c/busses/i2c-viapro
6017F: drivers/i2c/busses/i2c-viapro.c
4859 6018
4860VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER 6019VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
4861P: Joseph Chan 6020P: Joseph Chan
@@ -4864,26 +6023,23 @@ P: Scott Fang
4864M: ScottFang@viatech.com.cn 6023M: ScottFang@viatech.com.cn
4865L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 6024L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
4866S: Maintained 6025S: Maintained
6026F: drivers/video/via/
4867 6027
4868VIA VELOCITY NETWORK DRIVER 6028VIA VELOCITY NETWORK DRIVER
4869P: Francois Romieu 6029P: Francois Romieu
4870M: romieu@fr.zoreil.com 6030M: romieu@fr.zoreil.com
4871L: netdev@vger.kernel.org 6031L: netdev@vger.kernel.org
4872S: Maintained 6032S: Maintained
4873 6033F: drivers/net/via-velocity.*
4874VIDEO FOR LINUX (V4L)
4875P: Mauro Carvalho Chehab
4876M: mchehab@infradead.org
4877L: linux-media@vger.kernel.org
4878W: http://linuxtv.org
4879T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
4880S: Maintained
4881 6034
4882VLAN (802.1Q) 6035VLAN (802.1Q)
4883P: Patrick McHardy 6036P: Patrick McHardy
4884M: kaber@trash.net 6037M: kaber@trash.net
4885L: netdev@vger.kernel.org 6038L: netdev@vger.kernel.org
4886S: Maintained 6039S: Maintained
6040F: drivers/net/macvlan.c
6041F: include/linux/if_*vlan.h
6042F: net/8021q/
4887 6043
4888VOLTAGE AND CURRENT REGULATOR FRAMEWORK 6044VOLTAGE AND CURRENT REGULATOR FRAMEWORK
4889P: Liam Girdwood 6045P: Liam Girdwood
@@ -4892,49 +6048,64 @@ P: Mark Brown
4892M: broonie@opensource.wolfsonmicro.com 6048M: broonie@opensource.wolfsonmicro.com
4893W: http://opensource.wolfsonmicro.com/node/15 6049W: http://opensource.wolfsonmicro.com/node/15
4894W: http://www.slimlogic.co.uk/?p=48 6050W: http://www.slimlogic.co.uk/?p=48
4895T: git kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git 6051T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git
4896S: Supported 6052S: Supported
6053F: drivers/regulator/
6054F: include/linux/regulator/
4897 6055
4898VT1211 HARDWARE MONITOR DRIVER 6056VT1211 HARDWARE MONITOR DRIVER
4899P: Juerg Haefliger 6057P: Juerg Haefliger
4900M: juergh@gmail.com 6058M: juergh@gmail.com
4901L: lm-sensors@lm-sensors.org 6059L: lm-sensors@lm-sensors.org
4902S: Maintained 6060S: Maintained
6061F: Documentation/hwmon/vt1211
6062F: drivers/hwmon/vt1211.c
4903 6063
4904VT8231 HARDWARE MONITOR DRIVER 6064VT8231 HARDWARE MONITOR DRIVER
4905P: Roger Lucas 6065P: Roger Lucas
4906M: vt8231@hiddenengine.co.uk 6066M: vt8231@hiddenengine.co.uk
4907L: lm-sensors@lm-sensors.org 6067L: lm-sensors@lm-sensors.org
4908S: Maintained 6068S: Maintained
6069F: drivers/hwmon/vt8231.c
4909 6070
4910W1 DALLAS'S 1-WIRE BUS 6071W1 DALLAS'S 1-WIRE BUS
4911P: Evgeniy Polyakov 6072P: Evgeniy Polyakov
4912M: johnpol@2ka.mipt.ru 6073M: johnpol@2ka.mipt.ru
4913S: Maintained 6074S: Maintained
6075F: Documentation/w1/
6076F: drivers/w1/
4914 6077
4915W83791D HARDWARE MONITORING DRIVER 6078W83791D HARDWARE MONITORING DRIVER
4916P: Marc Hulsman 6079P: Marc Hulsman
4917M: m.hulsman@tudelft.nl 6080M: m.hulsman@tudelft.nl
4918L: lm-sensors@lm-sensors.org 6081L: lm-sensors@lm-sensors.org
4919S: Maintained 6082S: Maintained
6083F: Documentation/hwmon/w83791d
6084F: drivers/hwmon/w83791d.c
4920 6085
4921W83793 HARDWARE MONITORING DRIVER 6086W83793 HARDWARE MONITORING DRIVER
4922P: Rudolf Marek 6087P: Rudolf Marek
4923M: r.marek@assembler.cz 6088M: r.marek@assembler.cz
4924L: lm-sensors@lm-sensors.org 6089L: lm-sensors@lm-sensors.org
4925S: Maintained 6090S: Maintained
6091F: Documentation/hwmon/w83793
6092F: drivers/hwmon/w83793.c
4926 6093
4927W83L51xD SD/MMC CARD INTERFACE DRIVER 6094W83L51xD SD/MMC CARD INTERFACE DRIVER
4928P: Pierre Ossman 6095P: Pierre Ossman
4929M: pierre@ossman.eu 6096M: pierre@ossman.eu
4930L: linux-kernel@vger.kernel.org 6097L: linux-kernel@vger.kernel.org
4931S: Maintained 6098S: Maintained
6099F: drivers/mmc/host/wbsd.*
4932 6100
4933WATCHDOG DEVICE DRIVERS 6101WATCHDOG DEVICE DRIVERS
4934P: Wim Van Sebroeck 6102P: Wim Van Sebroeck
4935M: wim@iguana.be 6103M: wim@iguana.be
4936T: git kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git 6104T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
4937S: Maintained 6105S: Maintained
6106F: Documentation/watchdog/
6107F: drivers/watchdog/
6108F: include/linux/watchdog.h
4938 6109
4939WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS 6110WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
4940P: Jean Tourrilhes 6111P: Jean Tourrilhes
@@ -4942,12 +6113,15 @@ M: jt@hpl.hp.com
4942L: linux-wireless@vger.kernel.org 6113L: linux-wireless@vger.kernel.org
4943W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/ 6114W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
4944S: Maintained 6115S: Maintained
6116F: Documentation/networking/wavelan.txt
6117F: drivers/net/wireless/wavelan*
4945 6118
4946WD7000 SCSI DRIVER 6119WD7000 SCSI DRIVER
4947P: Miroslav Zagorac 6120P: Miroslav Zagorac
4948M: zaga@fly.cc.fer.hr 6121M: zaga@fly.cc.fer.hr
4949L: linux-scsi@vger.kernel.org 6122L: linux-scsi@vger.kernel.org
4950S: Maintained 6123S: Maintained
6124F: drivers/scsi/wd7000.c
4951 6125
4952WIMAX STACK 6126WIMAX STACK
4953P: Inaky Perez-Gonzalez 6127P: Inaky Perez-Gonzalez
@@ -4961,11 +6135,14 @@ WIMEDIA LLC PROTOCOL (WLP) SUBSYSTEM
4961P: David Vrabel 6135P: David Vrabel
4962M: david.vrabel@csr.com 6136M: david.vrabel@csr.com
4963S: Maintained 6137S: Maintained
6138F: include/linux/wlp.h
6139F: drivers/uwb/wlp/
4964 6140
4965WISTRON LAPTOP BUTTON DRIVER 6141WISTRON LAPTOP BUTTON DRIVER
4966P: Miloslav Trmac 6142P: Miloslav Trmac
4967M: mitr@volny.cz 6143M: mitr@volny.cz
4968S: Maintained 6144S: Maintained
6145F: drivers/input/misc/wistron_btns.c
4969 6146
4970WL3501 WIRELESS PCMCIA CARD DRIVER 6147WL3501 WIRELESS PCMCIA CARD DRIVER
4971P: Arnaldo Carvalho de Melo 6148P: Arnaldo Carvalho de Melo
@@ -4973,6 +6150,7 @@ M: acme@ghostprotocols.net
4973L: linux-wireless@vger.kernel.org 6150L: linux-wireless@vger.kernel.org
4974W: http://oops.ghostprotocols.net:81/blog 6151W: http://oops.ghostprotocols.net:81/blog
4975S: Maintained 6152S: Maintained
6153F: drivers/net/wireless/wl3501*
4976 6154
4977WM97XX TOUCHSCREEN DRIVERS 6155WM97XX TOUCHSCREEN DRIVERS
4978P: Mark Brown 6156P: Mark Brown
@@ -4983,12 +6161,17 @@ L: linux-input@vger.kernel.org
4983T: git git://opensource.wolfsonmicro.com/linux-2.6-touch 6161T: git git://opensource.wolfsonmicro.com/linux-2.6-touch
4984W: http://opensource.wolfsonmicro.com/node/7 6162W: http://opensource.wolfsonmicro.com/node/7
4985S: Supported 6163S: Supported
6164F: drivers/input/touchscreen/*wm97*
6165F: include/linux/wm97xx.h
4986 6166
4987X.25 NETWORK LAYER 6167X.25 NETWORK LAYER
4988P: Henner Eisen 6168P: Henner Eisen
4989M: eis@baty.hanse.de 6169M: eis@baty.hanse.de
4990L: linux-x25@vger.kernel.org 6170L: linux-x25@vger.kernel.org
4991S: Maintained 6171S: Maintained
6172F: Documentation/networking/x25*
6173F: include/net/x25*
6174F: net/x25/
4992 6175
4993X86 ARCHITECTURE (32-BIT AND 64-BIT) 6176X86 ARCHITECTURE (32-BIT AND 64-BIT)
4994P: Thomas Gleixner 6177P: Thomas Gleixner
@@ -4999,8 +6182,10 @@ P: H. Peter Anvin
4999M: hpa@zytor.com 6182M: hpa@zytor.com
5000M: x86@kernel.org 6183M: x86@kernel.org
5001L: linux-kernel@vger.kernel.org 6184L: linux-kernel@vger.kernel.org
5002T: git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git 6185T: git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
5003S: Maintained 6186S: Maintained
6187F: Documentation/x86/
6188F: arch/x86/
5004 6189
5005XEN HYPERVISOR INTERFACE 6190XEN HYPERVISOR INTERFACE
5006P: Jeremy Fitzhardinge 6191P: Jeremy Fitzhardinge
@@ -5010,6 +6195,11 @@ M: chrisw@sous-sol.org
5010L: virtualization@lists.osdl.org 6195L: virtualization@lists.osdl.org
5011L: xen-devel@lists.xensource.com 6196L: xen-devel@lists.xensource.com
5012S: Supported 6197S: Supported
6198F: arch/x86/xen/
6199F: drivers/*/xen-*front.c
6200F: drivers/xen/
6201F: arch/x86/include/asm/xen/
6202F: include/xen/
5013 6203
5014XFS FILESYSTEM 6204XFS FILESYSTEM
5015P: Silicon Graphics Inc 6205P: Silicon Graphics Inc
@@ -5018,8 +6208,10 @@ M: felixb@sgi.com
5018M: xfs-masters@oss.sgi.com 6208M: xfs-masters@oss.sgi.com
5019L: xfs@oss.sgi.com 6209L: xfs@oss.sgi.com
5020W: http://oss.sgi.com/projects/xfs 6210W: http://oss.sgi.com/projects/xfs
5021T: git://oss.sgi.com/xfs/xfs.git 6211T: git git://oss.sgi.com/xfs/xfs.git
5022S: Supported 6212S: Supported
6213F: Documentation/filesystems/xfs.txt
6214F: fs/xfs/
5023 6215
5024XILINX SYSTEMACE DRIVER 6216XILINX SYSTEMACE DRIVER
5025P: Grant Likely 6217P: Grant Likely
@@ -5027,24 +6219,30 @@ M: grant.likely@secretlab.ca
5027W: http://www.secretlab.ca/ 6219W: http://www.secretlab.ca/
5028L: linux-kernel@vger.kernel.org 6220L: linux-kernel@vger.kernel.org
5029S: Maintained 6221S: Maintained
6222F: drivers/block/xsysace.c
5030 6223
5031XILINX UARTLITE SERIAL DRIVER 6224XILINX UARTLITE SERIAL DRIVER
5032P: Peter Korsgaard 6225P: Peter Korsgaard
5033M: jacmet@sunsite.dk 6226M: jacmet@sunsite.dk
5034L: linux-serial@vger.kernel.org 6227L: linux-serial@vger.kernel.org
5035S: Maintained 6228S: Maintained
6229F: drivers/serial/uartlite.c
5036 6230
5037YAM DRIVER FOR AX.25 6231YAM DRIVER FOR AX.25
5038P: Jean-Paul Roubelat 6232P: Jean-Paul Roubelat
5039M: jpr@f6fbb.org 6233M: jpr@f6fbb.org
5040L: linux-hams@vger.kernel.org 6234L: linux-hams@vger.kernel.org
5041S: Maintained 6235S: Maintained
6236F: drivers/net/hamradio/yam*
6237F: include/linux/yam.h
5042 6238
5043YEALINK PHONE DRIVER 6239YEALINK PHONE DRIVER
5044P: Henk Vergonet 6240P: Henk Vergonet
5045M: Henk.Vergonet@gmail.com 6241M: Henk.Vergonet@gmail.com
5046L: usbb2k-api-dev@nongnu.org 6242L: usbb2k-api-dev@nongnu.org
5047S: Maintained 6243S: Maintained
6244F: Documentation/input/yealink.txt
6245F: drivers/input/misc/yealink.*
5048 6246
5049Z8530 DRIVER FOR AX.25 6247Z8530 DRIVER FOR AX.25
5050P: Joerg Reuter 6248P: Joerg Reuter
@@ -5053,6 +6251,9 @@ W: http://yaina.de/jreuter/
5053W: http://www.qsl.net/dl1bke/ 6251W: http://www.qsl.net/dl1bke/
5054L: linux-hams@vger.kernel.org 6252L: linux-hams@vger.kernel.org
5055S: Maintained 6253S: Maintained
6254F: Documentation/networking/z8530drv.txt
6255F: drivers/net/hamradio/*scc.c
6256F: drivers/net/hamradio/z8530.h
5056 6257
5057ZD1211RW WIRELESS DRIVER 6258ZD1211RW WIRELESS DRIVER
5058P: Daniel Drake 6259P: Daniel Drake
@@ -5063,6 +6264,7 @@ W: http://zd1211.ath.cx/wiki/DriverRewrite
5063L: linux-wireless@vger.kernel.org 6264L: linux-wireless@vger.kernel.org
5064L: zd1211-devs@lists.sourceforge.net (subscribers-only) 6265L: zd1211-devs@lists.sourceforge.net (subscribers-only)
5065S: Maintained 6266S: Maintained
6267F: drivers/net/wireless/zd1211rw/
5066 6268
5067ZR36067 VIDEO FOR LINUX DRIVER 6269ZR36067 VIDEO FOR LINUX DRIVER
5068L: mjpeg-users@lists.sourceforge.net 6270L: mjpeg-users@lists.sourceforge.net
@@ -5070,12 +6272,15 @@ L: linux-media@vger.kernel.org
5070W: http://mjpeg.sourceforge.net/driver-zoran/ 6272W: http://mjpeg.sourceforge.net/driver-zoran/
5071T: Mercurial http://linuxtv.org/hg/v4l-dvb 6273T: Mercurial http://linuxtv.org/hg/v4l-dvb
5072S: Odd Fixes 6274S: Odd Fixes
6275F: drivers/media/video/zoran/
5073 6276
5074ZS DECSTATION Z85C30 SERIAL DRIVER 6277ZS DECSTATION Z85C30 SERIAL DRIVER
5075P: Maciej W. Rozycki 6278P: Maciej W. Rozycki
5076M: macro@linux-mips.org 6279M: macro@linux-mips.org
5077S: Maintained 6280S: Maintained
6281F: drivers/serial/zs.*
5078 6282
5079THE REST 6283THE REST
5080P: Linus Torvalds 6284P: Linus Torvalds
6285T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
5081S: Buried alive in reporters 6286S: Buried alive in reporters
diff --git a/Makefile b/Makefile
index e5ad5fd96177..4f7e3ccde05b 100644
--- a/Makefile
+++ b/Makefile
@@ -169,7 +169,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
169 -e s/arm.*/arm/ -e s/sa110/arm/ \ 169 -e s/arm.*/arm/ -e s/sa110/arm/ \
170 -e s/s390x/s390/ -e s/parisc64/parisc/ \ 170 -e s/s390x/s390/ -e s/parisc64/parisc/ \
171 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ 171 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
172 -e s/sh.*/sh/ ) 172 -e s/sh[234].*/sh/ )
173 173
174# Cross compiling and selecting different set of gcc/bin-utils 174# Cross compiling and selecting different set of gcc/bin-utils
175# --------------------------------------------------------------------------- 175# ---------------------------------------------------------------------------
@@ -210,6 +210,11 @@ ifeq ($(ARCH),sparc64)
210 SRCARCH := sparc 210 SRCARCH := sparc
211endif 211endif
212 212
213# Additional ARCH settings for sh
214ifeq ($(ARCH),sh64)
215 SRCARCH := sh
216endif
217
213# Where to locate arch specific headers 218# Where to locate arch specific headers
214hdr-arch := $(SRCARCH) 219hdr-arch := $(SRCARCH)
215 220
@@ -567,7 +572,7 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
567# disable pointer signed / unsigned warnings in gcc 4.0 572# disable pointer signed / unsigned warnings in gcc 4.0
568KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) 573KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
569 574
570# disable invalid "can't wrap" optimzations for signed / pointers 575# disable invalid "can't wrap" optimizations for signed / pointers
571KBUILD_CFLAGS += $(call cc-option,-fwrapv) 576KBUILD_CFLAGS += $(call cc-option,-fwrapv)
572 577
573# revert to pre-gcc-4.4 behaviour of .eh_frame 578# revert to pre-gcc-4.4 behaviour of .eh_frame
@@ -597,6 +602,10 @@ LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
597LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) 602LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
598LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) 603LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
599 604
605ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
606LDFLAGS_vmlinux += -X
607endif
608
600# Default kernel image to build when no specific target is given. 609# Default kernel image to build when no specific target is given.
601# KBUILD_IMAGE may be overruled on the command line or 610# KBUILD_IMAGE may be overruled on the command line or
602# set in the environment 611# set in the environment
@@ -1587,5 +1596,5 @@ PHONY += FORCE
1587FORCE: 1596FORCE:
1588 1597
1589# Declare the contents of the .PHONY variable as phony. We keep that 1598# Declare the contents of the .PHONY variable as phony. We keep that
1590# information in a variable se we can use it in if_changed and friends. 1599# information in a variable so we can use it in if_changed and friends.
1591.PHONY: $(PHONY) 1600.PHONY: $(PHONY)
diff --git a/arch/Kconfig b/arch/Kconfig
index dc81b34c5d82..78a35e9dc104 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -109,3 +109,6 @@ config HAVE_CLK
109 109
110config HAVE_DMA_API_DEBUG 110config HAVE_DMA_API_DEBUG
111 bool 111 bool
112
113config HAVE_DEFAULT_NO_SPIN_MUTEXES
114 bool
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index fc74e913c415..34a56a136efd 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -131,14 +131,14 @@ static struct musb_hdrc_platform_data musb_plat = {
131 .power = 50, /* up to 100 mA */ 131 .power = 50, /* up to 100 mA */
132}; 132};
133 133
134static u64 musb_dmamask = DMA_32BIT_MASK; 134static u64 musb_dmamask = DMA_BIT_MASK(32);
135 135
136static struct platform_device musb_device = { 136static struct platform_device musb_device = {
137 .name = "musb_hdrc", 137 .name = "musb_hdrc",
138 .id = -1, 138 .id = -1,
139 .dev = { 139 .dev = {
140 .dma_mask = &musb_dmamask, 140 .dma_mask = &musb_dmamask,
141 .coherent_dma_mask = DMA_32BIT_MASK, 141 .coherent_dma_mask = DMA_BIT_MASK(32),
142 .platform_data = &musb_plat, 142 .platform_data = &musb_plat,
143 }, 143 },
144 .num_resources = ARRAY_SIZE(musb_resources), 144 .num_resources = ARRAY_SIZE(musb_resources),
@@ -146,14 +146,14 @@ static struct platform_device musb_device = {
146}; 146};
147 147
148#ifdef CONFIG_NOP_USB_XCEIV 148#ifdef CONFIG_NOP_USB_XCEIV
149static u64 nop_xceiv_dmamask = DMA_32BIT_MASK; 149static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32);
150 150
151static struct platform_device nop_xceiv_device = { 151static struct platform_device nop_xceiv_device = {
152 .name = "nop_usb_xceiv", 152 .name = "nop_usb_xceiv",
153 .id = -1, 153 .id = -1,
154 .dev = { 154 .dev = {
155 .dma_mask = &nop_xceiv_dmamask, 155 .dma_mask = &nop_xceiv_dmamask,
156 .coherent_dma_mask = DMA_32BIT_MASK, 156 .coherent_dma_mask = DMA_BIT_MASK(32),
157 .platform_data = NULL, 157 .platform_data = NULL,
158 }, 158 },
159}; 159};
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c
index 573f02c39a00..285aae8431c6 100644
--- a/arch/ia64/kernel/pci-swiotlb.c
+++ b/arch/ia64/kernel/pci-swiotlb.c
@@ -16,7 +16,7 @@ EXPORT_SYMBOL(swiotlb);
16static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size, 16static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size,
17 dma_addr_t *dma_handle, gfp_t gfp) 17 dma_addr_t *dma_handle, gfp_t gfp)
18{ 18{
19 if (dev->coherent_dma_mask != DMA_64BIT_MASK) 19 if (dev->coherent_dma_mask != DMA_BIT_MASK(64))
20 gfp |= GFP_DMA; 20 gfp |= GFP_DMA;
21 return swiotlb_alloc_coherent(dev, size, dma_handle, gfp); 21 return swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
22} 22}
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
new file mode 100644
index 000000000000..8cc312b5d4dc
--- /dev/null
+++ b/arch/microblaze/Kconfig
@@ -0,0 +1,141 @@
1# For a description of the syntax of this configuration file,
2# see Documentation/kbuild/kconfig-language.txt.
3
4mainmenu "Linux/Microblaze Kernel Configuration"
5
6config MICROBLAZE
7 def_bool y
8 select HAVE_LMB
9
10config SWAP
11 def_bool n
12
13config RWSEM_GENERIC_SPINLOCK
14 def_bool y
15
16config RWSEM_XCHGADD_ALGORITHM
17 bool
18
19config ARCH_HAS_ILOG2_U32
20 def_bool n
21
22config ARCH_HAS_ILOG2_U64
23 def_bool n
24
25config GENERIC_FIND_NEXT_BIT
26 def_bool y
27
28config GENERIC_HWEIGHT
29 def_bool y
30
31config GENERIC_HARDIRQS
32 def_bool y
33
34config GENERIC_IRQ_PROBE
35 def_bool y
36
37config GENERIC_CALIBRATE_DELAY
38 def_bool y
39
40config GENERIC_TIME
41 def_bool y
42
43config GENERIC_TIME_VSYSCALL
44 def_bool n
45
46config GENERIC_CLOCKEVENTS
47 def_bool y
48
49config GENERIC_HARDIRQS_NO__DO_IRQ
50 def_bool y
51
52config PCI
53 depends on !MMU
54 def_bool n
55
56config NO_DMA
57 depends on !MMU
58 def_bool n
59
60source "init/Kconfig"
61
62source "kernel/Kconfig.freezer"
63
64source "arch/microblaze/platform/Kconfig.platform"
65
66menu "Processor type and features"
67
68source kernel/time/Kconfig
69
70source "kernel/Kconfig.preempt"
71
72source "kernel/Kconfig.hz"
73
74config MMU
75 def_bool n
76
77config NO_MMU
78 bool
79 depends on !MMU
80 default y
81
82comment "Boot options"
83
84config CMDLINE_BOOL
85 bool "Default bootloader kernel arguments"
86
87config CMDLINE
88 string "Default kernel command string"
89 depends on CMDLINE_BOOL
90 default "console=ttyUL0,115200"
91 help
92 On some architectures there is currently no way for the boot loader
93 to pass arguments to the kernel. For these architectures, you should
94 supply some command-line options at build time by entering them
95 here.
96
97config CMDLINE_FORCE
98 bool "Force default kernel command string"
99 depends on CMDLINE_BOOL
100 default n
101 help
102 Set this to have arguments from the default kernel command string
103 override those passed by the boot loader.
104
105config OF
106 def_bool y
107
108config OF_DEVICE
109 def_bool y
110
111config PROC_DEVICETREE
112 bool "Support for device tree in /proc"
113 depends on PROC_FS
114 help
115 This option adds a device-tree directory under /proc which contains
116 an image of the device tree that the kernel copies from Open
117 Firmware or other boot firmware. If unsure, say Y here.
118
119endmenu
120
121source "mm/Kconfig"
122
123menu "Exectuable file formats"
124
125source "fs/Kconfig.binfmt"
126
127endmenu
128
129source "net/Kconfig"
130
131source "drivers/Kconfig"
132
133source "fs/Kconfig"
134
135source "arch/microblaze/Kconfig.debug"
136
137source "security/Kconfig"
138
139source "crypto/Kconfig"
140
141source "lib/Kconfig"
diff --git a/arch/microblaze/Kconfig.debug b/arch/microblaze/Kconfig.debug
new file mode 100644
index 000000000000..242cd35bdb4b
--- /dev/null
+++ b/arch/microblaze/Kconfig.debug
@@ -0,0 +1,26 @@
1# For a description of the syntax of this configuration file,
2# see Documentation/kbuild/kconfig-language.txt.
3
4menu "Kernel hacking"
5
6source "lib/Kconfig.debug"
7
8config EARLY_PRINTK
9 bool "Early printk function for kernel"
10 default n
11 help
12 This option turns on/off early printk messages to console.
13 First Uartlite node is taken.
14
15config HEART_BEAT
16 bool "Heart beat function for kernel"
17 default n
18 help
19 This option turns on/off heart beat kernel functionality.
20 First GPIO node is taken.
21
22config DEBUG_BOOTMEM
23 depends on DEBUG_KERNEL
24 bool "Debug BOOTMEM initialization"
25
26endmenu
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
new file mode 100644
index 000000000000..0dcbb9832974
--- /dev/null
+++ b/arch/microblaze/Makefile
@@ -0,0 +1,69 @@
1UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
2
3# What CPU vesion are we building for, and crack it open
4# as major.minor.rev
5CPU_VER=$(subst ",,$(CONFIG_XILINX_MICROBLAZE0_HW_VER) )
6CPU_MAJOR=$(shell echo $(CPU_VER) | cut -d '.' -f 1)
7CPU_MINOR=$(shell echo $(CPU_VER) | cut -d '.' -f 2)
8CPU_REV=$(shell echo $(CPU_VER) | cut -d '.' -f 3)
9
10export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
11
12# Use cpu-related CONFIG_ vars to set compile options.
13
14# Work out HW multipler support. This is icky.
15# 1. Spartan2 has no HW multiplers.
16# 2. MicroBlaze v3.x always uses them, except in Spartan 2
17# 3. All other FPGa/CPU ver combos, we can trust the CONFIG_ settings
18ifeq (,$(findstring spartan2,$(CONFIG_XILINX_MICROBLAZE0_FAMILY)))
19 ifeq ($(CPU_MAJOR),3)
20 CPUFLAGS-1 += -mno-xl-soft-mul
21 else
22 # USE_HW_MUL can be 0, 1, or 2, defining a heirarchy of HW Mul support.
23 CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL)) += -mxl-multiply-high
24 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL) += -mno-xl-soft-mul
25 endif
26endif
27CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
28CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
29CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP) += -mxl-pattern-compare
30
31CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
32
33# The various CONFIG_XILINX cpu features options are integers 0/1/2...
34# rather than bools y/n
35CFLAGS += $(CPUFLAGS-1)
36CFLAGS += $(CPUFLAGS-2)
37
38# r31 holds current when in kernel mode
39CFLAGS += -ffixed-r31
40
41LDFLAGS_BLOB := --format binary --oformat elf32-microblaze
42
43LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
44
45head-y := arch/microblaze/kernel/head.o
46libs-y += arch/microblaze/lib/ $(LIBGCC)
47core-y += arch/microblaze/kernel/ arch/microblaze/mm/ \
48 arch/microblaze/platform/
49
50boot := arch/$(ARCH)/boot
51
52# defines filename extension depending memory management type
53ifeq ($(CONFIG_MMU),)
54MMUEXT := -nommu
55endif
56export MMUEXT
57
58all: linux.bin
59
60archclean:
61 $(Q)$(MAKE) $(clean)=$(boot)
62
63linux.bin linux.bin.gz: vmlinux
64 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
65
66define archhelp
67 echo '* linux.bin - Create raw binary'
68 echo ' linux.bin.gz - Create compressed raw binary'
69endef
diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile
new file mode 100644
index 000000000000..844edf406d34
--- /dev/null
+++ b/arch/microblaze/boot/Makefile
@@ -0,0 +1,17 @@
1#
2# arch/microblaze/boot/Makefile
3#
4
5targets := linux.bin linux.bin.gz
6
7OBJCOPYFLAGS_linux.bin := -O binary
8
9$(obj)/linux.bin: vmlinux FORCE
10 $(call if_changed,objcopy)
11 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
12
13$(obj)/linux.bin.gz: $(obj)/linux.bin FORCE
14 $(call if_changed,gzip)
15 @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
16
17clean-kernel += linux.bin linux.bin.gz
diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig
new file mode 100644
index 000000000000..beb7ecd72793
--- /dev/null
+++ b/arch/microblaze/configs/nommu_defconfig
@@ -0,0 +1,804 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29
4# Tue Mar 24 10:23:20 2009
5#
6CONFIG_MICROBLAZE=y
7# CONFIG_SWAP is not set
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9# CONFIG_ARCH_HAS_ILOG2_U32 is not set
10# CONFIG_ARCH_HAS_ILOG2_U64 is not set
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_GENERIC_CALIBRATE_DELAY=y
16CONFIG_GENERIC_TIME=y
17# CONFIG_GENERIC_TIME_VSYSCALL is not set
18CONFIG_GENERIC_CLOCKEVENTS=y
19CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
20# CONFIG_PCI is not set
21# CONFIG_NO_DMA is not set
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23
24#
25# General setup
26#
27CONFIG_EXPERIMENTAL=y
28CONFIG_BROKEN_ON_SMP=y
29CONFIG_INIT_ENV_ARG_LIMIT=32
30CONFIG_LOCALVERSION=""
31CONFIG_LOCALVERSION_AUTO=y
32CONFIG_SYSVIPC=y
33CONFIG_SYSVIPC_SYSCTL=y
34CONFIG_POSIX_MQUEUE=y
35CONFIG_BSD_PROCESS_ACCT=y
36CONFIG_BSD_PROCESS_ACCT_V3=y
37# CONFIG_TASKSTATS is not set
38# CONFIG_AUDIT is not set
39
40#
41# RCU Subsystem
42#
43CONFIG_CLASSIC_RCU=y
44# CONFIG_TREE_RCU is not set
45# CONFIG_PREEMPT_RCU is not set
46# CONFIG_TREE_RCU_TRACE is not set
47# CONFIG_PREEMPT_RCU_TRACE is not set
48CONFIG_IKCONFIG=y
49CONFIG_IKCONFIG_PROC=y
50CONFIG_LOG_BUF_SHIFT=17
51# CONFIG_GROUP_SCHED is not set
52# CONFIG_CGROUPS is not set
53CONFIG_SYSFS_DEPRECATED=y
54CONFIG_SYSFS_DEPRECATED_V2=y
55# CONFIG_RELAY is not set
56# CONFIG_NAMESPACES is not set
57# CONFIG_BLK_DEV_INITRD is not set
58CONFIG_CC_OPTIMIZE_FOR_SIZE=y
59CONFIG_SYSCTL=y
60CONFIG_ANON_INODES=y
61CONFIG_EMBEDDED=y
62CONFIG_SYSCTL_SYSCALL=y
63CONFIG_KALLSYMS=y
64CONFIG_KALLSYMS_ALL=y
65CONFIG_KALLSYMS_EXTRA_PASS=y
66# CONFIG_HOTPLUG is not set
67CONFIG_PRINTK=y
68CONFIG_BUG=y
69CONFIG_ELF_CORE=y
70# CONFIG_BASE_FULL is not set
71CONFIG_FUTEX=y
72CONFIG_EPOLL=y
73CONFIG_SIGNALFD=y
74CONFIG_TIMERFD=y
75CONFIG_EVENTFD=y
76CONFIG_AIO=y
77CONFIG_VM_EVENT_COUNTERS=y
78CONFIG_COMPAT_BRK=y
79CONFIG_SLAB=y
80# CONFIG_SLUB is not set
81# CONFIG_SLOB is not set
82# CONFIG_PROFILING is not set
83# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
84CONFIG_SLABINFO=y
85CONFIG_RT_MUTEXES=y
86CONFIG_BASE_SMALL=1
87CONFIG_MODULES=y
88# CONFIG_MODULE_FORCE_LOAD is not set
89CONFIG_MODULE_UNLOAD=y
90# CONFIG_MODULE_FORCE_UNLOAD is not set
91# CONFIG_MODVERSIONS is not set
92# CONFIG_MODULE_SRCVERSION_ALL is not set
93CONFIG_BLOCK=y
94# CONFIG_LBD is not set
95# CONFIG_BLK_DEV_IO_TRACE is not set
96# CONFIG_BLK_DEV_BSG is not set
97# CONFIG_BLK_DEV_INTEGRITY is not set
98
99#
100# IO Schedulers
101#
102CONFIG_IOSCHED_NOOP=y
103CONFIG_IOSCHED_AS=y
104CONFIG_IOSCHED_DEADLINE=y
105CONFIG_IOSCHED_CFQ=y
106# CONFIG_DEFAULT_AS is not set
107# CONFIG_DEFAULT_DEADLINE is not set
108CONFIG_DEFAULT_CFQ=y
109# CONFIG_DEFAULT_NOOP is not set
110CONFIG_DEFAULT_IOSCHED="cfq"
111# CONFIG_FREEZER is not set
112
113#
114# Platform options
115#
116CONFIG_PLATFORM_GENERIC=y
117# CONFIG_SELFMOD is not set
118# CONFIG_OPT_LIB_FUNCTION is not set
119# CONFIG_ALLOW_EDIT_AUTO is not set
120CONFIG_KERNEL_BASE_ADDR=0x90000000
121CONFIG_XILINX_MICROBLAZE0_FAMILY="virtex5"
122CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR=1
123CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR=1
124CONFIG_XILINX_MICROBLAZE0_USE_BARREL=1
125CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
126CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
127CONFIG_XILINX_MICROBLAZE0_USE_FPU=2
128CONFIG_XILINX_MICROBLAZE0_HW_VER="7.10.d"
129
130#
131# Processor type and features
132#
133CONFIG_TICK_ONESHOT=y
134# CONFIG_NO_HZ is not set
135CONFIG_HIGH_RES_TIMERS=y
136CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
137CONFIG_PREEMPT_NONE=y
138# CONFIG_PREEMPT_VOLUNTARY is not set
139# CONFIG_PREEMPT is not set
140CONFIG_HZ_100=y
141# CONFIG_HZ_250 is not set
142# CONFIG_HZ_300 is not set
143# CONFIG_HZ_1000 is not set
144CONFIG_HZ=100
145CONFIG_SCHED_HRTICK=y
146# CONFIG_MMU is not set
147CONFIG_NO_MMU=y
148
149#
150# Boot options
151#
152CONFIG_CMDLINE_BOOL=y
153CONFIG_CMDLINE="console=ttyUL0,115200"
154# CONFIG_CMDLINE_FORCE is not set
155CONFIG_OF=y
156CONFIG_OF_DEVICE=y
157CONFIG_PROC_DEVICETREE=y
158CONFIG_SELECT_MEMORY_MODEL=y
159CONFIG_FLATMEM_MANUAL=y
160# CONFIG_DISCONTIGMEM_MANUAL is not set
161# CONFIG_SPARSEMEM_MANUAL is not set
162CONFIG_FLATMEM=y
163CONFIG_FLAT_NODE_MEM_MAP=y
164CONFIG_PAGEFLAGS_EXTENDED=y
165CONFIG_SPLIT_PTLOCK_CPUS=4
166# CONFIG_PHYS_ADDR_T_64BIT is not set
167CONFIG_ZONE_DMA_FLAG=0
168CONFIG_VIRT_TO_BUS=y
169
170#
171# Exectuable file formats
172#
173CONFIG_BINFMT_FLAT=y
174# CONFIG_BINFMT_ZFLAT is not set
175# CONFIG_BINFMT_SHARED_FLAT is not set
176# CONFIG_HAVE_AOUT is not set
177# CONFIG_BINFMT_MISC is not set
178CONFIG_NET=y
179
180#
181# Networking options
182#
183CONFIG_COMPAT_NET_DEV_OPS=y
184CONFIG_PACKET=y
185# CONFIG_PACKET_MMAP is not set
186CONFIG_UNIX=y
187CONFIG_XFRM=y
188# CONFIG_XFRM_USER is not set
189# CONFIG_XFRM_SUB_POLICY is not set
190# CONFIG_XFRM_MIGRATE is not set
191# CONFIG_XFRM_STATISTICS is not set
192# CONFIG_NET_KEY is not set
193CONFIG_INET=y
194# CONFIG_IP_MULTICAST is not set
195# CONFIG_IP_ADVANCED_ROUTER is not set
196CONFIG_IP_FIB_HASH=y
197# CONFIG_IP_PNP is not set
198# CONFIG_NET_IPIP is not set
199# CONFIG_NET_IPGRE is not set
200# CONFIG_ARPD is not set
201# CONFIG_SYN_COOKIES is not set
202# CONFIG_INET_AH is not set
203# CONFIG_INET_ESP is not set
204# CONFIG_INET_IPCOMP is not set
205# CONFIG_INET_XFRM_TUNNEL is not set
206# CONFIG_INET_TUNNEL is not set
207CONFIG_INET_XFRM_MODE_TRANSPORT=y
208CONFIG_INET_XFRM_MODE_TUNNEL=y
209CONFIG_INET_XFRM_MODE_BEET=y
210# CONFIG_INET_LRO is not set
211CONFIG_INET_DIAG=y
212CONFIG_INET_TCP_DIAG=y
213# CONFIG_TCP_CONG_ADVANCED is not set
214CONFIG_TCP_CONG_CUBIC=y
215CONFIG_DEFAULT_TCP_CONG="cubic"
216# CONFIG_TCP_MD5SIG is not set
217# CONFIG_IPV6 is not set
218# CONFIG_NETWORK_SECMARK is not set
219# CONFIG_NETFILTER is not set
220# CONFIG_IP_DCCP is not set
221# CONFIG_IP_SCTP is not set
222# CONFIG_TIPC is not set
223# CONFIG_ATM is not set
224# CONFIG_BRIDGE is not set
225# CONFIG_NET_DSA is not set
226# CONFIG_VLAN_8021Q is not set
227# CONFIG_DECNET is not set
228# CONFIG_LLC2 is not set
229# CONFIG_IPX is not set
230# CONFIG_ATALK is not set
231# CONFIG_X25 is not set
232# CONFIG_LAPB is not set
233# CONFIG_ECONET is not set
234# CONFIG_WAN_ROUTER is not set
235# CONFIG_NET_SCHED is not set
236# CONFIG_DCB is not set
237
238#
239# Network testing
240#
241# CONFIG_NET_PKTGEN is not set
242# CONFIG_HAMRADIO is not set
243# CONFIG_CAN is not set
244# CONFIG_IRDA is not set
245# CONFIG_BT is not set
246# CONFIG_AF_RXRPC is not set
247# CONFIG_PHONET is not set
248CONFIG_WIRELESS=y
249# CONFIG_CFG80211 is not set
250CONFIG_WIRELESS_OLD_REGULATORY=y
251# CONFIG_WIRELESS_EXT is not set
252# CONFIG_LIB80211 is not set
253# CONFIG_MAC80211 is not set
254# CONFIG_WIMAX is not set
255# CONFIG_RFKILL is not set
256# CONFIG_NET_9P is not set
257
258#
259# Device Drivers
260#
261
262#
263# Generic Driver Options
264#
265CONFIG_STANDALONE=y
266# CONFIG_PREVENT_FIRMWARE_BUILD is not set
267# CONFIG_DEBUG_DRIVER is not set
268# CONFIG_DEBUG_DEVRES is not set
269# CONFIG_SYS_HYPERVISOR is not set
270# CONFIG_CONNECTOR is not set
271CONFIG_MTD=y
272# CONFIG_MTD_DEBUG is not set
273CONFIG_MTD_CONCAT=y
274CONFIG_MTD_PARTITIONS=y
275# CONFIG_MTD_TESTS is not set
276# CONFIG_MTD_REDBOOT_PARTS is not set
277CONFIG_MTD_CMDLINE_PARTS=y
278# CONFIG_MTD_AR7_PARTS is not set
279
280#
281# User Modules And Translation Layers
282#
283CONFIG_MTD_CHAR=y
284CONFIG_MTD_BLKDEVS=y
285CONFIG_MTD_BLOCK=y
286# CONFIG_FTL is not set
287# CONFIG_NFTL is not set
288# CONFIG_INFTL is not set
289# CONFIG_RFD_FTL is not set
290# CONFIG_SSFDC is not set
291# CONFIG_MTD_OOPS is not set
292
293#
294# RAM/ROM/Flash chip drivers
295#
296CONFIG_MTD_CFI=y
297# CONFIG_MTD_JEDECPROBE is not set
298CONFIG_MTD_GEN_PROBE=y
299# CONFIG_MTD_CFI_ADV_OPTIONS is not set
300CONFIG_MTD_MAP_BANK_WIDTH_1=y
301CONFIG_MTD_MAP_BANK_WIDTH_2=y
302CONFIG_MTD_MAP_BANK_WIDTH_4=y
303# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
304# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
305# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
306CONFIG_MTD_CFI_I1=y
307CONFIG_MTD_CFI_I2=y
308# CONFIG_MTD_CFI_I4 is not set
309# CONFIG_MTD_CFI_I8 is not set
310CONFIG_MTD_CFI_INTELEXT=y
311CONFIG_MTD_CFI_AMDSTD=y
312# CONFIG_MTD_CFI_STAA is not set
313CONFIG_MTD_CFI_UTIL=y
314CONFIG_MTD_RAM=y
315# CONFIG_MTD_ROM is not set
316# CONFIG_MTD_ABSENT is not set
317
318#
319# Mapping drivers for chip access
320#
321# CONFIG_MTD_COMPLEX_MAPPINGS is not set
322# CONFIG_MTD_PHYSMAP is not set
323CONFIG_MTD_UCLINUX=y
324# CONFIG_MTD_PLATRAM is not set
325
326#
327# Self-contained MTD device drivers
328#
329# CONFIG_MTD_SLRAM is not set
330# CONFIG_MTD_PHRAM is not set
331# CONFIG_MTD_MTDRAM is not set
332# CONFIG_MTD_BLOCK2MTD is not set
333
334#
335# Disk-On-Chip Device Drivers
336#
337# CONFIG_MTD_DOC2000 is not set
338# CONFIG_MTD_DOC2001 is not set
339# CONFIG_MTD_DOC2001PLUS is not set
340# CONFIG_MTD_NAND is not set
341# CONFIG_MTD_ONENAND is not set
342
343#
344# LPDDR flash memory drivers
345#
346# CONFIG_MTD_LPDDR is not set
347
348#
349# UBI - Unsorted block images
350#
351# CONFIG_MTD_UBI is not set
352# CONFIG_PARPORT is not set
353CONFIG_BLK_DEV=y
354# CONFIG_BLK_DEV_COW_COMMON is not set
355# CONFIG_BLK_DEV_LOOP is not set
356CONFIG_BLK_DEV_NBD=y
357CONFIG_BLK_DEV_RAM=y
358CONFIG_BLK_DEV_RAM_COUNT=16
359CONFIG_BLK_DEV_RAM_SIZE=4096
360# CONFIG_BLK_DEV_XIP is not set
361# CONFIG_CDROM_PKTCDVD is not set
362# CONFIG_ATA_OVER_ETH is not set
363CONFIG_MISC_DEVICES=y
364# CONFIG_ENCLOSURE_SERVICES is not set
365# CONFIG_C2PORT is not set
366
367#
368# EEPROM support
369#
370# CONFIG_EEPROM_93CX6 is not set
371
372#
373# SCSI device support
374#
375# CONFIG_RAID_ATTRS is not set
376# CONFIG_SCSI is not set
377# CONFIG_SCSI_DMA is not set
378# CONFIG_SCSI_NETLINK is not set
379# CONFIG_ATA is not set
380# CONFIG_MD is not set
381CONFIG_NETDEVICES=y
382# CONFIG_DUMMY is not set
383# CONFIG_BONDING is not set
384# CONFIG_MACVLAN is not set
385# CONFIG_EQUALIZER is not set
386# CONFIG_TUN is not set
387# CONFIG_VETH is not set
388# CONFIG_PHYLIB is not set
389CONFIG_NET_ETHERNET=y
390# CONFIG_MII is not set
391# CONFIG_DNET is not set
392# CONFIG_IBM_NEW_EMAC_ZMII is not set
393# CONFIG_IBM_NEW_EMAC_RGMII is not set
394# CONFIG_IBM_NEW_EMAC_TAH is not set
395# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
396# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
397# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
398# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
399# CONFIG_B44 is not set
400CONFIG_NETDEV_1000=y
401CONFIG_NETDEV_10000=y
402
403#
404# Wireless LAN
405#
406# CONFIG_WLAN_PRE80211 is not set
407# CONFIG_WLAN_80211 is not set
408# CONFIG_IWLWIFI_LEDS is not set
409
410#
411# Enable WiMAX (Networking options) to see the WiMAX drivers
412#
413# CONFIG_WAN is not set
414# CONFIG_PPP is not set
415# CONFIG_SLIP is not set
416# CONFIG_NETCONSOLE is not set
417# CONFIG_NETPOLL is not set
418# CONFIG_NET_POLL_CONTROLLER is not set
419# CONFIG_ISDN is not set
420# CONFIG_PHONE is not set
421
422#
423# Input device support
424#
425# CONFIG_INPUT is not set
426
427#
428# Hardware I/O ports
429#
430# CONFIG_SERIO is not set
431# CONFIG_GAMEPORT is not set
432
433#
434# Character devices
435#
436# CONFIG_VT is not set
437CONFIG_DEVKMEM=y
438# CONFIG_SERIAL_NONSTANDARD is not set
439
440#
441# Serial drivers
442#
443# CONFIG_SERIAL_8250 is not set
444
445#
446# Non-8250 serial port support
447#
448CONFIG_SERIAL_UARTLITE=y
449CONFIG_SERIAL_UARTLITE_CONSOLE=y
450CONFIG_SERIAL_CORE=y
451CONFIG_SERIAL_CORE_CONSOLE=y
452CONFIG_UNIX98_PTYS=y
453# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
454CONFIG_LEGACY_PTYS=y
455CONFIG_LEGACY_PTY_COUNT=256
456# CONFIG_IPMI_HANDLER is not set
457CONFIG_HW_RANDOM=y
458# CONFIG_RTC is not set
459# CONFIG_GEN_RTC is not set
460# CONFIG_R3964 is not set
461# CONFIG_RAW_DRIVER is not set
462# CONFIG_TCG_TPM is not set
463# CONFIG_I2C is not set
464# CONFIG_SPI is not set
465# CONFIG_W1 is not set
466# CONFIG_POWER_SUPPLY is not set
467# CONFIG_HWMON is not set
468# CONFIG_THERMAL is not set
469# CONFIG_THERMAL_HWMON is not set
470# CONFIG_WATCHDOG is not set
471CONFIG_SSB_POSSIBLE=y
472
473#
474# Sonics Silicon Backplane
475#
476# CONFIG_SSB is not set
477
478#
479# Multifunction device drivers
480#
481# CONFIG_MFD_CORE is not set
482# CONFIG_MFD_SM501 is not set
483# CONFIG_HTC_PASIC3 is not set
484# CONFIG_MFD_TMIO is not set
485# CONFIG_REGULATOR is not set
486
487#
488# Multimedia devices
489#
490
491#
492# Multimedia core support
493#
494# CONFIG_VIDEO_DEV is not set
495# CONFIG_DVB_CORE is not set
496# CONFIG_VIDEO_MEDIA is not set
497
498#
499# Multimedia drivers
500#
501CONFIG_DAB=y
502
503#
504# Graphics support
505#
506# CONFIG_VGASTATE is not set
507CONFIG_VIDEO_OUTPUT_CONTROL=y
508# CONFIG_FB is not set
509# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
510
511#
512# Display device support
513#
514# CONFIG_DISPLAY_SUPPORT is not set
515# CONFIG_SOUND is not set
516CONFIG_USB_SUPPORT=y
517# CONFIG_USB_ARCH_HAS_HCD is not set
518# CONFIG_USB_ARCH_HAS_OHCI is not set
519# CONFIG_USB_ARCH_HAS_EHCI is not set
520# CONFIG_USB_OTG_WHITELIST is not set
521# CONFIG_USB_OTG_BLACKLIST_HUB is not set
522
523#
524# Enable Host or Gadget support to see Inventra options
525#
526
527#
528# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
529#
530# CONFIG_USB_GADGET is not set
531
532#
533# OTG and related infrastructure
534#
535# CONFIG_MMC is not set
536# CONFIG_MEMSTICK is not set
537# CONFIG_NEW_LEDS is not set
538# CONFIG_ACCESSIBILITY is not set
539# CONFIG_RTC_CLASS is not set
540# CONFIG_DMADEVICES is not set
541# CONFIG_UIO is not set
542# CONFIG_STAGING is not set
543
544#
545# File systems
546#
547CONFIG_EXT2_FS=y
548# CONFIG_EXT2_FS_XATTR is not set
549# CONFIG_EXT3_FS is not set
550# CONFIG_EXT4_FS is not set
551# CONFIG_REISERFS_FS is not set
552# CONFIG_JFS_FS is not set
553CONFIG_FS_POSIX_ACL=y
554CONFIG_FILE_LOCKING=y
555# CONFIG_XFS_FS is not set
556# CONFIG_OCFS2_FS is not set
557# CONFIG_BTRFS_FS is not set
558# CONFIG_DNOTIFY is not set
559# CONFIG_INOTIFY is not set
560# CONFIG_QUOTA is not set
561# CONFIG_AUTOFS_FS is not set
562# CONFIG_AUTOFS4_FS is not set
563# CONFIG_FUSE_FS is not set
564
565#
566# CD-ROM/DVD Filesystems
567#
568# CONFIG_ISO9660_FS is not set
569# CONFIG_UDF_FS is not set
570
571#
572# DOS/FAT/NT Filesystems
573#
574# CONFIG_MSDOS_FS is not set
575# CONFIG_VFAT_FS is not set
576# CONFIG_NTFS_FS is not set
577
578#
579# Pseudo filesystems
580#
581CONFIG_PROC_FS=y
582CONFIG_PROC_SYSCTL=y
583CONFIG_SYSFS=y
584# CONFIG_TMPFS is not set
585# CONFIG_HUGETLB_PAGE is not set
586# CONFIG_CONFIGFS_FS is not set
587CONFIG_MISC_FILESYSTEMS=y
588# CONFIG_ADFS_FS is not set
589# CONFIG_AFFS_FS is not set
590# CONFIG_HFS_FS is not set
591# CONFIG_HFSPLUS_FS is not set
592# CONFIG_BEFS_FS is not set
593# CONFIG_BFS_FS is not set
594# CONFIG_EFS_FS is not set
595# CONFIG_JFFS2_FS is not set
596CONFIG_CRAMFS=y
597# CONFIG_SQUASHFS is not set
598# CONFIG_VXFS_FS is not set
599# CONFIG_MINIX_FS is not set
600# CONFIG_OMFS_FS is not set
601# CONFIG_HPFS_FS is not set
602# CONFIG_QNX4FS_FS is not set
603CONFIG_ROMFS_FS=y
604# CONFIG_SYSV_FS is not set
605# CONFIG_UFS_FS is not set
606CONFIG_NETWORK_FILESYSTEMS=y
607CONFIG_NFS_FS=y
608CONFIG_NFS_V3=y
609CONFIG_NFS_V3_ACL=y
610# CONFIG_NFS_V4 is not set
611# CONFIG_NFSD is not set
612CONFIG_LOCKD=y
613CONFIG_LOCKD_V4=y
614CONFIG_NFS_ACL_SUPPORT=y
615CONFIG_NFS_COMMON=y
616CONFIG_SUNRPC=y
617# CONFIG_SUNRPC_REGISTER_V4 is not set
618# CONFIG_RPCSEC_GSS_KRB5 is not set
619# CONFIG_RPCSEC_GSS_SPKM3 is not set
620# CONFIG_SMB_FS is not set
621# CONFIG_CIFS is not set
622# CONFIG_NCP_FS is not set
623# CONFIG_CODA_FS is not set
624# CONFIG_AFS_FS is not set
625
626#
627# Partition Types
628#
629# CONFIG_PARTITION_ADVANCED is not set
630CONFIG_MSDOS_PARTITION=y
631# CONFIG_NLS is not set
632# CONFIG_DLM is not set
633
634#
635# Kernel hacking
636#
637# CONFIG_PRINTK_TIME is not set
638CONFIG_ENABLE_WARN_DEPRECATED=y
639CONFIG_ENABLE_MUST_CHECK=y
640CONFIG_FRAME_WARN=1024
641# CONFIG_MAGIC_SYSRQ is not set
642CONFIG_UNUSED_SYMBOLS=y
643CONFIG_DEBUG_FS=y
644# CONFIG_HEADERS_CHECK is not set
645CONFIG_DEBUG_KERNEL=y
646CONFIG_DEBUG_SHIRQ=y
647CONFIG_DETECT_SOFTLOCKUP=y
648CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
649CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=1
650CONFIG_SCHED_DEBUG=y
651CONFIG_SCHEDSTATS=y
652CONFIG_TIMER_STATS=y
653CONFIG_DEBUG_OBJECTS=y
654CONFIG_DEBUG_OBJECTS_SELFTEST=y
655CONFIG_DEBUG_OBJECTS_FREE=y
656CONFIG_DEBUG_OBJECTS_TIMERS=y
657CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
658# CONFIG_DEBUG_SLAB is not set
659# CONFIG_DEBUG_RT_MUTEXES is not set
660# CONFIG_RT_MUTEX_TESTER is not set
661# CONFIG_DEBUG_SPINLOCK is not set
662# CONFIG_DEBUG_MUTEXES is not set
663# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
664# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
665# CONFIG_DEBUG_KOBJECT is not set
666CONFIG_DEBUG_INFO=y
667# CONFIG_DEBUG_VM is not set
668# CONFIG_DEBUG_NOMMU_REGIONS is not set
669# CONFIG_DEBUG_WRITECOUNT is not set
670# CONFIG_DEBUG_MEMORY_INIT is not set
671CONFIG_DEBUG_LIST=y
672CONFIG_DEBUG_SG=y
673# CONFIG_DEBUG_NOTIFIERS is not set
674# CONFIG_BOOT_PRINTK_DELAY is not set
675# CONFIG_RCU_TORTURE_TEST is not set
676# CONFIG_RCU_CPU_STALL_DETECTOR is not set
677# CONFIG_BACKTRACE_SELF_TEST is not set
678# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
679# CONFIG_FAULT_INJECTION is not set
680CONFIG_SYSCTL_SYSCALL_CHECK=y
681
682#
683# Tracers
684#
685# CONFIG_SCHED_TRACER is not set
686# CONFIG_CONTEXT_SWITCH_TRACER is not set
687# CONFIG_BOOT_TRACER is not set
688# CONFIG_TRACE_BRANCH_PROFILING is not set
689# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
690# CONFIG_SAMPLES is not set
691CONFIG_EARLY_PRINTK=y
692CONFIG_HEART_BEAT=y
693# CONFIG_DEBUG_BOOTMEM is not set
694
695#
696# Security options
697#
698# CONFIG_KEYS is not set
699# CONFIG_SECURITY is not set
700# CONFIG_SECURITYFS is not set
701# CONFIG_SECURITY_FILE_CAPABILITIES is not set
702CONFIG_CRYPTO=y
703
704#
705# Crypto core or helper
706#
707# CONFIG_CRYPTO_FIPS is not set
708# CONFIG_CRYPTO_MANAGER is not set
709# CONFIG_CRYPTO_MANAGER2 is not set
710# CONFIG_CRYPTO_GF128MUL is not set
711# CONFIG_CRYPTO_NULL is not set
712# CONFIG_CRYPTO_CRYPTD is not set
713# CONFIG_CRYPTO_AUTHENC is not set
714# CONFIG_CRYPTO_TEST is not set
715
716#
717# Authenticated Encryption with Associated Data
718#
719# CONFIG_CRYPTO_CCM is not set
720# CONFIG_CRYPTO_GCM is not set
721# CONFIG_CRYPTO_SEQIV is not set
722
723#
724# Block modes
725#
726# CONFIG_CRYPTO_CBC is not set
727# CONFIG_CRYPTO_CTR is not set
728# CONFIG_CRYPTO_CTS is not set
729# CONFIG_CRYPTO_ECB is not set
730# CONFIG_CRYPTO_LRW is not set
731# CONFIG_CRYPTO_PCBC is not set
732# CONFIG_CRYPTO_XTS is not set
733
734#
735# Hash modes
736#
737# CONFIG_CRYPTO_HMAC is not set
738# CONFIG_CRYPTO_XCBC is not set
739
740#
741# Digest
742#
743# CONFIG_CRYPTO_CRC32C is not set
744# CONFIG_CRYPTO_MD4 is not set
745# CONFIG_CRYPTO_MD5 is not set
746# CONFIG_CRYPTO_MICHAEL_MIC is not set
747# CONFIG_CRYPTO_RMD128 is not set
748# CONFIG_CRYPTO_RMD160 is not set
749# CONFIG_CRYPTO_RMD256 is not set
750# CONFIG_CRYPTO_RMD320 is not set
751# CONFIG_CRYPTO_SHA1 is not set
752# CONFIG_CRYPTO_SHA256 is not set
753# CONFIG_CRYPTO_SHA512 is not set
754# CONFIG_CRYPTO_TGR192 is not set
755# CONFIG_CRYPTO_WP512 is not set
756
757#
758# Ciphers
759#
760# CONFIG_CRYPTO_AES is not set
761# CONFIG_CRYPTO_ANUBIS is not set
762# CONFIG_CRYPTO_ARC4 is not set
763# CONFIG_CRYPTO_BLOWFISH is not set
764# CONFIG_CRYPTO_CAMELLIA is not set
765# CONFIG_CRYPTO_CAST5 is not set
766# CONFIG_CRYPTO_CAST6 is not set
767# CONFIG_CRYPTO_DES is not set
768# CONFIG_CRYPTO_FCRYPT is not set
769# CONFIG_CRYPTO_KHAZAD is not set
770# CONFIG_CRYPTO_SALSA20 is not set
771# CONFIG_CRYPTO_SEED is not set
772# CONFIG_CRYPTO_SERPENT is not set
773# CONFIG_CRYPTO_TEA is not set
774# CONFIG_CRYPTO_TWOFISH is not set
775
776#
777# Compression
778#
779# CONFIG_CRYPTO_DEFLATE is not set
780# CONFIG_CRYPTO_LZO is not set
781
782#
783# Random Number Generation
784#
785# CONFIG_CRYPTO_ANSI_CPRNG is not set
786CONFIG_CRYPTO_HW=y
787
788#
789# Library routines
790#
791CONFIG_GENERIC_FIND_LAST_BIT=y
792# CONFIG_CRC_CCITT is not set
793# CONFIG_CRC16 is not set
794# CONFIG_CRC_T10DIF is not set
795# CONFIG_CRC_ITU_T is not set
796# CONFIG_CRC32 is not set
797# CONFIG_CRC7 is not set
798# CONFIG_LIBCRC32C is not set
799CONFIG_ZLIB_INFLATE=y
800CONFIG_PLIST=y
801CONFIG_HAS_IOMEM=y
802CONFIG_HAS_IOPORT=y
803CONFIG_HAS_DMA=y
804CONFIG_HAVE_LMB=y
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
new file mode 100644
index 000000000000..31820dfef56b
--- /dev/null
+++ b/arch/microblaze/include/asm/Kbuild
@@ -0,0 +1,26 @@
1include include/asm-generic/Kbuild.asm
2
3header-y += auxvec.h
4header-y += errno.h
5header-y += fcntl.h
6header-y += ioctl.h
7header-y += ioctls.h
8header-y += ipcbuf.h
9header-y += linkage.h
10header-y += msgbuf.h
11header-y += poll.h
12header-y += resource.h
13header-y += sembuf.h
14header-y += shmbuf.h
15header-y += sigcontext.h
16header-y += siginfo.h
17header-y += socket.h
18header-y += sockios.h
19header-y += statfs.h
20header-y += stat.h
21header-y += termbits.h
22header-y += ucontext.h
23
24unifdef-y += cputable.h
25unifdef-y += elf.h
26unifdef-y += termios.h
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
new file mode 100644
index 000000000000..a448d94ab721
--- /dev/null
+++ b/arch/microblaze/include/asm/atomic.h
@@ -0,0 +1,123 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_ATOMIC_H
10#define _ASM_MICROBLAZE_ATOMIC_H
11
12#include <linux/types.h>
13#include <linux/compiler.h> /* likely */
14#include <asm/system.h> /* local_irq_XXX and friends */
15
16#define ATOMIC_INIT(i) { (i) }
17#define atomic_read(v) ((v)->counter)
18#define atomic_set(v, i) (((v)->counter) = (i))
19
20#define atomic_inc(v) (atomic_add_return(1, (v)))
21#define atomic_dec(v) (atomic_sub_return(1, (v)))
22
23#define atomic_add(i, v) (atomic_add_return(i, (v)))
24#define atomic_sub(i, v) (atomic_sub_return(i, (v)))
25
26#define atomic_inc_return(v) (atomic_add_return(1, (v)))
27#define atomic_dec_return(v) (atomic_sub_return(1, (v)))
28
29#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
30#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
31
32#define atomic_inc_not_zero(v) (atomic_add_unless((v), 1, 0))
33
34#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
35
36static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
37{
38 int ret;
39 unsigned long flags;
40
41 local_irq_save(flags);
42 ret = v->counter;
43 if (likely(ret == old))
44 v->counter = new;
45 local_irq_restore(flags);
46
47 return ret;
48}
49
50static inline int atomic_add_unless(atomic_t *v, int a, int u)
51{
52 int c, old;
53
54 c = atomic_read(v);
55 while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
56 c = old;
57 return c != u;
58}
59
60static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
61{
62 unsigned long flags;
63
64 local_irq_save(flags);
65 *addr &= ~mask;
66 local_irq_restore(flags);
67}
68
69/**
70 * atomic_add_return - add and return
71 * @i: integer value to add
72 * @v: pointer of type atomic_t
73 *
74 * Atomically adds @i to @v and returns @i + @v
75 */
76static inline int atomic_add_return(int i, atomic_t *v)
77{
78 unsigned long flags;
79 int val;
80
81 local_irq_save(flags);
82 val = v->counter;
83 v->counter = val += i;
84 local_irq_restore(flags);
85
86 return val;
87}
88
89static inline int atomic_sub_return(int i, atomic_t *v)
90{
91 return atomic_add_return(-i, v);
92}
93
94/*
95 * Atomically test *v and decrement if it is greater than 0.
96 * The function returns the old value of *v minus 1.
97 */
98static inline int atomic_dec_if_positive(atomic_t *v)
99{
100 unsigned long flags;
101 int res;
102
103 local_irq_save(flags);
104 res = v->counter - 1;
105 if (res >= 0)
106 v->counter = res;
107 local_irq_restore(flags);
108
109 return res;
110}
111
112#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
113#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
114
115/* Atomic operations are already serializing */
116#define smp_mb__before_atomic_dec() barrier()
117#define smp_mb__after_atomic_dec() barrier()
118#define smp_mb__before_atomic_inc() barrier()
119#define smp_mb__after_atomic_inc() barrier()
120
121#include <asm-generic/atomic.h>
122
123#endif /* _ASM_MICROBLAZE_ATOMIC_H */
diff --git a/arch/microblaze/include/asm/auxvec.h b/arch/microblaze/include/asm/auxvec.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/auxvec.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h
new file mode 100644
index 000000000000..d6df1fd4e1e8
--- /dev/null
+++ b/arch/microblaze/include/asm/bitops.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BITOPS_H
10#define _ASM_MICROBLAZE_BITOPS_H
11
12/*
13 * Copyright 1992, Linus Torvalds.
14 */
15
16#include <asm/byteorder.h> /* swab32 */
17#include <asm/system.h> /* save_flags */
18
19/*
20 * clear_bit() doesn't provide any barrier for the compiler.
21 */
22#define smp_mb__before_clear_bit() barrier()
23#define smp_mb__after_clear_bit() barrier()
24#include <asm-generic/bitops.h>
25#include <asm-generic/bitops/__fls.h>
26
27#endif /* _ASM_MICROBLAZE_BITOPS_H */
diff --git a/arch/microblaze/include/asm/bug.h b/arch/microblaze/include/asm/bug.h
new file mode 100644
index 000000000000..8eb2cdde11d7
--- /dev/null
+++ b/arch/microblaze/include/asm/bug.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BUG_H
10#define _ASM_MICROBLAZE_BUG_H
11
12#include <linux/kernel.h>
13#include <asm-generic/bug.h>
14
15#endif /* _ASM_MICROBLAZE_BUG_H */
diff --git a/arch/microblaze/include/asm/bugs.h b/arch/microblaze/include/asm/bugs.h
new file mode 100644
index 000000000000..f2c6593653fb
--- /dev/null
+++ b/arch/microblaze/include/asm/bugs.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BUGS_H
10#define _ASM_MICROBLAZE_BUGS_H
11
12static inline void check_bugs(void)
13{
14 /* nothing to do */
15}
16
17#endif /* _ASM_MICROBLAZE_BUGS_H */
diff --git a/arch/microblaze/include/asm/byteorder.h b/arch/microblaze/include/asm/byteorder.h
new file mode 100644
index 000000000000..ce9c58732ffc
--- /dev/null
+++ b/arch/microblaze/include/asm/byteorder.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_MICROBLAZE_BYTEORDER_H
2#define _ASM_MICROBLAZE_BYTEORDER_H
3
4#include <linux/byteorder/big_endian.h>
5
6#endif /* _ASM_MICROBLAZE_BYTEORDER_H */
diff --git a/arch/microblaze/include/asm/cache.h b/arch/microblaze/include/asm/cache.h
new file mode 100644
index 000000000000..c4c64b43c074
--- /dev/null
+++ b/arch/microblaze/include/asm/cache.h
@@ -0,0 +1,45 @@
1/*
2 * Cache operations
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_CACHE_H
14#define _ASM_MICROBLAZE_CACHE_H
15
16#include <asm/registers.h>
17
18#define L1_CACHE_SHIFT 2
19/* word-granular cache in microblaze */
20#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
21
22#define SMP_CACHE_BYTES L1_CACHE_BYTES
23
24void _enable_icache(void);
25void _disable_icache(void);
26void _invalidate_icache(unsigned int addr);
27
28#define __enable_icache() _enable_icache()
29#define __disable_icache() _disable_icache()
30#define __invalidate_icache(addr) _invalidate_icache(addr)
31
32void _enable_dcache(void);
33void _disable_dcache(void);
34void _invalidate_dcache(unsigned int addr);
35
36#define __enable_dcache() _enable_dcache()
37#define __disable_dcache() _disable_dcache()
38#define __invalidate_dcache(addr) _invalidate_dcache(addr)
39
40/* FIXME - I don't think this is right */
41#ifdef CONFIG_XILINX_UNCACHED_SHADOW
42#define UNCACHED_SHADOW_MASK (CONFIG_XILINX_ERAM_SIZE)
43#endif
44
45#endif /* _ASM_MICROBLAZE_CACHE_H */
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
new file mode 100644
index 000000000000..3300b785049b
--- /dev/null
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (C) 2007 PetaLogix
3 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
4 * based on v850 version which was
5 * Copyright (C) 2001,02,03 NEC Electronics Corporation
6 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 *
12 */
13
14#ifndef _ASM_MICROBLAZE_CACHEFLUSH_H
15#define _ASM_MICROBLAZE_CACHEFLUSH_H
16
17/* Somebody depends on this; sigh... */
18#include <linux/mm.h>
19
20/*
21 * Cache handling functions.
22 * Microblaze has a write-through data cache, meaning that the data cache
23 * never needs to be flushed. The only flushing operations that are
24 * implemented are to invalidate the instruction cache. These are called
25 * after loading a user application into memory, we must invalidate the
26 * instruction cache to make sure we don't fetch old, bad code.
27 */
28
29/* FIXME for LL-temac driver */
30#define invalidate_dcache_range(start, end) \
31 __invalidate_dcache_range(start, end)
32
33#define flush_cache_all() __invalidate_cache_all()
34#define flush_cache_mm(mm) do { } while (0)
35#define flush_cache_range(vma, start, end) __invalidate_cache_all()
36#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
37
38#define flush_dcache_range(start, end) __invalidate_dcache_range(start, end)
39#define flush_dcache_page(page) do { } while (0)
40#define flush_dcache_mmap_lock(mapping) do { } while (0)
41#define flush_dcache_mmap_unlock(mapping) do { } while (0)
42
43#define flush_icache_range(start, len) __invalidate_icache_range(start, len)
44#define flush_icache_page(vma, pg) do { } while (0)
45
46#define flush_cache_vmap(start, end) do { } while (0)
47#define flush_cache_vunmap(start, end) do { } while (0)
48
49struct page;
50struct mm_struct;
51struct vm_area_struct;
52
53/* see arch/microblaze/kernel/cache.c */
54extern void __invalidate_icache_all(void);
55extern void __invalidate_icache_range(unsigned long start, unsigned long end);
56extern void __invalidate_icache_page(struct vm_area_struct *vma,
57 struct page *page);
58extern void __invalidate_icache_user_range(struct vm_area_struct *vma,
59 struct page *page,
60 unsigned long adr, int len);
61extern void __invalidate_cache_sigtramp(unsigned long addr);
62
63extern void __invalidate_dcache_all(void);
64extern void __invalidate_dcache_range(unsigned long start, unsigned long end);
65extern void __invalidate_dcache_page(struct vm_area_struct *vma,
66 struct page *page);
67extern void __invalidate_dcache_user_range(struct vm_area_struct *vma,
68 struct page *page,
69 unsigned long adr, int len);
70
71extern inline void __invalidate_cache_all(void)
72{
73 __invalidate_icache_all();
74 __invalidate_dcache_all();
75}
76
77#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
78do { memcpy((dst), (src), (len)); \
79 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
80} while (0)
81
82#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
83 memcpy((dst), (src), (len))
84
85#endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */
diff --git a/arch/microblaze/include/asm/checksum.h b/arch/microblaze/include/asm/checksum.h
new file mode 100644
index 000000000000..92b30762ce59
--- /dev/null
+++ b/arch/microblaze/include/asm/checksum.h
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_CHECKSUM_H
11#define _ASM_MICROBLAZE_CHECKSUM_H
12
13#include <linux/in6.h>
14
15/*
16 * computes the checksum of the TCP/UDP pseudo-header
17 * returns a 16-bit checksum, already complemented
18 */
19static inline __wsum
20csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
21 unsigned short proto, __wsum sum)
22{
23 __asm__("add %0, %0, %1\n\t"
24 "addc %0, %0, %2\n\t"
25 "addc %0, %0, %3\n\t"
26 "addc %0, %0, r0\n\t"
27 : "+&d" (sum)
28 : "d" (saddr), "d" (daddr), "d" (len + proto));
29
30 return sum;
31}
32
33/*
34 * computes the checksum of a memory block at buff, length len,
35 * and adds in "sum" (32-bit)
36 *
37 * returns a 32-bit number suitable for feeding into itself
38 * or csum_tcpudp_magic
39 *
40 * this function must be called with even lengths, except
41 * for the last fragment, which may be odd
42 *
43 * it's best to have buff aligned on a 32-bit boundary
44 */
45extern __wsum csum_partial(const void *buff, int len, __wsum sum);
46
47/*
48 * the same as csum_partial, but copies from src while it
49 * checksums
50 *
51 * here even more important to align src and dst on a 32-bit (or even
52 * better 64-bit) boundary
53 */
54extern __wsum csum_partial_copy(const char *src, char *dst, int len, int sum);
55
56/*
57 * the same as csum_partial_copy, but copies from user space.
58 *
59 * here even more important to align src and dst on a 32-bit (or even
60 * better 64-bit) boundary
61 */
62extern __wsum csum_partial_copy_from_user(const char *src, char *dst,
63 int len, int sum, int *csum_err);
64
65#define csum_partial_copy_nocheck(src, dst, len, sum) \
66 csum_partial_copy((src), (dst), (len), (sum))
67
68/*
69 * This is a version of ip_compute_csum() optimized for IP headers,
70 * which always checksum on 4 octet boundaries.
71 *
72 */
73extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
74
75/*
76 * Fold a partial checksum
77 */
78static inline __sum16 csum_fold(unsigned int sum)
79{
80 sum = (sum & 0xffff) + (sum >> 16);
81 sum = (sum & 0xffff) + (sum >> 16);
82 return ~sum;
83}
84
85static inline __sum16
86csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
87 unsigned short proto, __wsum sum)
88{
89 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
90}
91
92/*
93 * this routine is used for miscellaneous IP-like checksums, mainly
94 * in icmp.c
95 */
96extern __sum16 ip_compute_csum(const unsigned char *buff, int len);
97
98#endif /* _ASM_MICROBLAZE_CHECKSUM_H */
diff --git a/arch/microblaze/include/asm/clinkage.h b/arch/microblaze/include/asm/clinkage.h
new file mode 100644
index 000000000000..9e218435a55c
--- /dev/null
+++ b/arch/microblaze/include/asm/clinkage.h
@@ -0,0 +1 @@
#include <linux/linkage.h>
diff --git a/arch/microblaze/include/asm/cpuinfo.h b/arch/microblaze/include/asm/cpuinfo.h
new file mode 100644
index 000000000000..52f28f6dc4eb
--- /dev/null
+++ b/arch/microblaze/include/asm/cpuinfo.h
@@ -0,0 +1,102 @@
1/*
2 * Generic support for queying CPU info
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2007 John Williams <jwilliams@itee.uq.edu.au>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_CPUINFO_H
14#define _ASM_MICROBLAZE_CPUINFO_H
15
16#include <asm/prom.h>
17
18/* CPU Version and FPGA Family code conversion table type */
19struct cpu_ver_key {
20 const char *s;
21 const unsigned k;
22};
23
24extern const struct cpu_ver_key cpu_ver_lookup[];
25
26struct family_string_key {
27 const char *s;
28 const unsigned k;
29};
30
31extern const struct family_string_key family_string_lookup[];
32
33struct cpuinfo {
34 /* Core CPU configuration */
35 u32 use_instr;
36 u32 use_mult;
37 u32 use_fpu;
38 u32 use_exc;
39 u32 ver_code;
40 u32 mmu;
41
42 /* CPU caches */
43 u32 use_icache;
44 u32 icache_tagbits;
45 u32 icache_write;
46 u32 icache_line;
47 u32 icache_size;
48 unsigned long icache_base;
49 unsigned long icache_high;
50
51 u32 use_dcache;
52 u32 dcache_tagbits;
53 u32 dcache_write;
54 u32 dcache_line;
55 u32 dcache_size;
56 unsigned long dcache_base;
57 unsigned long dcache_high;
58
59 /* Bus connections */
60 u32 use_dopb;
61 u32 use_iopb;
62 u32 use_dlmb;
63 u32 use_ilmb;
64 u32 num_fsl;
65
66 /* CPU interrupt line info */
67 u32 irq_edge;
68 u32 irq_positive;
69
70 u32 area_optimised;
71
72 /* HW debug support */
73 u32 hw_debug;
74 u32 num_pc_brk;
75 u32 num_rd_brk;
76 u32 num_wr_brk;
77 u32 cpu_clock_freq; /* store real freq of cpu */
78 u32 freq_div_hz; /* store freq/HZ */
79
80 /* FPGA family */
81 u32 fpga_family_code;
82
83 /* User define */
84 u32 pvr_user1;
85 u32 pvr_user2;
86};
87
88extern struct cpuinfo cpuinfo;
89
90/* fwd declarations of the various CPUinfo populators */
91void setup_cpuinfo(void);
92
93void set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu);
94void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
95
96static inline unsigned int fcpu(struct device_node *cpu, char *n)
97{
98 int *val;
99 return (val = (int *) of_get_property(cpu, n, NULL)) ? *val : 0;
100}
101
102#endif /* _ASM_MICROBLAZE_CPUINFO_H */
diff --git a/arch/microblaze/include/asm/cputable.h b/arch/microblaze/include/asm/cputable.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/cputable.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/cputime.h b/arch/microblaze/include/asm/cputime.h
new file mode 100644
index 000000000000..6d68ad7e0ea3
--- /dev/null
+++ b/arch/microblaze/include/asm/cputime.h
@@ -0,0 +1 @@
#include <asm-generic/cputime.h>
diff --git a/arch/microblaze/include/asm/current.h b/arch/microblaze/include/asm/current.h
new file mode 100644
index 000000000000..8375ea991e26
--- /dev/null
+++ b/arch/microblaze/include/asm/current.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_CURRENT_H
10#define _ASM_MICROBLAZE_CURRENT_H
11
12# ifndef __ASSEMBLY__
13/*
14 * Dedicate r31 to keeping the current task pointer
15 */
16register struct task_struct *current asm("r31");
17
18# define get_current() current
19# endif /* __ASSEMBLY__ */
20
21#endif /* _ASM_MICROBLAZE_CURRENT_H */
diff --git a/arch/microblaze/include/asm/delay.h b/arch/microblaze/include/asm/delay.h
new file mode 100644
index 000000000000..05b7d39e4391
--- /dev/null
+++ b/arch/microblaze/include/asm/delay.h
@@ -0,0 +1,72 @@
1/*
2 * include/asm-microblaze/delay.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2008 Michal Simek
9 * Copyright (C) 2007 John Williams
10 * Copyright (C) 2006 Atmark Techno, Inc.
11 */
12
13#ifndef _ASM_MICROBLAZE_DELAY_H
14#define _ASM_MICROBLAZE_DELAY_H
15
16extern inline void __delay(unsigned long loops)
17{
18 asm volatile ("# __delay \n\t" \
19 "1: addi %0, %0, -1\t\n" \
20 "bneid %0, 1b \t\n" \
21 "nop \t\n"
22 : "=r" (loops)
23 : "0" (loops));
24}
25
26/*
27 * Note that 19 * 226 == 4294 ==~ 2^32 / 10^6, so
28 * loops = (4294 * usecs * loops_per_jiffy * HZ) / 2^32.
29 *
30 * The mul instruction gives us loops = (a * b) / 2^32.
31 * We choose a = usecs * 19 * HZ and b = loops_per_jiffy * 226
32 * because this lets us support a wide range of HZ and
33 * loops_per_jiffy values without either a or b overflowing 2^32.
34 * Thus we need usecs * HZ <= (2^32 - 1) / 19 = 226050910 and
35 * loops_per_jiffy <= (2^32 - 1) / 226 = 19004280
36 * (which corresponds to ~3800 bogomips at HZ = 100).
37 * -- paulus
38 */
39#define __MAX_UDELAY (226050910UL/HZ) /* maximum udelay argument */
40#define __MAX_NDELAY (4294967295UL/HZ) /* maximum ndelay argument */
41
42extern unsigned long loops_per_jiffy;
43
44extern inline void __udelay(unsigned int x)
45{
46
47 unsigned long long tmp =
48 (unsigned long long)x * (unsigned long long)loops_per_jiffy \
49 * 226LL;
50 unsigned loops = tmp >> 32;
51
52/*
53 __asm__("mulxuu %0,%1,%2" : "=r" (loops) :
54 "r" (x), "r" (loops_per_jiffy * 226));
55*/
56 __delay(loops);
57}
58
59extern void __bad_udelay(void); /* deliberately undefined */
60extern void __bad_ndelay(void); /* deliberately undefined */
61
62#define udelay(n) (__builtin_constant_p(n) ? \
63 ((n) > __MAX_UDELAY ? __bad_udelay() : __udelay((n) * (19 * HZ))) : \
64 __udelay((n) * (19 * HZ)))
65
66#define ndelay(n) (__builtin_constant_p(n) ? \
67 ((n) > __MAX_NDELAY ? __bad_ndelay() : __udelay((n) * HZ)) : \
68 __udelay((n) * HZ))
69
70#define muldiv(a, b, c) (((a)*(b))/(c))
71
72#endif /* _ASM_MICROBLAZE_DELAY_H */
diff --git a/arch/microblaze/include/asm/device.h b/arch/microblaze/include/asm/device.h
new file mode 100644
index 000000000000..c042830793ed
--- /dev/null
+++ b/arch/microblaze/include/asm/device.h
@@ -0,0 +1,21 @@
1/*
2 * Arch specific extensions to struct device
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License v2. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DEVICE_H
10#define _ASM_MICROBLAZE_DEVICE_H
11
12struct device_node;
13
14struct dev_archdata {
15 /* Optional pointer to an OF device node */
16 struct device_node *of_node;
17};
18
19#endif /* _ASM_MICROBLAZE_DEVICE_H */
20
21
diff --git a/arch/microblaze/include/asm/div64.h b/arch/microblaze/include/asm/div64.h
new file mode 100644
index 000000000000..6cd978cefb28
--- /dev/null
+++ b/arch/microblaze/include/asm/div64.h
@@ -0,0 +1 @@
#include <asm-generic/div64.h>
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
new file mode 100644
index 000000000000..17336252a9b8
--- /dev/null
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -0,0 +1,129 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DMA_MAPPING_H
10#define _ASM_MICROBLAZE_DMA_MAPPING_H
11
12#include <asm/cacheflush.h>
13#include <linux/io.h>
14#include <linux/bug.h>
15
16struct scatterlist;
17
18#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
19#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
20
21/* FIXME */
22static inline int
23dma_supported(struct device *dev, u64 mask)
24{
25 return 1;
26}
27
28static inline dma_addr_t
29dma_map_page(struct device *dev, struct page *page,
30 unsigned long offset, size_t size,
31 enum dma_data_direction direction)
32{
33 BUG();
34 return 0;
35}
36
37static inline void
38dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
39 enum dma_data_direction direction)
40{
41 BUG();
42}
43
44static inline int
45dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
46 enum dma_data_direction direction)
47{
48 BUG();
49 return 0;
50}
51
52static inline void
53dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
54 enum dma_data_direction direction)
55{
56 BUG();
57}
58
59static inline void
60dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
61 enum dma_data_direction direction)
62{
63 BUG();
64}
65
66static inline void
67dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
68 size_t size, enum dma_data_direction direction)
69{
70 BUG();
71}
72
73static inline void
74dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
75 enum dma_data_direction direction)
76{
77 BUG();
78}
79
80static inline void
81dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
82 enum dma_data_direction direction)
83{
84 BUG();
85}
86
87static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
88{
89 return 0;
90}
91
92static inline void *dma_alloc_coherent(struct device *dev, size_t size,
93 dma_addr_t *dma_handle, int flag)
94{
95 return NULL; /* consistent_alloc(flag, size, dma_handle); */
96}
97
98static inline void dma_free_coherent(struct device *dev, size_t size,
99 void *vaddr, dma_addr_t dma_handle)
100{
101 BUG();
102}
103
104static inline dma_addr_t
105dma_map_single(struct device *dev, void *ptr, size_t size,
106 enum dma_data_direction direction)
107{
108 BUG_ON(direction == DMA_NONE);
109
110 return virt_to_bus(ptr);
111}
112
113static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
114 size_t size,
115 enum dma_data_direction direction)
116{
117 switch (direction) {
118 case DMA_FROM_DEVICE:
119 flush_dcache_range((unsigned)dma_addr,
120 (unsigned)dma_addr + size);
121 /* Fall through */
122 case DMA_TO_DEVICE:
123 break;
124 default:
125 BUG();
126 }
127}
128
129#endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */
diff --git a/arch/microblaze/include/asm/dma.h b/arch/microblaze/include/asm/dma.h
new file mode 100644
index 000000000000..0967fa04fc5e
--- /dev/null
+++ b/arch/microblaze/include/asm/dma.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_DMA_H
10#define _ASM_MICROBLAZE_DMA_H
11
12/* we don't have dma address limit. define it as zero to be
13 * unlimited. */
14#define MAX_DMA_ADDRESS (0)
15
16#endif /* _ASM_MICROBLAZE_DMA_H */
diff --git a/arch/microblaze/include/asm/elf.h b/arch/microblaze/include/asm/elf.h
new file mode 100644
index 000000000000..81337f241347
--- /dev/null
+++ b/arch/microblaze/include/asm/elf.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_ELF_H
10#define _ASM_MICROBLAZE_ELF_H
11
12/*
13 * Note there is no "official" ELF designation for Microblaze.
14 * I've snaffled the value from the microblaze binutils source code
15 * /binutils/microblaze/include/elf/microblaze.h
16 */
17#define EM_XILINX_MICROBLAZE 0xbaab
18#define ELF_ARCH EM_XILINX_MICROBLAZE
19
20/*
21 * This is used to ensure we don't load something for the wrong architecture.
22 */
23#define elf_check_arch(x) ((x)->e_machine == EM_XILINX_MICROBLAZE)
24
25/*
26 * These are used to set parameters in the core dumps.
27 */
28#define ELF_CLASS ELFCLASS32
29
30#endif /* _ASM_MICROBLAZE_ELF_H */
diff --git a/arch/microblaze/include/asm/emergency-restart.h b/arch/microblaze/include/asm/emergency-restart.h
new file mode 100644
index 000000000000..3711bd9d50bd
--- /dev/null
+++ b/arch/microblaze/include/asm/emergency-restart.h
@@ -0,0 +1 @@
#include <asm-generic/emergency-restart.h>
diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h
new file mode 100644
index 000000000000..7f57e42ee467
--- /dev/null
+++ b/arch/microblaze/include/asm/entry.h
@@ -0,0 +1,35 @@
1/*
2 * Definitions used by low-level trap handlers
3 *
4 * Copyright (C) 2008 Michal Simek
5 * Copyright (C) 2007 - 2008 PetaLogix
6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_ENTRY_H
14#define _ASM_MICROBLAZE_ENTRY_H
15
16#include <asm/percpu.h>
17#include <asm/ptrace.h>
18
19/*
20 * These are per-cpu variables required in entry.S, among other
21 * places
22 */
23
24#define PER_CPU(var) per_cpu__##var
25
26# ifndef __ASSEMBLY__
27DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */
28DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */
29DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */
30DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
31DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
32DECLARE_PER_CPU(unsigned int, SYSCALL_SAVE); /* Saved syscall number */
33# endif /* __ASSEMBLY__ */
34
35#endif /* _ASM_MICROBLAZE_ENTRY_H */
diff --git a/arch/microblaze/include/asm/errno.h b/arch/microblaze/include/asm/errno.h
new file mode 100644
index 000000000000..4c82b503d92f
--- /dev/null
+++ b/arch/microblaze/include/asm/errno.h
@@ -0,0 +1 @@
#include <asm-generic/errno.h>
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
new file mode 100644
index 000000000000..4cdd2159f470
--- /dev/null
+++ b/arch/microblaze/include/asm/exceptions.h
@@ -0,0 +1,96 @@
1/*
2 * Preliminary support for HW exception handing for Microblaze
3 *
4 * Copyright (C) 2008 Michal Simek
5 * Copyright (C) 2008 PetaLogix
6 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_EXCEPTIONS_H
14#define _ASM_MICROBLAZE_EXCEPTIONS_H
15
16#ifdef __KERNEL__
17#ifndef __ASSEMBLY__
18
19/* Macros to enable and disable HW exceptions in the MSR */
20/* Define MSR enable bit for HW exceptions */
21#define HWEX_MSR_BIT (1 << 8)
22
23#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
24#define __enable_hw_exceptions() \
25 __asm__ __volatile__ (" msrset r0, %0; \
26 nop;" \
27 : \
28 : "i" (HWEX_MSR_BIT) \
29 : "memory")
30
31#define __disable_hw_exceptions() \
32 __asm__ __volatile__ (" msrclr r0, %0; \
33 nop;" \
34 : \
35 : "i" (HWEX_MSR_BIT) \
36 : "memory")
37#else /* !CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
38#define __enable_hw_exceptions() \
39 __asm__ __volatile__ (" \
40 mfs r12, rmsr; \
41 nop; \
42 ori r12, r12, %0; \
43 mts rmsr, r12; \
44 nop;" \
45 : \
46 : "i" (HWEX_MSR_BIT) \
47 : "memory", "r12")
48
49#define __disable_hw_exceptions() \
50 __asm__ __volatile__ (" \
51 mfs r12, rmsr; \
52 nop; \
53 andi r12, r12, ~%0; \
54 mts rmsr, r12; \
55 nop;" \
56 : \
57 : "i" (HWEX_MSR_BIT) \
58 : "memory", "r12")
59#endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
60
61asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
62 int fsr, int addr);
63
64#if defined(CONFIG_XMON)
65extern void xmon(struct pt_regs *regs);
66extern int xmon_bpt(struct pt_regs *regs);
67extern int xmon_sstep(struct pt_regs *regs);
68extern int xmon_iabr_match(struct pt_regs *regs);
69extern int xmon_dabr_match(struct pt_regs *regs);
70extern void (*xmon_fault_handler)(struct pt_regs *regs);
71
72void (*debugger)(struct pt_regs *regs) = xmon;
73int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
74int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
75int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
76int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
77void (*debugger_fault_handler)(struct pt_regs *regs);
78#elif defined(CONFIG_KGDB)
79void (*debugger)(struct pt_regs *regs);
80int (*debugger_bpt)(struct pt_regs *regs);
81int (*debugger_sstep)(struct pt_regs *regs);
82int (*debugger_iabr_match)(struct pt_regs *regs);
83int (*debugger_dabr_match)(struct pt_regs *regs);
84void (*debugger_fault_handler)(struct pt_regs *regs);
85#else
86#define debugger(regs) do { } while (0)
87#define debugger_bpt(regs) 0
88#define debugger_sstep(regs) 0
89#define debugger_iabr_match(regs) 0
90#define debugger_dabr_match(regs) 0
91#define debugger_fault_handler ((void (*)(struct pt_regs *))0)
92#endif
93
94#endif /*__ASSEMBLY__ */
95#endif /* __KERNEL__ */
96#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
diff --git a/arch/microblaze/include/asm/fcntl.h b/arch/microblaze/include/asm/fcntl.h
new file mode 100644
index 000000000000..46ab12db5739
--- /dev/null
+++ b/arch/microblaze/include/asm/fcntl.h
@@ -0,0 +1 @@
#include <asm-generic/fcntl.h>
diff --git a/arch/microblaze/include/asm/flat.h b/arch/microblaze/include/asm/flat.h
new file mode 100644
index 000000000000..acf0da543ef1
--- /dev/null
+++ b/arch/microblaze/include/asm/flat.h
@@ -0,0 +1,90 @@
1/*
2 * uClinux flat-format executables
3 *
4 * Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file COPYING in the main directory of this
8 * archive for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_FLAT_H
12#define _ASM_MICROBLAZE_FLAT_H
13
14#include <asm/unaligned.h>
15
16#define flat_stack_align(sp) /* nothing needed */
17#define flat_argvp_envp_on_stack() 0
18#define flat_old_ram_flag(flags) (flags)
19#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
20#define flat_set_persistent(relval, p) 0
21
22/*
23 * Microblaze works a little differently from other arches, because
24 * of the MICROBLAZE_64 reloc type. Here, a 32 bit address is split
25 * over two instructions, an 'imm' instruction which provides the top
26 * 16 bits, then the instruction "proper" which provides the low 16
27 * bits.
28 */
29
30/*
31 * Crack open a symbol reference and extract the address to be
32 * relocated. rp is a potentially unaligned pointer to the
33 * reference
34 */
35
36static inline unsigned long
37flat_get_addr_from_rp(unsigned long *rp, unsigned long relval,
38 unsigned long flags, unsigned long *persistent)
39{
40 unsigned long addr;
41 (void)flags;
42
43 /* Is it a split 64/32 reference? */
44 if (relval & 0x80000000) {
45 /* Grab the two halves of the reference */
46 unsigned long val_hi, val_lo;
47
48 val_hi = get_unaligned(rp);
49 val_lo = get_unaligned(rp+1);
50
51 /* Crack the address out */
52 addr = ((val_hi & 0xffff) << 16) + (val_lo & 0xffff);
53 } else {
54 /* Get the address straight out */
55 addr = get_unaligned(rp);
56 }
57
58 return addr;
59}
60
61/*
62 * Insert an address into the symbol reference at rp. rp is potentially
63 * unaligned.
64 */
65
66static inline void
67flat_put_addr_at_rp(unsigned long *rp, unsigned long addr, unsigned long relval)
68{
69 /* Is this a split 64/32 reloc? */
70 if (relval & 0x80000000) {
71 /* Get the two "halves" */
72 unsigned long val_hi = get_unaligned(rp);
73 unsigned long val_lo = get_unaligned(rp + 1);
74
75 /* insert the address */
76 val_hi = (val_hi & 0xffff0000) | addr >> 16;
77 val_lo = (val_lo & 0xffff0000) | (addr & 0xffff);
78
79 /* store the two halves back into memory */
80 put_unaligned(val_hi, rp);
81 put_unaligned(val_lo, rp+1);
82 } else {
83 /* Put it straight in, no messing around */
84 put_unaligned(addr, rp);
85 }
86}
87
88#define flat_get_relocate_addr(rel) (rel & 0x7fffffff)
89
90#endif /* _ASM_MICROBLAZE_FLAT_H */
diff --git a/arch/microblaze/include/asm/ftrace.h b/arch/microblaze/include/asm/ftrace.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/ftrace.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/futex.h b/arch/microblaze/include/asm/futex.h
new file mode 100644
index 000000000000..0b745828f42b
--- /dev/null
+++ b/arch/microblaze/include/asm/futex.h
@@ -0,0 +1 @@
#include <asm-generic/futex.h>
diff --git a/arch/microblaze/include/asm/gpio.h b/arch/microblaze/include/asm/gpio.h
new file mode 100644
index 000000000000..ea04632399d8
--- /dev/null
+++ b/arch/microblaze/include/asm/gpio.h
@@ -0,0 +1,56 @@
1/*
2 * Generic GPIO API implementation for PowerPC.
3 *
4 * Copyright (c) 2007-2008 MontaVista Software, Inc.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.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 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#ifndef __ASM_POWERPC_GPIO_H
15#define __ASM_POWERPC_GPIO_H
16
17#include <linux/errno.h>
18#include <asm-generic/gpio.h>
19
20#ifdef CONFIG_GPIOLIB
21
22/*
23 * We don't (yet) implement inlined/rapid versions for on-chip gpios.
24 * Just call gpiolib.
25 */
26static inline int gpio_get_value(unsigned int gpio)
27{
28 return __gpio_get_value(gpio);
29}
30
31static inline void gpio_set_value(unsigned int gpio, int value)
32{
33 __gpio_set_value(gpio, value);
34}
35
36static inline int gpio_cansleep(unsigned int gpio)
37{
38 return __gpio_cansleep(gpio);
39}
40
41/*
42 * Not implemented, yet.
43 */
44static inline int gpio_to_irq(unsigned int gpio)
45{
46 return -ENOSYS;
47}
48
49static inline int irq_to_gpio(unsigned int irq)
50{
51 return -EINVAL;
52}
53
54#endif /* CONFIG_GPIOLIB */
55
56#endif /* __ASM_POWERPC_GPIO_H */
diff --git a/arch/microblaze/include/asm/hardirq.h b/arch/microblaze/include/asm/hardirq.h
new file mode 100644
index 000000000000..0f2d6b013e11
--- /dev/null
+++ b/arch/microblaze/include/asm/hardirq.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_HARDIRQ_H
10#define _ASM_MICROBLAZE_HARDIRQ_H
11
12#include <linux/cache.h>
13#include <linux/irq.h>
14#include <asm/irq.h>
15#include <asm/current.h>
16#include <linux/ptrace.h>
17
18/* should be defined in each interrupt controller driver */
19extern unsigned int get_irq(struct pt_regs *regs);
20
21typedef struct {
22 unsigned int __softirq_pending;
23} ____cacheline_aligned irq_cpustat_t;
24
25void ack_bad_irq(unsigned int irq);
26
27#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
28
29#endif /* _ASM_MICROBLAZE_HARDIRQ_H */
diff --git a/arch/microblaze/include/asm/hw_irq.h b/arch/microblaze/include/asm/hw_irq.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/hw_irq.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
new file mode 100644
index 000000000000..8b5853ee6b5c
--- /dev/null
+++ b/arch/microblaze/include/asm/io.h
@@ -0,0 +1,208 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IO_H
10#define _ASM_MICROBLAZE_IO_H
11
12#include <asm/byteorder.h>
13#include <asm/page.h>
14#include <linux/types.h>
15
16#define IO_SPACE_LIMIT (0xFFFFFFFF)
17
18static inline unsigned char __raw_readb(const volatile void __iomem *addr)
19{
20 return *(volatile unsigned char __force *)addr;
21}
22static inline unsigned short __raw_readw(const volatile void __iomem *addr)
23{
24 return *(volatile unsigned short __force *)addr;
25}
26static inline unsigned int __raw_readl(const volatile void __iomem *addr)
27{
28 return *(volatile unsigned int __force *)addr;
29}
30static inline unsigned long __raw_readq(const volatile void __iomem *addr)
31{
32 return *(volatile unsigned long __force *)addr;
33}
34static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
35{
36 *(volatile unsigned char __force *)addr = v;
37}
38static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
39{
40 *(volatile unsigned short __force *)addr = v;
41}
42static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
43{
44 *(volatile unsigned int __force *)addr = v;
45}
46static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
47{
48 *(volatile unsigned long __force *)addr = v;
49}
50
51/*
52 * read (readb, readw, readl, readq) and write (writeb, writew,
53 * writel, writeq) accessors are for PCI and thus littel endian.
54 * Linux 2.4 for Microblaze had this wrong.
55 */
56static inline unsigned char readb(const volatile void __iomem *addr)
57{
58 return *(volatile unsigned char __force *)addr;
59}
60static inline unsigned short readw(const volatile void __iomem *addr)
61{
62 return le16_to_cpu(*(volatile unsigned short __force *)addr);
63}
64static inline unsigned int readl(const volatile void __iomem *addr)
65{
66 return le32_to_cpu(*(volatile unsigned int __force *)addr);
67}
68static inline void writeb(unsigned char v, volatile void __iomem *addr)
69{
70 *(volatile unsigned char __force *)addr = v;
71}
72static inline void writew(unsigned short v, volatile void __iomem *addr)
73{
74 *(volatile unsigned short __force *)addr = cpu_to_le16(v);
75}
76static inline void writel(unsigned int v, volatile void __iomem *addr)
77{
78 *(volatile unsigned int __force *)addr = cpu_to_le32(v);
79}
80
81/* ioread and iowrite variants. thease are for now same as __raw_
82 * variants of accessors. we might check for endianess in the feature
83 */
84#define ioread8(addr) __raw_readb((u8 *)(addr))
85#define ioread16(addr) __raw_readw((u16 *)(addr))
86#define ioread32(addr) __raw_readl((u32 *)(addr))
87#define iowrite8(v, addr) __raw_writeb((u8)(v), (u8 *)(addr))
88#define iowrite16(v, addr) __raw_writew((u16)(v), (u16 *)(addr))
89#define iowrite32(v, addr) __raw_writel((u32)(v), (u32 *)(addr))
90
91/* These are the definitions for the x86 IO instructions
92 * inb/inw/inl/outb/outw/outl, the "string" versions
93 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
94 * inb_p/inw_p/...
95 * The macros don't do byte-swapping.
96 */
97#define inb(port) readb((u8 *)((port)))
98#define outb(val, port) writeb((val), (u8 *)((unsigned long)(port)))
99#define inw(port) readw((u16 *)((port)))
100#define outw(val, port) writew((val), (u16 *)((unsigned long)(port)))
101#define inl(port) readl((u32 *)((port)))
102#define outl(val, port) writel((val), (u32 *)((unsigned long)(port)))
103
104#define inb_p(port) inb((port))
105#define outb_p(val, port) outb((val), (port))
106#define inw_p(port) inw((port))
107#define outw_p(val, port) outw((val), (port))
108#define inl_p(port) inl((port))
109#define outl_p(val, port) outl((val), (port))
110
111#define memset_io(a, b, c) memset((void *)(a), (b), (c))
112#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c))
113#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c))
114
115/**
116 * virt_to_phys - map virtual addresses to physical
117 * @address: address to remap
118 *
119 * The returned physical address is the physical (CPU) mapping for
120 * the memory address given. It is only valid to use this function on
121 * addresses directly mapped or allocated via kmalloc.
122 *
123 * This function does not give bus mappings for DMA transfers. In
124 * almost all conceivable cases a device driver should not be using
125 * this function
126 */
127static inline unsigned long __iomem virt_to_phys(volatile void *address)
128{
129 return __pa((unsigned long)address);
130}
131
132#define virt_to_bus virt_to_phys
133
134/**
135 * phys_to_virt - map physical address to virtual
136 * @address: address to remap
137 *
138 * The returned virtual address is a current CPU mapping for
139 * the memory address given. It is only valid to use this function on
140 * addresses that have a kernel mapping
141 *
142 * This function does not handle bus mappings for DMA transfers. In
143 * almost all conceivable cases a device driver should not be using
144 * this function
145 */
146static inline void *phys_to_virt(unsigned long address)
147{
148 return (void *)__va(address);
149}
150
151#define bus_to_virt(a) phys_to_virt(a)
152
153static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
154 unsigned long flags)
155{
156 return (void *)address;
157}
158
159#define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr))
160#define iounmap(addr) ((void)0)
161#define ioremap_nocache(physaddr, size) ioremap(physaddr, size)
162
163/*
164 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
165 * access
166 */
167#define xlate_dev_mem_ptr(p) __va(p)
168
169/*
170 * Convert a virtual cached pointer to an uncached pointer
171 */
172#define xlate_dev_kmem_ptr(p) p
173
174/*
175 * Big Endian
176 */
177#define out_be32(a, v) __raw_writel((v), (void __iomem __force *)(a))
178#define out_be16(a, v) __raw_writew((v), (a))
179
180#define in_be32(a) __raw_readl((const void __iomem __force *)(a))
181#define in_be16(a) __raw_readw(a)
182
183/*
184 * Little endian
185 */
186
187#define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a));
188#define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a))
189
190#define in_le32(a) __le32_to_cpu(__raw_readl(a))
191#define in_le16(a) __le16_to_cpu(__raw_readw(a))
192
193/* Byte ops */
194#define out_8(a, v) __raw_writeb((v), (a))
195#define in_8(a) __raw_readb(a)
196
197/* FIXME */
198static inline void __iomem *ioport_map(unsigned long port, unsigned int len)
199{
200 return (void __iomem *) (port);
201}
202
203static inline void ioport_unmap(void __iomem *addr)
204{
205 /* Nothing to do */
206}
207
208#endif /* _ASM_MICROBLAZE_IO_H */
diff --git a/arch/microblaze/include/asm/ioctl.h b/arch/microblaze/include/asm/ioctl.h
new file mode 100644
index 000000000000..b279fe06dfe5
--- /dev/null
+++ b/arch/microblaze/include/asm/ioctl.h
@@ -0,0 +1 @@
#include <asm-generic/ioctl.h>
diff --git a/arch/microblaze/include/asm/ioctls.h b/arch/microblaze/include/asm/ioctls.h
new file mode 100644
index 000000000000..03582b249204
--- /dev/null
+++ b/arch/microblaze/include/asm/ioctls.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IOCTLS_H
10#define _ASM_MICROBLAZE_IOCTLS_H
11
12#include <linux/ioctl.h>
13
14/* 0x54 is just a magic number to make these relatively unique ('T') */
15
16#define TCGETS 0x5401
17#define TCSETS 0x5402
18#define TCSETSW 0x5403
19#define TCSETSF 0x5404
20#define TCGETA 0x5405
21#define TCSETA 0x5406
22#define TCSETAW 0x5407
23#define TCSETAF 0x5408
24#define TCSBRK 0x5409
25#define TCXONC 0x540A
26#define TCFLSH 0x540B
27#define TIOCEXCL 0x540C
28#define TIOCNXCL 0x540D
29#define TIOCSCTTY 0x540E
30#define TIOCGPGRP 0x540F
31#define TIOCSPGRP 0x5410
32#define TIOCOUTQ 0x5411
33#define TIOCSTI 0x5412
34#define TIOCGWINSZ 0x5413
35#define TIOCSWINSZ 0x5414
36#define TIOCMGET 0x5415
37#define TIOCMBIS 0x5416
38#define TIOCMBIC 0x5417
39#define TIOCMSET 0x5418
40#define TIOCGSOFTCAR 0x5419
41#define TIOCSSOFTCAR 0x541A
42#define FIONREAD 0x541B
43#define TIOCINQ FIONREAD
44#define TIOCLINUX 0x541C
45#define TIOCCONS 0x541D
46#define TIOCGSERIAL 0x541E
47#define TIOCSSERIAL 0x541F
48#define TIOCPKT 0x5420
49#define FIONBIO 0x5421
50#define TIOCNOTTY 0x5422
51#define TIOCSETD 0x5423
52#define TIOCGETD 0x5424
53#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
54#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
55#define TIOCSBRK 0x5427 /* BSD compatibility */
56#define TIOCCBRK 0x5428 /* BSD compatibility */
57#define TIOCGSID 0x5429 /* Return the session ID of FD */
58/* Get Pty Number (of pty-mux device) */
59#define TIOCGPTN _IOR('T', 0x30, unsigned int)
60#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
61
62#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
63#define FIOCLEX 0x5451
64#define FIOASYNC 0x5452
65#define TIOCSERCONFIG 0x5453
66#define TIOCSERGWILD 0x5454
67#define TIOCSERSWILD 0x5455
68#define TIOCGLCKTRMIOS 0x5456
69#define TIOCSLCKTRMIOS 0x5457
70#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
71#define TIOCSERGETLSR 0x5459 /* Get line status register */
72#define TIOCSERGETMULTI 0x545A /* Get multiport config */
73#define TIOCSERSETMULTI 0x545B /* Set multiport config */
74
75#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
76#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
77
78#define FIOQSIZE 0x545E
79
80/* Used for packet mode */
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88
89#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
90
91#endif /* _ASM_MICROBLAZE_IOCTLS_H */
diff --git a/arch/microblaze/include/asm/ipc.h b/arch/microblaze/include/asm/ipc.h
new file mode 100644
index 000000000000..a46e3d9c2a3f
--- /dev/null
+++ b/arch/microblaze/include/asm/ipc.h
@@ -0,0 +1 @@
#include <asm-generic/ipc.h>
diff --git a/arch/microblaze/include/asm/ipcbuf.h b/arch/microblaze/include/asm/ipcbuf.h
new file mode 100644
index 000000000000..b056fa420654
--- /dev/null
+++ b/arch/microblaze/include/asm/ipcbuf.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IPCBUF_H
10#define _ASM_MICROBLAZE_IPCBUF_H
11
12/*
13 * The user_ipc_perm structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 32-bit mode_t and seq
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct ipc64_perm {
23 __kernel_key_t key;
24 __kernel_uid32_t uid;
25 __kernel_gid32_t gid;
26 __kernel_uid32_t cuid;
27 __kernel_gid32_t cgid;
28 __kernel_mode_t mode;
29 unsigned short __pad1;
30 unsigned short seq;
31 unsigned short __pad2;
32 unsigned long __unused1;
33 unsigned long __unused2;
34};
35
36#endif /* _ASM_MICROBLAZE_IPCBUF_H */
diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h
new file mode 100644
index 000000000000..db515deaa720
--- /dev/null
+++ b/arch/microblaze/include/asm/irq.h
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IRQ_H
10#define _ASM_MICROBLAZE_IRQ_H
11
12#define NR_IRQS 32
13
14#include <linux/interrupt.h>
15
16extern unsigned int nr_irq;
17
18#define NO_IRQ (-1)
19
20static inline int irq_canonicalize(int irq)
21{
22 return irq;
23}
24
25struct pt_regs;
26extern void do_IRQ(struct pt_regs *regs);
27
28/* irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
29 * @device: Device node of the device whose interrupt is to be mapped
30 * @index: Index of the interrupt to map
31 *
32 * This function is a wrapper that chains of_irq_map_one() and
33 * irq_create_of_mapping() to make things easier to callers
34 */
35struct device_node;
36extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index);
37
38/** FIXME - not implement
39 * irq_dispose_mapping - Unmap an interrupt
40 * @virq: linux virq number of the interrupt to unmap
41 */
42static inline void irq_dispose_mapping(unsigned int virq)
43{
44 return;
45}
46
47#endif /* _ASM_MICROBLAZE_IRQ_H */
diff --git a/arch/microblaze/include/asm/irq_regs.h b/arch/microblaze/include/asm/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/arch/microblaze/include/asm/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/arch/microblaze/include/asm/irqflags.h b/arch/microblaze/include/asm/irqflags.h
new file mode 100644
index 000000000000..dea65645a4f8
--- /dev/null
+++ b/arch/microblaze/include/asm/irqflags.h
@@ -0,0 +1,123 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IRQFLAGS_H
10#define _ASM_MICROBLAZE_IRQFLAGS_H
11
12#include <linux/irqflags.h>
13
14# if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
15
16# define local_irq_save(flags) \
17 do { \
18 asm volatile ("# local_irq_save \n\t" \
19 "msrclr %0, %1 \n\t" \
20 "nop \n\t" \
21 : "=r"(flags) \
22 : "i"(MSR_IE) \
23 : "memory"); \
24 } while (0)
25
26# define local_irq_disable() \
27 do { \
28 asm volatile ("# local_irq_disable \n\t" \
29 "msrclr r0, %0 \n\t" \
30 "nop \n\t" \
31 : \
32 : "i"(MSR_IE) \
33 : "memory"); \
34 } while (0)
35
36# define local_irq_enable() \
37 do { \
38 asm volatile ("# local_irq_enable \n\t" \
39 "msrset r0, %0 \n\t" \
40 "nop \n\t" \
41 : \
42 : "i"(MSR_IE) \
43 : "memory"); \
44 } while (0)
45
46# else /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR == 0 */
47
48# define local_irq_save(flags) \
49 do { \
50 register unsigned tmp; \
51 asm volatile ("# local_irq_save \n\t" \
52 "mfs %0, rmsr \n\t" \
53 "nop \n\t" \
54 "andi %1, %0, %2 \n\t" \
55 "mts rmsr, %1 \n\t" \
56 "nop \n\t" \
57 : "=r"(flags), "=r" (tmp) \
58 : "i"(~MSR_IE) \
59 : "memory"); \
60 } while (0)
61
62# define local_irq_disable() \
63 do { \
64 register unsigned tmp; \
65 asm volatile ("# local_irq_disable \n\t" \
66 "mfs %0, rmsr \n\t" \
67 "nop \n\t" \
68 "andi %0, %0, %1 \n\t" \
69 "mts rmsr, %0 \n\t" \
70 "nop \n\t" \
71 : "=r"(tmp) \
72 : "i"(~MSR_IE) \
73 : "memory"); \
74 } while (0)
75
76# define local_irq_enable() \
77 do { \
78 register unsigned tmp; \
79 asm volatile ("# local_irq_enable \n\t" \
80 "mfs %0, rmsr \n\t" \
81 "nop \n\t" \
82 "ori %0, %0, %1 \n\t" \
83 "mts rmsr, %0 \n\t" \
84 "nop \n\t" \
85 : "=r"(tmp) \
86 : "i"(MSR_IE) \
87 : "memory"); \
88 } while (0)
89
90# endif /* CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR */
91
92#define local_save_flags(flags) \
93 do { \
94 asm volatile ("# local_save_flags \n\t" \
95 "mfs %0, rmsr \n\t" \
96 "nop \n\t" \
97 : "=r"(flags) \
98 : \
99 : "memory"); \
100 } while (0)
101
102#define local_irq_restore(flags) \
103 do { \
104 asm volatile ("# local_irq_restore \n\t"\
105 "mts rmsr, %0 \n\t" \
106 "nop \n\t" \
107 : \
108 : "r"(flags) \
109 : "memory"); \
110 } while (0)
111
112static inline int irqs_disabled(void)
113{
114 unsigned long flags;
115
116 local_save_flags(flags);
117 return ((flags & MSR_IE) == 0);
118}
119
120#define raw_irqs_disabled irqs_disabled
121#define raw_irqs_disabled_flags(flags) ((flags) == 0)
122
123#endif /* _ASM_MICROBLAZE_IRQFLAGS_H */
diff --git a/arch/microblaze/include/asm/kdebug.h b/arch/microblaze/include/asm/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/arch/microblaze/include/asm/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/arch/microblaze/include/asm/kmap_types.h b/arch/microblaze/include/asm/kmap_types.h
new file mode 100644
index 000000000000..4d7e222f5dd7
--- /dev/null
+++ b/arch/microblaze/include/asm/kmap_types.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_KMAP_TYPES_H
10#define _ASM_MICROBLAZE_KMAP_TYPES_H
11
12enum km_type {
13 KM_BOUNCE_READ,
14 KM_SKB_SUNRPC_DATA,
15 KM_SKB_DATA_SOFTIRQ,
16 KM_USER0,
17 KM_USER1,
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR,
27};
28
29#endif /* _ASM_MICROBLAZE_KMAP_TYPES_H */
diff --git a/arch/microblaze/include/asm/linkage.h b/arch/microblaze/include/asm/linkage.h
new file mode 100644
index 000000000000..3a8e36d057eb
--- /dev/null
+++ b/arch/microblaze/include/asm/linkage.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_LINKAGE_H
10#define _ASM_MICROBLAZE_LINKAGE_H
11
12#define __ALIGN .align 4
13#define __ALIGN_STR ".align 4"
14
15#endif /* _ASM_MICROBLAZE_LINKAGE_H */
diff --git a/arch/microblaze/include/asm/lmb.h b/arch/microblaze/include/asm/lmb.h
new file mode 100644
index 000000000000..a0a0a929c293
--- /dev/null
+++ b/arch/microblaze/include/asm/lmb.h
@@ -0,0 +1,17 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_LMB_H
10#define _ASM_MICROBLAZE_LMB_H
11
12/* LMB limit is OFF */
13#define LMB_REAL_LIMIT 0xFFFFFFFF
14
15#endif /* _ASM_MICROBLAZE_LMB_H */
16
17
diff --git a/arch/microblaze/include/asm/local.h b/arch/microblaze/include/asm/local.h
new file mode 100644
index 000000000000..c11c530f74d0
--- /dev/null
+++ b/arch/microblaze/include/asm/local.h
@@ -0,0 +1 @@
#include <asm-generic/local.h>
diff --git a/arch/microblaze/include/asm/mman.h b/arch/microblaze/include/asm/mman.h
new file mode 100644
index 000000000000..4914b1329445
--- /dev/null
+++ b/arch/microblaze/include/asm/mman.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMAN_H
10#define _ASM_MICROBLAZE_MMAN_H
11
12#include <asm-generic/mman.h>
13
14#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
15#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
16#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
17#define MAP_LOCKED 0x2000 /* pages are locked */
18#define MAP_NORESERVE 0x4000 /* don't check for reservations */
19#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
20#define MAP_NONBLOCK 0x10000 /* do not block on IO */
21
22#define MCL_CURRENT 1 /* lock all current mappings */
23#define MCL_FUTURE 2 /* lock all future mappings */
24
25#endif /* _ASM_MICROBLAZE_MMAN_H */
diff --git a/arch/microblaze/include/asm/mmu.h b/arch/microblaze/include/asm/mmu.h
new file mode 100644
index 000000000000..0e0431d61635
--- /dev/null
+++ b/arch/microblaze/include/asm/mmu.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMU_H
10#define _ASM_MICROBLAZE_MMU_H
11
12#ifndef __ASSEMBLY__
13typedef struct {
14 struct vm_list_struct *vmlist;
15 unsigned long end_brk;
16} mm_context_t;
17#endif /* __ASSEMBLY__ */
18
19#endif /* _ASM_MICROBLAZE_MMU_H */
diff --git a/arch/microblaze/include/asm/mmu_context.h b/arch/microblaze/include/asm/mmu_context.h
new file mode 100644
index 000000000000..150ca01b74ba
--- /dev/null
+++ b/arch/microblaze/include/asm/mmu_context.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
10#define _ASM_MICROBLAZE_MMU_CONTEXT_H
11
12# define init_new_context(tsk, mm) ({ 0; })
13
14# define enter_lazy_tlb(mm, tsk) do {} while (0)
15# define change_mm_context(old, ctx, _pml4) do {} while (0)
16# define destroy_context(mm) do {} while (0)
17# define deactivate_mm(tsk, mm) do {} while (0)
18# define switch_mm(prev, next, tsk) do {} while (0)
19# define activate_mm(prev, next) do {} while (0)
20
21#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/module.h b/arch/microblaze/include/asm/module.h
new file mode 100644
index 000000000000..914565a90315
--- /dev/null
+++ b/arch/microblaze/include/asm/module.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MODULE_H
10#define _ASM_MICROBLAZE_MODULE_H
11
12/* Microblaze Relocations */
13#define R_MICROBLAZE_NONE 0
14#define R_MICROBLAZE_32 1
15#define R_MICROBLAZE_32_PCREL 2
16#define R_MICROBLAZE_64_PCREL 3
17#define R_MICROBLAZE_32_PCREL_LO 4
18#define R_MICROBLAZE_64 5
19#define R_MICROBLAZE_32_LO 6
20#define R_MICROBLAZE_SRO32 7
21#define R_MICROBLAZE_SRW32 8
22#define R_MICROBLAZE_64_NONE 9
23#define R_MICROBLAZE_32_SYM_OP_SYM 10
24/* Keep this the last entry. */
25#define R_MICROBLAZE_NUM 11
26
27struct mod_arch_specific {
28 int foo;
29};
30
31#define Elf_Shdr Elf32_Shdr
32#define Elf_Sym Elf32_Sym
33#define Elf_Ehdr Elf32_Ehdr
34
35typedef struct { volatile int counter; } module_t;
36
37#endif /* _ASM_MICROBLAZE_MODULE_H */
diff --git a/arch/microblaze/include/asm/msgbuf.h b/arch/microblaze/include/asm/msgbuf.h
new file mode 100644
index 000000000000..09dd97097211
--- /dev/null
+++ b/arch/microblaze/include/asm/msgbuf.h
@@ -0,0 +1,31 @@
1#ifndef _ASM_MICROBLAZE_MSGBUF_H
2#define _ASM_MICROBLAZE_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASM_MICROBLAZE_MSGBUF_H */
diff --git a/arch/microblaze/include/asm/mutex.h b/arch/microblaze/include/asm/mutex.h
new file mode 100644
index 000000000000..ff6101aa2c71
--- /dev/null
+++ b/arch/microblaze/include/asm/mutex.h
@@ -0,0 +1 @@
#include <asm-generic/mutex-dec.h>
diff --git a/arch/microblaze/include/asm/namei.h b/arch/microblaze/include/asm/namei.h
new file mode 100644
index 000000000000..61d60b8a07d5
--- /dev/null
+++ b/arch/microblaze/include/asm/namei.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_NAMEI_H
10#define _ASM_MICROBLAZE_NAMEI_H
11
12#ifdef __KERNEL__
13
14/* This dummy routine maybe changed to something useful
15 * for /usr/gnemul/ emulation stuff.
16 * Look at asm-sparc/namei.h for details.
17 */
18#define __emul_prefix() NULL
19
20#endif /* __KERNEL__ */
21
22#endif /* _ASM_MICROBLAZE_NAMEI_H */
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h
new file mode 100644
index 000000000000..ba917cfaefe6
--- /dev/null
+++ b/arch/microblaze/include/asm/of_device.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 *
4 * based on PowerPC of_device.h
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_OF_DEVICE_H
12#define _ASM_MICROBLAZE_OF_DEVICE_H
13#ifdef __KERNEL__
14
15#include <linux/device.h>
16#include <linux/of.h>
17
18/*
19 * The of_device is a kind of "base class" that is a superset of
20 * struct device for use by devices attached to an OF node and
21 * probed using OF properties.
22 */
23struct of_device {
24 struct device_node *node; /* to be obsoleted */
25 u64 dma_mask; /* DMA mask */
26 struct device dev; /* Generic device interface */
27};
28
29extern ssize_t of_device_get_modalias(struct of_device *ofdev,
30 char *str, ssize_t len);
31
32extern struct of_device *of_device_alloc(struct device_node *np,
33 const char *bus_id,
34 struct device *parent);
35
36extern int of_device_uevent(struct device *dev,
37 struct kobj_uevent_env *env);
38
39extern void of_device_make_bus_id(struct of_device *dev);
40
41/* This is just here during the transition */
42#include <linux/of_device.h>
43
44#endif /* __KERNEL__ */
45#endif /* _ASM_MICROBLAZE_OF_DEVICE_H */
diff --git a/arch/microblaze/include/asm/of_platform.h b/arch/microblaze/include/asm/of_platform.h
new file mode 100644
index 000000000000..187c0eedaece
--- /dev/null
+++ b/arch/microblaze/include/asm/of_platform.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
3 * <benh@kernel.crashing.org>
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
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _ASM_MICROBLAZE_OF_PLATFORM_H
12#define _ASM_MICROBLAZE_OF_PLATFORM_H
13
14/* This is just here during the transition */
15#include <linux/of_platform.h>
16
17/*
18 * The list of OF IDs below is used for matching bus types in the
19 * system whose devices are to be exposed as of_platform_devices.
20 *
21 * This is the default list valid for most platforms. This file provides
22 * functions who can take an explicit list if necessary though
23 *
24 * The search is always performed recursively looking for children of
25 * the provided device_node and recursively if such a children matches
26 * a bus type in the list
27 */
28
29static const struct of_device_id of_default_bus_ids[] = {
30 { .type = "soc", },
31 { .compatible = "soc", },
32 { .type = "plb5", },
33 { .type = "plb4", },
34 { .type = "opb", },
35 { .type = "simple", },
36 {},
37};
38
39/* Platform drivers register/unregister */
40static inline int of_register_platform_driver(struct of_platform_driver *drv)
41{
42 return of_register_driver(drv, &of_platform_bus_type);
43}
44static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
45{
46 of_unregister_driver(drv);
47}
48
49/* Platform devices and busses creation */
50extern struct of_device *of_platform_device_create(struct device_node *np,
51 const char *bus_id,
52 struct device *parent);
53/* pseudo "matches" value to not do deep probe */
54#define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
55
56extern int of_platform_bus_probe(struct device_node *root,
57 const struct of_device_id *matches,
58 struct device *parent);
59
60extern struct of_device *of_find_device_by_phandle(phandle ph);
61
62extern void of_instantiate_rtc(void);
63
64#endif /* _ASM_MICROBLAZE_OF_PLATFORM_H */
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
new file mode 100644
index 000000000000..7238dcfcc517
--- /dev/null
+++ b/arch/microblaze/include/asm/page.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 * Changes for MMU support:
6 * Copyright (C) 2007 Xilinx, Inc. All rights reserved.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_PAGE_H
14#define _ASM_MICROBLAZE_PAGE_H
15
16#include <linux/pfn.h>
17#include <asm/setup.h>
18
19/* PAGE_SHIFT determines the page size */
20#define PAGE_SHIFT (12)
21#define PAGE_SIZE (1UL << PAGE_SHIFT)
22#define PAGE_MASK (~(PAGE_SIZE-1))
23
24#ifdef __KERNEL__
25
26#ifndef __ASSEMBLY__
27
28#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
29#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
30
31/* align addr on a size boundary - adjust address up/down if needed */
32#define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((size)-1)))
33#define _ALIGN_DOWN(addr, size) ((addr)&(~((size)-1)))
34
35/* align addr on a size boundary - adjust address up if needed */
36#define _ALIGN(addr, size) _ALIGN_UP(addr, size)
37
38/*
39 * PAGE_OFFSET -- the first address of the first page of memory. When not
40 * using MMU this corresponds to the first free page in physical memory (aligned
41 * on a page boundary).
42 */
43extern unsigned int __page_offset;
44#define PAGE_OFFSET __page_offset
45
46#define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
47#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
48#define free_user_page(page, addr) free_page(addr)
49
50#define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
51
52
53#define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
54#define copy_user_page(vto, vfrom, vaddr, topg) \
55 memcpy((vto), (vfrom), PAGE_SIZE)
56
57/*
58 * These are used to make use of C type-checking..
59 */
60typedef struct page *pgtable_t;
61typedef struct { unsigned long pte; } pte_t;
62typedef struct { unsigned long pgprot; } pgprot_t;
63typedef struct { unsigned long ste[64]; } pmd_t;
64typedef struct { pmd_t pue[1]; } pud_t;
65typedef struct { pud_t pge[1]; } pgd_t;
66
67
68#define pte_val(x) ((x).pte)
69#define pgprot_val(x) ((x).pgprot)
70#define pmd_val(x) ((x).ste[0])
71#define pud_val(x) ((x).pue[0])
72#define pgd_val(x) ((x).pge[0])
73
74#define __pte(x) ((pte_t) { (x) })
75#define __pmd(x) ((pmd_t) { (x) })
76#define __pgd(x) ((pgd_t) { (x) })
77#define __pgprot(x) ((pgprot_t) { (x) })
78
79/**
80 * Conversions for virtual address, physical address, pfn, and struct
81 * page are defined in the following files.
82 *
83 * virt -+
84 * | asm-microblaze/page.h
85 * phys -+
86 * | linux/pfn.h
87 * pfn -+
88 * | asm-generic/memory_model.h
89 * page -+
90 *
91 */
92
93extern unsigned long max_low_pfn;
94extern unsigned long min_low_pfn;
95extern unsigned long max_pfn;
96
97#define __pa(vaddr) ((unsigned long) (vaddr))
98#define __va(paddr) ((void *) (paddr))
99
100#define phys_to_pfn(phys) (PFN_DOWN(phys))
101#define pfn_to_phys(pfn) (PFN_PHYS(pfn))
102
103#define virt_to_pfn(vaddr) (phys_to_pfn((__pa(vaddr))))
104#define pfn_to_virt(pfn) __va(pfn_to_phys((pfn)))
105
106#define virt_to_page(vaddr) (pfn_to_page(virt_to_pfn(vaddr)))
107#define page_to_virt(page) (pfn_to_virt(page_to_pfn(page)))
108
109#define page_to_phys(page) (pfn_to_phys(page_to_pfn(page)))
110#define page_to_bus(page) (page_to_phys(page))
111#define phys_to_page(paddr) (pfn_to_page(phys_to_pfn(paddr)))
112
113extern unsigned int memory_start;
114extern unsigned int memory_end;
115extern unsigned int memory_size;
116
117#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_mapnr)
118
119#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
120
121#else
122#define tophys(rd, rs) (addik rd, rs, 0)
123#define tovirt(rd, rs) (addik rd, rs, 0)
124#endif /* __ASSEMBLY__ */
125
126#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
127
128/* Convert between virtual and physical address for MMU. */
129/* Handle MicroBlaze processor with virtual memory. */
130#define __virt_to_phys(addr) addr
131#define __phys_to_virt(addr) addr
132
133#define TOPHYS(addr) __virt_to_phys(addr)
134
135#endif /* __KERNEL__ */
136
137#include <asm-generic/memory_model.h>
138#include <asm-generic/page.h>
139
140#endif /* _ASM_MICROBLAZE_PAGE_H */
diff --git a/arch/microblaze/include/asm/param.h b/arch/microblaze/include/asm/param.h
new file mode 100644
index 000000000000..8c538a49616d
--- /dev/null
+++ b/arch/microblaze/include/asm/param.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PARAM_H
10#define _ASM_MICROBLAZE_PARAM_H
11
12#ifdef __KERNEL__
13#define HZ CONFIG_HZ /* internal kernel timer frequency */
14#define USER_HZ 100 /* for user interfaces in "ticks" */
15#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
16#endif /* __KERNEL__ */
17
18#ifndef HZ
19#define HZ 100
20#endif
21
22#define EXEC_PAGESIZE 4096
23
24#ifndef NOGROUP
25#define NOGROUP (-1)
26#endif
27
28#define MAXHOSTNAMELEN 64 /* max length of hostname */
29
30#endif /* _ASM_MICROBLAZE_PARAM_H */
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h
new file mode 100644
index 000000000000..7ad28f6f5f1a
--- /dev/null
+++ b/arch/microblaze/include/asm/pci-bridge.h
@@ -0,0 +1 @@
#include <linux/pci.h>
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
new file mode 100644
index 000000000000..ca03794cf3f0
--- /dev/null
+++ b/arch/microblaze/include/asm/pci.h
@@ -0,0 +1 @@
#include <linux/io.h>
diff --git a/arch/microblaze/include/asm/percpu.h b/arch/microblaze/include/asm/percpu.h
new file mode 100644
index 000000000000..06a959d67234
--- /dev/null
+++ b/arch/microblaze/include/asm/percpu.h
@@ -0,0 +1 @@
#include <asm-generic/percpu.h>
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
new file mode 100644
index 000000000000..2a4b35484010
--- /dev/null
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PGALLOC_H
10#define _ASM_MICROBLAZE_PGALLOC_H
11
12#define check_pgt_cache() do {} while (0)
13
14#endif /* _ASM_MICROBLAZE_PGALLOC_H */
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
new file mode 100644
index 000000000000..4df31e46568e
--- /dev/null
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -0,0 +1,54 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PGTABLE_H
10#define _ASM_MICROBLAZE_PGTABLE_H
11
12#include <asm/setup.h>
13
14#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
15 remap_pfn_range(vma, vaddr, pfn, size, prot)
16
17#define pgd_present(pgd) (1) /* pages are always present on non MMU */
18#define pgd_none(pgd) (0)
19#define pgd_bad(pgd) (0)
20#define pgd_clear(pgdp)
21#define kern_addr_valid(addr) (1)
22#define pmd_offset(a, b) ((void *) 0)
23
24#define PAGE_NONE __pgprot(0) /* these mean nothing to non MMU */
25#define PAGE_SHARED __pgprot(0) /* these mean nothing to non MMU */
26#define PAGE_COPY __pgprot(0) /* these mean nothing to non MMU */
27#define PAGE_READONLY __pgprot(0) /* these mean nothing to non MMU */
28#define PAGE_KERNEL __pgprot(0) /* these mean nothing to non MMU */
29
30#define __swp_type(x) (0)
31#define __swp_offset(x) (0)
32#define __swp_entry(typ, off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
33#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
34#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
35
36#ifndef __ASSEMBLY__
37static inline int pte_file(pte_t pte) { return 0; }
38#endif /* __ASSEMBLY__ */
39
40#define ZERO_PAGE(vaddr) ({ BUG(); NULL; })
41
42#define swapper_pg_dir ((pgd_t *) NULL)
43
44#define pgtable_cache_init() do {} while (0)
45
46#define arch_enter_lazy_cpu_mode() do {} while (0)
47
48#ifndef __ASSEMBLY__
49#include <asm-generic/pgtable.h>
50
51void setup_memory(void);
52#endif /* __ASSEMBLY__ */
53
54#endif /* _ASM_MICROBLAZE_PGTABLE_H */
diff --git a/arch/microblaze/include/asm/poll.h b/arch/microblaze/include/asm/poll.h
new file mode 100644
index 000000000000..c98509d3149e
--- /dev/null
+++ b/arch/microblaze/include/asm/poll.h
@@ -0,0 +1 @@
#include <asm-generic/poll.h>
diff --git a/arch/microblaze/include/asm/posix_types.h b/arch/microblaze/include/asm/posix_types.h
new file mode 100644
index 000000000000..b4df41c5dde2
--- /dev/null
+++ b/arch/microblaze/include/asm/posix_types.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H
10#define _ASM_MICROBLAZE_POSIX_TYPES_H
11
12/*
13 * This file is generally used by user-level software, so you need to
14 * be a little careful about namespace pollution etc. Also, we cannot
15 * assume GCC is being used.
16 */
17
18typedef unsigned long __kernel_ino_t;
19typedef unsigned int __kernel_mode_t;
20typedef unsigned int __kernel_nlink_t;
21typedef long __kernel_off_t;
22typedef int __kernel_pid_t;
23typedef unsigned int __kernel_ipc_pid_t;
24typedef unsigned int __kernel_uid_t;
25typedef unsigned int __kernel_gid_t;
26typedef unsigned long __kernel_size_t;
27typedef long __kernel_ssize_t;
28typedef int __kernel_ptrdiff_t;
29typedef long __kernel_time_t;
30typedef long __kernel_suseconds_t;
31typedef long __kernel_clock_t;
32typedef int __kernel_timer_t;
33typedef int __kernel_clockid_t;
34typedef int __kernel_daddr_t;
35typedef char *__kernel_caddr_t;
36typedef unsigned short __kernel_uid16_t;
37typedef unsigned short __kernel_gid16_t;
38typedef unsigned int __kernel_uid32_t;
39typedef unsigned int __kernel_gid32_t;
40
41typedef unsigned int __kernel_old_uid_t;
42typedef unsigned int __kernel_old_gid_t;
43typedef unsigned int __kernel_old_dev_t;
44
45#ifdef __GNUC__
46typedef long long __kernel_loff_t;
47#endif
48
49typedef struct {
50#if defined(__KERNEL__) || defined(__USE_ALL)
51 int val[2];
52#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
53 int __val[2];
54#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
55} __kernel_fsid_t;
56
57#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
58
59#undef __FD_SET
60#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
61
62#undef __FD_CLR
63#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
64
65#undef __FD_ISSET
66#define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
67
68#undef __FD_ZERO
69#define __FD_ZERO(fdsetp) (memset(fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
70
71#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
72
73#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
new file mode 100644
index 000000000000..d8e15434ba21
--- /dev/null
+++ b/arch/microblaze/include/asm/processor.h
@@ -0,0 +1,93 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_PROCESSOR_H
12#define _ASM_MICROBLAZE_PROCESSOR_H
13
14#include <asm/ptrace.h>
15#include <asm/setup.h>
16#include <asm/registers.h>
17#include <asm/segment.h>
18
19# ifndef __ASSEMBLY__
20/* from kernel/cpu/mb.c */
21extern const struct seq_operations cpuinfo_op;
22
23# define cpu_relax() barrier()
24# define cpu_sleep() do {} while (0)
25# define prepare_to_copy(tsk) do {} while (0)
26
27# endif /* __ASSEMBLY__ */
28
29/*
30 * User space process size: memory size
31 *
32 * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both
33 * user processes and the kernel is on the same memory region. They
34 * both share the memory space and that is limited by the amount of
35 * physical memory. thus, we set TASK_SIZE == amount of total memory.
36 */
37# define TASK_SIZE (0x81000000 - 0x80000000)
38
39/*
40 * Default implementation of macro that returns current
41 * instruction pointer ("program counter").
42 */
43# define current_text_addr() ({ __label__ _l; _l: &&_l; })
44
45/*
46 * This decides where the kernel will search for a free chunk of vm
47 * space during mmap's. We won't be using it
48 */
49# define TASK_UNMAPPED_BASE 0
50
51/* definition in include/linux/sched.h */
52struct task_struct;
53
54/* thread_struct is gone. use thread_info instead. */
55struct thread_struct { };
56# define INIT_THREAD { }
57
58/* Do necessary setup to start up a newly executed thread. */
59static inline void start_thread(struct pt_regs *regs,
60 unsigned long pc,
61 unsigned long usp)
62{
63 regs->pc = pc;
64 regs->r1 = usp;
65 regs->kernel_mode = 0;
66}
67
68/* Free all resources held by a thread. */
69static inline void release_thread(struct task_struct *dead_task)
70{
71}
72
73/* Free all resources held by a thread. */
74static inline void exit_thread(void)
75{
76}
77
78extern unsigned long thread_saved_pc(struct task_struct *t);
79
80extern unsigned long get_wchan(struct task_struct *p);
81
82/*
83 * create a kernel thread without removing it from tasklists
84 */
85extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
86
87# define task_pt_regs(tsk) \
88 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
89
90# define KSTK_EIP(tsk) (0)
91# define KSTK_ESP(tsk) (0)
92
93#endif /* _ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
new file mode 100644
index 000000000000..20f7b3a926e8
--- /dev/null
+++ b/arch/microblaze/include/asm/prom.h
@@ -0,0 +1,313 @@
1/*
2 * Definitions for talking to the Open Firmware PROM on
3 * Power Macintosh computers.
4 *
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#ifndef _ASM_MICROBLAZE_PROM_H
16#define _ASM_MICROBLAZE_PROM_H
17#ifdef __KERNEL__
18
19#include <linux/types.h>
20#include <linux/proc_fs.h>
21#include <linux/platform_device.h>
22#include <asm/irq.h>
23#include <asm/atomic.h>
24
25#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
26#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
27
28#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
29#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
30#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
31
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/*
43 * This is what gets passed to the kernel by prom_init or kexec
44 *
45 * The dt struct contains the device tree structure, full pathes and
46 * property contents. The dt strings contain a separate block with just
47 * the strings for the property names, and is fully page aligned and
48 * self contained in a page, so that it can be kept around by the kernel,
49 * each property name appears only once in this page (cheap compression)
50 *
51 * the mem_rsvmap contains a map of reserved ranges of physical memory,
52 * passing it here instead of in the device-tree itself greatly simplifies
53 * the job of everybody. It's just a list of u64 pairs (base/size) that
54 * ends when size is 0
55 */
56struct boot_param_header {
57 u32 magic; /* magic word OF_DT_HEADER */
58 u32 totalsize; /* total size of DT block */
59 u32 off_dt_struct; /* offset to structure */
60 u32 off_dt_strings; /* offset to strings */
61 u32 off_mem_rsvmap; /* offset to memory reserve map */
62 u32 version; /* format version */
63 u32 last_comp_version; /* last compatible version */
64 /* version 2 fields below */
65 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
66 /* version 3 fields below */
67 u32 dt_strings_size; /* size of the DT strings block */
68 /* version 17 fields below */
69 u32 dt_struct_size; /* size of the DT structure block */
70};
71
72typedef u32 phandle;
73typedef u32 ihandle;
74
75struct property {
76 char *name;
77 int length;
78 void *value;
79 struct property *next;
80};
81
82struct device_node {
83 const char *name;
84 const char *type;
85 phandle node;
86 phandle linux_phandle;
87 char *full_name;
88
89 struct property *properties;
90 struct property *deadprops; /* removed properties */
91 struct device_node *parent;
92 struct device_node *child;
93 struct device_node *sibling;
94 struct device_node *next; /* next device of same type */
95 struct device_node *allnext; /* next in list of all nodes */
96 struct proc_dir_entry *pde; /* this node's proc directory */
97 struct kref kref;
98 unsigned long _flags;
99 void *data;
100};
101
102extern struct device_node *of_chosen;
103
104static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
105{
106 return test_bit(flag, &n->_flags);
107}
108
109static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
110{
111 set_bit(flag, &n->_flags);
112}
113
114#define HAVE_ARCH_DEVTREE_FIXUPS
115
116static inline void set_node_proc_entry(struct device_node *dn,
117 struct proc_dir_entry *de)
118{
119 dn->pde = de;
120}
121
122extern struct device_node *allnodes; /* temporary while merging */
123extern rwlock_t devtree_lock; /* temporary while merging */
124
125extern struct device_node *of_find_all_nodes(struct device_node *prev);
126extern struct device_node *of_node_get(struct device_node *node);
127extern void of_node_put(struct device_node *node);
128
129/* For scanning the flat device-tree at boot time */
130extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
131 const char *uname, int depth,
132 void *data),
133 void *data);
134extern void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
135 unsigned long *size);
136extern int __init
137 of_flat_dt_is_compatible(unsigned long node, const char *name);
138extern unsigned long __init of_get_flat_dt_root(void);
139
140/* For updating the device tree at runtime */
141extern void of_attach_node(struct device_node *);
142extern void of_detach_node(struct device_node *);
143
144/* Other Prototypes */
145extern void finish_device_tree(void);
146extern void unflatten_device_tree(void);
147extern int early_uartlite_console(void);
148extern void early_init_devtree(void *);
149extern int machine_is_compatible(const char *compat);
150extern void print_properties(struct device_node *node);
151extern int prom_n_intr_cells(struct device_node *np);
152extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
153extern int prom_add_property(struct device_node *np, struct property *prop);
154extern int prom_remove_property(struct device_node *np, struct property *prop);
155extern int prom_update_property(struct device_node *np,
156 struct property *newprop,
157 struct property *oldprop);
158
159extern struct resource *request_OF_resource(struct device_node *node,
160 int index, const char *name_postfix);
161extern int release_OF_resource(struct device_node *node, int index);
162
163/*
164 * OF address retreival & translation
165 */
166
167/* Helper to read a big number; size is in cells (not bytes) */
168static inline u64 of_read_number(const u32 *cell, int size)
169{
170 u64 r = 0;
171 while (size--)
172 r = (r << 32) | *(cell++);
173 return r;
174}
175
176/* Like of_read_number, but we want an unsigned long result */
177#define of_read_ulong(cell, size) of_read_number(cell, size)
178
179/* Translate an OF address block into a CPU physical address
180 */
181extern u64 of_translate_address(struct device_node *np, const u32 *addr);
182
183/* Extract an address from a device, returns the region size and
184 * the address space flags too. The PCI version uses a BAR number
185 * instead of an absolute index
186 */
187extern const u32 *of_get_address(struct device_node *dev, int index,
188 u64 *size, unsigned int *flags);
189extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
190 u64 *size, unsigned int *flags);
191
192/* Get an address as a resource. Note that if your address is
193 * a PIO address, the conversion will fail if the physical address
194 * can't be internally converted to an IO token with
195 * pci_address_to_pio(), that is because it's either called to early
196 * or it can't be matched to any host bridge IO space
197 */
198extern int of_address_to_resource(struct device_node *dev, int index,
199 struct resource *r);
200extern int of_pci_address_to_resource(struct device_node *dev, int bar,
201 struct resource *r);
202
203/* Parse the ibm,dma-window property of an OF node into the busno, phys and
204 * size parameters.
205 */
206void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
207 unsigned long *busno, unsigned long *phys, unsigned long *size);
208
209extern void kdump_move_device_tree(void);
210
211/* CPU OF node matching */
212struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
213
214/* Get the MAC address */
215extern const void *of_get_mac_address(struct device_node *np);
216
217/*
218 * OF interrupt mapping
219 */
220
221/* This structure is returned when an interrupt is mapped. The controller
222 * field needs to be put() after use
223 */
224
225#define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */
226
227struct of_irq {
228 struct device_node *controller; /* Interrupt controller node */
229 u32 size; /* Specifier size */
230 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */
231};
232
233/**
234 * of_irq_map_init - Initialize the irq remapper
235 * @flags: flags defining workarounds to enable
236 *
237 * Some machines have bugs in the device-tree which require certain workarounds
238 * to be applied. Call this before any interrupt mapping attempts to enable
239 * those workarounds.
240 */
241#define OF_IMAP_OLDWORLD_MAC 0x00000001
242#define OF_IMAP_NO_PHANDLE 0x00000002
243
244extern void of_irq_map_init(unsigned int flags);
245
246/**
247 * of_irq_map_raw - Low level interrupt tree parsing
248 * @parent: the device interrupt parent
249 * @intspec: interrupt specifier ("interrupts" property of the device)
250 * @ointsize: size of the passed in interrupt specifier
251 * @addr: address specifier (start of "reg" property of the device)
252 * @out_irq: structure of_irq filled by this function
253 *
254 * Returns 0 on success and a negative number on error
255 *
256 * This function is a low-level interrupt tree walking function. It
257 * can be used to do a partial walk with synthetized reg and interrupts
258 * properties, for example when resolving PCI interrupts when no device
259 * node exist for the parent.
260 *
261 */
262
263extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
264 u32 ointsize, const u32 *addr,
265 struct of_irq *out_irq);
266
267/**
268 * of_irq_map_one - Resolve an interrupt for a device
269 * @device: the device whose interrupt is to be resolved
270 * @index: index of the interrupt to resolve
271 * @out_irq: structure of_irq filled by this function
272 *
273 * This function resolves an interrupt, walking the tree, for a given
274 * device-tree node. It's the high level pendant to of_irq_map_raw().
275 * It also implements the workarounds for OldWolrd Macs.
276 */
277extern int of_irq_map_one(struct device_node *device, int index,
278 struct of_irq *out_irq);
279
280/**
281 * of_irq_map_pci - Resolve the interrupt for a PCI device
282 * @pdev: the device whose interrupt is to be resolved
283 * @out_irq: structure of_irq filled by this function
284 *
285 * This function resolves the PCI interrupt for a given PCI device. If a
286 * device-node exists for a given pci_dev, it will use normal OF tree
287 * walking. If not, it will implement standard swizzling and walk up the
288 * PCI tree until an device-node is found, at which point it will finish
289 * resolving using the OF tree walking.
290 */
291struct pci_dev;
292extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
293
294extern int of_irq_to_resource(struct device_node *dev, int index,
295 struct resource *r);
296
297/**
298 * of_iomap - Maps the memory mapped IO for a given device_node
299 * @device: the device whose io range will be mapped
300 * @index: index of the io range
301 *
302 * Returns a pointer to the mapped memory
303 */
304extern void __iomem *of_iomap(struct device_node *device, int index);
305
306/*
307 * NB: This is here while we transition from using asm/prom.h
308 * to linux/of.h
309 */
310#include <linux/of.h>
311
312#endif /* __KERNEL__ */
313#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h
new file mode 100644
index 000000000000..f1f03486428a
--- /dev/null
+++ b/arch/microblaze/include/asm/ptrace.h
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PTRACE_H
10#define _ASM_MICROBLAZE_PTRACE_H
11
12#ifndef __ASSEMBLY__
13#include <linux/types.h>
14
15typedef unsigned long microblaze_reg_t;
16
17struct pt_regs {
18 microblaze_reg_t r0;
19 microblaze_reg_t r1;
20 microblaze_reg_t r2;
21 microblaze_reg_t r3;
22 microblaze_reg_t r4;
23 microblaze_reg_t r5;
24 microblaze_reg_t r6;
25 microblaze_reg_t r7;
26 microblaze_reg_t r8;
27 microblaze_reg_t r9;
28 microblaze_reg_t r10;
29 microblaze_reg_t r11;
30 microblaze_reg_t r12;
31 microblaze_reg_t r13;
32 microblaze_reg_t r14;
33 microblaze_reg_t r15;
34 microblaze_reg_t r16;
35 microblaze_reg_t r17;
36 microblaze_reg_t r18;
37 microblaze_reg_t r19;
38 microblaze_reg_t r20;
39 microblaze_reg_t r21;
40 microblaze_reg_t r22;
41 microblaze_reg_t r23;
42 microblaze_reg_t r24;
43 microblaze_reg_t r25;
44 microblaze_reg_t r26;
45 microblaze_reg_t r27;
46 microblaze_reg_t r28;
47 microblaze_reg_t r29;
48 microblaze_reg_t r30;
49 microblaze_reg_t r31;
50 microblaze_reg_t pc;
51 microblaze_reg_t msr;
52 microblaze_reg_t ear;
53 microblaze_reg_t esr;
54 microblaze_reg_t fsr;
55 int kernel_mode;
56};
57
58#define kernel_mode(regs) ((regs)->kernel_mode)
59#define user_mode(regs) (!kernel_mode(regs))
60
61#define instruction_pointer(regs) ((regs)->pc)
62#define profile_pc(regs) instruction_pointer(regs)
63
64void show_regs(struct pt_regs *);
65
66#endif /* __ASSEMBLY__ */
67
68#endif /* _ASM_MICROBLAZE_PTRACE_H */
diff --git a/arch/microblaze/include/asm/pvr.h b/arch/microblaze/include/asm/pvr.h
new file mode 100644
index 000000000000..66f1b30dd097
--- /dev/null
+++ b/arch/microblaze/include/asm/pvr.h
@@ -0,0 +1,209 @@
1/*
2 * Support for the MicroBlaze PVR (Processor Version Register)
3 *
4 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
6 * Copyright (C) 2007 - 2009 PetaLogix
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#ifndef _ASM_MICROBLAZE_PVR_H
14#define _ASM_MICROBLAZE_PVR_H
15
16#define PVR_MSR_BIT 0x400
17
18struct pvr_s {
19 unsigned pvr[16];
20};
21
22/* The following taken from Xilinx's standalone BSP pvr.h */
23
24/* Basic PVR mask */
25#define PVR0_PVR_FULL_MASK 0x80000000
26#define PVR0_USE_BARREL_MASK 0x40000000
27#define PVR0_USE_DIV_MASK 0x20000000
28#define PVR0_USE_HW_MUL_MASK 0x10000000
29#define PVR0_USE_FPU_MASK 0x08000000
30#define PVR0_USE_EXC_MASK 0x04000000
31#define PVR0_USE_ICACHE_MASK 0x02000000
32#define PVR0_USE_DCACHE_MASK 0x01000000
33#define PVR0_USE_MMU 0x00800000 /* new */
34#define PVR0_VERSION_MASK 0x0000FF00
35#define PVR0_USER1_MASK 0x000000FF
36
37/* User 2 PVR mask */
38#define PVR1_USER2_MASK 0xFFFFFFFF
39
40/* Configuration PVR masks */
41#define PVR2_D_OPB_MASK 0x80000000
42#define PVR2_D_LMB_MASK 0x40000000
43#define PVR2_I_OPB_MASK 0x20000000
44#define PVR2_I_LMB_MASK 0x10000000
45#define PVR2_INTERRUPT_IS_EDGE_MASK 0x08000000
46#define PVR2_EDGE_IS_POSITIVE_MASK 0x04000000
47#define PVR2_D_PLB_MASK 0x02000000 /* new */
48#define PVR2_I_PLB_MASK 0x01000000 /* new */
49#define PVR2_INTERCONNECT 0x00800000 /* new */
50#define PVR2_USE_EXTEND_FSL 0x00080000 /* new */
51#define PVR2_USE_FSL_EXC 0x00040000 /* new */
52#define PVR2_USE_MSR_INSTR 0x00020000
53#define PVR2_USE_PCMP_INSTR 0x00010000
54#define PVR2_AREA_OPTIMISED 0x00008000
55#define PVR2_USE_BARREL_MASK 0x00004000
56#define PVR2_USE_DIV_MASK 0x00002000
57#define PVR2_USE_HW_MUL_MASK 0x00001000
58#define PVR2_USE_FPU_MASK 0x00000800
59#define PVR2_USE_MUL64_MASK 0x00000400
60#define PVR2_USE_FPU2_MASK 0x00000200 /* new */
61#define PVR2_USE_IPLBEXC 0x00000100
62#define PVR2_USE_DPLBEXC 0x00000080
63#define PVR2_OPCODE_0x0_ILL_MASK 0x00000040
64#define PVR2_UNALIGNED_EXC_MASK 0x00000020
65#define PVR2_ILL_OPCODE_EXC_MASK 0x00000010
66#define PVR2_IOPB_BUS_EXC_MASK 0x00000008
67#define PVR2_DOPB_BUS_EXC_MASK 0x00000004
68#define PVR2_DIV_ZERO_EXC_MASK 0x00000002
69#define PVR2_FPU_EXC_MASK 0x00000001
70
71/* Debug and exception PVR masks */
72#define PVR3_DEBUG_ENABLED_MASK 0x80000000
73#define PVR3_NUMBER_OF_PC_BRK_MASK 0x1E000000
74#define PVR3_NUMBER_OF_RD_ADDR_BRK_MASK 0x00380000
75#define PVR3_NUMBER_OF_WR_ADDR_BRK_MASK 0x0000E000
76#define PVR3_FSL_LINKS_MASK 0x00000380
77
78/* ICache config PVR masks */
79#define PVR4_USE_ICACHE_MASK 0x80000000
80#define PVR4_ICACHE_ADDR_TAG_BITS_MASK 0x7C000000
81#define PVR4_ICACHE_USE_FSL_MASK 0x02000000
82#define PVR4_ICACHE_ALLOW_WR_MASK 0x01000000
83#define PVR4_ICACHE_LINE_LEN_MASK 0x00E00000
84#define PVR4_ICACHE_BYTE_SIZE_MASK 0x001F0000
85
86/* DCache config PVR masks */
87#define PVR5_USE_DCACHE_MASK 0x80000000
88#define PVR5_DCACHE_ADDR_TAG_BITS_MASK 0x7C000000
89#define PVR5_DCACHE_USE_FSL_MASK 0x02000000
90#define PVR5_DCACHE_ALLOW_WR_MASK 0x01000000
91#define PVR5_DCACHE_LINE_LEN_MASK 0x00E00000
92#define PVR5_DCACHE_BYTE_SIZE_MASK 0x001F0000
93
94/* ICache base address PVR mask */
95#define PVR6_ICACHE_BASEADDR_MASK 0xFFFFFFFF
96
97/* ICache high address PVR mask */
98#define PVR7_ICACHE_HIGHADDR_MASK 0xFFFFFFFF
99
100/* DCache base address PVR mask */
101#define PVR8_DCACHE_BASEADDR_MASK 0xFFFFFFFF
102
103/* DCache high address PVR mask */
104#define PVR9_DCACHE_HIGHADDR_MASK 0xFFFFFFFF
105
106/* Target family PVR mask */
107#define PVR10_TARGET_FAMILY_MASK 0xFF000000
108
109/* MMU descrtiption */
110#define PVR11_USE_MMU 0xC0000000
111#define PVR11_MMU_ITLB_SIZE 0x38000000
112#define PVR11_MMU_DTLB_SIZE 0x07000000
113#define PVR11_MMU_TLB_ACCESS 0x00C00000
114#define PVR11_MMU_ZONES 0x003C0000
115/* MSR Reset value PVR mask */
116#define PVR11_MSR_RESET_VALUE_MASK 0x000007FF
117
118
119/* PVR access macros */
120#define PVR_IS_FULL(pvr) (pvr.pvr[0] & PVR0_PVR_FULL_MASK)
121#define PVR_USE_BARREL(pvr) (pvr.pvr[0] & PVR0_USE_BARREL_MASK)
122#define PVR_USE_DIV(pvr) (pvr.pvr[0] & PVR0_USE_DIV_MASK)
123#define PVR_USE_HW_MUL(pvr) (pvr.pvr[0] & PVR0_USE_HW_MUL_MASK)
124#define PVR_USE_FPU(pvr) (pvr.pvr[0] & PVR0_USE_FPU_MASK)
125#define PVR_USE_FPU2(pvr) (pvr.pvr[2] & PVR2_USE_FPU2_MASK)
126#define PVR_USE_ICACHE(pvr) (pvr.pvr[0] & PVR0_USE_ICACHE_MASK)
127#define PVR_USE_DCACHE(pvr) (pvr.pvr[0] & PVR0_USE_DCACHE_MASK)
128#define PVR_VERSION(pvr) ((pvr.pvr[0] & PVR0_VERSION_MASK) >> 8)
129#define PVR_USER1(pvr) (pvr.pvr[0] & PVR0_USER1_MASK)
130#define PVR_USER2(pvr) (pvr.pvr[1] & PVR1_USER2_MASK)
131
132#define PVR_D_OPB(pvr) (pvr.pvr[2] & PVR2_D_OPB_MASK)
133#define PVR_D_LMB(pvr) (pvr.pvr[2] & PVR2_D_LMB_MASK)
134#define PVR_I_OPB(pvr) (pvr.pvr[2] & PVR2_I_OPB_MASK)
135#define PVR_I_LMB(pvr) (pvr.pvr[2] & PVR2_I_LMB_MASK)
136#define PVR_INTERRUPT_IS_EDGE(pvr) \
137 (pvr.pvr[2] & PVR2_INTERRUPT_IS_EDGE_MASK)
138#define PVR_EDGE_IS_POSITIVE(pvr) \
139 (pvr.pvr[2] & PVR2_EDGE_IS_POSITIVE_MASK)
140#define PVR_USE_MSR_INSTR(pvr) (pvr.pvr[2] & PVR2_USE_MSR_INSTR)
141#define PVR_USE_PCMP_INSTR(pvr) (pvr.pvr[2] & PVR2_USE_PCMP_INSTR)
142#define PVR_AREA_OPTIMISED(pvr) (pvr.pvr[2] & PVR2_AREA_OPTIMISED)
143#define PVR_USE_MUL64(pvr) (pvr.pvr[2] & PVR2_USE_MUL64_MASK)
144#define PVR_OPCODE_0x0_ILLEGAL(pvr) \
145 (pvr.pvr[2] & PVR2_OPCODE_0x0_ILL_MASK)
146#define PVR_UNALIGNED_EXCEPTION(pvr) \
147 (pvr.pvr[2] & PVR2_UNALIGNED_EXC_MASK)
148#define PVR_ILL_OPCODE_EXCEPTION(pvr) \
149 (pvr.pvr[2] & PVR2_ILL_OPCODE_EXC_MASK)
150#define PVR_IOPB_BUS_EXCEPTION(pvr) \
151 (pvr.pvr[2] & PVR2_IOPB_BUS_EXC_MASK)
152#define PVR_DOPB_BUS_EXCEPTION(pvr) \
153 (pvr.pvr[2] & PVR2_DOPB_BUS_EXC_MASK)
154#define PVR_DIV_ZERO_EXCEPTION(pvr) \
155 (pvr.pvr[2] & PVR2_DIV_ZERO_EXC_MASK)
156#define PVR_FPU_EXCEPTION(pvr) (pvr.pvr[2] & PVR2_FPU_EXC_MASK)
157#define PVR_FSL_EXCEPTION(pvr) (pvr.pvr[2] & PVR2_USE_EXTEND_FSL)
158
159#define PVR_DEBUG_ENABLED(pvr) (pvr.pvr[3] & PVR3_DEBUG_ENABLED_MASK)
160#define PVR_NUMBER_OF_PC_BRK(pvr) \
161 ((pvr.pvr[3] & PVR3_NUMBER_OF_PC_BRK_MASK) >> 25)
162#define PVR_NUMBER_OF_RD_ADDR_BRK(pvr) \
163 ((pvr.pvr[3] & PVR3_NUMBER_OF_RD_ADDR_BRK_MASK) >> 19)
164#define PVR_NUMBER_OF_WR_ADDR_BRK(pvr) \
165 ((pvr.pvr[3] & PVR3_NUMBER_OF_WR_ADDR_BRK_MASK) >> 13)
166#define PVR_FSL_LINKS(pvr) ((pvr.pvr[3] & PVR3_FSL_LINKS_MASK) >> 7)
167
168#define PVR_ICACHE_ADDR_TAG_BITS(pvr) \
169 ((pvr.pvr[4] & PVR4_ICACHE_ADDR_TAG_BITS_MASK) >> 26)
170#define PVR_ICACHE_USE_FSL(pvr) (pvr.pvr[4] & PVR4_ICACHE_USE_FSL_MASK)
171#define PVR_ICACHE_ALLOW_WR(pvr) (pvr.pvr[4] & PVR4_ICACHE_ALLOW_WR_MASK)
172#define PVR_ICACHE_LINE_LEN(pvr) \
173 (1 << ((pvr.pvr[4] & PVR4_ICACHE_LINE_LEN_MASK) >> 21))
174#define PVR_ICACHE_BYTE_SIZE(pvr) \
175 (1 << ((pvr.pvr[4] & PVR4_ICACHE_BYTE_SIZE_MASK) >> 16))
176
177#define PVR_DCACHE_ADDR_TAG_BITS(pvr) \
178 ((pvr.pvr[5] & PVR5_DCACHE_ADDR_TAG_BITS_MASK) >> 26)
179#define PVR_DCACHE_USE_FSL(pvr) (pvr.pvr[5] & PVR5_DCACHE_USE_FSL_MASK)
180#define PVR_DCACHE_ALLOW_WR(pvr) (pvr.pvr[5] & PVR5_DCACHE_ALLOW_WR_MASK)
181#define PVR_DCACHE_LINE_LEN(pvr) \
182 (1 << ((pvr.pvr[5] & PVR5_DCACHE_LINE_LEN_MASK) >> 21))
183#define PVR_DCACHE_BYTE_SIZE(pvr) \
184 (1 << ((pvr.pvr[5] & PVR5_DCACHE_BYTE_SIZE_MASK) >> 16))
185
186
187#define PVR_ICACHE_BASEADDR(pvr) (pvr.pvr[6] & PVR6_ICACHE_BASEADDR_MASK)
188#define PVR_ICACHE_HIGHADDR(pvr) (pvr.pvr[7] & PVR7_ICACHE_HIGHADDR_MASK)
189
190#define PVR_DCACHE_BASEADDR(pvr) (pvr.pvr[8] & PVR8_DCACHE_BASEADDR_MASK)
191#define PVR_DCACHE_HIGHADDR(pvr) (pvr.pvr[9] & PVR9_DCACHE_HIGHADDR_MASK)
192
193#define PVR_TARGET_FAMILY(pvr) ((pvr.pvr[10] & PVR10_TARGET_FAMILY_MASK) >> 24)
194
195#define PVR_MSR_RESET_VALUE(pvr) \
196 (pvr.pvr[11] & PVR11_MSR_RESET_VALUE_MASK)
197
198/* mmu */
199#define PVR_USE_MMU(pvr) ((pvr.pvr[11] & PVR11_USE_MMU) >> 30)
200#define PVR_MMU_ITLB_SIZE(pvr) (pvr.pvr[11] & PVR11_MMU_ITLB_SIZE)
201#define PVR_MMU_DTLB_SIZE(pvr) (pvr.pvr[11] & PVR11_MMU_DTLB_SIZE)
202#define PVR_MMU_TLB_ACCESS(pvr) (pvr.pvr[11] & PVR11_MMU_TLB_ACCESS)
203#define PVR_MMU_ZONES(pvr) (pvr.pvr[11] & PVR11_MMU_ZONES)
204
205
206int cpu_has_pvr(void);
207void get_pvr(struct pvr_s *pvr);
208
209#endif /* _ASM_MICROBLAZE_PVR_H */
diff --git a/arch/microblaze/include/asm/registers.h b/arch/microblaze/include/asm/registers.h
new file mode 100644
index 000000000000..834142d9356f
--- /dev/null
+++ b/arch/microblaze/include/asm/registers.h
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_REGISTERS_H
12#define _ASM_MICROBLAZE_REGISTERS_H
13
14#define MSR_BE (1<<0) /* 0x001 */
15#define MSR_IE (1<<1) /* 0x002 */
16#define MSR_C (1<<2) /* 0x004 */
17#define MSR_BIP (1<<3) /* 0x008 */
18#define MSR_FSL (1<<4) /* 0x010 */
19#define MSR_ICE (1<<5) /* 0x020 */
20#define MSR_DZ (1<<6) /* 0x040 */
21#define MSR_DCE (1<<7) /* 0x080 */
22#define MSR_EE (1<<8) /* 0x100 */
23#define MSR_EIP (1<<9) /* 0x200 */
24#define MSR_CC (1<<31)
25
26/* Floating Point Status Register (FSR) Bits */
27#define FSR_IO (1<<4) /* Invalid operation */
28#define FSR_DZ (1<<3) /* Divide-by-zero */
29#define FSR_OF (1<<2) /* Overflow */
30#define FSR_UF (1<<1) /* Underflow */
31#define FSR_DO (1<<0) /* Denormalized operand error */
32
33#endif /* _ASM_MICROBLAZE_REGISTERS_H */
diff --git a/arch/microblaze/include/asm/resource.h b/arch/microblaze/include/asm/resource.h
new file mode 100644
index 000000000000..04bc4db8921b
--- /dev/null
+++ b/arch/microblaze/include/asm/resource.h
@@ -0,0 +1 @@
#include <asm-generic/resource.h>
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
new file mode 100644
index 000000000000..08ff1d049b42
--- /dev/null
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_SCATTERLIST_H
11#define _ASM_MICROBLAZE_SCATTERLIST_H
12
13struct scatterlist {
14#ifdef CONFIG_DEBUG_SG
15 unsigned long sg_magic;
16#endif
17 unsigned long page_link;
18 dma_addr_t dma_address;
19 unsigned int offset;
20 unsigned int length;
21};
22
23#define sg_dma_address(sg) ((sg)->dma_address)
24#define sg_dma_len(sg) ((sg)->length)
25
26#define ISA_DMA_THRESHOLD (~0UL)
27
28#endif /* _ASM_MICROBLAZE_SCATTERLIST_H */
diff --git a/arch/microblaze/include/asm/sections.h b/arch/microblaze/include/asm/sections.h
new file mode 100644
index 000000000000..8434a43e5421
--- /dev/null
+++ b/arch/microblaze/include/asm/sections.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SECTIONS_H
10#define _ASM_MICROBLAZE_SECTIONS_H
11
12#include <asm-generic/sections.h>
13
14# ifndef __ASSEMBLY__
15extern char _ssbss[], _esbss[];
16extern unsigned long __ivt_start[], __ivt_end[];
17
18# ifdef CONFIG_MTD_UCLINUX
19extern char *_ebss;
20# endif
21
22extern u32 _fdt_start[], _fdt_end[];
23
24# endif /* !__ASSEMBLY__ */
25#endif /* _ASM_MICROBLAZE_SECTIONS_H */
diff --git a/arch/microblaze/include/asm/segment.h b/arch/microblaze/include/asm/segment.h
new file mode 100644
index 000000000000..7f5dcc56eea1
--- /dev/null
+++ b/arch/microblaze/include/asm/segment.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2008 Michal Simek
3 * Copyright (C) 2008 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_SEGMENT_H
12#define _ASM_MICROBLAZE_SEGMENT_H
13
14#ifndef __ASSEMBLY__
15
16typedef struct {
17 unsigned long seg;
18} mm_segment_t;
19
20/*
21 * On Microblaze the fs value is actually the top of the corresponding
22 * address space.
23 *
24 * The fs value determines whether argument validity checking should be
25 * performed or not. If get_fs() == USER_DS, checking is performed, with
26 * get_fs() == KERNEL_DS, checking is bypassed.
27 *
28 * For historical reasons, these macros are grossly misnamed.
29 *
30 * For non-MMU arch like Microblaze, KERNEL_DS and USER_DS is equal.
31 */
32# define KERNEL_DS ((mm_segment_t){0})
33# define USER_DS KERNEL_DS
34
35# define get_ds() (KERNEL_DS)
36# define get_fs() (current_thread_info()->addr_limit)
37# define set_fs(x) \
38 do { current_thread_info()->addr_limit = (x); } while (0)
39
40# define segment_eq(a, b) ((a).seg == (b).seg)
41
42# endif /* __ASSEMBLY__ */
43#endif /* _ASM_MICROBLAZE_SEGMENT_H */
diff --git a/arch/microblaze/include/asm/selfmod.h b/arch/microblaze/include/asm/selfmod.h
new file mode 100644
index 000000000000..c42aff2e6cd0
--- /dev/null
+++ b/arch/microblaze/include/asm/selfmod.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SELFMOD_H
10#define _ASM_MICROBLAZE_SELFMOD_H
11
12/*
13 * BARRIER_BASE_ADDR is constant address for selfmod function.
14 * do not change this value - selfmod function is in
15 * arch/microblaze/kernel/selfmod.c: selfmod_function()
16 *
17 * last 16 bits is used for storing register offset
18 */
19
20#define BARRIER_BASE_ADDR 0x1234ff00
21
22void selfmod_function(const int *arr_fce, const unsigned int base);
23
24#endif /* _ASM_MICROBLAZE_SELFMOD_H */
diff --git a/arch/microblaze/include/asm/sembuf.h b/arch/microblaze/include/asm/sembuf.h
new file mode 100644
index 000000000000..b804ed71a57e
--- /dev/null
+++ b/arch/microblaze/include/asm/sembuf.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SEMBUF_H
10#define _ASM_MICROBLAZE_SEMBUF_H
11
12/*
13 * The semid64_ds structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 64-bit time_t to solve y2038 problem
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct semid64_ds {
23 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
24 __kernel_time_t sem_otime; /* last semop time */
25 unsigned long __unused1;
26 __kernel_time_t sem_ctime; /* last change time */
27 unsigned long __unused2;
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long __unused3;
30 unsigned long __unused4;
31};
32
33
34#endif /* _ASM_MICROBLAZE_SEMBUF_H */
diff --git a/arch/microblaze/include/asm/serial.h b/arch/microblaze/include/asm/serial.h
new file mode 100644
index 000000000000..39bfc8ce6af5
--- /dev/null
+++ b/arch/microblaze/include/asm/serial.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SERIAL_H
10#define _ASM_MICROBLAZE_SERIAL_H
11
12# define BASE_BAUD (1843200 / 16)
13
14#endif /* _ASM_MICROBLAZE_SERIAL_H */
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
new file mode 100644
index 000000000000..9b98e8e6abae
--- /dev/null
+++ b/arch/microblaze/include/asm/setup.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_SETUP_H
11#define _ASM_MICROBLAZE_SETUP_H
12
13#define COMMAND_LINE_SIZE 256
14
15# ifndef __ASSEMBLY__
16
17# ifdef __KERNEL__
18extern unsigned int boot_cpuid; /* move to smp.h */
19
20extern char cmd_line[COMMAND_LINE_SIZE];
21# endif/* __KERNEL__ */
22
23void early_printk(const char *fmt, ...);
24
25int setup_early_printk(char *opt);
26void disable_early_printk(void);
27
28void heartbeat(void);
29void setup_heartbeat(void);
30
31unsigned long long sched_clock(void);
32
33void time_init(void);
34void init_IRQ(void);
35void machine_early_init(const char *cmdline, unsigned int ram,
36 unsigned int fdt);
37
38void machine_restart(char *cmd);
39void machine_shutdown(void);
40void machine_halt(void);
41void machine_power_off(void);
42
43# endif /* __ASSEMBLY__ */
44#endif /* _ASM_MICROBLAZE_SETUP_H */
diff --git a/arch/microblaze/include/asm/shmbuf.h b/arch/microblaze/include/asm/shmbuf.h
new file mode 100644
index 000000000000..f829c5843618
--- /dev/null
+++ b/arch/microblaze/include/asm/shmbuf.h
@@ -0,0 +1,42 @@
1#ifndef _ASM_MICROBLAZE_SHMBUF_H
2#define _ASM_MICROBLAZE_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASM_MICROBLAZE_SHMBUF_H */
diff --git a/arch/microblaze/include/asm/shmparam.h b/arch/microblaze/include/asm/shmparam.h
new file mode 100644
index 000000000000..9f5fc2b3b6a3
--- /dev/null
+++ b/arch/microblaze/include/asm/shmparam.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_MICROBLAZE_SHMPARAM_H
2#define _ASM_MICROBLAZE_SHMPARAM_H
3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5
6#endif /* _ASM_MICROBLAZE_SHMPARAM_H */
diff --git a/arch/microblaze/include/asm/sigcontext.h b/arch/microblaze/include/asm/sigcontext.h
new file mode 100644
index 000000000000..55873c80c917
--- /dev/null
+++ b/arch/microblaze/include/asm/sigcontext.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SIGCONTEXT_H
10#define _ASM_MICROBLAZE_SIGCONTEXT_H
11
12/* FIXME should be linux/ptrace.h */
13#include <asm/ptrace.h>
14
15struct sigcontext {
16 struct pt_regs regs;
17 unsigned long oldmask;
18};
19
20#endif /* _ASM_MICROBLAZE_SIGCONTEXT_H */
diff --git a/arch/microblaze/include/asm/siginfo.h b/arch/microblaze/include/asm/siginfo.h
new file mode 100644
index 000000000000..f162911a8f50
--- /dev/null
+++ b/arch/microblaze/include/asm/siginfo.h
@@ -0,0 +1,15 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SIGINFO_H
10#define _ASM_MICROBLAZE_SIGINFO_H
11
12#include <linux/types.h>
13#include <asm-generic/siginfo.h>
14
15#endif /* _ASM_MICROBLAZE_SIGINFO_H */
diff --git a/arch/microblaze/include/asm/signal.h b/arch/microblaze/include/asm/signal.h
new file mode 100644
index 000000000000..9676fad3486c
--- /dev/null
+++ b/arch/microblaze/include/asm/signal.h
@@ -0,0 +1,165 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 * Yasushi SHOJI <yashi@atmark-techno.com>
4 * Tetsuya OHKAWA <tetsuya@atmark-techno.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_SIGNAL_H
12#define _ASM_MICROBLAZE_SIGNAL_H
13
14#define SIGHUP 1
15#define SIGINT 2
16#define SIGQUIT 3
17#define SIGILL 4
18#define SIGTRAP 5
19#define SIGABRT 6
20#define SIGIOT 6
21#define SIGBUS 7
22#define SIGFPE 8
23#define SIGKILL 9
24#define SIGUSR1 10
25#define SIGSEGV 11
26#define SIGUSR2 12
27#define SIGPIPE 13
28#define SIGALRM 14
29#define SIGTERM 15
30#define SIGSTKFLT 16
31#define SIGCHLD 17
32#define SIGCONT 18
33#define SIGSTOP 19
34#define SIGTSTP 20
35#define SIGTTIN 21
36#define SIGTTOU 22
37#define SIGURG 23
38#define SIGXCPU 24
39#define SIGXFSZ 25
40#define SIGVTALRM 26
41#define SIGPROF 27
42#define SIGWINCH 28
43#define SIGIO 29
44#define SIGPOLL SIGIO
45/*
46#define SIGLOST 29
47*/
48#define SIGPWR 30
49#define SIGSYS 31
50#define SIGUNUSED 31
51
52/* These should not be considered constants from userland. */
53#define SIGRTMIN 32
54#define SIGRTMAX _NSIG
55
56/*
57 * SA_FLAGS values:
58 *
59 * SA_ONSTACK indicates that a registered stack_t will be used.
60 * SA_RESTART flag to get restarting signals (which were the default long ago)
61 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
62 * SA_RESETHAND clears the handler when the signal is delivered.
63 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
64 * SA_NODEFER prevents the current signal from being masked in the handler.
65 *
66 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
67 * Unix names RESETHAND and NODEFER respectively.
68 */
69#define SA_NOCLDSTOP 0x00000001
70#define SA_NOCLDWAIT 0x00000002
71#define SA_SIGINFO 0x00000004
72#define SA_ONSTACK 0x08000000
73#define SA_RESTART 0x10000000
74#define SA_NODEFER 0x40000000
75#define SA_RESETHAND 0x80000000
76
77#define SA_NOMASK SA_NODEFER
78#define SA_ONESHOT SA_RESETHAND
79
80#define SA_RESTORER 0x04000000
81
82/*
83 * sigaltstack controls
84 */
85#define SS_ONSTACK 1
86#define SS_DISABLE 2
87
88#define MINSIGSTKSZ 2048
89#define SIGSTKSZ 8192
90
91# ifndef __ASSEMBLY__
92# include <linux/types.h>
93# include <asm-generic/signal.h>
94
95/* Avoid too many header ordering problems. */
96struct siginfo;
97
98# ifdef __KERNEL__
99/*
100 * Most things should be clean enough to redefine this at will, if care
101 * is taken to make libc match.
102 */
103# define _NSIG 64
104# define _NSIG_BPW 32
105# define _NSIG_WORDS (_NSIG / _NSIG_BPW)
106
107typedef unsigned long old_sigset_t; /* at least 32 bits */
108
109typedef struct {
110 unsigned long sig[_NSIG_WORDS];
111} sigset_t;
112
113struct old_sigaction {
114 __sighandler_t sa_handler;
115 old_sigset_t sa_mask;
116 unsigned long sa_flags;
117 void (*sa_restorer)(void);
118};
119
120struct sigaction {
121 __sighandler_t sa_handler;
122 unsigned long sa_flags;
123 void (*sa_restorer)(void);
124 sigset_t sa_mask; /* mask last for extensibility */
125};
126
127struct k_sigaction {
128 struct sigaction sa;
129};
130
131# include <asm/sigcontext.h>
132# undef __HAVE_ARCH_SIG_BITOPS
133
134# define ptrace_signal_deliver(regs, cookie) do { } while (0)
135
136# else /* !__KERNEL__ */
137
138/* Here we must cater to libcs that poke about in kernel headers. */
139
140# define NSIG 32
141typedef unsigned long sigset_t;
142
143struct sigaction {
144 union {
145 __sighandler_t _sa_handler;
146 void (*_sa_sigaction)(int, struct siginfo *, void *);
147 } _u;
148 sigset_t sa_mask;
149 unsigned long sa_flags;
150 void (*sa_restorer)(void);
151};
152
153# define sa_handler _u._sa_handler
154# define sa_sigaction _u._sa_sigaction
155
156# endif /* __KERNEL__ */
157
158typedef struct sigaltstack {
159 void *ss_sp;
160 int ss_flags;
161 size_t ss_size;
162} stack_t;
163
164# endif /* __ASSEMBLY__ */
165#endif /* _ASM_MICROBLAZE_SIGNAL_H */
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h
new file mode 100644
index 000000000000..825936860314
--- /dev/null
+++ b/arch/microblaze/include/asm/socket.h
@@ -0,0 +1,69 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SOCKET_H
10#define _ASM_MICROBLAZE_SOCKET_H
11
12#include <asm/sockios.h>
13
14/* For setsockoptions(2) */
15#define SOL_SOCKET 1
16
17#define SO_DEBUG 1
18#define SO_REUSEADDR 2
19#define SO_TYPE 3
20#define SO_ERROR 4
21#define SO_DONTROUTE 5
22#define SO_BROADCAST 6
23#define SO_SNDBUF 7
24#define SO_RCVBUF 8
25#define SO_SNDBUFFORCE 32
26#define SO_RCVBUFFORCE 33
27#define SO_KEEPALIVE 9
28#define SO_OOBINLINE 10
29#define SO_NO_CHECK 11
30#define SO_PRIORITY 12
31#define SO_LINGER 13
32#define SO_BSDCOMPAT 14
33/* To add :#define SO_REUSEPORT 15 */
34#define SO_PASSCRED 16
35#define SO_PEERCRED 17
36#define SO_RCVLOWAT 18
37#define SO_SNDLOWAT 19
38#define SO_RCVTIMEO 20
39#define SO_SNDTIMEO 21
40
41/* Security levels - as per NRL IPv6 - don't actually do anything */
42#define SO_SECURITY_AUTHENTICATION 22
43#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
44#define SO_SECURITY_ENCRYPTION_NETWORK 24
45
46#define SO_BINDTODEVICE 25
47
48/* Socket filtering */
49#define SO_ATTACH_FILTER 26
50#define SO_DETACH_FILTER 27
51
52#define SO_PEERNAME 28
53#define SO_TIMESTAMP 29
54#define SCM_TIMESTAMP SO_TIMESTAMP
55
56#define SO_ACCEPTCONN 30
57
58#define SO_PEERSEC 31
59#define SO_PASSSEC 34
60
61#define SO_TIMESTAMPNS 35
62#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
63
64#define SO_MARK 36
65
66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68
69#endif /* _ASM_MICROBLAZE_SOCKET_H */
diff --git a/arch/microblaze/include/asm/sockios.h b/arch/microblaze/include/asm/sockios.h
new file mode 100644
index 000000000000..9fff57a701e1
--- /dev/null
+++ b/arch/microblaze/include/asm/sockios.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SOCKIOS_H
10#define _ASM_MICROBLAZE_SOCKIOS_H
11
12#include <linux/ioctl.h>
13
14/* Socket-level I/O control calls. */
15#define FIOSETOWN 0x8901
16#define SIOCSPGRP 0x8902
17#define FIOGETOWN 0x8903
18#define SIOCGPGRP 0x8904
19#define SIOCATMARK 0x8905
20#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
21#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
22
23#endif /* _ASM_MICROBLAZE_SOCKIOS_H */
diff --git a/arch/microblaze/include/asm/stat.h b/arch/microblaze/include/asm/stat.h
new file mode 100644
index 000000000000..5f18b8aed220
--- /dev/null
+++ b/arch/microblaze/include/asm/stat.h
@@ -0,0 +1,73 @@
1/*
2 * Microblaze stat structure
3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
10 *
11 * Written by Miles Bader <miles@gnu.org>
12 */
13
14#ifndef _ASM_MICROBLAZE_STAT_H
15#define _ASM_MICROBLAZE_STAT_H
16
17#include <linux/posix_types.h>
18
19struct stat {
20 unsigned int st_dev;
21 unsigned long st_ino;
22 unsigned int st_mode;
23 unsigned int st_nlink;
24 unsigned int st_uid;
25 unsigned int st_gid;
26 unsigned int st_rdev;
27 unsigned long st_size;
28 unsigned long st_blksize;
29 unsigned long st_blocks;
30 unsigned long st_atime;
31 unsigned long __unused1; /* unsigned long st_atime_nsec */
32 unsigned long st_mtime;
33 unsigned long __unused2; /* unsigned long st_mtime_nsec */
34 unsigned long st_ctime;
35 unsigned long __unused3; /* unsigned long st_ctime_nsec */
36 unsigned long __unused4;
37 unsigned long __unused5;
38};
39
40struct stat64 {
41 unsigned long long st_dev;
42 unsigned long __unused1;
43
44 unsigned long long st_ino;
45
46 unsigned int st_mode;
47 unsigned int st_nlink;
48
49 unsigned int st_uid;
50 unsigned int st_gid;
51
52 unsigned long long st_rdev;
53 unsigned long __unused3;
54
55 long long st_size;
56 unsigned long st_blksize;
57
58 unsigned long st_blocks; /* No. of 512-byte blocks allocated */
59 unsigned long __unused4; /* future possible st_blocks high bits */
60
61 unsigned long st_atime;
62 unsigned long st_atime_nsec;
63
64 unsigned long st_mtime;
65 unsigned long st_mtime_nsec;
66
67 unsigned long st_ctime;
68 unsigned long st_ctime_nsec;
69
70 unsigned long __unused8;
71};
72
73#endif /* _ASM_MICROBLAZE_STAT_H */
diff --git a/arch/microblaze/include/asm/statfs.h b/arch/microblaze/include/asm/statfs.h
new file mode 100644
index 000000000000..0b91fe198c20
--- /dev/null
+++ b/arch/microblaze/include/asm/statfs.h
@@ -0,0 +1 @@
#include <asm-generic/statfs.h>
diff --git a/arch/microblaze/include/asm/string.h b/arch/microblaze/include/asm/string.h
new file mode 100644
index 000000000000..f7728c90fc18
--- /dev/null
+++ b/arch/microblaze/include/asm/string.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_STRING_H
10#define _ASM_MICROBLAZE_STRING_H
11
12#ifndef __KERNEL__
13
14#define __HAVE_ARCH_MEMSET
15#define __HAVE_ARCH_MEMCPY
16#define __HAVE_ARCH_MEMMOVE
17
18extern void *memset(void *, int, __kernel_size_t);
19extern void *memcpy(void *, const void *, __kernel_size_t);
20extern void *memmove(void *, const void *, __kernel_size_t);
21
22#endif /* __KERNEL__ */
23
24#endif /* _ASM_MICROBLAZE_STRING_H */
diff --git a/arch/microblaze/include/asm/swab.h b/arch/microblaze/include/asm/swab.h
new file mode 100644
index 000000000000..b375d7b65ad7
--- /dev/null
+++ b/arch/microblaze/include/asm/swab.h
@@ -0,0 +1,8 @@
1#ifndef _ASM_MICROBLAZE_SWAB_H
2#define _ASM_MICROBLAZE_SWAB_H
3
4#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
5#define __SWAB_64_THRU_32__
6#endif
7
8#endif /* _ASM_MICROBLAZE_SWAB_H */
diff --git a/arch/microblaze/include/asm/syscalls.h b/arch/microblaze/include/asm/syscalls.h
new file mode 100644
index 000000000000..9cb4ff0edeb2
--- /dev/null
+++ b/arch/microblaze/include/asm/syscalls.h
@@ -0,0 +1,45 @@
1#ifndef __ASM_MICROBLAZE_SYSCALLS_H
2#define __ASM_MICROBLAZE_SYSCALLS_H
3#ifdef __KERNEL__
4
5#include <linux/compiler.h>
6#include <linux/linkage.h>
7#include <linux/types.h>
8#include <linux/signal.h>
9
10/* FIXME will be removed */
11asmlinkage int sys_ipc(uint call, int first, int second,
12 int third, void *ptr, long fifth);
13
14struct pt_regs;
15asmlinkage int sys_vfork(struct pt_regs *regs);
16asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
17asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
18 char __user *__user *envp, struct pt_regs *regs);
19
20asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
21 unsigned long prot, unsigned long flags,
22 unsigned long fd, unsigned long pgoff);
23
24asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
25 unsigned long prot, unsigned long flags,
26 unsigned long fd, off_t offset);
27
28/* from signal.c */
29asmlinkage int sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs);
30
31asmlinkage int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
32 struct pt_regs *regs);
33
34asmlinkage int sys_sigaction(int sig, const struct old_sigaction *act,
35 struct old_sigaction *oact);
36
37asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
38 struct pt_regs *regs);
39
40asmlinkage int sys_sigreturn(struct pt_regs *regs);
41
42asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
43
44#endif /* __KERNEL__ */
45#endif /* __ASM_MICROBLAZE_SYSCALLS_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
new file mode 100644
index 000000000000..c4e308850b5d
--- /dev/null
+++ b/arch/microblaze/include/asm/system.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SYSTEM_H
10#define _ASM_MICROBLAZE_SYSTEM_H
11
12#include <asm/registers.h>
13#include <asm/setup.h>
14#include <asm/irqflags.h>
15
16struct task_struct;
17struct thread_info;
18
19extern struct task_struct *_switch_to(struct thread_info *prev,
20 struct thread_info *next);
21
22#define switch_to(prev, next, last) \
23 do { \
24 (last) = _switch_to(task_thread_info(prev), \
25 task_thread_info(next)); \
26 } while (0)
27
28#define smp_read_barrier_depends() do {} while (0)
29#define read_barrier_depends() do {} while (0)
30
31#define nop() asm volatile ("nop")
32#define mb() barrier()
33#define rmb() mb()
34#define wmb() mb()
35#define set_mb(var, value) do { var = value; mb(); } while (0)
36#define set_wmb(var, value) do { var = value; wmb(); } while (0)
37
38#define smp_mb() mb()
39#define smp_rmb() rmb()
40#define smp_wmb() wmb()
41
42void show_trace(struct task_struct *task, unsigned long *stack);
43void __bad_xchg(volatile void *ptr, int size);
44
45static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
46 int size)
47{
48 unsigned long ret;
49 unsigned long flags;
50
51 switch (size) {
52 case 1:
53 local_irq_save(flags);
54 ret = *(volatile unsigned char *)ptr;
55 *(volatile unsigned char *)ptr = x;
56 local_irq_restore(flags);
57 break;
58
59 case 4:
60 local_irq_save(flags);
61 ret = *(volatile unsigned long *)ptr;
62 *(volatile unsigned long *)ptr = x;
63 local_irq_restore(flags);
64 break;
65 default:
66 __bad_xchg(ptr, size), ret = 0;
67 break;
68 }
69
70 return ret;
71}
72
73void disable_hlt(void);
74void enable_hlt(void);
75void default_idle(void);
76
77#define xchg(ptr, x) \
78 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
79
80void free_init_pages(char *what, unsigned long begin, unsigned long end);
81void free_initmem(void);
82extern char *klimit;
83extern void ret_from_fork(void);
84
85#ifdef CONFIG_DEBUG_FS
86extern struct dentry *of_debugfs_root;
87#endif
88
89#define arch_align_stack(x) (x)
90
91#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/microblaze/include/asm/termbits.h b/arch/microblaze/include/asm/termbits.h
new file mode 100644
index 000000000000..a1b64bc4724a
--- /dev/null
+++ b/arch/microblaze/include/asm/termbits.h
@@ -0,0 +1,203 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TERMBITS_H
10#define _ASM_MICROBLAZE_TERMBITS_H
11
12#include <linux/posix_types.h>
13
14typedef unsigned char cc_t;
15typedef unsigned int speed_t;
16typedef unsigned int tcflag_t;
17
18#define NCCS 19
19struct termios {
20 tcflag_t c_iflag; /* input mode flags */
21 tcflag_t c_oflag; /* output mode flags */
22 tcflag_t c_cflag; /* control mode flags */
23 tcflag_t c_lflag; /* local mode flags */
24 cc_t c_line; /* line discipline */
25 cc_t c_cc[NCCS]; /* control characters */
26};
27
28struct ktermios {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
39/* c_cc characters */
40
41#define VINTR 0
42#define VQUIT 1
43#define VERASE 2
44#define VKILL 3
45#define VEOF 4
46#define VTIME 5
47#define VMIN 6
48#define VSWTC 7
49#define VSTART 8
50#define VSTOP 9
51#define VSUSP 10
52#define VEOL 11
53#define VREPRINT 12
54#define VDISCARD 13
55#define VWERASE 14
56#define VLNEXT 15
57#define VEOL2 16
58
59/* c_iflag bits */
60
61#define IGNBRK 0000001
62#define BRKINT 0000002
63#define IGNPAR 0000004
64#define PARMRK 0000010
65#define INPCK 0000020
66#define ISTRIP 0000040
67#define INLCR 0000100
68#define IGNCR 0000200
69#define ICRNL 0000400
70#define IUCLC 0001000
71#define IXON 0002000
72#define IXANY 0004000
73#define IXOFF 0010000
74#define IMAXBEL 0020000
75#define IUTF8 0040000
76
77/* c_oflag bits */
78
79#define OPOST 0000001
80#define OLCUC 0000002
81#define ONLCR 0000004
82#define OCRNL 0000010
83#define ONOCR 0000020
84#define ONLRET 0000040
85#define OFILL 0000100
86#define OFDEL 0000200
87#define NLDLY 0000400
88#define NL0 0000000
89#define NL1 0000400
90#define CRDLY 0003000
91#define CR0 0000000
92#define CR1 0001000
93#define CR2 0002000
94#define CR3 0003000
95#define TABDLY 0014000
96#define TAB0 0000000
97#define TAB1 0004000
98#define TAB2 0010000
99#define TAB3 0014000
100#define XTABS 0014000
101#define BSDLY 0020000
102#define BS0 0000000
103#define BS1 0020000
104#define VTDLY 0040000
105#define VT0 0000000
106#define VT1 0040000
107#define FFDLY 0100000
108#define FF0 0000000
109#define FF1 0100000
110
111/* c_cflag bit meaning */
112
113#define CBAUD 0010017
114#define B0 0000000 /* hang up */
115#define B50 0000001
116#define B75 0000002
117#define B110 0000003
118#define B134 0000004
119#define B150 0000005
120#define B200 0000006
121#define B300 0000007
122#define B600 0000010
123#define B1200 0000011
124#define B1800 0000012
125#define B2400 0000013
126#define B4800 0000014
127#define B9600 0000015
128#define B19200 0000016
129#define B38400 0000017
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0000060
133#define CS5 0000000
134#define CS6 0000020
135#define CS7 0000040
136#define CS8 0000060
137#define CSTOPB 0000100
138#define CREAD 0000200
139#define PARENB 0000400
140#define PARODD 0001000
141#define HUPCL 0002000
142#define CLOCAL 0004000
143#define CBAUDEX 0010000
144#define B57600 0010001
145#define B115200 0010002
146#define B230400 0010003
147#define B460800 0010004
148#define B500000 0010005
149#define B576000 0010006
150#define B921600 0010007
151#define BOTHER 0010000
152#define B1000000 0010010
153#define B1152000 0010011
154#define B1500000 0010012
155#define B2000000 0010013
156#define B2500000 0010014
157#define B3000000 0010015
158#define B3500000 0010016
159#define B4000000 0010017
160#define CIBAUD 002003600000 /* input baud rate (not used) */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
166/* c_lflag bits */
167
168#define ISIG 0000001
169#define ICANON 0000002
170#define XCASE 0000004
171#define ECHO 0000010
172#define ECHOE 0000020
173#define ECHOK 0000040
174#define ECHONL 0000100
175#define NOFLSH 0000200
176#define TOSTOP 0000400
177#define ECHOCTL 0001000
178#define ECHOPRT 0002000
179#define ECHOKE 0004000
180#define FLUSHO 0010000
181#define PENDIN 0040000
182#define IEXTEN 0100000
183
184/* tcflow() and TCXONC use these */
185
186#define TCOOFF 0
187#define TCOON 1
188#define TCIOFF 2
189#define TCION 3
190
191/* tcflush() and TCFLSH use these */
192
193#define TCIFLUSH 0
194#define TCOFLUSH 1
195#define TCIOFLUSH 2
196
197/* tcsetattr uses these */
198
199#define TCSANOW 0
200#define TCSADRAIN 1
201#define TCSAFLUSH 2
202
203#endif /* _ASM_MICROBLAZE_TERMBITS_H */
diff --git a/arch/microblaze/include/asm/termios.h b/arch/microblaze/include/asm/termios.h
new file mode 100644
index 000000000000..102d77258668
--- /dev/null
+++ b/arch/microblaze/include/asm/termios.h
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TERMIOS_H
10#define _ASM_MICROBLAZE_TERMIOS_H
11
12#include <linux/string.h>
13#include <asm/termbits.h>
14#include <asm/ioctls.h>
15
16struct winsize {
17 unsigned short ws_row;
18 unsigned short ws_col;
19 unsigned short ws_xpixel;
20 unsigned short ws_ypixel;
21};
22
23#define NCC 8
24struct termio {
25 unsigned short c_iflag; /* input mode flags */
26 unsigned short c_oflag; /* output mode flags */
27 unsigned short c_cflag; /* control mode flags */
28 unsigned short c_lflag; /* local mode flags */
29 unsigned char c_line; /* line discipline */
30 unsigned char c_cc[NCC]; /* control characters */
31};
32
33#ifdef __KERNEL__
34/* intr=^C quit=^| erase=del kill=^U
35 eof=^D vtime=\0 vmin=\1 sxtc=\0
36 start=^Q stop=^S susp=^Z eol=\0
37 reprint=^R discard=^U werase=^W lnext=^V
38 eol2=\0
39*/
40#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
41#endif
42
43/* Modem lines */
44
45#define TIOCM_LE 0x001
46#define TIOCM_DTR 0x002
47#define TIOCM_RTS 0x004
48#define TIOCM_ST 0x008
49#define TIOCM_SR 0x010
50#define TIOCM_CTS 0x020
51#define TIOCM_CAR 0x040
52#define TIOCM_RNG 0x080
53#define TIOCM_DSR 0x100
54#define TIOCM_CD TIOCM_CAR
55#define TIOCM_RI TIOCM_RNG
56#define TIOCM_OUT1 0x2000
57#define TIOCM_OUT2 0x4000
58#define TIOCM_LOOP 0x8000
59
60/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
61
62/* Line disciplines */
63
64#define N_TTY 0
65#define N_SLIP 1
66#define N_MOUSE 2
67#define N_PPP 3
68#define N_STRIP 4
69#define N_AX25 5
70#define N_X25 6 /* X.25 async */
71#define N_6PACK 7
72#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
73#define N_R3964 9 /* Reserved for Simatic R3964 module */
74#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
75#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
76#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards
77 about SMS messages */
78#define N_HDLC 13 /* synchronous HDLC */
79#define N_SYNC_PPP 14
80#define N_HCI 15 /* Bluetooth HCI UART */
81
82#ifdef __KERNEL__
83
84#include <asm-generic/termios.h>
85
86#endif /* __KERNEL__ */
87
88#endif /* _ASM_MICROBLAZE_TERMIOS_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
new file mode 100644
index 000000000000..4c3943e3f403
--- /dev/null
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -0,0 +1,159 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_THREAD_INFO_H
10#define _ASM_MICROBLAZE_THREAD_INFO_H
11
12#ifdef __KERNEL__
13
14/* we have 8k stack */
15#define THREAD_SHIFT 13
16#define THREAD_SIZE (1 << THREAD_SHIFT)
17#define THREAD_SIZE_ORDER 1
18
19#ifndef __ASSEMBLY__
20# include <linux/types.h>
21# include <asm/processor.h>
22# include <asm/segment.h>
23
24/*
25 * low level task data that entry.S needs immediate access to
26 * - this struct should fit entirely inside of one cache line
27 * - this struct shares the supervisor stack pages
28 * - if the contents of this structure are changed, the assembly constants
29 * must also be changed
30 */
31
32struct cpu_context {
33 __u32 r1; /* stack pointer */
34 __u32 r2;
35 /* dedicated registers */
36 __u32 r13;
37 __u32 r14;
38 __u32 r15;
39 __u32 r16;
40 __u32 r17;
41 __u32 r18;
42 /* non-volatile registers */
43 __u32 r19;
44 __u32 r20;
45 __u32 r21;
46 __u32 r22;
47 __u32 r23;
48 __u32 r24;
49 __u32 r25;
50 __u32 r26;
51 __u32 r27;
52 __u32 r28;
53 __u32 r29;
54 __u32 r30;
55 /* r31 is used as current task pointer */
56 /* special purpose registers */
57 __u32 msr;
58 __u32 ear;
59 __u32 esr;
60 __u32 fsr;
61};
62
63struct thread_info {
64 struct task_struct *task; /* main task structure */
65 struct exec_domain *exec_domain; /* execution domain */
66 unsigned long flags; /* low level flags */
67 unsigned long status; /* thread-synchronous flags */
68 __u32 cpu; /* current CPU */
69 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
70 mm_segment_t addr_limit; /* thread address space */
71 struct restart_block restart_block;
72
73 struct cpu_context cpu_context;
74};
75
76/*
77 * macros/functions for gaining access to the thread information structure
78 *
79 * preempt_count needs to be 1 initially, until the scheduler is functional.
80 */
81#define INIT_THREAD_INFO(tsk) \
82{ \
83 .task = &tsk, \
84 .exec_domain = &default_exec_domain, \
85 .flags = 0, \
86 .cpu = 0, \
87 .preempt_count = 1, \
88 .addr_limit = KERNEL_DS, \
89 .restart_block = { \
90 .fn = do_no_restart_syscall, \
91 }, \
92}
93
94#define init_thread_info (init_thread_union.thread_info)
95#define init_stack (init_thread_union.stack)
96
97/* how to get the thread information struct from C */
98static inline struct thread_info *current_thread_info(void)
99{
100 register unsigned long sp asm("r1");
101
102 return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
103}
104
105/* thread information allocation */
106#endif /* __ASSEMBLY__ */
107
108#define PREEMPT_ACTIVE 0x10000000
109
110/*
111 * thread information flags
112 * - these are process state flags that various assembly files may
113 * need to access
114 * - pending work-to-be-done flags are in LSW
115 * - other flags in MSW
116 */
117#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
118#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
119#define TIF_SIGPENDING 2 /* signal pending */
120#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
121/* restore singlestep on return to user mode */
122#define TIF_SINGLESTEP 4
123#define TIF_IRET 5 /* return with iret */
124#define TIF_MEMDIE 6
125#define TIF_FREEZE 14 /* Freezing for suspend */
126
127/* FIXME change in entry.S */
128#define TIF_KERNEL_TRACE 8 /* kernel trace active */
129
130/* true if poll_idle() is polling TIF_NEED_RESCHED */
131#define TIF_POLLING_NRFLAG 16
132
133#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
134#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
135#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
136#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
137#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
138#define _TIF_IRET (1<<TIF_IRET)
139#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
140#define _TIF_FREEZE (1<<TIF_FREEZE)
141#define _TIF_KERNEL_TRACE (1 << TIF_KERNEL_TRACE)
142
143/* work to do on interrupt/exception return */
144#define _TIF_WORK_MASK 0x0000FFFE
145/* work to do on any return to u-space */
146#define _TIF_ALLWORK_MASK 0x0000FFFF
147
148/*
149 * Thread-synchronous status.
150 *
151 * This is different from the flags in that nobody else
152 * ever touches our thread-synchronous status, so we don't
153 * have to worry about atomic accesses.
154 */
155/* FPU was used by this task this quantum (SMP) */
156#define TS_USEDFPU 0x0001
157
158#endif /* __KERNEL__ */
159#endif /* _ASM_MICROBLAZE_THREAD_INFO_H */
diff --git a/arch/microblaze/include/asm/timex.h b/arch/microblaze/include/asm/timex.h
new file mode 100644
index 000000000000..678525dc6d0b
--- /dev/null
+++ b/arch/microblaze/include/asm/timex.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TIMEX_H
10#define _ASM_MICROBLAZE_TIMEX_H
11
12#define CLOCK_TICK_RATE 1000 /* Timer input freq. */
13
14typedef unsigned long cycles_t;
15
16#define get_cycles() (0)
17
18#endif /* _ASM_TIMEX_H */
diff --git a/arch/microblaze/include/asm/tlb.h b/arch/microblaze/include/asm/tlb.h
new file mode 100644
index 000000000000..d1dfe3791127
--- /dev/null
+++ b/arch/microblaze/include/asm/tlb.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TLB_H
10#define _ASM_MICROBLAZE_TLB_H
11
12#define tlb_flush(tlb) do {} while (0)
13
14#include <asm-generic/tlb.h>
15
16#endif /* _ASM_MICROBLAZE_TLB_H */
diff --git a/arch/microblaze/include/asm/tlbflush.h b/arch/microblaze/include/asm/tlbflush.h
new file mode 100644
index 000000000000..d7fe7629001b
--- /dev/null
+++ b/arch/microblaze/include/asm/tlbflush.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TLBFLUSH_H
10#define _ASM_MICROBLAZE_TLBFLUSH_H
11
12#define flush_tlb() BUG()
13#define flush_tlb_all() BUG()
14#define flush_tlb_mm(mm) BUG()
15#define flush_tlb_page(vma, addr) BUG()
16#define flush_tlb_range(mm, start, end) BUG()
17#define flush_tlb_pgtables(mm, start, end) BUG()
18#define flush_tlb_kernel_range(start, end) BUG()
19
20#endif /* _ASM_MICROBLAZE_TLBFLUSH_H */
diff --git a/arch/microblaze/include/asm/topology.h b/arch/microblaze/include/asm/topology.h
new file mode 100644
index 000000000000..96bcea5a9920
--- /dev/null
+++ b/arch/microblaze/include/asm/topology.h
@@ -0,0 +1,11 @@
1#include <asm-generic/topology.h>
2
3#ifndef _ASM_MICROBLAZE_TOPOLOGY_H
4#define _ASM_MICROBLAZE_TOPOLOGY_H
5
6struct device_node;
7static inline int of_node_to_nid(struct device_node *device)
8{
9 return 0;
10}
11#endif /* _ASM_MICROBLAZE_TOPOLOGY_H */
diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h
new file mode 100644
index 000000000000..bebc018318f5
--- /dev/null
+++ b/arch/microblaze/include/asm/types.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TYPES_H
10#define _ASM_MICROBLAZE_TYPES_H
11
12/*
13 * This file is never included by application software unless
14 * explicitly requested (e.g., via linux/types.h) in which case the
15 * application is Linux specific so (user-) name space pollution is
16 * not a major issue. However, for interoperability, libraries still
17 * need to be careful to avoid a name clashes.
18 */
19
20#include <asm-generic/int-ll64.h>
21
22# ifndef __ASSEMBLY__
23
24typedef unsigned short umode_t;
25
26/*
27 * These aren't exported outside the kernel to avoid name space clashes
28 */
29# ifdef __KERNEL__
30# define BITS_PER_LONG 32
31
32/* Dma addresses are 32-bits wide. */
33
34typedef u32 dma_addr_t;
35
36# endif/* __KERNEL__ */
37# endif /* __ASSEMBLY__ */
38#endif /* _ASM_MICROBLAZE_TYPES_H */
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
new file mode 100644
index 000000000000..5a3ffc308e12
--- /dev/null
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -0,0 +1,134 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_UACCESS_H
10#define _ASM_MICROBLAZE_UACCESS_H
11
12#ifdef __KERNEL__
13#ifndef __ASSEMBLY__
14
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/sched.h> /* RLIMIT_FSIZE */
18#include <linux/mm.h>
19
20#include <asm/mmu.h>
21#include <asm/page.h>
22#include <asm/pgtable.h>
23#include <asm/segment.h>
24#include <linux/string.h>
25
26#define VERIFY_READ 0
27#define VERIFY_WRITE 1
28
29extern int ___range_ok(unsigned long addr, unsigned long size);
30
31#define __range_ok(addr, size) \
32 ___range_ok((unsigned long)(addr), (unsigned long)(size))
33
34#define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0)
35#define __access_ok(add, size) (__range_ok((addr), (size)) == 0)
36
37extern inline int bad_user_access_length(void)
38{
39 return 0;
40}
41/* FIXME this is function for optimalization -> memcpy */
42#define __get_user(var, ptr) \
43 ({ \
44 int __gu_err = 0; \
45 switch (sizeof(*(ptr))) { \
46 case 1: \
47 case 2: \
48 case 4: \
49 (var) = *(ptr); \
50 break; \
51 case 8: \
52 memcpy((void *) &(var), (ptr), 8); \
53 break; \
54 default: \
55 (var) = 0; \
56 __gu_err = __get_user_bad(); \
57 break; \
58 } \
59 __gu_err; \
60 })
61
62#define __get_user_bad() (bad_user_access_length(), (-EFAULT))
63
64#define __put_user(var, ptr) \
65 ({ \
66 int __pu_err = 0; \
67 switch (sizeof(*(ptr))) { \
68 case 1: \
69 case 2: \
70 case 4: \
71 *(ptr) = (var); \
72 break; \
73 case 8: { \
74 typeof(*(ptr)) __pu_val = var; \
75 memcpy(ptr, &__pu_val, sizeof(__pu_val));\
76 } \
77 break; \
78 default: \
79 __pu_err = __put_user_bad(); \
80 break; \
81 } \
82 __pu_err; \
83 })
84
85#define __put_user_bad() (bad_user_access_length(), (-EFAULT))
86
87#define put_user(x, ptr) __put_user(x, ptr)
88#define get_user(x, ptr) __get_user(x, ptr)
89
90#define copy_to_user(to, from, n) (memcpy(to, from, n), 0)
91#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)
92
93#define __copy_to_user(to, from, n) (copy_to_user(to, from, n))
94#define __copy_from_user(to, from, n) (copy_from_user(to, from, n))
95#define __copy_to_user_inatomic(to, from, n) (__copy_to_user(to, from, n))
96#define __copy_from_user_inatomic(to, from, n) (__copy_from_user(to, from, n))
97
98#define __clear_user(addr, n) (memset((void *)addr, 0, n), 0)
99
100static inline unsigned long clear_user(void *addr, unsigned long size)
101{
102 if (access_ok(VERIFY_WRITE, addr, size))
103 size = __clear_user(addr, size);
104 return size;
105}
106
107/* Returns 0 if exception not found and fixup otherwise. */
108extern unsigned long search_exception_table(unsigned long);
109
110
111extern long strncpy_from_user(char *dst, const char __user *src, long count);
112extern long strnlen_user(const char __user *src, long count);
113extern long __strncpy_from_user(char *dst, const char __user *src, long count);
114
115/*
116 * The exception table consists of pairs of addresses: the first is the
117 * address of an instruction that is allowed to fault, and the second is
118 * the address at which the program should continue. No registers are
119 * modified, so it is entirely up to the continuation code to figure out
120 * what to do.
121 *
122 * All the routines below use bits of fixup code that are out of line
123 * with the main instruction path. This means when everything is well,
124 * we don't even have to jump over them. Further, they do not intrude
125 * on our cache or tlb entries.
126 */
127struct exception_table_entry {
128 unsigned long insn, fixup;
129};
130
131#endif /* __ASSEMBLY__ */
132#endif /* __KERNEL__ */
133
134#endif /* _ASM_MICROBLAZE_UACCESS_H */
diff --git a/arch/microblaze/include/asm/ucontext.h b/arch/microblaze/include/asm/ucontext.h
new file mode 100644
index 000000000000..11f6bb3ae3a4
--- /dev/null
+++ b/arch/microblaze/include/asm/ucontext.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_UCONTEXT_H
10#define _ASM_MICROBLAZE_UCONTEXT_H
11
12#include <asm/sigcontext.h>
13
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 struct sigcontext uc_mcontext;
19 sigset_t uc_sigmask; /* mask last for extensibility */
20};
21
22#endif /* _ASM_MICROBLAZE_UCONTEXT_H */
diff --git a/arch/microblaze/include/asm/unaligned.h b/arch/microblaze/include/asm/unaligned.h
new file mode 100644
index 000000000000..9d66b640c910
--- /dev/null
+++ b/arch/microblaze/include/asm/unaligned.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_UNALIGNED_H
11#define _ASM_MICROBLAZE_UNALIGNED_H
12
13# ifdef __KERNEL__
14
15# include <linux/unaligned/access_ok.h>
16# include <linux/unaligned/generic.h>
17
18# define get_unaligned __get_unaligned_be
19# define put_unaligned __put_unaligned_be
20
21# endif /* __KERNEL__ */
22#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
new file mode 100644
index 000000000000..d9d3903fde3f
--- /dev/null
+++ b/arch/microblaze/include/asm/unistd.h
@@ -0,0 +1,421 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_UNISTD_H
11#define _ASM_MICROBLAZE_UNISTD_H
12
13#define __NR_restart_syscall 0 /* ok */
14#define __NR_exit 1 /* ok */
15#define __NR_fork 2 /* not for no MMU - weird */
16#define __NR_read 3 /* ok */
17#define __NR_write 4 /* ok */
18#define __NR_open 5 /* openat */
19#define __NR_close 6 /* ok */
20#define __NR_waitpid 7 /* waitid */
21#define __NR_creat 8 /* openat */
22#define __NR_link 9 /* linkat */
23#define __NR_unlink 10 /* unlinkat */
24#define __NR_execve 11 /* ok */
25#define __NR_chdir 12 /* ok */
26#define __NR_time 13 /* obsolete -> sys_gettimeofday */
27#define __NR_mknod 14 /* mknodat */
28#define __NR_chmod 15 /* fchmodat */
29#define __NR_lchown 16 /* ok */
30#define __NR_break 17 /* don't know */
31#define __NR_oldstat 18 /* remove */
32#define __NR_lseek 19 /* ok */
33#define __NR_getpid 20 /* ok */
34#define __NR_mount 21 /* ok */
35#define __NR_umount 22 /* ok */ /* use only umount2 */
36#define __NR_setuid 23 /* ok */
37#define __NR_getuid 24 /* ok */
38#define __NR_stime 25 /* obsolete -> sys_settimeofday */
39#define __NR_ptrace 26 /* ok */
40#define __NR_alarm 27 /* obsolete -> sys_setitimer */
41#define __NR_oldfstat 28 /* remove */
42#define __NR_pause 29 /* obsolete -> sys_rt_sigtimedwait */
43#define __NR_utime 30 /* obsolete -> sys_utimesat */
44#define __NR_stty 31 /* remove */
45#define __NR_gtty 32 /* remove */
46#define __NR_access 33 /* faccessat */
47/* can be implemented by sys_setpriority */
48#define __NR_nice 34
49#define __NR_ftime 35 /* remove */
50#define __NR_sync 36 /* ok */
51#define __NR_kill 37 /* ok */
52#define __NR_rename 38 /* renameat */
53#define __NR_mkdir 39 /* mkdirat */
54#define __NR_rmdir 40 /* unlinkat */
55#define __NR_dup 41 /* ok */
56#define __NR_pipe 42 /* ok */
57#define __NR_times 43 /* ok */
58#define __NR_prof 44 /* remove */
59#define __NR_brk 45 /* ok -mmu, nommu specific */
60#define __NR_setgid 46 /* ok */
61#define __NR_getgid 47 /* ok */
62#define __NR_signal 48 /* obsolete -> sys_rt_sigaction */
63#define __NR_geteuid 49 /* ok */
64#define __NR_getegid 50 /* ok */
65#define __NR_acct 51 /* add it and then I can disable it */
66#define __NR_umount2 52 /* remove */
67#define __NR_lock 53 /* remove */
68#define __NR_ioctl 54 /* ok */
69#define __NR_fcntl 55 /* ok -> 64bit version*/
70#define __NR_mpx 56 /* remove */
71#define __NR_setpgid 57 /* ok */
72#define __NR_ulimit 58 /* remove */
73#define __NR_oldolduname 59 /* remove */
74#define __NR_umask 60 /* ok */
75#define __NR_chroot 61 /* ok */
76#define __NR_ustat 62 /* obsolete -> statfs64 */
77#define __NR_dup2 63 /* ok */
78#define __NR_getppid 64 /* ok */
79#define __NR_getpgrp 65 /* obsolete -> sys_getpgid */
80#define __NR_setsid 66 /* ok */
81#define __NR_sigaction 67 /* obsolete -> rt_sigaction */
82#define __NR_sgetmask 68 /* obsolete -> sys_rt_sigprocmask */
83#define __NR_ssetmask 69 /* obsolete ->sys_rt_sigprocmask */
84#define __NR_setreuid 70 /* ok */
85#define __NR_setregid 71 /* ok */
86#define __NR_sigsuspend 72 /* obsolete -> rt_sigsuspend */
87#define __NR_sigpending 73 /* obsolete -> sys_rt_sigpending */
88#define __NR_sethostname 74 /* ok */
89#define __NR_setrlimit 75 /* ok */
90#define __NR_getrlimit 76 /* ok Back compatible 2G limited rlimit */
91#define __NR_getrusage 77 /* ok */
92#define __NR_gettimeofday 78 /* ok */
93#define __NR_settimeofday 79 /* ok */
94#define __NR_getgroups 80 /* ok */
95#define __NR_setgroups 81 /* ok */
96#define __NR_select 82 /* obsolete -> sys_pselect7 */
97#define __NR_symlink 83 /* symlinkat */
98#define __NR_oldlstat 84 /* remove */
99#define __NR_readlink 85 /* obsolete -> sys_readlinkat */
100#define __NR_uselib 86 /* remove */
101#define __NR_swapon 87 /* ok */
102#define __NR_reboot 88 /* ok */
103#define __NR_readdir 89 /* remove ? */
104#define __NR_mmap 90 /* obsolete -> sys_mmap2 */
105#define __NR_munmap 91 /* ok - mmu and nommu */
106#define __NR_truncate 92 /* ok or truncate64 */
107#define __NR_ftruncate 93 /* ok or ftruncate64 */
108#define __NR_fchmod 94 /* ok */
109#define __NR_fchown 95 /* ok */
110#define __NR_getpriority 96 /* ok */
111#define __NR_setpriority 97 /* ok */
112#define __NR_profil 98 /* remove */
113#define __NR_statfs 99 /* ok or statfs64 */
114#define __NR_fstatfs 100 /* ok or fstatfs64 */
115#define __NR_ioperm 101 /* remove */
116#define __NR_socketcall 102 /* remove */
117#define __NR_syslog 103 /* ok */
118#define __NR_setitimer 104 /* ok */
119#define __NR_getitimer 105 /* ok */
120#define __NR_stat 106 /* remove */
121#define __NR_lstat 107 /* remove */
122#define __NR_fstat 108 /* remove */
123#define __NR_olduname 109 /* remove */
124#define __NR_iopl 110 /* remove */
125#define __NR_vhangup 111 /* ok */
126#define __NR_idle 112 /* remove */
127#define __NR_vm86old 113 /* remove */
128#define __NR_wait4 114 /* obsolete -> waitid */
129#define __NR_swapoff 115 /* ok */
130#define __NR_sysinfo 116 /* ok */
131#define __NR_ipc 117 /* remove - direct call */
132#define __NR_fsync 118 /* ok */
133#define __NR_sigreturn 119 /* obsolete -> sys_rt_sigreturn */
134#define __NR_clone 120 /* ok */
135#define __NR_setdomainname 121 /* ok */
136#define __NR_uname 122 /* remove */
137#define __NR_modify_ldt 123 /* remove */
138#define __NR_adjtimex 124 /* ok */
139#define __NR_mprotect 125 /* remove */
140#define __NR_sigprocmask 126 /* obsolete -> sys_rt_sigprocmask */
141#define __NR_create_module 127 /* remove */
142#define __NR_init_module 128 /* ok */
143#define __NR_delete_module 129 /* ok */
144#define __NR_get_kernel_syms 130 /* remove */
145#define __NR_quotactl 131 /* ok */
146#define __NR_getpgid 132 /* ok */
147#define __NR_fchdir 133 /* ok */
148#define __NR_bdflush 134 /* remove */
149#define __NR_sysfs 135 /* needed for busybox */
150#define __NR_personality 136 /* ok */
151#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
152#define __NR_setfsuid 138 /* ok */
153#define __NR_setfsgid 139 /* ok */
154#define __NR__llseek 140 /* remove only lseek */
155#define __NR_getdents 141 /* ok or getdents64 */
156#define __NR__newselect 142 /* remove */
157#define __NR_flock 143 /* ok */
158#define __NR_msync 144 /* remove */
159#define __NR_readv 145 /* ok */
160#define __NR_writev 146 /* ok */
161#define __NR_getsid 147 /* ok */
162#define __NR_fdatasync 148 /* ok */
163#define __NR__sysctl 149 /* remove */
164#define __NR_mlock 150 /* ok - nommu or mmu */
165#define __NR_munlock 151 /* ok - nommu or mmu */
166#define __NR_mlockall 152 /* ok - nommu or mmu */
167#define __NR_munlockall 153 /* ok - nommu or mmu */
168#define __NR_sched_setparam 154 /* ok */
169#define __NR_sched_getparam 155 /* ok */
170#define __NR_sched_setscheduler 156 /* ok */
171#define __NR_sched_getscheduler 157 /* ok */
172#define __NR_sched_yield 158 /* ok */
173#define __NR_sched_get_priority_max 159 /* ok */
174#define __NR_sched_get_priority_min 160 /* ok */
175#define __NR_sched_rr_get_interval 161 /* ok */
176#define __NR_nanosleep 162 /* ok */
177#define __NR_mremap 163 /* ok - nommu or mmu */
178#define __NR_setresuid 164 /* ok */
179#define __NR_getresuid 165 /* ok */
180#define __NR_vm86 166 /* remove */
181#define __NR_query_module 167 /* ok */
182#define __NR_poll 168 /* obsolete -> sys_ppoll */
183#define __NR_nfsservctl 169 /* ok */
184#define __NR_setresgid 170 /* ok */
185#define __NR_getresgid 171 /* ok */
186#define __NR_prctl 172 /* ok */
187#define __NR_rt_sigreturn 173 /* ok */
188#define __NR_rt_sigaction 174 /* ok */
189#define __NR_rt_sigprocmask 175 /* ok */
190#define __NR_rt_sigpending 176 /* ok */
191#define __NR_rt_sigtimedwait 177 /* ok */
192#define __NR_rt_sigqueueinfo 178 /* ok */
193#define __NR_rt_sigsuspend 179 /* ok */
194#define __NR_pread64 180 /* ok */
195#define __NR_pwrite64 181 /* ok */
196#define __NR_chown 182 /* obsolete -> fchownat */
197#define __NR_getcwd 183 /* ok */
198#define __NR_capget 184 /* ok */
199#define __NR_capset 185 /* ok */
200#define __NR_sigaltstack 186 /* remove */
201#define __NR_sendfile 187 /* ok -> exist 64bit version*/
202#define __NR_getpmsg 188 /* remove */
203/* remove - some people actually want streams */
204#define __NR_putpmsg 189
205/* for noMMU - group with clone -> maybe remove */
206#define __NR_vfork 190
207#define __NR_ugetrlimit 191 /* remove - SuS compliant getrlimit */
208#define __NR_mmap2 192 /* ok */
209#define __NR_truncate64 193 /* ok */
210#define __NR_ftruncate64 194 /* ok */
211#define __NR_stat64 195 /* remove _ARCH_WANT_STAT64 */
212#define __NR_lstat64 196 /* remove _ARCH_WANT_STAT64 */
213#define __NR_fstat64 197 /* remove _ARCH_WANT_STAT64 */
214#define __NR_lchown32 198 /* ok - without 32 */
215#define __NR_getuid32 199 /* ok - without 32 */
216#define __NR_getgid32 200 /* ok - without 32 */
217#define __NR_geteuid32 201 /* ok - without 32 */
218#define __NR_getegid32 202 /* ok - without 32 */
219#define __NR_setreuid32 203 /* ok - without 32 */
220#define __NR_setregid32 204 /* ok - without 32 */
221#define __NR_getgroups32 205 /* ok - without 32 */
222#define __NR_setgroups32 206 /* ok - without 32 */
223#define __NR_fchown32 207 /* ok - without 32 */
224#define __NR_setresuid32 208 /* ok - without 32 */
225#define __NR_getresuid32 209 /* ok - without 32 */
226#define __NR_setresgid32 210 /* ok - without 32 */
227#define __NR_getresgid32 211 /* ok - without 32 */
228#define __NR_chown32 212 /* ok - without 32 -obsolete -> fchownat */
229#define __NR_setuid32 213 /* ok - without 32 */
230#define __NR_setgid32 214 /* ok - without 32 */
231#define __NR_setfsuid32 215 /* ok - without 32 */
232#define __NR_setfsgid32 216 /* ok - without 32 */
233#define __NR_pivot_root 217 /* ok */
234#define __NR_mincore 218 /* ok */
235#define __NR_madvise 219 /* ok */
236#define __NR_getdents64 220 /* ok */
237#define __NR_fcntl64 221 /* ok */
238/* 223 is unused */
239#define __NR_gettid 224 /* ok */
240#define __NR_readahead 225 /* ok */
241#define __NR_setxattr 226 /* ok */
242#define __NR_lsetxattr 227 /* ok */
243#define __NR_fsetxattr 228 /* ok */
244#define __NR_getxattr 229 /* ok */
245#define __NR_lgetxattr 230 /* ok */
246#define __NR_fgetxattr 231 /* ok */
247#define __NR_listxattr 232 /* ok */
248#define __NR_llistxattr 233 /* ok */
249#define __NR_flistxattr 234 /* ok */
250#define __NR_removexattr 235 /* ok */
251#define __NR_lremovexattr 236 /* ok */
252#define __NR_fremovexattr 237 /* ok */
253#define __NR_tkill 238 /* ok */
254#define __NR_sendfile64 239 /* ok */
255#define __NR_futex 240 /* ok */
256#define __NR_sched_setaffinity 241 /* ok */
257#define __NR_sched_getaffinity 242 /* ok */
258#define __NR_set_thread_area 243 /* remove */
259#define __NR_get_thread_area 244 /* remove */
260#define __NR_io_setup 245 /* ok */
261#define __NR_io_destroy 246 /* ok */
262#define __NR_io_getevents 247 /* ok */
263#define __NR_io_submit 248 /* ok */
264#define __NR_io_cancel 249 /* ok */
265#define __NR_fadvise64 250 /* remove -> sys_fadvise64_64 */
266/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
267#define __NR_exit_group 252 /* ok */
268#define __NR_lookup_dcookie 253 /* ok */
269#define __NR_epoll_create 254 /* ok */
270#define __NR_epoll_ctl 255 /* ok */
271#define __NR_epoll_wait 256 /* obsolete -> sys_epoll_pwait */
272#define __NR_remap_file_pages 257 /* only for mmu */
273#define __NR_set_tid_address 258 /* ok */
274#define __NR_timer_create 259 /* ok */
275#define __NR_timer_settime (__NR_timer_create+1) /* 260 */ /* ok */
276#define __NR_timer_gettime (__NR_timer_create+2) /* 261 */ /* ok */
277#define __NR_timer_getoverrun (__NR_timer_create+3) /* 262 */ /* ok */
278#define __NR_timer_delete (__NR_timer_create+4) /* 263 */ /* ok */
279#define __NR_clock_settime (__NR_timer_create+5) /* 264 */ /* ok */
280#define __NR_clock_gettime (__NR_timer_create+6) /* 265 */ /* ok */
281#define __NR_clock_getres (__NR_timer_create+7) /* 266 */ /* ok */
282#define __NR_clock_nanosleep (__NR_timer_create+8) /* 267 */ /* ok */
283#define __NR_statfs64 268 /* ok */
284#define __NR_fstatfs64 269 /* ok */
285#define __NR_tgkill 270 /* ok */
286#define __NR_utimes 271 /* obsolete -> sys_futimesat */
287#define __NR_fadvise64_64 272 /* ok */
288#define __NR_vserver 273 /* ok */
289#define __NR_mbind 274 /* only for mmu */
290#define __NR_get_mempolicy 275 /* only for mmu */
291#define __NR_set_mempolicy 276 /* only for mmu */
292#define __NR_mq_open 277 /* ok */
293#define __NR_mq_unlink (__NR_mq_open+1) /* 278 */ /* ok */
294#define __NR_mq_timedsend (__NR_mq_open+2) /* 279 */ /* ok */
295#define __NR_mq_timedreceive (__NR_mq_open+3) /* 280 */ /* ok */
296#define __NR_mq_notify (__NR_mq_open+4) /* 281 */ /* ok */
297#define __NR_mq_getsetattr (__NR_mq_open+5) /* 282 */ /* ok */
298#define __NR_kexec_load 283 /* ok */
299#define __NR_waitid 284 /* ok */
300/* #define __NR_sys_setaltroot 285 */
301#define __NR_add_key 286 /* ok */
302#define __NR_request_key 287 /* ok */
303#define __NR_keyctl 288 /* ok */
304#define __NR_ioprio_set 289 /* ok */
305#define __NR_ioprio_get 290 /* ok */
306#define __NR_inotify_init 291 /* ok */
307#define __NR_inotify_add_watch 292 /* ok */
308#define __NR_inotify_rm_watch 293 /* ok */
309#define __NR_migrate_pages 294 /* mmu */
310#define __NR_openat 295 /* ok */
311#define __NR_mkdirat 296 /* ok */
312#define __NR_mknodat 297 /* ok */
313#define __NR_fchownat 298 /* ok */
314#define __NR_futimesat 299 /* obsolete -> sys_utimesat */
315#define __NR_fstatat64 300 /* stat64 */
316#define __NR_unlinkat 301 /* ok */
317#define __NR_renameat 302 /* ok */
318#define __NR_linkat 303 /* ok */
319#define __NR_symlinkat 304 /* ok */
320#define __NR_readlinkat 305 /* ok */
321#define __NR_fchmodat 306 /* ok */
322#define __NR_faccessat 307 /* ok */
323#define __NR_pselect6 308 /* obsolete -> sys_pselect7 */
324#define __NR_ppoll 309 /* ok */
325#define __NR_unshare 310 /* ok */
326#define __NR_set_robust_list 311 /* ok */
327#define __NR_get_robust_list 312 /* ok */
328#define __NR_splice 313 /* ok */
329#define __NR_sync_file_range 314 /* ok */
330#define __NR_tee 315 /* ok */
331#define __NR_vmsplice 316 /* ok */
332#define __NR_move_pages 317 /* mmu */
333#define __NR_getcpu 318 /* ok */
334#define __NR_epoll_pwait 319 /* ok */
335#define __NR_utimensat 320 /* ok */
336#define __NR_signalfd 321 /* ok */
337#define __NR_timerfd_create 322 /* ok */
338#define __NR_eventfd 323 /* ok */
339#define __NR_fallocate 324 /* ok */
340#define __NR_semtimedop 325 /* ok - semaphore group */
341#define __NR_timerfd_settime 326 /* ok */
342#define __NR_timerfd_gettime 327 /* ok */
343/* sysv ipc syscalls */
344#define __NR_semctl 328 /* ok */
345#define __NR_semget 329 /* ok */
346#define __NR_semop 330 /* ok */
347#define __NR_msgctl 331 /* ok */
348#define __NR_msgget 332 /* ok */
349#define __NR_msgrcv 333 /* ok */
350#define __NR_msgsnd 334 /* ok */
351#define __NR_shmat 335 /* ok */
352#define __NR_shmctl 336 /* ok */
353#define __NR_shmdt 337 /* ok */
354#define __NR_shmget 338 /* ok */
355
356
357#define __NR_signalfd4 339 /* new */
358#define __NR_eventfd2 340 /* new */
359#define __NR_epoll_create1 341 /* new */
360#define __NR_dup3 342 /* new */
361#define __NR_pipe2 343 /* new */
362#define __NR_inotify_init1 344 /* new */
363#define __NR_socket 345 /* new */
364#define __NR_socketpair 346 /* new */
365#define __NR_bind 347 /* new */
366#define __NR_listen 348 /* new */
367#define __NR_accept 349 /* new */
368#define __NR_connect 350 /* new */
369#define __NR_getsockname 351 /* new */
370#define __NR_getpeername 352 /* new */
371#define __NR_sendto 353 /* new */
372#define __NR_send 354 /* new */
373#define __NR_recvfrom 355 /* new */
374#define __NR_recv 356 /* new */
375#define __NR_setsockopt 357 /* new */
376#define __NR_getsockopt 358 /* new */
377#define __NR_shutdown 359 /* new */
378#define __NR_sendmsg 360 /* new */
379#define __NR_recvmsg 361 /* new */
380#define __NR_accept04 362 /* new */
381
382#define __NR_syscalls 363
383
384#ifdef __KERNEL__
385#ifndef __ASSEMBLY__
386
387#define __ARCH_WANT_IPC_PARSE_VERSION
388/* #define __ARCH_WANT_OLD_READDIR */
389/* #define __ARCH_WANT_OLD_STAT */
390#define __ARCH_WANT_STAT64
391#define __ARCH_WANT_SYS_ALARM
392#define __ARCH_WANT_SYS_GETHOSTNAME
393#define __ARCH_WANT_SYS_PAUSE
394#define __ARCH_WANT_SYS_SGETMASK
395#define __ARCH_WANT_SYS_SIGNAL
396#define __ARCH_WANT_SYS_TIME
397#define __ARCH_WANT_SYS_UTIME
398#define __ARCH_WANT_SYS_WAITPID
399#define __ARCH_WANT_SYS_SOCKETCALL
400#define __ARCH_WANT_SYS_FADVISE64
401#define __ARCH_WANT_SYS_GETPGRP
402#define __ARCH_WANT_SYS_LLSEEK
403#define __ARCH_WANT_SYS_NICE
404/* #define __ARCH_WANT_SYS_OLD_GETRLIMIT */
405#define __ARCH_WANT_SYS_OLDUMOUNT
406#define __ARCH_WANT_SYS_SIGPENDING
407#define __ARCH_WANT_SYS_SIGPROCMASK
408#define __ARCH_WANT_SYS_RT_SIGACTION
409/* #define __ARCH_WANT_SYS_RT_SIGSUSPEND */
410
411/*
412 * "Conditional" syscalls
413 *
414 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
415 * but it doesn't work on all toolchains, so we just do it by hand
416 */
417#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
418
419#endif /* __ASSEMBLY__ */
420#endif /* __KERNEL__ */
421#endif /* _ASM_MICROBLAZE_UNISTD_H */
diff --git a/arch/microblaze/include/asm/user.h b/arch/microblaze/include/asm/user.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/user.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/vga.h b/arch/microblaze/include/asm/vga.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/arch/microblaze/include/asm/vga.h
@@ -0,0 +1 @@
diff --git a/arch/microblaze/include/asm/xor.h b/arch/microblaze/include/asm/xor.h
new file mode 100644
index 000000000000..c82eb12a5b18
--- /dev/null
+++ b/arch/microblaze/include/asm/xor.h
@@ -0,0 +1 @@
#include <asm-generic/xor.h>
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile
new file mode 100644
index 000000000000..da94bec4ecba
--- /dev/null
+++ b/arch/microblaze/kernel/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile
3#
4
5extra-y := head.o vmlinux.lds
6
7obj-y += exceptions.o \
8 hw_exception_handler.o init_task.o intc.o irq.o of_device.o \
9 of_platform.o process.o prom.o prom_parse.o ptrace.o \
10 setup.o signal.o sys_microblaze.o timer.o traps.o
11
12obj-y += cpu/
13
14obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
15obj-$(CONFIG_SELFMOD) += selfmod.o
16obj-$(CONFIG_HEART_BEAT) += heartbeat.o
17obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
18
19obj-y += entry$(MMUEXT).o
diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/asm-offsets.c
new file mode 100644
index 000000000000..38e1a2e8ad0c
--- /dev/null
+++ b/arch/microblaze/kernel/asm-offsets.c
@@ -0,0 +1,115 @@
1/*
2 * Copyright (C) 2007-2009 PetaLogix
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#include <linux/init.h>
11#include <linux/stddef.h>
12#include <linux/sched.h>
13#include <linux/kernel_stat.h>
14#include <linux/ptrace.h>
15#include <linux/hardirq.h>
16#include <linux/thread_info.h>
17#include <linux/kbuild.h>
18
19int main(int argc, char *argv[])
20{
21 /* struct pt_regs */
22 DEFINE(PT_SIZE, sizeof(struct pt_regs));
23 DEFINE(PT_MSR, offsetof(struct pt_regs, msr));
24 DEFINE(PT_EAR, offsetof(struct pt_regs, ear));
25 DEFINE(PT_ESR, offsetof(struct pt_regs, esr));
26 DEFINE(PT_FSR, offsetof(struct pt_regs, fsr));
27 DEFINE(PT_PC, offsetof(struct pt_regs, pc));
28 DEFINE(PT_R0, offsetof(struct pt_regs, r0));
29 DEFINE(PT_R1, offsetof(struct pt_regs, r1));
30 DEFINE(PT_R2, offsetof(struct pt_regs, r2));
31 DEFINE(PT_R3, offsetof(struct pt_regs, r3));
32 DEFINE(PT_R4, offsetof(struct pt_regs, r4));
33 DEFINE(PT_R5, offsetof(struct pt_regs, r5));
34 DEFINE(PT_R6, offsetof(struct pt_regs, r6));
35 DEFINE(PT_R7, offsetof(struct pt_regs, r7));
36 DEFINE(PT_R8, offsetof(struct pt_regs, r8));
37 DEFINE(PT_R9, offsetof(struct pt_regs, r9));
38 DEFINE(PT_R10, offsetof(struct pt_regs, r10));
39 DEFINE(PT_R11, offsetof(struct pt_regs, r11));
40 DEFINE(PT_R12, offsetof(struct pt_regs, r12));
41 DEFINE(PT_R13, offsetof(struct pt_regs, r13));
42 DEFINE(PT_R14, offsetof(struct pt_regs, r14));
43 DEFINE(PT_R15, offsetof(struct pt_regs, r15));
44 DEFINE(PT_R16, offsetof(struct pt_regs, r16));
45 DEFINE(PT_R17, offsetof(struct pt_regs, r17));
46 DEFINE(PT_R18, offsetof(struct pt_regs, r18));
47 DEFINE(PT_R19, offsetof(struct pt_regs, r19));
48 DEFINE(PT_R20, offsetof(struct pt_regs, r20));
49 DEFINE(PT_R21, offsetof(struct pt_regs, r21));
50 DEFINE(PT_R22, offsetof(struct pt_regs, r22));
51 DEFINE(PT_R23, offsetof(struct pt_regs, r23));
52 DEFINE(PT_R24, offsetof(struct pt_regs, r24));
53 DEFINE(PT_R25, offsetof(struct pt_regs, r25));
54 DEFINE(PT_R26, offsetof(struct pt_regs, r26));
55 DEFINE(PT_R27, offsetof(struct pt_regs, r27));
56 DEFINE(PT_R28, offsetof(struct pt_regs, r28));
57 DEFINE(PT_R29, offsetof(struct pt_regs, r29));
58 DEFINE(PT_R30, offsetof(struct pt_regs, r30));
59 DEFINE(PT_R31, offsetof(struct pt_regs, r31));
60 DEFINE(PT_MODE, offsetof(struct pt_regs, kernel_mode));
61 BLANK();
62
63 /* Magic offsets for PTRACE PEEK/POKE etc */
64 DEFINE(PT_TEXT_ADDR, sizeof(struct pt_regs) + 1);
65 DEFINE(PT_TEXT_LEN, sizeof(struct pt_regs) + 2);
66 DEFINE(PT_DATA_ADDR, sizeof(struct pt_regs) + 3);
67 BLANK();
68
69 /* struct task_struct */
70 DEFINE(TS_THREAD_INFO, offsetof(struct task_struct, stack));
71
72 /* struct thread_info */
73 DEFINE(TI_TASK, offsetof(struct thread_info, task));
74 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
75 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
76 DEFINE(TI_STATUS, offsetof(struct thread_info, status));
77 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
78 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
79 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
80 DEFINE(TI_RESTART_BLOCK, offsetof(struct thread_info, restart_block));
81 DEFINE(TI_CPU_CONTEXT, offsetof(struct thread_info, cpu_context));
82 BLANK();
83
84 /* struct cpu_context */
85 DEFINE(CC_R1, offsetof(struct cpu_context, r1)); /* r1 */
86 DEFINE(CC_R2, offsetof(struct cpu_context, r2));
87 /* dedicated registers */
88 DEFINE(CC_R13, offsetof(struct cpu_context, r13));
89 DEFINE(CC_R14, offsetof(struct cpu_context, r14));
90 DEFINE(CC_R15, offsetof(struct cpu_context, r15));
91 DEFINE(CC_R16, offsetof(struct cpu_context, r16));
92 DEFINE(CC_R17, offsetof(struct cpu_context, r17));
93 DEFINE(CC_R18, offsetof(struct cpu_context, r18));
94 /* non-volatile registers */
95 DEFINE(CC_R19, offsetof(struct cpu_context, r19));
96 DEFINE(CC_R20, offsetof(struct cpu_context, r20));
97 DEFINE(CC_R21, offsetof(struct cpu_context, r21));
98 DEFINE(CC_R22, offsetof(struct cpu_context, r22));
99 DEFINE(CC_R23, offsetof(struct cpu_context, r23));
100 DEFINE(CC_R24, offsetof(struct cpu_context, r24));
101 DEFINE(CC_R25, offsetof(struct cpu_context, r25));
102 DEFINE(CC_R26, offsetof(struct cpu_context, r26));
103 DEFINE(CC_R27, offsetof(struct cpu_context, r27));
104 DEFINE(CC_R28, offsetof(struct cpu_context, r28));
105 DEFINE(CC_R29, offsetof(struct cpu_context, r29));
106 DEFINE(CC_R30, offsetof(struct cpu_context, r30));
107 /* special purpose registers */
108 DEFINE(CC_MSR, offsetof(struct cpu_context, msr));
109 DEFINE(CC_EAR, offsetof(struct cpu_context, ear));
110 DEFINE(CC_ESR, offsetof(struct cpu_context, esr));
111 DEFINE(CC_FSR, offsetof(struct cpu_context, fsr));
112 BLANK();
113
114 return 0;
115}
diff --git a/arch/microblaze/kernel/cpu/Makefile b/arch/microblaze/kernel/cpu/Makefile
new file mode 100644
index 000000000000..20646e549271
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/Makefile
@@ -0,0 +1,8 @@
1#
2# Build the appropriate CPU version support
3#
4
5EXTRA_CFLAGS += -DCPU_MAJOR=$(CPU_MAJOR) -DCPU_MINOR=$(CPU_MINOR) \
6 -DCPU_REV=$(CPU_REV)
7
8obj-y += cache.o cpuinfo.o cpuinfo-pvr-full.o cpuinfo-static.o mb.o pvr.o
diff --git a/arch/microblaze/kernel/cpu/cache.c b/arch/microblaze/kernel/cpu/cache.c
new file mode 100644
index 000000000000..be9fecca4f91
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/cache.c
@@ -0,0 +1,258 @@
1/*
2 * Cache control for MicroBlaze cache memories
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this
10 * archive for more details.
11 */
12
13#include <asm/cacheflush.h>
14#include <linux/cache.h>
15#include <asm/cpuinfo.h>
16
17/* Exported functions */
18
19void _enable_icache(void)
20{
21 if (cpuinfo.use_icache) {
22#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
23 __asm__ __volatile__ (" \
24 msrset r0, %0; \
25 nop; " \
26 : \
27 : "i" (MSR_ICE) \
28 : "memory");
29#else
30 __asm__ __volatile__ (" \
31 mfs r12, rmsr; \
32 nop; \
33 ori r12, r12, %0; \
34 mts rmsr, r12; \
35 nop; " \
36 : \
37 : "i" (MSR_ICE) \
38 : "memory", "r12");
39#endif
40 }
41}
42
43void _disable_icache(void)
44{
45 if (cpuinfo.use_icache) {
46#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
47 __asm__ __volatile__ (" \
48 msrclr r0, %0; \
49 nop; " \
50 : \
51 : "i" (MSR_ICE) \
52 : "memory");
53#else
54 __asm__ __volatile__ (" \
55 mfs r12, rmsr; \
56 nop; \
57 andi r12, r12, ~%0; \
58 mts rmsr, r12; \
59 nop; " \
60 : \
61 : "i" (MSR_ICE) \
62 : "memory", "r12");
63#endif
64 }
65}
66
67void _invalidate_icache(unsigned int addr)
68{
69 if (cpuinfo.use_icache) {
70 __asm__ __volatile__ (" \
71 wic %0, r0" \
72 : \
73 : "r" (addr));
74 }
75}
76
77void _enable_dcache(void)
78{
79 if (cpuinfo.use_dcache) {
80#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
81 __asm__ __volatile__ (" \
82 msrset r0, %0; \
83 nop; " \
84 : \
85 : "i" (MSR_DCE) \
86 : "memory");
87#else
88 __asm__ __volatile__ (" \
89 mfs r12, rmsr; \
90 nop; \
91 ori r12, r12, %0; \
92 mts rmsr, r12; \
93 nop; " \
94 : \
95 : "i" (MSR_DCE) \
96 : "memory", "r12");
97#endif
98 }
99}
100
101void _disable_dcache(void)
102{
103 if (cpuinfo.use_dcache) {
104#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
105 __asm__ __volatile__ (" \
106 msrclr r0, %0; \
107 nop; " \
108 : \
109 : "i" (MSR_DCE) \
110 : "memory");
111#else
112 __asm__ __volatile__ (" \
113 mfs r12, rmsr; \
114 nop; \
115 andi r12, r12, ~%0; \
116 mts rmsr, r12; \
117 nop; " \
118 : \
119 : "i" (MSR_DCE) \
120 : "memory", "r12");
121#endif
122 }
123}
124
125void _invalidate_dcache(unsigned int addr)
126{
127 if (cpuinfo.use_dcache)
128 __asm__ __volatile__ (" \
129 wdc %0, r0" \
130 : \
131 : "r" (addr));
132}
133
134void __invalidate_icache_all(void)
135{
136 unsigned int i;
137 unsigned flags;
138
139 if (cpuinfo.use_icache) {
140 local_irq_save(flags);
141 __disable_icache();
142
143 /* Just loop through cache size and invalidate, no need to add
144 CACHE_BASE address */
145 for (i = 0; i < cpuinfo.icache_size;
146 i += cpuinfo.icache_line)
147 __invalidate_icache(i);
148
149 __enable_icache();
150 local_irq_restore(flags);
151 }
152}
153
154void __invalidate_icache_range(unsigned long start, unsigned long end)
155{
156 unsigned int i;
157 unsigned flags;
158 unsigned int align;
159
160 if (cpuinfo.use_icache) {
161 /*
162 * No need to cover entire cache range,
163 * just cover cache footprint
164 */
165 end = min(start + cpuinfo.icache_size, end);
166 align = ~(cpuinfo.icache_line - 1);
167 start &= align; /* Make sure we are aligned */
168 /* Push end up to the next cache line */
169 end = ((end & align) + cpuinfo.icache_line);
170
171 local_irq_save(flags);
172 __disable_icache();
173
174 for (i = start; i < end; i += cpuinfo.icache_line)
175 __invalidate_icache(i);
176
177 __enable_icache();
178 local_irq_restore(flags);
179 }
180}
181
182void __invalidate_icache_page(struct vm_area_struct *vma, struct page *page)
183{
184 __invalidate_icache_all();
185}
186
187void __invalidate_icache_user_range(struct vm_area_struct *vma,
188 struct page *page, unsigned long adr,
189 int len)
190{
191 __invalidate_icache_all();
192}
193
194void __invalidate_cache_sigtramp(unsigned long addr)
195{
196 __invalidate_icache_range(addr, addr + 8);
197}
198
199void __invalidate_dcache_all(void)
200{
201 unsigned int i;
202 unsigned flags;
203
204 if (cpuinfo.use_dcache) {
205 local_irq_save(flags);
206 __disable_dcache();
207
208 /*
209 * Just loop through cache size and invalidate,
210 * no need to add CACHE_BASE address
211 */
212 for (i = 0; i < cpuinfo.dcache_size;
213 i += cpuinfo.dcache_line)
214 __invalidate_dcache(i);
215
216 __enable_dcache();
217 local_irq_restore(flags);
218 }
219}
220
221void __invalidate_dcache_range(unsigned long start, unsigned long end)
222{
223 unsigned int i;
224 unsigned flags;
225 unsigned int align;
226
227 if (cpuinfo.use_dcache) {
228 /*
229 * No need to cover entire cache range,
230 * just cover cache footprint
231 */
232 end = min(start + cpuinfo.dcache_size, end);
233 align = ~(cpuinfo.dcache_line - 1);
234 start &= align; /* Make sure we are aligned */
235 /* Push end up to the next cache line */
236 end = ((end & align) + cpuinfo.dcache_line);
237 local_irq_save(flags);
238 __disable_dcache();
239
240 for (i = start; i < end; i += cpuinfo.dcache_line)
241 __invalidate_dcache(i);
242
243 __enable_dcache();
244 local_irq_restore(flags);
245 }
246}
247
248void __invalidate_dcache_page(struct vm_area_struct *vma, struct page *page)
249{
250 __invalidate_dcache_all();
251}
252
253void __invalidate_dcache_user_range(struct vm_area_struct *vma,
254 struct page *page, unsigned long adr,
255 int len)
256{
257 __invalidate_dcache_all();
258}
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
new file mode 100644
index 000000000000..cf7424a6bb87
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
@@ -0,0 +1,101 @@
1/*
2 * Support for MicroBlaze PVR (processor version register)
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/string.h>
15#include <asm/pvr.h>
16#include <asm/cpuinfo.h>
17
18/*
19 * Helper macro to map between fields in our struct cpuinfo, and
20 * the PVR macros in pvr.h.
21 */
22
23#define CI(c, p) { ci->c = PVR_##p(pvr); }
24#define err_printk(x) \
25 early_printk("ERROR: Microblaze " x " - different for PVR and DTS\n");
26
27void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
28{
29 struct pvr_s pvr;
30 int temp; /* for saving temp value */
31 get_pvr(&pvr);
32
33 temp = PVR_USE_BARREL(pvr) | PVR_USE_MSR_INSTR(pvr) |\
34 PVR_USE_PCMP_INSTR(pvr) | PVR_USE_DIV(pvr);
35 if (ci->use_instr != temp)
36 err_printk("BARREL, MSR, PCMP or DIV");
37 ci->use_instr = temp;
38
39 temp = PVR_USE_HW_MUL(pvr) | PVR_USE_MUL64(pvr);
40 if (ci->use_mult != temp)
41 err_printk("HW_MUL");
42 ci->use_mult = temp;
43
44 temp = PVR_USE_FPU(pvr) | PVR_USE_FPU2(pvr);
45 if (ci->use_fpu != temp)
46 err_printk("HW_FPU");
47 ci->use_fpu = temp;
48
49 ci->use_exc = PVR_OPCODE_0x0_ILLEGAL(pvr) |\
50 PVR_UNALIGNED_EXCEPTION(pvr) |\
51 PVR_ILL_OPCODE_EXCEPTION(pvr) |\
52 PVR_IOPB_BUS_EXCEPTION(pvr) |\
53 PVR_DOPB_BUS_EXCEPTION(pvr) |\
54 PVR_DIV_ZERO_EXCEPTION(pvr) |\
55 PVR_FPU_EXCEPTION(pvr) |\
56 PVR_FSL_EXCEPTION(pvr);
57
58 CI(pvr_user1, USER1);
59 CI(pvr_user2, USER2);
60
61 CI(mmu, USE_MMU);
62
63 CI(ver_code, VERSION);
64
65 CI(use_icache, USE_ICACHE);
66 CI(icache_tagbits, ICACHE_ADDR_TAG_BITS);
67 CI(icache_write, ICACHE_ALLOW_WR);
68 CI(icache_line, ICACHE_LINE_LEN);
69 CI(icache_size, ICACHE_BYTE_SIZE);
70 CI(icache_base, ICACHE_BASEADDR);
71 CI(icache_high, ICACHE_HIGHADDR);
72
73 CI(use_dcache, USE_DCACHE);
74 CI(dcache_tagbits, DCACHE_ADDR_TAG_BITS);
75 CI(dcache_write, DCACHE_ALLOW_WR);
76 CI(dcache_line, DCACHE_LINE_LEN);
77 CI(dcache_size, DCACHE_BYTE_SIZE);
78 CI(dcache_base, DCACHE_BASEADDR);
79 CI(dcache_high, DCACHE_HIGHADDR);
80
81 CI(use_dopb, D_OPB);
82 CI(use_iopb, I_OPB);
83 CI(use_dlmb, D_LMB);
84 CI(use_ilmb, I_LMB);
85 CI(num_fsl, FSL_LINKS);
86
87 CI(irq_edge, INTERRUPT_IS_EDGE);
88 CI(irq_positive, EDGE_IS_POSITIVE);
89
90 CI(area_optimised, AREA_OPTIMISED);
91
92 CI(hw_debug, DEBUG_ENABLED);
93 CI(num_pc_brk, NUMBER_OF_PC_BRK);
94 CI(num_rd_brk, NUMBER_OF_RD_ADDR_BRK);
95 CI(num_wr_brk, NUMBER_OF_WR_ADDR_BRK);
96
97 CI(fpga_family_code, TARGET_FAMILY);
98
99 /* take timebase-frequency from DTS */
100 ci->cpu_clock_freq = fcpu(cpu, "timebase-frequency");
101}
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c
new file mode 100644
index 000000000000..cfe44effdb77
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c
@@ -0,0 +1,144 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/string.h>
14#include <asm/cpuinfo.h>
15#include <asm/pvr.h>
16
17const static char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
18const static char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
19
20#define err_printk(x) \
21 early_printk("ERROR: Microblaze " x "- different for kernel and DTS\n");
22
23void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
24{
25 int i = 0;
26
27 ci->use_instr =
28 (fcpu(cpu, "xlnx,use-barrel") ? PVR0_USE_BARREL_MASK : 0) |
29 (fcpu(cpu, "xlnx,use-msr-instr") ? PVR2_USE_MSR_INSTR : 0) |
30 (fcpu(cpu, "xlnx,use-pcmp-instr") ? PVR2_USE_PCMP_INSTR : 0) |
31 (fcpu(cpu, "xlnx,use-div") ? PVR0_USE_DIV_MASK : 0);
32 if (CONFIG_XILINX_MICROBLAZE0_USE_BARREL)
33 i |= PVR0_USE_BARREL_MASK;
34 if (CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR)
35 i |= PVR2_USE_MSR_INSTR;
36 if (CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR)
37 i |= PVR2_USE_PCMP_INSTR;
38 if (CONFIG_XILINX_MICROBLAZE0_USE_DIV)
39 i |= PVR0_USE_DIV_MASK;
40 if (ci->use_instr != i)
41 err_printk("BARREL, MSR, PCMP or DIV");
42
43 ci->use_mult = fcpu(cpu, "xlnx,use-hw-mul");
44 if (ci->use_mult != CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL)
45 err_printk("HW_MUL");
46 ci->use_mult =
47 (ci->use_mult > 1 ?
48 (PVR2_USE_MUL64_MASK | PVR0_USE_HW_MUL_MASK) :
49 (ci->use_mult == 1 ? PVR0_USE_HW_MUL_MASK : 0));
50
51 ci->use_fpu = fcpu(cpu, "xlnx,use-fpu");
52 if (ci->use_fpu != CONFIG_XILINX_MICROBLAZE0_USE_FPU)
53 err_printk("HW_FPU");
54 ci->use_fpu = (ci->use_fpu > 1 ?
55 (PVR2_USE_FPU2_MASK | PVR0_USE_FPU_MASK) :
56 (ci->use_fpu == 1 ? PVR0_USE_FPU_MASK : 0));
57
58 ci->use_exc =
59 (fcpu(cpu, "xlnx,unaligned-exceptions") ?
60 PVR2_UNALIGNED_EXC_MASK : 0) |
61 (fcpu(cpu, "xlnx,ill-opcode-exception") ?
62 PVR2_ILL_OPCODE_EXC_MASK : 0) |
63 (fcpu(cpu, "xlnx,iopb-bus-exception") ?
64 PVR2_IOPB_BUS_EXC_MASK : 0) |
65 (fcpu(cpu, "xlnx,dopb-bus-exception") ?
66 PVR2_DOPB_BUS_EXC_MASK : 0) |
67 (fcpu(cpu, "xlnx,div-zero-exception") ?
68 PVR2_DIV_ZERO_EXC_MASK : 0) |
69 (fcpu(cpu, "xlnx,fpu-exception") ? PVR2_FPU_EXC_MASK : 0) |
70 (fcpu(cpu, "xlnx,fsl-exception") ? PVR2_USE_EXTEND_FSL : 0);
71
72 ci->use_icache = fcpu(cpu, "xlnx,use-icache");
73 ci->icache_tagbits = fcpu(cpu, "xlnx,addr-tag-bits");
74 ci->icache_write = fcpu(cpu, "xlnx,allow-icache-wr");
75 ci->icache_line = fcpu(cpu, "xlnx,icache-line-len") << 2;
76 if (!ci->icache_line) {
77 if (fcpu(cpu, "xlnx,icache-use-fsl"))
78 ci->icache_line = 4 << 2;
79 else
80 ci->icache_line = 1 << 2;
81 }
82 ci->icache_size = fcpu(cpu, "i-cache-size");
83 ci->icache_base = fcpu(cpu, "i-cache-baseaddr");
84 ci->icache_high = fcpu(cpu, "i-cache-highaddr");
85
86 ci->use_dcache = fcpu(cpu, "xlnx,use-dcache");
87 ci->dcache_tagbits = fcpu(cpu, "xlnx,dcache-addr-tag");
88 ci->dcache_write = fcpu(cpu, "xlnx,allow-dcache-wr");
89 ci->dcache_line = fcpu(cpu, "xlnx,dcache-line-len") << 2;
90 if (!ci->dcache_line) {
91 if (fcpu(cpu, "xlnx,dcache-use-fsl"))
92 ci->dcache_line = 4 << 2;
93 else
94 ci->dcache_line = 1 << 2;
95 }
96 ci->dcache_size = fcpu(cpu, "d-cache-size");
97 ci->dcache_base = fcpu(cpu, "d-cache-baseaddr");
98 ci->dcache_high = fcpu(cpu, "d-cache-highaddr");
99
100 ci->use_dopb = fcpu(cpu, "xlnx,d-opb");
101 ci->use_iopb = fcpu(cpu, "xlnx,i-opb");
102 ci->use_dlmb = fcpu(cpu, "xlnx,d-lmb");
103 ci->use_ilmb = fcpu(cpu, "xlnx,i-lmb");
104
105 ci->num_fsl = fcpu(cpu, "xlnx,fsl-links");
106 ci->irq_edge = fcpu(cpu, "xlnx,interrupt-is-edge");
107 ci->irq_positive = fcpu(cpu, "xlnx,edge-is-positive");
108 ci->area_optimised = 0;
109
110 ci->hw_debug = fcpu(cpu, "xlnx,debug-enabled");
111 ci->num_pc_brk = fcpu(cpu, "xlnx,number-of-pc-brk");
112 ci->num_rd_brk = fcpu(cpu, "xlnx,number-of-rd-addr-brk");
113 ci->num_wr_brk = fcpu(cpu, "xlnx,number-of-wr-addr-brk");
114
115 ci->cpu_clock_freq = fcpu(cpu, "timebase-frequency");
116
117 ci->pvr_user1 = fcpu(cpu, "xlnx,pvr-user1");
118 ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2");
119
120 ci->mmu = fcpu(cpu, "xlnx,use-mmu");
121
122 ci->ver_code = 0;
123 ci->fpga_family_code = 0;
124
125 /* Do various fixups based on CPU version and FPGA family strings */
126
127 /* Resolved the CPU version code */
128 for (i = 0; cpu_ver_lookup[i].s != NULL; i++) {
129 if (strcmp(cpu_ver_lookup[i].s, cpu_ver_string) == 0)
130 ci->ver_code = cpu_ver_lookup[i].k;
131 }
132
133 /* Resolved the fpga family code */
134 for (i = 0; family_string_lookup[i].s != NULL; i++) {
135 if (strcmp(family_string_lookup[i].s, family_string) == 0)
136 ci->fpga_family_code = family_string_lookup[i].k;
137 }
138
139 /* FIXME - mb3 and spartan2 do not exist in PVR */
140 /* This is mb3 and on a non Spartan2 */
141 if (ci->ver_code == 0x20 && ci->fpga_family_code != 0xf0)
142 /* Hardware Multiplier in use */
143 ci->use_mult = 1;
144}
diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c
new file mode 100644
index 000000000000..4a740dfcf6da
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/cpuinfo.c
@@ -0,0 +1,86 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/slab.h>
13#include <asm/cpuinfo.h>
14#include <asm/pvr.h>
15
16const struct cpu_ver_key cpu_ver_lookup[] = {
17 /* These key value are as per MBV field in PVR0 */
18 {"5.00.a", 0x01},
19 {"5.00.b", 0x02},
20 {"5.00.c", 0x03},
21 {"6.00.a", 0x04},
22 {"6.00.b", 0x06},
23 {"7.00.a", 0x05},
24 {"7.00.b", 0x07},
25 {"7.10.a", 0x08},
26 {"7.10.b", 0x09},
27 {"7.10.c", 0x0a},
28 {"7.10.d", 0x0b},
29 /* FIXME There is no keycode defined in MBV for these versions */
30 {"2.10.a", 0x10},
31 {"3.00.a", 0x20},
32 {"4.00.a", 0x30},
33 {"4.00.b", 0x40},
34 {NULL, 0},
35};
36
37/*
38 * FIXME Not sure if the actual key is defined by Xilinx in the PVR
39 */
40const struct family_string_key family_string_lookup[] = {
41 {"virtex2", 0x4},
42 {"virtex2pro", 0x5},
43 {"spartan3", 0x6},
44 {"virtex4", 0x7},
45 {"virtex5", 0x8},
46 {"spartan3e", 0x9},
47 {"spartan3a", 0xa},
48 {"spartan3an", 0xb},
49 {"spartan3adsp", 0xc},
50 /* FIXME There is no key code defined for spartan2 */
51 {"spartan2", 0xf0},
52 {NULL, 0},
53};
54
55struct cpuinfo cpuinfo;
56
57void __init setup_cpuinfo(void)
58{
59 struct device_node *cpu = NULL;
60
61 cpu = (struct device_node *) of_find_node_by_type(NULL, "cpu");
62 if (!cpu)
63 printk(KERN_ERR "You don't have cpu!!!\n");
64
65 printk(KERN_INFO "%s: initialising\n", __func__);
66
67 switch (cpu_has_pvr()) {
68 case 0:
69 printk(KERN_WARNING
70 "%s: No PVR support. Using static CPU info from FDT\n",
71 __func__);
72 set_cpuinfo_static(&cpuinfo, cpu);
73 break;
74/* FIXME I found weird behavior with MB 7.00.a/b
75 * please do not use FULL PVR with MMU */
76 case 1:
77 printk(KERN_INFO "%s: Using full CPU PVR support\n",
78 __func__);
79 set_cpuinfo_static(&cpuinfo, cpu);
80 set_cpuinfo_pvr_full(&cpuinfo, cpu);
81 break;
82 default:
83 printk(KERN_WARNING "%s: Unsupported PVR setting\n", __func__);
84 set_cpuinfo_static(&cpuinfo, cpu);
85 }
86}
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c
new file mode 100644
index 000000000000..3b6212bdc8dc
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/mb.c
@@ -0,0 +1,148 @@
1/*
2 * CPU-version specific code
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2006-2009 PetaLogix
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#include <linux/init.h>
13#include <linux/string.h>
14#include <linux/seq_file.h>
15#include <linux/cpu.h>
16#include <linux/initrd.h>
17
18#include <linux/bug.h>
19#include <asm/cpuinfo.h>
20#include <linux/delay.h>
21#include <linux/io.h>
22#include <asm/page.h>
23#include <linux/param.h>
24#include <asm/pvr.h>
25#include <asm/sections.h>
26#include <asm/setup.h>
27
28static int show_cpuinfo(struct seq_file *m, void *v)
29{
30 int count = 0;
31 char *fpga_family = "Unknown";
32 char *cpu_ver = "Unknown";
33 int i;
34
35 /* Denormalised to get the fpga family string */
36 for (i = 0; family_string_lookup[i].s != NULL; i++) {
37 if (cpuinfo.fpga_family_code == family_string_lookup[i].k) {
38 fpga_family = (char *)family_string_lookup[i].s;
39 break;
40 }
41 }
42
43 /* Denormalised to get the hw version string */
44 for (i = 0; cpu_ver_lookup[i].s != NULL; i++) {
45 if (cpuinfo.ver_code == cpu_ver_lookup[i].k) {
46 cpu_ver = (char *)cpu_ver_lookup[i].s;
47 break;
48 }
49 }
50
51 count = seq_printf(m,
52 "CPU-Family: MicroBlaze\n"
53 "FPGA-Arch: %s\n"
54 "CPU-Ver: %s\n"
55 "CPU-MHz: %d.%02d\n"
56 "BogoMips: %lu.%02lu\n",
57 fpga_family,
58 cpu_ver,
59 cpuinfo.cpu_clock_freq /
60 1000000,
61 cpuinfo.cpu_clock_freq %
62 1000000,
63 loops_per_jiffy / (500000 / HZ),
64 (loops_per_jiffy / (5000 / HZ)) % 100);
65
66 count += seq_printf(m,
67 "HW:\n Shift:\t\t%s\n"
68 " MSR:\t\t%s\n"
69 " PCMP:\t\t%s\n"
70 " DIV:\t\t%s\n",
71 (cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no",
72 (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no",
73 (cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no",
74 (cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no");
75
76 count += seq_printf(m,
77 " MMU:\t\t%x\n",
78 cpuinfo.mmu);
79
80 count += seq_printf(m,
81 " MUL:\t\t%s\n"
82 " FPU:\t\t%s\n",
83 (cpuinfo.use_mult & PVR2_USE_MUL64_MASK) ? "v2" :
84 (cpuinfo.use_mult & PVR0_USE_HW_MUL_MASK) ? "v1" : "no",
85 (cpuinfo.use_fpu & PVR2_USE_FPU2_MASK) ? "v2" :
86 (cpuinfo.use_fpu & PVR0_USE_FPU_MASK) ? "v1" : "no");
87
88 count += seq_printf(m,
89 " Exc:\t\t%s%s%s%s%s%s%s%s\n",
90 (cpuinfo.use_exc & PVR2_OPCODE_0x0_ILL_MASK) ? "op0x0 " : "",
91 (cpuinfo.use_exc & PVR2_UNALIGNED_EXC_MASK) ? "unal " : "",
92 (cpuinfo.use_exc & PVR2_ILL_OPCODE_EXC_MASK) ? "ill " : "",
93 (cpuinfo.use_exc & PVR2_IOPB_BUS_EXC_MASK) ? "iopb " : "",
94 (cpuinfo.use_exc & PVR2_DOPB_BUS_EXC_MASK) ? "dopb " : "",
95 (cpuinfo.use_exc & PVR2_DIV_ZERO_EXC_MASK) ? "zero " : "",
96 (cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "",
97 (cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : "");
98
99 if (cpuinfo.use_icache)
100 count += seq_printf(m,
101 "Icache:\t\t%ukB\n",
102 cpuinfo.icache_size >> 10);
103 else
104 count += seq_printf(m, "Icache:\t\tno\n");
105
106 if (cpuinfo.use_dcache)
107 count += seq_printf(m,
108 "Dcache:\t\t%ukB\n",
109 cpuinfo.dcache_size >> 10);
110 else
111 count += seq_printf(m, "Dcache:\t\tno\n");
112
113 count += seq_printf(m,
114 "HW-Debug:\t%s\n",
115 cpuinfo.hw_debug ? "yes" : "no");
116
117 count += seq_printf(m,
118 "PVR-USR1:\t%x\n"
119 "PVR-USR2:\t%x\n",
120 cpuinfo.pvr_user1,
121 cpuinfo.pvr_user2);
122
123 return 0;
124}
125
126static void *c_start(struct seq_file *m, loff_t *pos)
127{
128 int i = *pos;
129
130 return i < NR_CPUS ? (void *) (i + 1) : NULL;
131}
132
133static void *c_next(struct seq_file *m, void *v, loff_t *pos)
134{
135 ++*pos;
136 return c_start(m, pos);
137}
138
139static void c_stop(struct seq_file *m, void *v)
140{
141}
142
143const struct seq_operations cpuinfo_op = {
144 .start = c_start,
145 .next = c_next,
146 .stop = c_stop,
147 .show = show_cpuinfo,
148};
diff --git a/arch/microblaze/kernel/cpu/pvr.c b/arch/microblaze/kernel/cpu/pvr.c
new file mode 100644
index 000000000000..c9a4340ddd53
--- /dev/null
+++ b/arch/microblaze/kernel/cpu/pvr.c
@@ -0,0 +1,81 @@
1/*
2 * Support for MicroBlaze PVR (processor version register)
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/kernel.h>
14#include <linux/compiler.h>
15#include <asm/system.h>
16#include <asm/exceptions.h>
17#include <asm/pvr.h>
18
19/*
20 * Until we get an assembler that knows about the pvr registers,
21 * this horrible cruft will have to do.
22 * That hardcoded opcode is mfs r3, rpvrNN
23 */
24
25#define get_single_pvr(pvrid, val) \
26{ \
27 register unsigned tmp __asm__("r3"); \
28 tmp = 0x0; /* Prevent warning about unused */ \
29 __asm__ __volatile__ ( \
30 ".byte 0x94,0x60,0xa0, " #pvrid "\n\t" \
31 : "=r" (tmp) : : "memory"); \
32 val = tmp; \
33}
34
35/*
36 * Does the CPU support the PVR register?
37 * return value:
38 * 0: no PVR
39 * 1: simple PVR
40 * 2: full PVR
41 *
42 * This must work on all CPU versions, including those before the
43 * PVR was even an option.
44 */
45
46int cpu_has_pvr(void)
47{
48 unsigned flags;
49 unsigned pvr0;
50
51 local_save_flags(flags);
52
53 /* PVR bit in MSR tells us if there is any support */
54 if (!(flags & PVR_MSR_BIT))
55 return 0;
56
57 get_single_pvr(0x00, pvr0);
58 pr_debug("%s: pvr0 is 0x%08x\n", __func__, pvr0);
59
60 if (pvr0 & PVR0_PVR_FULL_MASK)
61 return 1;
62
63 /* for partial PVR use static cpuinfo */
64 return 2;
65}
66
67void get_pvr(struct pvr_s *p)
68{
69 get_single_pvr(0, p->pvr[0]);
70 get_single_pvr(1, p->pvr[1]);
71 get_single_pvr(2, p->pvr[2]);
72 get_single_pvr(3, p->pvr[3]);
73 get_single_pvr(4, p->pvr[4]);
74 get_single_pvr(5, p->pvr[5]);
75 get_single_pvr(6, p->pvr[6]);
76 get_single_pvr(7, p->pvr[7]);
77 get_single_pvr(8, p->pvr[8]);
78 get_single_pvr(9, p->pvr[9]);
79 get_single_pvr(10, p->pvr[10]);
80 get_single_pvr(11, p->pvr[11]);
81}
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c
new file mode 100644
index 000000000000..62cc78993f44
--- /dev/null
+++ b/arch/microblaze/kernel/early_printk.c
@@ -0,0 +1,107 @@
1/*
2 * Early printk support for Microblaze.
3 *
4 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2003-2006 Yasushi SHOJI <yashi@atmark-techno.com>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/console.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/string.h>
17#include <linux/tty.h>
18#include <linux/io.h>
19#include <asm/processor.h>
20#include <linux/fcntl.h>
21#include <asm/setup.h>
22#include <asm/prom.h>
23
24static u32 early_console_initialized;
25static u32 base_addr;
26
27static void early_printk_putc(char c)
28{
29 /*
30 * Limit how many times we'll spin waiting for TX FIFO status.
31 * This will prevent lockups if the base address is incorrectly
32 * set, or any other issue on the UARTLITE.
33 * This limit is pretty arbitrary, unless we are at about 10 baud
34 * we'll never timeout on a working UART.
35 */
36
37 unsigned retries = 10000;
38 /* read status bit - 0x8 offset */
39 while (retries-- && (in_be32(base_addr + 8) & (1 << 3)))
40 ;
41
42 /* Only attempt the iowrite if we didn't timeout */
43 /* write to TX_FIFO - 0x4 offset */
44 if (retries)
45 out_be32(base_addr + 4, c & 0xff);
46}
47
48static void early_printk_write(struct console *unused,
49 const char *s, unsigned n)
50{
51 while (*s && n-- > 0) {
52 early_printk_putc(*s);
53 if (*s == '\n')
54 early_printk_putc('\r');
55 s++;
56 }
57}
58
59static struct console early_serial_console = {
60 .name = "earlyser",
61 .write = early_printk_write,
62 .flags = CON_PRINTBUFFER,
63 .index = -1,
64};
65
66static struct console *early_console = &early_serial_console;
67
68void early_printk(const char *fmt, ...)
69{
70 char buf[512];
71 int n;
72 va_list ap;
73
74 if (early_console_initialized) {
75 va_start(ap, fmt);
76 n = vscnprintf(buf, 512, fmt, ap);
77 early_console->write(early_console, buf, n);
78 va_end(ap);
79 }
80}
81
82int __init setup_early_printk(char *opt)
83{
84 if (early_console_initialized)
85 return 1;
86
87 base_addr = early_uartlite_console();
88 if (base_addr) {
89 early_console_initialized = 1;
90 early_printk("early_printk_console is enabled at 0x%08x\n",
91 base_addr);
92
93 /* register_console(early_console); */
94
95 return 0;
96 } else
97 return 1;
98}
99
100void __init disable_early_printk(void)
101{
102 if (!early_console_initialized || !early_console)
103 return;
104 printk(KERN_WARNING "disabling early console\n");
105 unregister_console(early_console);
106 early_console_initialized = 0;
107}
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S
new file mode 100644
index 000000000000..f24b1268baaf
--- /dev/null
+++ b/arch/microblaze/kernel/entry-nommu.S
@@ -0,0 +1,596 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/linkage.h>
12#include <asm/thread_info.h>
13#include <asm/errno.h>
14#include <asm/entry.h>
15#include <asm/asm-offsets.h>
16#include <asm/registers.h>
17#include <asm/unistd.h>
18#include <asm/percpu.h>
19#include <asm/signal.h>
20
21#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
22 .macro disable_irq
23 msrclr r0, MSR_IE
24 .endm
25
26 .macro enable_irq
27 msrset r0, MSR_IE
28 .endm
29
30 .macro clear_bip
31 msrclr r0, MSR_BIP
32 .endm
33#else
34 .macro disable_irq
35 mfs r11, rmsr
36 andi r11, r11, ~MSR_IE
37 mts rmsr, r11
38 .endm
39
40 .macro enable_irq
41 mfs r11, rmsr
42 ori r11, r11, MSR_IE
43 mts rmsr, r11
44 .endm
45
46 .macro clear_bip
47 mfs r11, rmsr
48 andi r11, r11, ~MSR_BIP
49 mts rmsr, r11
50 .endm
51#endif
52
53ENTRY(_interrupt)
54 swi r1, r0, PER_CPU(ENTRY_SP) /* save the current sp */
55 swi r11, r0, PER_CPU(R11_SAVE) /* temporarily save r11 */
56 lwi r11, r0, PER_CPU(KM) /* load mode indicator */
57 beqid r11, 1f
58 nop
59 brid 2f /* jump over */
60 addik r1, r1, (-PT_SIZE) /* room for pt_regs (delay slot) */
611: /* switch to kernel stack */
62 lwi r1, r0, PER_CPU(CURRENT_SAVE) /* get the saved current */
63 lwi r1, r1, TS_THREAD_INFO /* get the thread info */
64 /* calculate kernel stack pointer */
65 addik r1, r1, THREAD_SIZE - PT_SIZE
662:
67 swi r11, r1, PT_MODE /* store the mode */
68 lwi r11, r0, PER_CPU(R11_SAVE) /* reload r11 */
69 swi r2, r1, PT_R2
70 swi r3, r1, PT_R3
71 swi r4, r1, PT_R4
72 swi r5, r1, PT_R5
73 swi r6, r1, PT_R6
74 swi r7, r1, PT_R7
75 swi r8, r1, PT_R8
76 swi r9, r1, PT_R9
77 swi r10, r1, PT_R10
78 swi r11, r1, PT_R11
79 swi r12, r1, PT_R12
80 swi r13, r1, PT_R13
81 swi r14, r1, PT_R14
82 swi r14, r1, PT_PC
83 swi r15, r1, PT_R15
84 swi r16, r1, PT_R16
85 swi r17, r1, PT_R17
86 swi r18, r1, PT_R18
87 swi r19, r1, PT_R19
88 swi r20, r1, PT_R20
89 swi r21, r1, PT_R21
90 swi r22, r1, PT_R22
91 swi r23, r1, PT_R23
92 swi r24, r1, PT_R24
93 swi r25, r1, PT_R25
94 swi r26, r1, PT_R26
95 swi r27, r1, PT_R27
96 swi r28, r1, PT_R28
97 swi r29, r1, PT_R29
98 swi r30, r1, PT_R30
99 swi r31, r1, PT_R31
100 /* special purpose registers */
101 mfs r11, rmsr
102 swi r11, r1, PT_MSR
103 mfs r11, rear
104 swi r11, r1, PT_EAR
105 mfs r11, resr
106 swi r11, r1, PT_ESR
107 mfs r11, rfsr
108 swi r11, r1, PT_FSR
109 /* reload original stack pointer and save it */
110 lwi r11, r0, PER_CPU(ENTRY_SP)
111 swi r11, r1, PT_R1
112 /* update mode indicator we are in kernel mode */
113 addik r11, r0, 1
114 swi r11, r0, PER_CPU(KM)
115 /* restore r31 */
116 lwi r31, r0, PER_CPU(CURRENT_SAVE)
117 /* prepare the link register, the argument and jump */
118 la r15, r0, ret_from_intr - 8
119 addk r6, r0, r15
120 braid do_IRQ
121 add r5, r0, r1
122
123ret_from_intr:
124 lwi r11, r1, PT_MODE
125 bneid r11, 3f
126
127 lwi r6, r31, TS_THREAD_INFO /* get thread info */
128 lwi r19, r6, TI_FLAGS /* get flags in thread info */
129 /* do an extra work if any bits are set */
130
131 andi r11, r19, _TIF_NEED_RESCHED
132 beqi r11, 1f
133 bralid r15, schedule
134 nop
1351: andi r11, r19, _TIF_SIGPENDING
136 beqid r11, no_intr_reshed
137 addk r5, r1, r0
138 addk r7, r0, r0
139 bralid r15, do_signal
140 addk r6, r0, r0
141
142no_intr_reshed:
143 /* save mode indicator */
144 lwi r11, r1, PT_MODE
1453:
146 swi r11, r0, PER_CPU(KM)
147
148 /* save r31 */
149 swi r31, r0, PER_CPU(CURRENT_SAVE)
150restore_context:
151 /* special purpose registers */
152 lwi r11, r1, PT_FSR
153 mts rfsr, r11
154 lwi r11, r1, PT_ESR
155 mts resr, r11
156 lwi r11, r1, PT_EAR
157 mts rear, r11
158 lwi r11, r1, PT_MSR
159 mts rmsr, r11
160
161 lwi r31, r1, PT_R31
162 lwi r30, r1, PT_R30
163 lwi r29, r1, PT_R29
164 lwi r28, r1, PT_R28
165 lwi r27, r1, PT_R27
166 lwi r26, r1, PT_R26
167 lwi r25, r1, PT_R25
168 lwi r24, r1, PT_R24
169 lwi r23, r1, PT_R23
170 lwi r22, r1, PT_R22
171 lwi r21, r1, PT_R21
172 lwi r20, r1, PT_R20
173 lwi r19, r1, PT_R19
174 lwi r18, r1, PT_R18
175 lwi r17, r1, PT_R17
176 lwi r16, r1, PT_R16
177 lwi r15, r1, PT_R15
178 lwi r14, r1, PT_PC
179 lwi r13, r1, PT_R13
180 lwi r12, r1, PT_R12
181 lwi r11, r1, PT_R11
182 lwi r10, r1, PT_R10
183 lwi r9, r1, PT_R9
184 lwi r8, r1, PT_R8
185 lwi r7, r1, PT_R7
186 lwi r6, r1, PT_R6
187 lwi r5, r1, PT_R5
188 lwi r4, r1, PT_R4
189 lwi r3, r1, PT_R3
190 lwi r2, r1, PT_R2
191 lwi r1, r1, PT_R1
192 rtid r14, 0
193 nop
194
195ENTRY(_reset)
196 brai 0;
197
198ENTRY(_user_exception)
199 swi r1, r0, PER_CPU(ENTRY_SP) /* save the current sp */
200 swi r11, r0, PER_CPU(R11_SAVE) /* temporarily save r11 */
201 lwi r11, r0, PER_CPU(KM) /* load mode indicator */
202 beqid r11, 1f /* Already in kernel mode? */
203 nop
204 brid 2f /* jump over */
205 addik r1, r1, (-PT_SIZE) /* Room for pt_regs (delay slot) */
2061: /* Switch to kernel stack */
207 lwi r1, r0, PER_CPU(CURRENT_SAVE) /* get the saved current */
208 lwi r1, r1, TS_THREAD_INFO /* get the thread info */
209 /* calculate kernel stack pointer */
210 addik r1, r1, THREAD_SIZE - PT_SIZE
211 swi r11, r0, PER_CPU(R11_SAVE) /* temporarily save r11 */
212 lwi r11, r0, PER_CPU(KM) /* load mode indicator */
2132:
214 swi r11, r1, PT_MODE /* store the mode */
215 lwi r11, r0, PER_CPU(R11_SAVE) /* reload r11 */
216 /* save them on stack */
217 swi r2, r1, PT_R2
218 swi r3, r1, PT_R3 /* r3: _always_ in clobber list; see unistd.h */
219 swi r4, r1, PT_R4 /* r4: _always_ in clobber list; see unistd.h */
220 swi r5, r1, PT_R5
221 swi r6, r1, PT_R6
222 swi r7, r1, PT_R7
223 swi r8, r1, PT_R8
224 swi r9, r1, PT_R9
225 swi r10, r1, PT_R10
226 swi r11, r1, PT_R11
227 /* r12: _always_ in clobber list; see unistd.h */
228 swi r12, r1, PT_R12
229 swi r13, r1, PT_R13
230 /* r14: _always_ in clobber list; see unistd.h */
231 swi r14, r1, PT_R14
232 /* but we want to return to the next inst. */
233 addik r14, r14, 0x4
234 swi r14, r1, PT_PC /* increment by 4 and store in pc */
235 swi r15, r1, PT_R15
236 swi r16, r1, PT_R16
237 swi r17, r1, PT_R17
238 swi r18, r1, PT_R18
239 swi r19, r1, PT_R19
240 swi r20, r1, PT_R20
241 swi r21, r1, PT_R21
242 swi r22, r1, PT_R22
243 swi r23, r1, PT_R23
244 swi r24, r1, PT_R24
245 swi r25, r1, PT_R25
246 swi r26, r1, PT_R26
247 swi r27, r1, PT_R27
248 swi r28, r1, PT_R28
249 swi r29, r1, PT_R29
250 swi r30, r1, PT_R30
251 swi r31, r1, PT_R31
252
253 disable_irq
254 nop /* make sure IE bit is in effect */
255 clear_bip /* once IE is in effect it is safe to clear BIP */
256 nop
257
258 /* special purpose registers */
259 mfs r11, rmsr
260 swi r11, r1, PT_MSR
261 mfs r11, rear
262 swi r11, r1, PT_EAR
263 mfs r11, resr
264 swi r11, r1, PT_ESR
265 mfs r11, rfsr
266 swi r11, r1, PT_FSR
267 /* reload original stack pointer and save it */
268 lwi r11, r0, PER_CPU(ENTRY_SP)
269 swi r11, r1, PT_R1
270 /* update mode indicator we are in kernel mode */
271 addik r11, r0, 1
272 swi r11, r0, PER_CPU(KM)
273 /* restore r31 */
274 lwi r31, r0, PER_CPU(CURRENT_SAVE)
275 /* re-enable interrupts now we are in kernel mode */
276 enable_irq
277
278 /* See if the system call number is valid. */
279 addi r11, r12, -__NR_syscalls
280 bgei r11, 1f /* return to user if not valid */
281 /* Figure out which function to use for this system call. */
282 /* Note Microblaze barrel shift is optional, so don't rely on it */
283 add r12, r12, r12 /* convert num -> ptr */
284 add r12, r12, r12
285 lwi r12, r12, sys_call_table /* Get function pointer */
286 la r15, r0, ret_to_user-8 /* set return address */
287 bra r12 /* Make the system call. */
288 bri 0 /* won't reach here */
2891:
290 brid ret_to_user /* jump to syscall epilogue */
291 addi r3, r0, -ENOSYS /* set errno in delay slot */
292
293/*
294 * Debug traps are like a system call, but entered via brki r14, 0x60
295 * All we need to do is send the SIGTRAP signal to current, ptrace and do_signal
296 * will handle the rest
297 */
298ENTRY(_debug_exception)
299 swi r1, r0, PER_CPU(ENTRY_SP) /* save the current sp */
300 lwi r1, r0, PER_CPU(CURRENT_SAVE) /* get the saved current */
301 lwi r1, r1, TS_THREAD_INFO /* get the thread info */
302 addik r1, r1, THREAD_SIZE - PT_SIZE /* get the kernel stack */
303 swi r11, r0, PER_CPU(R11_SAVE) /* temporarily save r11 */
304 lwi r11, r0, PER_CPU(KM) /* load mode indicator */
305//save_context:
306 swi r11, r1, PT_MODE /* store the mode */
307 lwi r11, r0, PER_CPU(R11_SAVE) /* reload r11 */
308 /* save them on stack */
309 swi r2, r1, PT_R2
310 swi r3, r1, PT_R3 /* r3: _always_ in clobber list; see unistd.h */
311 swi r4, r1, PT_R4 /* r4: _always_ in clobber list; see unistd.h */
312 swi r5, r1, PT_R5
313 swi r6, r1, PT_R6
314 swi r7, r1, PT_R7
315 swi r8, r1, PT_R8
316 swi r9, r1, PT_R9
317 swi r10, r1, PT_R10
318 swi r11, r1, PT_R11
319 /* r12: _always_ in clobber list; see unistd.h */
320 swi r12, r1, PT_R12
321 swi r13, r1, PT_R13
322 /* r14: _always_ in clobber list; see unistd.h */
323 swi r14, r1, PT_R14
324 swi r14, r1, PT_PC /* Will return to interrupted instruction */
325 swi r15, r1, PT_R15
326 swi r16, r1, PT_R16
327 swi r17, r1, PT_R17
328 swi r18, r1, PT_R18
329 swi r19, r1, PT_R19
330 swi r20, r1, PT_R20
331 swi r21, r1, PT_R21
332 swi r22, r1, PT_R22
333 swi r23, r1, PT_R23
334 swi r24, r1, PT_R24
335 swi r25, r1, PT_R25
336 swi r26, r1, PT_R26
337 swi r27, r1, PT_R27
338 swi r28, r1, PT_R28
339 swi r29, r1, PT_R29
340 swi r30, r1, PT_R30
341 swi r31, r1, PT_R31
342
343 disable_irq
344 nop /* make sure IE bit is in effect */
345 clear_bip /* once IE is in effect it is safe to clear BIP */
346 nop
347
348 /* special purpose registers */
349 mfs r11, rmsr
350 swi r11, r1, PT_MSR
351 mfs r11, rear
352 swi r11, r1, PT_EAR
353 mfs r11, resr
354 swi r11, r1, PT_ESR
355 mfs r11, rfsr
356 swi r11, r1, PT_FSR
357 /* reload original stack pointer and save it */
358 lwi r11, r0, PER_CPU(ENTRY_SP)
359 swi r11, r1, PT_R1
360 /* update mode indicator we are in kernel mode */
361 addik r11, r0, 1
362 swi r11, r0, PER_CPU(KM)
363 /* restore r31 */
364 lwi r31, r0, PER_CPU(CURRENT_SAVE)
365 /* re-enable interrupts now we are in kernel mode */
366 enable_irq
367
368 addi r5, r0, SIGTRAP /* sending the trap signal */
369 add r6, r0, r31 /* to current */
370 bralid r15, send_sig
371 add r7, r0, r0 /* 3rd param zero */
372
373 /* Restore r3/r4 to work around how ret_to_user works */
374 lwi r3, r1, PT_R3
375 lwi r4, r1, PT_R4
376 bri ret_to_user
377
378ENTRY(_break)
379 bri 0
380
381/* struct task_struct *_switch_to(struct thread_info *prev,
382 struct thread_info *next); */
383ENTRY(_switch_to)
384 /* prepare return value */
385 addk r3, r0, r31
386
387 /* save registers in cpu_context */
388 /* use r11 and r12, volatile registers, as temp register */
389 addik r11, r5, TI_CPU_CONTEXT
390 swi r1, r11, CC_R1
391 swi r2, r11, CC_R2
392 /* skip volatile registers.
393 * they are saved on stack when we jumped to _switch_to() */
394 /* dedicated registers */
395 swi r13, r11, CC_R13
396 swi r14, r11, CC_R14
397 swi r15, r11, CC_R15
398 swi r16, r11, CC_R16
399 swi r17, r11, CC_R17
400 swi r18, r11, CC_R18
401 /* save non-volatile registers */
402 swi r19, r11, CC_R19
403 swi r20, r11, CC_R20
404 swi r21, r11, CC_R21
405 swi r22, r11, CC_R22
406 swi r23, r11, CC_R23
407 swi r24, r11, CC_R24
408 swi r25, r11, CC_R25
409 swi r26, r11, CC_R26
410 swi r27, r11, CC_R27
411 swi r28, r11, CC_R28
412 swi r29, r11, CC_R29
413 swi r30, r11, CC_R30
414 /* special purpose registers */
415 mfs r12, rmsr
416 swi r12, r11, CC_MSR
417 mfs r12, rear
418 swi r12, r11, CC_EAR
419 mfs r12, resr
420 swi r12, r11, CC_ESR
421 mfs r12, rfsr
422 swi r12, r11, CC_FSR
423
424 /* update r31, the current */
425 lwi r31, r6, TI_TASK
426 swi r31, r0, PER_CPU(CURRENT_SAVE)
427
428 /* get new process' cpu context and restore */
429 addik r11, r6, TI_CPU_CONTEXT
430
431 /* special purpose registers */
432 lwi r12, r11, CC_FSR
433 mts rfsr, r12
434 lwi r12, r11, CC_ESR
435 mts resr, r12
436 lwi r12, r11, CC_EAR
437 mts rear, r12
438 lwi r12, r11, CC_MSR
439 mts rmsr, r12
440 /* non-volatile registers */
441 lwi r30, r11, CC_R30
442 lwi r29, r11, CC_R29
443 lwi r28, r11, CC_R28
444 lwi r27, r11, CC_R27
445 lwi r26, r11, CC_R26
446 lwi r25, r11, CC_R25
447 lwi r24, r11, CC_R24
448 lwi r23, r11, CC_R23
449 lwi r22, r11, CC_R22
450 lwi r21, r11, CC_R21
451 lwi r20, r11, CC_R20
452 lwi r19, r11, CC_R19
453 /* dedicated registers */
454 lwi r18, r11, CC_R18
455 lwi r17, r11, CC_R17
456 lwi r16, r11, CC_R16
457 lwi r15, r11, CC_R15
458 lwi r14, r11, CC_R14
459 lwi r13, r11, CC_R13
460 /* skip volatile registers */
461 lwi r2, r11, CC_R2
462 lwi r1, r11, CC_R1
463
464 rtsd r15, 8
465 nop
466
467ENTRY(ret_from_fork)
468 addk r5, r0, r3
469 addk r6, r0, r1
470 brlid r15, schedule_tail
471 nop
472 swi r31, r1, PT_R31 /* save r31 in user context. */
473 /* will soon be restored to r31 in ret_to_user */
474 addk r3, r0, r0
475 brid ret_to_user
476 nop
477
478work_pending:
479 andi r11, r19, _TIF_NEED_RESCHED
480 beqi r11, 1f
481 bralid r15, schedule
482 nop
4831: andi r11, r19, _TIF_SIGPENDING
484 beqi r11, no_work_pending
485 addk r5, r1, r0
486 addik r7, r0, 1
487 bralid r15, do_signal
488 addk r6, r0, r0
489 bri no_work_pending
490
491ENTRY(ret_to_user)
492 disable_irq
493
494 swi r4, r1, PT_R4 /* return val */
495 swi r3, r1, PT_R3 /* return val */
496
497 lwi r6, r31, TS_THREAD_INFO /* get thread info */
498 lwi r19, r6, TI_FLAGS /* get flags in thread info */
499 bnei r19, work_pending /* do an extra work if any bits are set */
500no_work_pending:
501 disable_irq
502
503 /* save r31 */
504 swi r31, r0, PER_CPU(CURRENT_SAVE)
505 /* save mode indicator */
506 lwi r18, r1, PT_MODE
507 swi r18, r0, PER_CPU(KM)
508//restore_context:
509 /* special purpose registers */
510 lwi r18, r1, PT_FSR
511 mts rfsr, r18
512 lwi r18, r1, PT_ESR
513 mts resr, r18
514 lwi r18, r1, PT_EAR
515 mts rear, r18
516 lwi r18, r1, PT_MSR
517 mts rmsr, r18
518
519 lwi r31, r1, PT_R31
520 lwi r30, r1, PT_R30
521 lwi r29, r1, PT_R29
522 lwi r28, r1, PT_R28
523 lwi r27, r1, PT_R27
524 lwi r26, r1, PT_R26
525 lwi r25, r1, PT_R25
526 lwi r24, r1, PT_R24
527 lwi r23, r1, PT_R23
528 lwi r22, r1, PT_R22
529 lwi r21, r1, PT_R21
530 lwi r20, r1, PT_R20
531 lwi r19, r1, PT_R19
532 lwi r18, r1, PT_R18
533 lwi r17, r1, PT_R17
534 lwi r16, r1, PT_R16
535 lwi r15, r1, PT_R15
536 lwi r14, r1, PT_PC
537 lwi r13, r1, PT_R13
538 lwi r12, r1, PT_R12
539 lwi r11, r1, PT_R11
540 lwi r10, r1, PT_R10
541 lwi r9, r1, PT_R9
542 lwi r8, r1, PT_R8
543 lwi r7, r1, PT_R7
544 lwi r6, r1, PT_R6
545 lwi r5, r1, PT_R5
546 lwi r4, r1, PT_R4 /* return val */
547 lwi r3, r1, PT_R3 /* return val */
548 lwi r2, r1, PT_R2
549 lwi r1, r1, PT_R1
550
551 rtid r14, 0
552 nop
553
554sys_vfork_wrapper:
555 brid sys_vfork
556 addk r5, r1, r0
557
558sys_clone_wrapper:
559 brid sys_clone
560 addk r7, r1, r0
561
562sys_execve_wrapper:
563 brid sys_execve
564 addk r8, r1, r0
565
566sys_sigreturn_wrapper:
567 brid sys_sigreturn
568 addk r5, r1, r0
569
570sys_rt_sigreturn_wrapper:
571 brid sys_rt_sigreturn
572 addk r5, r1, r0
573
574sys_sigsuspend_wrapper:
575 brid sys_rt_sigsuspend
576 addk r6, r1, r0
577
578sys_rt_sigsuspend_wrapper:
579 brid sys_rt_sigsuspend
580 addk r7, r1, r0
581
582 /* Interrupt vector table */
583 .section .init.ivt, "ax"
584 .org 0x0
585 brai _reset
586 brai _user_exception
587 brai _interrupt
588 brai _break
589 brai _hw_exception_handler
590 .org 0x60
591 brai _debug_exception
592
593.section .rodata,"a"
594#include "syscall_table.S"
595
596syscall_table_size=(.-sys_call_table)
diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c
new file mode 100644
index 000000000000..4a8a4064c7ee
--- /dev/null
+++ b/arch/microblaze/kernel/exceptions.c
@@ -0,0 +1,124 @@
1/*
2 * HW exception handling
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008 PetaLogix
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
10 */
11
12/*
13 * This file handles the architecture-dependent parts of hardware exceptions
14 */
15
16#include <linux/kernel.h>
17#include <linux/signal.h>
18#include <linux/sched.h>
19#include <linux/kallsyms.h>
20#include <linux/module.h>
21
22#include <asm/exceptions.h>
23#include <asm/entry.h> /* For KM CPU var */
24#include <asm/uaccess.h>
25#include <asm/errno.h>
26#include <asm/ptrace.h>
27#include <asm/current.h>
28
29#define MICROBLAZE_ILL_OPCODE_EXCEPTION 0x02
30#define MICROBLAZE_IBUS_EXCEPTION 0x03
31#define MICROBLAZE_DBUS_EXCEPTION 0x04
32#define MICROBLAZE_DIV_ZERO_EXCEPTION 0x05
33#define MICROBLAZE_FPU_EXCEPTION 0x06
34#define MICROBLAZE_PRIVILEG_EXCEPTION 0x07
35
36static DEFINE_SPINLOCK(die_lock);
37
38void die(const char *str, struct pt_regs *fp, long err)
39{
40 console_verbose();
41 spin_lock_irq(&die_lock);
42 printk(KERN_WARNING "Oops: %s, sig: %ld\n", str, err);
43 show_regs(fp);
44 spin_unlock_irq(&die_lock);
45 /* do_exit() should take care of panic'ing from an interrupt
46 * context so we don't handle it here
47 */
48 do_exit(err);
49}
50
51void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
52{
53 siginfo_t info;
54
55 if (kernel_mode(regs)) {
56 debugger(regs);
57 die("Exception in kernel mode", regs, signr);
58 }
59 info.si_signo = signr;
60 info.si_errno = 0;
61 info.si_code = code;
62 info.si_addr = (void __user *) addr;
63 force_sig_info(signr, &info, current);
64}
65
66asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
67 int fsr, int addr)
68{
69#if 0
70 printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n",
71 type, user_mode(regs) ? "user" : "kernel", fsr,
72 (unsigned int) regs->pc, (unsigned int) regs->esr);
73#endif
74
75 switch (type & 0x1F) {
76 case MICROBLAZE_ILL_OPCODE_EXCEPTION:
77 _exception(SIGILL, regs, ILL_ILLOPC, addr);
78 break;
79 case MICROBLAZE_IBUS_EXCEPTION:
80 if (user_mode(regs)) {
81 printk(KERN_WARNING "Instruction bus error exception in user mode.\n");
82 _exception(SIGBUS, regs, BUS_ADRERR, addr);
83 return;
84 }
85 printk(KERN_WARNING "Instruction bus error exception in kernel mode.\n");
86 die("bus exception", regs, SIGBUS);
87 break;
88 case MICROBLAZE_DBUS_EXCEPTION:
89 if (user_mode(regs)) {
90 printk(KERN_WARNING "Data bus error exception in user mode.\n");
91 _exception(SIGBUS, regs, BUS_ADRERR, addr);
92 return;
93 }
94 printk(KERN_WARNING "Data bus error exception in kernel mode.\n");
95 die("bus exception", regs, SIGBUS);
96 break;
97 case MICROBLAZE_DIV_ZERO_EXCEPTION:
98 printk(KERN_WARNING "Divide by zero exception\n");
99 _exception(SIGILL, regs, ILL_ILLOPC, addr);
100 break;
101
102 case MICROBLAZE_FPU_EXCEPTION:
103 /* IEEE FP exception */
104 /* I removed fsr variable and use code var for storing fsr */
105 if (fsr & FSR_IO)
106 fsr = FPE_FLTINV;
107 else if (fsr & FSR_OF)
108 fsr = FPE_FLTOVF;
109 else if (fsr & FSR_UF)
110 fsr = FPE_FLTUND;
111 else if (fsr & FSR_DZ)
112 fsr = FPE_FLTDIV;
113 else if (fsr & FSR_DO)
114 fsr = FPE_FLTRES;
115 _exception(SIGFPE, regs, fsr, addr);
116 break;
117
118 default:
119 printk(KERN_WARNING "Unexpected exception %02x "
120 "PC=%08x in %s mode\n", type, (unsigned int) addr,
121 kernel_mode(regs) ? "kernel" : "user");
122 }
123 return;
124}
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
new file mode 100644
index 000000000000..319dc35fc922
--- /dev/null
+++ b/arch/microblaze/kernel/head.S
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/linkage.h>
12#include <asm/thread_info.h>
13#include <asm/page.h>
14
15 .text
16ENTRY(_start)
17 mfs r1, rmsr
18 andi r1, r1, ~2
19 mts rmsr, r1
20
21/* save fdt to kernel location */
22/* r7 stores pointer to fdt blob */
23 beqi r7, no_fdt_arg
24 or r11, r0, r0 /* incremment */
25 ori r4, r0, TOPHYS(_fdt_start) /* save bram context */
26 ori r3, r0, (0x4000 - 4)
27_copy_fdt:
28 lw r12, r7, r11 /* r12 = r7 + r11 */
29 sw r12, r4, r11 /* addr[r4 + r11] = r12 */
30 addik r11, r11, 4 /* increment counting */
31 bgtid r3, _copy_fdt /* loop for all entries */
32 addik r3, r3, -4 /* descrement loop */
33no_fdt_arg:
34
35 /* Initialize small data anchors */
36 la r13, r0, _KERNEL_SDA_BASE_
37 la r2, r0, _KERNEL_SDA2_BASE_
38
39 /* Initialize stack pointer */
40 la r1, r0, init_thread_union + THREAD_SIZE - 4
41
42 /* Initialize r31 with current task address */
43 la r31, r0, init_task
44
45 /*
46 * Call platform dependent initialize function.
47 * Please see $(ARCH)/mach-$(SUBARCH)/setup.c for
48 * the function.
49 */
50 la r8, r0, machine_early_init
51 brald r15, r8
52 nop
53
54 la r15, r0, machine_halt
55 braid start_kernel
56 nop
diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c
new file mode 100644
index 000000000000..1bdf20222b92
--- /dev/null
+++ b/arch/microblaze/kernel/heartbeat.c
@@ -0,0 +1,67 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/sched.h>
12#include <linux/io.h>
13
14#include <asm/setup.h>
15#include <asm/page.h>
16#include <asm/prom.h>
17
18static unsigned int base_addr;
19
20void heartbeat(void)
21{
22 static unsigned int cnt, period, dist;
23
24 if (base_addr) {
25 if (cnt == 0 || cnt == dist)
26 out_be32(base_addr, 1);
27 else if (cnt == 7 || cnt == dist + 7)
28 out_be32(base_addr, 0);
29
30 if (++cnt > period) {
31 cnt = 0;
32 /*
33 * The hyperbolic function below modifies the heartbeat
34 * period length in dependency of the current (5min)
35 * load. It goes through the points f(0)=126, f(1)=86,
36 * f(5)=51, f(inf)->30.
37 */
38 period = ((672 << FSHIFT) / (5 * avenrun[0] +
39 (7 << FSHIFT))) + 30;
40 dist = period / 4;
41 }
42 }
43}
44
45void setup_heartbeat(void)
46{
47 struct device_node *gpio = NULL;
48 int j;
49 char *gpio_list[] = {
50 "xlnx,xps-gpio-1.00.a",
51 "xlnx,opb-gpio-1.00.a",
52 NULL
53 };
54
55 for (j = 0; gpio_list[j] != NULL; j++) {
56 gpio = of_find_compatible_node(NULL, NULL, gpio_list[j]);
57 if (gpio)
58 break;
59 }
60
61 base_addr = *(int *) of_get_property(gpio, "reg", NULL);
62 base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE);
63 printk(KERN_NOTICE "Heartbeat GPIO at 0x%x\n", base_addr);
64
65 if (*(int *) of_get_property(gpio, "xlnx,is-bidir", NULL))
66 out_be32(base_addr + 4, 0); /* GPIO is configured as output */
67}
diff --git a/arch/microblaze/kernel/hw_exception_handler.S b/arch/microblaze/kernel/hw_exception_handler.S
new file mode 100644
index 000000000000..cf9486d99838
--- /dev/null
+++ b/arch/microblaze/kernel/hw_exception_handler.S
@@ -0,0 +1,458 @@
1/*
2 * Exception handling for Microblaze
3 *
4 * Rewriten interrupt handling
5 *
6 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
7 * Copyright (C) 2008-2009 PetaLogix
8 *
9 * uClinux customisation (C) 2005 John Williams
10 *
11 * MMU code derived from arch/ppc/kernel/head_4xx.S:
12 * Copyright (C) 1995-1996 Gary Thomas <gdt@linuxppc.org>
13 * Initial PowerPC version.
14 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
15 * Rewritten for PReP
16 * Copyright (C) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
17 * Low-level exception handers, MMU support, and rewrite.
18 * Copyright (C) 1997 Dan Malek <dmalek@jlc.net>
19 * PowerPC 8xx modifications.
20 * Copyright (C) 1998-1999 TiVo, Inc.
21 * PowerPC 403GCX modifications.
22 * Copyright (C) 1999 Grant Erickson <grant@lcse.umn.edu>
23 * PowerPC 403GCX/405GP modifications.
24 * Copyright 2000 MontaVista Software Inc.
25 * PPC405 modifications
26 * PowerPC 403GCX/405GP modifications.
27 * Author: MontaVista Software, Inc.
28 * frank_rowand@mvista.com or source@mvista.com
29 * debbie_chu@mvista.com
30 *
31 * Original code
32 * Copyright (C) 2004 Xilinx, Inc.
33 *
34 * This program is free software; you can redistribute it and/or modify it
35 * under the terms of the GNU General Public License version 2 as published
36 * by the Free Software Foundation.
37 */
38
39/*
40 * Here are the handlers which don't require enabling translation
41 * and calling other kernel code thus we can keep their design very simple
42 * and do all processing in real mode. All what they need is a valid current
43 * (that is an issue for the CONFIG_REGISTER_TASK_PTR case)
44 * This handlers use r3,r4,r5,r6 and optionally r[current] to work therefore
45 * these registers are saved/restored
46 * The handlers which require translation are in entry.S --KAA
47 *
48 * Microblaze HW Exception Handler
49 * - Non self-modifying exception handler for the following exception conditions
50 * - Unalignment
51 * - Instruction bus error
52 * - Data bus error
53 * - Illegal instruction opcode
54 * - Divide-by-zero
55 *
56 * Note we disable interrupts during exception handling, otherwise we will
57 * possibly get multiple re-entrancy if interrupt handles themselves cause
58 * exceptions. JW
59 */
60
61#include <asm/exceptions.h>
62#include <asm/unistd.h>
63#include <asm/page.h>
64
65#include <asm/entry.h>
66#include <asm/current.h>
67#include <linux/linkage.h>
68
69#include <asm/mmu.h>
70#include <asm/pgtable.h>
71#include <asm/asm-offsets.h>
72
73/* Helpful Macros */
74#define EX_HANDLER_STACK_SIZ (4*19)
75#define NUM_TO_REG(num) r ## num
76
77#define LWREG_NOP \
78 bri ex_handler_unhandled; \
79 nop;
80
81#define SWREG_NOP \
82 bri ex_handler_unhandled; \
83 nop;
84
85/* FIXME this is weird - for noMMU kernel is not possible to use brid
86 * instruction which can shorten executed time
87 */
88
89/* r3 is the source */
90#define R3_TO_LWREG_V(regnum) \
91 swi r3, r1, 4 * regnum; \
92 bri ex_handler_done;
93
94/* r3 is the source */
95#define R3_TO_LWREG(regnum) \
96 or NUM_TO_REG (regnum), r0, r3; \
97 bri ex_handler_done;
98
99/* r3 is the target */
100#define SWREG_TO_R3_V(regnum) \
101 lwi r3, r1, 4 * regnum; \
102 bri ex_sw_tail;
103
104/* r3 is the target */
105#define SWREG_TO_R3(regnum) \
106 or r3, r0, NUM_TO_REG (regnum); \
107 bri ex_sw_tail;
108
109.extern other_exception_handler /* Defined in exception.c */
110
111/*
112 * hw_exception_handler - Handler for exceptions
113 *
114 * Exception handler notes:
115 * - Handles all exceptions
116 * - Does not handle unaligned exceptions during load into r17, r1, r0.
117 * - Does not handle unaligned exceptions during store from r17 (cannot be
118 * done) and r1 (slows down common case)
119 *
120 * Relevant register structures
121 *
122 * EAR - |----|----|----|----|----|----|----|----|
123 * - < ## 32 bit faulting address ## >
124 *
125 * ESR - |----|----|----|----|----| - | - |-----|-----|
126 * - W S REG EXC
127 *
128 *
129 * STACK FRAME STRUCTURE (for NO_MMU)
130 * ---------------------------------
131 *
132 * +-------------+ + 0
133 * | MSR |
134 * +-------------+ + 4
135 * | r1 |
136 * | . |
137 * | . |
138 * | . |
139 * | . |
140 * | r18 |
141 * +-------------+ + 76
142 * | . |
143 * | . |
144 *
145 * NO_MMU kernel use the same r0_ram pointed space - look to vmlinux.lds.S
146 * which is used for storing register values - old style was, that value were
147 * stored in stack but in case of failure you lost information about register.
148 * Currently you can see register value in memory in specific place.
149 * In compare to with previous solution the speed should be the same.
150 *
151 * MMU exception handler has different handling compare to no MMU kernel.
152 * Exception handler use jump table for directing of what happen. For MMU kernel
153 * is this approach better because MMU relate exception are handled by asm code
154 * in this file. In compare to with MMU expect of unaligned exception
155 * is everything handled by C code.
156 */
157
158/*
159 * every of these handlers is entered having R3/4/5/6/11/current saved on stack
160 * and clobbered so care should be taken to restore them if someone is going to
161 * return from exception
162 */
163
164/* wrappers to restore state before coming to entry.S */
165
166.global _hw_exception_handler
167.section .text
168.align 4
169.ent _hw_exception_handler
170_hw_exception_handler:
171 addik r1, r1, -(EX_HANDLER_STACK_SIZ); /* Create stack frame */
172 swi r3, r1, PT_R3
173 swi r4, r1, PT_R4
174 swi r5, r1, PT_R5
175 swi r6, r1, PT_R6
176
177 mfs r5, rmsr;
178 nop
179 swi r5, r1, 0;
180 mfs r4, rbtr /* Save BTR before jumping to handler */
181 nop
182 mfs r3, resr
183 nop
184
185 andi r5, r3, 0x1000; /* Check ESR[DS] */
186 beqi r5, not_in_delay_slot; /* Branch if ESR[DS] not set */
187 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */
188 nop
189not_in_delay_slot:
190 swi r17, r1, PT_R17
191
192 andi r5, r3, 0x1F; /* Extract ESR[EXC] */
193
194 /* Exceptions enabled here. This will allow nested exceptions */
195 mfs r6, rmsr;
196 nop
197 swi r6, r1, 0; /* RMSR_OFFSET */
198 ori r6, r6, 0x100; /* Turn ON the EE bit */
199 andi r6, r6, ~2; /* Disable interrupts */
200 mts rmsr, r6;
201 nop
202
203 xori r6, r5, 1; /* 00001 = Unaligned Exception */
204 /* Jump to unalignment exception handler */
205 beqi r6, handle_unaligned_ex;
206
207handle_other_ex: /* Handle Other exceptions here */
208 /* Save other volatiles before we make procedure calls below */
209 swi r7, r1, PT_R7
210 swi r8, r1, PT_R8
211 swi r9, r1, PT_R9
212 swi r10, r1, PT_R10
213 swi r11, r1, PT_R11
214 swi r12, r1, PT_R12
215 swi r14, r1, PT_R14
216 swi r15, r1, PT_R15
217 swi r18, r1, PT_R18
218
219 or r5, r1, r0
220 andi r6, r3, 0x1F; /* Load ESR[EC] */
221 lwi r7, r0, PER_CPU(KM) /* MS: saving current kernel mode to regs */
222 swi r7, r1, PT_MODE
223 mfs r7, rfsr
224 nop
225 addk r8, r17, r0; /* Load exception address */
226 bralid r15, full_exception; /* Branch to the handler */
227 nop;
228
229 /*
230 * Trigger execution of the signal handler by enabling
231 * interrupts and calling an invalid syscall.
232 */
233 mfs r5, rmsr;
234 nop
235 ori r5, r5, 2;
236 mts rmsr, r5; /* enable interrupt */
237 nop
238 addi r12, r0, __NR_syscalls;
239 brki r14, 0x08;
240 mfs r5, rmsr; /* disable interrupt */
241 nop
242 andi r5, r5, ~2;
243 mts rmsr, r5;
244 nop
245
246 lwi r7, r1, PT_R7
247 lwi r8, r1, PT_R8
248 lwi r9, r1, PT_R9
249 lwi r10, r1, PT_R10
250 lwi r11, r1, PT_R11
251 lwi r12, r1, PT_R12
252 lwi r14, r1, PT_R14
253 lwi r15, r1, PT_R15
254 lwi r18, r1, PT_R18
255
256 bri ex_handler_done; /* Complete exception handling */
257
258/* 0x01 - Unaligned data access exception
259 * This occurs when a word access is not aligned on a word boundary,
260 * or when a 16-bit access is not aligned on a 16-bit boundary.
261 * This handler perform the access, and returns, except for MMU when
262 * the unaligned address is last on a 4k page or the physical address is
263 * not found in the page table, in which case unaligned_data_trap is called.
264 */
265handle_unaligned_ex:
266 /* Working registers already saved: R3, R4, R5, R6
267 * R3 = ESR
268 * R4 = BTR
269 */
270 mfs r4, rear;
271 nop
272
273 andi r6, r3, 0x3E0; /* Mask and extract the register operand */
274 srl r6, r6; /* r6 >> 5 */
275 srl r6, r6;
276 srl r6, r6;
277 srl r6, r6;
278 srl r6, r6;
279 /* Store the register operand in a temporary location */
280 sbi r6, r0, TOPHYS(ex_reg_op);
281
282 andi r6, r3, 0x400; /* Extract ESR[S] */
283 bnei r6, ex_sw;
284ex_lw:
285 andi r6, r3, 0x800; /* Extract ESR[W] */
286 beqi r6, ex_lhw;
287 lbui r5, r4, 0; /* Exception address in r4 */
288 /* Load a word, byte-by-byte from destination address
289 and save it in tmp space */
290 sbi r5, r0, TOPHYS(ex_tmp_data_loc_0);
291 lbui r5, r4, 1;
292 sbi r5, r0, TOPHYS(ex_tmp_data_loc_1);
293 lbui r5, r4, 2;
294 sbi r5, r0, TOPHYS(ex_tmp_data_loc_2);
295 lbui r5, r4, 3;
296 sbi r5, r0, TOPHYS(ex_tmp_data_loc_3);
297 /* Get the destination register value into r3 */
298 lwi r3, r0, TOPHYS(ex_tmp_data_loc_0);
299 bri ex_lw_tail;
300ex_lhw:
301 lbui r5, r4, 0; /* Exception address in r4 */
302 /* Load a half-word, byte-by-byte from destination
303 address and save it in tmp space */
304 sbi r5, r0, TOPHYS(ex_tmp_data_loc_0);
305 lbui r5, r4, 1;
306 sbi r5, r0, TOPHYS(ex_tmp_data_loc_1);
307 /* Get the destination register value into r3 */
308 lhui r3, r0, TOPHYS(ex_tmp_data_loc_0);
309ex_lw_tail:
310 /* Get the destination register number into r5 */
311 lbui r5, r0, TOPHYS(ex_reg_op);
312 /* Form load_word jump table offset (lw_table + (8 * regnum)) */
313 la r6, r0, TOPHYS(lw_table);
314 addk r5, r5, r5;
315 addk r5, r5, r5;
316 addk r5, r5, r5;
317 addk r5, r5, r6;
318 bra r5;
319ex_lw_end: /* Exception handling of load word, ends */
320ex_sw:
321 /* Get the destination register number into r5 */
322 lbui r5, r0, TOPHYS(ex_reg_op);
323 /* Form store_word jump table offset (sw_table + (8 * regnum)) */
324 la r6, r0, TOPHYS(sw_table);
325 add r5, r5, r5;
326 add r5, r5, r5;
327 add r5, r5, r5;
328 add r5, r5, r6;
329 bra r5;
330ex_sw_tail:
331 mfs r6, resr;
332 nop
333 andi r6, r6, 0x800; /* Extract ESR[W] */
334 beqi r6, ex_shw;
335 /* Get the word - delay slot */
336 swi r3, r0, TOPHYS(ex_tmp_data_loc_0);
337 /* Store the word, byte-by-byte into destination address */
338 lbui r3, r0, TOPHYS(ex_tmp_data_loc_0);
339 sbi r3, r4, 0;
340 lbui r3, r0, TOPHYS(ex_tmp_data_loc_1);
341 sbi r3, r4, 1;
342 lbui r3, r0, TOPHYS(ex_tmp_data_loc_2);
343 sbi r3, r4, 2;
344 lbui r3, r0, TOPHYS(ex_tmp_data_loc_3);
345 sbi r3, r4, 3;
346 bri ex_handler_done;
347
348ex_shw:
349 /* Store the lower half-word, byte-by-byte into destination address */
350 swi r3, r0, TOPHYS(ex_tmp_data_loc_0);
351 lbui r3, r0, TOPHYS(ex_tmp_data_loc_2);
352 sbi r3, r4, 0;
353 lbui r3, r0, TOPHYS(ex_tmp_data_loc_3);
354 sbi r3, r4, 1;
355ex_sw_end: /* Exception handling of store word, ends. */
356
357ex_handler_done:
358 lwi r5, r1, 0 /* RMSR */
359 mts rmsr, r5
360 nop
361 lwi r3, r1, PT_R3
362 lwi r4, r1, PT_R4
363 lwi r5, r1, PT_R5
364 lwi r6, r1, PT_R6
365 lwi r17, r1, PT_R17
366
367 rted r17, 0
368 addik r1, r1, (EX_HANDLER_STACK_SIZ); /* Restore stack frame */
369
370.end _hw_exception_handler
371
372ex_handler_unhandled:
373/* FIXME add handle function for unhandled exception - dump register */
374 bri 0
375
376.section .text
377.align 4
378lw_table:
379lw_r0: R3_TO_LWREG (0);
380lw_r1: LWREG_NOP;
381lw_r2: R3_TO_LWREG (2);
382lw_r3: R3_TO_LWREG_V (3);
383lw_r4: R3_TO_LWREG_V (4);
384lw_r5: R3_TO_LWREG_V (5);
385lw_r6: R3_TO_LWREG_V (6);
386lw_r7: R3_TO_LWREG (7);
387lw_r8: R3_TO_LWREG (8);
388lw_r9: R3_TO_LWREG (9);
389lw_r10: R3_TO_LWREG (10);
390lw_r11: R3_TO_LWREG (11);
391lw_r12: R3_TO_LWREG (12);
392lw_r13: R3_TO_LWREG (13);
393lw_r14: R3_TO_LWREG (14);
394lw_r15: R3_TO_LWREG (15);
395lw_r16: R3_TO_LWREG (16);
396lw_r17: LWREG_NOP;
397lw_r18: R3_TO_LWREG (18);
398lw_r19: R3_TO_LWREG (19);
399lw_r20: R3_TO_LWREG (20);
400lw_r21: R3_TO_LWREG (21);
401lw_r22: R3_TO_LWREG (22);
402lw_r23: R3_TO_LWREG (23);
403lw_r24: R3_TO_LWREG (24);
404lw_r25: R3_TO_LWREG (25);
405lw_r26: R3_TO_LWREG (26);
406lw_r27: R3_TO_LWREG (27);
407lw_r28: R3_TO_LWREG (28);
408lw_r29: R3_TO_LWREG (29);
409lw_r30: R3_TO_LWREG (30);
410lw_r31: R3_TO_LWREG (31);
411
412sw_table:
413sw_r0: SWREG_TO_R3 (0);
414sw_r1: SWREG_NOP;
415sw_r2: SWREG_TO_R3 (2);
416sw_r3: SWREG_TO_R3_V (3);
417sw_r4: SWREG_TO_R3_V (4);
418sw_r5: SWREG_TO_R3_V (5);
419sw_r6: SWREG_TO_R3_V (6);
420sw_r7: SWREG_TO_R3 (7);
421sw_r8: SWREG_TO_R3 (8);
422sw_r9: SWREG_TO_R3 (9);
423sw_r10: SWREG_TO_R3 (10);
424sw_r11: SWREG_TO_R3 (11);
425sw_r12: SWREG_TO_R3 (12);
426sw_r13: SWREG_TO_R3 (13);
427sw_r14: SWREG_TO_R3 (14);
428sw_r15: SWREG_TO_R3 (15);
429sw_r16: SWREG_TO_R3 (16);
430sw_r17: SWREG_NOP;
431sw_r18: SWREG_TO_R3 (18);
432sw_r19: SWREG_TO_R3 (19);
433sw_r20: SWREG_TO_R3 (20);
434sw_r21: SWREG_TO_R3 (21);
435sw_r22: SWREG_TO_R3 (22);
436sw_r23: SWREG_TO_R3 (23);
437sw_r24: SWREG_TO_R3 (24);
438sw_r25: SWREG_TO_R3 (25);
439sw_r26: SWREG_TO_R3 (26);
440sw_r27: SWREG_TO_R3 (27);
441sw_r28: SWREG_TO_R3 (28);
442sw_r29: SWREG_TO_R3 (29);
443sw_r30: SWREG_TO_R3 (30);
444sw_r31: SWREG_TO_R3 (31);
445
446/* Temporary data structures used in the handler */
447.section .data
448.align 4
449ex_tmp_data_loc_0:
450 .byte 0
451ex_tmp_data_loc_1:
452 .byte 0
453ex_tmp_data_loc_2:
454 .byte 0
455ex_tmp_data_loc_3:
456 .byte 0
457ex_reg_op:
458 .byte 0
diff --git a/arch/microblaze/kernel/init_task.c b/arch/microblaze/kernel/init_task.c
new file mode 100644
index 000000000000..48eb9fb255fa
--- /dev/null
+++ b/arch/microblaze/kernel/init_task.c
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/module.h>
12#include <linux/sched.h>
13#include <linux/init_task.h>
14#include <linux/fs.h>
15#include <linux/mqueue.h>
16
17#include <asm/pgtable.h>
18
19static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
20static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
21struct mm_struct init_mm = INIT_MM(init_mm);
22EXPORT_SYMBOL(init_mm);
23
24union thread_union init_thread_union
25 __attribute__((__section__(".data.init_task"))) =
26{ INIT_THREAD_INFO(init_task) };
27
28struct task_struct init_task = INIT_TASK(init_task);
29EXPORT_SYMBOL(init_task);
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
new file mode 100644
index 000000000000..a69d3e3c2fd4
--- /dev/null
+++ b/arch/microblaze/kernel/intc.c
@@ -0,0 +1,172 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/irq.h>
13#include <asm/page.h>
14#include <linux/io.h>
15
16#include <asm/prom.h>
17#include <asm/irq.h>
18
19#ifdef CONFIG_SELFMOD_INTC
20#include <asm/selfmod.h>
21#define INTC_BASE BARRIER_BASE_ADDR
22#else
23static unsigned int intc_baseaddr;
24#define INTC_BASE intc_baseaddr
25#endif
26
27unsigned int nr_irq;
28
29/* No one else should require these constants, so define them locally here. */
30#define ISR 0x00 /* Interrupt Status Register */
31#define IPR 0x04 /* Interrupt Pending Register */
32#define IER 0x08 /* Interrupt Enable Register */
33#define IAR 0x0c /* Interrupt Acknowledge Register */
34#define SIE 0x10 /* Set Interrupt Enable bits */
35#define CIE 0x14 /* Clear Interrupt Enable bits */
36#define IVR 0x18 /* Interrupt Vector Register */
37#define MER 0x1c /* Master Enable Register */
38
39#define MER_ME (1<<0)
40#define MER_HIE (1<<1)
41
42static void intc_enable_or_unmask(unsigned int irq)
43{
44 pr_debug("enable_or_unmask: %d\n", irq);
45 out_be32(INTC_BASE + SIE, 1 << irq);
46}
47
48static void intc_disable_or_mask(unsigned int irq)
49{
50 pr_debug("disable: %d\n", irq);
51 out_be32(INTC_BASE + CIE, 1 << irq);
52}
53
54static void intc_ack(unsigned int irq)
55{
56 pr_debug("ack: %d\n", irq);
57 out_be32(INTC_BASE + IAR, 1 << irq);
58}
59
60static void intc_mask_ack(unsigned int irq)
61{
62 unsigned long mask = 1 << irq;
63 pr_debug("disable_and_ack: %d\n", irq);
64 out_be32(INTC_BASE + CIE, mask);
65 out_be32(INTC_BASE + IAR, mask);
66}
67
68static void intc_end(unsigned int irq)
69{
70 unsigned long mask = 1 << irq;
71 pr_debug("end: %d\n", irq);
72 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
73 out_be32(INTC_BASE + SIE, mask);
74 /* ack level sensitive intr */
75 if (irq_desc[irq].status & IRQ_LEVEL)
76 out_be32(INTC_BASE + IAR, mask);
77 }
78}
79
80static struct irq_chip intc_dev = {
81 .name = "Xilinx INTC",
82 .unmask = intc_enable_or_unmask,
83 .mask = intc_disable_or_mask,
84 .ack = intc_ack,
85 .mask_ack = intc_mask_ack,
86 .end = intc_end,
87};
88
89unsigned int get_irq(struct pt_regs *regs)
90{
91 int irq;
92
93 /*
94 * NOTE: This function is the one that needs to be improved in
95 * order to handle multiple interrupt controllers. It currently
96 * is hardcoded to check for interrupts only on the first INTC.
97 */
98 irq = in_be32(INTC_BASE + IVR);
99 pr_debug("get_irq: %d\n", irq);
100
101 return irq;
102}
103
104void __init init_IRQ(void)
105{
106 u32 i, j, intr_type;
107 struct device_node *intc = NULL;
108#ifdef CONFIG_SELFMOD_INTC
109 unsigned int intc_baseaddr = 0;
110 static int arr_func[] = {
111 (int)&get_irq,
112 (int)&intc_enable_or_unmask,
113 (int)&intc_disable_or_mask,
114 (int)&intc_mask_ack,
115 (int)&intc_ack,
116 (int)&intc_end,
117 0
118 };
119#endif
120 static char *intc_list[] = {
121 "xlnx,xps-intc-1.00.a",
122 "xlnx,opb-intc-1.00.c",
123 "xlnx,opb-intc-1.00.b",
124 "xlnx,opb-intc-1.00.a",
125 NULL
126 };
127
128 for (j = 0; intc_list[j] != NULL; j++) {
129 intc = of_find_compatible_node(NULL, NULL, intc_list[j]);
130 if (intc)
131 break;
132 }
133
134 intc_baseaddr = *(int *) of_get_property(intc, "reg", NULL);
135 intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
136 nr_irq = *(int *) of_get_property(intc, "xlnx,num-intr-inputs", NULL);
137
138 intr_type =
139 *(int *) of_get_property(intc, "xlnx,kind-of-intr", NULL);
140 if (intr_type >= (1 << nr_irq))
141 printk(KERN_INFO " ERROR: Mishmash in king-of-intr param\n");
142
143#ifdef CONFIG_SELFMOD_INTC
144 selfmod_function((int *) arr_func, intc_baseaddr);
145#endif
146 printk(KERN_INFO "%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
147 intc_list[j], intc_baseaddr, nr_irq, intr_type);
148
149 /*
150 * Disable all external interrupts until they are
151 * explicity requested.
152 */
153 out_be32(intc_baseaddr + IER, 0);
154
155 /* Acknowledge any pending interrupts just in case. */
156 out_be32(intc_baseaddr + IAR, 0xffffffff);
157
158 /* Turn on the Master Enable. */
159 out_be32(intc_baseaddr + MER, MER_HIE | MER_ME);
160
161 for (i = 0; i < nr_irq; ++i) {
162 if (intr_type & (0x00000001 << i)) {
163 set_irq_chip_and_handler_name(i, &intc_dev,
164 handle_edge_irq, intc_dev.name);
165 irq_desc[i].status &= ~IRQ_LEVEL;
166 } else {
167 set_irq_chip_and_handler_name(i, &intc_dev,
168 handle_level_irq, intc_dev.name);
169 irq_desc[i].status |= IRQ_LEVEL;
170 }
171 }
172}
diff --git a/arch/microblaze/kernel/irq.c b/arch/microblaze/kernel/irq.c
new file mode 100644
index 000000000000..f688ee93e3b9
--- /dev/null
+++ b/arch/microblaze/kernel/irq.c
@@ -0,0 +1,104 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/hardirq.h>
14#include <linux/interrupt.h>
15#include <linux/irqflags.h>
16#include <linux/seq_file.h>
17#include <linux/kernel_stat.h>
18#include <linux/irq.h>
19
20#include <asm/prom.h>
21
22unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
23{
24 struct of_irq oirq;
25
26 if (of_irq_map_one(dev, index, &oirq))
27 return NO_IRQ;
28
29 return oirq.specifier[0];
30}
31EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
32
33/*
34 * 'what should we do if we get a hw irq event on an illegal vector'.
35 * each architecture has to answer this themselves.
36 */
37void ack_bad_irq(unsigned int irq)
38{
39 printk(KERN_WARNING "unexpected IRQ trap at vector %02x\n", irq);
40}
41
42static u32 concurrent_irq;
43
44void do_IRQ(struct pt_regs *regs)
45{
46 unsigned int irq;
47 struct pt_regs *old_regs = set_irq_regs(regs);
48
49 irq_enter();
50 irq = get_irq(regs);
51next_irq:
52 BUG_ON(irq == -1U);
53 generic_handle_irq(irq);
54
55 irq = get_irq(regs);
56 if (irq != -1U) {
57 pr_debug("next irq: %d\n", irq);
58 ++concurrent_irq;
59 goto next_irq;
60 }
61
62 irq_exit();
63 set_irq_regs(old_regs);
64}
65
66int show_interrupts(struct seq_file *p, void *v)
67{
68 int i = *(loff_t *) v, j;
69 struct irqaction *action;
70 unsigned long flags;
71
72 if (i == 0) {
73 seq_printf(p, " ");
74 for_each_online_cpu(j)
75 seq_printf(p, "CPU%-8d", j);
76 seq_putc(p, '\n');
77 }
78
79 if (i < nr_irq) {
80 spin_lock_irqsave(&irq_desc[i].lock, flags);
81 action = irq_desc[i].action;
82 if (!action)
83 goto skip;
84 seq_printf(p, "%3d: ", i);
85#ifndef CONFIG_SMP
86 seq_printf(p, "%10u ", kstat_irqs(i));
87#else
88 for_each_online_cpu(j)
89 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
90#endif
91 seq_printf(p, " %8s", irq_desc[i].status &
92 IRQ_LEVEL ? "level" : "edge");
93 seq_printf(p, " %8s", irq_desc[i].chip->name);
94 seq_printf(p, " %s", action->name);
95
96 for (action = action->next; action; action = action->next)
97 seq_printf(p, ", %s", action->name);
98
99 seq_putc(p, '\n');
100skip:
101 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
102 }
103 return 0;
104}
diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
new file mode 100644
index 000000000000..5f71790e3c3c
--- /dev/null
+++ b/arch/microblaze/kernel/microblaze_ksyms.c
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
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#include <linux/module.h>
11#include <linux/string.h>
12#include <linux/cryptohash.h>
13#include <linux/delay.h>
14#include <linux/in6.h>
15#include <linux/syscalls.h>
16
17#include <asm/checksum.h>
18#include <linux/io.h>
19#include <asm/page.h>
20#include <asm/system.h>
21#include <linux/uaccess.h>
22
23/*
24 * libgcc functions - functions that are used internally by the
25 * compiler... (prototypes are not correct though, but that
26 * doesn't really matter since they're not versioned).
27 */
28extern void __ashldi3(void);
29EXPORT_SYMBOL(__ashldi3);
30extern void __ashrdi3(void);
31EXPORT_SYMBOL(__ashrdi3);
32extern void __divsi3(void);
33EXPORT_SYMBOL(__divsi3);
34extern void __lshrdi3(void);
35EXPORT_SYMBOL(__lshrdi3);
36extern void __modsi3(void);
37EXPORT_SYMBOL(__modsi3);
38extern void __mulsi3(void);
39EXPORT_SYMBOL(__mulsi3);
40extern void __muldi3(void);
41EXPORT_SYMBOL(__muldi3);
42extern void __ucmpdi2(void);
43EXPORT_SYMBOL(__ucmpdi2);
44extern void __udivsi3(void);
45EXPORT_SYMBOL(__udivsi3);
46extern void __umodsi3(void);
47EXPORT_SYMBOL(__umodsi3);
diff --git a/arch/microblaze/kernel/module.c b/arch/microblaze/kernel/module.c
new file mode 100644
index 000000000000..51414171326f
--- /dev/null
+++ b/arch/microblaze/kernel/module.c
@@ -0,0 +1,151 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
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#include <linux/module.h>
11#include <linux/moduleloader.h>
12#include <linux/kernel.h>
13#include <linux/elf.h>
14#include <linux/vmalloc.h>
15#include <linux/slab.h>
16#include <linux/fs.h>
17#include <linux/string.h>
18
19#include <asm/pgtable.h>
20
21void *module_alloc(unsigned long size)
22{
23 void *ret;
24 ret = (size == 0) ? NULL : vmalloc(size);
25 pr_debug("module_alloc (%08lx@%08lx)\n", size, (unsigned long int)ret);
26 return ret;
27}
28
29void module_free(struct module *module, void *region)
30{
31 pr_debug("module_free(%s,%08lx)\n", module->name,
32 (unsigned long)region);
33 vfree(region);
34}
35
36int module_frob_arch_sections(Elf_Ehdr *hdr,
37 Elf_Shdr *sechdrs,
38 char *secstrings,
39 struct module *mod)
40{
41 return 0;
42}
43
44int apply_relocate(Elf32_Shdr *sechdrs, const char *strtab,
45 unsigned int symindex, unsigned int relsec, struct module *module)
46{
47 printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
48 module->name);
49 return -ENOEXEC;
50}
51
52int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
53 unsigned int symindex, unsigned int relsec, struct module *module)
54{
55
56 unsigned int i;
57 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr;
58 Elf32_Sym *sym;
59 unsigned long int *location;
60 unsigned long int locoffs;
61 unsigned long int value;
62#if __GNUC__ < 4
63 unsigned long int old_value;
64#endif
65
66 pr_debug("Applying add relocation section %u to %u\n",
67 relsec, sechdrs[relsec].sh_info);
68
69 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) {
70
71 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr +
72 rela[i].r_offset;
73 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr +
74 ELF32_R_SYM(rela[i].r_info);
75 value = sym->st_value + rela[i].r_addend;
76
77 switch (ELF32_R_TYPE(rela[i].r_info)) {
78
79 /*
80 * Be careful! mb-gcc / mb-ld splits the relocs between the
81 * text and the reloc table. In general this means we must
82 * read the current contents of (*location), add any offset
83 * then store the result back in
84 */
85
86 case R_MICROBLAZE_32:
87#if __GNUC__ < 4
88 old_value = *location;
89 *location = value + old_value;
90
91 pr_debug("R_MICROBLAZE_32 (%08lx->%08lx)\n",
92 old_value, value);
93#else
94 *location = value;
95#endif
96 break;
97
98 case R_MICROBLAZE_64:
99#if __GNUC__ < 4
100 /* Split relocs only required/used pre gcc4.1.1 */
101 old_value = ((location[0] & 0x0000FFFF) << 16) |
102 (location[1] & 0x0000FFFF);
103 value += old_value;
104#endif
105 location[0] = (location[0] & 0xFFFF0000) |
106 (value >> 16);
107 location[1] = (location[1] & 0xFFFF0000) |
108 (value & 0xFFFF);
109#if __GNUC__ < 4
110 pr_debug("R_MICROBLAZE_64 (%08lx->%08lx)\n",
111 old_value, value);
112#endif
113 break;
114
115 case R_MICROBLAZE_64_PCREL:
116 locoffs = (location[0] & 0xFFFF) << 16 |
117 (location[1] & 0xFFFF);
118 value -= (unsigned long int)(location) + 4 +
119 locoffs;
120 location[0] = (location[0] & 0xFFFF0000) |
121 (value >> 16);
122 location[1] = (location[1] & 0xFFFF0000) |
123 (value & 0xFFFF);
124 pr_debug("R_MICROBLAZE_64_PCREL (%08lx)\n",
125 value);
126 break;
127
128 case R_MICROBLAZE_NONE:
129 pr_debug("R_MICROBLAZE_NONE\n");
130 break;
131
132 default:
133 printk(KERN_ERR "module %s: "
134 "Unknown relocation: %u\n",
135 module->name,
136 ELF32_R_TYPE(rela->r_info));
137 return -ENOEXEC;
138 }
139 }
140 return 0;
141}
142
143int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
144 struct module *module)
145{
146 return 0;
147}
148
149void module_arch_cleanup(struct module *mod)
150{
151}
diff --git a/arch/microblaze/kernel/of_device.c b/arch/microblaze/kernel/of_device.c
new file mode 100644
index 000000000000..9a0f7632c47c
--- /dev/null
+++ b/arch/microblaze/kernel/of_device.c
@@ -0,0 +1,113 @@
1#include <linux/string.h>
2#include <linux/kernel.h>
3#include <linux/of.h>
4#include <linux/init.h>
5#include <linux/module.h>
6#include <linux/mod_devicetable.h>
7#include <linux/slab.h>
8#include <linux/of_device.h>
9
10#include <linux/errno.h>
11
12void of_device_make_bus_id(struct of_device *dev)
13{
14 static atomic_t bus_no_reg_magic;
15 struct device_node *node = dev->node;
16 const u32 *reg;
17 u64 addr;
18 int magic;
19
20 /*
21 * For MMIO, get the physical address
22 */
23 reg = of_get_property(node, "reg", NULL);
24 if (reg) {
25 addr = of_translate_address(node, reg);
26 if (addr != OF_BAD_ADDR) {
27 dev_set_name(&dev->dev, "%llx.%s",
28 (unsigned long long)addr, node->name);
29 return;
30 }
31 }
32
33 /*
34 * No BusID, use the node name and add a globally incremented
35 * counter (and pray...)
36 */
37 magic = atomic_add_return(1, &bus_no_reg_magic);
38 dev_set_name(&dev->dev, "%s.%d", node->name, magic - 1);
39}
40EXPORT_SYMBOL(of_device_make_bus_id);
41
42struct of_device *of_device_alloc(struct device_node *np,
43 const char *bus_id,
44 struct device *parent)
45{
46 struct of_device *dev;
47
48 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
49 if (!dev)
50 return NULL;
51
52 dev->node = of_node_get(np);
53 dev->dev.dma_mask = &dev->dma_mask;
54 dev->dev.parent = parent;
55 dev->dev.release = of_release_dev;
56 dev->dev.archdata.of_node = np;
57
58 if (bus_id)
59 dev_set_name(&dev->dev, bus_id);
60 else
61 of_device_make_bus_id(dev);
62
63 return dev;
64}
65EXPORT_SYMBOL(of_device_alloc);
66
67int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
68{
69 struct of_device *ofdev;
70 const char *compat;
71 int seen = 0, cplen, sl;
72
73 if (!dev)
74 return -ENODEV;
75
76 ofdev = to_of_device(dev);
77
78 if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name))
79 return -ENOMEM;
80
81 if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type))
82 return -ENOMEM;
83
84 /* Since the compatible field can contain pretty much anything
85 * it's not really legal to split it out with commas. We split it
86 * up using a number of environment variables instead. */
87
88 compat = of_get_property(ofdev->node, "compatible", &cplen);
89 while (compat && *compat && cplen > 0) {
90 if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
91 return -ENOMEM;
92
93 sl = strlen(compat) + 1;
94 compat += sl;
95 cplen -= sl;
96 seen++;
97 }
98
99 if (add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen))
100 return -ENOMEM;
101
102 /* modalias is trickier, we add it in 2 steps */
103 if (add_uevent_var(env, "MODALIAS="))
104 return -ENOMEM;
105 sl = of_device_get_modalias(ofdev, &env->buf[env->buflen-1],
106 sizeof(env->buf) - env->buflen);
107 if (sl >= (sizeof(env->buf) - env->buflen))
108 return -ENOMEM;
109 env->buflen += sl;
110
111 return 0;
112}
113EXPORT_SYMBOL(of_device_uevent);
diff --git a/arch/microblaze/kernel/of_platform.c b/arch/microblaze/kernel/of_platform.c
new file mode 100644
index 000000000000..acf4574d0f18
--- /dev/null
+++ b/arch/microblaze/kernel/of_platform.c
@@ -0,0 +1,201 @@
1/*
2 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
3 * <benh@kernel.crashing.org>
4 * and Arnd Bergmann, IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#undef DEBUG
14
15#include <linux/string.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/module.h>
19#include <linux/mod_devicetable.h>
20#include <linux/slab.h>
21#include <linux/pci.h>
22#include <linux/of.h>
23#include <linux/of_device.h>
24#include <linux/of_platform.h>
25
26#include <linux/errno.h>
27#include <linux/topology.h>
28#include <asm/atomic.h>
29
30struct bus_type of_platform_bus_type = {
31 .uevent = of_device_uevent,
32};
33EXPORT_SYMBOL(of_platform_bus_type);
34
35static int __init of_bus_driver_init(void)
36{
37 return of_bus_type_init(&of_platform_bus_type, "of_platform");
38}
39postcore_initcall(of_bus_driver_init);
40
41struct of_device *of_platform_device_create(struct device_node *np,
42 const char *bus_id,
43 struct device *parent)
44{
45 struct of_device *dev;
46
47 dev = of_device_alloc(np, bus_id, parent);
48 if (!dev)
49 return NULL;
50
51 dev->dma_mask = 0xffffffffUL;
52 dev->dev.bus = &of_platform_bus_type;
53
54 /* We do not fill the DMA ops for platform devices by default.
55 * This is currently the responsibility of the platform code
56 * to do such, possibly using a device notifier
57 */
58
59 if (of_device_register(dev) != 0) {
60 of_device_free(dev);
61 return NULL;
62 }
63
64 return dev;
65}
66EXPORT_SYMBOL(of_platform_device_create);
67
68/**
69 * of_platform_bus_create - Create an OF device for a bus node and all its
70 * children. Optionally recursively instanciate matching busses.
71 * @bus: device node of the bus to instanciate
72 * @matches: match table, NULL to use the default, OF_NO_DEEP_PROBE to
73 * disallow recursive creation of child busses
74 */
75static int of_platform_bus_create(const struct device_node *bus,
76 const struct of_device_id *matches,
77 struct device *parent)
78{
79 struct device_node *child;
80 struct of_device *dev;
81 int rc = 0;
82
83 for_each_child_of_node(bus, child) {
84 pr_debug(" create child: %s\n", child->full_name);
85 dev = of_platform_device_create(child, NULL, parent);
86 if (dev == NULL)
87 rc = -ENOMEM;
88 else if (!of_match_node(matches, child))
89 continue;
90 if (rc == 0) {
91 pr_debug(" and sub busses\n");
92 rc = of_platform_bus_create(child, matches, &dev->dev);
93 }
94 if (rc) {
95 of_node_put(child);
96 break;
97 }
98 }
99 return rc;
100}
101
102
103/**
104 * of_platform_bus_probe - Probe the device-tree for platform busses
105 * @root: parent of the first level to probe or NULL for the root of the tree
106 * @matches: match table, NULL to use the default
107 * @parent: parent to hook devices from, NULL for toplevel
108 *
109 * Note that children of the provided root are not instanciated as devices
110 * unless the specified root itself matches the bus list and is not NULL.
111 */
112
113int of_platform_bus_probe(struct device_node *root,
114 const struct of_device_id *matches,
115 struct device *parent)
116{
117 struct device_node *child;
118 struct of_device *dev;
119 int rc = 0;
120
121 if (matches == NULL)
122 matches = of_default_bus_ids;
123 if (matches == OF_NO_DEEP_PROBE)
124 return -EINVAL;
125 if (root == NULL)
126 root = of_find_node_by_path("/");
127 else
128 of_node_get(root);
129
130 pr_debug("of_platform_bus_probe()\n");
131 pr_debug(" starting at: %s\n", root->full_name);
132
133 /* Do a self check of bus type, if there's a match, create
134 * children
135 */
136 if (of_match_node(matches, root)) {
137 pr_debug(" root match, create all sub devices\n");
138 dev = of_platform_device_create(root, NULL, parent);
139 if (dev == NULL) {
140 rc = -ENOMEM;
141 goto bail;
142 }
143 pr_debug(" create all sub busses\n");
144 rc = of_platform_bus_create(root, matches, &dev->dev);
145 goto bail;
146 }
147 for_each_child_of_node(root, child) {
148 if (!of_match_node(matches, child))
149 continue;
150
151 pr_debug(" match: %s\n", child->full_name);
152 dev = of_platform_device_create(child, NULL, parent);
153 if (dev == NULL)
154 rc = -ENOMEM;
155 else
156 rc = of_platform_bus_create(child, matches, &dev->dev);
157 if (rc) {
158 of_node_put(child);
159 break;
160 }
161 }
162 bail:
163 of_node_put(root);
164 return rc;
165}
166EXPORT_SYMBOL(of_platform_bus_probe);
167
168static int of_dev_node_match(struct device *dev, void *data)
169{
170 return to_of_device(dev)->node == data;
171}
172
173struct of_device *of_find_device_by_node(struct device_node *np)
174{
175 struct device *dev;
176
177 dev = bus_find_device(&of_platform_bus_type,
178 NULL, np, of_dev_node_match);
179 if (dev)
180 return to_of_device(dev);
181 return NULL;
182}
183EXPORT_SYMBOL(of_find_device_by_node);
184
185static int of_dev_phandle_match(struct device *dev, void *data)
186{
187 phandle *ph = data;
188 return to_of_device(dev)->node->linux_phandle == *ph;
189}
190
191struct of_device *of_find_device_by_phandle(phandle ph)
192{
193 struct device *dev;
194
195 dev = bus_find_device(&of_platform_bus_type,
196 NULL, &ph, of_dev_phandle_match);
197 if (dev)
198 return to_of_device(dev);
199 return NULL;
200}
201EXPORT_SYMBOL(of_find_device_by_phandle);
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
new file mode 100644
index 000000000000..436f26ccbfa9
--- /dev/null
+++ b/arch/microblaze/kernel/process.c
@@ -0,0 +1,186 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/module.h>
12#include <linux/sched.h>
13#include <linux/pm.h>
14#include <linux/tick.h>
15#include <linux/bitops.h>
16#include <asm/system.h>
17#include <asm/pgalloc.h>
18
19void show_regs(struct pt_regs *regs)
20{
21 printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->kernel_mode);
22 printk(KERN_INFO " r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n",
23 regs->r1, regs->r2, regs->r3, regs->r4);
24 printk(KERN_INFO " r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n",
25 regs->r5, regs->r6, regs->r7, regs->r8);
26 printk(KERN_INFO " r9=%08lX, r10=%08lX, r11=%08lX, r12=%08lX\n",
27 regs->r9, regs->r10, regs->r11, regs->r12);
28 printk(KERN_INFO " r13=%08lX, r14=%08lX, r15=%08lX, r16=%08lX\n",
29 regs->r13, regs->r14, regs->r15, regs->r16);
30 printk(KERN_INFO " r17=%08lX, r18=%08lX, r19=%08lX, r20=%08lX\n",
31 regs->r17, regs->r18, regs->r19, regs->r20);
32 printk(KERN_INFO " r21=%08lX, r22=%08lX, r23=%08lX, r24=%08lX\n",
33 regs->r21, regs->r22, regs->r23, regs->r24);
34 printk(KERN_INFO " r25=%08lX, r26=%08lX, r27=%08lX, r28=%08lX\n",
35 regs->r25, regs->r26, regs->r27, regs->r28);
36 printk(KERN_INFO " r29=%08lX, r30=%08lX, r31=%08lX, rPC=%08lX\n",
37 regs->r29, regs->r30, regs->r31, regs->pc);
38 printk(KERN_INFO " msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n",
39 regs->msr, regs->ear, regs->esr, regs->fsr);
40 while (1)
41 ;
42}
43
44void (*pm_idle)(void);
45void (*pm_power_off)(void) = NULL;
46EXPORT_SYMBOL(pm_power_off);
47
48static int hlt_counter = 1;
49
50void disable_hlt(void)
51{
52 hlt_counter++;
53}
54EXPORT_SYMBOL(disable_hlt);
55
56void enable_hlt(void)
57{
58 hlt_counter--;
59}
60EXPORT_SYMBOL(enable_hlt);
61
62static int __init nohlt_setup(char *__unused)
63{
64 hlt_counter = 1;
65 return 1;
66}
67__setup("nohlt", nohlt_setup);
68
69static int __init hlt_setup(char *__unused)
70{
71 hlt_counter = 0;
72 return 1;
73}
74__setup("hlt", hlt_setup);
75
76void default_idle(void)
77{
78 if (!hlt_counter) {
79 clear_thread_flag(TIF_POLLING_NRFLAG);
80 smp_mb__after_clear_bit();
81 local_irq_disable();
82 while (!need_resched())
83 cpu_sleep();
84 local_irq_enable();
85 set_thread_flag(TIF_POLLING_NRFLAG);
86 } else
87 while (!need_resched())
88 cpu_relax();
89}
90
91void cpu_idle(void)
92{
93 set_thread_flag(TIF_POLLING_NRFLAG);
94
95 /* endless idle loop with no priority at all */
96 while (1) {
97 void (*idle)(void) = pm_idle;
98
99 if (!idle)
100 idle = default_idle;
101
102 tick_nohz_stop_sched_tick(1);
103 while (!need_resched())
104 idle();
105 tick_nohz_restart_sched_tick();
106
107 preempt_enable_no_resched();
108 schedule();
109 preempt_disable();
110 check_pgt_cache();
111 }
112}
113
114void flush_thread(void)
115{
116}
117
118int copy_thread(unsigned long clone_flags, unsigned long usp,
119 unsigned long unused,
120 struct task_struct *p, struct pt_regs *regs)
121{
122 struct pt_regs *childregs = task_pt_regs(p);
123 struct thread_info *ti = task_thread_info(p);
124
125 *childregs = *regs;
126 if (user_mode(regs))
127 childregs->r1 = usp;
128 else
129 childregs->r1 = ((unsigned long) ti) + THREAD_SIZE;
130
131 memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
132 ti->cpu_context.r1 = (unsigned long)childregs;
133 ti->cpu_context.msr = (unsigned long)childregs->msr;
134 ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8;
135
136 if (clone_flags & CLONE_SETTLS)
137 ;
138
139 return 0;
140}
141
142/*
143 * Return saved PC of a blocked thread.
144 */
145unsigned long thread_saved_pc(struct task_struct *tsk)
146{
147 struct cpu_context *ctx =
148 &(((struct thread_info *)(tsk->stack))->cpu_context);
149
150 /* Check whether the thread is blocked in resume() */
151 if (in_sched_functions(ctx->r15))
152 return (unsigned long)ctx->r15;
153 else
154 return ctx->r14;
155}
156
157static void kernel_thread_helper(int (*fn)(void *), void *arg)
158{
159 fn(arg);
160 do_exit(-1);
161}
162
163int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
164{
165 struct pt_regs regs;
166 int ret;
167
168 memset(&regs, 0, sizeof(regs));
169 /* store them in non-volatile registers */
170 regs.r5 = (unsigned long)fn;
171 regs.r6 = (unsigned long)arg;
172 local_save_flags(regs.msr);
173 regs.pc = (unsigned long)kernel_thread_helper;
174 regs.kernel_mode = 1;
175
176 ret = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
177 &regs, 0, NULL, NULL);
178
179 return ret;
180}
181
182unsigned long get_wchan(struct task_struct *p)
183{
184/* TBD (used by procfs) */
185 return 0;
186}
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
new file mode 100644
index 000000000000..34c48718061a
--- /dev/null
+++ b/arch/microblaze/kernel/prom.c
@@ -0,0 +1,1146 @@
1/*
2 * Procedures for creating, accessing and interpreting the device tree.
3 *
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <stdarg.h>
17#include <linux/kernel.h>
18#include <linux/string.h>
19#include <linux/init.h>
20#include <linux/threads.h>
21#include <linux/spinlock.h>
22#include <linux/types.h>
23#include <linux/pci.h>
24#include <linux/stringify.h>
25#include <linux/delay.h>
26#include <linux/initrd.h>
27#include <linux/bitops.h>
28#include <linux/module.h>
29#include <linux/kexec.h>
30#include <linux/debugfs.h>
31#include <linux/irq.h>
32#include <linux/lmb.h>
33
34#include <asm/prom.h>
35#include <asm/page.h>
36#include <asm/processor.h>
37#include <asm/irq.h>
38#include <linux/io.h>
39#include <asm/system.h>
40#include <asm/mmu.h>
41#include <asm/pgtable.h>
42#include <asm/sections.h>
43#include <asm/pci-bridge.h>
44
45static int __initdata dt_root_addr_cells;
46static int __initdata dt_root_size_cells;
47
48typedef u32 cell_t;
49
50static struct boot_param_header *initial_boot_params;
51
52/* export that to outside world */
53struct device_node *of_chosen;
54
55static inline char *find_flat_dt_string(u32 offset)
56{
57 return ((char *)initial_boot_params) +
58 initial_boot_params->off_dt_strings + offset;
59}
60
61/**
62 * This function is used to scan the flattened device-tree, it is
63 * used to extract the memory informations at boot before we can
64 * unflatten the tree
65 */
66int __init of_scan_flat_dt(int (*it)(unsigned long node,
67 const char *uname, int depth,
68 void *data),
69 void *data)
70{
71 unsigned long p = ((unsigned long)initial_boot_params) +
72 initial_boot_params->off_dt_struct;
73 int rc = 0;
74 int depth = -1;
75
76 do {
77 u32 tag = *((u32 *)p);
78 char *pathp;
79
80 p += 4;
81 if (tag == OF_DT_END_NODE) {
82 depth--;
83 continue;
84 }
85 if (tag == OF_DT_NOP)
86 continue;
87 if (tag == OF_DT_END)
88 break;
89 if (tag == OF_DT_PROP) {
90 u32 sz = *((u32 *)p);
91 p += 8;
92 if (initial_boot_params->version < 0x10)
93 p = _ALIGN(p, sz >= 8 ? 8 : 4);
94 p += sz;
95 p = _ALIGN(p, 4);
96 continue;
97 }
98 if (tag != OF_DT_BEGIN_NODE) {
99 printk(KERN_WARNING "Invalid tag %x scanning flattened"
100 " device tree !\n", tag);
101 return -EINVAL;
102 }
103 depth++;
104 pathp = (char *)p;
105 p = _ALIGN(p + strlen(pathp) + 1, 4);
106 if ((*pathp) == '/') {
107 char *lp, *np;
108 for (lp = NULL, np = pathp; *np; np++)
109 if ((*np) == '/')
110 lp = np+1;
111 if (lp != NULL)
112 pathp = lp;
113 }
114 rc = it(p, pathp, depth, data);
115 if (rc != 0)
116 break;
117 } while (1);
118
119 return rc;
120}
121
122unsigned long __init of_get_flat_dt_root(void)
123{
124 unsigned long p = ((unsigned long)initial_boot_params) +
125 initial_boot_params->off_dt_struct;
126
127 while (*((u32 *)p) == OF_DT_NOP)
128 p += 4;
129 BUG_ON(*((u32 *)p) != OF_DT_BEGIN_NODE);
130 p += 4;
131 return _ALIGN(p + strlen((char *)p) + 1, 4);
132}
133
134/**
135 * This function can be used within scan_flattened_dt callback to get
136 * access to properties
137 */
138void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
139 unsigned long *size)
140{
141 unsigned long p = node;
142
143 do {
144 u32 tag = *((u32 *)p);
145 u32 sz, noff;
146 const char *nstr;
147
148 p += 4;
149 if (tag == OF_DT_NOP)
150 continue;
151 if (tag != OF_DT_PROP)
152 return NULL;
153
154 sz = *((u32 *)p);
155 noff = *((u32 *)(p + 4));
156 p += 8;
157 if (initial_boot_params->version < 0x10)
158 p = _ALIGN(p, sz >= 8 ? 8 : 4);
159
160 nstr = find_flat_dt_string(noff);
161 if (nstr == NULL) {
162 printk(KERN_WARNING "Can't find property index"
163 " name !\n");
164 return NULL;
165 }
166 if (strcmp(name, nstr) == 0) {
167 if (size)
168 *size = sz;
169 return (void *)p;
170 }
171 p += sz;
172 p = _ALIGN(p, 4);
173 } while (1);
174}
175
176int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
177{
178 const char *cp;
179 unsigned long cplen, l;
180
181 cp = of_get_flat_dt_prop(node, "compatible", &cplen);
182 if (cp == NULL)
183 return 0;
184 while (cplen > 0) {
185 if (strncasecmp(cp, compat, strlen(compat)) == 0)
186 return 1;
187 l = strlen(cp) + 1;
188 cp += l;
189 cplen -= l;
190 }
191
192 return 0;
193}
194
195static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
196 unsigned long align)
197{
198 void *res;
199
200 *mem = _ALIGN(*mem, align);
201 res = (void *)*mem;
202 *mem += size;
203
204 return res;
205}
206
207static unsigned long __init unflatten_dt_node(unsigned long mem,
208 unsigned long *p,
209 struct device_node *dad,
210 struct device_node ***allnextpp,
211 unsigned long fpsize)
212{
213 struct device_node *np;
214 struct property *pp, **prev_pp = NULL;
215 char *pathp;
216 u32 tag;
217 unsigned int l, allocl;
218 int has_name = 0;
219 int new_format = 0;
220
221 tag = *((u32 *)(*p));
222 if (tag != OF_DT_BEGIN_NODE) {
223 printk("Weird tag at start of node: %x\n", tag);
224 return mem;
225 }
226 *p += 4;
227 pathp = (char *)*p;
228 l = allocl = strlen(pathp) + 1;
229 *p = _ALIGN(*p + l, 4);
230
231 /* version 0x10 has a more compact unit name here instead of the full
232 * path. we accumulate the full path size using "fpsize", we'll rebuild
233 * it later. We detect this because the first character of the name is
234 * not '/'.
235 */
236 if ((*pathp) != '/') {
237 new_format = 1;
238 if (fpsize == 0) {
239 /* root node: special case. fpsize accounts for path
240 * plus terminating zero. root node only has '/', so
241 * fpsize should be 2, but we want to avoid the first
242 * level nodes to have two '/' so we use fpsize 1 here
243 */
244 fpsize = 1;
245 allocl = 2;
246 } else {
247 /* account for '/' and path size minus terminal 0
248 * already in 'l'
249 */
250 fpsize += l;
251 allocl = fpsize;
252 }
253 }
254
255 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
256 __alignof__(struct device_node));
257 if (allnextpp) {
258 memset(np, 0, sizeof(*np));
259 np->full_name = ((char *)np) + sizeof(struct device_node);
260 if (new_format) {
261 char *p2 = np->full_name;
262 /* rebuild full path for new format */
263 if (dad && dad->parent) {
264 strcpy(p2, dad->full_name);
265#ifdef DEBUG
266 if ((strlen(p2) + l + 1) != allocl) {
267 pr_debug("%s: p: %d, l: %d, a: %d\n",
268 pathp, (int)strlen(p2),
269 l, allocl);
270 }
271#endif
272 p2 += strlen(p2);
273 }
274 *(p2++) = '/';
275 memcpy(p2, pathp, l);
276 } else
277 memcpy(np->full_name, pathp, l);
278 prev_pp = &np->properties;
279 **allnextpp = np;
280 *allnextpp = &np->allnext;
281 if (dad != NULL) {
282 np->parent = dad;
283 /* we temporarily use the next field as `last_child'*/
284 if (dad->next == NULL)
285 dad->child = np;
286 else
287 dad->next->sibling = np;
288 dad->next = np;
289 }
290 kref_init(&np->kref);
291 }
292 while (1) {
293 u32 sz, noff;
294 char *pname;
295
296 tag = *((u32 *)(*p));
297 if (tag == OF_DT_NOP) {
298 *p += 4;
299 continue;
300 }
301 if (tag != OF_DT_PROP)
302 break;
303 *p += 4;
304 sz = *((u32 *)(*p));
305 noff = *((u32 *)((*p) + 4));
306 *p += 8;
307 if (initial_boot_params->version < 0x10)
308 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
309
310 pname = find_flat_dt_string(noff);
311 if (pname == NULL) {
312 printk(KERN_INFO
313 "Can't find property name in list !\n");
314 break;
315 }
316 if (strcmp(pname, "name") == 0)
317 has_name = 1;
318 l = strlen(pname) + 1;
319 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
320 __alignof__(struct property));
321 if (allnextpp) {
322 if (strcmp(pname, "linux,phandle") == 0) {
323 np->node = *((u32 *)*p);
324 if (np->linux_phandle == 0)
325 np->linux_phandle = np->node;
326 }
327 if (strcmp(pname, "ibm,phandle") == 0)
328 np->linux_phandle = *((u32 *)*p);
329 pp->name = pname;
330 pp->length = sz;
331 pp->value = (void *)*p;
332 *prev_pp = pp;
333 prev_pp = &pp->next;
334 }
335 *p = _ALIGN((*p) + sz, 4);
336 }
337 /* with version 0x10 we may not have the name property, recreate
338 * it here from the unit name if absent
339 */
340 if (!has_name) {
341 char *p1 = pathp, *ps = pathp, *pa = NULL;
342 int sz;
343
344 while (*p1) {
345 if ((*p1) == '@')
346 pa = p1;
347 if ((*p1) == '/')
348 ps = p1 + 1;
349 p1++;
350 }
351 if (pa < ps)
352 pa = p1;
353 sz = (pa - ps) + 1;
354 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
355 __alignof__(struct property));
356 if (allnextpp) {
357 pp->name = "name";
358 pp->length = sz;
359 pp->value = pp + 1;
360 *prev_pp = pp;
361 prev_pp = &pp->next;
362 memcpy(pp->value, ps, sz - 1);
363 ((char *)pp->value)[sz - 1] = 0;
364 pr_debug("fixed up name for %s -> %s\n", pathp,
365 (char *)pp->value);
366 }
367 }
368 if (allnextpp) {
369 *prev_pp = NULL;
370 np->name = of_get_property(np, "name", NULL);
371 np->type = of_get_property(np, "device_type", NULL);
372
373 if (!np->name)
374 np->name = "<NULL>";
375 if (!np->type)
376 np->type = "<NULL>";
377 }
378 while (tag == OF_DT_BEGIN_NODE) {
379 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
380 tag = *((u32 *)(*p));
381 }
382 if (tag != OF_DT_END_NODE) {
383 printk(KERN_INFO "Weird tag at end of node: %x\n", tag);
384 return mem;
385 }
386 *p += 4;
387 return mem;
388}
389
390/**
391 * unflattens the device-tree passed by the firmware, creating the
392 * tree of struct device_node. It also fills the "name" and "type"
393 * pointers of the nodes so the normal device-tree walking functions
394 * can be used (this used to be done by finish_device_tree)
395 */
396void __init unflatten_device_tree(void)
397{
398 unsigned long start, mem, size;
399 struct device_node **allnextp = &allnodes;
400
401 pr_debug(" -> unflatten_device_tree()\n");
402
403 /* First pass, scan for size */
404 start = ((unsigned long)initial_boot_params) +
405 initial_boot_params->off_dt_struct;
406 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
407 size = (size | 3) + 1;
408
409 pr_debug(" size is %lx, allocating...\n", size);
410
411 /* Allocate memory for the expanded device tree */
412 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
413 mem = (unsigned long) __va(mem);
414
415 ((u32 *)mem)[size / 4] = 0xdeadbeef;
416
417 pr_debug(" unflattening %lx...\n", mem);
418
419 /* Second pass, do actual unflattening */
420 start = ((unsigned long)initial_boot_params) +
421 initial_boot_params->off_dt_struct;
422 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
423 if (*((u32 *)start) != OF_DT_END)
424 printk(KERN_WARNING "Weird tag at end of tree: %08x\n",
425 *((u32 *)start));
426 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
427 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
428 ((u32 *)mem)[size / 4]);
429 *allnextp = NULL;
430
431 /* Get pointer to OF "/chosen" node for use everywhere */
432 of_chosen = of_find_node_by_path("/chosen");
433 if (of_chosen == NULL)
434 of_chosen = of_find_node_by_path("/chosen@0");
435
436 pr_debug(" <- unflatten_device_tree()\n");
437}
438
439#define early_init_dt_scan_drconf_memory(node) 0
440
441static int __init early_init_dt_scan_cpus(unsigned long node,
442 const char *uname, int depth,
443 void *data)
444{
445 static int logical_cpuid;
446 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
447 const u32 *intserv;
448 int i, nthreads;
449 int found = 0;
450
451 /* We are scanning "cpu" nodes only */
452 if (type == NULL || strcmp(type, "cpu") != 0)
453 return 0;
454
455 /* Get physical cpuid */
456 intserv = of_get_flat_dt_prop(node, "reg", NULL);
457 nthreads = 1;
458
459 /*
460 * Now see if any of these threads match our boot cpu.
461 * NOTE: This must match the parsing done in smp_setup_cpu_maps.
462 */
463 for (i = 0; i < nthreads; i++) {
464 /*
465 * version 2 of the kexec param format adds the phys cpuid of
466 * booted proc.
467 */
468 if (initial_boot_params && initial_boot_params->version >= 2) {
469 if (intserv[i] ==
470 initial_boot_params->boot_cpuid_phys) {
471 found = 1;
472 break;
473 }
474 } else {
475 /*
476 * Check if it's the boot-cpu, set it's hw index now,
477 * unfortunately this format did not support booting
478 * off secondary threads.
479 */
480 if (of_get_flat_dt_prop(node,
481 "linux,boot-cpu", NULL) != NULL) {
482 found = 1;
483 break;
484 }
485 }
486
487#ifdef CONFIG_SMP
488 /* logical cpu id is always 0 on UP kernels */
489 logical_cpuid++;
490#endif
491 }
492
493 if (found) {
494 pr_debug("boot cpu: logical %d physical %d\n", logical_cpuid,
495 intserv[i]);
496 boot_cpuid = logical_cpuid;
497 }
498
499 return 0;
500}
501
502#ifdef CONFIG_BLK_DEV_INITRD
503static void __init early_init_dt_check_for_initrd(unsigned long node)
504{
505 unsigned long l;
506 u32 *prop;
507
508 pr_debug("Looking for initrd properties... ");
509
510 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
511 if (prop) {
512 initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4));
513
514 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
515 if (prop) {
516 initrd_end = (unsigned long)
517 __va(of_read_ulong(prop, l/4));
518 initrd_below_start_ok = 1;
519 } else {
520 initrd_start = 0;
521 }
522 }
523
524 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n",
525 initrd_start, initrd_end);
526}
527#else
528static inline void early_init_dt_check_for_initrd(unsigned long node)
529{
530}
531#endif /* CONFIG_BLK_DEV_INITRD */
532
533static int __init early_init_dt_scan_chosen(unsigned long node,
534 const char *uname, int depth, void *data)
535{
536 unsigned long l;
537 char *p;
538
539 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
540
541 if (depth != 1 ||
542 (strcmp(uname, "chosen") != 0 &&
543 strcmp(uname, "chosen@0") != 0))
544 return 0;
545
546#ifdef CONFIG_KEXEC
547 lprop = (u64 *)of_get_flat_dt_prop(node,
548 "linux,crashkernel-base", NULL);
549 if (lprop)
550 crashk_res.start = *lprop;
551
552 lprop = (u64 *)of_get_flat_dt_prop(node,
553 "linux,crashkernel-size", NULL);
554 if (lprop)
555 crashk_res.end = crashk_res.start + *lprop - 1;
556#endif
557
558 early_init_dt_check_for_initrd(node);
559
560 /* Retreive command line */
561 p = of_get_flat_dt_prop(node, "bootargs", &l);
562 if (p != NULL && l > 0)
563 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
564
565#ifdef CONFIG_CMDLINE
566 if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
567 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
568#endif /* CONFIG_CMDLINE */
569
570 pr_debug("Command line is: %s\n", cmd_line);
571
572 /* break now */
573 return 1;
574}
575
576static int __init early_init_dt_scan_root(unsigned long node,
577 const char *uname, int depth, void *data)
578{
579 u32 *prop;
580
581 if (depth != 0)
582 return 0;
583
584 prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
585 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
586 pr_debug("dt_root_size_cells = %x\n", dt_root_size_cells);
587
588 prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
589 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
590 pr_debug("dt_root_addr_cells = %x\n", dt_root_addr_cells);
591
592 /* break now */
593 return 1;
594}
595
596static u64 __init dt_mem_next_cell(int s, cell_t **cellp)
597{
598 cell_t *p = *cellp;
599
600 *cellp = p + s;
601 return of_read_number(p, s);
602}
603
604static int __init early_init_dt_scan_memory(unsigned long node,
605 const char *uname, int depth, void *data)
606{
607 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
608 cell_t *reg, *endp;
609 unsigned long l;
610
611 /* Look for the ibm,dynamic-reconfiguration-memory node */
612/* if (depth == 1 &&
613 strcmp(uname, "ibm,dynamic-reconfiguration-memory") == 0)
614 return early_init_dt_scan_drconf_memory(node);
615*/
616 /* We are scanning "memory" nodes only */
617 if (type == NULL) {
618 /*
619 * The longtrail doesn't have a device_type on the
620 * /memory node, so look for the node called /memory@0.
621 */
622 if (depth != 1 || strcmp(uname, "memory@0") != 0)
623 return 0;
624 } else if (strcmp(type, "memory") != 0)
625 return 0;
626
627 reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
628 if (reg == NULL)
629 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
630 if (reg == NULL)
631 return 0;
632
633 endp = reg + (l / sizeof(cell_t));
634
635 pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
636 uname, l, reg[0], reg[1], reg[2], reg[3]);
637
638 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
639 u64 base, size;
640
641 base = dt_mem_next_cell(dt_root_addr_cells, &reg);
642 size = dt_mem_next_cell(dt_root_size_cells, &reg);
643
644 if (size == 0)
645 continue;
646 pr_debug(" - %llx , %llx\n", (unsigned long long)base,
647 (unsigned long long)size);
648
649 lmb_add(base, size);
650 }
651 return 0;
652}
653
654#ifdef CONFIG_PHYP_DUMP
655/**
656 * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
657 *
658 * Function to find the largest size we need to reserve
659 * during early boot process.
660 *
661 * It either looks for boot param and returns that OR
662 * returns larger of 256 or 5% rounded down to multiples of 256MB.
663 *
664 */
665static inline unsigned long phyp_dump_calculate_reserve_size(void)
666{
667 unsigned long tmp;
668
669 if (phyp_dump_info->reserve_bootvar)
670 return phyp_dump_info->reserve_bootvar;
671
672 /* divide by 20 to get 5% of value */
673 tmp = lmb_end_of_DRAM();
674 do_div(tmp, 20);
675
676 /* round it down in multiples of 256 */
677 tmp = tmp & ~0x0FFFFFFFUL;
678
679 return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
680}
681
682/**
683 * phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
684 *
685 * This routine may reserve memory regions in the kernel only
686 * if the system is supported and a dump was taken in last
687 * boot instance or if the hardware is supported and the
688 * scratch area needs to be setup. In other instances it returns
689 * without reserving anything. The memory in case of dump being
690 * active is freed when the dump is collected (by userland tools).
691 */
692static void __init phyp_dump_reserve_mem(void)
693{
694 unsigned long base, size;
695 unsigned long variable_reserve_size;
696
697 if (!phyp_dump_info->phyp_dump_configured) {
698 printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
699 return;
700 }
701
702 if (!phyp_dump_info->phyp_dump_at_boot) {
703 printk(KERN_INFO "Phyp-dump disabled at boot time\n");
704 return;
705 }
706
707 variable_reserve_size = phyp_dump_calculate_reserve_size();
708
709 if (phyp_dump_info->phyp_dump_is_active) {
710 /* Reserve *everything* above RMR.Area freed by userland tools*/
711 base = variable_reserve_size;
712 size = lmb_end_of_DRAM() - base;
713
714 /* XXX crashed_ram_end is wrong, since it may be beyond
715 * the memory_limit, it will need to be adjusted. */
716 lmb_reserve(base, size);
717
718 phyp_dump_info->init_reserve_start = base;
719 phyp_dump_info->init_reserve_size = size;
720 } else {
721 size = phyp_dump_info->cpu_state_size +
722 phyp_dump_info->hpte_region_size +
723 variable_reserve_size;
724 base = lmb_end_of_DRAM() - size;
725 lmb_reserve(base, size);
726 phyp_dump_info->init_reserve_start = base;
727 phyp_dump_info->init_reserve_size = size;
728 }
729}
730#else
731static inline void __init phyp_dump_reserve_mem(void) {}
732#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
733
734#ifdef CONFIG_EARLY_PRINTK
735/* MS this is Microblaze specifig function */
736static int __init early_init_dt_scan_serial(unsigned long node,
737 const char *uname, int depth, void *data)
738{
739 unsigned long l;
740 char *p;
741 int *addr;
742
743 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
744
745/* find all serial nodes */
746 if (strncmp(uname, "serial", 6) != 0)
747 return 0;
748
749 early_init_dt_check_for_initrd(node);
750
751/* find compatible node with uartlite */
752 p = of_get_flat_dt_prop(node, "compatible", &l);
753 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&
754 (strncmp(p, "xlnx,opb-uartlite", 17) != 0))
755 return 0;
756
757 addr = of_get_flat_dt_prop(node, "reg", &l);
758 return *addr; /* return address */
759}
760
761/* this function is looking for early uartlite console - Microblaze specific */
762int __init early_uartlite_console(void)
763{
764 return of_scan_flat_dt(early_init_dt_scan_serial, NULL);
765}
766#endif
767
768void __init early_init_devtree(void *params)
769{
770 pr_debug(" -> early_init_devtree(%p)\n", params);
771
772 /* Setup flat device-tree pointer */
773 initial_boot_params = params;
774
775#ifdef CONFIG_PHYP_DUMP
776 /* scan tree to see if dump occured during last boot */
777 of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
778#endif
779
780 /* Retrieve various informations from the /chosen node of the
781 * device-tree, including the platform type, initrd location and
782 * size, TCE reserve, and more ...
783 */
784 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
785
786 /* Scan memory nodes and rebuild LMBs */
787 lmb_init();
788 of_scan_flat_dt(early_init_dt_scan_root, NULL);
789 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
790
791 /* Save command line for /proc/cmdline and then parse parameters */
792 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
793 parse_early_param();
794
795 lmb_analyze();
796
797 pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size());
798
799 pr_debug("Scanning CPUs ...\n");
800
801 /* Retreive CPU related informations from the flat tree
802 * (altivec support, boot CPU ID, ...)
803 */
804 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
805
806 pr_debug(" <- early_init_devtree()\n");
807}
808
809/**
810 * Indicates whether the root node has a given value in its
811 * compatible property.
812 */
813int machine_is_compatible(const char *compat)
814{
815 struct device_node *root;
816 int rc = 0;
817
818 root = of_find_node_by_path("/");
819 if (root) {
820 rc = of_device_is_compatible(root, compat);
821 of_node_put(root);
822 }
823 return rc;
824}
825EXPORT_SYMBOL(machine_is_compatible);
826
827/*******
828 *
829 * New implementation of the OF "find" APIs, return a refcounted
830 * object, call of_node_put() when done. The device tree and list
831 * are protected by a rw_lock.
832 *
833 * Note that property management will need some locking as well,
834 * this isn't dealt with yet.
835 *
836 *******/
837
838/**
839 * of_find_node_by_phandle - Find a node given a phandle
840 * @handle: phandle of the node to find
841 *
842 * Returns a node pointer with refcount incremented, use
843 * of_node_put() on it when done.
844 */
845struct device_node *of_find_node_by_phandle(phandle handle)
846{
847 struct device_node *np;
848
849 read_lock(&devtree_lock);
850 for (np = allnodes; np != NULL; np = np->allnext)
851 if (np->linux_phandle == handle)
852 break;
853 of_node_get(np);
854 read_unlock(&devtree_lock);
855 return np;
856}
857EXPORT_SYMBOL(of_find_node_by_phandle);
858
859/**
860 * of_find_all_nodes - Get next node in global list
861 * @prev: Previous node or NULL to start iteration
862 * of_node_put() will be called on it
863 *
864 * Returns a node pointer with refcount incremented, use
865 * of_node_put() on it when done.
866 */
867struct device_node *of_find_all_nodes(struct device_node *prev)
868{
869 struct device_node *np;
870
871 read_lock(&devtree_lock);
872 np = prev ? prev->allnext : allnodes;
873 for (; np != NULL; np = np->allnext)
874 if (of_node_get(np))
875 break;
876 of_node_put(prev);
877 read_unlock(&devtree_lock);
878 return np;
879}
880EXPORT_SYMBOL(of_find_all_nodes);
881
882/**
883 * of_node_get - Increment refcount of a node
884 * @node: Node to inc refcount, NULL is supported to
885 * simplify writing of callers
886 *
887 * Returns node.
888 */
889struct device_node *of_node_get(struct device_node *node)
890{
891 if (node)
892 kref_get(&node->kref);
893 return node;
894}
895EXPORT_SYMBOL(of_node_get);
896
897static inline struct device_node *kref_to_device_node(struct kref *kref)
898{
899 return container_of(kref, struct device_node, kref);
900}
901
902/**
903 * of_node_release - release a dynamically allocated node
904 * @kref: kref element of the node to be released
905 *
906 * In of_node_put() this function is passed to kref_put()
907 * as the destructor.
908 */
909static void of_node_release(struct kref *kref)
910{
911 struct device_node *node = kref_to_device_node(kref);
912 struct property *prop = node->properties;
913
914 /* We should never be releasing nodes that haven't been detached. */
915 if (!of_node_check_flag(node, OF_DETACHED)) {
916 printk(KERN_INFO "WARNING: Bad of_node_put() on %s\n",
917 node->full_name);
918 dump_stack();
919 kref_init(&node->kref);
920 return;
921 }
922
923 if (!of_node_check_flag(node, OF_DYNAMIC))
924 return;
925
926 while (prop) {
927 struct property *next = prop->next;
928 kfree(prop->name);
929 kfree(prop->value);
930 kfree(prop);
931 prop = next;
932
933 if (!prop) {
934 prop = node->deadprops;
935 node->deadprops = NULL;
936 }
937 }
938 kfree(node->full_name);
939 kfree(node->data);
940 kfree(node);
941}
942
943/**
944 * of_node_put - Decrement refcount of a node
945 * @node: Node to dec refcount, NULL is supported to
946 * simplify writing of callers
947 *
948 */
949void of_node_put(struct device_node *node)
950{
951 if (node)
952 kref_put(&node->kref, of_node_release);
953}
954EXPORT_SYMBOL(of_node_put);
955
956/*
957 * Plug a device node into the tree and global list.
958 */
959void of_attach_node(struct device_node *np)
960{
961 unsigned long flags;
962
963 write_lock_irqsave(&devtree_lock, flags);
964 np->sibling = np->parent->child;
965 np->allnext = allnodes;
966 np->parent->child = np;
967 allnodes = np;
968 write_unlock_irqrestore(&devtree_lock, flags);
969}
970
971/*
972 * "Unplug" a node from the device tree. The caller must hold
973 * a reference to the node. The memory associated with the node
974 * is not freed until its refcount goes to zero.
975 */
976void of_detach_node(struct device_node *np)
977{
978 struct device_node *parent;
979 unsigned long flags;
980
981 write_lock_irqsave(&devtree_lock, flags);
982
983 parent = np->parent;
984 if (!parent)
985 goto out_unlock;
986
987 if (allnodes == np)
988 allnodes = np->allnext;
989 else {
990 struct device_node *prev;
991 for (prev = allnodes;
992 prev->allnext != np;
993 prev = prev->allnext)
994 ;
995 prev->allnext = np->allnext;
996 }
997
998 if (parent->child == np)
999 parent->child = np->sibling;
1000 else {
1001 struct device_node *prevsib;
1002 for (prevsib = np->parent->child;
1003 prevsib->sibling != np;
1004 prevsib = prevsib->sibling)
1005 ;
1006 prevsib->sibling = np->sibling;
1007 }
1008
1009 of_node_set_flag(np, OF_DETACHED);
1010
1011out_unlock:
1012 write_unlock_irqrestore(&devtree_lock, flags);
1013}
1014
1015/*
1016 * Add a property to a node
1017 */
1018int prom_add_property(struct device_node *np, struct property *prop)
1019{
1020 struct property **next;
1021 unsigned long flags;
1022
1023 prop->next = NULL;
1024 write_lock_irqsave(&devtree_lock, flags);
1025 next = &np->properties;
1026 while (*next) {
1027 if (strcmp(prop->name, (*next)->name) == 0) {
1028 /* duplicate ! don't insert it */
1029 write_unlock_irqrestore(&devtree_lock, flags);
1030 return -1;
1031 }
1032 next = &(*next)->next;
1033 }
1034 *next = prop;
1035 write_unlock_irqrestore(&devtree_lock, flags);
1036
1037#ifdef CONFIG_PROC_DEVICETREE
1038 /* try to add to proc as well if it was initialized */
1039 if (np->pde)
1040 proc_device_tree_add_prop(np->pde, prop);
1041#endif /* CONFIG_PROC_DEVICETREE */
1042
1043 return 0;
1044}
1045
1046/*
1047 * Remove a property from a node. Note that we don't actually
1048 * remove it, since we have given out who-knows-how-many pointers
1049 * to the data using get-property. Instead we just move the property
1050 * to the "dead properties" list, so it won't be found any more.
1051 */
1052int prom_remove_property(struct device_node *np, struct property *prop)
1053{
1054 struct property **next;
1055 unsigned long flags;
1056 int found = 0;
1057
1058 write_lock_irqsave(&devtree_lock, flags);
1059 next = &np->properties;
1060 while (*next) {
1061 if (*next == prop) {
1062 /* found the node */
1063 *next = prop->next;
1064 prop->next = np->deadprops;
1065 np->deadprops = prop;
1066 found = 1;
1067 break;
1068 }
1069 next = &(*next)->next;
1070 }
1071 write_unlock_irqrestore(&devtree_lock, flags);
1072
1073 if (!found)
1074 return -ENODEV;
1075
1076#ifdef CONFIG_PROC_DEVICETREE
1077 /* try to remove the proc node as well */
1078 if (np->pde)
1079 proc_device_tree_remove_prop(np->pde, prop);
1080#endif /* CONFIG_PROC_DEVICETREE */
1081
1082 return 0;
1083}
1084
1085/*
1086 * Update a property in a node. Note that we don't actually
1087 * remove it, since we have given out who-knows-how-many pointers
1088 * to the data using get-property. Instead we just move the property
1089 * to the "dead properties" list, and add the new property to the
1090 * property list
1091 */
1092int prom_update_property(struct device_node *np,
1093 struct property *newprop,
1094 struct property *oldprop)
1095{
1096 struct property **next;
1097 unsigned long flags;
1098 int found = 0;
1099
1100 write_lock_irqsave(&devtree_lock, flags);
1101 next = &np->properties;
1102 while (*next) {
1103 if (*next == oldprop) {
1104 /* found the node */
1105 newprop->next = oldprop->next;
1106 *next = newprop;
1107 oldprop->next = np->deadprops;
1108 np->deadprops = oldprop;
1109 found = 1;
1110 break;
1111 }
1112 next = &(*next)->next;
1113 }
1114 write_unlock_irqrestore(&devtree_lock, flags);
1115
1116 if (!found)
1117 return -ENODEV;
1118
1119#ifdef CONFIG_PROC_DEVICETREE
1120 /* try to add to proc as well if it was initialized */
1121 if (np->pde)
1122 proc_device_tree_update_prop(np->pde, newprop, oldprop);
1123#endif /* CONFIG_PROC_DEVICETREE */
1124
1125 return 0;
1126}
1127
1128#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
1129static struct debugfs_blob_wrapper flat_dt_blob;
1130
1131static int __init export_flat_device_tree(void)
1132{
1133 struct dentry *d;
1134
1135 flat_dt_blob.data = initial_boot_params;
1136 flat_dt_blob.size = initial_boot_params->totalsize;
1137
1138 d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
1139 of_debugfs_root, &flat_dt_blob);
1140 if (!d)
1141 return 1;
1142
1143 return 0;
1144}
1145device_initcall(export_flat_device_tree);
1146#endif
diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c
new file mode 100644
index 000000000000..ae0352ecd5a9
--- /dev/null
+++ b/arch/microblaze/kernel/prom_parse.c
@@ -0,0 +1,1025 @@
1#undef DEBUG
2
3#include <linux/kernel.h>
4#include <linux/string.h>
5#include <linux/pci_regs.h>
6#include <linux/module.h>
7#include <linux/ioport.h>
8#include <linux/etherdevice.h>
9#include <asm/prom.h>
10#include <asm/pci-bridge.h>
11
12#define PRu64 "%llx"
13
14/* Max address size we deal with */
15#define OF_MAX_ADDR_CELLS 4
16#define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
17 (ns) > 0)
18
19static struct of_bus *of_match_bus(struct device_node *np);
20static int __of_address_to_resource(struct device_node *dev,
21 const u32 *addrp, u64 size, unsigned int flags,
22 struct resource *r);
23
24/* Debug utility */
25#ifdef DEBUG
26static void of_dump_addr(const char *s, const u32 *addr, int na)
27{
28 printk(KERN_INFO "%s", s);
29 while (na--)
30 printk(KERN_INFO " %08x", *(addr++));
31 printk(KERN_INFO "\n");
32}
33#else
34static void of_dump_addr(const char *s, const u32 *addr, int na) { }
35#endif
36
37/* Callbacks for bus specific translators */
38struct of_bus {
39 const char *name;
40 const char *addresses;
41 int (*match)(struct device_node *parent);
42 void (*count_cells)(struct device_node *child,
43 int *addrc, int *sizec);
44 u64 (*map)(u32 *addr, const u32 *range,
45 int na, int ns, int pna);
46 int (*translate)(u32 *addr, u64 offset, int na);
47 unsigned int (*get_flags)(const u32 *addr);
48};
49
50/*
51 * Default translator (generic bus)
52 */
53
54static void of_bus_default_count_cells(struct device_node *dev,
55 int *addrc, int *sizec)
56{
57 if (addrc)
58 *addrc = of_n_addr_cells(dev);
59 if (sizec)
60 *sizec = of_n_size_cells(dev);
61}
62
63static u64 of_bus_default_map(u32 *addr, const u32 *range,
64 int na, int ns, int pna)
65{
66 u64 cp, s, da;
67
68 cp = of_read_number(range, na);
69 s = of_read_number(range + na + pna, ns);
70 da = of_read_number(addr, na);
71
72 pr_debug("OF: default map, cp="PRu64", s="PRu64", da="PRu64"\n",
73 cp, s, da);
74
75 if (da < cp || da >= (cp + s))
76 return OF_BAD_ADDR;
77 return da - cp;
78}
79
80static int of_bus_default_translate(u32 *addr, u64 offset, int na)
81{
82 u64 a = of_read_number(addr, na);
83 memset(addr, 0, na * 4);
84 a += offset;
85 if (na > 1)
86 addr[na - 2] = a >> 32;
87 addr[na - 1] = a & 0xffffffffu;
88
89 return 0;
90}
91
92static unsigned int of_bus_default_get_flags(const u32 *addr)
93{
94 return IORESOURCE_MEM;
95}
96
97#ifdef CONFIG_PCI
98/*
99 * PCI bus specific translator
100 */
101
102static int of_bus_pci_match(struct device_node *np)
103{
104 /* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */
105 return !strcmp(np->type, "pci") || !strcmp(np->type, "vci");
106}
107
108static void of_bus_pci_count_cells(struct device_node *np,
109 int *addrc, int *sizec)
110{
111 if (addrc)
112 *addrc = 3;
113 if (sizec)
114 *sizec = 2;
115}
116
117static u64 of_bus_pci_map(u32 *addr, const u32 *range, int na, int ns, int pna)
118{
119 u64 cp, s, da;
120
121 /* Check address type match */
122 if ((addr[0] ^ range[0]) & 0x03000000)
123 return OF_BAD_ADDR;
124
125 /* Read address values, skipping high cell */
126 cp = of_read_number(range + 1, na - 1);
127 s = of_read_number(range + na + pna, ns);
128 da = of_read_number(addr + 1, na - 1);
129
130 pr_debug("OF: PCI map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
131
132 if (da < cp || da >= (cp + s))
133 return OF_BAD_ADDR;
134 return da - cp;
135}
136
137static int of_bus_pci_translate(u32 *addr, u64 offset, int na)
138{
139 return of_bus_default_translate(addr + 1, offset, na - 1);
140}
141
142static unsigned int of_bus_pci_get_flags(const u32 *addr)
143{
144 unsigned int flags = 0;
145 u32 w = addr[0];
146
147 switch ((w >> 24) & 0x03) {
148 case 0x01:
149 flags |= IORESOURCE_IO;
150 break;
151 case 0x02: /* 32 bits */
152 case 0x03: /* 64 bits */
153 flags |= IORESOURCE_MEM;
154 break;
155 }
156 if (w & 0x40000000)
157 flags |= IORESOURCE_PREFETCH;
158 return flags;
159}
160
161const u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
162 unsigned int *flags)
163{
164 const u32 *prop;
165 unsigned int psize;
166 struct device_node *parent;
167 struct of_bus *bus;
168 int onesize, i, na, ns;
169
170 /* Get parent & match bus type */
171 parent = of_get_parent(dev);
172 if (parent == NULL)
173 return NULL;
174 bus = of_match_bus(parent);
175 if (strcmp(bus->name, "pci")) {
176 of_node_put(parent);
177 return NULL;
178 }
179 bus->count_cells(dev, &na, &ns);
180 of_node_put(parent);
181 if (!OF_CHECK_COUNTS(na, ns))
182 return NULL;
183
184 /* Get "reg" or "assigned-addresses" property */
185 prop = of_get_property(dev, bus->addresses, &psize);
186 if (prop == NULL)
187 return NULL;
188 psize /= 4;
189
190 onesize = na + ns;
191 for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++)
192 if ((prop[0] & 0xff) == ((bar_no * 4) + PCI_BASE_ADDRESS_0)) {
193 if (size)
194 *size = of_read_number(prop + na, ns);
195 if (flags)
196 *flags = bus->get_flags(prop);
197 return prop;
198 }
199 return NULL;
200}
201EXPORT_SYMBOL(of_get_pci_address);
202
203int of_pci_address_to_resource(struct device_node *dev, int bar,
204 struct resource *r)
205{
206 const u32 *addrp;
207 u64 size;
208 unsigned int flags;
209
210 addrp = of_get_pci_address(dev, bar, &size, &flags);
211 if (addrp == NULL)
212 return -EINVAL;
213 return __of_address_to_resource(dev, addrp, size, flags, r);
214}
215EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
216
217static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
218{
219 return (((pin - 1) + slot) % 4) + 1;
220}
221
222int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
223{
224 struct device_node *dn, *ppnode;
225 struct pci_dev *ppdev;
226 u32 lspec;
227 u32 laddr[3];
228 u8 pin;
229 int rc;
230
231 /* Check if we have a device node, if yes, fallback to standard OF
232 * parsing
233 */
234 dn = pci_device_to_OF_node(pdev);
235 if (dn)
236 return of_irq_map_one(dn, 0, out_irq);
237
238 /* Ok, we don't, time to have fun. Let's start by building up an
239 * interrupt spec. we assume #interrupt-cells is 1, which is standard
240 * for PCI. If you do different, then don't use that routine.
241 */
242 rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
243 if (rc != 0)
244 return rc;
245 /* No pin, exit */
246 if (pin == 0)
247 return -ENODEV;
248
249 /* Now we walk up the PCI tree */
250 lspec = pin;
251 for (;;) {
252 /* Get the pci_dev of our parent */
253 ppdev = pdev->bus->self;
254
255 /* Ouch, it's a host bridge... */
256 if (ppdev == NULL) {
257 struct pci_controller *host;
258 host = pci_bus_to_host(pdev->bus);
259 ppnode = host ? host->arch_data : NULL;
260 /* No node for host bridge ? give up */
261 if (ppnode == NULL)
262 return -EINVAL;
263 } else
264 /* We found a P2P bridge, check if it has a node */
265 ppnode = pci_device_to_OF_node(ppdev);
266
267 /* Ok, we have found a parent with a device-node, hand over to
268 * the OF parsing code.
269 * We build a unit address from the linux device to be used for
270 * resolution. Note that we use the linux bus number which may
271 * not match your firmware bus numbering.
272 * Fortunately, in most cases, interrupt-map-mask doesn't
273 * include the bus number as part of the matching.
274 * You should still be careful about that though if you intend
275 * to rely on this function (you ship a firmware that doesn't
276 * create device nodes for all PCI devices).
277 */
278 if (ppnode)
279 break;
280
281 /* We can only get here if we hit a P2P bridge with no node,
282 * let's do standard swizzling and try again
283 */
284 lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec);
285 pdev = ppdev;
286 }
287
288 laddr[0] = (pdev->bus->number << 16)
289 | (pdev->devfn << 8);
290 laddr[1] = laddr[2] = 0;
291 return of_irq_map_raw(ppnode, &lspec, 1, laddr, out_irq);
292}
293EXPORT_SYMBOL_GPL(of_irq_map_pci);
294#endif /* CONFIG_PCI */
295
296/*
297 * ISA bus specific translator
298 */
299
300static int of_bus_isa_match(struct device_node *np)
301{
302 return !strcmp(np->name, "isa");
303}
304
305static void of_bus_isa_count_cells(struct device_node *child,
306 int *addrc, int *sizec)
307{
308 if (addrc)
309 *addrc = 2;
310 if (sizec)
311 *sizec = 1;
312}
313
314static u64 of_bus_isa_map(u32 *addr, const u32 *range, int na, int ns, int pna)
315{
316 u64 cp, s, da;
317
318 /* Check address type match */
319 if ((addr[0] ^ range[0]) & 0x00000001)
320 return OF_BAD_ADDR;
321
322 /* Read address values, skipping high cell */
323 cp = of_read_number(range + 1, na - 1);
324 s = of_read_number(range + na + pna, ns);
325 da = of_read_number(addr + 1, na - 1);
326
327 pr_debug("OF: ISA map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
328
329 if (da < cp || da >= (cp + s))
330 return OF_BAD_ADDR;
331 return da - cp;
332}
333
334static int of_bus_isa_translate(u32 *addr, u64 offset, int na)
335{
336 return of_bus_default_translate(addr + 1, offset, na - 1);
337}
338
339static unsigned int of_bus_isa_get_flags(const u32 *addr)
340{
341 unsigned int flags = 0;
342 u32 w = addr[0];
343
344 if (w & 1)
345 flags |= IORESOURCE_IO;
346 else
347 flags |= IORESOURCE_MEM;
348 return flags;
349}
350
351/*
352 * Array of bus specific translators
353 */
354
355static struct of_bus of_busses[] = {
356#ifdef CONFIG_PCI
357 /* PCI */
358 {
359 .name = "pci",
360 .addresses = "assigned-addresses",
361 .match = of_bus_pci_match,
362 .count_cells = of_bus_pci_count_cells,
363 .map = of_bus_pci_map,
364 .translate = of_bus_pci_translate,
365 .get_flags = of_bus_pci_get_flags,
366 },
367#endif /* CONFIG_PCI */
368 /* ISA */
369 {
370 .name = "isa",
371 .addresses = "reg",
372 .match = of_bus_isa_match,
373 .count_cells = of_bus_isa_count_cells,
374 .map = of_bus_isa_map,
375 .translate = of_bus_isa_translate,
376 .get_flags = of_bus_isa_get_flags,
377 },
378 /* Default */
379 {
380 .name = "default",
381 .addresses = "reg",
382 .match = NULL,
383 .count_cells = of_bus_default_count_cells,
384 .map = of_bus_default_map,
385 .translate = of_bus_default_translate,
386 .get_flags = of_bus_default_get_flags,
387 },
388};
389
390static struct of_bus *of_match_bus(struct device_node *np)
391{
392 int i;
393
394 for (i = 0; i < ARRAY_SIZE(of_busses); i++)
395 if (!of_busses[i].match || of_busses[i].match(np))
396 return &of_busses[i];
397 BUG();
398 return NULL;
399}
400
401static int of_translate_one(struct device_node *parent, struct of_bus *bus,
402 struct of_bus *pbus, u32 *addr,
403 int na, int ns, int pna)
404{
405 const u32 *ranges;
406 unsigned int rlen;
407 int rone;
408 u64 offset = OF_BAD_ADDR;
409
410 /* Normally, an absence of a "ranges" property means we are
411 * crossing a non-translatable boundary, and thus the addresses
412 * below the current not cannot be converted to CPU physical ones.
413 * Unfortunately, while this is very clear in the spec, it's not
414 * what Apple understood, and they do have things like /uni-n or
415 * /ht nodes with no "ranges" property and a lot of perfectly
416 * useable mapped devices below them. Thus we treat the absence of
417 * "ranges" as equivalent to an empty "ranges" property which means
418 * a 1:1 translation at that level. It's up to the caller not to try
419 * to translate addresses that aren't supposed to be translated in
420 * the first place. --BenH.
421 */
422 ranges = of_get_property(parent, "ranges", (int *) &rlen);
423 if (ranges == NULL || rlen == 0) {
424 offset = of_read_number(addr, na);
425 memset(addr, 0, pna * 4);
426 pr_debug("OF: no ranges, 1:1 translation\n");
427 goto finish;
428 }
429
430 pr_debug("OF: walking ranges...\n");
431
432 /* Now walk through the ranges */
433 rlen /= 4;
434 rone = na + pna + ns;
435 for (; rlen >= rone; rlen -= rone, ranges += rone) {
436 offset = bus->map(addr, ranges, na, ns, pna);
437 if (offset != OF_BAD_ADDR)
438 break;
439 }
440 if (offset == OF_BAD_ADDR) {
441 pr_debug("OF: not found !\n");
442 return 1;
443 }
444 memcpy(addr, ranges + na, 4 * pna);
445
446 finish:
447 of_dump_addr("OF: parent translation for:", addr, pna);
448 pr_debug("OF: with offset: "PRu64"\n", offset);
449
450 /* Translate it into parent bus space */
451 return pbus->translate(addr, offset, pna);
452}
453
454/*
455 * Translate an address from the device-tree into a CPU physical address,
456 * this walks up the tree and applies the various bus mappings on the
457 * way.
458 *
459 * Note: We consider that crossing any level with #size-cells == 0 to mean
460 * that translation is impossible (that is we are not dealing with a value
461 * that can be mapped to a cpu physical address). This is not really specified
462 * that way, but this is traditionally the way IBM at least do things
463 */
464u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
465{
466 struct device_node *parent = NULL;
467 struct of_bus *bus, *pbus;
468 u32 addr[OF_MAX_ADDR_CELLS];
469 int na, ns, pna, pns;
470 u64 result = OF_BAD_ADDR;
471
472 pr_debug("OF: ** translation for device %s **\n", dev->full_name);
473
474 /* Increase refcount at current level */
475 of_node_get(dev);
476
477 /* Get parent & match bus type */
478 parent = of_get_parent(dev);
479 if (parent == NULL)
480 goto bail;
481 bus = of_match_bus(parent);
482
483 /* Cound address cells & copy address locally */
484 bus->count_cells(dev, &na, &ns);
485 if (!OF_CHECK_COUNTS(na, ns)) {
486 printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
487 dev->full_name);
488 goto bail;
489 }
490 memcpy(addr, in_addr, na * 4);
491
492 pr_debug("OF: bus is %s (na=%d, ns=%d) on %s\n",
493 bus->name, na, ns, parent->full_name);
494 of_dump_addr("OF: translating address:", addr, na);
495
496 /* Translate */
497 for (;;) {
498 /* Switch to parent bus */
499 of_node_put(dev);
500 dev = parent;
501 parent = of_get_parent(dev);
502
503 /* If root, we have finished */
504 if (parent == NULL) {
505 pr_debug("OF: reached root node\n");
506 result = of_read_number(addr, na);
507 break;
508 }
509
510 /* Get new parent bus and counts */
511 pbus = of_match_bus(parent);
512 pbus->count_cells(dev, &pna, &pns);
513 if (!OF_CHECK_COUNTS(pna, pns)) {
514 printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
515 dev->full_name);
516 break;
517 }
518
519 pr_debug("OF: parent bus is %s (na=%d, ns=%d) on %s\n",
520 pbus->name, pna, pns, parent->full_name);
521
522 /* Apply bus translation */
523 if (of_translate_one(dev, bus, pbus, addr, na, ns, pna))
524 break;
525
526 /* Complete the move up one level */
527 na = pna;
528 ns = pns;
529 bus = pbus;
530
531 of_dump_addr("OF: one level translation:", addr, na);
532 }
533 bail:
534 of_node_put(parent);
535 of_node_put(dev);
536
537 return result;
538}
539EXPORT_SYMBOL(of_translate_address);
540
541const u32 *of_get_address(struct device_node *dev, int index, u64 *size,
542 unsigned int *flags)
543{
544 const u32 *prop;
545 unsigned int psize;
546 struct device_node *parent;
547 struct of_bus *bus;
548 int onesize, i, na, ns;
549
550 /* Get parent & match bus type */
551 parent = of_get_parent(dev);
552 if (parent == NULL)
553 return NULL;
554 bus = of_match_bus(parent);
555 bus->count_cells(dev, &na, &ns);
556 of_node_put(parent);
557 if (!OF_CHECK_COUNTS(na, ns))
558 return NULL;
559
560 /* Get "reg" or "assigned-addresses" property */
561 prop = of_get_property(dev, bus->addresses, (int *) &psize);
562 if (prop == NULL)
563 return NULL;
564 psize /= 4;
565
566 onesize = na + ns;
567 for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++)
568 if (i == index) {
569 if (size)
570 *size = of_read_number(prop + na, ns);
571 if (flags)
572 *flags = bus->get_flags(prop);
573 return prop;
574 }
575 return NULL;
576}
577EXPORT_SYMBOL(of_get_address);
578
579static int __of_address_to_resource(struct device_node *dev, const u32 *addrp,
580 u64 size, unsigned int flags,
581 struct resource *r)
582{
583 u64 taddr;
584
585 if ((flags & (IORESOURCE_IO | IORESOURCE_MEM)) == 0)
586 return -EINVAL;
587 taddr = of_translate_address(dev, addrp);
588 if (taddr == OF_BAD_ADDR)
589 return -EINVAL;
590 memset(r, 0, sizeof(struct resource));
591 if (flags & IORESOURCE_IO) {
592 unsigned long port;
593 port = -1; /* pci_address_to_pio(taddr); */
594 if (port == (unsigned long)-1)
595 return -EINVAL;
596 r->start = port;
597 r->end = port + size - 1;
598 } else {
599 r->start = taddr;
600 r->end = taddr + size - 1;
601 }
602 r->flags = flags;
603 r->name = dev->name;
604 return 0;
605}
606
607int of_address_to_resource(struct device_node *dev, int index,
608 struct resource *r)
609{
610 const u32 *addrp;
611 u64 size;
612 unsigned int flags;
613
614 addrp = of_get_address(dev, index, &size, &flags);
615 if (addrp == NULL)
616 return -EINVAL;
617 return __of_address_to_resource(dev, addrp, size, flags, r);
618}
619EXPORT_SYMBOL_GPL(of_address_to_resource);
620
621void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
622 unsigned long *busno, unsigned long *phys, unsigned long *size)
623{
624 const u32 *dma_window;
625 u32 cells;
626 const unsigned char *prop;
627
628 dma_window = dma_window_prop;
629
630 /* busno is always one cell */
631 *busno = *(dma_window++);
632
633 prop = of_get_property(dn, "ibm,#dma-address-cells", NULL);
634 if (!prop)
635 prop = of_get_property(dn, "#address-cells", NULL);
636
637 cells = prop ? *(u32 *)prop : of_n_addr_cells(dn);
638 *phys = of_read_number(dma_window, cells);
639
640 dma_window += cells;
641
642 prop = of_get_property(dn, "ibm,#dma-size-cells", NULL);
643 cells = prop ? *(u32 *)prop : of_n_size_cells(dn);
644 *size = of_read_number(dma_window, cells);
645}
646
647/*
648 * Interrupt remapper
649 */
650
651static unsigned int of_irq_workarounds;
652static struct device_node *of_irq_dflt_pic;
653
654static struct device_node *of_irq_find_parent(struct device_node *child)
655{
656 struct device_node *p;
657 const phandle *parp;
658
659 if (!of_node_get(child))
660 return NULL;
661
662 do {
663 parp = of_get_property(child, "interrupt-parent", NULL);
664 if (parp == NULL)
665 p = of_get_parent(child);
666 else {
667 if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
668 p = of_node_get(of_irq_dflt_pic);
669 else
670 p = of_find_node_by_phandle(*parp);
671 }
672 of_node_put(child);
673 child = p;
674 } while (p && of_get_property(p, "#interrupt-cells", NULL) == NULL);
675
676 return p;
677}
678
679/* This doesn't need to be called if you don't have any special workaround
680 * flags to pass
681 */
682void of_irq_map_init(unsigned int flags)
683{
684 of_irq_workarounds = flags;
685
686 /* OldWorld, don't bother looking at other things */
687 if (flags & OF_IMAP_OLDWORLD_MAC)
688 return;
689
690 /* If we don't have phandles, let's try to locate a default interrupt
691 * controller (happens when booting with BootX). We do a first match
692 * here, hopefully, that only ever happens on machines with one
693 * controller.
694 */
695 if (flags & OF_IMAP_NO_PHANDLE) {
696 struct device_node *np;
697
698 for (np = NULL; (np = of_find_all_nodes(np)) != NULL;) {
699 if (of_get_property(np, "interrupt-controller", NULL)
700 == NULL)
701 continue;
702 /* Skip /chosen/interrupt-controller */
703 if (strcmp(np->name, "chosen") == 0)
704 continue;
705 /* It seems like at least one person on this planet
706 * wants to use BootX on a machine with an AppleKiwi
707 * controller which happens to pretend to be an
708 * interrupt controller too.
709 */
710 if (strcmp(np->name, "AppleKiwi") == 0)
711 continue;
712 /* I think we found one ! */
713 of_irq_dflt_pic = np;
714 break;
715 }
716 }
717
718}
719
720int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
721 const u32 *addr, struct of_irq *out_irq)
722{
723 struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
724 const u32 *tmp, *imap, *imask;
725 u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
726 int imaplen, match, i;
727
728 pr_debug("of_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],"
729 "ointsize=%d\n",
730 parent->full_name, intspec[0], intspec[1], ointsize);
731
732 ipar = of_node_get(parent);
733
734 /* First get the #interrupt-cells property of the current cursor
735 * that tells us how to interpret the passed-in intspec. If there
736 * is none, we are nice and just walk up the tree
737 */
738 do {
739 tmp = of_get_property(ipar, "#interrupt-cells", NULL);
740 if (tmp != NULL) {
741 intsize = *tmp;
742 break;
743 }
744 tnode = ipar;
745 ipar = of_irq_find_parent(ipar);
746 of_node_put(tnode);
747 } while (ipar);
748 if (ipar == NULL) {
749 pr_debug(" -> no parent found !\n");
750 goto fail;
751 }
752
753 pr_debug("of_irq_map_raw: ipar=%s, size=%d\n",
754 ipar->full_name, intsize);
755
756 if (ointsize != intsize)
757 return -EINVAL;
758
759 /* Look for this #address-cells. We have to implement the old linux
760 * trick of looking for the parent here as some device-trees rely on it
761 */
762 old = of_node_get(ipar);
763 do {
764 tmp = of_get_property(old, "#address-cells", NULL);
765 tnode = of_get_parent(old);
766 of_node_put(old);
767 old = tnode;
768 } while (old && tmp == NULL);
769 of_node_put(old);
770 old = NULL;
771 addrsize = (tmp == NULL) ? 2 : *tmp;
772
773 pr_debug(" -> addrsize=%d\n", addrsize);
774
775 /* Now start the actual "proper" walk of the interrupt tree */
776 while (ipar != NULL) {
777 /* Now check if cursor is an interrupt-controller and if it is
778 * then we are done
779 */
780 if (of_get_property(ipar, "interrupt-controller", NULL) !=
781 NULL) {
782 pr_debug(" -> got it !\n");
783 memcpy(out_irq->specifier, intspec,
784 intsize * sizeof(u32));
785 out_irq->size = intsize;
786 out_irq->controller = ipar;
787 of_node_put(old);
788 return 0;
789 }
790
791 /* Now look for an interrupt-map */
792 imap = of_get_property(ipar, "interrupt-map", &imaplen);
793 /* No interrupt map, check for an interrupt parent */
794 if (imap == NULL) {
795 pr_debug(" -> no map, getting parent\n");
796 newpar = of_irq_find_parent(ipar);
797 goto skiplevel;
798 }
799 imaplen /= sizeof(u32);
800
801 /* Look for a mask */
802 imask = of_get_property(ipar, "interrupt-map-mask", NULL);
803
804 /* If we were passed no "reg" property and we attempt to parse
805 * an interrupt-map, then #address-cells must be 0.
806 * Fail if it's not.
807 */
808 if (addr == NULL && addrsize != 0) {
809 pr_debug(" -> no reg passed in when needed !\n");
810 goto fail;
811 }
812
813 /* Parse interrupt-map */
814 match = 0;
815 while (imaplen > (addrsize + intsize + 1) && !match) {
816 /* Compare specifiers */
817 match = 1;
818 for (i = 0; i < addrsize && match; ++i) {
819 u32 mask = imask ? imask[i] : 0xffffffffu;
820 match = ((addr[i] ^ imap[i]) & mask) == 0;
821 }
822 for (; i < (addrsize + intsize) && match; ++i) {
823 u32 mask = imask ? imask[i] : 0xffffffffu;
824 match =
825 ((intspec[i-addrsize] ^ imap[i])
826 & mask) == 0;
827 }
828 imap += addrsize + intsize;
829 imaplen -= addrsize + intsize;
830
831 pr_debug(" -> match=%d (imaplen=%d)\n", match, imaplen);
832
833 /* Get the interrupt parent */
834 if (of_irq_workarounds & OF_IMAP_NO_PHANDLE)
835 newpar = of_node_get(of_irq_dflt_pic);
836 else
837 newpar =
838 of_find_node_by_phandle((phandle)*imap);
839 imap++;
840 --imaplen;
841
842 /* Check if not found */
843 if (newpar == NULL) {
844 pr_debug(" -> imap parent not found !\n");
845 goto fail;
846 }
847
848 /* Get #interrupt-cells and #address-cells of new
849 * parent
850 */
851 tmp = of_get_property(newpar, "#interrupt-cells", NULL);
852 if (tmp == NULL) {
853 pr_debug(" -> parent lacks "
854 "#interrupt-cells!\n");
855 goto fail;
856 }
857 newintsize = *tmp;
858 tmp = of_get_property(newpar, "#address-cells", NULL);
859 newaddrsize = (tmp == NULL) ? 0 : *tmp;
860
861 pr_debug(" -> newintsize=%d, newaddrsize=%d\n",
862 newintsize, newaddrsize);
863
864 /* Check for malformed properties */
865 if (imaplen < (newaddrsize + newintsize))
866 goto fail;
867
868 imap += newaddrsize + newintsize;
869 imaplen -= newaddrsize + newintsize;
870
871 pr_debug(" -> imaplen=%d\n", imaplen);
872 }
873 if (!match)
874 goto fail;
875
876 of_node_put(old);
877 old = of_node_get(newpar);
878 addrsize = newaddrsize;
879 intsize = newintsize;
880 intspec = imap - intsize;
881 addr = intspec - addrsize;
882
883skiplevel:
884 /* Iterate again with new parent */
885 pr_debug(" -> new parent: %s\n",
886 newpar ? newpar->full_name : "<>");
887 of_node_put(ipar);
888 ipar = newpar;
889 newpar = NULL;
890 }
891fail:
892 of_node_put(ipar);
893 of_node_put(old);
894 of_node_put(newpar);
895
896 return -EINVAL;
897}
898EXPORT_SYMBOL_GPL(of_irq_map_raw);
899
900int of_irq_map_one(struct device_node *device,
901 int index, struct of_irq *out_irq)
902{
903 struct device_node *p;
904 const u32 *intspec, *tmp, *addr;
905 u32 intsize, intlen;
906 int res;
907
908 pr_debug("of_irq_map_one: dev=%s, index=%d\n",
909 device->full_name, index);
910
911 /* Get the interrupts property */
912 intspec = of_get_property(device, "interrupts", (int *) &intlen);
913 if (intspec == NULL)
914 return -EINVAL;
915 intlen /= sizeof(u32);
916
917 pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
918
919 /* Get the reg property (if any) */
920 addr = of_get_property(device, "reg", NULL);
921
922 /* Look for the interrupt parent. */
923 p = of_irq_find_parent(device);
924 if (p == NULL)
925 return -EINVAL;
926
927 /* Get size of interrupt specifier */
928 tmp = of_get_property(p, "#interrupt-cells", NULL);
929 if (tmp == NULL) {
930 of_node_put(p);
931 return -EINVAL;
932 }
933 intsize = *tmp;
934
935 pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
936
937 /* Check index */
938 if ((index + 1) * intsize > intlen)
939 return -EINVAL;
940
941 /* Get new specifier and map it */
942 res = of_irq_map_raw(p, intspec + index * intsize, intsize,
943 addr, out_irq);
944 of_node_put(p);
945 return res;
946}
947EXPORT_SYMBOL_GPL(of_irq_map_one);
948
949/**
950 * Search the device tree for the best MAC address to use. 'mac-address' is
951 * checked first, because that is supposed to contain to "most recent" MAC
952 * address. If that isn't set, then 'local-mac-address' is checked next,
953 * because that is the default address. If that isn't set, then the obsolete
954 * 'address' is checked, just in case we're using an old device tree.
955 *
956 * Note that the 'address' property is supposed to contain a virtual address of
957 * the register set, but some DTS files have redefined that property to be the
958 * MAC address.
959 *
960 * All-zero MAC addresses are rejected, because those could be properties that
961 * exist in the device tree, but were not set by U-Boot. For example, the
962 * DTS could define 'mac-address' and 'local-mac-address', with zero MAC
963 * addresses. Some older U-Boots only initialized 'local-mac-address'. In
964 * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
965 * but is all zeros.
966*/
967const void *of_get_mac_address(struct device_node *np)
968{
969 struct property *pp;
970
971 pp = of_find_property(np, "mac-address", NULL);
972 if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
973 return pp->value;
974
975 pp = of_find_property(np, "local-mac-address", NULL);
976 if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
977 return pp->value;
978
979 pp = of_find_property(np, "address", NULL);
980 if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
981 return pp->value;
982
983 return NULL;
984}
985EXPORT_SYMBOL(of_get_mac_address);
986
987int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
988{
989 struct of_irq out_irq;
990 int irq;
991 int res;
992
993 res = of_irq_map_one(dev, index, &out_irq);
994
995 /* Get irq for the device */
996 if (res) {
997 pr_debug("IRQ not found... code = %d", res);
998 return NO_IRQ;
999 }
1000 /* Assuming single interrupt controller... */
1001 irq = out_irq.specifier[0];
1002
1003 pr_debug("IRQ found = %d", irq);
1004
1005 /* Only dereference the resource if both the
1006 * resource and the irq are valid. */
1007 if (r && irq != NO_IRQ) {
1008 r->start = r->end = irq;
1009 r->flags = IORESOURCE_IRQ;
1010 }
1011
1012 return irq;
1013}
1014EXPORT_SYMBOL_GPL(of_irq_to_resource);
1015
1016void __iomem *of_iomap(struct device_node *np, int index)
1017{
1018 struct resource res;
1019
1020 if (of_address_to_resource(np, index, &res))
1021 return NULL;
1022
1023 return ioremap(res.start, 1 + res.end - res.start);
1024}
1025EXPORT_SYMBOL(of_iomap);
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
new file mode 100644
index 000000000000..b86aa623e36d
--- /dev/null
+++ b/arch/microblaze/kernel/ptrace.c
@@ -0,0 +1,181 @@
1/*
2 * `ptrace' system call
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2007-2009 PetaLogix
6 * Copyright (C) 2004-2007 John Williams <john.williams@petalogix.com>
7 *
8 * derived from arch/v850/kernel/ptrace.c
9 *
10 * Copyright (C) 2002,03 NEC Electronics Corporation
11 * Copyright (C) 2002,03 Miles Bader <miles@gnu.org>
12 *
13 * Derived from arch/mips/kernel/ptrace.c:
14 *
15 * Copyright (C) 1992 Ross Biro
16 * Copyright (C) Linus Torvalds
17 * Copyright (C) 1994, 95, 96, 97, 98, 2000 Ralf Baechle
18 * Copyright (C) 1996 David S. Miller
19 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
20 * Copyright (C) 1999 MIPS Technologies, Inc.
21 *
22 * This file is subject to the terms and conditions of the GNU General
23 * Public License. See the file COPYING in the main directory of this
24 * archive for more details.
25 */
26
27#include <linux/kernel.h>
28#include <linux/mm.h>
29#include <linux/sched.h>
30#include <linux/smp_lock.h>
31#include <linux/ptrace.h>
32#include <linux/signal.h>
33
34#include <linux/errno.h>
35#include <asm/processor.h>
36#include <linux/uaccess.h>
37#include <asm/asm-offsets.h>
38
39/* Returns the address where the register at REG_OFFS in P is stashed away. */
40static microblaze_reg_t *reg_save_addr(unsigned reg_offs,
41 struct task_struct *t)
42{
43 struct pt_regs *regs;
44
45 /*
46 * Three basic cases:
47 *
48 * (1) A register normally saved before calling the scheduler, is
49 * available in the kernel entry pt_regs structure at the top
50 * of the kernel stack. The kernel trap/irq exit path takes
51 * care to save/restore almost all registers for ptrace'd
52 * processes.
53 *
54 * (2) A call-clobbered register, where the process P entered the
55 * kernel via [syscall] trap, is not stored anywhere; that's
56 * OK, because such registers are not expected to be preserved
57 * when the trap returns anyway (so we don't actually bother to
58 * test for this case).
59 *
60 * (3) A few registers not used at all by the kernel, and so
61 * normally never saved except by context-switches, are in the
62 * context switch state.
63 */
64
65 /* Register saved during kernel entry (or not available). */
66 regs = task_pt_regs(t);
67
68 return (microblaze_reg_t *)((char *)regs + reg_offs);
69}
70
71long arch_ptrace(struct task_struct *child, long request, long addr, long data)
72{
73 int rval;
74 unsigned long val = 0;
75 unsigned long copied;
76
77 switch (request) {
78 case PTRACE_PEEKTEXT: /* read word at location addr. */
79 case PTRACE_PEEKDATA:
80 pr_debug("PEEKTEXT/PEEKDATA at %08lX\n", addr);
81 copied = access_process_vm(child, addr, &val, sizeof(val), 0);
82 rval = -EIO;
83 if (copied != sizeof(val))
84 break;
85 rval = put_user(val, (unsigned long *)data);
86 break;
87
88 case PTRACE_POKETEXT: /* write the word at location addr. */
89 case PTRACE_POKEDATA:
90 pr_debug("POKETEXT/POKEDATA to %08lX\n", addr);
91 rval = 0;
92 if (access_process_vm(child, addr, &data, sizeof(data), 1)
93 == sizeof(data))
94 break;
95 rval = -EIO;
96 break;
97
98 /* Read/write the word at location ADDR in the registers. */
99 case PTRACE_PEEKUSR:
100 case PTRACE_POKEUSR:
101 pr_debug("PEEKUSR/POKEUSR : 0x%08lx\n", addr);
102 rval = 0;
103 if (addr >= PT_SIZE && request == PTRACE_PEEKUSR) {
104 /*
105 * Special requests that don't actually correspond
106 * to offsets in struct pt_regs.
107 */
108 if (addr == PT_TEXT_ADDR) {
109 val = child->mm->start_code;
110 } else if (addr == PT_DATA_ADDR) {
111 val = child->mm->start_data;
112 } else if (addr == PT_TEXT_LEN) {
113 val = child->mm->end_code
114 - child->mm->start_code;
115 } else {
116 rval = -EIO;
117 }
118 } else if (addr >= 0 && addr < PT_SIZE && (addr & 0x3) == 0) {
119 microblaze_reg_t *reg_addr = reg_save_addr(addr, child);
120 if (request == PTRACE_PEEKUSR)
121 val = *reg_addr;
122 else
123 *reg_addr = data;
124 } else
125 rval = -EIO;
126
127 if (rval == 0 && request == PTRACE_PEEKUSR)
128 rval = put_user(val, (unsigned long *)data);
129 break;
130 /* Continue and stop at next (return from) syscall */
131 case PTRACE_SYSCALL:
132 pr_debug("PTRACE_SYSCALL\n");
133 case PTRACE_SINGLESTEP:
134 pr_debug("PTRACE_SINGLESTEP\n");
135 /* Restart after a signal. */
136 case PTRACE_CONT:
137 pr_debug("PTRACE_CONT\n");
138 rval = -EIO;
139 if (!valid_signal(data))
140 break;
141
142 if (request == PTRACE_SYSCALL)
143 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
144 else
145 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
146
147 child->exit_code = data;
148 pr_debug("wakeup_process\n");
149 wake_up_process(child);
150 rval = 0;
151 break;
152
153 /*
154 * make the child exit. Best I can do is send it a sigkill.
155 * perhaps it should be put in the status that it wants to
156 * exit.
157 */
158 case PTRACE_KILL:
159 pr_debug("PTRACE_KILL\n");
160 rval = 0;
161 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
162 break;
163 child->exit_code = SIGKILL;
164 wake_up_process(child);
165 break;
166
167 case PTRACE_DETACH: /* detach a process that was attached. */
168 pr_debug("PTRACE_DETACH\n");
169 rval = ptrace_detach(child, data);
170 break;
171 default:
172 /* rval = ptrace_request(child, request, addr, data); noMMU */
173 rval = -EIO;
174 }
175 return rval;
176}
177
178void ptrace_disable(struct task_struct *child)
179{
180 /* nothing to do */
181}
diff --git a/arch/microblaze/kernel/selfmod.c b/arch/microblaze/kernel/selfmod.c
new file mode 100644
index 000000000000..89508bdc9f3c
--- /dev/null
+++ b/arch/microblaze/kernel/selfmod.c
@@ -0,0 +1,81 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2009 PetaLogix
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#include <linux/interrupt.h>
11#include <asm/selfmod.h>
12
13#undef DEBUG
14
15#if __GNUC__ > 3
16#error GCC 4 unsupported SELFMOD. Please disable SELFMOD from menuconfig.
17#endif
18
19#define OPCODE_IMM 0xB0000000
20#define OPCODE_LWI 0xE8000000
21#define OPCODE_LWI_MASK 0xEC000000
22#define OPCODE_RTSD 0xB60F0008 /* return from func: rtsd r15, 8 */
23#define OPCODE_ADDIK 0x30000000
24#define OPCODE_ADDIK_MASK 0xFC000000
25
26#define IMM_BASE (OPCODE_IMM | (BARRIER_BASE_ADDR >> 16))
27#define LWI_BASE (OPCODE_LWI | (BARRIER_BASE_ADDR & 0x0000ff00))
28#define LWI_BASE_MASK (OPCODE_LWI_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))
29#define ADDIK_BASE (OPCODE_ADDIK | (BARRIER_BASE_ADDR & 0x0000ff00))
30#define ADDIK_BASE_MASK (OPCODE_ADDIK_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))
31
32#define MODIFY_INSTR { \
33 pr_debug("%s: curr instr, (%d):0x%x, next(%d):0x%x\n", \
34 __func__, i, addr[i], i + 1, addr[i + 1]); \
35 addr[i] = OPCODE_IMM + (base >> 16); \
36 /* keep instruction opcode and add only last 16bits */ \
37 addr[i + 1] = (addr[i + 1] & 0xffff00ff) + (base & 0xffff); \
38 __invalidate_icache(addr[i]); \
39 __invalidate_icache(addr[i + 1]); \
40 pr_debug("%s: hack instr, (%d):0x%x, next(%d):0x%x\n", \
41 __func__, i, addr[i], i + 1, addr[i + 1]); }
42
43/* NOTE
44 * self-modified part of code for improvement of interrupt controller
45 * save instruction in interrupt rutine
46 */
47void selfmod_function(const int *arr_fce, const unsigned int base)
48{
49 unsigned int flags, i, j, *addr = NULL;
50
51 local_irq_save(flags);
52 __disable_icache();
53
54 /* zero terminated array */
55 for (j = 0; arr_fce[j] != 0; j++) {
56 /* get start address of function */
57 addr = (unsigned int *) arr_fce[j];
58 pr_debug("%s: func(%d) at 0x%x\n",
59 __func__, j, (unsigned int) addr);
60 for (i = 0; ; i++) {
61 pr_debug("%s: instruction code at %d: 0x%x\n",
62 __func__, i, addr[i]);
63 if (addr[i] == IMM_BASE) {
64 /* detecting of lwi (0xE8) or swi (0xF8) instr
65 * I can detect both opcode with one mask */
66 if ((addr[i + 1] & LWI_BASE_MASK) == LWI_BASE) {
67 MODIFY_INSTR;
68 } else /* detection addik for ack */
69 if ((addr[i + 1] & ADDIK_BASE_MASK) ==
70 ADDIK_BASE) {
71 MODIFY_INSTR;
72 }
73 } else if (addr[i] == OPCODE_RTSD) {
74 /* return from function means end of function */
75 pr_debug("%s: end of array %d\n", __func__, i);
76 break;
77 }
78 }
79 }
80 local_irq_restore(flags);
81} /* end of self-modified code */
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
new file mode 100644
index 000000000000..eb6b41758e23
--- /dev/null
+++ b/arch/microblaze/kernel/setup.c
@@ -0,0 +1,199 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/string.h>
13#include <linux/seq_file.h>
14#include <linux/cpu.h>
15#include <linux/initrd.h>
16#include <linux/console.h>
17#include <linux/debugfs.h>
18
19#include <asm/setup.h>
20#include <asm/sections.h>
21#include <asm/page.h>
22#include <linux/io.h>
23#include <linux/bug.h>
24#include <linux/param.h>
25#include <linux/cache.h>
26#include <asm/cacheflush.h>
27#include <asm/entry.h>
28#include <asm/cpuinfo.h>
29
30#include <asm/system.h>
31#include <asm/prom.h>
32#include <asm/pgtable.h>
33
34DEFINE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */
35DEFINE_PER_CPU(unsigned int, KM); /* Kernel/user mode */
36DEFINE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */
37DEFINE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */
38DEFINE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */
39
40unsigned int boot_cpuid;
41char cmd_line[COMMAND_LINE_SIZE];
42
43void __init setup_arch(char **cmdline_p)
44{
45#ifdef CONFIG_CMDLINE_FORCE
46 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
47 strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
48#endif
49 *cmdline_p = cmd_line;
50
51 console_verbose();
52
53 unflatten_device_tree();
54
55 /* NOTE I think that this function is not necessary to call */
56 /* irq_early_init(); */
57 setup_cpuinfo();
58
59 __invalidate_icache_all();
60 __enable_icache();
61
62 __invalidate_dcache_all();
63 __enable_dcache();
64
65 panic_timeout = 120;
66
67 setup_memory();
68
69#if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER)
70 printk(KERN_NOTICE "Self modified code enable\n");
71#endif
72
73#ifdef CONFIG_VT
74#if defined(CONFIG_XILINX_CONSOLE)
75 conswitchp = &xil_con;
76#elif defined(CONFIG_DUMMY_CONSOLE)
77 conswitchp = &dummy_con;
78#endif
79#endif
80}
81
82#ifdef CONFIG_MTD_UCLINUX
83/* Handle both romfs and cramfs types, without generating unnecessary
84 code (ie no point checking for CRAMFS if it's not even enabled) */
85inline unsigned get_romfs_len(unsigned *addr)
86{
87#ifdef CONFIG_ROMFS_FS
88 if (memcmp(&addr[0], "-rom1fs-", 8) == 0) /* romfs */
89 return be32_to_cpu(addr[2]);
90#endif
91
92#ifdef CONFIG_CRAMFS
93 if (addr[0] == le32_to_cpu(0x28cd3d45)) /* cramfs */
94 return le32_to_cpu(addr[1]);
95#endif
96 return 0;
97}
98#endif /* CONFIG_MTD_UCLINUX_EBSS */
99
100void __init machine_early_init(const char *cmdline, unsigned int ram,
101 unsigned int fdt)
102{
103 unsigned long *src, *dst = (unsigned long *)0x0;
104
105/* clearing bss section */
106 memset(__bss_start, 0, __bss_stop-__bss_start);
107 memset(_ssbss, 0, _esbss-_ssbss);
108
109 /*
110 * Copy command line passed from bootloader, or use default
111 * if none provided, or forced
112 */
113#ifndef CONFIG_CMDLINE_BOOL
114 if (cmdline && cmdline[0] != '\0')
115 strlcpy(cmd_line, cmdline, COMMAND_LINE_SIZE);
116#endif
117
118/* initialize device tree for usage in early_printk */
119 early_init_devtree((void *)_fdt_start);
120
121#ifdef CONFIG_EARLY_PRINTK
122 setup_early_printk(NULL);
123#endif
124
125 early_printk("Ramdisk addr 0x%08x, FDT 0x%08x\n", ram, fdt);
126 printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt);
127
128#ifdef CONFIG_MTD_UCLINUX
129 {
130 int size;
131 unsigned int romfs_base;
132 romfs_base = (ram ? ram : (unsigned int)&__init_end);
133 /* if CONFIG_MTD_UCLINUX_EBSS is defined, assume ROMFS is at the
134 * end of kernel, which is ROMFS_LOCATION defined above. */
135 size = PAGE_ALIGN(get_romfs_len((unsigned *)romfs_base));
136 early_printk("Found romfs @ 0x%08x (0x%08x)\n",
137 romfs_base, size);
138 early_printk("#### klimit %p ####\n", klimit);
139 BUG_ON(size < 0); /* What else can we do? */
140
141 /* Use memmove to handle likely case of memory overlap */
142 early_printk("Moving 0x%08x bytes from 0x%08x to 0x%08x\n",
143 size, romfs_base, (unsigned)&_ebss);
144 memmove(&_ebss, (int *)romfs_base, size);
145
146 /* update klimit */
147 klimit += PAGE_ALIGN(size);
148 early_printk("New klimit: 0x%08x\n", (unsigned)klimit);
149 }
150#endif
151
152 for (src = __ivt_start; src < __ivt_end; src++, dst++)
153 *dst = *src;
154
155 /* Initialize global data */
156 per_cpu(KM, 0) = 0x1; /* We start in kernel mode */
157 per_cpu(CURRENT_SAVE, 0) = (unsigned long)current;
158}
159
160#ifdef CONFIG_DEBUG_FS
161struct dentry *of_debugfs_root;
162
163static int microblaze_debugfs_init(void)
164{
165 of_debugfs_root = debugfs_create_dir("microblaze", NULL);
166
167 return of_debugfs_root == NULL;
168}
169arch_initcall(microblaze_debugfs_init);
170#endif
171
172void machine_restart(char *cmd)
173{
174 printk(KERN_NOTICE "Machine restart...\n");
175 dump_stack();
176 while (1)
177 ;
178}
179
180void machine_shutdown(void)
181{
182 printk(KERN_NOTICE "Machine shutdown...\n");
183 while (1)
184 ;
185}
186
187void machine_halt(void)
188{
189 printk(KERN_NOTICE "Machine halt...\n");
190 while (1)
191 ;
192}
193
194void machine_power_off(void)
195{
196 printk(KERN_NOTICE "Machine power off...\n");
197 while (1)
198 ;
199}
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
new file mode 100644
index 000000000000..3889cf45fa71
--- /dev/null
+++ b/arch/microblaze/kernel/signal.c
@@ -0,0 +1,537 @@
1/*
2 * Signal handling
3 *
4 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
5 * Copyright (C) 2008-2009 PetaLogix
6 * Copyright (C) 2003,2004 John Williams <jwilliams@itee.uq.edu.au>
7 * Copyright (C) 2001 NEC Corporation
8 * Copyright (C) 2001 Miles Bader <miles@gnu.org>
9 * Copyright (C) 1999,2000 Niibe Yutaka & Kaz Kojima
10 * Copyright (C) 1991,1992 Linus Torvalds
11 *
12 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
13 *
14 * This file was was derived from the sh version, arch/sh/kernel/signal.c
15 *
16 * This file is subject to the terms and conditions of the GNU General
17 * Public License. See the file COPYING in the main directory of this
18 * archive for more details.
19 */
20
21#include <linux/sched.h>
22#include <linux/mm.h>
23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/kernel.h>
26#include <linux/signal.h>
27#include <linux/errno.h>
28#include <linux/wait.h>
29#include <linux/ptrace.h>
30#include <linux/unistd.h>
31#include <linux/stddef.h>
32#include <linux/personality.h>
33#include <linux/percpu.h>
34#include <linux/linkage.h>
35#include <asm/entry.h>
36#include <asm/ucontext.h>
37#include <linux/uaccess.h>
38#include <asm/pgtable.h>
39#include <asm/pgalloc.h>
40#include <linux/syscalls.h>
41#include <asm/cacheflush.h>
42#include <asm/syscalls.h>
43
44#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
45
46asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall);
47
48/*
49 * Atomically swap in the new signal mask, and wait for a signal.
50 */
51asmlinkage int
52sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs)
53{
54 sigset_t saveset;
55
56 mask &= _BLOCKABLE;
57 spin_lock_irq(&current->sighand->siglock);
58 saveset = current->blocked;
59 siginitset(&current->blocked, mask);
60 recalc_sigpending();
61 spin_unlock_irq(&current->sighand->siglock);
62
63 regs->r3 = -EINTR;
64 while (1) {
65 current->state = TASK_INTERRUPTIBLE;
66 schedule();
67 if (do_signal(regs, &saveset, 1))
68 return -EINTR;
69 }
70}
71
72asmlinkage int
73sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
74 struct pt_regs *regs)
75{
76 sigset_t saveset, newset;
77
78 /* XXX: Don't preclude handling different sized sigset_t's. */
79 if (sigsetsize != sizeof(sigset_t))
80 return -EINVAL;
81
82 if (copy_from_user(&newset, unewset, sizeof(newset)))
83 return -EFAULT;
84 sigdelsetmask(&newset, ~_BLOCKABLE);
85 spin_lock_irq(&current->sighand->siglock);
86 saveset = current->blocked;
87 current->blocked = newset;
88 recalc_sigpending();
89 spin_unlock_irq(&current->sighand->siglock);
90
91 regs->r3 = -EINTR;
92 while (1) {
93 current->state = TASK_INTERRUPTIBLE;
94 schedule();
95 if (do_signal(regs, &saveset, 1))
96 return -EINTR;
97 }
98}
99
100asmlinkage int
101sys_sigaction(int sig, const struct old_sigaction *act,
102 struct old_sigaction *oact)
103{
104 struct k_sigaction new_ka, old_ka;
105 int ret;
106
107 if (act) {
108 old_sigset_t mask;
109 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
110 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
111 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
112 return -EFAULT;
113 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
114 __get_user(mask, &act->sa_mask);
115 siginitset(&new_ka.sa.sa_mask, mask);
116 }
117
118 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
119
120 if (!ret && oact) {
121 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
122 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
123 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
124 return -EFAULT;
125 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
126 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
127 }
128
129 return ret;
130}
131
132asmlinkage int
133sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
134 struct pt_regs *regs)
135{
136 return do_sigaltstack(uss, uoss, regs->r1);
137}
138
139/*
140 * Do a signal return; undo the signal stack.
141 */
142
143struct sigframe {
144 struct sigcontext sc;
145 unsigned long extramask[_NSIG_WORDS-1];
146 unsigned long tramp[2]; /* signal trampoline */
147};
148
149struct rt_sigframe {
150 struct siginfo info;
151 struct ucontext uc;
152 unsigned long tramp[2]; /* signal trampoline */
153};
154
155static int
156restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *rval_p)
157{
158 unsigned int err = 0;
159
160#define COPY(x) {err |= __get_user(regs->x, &sc->regs.x); }
161 COPY(r0);
162 COPY(r1);
163 COPY(r2); COPY(r3); COPY(r4); COPY(r5);
164 COPY(r6); COPY(r7); COPY(r8); COPY(r9);
165 COPY(r10); COPY(r11); COPY(r12); COPY(r13);
166 COPY(r14); COPY(r15); COPY(r16); COPY(r17);
167 COPY(r18); COPY(r19); COPY(r20); COPY(r21);
168 COPY(r22); COPY(r23); COPY(r24); COPY(r25);
169 COPY(r26); COPY(r27); COPY(r28); COPY(r29);
170 COPY(r30); COPY(r31);
171 COPY(pc); COPY(ear); COPY(esr); COPY(fsr);
172#undef COPY
173
174 *rval_p = regs->r3;
175
176 return err;
177}
178
179asmlinkage int sys_sigreturn(struct pt_regs *regs)
180{
181 struct sigframe *frame = (struct sigframe *)regs->r1;
182 sigset_t set;
183 int rval;
184
185 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
186 goto badframe;
187
188 if (__get_user(set.sig[0], &frame->sc.oldmask)
189 || (_NSIG_WORDS > 1
190 && __copy_from_user(&set.sig[1], &frame->extramask,
191 sizeof(frame->extramask))))
192 goto badframe;
193
194 sigdelsetmask(&set, ~_BLOCKABLE);
195
196 spin_lock_irq(&current->sighand->siglock);
197 current->blocked = set;
198 recalc_sigpending();
199 spin_unlock_irq(&current->sighand->siglock);
200
201 if (restore_sigcontext(regs, &frame->sc, &rval))
202 goto badframe;
203 return rval;
204
205badframe:
206 force_sig(SIGSEGV, current);
207 return 0;
208}
209
210asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
211{
212 struct rt_sigframe *frame = (struct rt_sigframe *)regs->r1;
213 sigset_t set;
214 stack_t st;
215 int rval;
216
217 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
218 goto badframe;
219
220 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
221 goto badframe;
222
223 sigdelsetmask(&set, ~_BLOCKABLE);
224 spin_lock_irq(&current->sighand->siglock);
225 current->blocked = set;
226 recalc_sigpending();
227 spin_unlock_irq(&current->sighand->siglock);
228
229 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &rval))
230 goto badframe;
231
232 if (__copy_from_user((void *)&st, &frame->uc.uc_stack, sizeof(st)))
233 goto badframe;
234 /* It is more difficult to avoid calling this function than to
235 call it and ignore errors. */
236 do_sigaltstack(&st, NULL, regs->r1);
237
238 return rval;
239
240badframe:
241 force_sig(SIGSEGV, current);
242 return 0;
243}
244
245/*
246 * Set up a signal frame.
247 */
248
249static int
250setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
251 unsigned long mask)
252{
253 int err = 0;
254
255#define COPY(x) {err |= __put_user(regs->x, &sc->regs.x); }
256 COPY(r0);
257 COPY(r1);
258 COPY(r2); COPY(r3); COPY(r4); COPY(r5);
259 COPY(r6); COPY(r7); COPY(r8); COPY(r9);
260 COPY(r10); COPY(r11); COPY(r12); COPY(r13);
261 COPY(r14); COPY(r15); COPY(r16); COPY(r17);
262 COPY(r18); COPY(r19); COPY(r20); COPY(r21);
263 COPY(r22); COPY(r23); COPY(r24); COPY(r25);
264 COPY(r26); COPY(r27); COPY(r28); COPY(r29);
265 COPY(r30); COPY(r31);
266 COPY(pc); COPY(ear); COPY(esr); COPY(fsr);
267#undef COPY
268
269 err |= __put_user(mask, &sc->oldmask);
270
271 return err;
272}
273
274/*
275 * Determine which stack to use..
276 */
277static inline void *
278get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
279{
280 /* Default to using normal stack */
281 unsigned long sp = regs->r1;
282
283 if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && !on_sig_stack(sp))
284 sp = current->sas_ss_sp + current->sas_ss_size;
285
286 return (void *)((sp - frame_size) & -8UL);
287}
288
289static void setup_frame(int sig, struct k_sigaction *ka,
290 sigset_t *set, struct pt_regs *regs)
291{
292 struct sigframe *frame;
293 int err = 0;
294 int signal;
295
296 frame = get_sigframe(ka, regs, sizeof(*frame));
297
298 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
299 goto give_sigsegv;
300
301 signal = current_thread_info()->exec_domain
302 && current_thread_info()->exec_domain->signal_invmap
303 && sig < 32
304 ? current_thread_info()->exec_domain->signal_invmap[sig]
305 : sig;
306
307 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
308
309 if (_NSIG_WORDS > 1) {
310 err |= __copy_to_user(frame->extramask, &set->sig[1],
311 sizeof(frame->extramask));
312 }
313
314 /* Set up to return from userspace. If provided, use a stub
315 already in userspace. */
316 /* minus 8 is offset to cater for "rtsd r15,8" offset */
317 if (ka->sa.sa_flags & SA_RESTORER) {
318 regs->r15 = ((unsigned long)ka->sa.sa_restorer)-8;
319 } else {
320 /* Note, these encodings are _big endian_! */
321
322 /* addi r12, r0, __NR_sigreturn */
323 err |= __put_user(0x31800000 | __NR_sigreturn ,
324 frame->tramp + 0);
325 /* brki r14, 0x8 */
326 err |= __put_user(0xb9cc0008, frame->tramp + 1);
327
328 /* Return from sighandler will jump to the tramp.
329 Negative 8 offset because return is rtsd r15, 8 */
330 regs->r15 = ((unsigned long)frame->tramp)-8;
331
332 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
333 }
334
335 if (err)
336 goto give_sigsegv;
337
338 /* Set up registers for signal handler */
339 regs->r1 = (unsigned long) frame;
340 /* Signal handler args: */
341 regs->r5 = signal; /* Arg 0: signum */
342 regs->r6 = (unsigned long) &frame->sc; /* arg 1: sigcontext */
343
344 /* Offset of 4 to handle microblaze rtid r14, 0 */
345 regs->pc = (unsigned long)ka->sa.sa_handler;
346
347 set_fs(USER_DS);
348
349#ifdef DEBUG_SIG
350 printk(KERN_INFO "SIG deliver (%s:%d): sp=%p pc=%08lx\n",
351 current->comm, current->pid, frame, regs->pc);
352#endif
353
354 return;
355
356give_sigsegv:
357 if (sig == SIGSEGV)
358 ka->sa.sa_handler = SIG_DFL;
359 force_sig(SIGSEGV, current);
360}
361
362static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
363 sigset_t *set, struct pt_regs *regs)
364{
365 struct rt_sigframe *frame;
366 int err = 0;
367 int signal;
368
369 frame = get_sigframe(ka, regs, sizeof(*frame));
370
371 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
372 goto give_sigsegv;
373
374 signal = current_thread_info()->exec_domain
375 && current_thread_info()->exec_domain->signal_invmap
376 && sig < 32
377 ? current_thread_info()->exec_domain->signal_invmap[sig]
378 : sig;
379
380 err |= copy_siginfo_to_user(&frame->info, info);
381
382 /* Create the ucontext. */
383 err |= __put_user(0, &frame->uc.uc_flags);
384 err |= __put_user(0, &frame->uc.uc_link);
385 err |= __put_user((void *)current->sas_ss_sp,
386 &frame->uc.uc_stack.ss_sp);
387 err |= __put_user(sas_ss_flags(regs->r1),
388 &frame->uc.uc_stack.ss_flags);
389 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
390 err |= setup_sigcontext(&frame->uc.uc_mcontext,
391 regs, set->sig[0]);
392 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
393
394 /* Set up to return from userspace. If provided, use a stub
395 already in userspace. */
396 /* minus 8 is offset to cater for "rtsd r15,8" */
397 if (ka->sa.sa_flags & SA_RESTORER) {
398 regs->r15 = ((unsigned long)ka->sa.sa_restorer)-8;
399 } else {
400 /* addi r12, r0, __NR_sigreturn */
401 err |= __put_user(0x31800000 | __NR_rt_sigreturn ,
402 frame->tramp + 0);
403 /* brki r14, 0x8 */
404 err |= __put_user(0xb9cc0008, frame->tramp + 1);
405
406 /* Return from sighandler will jump to the tramp.
407 Negative 8 offset because return is rtsd r15, 8 */
408 regs->r15 = ((unsigned long)frame->tramp)-8;
409
410 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
411 }
412
413 if (err)
414 goto give_sigsegv;
415
416 /* Set up registers for signal handler */
417 regs->r1 = (unsigned long) frame;
418 /* Signal handler args: */
419 regs->r5 = signal; /* arg 0: signum */
420 regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */
421 regs->r7 = (unsigned long) &frame->uc; /* arg2: ucontext */
422 /* Offset to handle microblaze rtid r14, 0 */
423 regs->pc = (unsigned long)ka->sa.sa_handler;
424
425 set_fs(USER_DS);
426
427#ifdef DEBUG_SIG
428 printk(KERN_INFO "SIG deliver (%s:%d): sp=%p pc=%08lx\n",
429 current->comm, current->pid, frame, regs->pc);
430#endif
431
432 return;
433
434give_sigsegv:
435 if (sig == SIGSEGV)
436 ka->sa.sa_handler = SIG_DFL;
437 force_sig(SIGSEGV, current);
438}
439
440/* Handle restarting system calls */
441static inline void
442handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
443{
444 switch (regs->r3) {
445 case -ERESTART_RESTARTBLOCK:
446 case -ERESTARTNOHAND:
447 if (!has_handler)
448 goto do_restart;
449 regs->r3 = -EINTR;
450 break;
451 case -ERESTARTSYS:
452 if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
453 regs->r3 = -EINTR;
454 break;
455 }
456 /* fallthrough */
457 case -ERESTARTNOINTR:
458do_restart:
459 /* offset of 4 bytes to re-execute trap (brki) instruction */
460 regs->pc -= 4;
461 break;
462 }
463}
464
465/*
466 * OK, we're invoking a handler
467 */
468
469static void
470handle_signal(unsigned long sig, struct k_sigaction *ka,
471 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
472{
473 /* Set up the stack frame */
474 if (ka->sa.sa_flags & SA_SIGINFO)
475 setup_rt_frame(sig, ka, info, oldset, regs);
476 else
477 setup_frame(sig, ka, oldset, regs);
478
479 if (ka->sa.sa_flags & SA_ONESHOT)
480 ka->sa.sa_handler = SIG_DFL;
481
482 if (!(ka->sa.sa_flags & SA_NODEFER)) {
483 spin_lock_irq(&current->sighand->siglock);
484 sigorsets(&current->blocked,
485 &current->blocked, &ka->sa.sa_mask);
486 sigaddset(&current->blocked, sig);
487 recalc_sigpending();
488 spin_unlock_irq(&current->sighand->siglock);
489 }
490}
491
492/*
493 * Note that 'init' is a special process: it doesn't get signals it doesn't
494 * want to handle. Thus you cannot kill init even with a SIGKILL even by
495 * mistake.
496 *
497 * Note that we go through the signals twice: once to check the signals that
498 * the kernel can handle, and then we build all the user-level signal handling
499 * stack-frames in one go after that.
500 */
501int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall)
502{
503 siginfo_t info;
504 int signr;
505 struct k_sigaction ka;
506#ifdef DEBUG_SIG
507 printk(KERN_INFO "do signal: %p %p %d\n", regs, oldset, in_syscall);
508 printk(KERN_INFO "do signal2: %lx %lx %ld [%lx]\n", regs->pc, regs->r1,
509 regs->r12, current_thread_info()->flags);
510#endif
511 /*
512 * We want the common case to go fast, which
513 * is why we may in certain cases get here from
514 * kernel mode. Just return without doing anything
515 * if so.
516 */
517 if (kernel_mode(regs))
518 return 1;
519
520 if (!oldset)
521 oldset = &current->blocked;
522
523 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
524 if (signr > 0) {
525 /* Whee! Actually deliver the signal. */
526 if (in_syscall)
527 handle_restart(regs, &ka, 1);
528 handle_signal(signr, &ka, &info, oldset, regs);
529 return 1;
530 }
531
532 if (in_syscall)
533 handle_restart(regs, NULL, 0);
534
535 /* Did we come from a system call? */
536 return 0;
537}
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c
new file mode 100644
index 000000000000..ba0568c2cc1c
--- /dev/null
+++ b/arch/microblaze/kernel/sys_microblaze.c
@@ -0,0 +1,225 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2007 John Williams <john.williams@petalogix.com>
5 *
6 * Copyright (C) 2006 Atmark Techno, Inc.
7 * Yasushi SHOJI <yashi@atmark-techno.com>
8 * Tetsuya OHKAWA <tetsuya@atmark-techno.com>
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 */
14
15#include <linux/errno.h>
16#include <linux/mm.h>
17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/syscalls.h>
20#include <linux/sem.h>
21#include <linux/msg.h>
22#include <linux/shm.h>
23#include <linux/stat.h>
24#include <linux/mman.h>
25#include <linux/sys.h>
26#include <linux/ipc.h>
27#include <linux/utsname.h>
28#include <linux/file.h>
29#include <linux/module.h>
30#include <linux/err.h>
31#include <linux/fs.h>
32#include <linux/semaphore.h>
33#include <linux/uaccess.h>
34#include <linux/unistd.h>
35
36#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 int
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 -EINVAL;
135}
136
137asmlinkage int sys_vfork(struct pt_regs *regs)
138{
139 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1,
140 regs, 0, NULL, NULL);
141}
142
143asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs)
144{
145 if (!stack)
146 stack = regs->r1;
147 return do_fork(flags, stack, regs, 0, NULL, NULL);
148}
149
150asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
151 char __user *__user *envp, struct pt_regs *regs)
152{
153 int error;
154 char *filename;
155
156 filename = getname(filenamei);
157 error = PTR_ERR(filename);
158 if (IS_ERR(filename))
159 goto out;
160 error = do_execve(filename, argv, envp, regs);
161 putname(filename);
162out:
163 return error;
164}
165
166asmlinkage unsigned long
167sys_mmap2(unsigned long addr, size_t len,
168 unsigned long prot, unsigned long flags,
169 unsigned long fd, unsigned long pgoff)
170{
171 struct file *file = NULL;
172 int ret = -EBADF;
173
174 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
175 if (!(flags & MAP_ANONYMOUS)) {
176 file = fget(fd);
177 if (!file) {
178 printk(KERN_INFO "no fd in mmap\r\n");
179 goto out;
180 }
181 }
182
183 down_write(&current->mm->mmap_sem);
184 ret = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
185 up_write(&current->mm->mmap_sem);
186 if (file)
187 fput(file);
188out:
189 return ret;
190}
191
192asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
193 unsigned long prot, unsigned long flags,
194 unsigned long fd, off_t offset)
195{
196 int err = -EINVAL;
197
198 if (offset & ~PAGE_MASK) {
199 printk(KERN_INFO "no pagemask in mmap\r\n");
200 goto out;
201 }
202
203 err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
204out:
205 return err;
206}
207
208/*
209 * Do a system call from kernel instead of calling sys_execve so we
210 * end up with proper pt_regs.
211 */
212int kernel_execve(const char *filename, char *const argv[], char *const envp[])
213{
214 register const char *__a __asm__("r5") = filename;
215 register const void *__b __asm__("r6") = argv;
216 register const void *__c __asm__("r7") = envp;
217 register unsigned long __syscall __asm__("r12") = __NR_execve;
218 register unsigned long __ret __asm__("r3");
219 __asm__ __volatile__ ("brki r14, 0x8"
220 : "=r" (__ret), "=r" (__syscall)
221 : "1" (__syscall), "r" (__a), "r" (__b), "r" (__c)
222 : "r4", "r8", "r9",
223 "r10", "r11", "r14", "cc", "memory");
224 return __ret;
225}
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
new file mode 100644
index 000000000000..529b0dbf4fe9
--- /dev/null
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -0,0 +1,365 @@
1ENTRY(sys_call_table)
2 .long sys_restart_syscall /* 0 - old "setup()" system call,
3 * used for restarting */
4 .long sys_exit
5 .long sys_ni_syscall /* was fork */
6 .long sys_read
7 .long sys_write
8 .long sys_open /* 5 */
9 .long sys_close
10 .long sys_waitpid
11 .long sys_creat
12 .long sys_link
13 .long sys_unlink /* 10 */
14 .long sys_execve_wrapper
15 .long sys_chdir
16 .long sys_time
17 .long sys_mknod
18 .long sys_chmod /* 15 */
19 .long sys_lchown
20 .long sys_ni_syscall /* old break syscall holder */
21 .long sys_ni_syscall /* old stat */
22 .long sys_lseek
23 .long sys_getpid /* 20 */
24 .long sys_mount
25 .long sys_oldumount
26 .long sys_setuid
27 .long sys_getuid
28 .long sys_stime /* 25 */
29 .long sys_ptrace
30 .long sys_alarm
31 .long sys_ni_syscall /* oldfstat */
32 .long sys_pause
33 .long sys_utime /* 30 */
34 .long sys_ni_syscall /* old stty syscall holder */
35 .long sys_ni_syscall /* old gtty syscall holder */
36 .long sys_access
37 .long sys_nice
38 .long sys_ni_syscall /* 35 - old ftime syscall holder */
39 .long sys_sync
40 .long sys_kill
41 .long sys_rename
42 .long sys_mkdir
43 .long sys_rmdir /* 40 */
44 .long sys_dup
45 .long sys_pipe
46 .long sys_times
47 .long sys_ni_syscall /* old prof syscall holder */
48 .long sys_brk /* 45 */
49 .long sys_setgid
50 .long sys_getgid
51 .long sys_signal
52 .long sys_geteuid
53 .long sys_getegid /* 50 */
54 .long sys_acct
55 .long sys_umount /* recycled never used phys() */
56 .long sys_ni_syscall /* old lock syscall holder */
57 .long sys_ioctl
58 .long sys_fcntl /* 55 */
59 .long sys_ni_syscall /* old mpx syscall holder */
60 .long sys_setpgid
61 .long sys_ni_syscall /* old ulimit syscall holder */
62 .long sys_ni_syscall /* olduname */
63 .long sys_umask /* 60 */
64 .long sys_chroot
65 .long sys_ustat
66 .long sys_dup2
67 .long sys_getppid
68 .long sys_getpgrp /* 65 */
69 .long sys_setsid
70 .long sys_sigaction
71 .long sys_sgetmask
72 .long sys_ssetmask
73 .long sys_setreuid /* 70 */
74 .long sys_setregid
75 .long sys_sigsuspend_wrapper
76 .long sys_sigpending
77 .long sys_sethostname
78 .long sys_setrlimit /* 75 */
79 .long sys_ni_syscall /* old_getrlimit */
80 .long sys_getrusage
81 .long sys_gettimeofday
82 .long sys_settimeofday
83 .long sys_getgroups /* 80 */
84 .long sys_setgroups
85 .long sys_ni_syscall /* old_select */
86 .long sys_symlink
87 .long sys_ni_syscall /* oldlstat */
88 .long sys_readlink /* 85 */
89 .long sys_uselib
90 .long sys_swapon
91 .long sys_reboot
92 .long sys_ni_syscall /* old_readdir */
93 .long sys_mmap /* 90 */ /* old_mmap */
94 .long sys_munmap
95 .long sys_truncate
96 .long sys_ftruncate
97 .long sys_fchmod
98 .long sys_fchown /* 95 */
99 .long sys_getpriority
100 .long sys_setpriority
101 .long sys_ni_syscall /* old profil syscall holder */
102 .long sys_statfs
103 .long sys_fstatfs /* 100 */
104 .long sys_ni_syscall /* ioperm */
105 .long sys_socketcall
106 .long sys_syslog /* operation with system console */
107 .long sys_setitimer
108 .long sys_getitimer /* 105 */
109 .long sys_newstat
110 .long sys_newlstat
111 .long sys_newfstat
112 .long sys_ni_syscall /* uname */
113 .long sys_ni_syscall /* 110 */ /* iopl */
114 .long sys_vhangup
115 .long sys_ni_syscall /* old "idle" system call */
116 .long sys_ni_syscall /* old sys_vm86old */
117 .long sys_wait4
118 .long sys_swapoff /* 115 */
119 .long sys_sysinfo
120 .long sys_ipc
121 .long sys_fsync
122 .long sys_sigreturn_wrapper
123 .long sys_clone_wrapper /* 120 */
124 .long sys_setdomainname
125 .long sys_newuname
126 .long sys_ni_syscall /* modify_ldt */
127 .long sys_adjtimex
128 .long sys_mprotect /* 125: sys_mprotect */
129 .long sys_sigprocmask
130 .long sys_ni_syscall /* old "create_module" */
131 .long sys_init_module
132 .long sys_delete_module
133 .long sys_ni_syscall /* 130: old "get_kernel_syms" */
134 .long sys_quotactl
135 .long sys_getpgid
136 .long sys_fchdir
137 .long sys_bdflush
138 .long sys_sysfs /* 135 */
139 .long sys_personality
140 .long sys_ni_syscall /* reserved for afs_syscall */
141 .long sys_setfsuid
142 .long sys_setfsgid
143 .long sys_llseek /* 140 */
144 .long sys_getdents
145 .long sys_select
146 .long sys_flock
147 .long sys_msync
148 .long sys_readv /* 145 */
149 .long sys_writev
150 .long sys_getsid
151 .long sys_fdatasync
152 .long sys_sysctl
153 .long sys_mlock /* 150: sys_mlock */
154 .long sys_munlock
155 .long sys_mlockall
156 .long sys_munlockall
157 .long sys_sched_setparam
158 .long sys_sched_getparam /* 155 */
159 .long sys_sched_setscheduler
160 .long sys_sched_getscheduler
161 .long sys_sched_yield
162 .long sys_sched_get_priority_max
163 .long sys_sched_get_priority_min /* 160 */
164 .long sys_sched_rr_get_interval
165 .long sys_nanosleep
166 .long sys_mremap
167 .long sys_setresuid
168 .long sys_getresuid /* 165 */
169 .long sys_ni_syscall /* sys_vm86 */
170 .long sys_ni_syscall /* Old sys_query_module */
171 .long sys_poll
172 .long sys_nfsservctl
173 .long sys_setresgid /* 170 */
174 .long sys_getresgid
175 .long sys_prctl
176 .long sys_rt_sigreturn_wrapper
177 .long sys_rt_sigaction
178 .long sys_rt_sigprocmask /* 175 */
179 .long sys_rt_sigpending
180 .long sys_rt_sigtimedwait
181 .long sys_rt_sigqueueinfo
182 .long sys_rt_sigsuspend_wrapper
183 .long sys_pread64 /* 180 */
184 .long sys_pwrite64
185 .long sys_chown
186 .long sys_getcwd
187 .long sys_capget
188 .long sys_capset /* 185 */
189 .long sys_ni_syscall /* sigaltstack */
190 .long sys_sendfile
191 .long sys_ni_syscall /* reserved for streams1 */
192 .long sys_ni_syscall /* reserved for streams2 */
193 .long sys_vfork_wrapper /* 190 */
194 .long sys_getrlimit
195 .long sys_mmap2 /* mmap2 */
196 .long sys_truncate64
197 .long sys_ftruncate64
198 .long sys_stat64 /* 195 */
199 .long sys_lstat64
200 .long sys_fstat64
201 .long sys_lchown
202 .long sys_getuid
203 .long sys_getgid /* 200 */
204 .long sys_geteuid
205 .long sys_getegid
206 .long sys_setreuid
207 .long sys_setregid
208 .long sys_getgroups /* 205 */
209 .long sys_setgroups
210 .long sys_fchown
211 .long sys_setresuid
212 .long sys_getresuid
213 .long sys_setresgid /* 210 */
214 .long sys_getresgid
215 .long sys_chown
216 .long sys_setuid
217 .long sys_setgid
218 .long sys_setfsuid /* 215 */
219 .long sys_setfsgid
220 .long sys_pivot_root
221 .long sys_mincore
222 .long sys_madvise
223 .long sys_getdents64 /* 220 */
224 .long sys_fcntl64
225 .long sys_ni_syscall /* reserved for TUX */
226 .long sys_ni_syscall
227 .long sys_gettid
228 .long sys_readahead /* 225 */
229 .long sys_setxattr
230 .long sys_lsetxattr
231 .long sys_fsetxattr
232 .long sys_getxattr
233 .long sys_lgetxattr /* 230 */
234 .long sys_fgetxattr
235 .long sys_listxattr
236 .long sys_llistxattr
237 .long sys_flistxattr
238 .long sys_removexattr /* 235 */
239 .long sys_lremovexattr
240 .long sys_fremovexattr
241 .long sys_tkill
242 .long sys_sendfile64
243 .long sys_futex /* 240 */
244 .long sys_sched_setaffinity
245 .long sys_sched_getaffinity
246 .long sys_ni_syscall /* set_thread_area */
247 .long sys_ni_syscall /* get_thread_area */
248 .long sys_io_setup /* 245 */
249 .long sys_io_destroy
250 .long sys_io_getevents
251 .long sys_io_submit
252 .long sys_io_cancel
253 .long sys_fadvise64 /* 250 */
254 .long sys_ni_syscall
255 .long sys_exit_group
256 .long sys_lookup_dcookie
257 .long sys_epoll_create
258 .long sys_epoll_ctl /* 255 */
259 .long sys_epoll_wait
260 .long sys_remap_file_pages
261 .long sys_set_tid_address
262 .long sys_timer_create
263 .long sys_timer_settime /* 260 */
264 .long sys_timer_gettime
265 .long sys_timer_getoverrun
266 .long sys_timer_delete
267 .long sys_clock_settime
268 .long sys_clock_gettime /* 265 */
269 .long sys_clock_getres
270 .long sys_clock_nanosleep
271 .long sys_statfs64
272 .long sys_fstatfs64
273 .long sys_tgkill /* 270 */
274 .long sys_utimes
275 .long sys_fadvise64_64
276 .long sys_ni_syscall /* sys_vserver */
277 .long sys_mbind
278 .long sys_get_mempolicy
279 .long sys_set_mempolicy
280 .long sys_mq_open
281 .long sys_mq_unlink
282 .long sys_mq_timedsend
283 .long sys_mq_timedreceive /* 280 */
284 .long sys_mq_notify
285 .long sys_mq_getsetattr
286 .long sys_kexec_load
287 .long sys_waitid
288 .long sys_ni_syscall /* 285 */ /* available */
289 .long sys_add_key
290 .long sys_request_key
291 .long sys_keyctl
292 .long sys_ioprio_set
293 .long sys_ioprio_get /* 290 */
294 .long sys_inotify_init
295 .long sys_inotify_add_watch
296 .long sys_inotify_rm_watch
297 .long sys_ni_syscall /* sys_migrate_pages */
298 .long sys_openat /* 295 */
299 .long sys_mkdirat
300 .long sys_mknodat
301 .long sys_fchownat
302 .long sys_ni_syscall
303 .long sys_fstatat64 /* 300 */
304 .long sys_unlinkat
305 .long sys_renameat
306 .long sys_linkat
307 .long sys_symlinkat
308 .long sys_readlinkat /* 305 */
309 .long sys_fchmodat
310 .long sys_faccessat
311 .long sys_ni_syscall /* pselect6 */
312 .long sys_ni_syscall /* sys_ppoll */
313 .long sys_unshare /* 310 */
314 .long sys_set_robust_list
315 .long sys_get_robust_list
316 .long sys_splice
317 .long sys_sync_file_range
318 .long sys_tee /* 315 */
319 .long sys_vmsplice
320 .long sys_move_pages
321 .long sys_getcpu
322 .long sys_epoll_pwait
323 .long sys_utimensat /* 320 */
324 .long sys_signalfd
325 .long sys_timerfd_create
326 .long sys_eventfd
327 .long sys_fallocate
328 .long sys_semtimedop /* 325 */
329 .long sys_timerfd_settime
330 .long sys_timerfd_gettime
331 .long sys_semctl
332 .long sys_semget
333 .long sys_semop /* 330 */
334 .long sys_msgctl
335 .long sys_msgget
336 .long sys_msgrcv
337 .long sys_msgsnd
338 .long sys_shmat /* 335 */
339 .long sys_shmctl
340 .long sys_shmdt
341 .long sys_shmget
342 .long sys_signalfd4 /* new syscall */
343 .long sys_eventfd2 /* 340 */
344 .long sys_epoll_create1
345 .long sys_dup3
346 .long sys_pipe2
347 .long sys_inotify_init1
348 .long sys_socket /* 345 */
349 .long sys_socketpair
350 .long sys_bind
351 .long sys_listen
352 .long sys_accept
353 .long sys_connect /* 350 */
354 .long sys_getsockname
355 .long sys_getpeername
356 .long sys_sendto
357 .long sys_send
358 .long sys_recvfrom /* 355 */
359 .long sys_recv
360 .long sys_setsockopt
361 .long sys_getsockopt
362 .long sys_shutdown
363 .long sys_sendmsg /* 360 */
364 .long sys_recvmsg
365 .long sys_ni_syscall
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
new file mode 100644
index 000000000000..05a497eefd78
--- /dev/null
+++ b/arch/microblaze/kernel/timer.c
@@ -0,0 +1,262 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/param.h>
14#include <linux/interrupt.h>
15#include <linux/profile.h>
16#include <linux/irq.h>
17#include <linux/delay.h>
18#include <linux/sched.h>
19#include <linux/spinlock.h>
20#include <linux/err.h>
21#include <linux/clk.h>
22#include <linux/clocksource.h>
23#include <linux/clockchips.h>
24#include <linux/io.h>
25#include <asm/cpuinfo.h>
26#include <asm/setup.h>
27#include <asm/prom.h>
28#include <asm/irq.h>
29#include <asm/system.h>
30
31#ifdef CONFIG_SELFMOD_TIMER
32#include <asm/selfmod.h>
33#define TIMER_BASE BARRIER_BASE_ADDR
34#else
35static unsigned int timer_baseaddr;
36#define TIMER_BASE timer_baseaddr
37#endif
38
39#define TCSR0 (0x00)
40#define TLR0 (0x04)
41#define TCR0 (0x08)
42#define TCSR1 (0x10)
43#define TLR1 (0x14)
44#define TCR1 (0x18)
45
46#define TCSR_MDT (1<<0)
47#define TCSR_UDT (1<<1)
48#define TCSR_GENT (1<<2)
49#define TCSR_CAPT (1<<3)
50#define TCSR_ARHT (1<<4)
51#define TCSR_LOAD (1<<5)
52#define TCSR_ENIT (1<<6)
53#define TCSR_ENT (1<<7)
54#define TCSR_TINT (1<<8)
55#define TCSR_PWMA (1<<9)
56#define TCSR_ENALL (1<<10)
57
58static inline void microblaze_timer0_stop(void)
59{
60 out_be32(TIMER_BASE + TCSR0, in_be32(TIMER_BASE + TCSR0) & ~TCSR_ENT);
61}
62
63static inline void microblaze_timer0_start_periodic(unsigned long load_val)
64{
65 if (!load_val)
66 load_val = 1;
67 out_be32(TIMER_BASE + TLR0, load_val); /* loading value to timer reg */
68
69 /* load the initial value */
70 out_be32(TIMER_BASE + TCSR0, TCSR_LOAD);
71
72 /* see timer data sheet for detail
73 * !ENALL - don't enable 'em all
74 * !PWMA - disable pwm
75 * TINT - clear interrupt status
76 * ENT- enable timer itself
77 * EINT - enable interrupt
78 * !LOAD - clear the bit to let go
79 * ARHT - auto reload
80 * !CAPT - no external trigger
81 * !GENT - no external signal
82 * UDT - set the timer as down counter
83 * !MDT0 - generate mode
84 */
85 out_be32(TIMER_BASE + TCSR0,
86 TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT);
87}
88
89static inline void microblaze_timer0_start_oneshot(unsigned long load_val)
90{
91 if (!load_val)
92 load_val = 1;
93 out_be32(TIMER_BASE + TLR0, load_val); /* loading value to timer reg */
94
95 /* load the initial value */
96 out_be32(TIMER_BASE + TCSR0, TCSR_LOAD);
97
98 out_be32(TIMER_BASE + TCSR0,
99 TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT);
100}
101
102static int microblaze_timer_set_next_event(unsigned long delta,
103 struct clock_event_device *dev)
104{
105 pr_debug("%s: next event, delta %x\n", __func__, (u32)delta);
106 microblaze_timer0_start_oneshot(delta);
107 return 0;
108}
109
110static void microblaze_timer_set_mode(enum clock_event_mode mode,
111 struct clock_event_device *evt)
112{
113 switch (mode) {
114 case CLOCK_EVT_MODE_PERIODIC:
115 printk(KERN_INFO "%s: periodic\n", __func__);
116 microblaze_timer0_start_periodic(cpuinfo.freq_div_hz);
117 break;
118 case CLOCK_EVT_MODE_ONESHOT:
119 printk(KERN_INFO "%s: oneshot\n", __func__);
120 break;
121 case CLOCK_EVT_MODE_UNUSED:
122 printk(KERN_INFO "%s: unused\n", __func__);
123 break;
124 case CLOCK_EVT_MODE_SHUTDOWN:
125 printk(KERN_INFO "%s: shutdown\n", __func__);
126 microblaze_timer0_stop();
127 break;
128 case CLOCK_EVT_MODE_RESUME:
129 printk(KERN_INFO "%s: resume\n", __func__);
130 break;
131 }
132}
133
134static struct clock_event_device clockevent_microblaze_timer = {
135 .name = "microblaze_clockevent",
136 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
137 .shift = 24,
138 .rating = 300,
139 .set_next_event = microblaze_timer_set_next_event,
140 .set_mode = microblaze_timer_set_mode,
141};
142
143static inline void timer_ack(void)
144{
145 out_be32(TIMER_BASE + TCSR0, in_be32(TIMER_BASE + TCSR0));
146}
147
148static irqreturn_t timer_interrupt(int irq, void *dev_id)
149{
150 struct clock_event_device *evt = &clockevent_microblaze_timer;
151#ifdef CONFIG_HEART_BEAT
152 heartbeat();
153#endif
154 timer_ack();
155 evt->event_handler(evt);
156 return IRQ_HANDLED;
157}
158
159static struct irqaction timer_irqaction = {
160 .handler = timer_interrupt,
161 .flags = IRQF_DISABLED | IRQF_TIMER,
162 .name = "timer",
163 .dev_id = &clockevent_microblaze_timer,
164};
165
166static __init void microblaze_clockevent_init(void)
167{
168 clockevent_microblaze_timer.mult =
169 div_sc(cpuinfo.cpu_clock_freq, NSEC_PER_SEC,
170 clockevent_microblaze_timer.shift);
171 clockevent_microblaze_timer.max_delta_ns =
172 clockevent_delta2ns((u32)~0, &clockevent_microblaze_timer);
173 clockevent_microblaze_timer.min_delta_ns =
174 clockevent_delta2ns(1, &clockevent_microblaze_timer);
175 clockevent_microblaze_timer.cpumask = cpumask_of(0);
176 clockevents_register_device(&clockevent_microblaze_timer);
177}
178
179static cycle_t microblaze_read(void)
180{
181 /* reading actual value of timer 1 */
182 return (cycle_t) (in_be32(TIMER_BASE + TCR1));
183}
184
185static struct clocksource clocksource_microblaze = {
186 .name = "microblaze_clocksource",
187 .rating = 300,
188 .read = microblaze_read,
189 .mask = CLOCKSOURCE_MASK(32),
190 .shift = 24, /* I can shift it */
191 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
192};
193
194static int __init microblaze_clocksource_init(void)
195{
196 clocksource_microblaze.mult =
197 clocksource_hz2mult(cpuinfo.cpu_clock_freq,
198 clocksource_microblaze.shift);
199 if (clocksource_register(&clocksource_microblaze))
200 panic("failed to register clocksource");
201
202 /* stop timer1 */
203 out_be32(TIMER_BASE + TCSR1, in_be32(TIMER_BASE + TCSR1) & ~TCSR_ENT);
204 /* start timer1 - up counting without interrupt */
205 out_be32(TIMER_BASE + TCSR1, TCSR_TINT|TCSR_ENT|TCSR_ARHT);
206 return 0;
207}
208
209void __init time_init(void)
210{
211 u32 irq, i = 0;
212 u32 timer_num = 1;
213 struct device_node *timer = NULL;
214#ifdef CONFIG_SELFMOD_TIMER
215 unsigned int timer_baseaddr = 0;
216 int arr_func[] = {
217 (int)&microblaze_read,
218 (int)&timer_interrupt,
219 (int)&microblaze_clocksource_init,
220 (int)&microblaze_timer_set_mode,
221 (int)&microblaze_timer_set_next_event,
222 0
223 };
224#endif
225 char *timer_list[] = {
226 "xlnx,xps-timer-1.00.a",
227 "xlnx,opb-timer-1.00.b",
228 "xlnx,opb-timer-1.00.a",
229 NULL
230 };
231
232 for (i = 0; timer_list[i] != NULL; i++) {
233 timer = of_find_compatible_node(NULL, NULL, timer_list[i]);
234 if (timer)
235 break;
236 }
237
238 timer_baseaddr = *(int *) of_get_property(timer, "reg", NULL);
239 timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
240 irq = *(int *) of_get_property(timer, "interrupts", NULL);
241 timer_num =
242 *(int *) of_get_property(timer, "xlnx,one-timer-only", NULL);
243 if (timer_num) {
244 printk(KERN_EMERG "Please enable two timers in HW\n");
245 BUG();
246 }
247
248#ifdef CONFIG_SELFMOD_TIMER
249 selfmod_function((int *) arr_func, timer_baseaddr);
250#endif
251 printk(KERN_INFO "%s #0 at 0x%08x, irq=%d\n",
252 timer_list[i], timer_baseaddr, irq);
253
254 cpuinfo.freq_div_hz = cpuinfo.cpu_clock_freq / HZ;
255
256 setup_irq(irq, &timer_irqaction);
257#ifdef CONFIG_HEART_BEAT
258 setup_heartbeat();
259#endif
260 microblaze_clocksource_init();
261 microblaze_clockevent_init();
262}
diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c
new file mode 100644
index 000000000000..fbdc533c61e3
--- /dev/null
+++ b/arch/microblaze/kernel/traps.c
@@ -0,0 +1,107 @@
1/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/kernel.h>
12#include <linux/kallsyms.h>
13#include <linux/module.h>
14#include <linux/sched.h>
15#include <linux/debug_locks.h>
16
17#include <asm/exceptions.h>
18#include <asm/system.h>
19
20void trap_init(void)
21{
22 __enable_hw_exceptions();
23}
24
25void __bad_xchg(volatile void *ptr, int size)
26{
27 printk(KERN_INFO "xchg: bad data size: pc 0x%p, ptr 0x%p, size %d\n",
28 __builtin_return_address(0), ptr, size);
29 BUG();
30}
31EXPORT_SYMBOL(__bad_xchg);
32
33static int kstack_depth_to_print = 24;
34
35static int __init kstack_setup(char *s)
36{
37 kstack_depth_to_print = strict_strtoul(s, 0, 0);
38
39 return 1;
40}
41__setup("kstack=", kstack_setup);
42
43void show_trace(struct task_struct *task, unsigned long *stack)
44{
45 unsigned long addr;
46
47 if (!stack)
48 stack = (unsigned long *)&stack;
49
50 printk(KERN_NOTICE "Call Trace: ");
51#ifdef CONFIG_KALLSYMS
52 printk(KERN_NOTICE "\n");
53#endif
54 while (!kstack_end(stack)) {
55 addr = *stack++;
56 /*
57 * If the address is either in the text segment of the
58 * kernel, or in the region which contains vmalloc'ed
59 * memory, it *may* be the address of a calling
60 * routine; if so, print it so that someone tracing
61 * down the cause of the crash will be able to figure
62 * out the call path that was taken.
63 */
64 if (kernel_text_address(addr))
65 print_ip_sym(addr);
66 }
67 printk(KERN_NOTICE "\n");
68
69 if (!task)
70 task = current;
71
72 debug_show_held_locks(task);
73}
74
75void show_stack(struct task_struct *task, unsigned long *sp)
76{
77 unsigned long *stack;
78 int i;
79
80 if (sp == NULL) {
81 if (task)
82 sp = (unsigned long *) ((struct thread_info *)
83 (task->stack))->cpu_context.r1;
84 else
85 sp = (unsigned long *)&sp;
86 }
87
88 stack = sp;
89
90 printk(KERN_INFO "\nStack:\n ");
91
92 for (i = 0; i < kstack_depth_to_print; i++) {
93 if (kstack_end(sp))
94 break;
95 if (i && ((i % 8) == 0))
96 printk("\n ");
97 printk("%08lx ", *sp++);
98 }
99 printk("\n");
100 show_trace(task, stack);
101}
102
103void dump_stack(void)
104{
105 show_stack(NULL, NULL);
106}
107EXPORT_SYMBOL(dump_stack);
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..840385e51291
--- /dev/null
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -0,0 +1,163 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
12OUTPUT_ARCH(microblaze)
13ENTRY(_start)
14
15#include <asm-generic/vmlinux.lds.h>
16
17jiffies = jiffies_64 + 4;
18
19SECTIONS {
20 . = CONFIG_KERNEL_BASE_ADDR;
21
22 .text : {
23 _text = . ;
24 _stext = . ;
25 *(.text .text.*)
26 *(.fixup)
27
28 *(.exitcall.exit)
29 SCHED_TEXT
30 LOCK_TEXT
31 KPROBES_TEXT
32 . = ALIGN (4) ;
33 _etext = . ;
34 }
35
36 . = ALIGN (4) ;
37 _fdt_start = . ; /* place for fdt blob */
38 . = . + 0x4000;
39 _fdt_end = . ;
40
41 . = ALIGN(16);
42 RODATA
43 . = ALIGN(16);
44 __ex_table : {
45 __start___ex_table = .;
46 *(__ex_table)
47 __stop___ex_table = .;
48 }
49
50 /*
51 * sdata2 section can go anywhere, but must be word aligned
52 * and SDA2_BASE must point to the middle of it
53 */
54 .sdata2 : {
55 _ssrw = .;
56 . = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */
57 *(.sdata2)
58 . = ALIGN(8);
59 _essrw = .;
60 _ssrw_size = _essrw - _ssrw;
61 _KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
62 }
63
64 _sdata = . ;
65 .data ALIGN (4096) : { /* page aligned when MMU used - origin 0x4 */
66 *(.data)
67 }
68 . = ALIGN(32);
69 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
70 _edata = . ;
71
72 /* Reserve some low RAM for r0 based memory references */
73 . = ALIGN(0x4) ;
74 r0_ram = . ;
75 . = . + 4096; /* a page should be enough */
76
77 /* The initial task */
78 . = ALIGN(8192);
79 .data.init_task : { *(.data.init_task) }
80
81 /* Under the microblaze ABI, .sdata and .sbss must be contiguous */
82 . = ALIGN(8);
83 .sdata : {
84 _ssro = .;
85 *(.sdata)
86 }
87
88 .sbss : {
89 _ssbss = .;
90 *(.sbss)
91 _esbss = .;
92 _essro = .;
93 _ssro_size = _essro - _ssro ;
94 _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
95 }
96
97 __init_begin = .;
98
99 . = ALIGN(4096);
100 .init.text : {
101 _sinittext = . ;
102 *(.init.text)
103 *(.exit.text)
104 *(.exit.data)
105 _einittext = .;
106 }
107
108 .init.data : { *(.init.data) }
109
110 . = ALIGN(4);
111 .init.ivt : {
112 __ivt_start = .;
113 *(.init.ivt)
114 __ivt_end = .;
115 }
116
117 .init.setup : {
118 __setup_start = .;
119 *(.init.setup)
120 __setup_end = .;
121 }
122
123 .initcall.init : {
124 __initcall_start = .;
125 INITCALLS
126 __initcall_end = .;
127 }
128
129 .con_initcall.init : {
130 __con_initcall_start = .;
131 *(.con_initcall.init)
132 __con_initcall_end = .;
133 }
134
135 __init_end_before_initramfs = .;
136
137 .init.ramfs ALIGN(4096) : {
138 __initramfs_start = .;
139 *(.init.ramfs)
140 __initramfs_end = .;
141 . = ALIGN(4);
142 LONG(0);
143/*
144 * FIXME this can break initramfs for MMU.
145 * Pad init.ramfs up to page boundary,
146 * so that __init_end == __bss_start. This will make image.elf
147 * consistent with the image.bin
148 */
149 /* . = ALIGN(4096); */
150 }
151 __init_end = .;
152
153 .bss ALIGN (4096) : { /* page aligned when MMU used */
154 __bss_start = . ;
155 *(.bss*)
156 *(COMMON)
157 . = ALIGN (4) ;
158 __bss_stop = . ;
159 _ebss = . ;
160 }
161 . = ALIGN(4096);
162 _end = .;
163}
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
new file mode 100644
index 000000000000..d27126bf306a
--- /dev/null
+++ b/arch/microblaze/lib/Makefile
@@ -0,0 +1,13 @@
1#
2# Makefile
3#
4
5lib-y := memset.o checksum.o
6
7ifeq ($(CONFIG_OPT_LIB_ASM),y)
8lib-y += fastcopy.o
9else
10lib-y += memcpy.o memmove.o
11endif
12
13lib-y += uaccess.o
diff --git a/arch/microblaze/lib/checksum.c b/arch/microblaze/lib/checksum.c
new file mode 100644
index 000000000000..809340070a13
--- /dev/null
+++ b/arch/microblaze/lib/checksum.c
@@ -0,0 +1,163 @@
1/*
2 *
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * IP/TCP/UDP checksumming routines
8 *
9 * Authors: Jorge Cwik, <jorge@laser.satlink.net>
10 * Arnt Gulbrandsen, <agulbra@nvg.unit.no>
11 * Tom May, <ftom@netcom.com>
12 * Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>
13 * Lots of code moved from tcp.c and ip.c; see those files
14 * for more names.
15 *
16 * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek:
17 * Fixed some nasty bugs, causing some horrible crashes.
18 * A: At some points, the sum (%0) was used as
19 * length-counter instead of the length counter
20 * (%1). Thanks to Roman Hodek for pointing this out.
21 * B: GCC seems to mess up if one uses too many
22 * data-registers to hold input values and one tries to
23 * specify d0 and d1 as scratch registers. Letting gcc
24 * choose these registers itself solves the problem.
25 *
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License
28 * as published by the Free Software Foundation; either version
29 * 2 of the License, or (at your option) any later version.
30 */
31
32/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
33 kills, so most of the assembly has to go. */
34
35#include <net/checksum.h>
36#include <asm/checksum.h>
37#include <linux/module.h>
38
39static inline unsigned short from32to16(unsigned long x)
40{
41 /* add up 16-bit and 16-bit for 16+c bit */
42 x = (x & 0xffff) + (x >> 16);
43 /* add up carry.. */
44 x = (x & 0xffff) + (x >> 16);
45 return x;
46}
47
48static unsigned int do_csum(const unsigned char *buff, int len)
49{
50 int odd, count;
51 unsigned long result = 0;
52
53 if (len <= 0)
54 goto out;
55 odd = 1 & (unsigned long) buff;
56 if (odd) {
57 result = *buff;
58 len--;
59 buff++;
60 }
61 count = len >> 1; /* nr of 16-bit words.. */
62 if (count) {
63 if (2 & (unsigned long) buff) {
64 result += *(unsigned short *) buff;
65 count--;
66 len -= 2;
67 buff += 2;
68 }
69 count >>= 1; /* nr of 32-bit words.. */
70 if (count) {
71 unsigned long carry = 0;
72 do {
73 unsigned long w = *(unsigned long *) buff;
74 count--;
75 buff += 4;
76 result += carry;
77 result += w;
78 carry = (w > result);
79 } while (count);
80 result += carry;
81 result = (result & 0xffff) + (result >> 16);
82 }
83 if (len & 2) {
84 result += *(unsigned short *) buff;
85 buff += 2;
86 }
87 }
88 if (len & 1)
89 result += (*buff << 8);
90 result = from32to16(result);
91 if (odd)
92 result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
93out:
94 return result;
95}
96
97/*
98 * This is a version of ip_compute_csum() optimized for IP headers,
99 * which always checksum on 4 octet boundaries.
100 */
101__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
102{
103 return (__force __sum16)~do_csum(iph, ihl*4);
104}
105
106/*
107 * computes the checksum of a memory block at buff, length len,
108 * and adds in "sum" (32-bit)
109 *
110 * returns a 32-bit number suitable for feeding into itself
111 * or csum_tcpudp_magic
112 *
113 * this function must be called with even lengths, except
114 * for the last fragment, which may be odd
115 *
116 * it's best to have buff aligned on a 32-bit boundary
117 */
118__wsum csum_partial(const void *buff, int len, __wsum sum)
119{
120 unsigned int result = do_csum(buff, len);
121
122 /* add in old sum, and carry.. */
123 result += sum;
124 if (sum > result)
125 result += 1;
126 return result;
127}
128EXPORT_SYMBOL(csum_partial);
129
130/*
131 * this routine is used for miscellaneous IP-like checksums, mainly
132 * in icmp.c
133 */
134__sum16 ip_compute_csum(const unsigned char *buff, int len)
135{
136 return ~do_csum(buff, len);
137}
138EXPORT_SYMBOL(ip_compute_csum);
139
140/*
141 * copy from fs while checksumming, otherwise like csum_partial
142 */
143__wsum
144csum_partial_copy_from_user(const char __user *src, char *dst, int len,
145 int sum, int *csum_err)
146{
147 if (csum_err)
148 *csum_err = 0;
149 memcpy(dst, src, len);
150 return csum_partial(dst, len, sum);
151}
152EXPORT_SYMBOL(csum_partial_copy_from_user);
153
154/*
155 * copy from ds while checksumming, otherwise like csum_partial
156 */
157__wsum
158csum_partial_copy(const char *src, char *dst, int len, int sum)
159{
160 memcpy(dst, src, len);
161 return csum_partial(dst, len, sum);
162}
163EXPORT_SYMBOL(csum_partial_copy);
diff --git a/arch/microblaze/lib/fastcopy.S b/arch/microblaze/lib/fastcopy.S
new file mode 100644
index 000000000000..02e3ab4eddf3
--- /dev/null
+++ b/arch/microblaze/lib/fastcopy.S
@@ -0,0 +1,662 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2008 Jim Law - Iris LP All rights reserved.
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file COPYING in the main directory of this
8 * archive for more details.
9 *
10 * Written by Jim Law <jlaw@irispower.com>
11 *
12 * intended to replace:
13 * memcpy in memcpy.c and
14 * memmove in memmove.c
15 * ... in arch/microblaze/lib
16 *
17 *
18 * assly_fastcopy.S
19 *
20 * Attempt at quicker memcpy and memmove for MicroBlaze
21 * Input : Operand1 in Reg r5 - destination address
22 * Operand2 in Reg r6 - source address
23 * Operand3 in Reg r7 - number of bytes to transfer
24 * Output: Result in Reg r3 - starting destinaition address
25 *
26 *
27 * Explanation:
28 * Perform (possibly unaligned) copy of a block of memory
29 * between mem locations with size of xfer spec'd in bytes
30 */
31
32#include <linux/linkage.h>
33
34 .globl memcpy
35 .ent memcpy
36
37memcpy:
38fast_memcpy_ascending:
39 /* move d to return register as value of function */
40 addi r3, r5, 0
41
42 addi r4, r0, 4 /* n = 4 */
43 cmpu r4, r4, r7 /* n = c - n (unsigned) */
44 blti r4, a_xfer_end /* if n < 0, less than one word to transfer */
45
46 /* transfer first 0~3 bytes to get aligned dest address */
47 andi r4, r5, 3 /* n = d & 3 */
48 /* if zero, destination already aligned */
49 beqi r4, a_dalign_done
50 /* n = 4 - n (yields 3, 2, 1 transfers for 1, 2, 3 addr offset) */
51 rsubi r4, r4, 4
52 rsub r7, r4, r7 /* c = c - n adjust c */
53
54a_xfer_first_loop:
55 /* if no bytes left to transfer, transfer the bulk */
56 beqi r4, a_dalign_done
57 lbui r11, r6, 0 /* h = *s */
58 sbi r11, r5, 0 /* *d = h */
59 addi r6, r6, 1 /* s++ */
60 addi r5, r5, 1 /* d++ */
61 brid a_xfer_first_loop /* loop */
62 addi r4, r4, -1 /* n-- (IN DELAY SLOT) */
63
64a_dalign_done:
65 addi r4, r0, 32 /* n = 32 */
66 cmpu r4, r4, r7 /* n = c - n (unsigned) */
67 /* if n < 0, less than one block to transfer */
68 blti r4, a_block_done
69
70a_block_xfer:
71 andi r4, r7, 0xffffffe0 /* n = c & ~31 */
72 rsub r7, r4, r7 /* c = c - n */
73
74 andi r9, r6, 3 /* t1 = s & 3 */
75 /* if temp != 0, unaligned transfers needed */
76 bnei r9, a_block_unaligned
77
78a_block_aligned:
79 lwi r9, r6, 0 /* t1 = *(s + 0) */
80 lwi r10, r6, 4 /* t2 = *(s + 4) */
81 lwi r11, r6, 8 /* t3 = *(s + 8) */
82 lwi r12, r6, 12 /* t4 = *(s + 12) */
83 swi r9, r5, 0 /* *(d + 0) = t1 */
84 swi r10, r5, 4 /* *(d + 4) = t2 */
85 swi r11, r5, 8 /* *(d + 8) = t3 */
86 swi r12, r5, 12 /* *(d + 12) = t4 */
87 lwi r9, r6, 16 /* t1 = *(s + 16) */
88 lwi r10, r6, 20 /* t2 = *(s + 20) */
89 lwi r11, r6, 24 /* t3 = *(s + 24) */
90 lwi r12, r6, 28 /* t4 = *(s + 28) */
91 swi r9, r5, 16 /* *(d + 16) = t1 */
92 swi r10, r5, 20 /* *(d + 20) = t2 */
93 swi r11, r5, 24 /* *(d + 24) = t3 */
94 swi r12, r5, 28 /* *(d + 28) = t4 */
95 addi r6, r6, 32 /* s = s + 32 */
96 addi r4, r4, -32 /* n = n - 32 */
97 bneid r4, a_block_aligned /* while (n) loop */
98 addi r5, r5, 32 /* d = d + 32 (IN DELAY SLOT) */
99 bri a_block_done
100
101a_block_unaligned:
102 andi r8, r6, 0xfffffffc /* as = s & ~3 */
103 add r6, r6, r4 /* s = s + n */
104 lwi r11, r8, 0 /* h = *(as + 0) */
105
106 addi r9, r9, -1
107 beqi r9, a_block_u1 /* t1 was 1 => 1 byte offset */
108 addi r9, r9, -1
109 beqi r9, a_block_u2 /* t1 was 2 => 2 byte offset */
110
111a_block_u3:
112 bslli r11, r11, 24 /* h = h << 24 */
113a_bu3_loop:
114 lwi r12, r8, 4 /* v = *(as + 4) */
115 bsrli r9, r12, 8 /* t1 = v >> 8 */
116 or r9, r11, r9 /* t1 = h | t1 */
117 swi r9, r5, 0 /* *(d + 0) = t1 */
118 bslli r11, r12, 24 /* h = v << 24 */
119 lwi r12, r8, 8 /* v = *(as + 8) */
120 bsrli r9, r12, 8 /* t1 = v >> 8 */
121 or r9, r11, r9 /* t1 = h | t1 */
122 swi r9, r5, 4 /* *(d + 4) = t1 */
123 bslli r11, r12, 24 /* h = v << 24 */
124 lwi r12, r8, 12 /* v = *(as + 12) */
125 bsrli r9, r12, 8 /* t1 = v >> 8 */
126 or r9, r11, r9 /* t1 = h | t1 */
127 swi r9, r5, 8 /* *(d + 8) = t1 */
128 bslli r11, r12, 24 /* h = v << 24 */
129 lwi r12, r8, 16 /* v = *(as + 16) */
130 bsrli r9, r12, 8 /* t1 = v >> 8 */
131 or r9, r11, r9 /* t1 = h | t1 */
132 swi r9, r5, 12 /* *(d + 12) = t1 */
133 bslli r11, r12, 24 /* h = v << 24 */
134 lwi r12, r8, 20 /* v = *(as + 20) */
135 bsrli r9, r12, 8 /* t1 = v >> 8 */
136 or r9, r11, r9 /* t1 = h | t1 */
137 swi r9, r5, 16 /* *(d + 16) = t1 */
138 bslli r11, r12, 24 /* h = v << 24 */
139 lwi r12, r8, 24 /* v = *(as + 24) */
140 bsrli r9, r12, 8 /* t1 = v >> 8 */
141 or r9, r11, r9 /* t1 = h | t1 */
142 swi r9, r5, 20 /* *(d + 20) = t1 */
143 bslli r11, r12, 24 /* h = v << 24 */
144 lwi r12, r8, 28 /* v = *(as + 28) */
145 bsrli r9, r12, 8 /* t1 = v >> 8 */
146 or r9, r11, r9 /* t1 = h | t1 */
147 swi r9, r5, 24 /* *(d + 24) = t1 */
148 bslli r11, r12, 24 /* h = v << 24 */
149 lwi r12, r8, 32 /* v = *(as + 32) */
150 bsrli r9, r12, 8 /* t1 = v >> 8 */
151 or r9, r11, r9 /* t1 = h | t1 */
152 swi r9, r5, 28 /* *(d + 28) = t1 */
153 bslli r11, r12, 24 /* h = v << 24 */
154 addi r8, r8, 32 /* as = as + 32 */
155 addi r4, r4, -32 /* n = n - 32 */
156 bneid r4, a_bu3_loop /* while (n) loop */
157 addi r5, r5, 32 /* d = d + 32 (IN DELAY SLOT) */
158 bri a_block_done
159
160a_block_u1:
161 bslli r11, r11, 8 /* h = h << 8 */
162a_bu1_loop:
163 lwi r12, r8, 4 /* v = *(as + 4) */
164 bsrli r9, r12, 24 /* t1 = v >> 24 */
165 or r9, r11, r9 /* t1 = h | t1 */
166 swi r9, r5, 0 /* *(d + 0) = t1 */
167 bslli r11, r12, 8 /* h = v << 8 */
168 lwi r12, r8, 8 /* v = *(as + 8) */
169 bsrli r9, r12, 24 /* t1 = v >> 24 */
170 or r9, r11, r9 /* t1 = h | t1 */
171 swi r9, r5, 4 /* *(d + 4) = t1 */
172 bslli r11, r12, 8 /* h = v << 8 */
173 lwi r12, r8, 12 /* v = *(as + 12) */
174 bsrli r9, r12, 24 /* t1 = v >> 24 */
175 or r9, r11, r9 /* t1 = h | t1 */
176 swi r9, r5, 8 /* *(d + 8) = t1 */
177 bslli r11, r12, 8 /* h = v << 8 */
178 lwi r12, r8, 16 /* v = *(as + 16) */
179 bsrli r9, r12, 24 /* t1 = v >> 24 */
180 or r9, r11, r9 /* t1 = h | t1 */
181 swi r9, r5, 12 /* *(d + 12) = t1 */
182 bslli r11, r12, 8 /* h = v << 8 */
183 lwi r12, r8, 20 /* v = *(as + 20) */
184 bsrli r9, r12, 24 /* t1 = v >> 24 */
185 or r9, r11, r9 /* t1 = h | t1 */
186 swi r9, r5, 16 /* *(d + 16) = t1 */
187 bslli r11, r12, 8 /* h = v << 8 */
188 lwi r12, r8, 24 /* v = *(as + 24) */
189 bsrli r9, r12, 24 /* t1 = v >> 24 */
190 or r9, r11, r9 /* t1 = h | t1 */
191 swi r9, r5, 20 /* *(d + 20) = t1 */
192 bslli r11, r12, 8 /* h = v << 8 */
193 lwi r12, r8, 28 /* v = *(as + 28) */
194 bsrli r9, r12, 24 /* t1 = v >> 24 */
195 or r9, r11, r9 /* t1 = h | t1 */
196 swi r9, r5, 24 /* *(d + 24) = t1 */
197 bslli r11, r12, 8 /* h = v << 8 */
198 lwi r12, r8, 32 /* v = *(as + 32) */
199 bsrli r9, r12, 24 /* t1 = v >> 24 */
200 or r9, r11, r9 /* t1 = h | t1 */
201 swi r9, r5, 28 /* *(d + 28) = t1 */
202 bslli r11, r12, 8 /* h = v << 8 */
203 addi r8, r8, 32 /* as = as + 32 */
204 addi r4, r4, -32 /* n = n - 32 */
205 bneid r4, a_bu1_loop /* while (n) loop */
206 addi r5, r5, 32 /* d = d + 32 (IN DELAY SLOT) */
207 bri a_block_done
208
209a_block_u2:
210 bslli r11, r11, 16 /* h = h << 16 */
211a_bu2_loop:
212 lwi r12, r8, 4 /* v = *(as + 4) */
213 bsrli r9, r12, 16 /* t1 = v >> 16 */
214 or r9, r11, r9 /* t1 = h | t1 */
215 swi r9, r5, 0 /* *(d + 0) = t1 */
216 bslli r11, r12, 16 /* h = v << 16 */
217 lwi r12, r8, 8 /* v = *(as + 8) */
218 bsrli r9, r12, 16 /* t1 = v >> 16 */
219 or r9, r11, r9 /* t1 = h | t1 */
220 swi r9, r5, 4 /* *(d + 4) = t1 */
221 bslli r11, r12, 16 /* h = v << 16 */
222 lwi r12, r8, 12 /* v = *(as + 12) */
223 bsrli r9, r12, 16 /* t1 = v >> 16 */
224 or r9, r11, r9 /* t1 = h | t1 */
225 swi r9, r5, 8 /* *(d + 8) = t1 */
226 bslli r11, r12, 16 /* h = v << 16 */
227 lwi r12, r8, 16 /* v = *(as + 16) */
228 bsrli r9, r12, 16 /* t1 = v >> 16 */
229 or r9, r11, r9 /* t1 = h | t1 */
230 swi r9, r5, 12 /* *(d + 12) = t1 */
231 bslli r11, r12, 16 /* h = v << 16 */
232 lwi r12, r8, 20 /* v = *(as + 20) */
233 bsrli r9, r12, 16 /* t1 = v >> 16 */
234 or r9, r11, r9 /* t1 = h | t1 */
235 swi r9, r5, 16 /* *(d + 16) = t1 */
236 bslli r11, r12, 16 /* h = v << 16 */
237 lwi r12, r8, 24 /* v = *(as + 24) */
238 bsrli r9, r12, 16 /* t1 = v >> 16 */
239 or r9, r11, r9 /* t1 = h | t1 */
240 swi r9, r5, 20 /* *(d + 20) = t1 */
241 bslli r11, r12, 16 /* h = v << 16 */
242 lwi r12, r8, 28 /* v = *(as + 28) */
243 bsrli r9, r12, 16 /* t1 = v >> 16 */
244 or r9, r11, r9 /* t1 = h | t1 */
245 swi r9, r5, 24 /* *(d + 24) = t1 */
246 bslli r11, r12, 16 /* h = v << 16 */
247 lwi r12, r8, 32 /* v = *(as + 32) */
248 bsrli r9, r12, 16 /* t1 = v >> 16 */
249 or r9, r11, r9 /* t1 = h | t1 */
250 swi r9, r5, 28 /* *(d + 28) = t1 */
251 bslli r11, r12, 16 /* h = v << 16 */
252 addi r8, r8, 32 /* as = as + 32 */
253 addi r4, r4, -32 /* n = n - 32 */
254 bneid r4, a_bu2_loop /* while (n) loop */
255 addi r5, r5, 32 /* d = d + 32 (IN DELAY SLOT) */
256
257a_block_done:
258 addi r4, r0, 4 /* n = 4 */
259 cmpu r4, r4, r7 /* n = c - n (unsigned) */
260 blti r4, a_xfer_end /* if n < 0, less than one word to transfer */
261
262a_word_xfer:
263 andi r4, r7, 0xfffffffc /* n = c & ~3 */
264 addi r10, r0, 0 /* offset = 0 */
265
266 andi r9, r6, 3 /* t1 = s & 3 */
267 /* if temp != 0, unaligned transfers needed */
268 bnei r9, a_word_unaligned
269
270a_word_aligned:
271 lw r9, r6, r10 /* t1 = *(s+offset) */
272 sw r9, r5, r10 /* *(d+offset) = t1 */
273 addi r4, r4,-4 /* n-- */
274 bneid r4, a_word_aligned /* loop */
275 addi r10, r10, 4 /* offset++ (IN DELAY SLOT) */
276
277 bri a_word_done
278
279a_word_unaligned:
280 andi r8, r6, 0xfffffffc /* as = s & ~3 */
281 lwi r11, r8, 0 /* h = *(as + 0) */
282 addi r8, r8, 4 /* as = as + 4 */
283
284 addi r9, r9, -1
285 beqi r9, a_word_u1 /* t1 was 1 => 1 byte offset */
286 addi r9, r9, -1
287 beqi r9, a_word_u2 /* t1 was 2 => 2 byte offset */
288
289a_word_u3:
290 bslli r11, r11, 24 /* h = h << 24 */
291a_wu3_loop:
292 lw r12, r8, r10 /* v = *(as + offset) */
293 bsrli r9, r12, 8 /* t1 = v >> 8 */
294 or r9, r11, r9 /* t1 = h | t1 */
295 sw r9, r5, r10 /* *(d + offset) = t1 */
296 bslli r11, r12, 24 /* h = v << 24 */
297 addi r4, r4,-4 /* n = n - 4 */
298 bneid r4, a_wu3_loop /* while (n) loop */
299 addi r10, r10, 4 /* offset = ofset + 4 (IN DELAY SLOT) */
300
301 bri a_word_done
302
303a_word_u1:
304 bslli r11, r11, 8 /* h = h << 8 */
305a_wu1_loop:
306 lw r12, r8, r10 /* v = *(as + offset) */
307 bsrli r9, r12, 24 /* t1 = v >> 24 */
308 or r9, r11, r9 /* t1 = h | t1 */
309 sw r9, r5, r10 /* *(d + offset) = t1 */
310 bslli r11, r12, 8 /* h = v << 8 */
311 addi r4, r4,-4 /* n = n - 4 */
312 bneid r4, a_wu1_loop /* while (n) loop */
313 addi r10, r10, 4 /* offset = ofset + 4 (IN DELAY SLOT) */
314
315 bri a_word_done
316
317a_word_u2:
318 bslli r11, r11, 16 /* h = h << 16 */
319a_wu2_loop:
320 lw r12, r8, r10 /* v = *(as + offset) */
321 bsrli r9, r12, 16 /* t1 = v >> 16 */
322 or r9, r11, r9 /* t1 = h | t1 */
323 sw r9, r5, r10 /* *(d + offset) = t1 */
324 bslli r11, r12, 16 /* h = v << 16 */
325 addi r4, r4,-4 /* n = n - 4 */
326 bneid r4, a_wu2_loop /* while (n) loop */
327 addi r10, r10, 4 /* offset = ofset + 4 (IN DELAY SLOT) */
328
329a_word_done:
330 add r5, r5, r10 /* d = d + offset */
331 add r6, r6, r10 /* s = s + offset */
332 rsub r7, r10, r7 /* c = c - offset */
333
334a_xfer_end:
335a_xfer_end_loop:
336 beqi r7, a_done /* while (c) */
337 lbui r9, r6, 0 /* t1 = *s */
338 addi r6, r6, 1 /* s++ */
339 sbi r9, r5, 0 /* *d = t1 */
340 addi r7, r7, -1 /* c-- */
341 brid a_xfer_end_loop /* loop */
342 addi r5, r5, 1 /* d++ (IN DELAY SLOT) */
343
344a_done:
345 rtsd r15, 8
346 nop
347
348.end memcpy
349/*----------------------------------------------------------------------------*/
350 .globl memmove
351 .ent memmove
352
353memmove:
354 cmpu r4, r5, r6 /* n = s - d */
355 bgei r4,fast_memcpy_ascending
356
357fast_memcpy_descending:
358 /* move d to return register as value of function */
359 addi r3, r5, 0
360
361 add r5, r5, r7 /* d = d + c */
362 add r6, r6, r7 /* s = s + c */
363
364 addi r4, r0, 4 /* n = 4 */
365 cmpu r4, r4, r7 /* n = c - n (unsigned) */
366 blti r4,d_xfer_end /* if n < 0, less than one word to transfer */
367
368 /* transfer first 0~3 bytes to get aligned dest address */
369 andi r4, r5, 3 /* n = d & 3 */
370 /* if zero, destination already aligned */
371 beqi r4,d_dalign_done
372 rsub r7, r4, r7 /* c = c - n adjust c */
373
374d_xfer_first_loop:
375 /* if no bytes left to transfer, transfer the bulk */
376 beqi r4,d_dalign_done
377 addi r6, r6, -1 /* s-- */
378 addi r5, r5, -1 /* d-- */
379 lbui r11, r6, 0 /* h = *s */
380 sbi r11, r5, 0 /* *d = h */
381 brid d_xfer_first_loop /* loop */
382 addi r4, r4, -1 /* n-- (IN DELAY SLOT) */
383
384d_dalign_done:
385 addi r4, r0, 32 /* n = 32 */
386 cmpu r4, r4, r7 /* n = c - n (unsigned) */
387 /* if n < 0, less than one block to transfer */
388 blti r4, d_block_done
389
390d_block_xfer:
391 andi r4, r7, 0xffffffe0 /* n = c & ~31 */
392 rsub r7, r4, r7 /* c = c - n */
393
394 andi r9, r6, 3 /* t1 = s & 3 */
395 /* if temp != 0, unaligned transfers needed */
396 bnei r9, d_block_unaligned
397
398d_block_aligned:
399 addi r6, r6, -32 /* s = s - 32 */
400 addi r5, r5, -32 /* d = d - 32 */
401 lwi r9, r6, 28 /* t1 = *(s + 28) */
402 lwi r10, r6, 24 /* t2 = *(s + 24) */
403 lwi r11, r6, 20 /* t3 = *(s + 20) */
404 lwi r12, r6, 16 /* t4 = *(s + 16) */
405 swi r9, r5, 28 /* *(d + 28) = t1 */
406 swi r10, r5, 24 /* *(d + 24) = t2 */
407 swi r11, r5, 20 /* *(d + 20) = t3 */
408 swi r12, r5, 16 /* *(d + 16) = t4 */
409 lwi r9, r6, 12 /* t1 = *(s + 12) */
410 lwi r10, r6, 8 /* t2 = *(s + 8) */
411 lwi r11, r6, 4 /* t3 = *(s + 4) */
412 lwi r12, r6, 0 /* t4 = *(s + 0) */
413 swi r9, r5, 12 /* *(d + 12) = t1 */
414 swi r10, r5, 8 /* *(d + 8) = t2 */
415 swi r11, r5, 4 /* *(d + 4) = t3 */
416 addi r4, r4, -32 /* n = n - 32 */
417 bneid r4, d_block_aligned /* while (n) loop */
418 swi r12, r5, 0 /* *(d + 0) = t4 (IN DELAY SLOT) */
419 bri d_block_done
420
421d_block_unaligned:
422 andi r8, r6, 0xfffffffc /* as = s & ~3 */
423 rsub r6, r4, r6 /* s = s - n */
424 lwi r11, r8, 0 /* h = *(as + 0) */
425
426 addi r9, r9, -1
427 beqi r9,d_block_u1 /* t1 was 1 => 1 byte offset */
428 addi r9, r9, -1
429 beqi r9,d_block_u2 /* t1 was 2 => 2 byte offset */
430
431d_block_u3:
432 bsrli r11, r11, 8 /* h = h >> 8 */
433d_bu3_loop:
434 addi r8, r8, -32 /* as = as - 32 */
435 addi r5, r5, -32 /* d = d - 32 */
436 lwi r12, r8, 28 /* v = *(as + 28) */
437 bslli r9, r12, 24 /* t1 = v << 24 */
438 or r9, r11, r9 /* t1 = h | t1 */
439 swi r9, r5, 28 /* *(d + 28) = t1 */
440 bsrli r11, r12, 8 /* h = v >> 8 */
441 lwi r12, r8, 24 /* v = *(as + 24) */
442 bslli r9, r12, 24 /* t1 = v << 24 */
443 or r9, r11, r9 /* t1 = h | t1 */
444 swi r9, r5, 24 /* *(d + 24) = t1 */
445 bsrli r11, r12, 8 /* h = v >> 8 */
446 lwi r12, r8, 20 /* v = *(as + 20) */
447 bslli r9, r12, 24 /* t1 = v << 24 */
448 or r9, r11, r9 /* t1 = h | t1 */
449 swi r9, r5, 20 /* *(d + 20) = t1 */
450 bsrli r11, r12, 8 /* h = v >> 8 */
451 lwi r12, r8, 16 /* v = *(as + 16) */
452 bslli r9, r12, 24 /* t1 = v << 24 */
453 or r9, r11, r9 /* t1 = h | t1 */
454 swi r9, r5, 16 /* *(d + 16) = t1 */
455 bsrli r11, r12, 8 /* h = v >> 8 */
456 lwi r12, r8, 12 /* v = *(as + 12) */
457 bslli r9, r12, 24 /* t1 = v << 24 */
458 or r9, r11, r9 /* t1 = h | t1 */
459 swi r9, r5, 12 /* *(d + 112) = t1 */
460 bsrli r11, r12, 8 /* h = v >> 8 */
461 lwi r12, r8, 8 /* v = *(as + 8) */
462 bslli r9, r12, 24 /* t1 = v << 24 */
463 or r9, r11, r9 /* t1 = h | t1 */
464 swi r9, r5, 8 /* *(d + 8) = t1 */
465 bsrli r11, r12, 8 /* h = v >> 8 */
466 lwi r12, r8, 4 /* v = *(as + 4) */
467 bslli r9, r12, 24 /* t1 = v << 24 */
468 or r9, r11, r9 /* t1 = h | t1 */
469 swi r9, r5, 4 /* *(d + 4) = t1 */
470 bsrli r11, r12, 8 /* h = v >> 8 */
471 lwi r12, r8, 0 /* v = *(as + 0) */
472 bslli r9, r12, 24 /* t1 = v << 24 */
473 or r9, r11, r9 /* t1 = h | t1 */
474 swi r9, r5, 0 /* *(d + 0) = t1 */
475 addi r4, r4, -32 /* n = n - 32 */
476 bneid r4, d_bu3_loop /* while (n) loop */
477 bsrli r11, r12, 8 /* h = v >> 8 (IN DELAY SLOT) */
478 bri d_block_done
479
480d_block_u1:
481 bsrli r11, r11, 24 /* h = h >> 24 */
482d_bu1_loop:
483 addi r8, r8, -32 /* as = as - 32 */
484 addi r5, r5, -32 /* d = d - 32 */
485 lwi r12, r8, 28 /* v = *(as + 28) */
486 bslli r9, r12, 8 /* t1 = v << 8 */
487 or r9, r11, r9 /* t1 = h | t1 */
488 swi r9, r5, 28 /* *(d + 28) = t1 */
489 bsrli r11, r12, 24 /* h = v >> 24 */
490 lwi r12, r8, 24 /* v = *(as + 24) */
491 bslli r9, r12, 8 /* t1 = v << 8 */
492 or r9, r11, r9 /* t1 = h | t1 */
493 swi r9, r5, 24 /* *(d + 24) = t1 */
494 bsrli r11, r12, 24 /* h = v >> 24 */
495 lwi r12, r8, 20 /* v = *(as + 20) */
496 bslli r9, r12, 8 /* t1 = v << 8 */
497 or r9, r11, r9 /* t1 = h | t1 */
498 swi r9, r5, 20 /* *(d + 20) = t1 */
499 bsrli r11, r12, 24 /* h = v >> 24 */
500 lwi r12, r8, 16 /* v = *(as + 16) */
501 bslli r9, r12, 8 /* t1 = v << 8 */
502 or r9, r11, r9 /* t1 = h | t1 */
503 swi r9, r5, 16 /* *(d + 16) = t1 */
504 bsrli r11, r12, 24 /* h = v >> 24 */
505 lwi r12, r8, 12 /* v = *(as + 12) */
506 bslli r9, r12, 8 /* t1 = v << 8 */
507 or r9, r11, r9 /* t1 = h | t1 */
508 swi r9, r5, 12 /* *(d + 112) = t1 */
509 bsrli r11, r12, 24 /* h = v >> 24 */
510 lwi r12, r8, 8 /* v = *(as + 8) */
511 bslli r9, r12, 8 /* t1 = v << 8 */
512 or r9, r11, r9 /* t1 = h | t1 */
513 swi r9, r5, 8 /* *(d + 8) = t1 */
514 bsrli r11, r12, 24 /* h = v >> 24 */
515 lwi r12, r8, 4 /* v = *(as + 4) */
516 bslli r9, r12, 8 /* t1 = v << 8 */
517 or r9, r11, r9 /* t1 = h | t1 */
518 swi r9, r5, 4 /* *(d + 4) = t1 */
519 bsrli r11, r12, 24 /* h = v >> 24 */
520 lwi r12, r8, 0 /* v = *(as + 0) */
521 bslli r9, r12, 8 /* t1 = v << 8 */
522 or r9, r11, r9 /* t1 = h | t1 */
523 swi r9, r5, 0 /* *(d + 0) = t1 */
524 addi r4, r4, -32 /* n = n - 32 */
525 bneid r4, d_bu1_loop /* while (n) loop */
526 bsrli r11, r12, 24 /* h = v >> 24 (IN DELAY SLOT) */
527 bri d_block_done
528
529d_block_u2:
530 bsrli r11, r11, 16 /* h = h >> 16 */
531d_bu2_loop:
532 addi r8, r8, -32 /* as = as - 32 */
533 addi r5, r5, -32 /* d = d - 32 */
534 lwi r12, r8, 28 /* v = *(as + 28) */
535 bslli r9, r12, 16 /* t1 = v << 16 */
536 or r9, r11, r9 /* t1 = h | t1 */
537 swi r9, r5, 28 /* *(d + 28) = t1 */
538 bsrli r11, r12, 16 /* h = v >> 16 */
539 lwi r12, r8, 24 /* v = *(as + 24) */
540 bslli r9, r12, 16 /* t1 = v << 16 */
541 or r9, r11, r9 /* t1 = h | t1 */
542 swi r9, r5, 24 /* *(d + 24) = t1 */
543 bsrli r11, r12, 16 /* h = v >> 16 */
544 lwi r12, r8, 20 /* v = *(as + 20) */
545 bslli r9, r12, 16 /* t1 = v << 16 */
546 or r9, r11, r9 /* t1 = h | t1 */
547 swi r9, r5, 20 /* *(d + 20) = t1 */
548 bsrli r11, r12, 16 /* h = v >> 16 */
549 lwi r12, r8, 16 /* v = *(as + 16) */
550 bslli r9, r12, 16 /* t1 = v << 16 */
551 or r9, r11, r9 /* t1 = h | t1 */
552 swi r9, r5, 16 /* *(d + 16) = t1 */
553 bsrli r11, r12, 16 /* h = v >> 16 */
554 lwi r12, r8, 12 /* v = *(as + 12) */
555 bslli r9, r12, 16 /* t1 = v << 16 */
556 or r9, r11, r9 /* t1 = h | t1 */
557 swi r9, r5, 12 /* *(d + 112) = t1 */
558 bsrli r11, r12, 16 /* h = v >> 16 */
559 lwi r12, r8, 8 /* v = *(as + 8) */
560 bslli r9, r12, 16 /* t1 = v << 16 */
561 or r9, r11, r9 /* t1 = h | t1 */
562 swi r9, r5, 8 /* *(d + 8) = t1 */
563 bsrli r11, r12, 16 /* h = v >> 16 */
564 lwi r12, r8, 4 /* v = *(as + 4) */
565 bslli r9, r12, 16 /* t1 = v << 16 */
566 or r9, r11, r9 /* t1 = h | t1 */
567 swi r9, r5, 4 /* *(d + 4) = t1 */
568 bsrli r11, r12, 16 /* h = v >> 16 */
569 lwi r12, r8, 0 /* v = *(as + 0) */
570 bslli r9, r12, 16 /* t1 = v << 16 */
571 or r9, r11, r9 /* t1 = h | t1 */
572 swi r9, r5, 0 /* *(d + 0) = t1 */
573 addi r4, r4, -32 /* n = n - 32 */
574 bneid r4, d_bu2_loop /* while (n) loop */
575 bsrli r11, r12, 16 /* h = v >> 16 (IN DELAY SLOT) */
576
577d_block_done:
578 addi r4, r0, 4 /* n = 4 */
579 cmpu r4, r4, r7 /* n = c - n (unsigned) */
580 blti r4,d_xfer_end /* if n < 0, less than one word to transfer */
581
582d_word_xfer:
583 andi r4, r7, 0xfffffffc /* n = c & ~3 */
584 rsub r5, r4, r5 /* d = d - n */
585 rsub r6, r4, r6 /* s = s - n */
586 rsub r7, r4, r7 /* c = c - n */
587
588 andi r9, r6, 3 /* t1 = s & 3 */
589 /* if temp != 0, unaligned transfers needed */
590 bnei r9, d_word_unaligned
591
592d_word_aligned:
593 addi r4, r4,-4 /* n-- */
594 lw r9, r6, r4 /* t1 = *(s+n) */
595 bneid r4, d_word_aligned /* loop */
596 sw r9, r5, r4 /* *(d+n) = t1 (IN DELAY SLOT) */
597
598 bri d_word_done
599
600d_word_unaligned:
601 andi r8, r6, 0xfffffffc /* as = s & ~3 */
602 lw r11, r8, r4 /* h = *(as + n) */
603
604 addi r9, r9, -1
605 beqi r9,d_word_u1 /* t1 was 1 => 1 byte offset */
606 addi r9, r9, -1
607 beqi r9,d_word_u2 /* t1 was 2 => 2 byte offset */
608
609d_word_u3:
610 bsrli r11, r11, 8 /* h = h >> 8 */
611d_wu3_loop:
612 addi r4, r4,-4 /* n = n - 4 */
613 lw r12, r8, r4 /* v = *(as + n) */
614 bslli r9, r12, 24 /* t1 = v << 24 */
615 or r9, r11, r9 /* t1 = h | t1 */
616 sw r9, r5, r4 /* *(d + n) = t1 */
617 bneid r4, d_wu3_loop /* while (n) loop */
618 bsrli r11, r12, 8 /* h = v >> 8 (IN DELAY SLOT) */
619
620 bri d_word_done
621
622d_word_u1:
623 bsrli r11, r11, 24 /* h = h >> 24 */
624d_wu1_loop:
625 addi r4, r4,-4 /* n = n - 4 */
626 lw r12, r8, r4 /* v = *(as + n) */
627 bslli r9, r12, 8 /* t1 = v << 8 */
628 or r9, r11, r9 /* t1 = h | t1 */
629 sw r9, r5, r4 /* *(d + n) = t1 */
630 bneid r4, d_wu1_loop /* while (n) loop */
631 bsrli r11, r12, 24 /* h = v >> 24 (IN DELAY SLOT) */
632
633 bri d_word_done
634
635d_word_u2:
636 bsrli r11, r11, 16 /* h = h >> 16 */
637d_wu2_loop:
638 addi r4, r4,-4 /* n = n - 4 */
639 lw r12, r8, r4 /* v = *(as + n) */
640 bslli r9, r12, 16 /* t1 = v << 16 */
641 or r9, r11, r9 /* t1 = h | t1 */
642 sw r9, r5, r4 /* *(d + n) = t1 */
643 bneid r4, d_wu2_loop /* while (n) loop */
644 bsrli r11, r12, 16 /* h = v >> 16 (IN DELAY SLOT) */
645
646d_word_done:
647
648d_xfer_end:
649d_xfer_end_loop:
650 beqi r7, a_done /* while (c) */
651 addi r6, r6, -1 /* s-- */
652 lbui r9, r6, 0 /* t1 = *s */
653 addi r5, r5, -1 /* d-- */
654 sbi r9, r5, 0 /* *d = t1 */
655 brid d_xfer_end_loop /* loop */
656 addi r7, r7, -1 /* c-- (IN DELAY SLOT) */
657
658d_done:
659 rtsd r15, 8
660 nop
661
662.end memmove
diff --git a/arch/microblaze/lib/memcpy.c b/arch/microblaze/lib/memcpy.c
new file mode 100644
index 000000000000..5880119c4487
--- /dev/null
+++ b/arch/microblaze/lib/memcpy.c
@@ -0,0 +1,161 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2007 John Williams
5 *
6 * Reasonably optimised generic C-code for memcpy on Microblaze
7 * This is generic C code to do efficient, alignment-aware memcpy.
8 *
9 * It is based on demo code originally Copyright 2001 by Intel Corp, taken from
10 * http://www.embedded.com/showArticle.jhtml?articleID=19205567
11 *
12 * Attempts were made, unsuccesfully, to contact the original
13 * author of this code (Michael Morrow, Intel). Below is the original
14 * copyright notice.
15 *
16 * This software has been developed by Intel Corporation.
17 * Intel specifically disclaims all warranties, express or
18 * implied, and all liability, including consequential and
19 * other indirect damages, for the use of this program, including
20 * liability for infringement of any proprietary rights,
21 * and including the warranties of merchantability and fitness
22 * for a particular purpose. Intel does not assume any
23 * responsibility for and errors which may appear in this program
24 * not any responsibility to update it.
25 */
26
27#include <linux/types.h>
28#include <linux/stddef.h>
29#include <linux/compiler.h>
30#include <linux/module.h>
31
32#include <linux/string.h>
33#include <asm/system.h>
34
35#ifdef __HAVE_ARCH_MEMCPY
36void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
37{
38 const char *src = v_src;
39 char *dst = v_dst;
40#ifndef CONFIG_OPT_LIB_FUNCTION
41 /* Simple, byte oriented memcpy. */
42 while (c--)
43 *dst++ = *src++;
44
45 return v_dst;
46#else
47 /* The following code tries to optimize the copy by using unsigned
48 * alignment. This will work fine if both source and destination are
49 * aligned on the same boundary. However, if they are aligned on
50 * different boundaries shifts will be necessary. This might result in
51 * bad performance on MicroBlaze systems without a barrel shifter.
52 */
53 const uint32_t *i_src;
54 uint32_t *i_dst;
55
56 if (c >= 4) {
57 unsigned value, buf_hold;
58
59 /* Align the dstination to a word boundry. */
60 /* This is done in an endian independant manner. */
61 switch ((unsigned long)dst & 3) {
62 case 1:
63 *dst++ = *src++;
64 --c;
65 case 2:
66 *dst++ = *src++;
67 --c;
68 case 3:
69 *dst++ = *src++;
70 --c;
71 }
72
73 i_dst = (void *)dst;
74
75 /* Choose a copy scheme based on the source */
76 /* alignment relative to dstination. */
77 switch ((unsigned long)src & 3) {
78 case 0x0: /* Both byte offsets are aligned */
79 i_src = (const void *)src;
80
81 for (; c >= 4; c -= 4)
82 *i_dst++ = *i_src++;
83
84 src = (const void *)i_src;
85 break;
86 case 0x1: /* Unaligned - Off by 1 */
87 /* Word align the source */
88 i_src = (const void *) ((unsigned)src & ~3);
89
90 /* Load the holding buffer */
91 buf_hold = *i_src++ << 8;
92
93 for (; c >= 4; c -= 4) {
94 value = *i_src++;
95 *i_dst++ = buf_hold | value >> 24;
96 buf_hold = value << 8;
97 }
98
99 /* Realign the source */
100 src = (const void *)i_src;
101 src -= 3;
102 break;
103 case 0x2: /* Unaligned - Off by 2 */
104 /* Word align the source */
105 i_src = (const void *) ((unsigned)src & ~3);
106
107 /* Load the holding buffer */
108 buf_hold = *i_src++ << 16;
109
110 for (; c >= 4; c -= 4) {
111 value = *i_src++;
112 *i_dst++ = buf_hold | value >> 16;
113 buf_hold = value << 16;
114 }
115
116 /* Realign the source */
117 src = (const void *)i_src;
118 src -= 2;
119 break;
120 case 0x3: /* Unaligned - Off by 3 */
121 /* Word align the source */
122 i_src = (const void *) ((unsigned)src & ~3);
123
124 /* Load the holding buffer */
125 buf_hold = *i_src++ << 24;
126
127 for (; c >= 4; c -= 4) {
128 value = *i_src++;
129 *i_dst++ = buf_hold | value >> 8;
130 buf_hold = value << 24;
131 }
132
133 /* Realign the source */
134 src = (const void *)i_src;
135 src -= 1;
136 break;
137 }
138 dst = (void *)i_dst;
139 }
140
141 /* Finish off any remaining bytes */
142 /* simple fast copy, ... unless a cache boundry is crossed */
143 switch (c) {
144 case 3:
145 *dst++ = *src++;
146 case 2:
147 *dst++ = *src++;
148 case 1:
149 *dst++ = *src++;
150 }
151
152 return v_dst;
153#endif
154}
155EXPORT_SYMBOL(memcpy);
156#endif /* __HAVE_ARCH_MEMCPY */
157
158void *cacheable_memcpy(void *d, const void *s, __kernel_size_t c)
159{
160 return memcpy(d, s, c);
161}
diff --git a/arch/microblaze/lib/memmove.c b/arch/microblaze/lib/memmove.c
new file mode 100644
index 000000000000..d4e9f49a71f7
--- /dev/null
+++ b/arch/microblaze/lib/memmove.c
@@ -0,0 +1,175 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2007 John Williams
5 *
6 * Reasonably optimised generic C-code for memcpy on Microblaze
7 * This is generic C code to do efficient, alignment-aware memmove.
8 *
9 * It is based on demo code originally Copyright 2001 by Intel Corp, taken from
10 * http://www.embedded.com/showArticle.jhtml?articleID=19205567
11 *
12 * Attempts were made, unsuccesfully, to contact the original
13 * author of this code (Michael Morrow, Intel). Below is the original
14 * copyright notice.
15 *
16 * This software has been developed by Intel Corporation.
17 * Intel specifically disclaims all warranties, express or
18 * implied, and all liability, including consequential and
19 * other indirect damages, for the use of this program, including
20 * liability for infringement of any proprietary rights,
21 * and including the warranties of merchantability and fitness
22 * for a particular purpose. Intel does not assume any
23 * responsibility for and errors which may appear in this program
24 * not any responsibility to update it.
25 */
26
27#include <linux/types.h>
28#include <linux/stddef.h>
29#include <linux/compiler.h>
30#include <linux/module.h>
31#include <linux/string.h>
32
33#ifdef __HAVE_ARCH_MEMMOVE
34void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
35{
36 const char *src = v_src;
37 char *dst = v_dst;
38
39#ifdef CONFIG_OPT_LIB_FUNCTION
40 const uint32_t *i_src;
41 uint32_t *i_dst;
42#endif
43
44 if (!c)
45 return v_dst;
46
47 /* Use memcpy when source is higher than dest */
48 if (v_dst <= v_src)
49 return memcpy(v_dst, v_src, c);
50
51#ifndef CONFIG_OPT_LIB_FUNCTION
52 /* copy backwards, from end to beginning */
53 src += c;
54 dst += c;
55
56 /* Simple, byte oriented memmove. */
57 while (c--)
58 *--dst = *--src;
59
60 return v_dst;
61#else
62 /* The following code tries to optimize the copy by using unsigned
63 * alignment. This will work fine if both source and destination are
64 * aligned on the same boundary. However, if they are aligned on
65 * different boundaries shifts will be necessary. This might result in
66 * bad performance on MicroBlaze systems without a barrel shifter.
67 */
68 /* FIXME this part needs more test */
69 /* Do a descending copy - this is a bit trickier! */
70 dst += c;
71 src += c;
72
73 if (c >= 4) {
74 unsigned value, buf_hold;
75
76 /* Align the destination to a word boundry. */
77 /* This is done in an endian independant manner. */
78
79 switch ((unsigned long)dst & 3) {
80 case 3:
81 *--dst = *--src;
82 --c;
83 case 2:
84 *--dst = *--src;
85 --c;
86 case 1:
87 *--dst = *--src;
88 --c;
89 }
90
91 i_dst = (void *)dst;
92 /* Choose a copy scheme based on the source */
93 /* alignment relative to dstination. */
94 switch ((unsigned long)src & 3) {
95 case 0x0: /* Both byte offsets are aligned */
96
97 i_src = (const void *)src;
98
99 for (; c >= 4; c -= 4)
100 *--i_dst = *--i_src;
101
102 src = (const void *)i_src;
103 break;
104 case 0x1: /* Unaligned - Off by 1 */
105 /* Word align the source */
106 i_src = (const void *) (((unsigned)src + 4) & ~3);
107
108 /* Load the holding buffer */
109 buf_hold = *--i_src >> 24;
110
111 for (; c >= 4; c -= 4) {
112 value = *--i_src;
113 *--i_dst = buf_hold << 8 | value;
114 buf_hold = value >> 24;
115 }
116
117 /* Realign the source */
118 src = (const void *)i_src;
119 src += 1;
120 break;
121 case 0x2: /* Unaligned - Off by 2 */
122 /* Word align the source */
123 i_src = (const void *) (((unsigned)src + 4) & ~3);
124
125 /* Load the holding buffer */
126 buf_hold = *--i_src >> 16;
127
128 for (; c >= 4; c -= 4) {
129 value = *--i_src;
130 *--i_dst = buf_hold << 16 | value;
131 buf_hold = value >> 16;
132 }
133
134 /* Realign the source */
135 src = (const void *)i_src;
136 src += 2;
137 break;
138 case 0x3: /* Unaligned - Off by 3 */
139 /* Word align the source */
140 i_src = (const void *) (((unsigned)src + 4) & ~3);
141
142 /* Load the holding buffer */
143 buf_hold = *--i_src >> 8;
144
145 for (; c >= 4; c -= 4) {
146 value = *--i_src;
147 *--i_dst = buf_hold << 24 | value;
148 buf_hold = value >> 8;
149 }
150
151 /* Realign the source */
152 src = (const void *)i_src;
153 src += 3;
154 break;
155 }
156 dst = (void *)i_dst;
157 }
158
159 /* simple fast copy, ... unless a cache boundry is crossed */
160 /* Finish off any remaining bytes */
161 switch (c) {
162 case 4:
163 *--dst = *--src;
164 case 3:
165 *--dst = *--src;
166 case 2:
167 *--dst = *--src;
168 case 1:
169 *--dst = *--src;
170 }
171 return v_dst;
172#endif
173}
174EXPORT_SYMBOL(memmove);
175#endif /* __HAVE_ARCH_MEMMOVE */
diff --git a/arch/microblaze/lib/memset.c b/arch/microblaze/lib/memset.c
new file mode 100644
index 000000000000..941dc8f94b03
--- /dev/null
+++ b/arch/microblaze/lib/memset.c
@@ -0,0 +1,82 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2007 John Williams
5 *
6 * Reasonably optimised generic C-code for memset on Microblaze
7 * This is generic C code to do efficient, alignment-aware memcpy.
8 *
9 * It is based on demo code originally Copyright 2001 by Intel Corp, taken from
10 * http://www.embedded.com/showArticle.jhtml?articleID=19205567
11 *
12 * Attempts were made, unsuccesfully, to contact the original
13 * author of this code (Michael Morrow, Intel). Below is the original
14 * copyright notice.
15 *
16 * This software has been developed by Intel Corporation.
17 * Intel specifically disclaims all warranties, express or
18 * implied, and all liability, including consequential and
19 * other indirect damages, for the use of this program, including
20 * liability for infringement of any proprietary rights,
21 * and including the warranties of merchantability and fitness
22 * for a particular purpose. Intel does not assume any
23 * responsibility for and errors which may appear in this program
24 * not any responsibility to update it.
25 */
26
27#include <linux/types.h>
28#include <linux/stddef.h>
29#include <linux/compiler.h>
30#include <linux/module.h>
31#include <linux/string.h>
32
33#ifdef __HAVE_ARCH_MEMSET
34void *memset(void *v_src, int c, __kernel_size_t n)
35{
36
37 char *src = v_src;
38#ifdef CONFIG_OPT_LIB_FUNCTION
39 uint32_t *i_src;
40 uint32_t w32;
41#endif
42 /* Truncate c to 8 bits */
43 c = (c & 0xFF);
44
45#ifdef CONFIG_OPT_LIB_FUNCTION
46 /* Make a repeating word out of it */
47 w32 = c;
48 w32 |= w32 << 8;
49 w32 |= w32 << 16;
50
51 if (n >= 4) {
52 /* Align the destination to a word boundary */
53 /* This is done in an endian independant manner */
54 switch ((unsigned) src & 3) {
55 case 1:
56 *src++ = c;
57 --n;
58 case 2:
59 *src++ = c;
60 --n;
61 case 3:
62 *src++ = c;
63 --n;
64 }
65
66 i_src = (void *)src;
67
68 /* Do as many full-word copies as we can */
69 for (; n >= 4; n -= 4)
70 *i_src++ = w32;
71
72 src = (void *)i_src;
73 }
74#endif
75 /* Simple, byte oriented memset or the rest of count. */
76 while (n--)
77 *src++ = c;
78
79 return v_src;
80}
81EXPORT_SYMBOL(memset);
82#endif /* __HAVE_ARCH_MEMSET */
diff --git a/arch/microblaze/lib/uaccess.c b/arch/microblaze/lib/uaccess.c
new file mode 100644
index 000000000000..8eb9df5a26c9
--- /dev/null
+++ b/arch/microblaze/lib/uaccess.c
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#include <linux/string.h>
10#include <asm/uaccess.h>
11
12#include <asm/bug.h>
13
14long strnlen_user(const char __user *src, long count)
15{
16 return strlen(src) + 1;
17}
18
19#define __do_strncpy_from_user(dst, src, count, res) \
20 do { \
21 char *tmp; \
22 strncpy(dst, src, count); \
23 for (tmp = dst; *tmp && count > 0; tmp++, count--) \
24 ; \
25 res = (tmp - dst); \
26 } while (0)
27
28long __strncpy_from_user(char *dst, const char __user *src, long count)
29{
30 long res;
31 __do_strncpy_from_user(dst, src, count, res);
32 return res;
33}
34
35long strncpy_from_user(char *dst, const char __user *src, long count)
36{
37 long res = -EFAULT;
38 if (access_ok(VERIFY_READ, src, 1))
39 __do_strncpy_from_user(dst, src, count, res);
40 return res;
41}
diff --git a/arch/microblaze/mm/Makefile b/arch/microblaze/mm/Makefile
new file mode 100644
index 000000000000..bf9e4479a1fd
--- /dev/null
+++ b/arch/microblaze/mm/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile
3#
4
5obj-y := init.o
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
new file mode 100644
index 000000000000..b0c8213cd6cf
--- /dev/null
+++ b/arch/microblaze/mm/init.c
@@ -0,0 +1,201 @@
1/*
2 * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#include <linux/bootmem.h>
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/lmb.h>
14#include <linux/mm.h> /* mem_init */
15#include <linux/initrd.h>
16#include <linux/pagemap.h>
17#include <linux/pfn.h>
18#include <linux/swap.h>
19
20#include <asm/page.h>
21#include <asm/mmu_context.h>
22#include <asm/pgalloc.h>
23#include <asm/sections.h>
24#include <asm/tlb.h>
25
26unsigned int __page_offset;
27/* EXPORT_SYMBOL(__page_offset); */
28
29char *klimit = _end;
30
31/*
32 * Initialize the bootmem system and give it all the memory we
33 * have available.
34 */
35unsigned int memory_start;
36unsigned int memory_end; /* due to mm/nommu.c */
37unsigned int memory_size;
38
39/*
40 * paging_init() sets up the page tables - in fact we've already done this.
41 */
42static void __init paging_init(void)
43{
44 int i;
45 unsigned long zones_size[MAX_NR_ZONES];
46
47 /*
48 * old: we can DMA to/from any address.put all page into ZONE_DMA
49 * We use only ZONE_NORMAL
50 */
51 zones_size[ZONE_NORMAL] = max_mapnr;
52
53 /* every other zones are empty */
54 for (i = 1; i < MAX_NR_ZONES; i++)
55 zones_size[i] = 0;
56
57 free_area_init(zones_size);
58}
59
60void __init setup_memory(void)
61{
62 int i;
63 unsigned long map_size;
64 u32 kernel_align_start, kernel_align_size;
65
66 /* Find main memory where is the kernel */
67 for (i = 0; i < lmb.memory.cnt; i++) {
68 memory_start = (u32) lmb.memory.region[i].base;
69 memory_end = (u32) lmb.memory.region[i].base
70 + (u32) lmb.memory.region[i].size;
71 if ((memory_start <= (u32)_text) &&
72 ((u32)_text <= memory_end)) {
73 memory_size = memory_end - memory_start;
74 PAGE_OFFSET = memory_start;
75 printk(KERN_INFO "%s: Main mem: 0x%x-0x%x, "
76 "size 0x%08x\n", __func__, memory_start,
77 memory_end, memory_size);
78 break;
79 }
80 }
81
82 if (!memory_start || !memory_end) {
83 panic("%s: Missing memory setting 0x%08x-0x%08x\n",
84 __func__, memory_start, memory_end);
85 }
86
87 /* reservation of region where is the kernel */
88 kernel_align_start = PAGE_DOWN((u32)_text);
89 /* ALIGN can be remove because _end in vmlinux.lds.S is align */
90 kernel_align_size = PAGE_UP((u32)klimit) - kernel_align_start;
91 lmb_reserve(kernel_align_start, kernel_align_size);
92 printk(KERN_INFO "%s: kernel addr=0x%08x-0x%08x size=0x%08x\n",
93 __func__, kernel_align_start, kernel_align_start
94 + kernel_align_size, kernel_align_size);
95
96 /*
97 * Kernel:
98 * start: base phys address of kernel - page align
99 * end: base phys address of kernel - page align
100 *
101 * min_low_pfn - the first page (mm/bootmem.c - node_boot_start)
102 * max_low_pfn
103 * max_mapnr - the first unused page (mm/bootmem.c - node_low_pfn)
104 * num_physpages - number of all pages
105 */
106
107 /* memory start is from the kernel end (aligned) to higher addr */
108 min_low_pfn = memory_start >> PAGE_SHIFT; /* minimum for allocation */
109 /* RAM is assumed contiguous */
110 num_physpages = max_mapnr = memory_size >> PAGE_SHIFT;
111 max_pfn = max_low_pfn = memory_end >> PAGE_SHIFT;
112
113 printk(KERN_INFO "%s: max_mapnr: %#lx\n", __func__, max_mapnr);
114 printk(KERN_INFO "%s: min_low_pfn: %#lx\n", __func__, min_low_pfn);
115 printk(KERN_INFO "%s: max_low_pfn: %#lx\n", __func__, max_low_pfn);
116
117 /*
118 * Find an area to use for the bootmem bitmap.
119 * We look for the first area which is at least
120 * 128kB in length (128kB is enough for a bitmap
121 * for 4GB of memory, using 4kB pages), plus 1 page
122 * (in case the address isn't page-aligned).
123 */
124 map_size = init_bootmem_node(NODE_DATA(0), PFN_UP(TOPHYS((u32)_end)),
125 min_low_pfn, max_low_pfn);
126
127 lmb_reserve(PFN_UP(TOPHYS((u32)_end)) << PAGE_SHIFT, map_size);
128
129 /* free bootmem is whole main memory */
130 free_bootmem(memory_start, memory_size);
131
132 /* reserve allocate blocks */
133 for (i = 0; i < lmb.reserved.cnt; i++) {
134 pr_debug("reserved %d - 0x%08x-0x%08x\n", i,
135 (u32) lmb.reserved.region[i].base,
136 (u32) lmb_size_bytes(&lmb.reserved, i));
137 reserve_bootmem(lmb.reserved.region[i].base,
138 lmb_size_bytes(&lmb.reserved, i) - 1, BOOTMEM_DEFAULT);
139 }
140 paging_init();
141}
142
143void free_init_pages(char *what, unsigned long begin, unsigned long end)
144{
145 unsigned long addr;
146
147 for (addr = begin; addr < end; addr += PAGE_SIZE) {
148 ClearPageReserved(virt_to_page(addr));
149 init_page_count(virt_to_page(addr));
150 memset((void *)addr, 0xcc, PAGE_SIZE);
151 free_page(addr);
152 totalram_pages++;
153 }
154 printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
155}
156
157#ifdef CONFIG_BLK_DEV_INITRD
158void free_initrd_mem(unsigned long start, unsigned long end)
159{
160 int pages = 0;
161 for (; start < end; start += PAGE_SIZE) {
162 ClearPageReserved(virt_to_page(start));
163 init_page_count(virt_to_page(start));
164 free_page(start);
165 totalram_pages++;
166 pages++;
167 }
168 printk(KERN_NOTICE "Freeing initrd memory: %dk freed\n", pages);
169}
170#endif
171
172void free_initmem(void)
173{
174 free_init_pages("unused kernel memory",
175 (unsigned long)(&__init_begin),
176 (unsigned long)(&__init_end));
177}
178
179/* FIXME from arch/powerpc/mm/mem.c*/
180void show_mem(void)
181{
182 printk(KERN_NOTICE "%s\n", __func__);
183}
184
185void __init mem_init(void)
186{
187 high_memory = (void *)__va(memory_end);
188 /* this will put all memory onto the freelists */
189 totalram_pages += free_all_bootmem();
190
191 printk(KERN_INFO "Memory: %luk/%luk available\n",
192 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
193 num_physpages << (PAGE_SHIFT-10));
194}
195
196/* Check against bounds of physical memory */
197int ___range_ok(unsigned long addr, unsigned long size)
198{
199 return ((addr < memory_start) ||
200 ((addr + size) > memory_end));
201}
diff --git a/arch/microblaze/platform/Kconfig.platform b/arch/microblaze/platform/Kconfig.platform
new file mode 100644
index 000000000000..8e9b4752d3ff
--- /dev/null
+++ b/arch/microblaze/platform/Kconfig.platform
@@ -0,0 +1,85 @@
1# For a description of the syntax of this configuration file,
2# see Documentation/kbuild/kconfig-language.txt.
3#
4# Platform selection Kconfig menu for MicroBlaze targets
5#
6
7menu "Platform options"
8choice
9 prompt "Platform"
10 default PLATFORM_MICROBLAZE_AUTO
11 help
12 Choose which hardware board/platform you are targeting.
13
14config PLATFORM_GENERIC
15 bool "Generic"
16 help
17 Choose this option for the Generic platform.
18
19endchoice
20
21config SELFMOD
22 bool "Use self modified code for intc/timer"
23 depends on EXPERIMENTAL && NO_MMU
24 default n
25 help
26 This choice enables self-modified code for interrupt controller
27 and timer.
28
29config SELFMOD_INTC
30 bool "Use self modified code for intc"
31 depends on SELFMOD
32 default y
33 help
34 This choice enables self-modified code for interrupt controller.
35
36config SELFMOD_TIMER
37 bool "Use self modified code for timer"
38 depends on SELFMOD
39 default y
40 help
41 This choice enables self-modified code for timer.
42
43config OPT_LIB_FUNCTION
44 bool "Optimalized lib function"
45 default y
46 help
47 Allows turn on optimalized library function (memcpy and memmove).
48 They are optimized by using word alignment. This will work
49 fine if both source and destination are aligned on the same
50 boundary. However, if they are aligned on different boundaries
51 shifts will be necessary. This might result in bad performance
52 on MicroBlaze systems without a barrel shifter.
53
54config OPT_LIB_ASM
55 bool "Optimalized lib function ASM"
56 depends on OPT_LIB_FUNCTION
57 default n
58 help
59 Allows turn on optimalized library function (memcpy and memmove).
60 Function are written in asm code.
61
62# This is still a bit broken - disabling for now JW 20070504
63config ALLOW_EDIT_AUTO
64 bool "Permit Display/edit of Kconfig.auto platform settings"
65 default n
66 help
67 Allows the editing of auto-generated platform settings from
68 the Kconfig.auto file. Obviously this does not change the
69 underlying hardware, so be very careful if you go editing
70 these settings.
71
72 Also, if you enable this, and edit various Kconfig.auto
73 settings, YOUR CHANGES WILL BE LOST if you then disable it
74 again. You have been warned!
75
76 If unsure, say no.
77
78comment "Automatic platform settings from Kconfig.auto"
79 depends on ALLOW_EDIT_AUTO
80
81if PLATFORM_GENERIC=y
82 source "arch/microblaze/platform/generic/Kconfig.auto"
83endif
84
85endmenu
diff --git a/arch/microblaze/platform/Makefile b/arch/microblaze/platform/Makefile
new file mode 100644
index 000000000000..ea1b75cc5775
--- /dev/null
+++ b/arch/microblaze/platform/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for arch/microblaze/platform directory
3#
4#obj-$(CONFIG_PLATFORM_GENERIC) += generic/
5
6obj-y += platform.o
diff --git a/arch/microblaze/platform/generic/Kconfig.auto b/arch/microblaze/platform/generic/Kconfig.auto
new file mode 100644
index 000000000000..fbca22d9c8b9
--- /dev/null
+++ b/arch/microblaze/platform/generic/Kconfig.auto
@@ -0,0 +1,62 @@
1#
2# (C) Copyright 2007 Michal Simek
3#
4# Michal SIMEK <monstr@monstr.eu>
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 as
8# published by the Free Software Foundation; either version 2 of
9# the License, or (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,
19# MA 02111-1307 USA
20#
21
22# Definitions for MICROBLAZE0
23comment "Definitions for MICROBLAZE0"
24 depends on ALLOW_EDIT_AUTO
25
26config KERNEL_BASE_ADDR
27 hex "Physical address where Linux Kernel is"
28 default "0x90000000"
29 help
30 BASE Address for kernel
31
32config XILINX_MICROBLAZE0_FAMILY
33 string "Targetted FPGA family" if ALLOW_EDIT_AUTO
34 default "virtex5"
35
36config XILINX_MICROBLAZE0_USE_MSR_INSTR
37 int "USE_MSR_INSTR range (0:1)" if ALLOW_EDIT_AUTO
38 default 1
39
40config XILINX_MICROBLAZE0_USE_PCMP_INSTR
41 int "USE_PCMP_INSTR range (0:1)" if ALLOW_EDIT_AUTO
42 default 1
43
44config XILINX_MICROBLAZE0_USE_BARREL
45 int "USE_BARREL range (0:1)" if ALLOW_EDIT_AUTO
46 default 1
47
48config XILINX_MICROBLAZE0_USE_DIV
49 int "USE_DIV range (0:1)" if ALLOW_EDIT_AUTO
50 default 1
51
52config XILINX_MICROBLAZE0_USE_HW_MUL
53 int "USE_HW_MUL values (0=NONE, 1=MUL32, 2=MUL64)" if ALLOW_EDIT_AUTO
54 default 2
55
56config XILINX_MICROBLAZE0_USE_FPU
57 int "USE_FPU values (0=NONE, 1=BASIC, 2=EXTENDED)" if ALLOW_EDIT_AUTO
58 default 2
59
60config XILINX_MICROBLAZE0_HW_VER
61 string "Core version number" if ALLOW_EDIT_AUTO
62 default 7.10.d
diff --git a/arch/microblaze/platform/generic/Makefile b/arch/microblaze/platform/generic/Makefile
new file mode 100644
index 000000000000..9a8b1bd3fa6d
--- /dev/null
+++ b/arch/microblaze/platform/generic/Makefile
@@ -0,0 +1,3 @@
1#
2# Empty Makefile to keep make clean happy
3#
diff --git a/arch/microblaze/platform/generic/system.dts b/arch/microblaze/platform/generic/system.dts
new file mode 100644
index 000000000000..29993f62b30a
--- /dev/null
+++ b/arch/microblaze/platform/generic/system.dts
@@ -0,0 +1,332 @@
1/*
2 * Device Tree Generator version: 1.1
3 *
4 * (C) Copyright 2007-2008 Xilinx, Inc.
5 * (C) Copyright 2007-2009 Michal Simek
6 *
7 * Michal SIMEK <monstr@monstr.eu>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (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,
22 * MA 02111-1307 USA
23 *
24 * CAUTION: This file is automatically generated by libgen.
25 * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6
26 *
27 * XPS project directory: Xilinx-ML505-ll_temac-sgdma-MMU-FDT-edk101
28 */
29
30/dts-v1/;
31/ {
32 #address-cells = <1>;
33 #size-cells = <1>;
34 compatible = "xlnx,microblaze";
35 model = "testing";
36 DDR2_SDRAM: memory@90000000 {
37 device_type = "memory";
38 reg = < 0x90000000 0x10000000 >;
39 } ;
40 chosen {
41 bootargs = "console=ttyUL0,115200 highres=on";
42 linux,stdout-path = "/plb@0/serial@84000000";
43 } ;
44 cpus {
45 #address-cells = <1>;
46 #cpus = <0x1>;
47 #size-cells = <0>;
48 microblaze_0: cpu@0 {
49 clock-frequency = <125000000>;
50 compatible = "xlnx,microblaze-7.10.d";
51 d-cache-baseaddr = <0x90000000>;
52 d-cache-highaddr = <0x9fffffff>;
53 d-cache-line-size = <0x10>;
54 d-cache-size = <0x2000>;
55 device_type = "cpu";
56 i-cache-baseaddr = <0x90000000>;
57 i-cache-highaddr = <0x9fffffff>;
58 i-cache-line-size = <0x10>;
59 i-cache-size = <0x2000>;
60 model = "microblaze,7.10.d";
61 reg = <0>;
62 timebase-frequency = <125000000>;
63 xlnx,addr-tag-bits = <0xf>;
64 xlnx,allow-dcache-wr = <0x1>;
65 xlnx,allow-icache-wr = <0x1>;
66 xlnx,area-optimized = <0x0>;
67 xlnx,cache-byte-size = <0x2000>;
68 xlnx,d-lmb = <0x1>;
69 xlnx,d-opb = <0x0>;
70 xlnx,d-plb = <0x1>;
71 xlnx,data-size = <0x20>;
72 xlnx,dcache-addr-tag = <0xf>;
73 xlnx,dcache-always-used = <0x1>;
74 xlnx,dcache-byte-size = <0x2000>;
75 xlnx,dcache-line-len = <0x4>;
76 xlnx,dcache-use-fsl = <0x1>;
77 xlnx,debug-enabled = <0x1>;
78 xlnx,div-zero-exception = <0x1>;
79 xlnx,dopb-bus-exception = <0x0>;
80 xlnx,dynamic-bus-sizing = <0x1>;
81 xlnx,edge-is-positive = <0x1>;
82 xlnx,family = "virtex5";
83 xlnx,fpu-exception = <0x1>;
84 xlnx,fsl-data-size = <0x20>;
85 xlnx,fsl-exception = <0x0>;
86 xlnx,fsl-links = <0x0>;
87 xlnx,i-lmb = <0x1>;
88 xlnx,i-opb = <0x0>;
89 xlnx,i-plb = <0x1>;
90 xlnx,icache-always-used = <0x1>;
91 xlnx,icache-line-len = <0x4>;
92 xlnx,icache-use-fsl = <0x1>;
93 xlnx,ill-opcode-exception = <0x1>;
94 xlnx,instance = "microblaze_0";
95 xlnx,interconnect = <0x1>;
96 xlnx,interrupt-is-edge = <0x0>;
97 xlnx,iopb-bus-exception = <0x0>;
98 xlnx,mmu-dtlb-size = <0x4>;
99 xlnx,mmu-itlb-size = <0x2>;
100 xlnx,mmu-tlb-access = <0x3>;
101 xlnx,mmu-zones = <0x10>;
102 xlnx,number-of-pc-brk = <0x1>;
103 xlnx,number-of-rd-addr-brk = <0x0>;
104 xlnx,number-of-wr-addr-brk = <0x0>;
105 xlnx,opcode-0x0-illegal = <0x1>;
106 xlnx,pvr = <0x2>;
107 xlnx,pvr-user1 = <0x0>;
108 xlnx,pvr-user2 = <0x0>;
109 xlnx,reset-msr = <0x0>;
110 xlnx,sco = <0x0>;
111 xlnx,unaligned-exceptions = <0x1>;
112 xlnx,use-barrel = <0x1>;
113 xlnx,use-dcache = <0x1>;
114 xlnx,use-div = <0x1>;
115 xlnx,use-ext-brk = <0x1>;
116 xlnx,use-ext-nm-brk = <0x1>;
117 xlnx,use-extended-fsl-instr = <0x0>;
118 xlnx,use-fpu = <0x2>;
119 xlnx,use-hw-mul = <0x2>;
120 xlnx,use-icache = <0x1>;
121 xlnx,use-interrupt = <0x1>;
122 xlnx,use-mmu = <0x3>;
123 xlnx,use-msr-instr = <0x1>;
124 xlnx,use-pcmp-instr = <0x1>;
125 } ;
126 } ;
127 mb_plb: plb@0 {
128 #address-cells = <1>;
129 #size-cells = <1>;
130 compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
131 ranges ;
132 FLASH: flash@a0000000 {
133 bank-width = <2>;
134 compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
135 reg = < 0xa0000000 0x2000000 >;
136 xlnx,family = "virtex5";
137 xlnx,include-datawidth-matching-0 = <0x1>;
138 xlnx,include-datawidth-matching-1 = <0x0>;
139 xlnx,include-datawidth-matching-2 = <0x0>;
140 xlnx,include-datawidth-matching-3 = <0x0>;
141 xlnx,include-negedge-ioregs = <0x0>;
142 xlnx,include-plb-ipif = <0x1>;
143 xlnx,include-wrbuf = <0x1>;
144 xlnx,max-mem-width = <0x10>;
145 xlnx,mch-native-dwidth = <0x20>;
146 xlnx,mch-plb-clk-period-ps = <0x1f40>;
147 xlnx,mch-splb-awidth = <0x20>;
148 xlnx,mch0-accessbuf-depth = <0x10>;
149 xlnx,mch0-protocol = <0x0>;
150 xlnx,mch0-rddatabuf-depth = <0x10>;
151 xlnx,mch1-accessbuf-depth = <0x10>;
152 xlnx,mch1-protocol = <0x0>;
153 xlnx,mch1-rddatabuf-depth = <0x10>;
154 xlnx,mch2-accessbuf-depth = <0x10>;
155 xlnx,mch2-protocol = <0x0>;
156 xlnx,mch2-rddatabuf-depth = <0x10>;
157 xlnx,mch3-accessbuf-depth = <0x10>;
158 xlnx,mch3-protocol = <0x0>;
159 xlnx,mch3-rddatabuf-depth = <0x10>;
160 xlnx,mem0-width = <0x10>;
161 xlnx,mem1-width = <0x20>;
162 xlnx,mem2-width = <0x20>;
163 xlnx,mem3-width = <0x20>;
164 xlnx,num-banks-mem = <0x1>;
165 xlnx,num-channels = <0x0>;
166 xlnx,priority-mode = <0x0>;
167 xlnx,synch-mem-0 = <0x0>;
168 xlnx,synch-mem-1 = <0x0>;
169 xlnx,synch-mem-2 = <0x0>;
170 xlnx,synch-mem-3 = <0x0>;
171 xlnx,synch-pipedelay-0 = <0x2>;
172 xlnx,synch-pipedelay-1 = <0x2>;
173 xlnx,synch-pipedelay-2 = <0x2>;
174 xlnx,synch-pipedelay-3 = <0x2>;
175 xlnx,tavdv-ps-mem-0 = <0x1adb0>;
176 xlnx,tavdv-ps-mem-1 = <0x3a98>;
177 xlnx,tavdv-ps-mem-2 = <0x3a98>;
178 xlnx,tavdv-ps-mem-3 = <0x3a98>;
179 xlnx,tcedv-ps-mem-0 = <0x1adb0>;
180 xlnx,tcedv-ps-mem-1 = <0x3a98>;
181 xlnx,tcedv-ps-mem-2 = <0x3a98>;
182 xlnx,tcedv-ps-mem-3 = <0x3a98>;
183 xlnx,thzce-ps-mem-0 = <0x88b8>;
184 xlnx,thzce-ps-mem-1 = <0x1b58>;
185 xlnx,thzce-ps-mem-2 = <0x1b58>;
186 xlnx,thzce-ps-mem-3 = <0x1b58>;
187 xlnx,thzoe-ps-mem-0 = <0x1b58>;
188 xlnx,thzoe-ps-mem-1 = <0x1b58>;
189 xlnx,thzoe-ps-mem-2 = <0x1b58>;
190 xlnx,thzoe-ps-mem-3 = <0x1b58>;
191 xlnx,tlzwe-ps-mem-0 = <0x88b8>;
192 xlnx,tlzwe-ps-mem-1 = <0x0>;
193 xlnx,tlzwe-ps-mem-2 = <0x0>;
194 xlnx,tlzwe-ps-mem-3 = <0x0>;
195 xlnx,twc-ps-mem-0 = <0x2af8>;
196 xlnx,twc-ps-mem-1 = <0x3a98>;
197 xlnx,twc-ps-mem-2 = <0x3a98>;
198 xlnx,twc-ps-mem-3 = <0x3a98>;
199 xlnx,twp-ps-mem-0 = <0x11170>;
200 xlnx,twp-ps-mem-1 = <0x2ee0>;
201 xlnx,twp-ps-mem-2 = <0x2ee0>;
202 xlnx,twp-ps-mem-3 = <0x2ee0>;
203 xlnx,xcl0-linesize = <0x4>;
204 xlnx,xcl0-writexfer = <0x1>;
205 xlnx,xcl1-linesize = <0x4>;
206 xlnx,xcl1-writexfer = <0x1>;
207 xlnx,xcl2-linesize = <0x4>;
208 xlnx,xcl2-writexfer = <0x1>;
209 xlnx,xcl3-linesize = <0x4>;
210 xlnx,xcl3-writexfer = <0x1>;
211 } ;
212 Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
213 #address-cells = <1>;
214 #size-cells = <1>;
215 compatible = "xlnx,compound";
216 ethernet@81c00000 {
217 compatible = "xlnx,xps-ll-temac-1.01.b";
218 device_type = "network";
219 interrupt-parent = <&xps_intc_0>;
220 interrupts = < 5 2 >;
221 llink-connected = <&PIM3>;
222 local-mac-address = [ 02 00 00 00 00 00 ];
223 reg = < 0x81c00000 0x40 >;
224 xlnx,bus2core-clk-ratio = <0x1>;
225 xlnx,phy-type = <0x1>;
226 xlnx,phyaddr = <0x1>;
227 xlnx,rxcsum = <0x0>;
228 xlnx,rxfifo = <0x1000>;
229 xlnx,temac-type = <0x0>;
230 xlnx,txcsum = <0x0>;
231 xlnx,txfifo = <0x1000>;
232 } ;
233 } ;
234 IIC_EEPROM: i2c@81600000 {
235 compatible = "xlnx,xps-iic-2.00.a";
236 interrupt-parent = <&xps_intc_0>;
237 interrupts = < 6 2 >;
238 reg = < 0x81600000 0x10000 >;
239 xlnx,clk-freq = <0x7735940>;
240 xlnx,family = "virtex5";
241 xlnx,gpo-width = <0x1>;
242 xlnx,iic-freq = <0x186a0>;
243 xlnx,scl-inertial-delay = <0x0>;
244 xlnx,sda-inertial-delay = <0x0>;
245 xlnx,ten-bit-adr = <0x0>;
246 } ;
247 LEDs_8Bit: gpio@81400000 {
248 compatible = "xlnx,xps-gpio-1.00.a";
249 interrupt-parent = <&xps_intc_0>;
250 interrupts = < 7 2 >;
251 reg = < 0x81400000 0x10000 >;
252 xlnx,all-inputs = <0x0>;
253 xlnx,all-inputs-2 = <0x0>;
254 xlnx,dout-default = <0x0>;
255 xlnx,dout-default-2 = <0x0>;
256 xlnx,family = "virtex5";
257 xlnx,gpio-width = <0x8>;
258 xlnx,interrupt-present = <0x1>;
259 xlnx,is-bidir = <0x1>;
260 xlnx,is-bidir-2 = <0x1>;
261 xlnx,is-dual = <0x0>;
262 xlnx,tri-default = <0xffffffff>;
263 xlnx,tri-default-2 = <0xffffffff>;
264 } ;
265 RS232_Uart_1: serial@84000000 {
266 clock-frequency = <125000000>;
267 compatible = "xlnx,xps-uartlite-1.00.a";
268 current-speed = <115200>;
269 device_type = "serial";
270 interrupt-parent = <&xps_intc_0>;
271 interrupts = < 8 0 >;
272 port-number = <0>;
273 reg = < 0x84000000 0x10000 >;
274 xlnx,baudrate = <0x1c200>;
275 xlnx,data-bits = <0x8>;
276 xlnx,family = "virtex5";
277 xlnx,odd-parity = <0x0>;
278 xlnx,use-parity = <0x0>;
279 } ;
280 SysACE_CompactFlash: sysace@83600000 {
281 compatible = "xlnx,xps-sysace-1.00.a";
282 interrupt-parent = <&xps_intc_0>;
283 interrupts = < 4 2 >;
284 reg = < 0x83600000 0x10000 >;
285 xlnx,family = "virtex5";
286 xlnx,mem-width = <0x10>;
287 } ;
288 debug_module: debug@84400000 {
289 compatible = "xlnx,mdm-1.00.d";
290 reg = < 0x84400000 0x10000 >;
291 xlnx,family = "virtex5";
292 xlnx,interconnect = <0x1>;
293 xlnx,jtag-chain = <0x2>;
294 xlnx,mb-dbg-ports = <0x1>;
295 xlnx,uart-width = <0x8>;
296 xlnx,use-uart = <0x1>;
297 xlnx,write-fsl-ports = <0x0>;
298 } ;
299 mpmc@90000000 {
300 #address-cells = <1>;
301 #size-cells = <1>;
302 compatible = "xlnx,mpmc-4.02.a";
303 PIM3: sdma@84600180 {
304 compatible = "xlnx,ll-dma-1.00.a";
305 interrupt-parent = <&xps_intc_0>;
306 interrupts = < 2 2 1 2 >;
307 reg = < 0x84600180 0x80 >;
308 } ;
309 } ;
310 xps_intc_0: interrupt-controller@81800000 {
311 #interrupt-cells = <0x2>;
312 compatible = "xlnx,xps-intc-1.00.a";
313 interrupt-controller ;
314 reg = < 0x81800000 0x10000 >;
315 xlnx,kind-of-intr = <0x100>;
316 xlnx,num-intr-inputs = <0x9>;
317 } ;
318 xps_timer_1: timer@83c00000 {
319 compatible = "xlnx,xps-timer-1.00.a";
320 interrupt-parent = <&xps_intc_0>;
321 interrupts = < 3 2 >;
322 reg = < 0x83c00000 0x10000 >;
323 xlnx,count-width = <0x20>;
324 xlnx,family = "virtex5";
325 xlnx,gen0-assert = <0x1>;
326 xlnx,gen1-assert = <0x1>;
327 xlnx,one-timer-only = <0x0>;
328 xlnx,trig0-assert = <0x1>;
329 xlnx,trig1-assert = <0x1>;
330 } ;
331 } ;
332} ;
diff --git a/arch/microblaze/platform/platform.c b/arch/microblaze/platform/platform.c
new file mode 100644
index 000000000000..56e0234fa34b
--- /dev/null
+++ b/arch/microblaze/platform/platform.c
@@ -0,0 +1,31 @@
1/*
2 * Copyright 2008 Michal Simek <monstr@monstr.eu>
3 *
4 * based on virtex.c file
5 *
6 * Copyright 2007 Secret Lab Technologies Ltd.
7 *
8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of any
10 * kind, whether express or implied.
11 */
12
13#include <linux/init.h>
14#include <linux/of_platform.h>
15#include <asm/prom.h>
16
17static struct of_device_id xilinx_of_bus_ids[] __initdata = {
18 { .compatible = "simple-bus", },
19 { .compatible = "xlnx,plb-v46-1.00.a", },
20 { .compatible = "xlnx,opb-v20-1.10.c", },
21 { .compatible = "xlnx,opb-v20-1.10.b", },
22 { .compatible = "xlnx,compound", },
23 {}
24};
25
26static int __init microblaze_device_probe(void)
27{
28 of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
29 return 0;
30}
31device_initcall(microblaze_device_probe);
diff --git a/arch/mips/include/asm/mach-rc32434/gpio.h b/arch/mips/include/asm/mach-rc32434/gpio.h
index 3cb50d17b62d..12ee8d510160 100644
--- a/arch/mips/include/asm/mach-rc32434/gpio.h
+++ b/arch/mips/include/asm/mach-rc32434/gpio.h
@@ -80,6 +80,9 @@ struct rb532_gpio_reg {
80/* Compact Flash GPIO pin */ 80/* Compact Flash GPIO pin */
81#define CF_GPIO_NUM 13 81#define CF_GPIO_NUM 13
82 82
83/* S1 button GPIO (shared with UART0_SIN) */
84#define GPIO_BTN_S1 1
85
83extern void rb532_gpio_set_ilevel(int bit, unsigned gpio); 86extern void rb532_gpio_set_ilevel(int bit, unsigned gpio);
84extern void rb532_gpio_set_istat(int bit, unsigned gpio); 87extern void rb532_gpio_set_istat(int bit, unsigned gpio);
85extern void rb532_gpio_set_func(unsigned gpio); 88extern void rb532_gpio_set_func(unsigned gpio);
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
index 4a5f05b662ae..9f40e1ff9b4f 100644
--- a/arch/mips/rb532/devices.c
+++ b/arch/mips/rb532/devices.c
@@ -200,26 +200,9 @@ static struct platform_device rb532_led = {
200 .id = -1, 200 .id = -1,
201}; 201};
202 202
203static struct gpio_keys_button rb532_gpio_btn[] = {
204 {
205 .gpio = 1,
206 .code = BTN_0,
207 .desc = "S1",
208 .active_low = 1,
209 }
210};
211
212static struct gpio_keys_platform_data rb532_gpio_btn_data = {
213 .buttons = rb532_gpio_btn,
214 .nbuttons = ARRAY_SIZE(rb532_gpio_btn),
215};
216
217static struct platform_device rb532_button = { 203static struct platform_device rb532_button = {
218 .name = "gpio-keys", 204 .name = "rb532-button",
219 .id = -1, 205 .id = -1,
220 .dev = {
221 .platform_data = &rb532_gpio_btn_data,
222 }
223}; 206};
224 207
225static struct resource rb532_wdt_res[] = { 208static struct resource rb532_wdt_res[] = {
diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h
index 414c50e2e881..94942d60ddfd 100644
--- a/arch/powerpc/include/asm/parport.h
+++ b/arch/powerpc/include/asm/parport.h
@@ -29,7 +29,7 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
29 prop = of_get_property(np, "interrupts", NULL); 29 prop = of_get_property(np, "interrupts", NULL);
30 if (!prop) 30 if (!prop)
31 continue; 31 continue;
32 if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL) 32 if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL, 0) != NULL)
33 count++; 33 count++;
34 } 34 }
35 return count; 35 return count;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index dcb667c4375a..2eca5fe0e75b 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -82,6 +82,7 @@ config S390
82 select USE_GENERIC_SMP_HELPERS if SMP 82 select USE_GENERIC_SMP_HELPERS if SMP
83 select HAVE_SYSCALL_WRAPPERS 83 select HAVE_SYSCALL_WRAPPERS
84 select HAVE_FUNCTION_TRACER 84 select HAVE_FUNCTION_TRACER
85 select HAVE_DEFAULT_NO_SPIN_MUTEXES
85 select HAVE_OPROFILE 86 select HAVE_OPROFILE
86 select HAVE_KPROBES 87 select HAVE_KPROBES
87 select HAVE_KRETPROBES 88 select HAVE_KRETPROBES
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 5e4babecf934..e7390dd0283d 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -14,6 +14,7 @@ config SUPERH
14 select HAVE_GENERIC_DMA_COHERENT 14 select HAVE_GENERIC_DMA_COHERENT
15 select HAVE_IOREMAP_PROT if MMU 15 select HAVE_IOREMAP_PROT if MMU
16 select HAVE_ARCH_TRACEHOOK 16 select HAVE_ARCH_TRACEHOOK
17 select HAVE_DMA_API_DEBUG
17 help 18 help
18 The SuperH is a RISC processor targeted for use in embedded systems 19 The SuperH is a RISC processor targeted for use in embedded systems
19 and consumer electronics; it was also used in the Sega Dreamcast 20 and consumer electronics; it was also used in the Sega Dreamcast
@@ -21,7 +22,7 @@ config SUPERH
21 <http://www.linux-sh.org/>. 22 <http://www.linux-sh.org/>.
22 23
23config SUPERH32 24config SUPERH32
24 def_bool !SUPERH64 25 def_bool ARCH = "sh"
25 select HAVE_KPROBES 26 select HAVE_KPROBES
26 select HAVE_KRETPROBES 27 select HAVE_KRETPROBES
27 select HAVE_FUNCTION_TRACER 28 select HAVE_FUNCTION_TRACER
@@ -31,7 +32,7 @@ config SUPERH32
31 select ARCH_HIBERNATION_POSSIBLE if MMU 32 select ARCH_HIBERNATION_POSSIBLE if MMU
32 33
33config SUPERH64 34config SUPERH64
34 def_bool y if CPU_SH5 35 def_bool ARCH = "sh64"
35 36
36config ARCH_DEFCONFIG 37config ARCH_DEFCONFIG
37 string 38 string
@@ -187,6 +188,8 @@ config ARCH_SHMOBILE
187 bool 188 bool
188 select ARCH_SUSPEND_POSSIBLE 189 select ARCH_SUSPEND_POSSIBLE
189 190
191if SUPERH32
192
190choice 193choice
191 prompt "Processor sub-type selection" 194 prompt "Processor sub-type selection"
192 195
@@ -408,6 +411,15 @@ config CPU_SUBTYPE_SH7366
408 select SYS_SUPPORTS_NUMA 411 select SYS_SUPPORTS_NUMA
409 select SYS_SUPPORTS_CMT 412 select SYS_SUPPORTS_CMT
410 413
414endchoice
415
416endif
417
418if SUPERH64
419
420choice
421 prompt "Processor sub-type selection"
422
411# SH-5 Processor Support 423# SH-5 Processor Support
412 424
413config CPU_SUBTYPE_SH5_101 425config CPU_SUBTYPE_SH5_101
@@ -420,6 +432,8 @@ config CPU_SUBTYPE_SH5_103
420 432
421endchoice 433endchoice
422 434
435endif
436
423source "arch/sh/mm/Kconfig" 437source "arch/sh/mm/Kconfig"
424 438
425source "arch/sh/Kconfig.cpu" 439source "arch/sh/Kconfig.cpu"
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index 912458f666eb..39e46919df14 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -349,6 +349,7 @@ static int ov7725_power(struct device *dev, int mode)
349static struct ov772x_camera_info ov7725_info = { 349static struct ov772x_camera_info ov7725_info = {
350 .buswidth = SOCAM_DATAWIDTH_8, 350 .buswidth = SOCAM_DATAWIDTH_8,
351 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 351 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
352 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
352 .link = { 353 .link = {
353 .power = ov7725_power, 354 .power = ov7725_power,
354 }, 355 },
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
index 8367d1d789c3..beb88c4da2c1 100644
--- a/arch/sh/boards/board-urquell.c
+++ b/arch/sh/boards/board-urquell.c
@@ -2,6 +2,8 @@
2 * Renesas Technology Corp. SH7786 Urquell Support. 2 * Renesas Technology Corp. SH7786 Urquell Support.
3 * 3 *
4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com> 4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * Based on board-sh7785lcr.c
5 * Copyright (C) 2008 Yoshihiro Shimoda 7 * Copyright (C) 2008 Yoshihiro Shimoda
6 * 8 *
7 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
@@ -21,6 +23,32 @@
21#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
22#include <asm/sizes.h> 24#include <asm/sizes.h>
23 25
26/*
27 * bit 1234 5678
28 *----------------------------
29 * SW1 0101 0010 -> Pck 33MHz version
30 * (1101 0010) Pck 66MHz version
31 * SW2 0x1x xxxx -> little endian
32 * 29bit mode
33 * SW47 0001 1000 -> CS0 : on-board flash
34 * CS1 : SRAM, registers, LAN, PCMCIA
35 * 38400 bps for SCIF1
36 *
37 * Address
38 * 0x00000000 - 0x04000000 (CS0) Nor Flash
39 * 0x04000000 - 0x04200000 (CS1) SRAM
40 * 0x05000000 - 0x05800000 (CS1) on board register
41 * 0x05800000 - 0x06000000 (CS1) LAN91C111
42 * 0x06000000 - 0x06400000 (CS1) PCMCIA
43 * 0x08000000 - 0x10000000 (CS2-CS3) DDR3
44 * 0x10000000 - 0x14000000 (CS4) PCIe
45 * 0x14000000 - 0x14800000 (CS5) Core0 LRAM/URAM
46 * 0x14800000 - 0x15000000 (CS5) Core1 LRAM/URAM
47 * 0x18000000 - 0x1C000000 (CS6) ATA/NAND-Flash
48 * 0x1C000000 - (CS7) SH7786 Control register
49 */
50
51/* HeartBeat */
24static struct resource heartbeat_resources[] = { 52static struct resource heartbeat_resources[] = {
25 [0] = { 53 [0] = {
26 .start = BOARDREG(SLEDR), 54 .start = BOARDREG(SLEDR),
@@ -43,6 +71,7 @@ static struct platform_device heartbeat_device = {
43 .resource = heartbeat_resources, 71 .resource = heartbeat_resources,
44}; 72};
45 73
74/* LAN91C111 */
46static struct smc91x_platdata smc91x_info = { 75static struct smc91x_platdata smc91x_info = {
47 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, 76 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
48}; 77};
@@ -69,6 +98,7 @@ static struct platform_device smc91x_eth_device = {
69 }, 98 },
70}; 99};
71 100
101/* Nor Flash */
72static struct mtd_partition nor_flash_partitions[] = { 102static struct mtd_partition nor_flash_partitions[] = {
73 { 103 {
74 .name = "loader", 104 .name = "loader",
diff --git a/arch/sh/drivers/pci/ops-sh7785lcr.c b/arch/sh/drivers/pci/ops-sh7785lcr.c
index e8b7446a7c2b..fb0869f0bef8 100644
--- a/arch/sh/drivers/pci/ops-sh7785lcr.c
+++ b/arch/sh/drivers/pci/ops-sh7785lcr.c
@@ -48,8 +48,13 @@ EXPORT_SYMBOL(board_pci_channels);
48 48
49static struct sh4_pci_address_map sh7785_pci_map = { 49static struct sh4_pci_address_map sh7785_pci_map = {
50 .window0 = { 50 .window0 = {
51#if defined(CONFIG_32BIT)
52 .base = SH7780_32BIT_DDR_BASE_ADDR,
53 .size = 0x40000000,
54#else
51 .base = SH7780_CS0_BASE_ADDR, 55 .base = SH7780_CS0_BASE_ADDR,
52 .size = 0x20000000, 56 .size = 0x20000000,
57#endif
53 }, 58 },
54 59
55 .flags = SH4_PCIC_NO_RESET, 60 .flags = SH4_PCIC_NO_RESET,
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h
index 97b2c98f05c4..93adc7119b79 100644
--- a/arch/sh/drivers/pci/pci-sh7780.h
+++ b/arch/sh/drivers/pci/pci-sh7780.h
@@ -104,6 +104,8 @@
104#define SH7780_CS5_BASE_ADDR (SH7780_CS4_BASE_ADDR + SH7780_MEM_REGION_SIZE) 104#define SH7780_CS5_BASE_ADDR (SH7780_CS4_BASE_ADDR + SH7780_MEM_REGION_SIZE)
105#define SH7780_CS6_BASE_ADDR (SH7780_CS5_BASE_ADDR + SH7780_MEM_REGION_SIZE) 105#define SH7780_CS6_BASE_ADDR (SH7780_CS5_BASE_ADDR + SH7780_MEM_REGION_SIZE)
106 106
107#define SH7780_32BIT_DDR_BASE_ADDR 0x40000000
108
107struct sh4_pci_address_map; 109struct sh4_pci_address_map;
108 110
109/* arch/sh/drivers/pci/pci-sh7780.c */ 111/* arch/sh/drivers/pci/pci-sh7780.c */
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index e36c7b870861..0d6ac7a1db49 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -19,6 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/dma-debug.h>
22#include <asm/io.h> 23#include <asm/io.h>
23 24
24static int __init pcibios_init(void) 25static int __init pcibios_init(void)
@@ -43,6 +44,8 @@ static int __init pcibios_init(void)
43 44
44 pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq); 45 pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq);
45 46
47 dma_debug_add_bus(&pci_bus_type);
48
46 return 0; 49 return 0;
47} 50}
48subsys_initcall(pcibios_init); 51subsys_initcall(pcibios_init);
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index 627315ecdb52..ea9d4f41c9d2 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/scatterlist.h> 5#include <linux/scatterlist.h>
6#include <linux/dma-debug.h>
6#include <asm/cacheflush.h> 7#include <asm/cacheflush.h>
7#include <asm/io.h> 8#include <asm/io.h>
8#include <asm-generic/dma-coherent.h> 9#include <asm-generic/dma-coherent.h>
@@ -38,16 +39,26 @@ static inline dma_addr_t dma_map_single(struct device *dev,
38 void *ptr, size_t size, 39 void *ptr, size_t size,
39 enum dma_data_direction dir) 40 enum dma_data_direction dir)
40{ 41{
42 dma_addr_t addr = virt_to_phys(ptr);
43
41#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) 44#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
42 if (dev->bus == &pci_bus_type) 45 if (dev->bus == &pci_bus_type)
43 return virt_to_phys(ptr); 46 return addr;
44#endif 47#endif
45 dma_cache_sync(dev, ptr, size, dir); 48 dma_cache_sync(dev, ptr, size, dir);
46 49
47 return virt_to_phys(ptr); 50 debug_dma_map_page(dev, virt_to_page(ptr),
51 (unsigned long)ptr & ~PAGE_MASK, size,
52 dir, addr, true);
53
54 return addr;
48} 55}
49 56
50#define dma_unmap_single(dev, addr, size, dir) do { } while (0) 57static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
58 size_t size, enum dma_data_direction dir)
59{
60 debug_dma_unmap_page(dev, addr, size, dir, true);
61}
51 62
52static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, 63static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
53 int nents, enum dma_data_direction dir) 64 int nents, enum dma_data_direction dir)
@@ -59,12 +70,19 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
59 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); 70 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
60#endif 71#endif
61 sg[i].dma_address = sg_phys(&sg[i]); 72 sg[i].dma_address = sg_phys(&sg[i]);
73 sg[i].dma_length = sg[i].length;
62 } 74 }
63 75
76 debug_dma_map_sg(dev, sg, nents, i, dir);
77
64 return nents; 78 return nents;
65} 79}
66 80
67#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) 81static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
82 int nents, enum dma_data_direction dir)
83{
84 debug_dma_unmap_sg(dev, sg, nents, dir);
85}
68 86
69static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, 87static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
70 unsigned long offset, size_t size, 88 unsigned long offset, size_t size,
@@ -111,6 +129,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
111 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); 129 dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir);
112#endif 130#endif
113 sg[i].dma_address = sg_phys(&sg[i]); 131 sg[i].dma_address = sg_phys(&sg[i]);
132 sg[i].dma_length = sg[i].length;
114 } 133 }
115} 134}
116 135
@@ -119,6 +138,7 @@ static inline void dma_sync_single_for_cpu(struct device *dev,
119 enum dma_data_direction dir) 138 enum dma_data_direction dir)
120{ 139{
121 dma_sync_single(dev, dma_handle, size, dir); 140 dma_sync_single(dev, dma_handle, size, dir);
141 debug_dma_sync_single_for_cpu(dev, dma_handle, size, dir);
122} 142}
123 143
124static inline void dma_sync_single_for_device(struct device *dev, 144static inline void dma_sync_single_for_device(struct device *dev,
@@ -127,6 +147,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
127 enum dma_data_direction dir) 147 enum dma_data_direction dir)
128{ 148{
129 dma_sync_single(dev, dma_handle, size, dir); 149 dma_sync_single(dev, dma_handle, size, dir);
150 debug_dma_sync_single_for_device(dev, dma_handle, size, dir);
130} 151}
131 152
132static inline void dma_sync_single_range_for_cpu(struct device *dev, 153static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -136,6 +157,8 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
136 enum dma_data_direction direction) 157 enum dma_data_direction direction)
137{ 158{
138 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction); 159 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
160 debug_dma_sync_single_range_for_cpu(dev, dma_handle,
161 offset, size, direction);
139} 162}
140 163
141static inline void dma_sync_single_range_for_device(struct device *dev, 164static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -145,6 +168,8 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
145 enum dma_data_direction direction) 168 enum dma_data_direction direction)
146{ 169{
147 dma_sync_single_for_device(dev, dma_handle+offset, size, direction); 170 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
171 debug_dma_sync_single_range_for_device(dev, dma_handle,
172 offset, size, direction);
148} 173}
149 174
150 175
@@ -153,6 +178,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev,
153 enum dma_data_direction dir) 178 enum dma_data_direction dir)
154{ 179{
155 dma_sync_sg(dev, sg, nelems, dir); 180 dma_sync_sg(dev, sg, nelems, dir);
181 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir);
156} 182}
157 183
158static inline void dma_sync_sg_for_device(struct device *dev, 184static inline void dma_sync_sg_for_device(struct device *dev,
@@ -160,9 +186,9 @@ static inline void dma_sync_sg_for_device(struct device *dev,
160 enum dma_data_direction dir) 186 enum dma_data_direction dir)
161{ 187{
162 dma_sync_sg(dev, sg, nelems, dir); 188 dma_sync_sg(dev, sg, nelems, dir);
189 debug_dma_sync_sg_for_device(dev, sg, nelems, dir);
163} 190}
164 191
165
166static inline int dma_get_cache_alignment(void) 192static inline int dma_get_cache_alignment(void)
167{ 193{
168 /* 194 /*
diff --git a/arch/sh/include/asm/scatterlist.h b/arch/sh/include/asm/scatterlist.h
index 2084d0373693..c693d268a413 100644
--- a/arch/sh/include/asm/scatterlist.h
+++ b/arch/sh/include/asm/scatterlist.h
@@ -5,12 +5,13 @@
5 5
6struct scatterlist { 6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG 7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic; 8 unsigned long sg_magic;
9#endif 9#endif
10 unsigned long page_link; 10 unsigned long page_link;
11 unsigned int offset;/* for highmem, page offset */ 11 unsigned int offset; /* for highmem, page offset */
12 dma_addr_t dma_address; 12 unsigned int length;
13 unsigned int length; 13 dma_addr_t dma_address;
14 unsigned int dma_length;
14}; 15};
15 16
16#define ISA_DMA_THRESHOLD PHYS_ADDR_MASK 17#define ISA_DMA_THRESHOLD PHYS_ADDR_MASK
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index a3f239545897..8489a0905a87 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -37,8 +37,11 @@
37#define pcibus_to_node(bus) ((void)(bus), -1) 37#define pcibus_to_node(bus) ((void)(bus), -1)
38#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ 38#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
39 CPU_MASK_ALL : \ 39 CPU_MASK_ALL : \
40 node_to_cpumask(pcibus_to_node(bus)) \ 40 node_to_cpumask(pcibus_to_node(bus)))
41 ) 41#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
42 CPU_MASK_ALL_PTR : \
43 cpumask_of_node(pcibus_to_node(bus)))
44
42#endif 45#endif
43 46
44#include <asm-generic/topology.h> 47#include <asm-generic/topology.h>
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h
index d52c000cf924..2efb819e2db3 100644
--- a/arch/sh/include/asm/unistd_32.h
+++ b/arch/sh/include/asm/unistd_32.h
@@ -341,8 +341,10 @@
341#define __NR_dup3 330 341#define __NR_dup3 330
342#define __NR_pipe2 331 342#define __NR_pipe2 331
343#define __NR_inotify_init1 332 343#define __NR_inotify_init1 332
344#define __NR_preadv 333
345#define __NR_pwritev 334
344 346
345#define NR_syscalls 333 347#define NR_syscalls 335
346 348
347#ifdef __KERNEL__ 349#ifdef __KERNEL__
348 350
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h
index 7c54e91753c1..6eb9d2934c0f 100644
--- a/arch/sh/include/asm/unistd_64.h
+++ b/arch/sh/include/asm/unistd_64.h
@@ -381,10 +381,12 @@
381#define __NR_dup3 358 381#define __NR_dup3 358
382#define __NR_pipe2 359 382#define __NR_pipe2 359
383#define __NR_inotify_init1 360 383#define __NR_inotify_init1 360
384#define __NR_preadv 361
385#define __NR_pwritev 362
384 386
385#ifdef __KERNEL__ 387#ifdef __KERNEL__
386 388
387#define NR_syscalls 361 389#define NR_syscalls 363
388 390
389#define __ARCH_WANT_IPC_PARSE_VERSION 391#define __ARCH_WANT_IPC_PARSE_VERSION
390#define __ARCH_WANT_OLD_READDIR 392#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 5a47e1cf442e..90e8cfff55fd 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -143,14 +143,14 @@ static void __init sh7786_usb_setup(void)
143 * Set the PHY and PLL enable bit 143 * Set the PHY and PLL enable bit
144 */ 144 */
145 __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1); 145 __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1);
146 while (i-- && 146 while (i--) {
147 ((__raw_readl(USBST) & ACT_PLL_STATUS) != ACT_PLL_STATUS)) 147 if (ACT_PLL_STATUS == (__raw_readl(USBST) & ACT_PLL_STATUS)) {
148 /* Set the PHY RST bit */
149 __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
150 printk(KERN_INFO "sh7786 usb setup done\n");
151 break;
152 }
148 cpu_relax(); 153 cpu_relax();
149
150 if (i) {
151 /* Set the PHY RST bit */
152 __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
153 printk(KERN_INFO "sh7786 usb setup done\n");
154 } 154 }
155} 155}
156 156
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S
index e67c1733e1b9..05202edd8e21 100644
--- a/arch/sh/kernel/syscalls_32.S
+++ b/arch/sh/kernel/syscalls_32.S
@@ -349,3 +349,5 @@ ENTRY(sys_call_table)
349 .long sys_dup3 /* 330 */ 349 .long sys_dup3 /* 330 */
350 .long sys_pipe2 350 .long sys_pipe2
351 .long sys_inotify_init1 351 .long sys_inotify_init1
352 .long sys_preadv
353 .long sys_writev
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S
index 557cb91f5caf..a083609f9284 100644
--- a/arch/sh/kernel/syscalls_64.S
+++ b/arch/sh/kernel/syscalls_64.S
@@ -387,3 +387,5 @@ sys_call_table:
387 .long sys_dup3 387 .long sys_dup3
388 .long sys_pipe2 388 .long sys_pipe2
389 .long sys_inotify_init1 /* 360 */ 389 .long sys_inotify_init1 /* 360 */
390 .long sys_preadv
391 .long sys_pwritev
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index edcd5fbf9651..e098ec158ddb 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -10,11 +10,22 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/init.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
14#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
16#include <linux/dma-debug.h>
17#include <linux/io.h>
15#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
16#include <asm/addrspace.h> 19#include <asm/addrspace.h>
17#include <asm/io.h> 20
21#define PREALLOC_DMA_DEBUG_ENTRIES 4096
22
23static int __init dma_init(void)
24{
25 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
26 return 0;
27}
28fs_initcall(dma_init);
18 29
19void *dma_alloc_coherent(struct device *dev, size_t size, 30void *dma_alloc_coherent(struct device *dev, size_t size,
20 dma_addr_t *dma_handle, gfp_t gfp) 31 dma_addr_t *dma_handle, gfp_t gfp)
@@ -45,6 +56,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
45 split_page(pfn_to_page(virt_to_phys(ret) >> PAGE_SHIFT), order); 56 split_page(pfn_to_page(virt_to_phys(ret) >> PAGE_SHIFT), order);
46 57
47 *dma_handle = virt_to_phys(ret); 58 *dma_handle = virt_to_phys(ret);
59
60 debug_dma_alloc_coherent(dev, size, *dma_handle, ret_nocache);
61
48 return ret_nocache; 62 return ret_nocache;
49} 63}
50EXPORT_SYMBOL(dma_alloc_coherent); 64EXPORT_SYMBOL(dma_alloc_coherent);
@@ -56,12 +70,15 @@ void dma_free_coherent(struct device *dev, size_t size,
56 unsigned long pfn = dma_handle >> PAGE_SHIFT; 70 unsigned long pfn = dma_handle >> PAGE_SHIFT;
57 int k; 71 int k;
58 72
59 if (!dma_release_from_coherent(dev, order, vaddr)) { 73 WARN_ON(irqs_disabled()); /* for portability */
60 WARN_ON(irqs_disabled()); /* for portability */ 74
61 for (k = 0; k < (1 << order); k++) 75 if (dma_release_from_coherent(dev, order, vaddr))
62 __free_pages(pfn_to_page(pfn + k), 0); 76 return;
63 iounmap(vaddr); 77
64 } 78 debug_dma_free_coherent(dev, size, vaddr, dma_handle);
79 for (k = 0; k < (1 << order); k++)
80 __free_pages(pfn_to_page(pfn + k), 0);
81 iounmap(vaddr);
65} 82}
66EXPORT_SYMBOL(dma_free_coherent); 83EXPORT_SYMBOL(dma_free_coherent);
67 84
diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h
index dff3f0253aa8..ff9ead640c4a 100644
--- a/arch/sparc/include/asm/parport.h
+++ b/arch/sparc/include/asm/parport.h
@@ -117,7 +117,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
117 if (!strcmp(parent->name, "dma")) { 117 if (!strcmp(parent->name, "dma")) {
118 p = parport_pc_probe_port(base, base + 0x400, 118 p = parport_pc_probe_port(base, base + 0x400,
119 op->irqs[0], PARPORT_DMA_NOFIFO, 119 op->irqs[0], PARPORT_DMA_NOFIFO,
120 op->dev.parent->parent); 120 op->dev.parent->parent, 0);
121 if (!p) 121 if (!p)
122 return -ENOMEM; 122 return -ENOMEM;
123 dev_set_drvdata(&op->dev, p); 123 dev_set_drvdata(&op->dev, p);
@@ -168,7 +168,8 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
168 p = parport_pc_probe_port(base, base + 0x400, 168 p = parport_pc_probe_port(base, base + 0x400,
169 op->irqs[0], 169 op->irqs[0],
170 slot, 170 slot,
171 op->dev.parent); 171 op->dev.parent,
172 0);
172 err = -ENOMEM; 173 err = -ENOMEM;
173 if (!p) 174 if (!p)
174 goto out_disable_irq; 175 goto out_disable_irq;
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index e5383e3d2f8c..73739322b6d0 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -193,8 +193,10 @@ extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);
193 */ 193 */
194extern void early_ioremap_init(void); 194extern void early_ioremap_init(void);
195extern void early_ioremap_reset(void); 195extern void early_ioremap_reset(void);
196extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); 196extern void __iomem *early_ioremap(resource_size_t phys_addr,
197extern void __iomem *early_memremap(unsigned long offset, unsigned long size); 197 unsigned long size);
198extern void __iomem *early_memremap(resource_size_t phys_addr,
199 unsigned long size);
198extern void early_iounmap(void __iomem *addr, unsigned long size); 200extern void early_iounmap(void __iomem *addr, unsigned long size);
199 201
200#define IO_SPACE_LIMIT 0xffff 202#define IO_SPACE_LIMIT 0xffff
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 34c52370f2fe..fcf4d92e7e04 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -352,6 +352,11 @@ struct i387_soft_struct {
352 u32 entry_eip; 352 u32 entry_eip;
353}; 353};
354 354
355struct ymmh_struct {
356 /* 16 * 16 bytes for each YMMH-reg = 256 bytes */
357 u32 ymmh_space[64];
358};
359
355struct xsave_hdr_struct { 360struct xsave_hdr_struct {
356 u64 xstate_bv; 361 u64 xstate_bv;
357 u64 reserved1[2]; 362 u64 reserved1[2];
@@ -361,6 +366,7 @@ struct xsave_hdr_struct {
361struct xsave_struct { 366struct xsave_struct {
362 struct i387_fxsave_struct i387; 367 struct i387_fxsave_struct i387;
363 struct xsave_hdr_struct xsave_hdr; 368 struct xsave_hdr_struct xsave_hdr;
369 struct ymmh_struct ymmh;
364 /* new processor state extensions will go here */ 370 /* new processor state extensions will go here */
365} __attribute__ ((packed, aligned (64))); 371} __attribute__ ((packed, aligned (64)));
366 372
diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index d5cd6c586881..a4737dddfd58 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -50,7 +50,7 @@
50#ifdef CONFIG_X86_64 50#ifdef CONFIG_X86_64
51#define NEED_PSE 0 51#define NEED_PSE 0
52#define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) 52#define NEED_MSR (1<<(X86_FEATURE_MSR & 31))
53#define NEED_PGE (1<<(X86_FEATURE_PGE & 31)) 53#define NEED_PGE 0
54#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31)) 54#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31))
55#define NEED_XMM (1<<(X86_FEATURE_XMM & 31)) 55#define NEED_XMM (1<<(X86_FEATURE_XMM & 31))
56#define NEED_XMM2 (1<<(X86_FEATURE_XMM2 & 31)) 56#define NEED_XMM2 (1<<(X86_FEATURE_XMM2 & 31))
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
index ec666491aaa4..72e5a4491661 100644
--- a/arch/x86/include/asm/sigcontext.h
+++ b/arch/x86/include/asm/sigcontext.h
@@ -269,6 +269,11 @@ struct _xsave_hdr {
269 __u64 reserved2[5]; 269 __u64 reserved2[5];
270}; 270};
271 271
272struct _ymmh_state {
273 /* 16 * 16 bytes for each YMMH-reg */
274 __u32 ymmh_space[64];
275};
276
272/* 277/*
273 * Extended state pointed by the fpstate pointer in the sigcontext. 278 * Extended state pointed by the fpstate pointer in the sigcontext.
274 * In addition to the fpstate, information encoded in the xstate_hdr 279 * In addition to the fpstate, information encoded in the xstate_hdr
@@ -278,6 +283,7 @@ struct _xsave_hdr {
278struct _xstate { 283struct _xstate {
279 struct _fpstate fpstate; 284 struct _fpstate fpstate;
280 struct _xsave_hdr xstate_hdr; 285 struct _xsave_hdr xstate_hdr;
286 struct _ymmh_state ymmh;
281 /* new processor state extensions go here */ 287 /* new processor state extensions go here */
282}; 288};
283 289
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index 1a918dde46b5..018a0a400799 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -124,7 +124,8 @@ static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
124 124
125/* VIRT <-> MACHINE conversion */ 125/* VIRT <-> MACHINE conversion */
126#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v)))) 126#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
127#define virt_to_mfn(v) (pfn_to_mfn(PFN_DOWN(__pa(v)))) 127#define virt_to_pfn(v) (PFN_DOWN(__pa(v)))
128#define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v)))
128#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT)) 129#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
129 130
130static inline unsigned long pte_mfn(pte_t pte) 131static inline unsigned long pte_mfn(pte_t pte)
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 08e9a1ac07a9..727acc152344 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -7,6 +7,7 @@
7 7
8#define XSTATE_FP 0x1 8#define XSTATE_FP 0x1
9#define XSTATE_SSE 0x2 9#define XSTATE_SSE 0x2
10#define XSTATE_YMM 0x4
10 11
11#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE) 12#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
12 13
@@ -15,7 +16,7 @@
15/* 16/*
16 * These are the features that the OS can handle currently. 17 * These are the features that the OS can handle currently.
17 */ 18 */
18#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE) 19#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
19 20
20#ifdef CONFIG_X86_64 21#ifdef CONFIG_X86_64
21#define REX_PREFIX "0x48, " 22#define REX_PREFIX "0x48, "
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 767fe7e46d68..a2789e42e162 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2524,7 +2524,6 @@ static void irq_complete_move(struct irq_desc **descp)
2524static inline void irq_complete_move(struct irq_desc **descp) {} 2524static inline void irq_complete_move(struct irq_desc **descp) {}
2525#endif 2525#endif
2526 2526
2527#ifdef CONFIG_X86_X2APIC
2528static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg) 2527static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
2529{ 2528{
2530 int apic, pin; 2529 int apic, pin;
@@ -2558,6 +2557,7 @@ eoi_ioapic_irq(struct irq_desc *desc)
2558 spin_unlock_irqrestore(&ioapic_lock, flags); 2557 spin_unlock_irqrestore(&ioapic_lock, flags);
2559} 2558}
2560 2559
2560#ifdef CONFIG_X86_X2APIC
2561static void ack_x2apic_level(unsigned int irq) 2561static void ack_x2apic_level(unsigned int irq)
2562{ 2562{
2563 struct irq_desc *desc = irq_to_desc(irq); 2563 struct irq_desc *desc = irq_to_desc(irq);
@@ -2634,6 +2634,9 @@ static void ack_apic_level(unsigned int irq)
2634 */ 2634 */
2635 ack_APIC_irq(); 2635 ack_APIC_irq();
2636 2636
2637 if (irq_remapped(irq))
2638 eoi_ioapic_irq(desc);
2639
2637 /* Now we can move and renable the irq */ 2640 /* Now we can move and renable the irq */
2638 if (unlikely(do_unmask_irq)) { 2641 if (unlikely(do_unmask_irq)) {
2639 /* Only migrate the irq if the ack has been received. 2642 /* Only migrate the irq if the ack has been received.
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 9d3af380c6bd..837c2c4cc203 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -153,7 +153,8 @@ struct drv_cmd {
153 u32 val; 153 u32 val;
154}; 154};
155 155
156static long do_drv_read(void *_cmd) 156/* Called via smp_call_function_single(), on the target CPU */
157static void do_drv_read(void *_cmd)
157{ 158{
158 struct drv_cmd *cmd = _cmd; 159 struct drv_cmd *cmd = _cmd;
159 u32 h; 160 u32 h;
@@ -170,10 +171,10 @@ static long do_drv_read(void *_cmd)
170 default: 171 default:
171 break; 172 break;
172 } 173 }
173 return 0;
174} 174}
175 175
176static long do_drv_write(void *_cmd) 176/* Called via smp_call_function_many(), on the target CPUs */
177static void do_drv_write(void *_cmd)
177{ 178{
178 struct drv_cmd *cmd = _cmd; 179 struct drv_cmd *cmd = _cmd;
179 u32 lo, hi; 180 u32 lo, hi;
@@ -192,23 +193,18 @@ static long do_drv_write(void *_cmd)
192 default: 193 default:
193 break; 194 break;
194 } 195 }
195 return 0;
196} 196}
197 197
198static void drv_read(struct drv_cmd *cmd) 198static void drv_read(struct drv_cmd *cmd)
199{ 199{
200 cmd->val = 0; 200 cmd->val = 0;
201 201
202 work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd); 202 smp_call_function_single(cpumask_any(cmd->mask), do_drv_read, cmd, 1);
203} 203}
204 204
205static void drv_write(struct drv_cmd *cmd) 205static void drv_write(struct drv_cmd *cmd)
206{ 206{
207 unsigned int i; 207 smp_call_function_many(cmd->mask, do_drv_write, cmd, 1);
208
209 for_each_cpu(i, cmd->mask) {
210 work_on_cpu(i, do_drv_write, cmd);
211 }
212} 208}
213 209
214static u32 get_cur_val(const struct cpumask *mask) 210static u32 get_cur_val(const struct cpumask *mask)
@@ -252,15 +248,13 @@ struct perf_pair {
252 } aperf, mperf; 248 } aperf, mperf;
253}; 249};
254 250
255 251/* Called via smp_call_function_single(), on the target CPU */
256static long read_measured_perf_ctrs(void *_cur) 252static void read_measured_perf_ctrs(void *_cur)
257{ 253{
258 struct perf_pair *cur = _cur; 254 struct perf_pair *cur = _cur;
259 255
260 rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi); 256 rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi);
261 rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi); 257 rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);
262
263 return 0;
264} 258}
265 259
266/* 260/*
@@ -283,7 +277,7 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,
283 unsigned int perf_percent; 277 unsigned int perf_percent;
284 unsigned int retval; 278 unsigned int retval;
285 279
286 if (!work_on_cpu(cpu, read_measured_perf_ctrs, &readin)) 280 if (smp_call_function_single(cpu, read_measured_perf_ctrs, &readin, 1))
287 return 0; 281 return 0;
288 282
289 cur.aperf.whole = readin.aperf.whole - 283 cur.aperf.whole = readin.aperf.whole -
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index dce99dca6cf8..70fd7e414c15 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -679,7 +679,7 @@ void __init get_smp_config(void)
679 __get_smp_config(0); 679 __get_smp_config(0);
680} 680}
681 681
682static void smp_reserve_bootmem(struct mpf_intel *mpf) 682static void __init smp_reserve_bootmem(struct mpf_intel *mpf)
683{ 683{
684 unsigned long size = get_mpc_size(mpf->physptr); 684 unsigned long size = get_mpc_size(mpf->physptr);
685#ifdef CONFIG_X86_32 685#ifdef CONFIG_X86_32
@@ -838,7 +838,7 @@ static int __init get_MP_intsrc_index(struct mpc_intsrc *m)
838 838
839static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM]; 839static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
840 840
841static void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) 841static void __init check_irq_src(struct mpc_intsrc *m, int *nr_m_spare)
842{ 842{
843 int i; 843 int i;
844 844
@@ -866,7 +866,8 @@ static void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare)
866 } 866 }
867} 867}
868#else /* CONFIG_X86_IO_APIC */ 868#else /* CONFIG_X86_IO_APIC */
869static inline void check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) {} 869static
870inline void __init check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) {}
870#endif /* CONFIG_X86_IO_APIC */ 871#endif /* CONFIG_X86_IO_APIC */
871 872
872static int check_slot(unsigned long mpc_new_phys, unsigned long mpc_new_length, 873static int check_slot(unsigned long mpc_new_phys, unsigned long mpc_new_length,
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 2b54fe002e94..0a5b04aa98f1 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -324,7 +324,7 @@ void __ref xsave_cntxt_init(void)
324 } 324 }
325 325
326 /* 326 /*
327 * for now OS knows only about FP/SSE 327 * Support only the state known to OS.
328 */ 328 */
329 pcntxt_mask = pcntxt_mask & XCNTXT_MASK; 329 pcntxt_mask = pcntxt_mask & XCNTXT_MASK;
330 xsave_init(); 330 xsave_init();
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
index be54176e9eb2..6340cef6798a 100644
--- a/arch/x86/mm/gup.c
+++ b/arch/x86/mm/gup.c
@@ -219,6 +219,22 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
219 return 1; 219 return 1;
220} 220}
221 221
222/**
223 * get_user_pages_fast() - pin user pages in memory
224 * @start: starting user address
225 * @nr_pages: number of pages from start to pin
226 * @write: whether pages will be written to
227 * @pages: array that receives pointers to the pages pinned.
228 * Should be at least nr_pages long.
229 *
230 * Attempt to pin user pages in memory without taking mm->mmap_sem.
231 * If not successful, it will fall back to taking the lock and
232 * calling get_user_pages().
233 *
234 * Returns number of pages pinned. This may be fewer than the number
235 * requested. If nr_pages is 0 or negative, returns 0. If no pages
236 * were pinned, returns -errno.
237 */
222int get_user_pages_fast(unsigned long start, int nr_pages, int write, 238int get_user_pages_fast(unsigned long start, int nr_pages, int write,
223 struct page **pages) 239 struct page **pages)
224{ 240{
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 0dfa09d69e80..09daebfdb11c 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -547,7 +547,7 @@ void __init early_ioremap_reset(void)
547} 547}
548 548
549static void __init __early_set_fixmap(enum fixed_addresses idx, 549static void __init __early_set_fixmap(enum fixed_addresses idx,
550 unsigned long phys, pgprot_t flags) 550 phys_addr_t phys, pgprot_t flags)
551{ 551{
552 unsigned long addr = __fix_to_virt(idx); 552 unsigned long addr = __fix_to_virt(idx);
553 pte_t *pte; 553 pte_t *pte;
@@ -566,7 +566,7 @@ static void __init __early_set_fixmap(enum fixed_addresses idx,
566} 566}
567 567
568static inline void __init early_set_fixmap(enum fixed_addresses idx, 568static inline void __init early_set_fixmap(enum fixed_addresses idx,
569 unsigned long phys, pgprot_t prot) 569 phys_addr_t phys, pgprot_t prot)
570{ 570{
571 if (after_paging_init) 571 if (after_paging_init)
572 __set_fixmap(idx, phys, prot); 572 __set_fixmap(idx, phys, prot);
@@ -607,9 +607,10 @@ static int __init check_early_ioremap_leak(void)
607late_initcall(check_early_ioremap_leak); 607late_initcall(check_early_ioremap_leak);
608 608
609static void __init __iomem * 609static void __init __iomem *
610__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) 610__early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
611{ 611{
612 unsigned long offset, last_addr; 612 unsigned long offset;
613 resource_size_t last_addr;
613 unsigned int nrpages; 614 unsigned int nrpages;
614 enum fixed_addresses idx0, idx; 615 enum fixed_addresses idx0, idx;
615 int i, slot; 616 int i, slot;
@@ -625,15 +626,15 @@ __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
625 } 626 }
626 627
627 if (slot < 0) { 628 if (slot < 0) {
628 printk(KERN_INFO "early_iomap(%08lx, %08lx) not found slot\n", 629 printk(KERN_INFO "early_iomap(%08llx, %08lx) not found slot\n",
629 phys_addr, size); 630 (u64)phys_addr, size);
630 WARN_ON(1); 631 WARN_ON(1);
631 return NULL; 632 return NULL;
632 } 633 }
633 634
634 if (early_ioremap_debug) { 635 if (early_ioremap_debug) {
635 printk(KERN_INFO "early_ioremap(%08lx, %08lx) [%d] => ", 636 printk(KERN_INFO "early_ioremap(%08llx, %08lx) [%d] => ",
636 phys_addr, size, slot); 637 (u64)phys_addr, size, slot);
637 dump_stack(); 638 dump_stack();
638 } 639 }
639 640
@@ -680,13 +681,15 @@ __early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
680} 681}
681 682
682/* Remap an IO device */ 683/* Remap an IO device */
683void __init __iomem *early_ioremap(unsigned long phys_addr, unsigned long size) 684void __init __iomem *
685early_ioremap(resource_size_t phys_addr, unsigned long size)
684{ 686{
685 return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO); 687 return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO);
686} 688}
687 689
688/* Remap memory */ 690/* Remap memory */
689void __init __iomem *early_memremap(unsigned long phys_addr, unsigned long size) 691void __init __iomem *
692early_memremap(resource_size_t phys_addr, unsigned long size)
690{ 693{
691 return __early_ioremap(phys_addr, size, PAGE_KERNEL); 694 return __early_ioremap(phys_addr, size, PAGE_KERNEL);
692} 695}
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 640339ee4fb2..c009a241d562 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -31,7 +31,7 @@
31#ifdef CONFIG_X86_PAT 31#ifdef CONFIG_X86_PAT
32int __read_mostly pat_enabled = 1; 32int __read_mostly pat_enabled = 1;
33 33
34void __cpuinit pat_disable(const char *reason) 34static inline void pat_disable(const char *reason)
35{ 35{
36 pat_enabled = 0; 36 pat_enabled = 0;
37 printk(KERN_INFO "%s\n", reason); 37 printk(KERN_INFO "%s\n", reason);
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 82cd39a6cbd3..f09e8c36ee80 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -42,6 +42,7 @@
42#include <asm/xen/hypervisor.h> 42#include <asm/xen/hypervisor.h>
43#include <asm/fixmap.h> 43#include <asm/fixmap.h>
44#include <asm/processor.h> 44#include <asm/processor.h>
45#include <asm/proto.h>
45#include <asm/msr-index.h> 46#include <asm/msr-index.h>
46#include <asm/setup.h> 47#include <asm/setup.h>
47#include <asm/desc.h> 48#include <asm/desc.h>
@@ -168,21 +169,23 @@ static void __init xen_banner(void)
168 xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : ""); 169 xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : "");
169} 170}
170 171
172static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
173static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
174
171static void xen_cpuid(unsigned int *ax, unsigned int *bx, 175static void xen_cpuid(unsigned int *ax, unsigned int *bx,
172 unsigned int *cx, unsigned int *dx) 176 unsigned int *cx, unsigned int *dx)
173{ 177{
178 unsigned maskecx = ~0;
174 unsigned maskedx = ~0; 179 unsigned maskedx = ~0;
175 180
176 /* 181 /*
177 * Mask out inconvenient features, to try and disable as many 182 * Mask out inconvenient features, to try and disable as many
178 * unsupported kernel subsystems as possible. 183 * unsupported kernel subsystems as possible.
179 */ 184 */
180 if (*ax == 1) 185 if (*ax == 1) {
181 maskedx = ~((1 << X86_FEATURE_APIC) | /* disable APIC */ 186 maskecx = cpuid_leaf1_ecx_mask;
182 (1 << X86_FEATURE_ACPI) | /* disable ACPI */ 187 maskedx = cpuid_leaf1_edx_mask;
183 (1 << X86_FEATURE_MCE) | /* disable MCE */ 188 }
184 (1 << X86_FEATURE_MCA) | /* disable MCA */
185 (1 << X86_FEATURE_ACC)); /* thermal monitoring */
186 189
187 asm(XEN_EMULATE_PREFIX "cpuid" 190 asm(XEN_EMULATE_PREFIX "cpuid"
188 : "=a" (*ax), 191 : "=a" (*ax),
@@ -190,9 +193,43 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
190 "=c" (*cx), 193 "=c" (*cx),
191 "=d" (*dx) 194 "=d" (*dx)
192 : "0" (*ax), "2" (*cx)); 195 : "0" (*ax), "2" (*cx));
196
197 *cx &= maskecx;
193 *dx &= maskedx; 198 *dx &= maskedx;
194} 199}
195 200
201static __init void xen_init_cpuid_mask(void)
202{
203 unsigned int ax, bx, cx, dx;
204
205 cpuid_leaf1_edx_mask =
206 ~((1 << X86_FEATURE_MCE) | /* disable MCE */
207 (1 << X86_FEATURE_MCA) | /* disable MCA */
208 (1 << X86_FEATURE_ACC)); /* thermal monitoring */
209
210 if (!xen_initial_domain())
211 cpuid_leaf1_edx_mask &=
212 ~((1 << X86_FEATURE_APIC) | /* disable local APIC */
213 (1 << X86_FEATURE_ACPI)); /* disable ACPI */
214
215 ax = 1;
216 xen_cpuid(&ax, &bx, &cx, &dx);
217
218 /* cpuid claims we support xsave; try enabling it to see what happens */
219 if (cx & (1 << (X86_FEATURE_XSAVE % 32))) {
220 unsigned long cr4;
221
222 set_in_cr4(X86_CR4_OSXSAVE);
223
224 cr4 = read_cr4();
225
226 if ((cr4 & X86_CR4_OSXSAVE) == 0)
227 cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_XSAVE % 32));
228
229 clear_in_cr4(X86_CR4_OSXSAVE);
230 }
231}
232
196static void xen_set_debugreg(int reg, unsigned long val) 233static void xen_set_debugreg(int reg, unsigned long val)
197{ 234{
198 HYPERVISOR_set_debugreg(reg, val); 235 HYPERVISOR_set_debugreg(reg, val);
@@ -284,12 +321,11 @@ static void xen_set_ldt(const void *addr, unsigned entries)
284 321
285static void xen_load_gdt(const struct desc_ptr *dtr) 322static void xen_load_gdt(const struct desc_ptr *dtr)
286{ 323{
287 unsigned long *frames;
288 unsigned long va = dtr->address; 324 unsigned long va = dtr->address;
289 unsigned int size = dtr->size + 1; 325 unsigned int size = dtr->size + 1;
290 unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; 326 unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE;
327 unsigned long frames[pages];
291 int f; 328 int f;
292 struct multicall_space mcs;
293 329
294 /* A GDT can be up to 64k in size, which corresponds to 8192 330 /* A GDT can be up to 64k in size, which corresponds to 8192
295 8-byte entries, or 16 4k pages.. */ 331 8-byte entries, or 16 4k pages.. */
@@ -297,19 +333,26 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
297 BUG_ON(size > 65536); 333 BUG_ON(size > 65536);
298 BUG_ON(va & ~PAGE_MASK); 334 BUG_ON(va & ~PAGE_MASK);
299 335
300 mcs = xen_mc_entry(sizeof(*frames) * pages);
301 frames = mcs.args;
302
303 for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) { 336 for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
304 frames[f] = arbitrary_virt_to_mfn((void *)va); 337 int level;
338 pte_t *ptep = lookup_address(va, &level);
339 unsigned long pfn, mfn;
340 void *virt;
341
342 BUG_ON(ptep == NULL);
343
344 pfn = pte_pfn(*ptep);
345 mfn = pfn_to_mfn(pfn);
346 virt = __va(PFN_PHYS(pfn));
347
348 frames[f] = mfn;
305 349
306 make_lowmem_page_readonly((void *)va); 350 make_lowmem_page_readonly((void *)va);
307 make_lowmem_page_readonly(mfn_to_virt(frames[f])); 351 make_lowmem_page_readonly(virt);
308 } 352 }
309 353
310 MULTI_set_gdt(mcs.mc, frames, size / sizeof(struct desc_struct)); 354 if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct)))
311 355 BUG();
312 xen_mc_issue(PARAVIRT_LAZY_CPU);
313} 356}
314 357
315static void load_TLS_descriptor(struct thread_struct *t, 358static void load_TLS_descriptor(struct thread_struct *t,
@@ -385,7 +428,7 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
385static int cvt_gate_to_trap(int vector, const gate_desc *val, 428static int cvt_gate_to_trap(int vector, const gate_desc *val,
386 struct trap_info *info) 429 struct trap_info *info)
387{ 430{
388 if (val->type != 0xf && val->type != 0xe) 431 if (val->type != GATE_TRAP && val->type != GATE_INTERRUPT)
389 return 0; 432 return 0;
390 433
391 info->vector = vector; 434 info->vector = vector;
@@ -393,8 +436,8 @@ static int cvt_gate_to_trap(int vector, const gate_desc *val,
393 info->cs = gate_segment(*val); 436 info->cs = gate_segment(*val);
394 info->flags = val->dpl; 437 info->flags = val->dpl;
395 /* interrupt gates clear IF */ 438 /* interrupt gates clear IF */
396 if (val->type == 0xe) 439 if (val->type == GATE_INTERRUPT)
397 info->flags |= 4; 440 info->flags |= 1 << 2;
398 441
399 return 1; 442 return 1;
400} 443}
@@ -872,7 +915,6 @@ static const struct machine_ops __initdata xen_machine_ops = {
872 .emergency_restart = xen_emergency_restart, 915 .emergency_restart = xen_emergency_restart,
873}; 916};
874 917
875
876/* First C function to be called on Xen boot */ 918/* First C function to be called on Xen boot */
877asmlinkage void __init xen_start_kernel(void) 919asmlinkage void __init xen_start_kernel(void)
878{ 920{
@@ -897,6 +939,8 @@ asmlinkage void __init xen_start_kernel(void)
897 939
898 xen_init_irq_ops(); 940 xen_init_irq_ops();
899 941
942 xen_init_cpuid_mask();
943
900#ifdef CONFIG_X86_LOCAL_APIC 944#ifdef CONFIG_X86_LOCAL_APIC
901 /* 945 /*
902 * set up the basic apic ops. 946 * set up the basic apic ops.
@@ -938,6 +982,11 @@ asmlinkage void __init xen_start_kernel(void)
938 if (!xen_initial_domain()) 982 if (!xen_initial_domain())
939 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); 983 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
940 984
985#ifdef CONFIG_X86_64
986 /* Work out if we support NX */
987 check_efer();
988#endif
989
941 /* Don't do the full vcpu_info placement stuff until we have a 990 /* Don't do the full vcpu_info placement stuff until we have a
942 possible map and a non-dummy shared_info. */ 991 possible map and a non-dummy shared_info. */
943 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; 992 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 2a81838a9ab7..9842b1212407 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -184,7 +184,7 @@ static inline unsigned p2m_index(unsigned long pfn)
184} 184}
185 185
186/* Build the parallel p2m_top_mfn structures */ 186/* Build the parallel p2m_top_mfn structures */
187void xen_setup_mfn_list_list(void) 187static void __init xen_build_mfn_list_list(void)
188{ 188{
189 unsigned pfn, idx; 189 unsigned pfn, idx;
190 190
@@ -198,7 +198,10 @@ void xen_setup_mfn_list_list(void)
198 unsigned topidx = idx * P2M_ENTRIES_PER_PAGE; 198 unsigned topidx = idx * P2M_ENTRIES_PER_PAGE;
199 p2m_top_mfn_list[idx] = virt_to_mfn(&p2m_top_mfn[topidx]); 199 p2m_top_mfn_list[idx] = virt_to_mfn(&p2m_top_mfn[topidx]);
200 } 200 }
201}
201 202
203void xen_setup_mfn_list_list(void)
204{
202 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info); 205 BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
203 206
204 HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = 207 HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list =
@@ -218,6 +221,8 @@ void __init xen_build_dynamic_phys_to_machine(void)
218 221
219 p2m_top[topidx] = &mfn_list[pfn]; 222 p2m_top[topidx] = &mfn_list[pfn];
220 } 223 }
224
225 xen_build_mfn_list_list();
221} 226}
222 227
223unsigned long get_phys_to_machine(unsigned long pfn) 228unsigned long get_phys_to_machine(unsigned long pfn)
@@ -233,47 +238,74 @@ unsigned long get_phys_to_machine(unsigned long pfn)
233} 238}
234EXPORT_SYMBOL_GPL(get_phys_to_machine); 239EXPORT_SYMBOL_GPL(get_phys_to_machine);
235 240
236static void alloc_p2m(unsigned long **pp, unsigned long *mfnp) 241/* install a new p2m_top page */
242bool install_p2mtop_page(unsigned long pfn, unsigned long *p)
237{ 243{
238 unsigned long *p; 244 unsigned topidx = p2m_top_index(pfn);
245 unsigned long **pfnp, *mfnp;
239 unsigned i; 246 unsigned i;
240 247
241 p = (void *)__get_free_page(GFP_KERNEL | __GFP_NOFAIL); 248 pfnp = &p2m_top[topidx];
242 BUG_ON(p == NULL); 249 mfnp = &p2m_top_mfn[topidx];
243 250
244 for (i = 0; i < P2M_ENTRIES_PER_PAGE; i++) 251 for (i = 0; i < P2M_ENTRIES_PER_PAGE; i++)
245 p[i] = INVALID_P2M_ENTRY; 252 p[i] = INVALID_P2M_ENTRY;
246 253
247 if (cmpxchg(pp, p2m_missing, p) != p2m_missing) 254 if (cmpxchg(pfnp, p2m_missing, p) == p2m_missing) {
248 free_page((unsigned long)p);
249 else
250 *mfnp = virt_to_mfn(p); 255 *mfnp = virt_to_mfn(p);
256 return true;
257 }
258
259 return false;
251} 260}
252 261
253void set_phys_to_machine(unsigned long pfn, unsigned long mfn) 262static void alloc_p2m(unsigned long pfn)
254{ 263{
255 unsigned topidx, idx; 264 unsigned long *p;
256 265
257 if (unlikely(xen_feature(XENFEAT_auto_translated_physmap))) { 266 p = (void *)__get_free_page(GFP_KERNEL | __GFP_NOFAIL);
258 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY); 267 BUG_ON(p == NULL);
259 return; 268
260 } 269 if (!install_p2mtop_page(pfn, p))
270 free_page((unsigned long)p);
271}
272
273/* Try to install p2m mapping; fail if intermediate bits missing */
274bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
275{
276 unsigned topidx, idx;
261 277
262 if (unlikely(pfn >= MAX_DOMAIN_PAGES)) { 278 if (unlikely(pfn >= MAX_DOMAIN_PAGES)) {
263 BUG_ON(mfn != INVALID_P2M_ENTRY); 279 BUG_ON(mfn != INVALID_P2M_ENTRY);
264 return; 280 return true;
265 } 281 }
266 282
267 topidx = p2m_top_index(pfn); 283 topidx = p2m_top_index(pfn);
268 if (p2m_top[topidx] == p2m_missing) { 284 if (p2m_top[topidx] == p2m_missing) {
269 /* no need to allocate a page to store an invalid entry */
270 if (mfn == INVALID_P2M_ENTRY) 285 if (mfn == INVALID_P2M_ENTRY)
271 return; 286 return true;
272 alloc_p2m(&p2m_top[topidx], &p2m_top_mfn[topidx]); 287 return false;
273 } 288 }
274 289
275 idx = p2m_index(pfn); 290 idx = p2m_index(pfn);
276 p2m_top[topidx][idx] = mfn; 291 p2m_top[topidx][idx] = mfn;
292
293 return true;
294}
295
296void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
297{
298 if (unlikely(xen_feature(XENFEAT_auto_translated_physmap))) {
299 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
300 return;
301 }
302
303 if (unlikely(!__set_phys_to_machine(pfn, mfn))) {
304 alloc_p2m(pfn);
305
306 if (!__set_phys_to_machine(pfn, mfn))
307 BUG();
308 }
277} 309}
278 310
279unsigned long arbitrary_virt_to_mfn(void *vaddr) 311unsigned long arbitrary_virt_to_mfn(void *vaddr)
@@ -987,7 +1019,7 @@ static __init int xen_mark_pinned(struct mm_struct *mm, struct page *page,
987 return 0; 1019 return 0;
988} 1020}
989 1021
990void __init xen_mark_init_mm_pinned(void) 1022static void __init xen_mark_init_mm_pinned(void)
991{ 1023{
992 xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP); 1024 xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP);
993} 1025}
@@ -1270,8 +1302,8 @@ static void xen_flush_tlb_others(const struct cpumask *cpus,
1270 } *args; 1302 } *args;
1271 struct multicall_space mcs; 1303 struct multicall_space mcs;
1272 1304
1273 BUG_ON(cpumask_empty(cpus)); 1305 if (cpumask_empty(cpus))
1274 BUG_ON(!mm); 1306 return; /* nothing to do */
1275 1307
1276 mcs = xen_mc_entry(sizeof(*args)); 1308 mcs = xen_mc_entry(sizeof(*args));
1277 args = mcs.args; 1309 args = mcs.args;
@@ -1438,6 +1470,15 @@ static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)
1438} 1470}
1439#endif 1471#endif
1440 1472
1473static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
1474{
1475 struct mmuext_op op;
1476 op.cmd = cmd;
1477 op.arg1.mfn = pfn_to_mfn(pfn);
1478 if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
1479 BUG();
1480}
1481
1441/* Early in boot, while setting up the initial pagetable, assume 1482/* Early in boot, while setting up the initial pagetable, assume
1442 everything is pinned. */ 1483 everything is pinned. */
1443static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn) 1484static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
@@ -1446,22 +1487,29 @@ static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
1446 BUG_ON(mem_map); /* should only be used early */ 1487 BUG_ON(mem_map); /* should only be used early */
1447#endif 1488#endif
1448 make_lowmem_page_readonly(__va(PFN_PHYS(pfn))); 1489 make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
1490 pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn);
1491}
1492
1493/* Used for pmd and pud */
1494static __init void xen_alloc_pmd_init(struct mm_struct *mm, unsigned long pfn)
1495{
1496#ifdef CONFIG_FLATMEM
1497 BUG_ON(mem_map); /* should only be used early */
1498#endif
1499 make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
1449} 1500}
1450 1501
1451/* Early release_pte assumes that all pts are pinned, since there's 1502/* Early release_pte assumes that all pts are pinned, since there's
1452 only init_mm and anything attached to that is pinned. */ 1503 only init_mm and anything attached to that is pinned. */
1453static void xen_release_pte_init(unsigned long pfn) 1504static __init void xen_release_pte_init(unsigned long pfn)
1454{ 1505{
1506 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
1455 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn))); 1507 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
1456} 1508}
1457 1509
1458static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn) 1510static __init void xen_release_pmd_init(unsigned long pfn)
1459{ 1511{
1460 struct mmuext_op op; 1512 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
1461 op.cmd = cmd;
1462 op.arg1.mfn = pfn_to_mfn(pfn);
1463 if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
1464 BUG();
1465} 1513}
1466 1514
1467/* This needs to make sure the new pte page is pinned iff its being 1515/* This needs to make sure the new pte page is pinned iff its being
@@ -1773,6 +1821,9 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot)
1773#ifdef CONFIG_X86_LOCAL_APIC 1821#ifdef CONFIG_X86_LOCAL_APIC
1774 case FIX_APIC_BASE: /* maps dummy local APIC */ 1822 case FIX_APIC_BASE: /* maps dummy local APIC */
1775#endif 1823#endif
1824 case FIX_TEXT_POKE0:
1825 case FIX_TEXT_POKE1:
1826 /* All local page mappings */
1776 pte = pfn_pte(phys, prot); 1827 pte = pfn_pte(phys, prot);
1777 break; 1828 break;
1778 1829
@@ -1819,7 +1870,6 @@ __init void xen_post_allocator_init(void)
1819 xen_mark_init_mm_pinned(); 1870 xen_mark_init_mm_pinned();
1820} 1871}
1821 1872
1822
1823const struct pv_mmu_ops xen_mmu_ops __initdata = { 1873const struct pv_mmu_ops xen_mmu_ops __initdata = {
1824 .pagetable_setup_start = xen_pagetable_setup_start, 1874 .pagetable_setup_start = xen_pagetable_setup_start,
1825 .pagetable_setup_done = xen_pagetable_setup_done, 1875 .pagetable_setup_done = xen_pagetable_setup_done,
@@ -1843,9 +1893,9 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = {
1843 1893
1844 .alloc_pte = xen_alloc_pte_init, 1894 .alloc_pte = xen_alloc_pte_init,
1845 .release_pte = xen_release_pte_init, 1895 .release_pte = xen_release_pte_init,
1846 .alloc_pmd = xen_alloc_pte_init, 1896 .alloc_pmd = xen_alloc_pmd_init,
1847 .alloc_pmd_clone = paravirt_nop, 1897 .alloc_pmd_clone = paravirt_nop,
1848 .release_pmd = xen_release_pte_init, 1898 .release_pmd = xen_release_pmd_init,
1849 1899
1850#ifdef CONFIG_HIGHPTE 1900#ifdef CONFIG_HIGHPTE
1851 .kmap_atomic_pte = xen_kmap_atomic_pte, 1901 .kmap_atomic_pte = xen_kmap_atomic_pte,
@@ -1883,8 +1933,8 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = {
1883 .make_pud = PV_CALLEE_SAVE(xen_make_pud), 1933 .make_pud = PV_CALLEE_SAVE(xen_make_pud),
1884 .set_pgd = xen_set_pgd_hyper, 1934 .set_pgd = xen_set_pgd_hyper,
1885 1935
1886 .alloc_pud = xen_alloc_pte_init, 1936 .alloc_pud = xen_alloc_pmd_init,
1887 .release_pud = xen_release_pte_init, 1937 .release_pud = xen_release_pmd_init,
1888#endif /* PAGETABLE_LEVELS == 4 */ 1938#endif /* PAGETABLE_LEVELS == 4 */
1889 1939
1890 .activate_mm = xen_activate_mm, 1940 .activate_mm = xen_activate_mm,
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index 24d1b44a337d..da7302624897 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -11,6 +11,9 @@ enum pt_level {
11}; 11};
12 12
13 13
14bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
15bool install_p2mtop_page(unsigned long pfn, unsigned long *p);
16
14void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); 17void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
15 18
16 19
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 585a6e330837..429834ec1687 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -317,7 +317,7 @@ static int __cpuinit xen_cpu_up(unsigned int cpu)
317 BUG_ON(rc); 317 BUG_ON(rc);
318 318
319 while(per_cpu(cpu_state, cpu) != CPU_ONLINE) { 319 while(per_cpu(cpu_state, cpu) != CPU_ONLINE) {
320 HYPERVISOR_sched_op(SCHEDOP_yield, 0); 320 HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
321 barrier(); 321 barrier();
322 } 322 }
323 323
@@ -422,7 +422,7 @@ static void xen_smp_send_call_function_ipi(const struct cpumask *mask)
422 /* Make sure other vcpus get a chance to run if they need to. */ 422 /* Make sure other vcpus get a chance to run if they need to. */
423 for_each_cpu(cpu, mask) { 423 for_each_cpu(cpu, mask) {
424 if (xen_vcpu_stolen(cpu)) { 424 if (xen_vcpu_stolen(cpu)) {
425 HYPERVISOR_sched_op(SCHEDOP_yield, 0); 425 HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
426 break; 426 break;
427 } 427 }
428 } 428 }
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 2f5ef2632ea2..20139464943c 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -57,8 +57,6 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
57 57
58bool xen_vcpu_stolen(int vcpu); 58bool xen_vcpu_stolen(int vcpu);
59 59
60void xen_mark_init_mm_pinned(void);
61
62void xen_setup_vcpu_info_placement(void); 60void xen_setup_vcpu_info_placement(void);
63 61
64#ifdef CONFIG_SMP 62#ifdef CONFIG_SMP
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 57be6bea48eb..08186ecbaf8d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -114,6 +114,7 @@ enum {
114 board_ahci_sb700 = 5, /* for SB700 and SB800 */ 114 board_ahci_sb700 = 5, /* for SB700 and SB800 */
115 board_ahci_mcp65 = 6, 115 board_ahci_mcp65 = 6,
116 board_ahci_nopmp = 7, 116 board_ahci_nopmp = 7,
117 board_ahci_yesncq = 8,
117 118
118 /* global controller registers */ 119 /* global controller registers */
119 HOST_CAP = 0x00, /* host capabilities */ 120 HOST_CAP = 0x00, /* host capabilities */
@@ -469,6 +470,14 @@ static const struct ata_port_info ahci_port_info[] = {
469 .udma_mask = ATA_UDMA6, 470 .udma_mask = ATA_UDMA6,
470 .port_ops = &ahci_ops, 471 .port_ops = &ahci_ops,
471 }, 472 },
473 /* board_ahci_yesncq */
474 {
475 AHCI_HFLAGS (AHCI_HFLAG_YES_NCQ),
476 .flags = AHCI_FLAG_COMMON,
477 .pio_mask = ATA_PIO4,
478 .udma_mask = ATA_UDMA6,
479 .port_ops = &ahci_ops,
480 },
472}; 481};
473 482
474static const struct pci_device_id ahci_pci_tbl[] = { 483static const struct pci_device_id ahci_pci_tbl[] = {
@@ -535,30 +544,30 @@ static const struct pci_device_id ahci_pci_tbl[] = {
535 { PCI_VDEVICE(NVIDIA, 0x045d), board_ahci_mcp65 }, /* MCP65 */ 544 { PCI_VDEVICE(NVIDIA, 0x045d), board_ahci_mcp65 }, /* MCP65 */
536 { PCI_VDEVICE(NVIDIA, 0x045e), board_ahci_mcp65 }, /* MCP65 */ 545 { PCI_VDEVICE(NVIDIA, 0x045e), board_ahci_mcp65 }, /* MCP65 */
537 { PCI_VDEVICE(NVIDIA, 0x045f), board_ahci_mcp65 }, /* MCP65 */ 546 { PCI_VDEVICE(NVIDIA, 0x045f), board_ahci_mcp65 }, /* MCP65 */
538 { PCI_VDEVICE(NVIDIA, 0x0550), board_ahci }, /* MCP67 */ 547 { PCI_VDEVICE(NVIDIA, 0x0550), board_ahci_yesncq }, /* MCP67 */
539 { PCI_VDEVICE(NVIDIA, 0x0551), board_ahci }, /* MCP67 */ 548 { PCI_VDEVICE(NVIDIA, 0x0551), board_ahci_yesncq }, /* MCP67 */
540 { PCI_VDEVICE(NVIDIA, 0x0552), board_ahci }, /* MCP67 */ 549 { PCI_VDEVICE(NVIDIA, 0x0552), board_ahci_yesncq }, /* MCP67 */
541 { PCI_VDEVICE(NVIDIA, 0x0553), board_ahci }, /* MCP67 */ 550 { PCI_VDEVICE(NVIDIA, 0x0553), board_ahci_yesncq }, /* MCP67 */
542 { PCI_VDEVICE(NVIDIA, 0x0554), board_ahci }, /* MCP67 */ 551 { PCI_VDEVICE(NVIDIA, 0x0554), board_ahci_yesncq }, /* MCP67 */
543 { PCI_VDEVICE(NVIDIA, 0x0555), board_ahci }, /* MCP67 */ 552 { PCI_VDEVICE(NVIDIA, 0x0555), board_ahci_yesncq }, /* MCP67 */
544 { PCI_VDEVICE(NVIDIA, 0x0556), board_ahci }, /* MCP67 */ 553 { PCI_VDEVICE(NVIDIA, 0x0556), board_ahci_yesncq }, /* MCP67 */
545 { PCI_VDEVICE(NVIDIA, 0x0557), board_ahci }, /* MCP67 */ 554 { PCI_VDEVICE(NVIDIA, 0x0557), board_ahci_yesncq }, /* MCP67 */
546 { PCI_VDEVICE(NVIDIA, 0x0558), board_ahci }, /* MCP67 */ 555 { PCI_VDEVICE(NVIDIA, 0x0558), board_ahci_yesncq }, /* MCP67 */
547 { PCI_VDEVICE(NVIDIA, 0x0559), board_ahci }, /* MCP67 */ 556 { PCI_VDEVICE(NVIDIA, 0x0559), board_ahci_yesncq }, /* MCP67 */
548 { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci }, /* MCP67 */ 557 { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci_yesncq }, /* MCP67 */
549 { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci }, /* MCP67 */ 558 { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci_yesncq }, /* MCP67 */
550 { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci }, /* MCP73 */ 559 { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci_yesncq }, /* MCP73 */
551 { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci }, /* MCP73 */ 560 { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci_yesncq }, /* MCP73 */
552 { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci }, /* MCP73 */ 561 { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci_yesncq }, /* MCP73 */
553 { PCI_VDEVICE(NVIDIA, 0x07f3), board_ahci }, /* MCP73 */ 562 { PCI_VDEVICE(NVIDIA, 0x07f3), board_ahci_yesncq }, /* MCP73 */
554 { PCI_VDEVICE(NVIDIA, 0x07f4), board_ahci }, /* MCP73 */ 563 { PCI_VDEVICE(NVIDIA, 0x07f4), board_ahci_yesncq }, /* MCP73 */
555 { PCI_VDEVICE(NVIDIA, 0x07f5), board_ahci }, /* MCP73 */ 564 { PCI_VDEVICE(NVIDIA, 0x07f5), board_ahci_yesncq }, /* MCP73 */
556 { PCI_VDEVICE(NVIDIA, 0x07f6), board_ahci }, /* MCP73 */ 565 { PCI_VDEVICE(NVIDIA, 0x07f6), board_ahci_yesncq }, /* MCP73 */
557 { PCI_VDEVICE(NVIDIA, 0x07f7), board_ahci }, /* MCP73 */ 566 { PCI_VDEVICE(NVIDIA, 0x07f7), board_ahci_yesncq }, /* MCP73 */
558 { PCI_VDEVICE(NVIDIA, 0x07f8), board_ahci }, /* MCP73 */ 567 { PCI_VDEVICE(NVIDIA, 0x07f8), board_ahci_yesncq }, /* MCP73 */
559 { PCI_VDEVICE(NVIDIA, 0x07f9), board_ahci }, /* MCP73 */ 568 { PCI_VDEVICE(NVIDIA, 0x07f9), board_ahci_yesncq }, /* MCP73 */
560 { PCI_VDEVICE(NVIDIA, 0x07fa), board_ahci }, /* MCP73 */ 569 { PCI_VDEVICE(NVIDIA, 0x07fa), board_ahci_yesncq }, /* MCP73 */
561 { PCI_VDEVICE(NVIDIA, 0x07fb), board_ahci }, /* MCP73 */ 570 { PCI_VDEVICE(NVIDIA, 0x07fb), board_ahci_yesncq }, /* MCP73 */
562 { PCI_VDEVICE(NVIDIA, 0x0ad0), board_ahci }, /* MCP77 */ 571 { PCI_VDEVICE(NVIDIA, 0x0ad0), board_ahci }, /* MCP77 */
563 { PCI_VDEVICE(NVIDIA, 0x0ad1), board_ahci }, /* MCP77 */ 572 { PCI_VDEVICE(NVIDIA, 0x0ad1), board_ahci }, /* MCP77 */
564 { PCI_VDEVICE(NVIDIA, 0x0ad2), board_ahci }, /* MCP77 */ 573 { PCI_VDEVICE(NVIDIA, 0x0ad2), board_ahci }, /* MCP77 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e7ea77cf6069..065507c46644 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6110,13 +6110,11 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
6110 ata_port_printk(ap, KERN_INFO, "DUMMY\n"); 6110 ata_port_printk(ap, KERN_INFO, "DUMMY\n");
6111 } 6111 }
6112 6112
6113 /* perform each probe synchronously */ 6113 /* perform each probe asynchronously */
6114 DPRINTK("probe begin\n");
6115 for (i = 0; i < host->n_ports; i++) { 6114 for (i = 0; i < host->n_ports; i++) {
6116 struct ata_port *ap = host->ports[i]; 6115 struct ata_port *ap = host->ports[i];
6117 async_schedule(async_port_probe, ap); 6116 async_schedule(async_port_probe, ap);
6118 } 6117 }
6119 DPRINTK("probe end\n");
6120 6118
6121 return 0; 6119 return 0;
6122} 6120}
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 98e8c50703b3..bdd43c7f432e 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -566,7 +566,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
566 static int printed_version; 566 static int printed_version;
567 unsigned int i; 567 unsigned int i;
568 int rc; 568 int rc;
569 struct ata_host *host; 569 struct ata_host *host = NULL;
570 int board_id = (int) ent->driver_data; 570 int board_id = (int) ent->driver_data;
571 const unsigned *bar_sizes; 571 const unsigned *bar_sizes;
572 572
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index be204308cc1b..9359613addc5 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -1059,7 +1059,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
1059 goto out; 1059 goto out;
1060 } 1060 }
1061 1061
1062 err = pci_set_dma_mask(dev, DMA_32BIT_MASK); 1062 err = pci_set_dma_mask(dev, DMA_BIT_MASK(32));
1063 if (err) { 1063 if (err) {
1064 dev_warn(&dev->dev, "Failed to set 32-bit DMA mask\n"); 1064 dev_warn(&dev->dev, "Failed to set 32-bit DMA mask\n");
1065 goto out; 1065 goto out;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 0ef6f08aa6ea..4d4d5e0d3fa6 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -3505,7 +3505,7 @@ static __devinit int cciss_message(struct pci_dev *pdev, unsigned char opcode, u
3505 /* The Inbound Post Queue only accepts 32-bit physical addresses for the 3505 /* The Inbound Post Queue only accepts 32-bit physical addresses for the
3506 CCISS commands, so they must be allocated from the lower 4GiB of 3506 CCISS commands, so they must be allocated from the lower 4GiB of
3507 memory. */ 3507 memory. */
3508 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 3508 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
3509 if (err) { 3509 if (err) {
3510 iounmap(vaddr); 3510 iounmap(vaddr);
3511 return -ENOMEM; 3511 return -ENOMEM;
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 9d9490e22e07..3686912427ba 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -2131,6 +2131,8 @@ static const struct intel_driver_description {
2131 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M", 2131 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M",
2132 &intel_845_driver, &intel_830_driver }, 2132 &intel_845_driver, &intel_830_driver },
2133 { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL }, 2133 { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL },
2134 { PCI_DEVICE_ID_INTEL_82854_HB, PCI_DEVICE_ID_INTEL_82854_IG, 0, "854",
2135 &intel_845_driver, &intel_830_driver },
2134 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL }, 2136 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL },
2135 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM", 2137 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM",
2136 &intel_845_driver, &intel_830_driver }, 2138 &intel_845_driver, &intel_830_driver },
@@ -2355,6 +2357,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
2355 ID(PCI_DEVICE_ID_INTEL_82845_HB), 2357 ID(PCI_DEVICE_ID_INTEL_82845_HB),
2356 ID(PCI_DEVICE_ID_INTEL_82845G_HB), 2358 ID(PCI_DEVICE_ID_INTEL_82845G_HB),
2357 ID(PCI_DEVICE_ID_INTEL_82850_HB), 2359 ID(PCI_DEVICE_ID_INTEL_82850_HB),
2360 ID(PCI_DEVICE_ID_INTEL_82854_HB),
2358 ID(PCI_DEVICE_ID_INTEL_82855PM_HB), 2361 ID(PCI_DEVICE_ID_INTEL_82855PM_HB),
2359 ID(PCI_DEVICE_ID_INTEL_82855GM_HB), 2362 ID(PCI_DEVICE_ID_INTEL_82855GM_HB),
2360 ID(PCI_DEVICE_ID_INTEL_82860_HB), 2363 ID(PCI_DEVICE_ID_INTEL_82860_HB),
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 6de020d078e1..b0a6a3e51924 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -35,7 +35,6 @@
35#include <linux/vt_kern.h> 35#include <linux/vt_kern.h>
36#include <linux/workqueue.h> 36#include <linux/workqueue.h>
37#include <linux/kexec.h> 37#include <linux/kexec.h>
38#include <linux/interrupt.h>
39#include <linux/hrtimer.h> 38#include <linux/hrtimer.h>
40#include <linux/oom.h> 39#include <linux/oom.h>
41 40
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 28f2c3f959b5..6ad95c8d6363 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -767,11 +767,19 @@ static inline void pci_write_bits16(struct pci_dev *pdev, int offset,
767 pci_write_config_word(pdev, offset, value); 767 pci_write_config_word(pdev, offset, value);
768} 768}
769 769
770/* write all or some bits in a dword-register*/ 770/*
771 * pci_write_bits32
772 *
773 * edac local routine to do pci_write_config_dword, but adds
774 * a mask parameter. If mask is all ones, ignore the mask.
775 * Otherwise utilize the mask to isolate specified bits
776 *
777 * write all or some bits in a dword-register
778 */
771static inline void pci_write_bits32(struct pci_dev *pdev, int offset, 779static inline void pci_write_bits32(struct pci_dev *pdev, int offset,
772 u32 value, u32 mask) 780 u32 value, u32 mask)
773{ 781{
774 if (mask != 0xffff) { 782 if (mask != 0xffffffff) {
775 u32 buf; 783 u32 buf;
776 784
777 pci_read_config_dword(pdev, offset, &buf); 785 pci_read_config_dword(pdev, offset, &buf);
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index ca9113e1c106..a7d2c717d033 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -389,7 +389,7 @@ static void del_edac_device_from_global_list(struct edac_device_ctl_info
389 */ 389 */
390static void edac_device_workq_function(struct work_struct *work_req) 390static void edac_device_workq_function(struct work_struct *work_req)
391{ 391{
392 struct delayed_work *d_work = (struct delayed_work *)work_req; 392 struct delayed_work *d_work = to_delayed_work(work_req);
393 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); 393 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work);
394 394
395 mutex_lock(&device_ctls_mutex); 395 mutex_lock(&device_ctls_mutex);
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 25d66940b4fa..335b7ebdb11c 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -260,7 +260,7 @@ static int edac_mc_assert_error_check_and_clear(void)
260 */ 260 */
261static void edac_mc_workq_function(struct work_struct *work_req) 261static void edac_mc_workq_function(struct work_struct *work_req)
262{ 262{
263 struct delayed_work *d_work = (struct delayed_work *)work_req; 263 struct delayed_work *d_work = to_delayed_work(work_req);
264 struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work); 264 struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work);
265 265
266 mutex_lock(&mem_ctls_mutex); 266 mutex_lock(&mem_ctls_mutex);
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
index 5b150aea703a..30b585b1d60b 100644
--- a/drivers/edac/edac_pci.c
+++ b/drivers/edac/edac_pci.c
@@ -233,7 +233,7 @@ EXPORT_SYMBOL_GPL(edac_pci_find);
233 */ 233 */
234static void edac_pci_workq_function(struct work_struct *work_req) 234static void edac_pci_workq_function(struct work_struct *work_req)
235{ 235{
236 struct delayed_work *d_work = (struct delayed_work *)work_req; 236 struct delayed_work *d_work = to_delayed_work(work_req);
237 struct edac_pci_ctl_info *pci = to_edac_pci_ctl_work(d_work); 237 struct edac_pci_ctl_info *pci = to_edac_pci_ctl_work(d_work);
238 int msec; 238 int msec;
239 unsigned long delay; 239 unsigned long delay;
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 0e8a9185f676..d73f5f473e38 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -692,6 +692,16 @@ config SENSORS_PCF8591
692 These devices are hard to detect and rarely found on mainstream 692 These devices are hard to detect and rarely found on mainstream
693 hardware. If unsure, say N. 693 hardware. If unsure, say N.
694 694
695config SENSORS_SHT15
696 tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
697 depends on GENERIC_GPIO
698 help
699 If you say yes here you get support for the Sensiron SHT10, SHT11,
700 SHT15, SHT71, SHT75 humidity and temperature sensors.
701
702 This driver can also be built as a module. If so, the module
703 will be called sht15.
704
695config SENSORS_SIS5595 705config SENSORS_SIS5595
696 tristate "Silicon Integrated Systems Corp. SiS5595" 706 tristate "Silicon Integrated Systems Corp. SiS5595"
697 depends on PCI 707 depends on PCI
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 1d3757837b4f..0ae26984ba45 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_SHT15) += sht15.o
79obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o 80obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
80obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o 81obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
81obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o 82obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c
index 55d3dc565be6..abca7e9f953b 100644
--- a/drivers/hwmon/hp_accel.c
+++ b/drivers/hwmon/hp_accel.c
@@ -34,7 +34,6 @@
34#include <linux/wait.h> 34#include <linux/wait.h>
35#include <linux/poll.h> 35#include <linux/poll.h>
36#include <linux/freezer.h> 36#include <linux/freezer.h>
37#include <linux/version.h>
38#include <linux/uaccess.h> 37#include <linux/uaccess.h>
39#include <linux/leds.h> 38#include <linux/leds.h>
40#include <acpi/acpi_drivers.h> 39#include <acpi/acpi_drivers.h>
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
new file mode 100644
index 000000000000..6cbdc2fea734
--- /dev/null
+++ b/drivers/hwmon/sht15.c
@@ -0,0 +1,692 @@
1/*
2 * sht15.c - support for the SHT15 Temperature and Humidity Sensor
3 *
4 * Copyright (c) 2009 Jonathan Cameron
5 *
6 * Copyright (c) 2007 Wouter Horre
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 * Currently ignoring checksum on readings.
13 * Default resolution only (14bit temp, 12bit humidity)
14 * Ignoring battery status.
15 * Heater not enabled.
16 * Timings are all conservative.
17 *
18 * Data sheet available (1/2009) at
19 * http://www.sensirion.ch/en/pdf/product_information/Datasheet-humidity-sensor-SHT1x.pdf
20 *
21 * Regulator supply name = vcc
22 */
23
24#include <linux/interrupt.h>
25#include <linux/irq.h>
26#include <linux/gpio.h>
27#include <linux/module.h>
28#include <linux/init.h>
29#include <linux/hwmon.h>
30#include <linux/hwmon-sysfs.h>
31#include <linux/mutex.h>
32#include <linux/platform_device.h>
33#include <linux/delay.h>
34#include <linux/jiffies.h>
35#include <linux/err.h>
36#include <linux/sht15.h>
37#include <linux/regulator/consumer.h>
38#include <asm/atomic.h>
39
40#define SHT15_MEASURE_TEMP 3
41#define SHT15_MEASURE_RH 5
42
43#define SHT15_READING_NOTHING 0
44#define SHT15_READING_TEMP 1
45#define SHT15_READING_HUMID 2
46
47/* Min timings in nsecs */
48#define SHT15_TSCKL 100 /* clock low */
49#define SHT15_TSCKH 100 /* clock high */
50#define SHT15_TSU 150 /* data setup time */
51
52/**
53 * struct sht15_temppair - elements of voltage dependant temp calc
54 * @vdd: supply voltage in microvolts
55 * @d1: see data sheet
56 */
57struct sht15_temppair {
58 int vdd; /* microvolts */
59 int d1;
60};
61
62/* Table 9 from data sheet - relates temperature calculation
63 * to supply voltage.
64 */
65static const struct sht15_temppair temppoints[] = {
66 { 2500000, -39400 },
67 { 3000000, -39600 },
68 { 3500000, -39700 },
69 { 4000000, -39800 },
70 { 5000000, -40100 },
71};
72
73/**
74 * struct sht15_data - device instance specific data
75 * @pdata: platform data (gpio's etc)
76 * @read_work: bh of interrupt handler
77 * @wait_queue: wait queue for getting values from device
78 * @val_temp: last temperature value read from device
79 * @val_humid: last humidity value read from device
80 * @flag: status flag used to identify what the last request was
81 * @valid: are the current stored values valid (start condition)
82 * @last_updat: time of last update
83 * @read_lock: mutex to ensure only one read in progress
84 * at a time.
85 * @dev: associate device structure
86 * @hwmon_dev: device associated with hwmon subsystem
87 * @reg: associated regulator (if specified)
88 * @nb: notifier block to handle notifications of voltage changes
89 * @supply_uV: local copy of supply voltage used to allow
90 * use of regulator consumer if available
91 * @supply_uV_valid: indicates that an updated value has not yet
92 * been obtained from the regulator and so any calculations
93 * based upon it will be invalid.
94 * @update_supply_work: work struct that is used to update the supply_uV
95 * @interrupt_handled: flag used to indicate a hander has been scheduled
96 */
97struct sht15_data {
98 struct sht15_platform_data *pdata;
99 struct work_struct read_work;
100 wait_queue_head_t wait_queue;
101 uint16_t val_temp;
102 uint16_t val_humid;
103 u8 flag;
104 u8 valid;
105 unsigned long last_updat;
106 struct mutex read_lock;
107 struct device *dev;
108 struct device *hwmon_dev;
109 struct regulator *reg;
110 struct notifier_block nb;
111 int supply_uV;
112 int supply_uV_valid;
113 struct work_struct update_supply_work;
114 atomic_t interrupt_handled;
115};
116
117/**
118 * sht15_connection_reset() - reset the comms interface
119 * @data: sht15 specific data
120 *
121 * This implements section 3.4 of the data sheet
122 */
123static void sht15_connection_reset(struct sht15_data *data)
124{
125 int i;
126 gpio_direction_output(data->pdata->gpio_data, 1);
127 ndelay(SHT15_TSCKL);
128 gpio_set_value(data->pdata->gpio_sck, 0);
129 ndelay(SHT15_TSCKL);
130 for (i = 0; i < 9; ++i) {
131 gpio_set_value(data->pdata->gpio_sck, 1);
132 ndelay(SHT15_TSCKH);
133 gpio_set_value(data->pdata->gpio_sck, 0);
134 ndelay(SHT15_TSCKL);
135 }
136}
137/**
138 * sht15_send_bit() - send an individual bit to the device
139 * @data: device state data
140 * @val: value of bit to be sent
141 **/
142static inline void sht15_send_bit(struct sht15_data *data, int val)
143{
144
145 gpio_set_value(data->pdata->gpio_data, val);
146 ndelay(SHT15_TSU);
147 gpio_set_value(data->pdata->gpio_sck, 1);
148 ndelay(SHT15_TSCKH);
149 gpio_set_value(data->pdata->gpio_sck, 0);
150 ndelay(SHT15_TSCKL); /* clock low time */
151}
152
153/**
154 * sht15_transmission_start() - specific sequence for new transmission
155 *
156 * @data: device state data
157 * Timings for this are not documented on the data sheet, so very
158 * conservative ones used in implementation. This implements
159 * figure 12 on the data sheet.
160 **/
161static void sht15_transmission_start(struct sht15_data *data)
162{
163 /* ensure data is high and output */
164 gpio_direction_output(data->pdata->gpio_data, 1);
165 ndelay(SHT15_TSU);
166 gpio_set_value(data->pdata->gpio_sck, 0);
167 ndelay(SHT15_TSCKL);
168 gpio_set_value(data->pdata->gpio_sck, 1);
169 ndelay(SHT15_TSCKH);
170 gpio_set_value(data->pdata->gpio_data, 0);
171 ndelay(SHT15_TSU);
172 gpio_set_value(data->pdata->gpio_sck, 0);
173 ndelay(SHT15_TSCKL);
174 gpio_set_value(data->pdata->gpio_sck, 1);
175 ndelay(SHT15_TSCKH);
176 gpio_set_value(data->pdata->gpio_data, 1);
177 ndelay(SHT15_TSU);
178 gpio_set_value(data->pdata->gpio_sck, 0);
179 ndelay(SHT15_TSCKL);
180}
181/**
182 * sht15_send_byte() - send a single byte to the device
183 * @data: device state
184 * @byte: value to be sent
185 **/
186static void sht15_send_byte(struct sht15_data *data, u8 byte)
187{
188 int i;
189 for (i = 0; i < 8; i++) {
190 sht15_send_bit(data, !!(byte & 0x80));
191 byte <<= 1;
192 }
193}
194/**
195 * sht15_wait_for_response() - checks for ack from device
196 * @data: device state
197 **/
198static int sht15_wait_for_response(struct sht15_data *data)
199{
200 gpio_direction_input(data->pdata->gpio_data);
201 gpio_set_value(data->pdata->gpio_sck, 1);
202 ndelay(SHT15_TSCKH);
203 if (gpio_get_value(data->pdata->gpio_data)) {
204 gpio_set_value(data->pdata->gpio_sck, 0);
205 dev_err(data->dev, "Command not acknowledged\n");
206 sht15_connection_reset(data);
207 return -EIO;
208 }
209 gpio_set_value(data->pdata->gpio_sck, 0);
210 ndelay(SHT15_TSCKL);
211 return 0;
212}
213
214/**
215 * sht15_send_cmd() - Sends a command to the device.
216 * @data: device state
217 * @cmd: command byte to be sent
218 *
219 * On entry, sck is output low, data is output pull high
220 * and the interrupt disabled.
221 **/
222static int sht15_send_cmd(struct sht15_data *data, u8 cmd)
223{
224 int ret = 0;
225 sht15_transmission_start(data);
226 sht15_send_byte(data, cmd);
227 ret = sht15_wait_for_response(data);
228 return ret;
229}
230/**
231 * sht15_update_single_val() - get a new value from device
232 * @data: device instance specific data
233 * @command: command sent to request value
234 * @timeout_msecs: timeout after which comms are assumed
235 * to have failed are reset.
236 **/
237static inline int sht15_update_single_val(struct sht15_data *data,
238 int command,
239 int timeout_msecs)
240{
241 int ret;
242 ret = sht15_send_cmd(data, command);
243 if (ret)
244 return ret;
245
246 gpio_direction_input(data->pdata->gpio_data);
247 atomic_set(&data->interrupt_handled, 0);
248
249 enable_irq(gpio_to_irq(data->pdata->gpio_data));
250 if (gpio_get_value(data->pdata->gpio_data) == 0) {
251 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));
252 /* Only relevant if the interrupt hasn't occured. */
253 if (!atomic_read(&data->interrupt_handled))
254 schedule_work(&data->read_work);
255 }
256 ret = wait_event_timeout(data->wait_queue,
257 (data->flag == SHT15_READING_NOTHING),
258 msecs_to_jiffies(timeout_msecs));
259 if (ret == 0) {/* timeout occurred */
260 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));;
261 sht15_connection_reset(data);
262 return -ETIME;
263 }
264 return 0;
265}
266
267/**
268 * sht15_update_vals() - get updated readings from device if too old
269 * @data: device state
270 **/
271static int sht15_update_vals(struct sht15_data *data)
272{
273 int ret = 0;
274 int timeout = HZ;
275
276 mutex_lock(&data->read_lock);
277 if (time_after(jiffies, data->last_updat + timeout)
278 || !data->valid) {
279 data->flag = SHT15_READING_HUMID;
280 ret = sht15_update_single_val(data, SHT15_MEASURE_RH, 160);
281 if (ret)
282 goto error_ret;
283 data->flag = SHT15_READING_TEMP;
284 ret = sht15_update_single_val(data, SHT15_MEASURE_TEMP, 400);
285 if (ret)
286 goto error_ret;
287 data->valid = 1;
288 data->last_updat = jiffies;
289 }
290error_ret:
291 mutex_unlock(&data->read_lock);
292
293 return ret;
294}
295
296/**
297 * sht15_calc_temp() - convert the raw reading to a temperature
298 * @data: device state
299 *
300 * As per section 4.3 of the data sheet.
301 **/
302static inline int sht15_calc_temp(struct sht15_data *data)
303{
304 int d1 = 0;
305 int i;
306
307 for (i = 1; i < ARRAY_SIZE(temppoints) - 1; i++)
308 /* Find pointer to interpolate */
309 if (data->supply_uV > temppoints[i - 1].vdd) {
310 d1 = (data->supply_uV/1000 - temppoints[i - 1].vdd)
311 * (temppoints[i].d1 - temppoints[i - 1].d1)
312 / (temppoints[i].vdd - temppoints[i - 1].vdd)
313 + temppoints[i - 1].d1;
314 break;
315 }
316
317 return data->val_temp*10 + d1;
318}
319
320/**
321 * sht15_calc_humid() - using last temperature convert raw to humid
322 * @data: device state
323 *
324 * This is the temperature compensated version as per section 4.2 of
325 * the data sheet.
326 **/
327static inline int sht15_calc_humid(struct sht15_data *data)
328{
329 int RHlinear; /* milli percent */
330 int temp = sht15_calc_temp(data);
331
332 const int c1 = -4;
333 const int c2 = 40500; /* x 10 ^ -6 */
334 const int c3 = 2800; /* x10 ^ -9 */
335
336 RHlinear = c1*1000
337 + c2 * data->val_humid/1000
338 + (data->val_humid * data->val_humid * c3)/1000000;
339 return (temp - 25000) * (10000 + 800 * data->val_humid)
340 / 1000000 + RHlinear;
341}
342
343static ssize_t sht15_show_temp(struct device *dev,
344 struct device_attribute *attr,
345 char *buf)
346{
347 int ret;
348 struct sht15_data *data = dev_get_drvdata(dev);
349
350 /* Technically no need to read humidity as well */
351 ret = sht15_update_vals(data);
352
353 return ret ? ret : sprintf(buf, "%d\n",
354 sht15_calc_temp(data));
355}
356
357static ssize_t sht15_show_humidity(struct device *dev,
358 struct device_attribute *attr,
359 char *buf)
360{
361 int ret;
362 struct sht15_data *data = dev_get_drvdata(dev);
363
364 ret = sht15_update_vals(data);
365
366 return ret ? ret : sprintf(buf, "%d\n", sht15_calc_humid(data));
367
368};
369static ssize_t show_name(struct device *dev,
370 struct device_attribute *attr,
371 char *buf)
372{
373 struct platform_device *pdev = to_platform_device(dev);
374 return sprintf(buf, "%s\n", pdev->name);
375}
376
377static SENSOR_DEVICE_ATTR(temp1_input,
378 S_IRUGO, sht15_show_temp,
379 NULL, 0);
380static SENSOR_DEVICE_ATTR(humidity1_input,
381 S_IRUGO, sht15_show_humidity,
382 NULL, 0);
383static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
384static struct attribute *sht15_attrs[] = {
385 &sensor_dev_attr_temp1_input.dev_attr.attr,
386 &sensor_dev_attr_humidity1_input.dev_attr.attr,
387 &dev_attr_name.attr,
388 NULL,
389};
390
391static const struct attribute_group sht15_attr_group = {
392 .attrs = sht15_attrs,
393};
394
395static irqreturn_t sht15_interrupt_fired(int irq, void *d)
396{
397 struct sht15_data *data = d;
398 /* First disable the interrupt */
399 disable_irq_nosync(irq);
400 atomic_inc(&data->interrupt_handled);
401 /* Then schedule a reading work struct */
402 if (data->flag != SHT15_READING_NOTHING)
403 schedule_work(&data->read_work);
404 return IRQ_HANDLED;
405}
406
407/* Each byte of data is acknowledged by pulling the data line
408 * low for one clock pulse.
409 */
410static void sht15_ack(struct sht15_data *data)
411{
412 gpio_direction_output(data->pdata->gpio_data, 0);
413 ndelay(SHT15_TSU);
414 gpio_set_value(data->pdata->gpio_sck, 1);
415 ndelay(SHT15_TSU);
416 gpio_set_value(data->pdata->gpio_sck, 0);
417 ndelay(SHT15_TSU);
418 gpio_set_value(data->pdata->gpio_data, 1);
419
420 gpio_direction_input(data->pdata->gpio_data);
421}
422/**
423 * sht15_end_transmission() - notify device of end of transmission
424 * @data: device state
425 *
426 * This is basically a NAK. (single clock pulse, data high)
427 **/
428static void sht15_end_transmission(struct sht15_data *data)
429{
430 gpio_direction_output(data->pdata->gpio_data, 1);
431 ndelay(SHT15_TSU);
432 gpio_set_value(data->pdata->gpio_sck, 1);
433 ndelay(SHT15_TSCKH);
434 gpio_set_value(data->pdata->gpio_sck, 0);
435 ndelay(SHT15_TSCKL);
436}
437
438static void sht15_bh_read_data(struct work_struct *work_s)
439{
440 int i;
441 uint16_t val = 0;
442 struct sht15_data *data
443 = container_of(work_s, struct sht15_data,
444 read_work);
445 /* Firstly, verify the line is low */
446 if (gpio_get_value(data->pdata->gpio_data)) {
447 /* If not, then start the interrupt again - care
448 here as could have gone low in meantime so verify
449 it hasn't!
450 */
451 atomic_set(&data->interrupt_handled, 0);
452 enable_irq(gpio_to_irq(data->pdata->gpio_data));
453 /* If still not occured or another handler has been scheduled */
454 if (gpio_get_value(data->pdata->gpio_data)
455 || atomic_read(&data->interrupt_handled))
456 return;
457 }
458 /* Read the data back from the device */
459 for (i = 0; i < 16; ++i) {
460 val <<= 1;
461 gpio_set_value(data->pdata->gpio_sck, 1);
462 ndelay(SHT15_TSCKH);
463 val |= !!gpio_get_value(data->pdata->gpio_data);
464 gpio_set_value(data->pdata->gpio_sck, 0);
465 ndelay(SHT15_TSCKL);
466 if (i == 7)
467 sht15_ack(data);
468 }
469 /* Tell the device we are done */
470 sht15_end_transmission(data);
471
472 switch (data->flag) {
473 case SHT15_READING_TEMP:
474 data->val_temp = val;
475 break;
476 case SHT15_READING_HUMID:
477 data->val_humid = val;
478 break;
479 }
480
481 data->flag = SHT15_READING_NOTHING;
482 wake_up(&data->wait_queue);
483}
484
485static void sht15_update_voltage(struct work_struct *work_s)
486{
487 struct sht15_data *data
488 = container_of(work_s, struct sht15_data,
489 update_supply_work);
490 data->supply_uV = regulator_get_voltage(data->reg);
491}
492
493/**
494 * sht15_invalidate_voltage() - mark supply voltage invalid when notified by reg
495 * @nb: associated notification structure
496 * @event: voltage regulator state change event code
497 * @ignored: function parameter - ignored here
498 *
499 * Note that as the notification code holds the regulator lock, we have
500 * to schedule an update of the supply voltage rather than getting it directly.
501 **/
502static int sht15_invalidate_voltage(struct notifier_block *nb,
503 unsigned long event,
504 void *ignored)
505{
506 struct sht15_data *data = container_of(nb, struct sht15_data, nb);
507
508 if (event == REGULATOR_EVENT_VOLTAGE_CHANGE)
509 data->supply_uV_valid = false;
510 schedule_work(&data->update_supply_work);
511
512 return NOTIFY_OK;
513}
514
515static int __devinit sht15_probe(struct platform_device *pdev)
516{
517 int ret = 0;
518 struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL);
519
520 if (!data) {
521 ret = -ENOMEM;
522 dev_err(&pdev->dev, "kzalloc failed");
523 goto error_ret;
524 }
525
526 INIT_WORK(&data->read_work, sht15_bh_read_data);
527 INIT_WORK(&data->update_supply_work, sht15_update_voltage);
528 platform_set_drvdata(pdev, data);
529 mutex_init(&data->read_lock);
530 data->dev = &pdev->dev;
531 init_waitqueue_head(&data->wait_queue);
532
533 if (pdev->dev.platform_data == NULL) {
534 dev_err(&pdev->dev, "no platform data supplied");
535 goto err_free_data;
536 }
537 data->pdata = pdev->dev.platform_data;
538 data->supply_uV = data->pdata->supply_mv*1000;
539
540/* If a regulator is available, query what the supply voltage actually is!*/
541 data->reg = regulator_get(data->dev, "vcc");
542 if (!IS_ERR(data->reg)) {
543 data->supply_uV = regulator_get_voltage(data->reg);
544 regulator_enable(data->reg);
545 /* setup a notifier block to update this if another device
546 * causes the voltage to change */
547 data->nb.notifier_call = &sht15_invalidate_voltage;
548 ret = regulator_register_notifier(data->reg, &data->nb);
549 }
550/* Try requesting the GPIOs */
551 ret = gpio_request(data->pdata->gpio_sck, "SHT15 sck");
552 if (ret) {
553 dev_err(&pdev->dev, "gpio request failed");
554 goto err_free_data;
555 }
556 gpio_direction_output(data->pdata->gpio_sck, 0);
557 ret = gpio_request(data->pdata->gpio_data, "SHT15 data");
558 if (ret) {
559 dev_err(&pdev->dev, "gpio request failed");
560 goto err_release_gpio_sck;
561 }
562 ret = sysfs_create_group(&pdev->dev.kobj, &sht15_attr_group);
563 if (ret) {
564 dev_err(&pdev->dev, "sysfs create failed");
565 goto err_free_data;
566 }
567
568 ret = request_irq(gpio_to_irq(data->pdata->gpio_data),
569 sht15_interrupt_fired,
570 IRQF_TRIGGER_FALLING,
571 "sht15 data",
572 data);
573 if (ret) {
574 dev_err(&pdev->dev, "failed to get irq for data line");
575 goto err_release_gpio_data;
576 }
577 disable_irq_nosync(gpio_to_irq(data->pdata->gpio_data));
578 sht15_connection_reset(data);
579 sht15_send_cmd(data, 0x1E);
580
581 data->hwmon_dev = hwmon_device_register(data->dev);
582 if (IS_ERR(data->hwmon_dev)) {
583 ret = PTR_ERR(data->hwmon_dev);
584 goto err_release_gpio_data;
585 }
586 return 0;
587
588err_release_gpio_data:
589 gpio_free(data->pdata->gpio_data);
590err_release_gpio_sck:
591 gpio_free(data->pdata->gpio_sck);
592err_free_data:
593 kfree(data);
594error_ret:
595
596 return ret;
597}
598
599static int __devexit sht15_remove(struct platform_device *pdev)
600{
601 struct sht15_data *data = platform_get_drvdata(pdev);
602
603 /* Make sure any reads from the device are done and
604 * prevent new ones beginnning */
605 mutex_lock(&data->read_lock);
606 hwmon_device_unregister(data->hwmon_dev);
607 sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
608 if (!IS_ERR(data->reg)) {
609 regulator_unregister_notifier(data->reg, &data->nb);
610 regulator_disable(data->reg);
611 regulator_put(data->reg);
612 }
613
614 free_irq(gpio_to_irq(data->pdata->gpio_data), data);
615 gpio_free(data->pdata->gpio_data);
616 gpio_free(data->pdata->gpio_sck);
617 mutex_unlock(&data->read_lock);
618 kfree(data);
619 return 0;
620}
621
622
623static struct platform_driver sht_drivers[] = {
624 {
625 .driver = {
626 .name = "sht10",
627 .owner = THIS_MODULE,
628 },
629 .probe = sht15_probe,
630 .remove = sht15_remove,
631 }, {
632 .driver = {
633 .name = "sht11",
634 .owner = THIS_MODULE,
635 },
636 .probe = sht15_probe,
637 .remove = sht15_remove,
638 }, {
639 .driver = {
640 .name = "sht15",
641 .owner = THIS_MODULE,
642 },
643 .probe = sht15_probe,
644 .remove = sht15_remove,
645 }, {
646 .driver = {
647 .name = "sht71",
648 .owner = THIS_MODULE,
649 },
650 .probe = sht15_probe,
651 .remove = sht15_remove,
652 }, {
653 .driver = {
654 .name = "sht75",
655 .owner = THIS_MODULE,
656 },
657 .probe = sht15_probe,
658 .remove = sht15_remove,
659 },
660};
661
662
663static int __init sht15_init(void)
664{
665 int ret;
666 int i;
667
668 for (i = 0; i < ARRAY_SIZE(sht_drivers); i++) {
669 ret = platform_driver_register(&sht_drivers[i]);
670 if (ret)
671 goto error_unreg;
672 }
673
674 return 0;
675
676error_unreg:
677 while (--i >= 0)
678 platform_driver_unregister(&sht_drivers[i]);
679
680 return ret;
681}
682module_init(sht15_init);
683
684static void __exit sht15_exit(void)
685{
686 int i;
687 for (i = ARRAY_SIZE(sht_drivers) - 1; i >= 0; i--)
688 platform_driver_unregister(&sht_drivers[i]);
689}
690module_exit(sht15_exit);
691
692MODULE_LICENSE("GPL");
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index f68e5f8e23ee..6318f7ddc1d4 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -190,7 +190,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
190 int completed = 1; 190 int completed = 1;
191 unsigned long timeout = jiffies + i2c_adap->timeout; 191 unsigned long timeout = jiffies + i2c_adap->timeout;
192 192
193 while (pca_status(adap) != 0xf8) { 193 while ((state = pca_status(adap)) != 0xf8) {
194 if (time_before(jiffies, timeout)) { 194 if (time_before(jiffies, timeout)) {
195 msleep(10); 195 msleep(10);
196 } else { 196 } else {
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 94eae5c3cbc7..a48c8aee0218 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -604,12 +604,14 @@ comment "Graphics adapter I2C/DDC channel drivers"
604 depends on PCI 604 depends on PCI
605 605
606config I2C_VOODOO3 606config I2C_VOODOO3
607 tristate "Voodoo 3" 607 tristate "Voodoo 3 (DEPRECATED)"
608 depends on PCI 608 depends on PCI
609 select I2C_ALGOBIT 609 select I2C_ALGOBIT
610 help 610 help
611 If you say yes to this option, support will be included for the 611 If you say yes to this option, support will be included for the
612 Voodoo 3 I2C interface. 612 Voodoo 3 I2C interface. This driver is deprecated and you should
613 use the tdfxfb driver instead, which additionally provides
614 framebuffer support.
613 615
614 This driver can also be built as a module. If so, the module 616 This driver can also be built as a module. If so, the module
615 will be called i2c-voodoo3. 617 will be called i2c-voodoo3.
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index b6f3a0de6ca2..85e2e919d1cd 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -716,8 +716,7 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
716 716
717 /* new style driver methods can't mix with legacy ones */ 717 /* new style driver methods can't mix with legacy ones */
718 if (is_newstyle_driver(driver)) { 718 if (is_newstyle_driver(driver)) {
719 if (driver->attach_adapter || driver->detach_adapter 719 if (driver->detach_adapter || driver->detach_client) {
720 || driver->detach_client) {
721 printk(KERN_WARNING 720 printk(KERN_WARNING
722 "i2c-core: driver [%s] is confused\n", 721 "i2c-core: driver [%s] is confused\n",
723 driver->driver.name); 722 driver->driver.name);
diff --git a/drivers/input/input.c b/drivers/input/input.c
index ec3db3ade118..d44065d2e662 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -132,6 +132,11 @@ static void input_start_autorepeat(struct input_dev *dev, int code)
132 } 132 }
133} 133}
134 134
135static void input_stop_autorepeat(struct input_dev *dev)
136{
137 del_timer(&dev->timer);
138}
139
135#define INPUT_IGNORE_EVENT 0 140#define INPUT_IGNORE_EVENT 0
136#define INPUT_PASS_TO_HANDLERS 1 141#define INPUT_PASS_TO_HANDLERS 1
137#define INPUT_PASS_TO_DEVICE 2 142#define INPUT_PASS_TO_DEVICE 2
@@ -167,6 +172,8 @@ static void input_handle_event(struct input_dev *dev,
167 __change_bit(code, dev->key); 172 __change_bit(code, dev->key);
168 if (value) 173 if (value)
169 input_start_autorepeat(dev, code); 174 input_start_autorepeat(dev, code);
175 else
176 input_stop_autorepeat(dev);
170 } 177 }
171 178
172 disposition = INPUT_PASS_TO_HANDLERS; 179 disposition = INPUT_PASS_TO_HANDLERS;
@@ -737,11 +744,11 @@ static inline void input_wakeup_procfs_readers(void)
737 744
738static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait) 745static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait)
739{ 746{
740 int state = input_devices_state;
741
742 poll_wait(file, &input_devices_poll_wait, wait); 747 poll_wait(file, &input_devices_poll_wait, wait);
743 if (state != input_devices_state) 748 if (file->f_version != input_devices_state) {
749 file->f_version = input_devices_state;
744 return POLLIN | POLLRDNORM; 750 return POLLIN | POLLRDNORM;
751 }
745 752
746 return 0; 753 return 0;
747} 754}
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 45470f18d7e9..f999dc60c3b8 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -229,7 +229,8 @@ struct atkbd {
229/* 229/*
230 * System-specific ketymap fixup routine 230 * System-specific ketymap fixup routine
231 */ 231 */
232static void (*atkbd_platform_fixup)(struct atkbd *); 232static void (*atkbd_platform_fixup)(struct atkbd *, const void *data);
233static void *atkbd_platform_fixup_data;
233 234
234static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf, 235static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
235 ssize_t (*handler)(struct atkbd *, char *)); 236 ssize_t (*handler)(struct atkbd *, char *));
@@ -834,87 +835,64 @@ static void atkbd_disconnect(struct serio *serio)
834} 835}
835 836
836/* 837/*
837 * Most special keys (Fn+F?) on Dell laptops do not generate release 838 * generate release events for the keycodes given in data
838 * events so we have to do it ourselves.
839 */ 839 */
840static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd) 840static void atkbd_apply_forced_release_keylist(struct atkbd* atkbd,
841 const void *data)
841{ 842{
842 static const unsigned int forced_release_keys[] = { 843 const unsigned int *keys = data;
843 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, 844 unsigned int i;
844 };
845 int i;
846 845
847 if (atkbd->set == 2) 846 if (atkbd->set == 2)
848 for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++) 847 for (i = 0; keys[i] != -1U; i++)
849 __set_bit(forced_release_keys[i], 848 __set_bit(keys[i], atkbd->force_release_mask);
850 atkbd->force_release_mask);
851} 849}
852 850
853/* 851/*
852 * Most special keys (Fn+F?) on Dell laptops do not generate release
853 * events so we have to do it ourselves.
854 */
855static unsigned int atkbd_dell_laptop_forced_release_keys[] = {
856 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, -1U
857};
858
859/*
854 * Perform fixup for HP system that doesn't generate release 860 * Perform fixup for HP system that doesn't generate release
855 * for its video switch 861 * for its video switch
856 */ 862 */
857static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) 863static unsigned int atkbd_hp_forced_release_keys[] = {
858{ 864 0x94, -1U
859 static const unsigned int forced_release_keys[] = { 865};
860 0x94,
861 };
862 int i;
863
864 if (atkbd->set == 2)
865 for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
866 __set_bit(forced_release_keys[i],
867 atkbd->force_release_mask);
868}
869 866
870/* 867/*
871 * Inventec system with broken key release on volume keys 868 * Inventec system with broken key release on volume keys
872 */ 869 */
873static void atkbd_inventec_keymap_fixup(struct atkbd *atkbd) 870static unsigned int atkbd_inventec_forced_release_keys[] = {
874{ 871 0xae, 0xb0, -1U
875 const unsigned int forced_release_keys[] = { 872};
876 0xae, 0xb0,
877 };
878 int i;
879
880 if (atkbd->set == 2)
881 for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
882 __set_bit(forced_release_keys[i],
883 atkbd->force_release_mask);
884}
885 873
886/* 874/*
887 * Perform fixup for HP Pavilion ZV6100 laptop that doesn't generate release 875 * Perform fixup for HP Pavilion ZV6100 laptop that doesn't generate release
888 * for its volume buttons 876 * for its volume buttons
889 */ 877 */
890static void atkbd_hp_zv6100_keymap_fixup(struct atkbd *atkbd) 878static unsigned int atkbd_hp_zv6100_forced_release_keys[] = {
891{ 879 0xae, 0xb0, -1U
892 const unsigned int forced_release_keys[] = { 880};
893 0xae, 0xb0,
894 };
895 int i;
896
897 if (atkbd->set == 2)
898 for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
899 __set_bit(forced_release_keys[i],
900 atkbd->force_release_mask);
901}
902 881
903/* 882/*
904 * Samsung NC10 with Fn+F? key release not working 883 * Samsung NC10 with Fn+F? key release not working
905 */ 884 */
906static void atkbd_samsung_keymap_fixup(struct atkbd *atkbd) 885static unsigned int atkbd_samsung_forced_release_keys[] = {
907{ 886 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9, -1U
908 const unsigned int forced_release_keys[] = { 887};
909 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9,
910 };
911 int i;
912 888
913 if (atkbd->set == 2) 889/*
914 for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++) 890 * The volume up and volume down special keys on a Fujitsu Amilo PA 1510 laptop
915 __set_bit(forced_release_keys[i], 891 * do not generate release events so we have to do it ourselves.
916 atkbd->force_release_mask); 892 */
917} 893static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = {
894 0xb0, 0xae, -1U
895};
918 896
919/* 897/*
920 * atkbd_set_keycode_table() initializes keyboard's keycode table 898 * atkbd_set_keycode_table() initializes keyboard's keycode table
@@ -967,7 +945,7 @@ static void atkbd_set_keycode_table(struct atkbd *atkbd)
967 * Perform additional fixups 945 * Perform additional fixups
968 */ 946 */
969 if (atkbd_platform_fixup) 947 if (atkbd_platform_fixup)
970 atkbd_platform_fixup(atkbd); 948 atkbd_platform_fixup(atkbd, atkbd_platform_fixup_data);
971} 949}
972 950
973/* 951/*
@@ -1492,9 +1470,11 @@ static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf)
1492 return sprintf(buf, "%lu\n", atkbd->err_count); 1470 return sprintf(buf, "%lu\n", atkbd->err_count);
1493} 1471}
1494 1472
1495static int __init atkbd_setup_fixup(const struct dmi_system_id *id) 1473static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
1496{ 1474{
1497 atkbd_platform_fixup = id->driver_data; 1475 atkbd_platform_fixup = atkbd_apply_forced_release_keylist;
1476 atkbd_platform_fixup_data = id->driver_data;
1477
1498 return 0; 1478 return 0;
1499} 1479}
1500 1480
@@ -1505,8 +1485,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1505 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 1485 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1506 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */ 1486 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1507 }, 1487 },
1508 .callback = atkbd_setup_fixup, 1488 .callback = atkbd_setup_forced_release,
1509 .driver_data = atkbd_dell_laptop_keymap_fixup, 1489 .driver_data = atkbd_dell_laptop_forced_release_keys,
1510 }, 1490 },
1511 { 1491 {
1512 .ident = "Dell Laptop", 1492 .ident = "Dell Laptop",
@@ -1514,8 +1494,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1514 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), 1494 DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
1515 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */ 1495 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1516 }, 1496 },
1517 .callback = atkbd_setup_fixup, 1497 .callback = atkbd_setup_forced_release,
1518 .driver_data = atkbd_dell_laptop_keymap_fixup, 1498 .driver_data = atkbd_dell_laptop_forced_release_keys,
1519 }, 1499 },
1520 { 1500 {
1521 .ident = "HP 2133", 1501 .ident = "HP 2133",
@@ -1523,8 +1503,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1523 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 1503 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1524 DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"), 1504 DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"),
1525 }, 1505 },
1526 .callback = atkbd_setup_fixup, 1506 .callback = atkbd_setup_forced_release,
1527 .driver_data = atkbd_hp_keymap_fixup, 1507 .driver_data = atkbd_hp_forced_release_keys,
1528 }, 1508 },
1529 { 1509 {
1530 .ident = "HP Pavilion ZV6100", 1510 .ident = "HP Pavilion ZV6100",
@@ -1532,8 +1512,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1532 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 1512 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1533 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"), 1513 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"),
1534 }, 1514 },
1535 .callback = atkbd_setup_fixup, 1515 .callback = atkbd_setup_forced_release,
1536 .driver_data = atkbd_hp_zv6100_keymap_fixup, 1516 .driver_data = atkbd_hp_zv6100_forced_release_keys,
1537 }, 1517 },
1538 { 1518 {
1539 .ident = "Inventec Symphony", 1519 .ident = "Inventec Symphony",
@@ -1541,8 +1521,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1541 DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"), 1521 DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"),
1542 DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), 1522 DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"),
1543 }, 1523 },
1544 .callback = atkbd_setup_fixup, 1524 .callback = atkbd_setup_forced_release,
1545 .driver_data = atkbd_inventec_keymap_fixup, 1525 .driver_data = atkbd_inventec_forced_release_keys,
1546 }, 1526 },
1547 { 1527 {
1548 .ident = "Samsung NC10", 1528 .ident = "Samsung NC10",
@@ -1550,8 +1530,17 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1550 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), 1530 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
1551 DMI_MATCH(DMI_PRODUCT_NAME, "NC10"), 1531 DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
1552 }, 1532 },
1553 .callback = atkbd_setup_fixup, 1533 .callback = atkbd_setup_forced_release,
1554 .driver_data = atkbd_samsung_keymap_fixup, 1534 .driver_data = atkbd_samsung_forced_release_keys,
1535 },
1536 {
1537 .ident = "Fujitsu Amilo PA 1510",
1538 .matches = {
1539 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1540 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"),
1541 },
1542 .callback = atkbd_setup_forced_release,
1543 .driver_data = atkbd_amilo_pa1510_forced_release_keys,
1555 }, 1544 },
1556 { } 1545 { }
1557}; 1546};
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c
index ee855c5202e8..e94b7d735aca 100644
--- a/drivers/input/keyboard/bf54x-keys.c
+++ b/drivers/input/keyboard/bf54x-keys.c
@@ -211,8 +211,8 @@ static int __devinit bfin_kpad_probe(struct platform_device *pdev)
211 211
212 if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT || 212 if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT ||
213 !pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) { 213 !pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) {
214 printk(KERN_ERR DRV_NAME 214 printk(KERN_WARNING DRV_NAME
215 ": Invalid Debounce/Columdrive Time from pdata\n"); 215 ": Invalid Debounce/Columndrive Time in platform data\n");
216 bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */ 216 bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */
217 } else { 217 } else {
218 bfin_write_KPAD_MSEL( 218 bfin_write_KPAD_MSEL(
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c
index aacf71f3cd44..e9d639ec283d 100644
--- a/drivers/input/keyboard/hilkbd.c
+++ b/drivers/input/keyboard/hilkbd.c
@@ -198,45 +198,28 @@ static void hil_do(unsigned char cmd, unsigned char *data, unsigned int len)
198} 198}
199 199
200 200
201/* initialise HIL */ 201/* initialize HIL */
202static int __init 202static int __devinit hil_keyb_init(void)
203hil_keyb_init(void)
204{ 203{
205 unsigned char c; 204 unsigned char c;
206 unsigned int i, kbid; 205 unsigned int i, kbid;
207 wait_queue_head_t hil_wait; 206 wait_queue_head_t hil_wait;
208 int err; 207 int err;
209 208
210 if (hil_dev.dev) { 209 if (hil_dev.dev)
211 return -ENODEV; /* already initialized */ 210 return -ENODEV; /* already initialized */
212 }
213 211
212 init_waitqueue_head(&hil_wait);
214 spin_lock_init(&hil_dev.lock); 213 spin_lock_init(&hil_dev.lock);
214
215 hil_dev.dev = input_allocate_device(); 215 hil_dev.dev = input_allocate_device();
216 if (!hil_dev.dev) 216 if (!hil_dev.dev)
217 return -ENOMEM; 217 return -ENOMEM;
218 218
219#if defined(CONFIG_HP300)
220 if (!MACH_IS_HP300) {
221 err = -ENODEV;
222 goto err1;
223 }
224 if (!hwreg_present((void *)(HILBASE + HIL_DATA))) {
225 printk(KERN_ERR "HIL: hardware register was not found\n");
226 err = -ENODEV;
227 goto err1;
228 }
229 if (!request_region(HILBASE + HIL_DATA, 2, "hil")) {
230 printk(KERN_ERR "HIL: IOPORT region already used\n");
231 err = -EIO;
232 goto err1;
233 }
234#endif
235
236 err = request_irq(HIL_IRQ, hil_interrupt, 0, "hil", hil_dev.dev_id); 219 err = request_irq(HIL_IRQ, hil_interrupt, 0, "hil", hil_dev.dev_id);
237 if (err) { 220 if (err) {
238 printk(KERN_ERR "HIL: Can't get IRQ\n"); 221 printk(KERN_ERR "HIL: Can't get IRQ\n");
239 goto err2; 222 goto err1;
240 } 223 }
241 224
242 /* Turn on interrupts */ 225 /* Turn on interrupts */
@@ -246,11 +229,9 @@ hil_keyb_init(void)
246 hil_dev.valid = 0; /* clear any pending data */ 229 hil_dev.valid = 0; /* clear any pending data */
247 hil_do(HIL_READKBDSADR, NULL, 0); 230 hil_do(HIL_READKBDSADR, NULL, 0);
248 231
249 init_waitqueue_head(&hil_wait); 232 wait_event_interruptible_timeout(hil_wait, hil_dev.valid, 3 * HZ);
250 wait_event_interruptible_timeout(hil_wait, hil_dev.valid, 3*HZ); 233 if (!hil_dev.valid)
251 if (!hil_dev.valid) {
252 printk(KERN_WARNING "HIL: timed out, assuming no keyboard present\n"); 234 printk(KERN_WARNING "HIL: timed out, assuming no keyboard present\n");
253 }
254 235
255 c = hil_dev.c; 236 c = hil_dev.c;
256 hil_dev.valid = 0; 237 hil_dev.valid = 0;
@@ -268,7 +249,7 @@ hil_keyb_init(void)
268 249
269 for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++) 250 for (i = 0; i < HIL_KEYCODES_SET1_TBLSIZE; i++)
270 if (hphilkeyb_keycode[i] != KEY_RESERVED) 251 if (hphilkeyb_keycode[i] != KEY_RESERVED)
271 set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit); 252 __set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit);
272 253
273 hil_dev.dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); 254 hil_dev.dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
274 hil_dev.dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) | 255 hil_dev.dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) |
@@ -287,34 +268,45 @@ hil_keyb_init(void)
287 err = input_register_device(hil_dev.dev); 268 err = input_register_device(hil_dev.dev);
288 if (err) { 269 if (err) {
289 printk(KERN_ERR "HIL: Can't register device\n"); 270 printk(KERN_ERR "HIL: Can't register device\n");
290 goto err3; 271 goto err2;
291 } 272 }
273
292 printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n", 274 printk(KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n",
293 hil_dev.dev->name, kbid, HILBASE, HIL_IRQ); 275 hil_dev.dev->name, kbid, HILBASE, HIL_IRQ);
294 276
295 return 0; 277 return 0;
296 278
297err3: 279err2:
298 hil_do(HIL_INTOFF, NULL, 0); 280 hil_do(HIL_INTOFF, NULL, 0);
299 disable_irq(HIL_IRQ);
300 free_irq(HIL_IRQ, hil_dev.dev_id); 281 free_irq(HIL_IRQ, hil_dev.dev_id);
301err2:
302#if defined(CONFIG_HP300)
303 release_region(HILBASE + HIL_DATA, 2);
304err1: 282err1:
305#endif
306 input_free_device(hil_dev.dev); 283 input_free_device(hil_dev.dev);
307 hil_dev.dev = NULL; 284 hil_dev.dev = NULL;
308 return err; 285 return err;
309} 286}
310 287
288static void __devexit hil_keyb_exit(void)
289{
290 if (HIL_IRQ)
291 free_irq(HIL_IRQ, hil_dev.dev_id);
292
293 /* Turn off interrupts */
294 hil_do(HIL_INTOFF, NULL, 0);
295
296 input_unregister_device(hil_dev.dev);
297 hil_dev.dev = NULL;
298}
311 299
312#if defined(CONFIG_PARISC) 300#if defined(CONFIG_PARISC)
313static int __init 301static int __devinit hil_probe_chip(struct parisc_device *dev)
314hil_init_chip(struct parisc_device *dev)
315{ 302{
303 /* Only allow one HIL keyboard */
304 if (hil_dev.dev)
305 return -ENODEV;
306
316 if (!dev->irq) { 307 if (!dev->irq) {
317 printk(KERN_WARNING "HIL: IRQ not found for HIL bus at 0x%08lx\n", dev->hpa.start); 308 printk(KERN_WARNING "HIL: IRQ not found for HIL bus at 0x%p\n",
309 (void *)dev->hpa.start);
318 return -ENODEV; 310 return -ENODEV;
319 } 311 }
320 312
@@ -327,51 +319,79 @@ hil_init_chip(struct parisc_device *dev)
327 return hil_keyb_init(); 319 return hil_keyb_init();
328} 320}
329 321
322static int __devexit hil_remove_chip(struct parisc_device *dev)
323{
324 hil_keyb_exit();
325
326 return 0;
327}
328
330static struct parisc_device_id hil_tbl[] = { 329static struct parisc_device_id hil_tbl[] = {
331 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00073 }, 330 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00073 },
332 { 0, } 331 { 0, }
333}; 332};
334 333
334#if 0
335/* Disabled to avoid conflicts with the HP SDC HIL drivers */
335MODULE_DEVICE_TABLE(parisc, hil_tbl); 336MODULE_DEVICE_TABLE(parisc, hil_tbl);
337#endif
336 338
337static struct parisc_driver hil_driver = { 339static struct parisc_driver hil_driver = {
338 .name = "hil", 340 .name = "hil",
339 .id_table = hil_tbl, 341 .id_table = hil_tbl,
340 .probe = hil_init_chip, 342 .probe = hil_probe_chip,
343 .remove = __devexit_p(hil_remove_chip),
341}; 344};
342#endif /* CONFIG_PARISC */
343
344 345
345static int __init hil_init(void) 346static int __init hil_init(void)
346{ 347{
347#if defined(CONFIG_PARISC)
348 return register_parisc_driver(&hil_driver); 348 return register_parisc_driver(&hil_driver);
349#else
350 return hil_keyb_init();
351#endif
352} 349}
353 350
354
355static void __exit hil_exit(void) 351static void __exit hil_exit(void)
356{ 352{
357 if (HIL_IRQ) { 353 unregister_parisc_driver(&hil_driver);
358 disable_irq(HIL_IRQ); 354}
359 free_irq(HIL_IRQ, hil_dev.dev_id); 355
356#else /* !CONFIG_PARISC */
357
358static int __init hil_init(void)
359{
360 int error;
361
362 /* Only allow one HIL keyboard */
363 if (hil_dev.dev)
364 return -EBUSY;
365
366 if (!MACH_IS_HP300)
367 return -ENODEV;
368
369 if (!hwreg_present((void *)(HILBASE + HIL_DATA))) {
370 printk(KERN_ERR "HIL: hardware register was not found\n");
371 return -ENODEV;
360 } 372 }
361 373
362 /* Turn off interrupts */ 374 if (!request_region(HILBASE + HIL_DATA, 2, "hil")) {
363 hil_do(HIL_INTOFF, NULL, 0); 375 printk(KERN_ERR "HIL: IOPORT region already used\n");
376 return -EIO;
377 }
364 378
365 input_unregister_device(hil_dev.dev); 379 error = hil_keyb_init();
380 if (error) {
381 release_region(HILBASE + HIL_DATA, 2);
382 return error;
383 }
366 384
367 hil_dev.dev = NULL; 385 return 0;
386}
368 387
369#if defined(CONFIG_PARISC) 388static void __exit hil_exit(void)
370 unregister_parisc_driver(&hil_driver); 389{
371#else 390 hil_keyb_exit();
372 release_region(HILBASE+HIL_DATA, 2); 391 release_region(HILBASE + HIL_DATA, 2);
373#endif
374} 392}
375 393
394#endif /* CONFIG_PARISC */
395
376module_init(hil_init); 396module_init(hil_init);
377module_exit(hil_exit); 397module_exit(hil_exit);
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 67e5553f699a..203abac1e23e 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -227,4 +227,27 @@ config INPUT_PCF50633_PMU
227 Say Y to include support for delivering PMU events via input 227 Say Y to include support for delivering PMU events via input
228 layer on NXP PCF50633. 228 layer on NXP PCF50633.
229 229
230config INPUT_GPIO_ROTARY_ENCODER
231 tristate "Rotary encoders connected to GPIO pins"
232 depends on GPIOLIB && GENERIC_GPIO
233 help
234 Say Y here to add support for rotary encoders connected to GPIO lines.
235 Check file:Documentation/incput/rotary_encoder.txt for more
236 information.
237
238 To compile this driver as a module, choose M here: the
239 module will be called rotary_encoder.
240
241config INPUT_RB532_BUTTON
242 tristate "Mikrotik Routerboard 532 button interface"
243 depends on MIKROTIK_RB532
244 depends on GPIOLIB && GENERIC_GPIO
245 select INPUT_POLLDEV
246 help
247 Say Y here if you want support for the S1 button built into
248 Mikrotik's Routerboard 532.
249
250 To compile this driver as a module, choose M here: the
251 module will be called rb532_button.
252
230endif 253endif
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index bb62e6efacf3..eb3f407baedf 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -4,21 +4,23 @@
4 4
5# Each configuration option enables a list of files. 5# Each configuration option enables a list of files.
6 6
7obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o 7obj-$(CONFIG_INPUT_APANEL) += apanel.o
8obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
9obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
10obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o
11obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o
12obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
13obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
14obj-$(CONFIG_INPUT_ATI_REMOTE) += ati_remote.o 8obj-$(CONFIG_INPUT_ATI_REMOTE) += ati_remote.o
15obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o 9obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o
16obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o 10obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
17obj-$(CONFIG_INPUT_POWERMATE) += powermate.o
18obj-$(CONFIG_INPUT_YEALINK) += yealink.o
19obj-$(CONFIG_INPUT_CM109) += cm109.o 11obj-$(CONFIG_INPUT_CM109) += cm109.o
12obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o
20obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o 13obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o
21obj-$(CONFIG_INPUT_UINPUT) += uinput.o 14obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o
22obj-$(CONFIG_INPUT_APANEL) += apanel.o 15obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o
23obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o 16obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
24obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o 17obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o
18obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
19obj-$(CONFIG_INPUT_POWERMATE) += powermate.o
20obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o
21obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o
22obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
23obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
24obj-$(CONFIG_INPUT_UINPUT) += uinput.o
25obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
26obj-$(CONFIG_INPUT_YEALINK) += yealink.o
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 3c9988dc0e9f..922c05141585 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -31,12 +31,73 @@ MODULE_LICENSE("GPL");
31 * newly configured "channel". 31 * newly configured "channel".
32 */ 32 */
33 33
34static unsigned int channel_mask = 0xFFFF; 34enum {
35module_param(channel_mask, uint, 0644); 35 ATI_REMOTE2_MAX_CHANNEL_MASK = 0xFFFF,
36 ATI_REMOTE2_MAX_MODE_MASK = 0x1F,
37};
38
39static int ati_remote2_set_mask(const char *val,
40 struct kernel_param *kp, unsigned int max)
41{
42 unsigned long mask;
43 int ret;
44
45 if (!val)
46 return -EINVAL;
47
48 ret = strict_strtoul(val, 0, &mask);
49 if (ret)
50 return ret;
51
52 if (mask & ~max)
53 return -EINVAL;
54
55 *(unsigned int *)kp->arg = mask;
56
57 return 0;
58}
59
60static int ati_remote2_set_channel_mask(const char *val,
61 struct kernel_param *kp)
62{
63 pr_debug("%s()\n", __func__);
64
65 return ati_remote2_set_mask(val, kp, ATI_REMOTE2_MAX_CHANNEL_MASK);
66}
67
68static int ati_remote2_get_channel_mask(char *buffer, struct kernel_param *kp)
69{
70 pr_debug("%s()\n", __func__);
71
72 return sprintf(buffer, "0x%04x", *(unsigned int *)kp->arg);
73}
74
75static int ati_remote2_set_mode_mask(const char *val, struct kernel_param *kp)
76{
77 pr_debug("%s()\n", __func__);
78
79 return ati_remote2_set_mask(val, kp, ATI_REMOTE2_MAX_MODE_MASK);
80}
81
82static int ati_remote2_get_mode_mask(char *buffer, struct kernel_param *kp)
83{
84 pr_debug("%s()\n", __func__);
85
86 return sprintf(buffer, "0x%02x", *(unsigned int *)kp->arg);
87}
88
89static unsigned int channel_mask = ATI_REMOTE2_MAX_CHANNEL_MASK;
90#define param_check_channel_mask(name, p) __param_check(name, p, unsigned int)
91#define param_set_channel_mask ati_remote2_set_channel_mask
92#define param_get_channel_mask ati_remote2_get_channel_mask
93module_param(channel_mask, channel_mask, 0644);
36MODULE_PARM_DESC(channel_mask, "Bitmask of channels to accept <15:Channel16>...<1:Channel2><0:Channel1>"); 94MODULE_PARM_DESC(channel_mask, "Bitmask of channels to accept <15:Channel16>...<1:Channel2><0:Channel1>");
37 95
38static unsigned int mode_mask = 0x1F; 96static unsigned int mode_mask = ATI_REMOTE2_MAX_MODE_MASK;
39module_param(mode_mask, uint, 0644); 97#define param_check_mode_mask(name, p) __param_check(name, p, unsigned int)
98#define param_set_mode_mask ati_remote2_set_mode_mask
99#define param_get_mode_mask ati_remote2_get_mode_mask
100module_param(mode_mask, mode_mask, 0644);
40MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>"); 101MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>");
41 102
42static struct usb_device_id ati_remote2_id_table[] = { 103static struct usb_device_id ati_remote2_id_table[] = {
@@ -133,12 +194,18 @@ struct ati_remote2 {
133 u16 keycode[ATI_REMOTE2_MODES][ARRAY_SIZE(ati_remote2_key_table)]; 194 u16 keycode[ATI_REMOTE2_MODES][ARRAY_SIZE(ati_remote2_key_table)];
134 195
135 unsigned int flags; 196 unsigned int flags;
197
198 unsigned int channel_mask;
199 unsigned int mode_mask;
136}; 200};
137 201
138static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id); 202static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id);
139static void ati_remote2_disconnect(struct usb_interface *interface); 203static void ati_remote2_disconnect(struct usb_interface *interface);
140static int ati_remote2_suspend(struct usb_interface *interface, pm_message_t message); 204static int ati_remote2_suspend(struct usb_interface *interface, pm_message_t message);
141static int ati_remote2_resume(struct usb_interface *interface); 205static int ati_remote2_resume(struct usb_interface *interface);
206static int ati_remote2_reset_resume(struct usb_interface *interface);
207static int ati_remote2_pre_reset(struct usb_interface *interface);
208static int ati_remote2_post_reset(struct usb_interface *interface);
142 209
143static struct usb_driver ati_remote2_driver = { 210static struct usb_driver ati_remote2_driver = {
144 .name = "ati_remote2", 211 .name = "ati_remote2",
@@ -147,6 +214,9 @@ static struct usb_driver ati_remote2_driver = {
147 .id_table = ati_remote2_id_table, 214 .id_table = ati_remote2_id_table,
148 .suspend = ati_remote2_suspend, 215 .suspend = ati_remote2_suspend,
149 .resume = ati_remote2_resume, 216 .resume = ati_remote2_resume,
217 .reset_resume = ati_remote2_reset_resume,
218 .pre_reset = ati_remote2_pre_reset,
219 .post_reset = ati_remote2_post_reset,
150 .supports_autosuspend = 1, 220 .supports_autosuspend = 1,
151}; 221};
152 222
@@ -238,7 +308,7 @@ static void ati_remote2_input_mouse(struct ati_remote2 *ar2)
238 308
239 channel = data[0] >> 4; 309 channel = data[0] >> 4;
240 310
241 if (!((1 << channel) & channel_mask)) 311 if (!((1 << channel) & ar2->channel_mask))
242 return; 312 return;
243 313
244 mode = data[0] & 0x0F; 314 mode = data[0] & 0x0F;
@@ -250,7 +320,7 @@ static void ati_remote2_input_mouse(struct ati_remote2 *ar2)
250 return; 320 return;
251 } 321 }
252 322
253 if (!((1 << mode) & mode_mask)) 323 if (!((1 << mode) & ar2->mode_mask))
254 return; 324 return;
255 325
256 input_event(idev, EV_REL, REL_X, (s8) data[1]); 326 input_event(idev, EV_REL, REL_X, (s8) data[1]);
@@ -277,7 +347,7 @@ static void ati_remote2_input_key(struct ati_remote2 *ar2)
277 347
278 channel = data[0] >> 4; 348 channel = data[0] >> 4;
279 349
280 if (!((1 << channel) & channel_mask)) 350 if (!((1 << channel) & ar2->channel_mask))
281 return; 351 return;
282 352
283 mode = data[0] & 0x0F; 353 mode = data[0] & 0x0F;
@@ -305,7 +375,7 @@ static void ati_remote2_input_key(struct ati_remote2 *ar2)
305 ar2->mode = mode; 375 ar2->mode = mode;
306 } 376 }
307 377
308 if (!((1 << mode) & mode_mask)) 378 if (!((1 << mode) & ar2->mode_mask))
309 return; 379 return;
310 380
311 index = ati_remote2_lookup(hw_code); 381 index = ati_remote2_lookup(hw_code);
@@ -410,7 +480,7 @@ static int ati_remote2_getkeycode(struct input_dev *idev,
410 int index, mode; 480 int index, mode;
411 481
412 mode = scancode >> 8; 482 mode = scancode >> 8;
413 if (mode > ATI_REMOTE2_PC || !((1 << mode) & mode_mask)) 483 if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask))
414 return -EINVAL; 484 return -EINVAL;
415 485
416 index = ati_remote2_lookup(scancode & 0xFF); 486 index = ati_remote2_lookup(scancode & 0xFF);
@@ -427,7 +497,7 @@ static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keyc
427 int index, mode, old_keycode; 497 int index, mode, old_keycode;
428 498
429 mode = scancode >> 8; 499 mode = scancode >> 8;
430 if (mode > ATI_REMOTE2_PC || !((1 << mode) & mode_mask)) 500 if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask))
431 return -EINVAL; 501 return -EINVAL;
432 502
433 index = ati_remote2_lookup(scancode & 0xFF); 503 index = ati_remote2_lookup(scancode & 0xFF);
@@ -550,7 +620,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2)
550 } 620 }
551} 621}
552 622
553static int ati_remote2_setup(struct ati_remote2 *ar2) 623static int ati_remote2_setup(struct ati_remote2 *ar2, unsigned int ch_mask)
554{ 624{
555 int r, i, channel; 625 int r, i, channel;
556 626
@@ -565,8 +635,8 @@ static int ati_remote2_setup(struct ati_remote2 *ar2)
565 635
566 channel = 0; 636 channel = 0;
567 for (i = 0; i < 16; i++) { 637 for (i = 0; i < 16; i++) {
568 if ((1 << i) & channel_mask) { 638 if ((1 << i) & ch_mask) {
569 if (!(~(1 << i) & 0xFFFF & channel_mask)) 639 if (!(~(1 << i) & ch_mask))
570 channel = i + 1; 640 channel = i + 1;
571 break; 641 break;
572 } 642 }
@@ -585,6 +655,99 @@ static int ati_remote2_setup(struct ati_remote2 *ar2)
585 return 0; 655 return 0;
586} 656}
587 657
658static ssize_t ati_remote2_show_channel_mask(struct device *dev,
659 struct device_attribute *attr,
660 char *buf)
661{
662 struct usb_device *udev = to_usb_device(dev);
663 struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
664 struct ati_remote2 *ar2 = usb_get_intfdata(intf);
665
666 return sprintf(buf, "0x%04x\n", ar2->channel_mask);
667}
668
669static ssize_t ati_remote2_store_channel_mask(struct device *dev,
670 struct device_attribute *attr,
671 const char *buf, size_t count)
672{
673 struct usb_device *udev = to_usb_device(dev);
674 struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
675 struct ati_remote2 *ar2 = usb_get_intfdata(intf);
676 unsigned long mask;
677 int r;
678
679 if (strict_strtoul(buf, 0, &mask))
680 return -EINVAL;
681
682 if (mask & ~ATI_REMOTE2_MAX_CHANNEL_MASK)
683 return -EINVAL;
684
685 r = usb_autopm_get_interface(ar2->intf[0]);
686 if (r) {
687 dev_err(&ar2->intf[0]->dev,
688 "%s(): usb_autopm_get_interface() = %d\n", __func__, r);
689 return r;
690 }
691
692 mutex_lock(&ati_remote2_mutex);
693
694 if (mask != ar2->channel_mask && !ati_remote2_setup(ar2, mask))
695 ar2->channel_mask = mask;
696
697 mutex_unlock(&ati_remote2_mutex);
698
699 usb_autopm_put_interface(ar2->intf[0]);
700
701 return count;
702}
703
704static ssize_t ati_remote2_show_mode_mask(struct device *dev,
705 struct device_attribute *attr,
706 char *buf)
707{
708 struct usb_device *udev = to_usb_device(dev);
709 struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
710 struct ati_remote2 *ar2 = usb_get_intfdata(intf);
711
712 return sprintf(buf, "0x%02x\n", ar2->mode_mask);
713}
714
715static ssize_t ati_remote2_store_mode_mask(struct device *dev,
716 struct device_attribute *attr,
717 const char *buf, size_t count)
718{
719 struct usb_device *udev = to_usb_device(dev);
720 struct usb_interface *intf = usb_ifnum_to_if(udev, 0);
721 struct ati_remote2 *ar2 = usb_get_intfdata(intf);
722 unsigned long mask;
723
724 if (strict_strtoul(buf, 0, &mask))
725 return -EINVAL;
726
727 if (mask & ~ATI_REMOTE2_MAX_MODE_MASK)
728 return -EINVAL;
729
730 ar2->mode_mask = mask;
731
732 return count;
733}
734
735static DEVICE_ATTR(channel_mask, 0644, ati_remote2_show_channel_mask,
736 ati_remote2_store_channel_mask);
737
738static DEVICE_ATTR(mode_mask, 0644, ati_remote2_show_mode_mask,
739 ati_remote2_store_mode_mask);
740
741static struct attribute *ati_remote2_attrs[] = {
742 &dev_attr_channel_mask.attr,
743 &dev_attr_mode_mask.attr,
744 NULL,
745};
746
747static struct attribute_group ati_remote2_attr_group = {
748 .attrs = ati_remote2_attrs,
749};
750
588static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id) 751static int ati_remote2_probe(struct usb_interface *interface, const struct usb_device_id *id)
589{ 752{
590 struct usb_device *udev = interface_to_usbdev(interface); 753 struct usb_device *udev = interface_to_usbdev(interface);
@@ -615,7 +778,10 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d
615 if (r) 778 if (r)
616 goto fail2; 779 goto fail2;
617 780
618 r = ati_remote2_setup(ar2); 781 ar2->channel_mask = channel_mask;
782 ar2->mode_mask = mode_mask;
783
784 r = ati_remote2_setup(ar2, ar2->channel_mask);
619 if (r) 785 if (r)
620 goto fail2; 786 goto fail2;
621 787
@@ -624,19 +790,24 @@ static int ati_remote2_probe(struct usb_interface *interface, const struct usb_d
624 790
625 strlcat(ar2->name, "ATI Remote Wonder II", sizeof(ar2->name)); 791 strlcat(ar2->name, "ATI Remote Wonder II", sizeof(ar2->name));
626 792
627 r = ati_remote2_input_init(ar2); 793 r = sysfs_create_group(&udev->dev.kobj, &ati_remote2_attr_group);
628 if (r) 794 if (r)
629 goto fail2; 795 goto fail2;
630 796
797 r = ati_remote2_input_init(ar2);
798 if (r)
799 goto fail3;
800
631 usb_set_intfdata(interface, ar2); 801 usb_set_intfdata(interface, ar2);
632 802
633 interface->needs_remote_wakeup = 1; 803 interface->needs_remote_wakeup = 1;
634 804
635 return 0; 805 return 0;
636 806
807 fail3:
808 sysfs_remove_group(&udev->dev.kobj, &ati_remote2_attr_group);
637 fail2: 809 fail2:
638 ati_remote2_urb_cleanup(ar2); 810 ati_remote2_urb_cleanup(ar2);
639
640 usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]); 811 usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]);
641 fail1: 812 fail1:
642 kfree(ar2); 813 kfree(ar2);
@@ -657,6 +828,8 @@ static void ati_remote2_disconnect(struct usb_interface *interface)
657 828
658 input_unregister_device(ar2->idev); 829 input_unregister_device(ar2->idev);
659 830
831 sysfs_remove_group(&ar2->udev->dev.kobj, &ati_remote2_attr_group);
832
660 ati_remote2_urb_cleanup(ar2); 833 ati_remote2_urb_cleanup(ar2);
661 834
662 usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]); 835 usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]);
@@ -715,6 +888,78 @@ static int ati_remote2_resume(struct usb_interface *interface)
715 return r; 888 return r;
716} 889}
717 890
891static int ati_remote2_reset_resume(struct usb_interface *interface)
892{
893 struct ati_remote2 *ar2;
894 struct usb_host_interface *alt = interface->cur_altsetting;
895 int r = 0;
896
897 if (alt->desc.bInterfaceNumber)
898 return 0;
899
900 ar2 = usb_get_intfdata(interface);
901
902 dev_dbg(&ar2->intf[0]->dev, "%s()\n", __func__);
903
904 mutex_lock(&ati_remote2_mutex);
905
906 r = ati_remote2_setup(ar2, ar2->channel_mask);
907 if (r)
908 goto out;
909
910 if (ar2->flags & ATI_REMOTE2_OPENED)
911 r = ati_remote2_submit_urbs(ar2);
912
913 if (!r)
914 ar2->flags &= ~ATI_REMOTE2_SUSPENDED;
915
916 out:
917 mutex_unlock(&ati_remote2_mutex);
918
919 return r;
920}
921
922static int ati_remote2_pre_reset(struct usb_interface *interface)
923{
924 struct ati_remote2 *ar2;
925 struct usb_host_interface *alt = interface->cur_altsetting;
926
927 if (alt->desc.bInterfaceNumber)
928 return 0;
929
930 ar2 = usb_get_intfdata(interface);
931
932 dev_dbg(&ar2->intf[0]->dev, "%s()\n", __func__);
933
934 mutex_lock(&ati_remote2_mutex);
935
936 if (ar2->flags == ATI_REMOTE2_OPENED)
937 ati_remote2_kill_urbs(ar2);
938
939 return 0;
940}
941
942static int ati_remote2_post_reset(struct usb_interface *interface)
943{
944 struct ati_remote2 *ar2;
945 struct usb_host_interface *alt = interface->cur_altsetting;
946 int r = 0;
947
948 if (alt->desc.bInterfaceNumber)
949 return 0;
950
951 ar2 = usb_get_intfdata(interface);
952
953 dev_dbg(&ar2->intf[0]->dev, "%s()\n", __func__);
954
955 if (ar2->flags == ATI_REMOTE2_OPENED)
956 r = ati_remote2_submit_urbs(ar2);
957
958 mutex_unlock(&ati_remote2_mutex);
959
960 return r;
961}
962
718static int __init ati_remote2_init(void) 963static int __init ati_remote2_init(void)
719{ 964{
720 int r; 965 int r;
diff --git a/drivers/input/misc/rb532_button.c b/drivers/input/misc/rb532_button.c
new file mode 100644
index 000000000000..e2c7f622a0b5
--- /dev/null
+++ b/drivers/input/misc/rb532_button.c
@@ -0,0 +1,120 @@
1/*
2 * Support for the S1 button on Routerboard 532
3 *
4 * Copyright (C) 2009 Phil Sutter <n0-1@freewrt.org>
5 */
6
7#include <linux/input-polldev.h>
8#include <linux/module.h>
9#include <linux/platform_device.h>
10
11#include <asm/mach-rc32434/gpio.h>
12#include <asm/mach-rc32434/rb.h>
13
14#define DRV_NAME "rb532-button"
15
16#define RB532_BTN_RATE 100 /* msec */
17#define RB532_BTN_KSYM BTN_0
18
19/* The S1 button state is provided by GPIO pin 1. But as this
20 * pin is also used for uart input as alternate function, the
21 * operational modes must be switched first:
22 * 1) disable uart using set_latch_u5()
23 * 2) turn off alternate function implicitly through
24 * gpio_direction_input()
25 * 3) read the GPIO's current value
26 * 4) undo step 2 by enabling alternate function (in this
27 * mode the GPIO direction is fixed, so no change needed)
28 * 5) turn on uart again
29 * The GPIO value occurs to be inverted, so pin high means
30 * button is not pressed.
31 */
32static bool rb532_button_pressed(void)
33{
34 int val;
35
36 set_latch_u5(0, LO_FOFF);
37 gpio_direction_input(GPIO_BTN_S1);
38
39 val = gpio_get_value(GPIO_BTN_S1);
40
41 rb532_gpio_set_func(GPIO_BTN_S1);
42 set_latch_u5(LO_FOFF, 0);
43
44 return !val;
45}
46
47static void rb532_button_poll(struct input_polled_dev *poll_dev)
48{
49 input_report_key(poll_dev->input, RB532_BTN_KSYM,
50 rb532_button_pressed());
51 input_sync(poll_dev->input);
52}
53
54static int __devinit rb532_button_probe(struct platform_device *pdev)
55{
56 struct input_polled_dev *poll_dev;
57 int error;
58
59 poll_dev = input_allocate_polled_device();
60 if (!poll_dev)
61 return -ENOMEM;
62
63 poll_dev->poll = rb532_button_poll;
64 poll_dev->poll_interval = RB532_BTN_RATE;
65
66 poll_dev->input->name = "rb532 button";
67 poll_dev->input->phys = "rb532/button0";
68 poll_dev->input->id.bustype = BUS_HOST;
69 poll_dev->input->dev.parent = &pdev->dev;
70
71 dev_set_drvdata(&pdev->dev, poll_dev);
72
73 input_set_capability(poll_dev->input, EV_KEY, RB532_BTN_KSYM);
74
75 error = input_register_polled_device(poll_dev);
76 if (error) {
77 input_free_polled_device(poll_dev);
78 return error;
79 }
80
81 return 0;
82}
83
84static int __devexit rb532_button_remove(struct platform_device *pdev)
85{
86 struct input_polled_dev *poll_dev = dev_get_drvdata(&pdev->dev);
87
88 input_unregister_polled_device(poll_dev);
89 input_free_polled_device(poll_dev);
90 dev_set_drvdata(&pdev->dev, NULL);
91
92 return 0;
93}
94
95static struct platform_driver rb532_button_driver = {
96 .probe = rb532_button_probe,
97 .remove = __devexit_p(rb532_button_remove),
98 .driver = {
99 .name = DRV_NAME,
100 .owner = THIS_MODULE,
101 },
102};
103
104static int __init rb532_button_init(void)
105{
106 return platform_driver_register(&rb532_button_driver);
107}
108
109static void __exit rb532_button_exit(void)
110{
111 platform_driver_unregister(&rb532_button_driver);
112}
113
114module_init(rb532_button_init);
115module_exit(rb532_button_exit);
116
117MODULE_AUTHOR("Phil Sutter <n0-1@freewrt.org>");
118MODULE_LICENSE("GPL");
119MODULE_DESCRIPTION("Support for S1 button on Routerboard 532");
120MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
new file mode 100644
index 000000000000..5bb3ab51b8c6
--- /dev/null
+++ b/drivers/input/misc/rotary_encoder.c
@@ -0,0 +1,221 @@
1/*
2 * rotary_encoder.c
3 *
4 * (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * state machine code inspired by code from Tim Ruetz
7 *
8 * A generic driver for rotary encoders connected to GPIO lines.
9 * See file:Documentation/input/rotary_encoder.txt for more information
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/input.h>
21#include <linux/device.h>
22#include <linux/platform_device.h>
23#include <linux/gpio.h>
24#include <linux/rotary_encoder.h>
25
26#define DRV_NAME "rotary-encoder"
27
28struct rotary_encoder {
29 unsigned int irq_a;
30 unsigned int irq_b;
31 unsigned int pos;
32 unsigned int armed;
33 unsigned int dir;
34 struct input_dev *input;
35 struct rotary_encoder_platform_data *pdata;
36};
37
38static irqreturn_t rotary_encoder_irq(int irq, void *dev_id)
39{
40 struct rotary_encoder *encoder = dev_id;
41 struct rotary_encoder_platform_data *pdata = encoder->pdata;
42 int a = !!gpio_get_value(pdata->gpio_a);
43 int b = !!gpio_get_value(pdata->gpio_b);
44 int state;
45
46 a ^= pdata->inverted_a;
47 b ^= pdata->inverted_b;
48 state = (a << 1) | b;
49
50 switch (state) {
51
52 case 0x0:
53 if (!encoder->armed)
54 break;
55
56 if (encoder->dir) {
57 /* turning counter-clockwise */
58 encoder->pos += pdata->steps;
59 encoder->pos--;
60 encoder->pos %= pdata->steps;
61 } else {
62 /* turning clockwise */
63 encoder->pos++;
64 encoder->pos %= pdata->steps;
65 }
66
67 input_report_abs(encoder->input, pdata->axis, encoder->pos);
68 input_sync(encoder->input);
69
70 encoder->armed = 0;
71 break;
72
73 case 0x1:
74 case 0x2:
75 if (encoder->armed)
76 encoder->dir = state - 1;
77 break;
78
79 case 0x3:
80 encoder->armed = 1;
81 break;
82 }
83
84 return IRQ_HANDLED;
85}
86
87static int __devinit rotary_encoder_probe(struct platform_device *pdev)
88{
89 struct rotary_encoder_platform_data *pdata = pdev->dev.platform_data;
90 struct rotary_encoder *encoder;
91 struct input_dev *input;
92 int err;
93
94 if (!pdata || !pdata->steps) {
95 dev_err(&pdev->dev, "invalid platform data\n");
96 return -ENOENT;
97 }
98
99 encoder = kzalloc(sizeof(struct rotary_encoder), GFP_KERNEL);
100 input = input_allocate_device();
101 if (!encoder || !input) {
102 dev_err(&pdev->dev, "failed to allocate memory for device\n");
103 err = -ENOMEM;
104 goto exit_free_mem;
105 }
106
107 encoder->input = input;
108 encoder->pdata = pdata;
109 encoder->irq_a = gpio_to_irq(pdata->gpio_a);
110 encoder->irq_b = gpio_to_irq(pdata->gpio_b);
111
112 /* create and register the input driver */
113 input->name = pdev->name;
114 input->id.bustype = BUS_HOST;
115 input->dev.parent = &pdev->dev;
116 input->evbit[0] = BIT_MASK(EV_ABS);
117 input_set_abs_params(encoder->input,
118 pdata->axis, 0, pdata->steps, 0, 1);
119
120 err = input_register_device(input);
121 if (err) {
122 dev_err(&pdev->dev, "failed to register input device\n");
123 goto exit_free_mem;
124 }
125
126 /* request the GPIOs */
127 err = gpio_request(pdata->gpio_a, DRV_NAME);
128 if (err) {
129 dev_err(&pdev->dev, "unable to request GPIO %d\n",
130 pdata->gpio_a);
131 goto exit_unregister_input;
132 }
133
134 err = gpio_request(pdata->gpio_b, DRV_NAME);
135 if (err) {
136 dev_err(&pdev->dev, "unable to request GPIO %d\n",
137 pdata->gpio_b);
138 goto exit_free_gpio_a;
139 }
140
141 /* request the IRQs */
142 err = request_irq(encoder->irq_a, &rotary_encoder_irq,
143 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE,
144 DRV_NAME, encoder);
145 if (err) {
146 dev_err(&pdev->dev, "unable to request IRQ %d\n",
147 encoder->irq_a);
148 goto exit_free_gpio_b;
149 }
150
151 err = request_irq(encoder->irq_b, &rotary_encoder_irq,
152 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE,
153 DRV_NAME, encoder);
154 if (err) {
155 dev_err(&pdev->dev, "unable to request IRQ %d\n",
156 encoder->irq_b);
157 goto exit_free_irq_a;
158 }
159
160 platform_set_drvdata(pdev, encoder);
161
162 return 0;
163
164exit_free_irq_a:
165 free_irq(encoder->irq_a, encoder);
166exit_free_gpio_b:
167 gpio_free(pdata->gpio_b);
168exit_free_gpio_a:
169 gpio_free(pdata->gpio_a);
170exit_unregister_input:
171 input_unregister_device(input);
172 input = NULL; /* so we don't try to free it */
173exit_free_mem:
174 input_free_device(input);
175 kfree(encoder);
176 return err;
177}
178
179static int __devexit rotary_encoder_remove(struct platform_device *pdev)
180{
181 struct rotary_encoder *encoder = platform_get_drvdata(pdev);
182 struct rotary_encoder_platform_data *pdata = pdev->dev.platform_data;
183
184 free_irq(encoder->irq_a, encoder);
185 free_irq(encoder->irq_b, encoder);
186 gpio_free(pdata->gpio_a);
187 gpio_free(pdata->gpio_b);
188 input_unregister_device(encoder->input);
189 platform_set_drvdata(pdev, NULL);
190 kfree(encoder);
191
192 return 0;
193}
194
195static struct platform_driver rotary_encoder_driver = {
196 .probe = rotary_encoder_probe,
197 .remove = __devexit_p(rotary_encoder_remove),
198 .driver = {
199 .name = DRV_NAME,
200 .owner = THIS_MODULE,
201 }
202};
203
204static int __init rotary_encoder_init(void)
205{
206 return platform_driver_register(&rotary_encoder_driver);
207}
208
209static void __exit rotary_encoder_exit(void)
210{
211 platform_driver_unregister(&rotary_encoder_driver);
212}
213
214module_init(rotary_encoder_init);
215module_exit(rotary_encoder_exit);
216
217MODULE_ALIAS("platform:" DRV_NAME);
218MODULE_DESCRIPTION("GPIO rotary encoder driver");
219MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
220MODULE_LICENSE("GPL v2");
221
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index 4f38e6f7dfdd..c66cc3d08c2f 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -292,4 +292,15 @@ config MOUSE_PXA930_TRKBALL
292 help 292 help
293 Say Y here to support PXA930 Trackball mouse. 293 Say Y here to support PXA930 Trackball mouse.
294 294
295config MOUSE_MAPLE
296 tristate "Maple mouse (for the Dreamcast)"
297 depends on MAPLE
298 help
299 This driver supports the Maple mouse on the SEGA Dreamcast.
300
301 Most Dreamcast users, who have a mouse, will say Y here.
302
303 To compile this driver as a module choose M here: the module will be
304 called maplemouse.
305
295endif 306endif
diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
index 8c8a1f236e28..472189468d67 100644
--- a/drivers/input/mouse/Makefile
+++ b/drivers/input/mouse/Makefile
@@ -6,18 +6,19 @@
6 6
7obj-$(CONFIG_MOUSE_AMIGA) += amimouse.o 7obj-$(CONFIG_MOUSE_AMIGA) += amimouse.o
8obj-$(CONFIG_MOUSE_APPLETOUCH) += appletouch.o 8obj-$(CONFIG_MOUSE_APPLETOUCH) += appletouch.o
9obj-$(CONFIG_MOUSE_BCM5974) += bcm5974.o
10obj-$(CONFIG_MOUSE_ATARI) += atarimouse.o 9obj-$(CONFIG_MOUSE_ATARI) += atarimouse.o
11obj-$(CONFIG_MOUSE_RISCPC) += rpcmouse.o 10obj-$(CONFIG_MOUSE_BCM5974) += bcm5974.o
11obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o
12obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o
12obj-$(CONFIG_MOUSE_INPORT) += inport.o 13obj-$(CONFIG_MOUSE_INPORT) += inport.o
13obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o 14obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o
15obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o
14obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o 16obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o
15obj-$(CONFIG_MOUSE_PS2) += psmouse.o 17obj-$(CONFIG_MOUSE_PS2) += psmouse.o
16obj-$(CONFIG_MOUSE_PXA930_TRKBALL) += pxa930_trkball.o 18obj-$(CONFIG_MOUSE_PXA930_TRKBALL) += pxa930_trkball.o
19obj-$(CONFIG_MOUSE_RISCPC) += rpcmouse.o
17obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o 20obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
18obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o
19obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o 21obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o
20obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o
21 22
22psmouse-objs := psmouse-base.o synaptics.o 23psmouse-objs := psmouse-base.o synaptics.o
23 24
diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 55cd0fa68339..a1ad2f1a7bb3 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -472,7 +472,7 @@ static enum hgpk_model_t hgpk_get_model(struct psmouse *psmouse)
472 return -EIO; 472 return -EIO;
473 } 473 }
474 474
475 hgpk_dbg(psmouse, "ID: %02x %02x %02x", param[0], param[1], param[2]); 475 hgpk_dbg(psmouse, "ID: %02x %02x %02x\n", param[0], param[1], param[2]);
476 476
477 /* HGPK signature: 0x67, 0x00, 0x<model> */ 477 /* HGPK signature: 0x67, 0x00, 0x<model> */
478 if (param[0] != 0x67 || param[1] != 0x00) 478 if (param[0] != 0x67 || param[1] != 0x00)
diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c
new file mode 100644
index 000000000000..d196abfb68bc
--- /dev/null
+++ b/drivers/input/mouse/maplemouse.c
@@ -0,0 +1,147 @@
1/*
2 * SEGA Dreamcast mouse driver
3 * Based on drivers/usb/usbmouse.c
4 *
5 * Copyright Yaegashi Takeshi, 2001
6 * Adrian McMenamin, 2008
7 */
8
9#include <linux/kernel.h>
10#include <linux/slab.h>
11#include <linux/input.h>
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/timer.h>
15#include <linux/maple.h>
16
17MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
18MODULE_DESCRIPTION("SEGA Dreamcast mouse driver");
19MODULE_LICENSE("GPL");
20
21struct dc_mouse {
22 struct input_dev *dev;
23 struct maple_device *mdev;
24};
25
26static void dc_mouse_callback(struct mapleq *mq)
27{
28 int buttons, relx, rely, relz;
29 struct maple_device *mapledev = mq->dev;
30 struct dc_mouse *mse = maple_get_drvdata(mapledev);
31 struct input_dev *dev = mse->dev;
32 unsigned char *res = mq->recvbuf;
33
34 buttons = ~res[8];
35 relx = *(unsigned short *)(res + 12) - 512;
36 rely = *(unsigned short *)(res + 14) - 512;
37 relz = *(unsigned short *)(res + 16) - 512;
38
39 input_report_key(dev, BTN_LEFT, buttons & 4);
40 input_report_key(dev, BTN_MIDDLE, buttons & 9);
41 input_report_key(dev, BTN_RIGHT, buttons & 2);
42 input_report_rel(dev, REL_X, relx);
43 input_report_rel(dev, REL_Y, rely);
44 input_report_rel(dev, REL_WHEEL, relz);
45 input_sync(dev);
46}
47
48static int dc_mouse_open(struct input_dev *dev)
49{
50 struct dc_mouse *mse = dev->dev.platform_data;
51
52 maple_getcond_callback(mse->mdev, dc_mouse_callback, HZ/50,
53 MAPLE_FUNC_MOUSE);
54
55 return 0;
56}
57
58static void dc_mouse_close(struct input_dev *dev)
59{
60 struct dc_mouse *mse = dev->dev.platform_data;
61
62 maple_getcond_callback(mse->mdev, dc_mouse_callback, 0,
63 MAPLE_FUNC_MOUSE);
64}
65
66
67static int __devinit probe_maple_mouse(struct device *dev)
68{
69 struct maple_device *mdev = to_maple_dev(dev);
70 struct maple_driver *mdrv = to_maple_driver(dev->driver);
71 struct input_dev *input_dev;
72 struct dc_mouse *mse;
73 int error;
74
75 mse = kzalloc(sizeof(struct dc_mouse), GFP_KERNEL);
76 input_dev = input_allocate_device();
77
78 if (!mse || !input_dev) {
79 error = -ENOMEM;
80 goto fail;
81 }
82
83 mse->dev = input_dev;
84 mse->mdev = mdev;
85
86 input_set_drvdata(input_dev, mse);
87 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
88 input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
89 BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
90 input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y) |
91 BIT_MASK(REL_WHEEL);
92 input_dev->name = mdev->product_name;
93 input_dev->id.bustype = BUS_HOST;
94 input_dev->open = dc_mouse_open;
95 input_dev->close = dc_mouse_close;
96
97 mdev->driver = mdrv;
98 maple_set_drvdata(mdev, mse);
99
100 error = input_register_device(input_dev);
101 if (error)
102 goto fail;
103
104 return 0;
105
106fail:
107 input_free_device(input_dev);
108 maple_set_drvdata(mdev, NULL);
109 kfree(mse);
110 mdev->driver = NULL;
111 return error;
112}
113
114static int __devexit remove_maple_mouse(struct device *dev)
115{
116 struct maple_device *mdev = to_maple_dev(dev);
117 struct dc_mouse *mse = maple_get_drvdata(mdev);
118
119 mdev->callback = NULL;
120 input_unregister_device(mse->dev);
121 maple_set_drvdata(mdev, NULL);
122 kfree(mse);
123
124 return 0;
125}
126
127static struct maple_driver dc_mouse_driver = {
128 .function = MAPLE_FUNC_MOUSE,
129 .drv = {
130 .name = "Dreamcast_mouse",
131 .probe = probe_maple_mouse,
132 .remove = __devexit_p(remove_maple_mouse),
133 },
134};
135
136static int __init dc_mouse_init(void)
137{
138 return maple_driver_register(&dc_mouse_driver);
139}
140
141static void __exit dc_mouse_exit(void)
142{
143 maple_driver_unregister(&dc_mouse_driver);
144}
145
146module_init(dc_mouse_init);
147module_exit(dc_mouse_exit);
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
index fd09c8df81f2..f63995f854ff 100644
--- a/drivers/input/mouse/pc110pad.c
+++ b/drivers/input/mouse/pc110pad.c
@@ -111,11 +111,8 @@ static int __init pc110pad_init(void)
111 struct pci_dev *dev; 111 struct pci_dev *dev;
112 int err; 112 int err;
113 113
114 dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); 114 if (!no_pci_devices())
115 if (dev) {
116 pci_dev_put(dev);
117 return -ENODEV; 115 return -ENODEV;
118 }
119 116
120 if (!request_region(pc110pad_io, 4, "pc110pad")) { 117 if (!request_region(pc110pad_io, 4, "pc110pad")) {
121 printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n", 118 printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n",
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 6fa2deff7446..83ed2d56b924 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -151,6 +151,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
151 DMI_MATCH(DMI_PRODUCT_VERSION, "01"), 151 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
152 }, 152 },
153 }, 153 },
154 {
155 .ident = "HP DV9700",
156 .matches = {
157 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
158 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
159 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
160 },
161 },
154 { } 162 { }
155}; 163};
156 164
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index bb6486a8c070..b01fd61dadcc 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -29,6 +29,51 @@ config TOUCHSCREEN_ADS7846
29 To compile this driver as a module, choose M here: the 29 To compile this driver as a module, choose M here: the
30 module will be called ads7846. 30 module will be called ads7846.
31 31
32config TOUCHSCREEN_AD7877
33 tristate "AD7877 based touchscreens"
34 depends on SPI_MASTER
35 help
36 Say Y here if you have a touchscreen interface using the
37 AD7877 controller, and your board-specific initialization
38 code includes that in its table of SPI devices.
39
40 If unsure, say N (but it's safe to say "Y").
41
42 To compile this driver as a module, choose M here: the
43 module will be called ad7877.
44
45config TOUCHSCREEN_AD7879_I2C
46 tristate "AD7879 based touchscreens: AD7879-1 I2C Interface"
47 depends on I2C
48 select TOUCHSCREEN_AD7879
49 help
50 Say Y here if you have a touchscreen interface using the
51 AD7879-1 controller, and your board-specific initialization
52 code includes that in its table of I2C devices.
53
54 If unsure, say N (but it's safe to say "Y").
55
56 To compile this driver as a module, choose M here: the
57 module will be called ad7879.
58
59config TOUCHSCREEN_AD7879_SPI
60 tristate "AD7879 based touchscreens: AD7879 SPI Interface"
61 depends on SPI_MASTER && TOUCHSCREEN_AD7879_I2C = n
62 select TOUCHSCREEN_AD7879
63 help
64 Say Y here if you have a touchscreen interface using the
65 AD7879 controller, and your board-specific initialization
66 code includes that in its table of SPI devices.
67
68 If unsure, say N (but it's safe to say "Y").
69
70 To compile this driver as a module, choose M here: the
71 module will be called ad7879.
72
73config TOUCHSCREEN_AD7879
74 tristate
75 default n
76
32config TOUCHSCREEN_BITSY 77config TOUCHSCREEN_BITSY
33 tristate "Compaq iPAQ H3600 (Bitsy) touchscreen" 78 tristate "Compaq iPAQ H3600 (Bitsy) touchscreen"
34 depends on SA1100_BITSY 79 depends on SA1100_BITSY
@@ -308,6 +353,19 @@ config TOUCHSCREEN_WM97XX_MAINSTONE
308 To compile this driver as a module, choose M here: the 353 To compile this driver as a module, choose M here: the
309 module will be called mainstone-wm97xx. 354 module will be called mainstone-wm97xx.
310 355
356config TOUCHSCREEN_WM97XX_ZYLONITE
357 tristate "Zylonite accelerated touch"
358 depends on TOUCHSCREEN_WM97XX && MACH_ZYLONITE
359 select TOUCHSCREEN_WM9713
360 help
361 Say Y here for support for streaming mode with the touchscreen
362 on Zylonite systems.
363
364 If unsure, say N.
365
366 To compile this driver as a module, choose M here: the
367 module will be called zylonite-wm97xx.
368
311config TOUCHSCREEN_USB_COMPOSITE 369config TOUCHSCREEN_USB_COMPOSITE
312 tristate "USB Touchscreen Driver" 370 tristate "USB Touchscreen Driver"
313 depends on USB_ARCH_HAS_HCD 371 depends on USB_ARCH_HAS_HCD
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index d3375aff46fe..6700f7b9d165 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -6,6 +6,8 @@
6 6
7wm97xx-ts-y := wm97xx-core.o 7wm97xx-ts-y := wm97xx-core.o
8 8
9obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o
10obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o
9obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o 11obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
10obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o 12obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
11obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o 13obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
@@ -34,3 +36,4 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
34wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o 36wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
35wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o 37wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o
36obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o 38obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o
39obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
new file mode 100644
index 000000000000..e4728a28f492
--- /dev/null
+++ b/drivers/input/touchscreen/ad7877.c
@@ -0,0 +1,844 @@
1/*
2 * Copyright (C) 2006-2008 Michael Hennerich, Analog Devices Inc.
3 *
4 * Description: AD7877 based touchscreen, sensor (ADCs), DAC and GPIO driver
5 * Based on: ads7846.c
6 *
7 * Bugs: Enter bugs at http://blackfin.uclinux.org/
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, see the file COPYING, or write
21 * to the Free Software Foundation, Inc.,
22 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 *
24 * History:
25 * Copyright (c) 2005 David Brownell
26 * Copyright (c) 2006 Nokia Corporation
27 * Various changes: Imre Deak <imre.deak@nokia.com>
28 *
29 * Using code from:
30 * - corgi_ts.c
31 * Copyright (C) 2004-2005 Richard Purdie
32 * - omap_ts.[hc], ads7846.h, ts_osk.c
33 * Copyright (C) 2002 MontaVista Software
34 * Copyright (C) 2004 Texas Instruments
35 * Copyright (C) 2005 Dirk Behme
36 */
37
38
39#include <linux/device.h>
40#include <linux/init.h>
41#include <linux/delay.h>
42#include <linux/input.h>
43#include <linux/interrupt.h>
44#include <linux/slab.h>
45#include <linux/spi/spi.h>
46#include <linux/spi/ad7877.h>
47#include <asm/irq.h>
48
49#define TS_PEN_UP_TIMEOUT msecs_to_jiffies(50)
50
51#define MAX_SPI_FREQ_HZ 20000000
52#define MAX_12BIT ((1<<12)-1)
53
54#define AD7877_REG_ZEROS 0
55#define AD7877_REG_CTRL1 1
56#define AD7877_REG_CTRL2 2
57#define AD7877_REG_ALERT 3
58#define AD7877_REG_AUX1HIGH 4
59#define AD7877_REG_AUX1LOW 5
60#define AD7877_REG_BAT1HIGH 6
61#define AD7877_REG_BAT1LOW 7
62#define AD7877_REG_BAT2HIGH 8
63#define AD7877_REG_BAT2LOW 9
64#define AD7877_REG_TEMP1HIGH 10
65#define AD7877_REG_TEMP1LOW 11
66#define AD7877_REG_SEQ0 12
67#define AD7877_REG_SEQ1 13
68#define AD7877_REG_DAC 14
69#define AD7877_REG_NONE1 15
70#define AD7877_REG_EXTWRITE 15
71#define AD7877_REG_XPLUS 16
72#define AD7877_REG_YPLUS 17
73#define AD7877_REG_Z2 18
74#define AD7877_REG_aux1 19
75#define AD7877_REG_aux2 20
76#define AD7877_REG_aux3 21
77#define AD7877_REG_bat1 22
78#define AD7877_REG_bat2 23
79#define AD7877_REG_temp1 24
80#define AD7877_REG_temp2 25
81#define AD7877_REG_Z1 26
82#define AD7877_REG_GPIOCTRL1 27
83#define AD7877_REG_GPIOCTRL2 28
84#define AD7877_REG_GPIODATA 29
85#define AD7877_REG_NONE2 30
86#define AD7877_REG_NONE3 31
87
88#define AD7877_SEQ_YPLUS_BIT (1<<11)
89#define AD7877_SEQ_XPLUS_BIT (1<<10)
90#define AD7877_SEQ_Z2_BIT (1<<9)
91#define AD7877_SEQ_AUX1_BIT (1<<8)
92#define AD7877_SEQ_AUX2_BIT (1<<7)
93#define AD7877_SEQ_AUX3_BIT (1<<6)
94#define AD7877_SEQ_BAT1_BIT (1<<5)
95#define AD7877_SEQ_BAT2_BIT (1<<4)
96#define AD7877_SEQ_TEMP1_BIT (1<<3)
97#define AD7877_SEQ_TEMP2_BIT (1<<2)
98#define AD7877_SEQ_Z1_BIT (1<<1)
99
100enum {
101 AD7877_SEQ_YPOS = 0,
102 AD7877_SEQ_XPOS = 1,
103 AD7877_SEQ_Z2 = 2,
104 AD7877_SEQ_AUX1 = 3,
105 AD7877_SEQ_AUX2 = 4,
106 AD7877_SEQ_AUX3 = 5,
107 AD7877_SEQ_BAT1 = 6,
108 AD7877_SEQ_BAT2 = 7,
109 AD7877_SEQ_TEMP1 = 8,
110 AD7877_SEQ_TEMP2 = 9,
111 AD7877_SEQ_Z1 = 10,
112 AD7877_NR_SENSE = 11,
113};
114
115/* DAC Register Default RANGE 0 to Vcc, Volatge Mode, DAC On */
116#define AD7877_DAC_CONF 0x1
117
118/* If gpio3 is set AUX3/GPIO3 acts as GPIO Output */
119#define AD7877_EXTW_GPIO_3_CONF 0x1C4
120#define AD7877_EXTW_GPIO_DATA 0x200
121
122/* Control REG 2 */
123#define AD7877_TMR(x) ((x & 0x3) << 0)
124#define AD7877_REF(x) ((x & 0x1) << 2)
125#define AD7877_POL(x) ((x & 0x1) << 3)
126#define AD7877_FCD(x) ((x & 0x3) << 4)
127#define AD7877_PM(x) ((x & 0x3) << 6)
128#define AD7877_ACQ(x) ((x & 0x3) << 8)
129#define AD7877_AVG(x) ((x & 0x3) << 10)
130
131/* Control REG 1 */
132#define AD7877_SER (1 << 11) /* non-differential */
133#define AD7877_DFR (0 << 11) /* differential */
134
135#define AD7877_MODE_NOC (0) /* Do not convert */
136#define AD7877_MODE_SCC (1) /* Single channel conversion */
137#define AD7877_MODE_SEQ0 (2) /* Sequence 0 in Slave Mode */
138#define AD7877_MODE_SEQ1 (3) /* Sequence 1 in Master Mode */
139
140#define AD7877_CHANADD(x) ((x&0xF)<<7)
141#define AD7877_READADD(x) ((x)<<2)
142#define AD7877_WRITEADD(x) ((x)<<12)
143
144#define AD7877_READ_CHAN(x) (AD7877_WRITEADD(AD7877_REG_CTRL1) | AD7877_SER | \
145 AD7877_MODE_SCC | AD7877_CHANADD(AD7877_REG_ ## x) | \
146 AD7877_READADD(AD7877_REG_ ## x))
147
148#define AD7877_MM_SEQUENCE (AD7877_SEQ_YPLUS_BIT | AD7877_SEQ_XPLUS_BIT | \
149 AD7877_SEQ_Z2_BIT | AD7877_SEQ_Z1_BIT)
150
151/*
152 * Non-touchscreen sensors only use single-ended conversions.
153 */
154
155struct ser_req {
156 u16 reset;
157 u16 ref_on;
158 u16 command;
159 u16 sample;
160 struct spi_message msg;
161 struct spi_transfer xfer[6];
162};
163
164struct ad7877 {
165 struct input_dev *input;
166 char phys[32];
167
168 struct spi_device *spi;
169 u16 model;
170 u16 vref_delay_usecs;
171 u16 x_plate_ohms;
172 u16 pressure_max;
173
174 u16 cmd_crtl1;
175 u16 cmd_crtl2;
176 u16 cmd_dummy;
177 u16 dac;
178
179 u8 stopacq_polarity;
180 u8 first_conversion_delay;
181 u8 acquisition_time;
182 u8 averaging;
183 u8 pen_down_acc_interval;
184
185 u16 conversion_data[AD7877_NR_SENSE];
186
187 struct spi_transfer xfer[AD7877_NR_SENSE + 2];
188 struct spi_message msg;
189
190 struct mutex mutex;
191 unsigned disabled:1; /* P: mutex */
192 unsigned gpio3:1; /* P: mutex */
193 unsigned gpio4:1; /* P: mutex */
194
195 spinlock_t lock;
196 struct timer_list timer; /* P: lock */
197 unsigned pending:1; /* P: lock */
198};
199
200static int gpio3;
201module_param(gpio3, int, 0);
202MODULE_PARM_DESC(gpio3, "If gpio3 is set to 1 AUX3 acts as GPIO3");
203
204/*
205 * ad7877_read/write are only used for initial setup and for sysfs controls.
206 * The main traffic is done using spi_async() in the interrupt handler.
207 */
208
209static int ad7877_read(struct spi_device *spi, u16 reg)
210{
211 struct ser_req *req;
212 int status, ret;
213
214 req = kzalloc(sizeof *req, GFP_KERNEL);
215 if (!req)
216 return -ENOMEM;
217
218 spi_message_init(&req->msg);
219
220 req->command = (u16) (AD7877_WRITEADD(AD7877_REG_CTRL1) |
221 AD7877_READADD(reg));
222 req->xfer[0].tx_buf = &req->command;
223 req->xfer[0].len = 2;
224
225 req->xfer[1].rx_buf = &req->sample;
226 req->xfer[1].len = 2;
227
228 spi_message_add_tail(&req->xfer[0], &req->msg);
229 spi_message_add_tail(&req->xfer[1], &req->msg);
230
231 status = spi_sync(spi, &req->msg);
232 ret = status ? : req->sample;
233
234 kfree(req);
235
236 return ret;
237}
238
239static int ad7877_write(struct spi_device *spi, u16 reg, u16 val)
240{
241 struct ser_req *req;
242 int status;
243
244 req = kzalloc(sizeof *req, GFP_KERNEL);
245 if (!req)
246 return -ENOMEM;
247
248 spi_message_init(&req->msg);
249
250 req->command = (u16) (AD7877_WRITEADD(reg) | (val & MAX_12BIT));
251 req->xfer[0].tx_buf = &req->command;
252 req->xfer[0].len = 2;
253
254 spi_message_add_tail(&req->xfer[0], &req->msg);
255
256 status = spi_sync(spi, &req->msg);
257
258 kfree(req);
259
260 return status;
261}
262
263static int ad7877_read_adc(struct spi_device *spi, unsigned command)
264{
265 struct ad7877 *ts = dev_get_drvdata(&spi->dev);
266 struct ser_req *req;
267 int status;
268 int sample;
269 int i;
270
271 req = kzalloc(sizeof *req, GFP_KERNEL);
272 if (!req)
273 return -ENOMEM;
274
275 spi_message_init(&req->msg);
276
277 /* activate reference, so it has time to settle; */
278 req->ref_on = AD7877_WRITEADD(AD7877_REG_CTRL2) |
279 AD7877_POL(ts->stopacq_polarity) |
280 AD7877_AVG(0) | AD7877_PM(2) | AD7877_TMR(0) |
281 AD7877_ACQ(ts->acquisition_time) | AD7877_FCD(0);
282
283 req->reset = AD7877_WRITEADD(AD7877_REG_CTRL1) | AD7877_MODE_NOC;
284
285 req->command = (u16) command;
286
287 req->xfer[0].tx_buf = &req->reset;
288 req->xfer[0].len = 2;
289
290 req->xfer[1].tx_buf = &req->ref_on;
291 req->xfer[1].len = 2;
292 req->xfer[1].delay_usecs = ts->vref_delay_usecs;
293
294 req->xfer[2].tx_buf = &req->command;
295 req->xfer[2].len = 2;
296 req->xfer[2].delay_usecs = ts->vref_delay_usecs;
297
298 req->xfer[3].rx_buf = &req->sample;
299 req->xfer[3].len = 2;
300
301 req->xfer[4].tx_buf = &ts->cmd_crtl2; /*REF OFF*/
302 req->xfer[4].len = 2;
303
304 req->xfer[5].tx_buf = &ts->cmd_crtl1; /*DEFAULT*/
305 req->xfer[5].len = 2;
306
307 /* group all the transfers together, so we can't interfere with
308 * reading touchscreen state; disable penirq while sampling
309 */
310 for (i = 0; i < 6; i++)
311 spi_message_add_tail(&req->xfer[i], &req->msg);
312
313 status = spi_sync(spi, &req->msg);
314 sample = req->sample;
315
316 kfree(req);
317
318 return status ? : sample;
319}
320
321static void ad7877_rx(struct ad7877 *ts)
322{
323 struct input_dev *input_dev = ts->input;
324 unsigned Rt;
325 u16 x, y, z1, z2;
326
327 x = ts->conversion_data[AD7877_SEQ_XPOS] & MAX_12BIT;
328 y = ts->conversion_data[AD7877_SEQ_YPOS] & MAX_12BIT;
329 z1 = ts->conversion_data[AD7877_SEQ_Z1] & MAX_12BIT;
330 z2 = ts->conversion_data[AD7877_SEQ_Z2] & MAX_12BIT;
331
332 /*
333 * The samples processed here are already preprocessed by the AD7877.
334 * The preprocessing function consists of an averaging filter.
335 * The combination of 'first conversion delay' and averaging provides a robust solution,
336 * discarding the spurious noise in the signal and keeping only the data of interest.
337 * The size of the averaging filter is programmable. (dev.platform_data, see linux/spi/ad7877.h)
338 * Other user-programmable conversion controls include variable acquisition time,
339 * and first conversion delay. Up to 16 averages can be taken per conversion.
340 */
341
342 if (likely(x && z1)) {
343 /* compute touch pressure resistance using equation #1 */
344 Rt = (z2 - z1) * x * ts->x_plate_ohms;
345 Rt /= z1;
346 Rt = (Rt + 2047) >> 12;
347
348 input_report_abs(input_dev, ABS_X, x);
349 input_report_abs(input_dev, ABS_Y, y);
350 input_report_abs(input_dev, ABS_PRESSURE, Rt);
351 input_sync(input_dev);
352 }
353}
354
355static inline void ad7877_ts_event_release(struct ad7877 *ts)
356{
357 struct input_dev *input_dev = ts->input;
358
359 input_report_abs(input_dev, ABS_PRESSURE, 0);
360 input_sync(input_dev);
361}
362
363static void ad7877_timer(unsigned long handle)
364{
365 struct ad7877 *ts = (void *)handle;
366
367 ad7877_ts_event_release(ts);
368}
369
370static irqreturn_t ad7877_irq(int irq, void *handle)
371{
372 struct ad7877 *ts = handle;
373 unsigned long flags;
374 int status;
375
376 /*
377 * The repeated conversion sequencer controlled by TMR kicked off
378 * too fast. We ignore the last and process the sample sequence
379 * currently in the queue. It can't be older than 9.4ms, and we
380 * need to avoid that ts->msg doesn't get issued twice while in work.
381 */
382
383 spin_lock_irqsave(&ts->lock, flags);
384 if (!ts->pending) {
385 ts->pending = 1;
386
387 status = spi_async(ts->spi, &ts->msg);
388 if (status)
389 dev_err(&ts->spi->dev, "spi_sync --> %d\n", status);
390 }
391 spin_unlock_irqrestore(&ts->lock, flags);
392
393 return IRQ_HANDLED;
394}
395
396static void ad7877_callback(void *_ts)
397{
398 struct ad7877 *ts = _ts;
399
400 spin_lock_irq(&ts->lock);
401
402 ad7877_rx(ts);
403 ts->pending = 0;
404 mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT);
405
406 spin_unlock_irq(&ts->lock);
407}
408
409static void ad7877_disable(struct ad7877 *ts)
410{
411 mutex_lock(&ts->mutex);
412
413 if (!ts->disabled) {
414 ts->disabled = 1;
415 disable_irq(ts->spi->irq);
416
417 /* Wait for spi_async callback */
418 while (ts->pending)
419 msleep(1);
420
421 if (del_timer_sync(&ts->timer))
422 ad7877_ts_event_release(ts);
423 }
424
425 /* we know the chip's in lowpower mode since we always
426 * leave it that way after every request
427 */
428
429 mutex_unlock(&ts->mutex);
430}
431
432static void ad7877_enable(struct ad7877 *ts)
433{
434 mutex_lock(&ts->mutex);
435
436 if (ts->disabled) {
437 ts->disabled = 0;
438 enable_irq(ts->spi->irq);
439 }
440
441 mutex_unlock(&ts->mutex);
442}
443
444#define SHOW(name) static ssize_t \
445name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
446{ \
447 struct ad7877 *ts = dev_get_drvdata(dev); \
448 ssize_t v = ad7877_read_adc(ts->spi, \
449 AD7877_READ_CHAN(name)); \
450 if (v < 0) \
451 return v; \
452 return sprintf(buf, "%u\n", (unsigned) v); \
453} \
454static DEVICE_ATTR(name, S_IRUGO, name ## _show, NULL);
455
456SHOW(aux1)
457SHOW(aux2)
458SHOW(aux3)
459SHOW(bat1)
460SHOW(bat2)
461SHOW(temp1)
462SHOW(temp2)
463
464static ssize_t ad7877_disable_show(struct device *dev,
465 struct device_attribute *attr, char *buf)
466{
467 struct ad7877 *ts = dev_get_drvdata(dev);
468
469 return sprintf(buf, "%u\n", ts->disabled);
470}
471
472static ssize_t ad7877_disable_store(struct device *dev,
473 struct device_attribute *attr,
474 const char *buf, size_t count)
475{
476 struct ad7877 *ts = dev_get_drvdata(dev);
477 unsigned long val;
478 int error;
479
480 error = strict_strtoul(buf, 10, &val);
481 if (error)
482 return error;
483
484 if (val)
485 ad7877_disable(ts);
486 else
487 ad7877_enable(ts);
488
489 return count;
490}
491
492static DEVICE_ATTR(disable, 0664, ad7877_disable_show, ad7877_disable_store);
493
494static ssize_t ad7877_dac_show(struct device *dev,
495 struct device_attribute *attr, char *buf)
496{
497 struct ad7877 *ts = dev_get_drvdata(dev);
498
499 return sprintf(buf, "%u\n", ts->dac);
500}
501
502static ssize_t ad7877_dac_store(struct device *dev,
503 struct device_attribute *attr,
504 const char *buf, size_t count)
505{
506 struct ad7877 *ts = dev_get_drvdata(dev);
507 unsigned long val;
508 int error;
509
510 error = strict_strtoul(buf, 10, &val);
511 if (error)
512 return error;
513
514 mutex_lock(&ts->mutex);
515 ts->dac = val & 0xFF;
516 ad7877_write(ts->spi, AD7877_REG_DAC, (ts->dac << 4) | AD7877_DAC_CONF);
517 mutex_unlock(&ts->mutex);
518
519 return count;
520}
521
522static DEVICE_ATTR(dac, 0664, ad7877_dac_show, ad7877_dac_store);
523
524static ssize_t ad7877_gpio3_show(struct device *dev,
525 struct device_attribute *attr, char *buf)
526{
527 struct ad7877 *ts = dev_get_drvdata(dev);
528
529 return sprintf(buf, "%u\n", ts->gpio3);
530}
531
532static ssize_t ad7877_gpio3_store(struct device *dev,
533 struct device_attribute *attr,
534 const char *buf, size_t count)
535{
536 struct ad7877 *ts = dev_get_drvdata(dev);
537 unsigned long val;
538 int error;
539
540 error = strict_strtoul(buf, 10, &val);
541 if (error)
542 return error;
543
544 mutex_lock(&ts->mutex);
545 ts->gpio3 = !!val;
546 ad7877_write(ts->spi, AD7877_REG_EXTWRITE, AD7877_EXTW_GPIO_DATA |
547 (ts->gpio4 << 4) | (ts->gpio3 << 5));
548 mutex_unlock(&ts->mutex);
549
550 return count;
551}
552
553static DEVICE_ATTR(gpio3, 0664, ad7877_gpio3_show, ad7877_gpio3_store);
554
555static ssize_t ad7877_gpio4_show(struct device *dev,
556 struct device_attribute *attr, char *buf)
557{
558 struct ad7877 *ts = dev_get_drvdata(dev);
559
560 return sprintf(buf, "%u\n", ts->gpio4);
561}
562
563static ssize_t ad7877_gpio4_store(struct device *dev,
564 struct device_attribute *attr,
565 const char *buf, size_t count)
566{
567 struct ad7877 *ts = dev_get_drvdata(dev);
568 unsigned long val;
569 int error;
570
571 error = strict_strtoul(buf, 10, &val);
572 if (error)
573 return error;
574
575 mutex_lock(&ts->mutex);
576 ts->gpio4 = !!val;
577 ad7877_write(ts->spi, AD7877_REG_EXTWRITE, AD7877_EXTW_GPIO_DATA |
578 (ts->gpio4 << 4) | (ts->gpio3 << 5));
579 mutex_unlock(&ts->mutex);
580
581 return count;
582}
583
584static DEVICE_ATTR(gpio4, 0664, ad7877_gpio4_show, ad7877_gpio4_store);
585
586static struct attribute *ad7877_attributes[] = {
587 &dev_attr_temp1.attr,
588 &dev_attr_temp2.attr,
589 &dev_attr_aux1.attr,
590 &dev_attr_aux2.attr,
591 &dev_attr_bat1.attr,
592 &dev_attr_bat2.attr,
593 &dev_attr_disable.attr,
594 &dev_attr_dac.attr,
595 &dev_attr_gpio4.attr,
596 NULL
597};
598
599static const struct attribute_group ad7877_attr_group = {
600 .attrs = ad7877_attributes,
601};
602
603static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts)
604{
605 struct spi_message *m;
606 int i;
607
608 ts->cmd_crtl2 = AD7877_WRITEADD(AD7877_REG_CTRL2) |
609 AD7877_POL(ts->stopacq_polarity) |
610 AD7877_AVG(ts->averaging) | AD7877_PM(1) |
611 AD7877_TMR(ts->pen_down_acc_interval) |
612 AD7877_ACQ(ts->acquisition_time) |
613 AD7877_FCD(ts->first_conversion_delay);
614
615 ad7877_write(spi, AD7877_REG_CTRL2, ts->cmd_crtl2);
616
617 ts->cmd_crtl1 = AD7877_WRITEADD(AD7877_REG_CTRL1) |
618 AD7877_READADD(AD7877_REG_XPLUS-1) |
619 AD7877_MODE_SEQ1 | AD7877_DFR;
620
621 ad7877_write(spi, AD7877_REG_CTRL1, ts->cmd_crtl1);
622
623 ts->cmd_dummy = 0;
624
625 m = &ts->msg;
626
627 spi_message_init(m);
628
629 m->complete = ad7877_callback;
630 m->context = ts;
631
632 ts->xfer[0].tx_buf = &ts->cmd_crtl1;
633 ts->xfer[0].len = 2;
634
635 spi_message_add_tail(&ts->xfer[0], m);
636
637 ts->xfer[1].tx_buf = &ts->cmd_dummy; /* Send ZERO */
638 ts->xfer[1].len = 2;
639
640 spi_message_add_tail(&ts->xfer[1], m);
641
642 for (i = 0; i < 11; i++) {
643 ts->xfer[i + 2].rx_buf = &ts->conversion_data[AD7877_SEQ_YPOS + i];
644 ts->xfer[i + 2].len = 2;
645 spi_message_add_tail(&ts->xfer[i + 2], m);
646 }
647}
648
649static int __devinit ad7877_probe(struct spi_device *spi)
650{
651 struct ad7877 *ts;
652 struct input_dev *input_dev;
653 struct ad7877_platform_data *pdata = spi->dev.platform_data;
654 int err;
655 u16 verify;
656
657 if (!spi->irq) {
658 dev_dbg(&spi->dev, "no IRQ?\n");
659 return -ENODEV;
660 }
661
662 if (!pdata) {
663 dev_dbg(&spi->dev, "no platform data?\n");
664 return -ENODEV;
665 }
666
667 /* don't exceed max specified SPI CLK frequency */
668 if (spi->max_speed_hz > MAX_SPI_FREQ_HZ) {
669 dev_dbg(&spi->dev, "SPI CLK %d Hz?\n",spi->max_speed_hz);
670 return -EINVAL;
671 }
672
673 ts = kzalloc(sizeof(struct ad7877), GFP_KERNEL);
674 input_dev = input_allocate_device();
675 if (!ts || !input_dev) {
676 err = -ENOMEM;
677 goto err_free_mem;
678 }
679
680 dev_set_drvdata(&spi->dev, ts);
681 ts->spi = spi;
682 ts->input = input_dev;
683
684 setup_timer(&ts->timer, ad7877_timer, (unsigned long) ts);
685 mutex_init(&ts->mutex);
686 spin_lock_init(&ts->lock);
687
688 ts->model = pdata->model ? : 7877;
689 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
690 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
691 ts->pressure_max = pdata->pressure_max ? : ~0;
692
693 ts->stopacq_polarity = pdata->stopacq_polarity;
694 ts->first_conversion_delay = pdata->first_conversion_delay;
695 ts->acquisition_time = pdata->acquisition_time;
696 ts->averaging = pdata->averaging;
697 ts->pen_down_acc_interval = pdata->pen_down_acc_interval;
698
699 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev));
700
701 input_dev->name = "AD7877 Touchscreen";
702 input_dev->phys = ts->phys;
703 input_dev->dev.parent = &spi->dev;
704
705 __set_bit(EV_ABS, input_dev->evbit);
706 __set_bit(ABS_X, input_dev->absbit);
707 __set_bit(ABS_Y, input_dev->absbit);
708 __set_bit(ABS_PRESSURE, input_dev->absbit);
709
710 input_set_abs_params(input_dev, ABS_X,
711 pdata->x_min ? : 0,
712 pdata->x_max ? : MAX_12BIT,
713 0, 0);
714 input_set_abs_params(input_dev, ABS_Y,
715 pdata->y_min ? : 0,
716 pdata->y_max ? : MAX_12BIT,
717 0, 0);
718 input_set_abs_params(input_dev, ABS_PRESSURE,
719 pdata->pressure_min, pdata->pressure_max, 0, 0);
720
721 ad7877_write(spi, AD7877_REG_SEQ1, AD7877_MM_SEQUENCE);
722
723 verify = ad7877_read(spi, AD7877_REG_SEQ1);
724
725 if (verify != AD7877_MM_SEQUENCE){
726 dev_err(&spi->dev, "%s: Failed to probe %s\n",
727 dev_name(&spi->dev), input_dev->name);
728 err = -ENODEV;
729 goto err_free_mem;
730 }
731
732 if (gpio3)
733 ad7877_write(spi, AD7877_REG_EXTWRITE, AD7877_EXTW_GPIO_3_CONF);
734
735 ad7877_setup_ts_def_msg(spi, ts);
736
737 /* Request AD7877 /DAV GPIO interrupt */
738
739 err = request_irq(spi->irq, ad7877_irq, IRQF_TRIGGER_FALLING |
740 IRQF_SAMPLE_RANDOM, spi->dev.driver->name, ts);
741 if (err) {
742 dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
743 goto err_free_mem;
744 }
745
746 err = sysfs_create_group(&spi->dev.kobj, &ad7877_attr_group);
747 if (err)
748 goto err_free_irq;
749
750 err = device_create_file(&spi->dev,
751 gpio3 ? &dev_attr_gpio3 : &dev_attr_aux3);
752 if (err)
753 goto err_remove_attr_group;
754
755 err = input_register_device(input_dev);
756 if (err)
757 goto err_remove_attr;
758
759 return 0;
760
761err_remove_attr:
762 device_remove_file(&spi->dev,
763 gpio3 ? &dev_attr_gpio3 : &dev_attr_aux3);
764err_remove_attr_group:
765 sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group);
766err_free_irq:
767 free_irq(spi->irq, ts);
768err_free_mem:
769 input_free_device(input_dev);
770 kfree(ts);
771 dev_set_drvdata(&spi->dev, NULL);
772 return err;
773}
774
775static int __devexit ad7877_remove(struct spi_device *spi)
776{
777 struct ad7877 *ts = dev_get_drvdata(&spi->dev);
778
779 sysfs_remove_group(&spi->dev.kobj, &ad7877_attr_group);
780 device_remove_file(&spi->dev,
781 gpio3 ? &dev_attr_gpio3 : &dev_attr_aux3);
782
783 ad7877_disable(ts);
784 free_irq(ts->spi->irq, ts);
785
786 input_unregister_device(ts->input);
787 kfree(ts);
788
789 dev_dbg(&spi->dev, "unregistered touchscreen\n");
790 dev_set_drvdata(&spi->dev, NULL);
791
792 return 0;
793}
794
795#ifdef CONFIG_PM
796static int ad7877_suspend(struct spi_device *spi, pm_message_t message)
797{
798 struct ad7877 *ts = dev_get_drvdata(&spi->dev);
799
800 ad7877_disable(ts);
801
802 return 0;
803}
804
805static int ad7877_resume(struct spi_device *spi)
806{
807 struct ad7877 *ts = dev_get_drvdata(&spi->dev);
808
809 ad7877_enable(ts);
810
811 return 0;
812}
813#else
814#define ad7877_suspend NULL
815#define ad7877_resume NULL
816#endif
817
818static struct spi_driver ad7877_driver = {
819 .driver = {
820 .name = "ad7877",
821 .bus = &spi_bus_type,
822 .owner = THIS_MODULE,
823 },
824 .probe = ad7877_probe,
825 .remove = __devexit_p(ad7877_remove),
826 .suspend = ad7877_suspend,
827 .resume = ad7877_resume,
828};
829
830static int __init ad7877_init(void)
831{
832 return spi_register_driver(&ad7877_driver);
833}
834module_init(ad7877_init);
835
836static void __exit ad7877_exit(void)
837{
838 spi_unregister_driver(&ad7877_driver);
839}
840module_exit(ad7877_exit);
841
842MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
843MODULE_DESCRIPTION("AD7877 touchscreen Driver");
844MODULE_LICENSE("GPL");
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
new file mode 100644
index 000000000000..ea4c61d68683
--- /dev/null
+++ b/drivers/input/touchscreen/ad7879.c
@@ -0,0 +1,782 @@
1/*
2 * Copyright (C) 2008 Michael Hennerich, Analog Devices Inc.
3 *
4 * Description: AD7879 based touchscreen, and GPIO driver (I2C/SPI Interface)
5 *
6 * Bugs: Enter bugs at http://blackfin.uclinux.org/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License 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, see the file COPYING, or write
20 * to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 * History:
24 * Copyright (c) 2005 David Brownell
25 * Copyright (c) 2006 Nokia Corporation
26 * Various changes: Imre Deak <imre.deak@nokia.com>
27 *
28 * Using code from:
29 * - corgi_ts.c
30 * Copyright (C) 2004-2005 Richard Purdie
31 * - omap_ts.[hc], ads7846.h, ts_osk.c
32 * Copyright (C) 2002 MontaVista Software
33 * Copyright (C) 2004 Texas Instruments
34 * Copyright (C) 2005 Dirk Behme
35 * - ad7877.c
36 * Copyright (C) 2006-2008 Analog Devices Inc.
37 */
38
39#include <linux/device.h>
40#include <linux/init.h>
41#include <linux/delay.h>
42#include <linux/input.h>
43#include <linux/interrupt.h>
44#include <linux/irq.h>
45#include <linux/slab.h>
46#include <linux/workqueue.h>
47#include <linux/spi/spi.h>
48#include <linux/i2c.h>
49
50#include <linux/spi/ad7879.h>
51
52#define AD7879_REG_ZEROS 0
53#define AD7879_REG_CTRL1 1
54#define AD7879_REG_CTRL2 2
55#define AD7879_REG_CTRL3 3
56#define AD7879_REG_AUX1HIGH 4
57#define AD7879_REG_AUX1LOW 5
58#define AD7879_REG_TEMP1HIGH 6
59#define AD7879_REG_TEMP1LOW 7
60#define AD7879_REG_XPLUS 8
61#define AD7879_REG_YPLUS 9
62#define AD7879_REG_Z1 10
63#define AD7879_REG_Z2 11
64#define AD7879_REG_AUXVBAT 12
65#define AD7879_REG_TEMP 13
66#define AD7879_REG_REVID 14
67
68/* Control REG 1 */
69#define AD7879_TMR(x) ((x & 0xFF) << 0)
70#define AD7879_ACQ(x) ((x & 0x3) << 8)
71#define AD7879_MODE_NOC (0 << 10) /* Do not convert */
72#define AD7879_MODE_SCC (1 << 10) /* Single channel conversion */
73#define AD7879_MODE_SEQ0 (2 << 10) /* Sequence 0 in Slave Mode */
74#define AD7879_MODE_SEQ1 (3 << 10) /* Sequence 1 in Master Mode */
75#define AD7879_MODE_INT (1 << 15) /* PENIRQ disabled INT enabled */
76
77/* Control REG 2 */
78#define AD7879_FCD(x) ((x & 0x3) << 0)
79#define AD7879_RESET (1 << 4)
80#define AD7879_MFS(x) ((x & 0x3) << 5)
81#define AD7879_AVG(x) ((x & 0x3) << 7)
82#define AD7879_SER (1 << 9) /* non-differential */
83#define AD7879_DFR (0 << 9) /* differential */
84#define AD7879_GPIOPOL (1 << 10)
85#define AD7879_GPIODIR (1 << 11)
86#define AD7879_GPIO_DATA (1 << 12)
87#define AD7879_GPIO_EN (1 << 13)
88#define AD7879_PM(x) ((x & 0x3) << 14)
89#define AD7879_PM_SHUTDOWN (0)
90#define AD7879_PM_DYN (1)
91#define AD7879_PM_FULLON (2)
92
93/* Control REG 3 */
94#define AD7879_TEMPMASK_BIT (1<<15)
95#define AD7879_AUXVBATMASK_BIT (1<<14)
96#define AD7879_INTMODE_BIT (1<<13)
97#define AD7879_GPIOALERTMASK_BIT (1<<12)
98#define AD7879_AUXLOW_BIT (1<<11)
99#define AD7879_AUXHIGH_BIT (1<<10)
100#define AD7879_TEMPLOW_BIT (1<<9)
101#define AD7879_TEMPHIGH_BIT (1<<8)
102#define AD7879_YPLUS_BIT (1<<7)
103#define AD7879_XPLUS_BIT (1<<6)
104#define AD7879_Z1_BIT (1<<5)
105#define AD7879_Z2_BIT (1<<4)
106#define AD7879_AUX_BIT (1<<3)
107#define AD7879_VBAT_BIT (1<<2)
108#define AD7879_TEMP_BIT (1<<1)
109
110enum {
111 AD7879_SEQ_XPOS = 0,
112 AD7879_SEQ_YPOS = 1,
113 AD7879_SEQ_Z1 = 2,
114 AD7879_SEQ_Z2 = 3,
115 AD7879_NR_SENSE = 4,
116};
117
118#define MAX_12BIT ((1<<12)-1)
119#define TS_PEN_UP_TIMEOUT msecs_to_jiffies(50)
120
121#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
122#define AD7879_DEVID 0x7A
123typedef struct spi_device bus_device;
124#elif defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
125#define AD7879_DEVID 0x79
126typedef struct i2c_client bus_device;
127#endif
128
129struct ad7879 {
130 bus_device *bus;
131 struct input_dev *input;
132 struct work_struct work;
133 struct timer_list timer;
134
135 struct mutex mutex;
136 unsigned disabled:1; /* P: mutex */
137
138#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
139 struct spi_message msg;
140 struct spi_transfer xfer[AD7879_NR_SENSE + 1];
141 u16 cmd;
142#endif
143 u16 conversion_data[AD7879_NR_SENSE];
144 char phys[32];
145 u8 first_conversion_delay;
146 u8 acquisition_time;
147 u8 averaging;
148 u8 pen_down_acc_interval;
149 u8 median;
150 u16 x_plate_ohms;
151 u16 pressure_max;
152 u16 gpio_init;
153 u16 cmd_crtl1;
154 u16 cmd_crtl2;
155 u16 cmd_crtl3;
156 unsigned gpio:1;
157};
158
159static int ad7879_read(bus_device *, u8);
160static int ad7879_write(bus_device *, u8, u16);
161static void ad7879_collect(struct ad7879 *);
162
163static void ad7879_report(struct ad7879 *ts)
164{
165 struct input_dev *input_dev = ts->input;
166 unsigned Rt;
167 u16 x, y, z1, z2;
168
169 x = ts->conversion_data[AD7879_SEQ_XPOS] & MAX_12BIT;
170 y = ts->conversion_data[AD7879_SEQ_YPOS] & MAX_12BIT;
171 z1 = ts->conversion_data[AD7879_SEQ_Z1] & MAX_12BIT;
172 z2 = ts->conversion_data[AD7879_SEQ_Z2] & MAX_12BIT;
173
174 /*
175 * The samples processed here are already preprocessed by the AD7879.
176 * The preprocessing function consists of a median and an averaging filter.
177 * The combination of these two techniques provides a robust solution,
178 * discarding the spurious noise in the signal and keeping only the data of interest.
179 * The size of both filters is programmable. (dev.platform_data, see linux/spi/ad7879.h)
180 * Other user-programmable conversion controls include variable acquisition time,
181 * and first conversion delay. Up to 16 averages can be taken per conversion.
182 */
183
184 if (likely(x && z1)) {
185 /* compute touch pressure resistance using equation #1 */
186 Rt = (z2 - z1) * x * ts->x_plate_ohms;
187 Rt /= z1;
188 Rt = (Rt + 2047) >> 12;
189
190 input_report_abs(input_dev, ABS_X, x);
191 input_report_abs(input_dev, ABS_Y, y);
192 input_report_abs(input_dev, ABS_PRESSURE, Rt);
193 input_sync(input_dev);
194 }
195}
196
197static void ad7879_work(struct work_struct *work)
198{
199 struct ad7879 *ts = container_of(work, struct ad7879, work);
200
201 /* use keventd context to read the result registers */
202 ad7879_collect(ts);
203 ad7879_report(ts);
204 mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT);
205}
206
207static void ad7879_ts_event_release(struct ad7879 *ts)
208{
209 struct input_dev *input_dev = ts->input;
210
211 input_report_abs(input_dev, ABS_PRESSURE, 0);
212 input_sync(input_dev);
213}
214
215static void ad7879_timer(unsigned long handle)
216{
217 struct ad7879 *ts = (void *)handle;
218
219 ad7879_ts_event_release(ts);
220}
221
222static irqreturn_t ad7879_irq(int irq, void *handle)
223{
224 struct ad7879 *ts = handle;
225
226 /* The repeated conversion sequencer controlled by TMR kicked off too fast.
227 * We ignore the last and process the sample sequence currently in the queue.
228 * It can't be older than 9.4ms
229 */
230
231 if (!work_pending(&ts->work))
232 schedule_work(&ts->work);
233
234 return IRQ_HANDLED;
235}
236
237static void ad7879_setup(struct ad7879 *ts)
238{
239 ts->cmd_crtl3 = AD7879_YPLUS_BIT |
240 AD7879_XPLUS_BIT |
241 AD7879_Z2_BIT |
242 AD7879_Z1_BIT |
243 AD7879_TEMPMASK_BIT |
244 AD7879_AUXVBATMASK_BIT |
245 AD7879_GPIOALERTMASK_BIT;
246
247 ts->cmd_crtl2 = AD7879_PM(AD7879_PM_DYN) | AD7879_DFR |
248 AD7879_AVG(ts->averaging) |
249 AD7879_MFS(ts->median) |
250 AD7879_FCD(ts->first_conversion_delay) |
251 ts->gpio_init;
252
253 ts->cmd_crtl1 = AD7879_MODE_INT | AD7879_MODE_SEQ1 |
254 AD7879_ACQ(ts->acquisition_time) |
255 AD7879_TMR(ts->pen_down_acc_interval);
256
257 ad7879_write(ts->bus, AD7879_REG_CTRL2, ts->cmd_crtl2);
258 ad7879_write(ts->bus, AD7879_REG_CTRL3, ts->cmd_crtl3);
259 ad7879_write(ts->bus, AD7879_REG_CTRL1, ts->cmd_crtl1);
260}
261
262static void ad7879_disable(struct ad7879 *ts)
263{
264 mutex_lock(&ts->mutex);
265
266 if (!ts->disabled) {
267
268 ts->disabled = 1;
269 disable_irq(ts->bus->irq);
270
271 cancel_work_sync(&ts->work);
272
273 if (del_timer_sync(&ts->timer))
274 ad7879_ts_event_release(ts);
275
276 ad7879_write(ts->bus, AD7879_REG_CTRL2,
277 AD7879_PM(AD7879_PM_SHUTDOWN));
278 }
279
280 mutex_unlock(&ts->mutex);
281}
282
283static void ad7879_enable(struct ad7879 *ts)
284{
285 mutex_lock(&ts->mutex);
286
287 if (ts->disabled) {
288 ad7879_setup(ts);
289 ts->disabled = 0;
290 enable_irq(ts->bus->irq);
291 }
292
293 mutex_unlock(&ts->mutex);
294}
295
296static ssize_t ad7879_disable_show(struct device *dev,
297 struct device_attribute *attr, char *buf)
298{
299 struct ad7879 *ts = dev_get_drvdata(dev);
300
301 return sprintf(buf, "%u\n", ts->disabled);
302}
303
304static ssize_t ad7879_disable_store(struct device *dev,
305 struct device_attribute *attr,
306 const char *buf, size_t count)
307{
308 struct ad7879 *ts = dev_get_drvdata(dev);
309 unsigned long val;
310 int error;
311
312 error = strict_strtoul(buf, 10, &val);
313 if (error)
314 return error;
315
316 if (val)
317 ad7879_disable(ts);
318 else
319 ad7879_enable(ts);
320
321 return count;
322}
323
324static DEVICE_ATTR(disable, 0664, ad7879_disable_show, ad7879_disable_store);
325
326static ssize_t ad7879_gpio_show(struct device *dev,
327 struct device_attribute *attr, char *buf)
328{
329 struct ad7879 *ts = dev_get_drvdata(dev);
330
331 return sprintf(buf, "%u\n", ts->gpio);
332}
333
334static ssize_t ad7879_gpio_store(struct device *dev,
335 struct device_attribute *attr,
336 const char *buf, size_t count)
337{
338 struct ad7879 *ts = dev_get_drvdata(dev);
339 unsigned long val;
340 int error;
341
342 error = strict_strtoul(buf, 10, &val);
343 if (error)
344 return error;
345
346 mutex_lock(&ts->mutex);
347 ts->gpio = !!val;
348 error = ad7879_write(ts->bus, AD7879_REG_CTRL2,
349 ts->gpio ?
350 ts->cmd_crtl2 & ~AD7879_GPIO_DATA :
351 ts->cmd_crtl2 | AD7879_GPIO_DATA);
352 mutex_unlock(&ts->mutex);
353
354 return error ? : count;
355}
356
357static DEVICE_ATTR(gpio, 0664, ad7879_gpio_show, ad7879_gpio_store);
358
359static struct attribute *ad7879_attributes[] = {
360 &dev_attr_disable.attr,
361 &dev_attr_gpio.attr,
362 NULL
363};
364
365static const struct attribute_group ad7879_attr_group = {
366 .attrs = ad7879_attributes,
367};
368
369static int __devinit ad7879_construct(bus_device *bus, struct ad7879 *ts)
370{
371 struct input_dev *input_dev;
372 struct ad7879_platform_data *pdata = bus->dev.platform_data;
373 int err;
374 u16 revid;
375
376 if (!bus->irq) {
377 dev_err(&bus->dev, "no IRQ?\n");
378 return -ENODEV;
379 }
380
381 if (!pdata) {
382 dev_err(&bus->dev, "no platform data?\n");
383 return -ENODEV;
384 }
385
386 input_dev = input_allocate_device();
387 if (!input_dev)
388 return -ENOMEM;
389
390 ts->input = input_dev;
391
392 setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts);
393 INIT_WORK(&ts->work, ad7879_work);
394 mutex_init(&ts->mutex);
395
396 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
397 ts->pressure_max = pdata->pressure_max ? : ~0;
398
399 ts->first_conversion_delay = pdata->first_conversion_delay;
400 ts->acquisition_time = pdata->acquisition_time;
401 ts->averaging = pdata->averaging;
402 ts->pen_down_acc_interval = pdata->pen_down_acc_interval;
403 ts->median = pdata->median;
404
405 if (pdata->gpio_output)
406 ts->gpio_init = AD7879_GPIO_EN |
407 (pdata->gpio_default ? 0 : AD7879_GPIO_DATA);
408 else
409 ts->gpio_init = AD7879_GPIO_EN | AD7879_GPIODIR;
410
411 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&bus->dev));
412
413 input_dev->name = "AD7879 Touchscreen";
414 input_dev->phys = ts->phys;
415 input_dev->dev.parent = &bus->dev;
416
417 __set_bit(EV_ABS, input_dev->evbit);
418 __set_bit(ABS_X, input_dev->absbit);
419 __set_bit(ABS_Y, input_dev->absbit);
420 __set_bit(ABS_PRESSURE, input_dev->absbit);
421
422 input_set_abs_params(input_dev, ABS_X,
423 pdata->x_min ? : 0,
424 pdata->x_max ? : MAX_12BIT,
425 0, 0);
426 input_set_abs_params(input_dev, ABS_Y,
427 pdata->y_min ? : 0,
428 pdata->y_max ? : MAX_12BIT,
429 0, 0);
430 input_set_abs_params(input_dev, ABS_PRESSURE,
431 pdata->pressure_min, pdata->pressure_max, 0, 0);
432
433 err = ad7879_write(bus, AD7879_REG_CTRL2, AD7879_RESET);
434
435 if (err < 0) {
436 dev_err(&bus->dev, "Failed to write %s\n", input_dev->name);
437 goto err_free_mem;
438 }
439
440 revid = ad7879_read(bus, AD7879_REG_REVID);
441
442 if ((revid & 0xFF) != AD7879_DEVID) {
443 dev_err(&bus->dev, "Failed to probe %s\n", input_dev->name);
444 err = -ENODEV;
445 goto err_free_mem;
446 }
447
448 ad7879_setup(ts);
449
450 err = request_irq(bus->irq, ad7879_irq,
451 IRQF_TRIGGER_FALLING | IRQF_SAMPLE_RANDOM,
452 bus->dev.driver->name, ts);
453
454 if (err) {
455 dev_err(&bus->dev, "irq %d busy?\n", bus->irq);
456 goto err_free_mem;
457 }
458
459 err = sysfs_create_group(&bus->dev.kobj, &ad7879_attr_group);
460 if (err)
461 goto err_free_irq;
462
463 err = input_register_device(input_dev);
464 if (err)
465 goto err_remove_attr;
466
467 dev_info(&bus->dev, "Rev.%d touchscreen, irq %d\n",
468 revid >> 8, bus->irq);
469
470 return 0;
471
472err_remove_attr:
473 sysfs_remove_group(&bus->dev.kobj, &ad7879_attr_group);
474err_free_irq:
475 free_irq(bus->irq, ts);
476err_free_mem:
477 input_free_device(input_dev);
478
479 return err;
480}
481
482static int __devexit ad7879_destroy(bus_device *bus, struct ad7879 *ts)
483{
484 ad7879_disable(ts);
485 sysfs_remove_group(&ts->bus->dev.kobj, &ad7879_attr_group);
486 free_irq(ts->bus->irq, ts);
487 input_unregister_device(ts->input);
488 dev_dbg(&bus->dev, "unregistered touchscreen\n");
489
490 return 0;
491}
492
493#ifdef CONFIG_PM
494static int ad7879_suspend(bus_device *bus, pm_message_t message)
495{
496 struct ad7879 *ts = dev_get_drvdata(&bus->dev);
497
498 ad7879_disable(ts);
499
500 return 0;
501}
502
503static int ad7879_resume(bus_device *bus)
504{
505 struct ad7879 *ts = dev_get_drvdata(&bus->dev);
506
507 ad7879_enable(ts);
508
509 return 0;
510}
511#else
512#define ad7879_suspend NULL
513#define ad7879_resume NULL
514#endif
515
516#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
517#define MAX_SPI_FREQ_HZ 5000000
518#define AD7879_CMD_MAGIC 0xE000
519#define AD7879_CMD_READ (1 << 10)
520#define AD7879_WRITECMD(reg) (AD7879_CMD_MAGIC | (reg & 0xF))
521#define AD7879_READCMD(reg) (AD7879_CMD_MAGIC | AD7879_CMD_READ | (reg & 0xF))
522
523struct ser_req {
524 u16 command;
525 u16 data;
526 struct spi_message msg;
527 struct spi_transfer xfer[2];
528};
529
530/*
531 * ad7879_read/write are only used for initial setup and for sysfs controls.
532 * The main traffic is done in ad7879_collect().
533 */
534
535static int ad7879_read(struct spi_device *spi, u8 reg)
536{
537 struct ser_req *req;
538 int status, ret;
539
540 req = kzalloc(sizeof *req, GFP_KERNEL);
541 if (!req)
542 return -ENOMEM;
543
544 spi_message_init(&req->msg);
545
546 req->command = (u16) AD7879_READCMD(reg);
547 req->xfer[0].tx_buf = &req->command;
548 req->xfer[0].len = 2;
549
550 req->xfer[1].rx_buf = &req->data;
551 req->xfer[1].len = 2;
552
553 spi_message_add_tail(&req->xfer[0], &req->msg);
554 spi_message_add_tail(&req->xfer[1], &req->msg);
555
556 status = spi_sync(spi, &req->msg);
557 ret = status ? : req->data;
558
559 kfree(req);
560
561 return ret;
562}
563
564static int ad7879_write(struct spi_device *spi, u8 reg, u16 val)
565{
566 struct ser_req *req;
567 int status;
568
569 req = kzalloc(sizeof *req, GFP_KERNEL);
570 if (!req)
571 return -ENOMEM;
572
573 spi_message_init(&req->msg);
574
575 req->command = (u16) AD7879_WRITECMD(reg);
576 req->xfer[0].tx_buf = &req->command;
577 req->xfer[0].len = 2;
578
579 req->data = val;
580 req->xfer[1].tx_buf = &req->data;
581 req->xfer[1].len = 2;
582
583 spi_message_add_tail(&req->xfer[0], &req->msg);
584 spi_message_add_tail(&req->xfer[1], &req->msg);
585
586 status = spi_sync(spi, &req->msg);
587
588 kfree(req);
589
590 return status;
591}
592
593static void ad7879_collect(struct ad7879 *ts)
594{
595 int status = spi_sync(ts->bus, &ts->msg);
596
597 if (status)
598 dev_err(&ts->bus->dev, "spi_sync --> %d\n", status);
599}
600
601static void ad7879_setup_ts_def_msg(struct ad7879 *ts)
602{
603 struct spi_message *m;
604 int i;
605
606 ts->cmd = (u16) AD7879_READCMD(AD7879_REG_XPLUS);
607
608 m = &ts->msg;
609 spi_message_init(m);
610 ts->xfer[0].tx_buf = &ts->cmd;
611 ts->xfer[0].len = 2;
612
613 spi_message_add_tail(&ts->xfer[0], m);
614
615 for (i = 0; i < AD7879_NR_SENSE; i++) {
616 ts->xfer[i + 1].rx_buf = &ts->conversion_data[i];
617 ts->xfer[i + 1].len = 2;
618 spi_message_add_tail(&ts->xfer[i + 1], m);
619 }
620}
621
622static int __devinit ad7879_probe(struct spi_device *spi)
623{
624 struct ad7879 *ts;
625 int error;
626
627 /* don't exceed max specified SPI CLK frequency */
628 if (spi->max_speed_hz > MAX_SPI_FREQ_HZ) {
629 dev_err(&spi->dev, "SPI CLK %d Hz?\n", spi->max_speed_hz);
630 return -EINVAL;
631 }
632
633 ts = kzalloc(sizeof(struct ad7879), GFP_KERNEL);
634 if (!ts)
635 return -ENOMEM;
636
637 dev_set_drvdata(&spi->dev, ts);
638 ts->bus = spi;
639
640 ad7879_setup_ts_def_msg(ts);
641
642 error = ad7879_construct(spi, ts);
643 if (error) {
644 dev_set_drvdata(&spi->dev, NULL);
645 kfree(ts);
646 }
647
648 return 0;
649}
650
651static int __devexit ad7879_remove(struct spi_device *spi)
652{
653 struct ad7879 *ts = dev_get_drvdata(&spi->dev);
654
655 ad7879_destroy(spi, ts);
656 dev_set_drvdata(&spi->dev, NULL);
657 kfree(ts);
658
659 return 0;
660}
661
662static struct spi_driver ad7879_driver = {
663 .driver = {
664 .name = "ad7879",
665 .bus = &spi_bus_type,
666 .owner = THIS_MODULE,
667 },
668 .probe = ad7879_probe,
669 .remove = __devexit_p(ad7879_remove),
670 .suspend = ad7879_suspend,
671 .resume = ad7879_resume,
672};
673
674static int __init ad7879_init(void)
675{
676 return spi_register_driver(&ad7879_driver);
677}
678module_init(ad7879_init);
679
680static void __exit ad7879_exit(void)
681{
682 spi_unregister_driver(&ad7879_driver);
683}
684module_exit(ad7879_exit);
685
686#elif defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
687
688/* All registers are word-sized.
689 * AD7879 uses a high-byte first convention.
690 */
691static int ad7879_read(struct i2c_client *client, u8 reg)
692{
693 return swab16(i2c_smbus_read_word_data(client, reg));
694}
695
696static int ad7879_write(struct i2c_client *client, u8 reg, u16 val)
697{
698 return i2c_smbus_write_word_data(client, reg, swab16(val));
699}
700
701static void ad7879_collect(struct ad7879 *ts)
702{
703 int i;
704
705 for (i = 0; i < AD7879_NR_SENSE; i++)
706 ts->conversion_data[i] = ad7879_read(ts->bus,
707 AD7879_REG_XPLUS + i);
708}
709
710static int __devinit ad7879_probe(struct i2c_client *client,
711 const struct i2c_device_id *id)
712{
713 struct ad7879 *ts;
714 int error;
715
716 if (!i2c_check_functionality(client->adapter,
717 I2C_FUNC_SMBUS_WORD_DATA)) {
718 dev_err(&client->dev, "SMBUS Word Data not Supported\n");
719 return -EIO;
720 }
721
722 ts = kzalloc(sizeof(struct ad7879), GFP_KERNEL);
723 if (!ts)
724 return -ENOMEM;
725
726 i2c_set_clientdata(client, ts);
727 ts->bus = client;
728
729 error = ad7879_construct(client, ts);
730 if (error) {
731 i2c_set_clientdata(client, NULL);
732 kfree(ts);
733 }
734
735 return 0;
736}
737
738static int __devexit ad7879_remove(struct i2c_client *client)
739{
740 struct ad7879 *ts = dev_get_drvdata(&client->dev);
741
742 ad7879_destroy(client, ts);
743 i2c_set_clientdata(client, NULL);
744 kfree(ts);
745
746 return 0;
747}
748
749static const struct i2c_device_id ad7879_id[] = {
750 { "ad7879", 0 },
751 { }
752};
753MODULE_DEVICE_TABLE(i2c, ad7879_id);
754
755static struct i2c_driver ad7879_driver = {
756 .driver = {
757 .name = "ad7879",
758 .owner = THIS_MODULE,
759 },
760 .probe = ad7879_probe,
761 .remove = __devexit_p(ad7879_remove),
762 .suspend = ad7879_suspend,
763 .resume = ad7879_resume,
764 .id_table = ad7879_id,
765};
766
767static int __init ad7879_init(void)
768{
769 return i2c_add_driver(&ad7879_driver);
770}
771module_init(ad7879_init);
772
773static void __exit ad7879_exit(void)
774{
775 i2c_del_driver(&ad7879_driver);
776}
777module_exit(ad7879_exit);
778#endif
779
780MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
781MODULE_DESCRIPTION("AD7879(-1) touchscreen Driver");
782MODULE_LICENSE("GPL");
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
index 1d11e2be9ef8..dfa6a84ab50a 100644
--- a/drivers/input/touchscreen/mainstone-wm97xx.c
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -162,6 +162,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)
162 input_report_abs(wm->input_dev, ABS_X, x & 0xfff); 162 input_report_abs(wm->input_dev, ABS_X, x & 0xfff);
163 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff); 163 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff);
164 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff); 164 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff);
165 input_report_key(wm->input_dev, BTN_TOUCH, (p != 0));
165 input_sync(wm->input_dev); 166 input_sync(wm->input_dev);
166 reads++; 167 reads++;
167 } while (reads < cinfo[sp_idx].reads); 168 } while (reads < cinfo[sp_idx].reads);
@@ -245,7 +246,7 @@ static void wm97xx_irq_enable(struct wm97xx *wm, int enable)
245 if (enable) 246 if (enable)
246 enable_irq(wm->pen_irq); 247 enable_irq(wm->pen_irq);
247 else 248 else
248 disable_irq(wm->pen_irq); 249 disable_irq_nosync(wm->pen_irq);
249} 250}
250 251
251static struct wm97xx_mach_ops mainstone_mach_ops = { 252static struct wm97xx_mach_ops mainstone_mach_ops = {
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 54986627def0..e868264fe799 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -151,12 +151,14 @@ static void ucb1400_ts_evt_add(struct input_dev *idev, u16 pressure, u16 x, u16
151 input_report_abs(idev, ABS_X, x); 151 input_report_abs(idev, ABS_X, x);
152 input_report_abs(idev, ABS_Y, y); 152 input_report_abs(idev, ABS_Y, y);
153 input_report_abs(idev, ABS_PRESSURE, pressure); 153 input_report_abs(idev, ABS_PRESSURE, pressure);
154 input_report_key(idev, BTN_TOUCH, 1);
154 input_sync(idev); 155 input_sync(idev);
155} 156}
156 157
157static void ucb1400_ts_event_release(struct input_dev *idev) 158static void ucb1400_ts_event_release(struct input_dev *idev)
158{ 159{
159 input_report_abs(idev, ABS_PRESSURE, 0); 160 input_report_abs(idev, ABS_PRESSURE, 0);
161 input_report_key(idev, BTN_TOUCH, 0);
160 input_sync(idev); 162 input_sync(idev);
161} 163}
162 164
@@ -377,7 +379,8 @@ static int ucb1400_ts_probe(struct platform_device *dev)
377 ucb->ts_idev->id.product = ucb->id; 379 ucb->ts_idev->id.product = ucb->id;
378 ucb->ts_idev->open = ucb1400_ts_open; 380 ucb->ts_idev->open = ucb1400_ts_open;
379 ucb->ts_idev->close = ucb1400_ts_close; 381 ucb->ts_idev->close = ucb1400_ts_close;
380 ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS); 382 ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
383 ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
381 384
382 ucb1400_adc_enable(ucb->ac97); 385 ucb1400_adc_enable(ucb->ac97);
383 x_res = ucb1400_ts_read_xres(ucb); 386 x_res = ucb1400_ts_read_xres(ucb);
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index d15aa11d7056..cec480bffe38 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -409,6 +409,7 @@ static int wm97xx_read_samples(struct wm97xx *wm)
409 wm->pen_is_down = 0; 409 wm->pen_is_down = 0;
410 dev_dbg(wm->dev, "pen up\n"); 410 dev_dbg(wm->dev, "pen up\n");
411 input_report_abs(wm->input_dev, ABS_PRESSURE, 0); 411 input_report_abs(wm->input_dev, ABS_PRESSURE, 0);
412 input_report_key(wm->input_dev, BTN_TOUCH, 0);
412 input_sync(wm->input_dev); 413 input_sync(wm->input_dev);
413 } else if (!(rc & RC_AGAIN)) { 414 } else if (!(rc & RC_AGAIN)) {
414 /* We need high frequency updates only while 415 /* We need high frequency updates only while
@@ -433,6 +434,7 @@ static int wm97xx_read_samples(struct wm97xx *wm)
433 input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff); 434 input_report_abs(wm->input_dev, ABS_X, data.x & 0xfff);
434 input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff); 435 input_report_abs(wm->input_dev, ABS_Y, data.y & 0xfff);
435 input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff); 436 input_report_abs(wm->input_dev, ABS_PRESSURE, data.p & 0xfff);
437 input_report_key(wm->input_dev, BTN_TOUCH, 1);
436 input_sync(wm->input_dev); 438 input_sync(wm->input_dev);
437 wm->pen_is_down = 1; 439 wm->pen_is_down = 1;
438 wm->ts_reader_interval = wm->ts_reader_min_interval; 440 wm->ts_reader_interval = wm->ts_reader_min_interval;
@@ -628,18 +630,21 @@ static int wm97xx_probe(struct device *dev)
628 wm->input_dev->phys = "wm97xx"; 630 wm->input_dev->phys = "wm97xx";
629 wm->input_dev->open = wm97xx_ts_input_open; 631 wm->input_dev->open = wm97xx_ts_input_open;
630 wm->input_dev->close = wm97xx_ts_input_close; 632 wm->input_dev->close = wm97xx_ts_input_close;
631 set_bit(EV_ABS, wm->input_dev->evbit); 633
632 set_bit(ABS_X, wm->input_dev->absbit); 634 __set_bit(EV_ABS, wm->input_dev->evbit);
633 set_bit(ABS_Y, wm->input_dev->absbit); 635 __set_bit(EV_KEY, wm->input_dev->evbit);
634 set_bit(ABS_PRESSURE, wm->input_dev->absbit); 636 __set_bit(BTN_TOUCH, wm->input_dev->keybit);
637
635 input_set_abs_params(wm->input_dev, ABS_X, abs_x[0], abs_x[1], 638 input_set_abs_params(wm->input_dev, ABS_X, abs_x[0], abs_x[1],
636 abs_x[2], 0); 639 abs_x[2], 0);
637 input_set_abs_params(wm->input_dev, ABS_Y, abs_y[0], abs_y[1], 640 input_set_abs_params(wm->input_dev, ABS_Y, abs_y[0], abs_y[1],
638 abs_y[2], 0); 641 abs_y[2], 0);
639 input_set_abs_params(wm->input_dev, ABS_PRESSURE, abs_p[0], abs_p[1], 642 input_set_abs_params(wm->input_dev, ABS_PRESSURE, abs_p[0], abs_p[1],
640 abs_p[2], 0); 643 abs_p[2], 0);
644
641 input_set_drvdata(wm->input_dev, wm); 645 input_set_drvdata(wm->input_dev, wm);
642 wm->input_dev->dev.parent = dev; 646 wm->input_dev->dev.parent = dev;
647
643 ret = input_register_device(wm->input_dev); 648 ret = input_register_device(wm->input_dev);
644 if (ret < 0) 649 if (ret < 0)
645 goto dev_alloc_err; 650 goto dev_alloc_err;
diff --git a/drivers/input/touchscreen/zylonite-wm97xx.c b/drivers/input/touchscreen/zylonite-wm97xx.c
new file mode 100644
index 000000000000..41e4359c277c
--- /dev/null
+++ b/drivers/input/touchscreen/zylonite-wm97xx.c
@@ -0,0 +1,240 @@
1/*
2 * zylonite-wm97xx.c -- Zylonite Continuous Touch screen driver
3 *
4 * Copyright 2004, 2007, 2008 Wolfson Microelectronics PLC.
5 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
6 * Parts Copyright : Ian Molton <spyro@f2s.com>
7 * Andrew Zabolotny <zap@homelink.ru>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * Notes:
15 * This is a wm97xx extended touch driver supporting interrupt driven
16 * and continuous operation on Marvell Zylonite development systems
17 * (which have a WM9713 on board).
18 */
19
20#include <linux/module.h>
21#include <linux/moduleparam.h>
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/delay.h>
25#include <linux/irq.h>
26#include <linux/interrupt.h>
27#include <linux/io.h>
28#include <linux/wm97xx.h>
29
30#include <mach/hardware.h>
31#include <mach/mfp.h>
32#include <mach/regs-ac97.h>
33
34struct continuous {
35 u16 id; /* codec id */
36 u8 code; /* continuous code */
37 u8 reads; /* number of coord reads per read cycle */
38 u32 speed; /* number of coords per second */
39};
40
41#define WM_READS(sp) ((sp / HZ) + 1)
42
43static const struct continuous cinfo[] = {
44 { WM9713_ID2, 0, WM_READS(94), 94 },
45 { WM9713_ID2, 1, WM_READS(120), 120 },
46 { WM9713_ID2, 2, WM_READS(154), 154 },
47 { WM9713_ID2, 3, WM_READS(188), 188 },
48};
49
50/* continuous speed index */
51static int sp_idx;
52
53/*
54 * Pen sampling frequency (Hz) in continuous mode.
55 */
56static int cont_rate = 200;
57module_param(cont_rate, int, 0);
58MODULE_PARM_DESC(cont_rate, "Sampling rate in continuous mode (Hz)");
59
60/*
61 * Pressure readback.
62 *
63 * Set to 1 to read back pen down pressure
64 */
65static int pressure;
66module_param(pressure, int, 0);
67MODULE_PARM_DESC(pressure, "Pressure readback (1 = pressure, 0 = no pressure)");
68
69/*
70 * AC97 touch data slot.
71 *
72 * Touch screen readback data ac97 slot
73 */
74static int ac97_touch_slot = 5;
75module_param(ac97_touch_slot, int, 0);
76MODULE_PARM_DESC(ac97_touch_slot, "Touch screen data slot AC97 number");
77
78
79/* flush AC97 slot 5 FIFO machines */
80static void wm97xx_acc_pen_up(struct wm97xx *wm)
81{
82 int i;
83
84 msleep(1);
85
86 for (i = 0; i < 16; i++)
87 MODR;
88}
89
90static int wm97xx_acc_pen_down(struct wm97xx *wm)
91{
92 u16 x, y, p = 0x100 | WM97XX_ADCSEL_PRES;
93 int reads = 0;
94 static u16 last, tries;
95
96 /* When the AC97 queue has been drained we need to allow time
97 * to buffer up samples otherwise we end up spinning polling
98 * for samples. The controller can't have a suitably low
99 * threashold set to use the notifications it gives.
100 */
101 msleep(1);
102
103 if (tries > 5) {
104 tries = 0;
105 return RC_PENUP;
106 }
107
108 x = MODR;
109 if (x == last) {
110 tries++;
111 return RC_AGAIN;
112 }
113 last = x;
114 do {
115 if (reads)
116 x = MODR;
117 y = MODR;
118 if (pressure)
119 p = MODR;
120
121 /* are samples valid */
122 if ((x & WM97XX_ADCSRC_MASK) != WM97XX_ADCSEL_X ||
123 (y & WM97XX_ADCSRC_MASK) != WM97XX_ADCSEL_Y ||
124 (p & WM97XX_ADCSRC_MASK) != WM97XX_ADCSEL_PRES)
125 goto up;
126
127 /* coordinate is good */
128 tries = 0;
129 input_report_abs(wm->input_dev, ABS_X, x & 0xfff);
130 input_report_abs(wm->input_dev, ABS_Y, y & 0xfff);
131 input_report_abs(wm->input_dev, ABS_PRESSURE, p & 0xfff);
132 input_report_key(wm->input_dev, BTN_TOUCH, (p != 0));
133 input_sync(wm->input_dev);
134 reads++;
135 } while (reads < cinfo[sp_idx].reads);
136up:
137 return RC_PENDOWN | RC_AGAIN;
138}
139
140static int wm97xx_acc_startup(struct wm97xx *wm)
141{
142 int idx;
143
144 /* check we have a codec */
145 if (wm->ac97 == NULL)
146 return -ENODEV;
147
148 /* Go you big red fire engine */
149 for (idx = 0; idx < ARRAY_SIZE(cinfo); idx++) {
150 if (wm->id != cinfo[idx].id)
151 continue;
152 sp_idx = idx;
153 if (cont_rate <= cinfo[idx].speed)
154 break;
155 }
156 wm->acc_rate = cinfo[sp_idx].code;
157 wm->acc_slot = ac97_touch_slot;
158 dev_info(wm->dev,
159 "zylonite accelerated touchscreen driver, %d samples/sec\n",
160 cinfo[sp_idx].speed);
161
162 return 0;
163}
164
165static void wm97xx_irq_enable(struct wm97xx *wm, int enable)
166{
167 if (enable)
168 enable_irq(wm->pen_irq);
169 else
170 disable_irq_nosync(wm->pen_irq);
171}
172
173static struct wm97xx_mach_ops zylonite_mach_ops = {
174 .acc_enabled = 1,
175 .acc_pen_up = wm97xx_acc_pen_up,
176 .acc_pen_down = wm97xx_acc_pen_down,
177 .acc_startup = wm97xx_acc_startup,
178 .irq_enable = wm97xx_irq_enable,
179 .irq_gpio = WM97XX_GPIO_2,
180};
181
182static int zylonite_wm97xx_probe(struct platform_device *pdev)
183{
184 struct wm97xx *wm = platform_get_drvdata(pdev);
185 int gpio_touch_irq;
186
187 if (cpu_is_pxa320())
188 gpio_touch_irq = mfp_to_gpio(MFP_PIN_GPIO15);
189 else
190 gpio_touch_irq = mfp_to_gpio(MFP_PIN_GPIO26);
191
192 wm->pen_irq = IRQ_GPIO(gpio_touch_irq);
193 set_irq_type(IRQ_GPIO(gpio_touch_irq), IRQ_TYPE_EDGE_BOTH);
194
195 wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN,
196 WM97XX_GPIO_POL_HIGH,
197 WM97XX_GPIO_STICKY,
198 WM97XX_GPIO_WAKE);
199 wm97xx_config_gpio(wm, WM97XX_GPIO_2, WM97XX_GPIO_OUT,
200 WM97XX_GPIO_POL_HIGH,
201 WM97XX_GPIO_NOTSTICKY,
202 WM97XX_GPIO_NOWAKE);
203
204 return wm97xx_register_mach_ops(wm, &zylonite_mach_ops);
205}
206
207static int zylonite_wm97xx_remove(struct platform_device *pdev)
208{
209 struct wm97xx *wm = platform_get_drvdata(pdev);
210
211 wm97xx_unregister_mach_ops(wm);
212
213 return 0;
214}
215
216static struct platform_driver zylonite_wm97xx_driver = {
217 .probe = zylonite_wm97xx_probe,
218 .remove = zylonite_wm97xx_remove,
219 .driver = {
220 .name = "wm97xx-touch",
221 },
222};
223
224static int __init zylonite_wm97xx_init(void)
225{
226 return platform_driver_register(&zylonite_wm97xx_driver);
227}
228
229static void __exit zylonite_wm97xx_exit(void)
230{
231 platform_driver_unregister(&zylonite_wm97xx_driver);
232}
233
234module_init(zylonite_wm97xx_init);
235module_exit(zylonite_wm97xx_exit);
236
237/* Module information */
238MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
239MODULE_DESCRIPTION("wm97xx continuous touch driver for Zylonite");
240MODULE_LICENSE("GPL");
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 102ef4a14c5f..d2109054de85 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -82,7 +82,7 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
82 if (!gpio_is_valid(template->gpio)) { 82 if (!gpio_is_valid(template->gpio)) {
83 printk(KERN_INFO "Skipping unavilable LED gpio %d (%s)\n", 83 printk(KERN_INFO "Skipping unavilable LED gpio %d (%s)\n",
84 template->gpio, template->name); 84 template->gpio, template->name);
85 return; 85 return 0;
86 } 86 }
87 87
88 ret = gpio_request(template->gpio, template->name); 88 ret = gpio_request(template->gpio, template->name);
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index d184dfab9631..db39f4a52f53 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -278,7 +278,7 @@ static ssize_t at24_bin_read(struct kobject *kobj, struct bin_attribute *attr,
278 * We only use page mode writes; the alternative is sloooow. This routine 278 * We only use page mode writes; the alternative is sloooow. This routine
279 * writes at most one page. 279 * writes at most one page.
280 */ 280 */
281static ssize_t at24_eeprom_write(struct at24_data *at24, char *buf, 281static ssize_t at24_eeprom_write(struct at24_data *at24, const char *buf,
282 unsigned offset, size_t count) 282 unsigned offset, size_t count)
283{ 283{
284 struct i2c_client *client; 284 struct i2c_client *client;
@@ -347,8 +347,8 @@ static ssize_t at24_eeprom_write(struct at24_data *at24, char *buf,
347 return -ETIMEDOUT; 347 return -ETIMEDOUT;
348} 348}
349 349
350static ssize_t at24_write(struct at24_data *at24, 350static ssize_t at24_write(struct at24_data *at24, const char *buf, loff_t off,
351 char *buf, loff_t off, size_t count) 351 size_t count)
352{ 352{
353 ssize_t retval = 0; 353 ssize_t retval = 0;
354 354
@@ -406,7 +406,7 @@ static ssize_t at24_macc_read(struct memory_accessor *macc, char *buf,
406 return at24_read(at24, buf, offset, count); 406 return at24_read(at24, buf, offset, count);
407} 407}
408 408
409static ssize_t at24_macc_write(struct memory_accessor *macc, char *buf, 409static ssize_t at24_macc_write(struct memory_accessor *macc, const char *buf,
410 off_t offset, size_t count) 410 off_t offset, size_t count)
411{ 411{
412 struct at24_data *at24 = container_of(macc, struct at24_data, macc); 412 struct at24_data *at24 = container_of(macc, struct at24_data, macc);
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 6bc0dac5c1e8..b34cb5f79eea 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -140,7 +140,8 @@ at25_bin_read(struct kobject *kobj, struct bin_attribute *bin_attr,
140 140
141 141
142static ssize_t 142static ssize_t
143at25_ee_write(struct at25_data *at25, char *buf, loff_t off, size_t count) 143at25_ee_write(struct at25_data *at25, const char *buf, loff_t off,
144 size_t count)
144{ 145{
145 ssize_t status = 0; 146 ssize_t status = 0;
146 unsigned written = 0; 147 unsigned written = 0;
@@ -276,7 +277,7 @@ static ssize_t at25_mem_read(struct memory_accessor *mem, char *buf,
276 return at25_ee_read(at25, buf, offset, count); 277 return at25_ee_read(at25, buf, offset, count);
277} 278}
278 279
279static ssize_t at25_mem_write(struct memory_accessor *mem, char *buf, 280static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf,
280 off_t offset, size_t count) 281 off_t offset, size_t count)
281{ 282{
282 struct at25_data *at25 = container_of(mem, struct at25_data, mem); 283 struct at25_data *at25 = container_of(mem, struct at25_data, mem);
diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h
index 114444cfd496..b94d5f767703 100644
--- a/drivers/misc/sgi-xp/xpc.h
+++ b/drivers/misc/sgi-xp/xpc.h
@@ -90,18 +90,21 @@ struct xpc_rsvd_page {
90 short max_npartitions; /* value of XPC_MAX_PARTITIONS */ 90 short max_npartitions; /* value of XPC_MAX_PARTITIONS */
91 u8 version; 91 u8 version;
92 u8 pad1[3]; /* align to next u64 in 1st 64-byte cacheline */ 92 u8 pad1[3]; /* align to next u64 in 1st 64-byte cacheline */
93 unsigned long ts_jiffies; /* timestamp when rsvd pg was setup by XPC */
93 union { 94 union {
94 unsigned long vars_pa; /* phys address of struct xpc_vars */ 95 struct {
95 unsigned long activate_gru_mq_desc_gpa; /* phys addr of */ 96 unsigned long vars_pa; /* phys addr */
96 /* activate mq's */ 97 } sn2;
97 /* gru mq descriptor */ 98 struct {
99 unsigned long heartbeat_gpa; /* phys addr */
100 unsigned long activate_gru_mq_desc_gpa; /* phys addr */
101 } uv;
98 } sn; 102 } sn;
99 unsigned long ts_jiffies; /* timestamp when rsvd pg was setup by XPC */ 103 u64 pad2[9]; /* align to last u64 in 2nd 64-byte cacheline */
100 u64 pad2[10]; /* align to last u64 in 2nd 64-byte cacheline */
101 u64 SAL_nasids_size; /* SAL: size of each nasid mask in bytes */ 104 u64 SAL_nasids_size; /* SAL: size of each nasid mask in bytes */
102}; 105};
103 106
104#define XPC_RP_VERSION _XPC_VERSION(2, 0) /* version 2.0 of the reserved page */ 107#define XPC_RP_VERSION _XPC_VERSION(3, 0) /* version 3.0 of the reserved page */
105 108
106/* 109/*
107 * Define the structures by which XPC variables can be exported to other 110 * Define the structures by which XPC variables can be exported to other
@@ -182,6 +185,17 @@ struct xpc_vars_part_sn2 {
182 (XPC_RP_MACH_NASIDS(_rp) + \ 185 (XPC_RP_MACH_NASIDS(_rp) + \
183 xpc_nasid_mask_nlongs)) 186 xpc_nasid_mask_nlongs))
184 187
188
189/*
190 * The following structure describes the partition's heartbeat info which
191 * will be periodically read by other partitions to determine whether this
192 * XPC is still 'alive'.
193 */
194struct xpc_heartbeat_uv {
195 unsigned long value;
196 unsigned long offline; /* if 0, heartbeat should be changing */
197};
198
185/* 199/*
186 * Info pertinent to a GRU message queue using a watch list for irq generation. 200 * Info pertinent to a GRU message queue using a watch list for irq generation.
187 */ 201 */
@@ -198,7 +212,7 @@ struct xpc_gru_mq_uv {
198 212
199/* 213/*
200 * The activate_mq is used to send/receive GRU messages that affect XPC's 214 * The activate_mq is used to send/receive GRU messages that affect XPC's
201 * heartbeat, partition active state, and channel state. This is UV only. 215 * partition active state and channel state. This is uv only.
202 */ 216 */
203struct xpc_activate_mq_msghdr_uv { 217struct xpc_activate_mq_msghdr_uv {
204 unsigned int gru_msg_hdr; /* FOR GRU INTERNAL USE ONLY */ 218 unsigned int gru_msg_hdr; /* FOR GRU INTERNAL USE ONLY */
@@ -210,33 +224,27 @@ struct xpc_activate_mq_msghdr_uv {
210 224
211/* activate_mq defined message types */ 225/* activate_mq defined message types */
212#define XPC_ACTIVATE_MQ_MSG_SYNC_ACT_STATE_UV 0 226#define XPC_ACTIVATE_MQ_MSG_SYNC_ACT_STATE_UV 0
213#define XPC_ACTIVATE_MQ_MSG_INC_HEARTBEAT_UV 1
214#define XPC_ACTIVATE_MQ_MSG_OFFLINE_HEARTBEAT_UV 2
215#define XPC_ACTIVATE_MQ_MSG_ONLINE_HEARTBEAT_UV 3
216 227
217#define XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV 4 228#define XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV 1
218#define XPC_ACTIVATE_MQ_MSG_DEACTIVATE_REQ_UV 5 229#define XPC_ACTIVATE_MQ_MSG_DEACTIVATE_REQ_UV 2
219 230
220#define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV 6 231#define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV 3
221#define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV 7 232#define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV 4
222#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV 8 233#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV 5
223#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV 9 234#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV 6
235#define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV 7
224 236
225#define XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV 10 237#define XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV 8
226#define XPC_ACTIVATE_MQ_MSG_MARK_DISENGAGED_UV 11 238#define XPC_ACTIVATE_MQ_MSG_MARK_DISENGAGED_UV 9
227 239
228struct xpc_activate_mq_msg_uv { 240struct xpc_activate_mq_msg_uv {
229 struct xpc_activate_mq_msghdr_uv hdr; 241 struct xpc_activate_mq_msghdr_uv hdr;
230}; 242};
231 243
232struct xpc_activate_mq_msg_heartbeat_req_uv {
233 struct xpc_activate_mq_msghdr_uv hdr;
234 u64 heartbeat;
235};
236
237struct xpc_activate_mq_msg_activate_req_uv { 244struct xpc_activate_mq_msg_activate_req_uv {
238 struct xpc_activate_mq_msghdr_uv hdr; 245 struct xpc_activate_mq_msghdr_uv hdr;
239 unsigned long rp_gpa; 246 unsigned long rp_gpa;
247 unsigned long heartbeat_gpa;
240 unsigned long activate_gru_mq_desc_gpa; 248 unsigned long activate_gru_mq_desc_gpa;
241}; 249};
242 250
@@ -271,6 +279,11 @@ struct xpc_activate_mq_msg_chctl_openreply_uv {
271 unsigned long notify_gru_mq_desc_gpa; 279 unsigned long notify_gru_mq_desc_gpa;
272}; 280};
273 281
282struct xpc_activate_mq_msg_chctl_opencomplete_uv {
283 struct xpc_activate_mq_msghdr_uv hdr;
284 short ch_number;
285};
286
274/* 287/*
275 * Functions registered by add_timer() or called by kernel_thread() only 288 * Functions registered by add_timer() or called by kernel_thread() only
276 * allow for a single 64-bit argument. The following macros can be used to 289 * allow for a single 64-bit argument. The following macros can be used to
@@ -576,30 +589,32 @@ struct xpc_channel {
576 589
577#define XPC_C_WASCONNECTED 0x00000001 /* channel was connected */ 590#define XPC_C_WASCONNECTED 0x00000001 /* channel was connected */
578 591
579#define XPC_C_ROPENREPLY 0x00000002 /* remote open channel reply */ 592#define XPC_C_ROPENCOMPLETE 0x00000002 /* remote open channel complete */
580#define XPC_C_OPENREPLY 0x00000004 /* local open channel reply */ 593#define XPC_C_OPENCOMPLETE 0x00000004 /* local open channel complete */
581#define XPC_C_ROPENREQUEST 0x00000008 /* remote open channel request */ 594#define XPC_C_ROPENREPLY 0x00000008 /* remote open channel reply */
582#define XPC_C_OPENREQUEST 0x00000010 /* local open channel request */ 595#define XPC_C_OPENREPLY 0x00000010 /* local open channel reply */
596#define XPC_C_ROPENREQUEST 0x00000020 /* remote open channel request */
597#define XPC_C_OPENREQUEST 0x00000040 /* local open channel request */
583 598
584#define XPC_C_SETUP 0x00000020 /* channel's msgqueues are alloc'd */ 599#define XPC_C_SETUP 0x00000080 /* channel's msgqueues are alloc'd */
585#define XPC_C_CONNECTEDCALLOUT 0x00000040 /* connected callout initiated */ 600#define XPC_C_CONNECTEDCALLOUT 0x00000100 /* connected callout initiated */
586#define XPC_C_CONNECTEDCALLOUT_MADE \ 601#define XPC_C_CONNECTEDCALLOUT_MADE \
587 0x00000080 /* connected callout completed */ 602 0x00000200 /* connected callout completed */
588#define XPC_C_CONNECTED 0x00000100 /* local channel is connected */ 603#define XPC_C_CONNECTED 0x00000400 /* local channel is connected */
589#define XPC_C_CONNECTING 0x00000200 /* channel is being connected */ 604#define XPC_C_CONNECTING 0x00000800 /* channel is being connected */
590 605
591#define XPC_C_RCLOSEREPLY 0x00000400 /* remote close channel reply */ 606#define XPC_C_RCLOSEREPLY 0x00001000 /* remote close channel reply */
592#define XPC_C_CLOSEREPLY 0x00000800 /* local close channel reply */ 607#define XPC_C_CLOSEREPLY 0x00002000 /* local close channel reply */
593#define XPC_C_RCLOSEREQUEST 0x00001000 /* remote close channel request */ 608#define XPC_C_RCLOSEREQUEST 0x00004000 /* remote close channel request */
594#define XPC_C_CLOSEREQUEST 0x00002000 /* local close channel request */ 609#define XPC_C_CLOSEREQUEST 0x00008000 /* local close channel request */
595 610
596#define XPC_C_DISCONNECTED 0x00004000 /* channel is disconnected */ 611#define XPC_C_DISCONNECTED 0x00010000 /* channel is disconnected */
597#define XPC_C_DISCONNECTING 0x00008000 /* channel is being disconnected */ 612#define XPC_C_DISCONNECTING 0x00020000 /* channel is being disconnected */
598#define XPC_C_DISCONNECTINGCALLOUT \ 613#define XPC_C_DISCONNECTINGCALLOUT \
599 0x00010000 /* disconnecting callout initiated */ 614 0x00040000 /* disconnecting callout initiated */
600#define XPC_C_DISCONNECTINGCALLOUT_MADE \ 615#define XPC_C_DISCONNECTINGCALLOUT_MADE \
601 0x00020000 /* disconnecting callout completed */ 616 0x00080000 /* disconnecting callout completed */
602#define XPC_C_WDISCONNECT 0x00040000 /* waiting for channel disconnect */ 617#define XPC_C_WDISCONNECT 0x00100000 /* waiting for channel disconnect */
603 618
604/* 619/*
605 * The channel control flags (chctl) union consists of a 64-bit variable which 620 * The channel control flags (chctl) union consists of a 64-bit variable which
@@ -618,11 +633,13 @@ union xpc_channel_ctl_flags {
618#define XPC_CHCTL_CLOSEREPLY 0x02 633#define XPC_CHCTL_CLOSEREPLY 0x02
619#define XPC_CHCTL_OPENREQUEST 0x04 634#define XPC_CHCTL_OPENREQUEST 0x04
620#define XPC_CHCTL_OPENREPLY 0x08 635#define XPC_CHCTL_OPENREPLY 0x08
621#define XPC_CHCTL_MSGREQUEST 0x10 636#define XPC_CHCTL_OPENCOMPLETE 0x10
637#define XPC_CHCTL_MSGREQUEST 0x20
622 638
623#define XPC_OPENCLOSE_CHCTL_FLAGS \ 639#define XPC_OPENCLOSE_CHCTL_FLAGS \
624 (XPC_CHCTL_CLOSEREQUEST | XPC_CHCTL_CLOSEREPLY | \ 640 (XPC_CHCTL_CLOSEREQUEST | XPC_CHCTL_CLOSEREPLY | \
625 XPC_CHCTL_OPENREQUEST | XPC_CHCTL_OPENREPLY) 641 XPC_CHCTL_OPENREQUEST | XPC_CHCTL_OPENREPLY | \
642 XPC_CHCTL_OPENCOMPLETE)
626#define XPC_MSG_CHCTL_FLAGS XPC_CHCTL_MSGREQUEST 643#define XPC_MSG_CHCTL_FLAGS XPC_CHCTL_MSGREQUEST
627 644
628static inline int 645static inline int
@@ -687,6 +704,9 @@ struct xpc_partition_sn2 {
687}; 704};
688 705
689struct xpc_partition_uv { 706struct xpc_partition_uv {
707 unsigned long heartbeat_gpa; /* phys addr of partition's heartbeat */
708 struct xpc_heartbeat_uv cached_heartbeat; /* cached copy of */
709 /* partition's heartbeat */
690 unsigned long activate_gru_mq_desc_gpa; /* phys addr of parititon's */ 710 unsigned long activate_gru_mq_desc_gpa; /* phys addr of parititon's */
691 /* activate mq's gru mq */ 711 /* activate mq's gru mq */
692 /* descriptor */ 712 /* descriptor */
@@ -698,14 +718,12 @@ struct xpc_partition_uv {
698 u8 remote_act_state; /* remote partition's act_state */ 718 u8 remote_act_state; /* remote partition's act_state */
699 u8 act_state_req; /* act_state request from remote partition */ 719 u8 act_state_req; /* act_state request from remote partition */
700 enum xp_retval reason; /* reason for deactivate act_state request */ 720 enum xp_retval reason; /* reason for deactivate act_state request */
701 u64 heartbeat; /* incremented by remote partition */
702}; 721};
703 722
704/* struct xpc_partition_uv flags */ 723/* struct xpc_partition_uv flags */
705 724
706#define XPC_P_HEARTBEAT_OFFLINE_UV 0x00000001 725#define XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV 0x00000001
707#define XPC_P_ENGAGED_UV 0x00000002 726#define XPC_P_ENGAGED_UV 0x00000002
708#define XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV 0x00000004
709 727
710/* struct xpc_partition_uv act_state change requests */ 728/* struct xpc_partition_uv act_state change requests */
711 729
@@ -762,6 +780,62 @@ struct xpc_partition {
762 780
763} ____cacheline_aligned; 781} ____cacheline_aligned;
764 782
783struct xpc_arch_operations {
784 int (*setup_partitions) (void);
785 void (*teardown_partitions) (void);
786 void (*process_activate_IRQ_rcvd) (void);
787 enum xp_retval (*get_partition_rsvd_page_pa)
788 (void *, u64 *, unsigned long *, size_t *);
789 int (*setup_rsvd_page) (struct xpc_rsvd_page *);
790
791 void (*allow_hb) (short);
792 void (*disallow_hb) (short);
793 void (*disallow_all_hbs) (void);
794 void (*increment_heartbeat) (void);
795 void (*offline_heartbeat) (void);
796 void (*online_heartbeat) (void);
797 void (*heartbeat_init) (void);
798 void (*heartbeat_exit) (void);
799 enum xp_retval (*get_remote_heartbeat) (struct xpc_partition *);
800
801 void (*request_partition_activation) (struct xpc_rsvd_page *,
802 unsigned long, int);
803 void (*request_partition_reactivation) (struct xpc_partition *);
804 void (*request_partition_deactivation) (struct xpc_partition *);
805 void (*cancel_partition_deactivation_request) (struct xpc_partition *);
806 enum xp_retval (*setup_ch_structures) (struct xpc_partition *);
807 void (*teardown_ch_structures) (struct xpc_partition *);
808
809 enum xp_retval (*make_first_contact) (struct xpc_partition *);
810
811 u64 (*get_chctl_all_flags) (struct xpc_partition *);
812 void (*send_chctl_closerequest) (struct xpc_channel *, unsigned long *);
813 void (*send_chctl_closereply) (struct xpc_channel *, unsigned long *);
814 void (*send_chctl_openrequest) (struct xpc_channel *, unsigned long *);
815 void (*send_chctl_openreply) (struct xpc_channel *, unsigned long *);
816 void (*send_chctl_opencomplete) (struct xpc_channel *, unsigned long *);
817 void (*process_msg_chctl_flags) (struct xpc_partition *, int);
818
819 enum xp_retval (*save_remote_msgqueue_pa) (struct xpc_channel *,
820 unsigned long);
821
822 enum xp_retval (*setup_msg_structures) (struct xpc_channel *);
823 void (*teardown_msg_structures) (struct xpc_channel *);
824
825 void (*indicate_partition_engaged) (struct xpc_partition *);
826 void (*indicate_partition_disengaged) (struct xpc_partition *);
827 void (*assume_partition_disengaged) (short);
828 int (*partition_engaged) (short);
829 int (*any_partition_engaged) (void);
830
831 int (*n_of_deliverable_payloads) (struct xpc_channel *);
832 enum xp_retval (*send_payload) (struct xpc_channel *, u32, void *,
833 u16, u8, xpc_notify_func, void *);
834 void *(*get_deliverable_payload) (struct xpc_channel *);
835 void (*received_payload) (struct xpc_channel *, void *);
836 void (*notify_senders_of_disconnect) (struct xpc_channel *);
837};
838
765/* struct xpc_partition act_state values (for XPC HB) */ 839/* struct xpc_partition act_state values (for XPC HB) */
766 840
767#define XPC_P_AS_INACTIVE 0x00 /* partition is not active */ 841#define XPC_P_AS_INACTIVE 0x00 /* partition is not active */
@@ -802,67 +876,17 @@ extern struct xpc_registration xpc_registrations[];
802/* found in xpc_main.c */ 876/* found in xpc_main.c */
803extern struct device *xpc_part; 877extern struct device *xpc_part;
804extern struct device *xpc_chan; 878extern struct device *xpc_chan;
879extern struct xpc_arch_operations xpc_arch_ops;
805extern int xpc_disengage_timelimit; 880extern int xpc_disengage_timelimit;
806extern int xpc_disengage_timedout; 881extern int xpc_disengage_timedout;
807extern int xpc_activate_IRQ_rcvd; 882extern int xpc_activate_IRQ_rcvd;
808extern spinlock_t xpc_activate_IRQ_rcvd_lock; 883extern spinlock_t xpc_activate_IRQ_rcvd_lock;
809extern wait_queue_head_t xpc_activate_IRQ_wq; 884extern wait_queue_head_t xpc_activate_IRQ_wq;
810extern void *xpc_heartbeating_to_mask;
811extern void *xpc_kzalloc_cacheline_aligned(size_t, gfp_t, void **); 885extern void *xpc_kzalloc_cacheline_aligned(size_t, gfp_t, void **);
812extern void xpc_activate_partition(struct xpc_partition *); 886extern void xpc_activate_partition(struct xpc_partition *);
813extern void xpc_activate_kthreads(struct xpc_channel *, int); 887extern void xpc_activate_kthreads(struct xpc_channel *, int);
814extern void xpc_create_kthreads(struct xpc_channel *, int, int); 888extern void xpc_create_kthreads(struct xpc_channel *, int, int);
815extern void xpc_disconnect_wait(int); 889extern void xpc_disconnect_wait(int);
816extern int (*xpc_setup_partitions_sn) (void);
817extern void (*xpc_teardown_partitions_sn) (void);
818extern enum xp_retval (*xpc_get_partition_rsvd_page_pa) (void *, u64 *,
819 unsigned long *,
820 size_t *);
821extern int (*xpc_setup_rsvd_page_sn) (struct xpc_rsvd_page *);
822extern void (*xpc_heartbeat_init) (void);
823extern void (*xpc_heartbeat_exit) (void);
824extern void (*xpc_increment_heartbeat) (void);
825extern void (*xpc_offline_heartbeat) (void);
826extern void (*xpc_online_heartbeat) (void);
827extern enum xp_retval (*xpc_get_remote_heartbeat) (struct xpc_partition *);
828extern enum xp_retval (*xpc_make_first_contact) (struct xpc_partition *);
829extern u64 (*xpc_get_chctl_all_flags) (struct xpc_partition *);
830extern enum xp_retval (*xpc_setup_msg_structures) (struct xpc_channel *);
831extern void (*xpc_teardown_msg_structures) (struct xpc_channel *);
832extern void (*xpc_notify_senders_of_disconnect) (struct xpc_channel *);
833extern void (*xpc_process_msg_chctl_flags) (struct xpc_partition *, int);
834extern int (*xpc_n_of_deliverable_payloads) (struct xpc_channel *);
835extern void *(*xpc_get_deliverable_payload) (struct xpc_channel *);
836extern void (*xpc_request_partition_activation) (struct xpc_rsvd_page *,
837 unsigned long, int);
838extern void (*xpc_request_partition_reactivation) (struct xpc_partition *);
839extern void (*xpc_request_partition_deactivation) (struct xpc_partition *);
840extern void (*xpc_cancel_partition_deactivation_request) (
841 struct xpc_partition *);
842extern void (*xpc_process_activate_IRQ_rcvd) (void);
843extern enum xp_retval (*xpc_setup_ch_structures_sn) (struct xpc_partition *);
844extern void (*xpc_teardown_ch_structures_sn) (struct xpc_partition *);
845
846extern void (*xpc_indicate_partition_engaged) (struct xpc_partition *);
847extern int (*xpc_partition_engaged) (short);
848extern int (*xpc_any_partition_engaged) (void);
849extern void (*xpc_indicate_partition_disengaged) (struct xpc_partition *);
850extern void (*xpc_assume_partition_disengaged) (short);
851
852extern void (*xpc_send_chctl_closerequest) (struct xpc_channel *,
853 unsigned long *);
854extern void (*xpc_send_chctl_closereply) (struct xpc_channel *,
855 unsigned long *);
856extern void (*xpc_send_chctl_openrequest) (struct xpc_channel *,
857 unsigned long *);
858extern void (*xpc_send_chctl_openreply) (struct xpc_channel *, unsigned long *);
859
860extern enum xp_retval (*xpc_save_remote_msgqueue_pa) (struct xpc_channel *,
861 unsigned long);
862
863extern enum xp_retval (*xpc_send_payload) (struct xpc_channel *, u32, void *,
864 u16, u8, xpc_notify_func, void *);
865extern void (*xpc_received_payload) (struct xpc_channel *, void *);
866 890
867/* found in xpc_sn2.c */ 891/* found in xpc_sn2.c */
868extern int xpc_init_sn2(void); 892extern int xpc_init_sn2(void);
@@ -909,40 +933,6 @@ extern void xpc_disconnect_channel(const int, struct xpc_channel *,
909extern void xpc_disconnect_callout(struct xpc_channel *, enum xp_retval); 933extern void xpc_disconnect_callout(struct xpc_channel *, enum xp_retval);
910extern void xpc_partition_going_down(struct xpc_partition *, enum xp_retval); 934extern void xpc_partition_going_down(struct xpc_partition *, enum xp_retval);
911 935
912static inline int
913xpc_hb_allowed(short partid, void *heartbeating_to_mask)
914{
915 return test_bit(partid, heartbeating_to_mask);
916}
917
918static inline int
919xpc_any_hbs_allowed(void)
920{
921 DBUG_ON(xpc_heartbeating_to_mask == NULL);
922 return !bitmap_empty(xpc_heartbeating_to_mask, xp_max_npartitions);
923}
924
925static inline void
926xpc_allow_hb(short partid)
927{
928 DBUG_ON(xpc_heartbeating_to_mask == NULL);
929 set_bit(partid, xpc_heartbeating_to_mask);
930}
931
932static inline void
933xpc_disallow_hb(short partid)
934{
935 DBUG_ON(xpc_heartbeating_to_mask == NULL);
936 clear_bit(partid, xpc_heartbeating_to_mask);
937}
938
939static inline void
940xpc_disallow_all_hbs(void)
941{
942 DBUG_ON(xpc_heartbeating_to_mask == NULL);
943 bitmap_zero(xpc_heartbeating_to_mask, xp_max_npartitions);
944}
945
946static inline void 936static inline void
947xpc_wakeup_channel_mgr(struct xpc_partition *part) 937xpc_wakeup_channel_mgr(struct xpc_partition *part)
948{ 938{
diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c
index 99a2534c38a1..652593fc486d 100644
--- a/drivers/misc/sgi-xp/xpc_channel.c
+++ b/drivers/misc/sgi-xp/xpc_channel.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2004-2009 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9/* 9/*
@@ -39,34 +39,38 @@ xpc_process_connect(struct xpc_channel *ch, unsigned long *irq_flags)
39 39
40 if (!(ch->flags & XPC_C_SETUP)) { 40 if (!(ch->flags & XPC_C_SETUP)) {
41 spin_unlock_irqrestore(&ch->lock, *irq_flags); 41 spin_unlock_irqrestore(&ch->lock, *irq_flags);
42 ret = xpc_setup_msg_structures(ch); 42 ret = xpc_arch_ops.setup_msg_structures(ch);
43 spin_lock_irqsave(&ch->lock, *irq_flags); 43 spin_lock_irqsave(&ch->lock, *irq_flags);
44 44
45 if (ret != xpSuccess) 45 if (ret != xpSuccess)
46 XPC_DISCONNECT_CHANNEL(ch, ret, irq_flags); 46 XPC_DISCONNECT_CHANNEL(ch, ret, irq_flags);
47 else
48 ch->flags |= XPC_C_SETUP;
47 49
48 ch->flags |= XPC_C_SETUP; 50 if (ch->flags & XPC_C_DISCONNECTING)
49
50 if (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING))
51 return; 51 return;
52 } 52 }
53 53
54 if (!(ch->flags & XPC_C_OPENREPLY)) { 54 if (!(ch->flags & XPC_C_OPENREPLY)) {
55 ch->flags |= XPC_C_OPENREPLY; 55 ch->flags |= XPC_C_OPENREPLY;
56 xpc_send_chctl_openreply(ch, irq_flags); 56 xpc_arch_ops.send_chctl_openreply(ch, irq_flags);
57 } 57 }
58 58
59 if (!(ch->flags & XPC_C_ROPENREPLY)) 59 if (!(ch->flags & XPC_C_ROPENREPLY))
60 return; 60 return;
61 61
62 ch->flags = (XPC_C_CONNECTED | XPC_C_SETUP); /* clear all else */ 62 if (!(ch->flags & XPC_C_OPENCOMPLETE)) {
63 ch->flags |= (XPC_C_OPENCOMPLETE | XPC_C_CONNECTED);
64 xpc_arch_ops.send_chctl_opencomplete(ch, irq_flags);
65 }
66
67 if (!(ch->flags & XPC_C_ROPENCOMPLETE))
68 return;
63 69
64 dev_info(xpc_chan, "channel %d to partition %d connected\n", 70 dev_info(xpc_chan, "channel %d to partition %d connected\n",
65 ch->number, ch->partid); 71 ch->number, ch->partid);
66 72
67 spin_unlock_irqrestore(&ch->lock, *irq_flags); 73 ch->flags = (XPC_C_CONNECTED | XPC_C_SETUP); /* clear all else */
68 xpc_create_kthreads(ch, 1, 0);
69 spin_lock_irqsave(&ch->lock, *irq_flags);
70} 74}
71 75
72/* 76/*
@@ -96,7 +100,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
96 100
97 if (part->act_state == XPC_P_AS_DEACTIVATING) { 101 if (part->act_state == XPC_P_AS_DEACTIVATING) {
98 /* can't proceed until the other side disengages from us */ 102 /* can't proceed until the other side disengages from us */
99 if (xpc_partition_engaged(ch->partid)) 103 if (xpc_arch_ops.partition_engaged(ch->partid))
100 return; 104 return;
101 105
102 } else { 106 } else {
@@ -108,7 +112,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
108 112
109 if (!(ch->flags & XPC_C_CLOSEREPLY)) { 113 if (!(ch->flags & XPC_C_CLOSEREPLY)) {
110 ch->flags |= XPC_C_CLOSEREPLY; 114 ch->flags |= XPC_C_CLOSEREPLY;
111 xpc_send_chctl_closereply(ch, irq_flags); 115 xpc_arch_ops.send_chctl_closereply(ch, irq_flags);
112 } 116 }
113 117
114 if (!(ch->flags & XPC_C_RCLOSEREPLY)) 118 if (!(ch->flags & XPC_C_RCLOSEREPLY))
@@ -118,7 +122,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
118 /* wake those waiting for notify completion */ 122 /* wake those waiting for notify completion */
119 if (atomic_read(&ch->n_to_notify) > 0) { 123 if (atomic_read(&ch->n_to_notify) > 0) {
120 /* we do callout while holding ch->lock, callout can't block */ 124 /* we do callout while holding ch->lock, callout can't block */
121 xpc_notify_senders_of_disconnect(ch); 125 xpc_arch_ops.notify_senders_of_disconnect(ch);
122 } 126 }
123 127
124 /* both sides are disconnected now */ 128 /* both sides are disconnected now */
@@ -132,7 +136,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
132 DBUG_ON(atomic_read(&ch->n_to_notify) != 0); 136 DBUG_ON(atomic_read(&ch->n_to_notify) != 0);
133 137
134 /* it's now safe to free the channel's message queues */ 138 /* it's now safe to free the channel's message queues */
135 xpc_teardown_msg_structures(ch); 139 xpc_arch_ops.teardown_msg_structures(ch);
136 140
137 ch->func = NULL; 141 ch->func = NULL;
138 ch->key = NULL; 142 ch->key = NULL;
@@ -144,8 +148,9 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags)
144 148
145 /* 149 /*
146 * Mark the channel disconnected and clear all other flags, including 150 * Mark the channel disconnected and clear all other flags, including
147 * XPC_C_SETUP (because of call to xpc_teardown_msg_structures()) but 151 * XPC_C_SETUP (because of call to
148 * not including XPC_C_WDISCONNECT (if it was set). 152 * xpc_arch_ops.teardown_msg_structures()) but not including
153 * XPC_C_WDISCONNECT (if it was set).
149 */ 154 */
150 ch->flags = (XPC_C_DISCONNECTED | (ch->flags & XPC_C_WDISCONNECT)); 155 ch->flags = (XPC_C_DISCONNECTED | (ch->flags & XPC_C_WDISCONNECT));
151 156
@@ -184,6 +189,7 @@ xpc_process_openclose_chctl_flags(struct xpc_partition *part, int ch_number,
184 struct xpc_channel *ch = &part->channels[ch_number]; 189 struct xpc_channel *ch = &part->channels[ch_number];
185 enum xp_retval reason; 190 enum xp_retval reason;
186 enum xp_retval ret; 191 enum xp_retval ret;
192 int create_kthread = 0;
187 193
188 spin_lock_irqsave(&ch->lock, irq_flags); 194 spin_lock_irqsave(&ch->lock, irq_flags);
189 195
@@ -196,8 +202,7 @@ again:
196 * has had a chance to see that the channel is disconnected. 202 * has had a chance to see that the channel is disconnected.
197 */ 203 */
198 ch->delayed_chctl_flags |= chctl_flags; 204 ch->delayed_chctl_flags |= chctl_flags;
199 spin_unlock_irqrestore(&ch->lock, irq_flags); 205 goto out;
200 return;
201 } 206 }
202 207
203 if (chctl_flags & XPC_CHCTL_CLOSEREQUEST) { 208 if (chctl_flags & XPC_CHCTL_CLOSEREQUEST) {
@@ -239,8 +244,7 @@ again:
239 XPC_CHCTL_CLOSEREQUEST; 244 XPC_CHCTL_CLOSEREQUEST;
240 spin_unlock(&part->chctl_lock); 245 spin_unlock(&part->chctl_lock);
241 } 246 }
242 spin_unlock_irqrestore(&ch->lock, irq_flags); 247 goto out;
243 return;
244 } 248 }
245 249
246 XPC_SET_REASON(ch, 0, 0); 250 XPC_SET_REASON(ch, 0, 0);
@@ -250,7 +254,8 @@ again:
250 ch->flags |= (XPC_C_CONNECTING | XPC_C_ROPENREQUEST); 254 ch->flags |= (XPC_C_CONNECTING | XPC_C_ROPENREQUEST);
251 } 255 }
252 256
253 chctl_flags &= ~(XPC_CHCTL_OPENREQUEST | XPC_CHCTL_OPENREPLY); 257 chctl_flags &= ~(XPC_CHCTL_OPENREQUEST | XPC_CHCTL_OPENREPLY |
258 XPC_CHCTL_OPENCOMPLETE);
254 259
255 /* 260 /*
256 * The meaningful CLOSEREQUEST connection state fields are: 261 * The meaningful CLOSEREQUEST connection state fields are:
@@ -269,8 +274,7 @@ again:
269 XPC_DISCONNECT_CHANNEL(ch, reason, &irq_flags); 274 XPC_DISCONNECT_CHANNEL(ch, reason, &irq_flags);
270 275
271 DBUG_ON(chctl_flags & XPC_CHCTL_CLOSEREPLY); 276 DBUG_ON(chctl_flags & XPC_CHCTL_CLOSEREPLY);
272 spin_unlock_irqrestore(&ch->lock, irq_flags); 277 goto out;
273 return;
274 } 278 }
275 279
276 xpc_process_disconnect(ch, &irq_flags); 280 xpc_process_disconnect(ch, &irq_flags);
@@ -283,8 +287,7 @@ again:
283 287
284 if (ch->flags & XPC_C_DISCONNECTED) { 288 if (ch->flags & XPC_C_DISCONNECTED) {
285 DBUG_ON(part->act_state != XPC_P_AS_DEACTIVATING); 289 DBUG_ON(part->act_state != XPC_P_AS_DEACTIVATING);
286 spin_unlock_irqrestore(&ch->lock, irq_flags); 290 goto out;
287 return;
288 } 291 }
289 292
290 DBUG_ON(!(ch->flags & XPC_C_CLOSEREQUEST)); 293 DBUG_ON(!(ch->flags & XPC_C_CLOSEREQUEST));
@@ -299,8 +302,7 @@ again:
299 XPC_CHCTL_CLOSEREPLY; 302 XPC_CHCTL_CLOSEREPLY;
300 spin_unlock(&part->chctl_lock); 303 spin_unlock(&part->chctl_lock);
301 } 304 }
302 spin_unlock_irqrestore(&ch->lock, irq_flags); 305 goto out;
303 return;
304 } 306 }
305 307
306 ch->flags |= XPC_C_RCLOSEREPLY; 308 ch->flags |= XPC_C_RCLOSEREPLY;
@@ -320,14 +322,12 @@ again:
320 322
321 if (part->act_state == XPC_P_AS_DEACTIVATING || 323 if (part->act_state == XPC_P_AS_DEACTIVATING ||
322 (ch->flags & XPC_C_ROPENREQUEST)) { 324 (ch->flags & XPC_C_ROPENREQUEST)) {
323 spin_unlock_irqrestore(&ch->lock, irq_flags); 325 goto out;
324 return;
325 } 326 }
326 327
327 if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_WDISCONNECT)) { 328 if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_WDISCONNECT)) {
328 ch->delayed_chctl_flags |= XPC_CHCTL_OPENREQUEST; 329 ch->delayed_chctl_flags |= XPC_CHCTL_OPENREQUEST;
329 spin_unlock_irqrestore(&ch->lock, irq_flags); 330 goto out;
330 return;
331 } 331 }
332 DBUG_ON(!(ch->flags & (XPC_C_DISCONNECTED | 332 DBUG_ON(!(ch->flags & (XPC_C_DISCONNECTED |
333 XPC_C_OPENREQUEST))); 333 XPC_C_OPENREQUEST)));
@@ -341,8 +341,7 @@ again:
341 */ 341 */
342 if (args->entry_size == 0 || args->local_nentries == 0) { 342 if (args->entry_size == 0 || args->local_nentries == 0) {
343 /* assume OPENREQUEST was delayed by mistake */ 343 /* assume OPENREQUEST was delayed by mistake */
344 spin_unlock_irqrestore(&ch->lock, irq_flags); 344 goto out;
345 return;
346 } 345 }
347 346
348 ch->flags |= (XPC_C_ROPENREQUEST | XPC_C_CONNECTING); 347 ch->flags |= (XPC_C_ROPENREQUEST | XPC_C_CONNECTING);
@@ -352,8 +351,7 @@ again:
352 if (args->entry_size != ch->entry_size) { 351 if (args->entry_size != ch->entry_size) {
353 XPC_DISCONNECT_CHANNEL(ch, xpUnequalMsgSizes, 352 XPC_DISCONNECT_CHANNEL(ch, xpUnequalMsgSizes,
354 &irq_flags); 353 &irq_flags);
355 spin_unlock_irqrestore(&ch->lock, irq_flags); 354 goto out;
356 return;
357 } 355 }
358 } else { 356 } else {
359 ch->entry_size = args->entry_size; 357 ch->entry_size = args->entry_size;
@@ -375,15 +373,13 @@ again:
375 args->local_msgqueue_pa, args->local_nentries, 373 args->local_msgqueue_pa, args->local_nentries,
376 args->remote_nentries, ch->partid, ch->number); 374 args->remote_nentries, ch->partid, ch->number);
377 375
378 if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED)) { 376 if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED))
379 spin_unlock_irqrestore(&ch->lock, irq_flags); 377 goto out;
380 return; 378
381 }
382 if (!(ch->flags & XPC_C_OPENREQUEST)) { 379 if (!(ch->flags & XPC_C_OPENREQUEST)) {
383 XPC_DISCONNECT_CHANNEL(ch, xpOpenCloseError, 380 XPC_DISCONNECT_CHANNEL(ch, xpOpenCloseError,
384 &irq_flags); 381 &irq_flags);
385 spin_unlock_irqrestore(&ch->lock, irq_flags); 382 goto out;
386 return;
387 } 383 }
388 384
389 DBUG_ON(!(ch->flags & XPC_C_ROPENREQUEST)); 385 DBUG_ON(!(ch->flags & XPC_C_ROPENREQUEST));
@@ -400,11 +396,11 @@ again:
400 DBUG_ON(args->local_nentries == 0); 396 DBUG_ON(args->local_nentries == 0);
401 DBUG_ON(args->remote_nentries == 0); 397 DBUG_ON(args->remote_nentries == 0);
402 398
403 ret = xpc_save_remote_msgqueue_pa(ch, args->local_msgqueue_pa); 399 ret = xpc_arch_ops.save_remote_msgqueue_pa(ch,
400 args->local_msgqueue_pa);
404 if (ret != xpSuccess) { 401 if (ret != xpSuccess) {
405 XPC_DISCONNECT_CHANNEL(ch, ret, &irq_flags); 402 XPC_DISCONNECT_CHANNEL(ch, ret, &irq_flags);
406 spin_unlock_irqrestore(&ch->lock, irq_flags); 403 goto out;
407 return;
408 } 404 }
409 ch->flags |= XPC_C_ROPENREPLY; 405 ch->flags |= XPC_C_ROPENREPLY;
410 406
@@ -430,7 +426,36 @@ again:
430 xpc_process_connect(ch, &irq_flags); 426 xpc_process_connect(ch, &irq_flags);
431 } 427 }
432 428
429 if (chctl_flags & XPC_CHCTL_OPENCOMPLETE) {
430
431 dev_dbg(xpc_chan, "XPC_CHCTL_OPENCOMPLETE received from "
432 "partid=%d, channel=%d\n", ch->partid, ch->number);
433
434 if (ch->flags & (XPC_C_DISCONNECTING | XPC_C_DISCONNECTED))
435 goto out;
436
437 if (!(ch->flags & XPC_C_OPENREQUEST) ||
438 !(ch->flags & XPC_C_OPENREPLY)) {
439 XPC_DISCONNECT_CHANNEL(ch, xpOpenCloseError,
440 &irq_flags);
441 goto out;
442 }
443
444 DBUG_ON(!(ch->flags & XPC_C_ROPENREQUEST));
445 DBUG_ON(!(ch->flags & XPC_C_ROPENREPLY));
446 DBUG_ON(!(ch->flags & XPC_C_CONNECTED));
447
448 ch->flags |= XPC_C_ROPENCOMPLETE;
449
450 xpc_process_connect(ch, &irq_flags);
451 create_kthread = 1;
452 }
453
454out:
433 spin_unlock_irqrestore(&ch->lock, irq_flags); 455 spin_unlock_irqrestore(&ch->lock, irq_flags);
456
457 if (create_kthread)
458 xpc_create_kthreads(ch, 1, 0);
434} 459}
435 460
436/* 461/*
@@ -508,7 +533,7 @@ xpc_connect_channel(struct xpc_channel *ch)
508 /* initiate the connection */ 533 /* initiate the connection */
509 534
510 ch->flags |= (XPC_C_OPENREQUEST | XPC_C_CONNECTING); 535 ch->flags |= (XPC_C_OPENREQUEST | XPC_C_CONNECTING);
511 xpc_send_chctl_openrequest(ch, &irq_flags); 536 xpc_arch_ops.send_chctl_openrequest(ch, &irq_flags);
512 537
513 xpc_process_connect(ch, &irq_flags); 538 xpc_process_connect(ch, &irq_flags);
514 539
@@ -526,7 +551,7 @@ xpc_process_sent_chctl_flags(struct xpc_partition *part)
526 int ch_number; 551 int ch_number;
527 u32 ch_flags; 552 u32 ch_flags;
528 553
529 chctl.all_flags = xpc_get_chctl_all_flags(part); 554 chctl.all_flags = xpc_arch_ops.get_chctl_all_flags(part);
530 555
531 /* 556 /*
532 * Initiate channel connections for registered channels. 557 * Initiate channel connections for registered channels.
@@ -564,10 +589,6 @@ xpc_process_sent_chctl_flags(struct xpc_partition *part)
564 if (!(ch_flags & XPC_C_OPENREQUEST)) { 589 if (!(ch_flags & XPC_C_OPENREQUEST)) {
565 DBUG_ON(ch_flags & XPC_C_SETUP); 590 DBUG_ON(ch_flags & XPC_C_SETUP);
566 (void)xpc_connect_channel(ch); 591 (void)xpc_connect_channel(ch);
567 } else {
568 spin_lock_irqsave(&ch->lock, irq_flags);
569 xpc_process_connect(ch, &irq_flags);
570 spin_unlock_irqrestore(&ch->lock, irq_flags);
571 } 592 }
572 continue; 593 continue;
573 } 594 }
@@ -579,7 +600,7 @@ xpc_process_sent_chctl_flags(struct xpc_partition *part)
579 */ 600 */
580 601
581 if (chctl.flags[ch_number] & XPC_MSG_CHCTL_FLAGS) 602 if (chctl.flags[ch_number] & XPC_MSG_CHCTL_FLAGS)
582 xpc_process_msg_chctl_flags(part, ch_number); 603 xpc_arch_ops.process_msg_chctl_flags(part, ch_number);
583 } 604 }
584} 605}
585 606
@@ -755,7 +776,7 @@ xpc_disconnect_channel(const int line, struct xpc_channel *ch,
755 XPC_C_ROPENREQUEST | XPC_C_ROPENREPLY | 776 XPC_C_ROPENREQUEST | XPC_C_ROPENREPLY |
756 XPC_C_CONNECTING | XPC_C_CONNECTED); 777 XPC_C_CONNECTING | XPC_C_CONNECTED);
757 778
758 xpc_send_chctl_closerequest(ch, irq_flags); 779 xpc_arch_ops.send_chctl_closerequest(ch, irq_flags);
759 780
760 if (channel_was_connected) 781 if (channel_was_connected)
761 ch->flags |= XPC_C_WASCONNECTED; 782 ch->flags |= XPC_C_WASCONNECTED;
@@ -862,8 +883,8 @@ xpc_initiate_send(short partid, int ch_number, u32 flags, void *payload,
862 DBUG_ON(payload == NULL); 883 DBUG_ON(payload == NULL);
863 884
864 if (xpc_part_ref(part)) { 885 if (xpc_part_ref(part)) {
865 ret = xpc_send_payload(&part->channels[ch_number], flags, 886 ret = xpc_arch_ops.send_payload(&part->channels[ch_number],
866 payload, payload_size, 0, NULL, NULL); 887 flags, payload, payload_size, 0, NULL, NULL);
867 xpc_part_deref(part); 888 xpc_part_deref(part);
868 } 889 }
869 890
@@ -914,9 +935,8 @@ xpc_initiate_send_notify(short partid, int ch_number, u32 flags, void *payload,
914 DBUG_ON(func == NULL); 935 DBUG_ON(func == NULL);
915 936
916 if (xpc_part_ref(part)) { 937 if (xpc_part_ref(part)) {
917 ret = xpc_send_payload(&part->channels[ch_number], flags, 938 ret = xpc_arch_ops.send_payload(&part->channels[ch_number],
918 payload, payload_size, XPC_N_CALL, func, 939 flags, payload, payload_size, XPC_N_CALL, func, key);
919 key);
920 xpc_part_deref(part); 940 xpc_part_deref(part);
921 } 941 }
922 return ret; 942 return ret;
@@ -930,7 +950,7 @@ xpc_deliver_payload(struct xpc_channel *ch)
930{ 950{
931 void *payload; 951 void *payload;
932 952
933 payload = xpc_get_deliverable_payload(ch); 953 payload = xpc_arch_ops.get_deliverable_payload(ch);
934 if (payload != NULL) { 954 if (payload != NULL) {
935 955
936 /* 956 /*
@@ -984,7 +1004,7 @@ xpc_initiate_received(short partid, int ch_number, void *payload)
984 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels); 1004 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels);
985 1005
986 ch = &part->channels[ch_number]; 1006 ch = &part->channels[ch_number];
987 xpc_received_payload(ch, payload); 1007 xpc_arch_ops.received_payload(ch, payload);
988 1008
989 /* the call to xpc_msgqueue_ref() was done by xpc_deliver_payload() */ 1009 /* the call to xpc_msgqueue_ref() was done by xpc_deliver_payload() */
990 xpc_msgqueue_deref(ch); 1010 xpc_msgqueue_deref(ch);
diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
index 1ab9fda87fab..fd3688a3e23f 100644
--- a/drivers/misc/sgi-xp/xpc_main.c
+++ b/drivers/misc/sgi-xp/xpc_main.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2004-2009 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9/* 9/*
@@ -150,7 +150,6 @@ DECLARE_WAIT_QUEUE_HEAD(xpc_activate_IRQ_wq);
150 150
151static unsigned long xpc_hb_check_timeout; 151static unsigned long xpc_hb_check_timeout;
152static struct timer_list xpc_hb_timer; 152static struct timer_list xpc_hb_timer;
153void *xpc_heartbeating_to_mask;
154 153
155/* notification that the xpc_hb_checker thread has exited */ 154/* notification that the xpc_hb_checker thread has exited */
156static DECLARE_COMPLETION(xpc_hb_checker_exited); 155static DECLARE_COMPLETION(xpc_hb_checker_exited);
@@ -170,62 +169,7 @@ static struct notifier_block xpc_die_notifier = {
170 .notifier_call = xpc_system_die, 169 .notifier_call = xpc_system_die,
171}; 170};
172 171
173int (*xpc_setup_partitions_sn) (void); 172struct xpc_arch_operations xpc_arch_ops;
174void (*xpc_teardown_partitions_sn) (void);
175enum xp_retval (*xpc_get_partition_rsvd_page_pa) (void *buf, u64 *cookie,
176 unsigned long *rp_pa,
177 size_t *len);
178int (*xpc_setup_rsvd_page_sn) (struct xpc_rsvd_page *rp);
179void (*xpc_heartbeat_init) (void);
180void (*xpc_heartbeat_exit) (void);
181void (*xpc_increment_heartbeat) (void);
182void (*xpc_offline_heartbeat) (void);
183void (*xpc_online_heartbeat) (void);
184enum xp_retval (*xpc_get_remote_heartbeat) (struct xpc_partition *part);
185
186enum xp_retval (*xpc_make_first_contact) (struct xpc_partition *part);
187void (*xpc_notify_senders_of_disconnect) (struct xpc_channel *ch);
188u64 (*xpc_get_chctl_all_flags) (struct xpc_partition *part);
189enum xp_retval (*xpc_setup_msg_structures) (struct xpc_channel *ch);
190void (*xpc_teardown_msg_structures) (struct xpc_channel *ch);
191void (*xpc_process_msg_chctl_flags) (struct xpc_partition *part, int ch_number);
192int (*xpc_n_of_deliverable_payloads) (struct xpc_channel *ch);
193void *(*xpc_get_deliverable_payload) (struct xpc_channel *ch);
194
195void (*xpc_request_partition_activation) (struct xpc_rsvd_page *remote_rp,
196 unsigned long remote_rp_pa,
197 int nasid);
198void (*xpc_request_partition_reactivation) (struct xpc_partition *part);
199void (*xpc_request_partition_deactivation) (struct xpc_partition *part);
200void (*xpc_cancel_partition_deactivation_request) (struct xpc_partition *part);
201
202void (*xpc_process_activate_IRQ_rcvd) (void);
203enum xp_retval (*xpc_setup_ch_structures_sn) (struct xpc_partition *part);
204void (*xpc_teardown_ch_structures_sn) (struct xpc_partition *part);
205
206void (*xpc_indicate_partition_engaged) (struct xpc_partition *part);
207int (*xpc_partition_engaged) (short partid);
208int (*xpc_any_partition_engaged) (void);
209void (*xpc_indicate_partition_disengaged) (struct xpc_partition *part);
210void (*xpc_assume_partition_disengaged) (short partid);
211
212void (*xpc_send_chctl_closerequest) (struct xpc_channel *ch,
213 unsigned long *irq_flags);
214void (*xpc_send_chctl_closereply) (struct xpc_channel *ch,
215 unsigned long *irq_flags);
216void (*xpc_send_chctl_openrequest) (struct xpc_channel *ch,
217 unsigned long *irq_flags);
218void (*xpc_send_chctl_openreply) (struct xpc_channel *ch,
219 unsigned long *irq_flags);
220
221enum xp_retval (*xpc_save_remote_msgqueue_pa) (struct xpc_channel *ch,
222 unsigned long msgqueue_pa);
223
224enum xp_retval (*xpc_send_payload) (struct xpc_channel *ch, u32 flags,
225 void *payload, u16 payload_size,
226 u8 notify_type, xpc_notify_func func,
227 void *key);
228void (*xpc_received_payload) (struct xpc_channel *ch, void *payload);
229 173
230/* 174/*
231 * Timer function to enforce the timelimit on the partition disengage. 175 * Timer function to enforce the timelimit on the partition disengage.
@@ -240,7 +184,7 @@ xpc_timeout_partition_disengage(unsigned long data)
240 (void)xpc_partition_disengaged(part); 184 (void)xpc_partition_disengaged(part);
241 185
242 DBUG_ON(part->disengage_timeout != 0); 186 DBUG_ON(part->disengage_timeout != 0);
243 DBUG_ON(xpc_partition_engaged(XPC_PARTID(part))); 187 DBUG_ON(xpc_arch_ops.partition_engaged(XPC_PARTID(part)));
244} 188}
245 189
246/* 190/*
@@ -251,7 +195,7 @@ xpc_timeout_partition_disengage(unsigned long data)
251static void 195static void
252xpc_hb_beater(unsigned long dummy) 196xpc_hb_beater(unsigned long dummy)
253{ 197{
254 xpc_increment_heartbeat(); 198 xpc_arch_ops.increment_heartbeat();
255 199
256 if (time_is_before_eq_jiffies(xpc_hb_check_timeout)) 200 if (time_is_before_eq_jiffies(xpc_hb_check_timeout))
257 wake_up_interruptible(&xpc_activate_IRQ_wq); 201 wake_up_interruptible(&xpc_activate_IRQ_wq);
@@ -263,7 +207,7 @@ xpc_hb_beater(unsigned long dummy)
263static void 207static void
264xpc_start_hb_beater(void) 208xpc_start_hb_beater(void)
265{ 209{
266 xpc_heartbeat_init(); 210 xpc_arch_ops.heartbeat_init();
267 init_timer(&xpc_hb_timer); 211 init_timer(&xpc_hb_timer);
268 xpc_hb_timer.function = xpc_hb_beater; 212 xpc_hb_timer.function = xpc_hb_beater;
269 xpc_hb_beater(0); 213 xpc_hb_beater(0);
@@ -273,7 +217,7 @@ static void
273xpc_stop_hb_beater(void) 217xpc_stop_hb_beater(void)
274{ 218{
275 del_timer_sync(&xpc_hb_timer); 219 del_timer_sync(&xpc_hb_timer);
276 xpc_heartbeat_exit(); 220 xpc_arch_ops.heartbeat_exit();
277} 221}
278 222
279/* 223/*
@@ -302,7 +246,7 @@ xpc_check_remote_hb(void)
302 continue; 246 continue;
303 } 247 }
304 248
305 ret = xpc_get_remote_heartbeat(part); 249 ret = xpc_arch_ops.get_remote_heartbeat(part);
306 if (ret != xpSuccess) 250 if (ret != xpSuccess)
307 XPC_DEACTIVATE_PARTITION(part, ret); 251 XPC_DEACTIVATE_PARTITION(part, ret);
308 } 252 }
@@ -353,7 +297,7 @@ xpc_hb_checker(void *ignore)
353 force_IRQ = 0; 297 force_IRQ = 0;
354 dev_dbg(xpc_part, "processing activate IRQs " 298 dev_dbg(xpc_part, "processing activate IRQs "
355 "received\n"); 299 "received\n");
356 xpc_process_activate_IRQ_rcvd(); 300 xpc_arch_ops.process_activate_IRQ_rcvd();
357 } 301 }
358 302
359 /* wait for IRQ or timeout */ 303 /* wait for IRQ or timeout */
@@ -528,7 +472,7 @@ xpc_setup_ch_structures(struct xpc_partition *part)
528 init_waitqueue_head(&ch->idle_wq); 472 init_waitqueue_head(&ch->idle_wq);
529 } 473 }
530 474
531 ret = xpc_setup_ch_structures_sn(part); 475 ret = xpc_arch_ops.setup_ch_structures(part);
532 if (ret != xpSuccess) 476 if (ret != xpSuccess)
533 goto out_2; 477 goto out_2;
534 478
@@ -572,7 +516,7 @@ xpc_teardown_ch_structures(struct xpc_partition *part)
572 516
573 /* now we can begin tearing down the infrastructure */ 517 /* now we can begin tearing down the infrastructure */
574 518
575 xpc_teardown_ch_structures_sn(part); 519 xpc_arch_ops.teardown_ch_structures(part);
576 520
577 kfree(part->remote_openclose_args_base); 521 kfree(part->remote_openclose_args_base);
578 part->remote_openclose_args = NULL; 522 part->remote_openclose_args = NULL;
@@ -620,12 +564,12 @@ xpc_activating(void *__partid)
620 564
621 dev_dbg(xpc_part, "activating partition %d\n", partid); 565 dev_dbg(xpc_part, "activating partition %d\n", partid);
622 566
623 xpc_allow_hb(partid); 567 xpc_arch_ops.allow_hb(partid);
624 568
625 if (xpc_setup_ch_structures(part) == xpSuccess) { 569 if (xpc_setup_ch_structures(part) == xpSuccess) {
626 (void)xpc_part_ref(part); /* this will always succeed */ 570 (void)xpc_part_ref(part); /* this will always succeed */
627 571
628 if (xpc_make_first_contact(part) == xpSuccess) { 572 if (xpc_arch_ops.make_first_contact(part) == xpSuccess) {
629 xpc_mark_partition_active(part); 573 xpc_mark_partition_active(part);
630 xpc_channel_mgr(part); 574 xpc_channel_mgr(part);
631 /* won't return until partition is deactivating */ 575 /* won't return until partition is deactivating */
@@ -635,12 +579,12 @@ xpc_activating(void *__partid)
635 xpc_teardown_ch_structures(part); 579 xpc_teardown_ch_structures(part);
636 } 580 }
637 581
638 xpc_disallow_hb(partid); 582 xpc_arch_ops.disallow_hb(partid);
639 xpc_mark_partition_inactive(part); 583 xpc_mark_partition_inactive(part);
640 584
641 if (part->reason == xpReactivating) { 585 if (part->reason == xpReactivating) {
642 /* interrupting ourselves results in activating partition */ 586 /* interrupting ourselves results in activating partition */
643 xpc_request_partition_reactivation(part); 587 xpc_arch_ops.request_partition_reactivation(part);
644 } 588 }
645 589
646 return 0; 590 return 0;
@@ -713,10 +657,13 @@ xpc_activate_kthreads(struct xpc_channel *ch, int needed)
713static void 657static void
714xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch) 658xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch)
715{ 659{
660 int (*n_of_deliverable_payloads) (struct xpc_channel *) =
661 xpc_arch_ops.n_of_deliverable_payloads;
662
716 do { 663 do {
717 /* deliver messages to their intended recipients */ 664 /* deliver messages to their intended recipients */
718 665
719 while (xpc_n_of_deliverable_payloads(ch) > 0 && 666 while (n_of_deliverable_payloads(ch) > 0 &&
720 !(ch->flags & XPC_C_DISCONNECTING)) { 667 !(ch->flags & XPC_C_DISCONNECTING)) {
721 xpc_deliver_payload(ch); 668 xpc_deliver_payload(ch);
722 } 669 }
@@ -732,7 +679,7 @@ xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch)
732 "wait_event_interruptible_exclusive()\n"); 679 "wait_event_interruptible_exclusive()\n");
733 680
734 (void)wait_event_interruptible_exclusive(ch->idle_wq, 681 (void)wait_event_interruptible_exclusive(ch->idle_wq,
735 (xpc_n_of_deliverable_payloads(ch) > 0 || 682 (n_of_deliverable_payloads(ch) > 0 ||
736 (ch->flags & XPC_C_DISCONNECTING))); 683 (ch->flags & XPC_C_DISCONNECTING)));
737 684
738 atomic_dec(&ch->kthreads_idle); 685 atomic_dec(&ch->kthreads_idle);
@@ -749,6 +696,8 @@ xpc_kthread_start(void *args)
749 struct xpc_channel *ch; 696 struct xpc_channel *ch;
750 int n_needed; 697 int n_needed;
751 unsigned long irq_flags; 698 unsigned long irq_flags;
699 int (*n_of_deliverable_payloads) (struct xpc_channel *) =
700 xpc_arch_ops.n_of_deliverable_payloads;
752 701
753 dev_dbg(xpc_chan, "kthread starting, partid=%d, channel=%d\n", 702 dev_dbg(xpc_chan, "kthread starting, partid=%d, channel=%d\n",
754 partid, ch_number); 703 partid, ch_number);
@@ -777,7 +726,7 @@ xpc_kthread_start(void *args)
777 * additional kthreads to help deliver them. We only 726 * additional kthreads to help deliver them. We only
778 * need one less than total #of messages to deliver. 727 * need one less than total #of messages to deliver.
779 */ 728 */
780 n_needed = xpc_n_of_deliverable_payloads(ch) - 1; 729 n_needed = n_of_deliverable_payloads(ch) - 1;
781 if (n_needed > 0 && !(ch->flags & XPC_C_DISCONNECTING)) 730 if (n_needed > 0 && !(ch->flags & XPC_C_DISCONNECTING))
782 xpc_activate_kthreads(ch, n_needed); 731 xpc_activate_kthreads(ch, n_needed);
783 732
@@ -805,7 +754,7 @@ xpc_kthread_start(void *args)
805 754
806 if (atomic_dec_return(&ch->kthreads_assigned) == 0 && 755 if (atomic_dec_return(&ch->kthreads_assigned) == 0 &&
807 atomic_dec_return(&part->nchannels_engaged) == 0) { 756 atomic_dec_return(&part->nchannels_engaged) == 0) {
808 xpc_indicate_partition_disengaged(part); 757 xpc_arch_ops.indicate_partition_disengaged(part);
809 } 758 }
810 759
811 xpc_msgqueue_deref(ch); 760 xpc_msgqueue_deref(ch);
@@ -837,6 +786,8 @@ xpc_create_kthreads(struct xpc_channel *ch, int needed,
837 u64 args = XPC_PACK_ARGS(ch->partid, ch->number); 786 u64 args = XPC_PACK_ARGS(ch->partid, ch->number);
838 struct xpc_partition *part = &xpc_partitions[ch->partid]; 787 struct xpc_partition *part = &xpc_partitions[ch->partid];
839 struct task_struct *kthread; 788 struct task_struct *kthread;
789 void (*indicate_partition_disengaged) (struct xpc_partition *) =
790 xpc_arch_ops.indicate_partition_disengaged;
840 791
841 while (needed-- > 0) { 792 while (needed-- > 0) {
842 793
@@ -858,7 +809,7 @@ xpc_create_kthreads(struct xpc_channel *ch, int needed,
858 809
859 } else if (atomic_inc_return(&ch->kthreads_assigned) == 1 && 810 } else if (atomic_inc_return(&ch->kthreads_assigned) == 1 &&
860 atomic_inc_return(&part->nchannels_engaged) == 1) { 811 atomic_inc_return(&part->nchannels_engaged) == 1) {
861 xpc_indicate_partition_engaged(part); 812 xpc_arch_ops.indicate_partition_engaged(part);
862 } 813 }
863 (void)xpc_part_ref(part); 814 (void)xpc_part_ref(part);
864 xpc_msgqueue_ref(ch); 815 xpc_msgqueue_ref(ch);
@@ -880,7 +831,7 @@ xpc_create_kthreads(struct xpc_channel *ch, int needed,
880 831
881 if (atomic_dec_return(&ch->kthreads_assigned) == 0 && 832 if (atomic_dec_return(&ch->kthreads_assigned) == 0 &&
882 atomic_dec_return(&part->nchannels_engaged) == 0) { 833 atomic_dec_return(&part->nchannels_engaged) == 0) {
883 xpc_indicate_partition_disengaged(part); 834 indicate_partition_disengaged(part);
884 } 835 }
885 xpc_msgqueue_deref(ch); 836 xpc_msgqueue_deref(ch);
886 xpc_part_deref(part); 837 xpc_part_deref(part);
@@ -993,13 +944,13 @@ xpc_setup_partitions(void)
993 atomic_set(&part->references, 0); 944 atomic_set(&part->references, 0);
994 } 945 }
995 946
996 return xpc_setup_partitions_sn(); 947 return xpc_arch_ops.setup_partitions();
997} 948}
998 949
999static void 950static void
1000xpc_teardown_partitions(void) 951xpc_teardown_partitions(void)
1001{ 952{
1002 xpc_teardown_partitions_sn(); 953 xpc_arch_ops.teardown_partitions();
1003 kfree(xpc_partitions); 954 kfree(xpc_partitions);
1004} 955}
1005 956
@@ -1055,7 +1006,7 @@ xpc_do_exit(enum xp_retval reason)
1055 disengage_timeout = part->disengage_timeout; 1006 disengage_timeout = part->disengage_timeout;
1056 } 1007 }
1057 1008
1058 if (xpc_any_partition_engaged()) { 1009 if (xpc_arch_ops.any_partition_engaged()) {
1059 if (time_is_before_jiffies(printmsg_time)) { 1010 if (time_is_before_jiffies(printmsg_time)) {
1060 dev_info(xpc_part, "waiting for remote " 1011 dev_info(xpc_part, "waiting for remote "
1061 "partitions to deactivate, timeout in " 1012 "partitions to deactivate, timeout in "
@@ -1086,8 +1037,7 @@ xpc_do_exit(enum xp_retval reason)
1086 1037
1087 } while (1); 1038 } while (1);
1088 1039
1089 DBUG_ON(xpc_any_partition_engaged()); 1040 DBUG_ON(xpc_arch_ops.any_partition_engaged());
1090 DBUG_ON(xpc_any_hbs_allowed() != 0);
1091 1041
1092 xpc_teardown_rsvd_page(); 1042 xpc_teardown_rsvd_page();
1093 1043
@@ -1152,15 +1102,15 @@ xpc_die_deactivate(void)
1152 /* keep xpc_hb_checker thread from doing anything (just in case) */ 1102 /* keep xpc_hb_checker thread from doing anything (just in case) */
1153 xpc_exiting = 1; 1103 xpc_exiting = 1;
1154 1104
1155 xpc_disallow_all_hbs(); /*indicate we're deactivated */ 1105 xpc_arch_ops.disallow_all_hbs(); /*indicate we're deactivated */
1156 1106
1157 for (partid = 0; partid < xp_max_npartitions; partid++) { 1107 for (partid = 0; partid < xp_max_npartitions; partid++) {
1158 part = &xpc_partitions[partid]; 1108 part = &xpc_partitions[partid];
1159 1109
1160 if (xpc_partition_engaged(partid) || 1110 if (xpc_arch_ops.partition_engaged(partid) ||
1161 part->act_state != XPC_P_AS_INACTIVE) { 1111 part->act_state != XPC_P_AS_INACTIVE) {
1162 xpc_request_partition_deactivation(part); 1112 xpc_arch_ops.request_partition_deactivation(part);
1163 xpc_indicate_partition_disengaged(part); 1113 xpc_arch_ops.indicate_partition_disengaged(part);
1164 } 1114 }
1165 } 1115 }
1166 1116
@@ -1177,7 +1127,7 @@ xpc_die_deactivate(void)
1177 wait_to_print = XPC_DEACTIVATE_PRINTMSG_INTERVAL * 1000 * 5; 1127 wait_to_print = XPC_DEACTIVATE_PRINTMSG_INTERVAL * 1000 * 5;
1178 1128
1179 while (1) { 1129 while (1) {
1180 any_engaged = xpc_any_partition_engaged(); 1130 any_engaged = xpc_arch_ops.any_partition_engaged();
1181 if (!any_engaged) { 1131 if (!any_engaged) {
1182 dev_info(xpc_part, "all partitions have deactivated\n"); 1132 dev_info(xpc_part, "all partitions have deactivated\n");
1183 break; 1133 break;
@@ -1186,7 +1136,7 @@ xpc_die_deactivate(void)
1186 if (!keep_waiting--) { 1136 if (!keep_waiting--) {
1187 for (partid = 0; partid < xp_max_npartitions; 1137 for (partid = 0; partid < xp_max_npartitions;
1188 partid++) { 1138 partid++) {
1189 if (xpc_partition_engaged(partid)) { 1139 if (xpc_arch_ops.partition_engaged(partid)) {
1190 dev_info(xpc_part, "deactivate from " 1140 dev_info(xpc_part, "deactivate from "
1191 "remote partition %d timed " 1141 "remote partition %d timed "
1192 "out\n", partid); 1142 "out\n", partid);
@@ -1233,7 +1183,7 @@ xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
1233 /* fall through */ 1183 /* fall through */
1234 case DIE_MCA_MONARCH_ENTER: 1184 case DIE_MCA_MONARCH_ENTER:
1235 case DIE_INIT_MONARCH_ENTER: 1185 case DIE_INIT_MONARCH_ENTER:
1236 xpc_offline_heartbeat(); 1186 xpc_arch_ops.offline_heartbeat();
1237 break; 1187 break;
1238 1188
1239 case DIE_KDEBUG_LEAVE: 1189 case DIE_KDEBUG_LEAVE:
@@ -1244,7 +1194,7 @@ xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
1244 /* fall through */ 1194 /* fall through */
1245 case DIE_MCA_MONARCH_LEAVE: 1195 case DIE_MCA_MONARCH_LEAVE:
1246 case DIE_INIT_MONARCH_LEAVE: 1196 case DIE_INIT_MONARCH_LEAVE:
1247 xpc_online_heartbeat(); 1197 xpc_arch_ops.online_heartbeat();
1248 break; 1198 break;
1249 } 1199 }
1250#else 1200#else
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c
index 6722f6fe4dc7..65877bc5edaa 100644
--- a/drivers/misc/sgi-xp/xpc_partition.c
+++ b/drivers/misc/sgi-xp/xpc_partition.c
@@ -70,6 +70,9 @@ xpc_get_rsvd_page_pa(int nasid)
70 size_t buf_len = 0; 70 size_t buf_len = 0;
71 void *buf = buf; 71 void *buf = buf;
72 void *buf_base = NULL; 72 void *buf_base = NULL;
73 enum xp_retval (*get_partition_rsvd_page_pa)
74 (void *, u64 *, unsigned long *, size_t *) =
75 xpc_arch_ops.get_partition_rsvd_page_pa;
73 76
74 while (1) { 77 while (1) {
75 78
@@ -79,8 +82,7 @@ xpc_get_rsvd_page_pa(int nasid)
79 * ??? function or have two versions? Rename rp_pa for UV to 82 * ??? function or have two versions? Rename rp_pa for UV to
80 * ??? rp_gpa? 83 * ??? rp_gpa?
81 */ 84 */
82 ret = xpc_get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, 85 ret = get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, &len);
83 &len);
84 86
85 dev_dbg(xpc_part, "SAL returned with ret=%d, cookie=0x%016lx, " 87 dev_dbg(xpc_part, "SAL returned with ret=%d, cookie=0x%016lx, "
86 "address=0x%016lx, len=0x%016lx\n", ret, 88 "address=0x%016lx, len=0x%016lx\n", ret,
@@ -172,7 +174,7 @@ xpc_setup_rsvd_page(void)
172 xpc_part_nasids = XPC_RP_PART_NASIDS(rp); 174 xpc_part_nasids = XPC_RP_PART_NASIDS(rp);
173 xpc_mach_nasids = XPC_RP_MACH_NASIDS(rp); 175 xpc_mach_nasids = XPC_RP_MACH_NASIDS(rp);
174 176
175 ret = xpc_setup_rsvd_page_sn(rp); 177 ret = xpc_arch_ops.setup_rsvd_page(rp);
176 if (ret != 0) 178 if (ret != 0)
177 return ret; 179 return ret;
178 180
@@ -264,7 +266,7 @@ xpc_partition_disengaged(struct xpc_partition *part)
264 short partid = XPC_PARTID(part); 266 short partid = XPC_PARTID(part);
265 int disengaged; 267 int disengaged;
266 268
267 disengaged = !xpc_partition_engaged(partid); 269 disengaged = !xpc_arch_ops.partition_engaged(partid);
268 if (part->disengage_timeout) { 270 if (part->disengage_timeout) {
269 if (!disengaged) { 271 if (!disengaged) {
270 if (time_is_after_jiffies(part->disengage_timeout)) { 272 if (time_is_after_jiffies(part->disengage_timeout)) {
@@ -280,7 +282,7 @@ xpc_partition_disengaged(struct xpc_partition *part)
280 dev_info(xpc_part, "deactivate request to remote " 282 dev_info(xpc_part, "deactivate request to remote "
281 "partition %d timed out\n", partid); 283 "partition %d timed out\n", partid);
282 xpc_disengage_timedout = 1; 284 xpc_disengage_timedout = 1;
283 xpc_assume_partition_disengaged(partid); 285 xpc_arch_ops.assume_partition_disengaged(partid);
284 disengaged = 1; 286 disengaged = 1;
285 } 287 }
286 part->disengage_timeout = 0; 288 part->disengage_timeout = 0;
@@ -294,7 +296,7 @@ xpc_partition_disengaged(struct xpc_partition *part)
294 if (part->act_state != XPC_P_AS_INACTIVE) 296 if (part->act_state != XPC_P_AS_INACTIVE)
295 xpc_wakeup_channel_mgr(part); 297 xpc_wakeup_channel_mgr(part);
296 298
297 xpc_cancel_partition_deactivation_request(part); 299 xpc_arch_ops.cancel_partition_deactivation_request(part);
298 } 300 }
299 return disengaged; 301 return disengaged;
300} 302}
@@ -339,7 +341,7 @@ xpc_deactivate_partition(const int line, struct xpc_partition *part,
339 spin_unlock_irqrestore(&part->act_lock, irq_flags); 341 spin_unlock_irqrestore(&part->act_lock, irq_flags);
340 if (reason == xpReactivating) { 342 if (reason == xpReactivating) {
341 /* we interrupt ourselves to reactivate partition */ 343 /* we interrupt ourselves to reactivate partition */
342 xpc_request_partition_reactivation(part); 344 xpc_arch_ops.request_partition_reactivation(part);
343 } 345 }
344 return; 346 return;
345 } 347 }
@@ -358,7 +360,7 @@ xpc_deactivate_partition(const int line, struct xpc_partition *part,
358 spin_unlock_irqrestore(&part->act_lock, irq_flags); 360 spin_unlock_irqrestore(&part->act_lock, irq_flags);
359 361
360 /* ask remote partition to deactivate with regard to us */ 362 /* ask remote partition to deactivate with regard to us */
361 xpc_request_partition_deactivation(part); 363 xpc_arch_ops.request_partition_deactivation(part);
362 364
363 /* set a timelimit on the disengage phase of the deactivation request */ 365 /* set a timelimit on the disengage phase of the deactivation request */
364 part->disengage_timeout = jiffies + (xpc_disengage_timelimit * HZ); 366 part->disengage_timeout = jiffies + (xpc_disengage_timelimit * HZ);
@@ -496,7 +498,7 @@ xpc_discovery(void)
496 continue; 498 continue;
497 } 499 }
498 500
499 xpc_request_partition_activation(remote_rp, 501 xpc_arch_ops.request_partition_activation(remote_rp,
500 remote_rp_pa, nasid); 502 remote_rp_pa, nasid);
501 } 503 }
502 } 504 }
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c
index eaaa964942de..915a3b495da5 100644
--- a/drivers/misc/sgi-xp/xpc_sn2.c
+++ b/drivers/misc/sgi-xp/xpc_sn2.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9/* 9/*
@@ -60,14 +60,14 @@ static struct xpc_vars_sn2 *xpc_vars_sn2;
60static struct xpc_vars_part_sn2 *xpc_vars_part_sn2; 60static struct xpc_vars_part_sn2 *xpc_vars_part_sn2;
61 61
62static int 62static int
63xpc_setup_partitions_sn_sn2(void) 63xpc_setup_partitions_sn2(void)
64{ 64{
65 /* nothing needs to be done */ 65 /* nothing needs to be done */
66 return 0; 66 return 0;
67} 67}
68 68
69static void 69static void
70xpc_teardown_partitions_sn_sn2(void) 70xpc_teardown_partitions_sn2(void)
71{ 71{
72 /* nothing needs to be done */ 72 /* nothing needs to be done */
73} 73}
@@ -431,6 +431,13 @@ xpc_send_chctl_openreply_sn2(struct xpc_channel *ch, unsigned long *irq_flags)
431} 431}
432 432
433static void 433static void
434xpc_send_chctl_opencomplete_sn2(struct xpc_channel *ch,
435 unsigned long *irq_flags)
436{
437 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_OPENCOMPLETE, irq_flags);
438}
439
440static void
434xpc_send_chctl_msgrequest_sn2(struct xpc_channel *ch) 441xpc_send_chctl_msgrequest_sn2(struct xpc_channel *ch)
435{ 442{
436 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_MSGREQUEST, NULL); 443 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_MSGREQUEST, NULL);
@@ -621,7 +628,7 @@ xpc_get_partition_rsvd_page_pa_sn2(void *buf, u64 *cookie, unsigned long *rp_pa,
621 628
622 629
623static int 630static int
624xpc_setup_rsvd_page_sn_sn2(struct xpc_rsvd_page *rp) 631xpc_setup_rsvd_page_sn2(struct xpc_rsvd_page *rp)
625{ 632{
626 struct amo *amos_page; 633 struct amo *amos_page;
627 int i; 634 int i;
@@ -629,7 +636,7 @@ xpc_setup_rsvd_page_sn_sn2(struct xpc_rsvd_page *rp)
629 636
630 xpc_vars_sn2 = XPC_RP_VARS(rp); 637 xpc_vars_sn2 = XPC_RP_VARS(rp);
631 638
632 rp->sn.vars_pa = xp_pa(xpc_vars_sn2); 639 rp->sn.sn2.vars_pa = xp_pa(xpc_vars_sn2);
633 640
634 /* vars_part array follows immediately after vars */ 641 /* vars_part array follows immediately after vars */
635 xpc_vars_part_sn2 = (struct xpc_vars_part_sn2 *)((u8 *)XPC_RP_VARS(rp) + 642 xpc_vars_part_sn2 = (struct xpc_vars_part_sn2 *)((u8 *)XPC_RP_VARS(rp) +
@@ -693,6 +700,33 @@ xpc_setup_rsvd_page_sn_sn2(struct xpc_rsvd_page *rp)
693 return 0; 700 return 0;
694} 701}
695 702
703static int
704xpc_hb_allowed_sn2(short partid, void *heartbeating_to_mask)
705{
706 return test_bit(partid, heartbeating_to_mask);
707}
708
709static void
710xpc_allow_hb_sn2(short partid)
711{
712 DBUG_ON(xpc_vars_sn2 == NULL);
713 set_bit(partid, xpc_vars_sn2->heartbeating_to_mask);
714}
715
716static void
717xpc_disallow_hb_sn2(short partid)
718{
719 DBUG_ON(xpc_vars_sn2 == NULL);
720 clear_bit(partid, xpc_vars_sn2->heartbeating_to_mask);
721}
722
723static void
724xpc_disallow_all_hbs_sn2(void)
725{
726 DBUG_ON(xpc_vars_sn2 == NULL);
727 bitmap_zero(xpc_vars_sn2->heartbeating_to_mask, xp_max_npartitions);
728}
729
696static void 730static void
697xpc_increment_heartbeat_sn2(void) 731xpc_increment_heartbeat_sn2(void)
698{ 732{
@@ -719,7 +753,6 @@ xpc_heartbeat_init_sn2(void)
719 DBUG_ON(xpc_vars_sn2 == NULL); 753 DBUG_ON(xpc_vars_sn2 == NULL);
720 754
721 bitmap_zero(xpc_vars_sn2->heartbeating_to_mask, XP_MAX_NPARTITIONS_SN2); 755 bitmap_zero(xpc_vars_sn2->heartbeating_to_mask, XP_MAX_NPARTITIONS_SN2);
722 xpc_heartbeating_to_mask = &xpc_vars_sn2->heartbeating_to_mask[0];
723 xpc_online_heartbeat_sn2(); 756 xpc_online_heartbeat_sn2();
724} 757}
725 758
@@ -751,9 +784,9 @@ xpc_get_remote_heartbeat_sn2(struct xpc_partition *part)
751 remote_vars->heartbeating_to_mask[0]); 784 remote_vars->heartbeating_to_mask[0]);
752 785
753 if ((remote_vars->heartbeat == part->last_heartbeat && 786 if ((remote_vars->heartbeat == part->last_heartbeat &&
754 remote_vars->heartbeat_offline == 0) || 787 !remote_vars->heartbeat_offline) ||
755 !xpc_hb_allowed(sn_partition_id, 788 !xpc_hb_allowed_sn2(sn_partition_id,
756 &remote_vars->heartbeating_to_mask)) { 789 remote_vars->heartbeating_to_mask)) {
757 ret = xpNoHeartbeat; 790 ret = xpNoHeartbeat;
758 } else { 791 } else {
759 part->last_heartbeat = remote_vars->heartbeat; 792 part->last_heartbeat = remote_vars->heartbeat;
@@ -972,7 +1005,7 @@ xpc_identify_activate_IRQ_req_sn2(int nasid)
972 return; 1005 return;
973 } 1006 }
974 1007
975 remote_vars_pa = remote_rp->sn.vars_pa; 1008 remote_vars_pa = remote_rp->sn.sn2.vars_pa;
976 remote_rp_version = remote_rp->version; 1009 remote_rp_version = remote_rp->version;
977 remote_rp_ts_jiffies = remote_rp->ts_jiffies; 1010 remote_rp_ts_jiffies = remote_rp->ts_jiffies;
978 1011
@@ -1129,7 +1162,7 @@ xpc_process_activate_IRQ_rcvd_sn2(void)
1129 * Setup the channel structures that are sn2 specific. 1162 * Setup the channel structures that are sn2 specific.
1130 */ 1163 */
1131static enum xp_retval 1164static enum xp_retval
1132xpc_setup_ch_structures_sn_sn2(struct xpc_partition *part) 1165xpc_setup_ch_structures_sn2(struct xpc_partition *part)
1133{ 1166{
1134 struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2; 1167 struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2;
1135 struct xpc_channel_sn2 *ch_sn2; 1168 struct xpc_channel_sn2 *ch_sn2;
@@ -1251,7 +1284,7 @@ out_1:
1251 * Teardown the channel structures that are sn2 specific. 1284 * Teardown the channel structures that are sn2 specific.
1252 */ 1285 */
1253static void 1286static void
1254xpc_teardown_ch_structures_sn_sn2(struct xpc_partition *part) 1287xpc_teardown_ch_structures_sn2(struct xpc_partition *part)
1255{ 1288{
1256 struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2; 1289 struct xpc_partition_sn2 *part_sn2 = &part->sn.sn2;
1257 short partid = XPC_PARTID(part); 1290 short partid = XPC_PARTID(part);
@@ -2315,61 +2348,70 @@ xpc_received_payload_sn2(struct xpc_channel *ch, void *payload)
2315 xpc_acknowledge_msgs_sn2(ch, get, msg->flags); 2348 xpc_acknowledge_msgs_sn2(ch, get, msg->flags);
2316} 2349}
2317 2350
2351static struct xpc_arch_operations xpc_arch_ops_sn2 = {
2352 .setup_partitions = xpc_setup_partitions_sn2,
2353 .teardown_partitions = xpc_teardown_partitions_sn2,
2354 .process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_sn2,
2355 .get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2,
2356 .setup_rsvd_page = xpc_setup_rsvd_page_sn2,
2357
2358 .allow_hb = xpc_allow_hb_sn2,
2359 .disallow_hb = xpc_disallow_hb_sn2,
2360 .disallow_all_hbs = xpc_disallow_all_hbs_sn2,
2361 .increment_heartbeat = xpc_increment_heartbeat_sn2,
2362 .offline_heartbeat = xpc_offline_heartbeat_sn2,
2363 .online_heartbeat = xpc_online_heartbeat_sn2,
2364 .heartbeat_init = xpc_heartbeat_init_sn2,
2365 .heartbeat_exit = xpc_heartbeat_exit_sn2,
2366 .get_remote_heartbeat = xpc_get_remote_heartbeat_sn2,
2367
2368 .request_partition_activation =
2369 xpc_request_partition_activation_sn2,
2370 .request_partition_reactivation =
2371 xpc_request_partition_reactivation_sn2,
2372 .request_partition_deactivation =
2373 xpc_request_partition_deactivation_sn2,
2374 .cancel_partition_deactivation_request =
2375 xpc_cancel_partition_deactivation_request_sn2,
2376
2377 .setup_ch_structures = xpc_setup_ch_structures_sn2,
2378 .teardown_ch_structures = xpc_teardown_ch_structures_sn2,
2379
2380 .make_first_contact = xpc_make_first_contact_sn2,
2381
2382 .get_chctl_all_flags = xpc_get_chctl_all_flags_sn2,
2383 .send_chctl_closerequest = xpc_send_chctl_closerequest_sn2,
2384 .send_chctl_closereply = xpc_send_chctl_closereply_sn2,
2385 .send_chctl_openrequest = xpc_send_chctl_openrequest_sn2,
2386 .send_chctl_openreply = xpc_send_chctl_openreply_sn2,
2387 .send_chctl_opencomplete = xpc_send_chctl_opencomplete_sn2,
2388 .process_msg_chctl_flags = xpc_process_msg_chctl_flags_sn2,
2389
2390 .save_remote_msgqueue_pa = xpc_save_remote_msgqueue_pa_sn2,
2391
2392 .setup_msg_structures = xpc_setup_msg_structures_sn2,
2393 .teardown_msg_structures = xpc_teardown_msg_structures_sn2,
2394
2395 .indicate_partition_engaged = xpc_indicate_partition_engaged_sn2,
2396 .indicate_partition_disengaged = xpc_indicate_partition_disengaged_sn2,
2397 .partition_engaged = xpc_partition_engaged_sn2,
2398 .any_partition_engaged = xpc_any_partition_engaged_sn2,
2399 .assume_partition_disengaged = xpc_assume_partition_disengaged_sn2,
2400
2401 .n_of_deliverable_payloads = xpc_n_of_deliverable_payloads_sn2,
2402 .send_payload = xpc_send_payload_sn2,
2403 .get_deliverable_payload = xpc_get_deliverable_payload_sn2,
2404 .received_payload = xpc_received_payload_sn2,
2405 .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_sn2,
2406};
2407
2318int 2408int
2319xpc_init_sn2(void) 2409xpc_init_sn2(void)
2320{ 2410{
2321 int ret; 2411 int ret;
2322 size_t buf_size; 2412 size_t buf_size;
2323 2413
2324 xpc_setup_partitions_sn = xpc_setup_partitions_sn_sn2; 2414 xpc_arch_ops = xpc_arch_ops_sn2;
2325 xpc_teardown_partitions_sn = xpc_teardown_partitions_sn_sn2;
2326 xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2;
2327 xpc_setup_rsvd_page_sn = xpc_setup_rsvd_page_sn_sn2;
2328 xpc_increment_heartbeat = xpc_increment_heartbeat_sn2;
2329 xpc_offline_heartbeat = xpc_offline_heartbeat_sn2;
2330 xpc_online_heartbeat = xpc_online_heartbeat_sn2;
2331 xpc_heartbeat_init = xpc_heartbeat_init_sn2;
2332 xpc_heartbeat_exit = xpc_heartbeat_exit_sn2;
2333 xpc_get_remote_heartbeat = xpc_get_remote_heartbeat_sn2;
2334
2335 xpc_request_partition_activation = xpc_request_partition_activation_sn2;
2336 xpc_request_partition_reactivation =
2337 xpc_request_partition_reactivation_sn2;
2338 xpc_request_partition_deactivation =
2339 xpc_request_partition_deactivation_sn2;
2340 xpc_cancel_partition_deactivation_request =
2341 xpc_cancel_partition_deactivation_request_sn2;
2342
2343 xpc_process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_sn2;
2344 xpc_setup_ch_structures_sn = xpc_setup_ch_structures_sn_sn2;
2345 xpc_teardown_ch_structures_sn = xpc_teardown_ch_structures_sn_sn2;
2346 xpc_make_first_contact = xpc_make_first_contact_sn2;
2347
2348 xpc_get_chctl_all_flags = xpc_get_chctl_all_flags_sn2;
2349 xpc_send_chctl_closerequest = xpc_send_chctl_closerequest_sn2;
2350 xpc_send_chctl_closereply = xpc_send_chctl_closereply_sn2;
2351 xpc_send_chctl_openrequest = xpc_send_chctl_openrequest_sn2;
2352 xpc_send_chctl_openreply = xpc_send_chctl_openreply_sn2;
2353
2354 xpc_save_remote_msgqueue_pa = xpc_save_remote_msgqueue_pa_sn2;
2355
2356 xpc_setup_msg_structures = xpc_setup_msg_structures_sn2;
2357 xpc_teardown_msg_structures = xpc_teardown_msg_structures_sn2;
2358
2359 xpc_notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_sn2;
2360 xpc_process_msg_chctl_flags = xpc_process_msg_chctl_flags_sn2;
2361 xpc_n_of_deliverable_payloads = xpc_n_of_deliverable_payloads_sn2;
2362 xpc_get_deliverable_payload = xpc_get_deliverable_payload_sn2;
2363
2364 xpc_indicate_partition_engaged = xpc_indicate_partition_engaged_sn2;
2365 xpc_indicate_partition_disengaged =
2366 xpc_indicate_partition_disengaged_sn2;
2367 xpc_partition_engaged = xpc_partition_engaged_sn2;
2368 xpc_any_partition_engaged = xpc_any_partition_engaged_sn2;
2369 xpc_assume_partition_disengaged = xpc_assume_partition_disengaged_sn2;
2370
2371 xpc_send_payload = xpc_send_payload_sn2;
2372 xpc_received_payload = xpc_received_payload_sn2;
2373 2415
2374 if (offsetof(struct xpc_msg_sn2, payload) > XPC_MSG_HDR_MAX_SIZE) { 2416 if (offsetof(struct xpc_msg_sn2, payload) > XPC_MSG_HDR_MAX_SIZE) {
2375 dev_err(xpc_part, "header portion of struct xpc_msg_sn2 is " 2417 dev_err(xpc_part, "header portion of struct xpc_msg_sn2 is "
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index f7fff4727edb..9172fcdee4e2 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -46,8 +46,7 @@ struct uv_IO_APIC_route_entry {
46}; 46};
47#endif 47#endif
48 48
49static atomic64_t xpc_heartbeat_uv; 49static struct xpc_heartbeat_uv *xpc_heartbeat_uv;
50static DECLARE_BITMAP(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV);
51 50
52#define XPC_ACTIVATE_MSG_SIZE_UV (1 * GRU_CACHE_LINE_BYTES) 51#define XPC_ACTIVATE_MSG_SIZE_UV (1 * GRU_CACHE_LINE_BYTES)
53#define XPC_ACTIVATE_MQ_SIZE_UV (4 * XP_MAX_NPARTITIONS_UV * \ 52#define XPC_ACTIVATE_MQ_SIZE_UV (4 * XP_MAX_NPARTITIONS_UV * \
@@ -63,7 +62,7 @@ static struct xpc_gru_mq_uv *xpc_activate_mq_uv;
63static struct xpc_gru_mq_uv *xpc_notify_mq_uv; 62static struct xpc_gru_mq_uv *xpc_notify_mq_uv;
64 63
65static int 64static int
66xpc_setup_partitions_sn_uv(void) 65xpc_setup_partitions_uv(void)
67{ 66{
68 short partid; 67 short partid;
69 struct xpc_partition_uv *part_uv; 68 struct xpc_partition_uv *part_uv;
@@ -79,7 +78,7 @@ xpc_setup_partitions_sn_uv(void)
79} 78}
80 79
81static void 80static void
82xpc_teardown_partitions_sn_uv(void) 81xpc_teardown_partitions_uv(void)
83{ 82{
84 short partid; 83 short partid;
85 struct xpc_partition_uv *part_uv; 84 struct xpc_partition_uv *part_uv;
@@ -423,41 +422,6 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
423 /* syncing of remote_act_state was just done above */ 422 /* syncing of remote_act_state was just done above */
424 break; 423 break;
425 424
426 case XPC_ACTIVATE_MQ_MSG_INC_HEARTBEAT_UV: {
427 struct xpc_activate_mq_msg_heartbeat_req_uv *msg;
428
429 msg = container_of(msg_hdr,
430 struct xpc_activate_mq_msg_heartbeat_req_uv,
431 hdr);
432 part_uv->heartbeat = msg->heartbeat;
433 break;
434 }
435 case XPC_ACTIVATE_MQ_MSG_OFFLINE_HEARTBEAT_UV: {
436 struct xpc_activate_mq_msg_heartbeat_req_uv *msg;
437
438 msg = container_of(msg_hdr,
439 struct xpc_activate_mq_msg_heartbeat_req_uv,
440 hdr);
441 part_uv->heartbeat = msg->heartbeat;
442
443 spin_lock_irqsave(&part_uv->flags_lock, irq_flags);
444 part_uv->flags |= XPC_P_HEARTBEAT_OFFLINE_UV;
445 spin_unlock_irqrestore(&part_uv->flags_lock, irq_flags);
446 break;
447 }
448 case XPC_ACTIVATE_MQ_MSG_ONLINE_HEARTBEAT_UV: {
449 struct xpc_activate_mq_msg_heartbeat_req_uv *msg;
450
451 msg = container_of(msg_hdr,
452 struct xpc_activate_mq_msg_heartbeat_req_uv,
453 hdr);
454 part_uv->heartbeat = msg->heartbeat;
455
456 spin_lock_irqsave(&part_uv->flags_lock, irq_flags);
457 part_uv->flags &= ~XPC_P_HEARTBEAT_OFFLINE_UV;
458 spin_unlock_irqrestore(&part_uv->flags_lock, irq_flags);
459 break;
460 }
461 case XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV: { 425 case XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV: {
462 struct xpc_activate_mq_msg_activate_req_uv *msg; 426 struct xpc_activate_mq_msg_activate_req_uv *msg;
463 427
@@ -475,6 +439,7 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
475 part_uv->act_state_req = XPC_P_ASR_ACTIVATE_UV; 439 part_uv->act_state_req = XPC_P_ASR_ACTIVATE_UV;
476 part->remote_rp_pa = msg->rp_gpa; /* !!! _pa is _gpa */ 440 part->remote_rp_pa = msg->rp_gpa; /* !!! _pa is _gpa */
477 part->remote_rp_ts_jiffies = msg_hdr->rp_ts_jiffies; 441 part->remote_rp_ts_jiffies = msg_hdr->rp_ts_jiffies;
442 part_uv->heartbeat_gpa = msg->heartbeat_gpa;
478 443
479 if (msg->activate_gru_mq_desc_gpa != 444 if (msg->activate_gru_mq_desc_gpa !=
480 part_uv->activate_gru_mq_desc_gpa) { 445 part_uv->activate_gru_mq_desc_gpa) {
@@ -569,6 +534,17 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
569 xpc_wakeup_channel_mgr(part); 534 xpc_wakeup_channel_mgr(part);
570 break; 535 break;
571 } 536 }
537 case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV: {
538 struct xpc_activate_mq_msg_chctl_opencomplete_uv *msg;
539
540 msg = container_of(msg_hdr, struct
541 xpc_activate_mq_msg_chctl_opencomplete_uv, hdr);
542 spin_lock_irqsave(&part->chctl_lock, irq_flags);
543 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_OPENCOMPLETE;
544 spin_unlock_irqrestore(&part->chctl_lock, irq_flags);
545
546 xpc_wakeup_channel_mgr(part);
547 }
572 case XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV: 548 case XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV:
573 spin_lock_irqsave(&part_uv->flags_lock, irq_flags); 549 spin_lock_irqsave(&part_uv->flags_lock, irq_flags);
574 part_uv->flags |= XPC_P_ENGAGED_UV; 550 part_uv->flags |= XPC_P_ENGAGED_UV;
@@ -759,7 +735,7 @@ xpc_send_local_activate_IRQ_uv(struct xpc_partition *part, int act_state_req)
759 735
760 /* 736 /*
761 * !!! Make our side think that the remote partition sent an activate 737 * !!! Make our side think that the remote partition sent an activate
762 * !!! message our way by doing what the activate IRQ handler would 738 * !!! mq message our way by doing what the activate IRQ handler would
763 * !!! do had one really been sent. 739 * !!! do had one really been sent.
764 */ 740 */
765 741
@@ -806,90 +782,82 @@ xpc_get_partition_rsvd_page_pa_uv(void *buf, u64 *cookie, unsigned long *rp_pa,
806} 782}
807 783
808static int 784static int
809xpc_setup_rsvd_page_sn_uv(struct xpc_rsvd_page *rp) 785xpc_setup_rsvd_page_uv(struct xpc_rsvd_page *rp)
810{ 786{
811 rp->sn.activate_gru_mq_desc_gpa = 787 xpc_heartbeat_uv =
788 &xpc_partitions[sn_partition_id].sn.uv.cached_heartbeat;
789 rp->sn.uv.heartbeat_gpa = uv_gpa(xpc_heartbeat_uv);
790 rp->sn.uv.activate_gru_mq_desc_gpa =
812 uv_gpa(xpc_activate_mq_uv->gru_mq_desc); 791 uv_gpa(xpc_activate_mq_uv->gru_mq_desc);
813 return 0; 792 return 0;
814} 793}
815 794
816static void 795static void
817xpc_send_heartbeat_uv(int msg_type) 796xpc_allow_hb_uv(short partid)
818{ 797{
819 short partid; 798}
820 struct xpc_partition *part;
821 struct xpc_activate_mq_msg_heartbeat_req_uv msg;
822
823 /*
824 * !!! On uv we're broadcasting a heartbeat message every 5 seconds.
825 * !!! Whereas on sn2 we're bte_copy'ng the heartbeat info every 20
826 * !!! seconds. This is an increase in numalink traffic.
827 * ??? Is this good?
828 */
829
830 msg.heartbeat = atomic64_inc_return(&xpc_heartbeat_uv);
831
832 partid = find_first_bit(xpc_heartbeating_to_mask_uv,
833 XP_MAX_NPARTITIONS_UV);
834
835 while (partid < XP_MAX_NPARTITIONS_UV) {
836 part = &xpc_partitions[partid];
837 799
838 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), 800static void
839 msg_type); 801xpc_disallow_hb_uv(short partid)
802{
803}
840 804
841 partid = find_next_bit(xpc_heartbeating_to_mask_uv, 805static void
842 XP_MAX_NPARTITIONS_UV, partid + 1); 806xpc_disallow_all_hbs_uv(void)
843 } 807{
844} 808}
845 809
846static void 810static void
847xpc_increment_heartbeat_uv(void) 811xpc_increment_heartbeat_uv(void)
848{ 812{
849 xpc_send_heartbeat_uv(XPC_ACTIVATE_MQ_MSG_INC_HEARTBEAT_UV); 813 xpc_heartbeat_uv->value++;
850} 814}
851 815
852static void 816static void
853xpc_offline_heartbeat_uv(void) 817xpc_offline_heartbeat_uv(void)
854{ 818{
855 xpc_send_heartbeat_uv(XPC_ACTIVATE_MQ_MSG_OFFLINE_HEARTBEAT_UV); 819 xpc_increment_heartbeat_uv();
820 xpc_heartbeat_uv->offline = 1;
856} 821}
857 822
858static void 823static void
859xpc_online_heartbeat_uv(void) 824xpc_online_heartbeat_uv(void)
860{ 825{
861 xpc_send_heartbeat_uv(XPC_ACTIVATE_MQ_MSG_ONLINE_HEARTBEAT_UV); 826 xpc_increment_heartbeat_uv();
827 xpc_heartbeat_uv->offline = 0;
862} 828}
863 829
864static void 830static void
865xpc_heartbeat_init_uv(void) 831xpc_heartbeat_init_uv(void)
866{ 832{
867 atomic64_set(&xpc_heartbeat_uv, 0); 833 xpc_heartbeat_uv->value = 1;
868 bitmap_zero(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV); 834 xpc_heartbeat_uv->offline = 0;
869 xpc_heartbeating_to_mask = &xpc_heartbeating_to_mask_uv[0];
870} 835}
871 836
872static void 837static void
873xpc_heartbeat_exit_uv(void) 838xpc_heartbeat_exit_uv(void)
874{ 839{
875 xpc_send_heartbeat_uv(XPC_ACTIVATE_MQ_MSG_OFFLINE_HEARTBEAT_UV); 840 xpc_offline_heartbeat_uv();
876} 841}
877 842
878static enum xp_retval 843static enum xp_retval
879xpc_get_remote_heartbeat_uv(struct xpc_partition *part) 844xpc_get_remote_heartbeat_uv(struct xpc_partition *part)
880{ 845{
881 struct xpc_partition_uv *part_uv = &part->sn.uv; 846 struct xpc_partition_uv *part_uv = &part->sn.uv;
882 enum xp_retval ret = xpNoHeartbeat; 847 enum xp_retval ret;
883 848
884 if (part_uv->remote_act_state != XPC_P_AS_INACTIVE && 849 ret = xp_remote_memcpy(uv_gpa(&part_uv->cached_heartbeat),
885 part_uv->remote_act_state != XPC_P_AS_DEACTIVATING) { 850 part_uv->heartbeat_gpa,
851 sizeof(struct xpc_heartbeat_uv));
852 if (ret != xpSuccess)
853 return ret;
886 854
887 if (part_uv->heartbeat != part->last_heartbeat || 855 if (part_uv->cached_heartbeat.value == part->last_heartbeat &&
888 (part_uv->flags & XPC_P_HEARTBEAT_OFFLINE_UV)) { 856 !part_uv->cached_heartbeat.offline) {
889 857
890 part->last_heartbeat = part_uv->heartbeat; 858 ret = xpNoHeartbeat;
891 ret = xpSuccess; 859 } else {
892 } 860 part->last_heartbeat = part_uv->cached_heartbeat.value;
893 } 861 }
894 return ret; 862 return ret;
895} 863}
@@ -904,8 +872,9 @@ xpc_request_partition_activation_uv(struct xpc_rsvd_page *remote_rp,
904 872
905 part->remote_rp_pa = remote_rp_gpa; /* !!! _pa here is really _gpa */ 873 part->remote_rp_pa = remote_rp_gpa; /* !!! _pa here is really _gpa */
906 part->remote_rp_ts_jiffies = remote_rp->ts_jiffies; 874 part->remote_rp_ts_jiffies = remote_rp->ts_jiffies;
875 part->sn.uv.heartbeat_gpa = remote_rp->sn.uv.heartbeat_gpa;
907 part->sn.uv.activate_gru_mq_desc_gpa = 876 part->sn.uv.activate_gru_mq_desc_gpa =
908 remote_rp->sn.activate_gru_mq_desc_gpa; 877 remote_rp->sn.uv.activate_gru_mq_desc_gpa;
909 878
910 /* 879 /*
911 * ??? Is it a good idea to make this conditional on what is 880 * ??? Is it a good idea to make this conditional on what is
@@ -913,8 +882,9 @@ xpc_request_partition_activation_uv(struct xpc_rsvd_page *remote_rp,
913 */ 882 */
914 if (part->sn.uv.remote_act_state == XPC_P_AS_INACTIVE) { 883 if (part->sn.uv.remote_act_state == XPC_P_AS_INACTIVE) {
915 msg.rp_gpa = uv_gpa(xpc_rsvd_page); 884 msg.rp_gpa = uv_gpa(xpc_rsvd_page);
885 msg.heartbeat_gpa = xpc_rsvd_page->sn.uv.heartbeat_gpa;
916 msg.activate_gru_mq_desc_gpa = 886 msg.activate_gru_mq_desc_gpa =
917 xpc_rsvd_page->sn.activate_gru_mq_desc_gpa; 887 xpc_rsvd_page->sn.uv.activate_gru_mq_desc_gpa;
918 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), 888 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg),
919 XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV); 889 XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV);
920 } 890 }
@@ -1010,7 +980,7 @@ xpc_n_of_fifo_entries_uv(struct xpc_fifo_head_uv *head)
1010 * Setup the channel structures that are uv specific. 980 * Setup the channel structures that are uv specific.
1011 */ 981 */
1012static enum xp_retval 982static enum xp_retval
1013xpc_setup_ch_structures_sn_uv(struct xpc_partition *part) 983xpc_setup_ch_structures_uv(struct xpc_partition *part)
1014{ 984{
1015 struct xpc_channel_uv *ch_uv; 985 struct xpc_channel_uv *ch_uv;
1016 int ch_number; 986 int ch_number;
@@ -1029,7 +999,7 @@ xpc_setup_ch_structures_sn_uv(struct xpc_partition *part)
1029 * Teardown the channel structures that are uv specific. 999 * Teardown the channel structures that are uv specific.
1030 */ 1000 */
1031static void 1001static void
1032xpc_teardown_ch_structures_sn_uv(struct xpc_partition *part) 1002xpc_teardown_ch_structures_uv(struct xpc_partition *part)
1033{ 1003{
1034 /* nothing needs to be done */ 1004 /* nothing needs to be done */
1035 return; 1005 return;
@@ -1243,6 +1213,16 @@ xpc_send_chctl_openreply_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1243} 1213}
1244 1214
1245static void 1215static void
1216xpc_send_chctl_opencomplete_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1217{
1218 struct xpc_activate_mq_msg_chctl_opencomplete_uv msg;
1219
1220 msg.ch_number = ch->number;
1221 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg),
1222 XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV);
1223}
1224
1225static void
1246xpc_send_chctl_local_msgrequest_uv(struct xpc_partition *part, int ch_number) 1226xpc_send_chctl_local_msgrequest_uv(struct xpc_partition *part, int ch_number)
1247{ 1227{
1248 unsigned long irq_flags; 1228 unsigned long irq_flags;
@@ -1669,58 +1649,67 @@ xpc_received_payload_uv(struct xpc_channel *ch, void *payload)
1669 msg->hdr.msg_slot_number += ch->remote_nentries; 1649 msg->hdr.msg_slot_number += ch->remote_nentries;
1670} 1650}
1671 1651
1652static struct xpc_arch_operations xpc_arch_ops_uv = {
1653 .setup_partitions = xpc_setup_partitions_uv,
1654 .teardown_partitions = xpc_teardown_partitions_uv,
1655 .process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_uv,
1656 .get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_uv,
1657 .setup_rsvd_page = xpc_setup_rsvd_page_uv,
1658
1659 .allow_hb = xpc_allow_hb_uv,
1660 .disallow_hb = xpc_disallow_hb_uv,
1661 .disallow_all_hbs = xpc_disallow_all_hbs_uv,
1662 .increment_heartbeat = xpc_increment_heartbeat_uv,
1663 .offline_heartbeat = xpc_offline_heartbeat_uv,
1664 .online_heartbeat = xpc_online_heartbeat_uv,
1665 .heartbeat_init = xpc_heartbeat_init_uv,
1666 .heartbeat_exit = xpc_heartbeat_exit_uv,
1667 .get_remote_heartbeat = xpc_get_remote_heartbeat_uv,
1668
1669 .request_partition_activation =
1670 xpc_request_partition_activation_uv,
1671 .request_partition_reactivation =
1672 xpc_request_partition_reactivation_uv,
1673 .request_partition_deactivation =
1674 xpc_request_partition_deactivation_uv,
1675 .cancel_partition_deactivation_request =
1676 xpc_cancel_partition_deactivation_request_uv,
1677
1678 .setup_ch_structures = xpc_setup_ch_structures_uv,
1679 .teardown_ch_structures = xpc_teardown_ch_structures_uv,
1680
1681 .make_first_contact = xpc_make_first_contact_uv,
1682
1683 .get_chctl_all_flags = xpc_get_chctl_all_flags_uv,
1684 .send_chctl_closerequest = xpc_send_chctl_closerequest_uv,
1685 .send_chctl_closereply = xpc_send_chctl_closereply_uv,
1686 .send_chctl_openrequest = xpc_send_chctl_openrequest_uv,
1687 .send_chctl_openreply = xpc_send_chctl_openreply_uv,
1688 .send_chctl_opencomplete = xpc_send_chctl_opencomplete_uv,
1689 .process_msg_chctl_flags = xpc_process_msg_chctl_flags_uv,
1690
1691 .save_remote_msgqueue_pa = xpc_save_remote_msgqueue_pa_uv,
1692
1693 .setup_msg_structures = xpc_setup_msg_structures_uv,
1694 .teardown_msg_structures = xpc_teardown_msg_structures_uv,
1695
1696 .indicate_partition_engaged = xpc_indicate_partition_engaged_uv,
1697 .indicate_partition_disengaged = xpc_indicate_partition_disengaged_uv,
1698 .assume_partition_disengaged = xpc_assume_partition_disengaged_uv,
1699 .partition_engaged = xpc_partition_engaged_uv,
1700 .any_partition_engaged = xpc_any_partition_engaged_uv,
1701
1702 .n_of_deliverable_payloads = xpc_n_of_deliverable_payloads_uv,
1703 .send_payload = xpc_send_payload_uv,
1704 .get_deliverable_payload = xpc_get_deliverable_payload_uv,
1705 .received_payload = xpc_received_payload_uv,
1706 .notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv,
1707};
1708
1672int 1709int
1673xpc_init_uv(void) 1710xpc_init_uv(void)
1674{ 1711{
1675 xpc_setup_partitions_sn = xpc_setup_partitions_sn_uv; 1712 xpc_arch_ops = xpc_arch_ops_uv;
1676 xpc_teardown_partitions_sn = xpc_teardown_partitions_sn_uv;
1677 xpc_process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_uv;
1678 xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_uv;
1679 xpc_setup_rsvd_page_sn = xpc_setup_rsvd_page_sn_uv;
1680 xpc_increment_heartbeat = xpc_increment_heartbeat_uv;
1681 xpc_offline_heartbeat = xpc_offline_heartbeat_uv;
1682 xpc_online_heartbeat = xpc_online_heartbeat_uv;
1683 xpc_heartbeat_init = xpc_heartbeat_init_uv;
1684 xpc_heartbeat_exit = xpc_heartbeat_exit_uv;
1685 xpc_get_remote_heartbeat = xpc_get_remote_heartbeat_uv;
1686
1687 xpc_request_partition_activation = xpc_request_partition_activation_uv;
1688 xpc_request_partition_reactivation =
1689 xpc_request_partition_reactivation_uv;
1690 xpc_request_partition_deactivation =
1691 xpc_request_partition_deactivation_uv;
1692 xpc_cancel_partition_deactivation_request =
1693 xpc_cancel_partition_deactivation_request_uv;
1694
1695 xpc_setup_ch_structures_sn = xpc_setup_ch_structures_sn_uv;
1696 xpc_teardown_ch_structures_sn = xpc_teardown_ch_structures_sn_uv;
1697
1698 xpc_make_first_contact = xpc_make_first_contact_uv;
1699
1700 xpc_get_chctl_all_flags = xpc_get_chctl_all_flags_uv;
1701 xpc_send_chctl_closerequest = xpc_send_chctl_closerequest_uv;
1702 xpc_send_chctl_closereply = xpc_send_chctl_closereply_uv;
1703 xpc_send_chctl_openrequest = xpc_send_chctl_openrequest_uv;
1704 xpc_send_chctl_openreply = xpc_send_chctl_openreply_uv;
1705
1706 xpc_save_remote_msgqueue_pa = xpc_save_remote_msgqueue_pa_uv;
1707
1708 xpc_setup_msg_structures = xpc_setup_msg_structures_uv;
1709 xpc_teardown_msg_structures = xpc_teardown_msg_structures_uv;
1710
1711 xpc_indicate_partition_engaged = xpc_indicate_partition_engaged_uv;
1712 xpc_indicate_partition_disengaged =
1713 xpc_indicate_partition_disengaged_uv;
1714 xpc_assume_partition_disengaged = xpc_assume_partition_disengaged_uv;
1715 xpc_partition_engaged = xpc_partition_engaged_uv;
1716 xpc_any_partition_engaged = xpc_any_partition_engaged_uv;
1717
1718 xpc_n_of_deliverable_payloads = xpc_n_of_deliverable_payloads_uv;
1719 xpc_process_msg_chctl_flags = xpc_process_msg_chctl_flags_uv;
1720 xpc_send_payload = xpc_send_payload_uv;
1721 xpc_notify_senders_of_disconnect = xpc_notify_senders_of_disconnect_uv;
1722 xpc_get_deliverable_payload = xpc_get_deliverable_payload_uv;
1723 xpc_received_payload = xpc_received_payload_uv;
1724 1713
1725 if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) { 1714 if (sizeof(struct xpc_notify_mq_msghdr_uv) > XPC_MSG_HDR_MAX_SIZE) {
1726 dev_err(xpc_part, "xpc_notify_mq_msghdr_uv is larger than %d\n", 1715 dev_err(xpc_part, "xpc_notify_mq_msghdr_uv is larger than %d\n",
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index deb7b53167ee..83a12125b94e 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -2532,8 +2532,8 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
2532 * various kernel subsystems to support the mechanics required by a 2532 * various kernel subsystems to support the mechanics required by a
2533 * fixed-high-32-bit system. 2533 * fixed-high-32-bit system.
2534 */ 2534 */
2535 if ((pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) || 2535 if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) ||
2536 (pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK) != 0)) { 2536 (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)) {
2537 dev_err(&pdev->dev, "No usable DMA configuration,aborting\n"); 2537 dev_err(&pdev->dev, "No usable DMA configuration,aborting\n");
2538 goto err_dma; 2538 goto err_dma;
2539 } 2539 }
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 9b75aa630062..30d0c81c989e 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1821,11 +1821,11 @@ static int __devinit be_probe(struct pci_dev *pdev,
1821 1821
1822 be_msix_enable(adapter); 1822 be_msix_enable(adapter);
1823 1823
1824 status = pci_set_dma_mask(pdev, DMA_64BIT_MASK); 1824 status = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
1825 if (!status) { 1825 if (!status) {
1826 netdev->features |= NETIF_F_HIGHDMA; 1826 netdev->features |= NETIF_F_HIGHDMA;
1827 } else { 1827 } else {
1828 status = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1828 status = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
1829 if (status) { 1829 if (status) {
1830 dev_err(&pdev->dev, "Could not set PCI DMA Mask\n"); 1830 dev_err(&pdev->dev, "Could not set PCI DMA Mask\n");
1831 goto free_netdev; 1831 goto free_netdev;
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index ece35040288c..621a7c0c46ba 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -2591,13 +2591,13 @@ static int
2591jme_pci_dma64(struct pci_dev *pdev) 2591jme_pci_dma64(struct pci_dev *pdev)
2592{ 2592{
2593 if (pdev->device == PCI_DEVICE_ID_JMICRON_JMC250 && 2593 if (pdev->device == PCI_DEVICE_ID_JMICRON_JMC250 &&
2594 !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) 2594 !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)))
2595 if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) 2595 if (!pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)))
2596 return 1; 2596 return 1;
2597 2597
2598 if (pdev->device == PCI_DEVICE_ID_JMICRON_JMC250 && 2598 if (pdev->device == PCI_DEVICE_ID_JMICRON_JMC250 &&
2599 !pci_set_dma_mask(pdev, DMA_40BIT_MASK)) 2599 !pci_set_dma_mask(pdev, DMA_BIT_MASK(40)))
2600 if (!pci_set_consistent_dma_mask(pdev, DMA_40BIT_MASK)) 2600 if (!pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(40)))
2601 return 1; 2601 return 1;
2602 2602
2603 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) 2603 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))
diff --git a/drivers/net/wireless/ath9k/pci.c b/drivers/net/wireless/ath9k/pci.c
index 6dbc58580abb..168411d322a2 100644
--- a/drivers/net/wireless/ath9k/pci.c
+++ b/drivers/net/wireless/ath9k/pci.c
@@ -93,14 +93,14 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
93 if (pci_enable_device(pdev)) 93 if (pci_enable_device(pdev))
94 return -EIO; 94 return -EIO;
95 95
96 ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 96 ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
97 97
98 if (ret) { 98 if (ret) {
99 printk(KERN_ERR "ath9k: 32-bit DMA not available\n"); 99 printk(KERN_ERR "ath9k: 32-bit DMA not available\n");
100 goto bad; 100 goto bad;
101 } 101 }
102 102
103 ret = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 103 ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
104 104
105 if (ret) { 105 if (ret) {
106 printk(KERN_ERR "ath9k: 32-bit DMA consistent " 106 printk(KERN_ERR "ath9k: 32-bit DMA consistent "
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index e3569a0a952d..b1610ea4bb3d 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -492,8 +492,8 @@ static int __devinit p54p_probe(struct pci_dev *pdev,
492 goto err_disable_dev; 492 goto err_disable_dev;
493 } 493 }
494 494
495 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) || 495 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
496 pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) { 496 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
497 dev_err(&pdev->dev, "No suitable DMA available\n"); 497 dev_err(&pdev->dev, "No suitable DMA available\n");
498 goto err_free_reg; 498 goto err_free_reg;
499 } 499 }
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 4fa3bb2ddfe4..33e5ade774ca 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -434,7 +434,8 @@ static void __init superio_parport_init(void)
434 0 /*base_hi*/, 434 0 /*base_hi*/,
435 PAR_IRQ, 435 PAR_IRQ,
436 PARPORT_DMA_NONE /* dma */, 436 PARPORT_DMA_NONE /* dma */,
437 NULL /*struct pci_dev* */) ) 437 NULL /*struct pci_dev* */),
438 0 /* shared irq flags */ )
438 439
439 printk(KERN_WARNING PFX "Probing parallel port failed.\n"); 440 printk(KERN_WARNING PFX "Probing parallel port failed.\n");
440#endif /* CONFIG_PARPORT_PC */ 441#endif /* CONFIG_PARPORT_PC */
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 25a00ce4f24d..fa3a11365ec3 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -173,12 +173,21 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header)
173 struct dmar_drhd_unit *dmaru; 173 struct dmar_drhd_unit *dmaru;
174 int ret = 0; 174 int ret = 0;
175 175
176 drhd = (struct acpi_dmar_hardware_unit *)header;
177 if (!drhd->address) {
178 /* Promote an attitude of violence to a BIOS engineer today */
179 WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n"
180 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
181 dmi_get_system_info(DMI_BIOS_VENDOR),
182 dmi_get_system_info(DMI_BIOS_VERSION),
183 dmi_get_system_info(DMI_PRODUCT_VERSION));
184 return -ENODEV;
185 }
176 dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL); 186 dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL);
177 if (!dmaru) 187 if (!dmaru)
178 return -ENOMEM; 188 return -ENOMEM;
179 189
180 dmaru->hdr = header; 190 dmaru->hdr = header;
181 drhd = (struct acpi_dmar_hardware_unit *)header;
182 dmaru->reg_base_addr = drhd->address; 191 dmaru->reg_base_addr = drhd->address;
183 dmaru->segment = drhd->segment; 192 dmaru->segment = drhd->segment;
184 dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */ 193 dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index fb3a3f3fca7a..001b328adf80 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -733,8 +733,8 @@ static void dma_pte_clear_range(struct dmar_domain *domain, u64 start, u64 end)
733 start &= (((u64)1) << addr_width) - 1; 733 start &= (((u64)1) << addr_width) - 1;
734 end &= (((u64)1) << addr_width) - 1; 734 end &= (((u64)1) << addr_width) - 1;
735 /* in case it's partial page */ 735 /* in case it's partial page */
736 start = PAGE_ALIGN(start); 736 start &= PAGE_MASK;
737 end &= PAGE_MASK; 737 end = PAGE_ALIGN(end);
738 npages = (end - start) / VTD_PAGE_SIZE; 738 npages = (end - start) / VTD_PAGE_SIZE;
739 739
740 /* we don't need lock here, nobody else touches the iova range */ 740 /* we don't need lock here, nobody else touches the iova range */
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index fdb14ec4fd47..8b7983aba8f7 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -2234,10 +2234,10 @@ static int twa_resume(struct pci_dev *pdev)
2234 pci_set_master(pdev); 2234 pci_set_master(pdev);
2235 pci_try_set_mwi(pdev); 2235 pci_try_set_mwi(pdev);
2236 2236
2237 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) 2237 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))
2238 || pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) 2238 || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)))
2239 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) 2239 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))
2240 || pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) { 2240 || pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
2241 TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during resume"); 2241 TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during resume");
2242 retval = -ENODEV; 2242 retval = -ENODEV;
2243 goto out_disable_device; 2243 goto out_disable_device;
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 280261c451d6..2a889853a106 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1378,7 +1378,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
1378 if (dev->nondasd_support && !dev->in_reset) 1378 if (dev->nondasd_support && !dev->in_reset)
1379 printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id); 1379 printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id);
1380 1380
1381 if (dma_get_required_mask(&dev->pdev->dev) > DMA_32BIT_MASK) 1381 if (dma_get_required_mask(&dev->pdev->dev) > DMA_BIT_MASK(32))
1382 dev->needs_dac = 1; 1382 dev->needs_dac = 1;
1383 dev->dac_support = 0; 1383 dev->dac_support = 0;
1384 if ((sizeof(dma_addr_t) > 4) && dev->needs_dac && 1384 if ((sizeof(dma_addr_t) > 4) && dev->needs_dac &&
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index b1bd3fc7bae8..36fd2e75da1c 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1394,7 +1394,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd,
1394 */ 1394 */
1395 cmd->sense_buffer[8] = 0; /* Information */ 1395 cmd->sense_buffer[8] = 0; /* Information */
1396 cmd->sense_buffer[9] = 0xa; /* Add. length */ 1396 cmd->sense_buffer[9] = 0xa; /* Add. length */
1397 do_div(bghm, cmd->device->sector_size); 1397 bghm /= cmd->device->sector_size;
1398 1398
1399 failing_sector = scsi_get_lba(cmd); 1399 failing_sector = scsi_get_lba(cmd);
1400 failing_sector += bghm; 1400 failing_sector += bghm;
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 52427a8324f5..a91f5143ceac 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -855,9 +855,9 @@ _base_config_dma_addressing(struct MPT2SAS_ADAPTER *ioc, struct pci_dev *pdev)
855 if (sizeof(dma_addr_t) > 4) { 855 if (sizeof(dma_addr_t) > 4) {
856 const uint64_t required_mask = 856 const uint64_t required_mask =
857 dma_get_required_mask(&pdev->dev); 857 dma_get_required_mask(&pdev->dev);
858 if ((required_mask > DMA_32BIT_MASK) && !pci_set_dma_mask(pdev, 858 if ((required_mask > DMA_BIT_MASK(32)) && !pci_set_dma_mask(pdev,
859 DMA_64BIT_MASK) && !pci_set_consistent_dma_mask(pdev, 859 DMA_BIT_MASK(64)) && !pci_set_consistent_dma_mask(pdev,
860 DMA_64BIT_MASK)) { 860 DMA_BIT_MASK(64))) {
861 ioc->base_add_sg_single = &_base_add_sg_single_64; 861 ioc->base_add_sg_single = &_base_add_sg_single_64;
862 ioc->sge_size = sizeof(Mpi2SGESimple64_t); 862 ioc->sge_size = sizeof(Mpi2SGESimple64_t);
863 desc = "64"; 863 desc = "64";
@@ -865,8 +865,8 @@ _base_config_dma_addressing(struct MPT2SAS_ADAPTER *ioc, struct pci_dev *pdev)
865 } 865 }
866 } 866 }
867 867
868 if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK) 868 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))
869 && !pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) { 869 && !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
870 ioc->base_add_sg_single = &_base_add_sg_single_32; 870 ioc->base_add_sg_single = &_base_add_sg_single_32;
871 ioc->sge_size = sizeof(Mpi2SGESimple32_t); 871 ioc->sge_size = sizeof(Mpi2SGESimple32_t);
872 desc = "32"; 872 desc = "32";
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index e1850904ff73..fbc83bebdd8e 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -38,9 +38,6 @@ static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
38 { }; 38 { };
39#endif 39#endif
40 40
41/* scsi_scan.c */
42int scsi_complete_async_scans(void);
43
44/* scsi_devinfo.c */ 41/* scsi_devinfo.c */
45extern int scsi_get_device_flags(struct scsi_device *sdev, 42extern int scsi_get_device_flags(struct scsi_device *sdev,
46 const unsigned char *vendor, 43 const unsigned char *vendor,
diff --git a/drivers/scsi/scsi_wait_scan.c b/drivers/scsi/scsi_wait_scan.c
index 8a636103083d..2f21af21269a 100644
--- a/drivers/scsi/scsi_wait_scan.c
+++ b/drivers/scsi/scsi_wait_scan.c
@@ -11,7 +11,7 @@
11 */ 11 */
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14#include "scsi_priv.h" 14#include <scsi/scsi_scan.h>
15 15
16static int __init wait_scan_init(void) 16static int __init wait_scan_init(void)
17{ 17{
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 0328fd4006e5..343e3a35b6a3 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -854,7 +854,7 @@ config SERIAL_IMX_CONSOLE
854 854
855config SERIAL_UARTLITE 855config SERIAL_UARTLITE
856 tristate "Xilinx uartlite serial port support" 856 tristate "Xilinx uartlite serial port support"
857 depends on PPC32 857 depends on PPC32 || MICROBLAZE
858 select SERIAL_CORE 858 select SERIAL_CORE
859 help 859 help
860 Say Y here if you want to use the Xilinx uartlite serial controller. 860 Say Y here if you want to use the Xilinx uartlite serial controller.
@@ -1340,7 +1340,7 @@ config SERIAL_NETX_CONSOLE
1340 1340
1341config SERIAL_OF_PLATFORM 1341config SERIAL_OF_PLATFORM
1342 tristate "Serial port on Open Firmware platform bus" 1342 tristate "Serial port on Open Firmware platform bus"
1343 depends on PPC_OF 1343 depends on PPC_OF || MICROBLAZE
1344 depends on SERIAL_8250 || SERIAL_OF_PLATFORM_NWPSERIAL 1344 depends on SERIAL_8250 || SERIAL_OF_PLATFORM_NWPSERIAL
1345 help 1345 help
1346 If you have a PowerPC based system that has serial ports 1346 If you have a PowerPC based system that has serial ports
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c
index 7fb9b5c4669a..12d13d99b6f0 100644
--- a/drivers/sh/intc.c
+++ b/drivers/sh/intc.c
@@ -44,6 +44,7 @@ struct intc_handle_int {
44struct intc_desc_int { 44struct intc_desc_int {
45 struct list_head list; 45 struct list_head list;
46 struct sys_device sysdev; 46 struct sys_device sysdev;
47 pm_message_t state;
47 unsigned long *reg; 48 unsigned long *reg;
48#ifdef CONFIG_SMP 49#ifdef CONFIG_SMP
49 unsigned long *smp; 50 unsigned long *smp;
@@ -786,18 +787,44 @@ static int intc_suspend(struct sys_device *dev, pm_message_t state)
786 /* get intc controller associated with this sysdev */ 787 /* get intc controller associated with this sysdev */
787 d = container_of(dev, struct intc_desc_int, sysdev); 788 d = container_of(dev, struct intc_desc_int, sysdev);
788 789
789 /* enable wakeup irqs belonging to this intc controller */ 790 switch (state.event) {
790 for_each_irq_desc(irq, desc) { 791 case PM_EVENT_ON:
791 if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip)) 792 if (d->state.event != PM_EVENT_FREEZE)
792 intc_enable(irq); 793 break;
794 for_each_irq_desc(irq, desc) {
795 if (desc->chip != &d->chip)
796 continue;
797 if (desc->status & IRQ_DISABLED)
798 intc_disable(irq);
799 else
800 intc_enable(irq);
801 }
802 break;
803 case PM_EVENT_FREEZE:
804 /* nothing has to be done */
805 break;
806 case PM_EVENT_SUSPEND:
807 /* enable wakeup irqs belonging to this intc controller */
808 for_each_irq_desc(irq, desc) {
809 if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip))
810 intc_enable(irq);
811 }
812 break;
793 } 813 }
814 d->state = state;
794 815
795 return 0; 816 return 0;
796} 817}
797 818
819static int intc_resume(struct sys_device *dev)
820{
821 return intc_suspend(dev, PMSG_ON);
822}
823
798static struct sysdev_class intc_sysdev_class = { 824static struct sysdev_class intc_sysdev_class = {
799 .name = "intc", 825 .name = "intc",
800 .suspend = intc_suspend, 826 .suspend = intc_suspend,
827 .resume = intc_resume,
801}; 828};
802 829
803/* register this intc as sysdev to allow suspend/resume */ 830/* register this intc as sysdev to allow suspend/resume */
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 643908b74bc0..8eba98c8ed1e 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -658,7 +658,7 @@ int spi_write_then_read(struct spi_device *spi,
658 658
659 int status; 659 int status;
660 struct spi_message message; 660 struct spi_message message;
661 struct spi_transfer x; 661 struct spi_transfer x[2];
662 u8 *local_buf; 662 u8 *local_buf;
663 663
664 /* Use preallocated DMA-safe buffer. We can't avoid copying here, 664 /* Use preallocated DMA-safe buffer. We can't avoid copying here,
@@ -669,9 +669,15 @@ int spi_write_then_read(struct spi_device *spi,
669 return -EINVAL; 669 return -EINVAL;
670 670
671 spi_message_init(&message); 671 spi_message_init(&message);
672 memset(&x, 0, sizeof x); 672 memset(x, 0, sizeof x);
673 x.len = n_tx + n_rx; 673 if (n_tx) {
674 spi_message_add_tail(&x, &message); 674 x[0].len = n_tx;
675 spi_message_add_tail(&x[0], &message);
676 }
677 if (n_rx) {
678 x[1].len = n_rx;
679 spi_message_add_tail(&x[1], &message);
680 }
675 681
676 /* ... unless someone else is using the pre-allocated buffer */ 682 /* ... unless someone else is using the pre-allocated buffer */
677 if (!mutex_trylock(&lock)) { 683 if (!mutex_trylock(&lock)) {
@@ -682,15 +688,15 @@ int spi_write_then_read(struct spi_device *spi,
682 local_buf = buf; 688 local_buf = buf;
683 689
684 memcpy(local_buf, txbuf, n_tx); 690 memcpy(local_buf, txbuf, n_tx);
685 x.tx_buf = local_buf; 691 x[0].tx_buf = local_buf;
686 x.rx_buf = local_buf; 692 x[1].rx_buf = local_buf + n_tx;
687 693
688 /* do the i/o */ 694 /* do the i/o */
689 status = spi_sync(spi, &message); 695 status = spi_sync(spi, &message);
690 if (status == 0) 696 if (status == 0)
691 memcpy(rxbuf, x.rx_buf + n_tx, n_rx); 697 memcpy(rxbuf, x[1].rx_buf, n_rx);
692 698
693 if (x.tx_buf == buf) 699 if (x[0].tx_buf == buf)
694 mutex_unlock(&lock); 700 mutex_unlock(&lock);
695 else 701 else
696 kfree(local_buf); 702 kfree(local_buf);
diff --git a/drivers/staging/b3dfg/b3dfg.c b/drivers/staging/b3dfg/b3dfg.c
index 0348072b3ab5..75ebe338c6f2 100644
--- a/drivers/staging/b3dfg/b3dfg.c
+++ b/drivers/staging/b3dfg/b3dfg.c
@@ -1000,7 +1000,7 @@ static int __devinit b3dfg_probe(struct pci_dev *pdev,
1000 1000
1001 pci_set_master(pdev); 1001 pci_set_master(pdev);
1002 1002
1003 r = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1003 r = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
1004 if (r) { 1004 if (r) {
1005 dev_err(&pdev->dev, "no usable DMA configuration\n"); 1005 dev_err(&pdev->dev, "no usable DMA configuration\n");
1006 goto err_free_res; 1006 goto err_free_res;
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 869d47cb6db3..0a69c0977e3f 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -546,10 +546,6 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
546 tty->driver_data = acm; 546 tty->driver_data = acm;
547 acm->tty = tty; 547 acm->tty = tty;
548 548
549 /* force low_latency on so that our tty_push actually forces the data through,
550 otherwise it is scheduled, and with high data rates data can get lost. */
551 tty->low_latency = 1;
552
553 if (usb_autopm_get_interface(acm->control) < 0) 549 if (usb_autopm_get_interface(acm->control) < 0)
554 goto early_bail; 550 goto early_bail;
555 else 551 else
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 4b933f646f2e..c567168f89af 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -36,14 +36,14 @@ struct nop_usb_xceiv {
36 struct device *dev; 36 struct device *dev;
37}; 37};
38 38
39static u64 nop_xceiv_dmamask = DMA_32BIT_MASK; 39static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32);
40 40
41static struct platform_device nop_xceiv_device = { 41static struct platform_device nop_xceiv_device = {
42 .name = "nop_usb_xceiv", 42 .name = "nop_usb_xceiv",
43 .id = -1, 43 .id = -1,
44 .dev = { 44 .dev = {
45 .dma_mask = &nop_xceiv_dmamask, 45 .dma_mask = &nop_xceiv_dmamask,
46 .coherent_dma_mask = DMA_32BIT_MASK, 46 .coherent_dma_mask = DMA_BIT_MASK(32),
47 .platform_data = NULL, 47 .platform_data = NULL,
48 }, 48 },
49}; 49};
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 2620bf6fe5e1..9c4c700c7cc6 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1215,20 +1215,22 @@ static void ti_bulk_in_callback(struct urb *urb)
1215 } 1215 }
1216 1216
1217 tty = tty_port_tty_get(&port->port); 1217 tty = tty_port_tty_get(&port->port);
1218 if (tty && urb->actual_length) { 1218 if (tty) {
1219 usb_serial_debug_data(debug, dev, __func__, 1219 if (urb->actual_length) {
1220 urb->actual_length, urb->transfer_buffer); 1220 usb_serial_debug_data(debug, dev, __func__,
1221 1221 urb->actual_length, urb->transfer_buffer);
1222 if (!tport->tp_is_open) 1222
1223 dbg("%s - port closed, dropping data", __func__); 1223 if (!tport->tp_is_open)
1224 else 1224 dbg("%s - port closed, dropping data",
1225 ti_recv(&urb->dev->dev, tty, 1225 __func__);
1226 else
1227 ti_recv(&urb->dev->dev, tty,
1226 urb->transfer_buffer, 1228 urb->transfer_buffer,
1227 urb->actual_length); 1229 urb->actual_length);
1228 1230 spin_lock(&tport->tp_lock);
1229 spin_lock(&tport->tp_lock); 1231 tport->tp_icount.rx += urb->actual_length;
1230 tport->tp_icount.rx += urb->actual_length; 1232 spin_unlock(&tport->tp_lock);
1231 spin_unlock(&tport->tp_lock); 1233 }
1232 tty_kref_put(tty); 1234 tty_kref_put(tty);
1233 } 1235 }
1234 1236
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 16bb7e3c0310..6c37e8ee5efe 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -698,8 +698,8 @@ static void __devinit radeon_get_pllinfo(struct radeonfb_info *rinfo)
698found: 698found:
699 /* 699 /*
700 * Some methods fail to retrieve SCLK and MCLK values, we apply default 700 * Some methods fail to retrieve SCLK and MCLK values, we apply default
701 * settings in this case (200Mhz). If that really happne often, we could 701 * settings in this case (200Mhz). If that really happens often, we
702 * fetch from registers instead... 702 * could fetch from registers instead...
703 */ 703 */
704 if (rinfo->pll.mclk == 0) 704 if (rinfo->pll.mclk == 0)
705 rinfo->pll.mclk = 20000; 705 rinfo->pll.mclk = 20000;
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index dd37cbcaf8ce..157057c79ca3 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -35,8 +35,6 @@ static int fb_notifier_callback(struct notifier_block *self,
35 return 0; 35 return 0;
36 36
37 bd = container_of(self, struct backlight_device, fb_notif); 37 bd = container_of(self, struct backlight_device, fb_notif);
38 if (!lock_fb_info(evdata->info))
39 return -ENODEV;
40 mutex_lock(&bd->ops_lock); 38 mutex_lock(&bd->ops_lock);
41 if (bd->ops) 39 if (bd->ops)
42 if (!bd->ops->check_fb || 40 if (!bd->ops->check_fb ||
@@ -49,7 +47,6 @@ static int fb_notifier_callback(struct notifier_block *self,
49 backlight_update_status(bd); 47 backlight_update_status(bd);
50 } 48 }
51 mutex_unlock(&bd->ops_lock); 49 mutex_unlock(&bd->ops_lock);
52 unlock_fb_info(evdata->info);
53 return 0; 50 return 0;
54} 51}
55 52
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 0bb13df0fa89..b6449470106c 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -40,8 +40,6 @@ static int fb_notifier_callback(struct notifier_block *self,
40 if (!ld->ops) 40 if (!ld->ops)
41 return 0; 41 return 0;
42 42
43 if (!lock_fb_info(evdata->info))
44 return -ENODEV;
45 mutex_lock(&ld->ops_lock); 43 mutex_lock(&ld->ops_lock);
46 if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { 44 if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) {
47 if (event == FB_EVENT_BLANK) { 45 if (event == FB_EVENT_BLANK) {
@@ -53,7 +51,6 @@ static int fb_notifier_callback(struct notifier_block *self,
53 } 51 }
54 } 52 }
55 mutex_unlock(&ld->ops_lock); 53 mutex_unlock(&ld->ops_lock);
56 unlock_fb_info(evdata->info);
57 return 0; 54 return 0;
58} 55}
59 56
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index d42e385f091c..4c2bf923418c 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -567,9 +567,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
567 default: 567 default:
568 dev_dbg(info->device, 568 dev_dbg(info->device,
569 "Unsupported bpp size: %d\n", var->bits_per_pixel); 569 "Unsupported bpp size: %d\n", var->bits_per_pixel);
570 assert(false); 570 return -EINVAL;
571 /* should never occur */
572 break;
573 } 571 }
574 572
575 if (var->xres_virtual < var->xres) 573 if (var->xres_virtual < var->xres)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 2cd500a304f2..471a9a60376a 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2263,9 +2263,12 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info,
2263 } 2263 }
2264 2264
2265 2265
2266 if (!lock_fb_info(info))
2267 return;
2266 event.info = info; 2268 event.info = info;
2267 event.data = &blank; 2269 event.data = &blank;
2268 fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); 2270 fb_notifier_call_chain(FB_EVENT_CONBLANK, &event);
2271 unlock_fb_info(info);
2269} 2272}
2270 2273
2271static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) 2274static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
@@ -2956,8 +2959,6 @@ static int fbcon_fb_unregistered(struct fb_info *info)
2956{ 2959{
2957 int i, idx; 2960 int i, idx;
2958 2961
2959 if (!lock_fb_info(info))
2960 return -ENODEV;
2961 idx = info->node; 2962 idx = info->node;
2962 for (i = first_fb_vc; i <= last_fb_vc; i++) { 2963 for (i = first_fb_vc; i <= last_fb_vc; i++) {
2963 if (con2fb_map[i] == idx) 2964 if (con2fb_map[i] == idx)
@@ -2985,8 +2986,6 @@ static int fbcon_fb_unregistered(struct fb_info *info)
2985 if (primary_device == idx) 2986 if (primary_device == idx)
2986 primary_device = -1; 2987 primary_device = -1;
2987 2988
2988 unlock_fb_info(info);
2989
2990 if (!num_registered_fb) 2989 if (!num_registered_fb)
2991 unregister_con_driver(&fb_con); 2990 unregister_con_driver(&fb_con);
2992 2991
@@ -3027,11 +3026,8 @@ static int fbcon_fb_registered(struct fb_info *info)
3027{ 3026{
3028 int ret = 0, i, idx; 3027 int ret = 0, i, idx;
3029 3028
3030 if (!lock_fb_info(info))
3031 return -ENODEV;
3032 idx = info->node; 3029 idx = info->node;
3033 fbcon_select_primary(info); 3030 fbcon_select_primary(info);
3034 unlock_fb_info(info);
3035 3031
3036 if (info_idx == -1) { 3032 if (info_idx == -1) {
3037 for (i = first_fb_vc; i <= last_fb_vc; i++) { 3033 for (i = first_fb_vc; i <= last_fb_vc; i++) {
@@ -3152,53 +3148,23 @@ static int fbcon_event_notify(struct notifier_block *self,
3152 3148
3153 switch(action) { 3149 switch(action) {
3154 case FB_EVENT_SUSPEND: 3150 case FB_EVENT_SUSPEND:
3155 if (!lock_fb_info(info)) {
3156 ret = -ENODEV;
3157 goto done;
3158 }
3159 fbcon_suspended(info); 3151 fbcon_suspended(info);
3160 unlock_fb_info(info);
3161 break; 3152 break;
3162 case FB_EVENT_RESUME: 3153 case FB_EVENT_RESUME:
3163 if (!lock_fb_info(info)) {
3164 ret = -ENODEV;
3165 goto done;
3166 }
3167 fbcon_resumed(info); 3154 fbcon_resumed(info);
3168 unlock_fb_info(info);
3169 break; 3155 break;
3170 case FB_EVENT_MODE_CHANGE: 3156 case FB_EVENT_MODE_CHANGE:
3171 if (!lock_fb_info(info)) {
3172 ret = -ENODEV;
3173 goto done;
3174 }
3175 fbcon_modechanged(info); 3157 fbcon_modechanged(info);
3176 unlock_fb_info(info);
3177 break; 3158 break;
3178 case FB_EVENT_MODE_CHANGE_ALL: 3159 case FB_EVENT_MODE_CHANGE_ALL:
3179 if (!lock_fb_info(info)) {
3180 ret = -ENODEV;
3181 goto done;
3182 }
3183 fbcon_set_all_vcs(info); 3160 fbcon_set_all_vcs(info);
3184 unlock_fb_info(info);
3185 break; 3161 break;
3186 case FB_EVENT_MODE_DELETE: 3162 case FB_EVENT_MODE_DELETE:
3187 mode = event->data; 3163 mode = event->data;
3188 if (!lock_fb_info(info)) {
3189 ret = -ENODEV;
3190 goto done;
3191 }
3192 ret = fbcon_mode_deleted(info, mode); 3164 ret = fbcon_mode_deleted(info, mode);
3193 unlock_fb_info(info);
3194 break; 3165 break;
3195 case FB_EVENT_FB_UNBIND: 3166 case FB_EVENT_FB_UNBIND:
3196 if (!lock_fb_info(info)) {
3197 ret = -ENODEV;
3198 goto done;
3199 }
3200 idx = info->node; 3167 idx = info->node;
3201 unlock_fb_info(info);
3202 ret = fbcon_fb_unbind(idx); 3168 ret = fbcon_fb_unbind(idx);
3203 break; 3169 break;
3204 case FB_EVENT_FB_REGISTERED: 3170 case FB_EVENT_FB_REGISTERED:
@@ -3217,29 +3183,14 @@ static int fbcon_event_notify(struct notifier_block *self,
3217 con2fb->framebuffer = con2fb_map[con2fb->console - 1]; 3183 con2fb->framebuffer = con2fb_map[con2fb->console - 1];
3218 break; 3184 break;
3219 case FB_EVENT_BLANK: 3185 case FB_EVENT_BLANK:
3220 if (!lock_fb_info(info)) {
3221 ret = -ENODEV;
3222 goto done;
3223 }
3224 fbcon_fb_blanked(info, *(int *)event->data); 3186 fbcon_fb_blanked(info, *(int *)event->data);
3225 unlock_fb_info(info);
3226 break; 3187 break;
3227 case FB_EVENT_NEW_MODELIST: 3188 case FB_EVENT_NEW_MODELIST:
3228 if (!lock_fb_info(info)) {
3229 ret = -ENODEV;
3230 goto done;
3231 }
3232 fbcon_new_modelist(info); 3189 fbcon_new_modelist(info);
3233 unlock_fb_info(info);
3234 break; 3190 break;
3235 case FB_EVENT_GET_REQ: 3191 case FB_EVENT_GET_REQ:
3236 caps = event->data; 3192 caps = event->data;
3237 if (!lock_fb_info(info)) {
3238 ret = -ENODEV;
3239 goto done;
3240 }
3241 fbcon_get_requirement(info, caps); 3193 fbcon_get_requirement(info, caps);
3242 unlock_fb_info(info);
3243 break; 3194 break;
3244 } 3195 }
3245done: 3196done:
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 0c5b9a9fd56f..8dea2bc92705 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -210,12 +210,15 @@ static int __init efifb_probe(struct platform_device *dev)
210 unsigned int size_total; 210 unsigned int size_total;
211 int request_succeeded = 0; 211 int request_succeeded = 0;
212 212
213 printk(KERN_INFO "efifb: probing for efifb\n");
214
215 if (!screen_info.lfb_depth) 213 if (!screen_info.lfb_depth)
216 screen_info.lfb_depth = 32; 214 screen_info.lfb_depth = 32;
217 if (!screen_info.pages) 215 if (!screen_info.pages)
218 screen_info.pages = 1; 216 screen_info.pages = 1;
217 if (!screen_info.lfb_base) {
218 printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
219 return -ENODEV;
220 }
221 printk(KERN_INFO "efifb: probing for efifb\n");
219 222
220 /* just assume they're all unset if any are */ 223 /* just assume they're all unset if any are */
221 if (!screen_info.blue_size) { 224 if (!screen_info.blue_size) {
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 2ac32e6b5953..d412a1ddc12f 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1097,8 +1097,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
1097 return -EINVAL; 1097 return -EINVAL;
1098 con2fb.framebuffer = -1; 1098 con2fb.framebuffer = -1;
1099 event.data = &con2fb; 1099 event.data = &con2fb;
1100 if (!lock_fb_info(info))
1101 return -ENODEV;
1100 event.info = info; 1102 event.info = info;
1101 fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event); 1103 fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event);
1104 unlock_fb_info(info);
1102 ret = copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0; 1105 ret = copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0;
1103 break; 1106 break;
1104 case FBIOPUT_CON2FBMAP: 1107 case FBIOPUT_CON2FBMAP:
@@ -1115,8 +1118,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
1115 break; 1118 break;
1116 } 1119 }
1117 event.data = &con2fb; 1120 event.data = &con2fb;
1121 if (!lock_fb_info(info))
1122 return -ENODEV;
1118 event.info = info; 1123 event.info = info;
1119 ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP, &event); 1124 ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP, &event);
1125 unlock_fb_info(info);
1120 break; 1126 break;
1121 case FBIOBLANK: 1127 case FBIOBLANK:
1122 if (!lock_fb_info(info)) 1128 if (!lock_fb_info(info))
@@ -1521,7 +1527,10 @@ register_framebuffer(struct fb_info *fb_info)
1521 registered_fb[i] = fb_info; 1527 registered_fb[i] = fb_info;
1522 1528
1523 event.info = fb_info; 1529 event.info = fb_info;
1530 if (!lock_fb_info(fb_info))
1531 return -ENODEV;
1524 fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); 1532 fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
1533 unlock_fb_info(fb_info);
1525 return 0; 1534 return 0;
1526} 1535}
1527 1536
@@ -1555,8 +1564,12 @@ unregister_framebuffer(struct fb_info *fb_info)
1555 goto done; 1564 goto done;
1556 } 1565 }
1557 1566
1567
1568 if (!lock_fb_info(fb_info))
1569 return -ENODEV;
1558 event.info = fb_info; 1570 event.info = fb_info;
1559 ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event); 1571 ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event);
1572 unlock_fb_info(fb_info);
1560 1573
1561 if (ret) { 1574 if (ret) {
1562 ret = -EINVAL; 1575 ret = -EINVAL;
@@ -1590,6 +1603,8 @@ void fb_set_suspend(struct fb_info *info, int state)
1590{ 1603{
1591 struct fb_event event; 1604 struct fb_event event;
1592 1605
1606 if (!lock_fb_info(info))
1607 return;
1593 event.info = info; 1608 event.info = info;
1594 if (state) { 1609 if (state) {
1595 fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); 1610 fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
@@ -1598,6 +1613,7 @@ void fb_set_suspend(struct fb_info *info, int state)
1598 info->state = FBINFO_STATE_RUNNING; 1613 info->state = FBINFO_STATE_RUNNING;
1599 fb_notifier_call_chain(FB_EVENT_RESUME, &event); 1614 fb_notifier_call_chain(FB_EVENT_RESUME, &event);
1600 } 1615 }
1616 unlock_fb_info(info);
1601} 1617}
1602 1618
1603/** 1619/**
@@ -1667,8 +1683,11 @@ int fb_new_modelist(struct fb_info *info)
1667 err = 1; 1683 err = 1;
1668 1684
1669 if (!list_empty(&info->modelist)) { 1685 if (!list_empty(&info->modelist)) {
1686 if (!lock_fb_info(info))
1687 return -ENODEV;
1670 event.info = info; 1688 event.info = info;
1671 err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event); 1689 err = fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
1690 unlock_fb_info(info);
1672 } 1691 }
1673 1692
1674 return err; 1693 return err;
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
index a50bea614804..40984551c927 100644
--- a/drivers/video/intelfb/intelfb.h
+++ b/drivers/video/intelfb/intelfb.h
@@ -53,6 +53,7 @@
53#define PCI_DEVICE_ID_INTEL_830M 0x3577 53#define PCI_DEVICE_ID_INTEL_830M 0x3577
54#define PCI_DEVICE_ID_INTEL_845G 0x2562 54#define PCI_DEVICE_ID_INTEL_845G 0x2562
55#define PCI_DEVICE_ID_INTEL_85XGM 0x3582 55#define PCI_DEVICE_ID_INTEL_85XGM 0x3582
56#define PCI_DEVICE_ID_INTEL_854 0x358E
56#define PCI_DEVICE_ID_INTEL_865G 0x2572 57#define PCI_DEVICE_ID_INTEL_865G 0x2572
57#define PCI_DEVICE_ID_INTEL_915G 0x2582 58#define PCI_DEVICE_ID_INTEL_915G 0x2582
58#define PCI_DEVICE_ID_INTEL_915GM 0x2592 59#define PCI_DEVICE_ID_INTEL_915GM 0x2592
@@ -154,6 +155,7 @@ enum intel_chips {
154 INTEL_85XGM, 155 INTEL_85XGM,
155 INTEL_852GM, 156 INTEL_852GM,
156 INTEL_852GME, 157 INTEL_852GME,
158 INTEL_854,
157 INTEL_855GM, 159 INTEL_855GM,
158 INTEL_855GME, 160 INTEL_855GME,
159 INTEL_865G, 161 INTEL_865G,
diff --git a/drivers/video/intelfb/intelfb_i2c.c b/drivers/video/intelfb/intelfb_i2c.c
index b3065492bb20..487f2be47460 100644
--- a/drivers/video/intelfb/intelfb_i2c.c
+++ b/drivers/video/intelfb/intelfb_i2c.c
@@ -156,6 +156,7 @@ void intelfb_create_i2c_busses(struct intelfb_info *dinfo)
156 switch(dinfo->chipset) { 156 switch(dinfo->chipset) {
157 case INTEL_830M: 157 case INTEL_830M:
158 case INTEL_845G: 158 case INTEL_845G:
159 case INTEL_854:
159 case INTEL_855GM: 160 case INTEL_855GM:
160 case INTEL_865G: 161 case INTEL_865G:
161 dinfo->output[i].type = INTELFB_OUTPUT_DVO; 162 dinfo->output[i].type = INTELFB_OUTPUT_DVO;
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 6d8e5415c809..ace14fe02fc4 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -182,6 +182,7 @@ static struct pci_device_id intelfb_pci_table[] __devinitdata = {
182 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G }, 182 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_845G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_845G },
183 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM }, 183 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_85XGM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_85XGM },
184 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_865G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_865G }, 184 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_865G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_865G },
185 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_854, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_854 },
185 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_915G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_915G }, 186 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_915G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_915G },
186 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_915GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_915GM }, 187 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_915GM, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_915GM },
187 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945G }, 188 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_945G, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, INTELFB_CLASS_MASK, INTEL_945G },
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 8b26b27c2db6..0689f97c5238 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -84,6 +84,11 @@ int intelfbhw_get_chipset(struct pci_dev *pdev, struct intelfb_info *dinfo)
84 dinfo->mobile = 0; 84 dinfo->mobile = 0;
85 dinfo->pll_index = PLLS_I8xx; 85 dinfo->pll_index = PLLS_I8xx;
86 return 0; 86 return 0;
87 case PCI_DEVICE_ID_INTEL_854:
88 dinfo->mobile = 1;
89 dinfo->name = "Intel(R) 854";
90 dinfo->chipset = INTEL_854;
91 return 0;
87 case PCI_DEVICE_ID_INTEL_85XGM: 92 case PCI_DEVICE_ID_INTEL_85XGM:
88 tmp = 0; 93 tmp = 0;
89 dinfo->mobile = 1; 94 dinfo->mobile = 1;
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 4dcec48a1d78..c3fad34309ed 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -45,11 +45,11 @@ struct s3fb_info {
45static const struct svga_fb_format s3fb_formats[] = { 45static const struct svga_fb_format s3fb_formats[] = {
46 { 0, {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0}, 0, 46 { 0, {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0}, 0,
47 FB_TYPE_TEXT, FB_AUX_TEXT_SVGA_STEP4, FB_VISUAL_PSEUDOCOLOR, 8, 16}, 47 FB_TYPE_TEXT, FB_AUX_TEXT_SVGA_STEP4, FB_VISUAL_PSEUDOCOLOR, 8, 16},
48 { 4, {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0}, 0, 48 { 4, {0, 4, 0}, {0, 4, 0}, {0, 4, 0}, {0, 0, 0}, 0,
49 FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_PSEUDOCOLOR, 8, 16}, 49 FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_PSEUDOCOLOR, 8, 16},
50 { 4, {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0}, 1, 50 { 4, {0, 4, 0}, {0, 4, 0}, {0, 4, 0}, {0, 0, 0}, 1,
51 FB_TYPE_INTERLEAVED_PLANES, 1, FB_VISUAL_PSEUDOCOLOR, 8, 16}, 51 FB_TYPE_INTERLEAVED_PLANES, 1, FB_VISUAL_PSEUDOCOLOR, 8, 16},
52 { 8, {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0}, 0, 52 { 8, {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0}, 0,
53 FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_PSEUDOCOLOR, 4, 8}, 53 FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_PSEUDOCOLOR, 4, 8},
54 {16, {10, 5, 0}, {5, 5, 0}, {0, 5, 0}, {0, 0, 0}, 0, 54 {16, {10, 5, 0}, {5, 5, 0}, {0, 5, 0}, {0, 0, 0}, 0,
55 FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_TRUECOLOR, 2, 4}, 55 FB_TYPE_PACKED_PIXELS, 0, FB_VISUAL_TRUECOLOR, 2, 4},
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index fad58cf9ef73..10ddad8e17d6 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -199,16 +199,20 @@
199extern void (*sa1100fb_backlight_power)(int on); 199extern void (*sa1100fb_backlight_power)(int on);
200extern void (*sa1100fb_lcd_power)(int on); 200extern void (*sa1100fb_lcd_power)(int on);
201 201
202/* 202static struct sa1100fb_rgb rgb_4 = {
203 * IMHO this looks wrong. In 8BPP, length should be 8.
204 */
205static struct sa1100fb_rgb rgb_8 = {
206 .red = { .offset = 0, .length = 4, }, 203 .red = { .offset = 0, .length = 4, },
207 .green = { .offset = 0, .length = 4, }, 204 .green = { .offset = 0, .length = 4, },
208 .blue = { .offset = 0, .length = 4, }, 205 .blue = { .offset = 0, .length = 4, },
209 .transp = { .offset = 0, .length = 0, }, 206 .transp = { .offset = 0, .length = 0, },
210}; 207};
211 208
209static struct sa1100fb_rgb rgb_8 = {
210 .red = { .offset = 0, .length = 8, },
211 .green = { .offset = 0, .length = 8, },
212 .blue = { .offset = 0, .length = 8, },
213 .transp = { .offset = 0, .length = 0, },
214};
215
212static struct sa1100fb_rgb def_rgb_16 = { 216static struct sa1100fb_rgb def_rgb_16 = {
213 .red = { .offset = 11, .length = 5, }, 217 .red = { .offset = 11, .length = 5, },
214 .green = { .offset = 5, .length = 6, }, 218 .green = { .offset = 5, .length = 6, },
@@ -613,7 +617,7 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
613 DPRINTK("var->bits_per_pixel=%d\n", var->bits_per_pixel); 617 DPRINTK("var->bits_per_pixel=%d\n", var->bits_per_pixel);
614 switch (var->bits_per_pixel) { 618 switch (var->bits_per_pixel) {
615 case 4: 619 case 4:
616 rgbidx = RGB_8; 620 rgbidx = RGB_4;
617 break; 621 break;
618 case 8: 622 case 8:
619 rgbidx = RGB_8; 623 rgbidx = RGB_8;
@@ -1382,6 +1386,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
1382 fbi->fb.monspecs = monspecs; 1386 fbi->fb.monspecs = monspecs;
1383 fbi->fb.pseudo_palette = (fbi + 1); 1387 fbi->fb.pseudo_palette = (fbi + 1);
1384 1388
1389 fbi->rgb[RGB_4] = &rgb_4;
1385 fbi->rgb[RGB_8] = &rgb_8; 1390 fbi->rgb[RGB_8] = &rgb_8;
1386 fbi->rgb[RGB_16] = &def_rgb_16; 1391 fbi->rgb[RGB_16] = &def_rgb_16;
1387 1392
diff --git a/drivers/video/sa1100fb.h b/drivers/video/sa1100fb.h
index 86831db9a042..1c3b459865d8 100644
--- a/drivers/video/sa1100fb.h
+++ b/drivers/video/sa1100fb.h
@@ -57,9 +57,10 @@ struct sa1100fb_lcd_reg {
57 unsigned long lccr3; 57 unsigned long lccr3;
58}; 58};
59 59
60#define RGB_8 (0) 60#define RGB_4 (0)
61#define RGB_16 (1) 61#define RGB_8 (1)
62#define NR_RGB 2 62#define RGB_16 (2)
63#define NR_RGB 3
63 64
64struct sa1100fb_info { 65struct sa1100fb_info {
65 struct fb_info fb; 66 struct fb_info fb;
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 346d6458cf76..7e17ee95a97a 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -1129,7 +1129,7 @@ sisfb_bpp_to_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
1129 switch(var->bits_per_pixel) { 1129 switch(var->bits_per_pixel) {
1130 case 8: 1130 case 8:
1131 var->red.offset = var->green.offset = var->blue.offset = 0; 1131 var->red.offset = var->green.offset = var->blue.offset = 0;
1132 var->red.length = var->green.length = var->blue.length = 6; 1132 var->red.length = var->green.length = var->blue.length = 8;
1133 break; 1133 break;
1134 case 16: 1134 case 16:
1135 var->red.offset = 11; 1135 var->red.offset = 11;
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index a439159204a8..89158bc71da2 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -308,9 +308,11 @@ static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
308 * color depth = SUM(var->{color}.length) 308 * color depth = SUM(var->{color}.length)
309 * 309 *
310 * Pseudocolor: 310 * Pseudocolor:
311 * var->{color}.offset is 0 311 * var->{color}.offset is 0 unless the palette index takes less than
312 * var->{color}.length contains width of DAC or the number of unique 312 * bits_per_pixel bits and is stored in the upper
313 * colors available (color depth) 313 * bits of the pixel value
314 * var->{color}.length is set so that 1 << length is the number of
315 * available palette entries
314 * pseudo_palette is not used 316 * pseudo_palette is not used
315 * RAMDAC[X] is programmed to (red, green, blue) 317 * RAMDAC[X] is programmed to (red, green, blue)
316 * color depth = var->{color}.length 318 * color depth = var->{color}.length
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 0b370aebdbfd..421770b5e6ab 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -55,6 +55,7 @@ static u16 maxvf __devinitdata; /* maximum vertical frequency */
55static u16 maxhf __devinitdata; /* maximum horizontal frequency */ 55static u16 maxhf __devinitdata; /* maximum horizontal frequency */
56static u16 vbemode __devinitdata; /* force use of a specific VBE mode */ 56static u16 vbemode __devinitdata; /* force use of a specific VBE mode */
57static char *mode_option __devinitdata; 57static char *mode_option __devinitdata;
58static u8 dac_width = 6;
58 59
59static struct uvesafb_ktask *uvfb_tasks[UVESAFB_TASKS_MAX]; 60static struct uvesafb_ktask *uvfb_tasks[UVESAFB_TASKS_MAX];
60static DEFINE_MUTEX(uvfb_lock); 61static DEFINE_MUTEX(uvfb_lock);
@@ -303,22 +304,10 @@ static void uvesafb_setup_var(struct fb_var_screeninfo *var,
303 var->blue.offset = 0; 304 var->blue.offset = 0;
304 var->transp.offset = 0; 305 var->transp.offset = 0;
305 306
306 /* 307 var->red.length = 8;
307 * We're assuming that we can switch the DAC to 8 bits. If 308 var->green.length = 8;
308 * this proves to be incorrect, we'll update the fields 309 var->blue.length = 8;
309 * later in set_par(). 310 var->transp.length = 0;
310 */
311 if (par->vbe_ib.capabilities & VBE_CAP_CAN_SWITCH_DAC) {
312 var->red.length = 8;
313 var->green.length = 8;
314 var->blue.length = 8;
315 var->transp.length = 0;
316 } else {
317 var->red.length = 6;
318 var->green.length = 6;
319 var->blue.length = 6;
320 var->transp.length = 0;
321 }
322 } 311 }
323} 312}
324 313
@@ -1006,7 +995,7 @@ static int uvesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
1006 struct fb_info *info) 995 struct fb_info *info)
1007{ 996{
1008 struct uvesafb_pal_entry entry; 997 struct uvesafb_pal_entry entry;
1009 int shift = 16 - info->var.green.length; 998 int shift = 16 - dac_width;
1010 int err = 0; 999 int err = 0;
1011 1000
1012 if (regno >= info->cmap.len) 1001 if (regno >= info->cmap.len)
@@ -1055,7 +1044,7 @@ static int uvesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
1055static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info) 1044static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
1056{ 1045{
1057 struct uvesafb_pal_entry *entries; 1046 struct uvesafb_pal_entry *entries;
1058 int shift = 16 - info->var.green.length; 1047 int shift = 16 - dac_width;
1059 int i, err = 0; 1048 int i, err = 0;
1060 1049
1061 if (info->var.bits_per_pixel == 8) { 1050 if (info->var.bits_per_pixel == 8) {
@@ -1317,13 +1306,9 @@ setmode:
1317 err = uvesafb_exec(task); 1306 err = uvesafb_exec(task);
1318 if (err || (task->t.regs.eax & 0xffff) != 0x004f || 1307 if (err || (task->t.regs.eax & 0xffff) != 0x004f ||
1319 ((task->t.regs.ebx & 0xff00) >> 8) != 8) { 1308 ((task->t.regs.ebx & 0xff00) >> 8) != 8) {
1320 /* 1309 dac_width = 6;
1321 * We've failed to set the DAC palette format - 1310 } else {
1322 * time to correct var. 1311 dac_width = 8;
1323 */
1324 info->var.red.length = 6;
1325 info->var.green.length = 6;
1326 info->var.blue.length = 6;
1327 } 1312 }
1328 } 1313 }
1329 1314
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index cc919ae46571..050d432c7d95 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -318,13 +318,16 @@ static int vfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
318 * {hardwarespecific} contains width of RAMDAC 318 * {hardwarespecific} contains width of RAMDAC
319 * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset) 319 * cmap[X] is programmed to (X << red.offset) | (X << green.offset) | (X << blue.offset)
320 * RAMDAC[X] is programmed to (red, green, blue) 320 * RAMDAC[X] is programmed to (red, green, blue)
321 * 321 *
322 * Pseudocolor: 322 * Pseudocolor:
323 * uses offset = 0 && length = RAMDAC register width. 323 * var->{color}.offset is 0 unless the palette index takes less than
324 * var->{color}.offset is 0 324 * bits_per_pixel bits and is stored in the upper
325 * var->{color}.length contains widht of DAC 325 * bits of the pixel value
326 * var->{color}.length is set so that 1 << length is the number of available
327 * palette entries
326 * cmap is not used 328 * cmap is not used
327 * RAMDAC[X] is programmed to (red, green, blue) 329 * RAMDAC[X] is programmed to (red, green, blue)
330 *
328 * Truecolor: 331 * Truecolor:
329 * does not use DAC. Usually 3 are present. 332 * does not use DAC. Usually 3 are present.
330 * var->{color}.offset contains start of bitfield 333 * var->{color}.offset contains start of bitfield
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 63024145215d..5eb8f21da82e 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -240,8 +240,6 @@ config ORION5X_WATCHDOG
240 To compile this driver as a module, choose M here: the 240 To compile this driver as a module, choose M here: the
241 module will be called orion5x_wdt. 241 module will be called orion5x_wdt.
242 242
243# ARM26 Architecture
244
245# AVR32 Architecture 243# AVR32 Architecture
246 244
247config AT32AP700X_WDT 245config AT32AP700X_WDT
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 806b3eb08536..7f8c56b14f58 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -42,8 +42,6 @@ obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
42obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o 42obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
43obj-$(CONFIG_ORION5X_WATCHDOG) += orion5x_wdt.o 43obj-$(CONFIG_ORION5X_WATCHDOG) += orion5x_wdt.o
44 44
45# ARM26 Architecture
46
47# AVR32 Architecture 45# AVR32 Architecture
48obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o 46obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
49 47
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c
index e35d54589232..29e52c237a3b 100644
--- a/drivers/watchdog/at91rm9200_wdt.c
+++ b/drivers/watchdog/at91rm9200_wdt.c
@@ -197,7 +197,7 @@ static struct miscdevice at91wdt_miscdev = {
197 .fops = &at91wdt_fops, 197 .fops = &at91wdt_fops,
198}; 198};
199 199
200static int __init at91wdt_probe(struct platform_device *pdev) 200static int __devinit at91wdt_probe(struct platform_device *pdev)
201{ 201{
202 int res; 202 int res;
203 203
@@ -214,7 +214,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
214 return 0; 214 return 0;
215} 215}
216 216
217static int __exit at91wdt_remove(struct platform_device *pdev) 217static int __devexit at91wdt_remove(struct platform_device *pdev)
218{ 218{
219 int res; 219 int res;
220 220
@@ -252,7 +252,7 @@ static int at91wdt_resume(struct platform_device *pdev)
252 252
253static struct platform_driver at91wdt_driver = { 253static struct platform_driver at91wdt_driver = {
254 .probe = at91wdt_probe, 254 .probe = at91wdt_probe,
255 .remove = __exit_p(at91wdt_remove), 255 .remove = __devexit_p(at91wdt_remove),
256 .shutdown = at91wdt_shutdown, 256 .shutdown = at91wdt_shutdown,
257 .suspend = at91wdt_suspend, 257 .suspend = at91wdt_suspend,
258 .resume = at91wdt_resume, 258 .resume = at91wdt_resume,
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c
index 2dbe83570d65..7ba0b11ec525 100644
--- a/drivers/watchdog/i6300esb.c
+++ b/drivers/watchdog/i6300esb.c
@@ -52,10 +52,10 @@
52#define ESB_LOCK_REG 0x68 /* WDT lock register */ 52#define ESB_LOCK_REG 0x68 /* WDT lock register */
53 53
54/* Memory mapped registers */ 54/* Memory mapped registers */
55#define ESB_TIMER1_REG BASEADDR + 0x00 /* Timer1 value after each reset */ 55#define ESB_TIMER1_REG (BASEADDR + 0x00)/* Timer1 value after each reset */
56#define ESB_TIMER2_REG BASEADDR + 0x04 /* Timer2 value after each reset */ 56#define ESB_TIMER2_REG (BASEADDR + 0x04)/* Timer2 value after each reset */
57#define ESB_GINTSR_REG BASEADDR + 0x08 /* General Interrupt Status Register */ 57#define ESB_GINTSR_REG (BASEADDR + 0x08)/* General Interrupt Status Register */
58#define ESB_RELOAD_REG BASEADDR + 0x0c /* Reload register */ 58#define ESB_RELOAD_REG (BASEADDR + 0x0c)/* Reload register */
59 59
60/* Lock register bits */ 60/* Lock register bits */
61#define ESB_WDT_FUNC (0x01 << 2) /* Watchdog functionality */ 61#define ESB_WDT_FUNC (0x01 << 2) /* Watchdog functionality */
@@ -68,6 +68,7 @@
68#define ESB_WDT_INTTYPE (0x11 << 0) /* Interrupt type on timer1 timeout */ 68#define ESB_WDT_INTTYPE (0x11 << 0) /* Interrupt type on timer1 timeout */
69 69
70/* Reload register bits */ 70/* Reload register bits */
71#define ESB_WDT_TIMEOUT (0x01 << 9) /* Watchdog timed out */
71#define ESB_WDT_RELOAD (0x01 << 8) /* prevent timeout */ 72#define ESB_WDT_RELOAD (0x01 << 8) /* prevent timeout */
72 73
73/* Magic constants */ 74/* Magic constants */
@@ -87,7 +88,6 @@ static struct platform_device *esb_platform_device;
87/* 30 sec default heartbeat (1 < heartbeat < 2*1023) */ 88/* 30 sec default heartbeat (1 < heartbeat < 2*1023) */
88#define WATCHDOG_HEARTBEAT 30 89#define WATCHDOG_HEARTBEAT 30
89static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ 90static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */
90
91module_param(heartbeat, int, 0); 91module_param(heartbeat, int, 0);
92MODULE_PARM_DESC(heartbeat, 92MODULE_PARM_DESC(heartbeat,
93 "Watchdog heartbeat in seconds. (1<heartbeat<2046, default=" 93 "Watchdog heartbeat in seconds. (1<heartbeat<2046, default="
@@ -123,7 +123,7 @@ static int esb_timer_start(void)
123 esb_unlock_registers(); 123 esb_unlock_registers();
124 writew(ESB_WDT_RELOAD, ESB_RELOAD_REG); 124 writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
125 /* Enable or Enable + Lock? */ 125 /* Enable or Enable + Lock? */
126 val = 0x02 | (nowayout ? 0x01 : 0x00); 126 val = ESB_WDT_ENABLE | (nowayout ? ESB_WDT_LOCK : 0x00);
127 pci_write_config_byte(esb_pci, ESB_LOCK_REG, val); 127 pci_write_config_byte(esb_pci, ESB_LOCK_REG, val);
128 spin_unlock(&esb_lock); 128 spin_unlock(&esb_lock);
129 return 0; 129 return 0;
@@ -143,7 +143,7 @@ static int esb_timer_stop(void)
143 spin_unlock(&esb_lock); 143 spin_unlock(&esb_lock);
144 144
145 /* Returns 0 if the timer was disabled, non-zero otherwise */ 145 /* Returns 0 if the timer was disabled, non-zero otherwise */
146 return (val & 0x01); 146 return val & ESB_WDT_ENABLE;
147} 147}
148 148
149static void esb_timer_keepalive(void) 149static void esb_timer_keepalive(void)
@@ -190,18 +190,6 @@ static int esb_timer_set_heartbeat(int time)
190 return 0; 190 return 0;
191} 191}
192 192
193static int esb_timer_read(void)
194{
195 u32 count;
196
197 /* This isn't documented, and doesn't take into
198 * acount which stage is running, but it looks
199 * like a 20 bit count down, so we might as well report it.
200 */
201 pci_read_config_dword(esb_pci, 0x64, &count);
202 return (int)count;
203}
204
205/* 193/*
206 * /dev/watchdog handling 194 * /dev/watchdog handling
207 */ 195 */
@@ -282,7 +270,7 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
282 sizeof(ident)) ? -EFAULT : 0; 270 sizeof(ident)) ? -EFAULT : 0;
283 271
284 case WDIOC_GETSTATUS: 272 case WDIOC_GETSTATUS:
285 return put_user(esb_timer_read(), p); 273 return put_user(0, p);
286 274
287 case WDIOC_GETBOOTSTATUS: 275 case WDIOC_GETBOOTSTATUS:
288 return put_user(triggered, p); 276 return put_user(triggered, p);
@@ -362,8 +350,6 @@ MODULE_DEVICE_TABLE(pci, esb_pci_tbl);
362 350
363static unsigned char __devinit esb_getdevice(void) 351static unsigned char __devinit esb_getdevice(void)
364{ 352{
365 u8 val1;
366 unsigned short val2;
367 /* 353 /*
368 * Find the PCI device 354 * Find the PCI device
369 */ 355 */
@@ -371,66 +357,79 @@ static unsigned char __devinit esb_getdevice(void)
371 esb_pci = pci_get_device(PCI_VENDOR_ID_INTEL, 357 esb_pci = pci_get_device(PCI_VENDOR_ID_INTEL,
372 PCI_DEVICE_ID_INTEL_ESB_9, NULL); 358 PCI_DEVICE_ID_INTEL_ESB_9, NULL);
373 359
374 if (esb_pci) { 360 if (!esb_pci)
375 if (pci_enable_device(esb_pci)) { 361 return 0;
376 printk(KERN_ERR PFX "failed to enable device\n");
377 goto err_devput;
378 }
379 362
380 if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) { 363 if (pci_enable_device(esb_pci)) {
381 printk(KERN_ERR PFX "failed to request region\n"); 364 printk(KERN_ERR PFX "failed to enable device\n");
382 goto err_disable; 365 goto err_devput;
383 } 366 }
384 367
385 BASEADDR = pci_ioremap_bar(esb_pci, 0); 368 if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) {
386 if (BASEADDR == NULL) { 369 printk(KERN_ERR PFX "failed to request region\n");
387 /* Something's wrong here, BASEADDR has to be set */ 370 goto err_disable;
388 printk(KERN_ERR PFX "failed to get BASEADDR\n"); 371 }
389 goto err_release;
390 }
391 372
392 /* 373 BASEADDR = pci_ioremap_bar(esb_pci, 0);
393 * The watchdog has two timers, it can be setup so that the 374 if (BASEADDR == NULL) {
394 * expiry of timer1 results in an interrupt and the expiry of 375 /* Something's wrong here, BASEADDR has to be set */
395 * timer2 results in a reboot. We set it to not generate 376 printk(KERN_ERR PFX "failed to get BASEADDR\n");
396 * any interrupts as there is not much we can do with it 377 goto err_release;
397 * right now. 378 }
398 * 379
399 * We also enable reboots and set the timer frequency to 380 /* Done */
400 * the PCI clock divided by 2^15 (approx 1KHz). 381 return 1;
401 */
402 pci_write_config_word(esb_pci, ESB_CONFIG_REG, 0x0003);
403
404 /* Check that the WDT isn't already locked */
405 pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1);
406 if (val1 & ESB_WDT_LOCK)
407 printk(KERN_WARNING PFX "nowayout already set\n");
408
409 /* Set the timer to watchdog mode and disable it for now */
410 pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00);
411
412 /* Check if the watchdog was previously triggered */
413 esb_unlock_registers();
414 val2 = readw(ESB_RELOAD_REG);
415 triggered = (val2 & (0x01 << 9) >> 9);
416
417 /* Reset trigger flag and timers */
418 esb_unlock_registers();
419 writew((0x11 << 8), ESB_RELOAD_REG);
420
421 /* Done */
422 return 1;
423 382
424err_release: 383err_release:
425 pci_release_region(esb_pci, 0); 384 pci_release_region(esb_pci, 0);
426err_disable: 385err_disable:
427 pci_disable_device(esb_pci); 386 pci_disable_device(esb_pci);
428err_devput: 387err_devput:
429 pci_dev_put(esb_pci); 388 pci_dev_put(esb_pci);
430 }
431 return 0; 389 return 0;
432} 390}
433 391
392static void __devinit esb_initdevice(void)
393{
394 u8 val1;
395 u16 val2;
396
397 /*
398 * Config register:
399 * Bit 5 : 0 = Enable WDT_OUTPUT
400 * Bit 2 : 0 = set the timer frequency to the PCI clock
401 * divided by 2^15 (approx 1KHz).
402 * Bits 1:0 : 11 = WDT_INT_TYPE Disabled.
403 * The watchdog has two timers, it can be setup so that the
404 * expiry of timer1 results in an interrupt and the expiry of
405 * timer2 results in a reboot. We set it to not generate
406 * any interrupts as there is not much we can do with it
407 * right now.
408 */
409 pci_write_config_word(esb_pci, ESB_CONFIG_REG, 0x0003);
410
411 /* Check that the WDT isn't already locked */
412 pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1);
413 if (val1 & ESB_WDT_LOCK)
414 printk(KERN_WARNING PFX "nowayout already set\n");
415
416 /* Set the timer to watchdog mode and disable it for now */
417 pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00);
418
419 /* Check if the watchdog was previously triggered */
420 esb_unlock_registers();
421 val2 = readw(ESB_RELOAD_REG);
422 if (val2 & ESB_WDT_TIMEOUT)
423 triggered = WDIOF_CARDRESET;
424
425 /* Reset WDT_TIMEOUT flag and timers */
426 esb_unlock_registers();
427 writew((ESB_WDT_TIMEOUT | ESB_WDT_RELOAD), ESB_RELOAD_REG);
428
429 /* And set the correct timeout value */
430 esb_timer_set_heartbeat(heartbeat);
431}
432
434static int __devinit esb_probe(struct platform_device *dev) 433static int __devinit esb_probe(struct platform_device *dev)
435{ 434{
436 int ret; 435 int ret;
@@ -441,13 +440,17 @@ static int __devinit esb_probe(struct platform_device *dev)
441 440
442 /* Check that the heartbeat value is within it's range; 441 /* Check that the heartbeat value is within it's range;
443 if not reset to the default */ 442 if not reset to the default */
444 if (esb_timer_set_heartbeat(heartbeat)) { 443 if (heartbeat < 0x1 || heartbeat > 2 * 0x03ff) {
445 esb_timer_set_heartbeat(WATCHDOG_HEARTBEAT); 444 heartbeat = WATCHDOG_HEARTBEAT;
446 printk(KERN_INFO PFX 445 printk(KERN_INFO PFX
447 "heartbeat value must be 1<heartbeat<2046, using %d\n", 446 "heartbeat value must be 1<heartbeat<2046, using %d\n",
448 heartbeat); 447 heartbeat);
449 } 448 }
450 449
450 /* Initialize the watchdog and make sure it does not run */
451 esb_initdevice();
452
453 /* Register the watchdog so that userspace has access to it */
451 ret = misc_register(&esb_miscdev); 454 ret = misc_register(&esb_miscdev);
452 if (ret != 0) { 455 if (ret != 0) {
453 printk(KERN_ERR PFX 456 printk(KERN_ERR PFX
@@ -455,7 +458,6 @@ static int __devinit esb_probe(struct platform_device *dev)
455 WATCHDOG_MINOR, ret); 458 WATCHDOG_MINOR, ret);
456 goto err_unmap; 459 goto err_unmap;
457 } 460 }
458 esb_timer_stop();
459 printk(KERN_INFO PFX 461 printk(KERN_INFO PFX
460 "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", 462 "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n",
461 BASEADDR, heartbeat, nowayout); 463 BASEADDR, heartbeat, nowayout);
@@ -463,11 +465,8 @@ static int __devinit esb_probe(struct platform_device *dev)
463 465
464err_unmap: 466err_unmap:
465 iounmap(BASEADDR); 467 iounmap(BASEADDR);
466/* err_release: */
467 pci_release_region(esb_pci, 0); 468 pci_release_region(esb_pci, 0);
468/* err_disable: */
469 pci_disable_device(esb_pci); 469 pci_disable_device(esb_pci);
470/* err_devput: */
471 pci_dev_put(esb_pci); 470 pci_dev_put(esb_pci);
472 return ret; 471 return ret;
473} 472}
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
index 74c92d384112..ae3832110acb 100644
--- a/drivers/watchdog/ks8695_wdt.c
+++ b/drivers/watchdog/ks8695_wdt.c
@@ -221,7 +221,7 @@ static struct miscdevice ks8695wdt_miscdev = {
221 .fops = &ks8695wdt_fops, 221 .fops = &ks8695wdt_fops,
222}; 222};
223 223
224static int __init ks8695wdt_probe(struct platform_device *pdev) 224static int __devinit ks8695wdt_probe(struct platform_device *pdev)
225{ 225{
226 int res; 226 int res;
227 227
@@ -238,7 +238,7 @@ static int __init ks8695wdt_probe(struct platform_device *pdev)
238 return 0; 238 return 0;
239} 239}
240 240
241static int __exit ks8695wdt_remove(struct platform_device *pdev) 241static int __devexit ks8695wdt_remove(struct platform_device *pdev)
242{ 242{
243 int res; 243 int res;
244 244
@@ -276,7 +276,7 @@ static int ks8695wdt_resume(struct platform_device *pdev)
276 276
277static struct platform_driver ks8695wdt_driver = { 277static struct platform_driver ks8695wdt_driver = {
278 .probe = ks8695wdt_probe, 278 .probe = ks8695wdt_probe,
279 .remove = __exit_p(ks8695wdt_remove), 279 .remove = __devexit_p(ks8695wdt_remove),
280 .shutdown = ks8695wdt_shutdown, 280 .shutdown = ks8695wdt_shutdown,
281 .suspend = ks8695wdt_suspend, 281 .suspend = ks8695wdt_suspend,
282 .resume = ks8695wdt_resume, 282 .resume = ks8695wdt_resume,
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index aa5ad6e33f02..f2713851aaab 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -258,7 +258,7 @@ static const struct file_operations omap_wdt_fops = {
258 .release = omap_wdt_release, 258 .release = omap_wdt_release,
259}; 259};
260 260
261static int __init omap_wdt_probe(struct platform_device *pdev) 261static int __devinit omap_wdt_probe(struct platform_device *pdev)
262{ 262{
263 struct resource *res, *mem; 263 struct resource *res, *mem;
264 struct omap_wdt_dev *wdev; 264 struct omap_wdt_dev *wdev;
@@ -367,7 +367,7 @@ static void omap_wdt_shutdown(struct platform_device *pdev)
367 omap_wdt_disable(wdev); 367 omap_wdt_disable(wdev);
368} 368}
369 369
370static int omap_wdt_remove(struct platform_device *pdev) 370static int __devexit omap_wdt_remove(struct platform_device *pdev)
371{ 371{
372 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); 372 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
373 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 373 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -426,7 +426,7 @@ static int omap_wdt_resume(struct platform_device *pdev)
426 426
427static struct platform_driver omap_wdt_driver = { 427static struct platform_driver omap_wdt_driver = {
428 .probe = omap_wdt_probe, 428 .probe = omap_wdt_probe,
429 .remove = omap_wdt_remove, 429 .remove = __devexit_p(omap_wdt_remove),
430 .shutdown = omap_wdt_shutdown, 430 .shutdown = omap_wdt_shutdown,
431 .suspend = omap_wdt_suspend, 431 .suspend = omap_wdt_suspend,
432 .resume = omap_wdt_resume, 432 .resume = omap_wdt_resume,
diff --git a/drivers/watchdog/orion5x_wdt.c b/drivers/watchdog/orion5x_wdt.c
index e81441f103dd..7529616739d2 100644
--- a/drivers/watchdog/orion5x_wdt.c
+++ b/drivers/watchdog/orion5x_wdt.c
@@ -42,7 +42,17 @@ static unsigned int wdt_tclk;
42static unsigned long wdt_status; 42static unsigned long wdt_status;
43static spinlock_t wdt_lock; 43static spinlock_t wdt_lock;
44 44
45static void wdt_enable(void) 45static void orion5x_wdt_ping(void)
46{
47 spin_lock(&wdt_lock);
48
49 /* Reload watchdog duration */
50 writel(wdt_tclk * heartbeat, WDT_VAL);
51
52 spin_unlock(&wdt_lock);
53}
54
55static void orion5x_wdt_enable(void)
46{ 56{
47 u32 reg; 57 u32 reg;
48 58
@@ -69,7 +79,7 @@ static void wdt_enable(void)
69 spin_unlock(&wdt_lock); 79 spin_unlock(&wdt_lock);
70} 80}
71 81
72static void wdt_disable(void) 82static void orion5x_wdt_disable(void)
73{ 83{
74 u32 reg; 84 u32 reg;
75 85
@@ -101,7 +111,7 @@ static int orion5x_wdt_open(struct inode *inode, struct file *file)
101 if (test_and_set_bit(WDT_IN_USE, &wdt_status)) 111 if (test_and_set_bit(WDT_IN_USE, &wdt_status))
102 return -EBUSY; 112 return -EBUSY;
103 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 113 clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
104 wdt_enable(); 114 orion5x_wdt_enable();
105 return nonseekable_open(inode, file); 115 return nonseekable_open(inode, file);
106} 116}
107 117
@@ -122,18 +132,28 @@ static ssize_t orion5x_wdt_write(struct file *file, const char *data,
122 set_bit(WDT_OK_TO_CLOSE, &wdt_status); 132 set_bit(WDT_OK_TO_CLOSE, &wdt_status);
123 } 133 }
124 } 134 }
125 wdt_enable(); 135 orion5x_wdt_ping();
126 } 136 }
127 return len; 137 return len;
128} 138}
129 139
130static struct watchdog_info ident = { 140static int orion5x_wdt_settimeout(int new_time)
141{
142 if ((new_time <= 0) || (new_time > wdt_max_duration))
143 return -EINVAL;
144
145 /* Set new watchdog time to be used when
146 * orion5x_wdt_enable() or orion5x_wdt_ping() is called. */
147 heartbeat = new_time;
148 return 0;
149}
150
151static const struct watchdog_info ident = {
131 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT | 152 .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT |
132 WDIOF_KEEPALIVEPING, 153 WDIOF_KEEPALIVEPING,
133 .identity = "Orion5x Watchdog", 154 .identity = "Orion5x Watchdog",
134}; 155};
135 156
136
137static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd, 157static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
138 unsigned long arg) 158 unsigned long arg)
139{ 159{
@@ -152,7 +172,7 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
152 break; 172 break;
153 173
154 case WDIOC_KEEPALIVE: 174 case WDIOC_KEEPALIVE:
155 wdt_enable(); 175 orion5x_wdt_ping();
156 ret = 0; 176 ret = 0;
157 break; 177 break;
158 178
@@ -161,12 +181,11 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
161 if (ret) 181 if (ret)
162 break; 182 break;
163 183
164 if (time <= 0 || time > wdt_max_duration) { 184 if (orion5x_wdt_settimeout(time)) {
165 ret = -EINVAL; 185 ret = -EINVAL;
166 break; 186 break;
167 } 187 }
168 heartbeat = time; 188 orion5x_wdt_ping();
169 wdt_enable();
170 /* Fall through */ 189 /* Fall through */
171 190
172 case WDIOC_GETTIMEOUT: 191 case WDIOC_GETTIMEOUT:
@@ -187,7 +206,7 @@ static long orion5x_wdt_ioctl(struct file *file, unsigned int cmd,
187static int orion5x_wdt_release(struct inode *inode, struct file *file) 206static int orion5x_wdt_release(struct inode *inode, struct file *file)
188{ 207{
189 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 208 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
190 wdt_disable(); 209 orion5x_wdt_disable();
191 else 210 else
192 printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 211 printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
193 "timer will not stop\n"); 212 "timer will not stop\n");
@@ -230,7 +249,7 @@ static int __devinit orion5x_wdt_probe(struct platform_device *pdev)
230 orion5x_wdt_miscdev.parent = &pdev->dev; 249 orion5x_wdt_miscdev.parent = &pdev->dev;
231 250
232 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk; 251 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
233 if (heartbeat <= 0 || heartbeat > wdt_max_duration) 252 if (orion5x_wdt_settimeout(heartbeat))
234 heartbeat = wdt_max_duration; 253 heartbeat = wdt_max_duration;
235 254
236 ret = misc_register(&orion5x_wdt_miscdev); 255 ret = misc_register(&orion5x_wdt_miscdev);
@@ -247,7 +266,7 @@ static int __devexit orion5x_wdt_remove(struct platform_device *pdev)
247 int ret; 266 int ret;
248 267
249 if (test_bit(WDT_IN_USE, &wdt_status)) { 268 if (test_bit(WDT_IN_USE, &wdt_status)) {
250 wdt_disable(); 269 orion5x_wdt_disable();
251 clear_bit(WDT_IN_USE, &wdt_status); 270 clear_bit(WDT_IN_USE, &wdt_status);
252 } 271 }
253 272
@@ -258,9 +277,16 @@ static int __devexit orion5x_wdt_remove(struct platform_device *pdev)
258 return ret; 277 return ret;
259} 278}
260 279
280static void orion5x_wdt_shutdown(struct platform_device *pdev)
281{
282 if (test_bit(WDT_IN_USE, &wdt_status))
283 orion5x_wdt_disable();
284}
285
261static struct platform_driver orion5x_wdt_driver = { 286static struct platform_driver orion5x_wdt_driver = {
262 .probe = orion5x_wdt_probe, 287 .probe = orion5x_wdt_probe,
263 .remove = __devexit_p(orion5x_wdt_remove), 288 .remove = __devexit_p(orion5x_wdt_remove),
289 .shutdown = orion5x_wdt_shutdown,
264 .driver = { 290 .driver = {
265 .owner = THIS_MODULE, 291 .owner = THIS_MODULE,
266 .name = "orion5x_wdt", 292 .name = "orion5x_wdt",
@@ -285,10 +311,11 @@ MODULE_AUTHOR("Sylver Bruneau <sylver.bruneau@googlemail.com>");
285MODULE_DESCRIPTION("Orion5x Processor Watchdog"); 311MODULE_DESCRIPTION("Orion5x Processor Watchdog");
286 312
287module_param(heartbeat, int, 0); 313module_param(heartbeat, int, 0);
288MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds"); 314MODULE_PARM_DESC(heartbeat, "Initial watchdog heartbeat in seconds");
289 315
290module_param(nowayout, int, 0); 316module_param(nowayout, int, 0);
291MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); 317MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
318 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
292 319
293MODULE_LICENSE("GPL"); 320MODULE_LICENSE("GPL");
294MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 321MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
index 5f54c01c1568..bdfd584ad853 100644
--- a/drivers/xen/cpu_hotplug.c
+++ b/drivers/xen/cpu_hotplug.c
@@ -21,29 +21,41 @@ static void disable_hotplug_cpu(int cpu)
21 set_cpu_present(cpu, false); 21 set_cpu_present(cpu, false);
22} 22}
23 23
24static void vcpu_hotplug(unsigned int cpu) 24static int vcpu_online(unsigned int cpu)
25{ 25{
26 int err; 26 int err;
27 char dir[32], state[32]; 27 char dir[32], state[32];
28 28
29 if (!cpu_possible(cpu))
30 return;
31
32 sprintf(dir, "cpu/%u", cpu); 29 sprintf(dir, "cpu/%u", cpu);
33 err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state); 30 err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
34 if (err != 1) { 31 if (err != 1) {
35 printk(KERN_ERR "XENBUS: Unable to read cpu state\n"); 32 printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
36 return; 33 return err;
37 } 34 }
38 35
39 if (strcmp(state, "online") == 0) { 36 if (strcmp(state, "online") == 0)
37 return 1;
38 else if (strcmp(state, "offline") == 0)
39 return 0;
40
41 printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n", state, cpu);
42 return -EINVAL;
43}
44static void vcpu_hotplug(unsigned int cpu)
45{
46 if (!cpu_possible(cpu))
47 return;
48
49 switch (vcpu_online(cpu)) {
50 case 1:
40 enable_hotplug_cpu(cpu); 51 enable_hotplug_cpu(cpu);
41 } else if (strcmp(state, "offline") == 0) { 52 break;
53 case 0:
42 (void)cpu_down(cpu); 54 (void)cpu_down(cpu);
43 disable_hotplug_cpu(cpu); 55 disable_hotplug_cpu(cpu);
44 } else { 56 break;
45 printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n", 57 default:
46 state, cpu); 58 break;
47 } 59 }
48} 60}
49 61
@@ -64,12 +76,20 @@ static void handle_vcpu_hotplug_event(struct xenbus_watch *watch,
64static int setup_cpu_watcher(struct notifier_block *notifier, 76static int setup_cpu_watcher(struct notifier_block *notifier,
65 unsigned long event, void *data) 77 unsigned long event, void *data)
66{ 78{
79 int cpu;
67 static struct xenbus_watch cpu_watch = { 80 static struct xenbus_watch cpu_watch = {
68 .node = "cpu", 81 .node = "cpu",
69 .callback = handle_vcpu_hotplug_event}; 82 .callback = handle_vcpu_hotplug_event};
70 83
71 (void)register_xenbus_watch(&cpu_watch); 84 (void)register_xenbus_watch(&cpu_watch);
72 85
86 for_each_possible_cpu(cpu) {
87 if (vcpu_online(cpu) == 0) {
88 (void)cpu_down(cpu);
89 cpu_clear(cpu, cpu_present_map);
90 }
91 }
92
73 return NOTIFY_DONE; 93 return NOTIFY_DONE;
74} 94}
75 95
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 0d61db1e7b49..4b5b84837ee1 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -62,14 +62,15 @@ static int xen_suspend(void *data)
62 gnttab_resume(); 62 gnttab_resume();
63 xen_mm_unpin_all(); 63 xen_mm_unpin_all();
64 64
65 sysdev_resume();
66
67 if (!*cancelled) { 65 if (!*cancelled) {
68 xen_irq_resume(); 66 xen_irq_resume();
69 xen_console_resume(); 67 xen_console_resume();
70 xen_timer_resume(); 68 xen_timer_resume();
71 } 69 }
72 70
71 sysdev_resume();
72 device_power_up(PMSG_RESUME);
73
73 return 0; 74 return 0;
74} 75}
75 76
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index b43b95563663..acf678831103 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -590,9 +590,8 @@ static int ext2_get_blocks(struct inode *inode,
590 590
591 if (depth == 0) 591 if (depth == 0)
592 return (err); 592 return (err);
593reread:
594 partial = ext2_get_branch(inode, depth, offsets, chain, &err);
595 593
594 partial = ext2_get_branch(inode, depth, offsets, chain, &err);
596 /* Simplest case - block found, no allocation needed */ 595 /* Simplest case - block found, no allocation needed */
597 if (!partial) { 596 if (!partial) {
598 first_block = le32_to_cpu(chain[depth - 1].key); 597 first_block = le32_to_cpu(chain[depth - 1].key);
@@ -602,15 +601,16 @@ reread:
602 while (count < maxblocks && count <= blocks_to_boundary) { 601 while (count < maxblocks && count <= blocks_to_boundary) {
603 ext2_fsblk_t blk; 602 ext2_fsblk_t blk;
604 603
605 if (!verify_chain(chain, partial)) { 604 if (!verify_chain(chain, chain + depth - 1)) {
606 /* 605 /*
607 * Indirect block might be removed by 606 * Indirect block might be removed by
608 * truncate while we were reading it. 607 * truncate while we were reading it.
609 * Handling of that case: forget what we've 608 * Handling of that case: forget what we've
610 * got now, go to reread. 609 * got now, go to reread.
611 */ 610 */
611 err = -EAGAIN;
612 count = 0; 612 count = 0;
613 goto changed; 613 break;
614 } 614 }
615 blk = le32_to_cpu(*(chain[depth-1].p + count)); 615 blk = le32_to_cpu(*(chain[depth-1].p + count));
616 if (blk == first_block + count) 616 if (blk == first_block + count)
@@ -618,7 +618,8 @@ reread:
618 else 618 else
619 break; 619 break;
620 } 620 }
621 goto got_it; 621 if (err != -EAGAIN)
622 goto got_it;
622 } 623 }
623 624
624 /* Next simple case - plain lookup or failed read of indirect block */ 625 /* Next simple case - plain lookup or failed read of indirect block */
@@ -626,6 +627,33 @@ reread:
626 goto cleanup; 627 goto cleanup;
627 628
628 mutex_lock(&ei->truncate_mutex); 629 mutex_lock(&ei->truncate_mutex);
630 /*
631 * If the indirect block is missing while we are reading
632 * the chain(ext3_get_branch() returns -EAGAIN err), or
633 * if the chain has been changed after we grab the semaphore,
634 * (either because another process truncated this branch, or
635 * another get_block allocated this branch) re-grab the chain to see if
636 * the request block has been allocated or not.
637 *
638 * Since we already block the truncate/other get_block
639 * at this point, we will have the current copy of the chain when we
640 * splice the branch into the tree.
641 */
642 if (err == -EAGAIN || !verify_chain(chain, partial)) {
643 while (partial > chain) {
644 brelse(partial->bh);
645 partial--;
646 }
647 partial = ext2_get_branch(inode, depth, offsets, chain, &err);
648 if (!partial) {
649 count++;
650 mutex_unlock(&ei->truncate_mutex);
651 if (err)
652 goto cleanup;
653 clear_buffer_new(bh_result);
654 goto got_it;
655 }
656 }
629 657
630 /* 658 /*
631 * Okay, we need to do block allocation. Lazily initialize the block 659 * Okay, we need to do block allocation. Lazily initialize the block
@@ -683,12 +711,6 @@ cleanup:
683 partial--; 711 partial--;
684 } 712 }
685 return err; 713 return err;
686changed:
687 while (partial > chain) {
688 brelse(partial->bh);
689 partial--;
690 }
691 goto reread;
692} 714}
693 715
694int ext2_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create) 716int ext2_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create)
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 9435dda8f1e0..a1cbff2b4d99 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -70,6 +70,10 @@ static int hfs_releasepage(struct page *page, gfp_t mask)
70 BUG(); 70 BUG();
71 return 0; 71 return 0;
72 } 72 }
73
74 if (!tree)
75 return 0;
76
73 if (tree->node_size >= PAGE_CACHE_SIZE) { 77 if (tree->node_size >= PAGE_CACHE_SIZE) {
74 nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT); 78 nidx = page->index >> (tree->node_size_shift - PAGE_CACHE_SHIFT);
75 spin_lock(&tree->hash_lock); 79 spin_lock(&tree->hash_lock);
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index 36ca2e1a4fa3..7b6165f25fbe 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -349,6 +349,7 @@ void hfs_mdb_put(struct super_block *sb)
349 if (HFS_SB(sb)->nls_disk) 349 if (HFS_SB(sb)->nls_disk)
350 unload_nls(HFS_SB(sb)->nls_disk); 350 unload_nls(HFS_SB(sb)->nls_disk);
351 351
352 free_pages((unsigned long)HFS_SB(sb)->bitmap, PAGE_SIZE < 8192 ? 1 : 0);
352 kfree(HFS_SB(sb)); 353 kfree(HFS_SB(sb));
353 sb->s_fs_info = NULL; 354 sb->s_fs_info = NULL;
354} 355}
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index c7bd649bbbdc..3e9afc2a91d2 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -55,6 +55,25 @@
55 * need do nothing. 55 * need do nothing.
56 * RevokeValid set, Revoked set: 56 * RevokeValid set, Revoked set:
57 * buffer has been revoked. 57 * buffer has been revoked.
58 *
59 * Locking rules:
60 * We keep two hash tables of revoke records. One hashtable belongs to the
61 * running transaction (is pointed to by journal->j_revoke), the other one
62 * belongs to the committing transaction. Accesses to the second hash table
63 * happen only from the kjournald and no other thread touches this table. Also
64 * journal_switch_revoke_table() which switches which hashtable belongs to the
65 * running and which to the committing transaction is called only from
66 * kjournald. Therefore we need no locks when accessing the hashtable belonging
67 * to the committing transaction.
68 *
69 * All users operating on the hash table belonging to the running transaction
70 * have a handle to the transaction. Therefore they are safe from kjournald
71 * switching hash tables under them. For operations on the lists of entries in
72 * the hash table j_revoke_lock is used.
73 *
74 * Finally, also replay code uses the hash tables but at this moment noone else
75 * can touch them (filesystem isn't mounted yet) and hence no locking is
76 * needed.
58 */ 77 */
59 78
60#ifndef __KERNEL__ 79#ifndef __KERNEL__
@@ -402,8 +421,6 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
402 * the second time we would still have a pending revoke to cancel. So, 421 * the second time we would still have a pending revoke to cancel. So,
403 * do not trust the Revoked bit on buffers unless RevokeValid is also 422 * do not trust the Revoked bit on buffers unless RevokeValid is also
404 * set. 423 * set.
405 *
406 * The caller must have the journal locked.
407 */ 424 */
408int journal_cancel_revoke(handle_t *handle, struct journal_head *jh) 425int journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
409{ 426{
@@ -481,10 +498,7 @@ void journal_switch_revoke_table(journal_t *journal)
481/* 498/*
482 * Write revoke records to the journal for all entries in the current 499 * Write revoke records to the journal for all entries in the current
483 * revoke hash, deleting the entries as we go. 500 * revoke hash, deleting the entries as we go.
484 *
485 * Called with the journal lock held.
486 */ 501 */
487
488void journal_write_revoke_records(journal_t *journal, 502void journal_write_revoke_records(journal_t *journal,
489 transaction_t *transaction) 503 transaction_t *transaction)
490{ 504{
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index c13f67300fe7..7ec89fc05b2b 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -153,23 +153,6 @@ xfs_find_bdev_for_inode(
153} 153}
154 154
155/* 155/*
156 * Schedule IO completion handling on a xfsdatad if this was
157 * the final hold on this ioend. If we are asked to wait,
158 * flush the workqueue.
159 */
160STATIC void
161xfs_finish_ioend(
162 xfs_ioend_t *ioend,
163 int wait)
164{
165 if (atomic_dec_and_test(&ioend->io_remaining)) {
166 queue_work(xfsdatad_workqueue, &ioend->io_work);
167 if (wait)
168 flush_workqueue(xfsdatad_workqueue);
169 }
170}
171
172/*
173 * We're now finished for good with this ioend structure. 156 * We're now finished for good with this ioend structure.
174 * Update the page state via the associated buffer_heads, 157 * Update the page state via the associated buffer_heads,
175 * release holds on the inode and bio, and finally free 158 * release holds on the inode and bio, and finally free
@@ -310,6 +293,27 @@ xfs_end_bio_read(
310} 293}
311 294
312/* 295/*
296 * Schedule IO completion handling on a xfsdatad if this was
297 * the final hold on this ioend. If we are asked to wait,
298 * flush the workqueue.
299 */
300STATIC void
301xfs_finish_ioend(
302 xfs_ioend_t *ioend,
303 int wait)
304{
305 if (atomic_dec_and_test(&ioend->io_remaining)) {
306 struct workqueue_struct *wq = xfsdatad_workqueue;
307 if (ioend->io_work.func == xfs_end_bio_unwritten)
308 wq = xfsconvertd_workqueue;
309
310 queue_work(wq, &ioend->io_work);
311 if (wait)
312 flush_workqueue(wq);
313 }
314}
315
316/*
313 * Allocate and initialise an IO completion structure. 317 * Allocate and initialise an IO completion structure.
314 * We need to track unwritten extent write completion here initially. 318 * We need to track unwritten extent write completion here initially.
315 * We'll need to extend this for updating the ondisk inode size later 319 * We'll need to extend this for updating the ondisk inode size later
diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/linux-2.6/xfs_aops.h
index 1dd528849755..221b3e66ceef 100644
--- a/fs/xfs/linux-2.6/xfs_aops.h
+++ b/fs/xfs/linux-2.6/xfs_aops.h
@@ -19,6 +19,7 @@
19#define __XFS_AOPS_H__ 19#define __XFS_AOPS_H__
20 20
21extern struct workqueue_struct *xfsdatad_workqueue; 21extern struct workqueue_struct *xfsdatad_workqueue;
22extern struct workqueue_struct *xfsconvertd_workqueue;
22extern mempool_t *xfs_ioend_pool; 23extern mempool_t *xfs_ioend_pool;
23 24
24/* 25/*
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index aa1016bb9134..e28800a9f2b5 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -51,6 +51,7 @@ static struct shrinker xfs_buf_shake = {
51 51
52static struct workqueue_struct *xfslogd_workqueue; 52static struct workqueue_struct *xfslogd_workqueue;
53struct workqueue_struct *xfsdatad_workqueue; 53struct workqueue_struct *xfsdatad_workqueue;
54struct workqueue_struct *xfsconvertd_workqueue;
54 55
55#ifdef XFS_BUF_TRACE 56#ifdef XFS_BUF_TRACE
56void 57void
@@ -1775,6 +1776,7 @@ xfs_flush_buftarg(
1775 xfs_buf_t *bp, *n; 1776 xfs_buf_t *bp, *n;
1776 int pincount = 0; 1777 int pincount = 0;
1777 1778
1779 xfs_buf_runall_queues(xfsconvertd_workqueue);
1778 xfs_buf_runall_queues(xfsdatad_workqueue); 1780 xfs_buf_runall_queues(xfsdatad_workqueue);
1779 xfs_buf_runall_queues(xfslogd_workqueue); 1781 xfs_buf_runall_queues(xfslogd_workqueue);
1780 1782
@@ -1831,9 +1833,15 @@ xfs_buf_init(void)
1831 if (!xfsdatad_workqueue) 1833 if (!xfsdatad_workqueue)
1832 goto out_destroy_xfslogd_workqueue; 1834 goto out_destroy_xfslogd_workqueue;
1833 1835
1836 xfsconvertd_workqueue = create_workqueue("xfsconvertd");
1837 if (!xfsconvertd_workqueue)
1838 goto out_destroy_xfsdatad_workqueue;
1839
1834 register_shrinker(&xfs_buf_shake); 1840 register_shrinker(&xfs_buf_shake);
1835 return 0; 1841 return 0;
1836 1842
1843 out_destroy_xfsdatad_workqueue:
1844 destroy_workqueue(xfsdatad_workqueue);
1837 out_destroy_xfslogd_workqueue: 1845 out_destroy_xfslogd_workqueue:
1838 destroy_workqueue(xfslogd_workqueue); 1846 destroy_workqueue(xfslogd_workqueue);
1839 out_free_buf_zone: 1847 out_free_buf_zone:
@@ -1849,6 +1857,7 @@ void
1849xfs_buf_terminate(void) 1857xfs_buf_terminate(void)
1850{ 1858{
1851 unregister_shrinker(&xfs_buf_shake); 1859 unregister_shrinker(&xfs_buf_shake);
1860 destroy_workqueue(xfsconvertd_workqueue);
1852 destroy_workqueue(xfsdatad_workqueue); 1861 destroy_workqueue(xfsdatad_workqueue);
1853 destroy_workqueue(xfslogd_workqueue); 1862 destroy_workqueue(xfslogd_workqueue);
1854 kmem_zone_destroy(xfs_buf_zone); 1863 kmem_zone_destroy(xfs_buf_zone);
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c
index 5aeb77776961..08be36d7326c 100644
--- a/fs/xfs/linux-2.6/xfs_fs_subr.c
+++ b/fs/xfs/linux-2.6/xfs_fs_subr.c
@@ -74,14 +74,14 @@ xfs_flush_pages(
74 74
75 if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) { 75 if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
76 xfs_iflags_clear(ip, XFS_ITRUNCATED); 76 xfs_iflags_clear(ip, XFS_ITRUNCATED);
77 ret = filemap_fdatawrite(mapping); 77 ret = -filemap_fdatawrite(mapping);
78 if (flags & XFS_B_ASYNC)
79 return -ret;
80 ret2 = filemap_fdatawait(mapping);
81 if (!ret)
82 ret = ret2;
83 } 78 }
84 return -ret; 79 if (flags & XFS_B_ASYNC)
80 return ret;
81 ret2 = xfs_wait_on_pages(ip, first, last);
82 if (!ret)
83 ret = ret2;
84 return ret;
85} 85}
86 86
87int 87int
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 7e90daa0d1d1..9142192ccbe6 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -751,10 +751,26 @@ start:
751 goto relock; 751 goto relock;
752 } 752 }
753 } else { 753 } else {
754 int enospc = 0;
755 ssize_t ret2 = 0;
756
757write_retry:
754 xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs, 758 xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs,
755 *offset, ioflags); 759 *offset, ioflags);
756 ret = generic_file_buffered_write(iocb, iovp, segs, 760 ret2 = generic_file_buffered_write(iocb, iovp, segs,
757 pos, offset, count, ret); 761 pos, offset, count, ret);
762 /*
763 * if we just got an ENOSPC, flush the inode now we
764 * aren't holding any page locks and retry *once*
765 */
766 if (ret2 == -ENOSPC && !enospc) {
767 error = xfs_flush_pages(xip, 0, -1, 0, FI_NONE);
768 if (error)
769 goto out_unlock_internal;
770 enospc = 1;
771 goto write_retry;
772 }
773 ret = ret2;
758 } 774 }
759 775
760 current->backing_dev_info = NULL; 776 current->backing_dev_info = NULL;
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index a608e72fa405..f7ba76633c29 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -62,12 +62,6 @@ xfs_sync_inodes_ag(
62 uint32_t first_index = 0; 62 uint32_t first_index = 0;
63 int error = 0; 63 int error = 0;
64 int last_error = 0; 64 int last_error = 0;
65 int fflag = XFS_B_ASYNC;
66
67 if (flags & SYNC_DELWRI)
68 fflag = XFS_B_DELWRI;
69 if (flags & SYNC_WAIT)
70 fflag = 0; /* synchronous overrides all */
71 65
72 do { 66 do {
73 struct inode *inode; 67 struct inode *inode;
@@ -128,11 +122,23 @@ xfs_sync_inodes_ag(
128 * If we have to flush data or wait for I/O completion 122 * If we have to flush data or wait for I/O completion
129 * we need to hold the iolock. 123 * we need to hold the iolock.
130 */ 124 */
131 if ((flags & SYNC_DELWRI) && VN_DIRTY(inode)) { 125 if (flags & SYNC_DELWRI) {
132 xfs_ilock(ip, XFS_IOLOCK_SHARED); 126 if (VN_DIRTY(inode)) {
133 lock_flags |= XFS_IOLOCK_SHARED; 127 if (flags & SYNC_TRYLOCK) {
134 error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); 128 if (xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED))
135 if (flags & SYNC_IOWAIT) 129 lock_flags |= XFS_IOLOCK_SHARED;
130 } else {
131 xfs_ilock(ip, XFS_IOLOCK_SHARED);
132 lock_flags |= XFS_IOLOCK_SHARED;
133 }
134 if (lock_flags & XFS_IOLOCK_SHARED) {
135 error = xfs_flush_pages(ip, 0, -1,
136 (flags & SYNC_WAIT) ? 0
137 : XFS_B_ASYNC,
138 FI_NONE);
139 }
140 }
141 if (VN_CACHED(inode) && (flags & SYNC_IOWAIT))
136 xfs_ioend_wait(ip); 142 xfs_ioend_wait(ip);
137 } 143 }
138 xfs_ilock(ip, XFS_ILOCK_SHARED); 144 xfs_ilock(ip, XFS_ILOCK_SHARED);
@@ -398,15 +404,17 @@ STATIC void
398xfs_syncd_queue_work( 404xfs_syncd_queue_work(
399 struct xfs_mount *mp, 405 struct xfs_mount *mp,
400 void *data, 406 void *data,
401 void (*syncer)(struct xfs_mount *, void *)) 407 void (*syncer)(struct xfs_mount *, void *),
408 struct completion *completion)
402{ 409{
403 struct bhv_vfs_sync_work *work; 410 struct xfs_sync_work *work;
404 411
405 work = kmem_alloc(sizeof(struct bhv_vfs_sync_work), KM_SLEEP); 412 work = kmem_alloc(sizeof(struct xfs_sync_work), KM_SLEEP);
406 INIT_LIST_HEAD(&work->w_list); 413 INIT_LIST_HEAD(&work->w_list);
407 work->w_syncer = syncer; 414 work->w_syncer = syncer;
408 work->w_data = data; 415 work->w_data = data;
409 work->w_mount = mp; 416 work->w_mount = mp;
417 work->w_completion = completion;
410 spin_lock(&mp->m_sync_lock); 418 spin_lock(&mp->m_sync_lock);
411 list_add_tail(&work->w_list, &mp->m_sync_list); 419 list_add_tail(&work->w_list, &mp->m_sync_list);
412 spin_unlock(&mp->m_sync_lock); 420 spin_unlock(&mp->m_sync_lock);
@@ -420,49 +428,26 @@ xfs_syncd_queue_work(
420 * heads, looking about for more room... 428 * heads, looking about for more room...
421 */ 429 */
422STATIC void 430STATIC void
423xfs_flush_inode_work( 431xfs_flush_inodes_work(
424 struct xfs_mount *mp,
425 void *arg)
426{
427 struct inode *inode = arg;
428 filemap_flush(inode->i_mapping);
429 iput(inode);
430}
431
432void
433xfs_flush_inode(
434 xfs_inode_t *ip)
435{
436 struct inode *inode = VFS_I(ip);
437
438 igrab(inode);
439 xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work);
440 delay(msecs_to_jiffies(500));
441}
442
443/*
444 * This is the "bigger hammer" version of xfs_flush_inode_work...
445 * (IOW, "If at first you don't succeed, use a Bigger Hammer").
446 */
447STATIC void
448xfs_flush_device_work(
449 struct xfs_mount *mp, 432 struct xfs_mount *mp,
450 void *arg) 433 void *arg)
451{ 434{
452 struct inode *inode = arg; 435 struct inode *inode = arg;
453 sync_blockdev(mp->m_super->s_bdev); 436 xfs_sync_inodes(mp, SYNC_DELWRI | SYNC_TRYLOCK);
437 xfs_sync_inodes(mp, SYNC_DELWRI | SYNC_TRYLOCK | SYNC_IOWAIT);
454 iput(inode); 438 iput(inode);
455} 439}
456 440
457void 441void
458xfs_flush_device( 442xfs_flush_inodes(
459 xfs_inode_t *ip) 443 xfs_inode_t *ip)
460{ 444{
461 struct inode *inode = VFS_I(ip); 445 struct inode *inode = VFS_I(ip);
446 DECLARE_COMPLETION_ONSTACK(completion);
462 447
463 igrab(inode); 448 igrab(inode);
464 xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); 449 xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inodes_work, &completion);
465 delay(msecs_to_jiffies(500)); 450 wait_for_completion(&completion);
466 xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); 451 xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC);
467} 452}
468 453
@@ -497,7 +482,7 @@ xfssyncd(
497{ 482{
498 struct xfs_mount *mp = arg; 483 struct xfs_mount *mp = arg;
499 long timeleft; 484 long timeleft;
500 bhv_vfs_sync_work_t *work, *n; 485 xfs_sync_work_t *work, *n;
501 LIST_HEAD (tmp); 486 LIST_HEAD (tmp);
502 487
503 set_freezable(); 488 set_freezable();
@@ -532,6 +517,8 @@ xfssyncd(
532 list_del(&work->w_list); 517 list_del(&work->w_list);
533 if (work == &mp->m_sync_work) 518 if (work == &mp->m_sync_work)
534 continue; 519 continue;
520 if (work->w_completion)
521 complete(work->w_completion);
535 kmem_free(work); 522 kmem_free(work);
536 } 523 }
537 } 524 }
@@ -545,6 +532,7 @@ xfs_syncd_init(
545{ 532{
546 mp->m_sync_work.w_syncer = xfs_sync_worker; 533 mp->m_sync_work.w_syncer = xfs_sync_worker;
547 mp->m_sync_work.w_mount = mp; 534 mp->m_sync_work.w_mount = mp;
535 mp->m_sync_work.w_completion = NULL;
548 mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd"); 536 mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd");
549 if (IS_ERR(mp->m_sync_task)) 537 if (IS_ERR(mp->m_sync_task))
550 return -PTR_ERR(mp->m_sync_task); 538 return -PTR_ERR(mp->m_sync_task);
diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h
index 04f058c848ae..308d5bf6dfbd 100644
--- a/fs/xfs/linux-2.6/xfs_sync.h
+++ b/fs/xfs/linux-2.6/xfs_sync.h
@@ -21,18 +21,20 @@
21struct xfs_mount; 21struct xfs_mount;
22struct xfs_perag; 22struct xfs_perag;
23 23
24typedef struct bhv_vfs_sync_work { 24typedef struct xfs_sync_work {
25 struct list_head w_list; 25 struct list_head w_list;
26 struct xfs_mount *w_mount; 26 struct xfs_mount *w_mount;
27 void *w_data; /* syncer routine argument */ 27 void *w_data; /* syncer routine argument */
28 void (*w_syncer)(struct xfs_mount *, void *); 28 void (*w_syncer)(struct xfs_mount *, void *);
29} bhv_vfs_sync_work_t; 29 struct completion *w_completion;
30} xfs_sync_work_t;
30 31
31#define SYNC_ATTR 0x0001 /* sync attributes */ 32#define SYNC_ATTR 0x0001 /* sync attributes */
32#define SYNC_DELWRI 0x0002 /* look at delayed writes */ 33#define SYNC_DELWRI 0x0002 /* look at delayed writes */
33#define SYNC_WAIT 0x0004 /* wait for i/o to complete */ 34#define SYNC_WAIT 0x0004 /* wait for i/o to complete */
34#define SYNC_BDFLUSH 0x0008 /* BDFLUSH is calling -- don't block */ 35#define SYNC_BDFLUSH 0x0008 /* BDFLUSH is calling -- don't block */
35#define SYNC_IOWAIT 0x0010 /* wait for all I/O to complete */ 36#define SYNC_IOWAIT 0x0010 /* wait for all I/O to complete */
37#define SYNC_TRYLOCK 0x0020 /* only try to lock inodes */
36 38
37int xfs_syncd_init(struct xfs_mount *mp); 39int xfs_syncd_init(struct xfs_mount *mp);
38void xfs_syncd_stop(struct xfs_mount *mp); 40void xfs_syncd_stop(struct xfs_mount *mp);
@@ -43,8 +45,7 @@ int xfs_sync_fsdata(struct xfs_mount *mp, int flags);
43int xfs_quiesce_data(struct xfs_mount *mp); 45int xfs_quiesce_data(struct xfs_mount *mp);
44void xfs_quiesce_attr(struct xfs_mount *mp); 46void xfs_quiesce_attr(struct xfs_mount *mp);
45 47
46void xfs_flush_inode(struct xfs_inode *ip); 48void xfs_flush_inodes(struct xfs_inode *ip);
47void xfs_flush_device(struct xfs_inode *ip);
48 49
49int xfs_reclaim_inode(struct xfs_inode *ip, int locked, int sync_mode); 50int xfs_reclaim_inode(struct xfs_inode *ip, int locked, int sync_mode);
50int xfs_reclaim_inodes(struct xfs_mount *mp, int noblock, int mode); 51int xfs_reclaim_inodes(struct xfs_mount *mp, int noblock, int mode);
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 478e587087fe..89b81eedce6a 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -69,15 +69,6 @@ xfs_inode_alloc(
69 ASSERT(!spin_is_locked(&ip->i_flags_lock)); 69 ASSERT(!spin_is_locked(&ip->i_flags_lock));
70 ASSERT(completion_done(&ip->i_flush)); 70 ASSERT(completion_done(&ip->i_flush));
71 71
72 /*
73 * initialise the VFS inode here to get failures
74 * out of the way early.
75 */
76 if (!inode_init_always(mp->m_super, VFS_I(ip))) {
77 kmem_zone_free(xfs_inode_zone, ip);
78 return NULL;
79 }
80
81 /* initialise the xfs inode */ 72 /* initialise the xfs inode */
82 ip->i_ino = ino; 73 ip->i_ino = ino;
83 ip->i_mount = mp; 74 ip->i_mount = mp;
@@ -113,6 +104,20 @@ xfs_inode_alloc(
113#ifdef XFS_DIR2_TRACE 104#ifdef XFS_DIR2_TRACE
114 ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS); 105 ip->i_dir_trace = ktrace_alloc(XFS_DIR2_KTRACE_SIZE, KM_NOFS);
115#endif 106#endif
107 /*
108 * Now initialise the VFS inode. We do this after the xfs_inode
109 * initialisation as internal failures will result in ->destroy_inode
110 * being called and that will pass down through the reclaim path and
111 * free the XFS inode. This path requires the XFS inode to already be
112 * initialised. Hence if this call fails, the xfs_inode has already
113 * been freed and we should not reference it at all in the error
114 * handling.
115 */
116 if (!inode_init_always(mp->m_super, VFS_I(ip)))
117 return NULL;
118
119 /* prevent anyone from using this yet */
120 VFS_I(ip)->i_state = I_NEW|I_LOCK;
116 121
117 return ip; 122 return ip;
118} 123}
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 08ce72316bfe..5aaa2d7ec155 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -338,38 +338,6 @@ xfs_iomap_eof_align_last_fsb(
338} 338}
339 339
340STATIC int 340STATIC int
341xfs_flush_space(
342 xfs_inode_t *ip,
343 int *fsynced,
344 int *ioflags)
345{
346 switch (*fsynced) {
347 case 0:
348 if (ip->i_delayed_blks) {
349 xfs_iunlock(ip, XFS_ILOCK_EXCL);
350 xfs_flush_inode(ip);
351 xfs_ilock(ip, XFS_ILOCK_EXCL);
352 *fsynced = 1;
353 } else {
354 *ioflags |= BMAPI_SYNC;
355 *fsynced = 2;
356 }
357 return 0;
358 case 1:
359 *fsynced = 2;
360 *ioflags |= BMAPI_SYNC;
361 return 0;
362 case 2:
363 xfs_iunlock(ip, XFS_ILOCK_EXCL);
364 xfs_flush_device(ip);
365 xfs_ilock(ip, XFS_ILOCK_EXCL);
366 *fsynced = 3;
367 return 0;
368 }
369 return 1;
370}
371
372STATIC int
373xfs_cmn_err_fsblock_zero( 341xfs_cmn_err_fsblock_zero(
374 xfs_inode_t *ip, 342 xfs_inode_t *ip,
375 xfs_bmbt_irec_t *imap) 343 xfs_bmbt_irec_t *imap)
@@ -538,15 +506,9 @@ error_out:
538} 506}
539 507
540/* 508/*
541 * If the caller is doing a write at the end of the file, 509 * If the caller is doing a write at the end of the file, then extend the
542 * then extend the allocation out to the file system's write 510 * allocation out to the file system's write iosize. We clean up any extra
543 * iosize. We clean up any extra space left over when the 511 * space left over when the file is closed in xfs_inactive().
544 * file is closed in xfs_inactive().
545 *
546 * For sync writes, we are flushing delayed allocate space to
547 * try to make additional space available for allocation near
548 * the filesystem full boundary - preallocation hurts in that
549 * situation, of course.
550 */ 512 */
551STATIC int 513STATIC int
552xfs_iomap_eof_want_preallocate( 514xfs_iomap_eof_want_preallocate(
@@ -565,7 +527,7 @@ xfs_iomap_eof_want_preallocate(
565 int n, error, imaps; 527 int n, error, imaps;
566 528
567 *prealloc = 0; 529 *prealloc = 0;
568 if ((ioflag & BMAPI_SYNC) || (offset + count) <= ip->i_size) 530 if ((offset + count) <= ip->i_size)
569 return 0; 531 return 0;
570 532
571 /* 533 /*
@@ -611,7 +573,7 @@ xfs_iomap_write_delay(
611 xfs_extlen_t extsz; 573 xfs_extlen_t extsz;
612 int nimaps; 574 int nimaps;
613 xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS]; 575 xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS];
614 int prealloc, fsynced = 0; 576 int prealloc, flushed = 0;
615 int error; 577 int error;
616 578
617 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); 579 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
@@ -627,12 +589,12 @@ xfs_iomap_write_delay(
627 extsz = xfs_get_extsz_hint(ip); 589 extsz = xfs_get_extsz_hint(ip);
628 offset_fsb = XFS_B_TO_FSBT(mp, offset); 590 offset_fsb = XFS_B_TO_FSBT(mp, offset);
629 591
630retry:
631 error = xfs_iomap_eof_want_preallocate(mp, ip, offset, count, 592 error = xfs_iomap_eof_want_preallocate(mp, ip, offset, count,
632 ioflag, imap, XFS_WRITE_IMAPS, &prealloc); 593 ioflag, imap, XFS_WRITE_IMAPS, &prealloc);
633 if (error) 594 if (error)
634 return error; 595 return error;
635 596
597retry:
636 if (prealloc) { 598 if (prealloc) {
637 aligned_offset = XFS_WRITEIO_ALIGN(mp, (offset + count - 1)); 599 aligned_offset = XFS_WRITEIO_ALIGN(mp, (offset + count - 1));
638 ioalign = XFS_B_TO_FSBT(mp, aligned_offset); 600 ioalign = XFS_B_TO_FSBT(mp, aligned_offset);
@@ -659,15 +621,22 @@ retry:
659 621
660 /* 622 /*
661 * If bmapi returned us nothing, and if we didn't get back EDQUOT, 623 * If bmapi returned us nothing, and if we didn't get back EDQUOT,
662 * then we must have run out of space - flush delalloc, and retry.. 624 * then we must have run out of space - flush all other inodes with
625 * delalloc blocks and retry without EOF preallocation.
663 */ 626 */
664 if (nimaps == 0) { 627 if (nimaps == 0) {
665 xfs_iomap_enter_trace(XFS_IOMAP_WRITE_NOSPACE, 628 xfs_iomap_enter_trace(XFS_IOMAP_WRITE_NOSPACE,
666 ip, offset, count); 629 ip, offset, count);
667 if (xfs_flush_space(ip, &fsynced, &ioflag)) 630 if (flushed)
668 return XFS_ERROR(ENOSPC); 631 return XFS_ERROR(ENOSPC);
669 632
633 xfs_iunlock(ip, XFS_ILOCK_EXCL);
634 xfs_flush_inodes(ip);
635 xfs_ilock(ip, XFS_ILOCK_EXCL);
636
637 flushed = 1;
670 error = 0; 638 error = 0;
639 prealloc = 0;
671 goto retry; 640 goto retry;
672 } 641 }
673 642
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h
index a1cc1322fc0f..fdcf7b82747f 100644
--- a/fs/xfs/xfs_iomap.h
+++ b/fs/xfs/xfs_iomap.h
@@ -40,8 +40,7 @@ typedef enum {
40 BMAPI_IGNSTATE = (1 << 4), /* ignore unwritten state on read */ 40 BMAPI_IGNSTATE = (1 << 4), /* ignore unwritten state on read */
41 BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */ 41 BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */
42 BMAPI_MMAP = (1 << 6), /* allocate for mmap write */ 42 BMAPI_MMAP = (1 << 6), /* allocate for mmap write */
43 BMAPI_SYNC = (1 << 7), /* sync write to flush delalloc space */ 43 BMAPI_TRYLOCK = (1 << 7), /* non-blocking request */
44 BMAPI_TRYLOCK = (1 << 8), /* non-blocking request */
45} bmapi_flags_t; 44} bmapi_flags_t;
46 45
47 46
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index f76c6d7cea21..3750f04ede0b 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -562,9 +562,8 @@ xfs_log_mount(
562 } 562 }
563 563
564 mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks); 564 mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks);
565 if (!mp->m_log) { 565 if (IS_ERR(mp->m_log)) {
566 cmn_err(CE_WARN, "XFS: Log allocation failed: No memory!"); 566 error = -PTR_ERR(mp->m_log);
567 error = ENOMEM;
568 goto out; 567 goto out;
569 } 568 }
570 569
@@ -1180,10 +1179,13 @@ xlog_alloc_log(xfs_mount_t *mp,
1180 xfs_buf_t *bp; 1179 xfs_buf_t *bp;
1181 int i; 1180 int i;
1182 int iclogsize; 1181 int iclogsize;
1182 int error = ENOMEM;
1183 1183
1184 log = kmem_zalloc(sizeof(xlog_t), KM_MAYFAIL); 1184 log = kmem_zalloc(sizeof(xlog_t), KM_MAYFAIL);
1185 if (!log) 1185 if (!log) {
1186 return NULL; 1186 xlog_warn("XFS: Log allocation failed: No memory!");
1187 goto out;
1188 }
1187 1189
1188 log->l_mp = mp; 1190 log->l_mp = mp;
1189 log->l_targ = log_target; 1191 log->l_targ = log_target;
@@ -1201,19 +1203,35 @@ xlog_alloc_log(xfs_mount_t *mp,
1201 log->l_grant_reserve_cycle = 1; 1203 log->l_grant_reserve_cycle = 1;
1202 log->l_grant_write_cycle = 1; 1204 log->l_grant_write_cycle = 1;
1203 1205
1206 error = EFSCORRUPTED;
1204 if (xfs_sb_version_hassector(&mp->m_sb)) { 1207 if (xfs_sb_version_hassector(&mp->m_sb)) {
1205 log->l_sectbb_log = mp->m_sb.sb_logsectlog - BBSHIFT; 1208 log->l_sectbb_log = mp->m_sb.sb_logsectlog - BBSHIFT;
1206 ASSERT(log->l_sectbb_log <= mp->m_sectbb_log); 1209 if (log->l_sectbb_log < 0 ||
1210 log->l_sectbb_log > mp->m_sectbb_log) {
1211 xlog_warn("XFS: Log sector size (0x%x) out of range.",
1212 log->l_sectbb_log);
1213 goto out_free_log;
1214 }
1215
1207 /* for larger sector sizes, must have v2 or external log */ 1216 /* for larger sector sizes, must have v2 or external log */
1208 ASSERT(log->l_sectbb_log == 0 || 1217 if (log->l_sectbb_log != 0 &&
1209 log->l_logBBstart == 0 || 1218 (log->l_logBBstart != 0 &&
1210 xfs_sb_version_haslogv2(&mp->m_sb)); 1219 !xfs_sb_version_haslogv2(&mp->m_sb))) {
1211 ASSERT(mp->m_sb.sb_logsectlog >= BBSHIFT); 1220 xlog_warn("XFS: log sector size (0x%x) invalid "
1221 "for configuration.", log->l_sectbb_log);
1222 goto out_free_log;
1223 }
1224 if (mp->m_sb.sb_logsectlog < BBSHIFT) {
1225 xlog_warn("XFS: Log sector log (0x%x) too small.",
1226 mp->m_sb.sb_logsectlog);
1227 goto out_free_log;
1228 }
1212 } 1229 }
1213 log->l_sectbb_mask = (1 << log->l_sectbb_log) - 1; 1230 log->l_sectbb_mask = (1 << log->l_sectbb_log) - 1;
1214 1231
1215 xlog_get_iclog_buffer_size(mp, log); 1232 xlog_get_iclog_buffer_size(mp, log);
1216 1233
1234 error = ENOMEM;
1217 bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp); 1235 bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp);
1218 if (!bp) 1236 if (!bp)
1219 goto out_free_log; 1237 goto out_free_log;
@@ -1313,7 +1331,8 @@ out_free_iclog:
1313 xfs_buf_free(log->l_xbuf); 1331 xfs_buf_free(log->l_xbuf);
1314out_free_log: 1332out_free_log:
1315 kmem_free(log); 1333 kmem_free(log);
1316 return NULL; 1334out:
1335 return ERR_PTR(-error);
1317} /* xlog_alloc_log */ 1336} /* xlog_alloc_log */
1318 1337
1319 1338
@@ -2541,18 +2560,19 @@ redo:
2541 xlog_ins_ticketq(&log->l_reserve_headq, tic); 2560 xlog_ins_ticketq(&log->l_reserve_headq, tic);
2542 xlog_trace_loggrant(log, tic, 2561 xlog_trace_loggrant(log, tic,
2543 "xlog_grant_log_space: sleep 2"); 2562 "xlog_grant_log_space: sleep 2");
2563 spin_unlock(&log->l_grant_lock);
2564 xlog_grant_push_ail(log->l_mp, need_bytes);
2565 spin_lock(&log->l_grant_lock);
2566
2544 XFS_STATS_INC(xs_sleep_logspace); 2567 XFS_STATS_INC(xs_sleep_logspace);
2545 sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); 2568 sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s);
2546 2569
2547 if (XLOG_FORCED_SHUTDOWN(log)) { 2570 spin_lock(&log->l_grant_lock);
2548 spin_lock(&log->l_grant_lock); 2571 if (XLOG_FORCED_SHUTDOWN(log))
2549 goto error_return; 2572 goto error_return;
2550 }
2551 2573
2552 xlog_trace_loggrant(log, tic, 2574 xlog_trace_loggrant(log, tic,
2553 "xlog_grant_log_space: wake 2"); 2575 "xlog_grant_log_space: wake 2");
2554 xlog_grant_push_ail(log->l_mp, need_bytes);
2555 spin_lock(&log->l_grant_lock);
2556 goto redo; 2576 goto redo;
2557 } else if (tic->t_flags & XLOG_TIC_IN_Q) 2577 } else if (tic->t_flags & XLOG_TIC_IN_Q)
2558 xlog_del_ticketq(&log->l_reserve_headq, tic); 2578 xlog_del_ticketq(&log->l_reserve_headq, tic);
@@ -2631,7 +2651,7 @@ xlog_regrant_write_log_space(xlog_t *log,
2631 * for more free space, otherwise try to get some space for 2651 * for more free space, otherwise try to get some space for
2632 * this transaction. 2652 * this transaction.
2633 */ 2653 */
2634 2654 need_bytes = tic->t_unit_res;
2635 if ((ntic = log->l_write_headq)) { 2655 if ((ntic = log->l_write_headq)) {
2636 free_bytes = xlog_space_left(log, log->l_grant_write_cycle, 2656 free_bytes = xlog_space_left(log, log->l_grant_write_cycle,
2637 log->l_grant_write_bytes); 2657 log->l_grant_write_bytes);
@@ -2651,26 +2671,25 @@ xlog_regrant_write_log_space(xlog_t *log,
2651 2671
2652 xlog_trace_loggrant(log, tic, 2672 xlog_trace_loggrant(log, tic,
2653 "xlog_regrant_write_log_space: sleep 1"); 2673 "xlog_regrant_write_log_space: sleep 1");
2674 spin_unlock(&log->l_grant_lock);
2675 xlog_grant_push_ail(log->l_mp, need_bytes);
2676 spin_lock(&log->l_grant_lock);
2677
2654 XFS_STATS_INC(xs_sleep_logspace); 2678 XFS_STATS_INC(xs_sleep_logspace);
2655 sv_wait(&tic->t_wait, PINOD|PLTWAIT, 2679 sv_wait(&tic->t_wait, PINOD|PLTWAIT,
2656 &log->l_grant_lock, s); 2680 &log->l_grant_lock, s);
2657 2681
2658 /* If we're shutting down, this tic is already 2682 /* If we're shutting down, this tic is already
2659 * off the queue */ 2683 * off the queue */
2660 if (XLOG_FORCED_SHUTDOWN(log)) { 2684 spin_lock(&log->l_grant_lock);
2661 spin_lock(&log->l_grant_lock); 2685 if (XLOG_FORCED_SHUTDOWN(log))
2662 goto error_return; 2686 goto error_return;
2663 }
2664 2687
2665 xlog_trace_loggrant(log, tic, 2688 xlog_trace_loggrant(log, tic,
2666 "xlog_regrant_write_log_space: wake 1"); 2689 "xlog_regrant_write_log_space: wake 1");
2667 xlog_grant_push_ail(log->l_mp, tic->t_unit_res);
2668 spin_lock(&log->l_grant_lock);
2669 } 2690 }
2670 } 2691 }
2671 2692
2672 need_bytes = tic->t_unit_res;
2673
2674redo: 2693redo:
2675 if (XLOG_FORCED_SHUTDOWN(log)) 2694 if (XLOG_FORCED_SHUTDOWN(log))
2676 goto error_return; 2695 goto error_return;
@@ -2680,19 +2699,20 @@ redo:
2680 if (free_bytes < need_bytes) { 2699 if (free_bytes < need_bytes) {
2681 if ((tic->t_flags & XLOG_TIC_IN_Q) == 0) 2700 if ((tic->t_flags & XLOG_TIC_IN_Q) == 0)
2682 xlog_ins_ticketq(&log->l_write_headq, tic); 2701 xlog_ins_ticketq(&log->l_write_headq, tic);
2702 spin_unlock(&log->l_grant_lock);
2703 xlog_grant_push_ail(log->l_mp, need_bytes);
2704 spin_lock(&log->l_grant_lock);
2705
2683 XFS_STATS_INC(xs_sleep_logspace); 2706 XFS_STATS_INC(xs_sleep_logspace);
2684 sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); 2707 sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s);
2685 2708
2686 /* If we're shutting down, this tic is already off the queue */ 2709 /* If we're shutting down, this tic is already off the queue */
2687 if (XLOG_FORCED_SHUTDOWN(log)) { 2710 spin_lock(&log->l_grant_lock);
2688 spin_lock(&log->l_grant_lock); 2711 if (XLOG_FORCED_SHUTDOWN(log))
2689 goto error_return; 2712 goto error_return;
2690 }
2691 2713
2692 xlog_trace_loggrant(log, tic, 2714 xlog_trace_loggrant(log, tic,
2693 "xlog_regrant_write_log_space: wake 2"); 2715 "xlog_regrant_write_log_space: wake 2");
2694 xlog_grant_push_ail(log->l_mp, need_bytes);
2695 spin_lock(&log->l_grant_lock);
2696 goto redo; 2716 goto redo;
2697 } else if (tic->t_flags & XLOG_TIC_IN_Q) 2717 } else if (tic->t_flags & XLOG_TIC_IN_Q)
2698 xlog_del_ticketq(&log->l_write_headq, tic); 2718 xlog_del_ticketq(&log->l_write_headq, tic);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 7af44adffc8f..d6a64392f983 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -313,7 +313,7 @@ typedef struct xfs_mount {
313#endif 313#endif
314 struct xfs_mru_cache *m_filestream; /* per-mount filestream data */ 314 struct xfs_mru_cache *m_filestream; /* per-mount filestream data */
315 struct task_struct *m_sync_task; /* generalised sync thread */ 315 struct task_struct *m_sync_task; /* generalised sync thread */
316 bhv_vfs_sync_work_t m_sync_work; /* work item for VFS_SYNC */ 316 xfs_sync_work_t m_sync_work; /* work item for VFS_SYNC */
317 struct list_head m_sync_list; /* sync thread work item list */ 317 struct list_head m_sync_list; /* sync thread work item list */
318 spinlock_t m_sync_lock; /* work item list lock */ 318 spinlock_t m_sync_lock; /* work item list lock */
319 int m_sync_seq; /* sync thread generation no. */ 319 int m_sync_seq; /* sync thread generation no. */
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 7394c7af5de5..19cf90a9c762 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1457,6 +1457,13 @@ xfs_create(
1457 error = xfs_trans_reserve(tp, resblks, log_res, 0, 1457 error = xfs_trans_reserve(tp, resblks, log_res, 0,
1458 XFS_TRANS_PERM_LOG_RES, log_count); 1458 XFS_TRANS_PERM_LOG_RES, log_count);
1459 if (error == ENOSPC) { 1459 if (error == ENOSPC) {
1460 /* flush outstanding delalloc blocks and retry */
1461 xfs_flush_inodes(dp);
1462 error = xfs_trans_reserve(tp, resblks, XFS_CREATE_LOG_RES(mp), 0,
1463 XFS_TRANS_PERM_LOG_RES, XFS_CREATE_LOG_COUNT);
1464 }
1465 if (error == ENOSPC) {
1466 /* No space at all so try a "no-allocation" reservation */
1460 resblks = 0; 1467 resblks = 0;
1461 error = xfs_trans_reserve(tp, 0, log_res, 0, 1468 error = xfs_trans_reserve(tp, 0, log_res, 0,
1462 XFS_TRANS_PERM_LOG_RES, log_count); 1469 XFS_TRANS_PERM_LOG_RES, log_count);
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 00f45ff081a6..b0e63c672ebd 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -80,56 +80,4 @@ extern void setup_per_cpu_areas(void);
80#define DECLARE_PER_CPU(type, name) extern PER_CPU_ATTRIBUTES \ 80#define DECLARE_PER_CPU(type, name) extern PER_CPU_ATTRIBUTES \
81 __typeof__(type) per_cpu_var(name) 81 __typeof__(type) per_cpu_var(name)
82 82
83/*
84 * Optional methods for optimized non-lvalue per-cpu variable access.
85 *
86 * @var can be a percpu variable or a field of it and its size should
87 * equal char, int or long. percpu_read() evaluates to a lvalue and
88 * all others to void.
89 *
90 * These operations are guaranteed to be atomic w.r.t. preemption.
91 * The generic versions use plain get/put_cpu_var(). Archs are
92 * encouraged to implement single-instruction alternatives which don't
93 * require preemption protection.
94 */
95#ifndef percpu_read
96# define percpu_read(var) \
97 ({ \
98 typeof(per_cpu_var(var)) __tmp_var__; \
99 __tmp_var__ = get_cpu_var(var); \
100 put_cpu_var(var); \
101 __tmp_var__; \
102 })
103#endif
104
105#define __percpu_generic_to_op(var, val, op) \
106do { \
107 get_cpu_var(var) op val; \
108 put_cpu_var(var); \
109} while (0)
110
111#ifndef percpu_write
112# define percpu_write(var, val) __percpu_generic_to_op(var, (val), =)
113#endif
114
115#ifndef percpu_add
116# define percpu_add(var, val) __percpu_generic_to_op(var, (val), +=)
117#endif
118
119#ifndef percpu_sub
120# define percpu_sub(var, val) __percpu_generic_to_op(var, (val), -=)
121#endif
122
123#ifndef percpu_and
124# define percpu_and(var, val) __percpu_generic_to_op(var, (val), &=)
125#endif
126
127#ifndef percpu_or
128# define percpu_or(var, val) __percpu_generic_to_op(var, (val), |=)
129#endif
130
131#ifndef percpu_xor
132# define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=)
133#endif
134
135#endif /* _ASM_GENERIC_PERCPU_H_ */ 83#endif /* _ASM_GENERIC_PERCPU_H_ */
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index 35752dadd6df..c840719a8c59 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -201,7 +201,7 @@ typedef struct siginfo {
201#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */ 201#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
202#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */ 202#define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
203#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */ 203#define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */
204#define NSIGTRAP 2 204#define NSIGTRAP 4
205 205
206/* 206/*
207 * SIGCHLD si_codes 207 * SIGCHLD si_codes
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 2df74eb09563..9477af01a639 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -472,6 +472,7 @@
472 {0x8086, 0x2562, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 472 {0x8086, 0x2562, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
473 {0x8086, 0x3582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 473 {0x8086, 0x3582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
474 {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 474 {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
475 {0x8086, 0x358e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
475 {0, 0, 0} 476 {0, 0, 0}
476 477
477#define gamma_PCI_IDS \ 478#define gamma_PCI_IDS \
@@ -533,4 +534,5 @@
533 {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ 534 {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
534 {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ 535 {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
535 {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ 536 {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
537 {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
536 {0, 0, 0} 538 {0, 0, 0}
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 4864a43b2b45..c3021105edc0 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -377,7 +377,21 @@ struct cpu_vfs_cap_data {
377#define CAP_FOR_EACH_U32(__capi) \ 377#define CAP_FOR_EACH_U32(__capi) \
378 for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi) 378 for (__capi = 0; __capi < _KERNEL_CAPABILITY_U32S; ++__capi)
379 379
380/*
381 * CAP_FS_MASK and CAP_NFSD_MASKS:
382 *
383 * The fs mask is all the privileges that fsuid==0 historically meant.
384 * At one time in the past, that included CAP_MKNOD and CAP_LINUX_IMMUTABLE.
385 *
386 * It has never meant setting security.* and trusted.* xattrs.
387 *
388 * We could also define fsmask as follows:
389 * 1. CAP_FS_MASK is the privilege to bypass all fs-related DAC permissions
390 * 2. The security.* and trusted.* xattrs are fs-related MAC permissions
391 */
392
380# define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \ 393# define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \
394 | CAP_TO_MASK(CAP_MKNOD) \
381 | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ 395 | CAP_TO_MASK(CAP_DAC_OVERRIDE) \
382 | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ 396 | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \
383 | CAP_TO_MASK(CAP_FOWNER) \ 397 | CAP_TO_MASK(CAP_FOWNER) \
@@ -392,11 +406,12 @@ struct cpu_vfs_cap_data {
392# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) 406# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }})
393# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) 407# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }})
394# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}) 408# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }})
395# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }) 409# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \
410 | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \
411 CAP_FS_MASK_B1 } })
396# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ 412# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \
397 | CAP_TO_MASK(CAP_SYS_RESOURCE) \ 413 | CAP_TO_MASK(CAP_SYS_RESOURCE), \
398 | CAP_TO_MASK(CAP_MKNOD), \ 414 CAP_FS_MASK_B1 } })
399 CAP_FS_MASK_B1 } })
400 415
401#endif /* _KERNEL_CAPABILITY_U32S != 2 */ 416#endif /* _KERNEL_CAPABILITY_U32S != 2 */
402 417
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 096476f1fb35..493dedb7a67b 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -2,12 +2,19 @@
2#define __LINUX_DEBUG_LOCKING_H 2#define __LINUX_DEBUG_LOCKING_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <asm/atomic.h>
5 6
6struct task_struct; 7struct task_struct;
7 8
8extern int debug_locks; 9extern int debug_locks;
9extern int debug_locks_silent; 10extern int debug_locks_silent;
10 11
12
13static inline int __debug_locks_off(void)
14{
15 return xchg(&debug_locks, 0);
16}
17
11/* 18/*
12 * Generic 'turn off all lock debugging' function: 19 * Generic 'turn off all lock debugging' function:
13 */ 20 */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f563c5013932..330c4b1bfcaa 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -173,8 +173,12 @@ struct fb_fix_screeninfo {
173/* Interpretation of offset for color fields: All offsets are from the right, 173/* Interpretation of offset for color fields: All offsets are from the right,
174 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you 174 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
175 * can use the offset as right argument to <<). A pixel afterwards is a bit 175 * can use the offset as right argument to <<). A pixel afterwards is a bit
176 * stream and is written to video memory as that unmodified. This implies 176 * stream and is written to video memory as that unmodified.
177 * big-endian byte order if bits_per_pixel is greater than 8. 177 *
178 * For pseudocolor: offset and length should be the same for all color
179 * components. Offset specifies the position of the least significant bit
180 * of the pallette index in a pixel value. Length indicates the number
181 * of available palette entries (i.e. # of entries = 1 << length).
178 */ 182 */
179struct fb_bitfield { 183struct fb_bitfield {
180 __u32 offset; /* beginning of bitfield */ 184 __u32 offset; /* beginning of bitfield */
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h
index 671decbd2aeb..934e22d65801 100644
--- a/include/linux/fiemap.h
+++ b/include/linux/fiemap.h
@@ -11,6 +11,8 @@
11#ifndef _LINUX_FIEMAP_H 11#ifndef _LINUX_FIEMAP_H
12#define _LINUX_FIEMAP_H 12#define _LINUX_FIEMAP_H
13 13
14#include <linux/types.h>
15
14struct fiemap_extent { 16struct fiemap_extent {
15 __u64 fe_logical; /* logical offset in bytes for the start of 17 __u64 fe_logical; /* logical offset in bytes for the start of
16 * the extent from the beginning of the file */ 18 * the extent from the beginning of the file */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 00ee11eb9092..ad2580596033 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -274,7 +274,7 @@ struct i2c_board_info {
274 * are provided using conventional syntax. 274 * are provided using conventional syntax.
275 */ 275 */
276#define I2C_BOARD_INFO(dev_type, dev_addr) \ 276#define I2C_BOARD_INFO(dev_type, dev_addr) \
277 .type = (dev_type), .addr = (dev_addr) 277 .type = dev_type, .addr = (dev_addr)
278 278
279 279
280/* Add-on boards should register/unregister their devices; e.g. a board 280/* Add-on boards should register/unregister their devices; e.g. a board
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index dcfb93337e9a..d87247d2641f 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -15,19 +15,6 @@
15extern struct files_struct init_files; 15extern struct files_struct init_files;
16extern struct fs_struct init_fs; 16extern struct fs_struct init_fs;
17 17
18#define INIT_KIOCTX(name, which_mm) \
19{ \
20 .users = ATOMIC_INIT(1), \
21 .dead = 0, \
22 .mm = &which_mm, \
23 .user_id = 0, \
24 .next = NULL, \
25 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \
26 .ctx_lock = __SPIN_LOCK_UNLOCKED(name.ctx_lock), \
27 .reqs_active = 0U, \
28 .max_reqs = ~0U, \
29}
30
31#define INIT_MM(name) \ 18#define INIT_MM(name) \
32{ \ 19{ \
33 .mm_rb = RB_ROOT, \ 20 .mm_rb = RB_ROOT, \
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ee98cd570885..06ba90c211a5 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2514,6 +2514,8 @@
2514#define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433 2514#define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433
2515#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2515#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2516#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2516#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
2517#define PCI_DEVICE_ID_INTEL_82854_HB 0x358c
2518#define PCI_DEVICE_ID_INTEL_82854_IG 0x358e
2517#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 2519#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580
2518#define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582 2520#define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582
2519#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 2521#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index ee5615d65211..cfda2d5ad319 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -168,4 +168,56 @@ static inline void free_percpu(void *p)
168#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ 168#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \
169 __alignof__(type)) 169 __alignof__(type))
170 170
171/*
172 * Optional methods for optimized non-lvalue per-cpu variable access.
173 *
174 * @var can be a percpu variable or a field of it and its size should
175 * equal char, int or long. percpu_read() evaluates to a lvalue and
176 * all others to void.
177 *
178 * These operations are guaranteed to be atomic w.r.t. preemption.
179 * The generic versions use plain get/put_cpu_var(). Archs are
180 * encouraged to implement single-instruction alternatives which don't
181 * require preemption protection.
182 */
183#ifndef percpu_read
184# define percpu_read(var) \
185 ({ \
186 typeof(per_cpu_var(var)) __tmp_var__; \
187 __tmp_var__ = get_cpu_var(var); \
188 put_cpu_var(var); \
189 __tmp_var__; \
190 })
191#endif
192
193#define __percpu_generic_to_op(var, val, op) \
194do { \
195 get_cpu_var(var) op val; \
196 put_cpu_var(var); \
197} while (0)
198
199#ifndef percpu_write
200# define percpu_write(var, val) __percpu_generic_to_op(var, (val), =)
201#endif
202
203#ifndef percpu_add
204# define percpu_add(var, val) __percpu_generic_to_op(var, (val), +=)
205#endif
206
207#ifndef percpu_sub
208# define percpu_sub(var, val) __percpu_generic_to_op(var, (val), -=)
209#endif
210
211#ifndef percpu_and
212# define percpu_and(var, val) __percpu_generic_to_op(var, (val), &=)
213#endif
214
215#ifndef percpu_or
216# define percpu_or(var, val) __percpu_generic_to_op(var, (val), |=)
217#endif
218
219#ifndef percpu_xor
220# define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=)
221#endif
222
171#endif /* __LINUX_PERCPU_H */ 223#endif /* __LINUX_PERCPU_H */
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h
new file mode 100644
index 000000000000..12d63a30c347
--- /dev/null
+++ b/include/linux/rotary_encoder.h
@@ -0,0 +1,13 @@
1#ifndef __ROTARY_ENCODER_H__
2#define __ROTARY_ENCODER_H__
3
4struct rotary_encoder_platform_data {
5 unsigned int steps;
6 unsigned int axis;
7 unsigned int gpio_a;
8 unsigned int gpio_b;
9 unsigned int inverted_a;
10 unsigned int inverted_b;
11};
12
13#endif /* __ROTARY_ENCODER_H__ */
diff --git a/include/linux/sht15.h b/include/linux/sht15.h
new file mode 100644
index 000000000000..046bce05ecab
--- /dev/null
+++ b/include/linux/sht15.h
@@ -0,0 +1,24 @@
1/*
2 * sht15.h - support for the SHT15 Temperature and Humidity Sensor
3 *
4 * Copyright (c) 2009 Jonathan Cameron
5 *
6 * Copyright (c) 2007 Wouter Horre
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 * struct sht15_platform_data - sht15 connectivity info
15 * @gpio_data: no. of gpio to which bidirectional data line is connected
16 * @gpio_sck: no. of gpio to which the data clock is connected.
17 * @supply_mv: supply voltage in mv. Overridden by regulator if available.
18 **/
19struct sht15_platform_data {
20 int gpio_data;
21 int gpio_sck;
22 int supply_mv;
23};
24
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h
new file mode 100644
index 000000000000..4231104c9afa
--- /dev/null
+++ b/include/linux/spi/ad7879.h
@@ -0,0 +1,35 @@
1/* linux/spi/ad7879.h */
2
3/* Touchscreen characteristics vary between boards and models. The
4 * platform_data for the device's "struct device" holds this information.
5 *
6 * It's OK if the min/max values are zero.
7 */
8struct ad7879_platform_data {
9 u16 model; /* 7879 */
10 u16 x_plate_ohms;
11 u16 x_min, x_max;
12 u16 y_min, y_max;
13 u16 pressure_min, pressure_max;
14
15 /* [0..255] 0=OFF Starts at 1=550us and goes
16 * all the way to 9.440ms in steps of 35us.
17 */
18 u8 pen_down_acc_interval;
19 /* [0..15] Starts at 0=128us and goes all the
20 * way to 4.096ms in steps of 128us.
21 */
22 u8 first_conversion_delay;
23 /* [0..3] 0 = 2us, 1 = 4us, 2 = 8us, 3 = 16us */
24 u8 acquisition_time;
25 /* [0..3] Average X middle samples 0 = 2, 1 = 4, 2 = 8, 3 = 16 */
26 u8 averaging;
27 /* [0..3] Perform X measurements 0 = OFF,
28 * 1 = 4, 2 = 8, 3 = 16 (median > averaging)
29 */
30 u8 median;
31 /* 1 = AUX/VBAT/GPIO set to GPIO Output */
32 u8 gpio_output;
33 /* Initial GPIO pin state (valid if gpio_output = 1) */
34 u8 gpio_default;
35};
diff --git a/include/linux/stringify.h b/include/linux/stringify.h
index 0b4388356c87..841cec8ed525 100644
--- a/include/linux/stringify.h
+++ b/include/linux/stringify.h
@@ -6,7 +6,7 @@
6 * converts to "bar". 6 * converts to "bar".
7 */ 7 */
8 8
9#define __stringify_1(x) #x 9#define __stringify_1(x...) #x
10#define __stringify(x) __stringify_1(x) 10#define __stringify(x...) __stringify_1(x)
11 11
12#endif /* !__LINUX_STRINGIFY_H */ 12#endif /* !__LINUX_STRINGIFY_H */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index b95842542590..625e9e4639c6 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -29,7 +29,7 @@
29/** 29/**
30 * usb_serial_port: structure for the specific ports of a device. 30 * usb_serial_port: structure for the specific ports of a device.
31 * @serial: pointer back to the struct usb_serial owner of this port. 31 * @serial: pointer back to the struct usb_serial owner of this port.
32 * @tty: pointer to the corresponding tty for this port. 32 * @port: pointer to the corresponding tty_port for this port.
33 * @lock: spinlock to grab when updating portions of this structure. 33 * @lock: spinlock to grab when updating portions of this structure.
34 * @mutex: mutex used to synchronize serial_open() and serial_close() 34 * @mutex: mutex used to synchronize serial_open() and serial_close()
35 * access for this port. 35 * access for this port.
@@ -44,19 +44,22 @@
44 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe 44 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe
45 * for this port. 45 * for this port.
46 * @bulk_in_buffer: pointer to the bulk in buffer for this port. 46 * @bulk_in_buffer: pointer to the bulk in buffer for this port.
47 * @bulk_in_size: the size of the bulk_in_buffer, in bytes.
47 * @read_urb: pointer to the bulk in struct urb for this port. 48 * @read_urb: pointer to the bulk in struct urb for this port.
48 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this 49 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this
49 * port. 50 * port.
50 * @bulk_out_buffer: pointer to the bulk out buffer for this port. 51 * @bulk_out_buffer: pointer to the bulk out buffer for this port.
51 * @bulk_out_size: the size of the bulk_out_buffer, in bytes. 52 * @bulk_out_size: the size of the bulk_out_buffer, in bytes.
52 * @write_urb: pointer to the bulk out struct urb for this port. 53 * @write_urb: pointer to the bulk out struct urb for this port.
54 * @write_urb_busy: port`s writing status
53 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this 55 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this
54 * port. 56 * port.
55 * @write_wait: a wait_queue_head_t used by the port. 57 * @write_wait: a wait_queue_head_t used by the port.
56 * @work: work queue entry for the line discipline waking up. 58 * @work: work queue entry for the line discipline waking up.
57 * @open_count: number of times this port has been opened.
58 * @throttled: nonzero if the read urb is inactive to throttle the device 59 * @throttled: nonzero if the read urb is inactive to throttle the device
59 * @throttle_req: nonzero if the tty wants to throttle us 60 * @throttle_req: nonzero if the tty wants to throttle us
61 * @console: attached usb serial console
62 * @dev: pointer to the serial device
60 * 63 *
61 * This structure is used by the usb-serial core and drivers for the specific 64 * This structure is used by the usb-serial core and drivers for the specific
62 * ports of a device. 65 * ports of a device.
diff --git a/include/scsi/scsi_scan.h b/include/scsi/scsi_scan.h
new file mode 100644
index 000000000000..78898889243d
--- /dev/null
+++ b/include/scsi/scsi_scan.h
@@ -0,0 +1,11 @@
1#ifndef _SCSI_SCSI_SCAN_H
2#define _SCSI_SCSI_SCAN_H
3
4#ifdef CONFIG_SCSI
5/* drivers/scsi/scsi_scan.c */
6extern int scsi_complete_async_scans(void);
7#else
8static inline int scsi_complete_async_scans(void) { return 0; }
9#endif
10
11#endif /* _SCSI_SCSI_SCAN_H */
diff --git a/include/video/cyblafb.h b/include/video/cyblafb.h
deleted file mode 100644
index d3c1d4e2c8e3..000000000000
--- a/include/video/cyblafb.h
+++ /dev/null
@@ -1,175 +0,0 @@
1
2#ifndef CYBLAFB_DEBUG
3#define CYBLAFB_DEBUG 0
4#endif
5
6#if CYBLAFB_DEBUG
7#define debug(f,a...) printk("%s:" f, __func__ , ## a);
8#else
9#define debug(f,a...)
10#endif
11
12#define output(f, a...) printk("cyblafb: " f, ## a)
13
14#define Kb (1024)
15#define Mb (Kb*Kb)
16
17/* PCI IDS of supported cards temporarily here */
18
19#define CYBERBLADEi1 0x8500
20
21/* these defines are for 'lcd' variable */
22#define LCD_STRETCH 0
23#define LCD_CENTER 1
24#define LCD_BIOS 2
25
26/* display types */
27#define DISPLAY_CRT 0
28#define DISPLAY_FP 1
29
30#define ROP_S 0xCC
31
32#define point(x,y) ((y)<<16|(x))
33
34//
35// Attribute Regs, ARxx, 3c0/3c1
36//
37#define AR00 0x00
38#define AR01 0x01
39#define AR02 0x02
40#define AR03 0x03
41#define AR04 0x04
42#define AR05 0x05
43#define AR06 0x06
44#define AR07 0x07
45#define AR08 0x08
46#define AR09 0x09
47#define AR0A 0x0A
48#define AR0B 0x0B
49#define AR0C 0x0C
50#define AR0D 0x0D
51#define AR0E 0x0E
52#define AR0F 0x0F
53#define AR10 0x10
54#define AR12 0x12
55#define AR13 0x13
56
57//
58// Sequencer Regs, SRxx, 3c4/3c5
59//
60#define SR00 0x00
61#define SR01 0x01
62#define SR02 0x02
63#define SR03 0x03
64#define SR04 0x04
65#define SR0D 0x0D
66#define SR0E 0x0E
67#define SR11 0x11
68#define SR18 0x18
69#define SR19 0x19
70
71//
72//
73//
74#define CR00 0x00
75#define CR01 0x01
76#define CR02 0x02
77#define CR03 0x03
78#define CR04 0x04
79#define CR05 0x05
80#define CR06 0x06
81#define CR07 0x07
82#define CR08 0x08
83#define CR09 0x09
84#define CR0A 0x0A
85#define CR0B 0x0B
86#define CR0C 0x0C
87#define CR0D 0x0D
88#define CR0E 0x0E
89#define CR0F 0x0F
90#define CR10 0x10
91#define CR11 0x11
92#define CR12 0x12
93#define CR13 0x13
94#define CR14 0x14
95#define CR15 0x15
96#define CR16 0x16
97#define CR17 0x17
98#define CR18 0x18
99#define CR19 0x19
100#define CR1A 0x1A
101#define CR1B 0x1B
102#define CR1C 0x1C
103#define CR1D 0x1D
104#define CR1E 0x1E
105#define CR1F 0x1F
106#define CR20 0x20
107#define CR21 0x21
108#define CR27 0x27
109#define CR29 0x29
110#define CR2A 0x2A
111#define CR2B 0x2B
112#define CR2D 0x2D
113#define CR2F 0x2F
114#define CR36 0x36
115#define CR38 0x38
116#define CR39 0x39
117#define CR3A 0x3A
118#define CR55 0x55
119#define CR56 0x56
120#define CR57 0x57
121#define CR58 0x58
122
123//
124//
125//
126
127#define GR00 0x01
128#define GR01 0x01
129#define GR02 0x02
130#define GR03 0x03
131#define GR04 0x04
132#define GR05 0x05
133#define GR06 0x06
134#define GR07 0x07
135#define GR08 0x08
136#define GR0F 0x0F
137#define GR20 0x20
138#define GR23 0x23
139#define GR2F 0x2F
140#define GR30 0x30
141#define GR31 0x31
142#define GR33 0x33
143#define GR52 0x52
144#define GR53 0x53
145#define GR5D 0x5d
146
147
148//
149// Graphics Engine
150//
151#define GEBase 0x2100 // could be mapped elsewhere if we like it
152#define GE00 (GEBase+0x00) // source 1, p 111
153#define GE04 (GEBase+0x04) // source 2, p 111
154#define GE08 (GEBase+0x08) // destination 1, p 111
155#define GE0C (GEBase+0x0C) // destination 2, p 112
156#define GE10 (GEBase+0x10) // right view base & enable, p 112
157#define GE13 (GEBase+0x13) // left view base & enable, p 112
158#define GE18 (GEBase+0x18) // block write start address, p 112
159#define GE1C (GEBase+0x1C) // block write end address, p 112
160#define GE20 (GEBase+0x20) // engine status, p 113
161#define GE24 (GEBase+0x24) // reset all GE pointers
162#define GE44 (GEBase+0x44) // command register, p 126
163#define GE48 (GEBase+0x48) // raster operation, p 127
164#define GE60 (GEBase+0x60) // foreground color, p 128
165#define GE64 (GEBase+0x64) // background color, p 128
166#define GE6C (GEBase+0x6C) // Pattern and Style, p 129, ok
167#define GE9C (GEBase+0x9C) // pixel engine data port, p 125
168#define GEB8 (GEBase+0xB8) // Destination Stride / Buffer Base 0, p 133
169#define GEBC (GEBase+0xBC) // Destination Stride / Buffer Base 1, p 133
170#define GEC0 (GEBase+0xC0) // Destination Stride / Buffer Base 2, p 133
171#define GEC4 (GEBase+0xC4) // Destination Stride / Buffer Base 3, p 133
172#define GEC8 (GEBase+0xC8) // Source Stride / Buffer Base 0, p 133
173#define GECC (GEBase+0xCC) // Source Stride / Buffer Base 1, p 133
174#define GED0 (GEBase+0xD0) // Source Stride / Buffer Base 2, p 133
175#define GED4 (GEBase+0xD4) // Source Stride / Buffer Base 3, p 133
diff --git a/init/Kconfig b/init/Kconfig
index f2f9b5362b48..7be4d3836745 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -808,6 +808,14 @@ config KALLSYMS_EXTRA_PASS
808 you wait for kallsyms to be fixed. 808 you wait for kallsyms to be fixed.
809 809
810 810
811config STRIP_ASM_SYMS
812 bool "Strip assembler-generated symbols during link"
813 default n
814 help
815 Strip internal assembler-generated symbols during a link (symbols
816 that look like '.Lxxx') so they don't pollute the output of
817 get_wchan() and suchlike.
818
811config HOTPLUG 819config HOTPLUG
812 bool "Support for hot-pluggable devices" if EMBEDDED 820 bool "Support for hot-pluggable devices" if EMBEDDED
813 default y 821 default y
diff --git a/init/initramfs.c b/init/initramfs.c
index 80cd713f6cc5..9ee7b7810417 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -310,7 +310,8 @@ static int __init do_name(void)
310 if (wfd >= 0) { 310 if (wfd >= 0) {
311 sys_fchown(wfd, uid, gid); 311 sys_fchown(wfd, uid, gid);
312 sys_fchmod(wfd, mode); 312 sys_fchmod(wfd, mode);
313 sys_ftruncate(wfd, body_len); 313 if (body_len)
314 sys_ftruncate(wfd, body_len);
314 vcollected = kstrdup(collected, GFP_KERNEL); 315 vcollected = kstrdup(collected, GFP_KERNEL);
315 state = CopyFile; 316 state = CopyFile;
316 } 317 }
@@ -515,6 +516,7 @@ skip:
515 initrd_end = 0; 516 initrd_end = 0;
516} 517}
517 518
519#ifdef CONFIG_BLK_DEV_RAM
518#define BUF_SIZE 1024 520#define BUF_SIZE 1024
519static void __init clean_rootfs(void) 521static void __init clean_rootfs(void)
520{ 522{
@@ -561,6 +563,7 @@ static void __init clean_rootfs(void)
561 sys_close(fd); 563 sys_close(fd);
562 kfree(buf); 564 kfree(buf);
563} 565}
566#endif
564 567
565static int __init populate_rootfs(void) 568static int __init populate_rootfs(void)
566{ 569{
diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c
index 89f60ec8ee54..24ae46dfe45d 100644
--- a/ipc/mq_sysctl.c
+++ b/ipc/mq_sysctl.c
@@ -22,6 +22,7 @@
22#define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */ 22#define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */
23#define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */ 23#define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */
24 24
25#ifdef CONFIG_PROC_SYSCTL
25static void *get_mq(ctl_table *table) 26static void *get_mq(ctl_table *table)
26{ 27{
27 char *which = table->data; 28 char *which = table->data;
@@ -30,7 +31,6 @@ static void *get_mq(ctl_table *table)
30 return which; 31 return which;
31} 32}
32 33
33#ifdef CONFIG_PROC_SYSCTL
34static int proc_mq_dointvec(ctl_table *table, int write, struct file *filp, 34static int proc_mq_dointvec(ctl_table *table, int write, struct file *filp,
35 void __user *buffer, size_t *lenp, loff_t *ppos) 35 void __user *buffer, size_t *lenp, loff_t *ppos)
36{ 36{
diff --git a/kernel/mutex.c b/kernel/mutex.c
index 5d79781394a3..507cf2b5e9f1 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -148,7 +148,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
148 148
149 preempt_disable(); 149 preempt_disable();
150 mutex_acquire(&lock->dep_map, subclass, 0, ip); 150 mutex_acquire(&lock->dep_map, subclass, 0, ip);
151#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) 151#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) && \
152 !defined(CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES)
152 /* 153 /*
153 * Optimistic spinning. 154 * Optimistic spinning.
154 * 155 *
diff --git a/kernel/panic.c b/kernel/panic.c
index 3fd8c5bf8b39..934fb377f4b3 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -213,8 +213,16 @@ unsigned long get_taint(void)
213 213
214void add_taint(unsigned flag) 214void add_taint(unsigned flag)
215{ 215{
216 /* can't trust the integrity of the kernel anymore: */ 216 /*
217 debug_locks = 0; 217 * Can't trust the integrity of the kernel anymore.
218 * We don't call directly debug_locks_off() because the issue
219 * is not necessarily serious enough to set oops_in_progress to 1
220 * Also we want to keep up lockdep for staging development and
221 * post-warning case.
222 */
223 if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
224 printk(KERN_WARNING "Disabling lockdep due to kernel taint\n");
225
218 set_bit(flag, &tainted_mask); 226 set_bit(flag, &tainted_mask);
219} 227}
220EXPORT_SYMBOL(add_taint); 228EXPORT_SYMBOL(add_taint);
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 5f21ab2bbcdf..0854770b63b9 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -22,6 +22,7 @@
22#include <linux/console.h> 22#include <linux/console.h>
23#include <linux/cpu.h> 23#include <linux/cpu.h>
24#include <linux/freezer.h> 24#include <linux/freezer.h>
25#include <scsi/scsi_scan.h>
25#include <asm/suspend.h> 26#include <asm/suspend.h>
26 27
27#include "power.h" 28#include "power.h"
@@ -645,6 +646,13 @@ static int software_resume(void)
645 return 0; 646 return 0;
646 647
647 /* 648 /*
649 * We can't depend on SCSI devices being available after loading one of
650 * their modules if scsi_complete_async_scans() is not called and the
651 * resume device usually is a SCSI one.
652 */
653 scsi_complete_async_scans();
654
655 /*
648 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs 656 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
649 * is configured into the kernel. Since the regular hibernate 657 * is configured into the kernel. Since the regular hibernate
650 * trigger path is via sysfs which takes a buffer mutex before 658 * trigger path is via sysfs which takes a buffer mutex before
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 6c85359364f2..ed97375daae9 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -24,6 +24,7 @@
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> 26#include <linux/smp_lock.h>
27#include <scsi/scsi_scan.h>
27 28
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29 30
@@ -92,6 +93,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
92 filp->private_data = data; 93 filp->private_data = data;
93 memset(&data->handle, 0, sizeof(struct snapshot_handle)); 94 memset(&data->handle, 0, sizeof(struct snapshot_handle));
94 if ((filp->f_flags & O_ACCMODE) == O_RDONLY) { 95 if ((filp->f_flags & O_ACCMODE) == O_RDONLY) {
96 /* Hibernating. The image device should be accessible. */
95 data->swap = swsusp_resume_device ? 97 data->swap = swsusp_resume_device ?
96 swap_type_of(swsusp_resume_device, 0, NULL) : -1; 98 swap_type_of(swsusp_resume_device, 0, NULL) : -1;
97 data->mode = O_RDONLY; 99 data->mode = O_RDONLY;
@@ -99,6 +101,13 @@ static int snapshot_open(struct inode *inode, struct file *filp)
99 if (error) 101 if (error)
100 pm_notifier_call_chain(PM_POST_HIBERNATION); 102 pm_notifier_call_chain(PM_POST_HIBERNATION);
101 } else { 103 } else {
104 /*
105 * Resuming. We may need to wait for the image device to
106 * appear.
107 */
108 wait_for_device_probe();
109 scsi_complete_async_scans();
110
102 data->swap = -1; 111 data->swap = -1;
103 data->mode = O_WRONLY; 112 data->mode = O_WRONLY;
104 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 113 error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 64191fa09b7e..dfcd83ceee3b 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -604,10 +604,11 @@ repeat:
604 ret = security_ptrace_traceme(current->parent); 604 ret = security_ptrace_traceme(current->parent);
605 605
606 /* 606 /*
607 * Set the ptrace bit in the process ptrace flags. 607 * Check PF_EXITING to ensure ->real_parent has not passed
608 * Then link us on our parent's ptraced list. 608 * exit_ptrace(). Otherwise we don't report the error but
609 * pretend ->real_parent untraces us right after return.
609 */ 610 */
610 if (!ret) { 611 if (!ret && !(current->real_parent->flags & PF_EXITING)) {
611 current->ptrace |= PT_PTRACED; 612 current->ptrace |= PT_PTRACED;
612 __ptrace_link(current, current->real_parent); 613 __ptrace_link(current, current->real_parent);
613 } 614 }
diff --git a/kernel/sys.c b/kernel/sys.c
index 51dbb55604e8..e7998cf31498 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -360,6 +360,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
360 void __user *, arg) 360 void __user *, arg)
361{ 361{
362 char buffer[256]; 362 char buffer[256];
363 int ret = 0;
363 364
364 /* We only trust the superuser with rebooting the system. */ 365 /* We only trust the superuser with rebooting the system. */
365 if (!capable(CAP_SYS_BOOT)) 366 if (!capable(CAP_SYS_BOOT))
@@ -397,7 +398,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
397 kernel_halt(); 398 kernel_halt();
398 unlock_kernel(); 399 unlock_kernel();
399 do_exit(0); 400 do_exit(0);
400 break; 401 panic("cannot halt");
401 402
402 case LINUX_REBOOT_CMD_POWER_OFF: 403 case LINUX_REBOOT_CMD_POWER_OFF:
403 kernel_power_off(); 404 kernel_power_off();
@@ -417,29 +418,22 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
417 418
418#ifdef CONFIG_KEXEC 419#ifdef CONFIG_KEXEC
419 case LINUX_REBOOT_CMD_KEXEC: 420 case LINUX_REBOOT_CMD_KEXEC:
420 { 421 ret = kernel_kexec();
421 int ret; 422 break;
422 ret = kernel_kexec();
423 unlock_kernel();
424 return ret;
425 }
426#endif 423#endif
427 424
428#ifdef CONFIG_HIBERNATION 425#ifdef CONFIG_HIBERNATION
429 case LINUX_REBOOT_CMD_SW_SUSPEND: 426 case LINUX_REBOOT_CMD_SW_SUSPEND:
430 { 427 ret = hibernate();
431 int ret = hibernate(); 428 break;
432 unlock_kernel();
433 return ret;
434 }
435#endif 429#endif
436 430
437 default: 431 default:
438 unlock_kernel(); 432 ret = -EINVAL;
439 return -EINVAL; 433 break;
440 } 434 }
441 unlock_kernel(); 435 unlock_kernel();
442 return 0; 436 return ret;
443} 437}
444 438
445static void deferred_cad(struct work_struct *dummy) 439static void deferred_cad(struct work_struct *dummy)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 4286b62b34a0..e3d2c7dd59b9 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -902,16 +902,6 @@ static struct ctl_table kern_table[] = {
902 .proc_handler = &proc_dointvec, 902 .proc_handler = &proc_dointvec,
903 }, 903 },
904#endif 904#endif
905#ifdef CONFIG_UNEVICTABLE_LRU
906 {
907 .ctl_name = CTL_UNNUMBERED,
908 .procname = "scan_unevictable_pages",
909 .data = &scan_unevictable_pages,
910 .maxlen = sizeof(scan_unevictable_pages),
911 .mode = 0644,
912 .proc_handler = &scan_unevictable_handler,
913 },
914#endif
915#ifdef CONFIG_SLOW_WORK 905#ifdef CONFIG_SLOW_WORK
916 { 906 {
917 .ctl_name = CTL_UNNUMBERED, 907 .ctl_name = CTL_UNNUMBERED,
@@ -1302,6 +1292,16 @@ static struct ctl_table vm_table[] = {
1302 .extra2 = &one, 1292 .extra2 = &one,
1303 }, 1293 },
1304#endif 1294#endif
1295#ifdef CONFIG_UNEVICTABLE_LRU
1296 {
1297 .ctl_name = CTL_UNNUMBERED,
1298 .procname = "scan_unevictable_pages",
1299 .data = &scan_unevictable_pages,
1300 .maxlen = sizeof(scan_unevictable_pages),
1301 .mode = 0644,
1302 .proc_handler = &scan_unevictable_handler,
1303 },
1304#endif
1305/* 1305/*
1306 * NOTE: do not add new entries to this table unless you have read 1306 * NOTE: do not add new entries to this table unless you have read
1307 * Documentation/sysctl/ctl_unnumbered.txt 1307 * Documentation/sysctl/ctl_unnumbered.txt
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 2246141bda4d..417d1985e299 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -312,7 +312,7 @@ config KMEMTRACE
312 and profile kernel code. 312 and profile kernel code.
313 313
314 This requires an userspace application to use. See 314 This requires an userspace application to use. See
315 Documentation/vm/kmemtrace.txt for more information. 315 Documentation/trace/kmemtrace.txt for more information.
316 316
317 Saying Y will make the kernel somewhat larger and slower. However, 317 Saying Y will make the kernel somewhat larger and slower. However,
318 if you disable kmemtrace at run-time or boot-time, the performance 318 if you disable kmemtrace at run-time or boot-time, the performance
@@ -403,7 +403,7 @@ config MMIOTRACE
403 implementation and works via page faults. Tracing is disabled by 403 implementation and works via page faults. Tracing is disabled by
404 default and can be enabled at run-time. 404 default and can be enabled at run-time.
405 405
406 See Documentation/tracers/mmiotrace.txt. 406 See Documentation/trace/mmiotrace.txt.
407 If you are not helping to develop drivers, say N. 407 If you are not helping to develop drivers, say N.
408 408
409config MMIOTRACE_TEST 409config MMIOTRACE_TEST
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9d28476a9851..1ce5dc6372b8 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3277,19 +3277,13 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
3277 3277
3278 info->tr = &global_trace; 3278 info->tr = &global_trace;
3279 info->cpu = cpu; 3279 info->cpu = cpu;
3280 info->spare = ring_buffer_alloc_read_page(info->tr->buffer); 3280 info->spare = NULL;
3281 /* Force reading ring buffer for first read */ 3281 /* Force reading ring buffer for first read */
3282 info->read = (unsigned int)-1; 3282 info->read = (unsigned int)-1;
3283 if (!info->spare)
3284 goto out;
3285 3283
3286 filp->private_data = info; 3284 filp->private_data = info;
3287 3285
3288 return 0; 3286 return nonseekable_open(inode, filp);
3289
3290 out:
3291 kfree(info);
3292 return -ENOMEM;
3293} 3287}
3294 3288
3295static ssize_t 3289static ssize_t
@@ -3304,6 +3298,11 @@ tracing_buffers_read(struct file *filp, char __user *ubuf,
3304 if (!count) 3298 if (!count)
3305 return 0; 3299 return 0;
3306 3300
3301 if (!info->spare)
3302 info->spare = ring_buffer_alloc_read_page(info->tr->buffer);
3303 if (!info->spare)
3304 return -ENOMEM;
3305
3307 /* Do we have previous read data to read? */ 3306 /* Do we have previous read data to read? */
3308 if (info->read < PAGE_SIZE) 3307 if (info->read < PAGE_SIZE)
3309 goto read; 3308 goto read;
@@ -3342,7 +3341,8 @@ static int tracing_buffers_release(struct inode *inode, struct file *file)
3342{ 3341{
3343 struct ftrace_buffer_info *info = file->private_data; 3342 struct ftrace_buffer_info *info = file->private_data;
3344 3343
3345 ring_buffer_free_read_page(info->tr->buffer, info->spare); 3344 if (info->spare)
3345 ring_buffer_free_read_page(info->tr->buffer, info->spare);
3346 kfree(info); 3346 kfree(info);
3347 3347
3348 return 0; 3348 return 0;
@@ -3428,14 +3428,19 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
3428 int size, i; 3428 int size, i;
3429 size_t ret; 3429 size_t ret;
3430 3430
3431 /* 3431 if (*ppos & (PAGE_SIZE - 1)) {
3432 * We can't seek on a buffer input 3432 WARN_ONCE(1, "Ftrace: previous read must page-align\n");
3433 */ 3433 return -EINVAL;
3434 if (unlikely(*ppos)) 3434 }
3435 return -ESPIPE;
3436 3435
3436 if (len & (PAGE_SIZE - 1)) {
3437 WARN_ONCE(1, "Ftrace: splice_read should page-align\n");
3438 if (len < PAGE_SIZE)
3439 return -EINVAL;
3440 len &= PAGE_MASK;
3441 }
3437 3442
3438 for (i = 0; i < PIPE_BUFFERS && len; i++, len -= size) { 3443 for (i = 0; i < PIPE_BUFFERS && len; i++, len -= PAGE_SIZE) {
3439 struct page *page; 3444 struct page *page;
3440 int r; 3445 int r;
3441 3446
@@ -3474,6 +3479,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
3474 spd.partial[i].offset = 0; 3479 spd.partial[i].offset = 0;
3475 spd.partial[i].private = (unsigned long)ref; 3480 spd.partial[i].private = (unsigned long)ref;
3476 spd.nr_pages++; 3481 spd.nr_pages++;
3482 *ppos += PAGE_SIZE;
3477 } 3483 }
3478 3484
3479 spd.nr_pages = i; 3485 spd.nr_pages = i;
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 64ec4d278ffb..576f4fa2af0d 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -503,6 +503,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
503 503
504 if (copy_from_user(&buf, ubuf, cnt)) 504 if (copy_from_user(&buf, ubuf, cnt))
505 return -EFAULT; 505 return -EFAULT;
506 buf[cnt] = '\0';
506 507
507 pred = kzalloc(sizeof(*pred), GFP_KERNEL); 508 pred = kzalloc(sizeof(*pred), GFP_KERNEL);
508 if (!pred) 509 if (!pred)
@@ -520,9 +521,10 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
520 return cnt; 521 return cnt;
521 } 522 }
522 523
523 if (filter_add_pred(call, pred)) { 524 err = filter_add_pred(call, pred);
525 if (err < 0) {
524 filter_free_pred(pred); 526 filter_free_pred(pred);
525 return -EINVAL; 527 return err;
526 } 528 }
527 529
528 *ppos += cnt; 530 *ppos += cnt;
@@ -569,6 +571,7 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
569 571
570 if (copy_from_user(&buf, ubuf, cnt)) 572 if (copy_from_user(&buf, ubuf, cnt))
571 return -EFAULT; 573 return -EFAULT;
574 buf[cnt] = '\0';
572 575
573 pred = kzalloc(sizeof(*pred), GFP_KERNEL); 576 pred = kzalloc(sizeof(*pred), GFP_KERNEL);
574 if (!pred) 577 if (!pred)
@@ -586,10 +589,11 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
586 return cnt; 589 return cnt;
587 } 590 }
588 591
589 if (filter_add_subsystem_pred(system, pred)) { 592 err = filter_add_subsystem_pred(system, pred);
593 if (err < 0) {
590 filter_free_subsystem_preds(system); 594 filter_free_subsystem_preds(system);
591 filter_free_pred(pred); 595 filter_free_pred(pred);
592 return -EINVAL; 596 return err;
593 } 597 }
594 598
595 *ppos += cnt; 599 *ppos += cnt;
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 026be412f356..e03cbf1e38f3 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -215,7 +215,7 @@ static int __filter_add_pred(struct ftrace_event_call *call,
215 } 215 }
216 } 216 }
217 217
218 return -ENOMEM; 218 return -ENOSPC;
219} 219}
220 220
221static int is_string_field(const char *type) 221static int is_string_field(const char *type)
@@ -319,7 +319,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system,
319 } 319 }
320 320
321 if (i == MAX_FILTER_PRED) 321 if (i == MAX_FILTER_PRED)
322 return -EINVAL; 322 return -ENOSPC;
323 323
324 events_for_each(call) { 324 events_for_each(call) {
325 int err; 325 int err;
@@ -410,16 +410,22 @@ int filter_parse(char **pbuf, struct filter_pred *pred)
410 } 410 }
411 } 411 }
412 412
413 if (!val_str) {
414 pred->field_name = NULL;
415 return -EINVAL;
416 }
417
413 pred->field_name = kstrdup(pred->field_name, GFP_KERNEL); 418 pred->field_name = kstrdup(pred->field_name, GFP_KERNEL);
414 if (!pred->field_name) 419 if (!pred->field_name)
415 return -ENOMEM; 420 return -ENOMEM;
416 421
417 pred->val = simple_strtoull(val_str, &tmp, 10); 422 pred->val = simple_strtoull(val_str, &tmp, 0);
418 if (tmp == val_str) { 423 if (tmp == val_str) {
419 pred->str_val = kstrdup(val_str, GFP_KERNEL); 424 pred->str_val = kstrdup(val_str, GFP_KERNEL);
420 if (!pred->str_val) 425 if (!pred->str_val)
421 return -ENOMEM; 426 return -ENOMEM;
422 } 427 } else if (*tmp != '\0')
428 return -EINVAL;
423 429
424 return 0; 430 return 0;
425} 431}
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h
index 30743f7d4110..d363c6672c6c 100644
--- a/kernel/trace/trace_events_stage_2.h
+++ b/kernel/trace/trace_events_stage_2.h
@@ -105,10 +105,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
105 return 0; 105 return 0;
106 106
107#undef __entry 107#undef __entry
108#define __entry "REC" 108#define __entry REC
109 109
110#undef TP_printk 110#undef TP_printk
111#define TP_printk(fmt, args...) "%s, %s\n", #fmt, #args 111#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args)
112 112
113#undef TP_fast_assign 113#undef TP_fast_assign
114#define TP_fast_assign(args...) args 114#define TP_fast_assign(args...) args
diff --git a/lib/debug_locks.c b/lib/debug_locks.c
index 0218b4693dd8..bc3b11731b9c 100644
--- a/lib/debug_locks.c
+++ b/lib/debug_locks.c
@@ -36,7 +36,7 @@ int debug_locks_silent;
36 */ 36 */
37int debug_locks_off(void) 37int debug_locks_off(void)
38{ 38{
39 if (xchg(&debug_locks, 0)) { 39 if (__debug_locks_off()) {
40 if (!debug_locks_silent) { 40 if (!debug_locks_silent) {
41 oops_in_progress = 1; 41 oops_in_progress = 1;
42 console_verbose(); 42 console_verbose();
diff --git a/mm/Kconfig b/mm/Kconfig
index b53427ad30a3..57971d2ab848 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -213,6 +213,8 @@ config UNEVICTABLE_LRU
213 will use one page flag and increase the code size a little, 213 will use one page flag and increase the code size a little,
214 say Y unless you know what you are doing. 214 say Y unless you know what you are doing.
215 215
216 See Documentation/vm/unevictable-lru.txt for more information.
217
216config HAVE_MLOCK 218config HAVE_MLOCK
217 bool 219 bool
218 default y if MMU=y 220 default y if MMU=y
diff --git a/mm/filemap.c b/mm/filemap.c
index 2e2d38ebda4b..8bd498040f32 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -567,8 +567,8 @@ EXPORT_SYMBOL(wait_on_page_bit);
567 567
568/** 568/**
569 * add_page_wait_queue - Add an arbitrary waiter to a page's wait queue 569 * add_page_wait_queue - Add an arbitrary waiter to a page's wait queue
570 * @page - Page defining the wait queue of interest 570 * @page: Page defining the wait queue of interest
571 * @waiter - Waiter to add to the queue 571 * @waiter: Waiter to add to the queue
572 * 572 *
573 * Add an arbitrary @waiter to the wait queue for the nominated @page. 573 * Add an arbitrary @waiter to the wait queue for the nominated @page.
574 */ 574 */
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2fc6d6c48238..e44fb0fbb80e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -932,7 +932,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
932 if (unlikely(!mem)) 932 if (unlikely(!mem))
933 return 0; 933 return 0;
934 934
935 VM_BUG_ON(mem_cgroup_is_obsolete(mem)); 935 VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
936 936
937 while (1) { 937 while (1) {
938 int ret; 938 int ret;
diff --git a/mm/shmem.c b/mm/shmem.c
index d94d2e9146bc..f9cb20ebb990 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/vfs.h> 25#include <linux/vfs.h>
26#include <linux/mount.h> 26#include <linux/mount.h>
27#include <linux/pagemap.h>
27#include <linux/file.h> 28#include <linux/file.h>
28#include <linux/mm.h> 29#include <linux/mm.h>
29#include <linux/module.h> 30#include <linux/module.h>
@@ -43,7 +44,6 @@ static struct vfsmount *shm_mnt;
43#include <linux/exportfs.h> 44#include <linux/exportfs.h>
44#include <linux/generic_acl.h> 45#include <linux/generic_acl.h>
45#include <linux/mman.h> 46#include <linux/mman.h>
46#include <linux/pagemap.h>
47#include <linux/string.h> 47#include <linux/string.h>
48#include <linux/slab.h> 48#include <linux/slab.h>
49#include <linux/backing-dev.h> 49#include <linux/backing-dev.h>
@@ -65,13 +65,28 @@ static struct vfsmount *shm_mnt;
65#include <asm/div64.h> 65#include <asm/div64.h>
66#include <asm/pgtable.h> 66#include <asm/pgtable.h>
67 67
68/*
69 * The maximum size of a shmem/tmpfs file is limited by the maximum size of
70 * its triple-indirect swap vector - see illustration at shmem_swp_entry().
71 *
72 * With 4kB page size, maximum file size is just over 2TB on a 32-bit kernel,
73 * but one eighth of that on a 64-bit kernel. With 8kB page size, maximum
74 * file size is just over 4TB on a 64-bit kernel, but 16TB on a 32-bit kernel,
75 * MAX_LFS_FILESIZE being then more restrictive than swap vector layout.
76 *
77 * We use / and * instead of shifts in the definitions below, so that the swap
78 * vector can be tested with small even values (e.g. 20) for ENTRIES_PER_PAGE.
79 */
68#define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long)) 80#define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long))
69#define ENTRIES_PER_PAGEPAGE (ENTRIES_PER_PAGE*ENTRIES_PER_PAGE) 81#define ENTRIES_PER_PAGEPAGE ((unsigned long long)ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
70#define BLOCKS_PER_PAGE (PAGE_CACHE_SIZE/512)
71 82
72#define SHMEM_MAX_INDEX (SHMEM_NR_DIRECT + (ENTRIES_PER_PAGEPAGE/2) * (ENTRIES_PER_PAGE+1)) 83#define SHMSWP_MAX_INDEX (SHMEM_NR_DIRECT + (ENTRIES_PER_PAGEPAGE/2) * (ENTRIES_PER_PAGE+1))
73#define SHMEM_MAX_BYTES ((unsigned long long)SHMEM_MAX_INDEX << PAGE_CACHE_SHIFT) 84#define SHMSWP_MAX_BYTES (SHMSWP_MAX_INDEX << PAGE_CACHE_SHIFT)
74 85
86#define SHMEM_MAX_BYTES min_t(unsigned long long, SHMSWP_MAX_BYTES, MAX_LFS_FILESIZE)
87#define SHMEM_MAX_INDEX ((unsigned long)((SHMEM_MAX_BYTES+1) >> PAGE_CACHE_SHIFT))
88
89#define BLOCKS_PER_PAGE (PAGE_CACHE_SIZE/512)
75#define VM_ACCT(size) (PAGE_CACHE_ALIGN(size) >> PAGE_SHIFT) 90#define VM_ACCT(size) (PAGE_CACHE_ALIGN(size) >> PAGE_SHIFT)
76 91
77/* info->flags needs VM_flags to handle pagein/truncate races efficiently */ 92/* info->flags needs VM_flags to handle pagein/truncate races efficiently */
@@ -2581,7 +2596,7 @@ int shmem_unuse(swp_entry_t entry, struct page *page)
2581#define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev) 2596#define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev)
2582#define shmem_acct_size(flags, size) 0 2597#define shmem_acct_size(flags, size) 0
2583#define shmem_unacct_size(flags, size) do {} while (0) 2598#define shmem_unacct_size(flags, size) do {} while (0)
2584#define SHMEM_MAX_BYTES LLONG_MAX 2599#define SHMEM_MAX_BYTES MAX_LFS_FILESIZE
2585 2600
2586#endif /* CONFIG_SHMEM */ 2601#endif /* CONFIG_SHMEM */
2587 2602
diff --git a/mm/util.c b/mm/util.c
index 2599e83eea17..55bef160b9f1 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -223,6 +223,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
223} 223}
224#endif 224#endif
225 225
226/**
227 * get_user_pages_fast() - pin user pages in memory
228 * @start: starting user address
229 * @nr_pages: number of pages from start to pin
230 * @write: whether pages will be written to
231 * @pages: array that receives pointers to the pages pinned.
232 * Should be at least nr_pages long.
233 *
234 * Attempt to pin user pages in memory without taking mm->mmap_sem.
235 * If not successful, it will fall back to taking the lock and
236 * calling get_user_pages().
237 *
238 * Returns number of pages pinned. This may be fewer than the number
239 * requested. If nr_pages is 0 or negative, returns 0. If no pages
240 * were pinned, returns -errno.
241 */
226int __attribute__((weak)) get_user_pages_fast(unsigned long start, 242int __attribute__((weak)) get_user_pages_fast(unsigned long start,
227 int nr_pages, int write, struct page **pages) 243 int nr_pages, int write, struct page **pages)
228{ 244{
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 612dc13ddd85..095cfc8b9dbf 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -14,6 +14,8 @@ _dst := $(if $(dst),$(dst),$(obj))
14kbuild-file := $(srctree)/$(obj)/Kbuild 14kbuild-file := $(srctree)/$(obj)/Kbuild
15include $(kbuild-file) 15include $(kbuild-file)
16 16
17_dst := $(if $(destination-y),$(destination-y),$(_dst))
18
17include scripts/Kbuild.include 19include scripts/Kbuild.include
18 20
19install := $(INSTALL_HDR_PATH)/$(_dst) 21install := $(INSTALL_HDR_PATH)/$(_dst)
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 3eea8f15131b..76af5f9623e3 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -97,7 +97,7 @@ print_mtime() {
97} 97}
98 98
99list_parse() { 99list_parse() {
100 echo "$1 \\" 100 [ ! -L "$1" ] && echo "$1 \\" || :
101} 101}
102 102
103# for each file print a line in following format 103# for each file print a line in following format
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
new file mode 100755
index 000000000000..60dc0c48c929
--- /dev/null
+++ b/scripts/get_maintainer.pl
@@ -0,0 +1,515 @@
1#!/usr/bin/perl -w
2# (c) 2007, Joe Perches <joe@perches.com>
3# created from checkpatch.pl
4#
5# Print selected MAINTAINERS information for
6# the files modified in a patch or for a file
7#
8# usage: perl scripts/get_maintainers.pl [OPTIONS] <patch>
9# perl scripts/get_maintainers.pl [OPTIONS] -f <file>
10#
11# Licensed under the terms of the GNU GPL License version 2
12
13use strict;
14
15my $P = $0;
16my $V = '0.15';
17
18use Getopt::Long qw(:config no_auto_abbrev);
19
20my $lk_path = "./";
21my $email = 1;
22my $email_usename = 1;
23my $email_maintainer = 1;
24my $email_list = 1;
25my $email_subscriber_list = 0;
26my $email_git = 1;
27my $email_git_penguin_chiefs = 0;
28my $email_git_min_signatures = 1;
29my $email_git_max_maintainers = 5;
30my $email_git_since = "1-year-ago";
31my $output_multiline = 1;
32my $output_separator = ", ";
33my $scm = 0;
34my $web = 0;
35my $subsystem = 0;
36my $status = 0;
37my $from_filename = 0;
38my $version = 0;
39my $help = 0;
40
41my $exit = 0;
42
43my @penguin_chief = ();
44push(@penguin_chief,"Linus Torvalds:torvalds\@linux-foundation.org");
45#Andrew wants in on most everything - 2009/01/14
46#push(@penguin_chief,"Andrew Morton:akpm\@linux-foundation.org");
47
48my @penguin_chief_names = ();
49foreach my $chief (@penguin_chief) {
50 if ($chief =~ m/^(.*):(.*)/) {
51 my $chief_name = $1;
52 my $chief_addr = $2;
53 push(@penguin_chief_names, $chief_name);
54 }
55}
56my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)";
57
58if (!GetOptions(
59 'email!' => \$email,
60 'git!' => \$email_git,
61 'git-chief-penguins!' => \$email_git_penguin_chiefs,
62 'git-min-signatures=i' => \$email_git_min_signatures,
63 'git-max-maintainers=i' => \$email_git_max_maintainers,
64 'git-since=s' => \$email_git_since,
65 'm!' => \$email_maintainer,
66 'n!' => \$email_usename,
67 'l!' => \$email_list,
68 's!' => \$email_subscriber_list,
69 'multiline!' => \$output_multiline,
70 'separator=s' => \$output_separator,
71 'subsystem!' => \$subsystem,
72 'status!' => \$status,
73 'scm!' => \$scm,
74 'web!' => \$web,
75 'f|file' => \$from_filename,
76 'v|version' => \$version,
77 'h|help' => \$help,
78 )) {
79 usage();
80 die "$P: invalid argument\n";
81}
82
83if ($help != 0) {
84 usage();
85 exit 0;
86}
87
88if ($version != 0) {
89 print("${P} ${V}\n");
90 exit 0;
91}
92
93if ($#ARGV < 0) {
94 usage();
95 die "$P: argument missing: patchfile or -f file please\n";
96}
97
98my $selections = $email + $scm + $status + $subsystem + $web;
99if ($selections == 0) {
100 usage();
101 die "$P: Missing required option: email, scm, status, subsystem or web\n";
102}
103
104if ($email && ($email_maintainer + $email_list + $email_subscriber_list
105 + $email_git + $email_git_penguin_chiefs) == 0) {
106 usage();
107 die "$P: Please select at least 1 email option\n";
108}
109
110if (!top_of_kernel_tree($lk_path)) {
111 die "$P: The current directory does not appear to be "
112 . "a linux kernel source tree.\n";
113}
114
115## Read MAINTAINERS for type/value pairs
116
117my @typevalue = ();
118open(MAINT, "<${lk_path}MAINTAINERS") || die "$P: Can't open MAINTAINERS\n";
119while (<MAINT>) {
120 my $line = $_;
121
122 if ($line =~ m/^(\C):\s*(.*)/) {
123 my $type = $1;
124 my $value = $2;
125
126 ##Filename pattern matching
127 if ($type eq "F" || $type eq "X") {
128 $value =~ s@\.@\\\.@g; ##Convert . to \.
129 $value =~ s/\*/\.\*/g; ##Convert * to .*
130 $value =~ s/\?/\./g; ##Convert ? to .
131 }
132 push(@typevalue, "$type:$value");
133 } elsif (!/^(\s)*$/) {
134 $line =~ s/\n$//g;
135 push(@typevalue, $line);
136 }
137}
138close(MAINT);
139
140## use the filenames on the command line or find the filenames in the patchfiles
141
142my @files = ();
143
144foreach my $file (@ARGV) {
145 next if ((-d $file));
146 if (!(-f $file)) {
147 die "$P: file '${file}' not found\n";
148 }
149 if ($from_filename) {
150 push(@files, $file);
151 } else {
152 my $file_cnt = @files;
153 open(PATCH, "<$file") or die "$P: Can't open ${file}\n";
154 while (<PATCH>) {
155 if (m/^\+\+\+\s+(\S+)/) {
156 my $filename = $1;
157 $filename =~ s@^[^/]*/@@;
158 $filename =~ s@\n@@;
159 push(@files, $filename);
160 }
161 }
162 close(PATCH);
163 if ($file_cnt == @files) {
164 die "$P: file '${file}' doesn't appear to be a patch. "
165 . "Add -f to options?\n";
166 }
167 @files = sort_and_uniq(@files);
168 }
169}
170
171my @email_to = ();
172my @scm = ();
173my @web = ();
174my @subsystem = ();
175my @status = ();
176
177# Find responsible parties
178
179foreach my $file (@files) {
180
181#Do not match excluded file patterns
182
183 my $exclude = 0;
184 foreach my $line (@typevalue) {
185 if ($line =~ m/^(\C):(.*)/) {
186 my $type = $1;
187 my $value = $2;
188 if ($type eq 'X') {
189 if (file_match_pattern($file, $value)) {
190 $exclude = 1;
191 }
192 }
193 }
194 }
195
196 if (!$exclude) {
197 my $tvi = 0;
198 foreach my $line (@typevalue) {
199 if ($line =~ m/^(\C):(.*)/) {
200 my $type = $1;
201 my $value = $2;
202 if ($type eq 'F') {
203 if (file_match_pattern($file, $value)) {
204 add_categories($tvi);
205 }
206 }
207 }
208 $tvi++;
209 }
210 }
211
212 if ($email && $email_git) {
213 recent_git_signoffs($file);
214 }
215
216}
217
218if ($email_git_penguin_chiefs) {
219 foreach my $chief (@penguin_chief) {
220 if ($chief =~ m/^(.*):(.*)/) {
221 my $chief_name = $1;
222 my $chief_addr = $2;
223 if ($email_usename) {
224 push(@email_to, format_email($chief_name, $chief_addr));
225 } else {
226 push(@email_to, $chief_addr);
227 }
228 }
229 }
230}
231
232if ($email) {
233 my $address_cnt = @email_to;
234 if ($address_cnt == 0 && $email_list) {
235 push(@email_to, "linux-kernel\@vger.kernel.org");
236 }
237
238#Don't sort email address list, but do remove duplicates
239 @email_to = uniq(@email_to);
240 output(@email_to);
241}
242
243if ($scm) {
244 @scm = sort_and_uniq(@scm);
245 output(@scm);
246}
247
248if ($status) {
249 @status = sort_and_uniq(@status);
250 output(@status);
251}
252
253if ($subsystem) {
254 @subsystem = sort_and_uniq(@subsystem);
255 output(@subsystem);
256}
257
258if ($web) {
259 @web = sort_and_uniq(@web);
260 output(@web);
261}
262
263exit($exit);
264
265sub file_match_pattern {
266 my ($file, $pattern) = @_;
267 if (substr($pattern, -1) eq "/") {
268 if ($file =~ m@^$pattern@) {
269 return 1;
270 }
271 } else {
272 if ($file =~ m@^$pattern@) {
273 my $s1 = ($file =~ tr@/@@);
274 my $s2 = ($pattern =~ tr@/@@);
275 if ($s1 == $s2) {
276 return 1;
277 }
278 }
279 }
280 return 0;
281}
282
283sub usage {
284 print <<EOT;
285usage: $P [options] patchfile
286 $P [options] -f file
287version: $V
288
289MAINTAINER field selection options:
290 --email => print email address(es) if any
291 --git => include recent git \*-by: signers
292 --git-chief-penguins => include ${penguin_chiefs}
293 --git-min-signatures => number of signatures required (default: 1)
294 --git-max-maintainers => maximum maintainers to add (default: 5)
295 --git-since => git history to use (default: 1-year-ago)
296 --m => include maintainer(s) if any
297 --n => include name 'Full Name <addr\@domain.tld>'
298 --l => include list(s) if any
299 --s => include subscriber only list(s) if any
300 --scm => print SCM tree(s) if any
301 --status => print status if any
302 --subsystem => print subsystem name if any
303 --web => print website(s) if any
304
305Output type options:
306 --separator [, ] => separator for multiple entries on 1 line
307 --multiline => print 1 entry per line
308
309Default options:
310 [--email --git --m --l --multiline]
311
312Other options:
313 --version -> show version
314 --help => show this help information
315
316EOT
317}
318
319sub top_of_kernel_tree {
320 my ($lk_path) = @_;
321
322 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
323 $lk_path .= "/";
324 }
325 if ( (-f "${lk_path}COPYING")
326 && (-f "${lk_path}CREDITS")
327 && (-f "${lk_path}Kbuild")
328 && (-f "${lk_path}MAINTAINERS")
329 && (-f "${lk_path}Makefile")
330 && (-f "${lk_path}README")
331 && (-d "${lk_path}Documentation")
332 && (-d "${lk_path}arch")
333 && (-d "${lk_path}include")
334 && (-d "${lk_path}drivers")
335 && (-d "${lk_path}fs")
336 && (-d "${lk_path}init")
337 && (-d "${lk_path}ipc")
338 && (-d "${lk_path}kernel")
339 && (-d "${lk_path}lib")
340 && (-d "${lk_path}scripts")) {
341 return 1;
342 }
343 return 0;
344}
345
346sub format_email {
347 my ($name, $email) = @_;
348
349 $name =~ s/^\s+|\s+$//g;
350 $email =~ s/^\s+|\s+$//g;
351
352 my $formatted_email = "";
353
354 if ($name =~ /[^a-z0-9 \.\-]/i) { ##has "must quote" chars
355 $name =~ s/(?<!\\)"/\\"/g; ##escape quotes
356 $formatted_email = "\"${name}\"\ \<${email}\>";
357 } else {
358 $formatted_email = "${name} \<${email}\>";
359 }
360 return $formatted_email;
361}
362
363sub add_categories {
364 my ($index) = @_;
365
366 $index = $index - 1;
367 while ($index >= 0) {
368 my $tv = $typevalue[$index];
369 if ($tv =~ m/^(\C):(.*)/) {
370 my $ptype = $1;
371 my $pvalue = $2;
372 if ($ptype eq "L") {
373 my $subscr = $pvalue;
374 if ($subscr =~ m/\s*\(subscribers-only\)/) {
375 if ($email_subscriber_list) {
376 $subscr =~ s/\s*\(subscribers-only\)//g;
377 push(@email_to, $subscr);
378 }
379 } else {
380 if ($email_list) {
381 push(@email_to, $pvalue);
382 }
383 }
384 } elsif ($ptype eq "M") {
385 if ($email_maintainer) {
386 if ($index >= 0) {
387 my $tv = $typevalue[$index - 1];
388 if ($tv =~ m/^(\C):(.*)/) {
389 if ($1 eq "P" && $email_usename) {
390 push(@email_to, format_email($2, $pvalue));
391 } else {
392 push(@email_to, $pvalue);
393 }
394 }
395 } else {
396 push(@email_to, $pvalue);
397 }
398 }
399 } elsif ($ptype eq "T") {
400 push(@scm, $pvalue);
401 } elsif ($ptype eq "W") {
402 push(@web, $pvalue);
403 } elsif ($ptype eq "S") {
404 push(@status, $pvalue);
405 }
406
407 $index--;
408 } else {
409 push(@subsystem,$tv);
410 $index = -1;
411 }
412 }
413}
414
415sub which {
416 my ($bin) = @_;
417
418 foreach my $path (split /:/, $ENV{PATH}) {
419 if (-e "$path/$bin") {
420 return "$path/$bin";
421 }
422 }
423
424 return "";
425}
426
427sub recent_git_signoffs {
428 my ($file) = @_;
429
430 my $sign_offs = "";
431 my $cmd = "";
432 my $output = "";
433 my $count = 0;
434 my @lines = ();
435
436 if (which("git") eq "") {
437 die("$P: git not found. Add --nogit to options?\n");
438 }
439
440 $cmd = "git log --since=${email_git_since} -- ${file}";
441 $cmd .= " | grep -Pi \"^[-_ a-z]+by:.*\\\@\"";
442 if (!$email_git_penguin_chiefs) {
443 $cmd .= " | grep -Pv \"${penguin_chiefs}\"";
444 }
445 $cmd .= " | cut -f2- -d\":\"";
446 $cmd .= " | sed -e \"s/^\\s+//g\"";
447 $cmd .= " | sort | uniq -c | sort -rn";
448
449 $output = `${cmd}`;
450 $output =~ s/^\s*//gm;
451
452 @lines = split("\n", $output);
453 foreach my $line (@lines) {
454 if ($line =~ m/([0-9]+)\s+(.*)/) {
455 my $sign_offs = $1;
456 $line = $2;
457 $count++;
458 if ($sign_offs < $email_git_min_signatures ||
459 $count > $email_git_max_maintainers) {
460 last;
461 }
462 } else {
463 die("$P: Unexpected git output: ${line}\n");
464 }
465 if ($line =~ m/(.+)<(.+)>/) {
466 my $git_name = $1;
467 my $git_addr = $2;
468 $git_name =~ tr/^\"//;
469 $git_name =~ tr/^\\s*//;
470 $git_name =~ tr/\"$//;
471 $git_name =~ tr/\\s*$//;
472 if ($email_usename) {
473 push(@email_to, format_email($git_name, $git_addr));
474 } else {
475 push(@email_to, $git_addr);
476 }
477 } elsif ($line =~ m/<(.+)>/) {
478 my $git_addr = $1;
479 push(@email_to, $git_addr);
480 } else {
481 push(@email_to, $line);
482 }
483 }
484 return $output;
485}
486
487sub uniq {
488 my @parms = @_;
489
490 my %saw;
491 @parms = grep(!$saw{$_}++, @parms);
492 return @parms;
493}
494
495sub sort_and_uniq {
496 my @parms = @_;
497
498 my %saw;
499 @parms = sort @parms;
500 @parms = grep(!$saw{$_}++, @parms);
501 return @parms;
502}
503
504sub output {
505 my @parms = @_;
506
507 if ($output_multiline) {
508 foreach my $line (@parms) {
509 print("${line}\n");
510 }
511 } else {
512 print(join($output_separator, @parms));
513 print("\n");
514 }
515}
diff --git a/scripts/headerdep.pl b/scripts/headerdep.pl
index 97399da89ef2..b7f6c560e24d 100755
--- a/scripts/headerdep.pl
+++ b/scripts/headerdep.pl
@@ -19,7 +19,7 @@ my $opt_graph;
19 version => \&version, 19 version => \&version,
20 20
21 all => \$opt_all, 21 all => \$opt_all,
22 I => \@opt_include, 22 "I=s" => \@opt_include,
23 graph => \$opt_graph, 23 graph => \$opt_graph,
24); 24);
25 25
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 6eb72a7f2562..8d9ce22b0fc5 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -43,6 +43,10 @@ static char *escape(const char* text, char *bf, int len)
43 ++text; 43 ++text;
44 goto next; 44 goto next;
45 } 45 }
46 else if (*text == '\\') {
47 *bfp++ = '\\';
48 len--;
49 }
46 *bfp++ = *text++; 50 *bfp++ = *text++;
47next: 51next:
48 --len; 52 --len;
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8cc70612984c..df6e6286a065 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1913,7 +1913,7 @@ static void read_dump(const char *fname, unsigned int kernel)
1913 if (!mod) { 1913 if (!mod) {
1914 if (is_vmlinux(modname)) 1914 if (is_vmlinux(modname))
1915 have_vmlinux = 1; 1915 have_vmlinux = 1;
1916 mod = new_module(NOFAIL(strdup(modname))); 1916 mod = new_module(modname);
1917 mod->skip = 1; 1917 mod->skip = 1;
1918 } 1918 }
1919 s = sym_add_exported(symname, mod, export_no(export)); 1919 s = sym_add_exported(symname, mod, export_no(export));
@@ -1997,7 +1997,7 @@ static void read_markers(const char *fname)
1997 1997
1998 mod = find_module(modname); 1998 mod = find_module(modname);
1999 if (!mod) { 1999 if (!mod) {
2000 mod = new_module(NOFAIL(strdup(modname))); 2000 mod = new_module(modname);
2001 mod->skip = 1; 2001 mod->skip = 1;
2002 } 2002 }
2003 if (is_vmlinux(modname)) { 2003 if (is_vmlinux(modname)) {
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index f1c4b35bc324..47e75b69a2e9 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -21,7 +21,7 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
21 21
22 # Is this git on svn? 22 # Is this git on svn?
23 if git config --get svn-remote.svn.url >/dev/null; then 23 if git config --get svn-remote.svn.url >/dev/null; then
24 printf -- '-svn%s' "`git-svn find-rev $head`" 24 printf -- '-svn%s' "`git svn find-rev $head`"
25 fi 25 fi
26 26
27 # Are there uncommitted changes? 27 # Are there uncommitted changes?
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index a0affd9cfca8..d4d41b3efc7c 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
@@ -1773,7 +1773,7 @@ void tomoyo_load_policy(const char *filename)
1773 envp[2] = NULL; 1773 envp[2] = NULL;
1774 call_usermodehelper(argv[0], argv, envp, 1); 1774 call_usermodehelper(argv[0], argv, envp, 1);
1775 1775
1776 printk(KERN_INFO "TOMOYO: 2.2.0-pre 2009/02/01\n"); 1776 printk(KERN_INFO "TOMOYO: 2.2.0 2009/04/01\n");
1777 printk(KERN_INFO "Mandatory Access Control activated.\n"); 1777 printk(KERN_INFO "Mandatory Access Control activated.\n");
1778 tomoyo_policy_loaded = true; 1778 tomoyo_policy_loaded = true;
1779 { /* Check all profiles currently assigned to domains are defined. */ 1779 { /* Check all profiles currently assigned to domains are defined. */
@@ -1800,7 +1800,7 @@ void tomoyo_load_policy(const char *filename)
1800static int tomoyo_read_version(struct tomoyo_io_buffer *head) 1800static int tomoyo_read_version(struct tomoyo_io_buffer *head)
1801{ 1801{
1802 if (!head->read_eof) { 1802 if (!head->read_eof) {
1803 tomoyo_io_printf(head, "2.2.0-pre"); 1803 tomoyo_io_printf(head, "2.2.0");
1804 head->read_eof = true; 1804 head->read_eof = true;
1805 } 1805 }
1806 return 0; 1806 return 0;
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index e77e6a6de0f2..678f4ff16aa4 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c
index 2f2b449ffd2d..2d6748741a26 100644
--- a/security/tomoyo/domain.c
+++ b/security/tomoyo/domain.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c
index 65f50c1c5ee9..2316da8ec5bc 100644
--- a/security/tomoyo/file.c
+++ b/security/tomoyo/file.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
index 3bbe01a7a4b5..bf8e2b451687 100644
--- a/security/tomoyo/realpath.c
+++ b/security/tomoyo/realpath.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/security/tomoyo/realpath.h b/security/tomoyo/realpath.h
index 7ec9fc9cbc07..78217a37960b 100644
--- a/security/tomoyo/realpath.h
+++ b/security/tomoyo/realpath.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c
index 3eeeae12c4dc..5b481912752a 100644
--- a/security/tomoyo/tomoyo.c
+++ b/security/tomoyo/tomoyo.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/security/tomoyo/tomoyo.h b/security/tomoyo/tomoyo.h
index a0c8f6e0bea4..41c6ebafb9c5 100644
--- a/security/tomoyo/tomoyo.h
+++ b/security/tomoyo/tomoyo.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2005-2009 NTT DATA CORPORATION 6 * Copyright (C) 2005-2009 NTT DATA CORPORATION
7 * 7 *
8 * Version: 2.2.0-pre 2009/02/01 8 * Version: 2.2.0 2009/04/01
9 * 9 *
10 */ 10 */
11 11
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 30829ee920c3..7ba8db5d4c42 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2260,11 +2260,11 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2260 gcap &= ~0x01; 2260 gcap &= ~0x01;
2261 2261
2262 /* allow 64bit DMA address if supported by H/W */ 2262 /* allow 64bit DMA address if supported by H/W */
2263 if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK)) 2263 if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
2264 pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK); 2264 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
2265 else { 2265 else {
2266 pci_set_dma_mask(pci, DMA_32BIT_MASK); 2266 pci_set_dma_mask(pci, DMA_BIT_MASK(32));
2267 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK); 2267 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
2268 } 2268 }
2269 2269
2270 /* read number of streams from GCAP register instead of using 2270 /* read number of streams from GCAP register instead of using